// Replacement of AdminTab by AdminController on modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10334 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2011-11-21 11:06:35 +00:00
parent 9d10de0848
commit 9b6824a825
13 changed files with 66 additions and 46 deletions
+8 -1
View File
@@ -250,7 +250,14 @@ class AdminCartsController extends AdminController
$this->context->cart->save();
if (!count($errors))
{
if (!($qty_upd = $this->context->cart->updateQty($qty, $id_product, (int)$id_product_attribute, (int)$id_customization, 'up')))
if ((int)$qty < 0)
{
$qty = str_replace('-', '', $qty);
$operator = 'down';
}
else
$operator = 'up';
if (!($qty_upd = $this->context->cart->updateQty($qty, $id_product, (int)$id_product_attribute, (int)$id_customization, 0, $operator)))
$errors[] = Tools::displayError('You already have the maximum quantity available for this product.');
}
@@ -1575,7 +1575,7 @@ class AdminProductsControllerCore extends AdminController
{
$this->display = 'list';
if ($id_category = (int)Tools::getValue('id_category'))
AdminTab::$currentIndex .= '&id_category='.$id_category;
AdminController::$currentIndex .= '&id_category='.$id_category;
$this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : null, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : null, 0, null, $this->context->shop->getID(true));
$id_category = Tools::getValue('id_category', 1);
+14 -14
View File
@@ -344,7 +344,7 @@ class BlockCms extends Module
<fieldset>
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('CMS block configuration').'</legend>
<p><a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addBlockCMS"><img src="'._PS_ADMIN_IMG_.'add.gif" alt="" /> '.$this->l('Add a new CMS block').'</a></p>';
<p><a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addBlockCMS"><img src="'._PS_ADMIN_IMG_.'add.gif" alt="" /> '.$this->l('Add a new CMS block').'</a></p>';
$this->_html .= '<div style="width:440px; float:left; margin-right:10px;" ><h3>'.$this->l('List of Left CMS blocks').'</h3>';
if (sizeof($cms_blocks_left))
@@ -370,14 +370,14 @@ class BlockCms extends Module
<td width="30%" class="center">'.(empty($cms_block['block_name']) ? $cms_block['category_name'] : $cms_block['block_name']).'</td>
<td width="30%" class="center">'.$cms_block['category_name'].'</td>
<td class="center pointer dragHandle">
<a'.(($cms_block['position'] == (sizeof($cms_blocks_left) - 1) OR sizeof($cms_blocks_left) == 1) ? ' style="display: none;"' : '').' href="'.AdminTab::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=1&position='.(int)($cms_block['position'] + 1).'&location=0&token='.Tools::getAdminTokenLite('AdminModules').'">
<a'.(($cms_block['position'] == (sizeof($cms_blocks_left) - 1) OR sizeof($cms_blocks_left) == 1) ? ' style="display: none;"' : '').' href="'.AdminController::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=1&position='.(int)($cms_block['position'] + 1).'&location=0&token='.Tools::getAdminTokenLite('AdminModules').'">
<img src="../img/admin/down.gif" alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>
<a'.($cms_block['position'] == 0 ? ' style="display: none;"' : '').' href="'.AdminTab::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=0&position='.(int)($cms_block['position'] - 1).'&location=0&token='.Tools::getAdminTokenLite('AdminModules').'">
<a'.($cms_block['position'] == 0 ? ' style="display: none;"' : '').' href="'.AdminController::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=0&position='.(int)($cms_block['position'] - 1).'&location=0&token='.Tools::getAdminTokenLite('AdminModules').'">
<img src="../img/admin/up.gif" alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a>
</td>
<td width="10%" class="center">
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
</td>
</tr>';
}
@@ -413,14 +413,14 @@ class BlockCms extends Module
<td width="30%" class="center">'.(empty($cms_block['block_name']) ? $cms_block['category_name'] : $cms_block['block_name']).'</td>
<td width="30%" class="center">'.$cms_block['category_name'].'</td>
<td class="center pointer dragHandle">
<a'.(($cms_block['position'] == (sizeof($cms_blocks_right) - 1) OR sizeof($cms_blocks_right) == 1) ? ' style="display: none;"' : '').' href="'.AdminTab::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=1&position='.(int)($cms_block['position'] + 1).'&location=1&token='.Tools::getAdminTokenLite('AdminModules').'">
<a'.(($cms_block['position'] == (sizeof($cms_blocks_right) - 1) OR sizeof($cms_blocks_right) == 1) ? ' style="display: none;"' : '').' href="'.AdminController::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=1&position='.(int)($cms_block['position'] + 1).'&location=1&token='.Tools::getAdminTokenLite('AdminModules').'">
<img src="../img/admin/down.gif" alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>
<a'.($cms_block['position'] == 0 ? ' style="display: none;"' : '').' href="'.AdminTab::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=0&position='.(int)($cms_block['position'] - 1).'&location=1&token='.Tools::getAdminTokenLite('AdminModules').'">
<a'.($cms_block['position'] == 0 ? ' style="display: none;"' : '').' href="'.AdminController::$currentIndex.'&configure=blockcms&id_cms_block='.$cms_block['id_cms_block'].'&way=0&position='.(int)($cms_block['position'] - 1).'&location=1&token='.Tools::getAdminTokenLite('AdminModules').'">
<img src="../img/admin/up.gif" alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a>
</td>
<td width="10%" class="center">
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMS&id_cms_block='.(int)($cms_block['id_cms_block']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
</td>
</tr>';
}
@@ -535,7 +535,7 @@ class BlockCms extends Module
$this->_html .= '<div id="cms_subcategories"></div>
<p class="center">
<input type="submit" class="button" name="submitBlockCMS" value="'.$this->l('Save').'" />
<a class="button" style="position:relative; padding:3px 3px 4px 3px; top:1px" href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">'.$this->l('Cancel').'</a>
<a class="button" style="position:relative; padding:3px 3px 4px 3px; top:1px" href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">'.$this->l('Cancel').'</a>
</p>';
$this->_html .= '
@@ -646,7 +646,7 @@ class BlockCms extends Module
SET `position` = '.((int)Tools::getValue('position')).'
WHERE `id_cms_block` = '.(int)Tools::getValue('id_cms_block'));
}
Tools::redirectAdmin(AdminTab::$currentIndex.'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'));
Tools::redirectAdmin(AdminController::$currentIndex.'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'));
}
private function _postProcess()
@@ -723,9 +723,9 @@ class BlockCms extends Module
VALUES('.(int)$id_cms_block.', '.(int)$cms_properties[1].', '.(int)$cms_properties[0].')');
}
if (Tools::isSubmit('addBlockCMS'))
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addBlockCMSConfirmation');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addBlockCMSConfirmation');
elseif (Tools::isSubmit('editBlockCMS'))
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMSConfirmation');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editBlockCMSConfirmation');
}
elseif (Tools::isSubmit('deleteBlockCMS') AND Tools::getValue('id_cms_block'))
{
@@ -746,7 +746,7 @@ class BlockCms extends Module
DELETE FROM `'._DB_PREFIX_.'cms_block_page`
WHERE `id_cms_block` = '.(int)(Tools::getValue('id_cms_block')));
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMSConfirmation');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteBlockCMSConfirmation');
}
else
$this->_html .= $this->displayError($this->l('Error: you are trying to delete a non-existent block cms'));
+21 -8
View File
@@ -60,6 +60,12 @@ class BlockLink extends Module
PRIMARY KEY(`id_blocklink`))
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
!Db::getInstance()->execute('
CREATE TABLE '._DB_PREFIX_.'blocklink_shop (
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
`id_shop` varchar(255) NOT NULL,
PRIMARY KEY(`id_blocklink`, `id_shop`))
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
!Db::getInstance()->execute('
CREATE TABLE '._DB_PREFIX_.'blocklink_lang (
`id_blocklink` int(2) NOT NULL,
`id_lang` int(2) NOT NULL,
@@ -106,7 +112,9 @@ class BlockLink extends Module
{
$result = array();
/* Get id and url */
if (!$links = Db::getInstance()->executeS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
if (!$links = Db::getInstance()->executeS('SELECT `id_blocklink`, `url`, `new_window`
FROM '._DB_PREFIX_.'blocklink'.
((int)Configuration::get('PS_BLOCKLINK_ORDERWAY') == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
return false;
$i = 0;
foreach ($links AS $link)
@@ -115,7 +123,9 @@ class BlockLink extends Module
$result[$i]['url'] = $link['url'];
$result[$i]['newWindow'] = $link['new_window'];
/* Get multilingual text */
if (!$texts = Db::getInstance()->executeS('SELECT `id_lang`, `text` FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_blocklink`='.(int)($link['id_blocklink'])))
if (!$texts = Db::getInstance()->executeS('SELECT `id_lang`, `text`
FROM '._DB_PREFIX_.'blocklink_lang
WHERE `id_blocklink`='.(int)$link['id_blocklink']))
return false;
foreach ($texts AS $text)
$result[$i]['text_'.$text['id_lang']] = $text['text'];
@@ -127,7 +137,9 @@ class BlockLink extends Module
public function addLink()
{
/* Url registration */
if (!Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = Db::getInstance()->Insert_ID())
if (!Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'blocklink
VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR
!$lastId = Db::getInstance()->Insert_ID())
return false;
/* Multilingual text */
$languages = Language::getLanguages();
@@ -137,7 +149,8 @@ class BlockLink extends Module
foreach ($languages AS $language)
if (!empty($_POST['text_'.$language['id_lang']]))
{
if (!Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
if (!Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang
VALUES ('.(int)$lastId.', '.(int)$language['id_lang'].', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')'))
return false;
}
else
@@ -274,7 +287,7 @@ class BlockLink extends Module
</script>
<fieldset>
<legend><img src="'.$this->_path.'add.png" alt="" title="" /> '.$this->l('Add a new link').'</legend>
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Text:').'</label>
<div class="margin-form">';
foreach ($languages as $language)
@@ -299,7 +312,7 @@ class BlockLink extends Module
</fieldset>
<fieldset class="space">
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->l('Block title').'</legend>
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Block title:').'</label>
<div class="margin-form">';
foreach ($languages as $language)
@@ -318,7 +331,7 @@ class BlockLink extends Module
</fieldset>
<fieldset class="space">
<legend><img src="'.$this->_path.'prefs.gif" alt="" title="" /> '.$this->l('Settings').'</legend>
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Order list:').'</label>
<div class="margin-form">
<select name="orderWay">
@@ -339,7 +352,7 @@ class BlockLink extends Module
{
$this->_html .= '
<script type="text/javascript">
var currentUrl = \''.AdminTab::$currentIndex.'&configure='.$this->name.'\';
var currentUrl = \''.AdminController::$currentIndex.'&configure='.$this->name.'\';
var token=\''.Tools::getValue('token').'\';
var links = new Array();';
foreach ($links AS $link)
+7 -7
View File
@@ -178,7 +178,7 @@ class DateOfDelivery extends Module
INSERT INTO `'._DB_PREFIX_.'dateofdelivery_carrier_rule`(`id_carrier`, `minimal_time`, `maximal_time`, `delivery_saturday`, `delivery_sunday`)
VALUES ('.(int)($carrier->id).', '.(int)(Tools::getValue('minimal_time')).', '.(int)(Tools::getValue('maximal_time')).', '.(int)(Tools::isSubmit('delivery_saturday')).', '.(int)(Tools::isSubmit('delivery_sunday')).')
'))
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmAddCarrierRule');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmAddCarrierRule');
else
$this->_html .= $this->displayError($this->l('An error occurred on adding of carrier rule.'));
}
@@ -189,7 +189,7 @@ class DateOfDelivery extends Module
SET `id_carrier` = '.(int)($carrier->id).', `minimal_time` = '.(int)(Tools::getValue('minimal_time')).', `maximal_time` = '.(int)(Tools::getValue('maximal_time')).', `delivery_saturday` = '.(int)(Tools::isSubmit('delivery_saturday')).', `delivery_sunday` = '.(int)(Tools::isSubmit('delivery_sunday')).'
WHERE `id_carrier_rule` = '.(int)(Tools::getValue('id_carrier_rule'))
))
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmEditCarrierRule');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&confirmEditCarrierRule');
else
$this->_html .= $this->displayError($this->l('An error occurred on updating of carrier rule.'));
}
@@ -218,7 +218,7 @@ class DateOfDelivery extends Module
<fieldset>
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/img/time.png" alt="" /> '.$this->l('Carrier configuration').'</legend>
<p><a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addCarrierRule"><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/img/time_add.png" alt="" /> '.$this->l('Add a new carrier rule').'</a></p>
<p><a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&addCarrierRule"><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/img/time_add.png" alt="" /> '.$this->l('Add a new carrier rule').'</a></p>
<h3>'.$this->l('List of carrier rules').'</h3>';
@@ -261,8 +261,8 @@ class DateOfDelivery extends Module
$this->_html .= '
</td>
<td width="10%" class="center">
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editCarrierRule&id_carrier_rule='.(int)($rule['id_carrier_rule']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteCarrierRule&id_carrier_rule='.(int)($rule['id_carrier_rule']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&editCarrierRule&id_carrier_rule='.(int)($rule['id_carrier_rule']).'" title="'.$this->l('Edit').'"><img src="'._PS_ADMIN_IMG_.'edit.gif" alt="" /></a>
<a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&deleteCarrierRule&id_carrier_rule='.(int)($rule['id_carrier_rule']).'" title="'.$this->l('Delete').'"><img src="'._PS_ADMIN_IMG_.'delete.gif" alt="" /></a>
</td>
</tr>';
}
@@ -277,7 +277,7 @@ class DateOfDelivery extends Module
$this->_html .= '
</fieldset>
<br />
<form method="POST" action="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">
<form method="POST" action="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">
<fieldset style="width:500px;">
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/img/time.png" alt="" /> '.$this->l('More options').'</legend>
@@ -357,7 +357,7 @@ class DateOfDelivery extends Module
</div>
<p class="center"><input type="submit" class="button" name="submitCarrierRule" value="'.$this->l('Save').'" /></p>
<p class="center"><a href="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">'.$this->l('Cancel').'</a></p>
<p class="center"><a href="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'">'.$this->l('Cancel').'</a></p>
';
$this->_html .= '
+1 -1
View File
@@ -105,7 +105,7 @@ class GCheckout extends PaymentModule
Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 0);
if (!$errors)
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure=gcheckout&token='.Tools::safeOutput(Tools::getValue('token')).'&conf=4');
Tools::redirectAdmin(AdminController::$currentIndex.'&configure=gcheckout&token='.Tools::safeOutput(Tools::getValue('token')).'&conf=4');
foreach ($errors as $error)
echo $error;
}
+2 -2
View File
@@ -428,7 +428,7 @@ class Hipay extends PaymentModule
</div>';
}
$link = AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::safeOutput(Tools::getValue('token'));
$link = AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::safeOutput(Tools::getValue('token'));
$form = '
<style>
.hipay_label {float:none;font-weight:normal;padding:0;text-align:left;width:100%;line-height:30px}
@@ -535,7 +535,7 @@ class Hipay extends PaymentModule
<fieldset>
<legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->l('Zones restrictions').'</legend>
'.$this->l('Select the authorized shipping zones').'<br /><br />
<form action="'.AdminTab::$currentIndex.'&configure=hipay&token='.Tools::safeOutput(Tools::getValue('token')).'" method="post">
<form action="'.AdminController::$currentIndex.'&configure=hipay&token='.Tools::safeOutput(Tools::getValue('token')).'" method="post">
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th class="center">'.$this->l('ID').'</th>
+2 -2
View File
@@ -393,7 +393,7 @@ class MailAlerts extends Module
$token = Tools::getValue('token');
$this->_html .= '
<form action="'.AdminTab::$currentIndex.'&token='.$token.'&configure=mailalerts" method="post">
<form action="'.AdminController::$currentIndex.'&token='.$token.'&configure=mailalerts" method="post">
<fieldset class="width3"><legend><img src="'.$this->_path.'logo.gif" />'.$this->l('Customer notification').'</legend>
<label>'.$this->l('Product availability:').' </label>
<div class="margin-form">
@@ -406,7 +406,7 @@ class MailAlerts extends Module
</fieldset>
</form>
<br />
<form action="'.AdminTab::$currentIndex.'&token='.$token.'&configure=mailalerts" method="post">
<form action="'.AdminController::$currentIndex.'&token='.$token.'&configure=mailalerts" method="post">
<fieldset class="width3"><legend><img src="'.$this->_path.'logo.gif" />'.$this->l('Merchant notification').'</legend>
<label>'.$this->l('New order:').' </label>
<div class="margin-form">
+5 -5
View File
@@ -936,7 +936,7 @@ class PayPal extends PaymentModule
if ($response['ACK'] == 'Success')
{
if ($response['PAYMENTSTATUS'] == 'Completed' OR $response['PAYMENTSTATUS'] == 'Reversed' OR ($response['PAYMENTSTATUS'] == 'Pending' AND $response['PENDINGREASON'] == 'authorization'))
Tools::redirectAdmin(AdminTab::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=validationOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
Tools::redirectAdmin(AdminController::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=validationOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
else
$this->_html .= '<p><b>'.$this->l('Status').':</b> '.$response['PAYMENTSTATUS'].' ('.$this->l('Reason:').' '.$response['PENDINGREASON'].')</p>';
}
@@ -954,9 +954,9 @@ class PayPal extends PaymentModule
if ($response['ACK'] == 'Success')
{
if ($response['PAYMENTSTATUS'] == 'Completed')
Tools::redirectAdmin(AdminTab::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
Tools::redirectAdmin(AdminController::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
else
Tools::redirectAdmin(AdminTab::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
Tools::redirectAdmin(AdminController::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=captureError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
}
else
$this->_html .= '<p style="color:red;">'.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')</p>';
@@ -972,9 +972,9 @@ class PayPal extends PaymentModule
if ($response['ACK'] == 'Success')
{
if ($response['REFUNDTRANSACTIONID'] != '')
Tools::redirectAdmin(AdminTab::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
Tools::redirectAdmin(AdminController::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundOk&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
else
Tools::redirectAdmin(AdminTab::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
Tools::redirectAdmin(AdminController::$currentIndex.'&id_order='.(int)(Tools::getValue('id_order')).'&vieworder&paypal=refundError&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id));
}
else
$this->_html .= '<p style="color:red;">'.$this->l('Error from PayPal: ').$response['L_LONGMESSAGE0'].' (#'.$response['L_ERRORCODE0'].')</p>';
+1 -1
View File
@@ -275,7 +275,7 @@ class Secuvad extends Module
'.($secuvad_order['is_fraud'] ? '<br /><b>'.$this->l('Unpaid transmitted:').'</b> '.$this->_getFraudStatusHtml((int)($secuvad_order['is_fraud'])) : '').'
</p>
<form method="POST" action="'.AdminTab::$currentIndex.'&id_order='.Tools::getValue('id_order').'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id).'">
<form method="POST" action="'.AdminController::$currentIndex.'&id_order='.Tools::getValue('id_order').'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id).'">
<p class="center">
<input type="hidden" name="id_secuvad_order" value="'.(int)($params['id_order']).'" />
<input type="submit" class="button" name="send_to_secuvad" value="'.$this->l('Update Secuvad status').'">
+2 -2
View File
@@ -269,7 +269,7 @@ class StatsProduct extends ModuleGraph
<tr>
<td>'.$product['reference'].'</td>
<td>
<a href="'.AdminTab::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'&id_product='.$product['id_product'].'">'.$product['name'].'</a>
<a href="'.AdminController::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'&id_product='.$product['id_product'].'">'.$product['name'].'</a>
</td>
<td>'.$product['quantity'].'</td>
</tr>';
@@ -431,4 +431,4 @@ class StatsProduct extends ModuleGraph
$this->_values[$i][(int)(substr($row['date_add'], 11, 2))] += $row['total'];
}
}
}
}
@@ -173,7 +173,7 @@ class ThemeInstallator extends Module
if (!Tools::isSubmit('cancelExport') AND (Tools::isSubmit('exportTheme') OR Tools::isSubmit('submitExport')))
$this->page = 'exportPage';
$this->_html = '<form action="'.AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::htmlentitiesUTF8(Tools::getValue('token')).'" method="POST" enctype=multipart/form-data>';
$this->_html = '<form action="'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::htmlentitiesUTF8(Tools::getValue('token')).'" method="POST" enctype=multipart/form-data>';
if (Tools::isSubmit('modulesToExport') OR Tools::isSubmit('submitModules'))
$this->to_export = Tools::getValue('modulesToExport');
+1 -1
View File
@@ -117,7 +117,7 @@ class Twenga extends PaymentModule
public function __construct()
{
// Basic vars
$this->current_index = AdminTab::$currentIndex;
$this->current_index = AdminController::$currentIndex;
$this->token = Tools::getValue('token');
$this->name = 'twenga';
$this->tab = 'smart_shopping';