// fix update form.tpl in AdminCarriersController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9872 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-11-03 21:54:05 +00:00
parent 491f946586
commit e5a66e4f95
3 changed files with 60 additions and 316 deletions
+30 -43
View File
@@ -132,6 +132,31 @@ class AdminCarriersControllerCore extends AdminController
public function initList()
{
$this->displayInformation(
'&nbsp;<b>'.$this->l('How to create a new carrier?').'</b>
<br />
<ul>
<li>'.$this->l('Click "Add new".').'<br /></li>
<li>'.$this->l('Fill in the fields and click "Save".').'</li>
<li>'.
$this->l('You need to decide a price range or a weight range for which the new carrier will be available.
Under the "Shipping" tab, click either "Price Ranges" or "Weight Ranges".').'
</li>
<li>'.$this->l('Click "Add new".').'</li>
<li>'.
$this->l('Select the name of the carrier and define the price range or the weight range.
For example the carrier can be made available for a weight range between 0 and 5kgs. Another carrier will have a range between 5 and 10kgs.').'
</li>
<li>'.$this->l('When you are done, click "Save".').'</li>
<li>'.$this->l('Click on the "Shipping" tab.').'</li>
<li>'.
$this->l('You need to choose the fees that will be applied for this carrier.
At the bottom on the page, in the "Fees" section, select the name of the carrier.').'
</li>
<li>'.$this->l('For each zone, enter a price. Click "Save".').'</li>
<li>'.$this->l('You\'re set! The new carrier will be displayed to your customers.').'</li>
</ul>'
);
$this->_select = 'b.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier';
$this->_where = 'AND b.id_lang = '.$this->context->language->id;
@@ -324,7 +349,6 @@ class AdminCarriersControllerCore extends AdminController
),
array(
'type' => 'hidden',
'label' => $this->l('Module:'),
'name' => 'is_module'
),
array(
@@ -357,6 +381,11 @@ class AdminCarriersControllerCore extends AdminController
'class' => 'button'
);
if (!($obj = $this->loadObject(true)))
return;
$this->getFieldsValues($obj);
return parent::initForm();
}
@@ -503,48 +532,6 @@ class AdminCarriersControllerCore extends AdminController
}
}
public function initContent()
{
if (!($obj = $this->loadObject(true)))
return;
if ($this->display != 'edit' && $this->display != 'add')
$this->display = 'list';
$this->getFieldsValues($obj);
parent::initContent();
if ($this->display == 'list')
{
$this->displayInformation(
'&nbsp;<b>'.$this->l('How to create a new carrier?').'</b>
<br />
<ul>
<li>'.$this->l('Click "Add new".').'<br /></li>
<li>'.$this->l('Fill in the fields and click "Save".').'</li>
<li>'.
$this->l('You need to decide a price range or a weight range for which the new carrier will be available.
Under the "Shipping" tab, click either "Price Ranges" or "Weight Ranges".').'
</li>
<li>'.$this->l('Click "Add new".').'</li>
<li>'.
$this->l('Select the name of the carrier and define the price range or the weight range.
For example the carrier can be made available for a weight range between 0 and 5kgs. Another carrier will have a range between 5 and 10kgs.').'
</li>
<li>'.$this->l('When you are done, click "Save".').'</li>
<li>'.$this->l('Click on the "Shipping" tab.').'</li>
<li>'.
$this->l('You need to choose the fees that will be applied for this carrier.
At the bottom on the page, in the "Fees" section, select the name of the carrier.').'
</li>
<li>'.$this->l('For each zone, enter a price. Click "Save".').'</li>
<li>'.$this->l('You\'re set! The new carrier will be displayed to your customers.').'</li>
</ul>'
);
}
}
public function beforeDelete($object)
{
return $object->isUsed();