From 3ba63a170ec385910f2e743c648dd977c5eee135 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 13:25:48 +0200 Subject: Suppression des 'notes' sur les articles, pas utile --- app/controllers/entryController.php | 71 ------------------------------------- 1 file changed, 71 deletions(-) (limited to 'app/controllers/entryController.php') diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index 35f3150ea..9d6d9a944 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -97,75 +97,4 @@ class entryController extends ActionController { } } } - - public function noteAction () { - View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main'))); - - $not_found = false; - $entryDAO = new EntryDAO (); - $catDAO = new CategoryDAO (); - - $id = Request::param ('id'); - if ($id) { - $entry = $entryDAO->searchById ($id); - - if ($entry) { - $feed = $entry->feed (true); - - if (Request::isPost ()) { - $note = htmlspecialchars (Request::param ('note', '')); - $public = Request::param ('public', 'no'); - if ($public == 'yes') { - $public = true; - } else { - $public = false; - } - - $values = array ( - 'annotation' => $note, - 'is_public' => $public, - 'lastUpdate' => time () - ); - - if ($entryDAO->updateEntry ($id, $values)) { - $notif = array ( - 'type' => 'good', - 'content' => Translate::t ('updated') - ); - } else { - $notif = array ( - 'type' => 'bad', - 'content' => Translate::t ('error_occured') - ); - } - Session::_param ('notification', $notif); - Request::forward (array ( - 'c' => 'entry', - 'a' => 'note', - 'params' => array ( - 'id' => $id - ) - ), true); - } - } else { - $not_found = true; - } - } else { - $not_found = true; - } - - if ($not_found) { - Error::error ( - 404, - array ('error' => array (Translate::t ('page_not_found'))) - ); - } else { - $this->view->entry = $entry; - $this->view->cat_aside = $catDAO->listCategories (); - $this->view->nb_favorites = $entryDAO->countFavorites (); - $this->view->nb_total = $entryDAO->count (); - $this->view->get_c = $feed->category (); - $this->view->get_f = $feed->id (); - } - } } -- cgit v1.2.3 From 8cf9ee76504d2eabd969aff1760b4edb59dfb358 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 17:36:42 +0200 Subject: Fix issue #69 : ajout d'une option pour optimiser la BDD + correction bug script actualisation lorsque connexion paramétrée MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actualize_script.php | 1 + app/controllers/entryController.php | 19 +++++++++++++++++++ app/i18n/en.php | 4 ++++ app/i18n/fr.php | 4 ++++ app/models/Entry.php | 6 ++++++ app/views/configure/display.phtml | 11 +++++++++++ 6 files changed, 45 insertions(+) (limited to 'app/controllers/entryController.php') diff --git a/actualize_script.php b/actualize_script.php index 76bbe2e4f..7f72e419e 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -24,4 +24,5 @@ require (APP_PATH . '/App_FrontController.php'); $front_controller = new App_FrontController (); $front_controller->init (); +Session::_param('mail', true); // permet de se passer de la phase de connexion $front_controller->run (); diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index 9d6d9a944..c7e13f471 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -97,4 +97,23 @@ class entryController extends ActionController { } } } + + public function optimizeAction() { + // La table des entrées a tendance à grossir énormément + // Cette action permet d'optimiser cette table permettant de grapiller un peu de place + // Cette fonctionnalité n'est à appeler qu'occasionnellement + $entryDAO = new EntryDAO(); + $entryDAO->optimizeTable(); + + $notif = array ( + 'type' => 'good', + 'content' => Translate::t ('optimization_complete') + ); + Session::_param ('notification', $notif); + + Request::forward(array( + 'c' => 'configure', + 'a' => 'display' + ), true); + } } diff --git a/app/i18n/en.php b/app/i18n/en.php index dbb6b1bfe..e40be045a 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -78,6 +78,8 @@ return array ( 'category_emptied' => 'Category has been emptied', 'feed_deleted' => 'Feed has been deleted', + 'optimization_complete' => 'Optimization complete', + 'your_rss_feeds' => 'Your RSS feeds', 'your_favorites' => 'Your favorites', 'public' => 'Public', @@ -154,6 +156,8 @@ return array ( 'share' => 'Share', 'by_email' => 'By mail', 'on_shaarli' => 'On your Shaarli', + 'optimize_bdd' => 'Optimize database', + 'optimize_todo_sometimes' => 'To do occasionally to reduce size of database', 'article' => 'Article', 'title' => 'Title', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 75a76cc7a..69c7a8ffe 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -78,6 +78,8 @@ return array ( 'category_emptied' => 'La catégorie a été vidée', 'feed_deleted' => 'Le flux a été supprimé', + 'optimization_complete' => 'Optimisation terminée', + 'your_rss_feeds' => 'Vos flux RSS', 'your_favorites' => 'Vos favoris', 'public' => 'Public', @@ -154,6 +156,8 @@ return array ( 'share' => 'Partager', 'by_email' => 'Par mail', 'on_shaarli' => 'Sur votre Shaarli', + 'optimize_bdd' => 'Optimiser la base de données', + 'optimize_todo_sometimes' => 'À faire de temps en temps pour réduire la taille de la BDD', 'article' => 'Article', 'title' => 'Titre', diff --git a/app/models/Entry.php b/app/models/Entry.php index 050407390..6af3178ee 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -509,6 +509,12 @@ class EntryDAO extends Model_pdo { return $res[0]['count']; } + + public function optimizeTable() { + $sql = 'OPTIMIZE TABLE entry'; + $stm = $this->bd->prepare ($sql); + $stm->execute (); + } } class HelperEntry { diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index ea4fecd34..c46a02143 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -121,6 +121,17 @@ + +
+ +
+ + + + +
+
+
-- cgit v1.2.3