From b0561c527707c4c03cb6db9cf7834b7db3d476f8 Mon Sep 17 00:00:00 2001 From: rMalie Date: Thu, 8 Dec 2011 09:25:10 +0000 Subject: [PATCH] // Remove AdminStatsConf controller (conf is already in AdminStatsTab) --- admin-dev/themes/template/stats/engines.tpl | 35 ++++-- .../themes/template/stats_conf/options.tpl | 56 ---------- .../admin/AdminStatsConfController.php | 105 ------------------ controllers/admin/AdminStatsTabController.php | 12 +- install-dev/sql/db_settings_lite.sql | 12 +- 5 files changed, 40 insertions(+), 180 deletions(-) delete mode 100644 admin-dev/themes/template/stats_conf/options.tpl delete mode 100644 controllers/admin/AdminStatsConfController.php diff --git a/admin-dev/themes/template/stats/engines.tpl b/admin-dev/themes/template/stats/engines.tpl index 6d615b2e9..b76fc2619 100644 --- a/admin-dev/themes/template/stats/engines.tpl +++ b/admin-dev/themes/template/stats/engines.tpl @@ -25,26 +25,28 @@ *}
-
+
+ +

{l s='Settings'}

- -

{l s='Settings'}

- -
- {if count($array_graph_engines)} - '; {foreach $array_graph_engines as $k => $value} {/foreach} - + {else} {l s='No graph engine module installed'} {/if} -
-
+
+ +
+ {if count($array_grid_engines)} - {foreach $array_grid_engines as $k => $value} {/foreach} @@ -52,7 +54,16 @@ {else} {l s='No grid engine module installed'} {/if} -
+
+ +
+ + +

diff --git a/admin-dev/themes/template/stats_conf/options.tpl b/admin-dev/themes/template/stats_conf/options.tpl deleted file mode 100644 index 23a37f2e4..000000000 --- a/admin-dev/themes/template/stats_conf/options.tpl +++ /dev/null @@ -1,56 +0,0 @@ -{* -* 2007-2011 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9540 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - -{extends file="helper/options/options.tpl"} - -{block name="start_field_block"} -
- {if $field['type'] == 'selectEngine'} - - -
{$list_engine_description_stats[$field.value]}
- {elseif $field['type'] == 'selectGrid'} - - -
{$list_engine_description_grid[$field.value]}
- {/if} -{/block} - -{block name="end_field_block"}
{/block} \ No newline at end of file diff --git a/controllers/admin/AdminStatsConfController.php b/controllers/admin/AdminStatsConfController.php deleted file mode 100644 index 5ac940f17..000000000 --- a/controllers/admin/AdminStatsConfController.php +++ /dev/null @@ -1,105 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 6844 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -class AdminStatsConfControllerCore extends AdminPreferencesControllerCore -{ - public function __construct() - { - $autoclean_period = array( - array('value' => 'never', 'name' => $this->l('Never')), - array('value' => 'week', 'name' => $this->l('Week')), - array('value' => 'month', 'name' => $this->l('Month')), - array('value' => 'year', 'name' => $this->l('Year')), - ); - - $list_engine_description_stats = array(); - $list_select_stats = array(); - foreach (ModuleGraphEngine::getGraphEngines() as $k => $engine) - { - $list_select_stats[] = array( - 'name' => $engine[0], - 'value' => $k, - ); - $list_engine_description_stats[$k] = $engine[1]; - } - - $list_engine_description_grid = array(); - $list_select_grid = array(); - foreach (ModuleGridEngine::getGridEngines() as $k => $engine) - { - $list_select_grid[] = array( - 'name' => $engine[0], - 'value' => $k, - ); - $list_engine_description_grid[$k] = $engine[1]; - } - - $this->options = array( - 'general' => array( - 'title' => $this->l('General'), - 'icon' => 'tab-preferences', - 'fields' => array( - 'PS_STATS_RENDER' => array( - 'title' => $this->l('Graph engine'), - 'validation' => 'isGenericName', - 'cast' => 'strval', - 'type' => 'selectEngine', - 'list' => $list_select_stats, - 'identifier' => 'value', - 'js' => '$(\'#render_engine_description\').html(engineDescriptions[$(this).val()])' - ), - 'PS_STATS_GRID_RENDER' => array( - 'title' => $this->l('Grid engine'), - 'validation' => 'isGenericName', - 'cast' => 'strval', - 'type' => 'selectGrid', - 'list' => $list_select_grid, - 'identifier' => 'value', - 'js' => '$(\'#render_engine_description\').html(engineDescriptions[$(this).val()])' - ), - 'PS_STATS_OLD_CONNECT_AUTO_CLEAN' => array( - 'title' => $this->l('Auto-clean period'), - 'validation' => 'isGenericName', - 'type' => 'select', - 'list' => $autoclean_period, - 'identifier' => 'value' - ) - ), - 'submit' => array() - ) - ); - - $this->tpl_option_vars = array ( - 'list_engine_description_stats_js' => Tools::jsonEncode($list_engine_description_stats), - 'list_engine_description_stats' => $list_engine_description_stats, - 'list_engine_description_grid_js' => Tools::jsonEncode($list_engine_description_grid), - 'list_engine_description_grid' => $list_engine_description_grid - ); - - parent::__construct(); - } -} diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index a2b614e29..4f8902ffd 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -97,13 +97,22 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor { $tpl = $this->context->smarty->createTemplate('stats/engines.tpl'); + $autoclean_period = array( + 'never' => $this->l('Never'), + 'week' => $this->l('Week'), + 'month' => $this->l('Month'), + 'year' => $this->l('Year'), + ); + $tpl->assign(array( 'current' => self::$currentIndex, 'token' => $this->token, 'graph_engine' => Configuration::get('PS_STATS_RENDER'), 'grid_engine' => Configuration::get('PS_STATS_GRID_RENDER'), + 'auto_clean' => Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'), 'array_graph_engines' => ModuleGraphEngine::getGraphEngines(), - 'array_grid_engines' => ModuleGridEngine::getGridEngines() + 'array_grid_engines' => ModuleGridEngine::getGridEngines(), + 'array_auto_clean' => $autoclean_period, )); return $tpl->fetch(); @@ -223,6 +232,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor self::$currentIndex .= '&module='.Tools::getValue('module'); Configuration::updateValue('PS_STATS_RENDER', Tools::getValue('PS_STATS_RENDER', Configuration::get('PS_STATS_RENDER'))); Configuration::updateValue('PS_STATS_GRID_RENDER', Tools::getValue('PS_STATS_GRID_RENDER', Configuration::get('PS_STATS_GRID_RENDER'))); + Configuration::updateValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Tools::getValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'))); } else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); diff --git a/install-dev/sql/db_settings_lite.sql b/install-dev/sql/db_settings_lite.sql index 223ef963e..f17e75a86 100644 --- a/install-dev/sql/db_settings_lite.sql +++ b/install-dev/sql/db_settings_lite.sql @@ -937,7 +937,7 @@ INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUE (65, 'AdminCarts', 2, 3),(42, 'AdminInvoices', 3, 1),(55, 'AdminDeliverySlip', 3, 2),(47, 'AdminReturn', 3, 3),(49, 'AdminSlip', 3, 4),(59, 'AdminMessages', 3, 5), (13, 'AdminStatuses', 3, 6),(54, 'AdminOrderMessage', 3, 7),(14, 'AdminCartRules', 4, 4),(15, 'AdminCurrencies', 4, 1),(16, 'AdminTaxes', 4, 2), (17, 'AdminCarriers', 5, 1),(46, 'AdminStates', 5, 2),(18, 'AdminCountries', 5, 3),(19, 'AdminZones', 5, 5),(20, 'AdminRangePrice', 5, 6), -(21, 'AdminRangeWeight', 5, 7),(51, 'AdminStatsConf', 6, 1),(61, 'AdminSearchEngines', 6, 2),(62, 'AdminReferrers', 6, 3), +(21, 'AdminRangeWeight', 5, 7),(61, 'AdminSearchEngines', 6, 2),(62, 'AdminReferrers', 6, 3), (22, 'AdminModulesPositions', 7, 4),(30, 'AdminProfiles', 29, 1),(31, 'AdminAccess', 29, 2),(28, 'AdminContacts', 29, 3),(39, 'AdminContact', 8, 1), (38, 'AdminThemes', 8, 2),(56, 'AdminMeta', 8, 3),(27, 'AdminPPreferences', 8, 4),(24, 'AdminEmails', 8, 5),(26, 'AdminImages', 8, 6),(23, 'AdminDb', 8, 7), (48, 'AdminPdf', 3, 8),(44, 'AdminLocalization', 8, 9),(67, 'AdminSearchConf', 8, 10),(32, 'AdminLanguages', 9, 1),(33, 'AdminTranslations', 9, 2), @@ -974,7 +974,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES (1, 27, 'Products'),(1, 28, 'Contacts'),(1, 29, 'Employees'),(1, 30, 'Profiles'),(1, 31, 'Permissions'),(1, 32, 'Languages'),(1, 33, 'Translations'), (1, 34, 'Suppliers'),(1, 35, 'Tabs'),(1, 36, 'Features'),(1, 37, 'Quick Access'),(1, 38, 'Themes'),(1, 39, 'Contact Information'),(1, 40, 'Keyword Typos'), (1, 41, 'CSV Import'),(1, 42, 'Invoices'),(1, 43, 'Search'),(1, 44, 'Localization'),(1, 46, 'States'),(1, 47, 'Merchandise Returns'),(1, 48, 'PDF'), -(1, 49, 'Credit Slips'),(1, 51, 'Settings'),(1, 52, 'Subdomains'),(1, 53, 'DB Backup'),(1, 54, 'Order Messages'), +(1, 49, 'Credit Slips'),(1, 52, 'Subdomains'),(1, 53, 'DB Backup'),(1, 54, 'Order Messages'), (1, 55, 'Delivery Slips'),(1, 56, 'SEO & URLs'),(1, 57, 'CMS'),(1, 58, 'Image Mapping'),(1, 59, 'Customer Messages'),(1, 60, 'Monitoring'), (1, 61, 'Search Engines'),(1, 62, 'Referrers'),(1, 63, 'Groups'),(1, 64, 'Generators'),(1, 65, 'Shopping Carts'),(1, 66, 'Tags'),(1, 67, 'Search'), (1, 68, 'Attachments'),(1, 69, 'Configuration Information'),(1, 70, 'Performance'),(1, 71, 'Customer Service'),(1, 72, 'Webservice'),(1, 73, 'Stock Movement'), @@ -1004,7 +1004,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES (2, 29, 'Employés'),(2, 30, 'Profils'),(2, 31, 'Permissions'),(2, 32, 'Langues'),(2, 33, 'Traductions'),(2, 34, 'Fournisseurs'),(2, 35, 'Onglets'), (2, 36, 'Caractéristiques'),(2, 37, 'Accès rapide'),(2, 38, 'Thèmes'),(2, 39, 'Coordonnées'),(2, 40, 'Alias'),(2, 41, 'Import'),(2, 42, 'Factures'), (2, 43, 'Recherche'),(2, 44, 'Localisation'),(2, 46, 'Etats'),(2, 47, 'Retours produits'),(2, 48, 'PDF'),(2, 49, 'Avoirs'), -(2, 51, 'Configuration'),(2, 52, 'Sous domaines'),(2, 53, 'Sauvegarde BDD'),(2, 54, 'Messages prédéfinis'),(2, 55, 'Bons de livraison'), +(2, 52, 'Sous domaines'),(2, 53, 'Sauvegarde BDD'),(2, 54, 'Messages prédéfinis'),(2, 55, 'Bons de livraison'), (2, 56, 'SEO & URLs'),(2, 57, 'CMS'),(2, 58, 'Scènes'),(2, 59, 'Messages clients'),(2, 60, 'Suivi'),(2, 61, 'Moteurs de recherche'), (2, 62, 'Sites affluents'),(2, 63, 'Groupes'),(2, 64, 'Générateurs'),(2, 65, 'Paniers'),(2, 66, 'Tags'),(2, 67, 'Recherche'), (2, 68, 'Documents joints'),(2, 69, 'Informations'),(2, 70, 'Performances'),(2, 71, 'SAV'),(2, 72, 'Service web'),(2, 73, 'Mouvements de Stock'), @@ -1034,7 +1034,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES (3, 27, 'Productos'),(3, 28, 'Contactos'),(3, 29, 'Empleados'),(3, 30, 'Perfiles'),(3, 31, 'Permisos'),(3, 32, 'Idiomas'),(3, 33, 'Traducciones'), (3, 34, 'Proveedores'),(3, 35, 'Pestañas'),(3, 36, 'Características'),(3, 37, 'Acceso rápido'),(3, 38, 'Temas'),(3, 39, 'Datos'),(3, 40, 'Alias'), (3, 41, 'Importar'),(3, 42, 'Facturas'),(3, 43, 'Búsqueda'),(3, 44, 'Ubicación'),(3, 46, 'Estados'),(3, 47, 'Devolución productos'),(3, 48, 'PDF'), -(3, 49, 'Vales'),(3, 51, 'Configuración'),(3, 52, 'Subcampos'),(3, 53, 'Copia de seguridad'),(3, 54, 'Mensajes de Orden'), +(3, 49, 'Vales'),(3, 52, 'Subcampos'),(3, 53, 'Copia de seguridad'),(3, 54, 'Mensajes de Orden'), (3, 55, 'Albaranes de entrega'),(3, 56, 'SEO & URLs'),(3, 57, 'CMS'),(3, 58, 'Mapeo de la imagen'),(3, 59, 'Mensajes del cliente'),(3, 60, 'Rastreo'), (3, 61, 'Motores de búsqueda'),(3, 62, 'Referido'),(3, 63, 'Grupos'),(3, 64, 'Generadores'),(3, 65, 'Carritos'),(3, 66, 'Etiquetas'),(3, 67, 'Búsqueda'),(3, 68, 'Adjuntos'), (3, 69, 'Informaciones'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'), @@ -1063,7 +1063,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES (4, 27, 'Produkte'),(4, 28, 'Kontakte'),(4, 29, 'Mitarbeiter'),(4, 30, 'Profile'),(4, 31, 'Berechtigungen'),(4, 32, 'Sprachen'),(4, 33, 'Übersetzungen'), (4, 34, 'Zulieferer'),(4, 35, 'Tabs'),(4, 36, 'Funktionen'),(4, 37, 'Schnellzugriff'),(4, 38, 'Themen'),(4, 39, 'Kontaktinformation'),(4, 40, 'Alias'), (4, 41, 'Import'),(4, 42, 'Rechnungen'),(4, 43, 'Suche'),(4, 44, 'Lokalisierung'),(4, 46, 'Staaten'),(4, 47, 'Warenrücksendungen'),(4, 48, 'PDF'), -(4, 49, 'Gutscheine'),(4, 51, 'Einstellungen'),(4, 52, 'Subdomains'),(4, 53, 'DB-Backup'),(4, 54, 'Bestellnachrichten'), +(4, 49, 'Gutscheine'),(4, 52, 'Subdomains'),(4, 53, 'DB-Backup'),(4, 54, 'Bestellnachrichten'), (4, 55, 'Lieferscheine'),(4, 56, 'SEO & URLs'),(4, 57, 'CMS'),(4, 58, 'Image Mapping'),(4, 59, 'Kundennachrichten'),(4, 60, 'Tracking'), (4, 61, 'Suchmaschinen'),(4, 62, 'Referrer'),(4, 63, 'Gruppen'),(4, 64, 'Generatoren'),(4, 65, 'Warenkörbe'),(4, 66, 'Tags'),(4, 67, 'Suche'), (4, 68, 'Anhänge'),(4, 69, 'Konfigurationsinformationen'),(4, 70, 'Leistung'),(4, 71, 'Kundenservice'),(4, 72, 'Webservice'),(4, 73, 'Lagerbewegungen'), @@ -1093,7 +1093,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES (5, 27, 'Prodotti'),(5, 28, 'Contatti'),(5, 29, 'Impiegati'),(5, 30, 'Profili'),(5, 31, 'Permessi'),(5, 32, 'Lingue'),(5, 33, 'Traduzioni'), (5, 34, 'Fornitori'),(5, 35, 'Tab'),(5, 36, 'Caratteristiche'),(5, 37, 'Accesso rapido'),(5, 38, 'Temi'),(5, 39, 'Informazioni di contatto'),(5, 40, 'Alias'), (5, 41, 'Importa'),(5, 42, 'Fatture'),(5, 43, 'Cerca'),(5, 44, 'Localizzazione'),(5, 46, 'Stati'),(5, 47, 'Resi merci'),(5, 48, 'PDF'), -(5, 49, 'Note di credito'),(5, 51, 'Impostazioni'),(5, 52, 'Sottodomini'),(5, 53, 'DB backup'),(5, 54, 'Messaggi ordine'), +(5, 49, 'Note di credito'),(5, 52, 'Sottodomini'),(5, 53, 'DB backup'),(5, 54, 'Messaggi ordine'), (5, 55, 'Note di consegna'),(5, 56, 'SEO & URLs'),(5, 57, 'CMS'),(5, 58, 'Mappatura immagine'),(5, 59, 'Messaggi cliente'),(5, 60, 'Rintracciare'), (5, 61, 'Motori di ricerca'),(5, 62, 'Referenti'),(5, 63, 'Gruppi'),(5, 64, 'Generatori'),(5, 65, 'Carrelli shopping'),(5, 66, 'Tag'),(5, 67, 'Cerca'), (5, 68, 'Allegati'),(5, 69, 'Informazioni di configurazione'),(5, 70, 'Performance'),(5, 71, 'Servizio clienti'),(5, 72, 'Webservice'),(5, 73, 'Movimenti magazzino'),