From 612e8d7680be6d1cfecebcd720e843d3fce3e9bd Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Mon, 14 Nov 2011 10:34:44 +0000 Subject: [PATCH] [+] BO : #PSFV-94 AdminCounty is integrated to AdminTaxRules, thanks to Franck git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10091 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/tabs/AdminCounty.php | 216 --------------------------------- 1 file changed, 216 deletions(-) delete mode 100644 admin-dev/tabs/AdminCounty.php diff --git a/admin-dev/tabs/AdminCounty.php b/admin-dev/tabs/AdminCounty.php deleted file mode 100644 index 712f4a43c..000000000 --- a/admin-dev/tabs/AdminCounty.php +++ /dev/null @@ -1,216 +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 AdminCounty extends AdminTab -{ - public function __construct() - { - $this->table = 'county'; - $this->className = 'County'; - $this->edit = true; - $this->delete = true; - $this->_select = 's.`name` AS state'; - $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)'; - - $this->fieldsDisplay = array( - 'id_county' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'name' => array('title' => $this->l('County'), 'width' => 130, 'filter_key' => 'a!name'), - 'state' => array('title' => $this->l('State'), 'width' => 70, 'filter_key' => 's!name'), - 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active')); - - parent::__construct(); - } - - public function renderJS() - { - return - ''; - } - - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - - $cur_id_country = 0; - $cur_id_state = 0; - if (isset($obj->id_state)) - { - $cur_state = new State($obj->id_state); - if (Validate::isLoadedObject($cur_state)) - { - $cur_id_country = $cur_state->id_country; - $cur_id_state = $cur_state->id; - } - } - - echo $this->renderJS(). - '
- '.($obj->id ? '' : '').' -
'.$this->l('Counties').''; - - if (!isset($obj->id)) - echo '
 '.$this->l('Save this county then you will be able to associate zipcodes').'

'; - - $countries = Country::getCountries($this->context->language->id, true, true); - echo ' -
'; - - - echo ' -
- -
- '; - - echo - ' -
- * -
- -
- id OR $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').'/> - - getFieldValue($obj, 'active') AND $obj->id) ? 'checked="checked" ' : '').'/> - -

'.$this->l('Enabled or disabled').'

-
-
-   - -
'; - - echo '
* '.$this->l('Required field').'
'; - - if (isset($obj->id)) - { - echo ' -
- '.$this->_renderZipCodeForm().'
-
- '.AdminCounty::renderZipCodeList($obj->getZipCodes()).' -
'; - } - - echo ' -
-
'; - } - - - protected function _renderZipCodeForm() - { - return ' -
- Add Zip Codes:
- Add -
-
'; - } - - - public static function renderZipCodeList($zip_codes) - { - $html = ''; - foreach ($zip_codes AS $zip_code) - { - $full_zip_code = $zip_code['from_zip_code']; - if ($zip_code['to_zip_code'] != 0) - $full_zip_code .= '-'.$zip_code['to_zip_code']; - - $html .= '
'.Tools::htmlentitiesUTF8($full_zip_code).'
'; - } - - return $html; - } -} -