diff --git a/admin-dev/tabs/AdminZones.php b/admin-dev/tabs/AdminZones.php deleted file mode 100644 index 4fa3ad8ba..000000000 --- a/admin-dev/tabs/AdminZones.php +++ /dev/null @@ -1,89 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7300 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -include_once(dirname(__FILE__).'/../../classes/AdminTab.php'); - -class AdminZones extends AdminTab -{ - public function __construct() - { - $this->table = 'zone'; - $this->className = 'Zone'; - $this->lang = false; - $this->edit = true; - $this->delete = true; - - $this->fieldsDisplay = array( - 'id_zone' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'name' => array('title' => $this->l('Zone'), 'width' => 150), - 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) - ); - - parent::__construct(); - } - - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - echo ' -
- '.($obj->id ? '' : '').' -
'.$this->l('Zones').' - -
- * - '.$this->l('Allowed characters: letters, spaces and').' (-)  -

'.$this->l('Zone name, e.g., Africa, West Coast, Neighboring Countries').'

-
- -
- id OR Tools::getValue('active', $obj->active)) ? 'checked="checked" ' : '').'/> - - active) AND $obj->id) ? 'checked="checked" ' : '').'/> - -

'.$this->l('Allow or disallow shipping to this zone').'

-
'; - if (Shop::isFeatureActive()) - { - echo '
'; - $this->displayAssoShop('group_shop'); - echo '
'; - } - echo ' -
- -
-
* '.$this->l('Required field').'
-
-
'; - } -} - - diff --git a/controllers/admin/AdminZonesController.php b/controllers/admin/AdminZonesController.php new file mode 100644 index 000000000..f0334b261 --- /dev/null +++ b/controllers/admin/AdminZonesController.php @@ -0,0 +1,95 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7300 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminZonesControllerCore extends AdminController +{ + public function __construct() + { + $this->table = 'zone'; + $this->className = 'Zone'; + $this->lang = false; + + $this->addRowAction('edit'); + $this->addRowAction('delete'); + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + + $this->fieldsDisplay = array( + 'id_zone' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Zone'), 'width' => 'auto'), + 'active' => array('title' => $this->l('Enabled'), 'width' => '70', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) + ); + + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Zones'), + 'image' => '../img/admin/world.gif' + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Name'), + 'name' => 'name', + 'size' => 33, + 'required' => true, + 'p' => $this->l('Zone name, e.g., Africa, West Coast, Neighboring Countries'), + ), + array( + 'type' => 'radio', + 'label' => $this->l('Status:'), + 'name' => 'active', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + 'p' => $this->l('Allow or disallow shipping to this zone') + ), + array( + 'type' => 'asso_shop', + 'name' => '' + ) + ), + 'submit' => array( + 'title' => $this->l(' Save '), + 'class' => 'button' + ) + ); + parent::__construct(); + } +} + +