// Context part 5

This commit is contained in:
tDidierjean
2011-07-13 15:24:38 +00:00
parent cb3f2f7b52
commit b09c76f5b4
89 changed files with 417 additions and 441 deletions
+8 -2
View File
@@ -235,9 +235,15 @@ function recursiveTab($id_tab)
recursiveTab($adminTab['id_parent']); recursiveTab($adminTab['id_parent']);
} }
/**
* Returns a new Tab object
*
* @param string $tab class name
* @return mixed(AdminTab, bool) tab object or false if failed
*/
function checkingTab($tab) function checkingTab($tab)
{ {
global $adminObj, $cookie; global $cookie;
$tab = trim($tab); $tab = trim($tab);
if (!Validate::isTabName($tab)) if (!Validate::isTabName($tab))
@@ -268,7 +274,7 @@ function checkingTab($tab)
echo $adminObj->displayErrors(); echo $adminObj->displayErrors();
return false; return false;
} }
return $row['id_tab']; return $adminObj;
} }
function checkTabRights($id_tab) function checkTabRights($id_tab)
+2 -2
View File
@@ -38,11 +38,11 @@ if (empty($tab) and !sizeof($_POST))
$_POST['token'] = Tools::getAdminTokenLite($tab); $_POST['token'] = Tools::getAdminTokenLite($tab);
} }
if ($id_tab = checkingTab($tab)) if ($adminObj = checkingTab($tab))
{ {
$isoUser = Language::getIsoById(intval($cookie->id_lang)); $isoUser = Language::getIsoById(intval($cookie->id_lang));
$tabs = array(); $tabs = array();
recursiveTab($id_tab); recursiveTab($adminObj->id);
$tabs = array_reverse($tabs); $tabs = array_reverse($tabs);
$bread = ''; $bread = '';
+2 -3
View File
@@ -39,9 +39,11 @@ if (!$cookie->isLoggedBack())
Tools::redirectAdmin('login.php'.(empty($destination) || ($destination == 'index.php?logout') ? '' : '?redirect='.$destination)); Tools::redirectAdmin('login.php'.(empty($destination) || ($destination == 'index.php?logout') ? '' : '?redirect='.$destination));
} }
// Set current index
$currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : ''); $currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : '');
if ($back = Tools::getValue('back')) if ($back = Tools::getValue('back'))
$currentIndex .= '&back='.urlencode($back); $currentIndex .= '&back='.urlencode($back);
AdminTab::$currentIndex = $currentIndex;
/* Server Params */ /* Server Params */
$protocol_link = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; $protocol_link = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://';
@@ -58,9 +60,6 @@ include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php'); include(_PS_TRANSLATIONS_DIR_.$iso.'/fields.php');
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
/* attribute id_lang is often needed, so we create a constant for performance reasons */
define('_USER_ID_LANG_', (int)$cookie->id_lang);
$path = dirname(__FILE__).'/themes/'; $path = dirname(__FILE__).'/themes/';
if (empty($employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css')) if (empty($employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css'))
{ {
+1 -1
View File
@@ -79,7 +79,7 @@ class AdminAccess extends AdminTab
<table class="table" cellspacing="0"> <table class="table" cellspacing="0">
<tr> <tr>
<th '.($currentProfile == (int)_PS_ADMIN_PROFILE_ ? 'colspan="6"' : '').'> <th '.($currentProfile == (int)_PS_ADMIN_PROFILE_ ? 'colspan="6"' : '').'>
<select name="profile" onchange="redirect(\''.Tools::getHttpHost(true, true).$currentIndex.'&token='.$this->token.'&profile=\'+this.options[this.selectedIndex].value)">'; <select name="profile" onchange="redirect(\''.Tools::getHttpHost(true, true).self::$currentIndex.'&token='.$this->token.'&profile=\'+this.options[this.selectedIndex].value)">';
if ($profiles) if ($profiles)
foreach ($profiles AS $profile) foreach ($profiles AS $profile)
echo '<option value="'.(int)$profile['id_profile'].'" '.((int)$profile['id_profile'] == $currentProfile ? 'selected="selected"' : '').'>'.$profile['name'].'</option>'; echo '<option value="'.(int)$profile['id_profile'].'" '.((int)$profile['id_profile'] == $currentProfile ? 'selected="selected"' : '').'>'.$profile['name'].'</option>';
+1 -1
View File
@@ -233,7 +233,7 @@ class AdminAddresses extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.((int)($obj->id) ? '<input type="hidden" name="id_'.$this->table.'" value="'.(int)($obj->id).'" />' : '').' '.((int)($obj->id) ? '<input type="hidden" name="id_'.$this->table.'" value="'.(int)($obj->id).'" />' : '').'
'.(($id_order = (int)(Tools::getValue('id_order'))) ? '<input type="hidden" name="id_order" value="'.(int)($id_order).'" />' : '').' '.(($id_order = (int)(Tools::getValue('id_order'))) ? '<input type="hidden" name="id_order" value="'.(int)($id_order).'" />' : '').'
'.(($address_type = (int)(Tools::getValue('address_type'))) ? '<input type="hidden" name="address_type" value="'.(int)($address_type).'" />' : '').' '.(($address_type = (int)(Tools::getValue('address_type'))) ? '<input type="hidden" name="address_type" value="'.(int)($address_type).'" />' : '').'
+1 -1
View File
@@ -80,7 +80,7 @@ class AdminAliases extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/search.gif" />'.$this->l('Aliases').'</legend> <fieldset><legend><img src="../img/admin/search.gif" />'.$this->l('Aliases').'</legend>
<label>'.$this->l('Alias:').' </label> <label>'.$this->l('Alias:').' </label>
+1 -1
View File
@@ -97,7 +97,7 @@ class AdminAttachments extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/t/AdminAttachments.gif" />'.$this->l('Attachment').'</legend> <fieldset><legend><img src="../img/t/AdminAttachments.gif" />'.$this->l('Attachment').'</legend>
<label>'.$this->l('Filename:').' </label> <label>'.$this->l('Filename:').' </label>
+2 -2
View File
@@ -97,7 +97,7 @@ class AdminAttributeGenerator extends AdminTab
} }
} }
elseif (isset($_POST['back'])) elseif (isset($_POST['back']))
Tools::redirectAdmin($currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct'.'&tabs=3&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct'.'&tabs=3&token='.Tools::getValue('token'));
parent::postProcess(); parent::postProcess();
} }
@@ -274,7 +274,7 @@ class AdminAttributeGenerator extends AdminTab
</div>'; </div>';
echo ' echo '
<script type="text/javascript" src="../js/attributesBack.js"></script> <script type="text/javascript" src="../js/attributesBack.js"></script>
<form enctype="multipart/form-data" method="post" id="generator" action="'.$currentIndex.'&&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&attributegenerator&token='.Tools::getValue('token').'"> <form enctype="multipart/form-data" method="post" id="generator" action="'.self::$currentIndex.'&&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(int)(Tools::getValue('id_category')).'&attributegenerator&token='.Tools::getValue('token').'">
<fieldset style="margin-bottom: 35px;"><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attributes generator').'</legend>'. <fieldset style="margin-bottom: 35px;"><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attributes generator').'</legend>'.
$this->l('Add or modify attributes for product:').' <b>'.$this->product->name[$cookie->id_lang].'</b> $this->l('Add or modify attributes for product:').' <b>'.$this->product->name[$cookie->id_lang].'</b>
<br /><br /> <br /><br />
+2 -2
View File
@@ -63,7 +63,7 @@ class AdminAttributes extends AdminTab
$strAttributesGroups .= '"'.$attribute_group['id_attribute_group'].'" : '.$attribute_group['is_color_group'].','; $strAttributesGroups .= '"'.$attribute_group['id_attribute_group'].'" : '.$attribute_group['is_color_group'].',';
echo $strAttributesGroups.'}; echo $strAttributesGroups.'};
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token ? $token : $this->token).'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token ? $token : $this->token).'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_attribute" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_attribute" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attribute').'</legend> <fieldset><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attribute').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
@@ -141,7 +141,7 @@ class AdminAttributes extends AdminTab
{ {
$object = new $this->className(); $object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box'])) if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box']))
Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token));
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
} }
else else
+10 -10
View File
@@ -56,7 +56,7 @@ class AdminAttributesGroups extends AdminTab
OR isset($_GET['updateattribute']) OR isset($_GET['addattribute'])) OR isset($_GET['updateattribute']) OR isset($_GET['addattribute']))
{ {
$this->adminAttributes->displayForm($this->token); $this->adminAttributes->displayForm($this->token);
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
else else
{ {
@@ -80,7 +80,7 @@ class AdminAttributesGroups extends AdminTab
{ {
$object = new $this->className(); $object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.'Box'])) if ($object->deleteSelection($_POST[$this->table.'Box']))
Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token);
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
} }
else else
@@ -104,8 +104,8 @@ class AdminAttributesGroups extends AdminTab
{ {
global $currentIndex, $cookie; global $currentIndex, $cookie;
echo '<br /><a href="'.$currentIndex.'&add'.$this->table.'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Add attributes group').'</b></a><br /> echo '<br /><a href="'.self::$currentIndex.'&add'.$this->table.'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Add attributes group').'</b></a><br />
<a href="'.$currentIndex.'&addattribute&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add attribute').'</a><br /><br /> <a href="'.self::$currentIndex.'&addattribute&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add attribute').'</a><br /><br />
'.$this->l('Click on the group name to view its attributes. Click again to hide them.').'<br /><br />'; '.$this->l('Click on the group name to view its attributes. Click again to hide them.').'<br /><br />';
if ($this->_list === false) if ($this->_list === false)
Tools::displayError('No elements found'); Tools::displayError('No elements found');
@@ -143,9 +143,9 @@ class AdminAttributesGroups extends AdminTab
.$attribute['name'].' .$attribute['name'].'
</td> </td>
<td class="center"> <td class="center">
<a href="'.$currentIndex.'&id_attribute='.$attribute['id_attribute'].'&updateattribute&token='.$this->token.'"> <a href="'.self::$currentIndex.'&id_attribute='.$attribute['id_attribute'].'&updateattribute&token='.$this->token.'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp; <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp;
<a href="'.$currentIndex.'&id_attribute='.$attribute['id_attribute'].'&deleteattribute&token='.$this->token.'" <a href="'.self::$currentIndex.'&id_attribute='.$attribute['id_attribute'].'&deleteattribute&token='.$this->token.'"
onclick="return confirm(\''.$this->l('Delete attribute', __CLASS__, true, false).' : '.$attribute['name'].'?\');"> onclick="return confirm(\''.$this->l('Delete attribute', __CLASS__, true, false).' : '.$attribute['name'].'?\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
</td> </td>
@@ -154,15 +154,15 @@ class AdminAttributesGroups extends AdminTab
echo ' echo '
</table> </table>
<p><input type="Submit" class="button" name="submitDelattribute" value="'.$this->l('Delete selection').'" <p><input type="Submit" class="button" name="submitDelattribute" value="'.$this->l('Delete selection').'"
onclick="changeFormParam(this.form, \''.$currentIndex.'\', '.$id.'); return confirm(\''.$this->l('Delete selected items?', __CLASS__, true, false).'\');" /></p> onclick="changeFormParam(this.form, \''.self::$currentIndex.'\', '.$id.'); return confirm(\''.$this->l('Delete selected items?', __CLASS__, true, false).'\');" /></p>
</div> </div>
</td>'; </td>';
echo ' echo '
<td style="vertical-align: top; padding: 4px 0 4px 0" class="center"> <td style="vertical-align: top; padding: 4px 0 4px 0" class="center">
<a href="'.$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.$this->token.'"> <a href="'.self::$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.$this->token.'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp; <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp;
<a href="'.$currentIndex.'&id_'.$this->table.'='.$id.'&delete'.$this->table.'&token='.$this->token.'" onclick="return confirm(\''.$this->l('Delete item', __CLASS__, true, false).' : '.$tr['name'].'?\');"> <a href="'.self::$currentIndex.'&id_'.$this->table.'='.$id.'&delete'.$this->table.'&token='.$this->token.'" onclick="return confirm(\''.$this->l('Delete item', __CLASS__, true, false).' : '.$tr['name'].'?\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
</td> </td>
</tr>'; </tr>';
@@ -180,7 +180,7 @@ class AdminAttributesGroups extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attributes group').'</legend> <fieldset><legend><img src="../img/admin/asterisk.gif" />'.$this->l('Attributes group').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+2 -2
View File
@@ -122,7 +122,7 @@ class AdminBackup extends AdminTab
echo '<br />'.$this->l('Back-up file should automatically download.'); echo '<br />'.$this->l('Back-up file should automatically download.');
echo '<br /><br />'.$this->l('If not,').' <b><a href="'.$url.'">'.$this->l('please click here!').'</a></b>'; echo '<br /><br />'.$this->l('If not,').' <b><a href="'.$url.'">'.$this->l('please click here!').'</a></b>';
echo '<iframe width="0" height="0" scrolling="no" frameborder="0" src="'.$url.'"></iframe>'; echo '<iframe width="0" height="0" scrolling="no" frameborder="0" src="'.$url.'"></iframe>';
echo '<br /><br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
elseif ($object->error) elseif ($object->error)
$this->_errors[] = $object->error; $this->_errors[] = $object->error;
@@ -150,7 +150,7 @@ class AdminBackup extends AdminTab
if ($showForm) if ($showForm)
echo ' echo '
<form action="'.$currentIndex.'&add'.$this->table.'&token='.$this->token.'" method="post" style="text-align: center;"> <form action="'.self::$currentIndex.'&add'.$this->table.'&token='.$this->token.'" method="post" style="text-align: center;">
<input type="submit" class="button" value="'.$this->l('I read the disclaimer - Create a new Backup').'" style="padding: 10px; font-weight: bold; border: 1px solid;" /> <input type="submit" class="button" value="'.$this->l('I read the disclaimer - Create a new Backup').'" style="padding: 10px; font-weight: bold; border: 1px solid;" />
</form>'; </form>';
+8 -8
View File
@@ -83,7 +83,7 @@ class AdminCMS extends AdminTab
$divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite'; $divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.Tools::getAdminTokenLite('AdminCMSContent').'" method="post" name="cms" id="cms"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.Tools::getAdminTokenLite('AdminCMSContent').'" method="post" name="cms" id="cms">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
'.$this->_displayDraftWarning($obj->active).' '.$this->_displayDraftWarning($obj->active).'
<fieldset><legend><img src="../img/admin/cms.gif" />'.$this->l('CMS page').'</legend>'; <fieldset><legend><img src="../img/admin/cms.gif" />'.$this->l('CMS page').'</legend>';
@@ -194,7 +194,7 @@ class AdminCMS extends AdminTab
$id_cms_category = 1; $id_cms_category = 1;
echo '<h3>'.(!$this->_listTotal ? ($this->l('No pages found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('pages') : $this->l('page')))).' '. echo '<h3>'.(!$this->_listTotal ? ($this->l('No pages found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('pages') : $this->l('page')))).' '.
$this->l('in category').' "'.stripslashes(CMSCategory::hideCMSCategoryPosition($this->_category->getName())).'"</h3>'; $this->l('in category').' "'.stripslashes(CMSCategory::hideCMSCategoryPosition($this->_category->getName())).'"</h3>';
echo '<a href="'.$currentIndex.'&id_cms_category='.$id_cms_category.'&add'.$this->table.'&token='.Tools::getAdminTokenLite('AdminCMSContent').'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new page').'</a> echo '<a href="'.self::$currentIndex.'&id_cms_category='.$id_cms_category.'&add'.$this->table.'&token='.Tools::getAdminTokenLite('AdminCMSContent').'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new page').'</a>
<div style="margin:10px;">'; <div style="margin:10px;">';
$this->displayList($token); $this->displayList($token);
echo '</div>'; echo '</div>';
@@ -243,7 +243,7 @@ class AdminCMS extends AdminTab
if (!$cms->delete()) if (!$cms->delete())
$this->_errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.' ('.mysql_error().')</b>'; $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.' ('.mysql_error().')</b>';
else else
Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCMSContent')); Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCMSContent'));
}/* Delete multiple objects */ }/* Delete multiple objects */
elseif (Tools::getValue('submitDel'.$this->table)) elseif (Tools::getValue('submitDel'.$this->table))
{ {
@@ -257,7 +257,7 @@ class AdminCMS extends AdminTab
if ($result) if ($result)
{ {
$cms->cleanPositions((int)(Tools::getValue('id_cms_category'))); $cms->cleanPositions((int)(Tools::getValue('id_cms_category')));
Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category'))); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category')));
} }
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
@@ -294,7 +294,7 @@ class AdminCMS extends AdminTab
Tools::redirectAdmin($preview_url); Tools::redirectAdmin($preview_url);
} }
else else
Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=3&token='.Tools::getAdminTokenLite('AdminCMSContent')); Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=3&token='.Tools::getAdminTokenLite('AdminCMSContent'));
} }
else else
{ {
@@ -316,7 +316,7 @@ class AdminCMS extends AdminTab
Tools::redirectAdmin($preview_url); Tools::redirectAdmin($preview_url);
} }
else else
Tools::redirectAdmin($currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCMSContent')); Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCMSContent'));
} }
} }
} }
@@ -329,7 +329,7 @@ class AdminCMS extends AdminTab
elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
$this->_errors[] = Tools::displayError('Failed to update the position.'); $this->_errors[] = Tools::displayError('Failed to update the position.');
else else
Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4'.(($id_category = (int)(Tools::getValue('id_cms_category'))) ? ('&id_cms_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent')); Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4'.(($id_category = (int)(Tools::getValue('id_cms_category'))) ? ('&id_cms_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent'));
} }
/* Change object statuts (active, inactive) */ /* Change object statuts (active, inactive) */
elseif (Tools::isSubmit('status') AND Tools::isSubmit($this->identifier)) elseif (Tools::isSubmit('status') AND Tools::isSubmit($this->identifier))
@@ -339,7 +339,7 @@ class AdminCMS extends AdminTab
if (Validate::isLoadedObject($object = $this->loadObject())) if (Validate::isLoadedObject($object = $this->loadObject()))
{ {
if ($object->toggleStatus()) if ($object->toggleStatus())
Tools::redirectAdmin($currentIndex.'&conf=5'.((int)Tools::getValue('id_cms_category') ? '&id_cms_category='.(int)Tools::getValue('id_cms_category') : '').'&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((int)Tools::getValue('id_cms_category') ? '&id_cms_category='.(int)Tools::getValue('id_cms_category') : '').'&token='.Tools::getValue('token'));
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
} }
+6 -6
View File
@@ -116,7 +116,7 @@ class AdminCMSCategories extends AdminTab
if (Validate::isLoadedObject($object = $this->loadObject())) if (Validate::isLoadedObject($object = $this->loadObject()))
{ {
if ($object->toggleStatus()) if ($object->toggleStatus())
Tools::redirectAdmin($currentIndex.'&conf=5'.((int)$object->id_parent ? '&id_cms_category='.(int)$object->id_parent : '').'&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((int)$object->id_parent ? '&id_cms_category='.(int)$object->id_parent : '').'&token='.Tools::getValue('token'));
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
} }
@@ -143,10 +143,10 @@ class AdminCMSCategories extends AdminTab
{ {
$object->deleted = 1; $object->deleted = 1;
if ($object->update()) if ($object->update())
Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token'));
} }
elseif ($object->delete()) elseif ($object->delete())
Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token'));
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
} }
@@ -165,7 +165,7 @@ class AdminCMSCategories extends AdminTab
elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) elseif (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
$this->_errors[] = Tools::displayError('Failed to update the position.'); $this->_errors[] = Tools::displayError('Failed to update the position.');
else else
Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_cms_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent')); Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_cms_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCMSContent'));
} }
/* Delete multiple objects */ /* Delete multiple objects */
elseif (Tools::getValue('submitDel'.$this->table)) elseif (Tools::getValue('submitDel'.$this->table))
@@ -180,7 +180,7 @@ class AdminCMSCategories extends AdminTab
if ($result) if ($result)
{ {
$cms_category->cleanPositions((int)(Tools::getValue('id_cms_category'))); $cms_category->cleanPositions((int)(Tools::getValue('id_cms_category')));
Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category'))); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCMSContent').'&id_category='.(int)(Tools::getValue('id_cms_category')));
} }
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
@@ -204,7 +204,7 @@ class AdminCMSCategories extends AdminTab
$active = $this->getFieldValue($obj, 'active'); $active = $this->getFieldValue($obj, 'active');
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token!=NULL ? $token : $this->token).'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token!=NULL ? $token : $this->token).'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset style="width:520px"><legend><img src="../img/admin/tab-categories.gif" />'.$this->l('CMS Category').'</legend> <fieldset style="width:520px"><legend><img src="../img/admin/tab-categories.gif" />'.$this->l('CMS Category').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+2 -2
View File
@@ -96,13 +96,13 @@ class AdminCMSContent extends AdminTab
if (((Tools::isSubmit('submitAddcms_category') OR Tools::isSubmit('submitAddcms_categoryAndStay')) AND sizeof($this->adminCMSCategories->_errors)) OR isset($_GET['updatecms_category']) OR isset($_GET['addcms_category'])) if (((Tools::isSubmit('submitAddcms_category') OR Tools::isSubmit('submitAddcms_categoryAndStay')) AND sizeof($this->adminCMSCategories->_errors)) OR isset($_GET['updatecms_category']) OR isset($_GET['addcms_category']))
{ {
$this->adminCMSCategories->displayForm($this->token); $this->adminCMSCategories->displayForm($this->token);
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
elseif (((Tools::isSubmit('submitAddcms') OR Tools::isSubmit('submitAddcmsAndStay')) AND sizeof($this->adminCMS->_errors)) OR isset($_GET['updatecms']) OR isset($_GET['addcms'])) elseif (((Tools::isSubmit('submitAddcms') OR Tools::isSubmit('submitAddcmsAndStay')) AND sizeof($this->adminCMS->_errors)) OR isset($_GET['updatecms']) OR isset($_GET['addcms']))
{ {
$this->adminCMS->displayForm($this->token); $this->adminCMS->displayForm($this->token);
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
else else
+3 -3
View File
@@ -99,7 +99,7 @@ class AdminCarriers extends AdminTab
}); });
}); });
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/delivery.gif" />'.$this->l('Carriers').'</legend> <fieldset><legend><img src="../img/admin/delivery.gif" />'.$this->l('Carriers').'</legend>
<label>'.$this->l('Company:').' </label> <label>'.$this->l('Company:').' </label>
@@ -309,7 +309,7 @@ class AdminCarriers extends AdminTab
elseif ($this->postImage($objectNew->id)) elseif ($this->postImage($objectNew->id))
{ {
$this->changeZones($objectNew->id); $this->changeZones($objectNew->id);
Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token);
} }
} }
else else
@@ -332,7 +332,7 @@ class AdminCarriers extends AdminTab
{ {
$this->changeZones($object->id); $this->changeZones($object->id);
$this->changeGroups($object->id); $this->changeGroups($object->id);
Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token);
} }
} }
else else
+1 -1
View File
@@ -336,7 +336,7 @@ class AdminCarts extends AdminTab
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false).$id.' ?)'; $_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false).$id.' ?)';
echo ' echo '
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].'\');"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].'\');">
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a> <img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>
'; ';
} }
+1 -1
View File
@@ -141,7 +141,7 @@ class AdminCatalog extends AdminTab
if (((Tools::isSubmit('submitAddcategory') OR Tools::isSubmit('submitAddcategoryAndStay')) AND sizeof($this->adminCategories->_errors)) OR isset($_GET['updatecategory']) OR isset($_GET['addcategory'])) if (((Tools::isSubmit('submitAddcategory') OR Tools::isSubmit('submitAddcategoryAndStay')) AND sizeof($this->adminCategories->_errors)) OR isset($_GET['updatecategory']) OR isset($_GET['addcategory']))
{ {
$this->adminCategories->displayForm($this->token); $this->adminCategories->displayForm($this->token);
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
elseif (((Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndPreview') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitSpecificPricePriorities') OR Tools::isSubmit('submitPriceAddition') OR Tools::isSubmit('submitPricesModification')) AND sizeof($this->adminProducts->_errors)) OR Tools::isSubmit('updateproduct') OR Tools::isSubmit('addproduct')) elseif (((Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndPreview') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitSpecificPricePriorities') OR Tools::isSubmit('submitPriceAddition') OR Tools::isSubmit('submitPricesModification')) AND sizeof($this->adminProducts->_errors)) OR Tools::isSubmit('updateproduct') OR Tools::isSubmit('addproduct'))
{ {
+6 -6
View File
@@ -119,7 +119,7 @@ class AdminCategories extends AdminTab
$target = '&id_category='.(int)($matches[1]); $target = '&id_category='.(int)($matches[1]);
} }
Module::hookExec('categoryUpdate'); Module::hookExec('categoryUpdate');
Tools::redirectAdmin($this->currentIndex.'&conf=5'.$target.'&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.$target.'&token='.Tools::getValue('token'));
} }
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
@@ -147,10 +147,10 @@ class AdminCategories extends AdminTab
$object->deleteImage(); $object->deleteImage();
$object->deleted = 1; $object->deleted = 1;
if ($object->update()) if ($object->update())
Tools::redirectAdmin($this->currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent)); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
} }
elseif ($object->delete()) elseif ($object->delete())
Tools::redirectAdmin($this->currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent)); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
} }
@@ -169,7 +169,7 @@ class AdminCategories extends AdminTab
if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
$this->_errors[] = Tools::displayError('Failed to update the position.'); $this->_errors[] = Tools::displayError('Failed to update the position.');
else else
Tools::redirectAdmin($this->currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog')); Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog'));
} }
/* Delete multiple objects */ /* Delete multiple objects */
elseif (Tools::getValue('submitDel'.$this->table)) elseif (Tools::getValue('submitDel'.$this->table))
@@ -184,7 +184,7 @@ class AdminCategories extends AdminTab
if ($result) if ($result)
{ {
$category->cleanPositions((int)(Tools::getValue('id_category'))); $category->cleanPositions((int)(Tools::getValue('id_category')));
Tools::redirectAdmin($this->currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCatalog').'&id_category='.(int)(Tools::getValue('id_category'))); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCatalog').'&id_category='.(int)(Tools::getValue('id_category')));
} }
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
@@ -226,7 +226,7 @@ class AdminCategories extends AdminTab
$id_category = (int)Tools::getValue('id_parent'); $id_category = (int)Tools::getValue('id_parent');
echo ' echo '
<form action="'.$this->currentIndex.'&submitAdd'.$this->table.'=1&token='.($token!=NULL ? $token : $this->token).'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token!=NULL ? $token : $this->token).'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab-categories.gif" />'.$this->l('Category').'</legend> <fieldset><legend><img src="../img/admin/tab-categories.gif" />'.$this->l('Category').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+1 -1
View File
@@ -65,7 +65,7 @@ class AdminContacts extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/contact.gif" />'.$this->l('Contacts').'</legend> <fieldset><legend><img src="../img/admin/contact.gif" />'.$this->l('Contacts').'</legend>
<label>'.$this->l('Title:').' </label> <label>'.$this->l('Title:').' </label>
+1 -1
View File
@@ -216,7 +216,7 @@ class AdminCountries extends AdminTab
} }
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Countries').'</legend> <fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Countries').'</legend>
<label>'.$this->l('Country:').' </label> <label>'.$this->l('Country:').' </label>
+1 -1
View File
@@ -127,7 +127,7 @@ class AdminCounty extends AdminTab
} }
echo $this->renderJS(). echo $this->renderJS().
'<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> '<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" id="id_county" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" id="id_county" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Counties').'</legend>'; <fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Counties').'</legend>';
+6 -6
View File
@@ -76,7 +76,7 @@ class AdminCurrencies extends AdminTab
if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT')) if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT'))
$this->_errors[] = $this->l('You can\'t delete the default currency'); $this->_errors[] = $this->l('You can\'t delete the default currency');
elseif ($object->delete()) elseif ($object->delete())
Tools::redirectAdmin($currentIndex.'&conf=1'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=1'.'&token='.$this->token);
else else
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
@@ -95,7 +95,7 @@ class AdminCurrencies extends AdminTab
if ($object->active AND $object->id == Configuration::get('PS_CURRENCY_DEFAULT')) if ($object->active AND $object->id == Configuration::get('PS_CURRENCY_DEFAULT'))
$this->_errors[] = $this->l('You can\'t disable the default currency'); $this->_errors[] = $this->l('You can\'t disable the default currency');
elseif ($object->toggleStatus()) elseif ($object->toggleStatus())
Tools::redirectAdmin($currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$this->token);
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
} }
@@ -113,12 +113,12 @@ class AdminCurrencies extends AdminTab
if ($key == 'PS_CURRENCY_DEFAULT') if ($key == 'PS_CURRENCY_DEFAULT')
Currency::refreshCurrencies(); Currency::refreshCurrencies();
} }
Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
elseif (Tools::isSubmit('submitExchangesRates')) elseif (Tools::isSubmit('submitExchangesRates'))
{ {
if (!$this->_errors[] = Currency::refreshCurrencies()) if (!$this->_errors[] = Currency::refreshCurrencies())
Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
else else
parent::postProcess(); parent::postProcess();
@@ -130,7 +130,7 @@ class AdminCurrencies extends AdminTab
parent::displayOptionsList(); parent::displayOptionsList();
echo '<br /><br /> echo '<br /><br />
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset> <fieldset>
<legend><img src="../img/admin/exchangesrate.gif" />'.$this->l('Currency rates').'</legend> <legend><img src="../img/admin/exchangesrate.gif" />'.$this->l('Currency rates').'</legend>
<label>'.$this->l('Update currency rates').'</label> <label>'.$this->l('Update currency rates').'</label>
@@ -153,7 +153,7 @@ class AdminCurrencies extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/money.gif" />'.$this->l('Currencies').'</legend> <fieldset><legend><img src="../img/admin/money.gif" />'.$this->l('Currencies').'</legend>
<label>'.$this->l('Currency:').' </label> <label>'.$this->l('Currency:').' </label>
+9 -9
View File
@@ -177,7 +177,7 @@ class AdminCustomerThreads extends AdminTab
Mail::Send($ct->id_lang, 'reply_msg', Mail::l('An answer to your message is available'), $params, Tools::getValue('msg_email'), NULL, NULL, NULL, $fileAttachment); Mail::Send($ct->id_lang, 'reply_msg', Mail::l('An answer to your message is available'), $params, Tools::getValue('msg_email'), NULL, NULL, NULL, $fileAttachment);
$ct->status = 'closed'; $ct->status = 'closed';
$ct->update(); $ct->update();
Tools::redirectAdmin($currentIndex.'&id_customer_thread='.(int)$id_customer_thread.'&viewcustomer_thread&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&id_customer_thread='.(int)$id_customer_thread.'&viewcustomer_thread&token='.Tools::getValue('token'));
} }
else else
$this->_errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.'); $this->_errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.');
@@ -241,7 +241,7 @@ class AdminCustomerThreads extends AdminTab
<h3 style="overflow:hidden;line-height:25px;color:#812143;height:25px;margin:0;">&nbsp;'.$val['name'].'</h3>'. <h3 style="overflow:hidden;line-height:25px;color:#812143;height:25px;margin:0;">&nbsp;'.$val['name'].'</h3>'.
($dim > 6 ? '' : '<p style="overflow:hidden;line-height:15px;height:45px;margin:0;padding:0 5px;">'.$val['description'].'</p>'). ($dim > 6 ? '' : '<p style="overflow:hidden;line-height:15px;height:45px;margin:0;padding:0 5px;">'.$val['description'].'</p>').
($totalThread == 0 ? '<h3 style="padding:0 5px;margin:0;height:23px;line-height:23px;background-color:#DEDEDE">'.$this->l('No new message').'</h3>' ($totalThread == 0 ? '<h3 style="padding:0 5px;margin:0;height:23px;line-height:23px;background-color:#DEDEDE">'.$this->l('No new message').'</h3>'
: '<a href="'.$currentIndex.'&token='.Tools::getValue('token').'&id_customer_thread='.$id_customer_thread.'&viewcustomer_thread" style="padding:0 5px;display:block;height:23px;line-height:23px;border:0;" class="button">'.$totalThread.' '.($totalThread > 1 ? $this->l('new messages'): $this->l('new message')).'</a>').' : '<a href="'.self::$currentIndex.'&token='.Tools::getValue('token').'&id_customer_thread='.$id_customer_thread.'&viewcustomer_thread" style="padding:0 5px;display:block;height:23px;line-height:23px;border:0;" class="button">'.$totalThread.' '.($totalThread > 1 ? $this->l('new messages'): $this->l('new message')).'</a>').'
</div>'; </div>';
} }
echo '</div>'; echo '</div>';
@@ -349,7 +349,7 @@ class AdminCustomerThreads extends AdminTab
else else
{ {
$output = '<div style="font-size:11px"> $output = '<div style="font-size:11px">
'.($id_employee ? '<a href="'.Tools::getHttpHost(true).$currentIndex.'&token='.Tools::getAdminToken('AdminCustomerThreads'.(int)(Tab::getIdFromClassName('AdminCustomerThreads')).(int)($id_employee)).'&id_customer_thread='.(int)$message['id_customer_thread'].'&viewcustomer_thread">'.$this->l('View this thread').'</a><br />' : '').' '.($id_employee ? '<a href="'.Tools::getHttpHost(true).self::$currentIndex.'&token='.Tools::getAdminToken('AdminCustomerThreads'.(int)(Tab::getIdFromClassName('AdminCustomerThreads')).(int)($id_employee)).'&id_customer_thread='.(int)$message['id_customer_thread'].'&viewcustomer_thread">'.$this->l('View this thread').'</a><br />' : '').'
<b>'.$this->l('Sent by:').'</b> '.(!empty($message['customer_name']) ? $message['customer_name'].' ('.$message['email'].')' : $message['email']) <b>'.$this->l('Sent by:').'</b> '.(!empty($message['customer_name']) ? $message['customer_name'].' ('.$message['email'].')' : $message['email'])
.((!empty($message['id_customer']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Customer ID:').'</b> '.(int)($message['id_customer']).'<br />' : '') .((!empty($message['id_customer']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Customer ID:').'</b> '.(int)($message['id_customer']).'<br />' : '')
.((!empty($message['id_order']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Order #').':</b> '.(int)($message['id_order']).'<br />' : '') .((!empty($message['id_order']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Order #').':</b> '.(int)($message['id_order']).'<br />' : '')
@@ -466,7 +466,7 @@ class AdminCustomerThreads extends AdminTab
if ($nextThread) if ($nextThread)
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&id_customer_thread='.(int)$nextThread.'&viewcustomer_thread&token='.$this->token.'"> <a href="'.self::$currentIndex.'&id_customer_thread='.(int)$nextThread.'&viewcustomer_thread&token='.$this->token.'">
<img src="../img/admin/next-msg.png" title="'.$this->l('Go to the oldest next unanswered message').'" style="margin-bottom: 10px;" /> <img src="../img/admin/next-msg.png" title="'.$this->l('Go to the oldest next unanswered message').'" style="margin-bottom: 10px;" />
<br />'.$this->l('Answer to the next unanswered message in this category').' &gt; <br />'.$this->l('Answer to the next unanswered message in this category').' &gt;
</a>'); </a>');
@@ -477,33 +477,33 @@ class AdminCustomerThreads extends AdminTab
if ($thread->status != "closed") if ($thread->status != "closed")
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&viewcustomer_thread&setstatus=2&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'"> <a href="'.self::$currentIndex.'&viewcustomer_thread&setstatus=2&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'">
<img src="../img/admin/msg-ok.png" style="margin-bottom:10px" /> <img src="../img/admin/msg-ok.png" style="margin-bottom:10px" />
<br />'.$this->l('Set this message as handled').' <br />'.$this->l('Set this message as handled').'
</a>'); </a>');
if ($thread->status != "pending1") if ($thread->status != "pending1")
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&viewcustomer_thread&setstatus=3&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'"> <a href="'.self::$currentIndex.'&viewcustomer_thread&setstatus=3&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'">
<img src="../img/admin/msg-pending.png" style="margin-bottom:10px" /> <img src="../img/admin/msg-pending.png" style="margin-bottom:10px" />
<br />'.$this->l('Declare this message').'<br />'.$this->l('as "pending 1"').'<br />'.$this->l('(will be answered later)').' <br />'.$this->l('Declare this message').'<br />'.$this->l('as "pending 1"').'<br />'.$this->l('(will be answered later)').'
</a>'); </a>');
else else
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'"> <a href="'.self::$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'">
<img src="../img/admin/msg-is-pending.png" style="margin-bottom:10px" /> <img src="../img/admin/msg-is-pending.png" style="margin-bottom:10px" />
<br />'.$this->l('Click here to disable pending status').' <br />'.$this->l('Click here to disable pending status').'
</a>'); </a>');
if ($thread->status != "pending2") if ($thread->status != "pending2")
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&viewcustomer_thread&setstatus=4&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'"> <a href="'.self::$currentIndex.'&viewcustomer_thread&setstatus=4&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'">
<img src="../img/admin/msg-pending.png" style="margin-bottom:10px" /> <img src="../img/admin/msg-pending.png" style="margin-bottom:10px" />
<br />'.$this->l('Declare this message').'<br />'.$this->l('as "pending 2"').'<br />'.$this->l('(will be answered later)').' <br />'.$this->l('Declare this message').'<br />'.$this->l('as "pending 2"').'<br />'.$this->l('(will be answered later)').'
</a>'); </a>');
else else
echo $this->displayButton(' echo $this->displayButton('
<a href="'.$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'"> <a href="'.self::$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token.'">
<img src="../img/admin/msg-is-pending.png" style="margin-bottom:10px" /> <img src="../img/admin/msg-is-pending.png" style="margin-bottom:10px" />
<br />'.$this->l('Click here to disable pending status').' <br />'.$this->l('Click here to disable pending status').'
</a>'); </a>');
+10 -10
View File
@@ -165,12 +165,12 @@ class AdminCustomers extends AdminTab
$parent_id = (int)(Tools::getValue('id_parent', 1)); $parent_id = (int)(Tools::getValue('id_parent', 1));
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$this->token);
// Save and back to parent // Save and back to parent
if (Tools::isSubmit('submitAdd'.$this->table.'AndBackToParent')) if (Tools::isSubmit('submitAdd'.$this->table.'AndBackToParent'))
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=3&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=3&token='.$this->token);
// Default behavior (save and back) // Default behavior (save and back)
Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$this->token);
} }
} }
else else
@@ -229,7 +229,7 @@ class AdminCustomers extends AdminTab
if(Customer::customerExists($customer->email)) if(Customer::customerExists($customer->email))
$this->_errors[] = Tools::displayError('This customer already exist as non-guest.'); $this->_errors[] = Tools::displayError('This customer already exist as non-guest.');
elseif ($customer->transformToCustomer(Tools::getValue('id_lang', Configuration::get('PS_LANG_DEFAULT')))) elseif ($customer->transformToCustomer(Tools::getValue('id_lang', Configuration::get('PS_LANG_DEFAULT'))))
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token);
else else
$this->_errors[] = Tools::displayError('An error occurred while updating customer.'); $this->_errors[] = Tools::displayError('An error occurred while updating customer.');
} }
@@ -244,7 +244,7 @@ class AdminCustomers extends AdminTab
$update = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer` SET newsletter = '.($customer->newsletter ? 0 : 1).' WHERE `id_customer` = '.(int)($customer->id)); $update = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer` SET newsletter = '.($customer->newsletter ? 0 : 1).' WHERE `id_customer` = '.(int)($customer->id));
if (!$update) if (!$update)
$this->_errors[] = Tools::displayError('An error occurred while updating customer.'); $this->_errors[] = Tools::displayError('An error occurred while updating customer.');
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
}elseif (Tools::isSubmit('changeOptinVal') AND Tools::getValue('id_customer')) }elseif (Tools::isSubmit('changeOptinVal') AND Tools::getValue('id_customer'))
{ {
@@ -255,7 +255,7 @@ class AdminCustomers extends AdminTab
$update = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer` SET optin = '.($customer->optin ? 0 : 1).' WHERE `id_customer` = '.(int)($customer->id)); $update = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer` SET optin = '.($customer->optin ? 0 : 1).' WHERE `id_customer` = '.(int)($customer->id));
if (!$update) if (!$update)
$this->_errors[] = Tools::displayError('An error occurred while updating customer.'); $this->_errors[] = Tools::displayError('An error occurred while updating customer.');
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
return parent::postProcess(); return parent::postProcess();
@@ -289,7 +289,7 @@ class AdminCustomers extends AdminTab
$countBetterCustomers = '-'; $countBetterCustomers = '-';
echo ' echo '
<fieldset style="width:400px;float: left"><div style="float: right"><a href="'.$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div> <fieldset style="width:400px;float: left"><div style="float: right"><a href="'.self::$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div>
<span style="font-weight: bold; font-size: 14px;">'.$customer->firstname.' '.$customer->lastname.'</span> <span style="font-weight: bold; font-size: 14px;">'.$customer->firstname.' '.$customer->lastname.'</span>
<img src="../img/admin/'.($customer->id_gender == 2 ? 'female' : ($customer->id_gender == 1 ? 'male' : 'unknown')).'.gif" style="margin-bottom: 5px" /><br /> <img src="../img/admin/'.($customer->id_gender == 2 ? 'female' : ($customer->id_gender == 1 ? 'male' : 'unknown')).'.gif" style="margin-bottom: 5px" /><br />
<a href="mailto:'.$customer->email.'" style="text-decoration: underline; color: blue">'.$customer->email.'</a><br /><br /> <a href="mailto:'.$customer->email.'" style="text-decoration: underline; color: blue">'.$customer->email.'</a><br /><br />
@@ -301,7 +301,7 @@ class AdminCustomers extends AdminTab
</fieldset> </fieldset>
<fieldset style="width:300px;float:left;margin-left:50px"> <fieldset style="width:300px;float:left;margin-left:50px">
<div style="float: right"> <div style="float: right">
<a href="'.$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a> <a href="'.self::$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a>
</div> </div>
'.$this->l('Newsletter:').' '.($customer->newsletter ? '<img src="../img/admin/enabled.gif" />' : '<img src="../img/admin/disabled.gif" />').'<br /> '.$this->l('Newsletter:').' '.($customer->newsletter ? '<img src="../img/admin/enabled.gif" />' : '<img src="../img/admin/disabled.gif" />').'<br />
'.$this->l('Opt-in:').' '.($customer->optin ? '<img src="../img/admin/enabled.gif" />' : '<img src="../img/admin/disabled.gif" />').'<br /> '.$this->l('Opt-in:').' '.($customer->optin ? '<img src="../img/admin/enabled.gif" />' : '<img src="../img/admin/disabled.gif" />').'<br />
@@ -678,7 +678,7 @@ class AdminCustomers extends AdminTab
</tr>'; </tr>';
echo '</table><div class="clear">&nbsp;</div>'; echo '</table><div class="clear">&nbsp;</div>';
} }
echo '<a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to customer list').'</a><br />'; echo '<a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to customer list').'</a><br />';
} }
public function displayForm($isMainTab = true) public function displayForm($isMainTab = true)
@@ -694,7 +694,7 @@ class AdminCustomers extends AdminTab
$groups = Group::getGroups($this->_defaultFormLanguage, true); $groups = Group::getGroups($this->_defaultFormLanguage, true);
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" autocomplete="off"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" autocomplete="off">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab-customers.gif" />'.$this->l('Customer').'</legend> <fieldset><legend><img src="../img/admin/tab-customers.gif" />'.$this->l('Customer').'</legend>
<label>'.$this->l('Gender:').' </label> <label>'.$this->l('Gender:').' </label>
+2 -2
View File
@@ -64,7 +64,7 @@ class AdminDb extends AdminPreferences
if ($value) if ($value)
$settings['_'.Tools::strtoupper($k).'_'] = $value; $settings['_'.Tools::strtoupper($k).'_'] = $value;
rewriteSettingsFile(NULL, NULL, $settings); rewriteSettingsFile(NULL, NULL, $settings);
Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
} }
else else
@@ -106,7 +106,7 @@ class AdminDb extends AdminPreferences
$this->_displayForm('database', $this->_fieldsDatabase, $this->l('Database'), 'width2', 'database_gear'); $this->_displayForm('database', $this->_fieldsDatabase, $this->l('Database'), 'width2', 'database_gear');
$engines = $this->_getEngines(); $engines = $this->_getEngines();
$irow = 0; $irow = 0;
echo '<br /><fieldset class="width2"><legend>'.$this->l('MySQL Engine').'</legend><form name="updateEngine" action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"><table cellspacing="0" cellpadding="0" class="table width2 clear"> echo '<br /><fieldset class="width2"><legend>'.$this->l('MySQL Engine').'</legend><form name="updateEngine" action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"><table cellspacing="0" cellpadding="0" class="table width2 clear">
<tr><th><input type="checkbox" onclick="checkDelBoxes(this.form, \'tablesBox[]\', this.checked)" class="noborder" name="checkme"></th><th>'.$this->l('Table').'</th><th>'.$this->l('Table Engine').'</th></tr>'; <tr><th><input type="checkbox" onclick="checkDelBoxes(this.form, \'tablesBox[]\', this.checked)" class="noborder" name="checkme"></th><th>'.$this->l('Table').'</th><th>'.$this->l('Table Engine').'</th></tr>';
$tables_status = $this->_getTablesStatus(); $tables_status = $this->_getTablesStatus();
foreach ($tables_status AS $table) foreach ($tables_status AS $table)
+1 -1
View File
@@ -50,7 +50,7 @@ class AdminDeliverySlip extends AdminTab
$output = ' $output = '
<h2>'.$this->l('Print PDF delivery slips').'</h2> <h2>'.$this->l('Print PDF delivery slips').'</h2>
<fieldset> <fieldset>
<form action="'.$currentIndex.'&submitPrint=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitPrint=1&token='.$this->token.'" method="post">
<label>'.$this->l('From:').' </label> <label>'.$this->l('From:').' </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup> <input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
+4 -4
View File
@@ -142,8 +142,8 @@ class AdminDiscounts extends AdminTab
if ($back = Tools::getValue('back')) if ($back = Tools::getValue('back'))
Tools::redirectAdmin(urldecode($back).'&conf=4'); Tools::redirectAdmin(urldecode($back).'&conf=4');
if (Tools::getValue('stay_here') == 'on' || Tools::getValue('stay_here') == 'true' || Tools::getValue('stay_here') == '1') if (Tools::getValue('stay_here') == 'on' || Tools::getValue('stay_here') == 'true' || Tools::getValue('stay_here') == '1')
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&updatescene&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&updatescene&token='.$token);
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&token='.$token);
} }
} }
else else
@@ -166,7 +166,7 @@ class AdminDiscounts extends AdminTab
if (!$object->add(true, false, $categories)) if (!$object->add(true, false, $categories))
$this->_errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>'; $this->_errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>';
elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect) elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect)
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token);
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to add here.'); $this->_errors[] = Tools::displayError('You do not have permission to add here.');
@@ -217,7 +217,7 @@ class AdminDiscounts extends AdminTab
discountType(); discountType();
}); });
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" id="discount" name="discount" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" id="discount" name="discount" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/coupon.gif" />'.$this->l('Vouchers').'</legend> <fieldset><legend><img src="../img/admin/coupon.gif" />'.$this->l('Vouchers').'</legend>
<label>'.$this->l('Code:').' </label> <label>'.$this->l('Code:').' </label>
+2 -2
View File
@@ -96,9 +96,9 @@ class AdminEmployees extends AdminTab
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.((int)$this->tabAccess['view'] ? '' : '&updateemployee&id_employee='.(int)$obj->id).'" method="post" enctype="multipart/form-data" autocomplete="off"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.((int)$this->tabAccess['view'] ? '' : '&updateemployee&id_employee='.(int)$obj->id).'" method="post" enctype="multipart/form-data" autocomplete="off">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
'.((int)$this->tabAccess['view'] ? '' : '<input type="hidden" name="back" value="'.$currentIndex.'&token='.$this->token.'&updateemployee&id_employee='.(int)$obj->id.'" />').' '.((int)$this->tabAccess['view'] ? '' : '<input type="hidden" name="back" value="'.self::$currentIndex.'&token='.$this->token.'&updateemployee&id_employee='.(int)$obj->id.'" />').'
<fieldset class="width3"><legend><img src="../img/admin/nav-user.gif" />'.$this->l('Employees').'</legend> <fieldset class="width3"><legend><img src="../img/admin/nav-user.gif" />'.$this->l('Employees').'</legend>
<label>'.$this->l('Last name:').' </label> <label>'.$this->l('Last name:').' </label>
<div class="margin-form"> <div class="margin-form">
+9 -9
View File
@@ -53,7 +53,7 @@ class AdminFeatures extends AdminTab
OR isset($_GET['updatefeature_value']) OR isset($_GET['addfeature_value'])) OR isset($_GET['updatefeature_value']) OR isset($_GET['addfeature_value']))
{ {
$this->adminFeaturesValues->displayForm($this->token); $this->adminFeaturesValues->displayForm($this->token);
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" alt="" /> '.$this->l('Back to the features list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" alt="" /> '.$this->l('Back to the features list').'</a><br />';
} }
else else
{ {
@@ -68,8 +68,8 @@ class AdminFeatures extends AdminTab
global $currentIndex; global $currentIndex;
echo '<br /> echo '<br />
<a href="'.$currentIndex.'&add'.$this->table.'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Add a new feature').'</b></a><br /> <a href="'.self::$currentIndex.'&add'.$this->table.'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Add a new feature').'</b></a><br />
<a href="'.$currentIndex.'&addfeature_value&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new feature value').'</a><br /><br /> <a href="'.self::$currentIndex.'&addfeature_value&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new feature value').'</a><br /><br />
'.$this->l('Click on a feature name to view its values and then click again if you want to hide them.').'<br /><br />'; '.$this->l('Click on a feature name to view its values and then click again if you want to hide them.').'<br /><br />';
$this->displayListHeader(); $this->displayListHeader();
@@ -102,9 +102,9 @@ class AdminFeatures extends AdminTab
<td class="center"><input type="checkbox" name="feature_value'.$id.'Box[]" value="'.$feature['id_feature_value'].'" class="noborder" /></td> <td class="center"><input type="checkbox" name="feature_value'.$id.'Box[]" value="'.$feature['id_feature_value'].'" class="noborder" /></td>
<td>'.$feature['value'].'</td> <td>'.$feature['value'].'</td>
<td class="center"> <td class="center">
<a href="'.$currentIndex.'&id_feature_value='.$feature['id_feature_value'].'&updatefeature_value&token='.$this->token.'"> <a href="'.self::$currentIndex.'&id_feature_value='.$feature['id_feature_value'].'&updatefeature_value&token='.$this->token.'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp; <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp;
<a href="'.$currentIndex.'&id_feature_value='.$feature['id_feature_value'].'&deletefeature_value&token='.$this->token.'" <a href="'.self::$currentIndex.'&id_feature_value='.$feature['id_feature_value'].'&deletefeature_value&token='.$this->token.'"
onclick="return confirm(\''.$this->l('Delete value', __CLASS__, true, false).' #'.$feature['id_feature_value'].'?\');"> onclick="return confirm(\''.$this->l('Delete value', __CLASS__, true, false).' #'.$feature['id_feature_value'].'?\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
</td> </td>
@@ -122,9 +122,9 @@ class AdminFeatures extends AdminTab
echo ' echo '
<td style="vertical-align: top; padding: 4px 0 4px 0" class="center"> <td style="vertical-align: top; padding: 4px 0 4px 0" class="center">
<a href="'.$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.$this->token.'"> <a href="'.self::$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.$this->token.'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp; <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>&nbsp;
<a href="'.$currentIndex.'&id_'.$this->table.'='.$id.'&delete'.$this->table.'&token='.$this->token.'" onclick="return confirm(\''.$this->l('Delete item', __CLASS__, true, false).' #'.$id.'?\');"> <a href="'.self::$currentIndex.'&id_'.$this->table.'='.$id.'&delete'.$this->table.'&token='.$this->token.'" onclick="return confirm(\''.$this->l('Delete item', __CLASS__, true, false).' #'.$id.'?\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
</td> </td>
</tr>'; </tr>';
@@ -144,7 +144,7 @@ class AdminFeatures extends AdminTab
echo ' echo '
<h2>'.$this->l('Add a new feature').'</h2> <h2>'.$this->l('Add a new feature').'</h2>
<form action="'.$currentIndex.'&token='.$this->token.'"" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'"" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset class="width2"> <fieldset class="width2">
<legend><img src="../img/t/AdminFeatures.gif" />'.$this->l('Add a new feature').'</legend> <legend><img src="../img/t/AdminFeatures.gif" />'.$this->l('Add a new feature').'</legend>
@@ -195,7 +195,7 @@ class AdminFeatures extends AdminTab
{ {
$object = new $this->className(); $object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.'Box'])) if ($object->deleteSelection($_POST[$this->table.'Box']))
Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token);
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
} }
else else
+2 -2
View File
@@ -53,7 +53,7 @@ class AdminFeaturesValues extends AdminTab
echo ' echo '
<h2>'.$this->l('Add a new feature value').'</h2> <h2>'.$this->l('Add a new feature value').'</h2>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.Tools::getValue('token').'" method="post">
'.($obj->id ? '<input type="hidden" name="id_feature_value" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_feature_value" value="'.$obj->id.'" />' : '').'
<fieldset class="width2"> <fieldset class="width2">
<legend><img src="../img/t/AdminFeatures.gif" />'.$this->l('Add a new feature value').'</legend> <legend><img src="../img/t/AdminFeatures.gif" />'.$this->l('Add a new feature value').'</legend>
@@ -103,7 +103,7 @@ class AdminFeaturesValues extends AdminTab
{ {
$object = new $this->className(); $object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box'])) if ($object->deleteSelection($_POST[$this->table.$_POST['groupid'].'Box']))
Tools::redirectAdmin($currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.($token ? $token : $this->token));
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
} }
else else
+4 -4
View File
@@ -44,7 +44,7 @@ class AdminGenerator extends AdminTab
// Htaccess // Htaccess
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="../img/admin/htaccess.gif" />'.$this->l('Htaccess file generation').'</legend> <fieldset><legend><img src="../img/admin/htaccess.gif" />'.$this->l('Htaccess file generation').'</legend>
<p><b>'.$this->l('Warning:').'</b> '.$this->l('this tool can ONLY be used if you are hosted by an Apache web server. Please ask your webhost.').'</p> <p><b>'.$this->l('Warning:').'</b> '.$this->l('this tool can ONLY be used if you are hosted by an Apache web server. Please ask your webhost.').'</p>
<p>'.$this->l('This tool will automatically generate a ".htaccess" file that will give you the ability to do URL rewriting and to catch 404 errors.').'</p> <p>'.$this->l('This tool will automatically generate a ".htaccess" file that will give you the ability to do URL rewriting and to catch 404 errors.').'</p>
@@ -81,7 +81,7 @@ class AdminGenerator extends AdminTab
// Robots // Robots
echo '<br /><br /> echo '<br /><br />
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="../img/admin/robots.gif" />'.$this->l('Robots file generation').'</legend> <fieldset><legend><img src="../img/admin/robots.gif" />'.$this->l('Robots file generation').'</legend>
<p><b>'.$this->l('Warning:').' </b>'.$this->l('Your file robots.txt MUST be in your website\'s root directory and nowhere else.').'</p> <p><b>'.$this->l('Warning:').' </b>'.$this->l('Your file robots.txt MUST be in your website\'s root directory and nowhere else.').'</p>
<p>'.$this->l('eg: http://www.yoursite.com/robots.txt').'.</p> <p>'.$this->l('eg: http://www.yoursite.com/robots.txt').'.</p>
@@ -118,7 +118,7 @@ class AdminGenerator extends AdminTab
Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS')); Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS'));
Configuration::updateValue('PS_HTACCESS_SPECIFIC', Tools::getValue('ps_htaccess_specific'), true); Configuration::updateValue('PS_HTACCESS_SPECIFIC', Tools::getValue('ps_htaccess_specific'), true);
if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Tools::getValue('ps_htaccess_specific'))) if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Tools::getValue('ps_htaccess_specific')))
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
$this->_errors[] = $this->l('Cannot write into file:').' <b>'.$this->_htFile.'</b><br />'.$this->l('Please check write permissions.'); $this->_errors[] = $this->l('Cannot write into file:').' <b>'.$this->_htFile.'</b><br />'.$this->l('Please check write permissions.');
} }
else else
@@ -164,7 +164,7 @@ class AdminGenerator extends AdminTab
fwrite($writeFd, "\n"); fwrite($writeFd, "\n");
fclose($writeFd); fclose($writeFd);
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
} }
} else } else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.'); $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
+6 -6
View File
@@ -39,7 +39,7 @@ class AdminGeolocation extends AdminTab
$this->displayWarning($this->l('In order to use Geolocation, please download').' <a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">'.$this->l('this file').'</a> '.$this->l('and decompress it into tools/geoip/ directory')); $this->displayWarning($this->l('In order to use Geolocation, please download').' <a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">'.$this->l('this file').'</a> '.$this->l('and decompress it into tools/geoip/ directory'));
echo ' echo '
<form method="POST" action="'.$currentIndex.'&token='.Tools::getValue('token').'"> <form method="POST" action="'.self::$currentIndex.'&token='.Tools::getValue('token').'">
<fieldset> <fieldset>
<legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Geolocation by IP').'</legend> <legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Geolocation by IP').'</legend>
@@ -58,7 +58,7 @@ class AdminGeolocation extends AdminTab
'; ';
$allowedCountries = explode(';', Configuration::get('PS_ALLOWED_COUNTRIES')); $allowedCountries = explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'));
echo ' echo '
<form method="POST" action="'.$currentIndex.'&token='.Tools::getValue('token').'"> <form method="POST" action="'.self::$currentIndex.'&token='.Tools::getValue('token').'">
<fieldset style="margin-top:10px;"> <fieldset style="margin-top:10px;">
<legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Options').'</legend> <legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Options').'</legend>
@@ -116,7 +116,7 @@ class AdminGeolocation extends AdminTab
</fieldset> </fieldset>
</form> </form>
<form method="POST" action="'.$currentIndex.'&token='.Tools::getValue('token').'"> <form method="POST" action="'.self::$currentIndex.'&token='.Tools::getValue('token').'">
<fieldset style="margin-top:10px;"> <fieldset style="margin-top:10px;">
<legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Whitelist of IP addresses').'</legend> <legend><img src="../img/admin/world.gif" alt="" /> '.$this->l('Whitelist of IP addresses').'</legend>
@@ -146,7 +146,7 @@ class AdminGeolocation extends AdminTab
if ($this->_isGeoLiteCityAvailable()) if ($this->_isGeoLiteCityAvailable())
{ {
Configuration::updateValue('PS_GEOLOCATION_ENABLED', intval(Tools::getValue('PS_GEOLOCATION_ENABLED'))); Configuration::updateValue('PS_GEOLOCATION_ENABLED', intval(Tools::getValue('PS_GEOLOCATION_ENABLED')));
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
else else
$this->_errors[] = Tools::displayError('Geolocation database is unavailable.'); $this->_errors[] = Tools::displayError('Geolocation database is unavailable.');
@@ -161,7 +161,7 @@ class AdminGeolocation extends AdminTab
Configuration::updateValue('PS_GEOLOCATION_BEHAVIOR', (!(int)(Tools::getValue('PS_GEOLOCATION_BEHAVIOR')) ? _PS_GEOLOCATION_NO_CATALOG_ : _PS_GEOLOCATION_NO_ORDER_)); Configuration::updateValue('PS_GEOLOCATION_BEHAVIOR', (!(int)(Tools::getValue('PS_GEOLOCATION_BEHAVIOR')) ? _PS_GEOLOCATION_NO_CATALOG_ : _PS_GEOLOCATION_NO_ORDER_));
Configuration::updateValue('PS_GEOLOCATION_NA_BEHAVIOR', (int)Tools::getValue('PS_GEOLOCATION_NA_BEHAVIOR')); Configuration::updateValue('PS_GEOLOCATION_NA_BEHAVIOR', (int)Tools::getValue('PS_GEOLOCATION_NA_BEHAVIOR'));
Configuration::updateValue('PS_ALLOWED_COUNTRIES', implode(';', Tools::getValue('countries'))); Configuration::updateValue('PS_ALLOWED_COUNTRIES', implode(';', Tools::getValue('countries')));
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
} }
@@ -172,7 +172,7 @@ class AdminGeolocation extends AdminTab
else else
{ {
Configuration::updateValue('PS_GEOLOCATION_WHITELIST', str_replace("\n", ';', str_replace("\r", '', Tools::getValue('PS_GEOLOCATION_WHITELIST')))); Configuration::updateValue('PS_GEOLOCATION_WHITELIST', str_replace("\n", ';', str_replace("\r", '', Tools::getValue('PS_GEOLOCATION_WHITELIST'))));
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
} }
+1 -1
View File
@@ -73,7 +73,7 @@ class AdminGroupShop extends AdminTab
else else
$disabled = ''; $disabled = '';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend>'.$this->l('GroupShop').'</legend><span class="hint" name="help_box" style="display:block;">'.$this->l('You can\'t edit GroupShop when you have more than one Shop').'</span><br /> <fieldset><legend>'.$this->l('GroupShop').'</legend><span class="hint" name="help_box" style="display:block;">'.$this->l('You can\'t edit GroupShop when you have more than one Shop').'</span><br />
<label for="name">'.$this->l('GroupShop name').'</label> <label for="name">'.$this->l('GroupShop name').'</label>
+7 -7
View File
@@ -67,7 +67,7 @@ class AdminGroups extends AdminTab
$categories = Category::getSimpleCategories((int)($cookie->id_lang)); $categories = Category::getSimpleCategories((int)($cookie->id_lang));
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab-groups.gif" />'.$this->l('Group').'</legend> <fieldset><legend><img src="../img/admin/tab-groups.gif" />'.$this->l('Group').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
@@ -106,7 +106,7 @@ class AdminGroups extends AdminTab
<tr> <tr>
<td>'.Tools::htmlentitiesUTF8($groupReduction['category_name']).'</td> <td>'.Tools::htmlentitiesUTF8($groupReduction['category_name']).'</td>
<td><input type="hidden" name="gr_id_group_reduction[]" value="'.(int)($groupReduction['id_group_reduction']).'" /><input type="text" name="gr_reduction[]" value="'.($groupReduction['reduction'] * 100).'" /></td> <td><input type="hidden" name="gr_id_group_reduction[]" value="'.(int)($groupReduction['id_group_reduction']).'" /><input type="text" name="gr_reduction[]" value="'.($groupReduction['reduction'] * 100).'" /></td>
<td><a href="'.$currentIndex.'&deleteGroupReduction&id_group_reduction='.(int)($groupReduction['id_group_reduction']).'&id_group='.(int)($obj->id).'&token='.$this->token.'"><img src="" alt="'.$this->l('Delete').'" /></a></td> <td><a href="'.self::$currentIndex.'&deleteGroupReduction&id_group_reduction='.(int)($groupReduction['id_group_reduction']).'&id_group='.(int)($obj->id).'&token='.$this->token.'"><img src="" alt="'.$this->l('Delete').'" /></a></td>
</tr>'; </tr>';
echo '</table>'; echo '</table>';
} }
@@ -141,7 +141,7 @@ class AdminGroups extends AdminTab
if ($obj->id) if ($obj->id)
{ {
echo ' echo '
<form action="'.$currentIndex.'&update'.$this->table.'&id_group='.$obj->id.'&token='.$this->token.'" method="post" class="width3"> <form action="'.self::$currentIndex.'&update'.$this->table.'&id_group='.$obj->id.'&token='.$this->token.'" method="post" class="width3">
<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" /> <input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />
<fieldset><legend><img src="../img/admin/tab-groups.gif" />'.$this->l('New group discount').'</legend> <fieldset><legend><img src="../img/admin/tab-groups.gif" />'.$this->l('New group discount').'</legend>
<label>'.$this->l('Category:').' </label> <label>'.$this->l('Category:').' </label>
@@ -176,7 +176,7 @@ class AdminGroups extends AdminTab
echo ' echo '
<fieldset style="width: 400px"> <fieldset style="width: 400px">
<div style="float: right"><a href="'.$currentIndex.'&updategroup&id_group='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div> <div style="float: right"><a href="'.self::$currentIndex.'&updategroup&id_group='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div>
<span style="font-weight: bold; font-size: 14px;">'.strval($obj->name[(int)($cookie->id_lang)]).'</span> <span style="font-weight: bold; font-size: 14px;">'.strval($obj->name[(int)($cookie->id_lang)]).'</span>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
'.$this->l('Discount:').' '.(float)($obj->reduction).$this->l('%').' '.$this->l('Discount:').' '.(float)($obj->reduction).$this->l('%').'
@@ -295,7 +295,7 @@ class AdminGroups extends AdminTab
if (!$groupReduction->delete()) if (!$groupReduction->delete())
$this->_errors[] = Tools::displayError('An error occurred while deleting the group reduction'); $this->_errors[] = Tools::displayError('An error occurred while deleting the group reduction');
else else
Tools::redirectAdmin($currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=1&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=1&token='.$token);
} }
} }
else else
@@ -322,7 +322,7 @@ class AdminGroups extends AdminTab
if (!$groupReduction->add()) if (!$groupReduction->add())
$this->_errors[] = Tools::displayError('An error occurred while adding a category group reduction.'); $this->_errors[] = Tools::displayError('An error occurred while adding a category group reduction.');
else else
Tools::redirectAdmin($currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=3&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&update'.$this->table.'&id_group='.(int)(Tools::getValue('id_group')).'&conf=3&token='.$this->token);
} }
} }
else else
@@ -367,7 +367,7 @@ class AdminGroups extends AdminTab
else else
{ {
if ($object->delete()) if ($object->delete())
Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.$token);
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
} }
+3 -3
View File
@@ -47,9 +47,9 @@ class AdminImageResize extends AdminTab
$this->_errors = Tools::displayError('An error occurred while copying image.').' '.stripslashes($imageType['name']); $this->_errors = Tools::displayError('An error occurred while copying image.').' '.stripslashes($imageType['name']);
// Save and stay on same form // Save and stay on same form
if (Tools::getValue('saveandstay') == 'on') if (Tools::getValue('saveandstay') == 'on')
Tools::redirectAdmin($currentIndex.'&id_product='.Tools::getValue('id_product').'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=1&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.Tools::getValue('id_product').'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=1&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)));
// Default behavior (save and back) // Default behavior (save and back)
Tools::redirectAdmin($currentIndex.'&id_category='.(int)(Tools::getValue('id_category')).'&conf='.(int)(Tools::getValue('conf')).'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); Tools::redirectAdmin(self::$currentIndex.'&id_category='.(int)(Tools::getValue('id_category')).'&conf='.(int)(Tools::getValue('conf')).'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)));
} else } else
parent::postProcess(); parent::postProcess();
} }
@@ -68,7 +68,7 @@ class AdminImageResize extends AdminTab
<script type="text/javascript" src="../js/cropper/dragdrop.js"></script> <script type="text/javascript" src="../js/cropper/dragdrop.js"></script>
<script type="text/javascript" src="../js/cropper/cropper.js"></script> <script type="text/javascript" src="../js/cropper/cropper.js"></script>
<script type="text/javascript" src="../js/cropper/loader.js"></script> <script type="text/javascript" src="../js/cropper/loader.js"></script>
<form enctype="multipart/form-data" method="post" action="'.$currentIndex.'&imageresize&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'"> <form enctype="multipart/form-data" method="post" action="'.self::$currentIndex.'&imageresize&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">
<input type="hidden" name="id_product" value="'.Tools::getValue('id_product').'" /> <input type="hidden" name="id_product" value="'.Tools::getValue('id_product').'" />
<input type="hidden" name="id_category" value="'.Tools::getValue('id_category').'" /> <input type="hidden" name="id_category" value="'.Tools::getValue('id_category').'" />
<input type="hidden" name="saveandstay" value="'.Tools::getValue('submitAddAndStay').'" /> <input type="hidden" name="saveandstay" value="'.Tools::getValue('submitAddAndStay').'" />
+5 -5
View File
@@ -62,7 +62,7 @@ class AdminImages extends AdminTab
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
if ($this->_regenerateThumbnails(Tools::getValue('type'), Tools::getValue('erase'))) if ($this->_regenerateThumbnails(Tools::getValue('type'), Tools::getValue('erase')))
Tools::redirectAdmin($currentIndex.'&conf=9'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=9'.'&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.'); $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
@@ -89,7 +89,7 @@ class AdminImages extends AdminTab
echo $obj->id ? $this->displayWarning($this->l('After modification, do not forget to regenerate thumbnails')) : ''; echo $obj->id ? $this->displayWarning($this->l('After modification, do not forget to regenerate thumbnails')) : '';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset> <fieldset>
<legend><img src="../img/admin/picture.gif" />'.$this->l('Images').'</legend><br /> <legend><img src="../img/admin/picture.gif" />'.$this->l('Images').'</legend><br />
@@ -186,7 +186,7 @@ class AdminImages extends AdminTab
'.$this->l('Regenerates thumbnails for all existing product images').'.<br /><br />'; '.$this->l('Regenerates thumbnails for all existing product images').'.<br /><br />';
$this->displayWarning($this->l('Please be patient, as this can take several minutes').'<br />'.$this->l('Be careful! Manually generated thumbnails will be erased by automatically generated thumbnails.')); $this->displayWarning($this->l('Please be patient, as this can take several minutes').'<br />'.$this->l('Be careful! Manually generated thumbnails will be erased by automatically generated thumbnails.'));
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width2"> <fieldset class="width2">
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Regenerate thumbnails').'</legend><br /> <legend><img src="../img/admin/picture.gif" /> '.$this->l('Regenerate thumbnails').'</legend><br />
<label>'.$this->l('Select image').'</label> <label>'.$this->l('Select image').'</label>
@@ -413,7 +413,7 @@ class AdminImages extends AdminTab
<br /><h2 class="space">'.$this->l('Move images').'</h2>'. <br /><h2 class="space">'.$this->l('Move images').'</h2>'.
$this->l('A new storage system for product images is now used by PrestaShop. It offers better performance if your shop has a very large number of products.').'<br />'. $this->l('A new storage system for product images is now used by PrestaShop. It offers better performance if your shop has a very large number of products.').'<br />'.
'<br /> '<br />
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width3"> <fieldset class="width3">
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Move images').'</legend><br />'. <legend><img src="../img/admin/picture.gif" /> '.$this->l('Move images').'</legend><br />'.
$this->l('You can choose to keep your images stored in the previous system - nothing wrong with that.').'<br />'. $this->l('You can choose to keep your images stored in the previous system - nothing wrong with that.').'<br />'.
@@ -439,6 +439,6 @@ class AdminImages extends AdminTab
$result = Image::moveToNewFileSystem($this->max_execution_time); $result = Image::moveToNewFileSystem($this->max_execution_time);
if ($result === 'timeout') if ($result === 'timeout')
$this->_errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on \"Move images\" again to resume moving images'); $this->_errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on \"Move images\" again to resume moving images');
Tools::redirectAdmin($currentIndex.'&conf=25'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token);
} }
} }
+5 -5
View File
@@ -1270,7 +1270,7 @@ class AdminImport extends AdminTab
echo ' echo '
<fieldset class="width3"> <fieldset class="width3">
<legend><img src="../img/admin/import.gif" />'.$this->l('Upload').'</legend> <legend><img src="../img/admin/import.gif" />'.$this->l('Upload').'</legend>
<form action="'.$this->currentIndex.'&token='.$this->token.'" method="POST" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="POST" enctype="multipart/form-data">
<label class="clear">'.$this->l('Select a file').' </label> <label class="clear">'.$this->l('Select a file').' </label>
<div class="margin-form"> <div class="margin-form">
<input name="file" type="file" /><br />'.$this->l('You can also upload your file by FTP and put it in').' '.realpath(dirname(__FILE__).'/../import/').'. <input name="file" type="file" /><br />'.$this->l('You can also upload your file by FTP and put it in').' '.realpath(dirname(__FILE__).'/../import/').'.
@@ -1295,7 +1295,7 @@ class AdminImport extends AdminTab
{ {
echo ' echo '
<div class="space"> <div class="space">
<form id="preview_import" action="'.$this->currentIndex.'&token='.$this->token.'" method="post" style="display:inline" enctype="multipart/form-data" class="clear" onsubmit="if ($(\'#truncate\').get(0).checked) {if (confirm(\''.$this->l('Are you sure you want to delete', __CLASS__, true, false).'\' + \' \' + $(\'#entity > option:selected\').text().toLowerCase() + \''.$this->l('?', __CLASS__, true, false).'\')){this.submit();} else {return false;}}"> <form id="preview_import" action="'.self::$currentIndex.'&token='.$this->token.'" method="post" style="display:inline" enctype="multipart/form-data" class="clear" onsubmit="if ($(\'#truncate\').get(0).checked) {if (confirm(\''.$this->l('Are you sure you want to delete', __CLASS__, true, false).'\' + \' \' + $(\'#entity > option:selected\').text().toLowerCase() + \''.$this->l('?', __CLASS__, true, false).'\')){this.submit();} else {return false;}}">
<fieldset style="float: left; width: 550px"> <fieldset style="float: left; width: 550px">
<legend><img src="../img/admin/import.gif" />'.$this->l('Import').'</legend> <legend><img src="../img/admin/import.gif" />'.$this->l('Import').'</legend>
<label class="clear">'.$this->l('Select which entity to import:').' </label> <label class="clear">'.$this->l('Select which entity to import:').' </label>
@@ -1360,7 +1360,7 @@ class AdminImport extends AdminTab
<script type="text/javascript"> <script type="text/javascript">
$("select#entity").change( function() { $("select#entity").change( function() {
$("#entitie").html($("#entity > option:selected").text().toLowerCase()); $("#entitie").html($("#entity > option:selected").text().toLowerCase());
$.getJSON("'.dirname($this->currentIndex).'/ajax.php", $.getJSON("'.dirname(self::$currentIndex).'/ajax.php",
{ {
getAvailableFields:1, getAvailableFields:1,
entity: $("#entity").val()}, entity: $("#entity").val()},
@@ -1511,7 +1511,7 @@ class AdminImport extends AdminTab
$res[] = '\''.$elem.'\''; $res[] = '\''.$elem.'\'';
echo ' echo '
<form action="'.$this->currentIndex.'&token='.$this->token.'" method="post" id="import_form" name="import_form"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" id="import_form" name="import_form">
'.$this->l('Skip').' <input type="text" size="2" name="skip" value="0" /> '.$this->l('lines').'. '.$this->l('Skip').' <input type="text" size="2" name="skip" value="0" /> '.$this->l('lines').'.
<input type="hidden" name="csv" value="'.Tools::getValue('csv').'" /> <input type="hidden" name="csv" value="'.Tools::getValue('csv').'" />
<input type="hidden" name="convert" value="'.Tools::getValue('convert').'" /> <input type="hidden" name="convert" value="'.Tools::getValue('convert').'" />
@@ -1659,7 +1659,7 @@ class AdminImport extends AdminTab
elseif (!file_exists($_FILES['file']['tmp_name']) OR !@move_uploaded_file($_FILES['file']['tmp_name'], dirname(__FILE__).'/../import/'.$_FILES['file']['name'].'.'.date('Ymdhis'))) elseif (!file_exists($_FILES['file']['tmp_name']) OR !@move_uploaded_file($_FILES['file']['tmp_name'], dirname(__FILE__).'/../import/'.$_FILES['file']['name'].'.'.date('Ymdhis')))
$this->_errors[] = $this->l('an error occurred while uploading and copying file'); $this->_errors[] = $this->l('an error occurred while uploading and copying file');
else else
Tools::redirectAdmin($this->currentIndex.'&token='.Tools::getValue('token').'&conf=18'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=18');
} }
elseif (Tools::isSubmit('submitImportFile')) elseif (Tools::isSubmit('submitImportFile'))
$this->displayCSV(); $this->displayCSV();
+2 -2
View File
@@ -66,7 +66,7 @@ class AdminInvoices extends AdminTab
echo ' echo '
<h2>'.$this->l('Print PDF invoices').'</h2> <h2>'.$this->l('Print PDF invoices').'</h2>
<fieldset style="float:left;width:300px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By date').'</legend> <fieldset style="float:left;width:300px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By date').'</legend>
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<label style="width:90px">'.$this->l('From:').' </label> <label style="width:90px">'.$this->l('From:').' </label>
<div class="margin-form" style="padding-left:100px"> <div class="margin-form" style="padding-left:100px">
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup> <input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
@@ -84,7 +84,7 @@ class AdminInvoices extends AdminTab
</form> </form>
</fieldset> </fieldset>
<fieldset style="float:left;width: 500px;margin-left:10px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By statuses').'</legend> <fieldset style="float:left;width: 500px;margin-left:10px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By statuses').'</legend>
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<label style="width:90px">'.$this->l('Statuses').' :</label> <label style="width:90px">'.$this->l('Statuses').' :</label>
<div class="margin-form" style="padding-left:100px"> <div class="margin-form" style="padding-left:100px">
<ul>'; <ul>';
+6 -6
View File
@@ -136,7 +136,7 @@ class AdminLanguages extends AdminTab
elseif ($object->id == $cookie->id_lang) elseif ($object->id == $cookie->id_lang)
$this->_errors[] = $this->l('You cannot delete the language currently in use. Please change languages before deleting.'); $this->_errors[] = $this->l('You cannot delete the language currently in use. Please change languages before deleting.');
elseif ($this->deleteNoPictureImages((int)(Tools::getValue('id_lang'))) AND $object->delete()) elseif ($this->deleteNoPictureImages((int)(Tools::getValue('id_lang'))) AND $object->delete())
Tools::redirectAdmin($currentIndex.'&conf=1'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=1'.'&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
@@ -283,9 +283,9 @@ class AdminLanguages extends AdminTab
{ {
$tmp = explode('!', $key); $tmp = explode('!', $key);
$key = isset($tmp[1]) ? $tmp[1] : $tmp[0]; $key = isset($tmp[1]) ? $tmp[1] : $tmp[0];
echo '<td class="pointer '.(isset($params['align']) ? $params['align'] : '').'" onclick="document.location = \''.$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'">'; echo '<td class="pointer '.(isset($params['align']) ? $params['align'] : '').'" onclick="document.location = \''.self::$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'">';
if (isset($params['active']) AND isset($tr[$key])) if (isset($params['active']) AND isset($tr[$key]))
echo '<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&'.$params['active'].'&token='.($token != NULL ? $token : $this->token).'"><img src="../img/admin/'.$active['img'].'.gif" alt="active" title="'.$active['title'].'" /></a>'; echo '<a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&'.$params['active'].'&token='.($token != NULL ? $token : $this->token).'"><img src="../img/admin/'.$active['img'].'.gif" alt="active" title="'.$active['title'].'" /></a>';
elseif (isset($params['image'])) elseif (isset($params['image']))
echo cacheImage(_PS_IMG_DIR_.$params['image'].'/'.$id.(isset($tr['id_image']) ? '-'.(int)($tr['id_image']) : '').'.'.$this->imageType, $this->table.'_mini_'.$id.'.'.$this->imageType, 45, $this->imageType); echo cacheImage(_PS_IMG_DIR_.$params['image'].'/'.$id.(isset($tr['id_image']) ? '-'.(int)($tr['id_image']) : '').'.'.$this->imageType, $this->table.'_mini_'.$id.'.'.$this->imageType, 45, $this->imageType);
elseif (isset($tr[$key])) elseif (isset($tr[$key]))
@@ -299,11 +299,11 @@ class AdminLanguages extends AdminTab
echo '<td class="center">'; echo '<td class="center">';
if ($this->edit) if ($this->edit)
echo ' echo '
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token != NULL ? $token : $this->token).'"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token != NULL ? $token : $this->token).'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>'; <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>';
if ($this->delete) if ($this->delete)
echo ' echo '
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != NULL ? $token : $this->token).'" onclick="return confirm(\''.$this->l('When you delete a language, ALL RELATED TRANSLATIONS IN THE DATABASE WILL BE DELETED, are you sure you want to delete this language?', __CLASS__, true, false).'\');"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != NULL ? $token : $this->token).'" onclick="return confirm(\''.$this->l('When you delete a language, ALL RELATED TRANSLATIONS IN THE DATABASE WILL BE DELETED, are you sure you want to delete this language?', __CLASS__, true, false).'\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>'; <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>';
echo '</td>'; echo '</td>';
} }
@@ -328,7 +328,7 @@ class AdminLanguages extends AdminTab
var download = "'.$this->l('Download').'"; var download = "'.$this->l('Download').'";
</script> </script>
<script type="text/javascript" src="'._PS_JS_DIR_.'checkLangPack.js"></script> <script type="text/javascript" src="'._PS_JS_DIR_.'checkLangPack.js"></script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Languages').'</legend> <fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Languages').'</legend>
<input type="hidden" value="'._PS_VERSION_.'" name="ps_version" id="ps_version" /> <input type="hidden" value="'._PS_VERSION_.'" name="ps_version" id="ps_version" />
+2 -2
View File
@@ -79,7 +79,7 @@ class AdminLocalization extends AdminPreferences
if (!$localizationPack->loadLocalisationPack($pack, $selection)) if (!$localizationPack->loadLocalisationPack($pack, $selection))
$this->_errors = array_merge($this->_errors, $localizationPack->getErrors()); $this->_errors = array_merge($this->_errors, $localizationPack->getErrors());
else else
Tools::redirectAdmin($currentIndex.'&conf=23&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=23&token='.$this->token);
} }
@@ -93,7 +93,7 @@ class AdminLocalization extends AdminPreferences
$this->_displayForm('localization', $this->_fieldsLocalization, $this->l('Localization'), 'width2', 'localization'); $this->_displayForm('localization', $this->_fieldsLocalization, $this->l('Localization'), 'width2', 'localization');
echo '<br /> echo '<br />
<form method="post" action="'.$currentIndex.'&token='.$this->token.'" class="width2" enctype="multipart/form-data"> <form method="post" action="'.self::$currentIndex.'&token='.$this->token.'" class="width2" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend><img src="../img/admin/localization.gif" />'.$this->l('Localization pack import').'</legend> <legend><img src="../img/admin/localization.gif" />'.$this->l('Localization pack import').'</legend>
<div style="clear: both; padding-top: 15px;"> <div style="clear: both; padding-top: 15px;">
+1 -1
View File
@@ -105,7 +105,7 @@ class AdminManufacturers extends AdminTab
$langtags = 'cdesc2¤cdesc¤mmeta_title¤mmeta_keywords¤mmeta_description'; $langtags = 'cdesc2¤cdesc¤mmeta_title¤mmeta_keywords¤mmeta_description';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($manufacturer->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$manufacturer->id.'" />' : '').' '.($manufacturer->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$manufacturer->id.'" />' : '').'
<fieldset style="width: 905px;"> <fieldset style="width: 905px;">
<legend><img src="../img/admin/manufacturers.gif" />'.$this->l('Manufacturers').'</legend> <legend><img src="../img/admin/manufacturers.gif" />'.$this->l('Manufacturers').'</legend>
+1 -1
View File
@@ -154,7 +154,7 @@ class AdminMessages extends AdminTab
foreach ($this->_list AS $k => &$item) foreach ($this->_list AS $k => &$item)
if ($item['id_order'] == '--') if ($item['id_order'] == '--')
$this->_list[$k]['last_message'] .= ' <a class="iframe" onclick="$(this).parent().attr(\'onclick\', \'return false\');" href="'.$currentIndex.'&token='.Tools::getAdminToken('AdminMessages'.(int)(Tab::getIdFromClassName('AdminMessages')).(int)($cookie->id_employee)).'&ajax=1&id_cart='.(int)$this->_list[$k]['id_cart'].'" title="'.$this->l('View details').'"><img src="../img/admin/details.gif" alt="'.$this->l('View details').'" /></a>'; $this->_list[$k]['last_message'] .= ' <a class="iframe" onclick="$(this).parent().attr(\'onclick\', \'return false\');" href="'.self::$currentIndex.'&token='.Tools::getAdminToken('AdminMessages'.(int)(Tab::getIdFromClassName('AdminMessages')).(int)($cookie->id_employee)).'&ajax=1&id_cart='.(int)$this->_list[$k]['id_cart'].'" title="'.$this->l('View details').'"><img src="../img/admin/details.gif" alt="'.$this->l('View details').'" /></a>';
echo ' echo '
<link href="'._PS_CSS_DIR_.'jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" media="screen" /> <link href="'._PS_CSS_DIR_.'jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" media="screen" />
+1 -1
View File
@@ -69,7 +69,7 @@ class AdminMeta extends AdminTab
return; return;
$files = Meta::getPages(true, ($meta->page ? $meta->page : false)); $files = Meta::getPages(true, ($meta->page ? $meta->page : false));
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'&submitAdd'.$this->table.'=1" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'&submitAdd'.$this->table.'=1" method="post">
'.($meta->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$meta->id.'" />' : '').' '.($meta->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$meta->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/metatags.gif" />'.$this->l('Meta-Tags').'</legend> <fieldset><legend><img src="../img/admin/metatags.gif" />'.$this->l('Meta-Tags').'</legend>
<label>'.$this->l('Page:').' </label> <label>'.$this->l('Page:').' </label>
+23 -23
View File
@@ -105,12 +105,12 @@ class AdminModules extends AdminTab
if (Tools::isSubmit('filterModules')) if (Tools::isSubmit('filterModules'))
{ {
$this->setFilterModules(Tools::getValue('module_type'), Tools::getValue('country_module_value'), Tools::getValue('module_install'), Tools::getValue('module_status')); $this->setFilterModules(Tools::getValue('module_type'), Tools::getValue('country_module_value'), Tools::getValue('module_install'), Tools::getValue('module_status'));
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
elseif (Tools::isSubmit('resetFilterModules')) elseif (Tools::isSubmit('resetFilterModules'))
{ {
$this->resetFilterModules(); $this->resetFilterModules();
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
if (Tools::isSubmit('active')) if (Tools::isSubmit('active'))
{ {
@@ -120,7 +120,7 @@ class AdminModules extends AdminTab
if (Validate::isLoadedObject($module)) if (Validate::isLoadedObject($module))
{ {
$module->enable(); $module->enable();
Tools::redirectAdmin($currentIndex.'&conf=5&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name); Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name);
} else } else
$this->_errors[] = Tools::displayError('Cannot load module object'); $this->_errors[] = Tools::displayError('Cannot load module object');
} else } else
@@ -134,7 +134,7 @@ class AdminModules extends AdminTab
if (Validate::isLoadedObject($module)) if (Validate::isLoadedObject($module))
{ {
$module->disable(); $module->disable();
Tools::redirectAdmin($currentIndex.'&conf=5&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name); Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name);
} else } else
$this->_errors[] = Tools::displayError('Cannot load module object'); $this->_errors[] = Tools::displayError('Cannot load module object');
} else } else
@@ -149,7 +149,7 @@ class AdminModules extends AdminTab
{ {
if ($module->uninstall()) if ($module->uninstall())
if ($module->install()) if ($module->install())
Tools::redirectAdmin($currentIndex.'&conf=21'.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name); Tools::redirectAdmin(self::$currentIndex.'&conf=21'.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name);
else else
$this->_errors[] = Tools::displayError('Cannot install module'); $this->_errors[] = Tools::displayError('Cannot install module');
else else
@@ -223,9 +223,9 @@ class AdminModules extends AdminTab
{ {
$moduleDir = _PS_MODULE_DIR_.str_replace(array('.', '/', '\\'), array('', '', ''), Tools::getValue('module_name')); $moduleDir = _PS_MODULE_DIR_.str_replace(array('.', '/', '\\'), array('', '', ''), Tools::getValue('module_name'));
$this->recursiveDeleteOnDisk($moduleDir); $this->recursiveDeleteOnDisk($moduleDir);
Tools::redirectAdmin($currentIndex.'&conf=22&token='.$this->token.'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name')); Tools::redirectAdmin(self::$currentIndex.'&conf=22&token='.$this->token.'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name'));
} }
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to delete here.'); $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
@@ -262,7 +262,7 @@ class AdminModules extends AdminTab
{ {
if (((method_exists($module, $method) && ($echo = $module->{$method}())) || ($echo = ' ')) AND $key == 'configure' AND Module::isInstalled($module->name)) if (((method_exists($module, $method) && ($echo = $module->{$method}())) || ($echo = ' ')) AND $key == 'configure' AND Module::isInstalled($module->name))
{ {
$backlink = $currentIndex.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name; $backlink = self::$currentIndex.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name;
$hooklink = 'index.php?tab=AdminModulesPositions&token='.Tools::getAdminTokenLite('AdminModulesPositions').'&show_modules='.(int)$module->id; $hooklink = 'index.php?tab=AdminModulesPositions&token='.Tools::getAdminTokenLite('AdminModulesPositions').'&show_modules='.(int)$module->id;
$tradlink = 'index.php?tab=AdminTranslations&token='.Tools::getAdminTokenLite('AdminTranslations').'&type=modules&lang='; $tradlink = 'index.php?tab=AdminTranslations&token='.Tools::getAdminTokenLite('AdminTranslations').'&type=modules&lang=';
@@ -323,7 +323,7 @@ class AdminModules extends AdminTab
} }
} }
if ($return) if ($return)
Tools::redirectAdmin($currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name); Tools::redirectAdmin(self::$currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name);
} }
} }
@@ -347,7 +347,7 @@ class AdminModules extends AdminTab
@unlink($file); @unlink($file);
if ($success) if ($success)
Tools::redirectAdmin($currentIndex.'&conf=8'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token);
} }
public function display() public function display()
@@ -386,7 +386,7 @@ class AdminModules extends AdminTab
module_list += \'|\'+modules[i].value; module_list += \'|\'+modules[i].value;
} }
} }
document.location.href=\''.$currentIndex.'&token='.$this->token.'&\'+action+\'=\'+module_list.substring(1, module_list.length); document.location.href=\''.self::$currentIndex.'&token='.$this->token.'&\'+action+\'=\'+module_list.substring(1, module_list.length);
} }
$(\'document\').ready( function() { $(\'document\').ready( function() {
$(\'input[name="filtername"]\').autocomplete(moduleList, { $(\'input[name="filtername"]\').autocomplete(moduleList, {
@@ -599,7 +599,7 @@ class AdminModules extends AdminTab
<img src="https://addons.prestashop.com/modules.php?'.(isset($_SERVER['SERVER_ADDR']) ? 'server='.ip2long($_SERVER['SERVER_ADDR']).'&' : '').'mods='.$serialModules.'" alt="Add" class="middle" /> <img src="https://addons.prestashop.com/modules.php?'.(isset($_SERVER['SERVER_ADDR']) ? 'server='.ip2long($_SERVER['SERVER_ADDR']).'&' : '').'mods='.$serialModules.'" alt="Add" class="middle" />
'.$this->l('Add a module from PrestaShop Addons').' '.$this->l('Add a module from PrestaShop Addons').'
</a>'; </a>';
echo '<form action="'.$currentIndex.'&token='.$this->token.'" method="post" id="filternameForm" style="float:right"><input type="text" name="filtername" value="'.Tools::htmlentitiesUTF8(Tools::getValue('filtername')).'" /> <input type="submit" value="'.$this->l('Search').'" class="button" /></form> echo '<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" id="filternameForm" style="float:right"><input type="text" name="filtername" value="'.Tools::htmlentitiesUTF8(Tools::getValue('filtername')).'" /> <input type="submit" value="'.$this->l('Search').'" class="button" /></form>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<div id="module_install" style="width:900px; '.((Tools::isSubmit('submitDownload') OR Tools::isSubmit('submitDownload2')) ? '' : 'display: none;').'"> <div id="module_install" style="width:900px; '.((Tools::isSubmit('submitDownload') OR Tools::isSubmit('submitDownload2')) ? '' : 'display: none;').'">
<fieldset> <fieldset>
@@ -607,7 +607,7 @@ class AdminModules extends AdminTab
<p>'.$this->l('The module must be either a zip file or a tarball.').'</p> <p>'.$this->l('The module must be either a zip file or a tarball.').'</p>
<hr /> <hr />
<div style="float:right;margin-right:50px;border-left:solid 1px #DFD5C3"> <div style="float:right;margin-right:50px;border-left:solid 1px #DFD5C3">
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<label style="width: 100px">'.$this->l('Module file').'</label> <label style="width: 100px">'.$this->l('Module file').'</label>
<div class="margin-form" style="padding-left: 140px"> <div class="margin-form" style="padding-left: 140px">
<input type="file" name="file" /> <input type="file" name="file" />
@@ -619,7 +619,7 @@ class AdminModules extends AdminTab
</form> </form>
</div> </div>
<div> <div>
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<label style="width: 100px">'.$this->l('Module URL').'</label> <label style="width: 100px">'.$this->l('Module URL').'</label>
<div class="margin-form" style="padding-left: 140px"> <div class="margin-form" style="padding-left: 140px">
<input type="text" name="url" style="width: 200px;" value="'.(Tools::getValue('url') ? Tools::getValue('url') : 'http://').'" /> <input type="text" name="url" style="width: 200px;" value="'.(Tools::getValue('url') ? Tools::getValue('url') : 'http://').'" />
@@ -650,7 +650,7 @@ class AdminModules extends AdminTab
foreach ($orderModule AS $tabModule) foreach ($orderModule AS $tabModule)
foreach ($tabModule AS $module) foreach ($tabModule AS $module)
if ($module->active AND isset($module->warning) && $module->warning) if ($module->active AND isset($module->warning) && $module->warning)
$warnings[] ='<a href="'.$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'">'.$module->displayName.'</a> - '.stripslashes(pSQL($module->warning)); $warnings[] ='<a href="'.self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'">'.$module->displayName.'</a> - '.stripslashes(pSQL($module->warning));
$this->displayWarning($warnings); $this->displayWarning($warnings);
echo '<form method="POST"> echo '<form method="POST">
<table cellpadding="0" cellspacing="0" style="width:100%;;margin-bottom:5px;"> <table cellpadding="0" cellspacing="0" style="width:100%;;margin-bottom:5px;">
@@ -811,16 +811,16 @@ class AdminModules extends AdminTab
echo '</td> echo '</td>
<td class="center" style="width:60px" rowspan="2">'; <td class="center" style="width:60px" rowspan="2">';
if ($module->id) if ($module->id)
echo '<a href="'.$currentIndex.'&token='.$this->token.'&module_name='.$module->name.'&'.($module->active ? 'enable=0' : 'enable=1').'">'; echo '<a href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.$module->name.'&'.($module->active ? 'enable=0' : 'enable=1').'">';
echo $img; echo $img;
if ($module->id) if ($module->id)
'</a>'; '</a>';
$href = $currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name; $href = self::$currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name;
echo ' echo '
</td> </td>
<td class="center" width="120" rowspan="2">'.((!$module->id) <td class="center" width="120" rowspan="2">'.((!$module->id)
? '<input type="button" class="button small" name="Install" value="'.$this->l('Install').'" ? '<input type="button" class="button small" name="Install" value="'.$this->l('Install').'"
onclick="javascript:document.location.href=\''.$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'\'">' onclick="javascript:document.location.href=\''.self::$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'\'">'
: '<input type="button" class="button small" name="Uninstall" value="'.$this->l('Uninstall').'" : '<input type="button" class="button small" name="Uninstall" value="'.$this->l('Uninstall').'"
onclick="'.((!method_exists($module, 'onclickOption')) ? ((empty($module->confirmUninstall)) ? '' : 'if(confirm(\''.addslashes($module->confirmUninstall).'\')) ').'document.location.href=\''.$href.'\'' : $module->onclickOption('uninstall', $href)).'">').'</td> onclick="'.((!method_exists($module, 'onclickOption')) ? ((empty($module->confirmUninstall)) ? '' : 'if(confirm(\''.addslashes($module->confirmUninstall).'\')) ').'document.location.href=\''.$href.'\'' : $module->onclickOption('uninstall', $href)).'">').'</td>
@@ -880,19 +880,19 @@ class AdminModules extends AdminTab
global $currentIndex; global $currentIndex;
$return = ''; $return = '';
$href = $currentIndex.'&token='.$this->token.'&module_name='. $href = self::$currentIndex.'&token='.$this->token.'&module_name='.
urlencode($module->name).'&tab_module='.$module->tab; urlencode($module->name).'&tab_module='.$module->tab;
if ($module->id) if ($module->id)
$return .= '<a class="action_module" '.($module->active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'" '.((Tools::isMultiShopActivated()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).'</a>&nbsp;&nbsp;'; $return .= '<a class="action_module" '.($module->active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'" '.((Tools::isMultiShopActivated()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).'</a>&nbsp;&nbsp;';
if ($module->id AND $module->active) if ($module->id AND $module->active)
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('reset', $href).'"' : '').' href="'.$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Reset').'</a>&nbsp;&nbsp;'; $return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('reset', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Reset').'</a>&nbsp;&nbsp;';
if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Tools::isMultiShopActivated())) if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Tools::isMultiShopActivated()))
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('configure', $href).'"' : '').' href="'.$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Configure').'</a>&nbsp;&nbsp;'; $return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('configure', $href).'"' : '').' href="'.self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Configure').'</a>&nbsp;&nbsp;';
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('delete', $href).'"' : '').' onclick="return confirm(\''.$this->l('This action will permanently remove the module from the server. Are you sure you want to do this ?').'\');" href="'.$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Delete').'</a>&nbsp;&nbsp;'; $return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('delete', $href).'"' : '').' onclick="return confirm(\''.$this->l('This action will permanently remove the module from the server. Are you sure you want to do this ?').'\');" href="'.self::$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Delete').'</a>&nbsp;&nbsp;';
return $return; return $return;
} }
+17 -17
View File
@@ -46,7 +46,7 @@ class AdminModulesPositions extends AdminTab
if (Validate::isLoadedObject($module)) if (Validate::isLoadedObject($module))
{ {
$module->updatePosition($id_hook, (int)(Tools::getValue('direction'))); $module->updatePosition($id_hook, (int)(Tools::getValue('direction')));
Tools::redirectAdmin($this->currentIndex.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('module cannot be loaded'); $this->_errors[] = Tools::displayError('module cannot be loaded');
@@ -87,7 +87,7 @@ class AdminModulesPositions extends AdminTab
elseif (!$module->registerExceptions($id_hook, $excepts, Shop::getListFromContext())) elseif (!$module->registerExceptions($id_hook, $excepts, Shop::getListFromContext()))
$this->_errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->_errors[] = Tools::displayError('An error occurred while transplanting module to hook.');
else else
Tools::redirectAdmin($this->currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
} }
else else
@@ -129,7 +129,7 @@ class AdminModulesPositions extends AdminTab
} }
if (!$this->_errors) if (!$this->_errors)
Tools::redirectAdmin($this->currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
else else
{ {
@@ -144,7 +144,7 @@ class AdminModulesPositions extends AdminTab
if (!$module->editExceptions($id_hook, $exceptions, Shop::getListFromContext())) if (!$module->editExceptions($id_hook, $exceptions, Shop::getListFromContext()))
$this->_errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->_errors[] = Tools::displayError('An error occurred while transplanting module to hook.');
else else
Tools::redirectAdmin($this->currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
} }
} }
@@ -170,7 +170,7 @@ class AdminModulesPositions extends AdminTab
if (!$module->unregisterHook($id_hook, Shop::getListFromContext()) OR !$module->unregisterExceptions($id_hook, Shop::getListFromContext())) if (!$module->unregisterHook($id_hook, Shop::getListFromContext()) OR !$module->unregisterExceptions($id_hook, Shop::getListFromContext()))
$this->_errors[] = Tools::displayError('An error occurred while deleting module from hook.'); $this->_errors[] = Tools::displayError('An error occurred while deleting module from hook.');
else else
Tools::redirectAdmin($this->currentIndex.'&conf=17'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=17'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
} }
else else
@@ -200,7 +200,7 @@ class AdminModulesPositions extends AdminTab
} }
} }
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($this->currentIndex.'&conf=17'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=17'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token);
} }
} }
} }
@@ -227,13 +227,13 @@ class AdminModulesPositions extends AdminTab
</script> </script>
<script type="text/javascript" src="../js/admin-dnd.js"></script> <script type="text/javascript" src="../js/admin-dnd.js"></script>
'; ';
echo '<a href="'.$this->currentIndex.'&addToHook'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Transplant a module').'</b></a><br /><br />'; echo '<a href="'.self::$currentIndex.'&addToHook'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/add.gif" border="0" /> <b>'.$this->l('Transplant a module').'</b></a><br /><br />';
// Print select list // Print select list
echo ' echo '
<form> <form>
'.$this->l('Show').' : '.$this->l('Show').' :
<select id="show_modules" onChange="autoUrl(\'show_modules\', \''.$this->currentIndex.'&token='.$this->token.'&show_modules=\')"> <select id="show_modules" onChange="autoUrl(\'show_modules\', \''.self::$currentIndex.'&token='.$this->token.'&show_modules=\')">
<option value="all">'.$this->l('All modules').'&nbsp;</option> <option value="all">'.$this->l('All modules').'&nbsp;</option>
<option>---------------</option>'; <option>---------------</option>';
$modules = Module::getModulesInstalled(); $modules = Module::getModulesInstalled();
@@ -249,7 +249,7 @@ class AdminModulesPositions extends AdminTab
echo ' echo '
</select> </select>
<br /><br /> <br /><br />
<input type="checkbox" id="hook_position" onclick="autoUrlNoList(\'hook_position\', \''.$this->currentIndex.'&token='.$this->token.'&show_modules='.(int)(Tools::getValue('show_modules')).'&hook_position=\')" '.(Tools::getValue('hook_position') ? 'checked="checked" ' : '').' />&nbsp;<label class="t" for="hook_position">'.$this->l('Display non-positionable hook').'</label> <input type="checkbox" id="hook_position" onclick="autoUrlNoList(\'hook_position\', \''.self::$currentIndex.'&token='.$this->token.'&show_modules='.(int)(Tools::getValue('show_modules')).'&hook_position=\')" '.(Tools::getValue('hook_position') ? 'checked="checked" ' : '').' />&nbsp;<label class="t" for="hook_position">'.$this->l('Display non-positionable hook').'</label>
</form> </form>
<fieldset style="width:250px;float:right"><legend>'.$this->l('Live edit').'</legend>'; <fieldset style="width:250px;float:right"><legend>'.$this->l('Live edit').'</legend>';
@@ -262,7 +262,7 @@ class AdminModulesPositions extends AdminTab
echo '</fieldset>'; echo '</fieldset>';
// Print hook list // Print hook list
echo '<form method="post" action="'.$this->currentIndex.'&token='.$this->token.'">'; echo '<form method="post" action="'.self::$currentIndex.'&token='.$this->token.'">';
$irow = 0; $irow = 0;
$hooks = Hook::getHooks(!(int)(Tools::getValue('hook_position'))); $hooks = Hook::getHooks(!(int)(Tools::getValue('hook_position')));
@@ -303,8 +303,8 @@ class AdminModulesPositions extends AdminTab
echo ' echo '
<td class="positions" width="40">'.(int)($position).'</td> <td class="positions" width="40">'.(int)($position).'</td>
<td'.(($canMove && $nbModules >= 2) ? ' class="dragHandle"' : '').' id="td_'.$hook['id_hook'].'_'.$instance->id.'" width="40"> <td'.(($canMove && $nbModules >= 2) ? ' class="dragHandle"' : '').' id="td_'.$hook['id_hook'].'_'.$instance->id.'" width="40">
'.(($canMove) ? '<a'.($position == 1 ? ' style="display: none;"' : '' ).' href="'.$this->currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&direction=0&token='.$this->token.'&changePosition='.rand().'#'.$hook['name'].'"><img src="../img/admin/up.gif" alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a><br /> '.(($canMove) ? '<a'.($position == 1 ? ' style="display: none;"' : '' ).' href="'.self::$currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&direction=0&token='.$this->token.'&changePosition='.rand().'#'.$hook['name'].'"><img src="../img/admin/up.gif" alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a><br />
<a '.($position == count($instances) ? ' style="display: none;"' : '').'href="'.$this->currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&direction=1&token='.$this->token.'&changePosition='.rand().'#'.$hook['name'].'"><img src="../img/admin/down.gif" alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>' : '').' <a '.($position == count($instances) ? ' style="display: none;"' : '').'href="'.self::$currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&direction=1&token='.$this->token.'&changePosition='.rand().'#'.$hook['name'].'"><img src="../img/admin/down.gif" alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>' : '').'
</td> </td>
<td style="padding-left: 10px;"><label class="lab_modules_positions" for="mod'.$hook['id_hook'].'_'.$instance->id.'"> <td style="padding-left: 10px;"><label class="lab_modules_positions" for="mod'.$hook['id_hook'].'_'.$instance->id.'">
'; ';
@@ -317,8 +317,8 @@ class AdminModulesPositions extends AdminTab
</label></td> </label></td>
<td width="60">'; <td width="60">';
echo ' echo '
<a href="'.$this->currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&editGraft'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a> <a href="'.self::$currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&editGraft'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>
<a href="'.$this->currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&deleteGraft'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <a href="'.self::$currentIndex.'&id_module='.$instance->id.'&id_hook='.$hook['id_hook'].'&deleteGraft'.($this->displayKey ? '&show_modules='.$this->displayKey : '').'&token='.$this->token.'"><img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
<input type="checkbox" id="mod'.$hook['id_hook'].'_'.$instance->id.'" class="hook'.$hook['id_hook'].'" onclick="hookCheckboxes('.$hook['id_hook'].', 1, this)" name="unhooks[]" value="'.$hook['id_hook'].'_'.$instance->id.'"/>'; <input type="checkbox" id="mod'.$hook['id_hook'].'_'.$instance->id.'" class="hook'.$hook['id_hook'].'" onclick="hookCheckboxes('.$hook['id_hook'].', 1, this)" name="unhooks[]" value="'.$hook['id_hook'].'_'.$instance->id.'"/>';
echo ' echo '
</td> </td>
@@ -341,7 +341,7 @@ class AdminModulesPositions extends AdminTab
{ {
// Check auth for this page // Check auth for this page
if (!$id_module || !$id_hook) if (!$id_module || !$id_hook)
Tools::redirectAdmin($this->currentIndex . '&token='.$this->token); Tools::redirectAdmin(self::$currentIndex . '&token='.$this->token);
$sql = 'SELECT id_module $sql = 'SELECT id_module
FROM '._DB_PREFIX_.'hook_module FROM '._DB_PREFIX_.'hook_module
@@ -349,7 +349,7 @@ class AdminModulesPositions extends AdminTab
AND id_hook = '.$id_hook.' AND id_hook = '.$id_hook.'
AND id_shop IN('.implode(', ', ShopCore::getListFromContext()).')'; AND id_shop IN('.implode(', ', ShopCore::getListFromContext()).')';
if (!Db::getInstance()->getValue($sql)) if (!Db::getInstance()->getValue($sql))
Tools::redirectAdmin($this->currentIndex . '&token='.$this->token); Tools::redirectAdmin(self::$currentIndex . '&token='.$this->token);
$slModule = Module::getInstanceById($id_module); $slModule = Module::getInstanceById($id_module);
$exceptsList = $slModule->getExceptions($id_hook, true); $exceptsList = $slModule->getExceptions($id_hook, true);
@@ -381,7 +381,7 @@ class AdminModulesPositions extends AdminTab
$modules = $instances; $modules = $instances;
$hooks = Hook::getHooks(0); $hooks = Hook::getHooks(0);
echo ' echo '
<form action="'.$this->currentIndex.'&token='.$this->token.'" method="post">'; <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">';
if ($this->displayKey) if ($this->displayKey)
echo '<input type="hidden" name="show_modules" value="'.$this->displayKey.'" />'; echo '<input type="hidden" name="show_modules" value="'.$this->displayKey.'" />';
echo '<fieldset style="width:700px"><legend><img src="../img/t/AdminModulesPositions.gif" />'.$this->l('Transplant a module').'</legend> echo '<fieldset style="width:700px"><legend><img src="../img/t/AdminModulesPositions.gif" />'.$this->l('Transplant a module').'</legend>
+1 -1
View File
@@ -52,7 +52,7 @@ class AdminOrderMessage extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'&submitAdd'.$this->table.'=1" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'&submitAdd'.$this->table.'=1" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/email.gif" />'.$this->l('Order messages').'</legend> <fieldset><legend><img src="../img/admin/email.gif" />'.$this->l('Order messages').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+10 -10
View File
@@ -135,7 +135,7 @@ class AdminOrders extends AdminTab
'{bankwire_details}' => (Configuration::get('BANK_WIRE_DETAILS') ? nl2br(Configuration::get('BANK_WIRE_DETAILS')) : ''), '{bankwire_details}' => (Configuration::get('BANK_WIRE_DETAILS') ? nl2br(Configuration::get('BANK_WIRE_DETAILS')) : ''),
'{bankwire_address}' => (Configuration::get('BANK_WIRE_ADDRESS') ? nl2br(Configuration::get('BANK_WIRE_ADDRESS')) : '')); '{bankwire_address}' => (Configuration::get('BANK_WIRE_ADDRESS') ? nl2br(Configuration::get('BANK_WIRE_ADDRESS')) : ''));
if ($history->addWithemail(true, $templateVars)) if ($history->addWithemail(true, $templateVars))
Tools::redirectAdmin($currentIndex.'&id_order='.$id_order.'&vieworder'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$id_order.'&vieworder'.'&token='.$this->token);
$this->_errors[] = Tools::displayError('An error occurred while changing the status or was unable to send e-mail to the customer.'); $this->_errors[] = Tools::displayError('An error occurred while changing the status or was unable to send e-mail to the customer.');
} }
} }
@@ -178,7 +178,7 @@ class AdminOrders extends AdminTab
if (!$message->add()) if (!$message->add())
$this->_errors[] = Tools::displayError('An error occurred while sending message.'); $this->_errors[] = Tools::displayError('An error occurred while sending message.');
elseif ($message->private) elseif ($message->private)
Tools::redirectAdmin($currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token);
elseif (Validate::isLoadedObject($customer = new Customer($id_customer))) elseif (Validate::isLoadedObject($customer = new Customer($id_customer)))
{ {
$order = new Order((int)($message->id_order)); $order = new Order((int)($message->id_order));
@@ -186,7 +186,7 @@ class AdminOrders extends AdminTab
{ {
$varsTpl = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order}' => $message->id_order, '{message}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $message->message : nl2br2($message->message))); $varsTpl = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order}' => $message->id_order, '{message}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $message->message : nl2br2($message->message)));
if (@Mail::Send((int)($order->id_lang), 'order_merchant_comment', Mail::l('New message regarding your order'), $varsTpl, $customer->email, $customer->firstname.' '.$customer->lastname)) if (@Mail::Send((int)($order->id_lang), 'order_merchant_comment', Mail::l('New message regarding your order'), $varsTpl, $customer->email, $customer->firstname.' '.$customer->lastname))
Tools::redirectAdmin($currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token);
} }
} }
$this->_errors[] = Tools::displayError('An error occurred while sending e-mail to customer.'); $this->_errors[] = Tools::displayError('An error occurred while sending e-mail to customer.');
@@ -345,7 +345,7 @@ class AdminOrders extends AdminTab
// Redirect if no errors // Redirect if no errors
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($currentIndex.'&id_order='.$order->id.'&vieworder&conf=24&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=24&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to delete here.'); $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
@@ -483,9 +483,9 @@ class AdminOrders extends AdminTab
$row = array_shift($history); $row = array_shift($history);
if ($prevOrder = Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_order < '.(int)$order->id.' ORDER BY id_order DESC')) if ($prevOrder = Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_order < '.(int)$order->id.' ORDER BY id_order DESC'))
$prevOrder = '<a href="'.$currentIndex.'&token='.Tools::getValue('token').'&vieworder&id_order='.$prevOrder.'"><img style="width:24px;height:24px" src="../img/admin/arrow-left.png" /></a>'; $prevOrder = '<a href="'.self::$currentIndex.'&token='.Tools::getValue('token').'&vieworder&id_order='.$prevOrder.'"><img style="width:24px;height:24px" src="../img/admin/arrow-left.png" /></a>';
if ($nextOrder = Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_order > '.(int)$order->id.' ORDER BY id_order ASC')) if ($nextOrder = Db::getInstance()->getValue('SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_order > '.(int)$order->id.' ORDER BY id_order ASC'))
$nextOrder = '<a href="'.$currentIndex.'&token='.Tools::getValue('token').'&vieworder&id_order='.$nextOrder.'"><img style="width:24px;height:24px" src="../img/admin/arrow-right.png" /></a>'; $nextOrder = '<a href="'.self::$currentIndex.'&token='.Tools::getValue('token').'&vieworder&id_order='.$nextOrder.'"><img style="width:24px;height:24px" src="../img/admin/arrow-right.png" /></a>';
if ($order->total_paid != $order->total_paid_real) if ($order->total_paid != $order->total_paid_real)
@@ -545,7 +545,7 @@ class AdminOrders extends AdminTab
/* Display status form */ /* Display status form */
echo ' echo '
<form action="'.$currentIndex.'&view'.$this->table.'&token='.$this->token.'" method="post" style="text-align:center;"> <form action="'.self::$currentIndex.'&view'.$this->table.'&token='.$this->token.'" method="post" style="text-align:center;">
<select name="id_order_state">'; <select name="id_order_state">';
$currentStateTab = $order->getCurrentStateFull($cookie->id_lang); $currentStateTab = $order->getCurrentStateFull($cookie->id_lang);
foreach ($states AS $state) foreach ($states AS $state)
@@ -642,7 +642,7 @@ class AdminOrders extends AdminTab
/* Display shipping number field */ /* Display shipping number field */
if ($carrier->url && $order->hasBeenShipped()) if ($carrier->url && $order->hasBeenShipped())
echo ' echo '
<form action="'.$currentIndex.'&view'.$this->table.'&token='.$this->token.'" method="post" style="margin-top:10px;"> <form action="'.self::$currentIndex.'&view'.$this->table.'&token='.$this->token.'" method="post" style="margin-top:10px;">
<input type="text" name="shipping_number" value="'. $order->shipping_number.'" /> <input type="text" name="shipping_number" value="'. $order->shipping_number.'" />
<input type="hidden" name="id_order" value="'.$order->id.'" /> <input type="hidden" name="id_order" value="'.$order->id.'" />
<input type="submit" name="submitShippingNumber" value="'.$this->l('Set shipping number').'" class="button" /> <input type="submit" name="submitShippingNumber" value="'.$this->l('Set shipping number').'" class="button" />
@@ -719,7 +719,7 @@ class AdminOrders extends AdminTab
// List of products // List of products
echo ' echo '
<a name="products"><br /></a> <a name="products"><br /></a>
<form action="'.$currentIndex.'&submitCreditSlip&vieworder&token='.$this->token.'" method="post" onsubmit="return orderDeleteProduct(\''.$this->l('Cannot return this product').'\', \''.$this->l('Quantity to cancel is greater than quantity available').'\');"> <form action="'.self::$currentIndex.'&submitCreditSlip&vieworder&token='.$this->token.'" method="post" onsubmit="return orderDeleteProduct(\''.$this->l('Cannot return this product').'\', \''.$this->l('Quantity to cancel is greater than quantity available').'\');">
<input type="hidden" name="id_order" value="'.$order->id.'" /> <input type="hidden" name="id_order" value="'.$order->id.'" />
<fieldset style="width: 868px; "> <fieldset style="width: 868px; ">
<legend><img src="../img/admin/cart.gif" alt="'.$this->l('Products').'" />'.$this->l('Products').'</legend> <legend><img src="../img/admin/cart.gif" alt="'.$this->l('Products').'" />'.$this->l('Products').'</legend>
@@ -942,7 +942,7 @@ class AdminOrders extends AdminTab
echo '</fieldset> echo '</fieldset>
</div>'; </div>';
echo '<div class="clear">&nbsp;</div>'; echo '<div class="clear">&nbsp;</div>';
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
public function displayAddressDetail($addressDelivery) public function displayAddressDetail($addressDelivery)
+1 -1
View File
@@ -115,7 +115,7 @@ class AdminOrdersStates extends AdminTab
return; return;
echo '<script type="text/javascript" src="../js/jquery/jquery-colorpicker.js"></script> echo '<script type="text/javascript" src="../js/jquery/jquery-colorpicker.js"></script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/time.gif" />'.$this->l('Order statuses').'</legend> <fieldset><legend><img src="../img/admin/time.gif" />'.$this->l('Order statuses').'</legend>
<label>'.$this->l('Status name:').' </label> <label>'.$this->l('Status name:').' </label>
+2 -2
View File
@@ -93,7 +93,7 @@ class AdminPayment extends AdminTab
$values[] = '('.(int)$module->id.', '.Context::getContext()->shop->getID().', '.(int)$selected.')'; $values[] = '('.(int)$module->id.', '.Context::getContext()->shop->getID().', '.(int)$selected.')';
if (sizeof($values)) if (sizeof($values))
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'module_'.$type.' (`id_module`, `id_shop`, `id_'.$type.'`) VALUES '.implode(',', $values)); Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'module_'.$type.' (`id_module`, `id_shop`, `id_'.$type.'`) VALUES '.implode(',', $values));
Tools::redirectAdmin($currentIndex.'&conf=4'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4'.'&token='.$this->token);
} }
public function display() public function display()
@@ -141,7 +141,7 @@ class AdminPayment extends AdminTab
$irow = 0; $irow = 0;
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" id="form_'.$nameId.'"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" id="form_'.$nameId.'">
<fieldset> <fieldset>
<legend><img src="../img/admin/'.$icon.'.gif" />'.$title.'</legend> <legend><img src="../img/admin/'.$icon.'.gif" />'.$title.'</legend>
<p>'.$desc.'<br />'.$this->youEditFieldFor().'<p> <p>'.$desc.'<br />'.$this->youEditFieldFor().'<p>
+14 -14
View File
@@ -64,7 +64,7 @@ class AdminPerformance extends AdminTab
{ {
$settings = preg_replace('/define\(\'_PS_CACHE_ENABLED_\', \'([0-9])\'\);/Ui', 'define(\'_PS_CACHE_ENABLED_\', \''.(int)$cache_active.'\');', $settings); $settings = preg_replace('/define\(\'_PS_CACHE_ENABLED_\', \'([0-9])\'\);/Ui', 'define(\'_PS_CACHE_ENABLED_\', \''.(int)$cache_active.'\');', $settings);
if (file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $settings)) if (file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $settings))
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else else
$this->_errors[] = Tools::displayError('Cannot overwrite settings file.'); $this->_errors[] = Tools::displayError('Cannot overwrite settings file.');
} }
@@ -85,7 +85,7 @@ class AdminPerformance extends AdminTab
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
{ {
if (MCached::addServer(pSQL(Tools::getValue('memcachedIp')), (int)Tools::getValue('memcachedPort'), (int)Tools::getValue('memcachedWeight'))) if (MCached::addServer(pSQL(Tools::getValue('memcachedIp')), (int)Tools::getValue('memcachedPort'), (int)Tools::getValue('memcachedWeight')))
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else else
$this->_errors[] = Tools::displayError('Cannot add Memcached server'); $this->_errors[] = Tools::displayError('Cannot add Memcached server');
} }
@@ -98,7 +98,7 @@ class AdminPerformance extends AdminTab
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
{ {
if (MCached::deleteServer((int)Tools::getValue('deleteMemcachedServer'))) if (MCached::deleteServer((int)Tools::getValue('deleteMemcachedServer')))
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else else
$this->_errors[] = Tools::displayError('Error in deleting Memcached server'); $this->_errors[] = Tools::displayError('Error in deleting Memcached server');
} }
@@ -137,7 +137,7 @@ class AdminPerformance extends AdminTab
if (file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $settings)) if (file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $settings))
{ {
Configuration::updateValue('PS_CIPHER_ALGORITHM', $algo); Configuration::updateValue('PS_CIPHER_ALGORITHM', $algo);
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
else else
$this->_errors[] = Tools::displayError('Cannot overwrite settings file.'); $this->_errors[] = Tools::displayError('Cannot overwrite settings file.');
@@ -160,7 +160,7 @@ class AdminPerformance extends AdminTab
) )
$this->_errors[] = Tools::displayError('Unknown error.'); $this->_errors[] = Tools::displayError('Unknown error.');
else else
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.'); $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
@@ -185,7 +185,7 @@ class AdminPerformance extends AdminTab
unset($this->_fieldsGeneral['_MEDIA_SERVER_1_']); unset($this->_fieldsGeneral['_MEDIA_SERVER_1_']);
unset($this->_fieldsGeneral['_MEDIA_SERVER_2_']); unset($this->_fieldsGeneral['_MEDIA_SERVER_2_']);
unset($this->_fieldsGeneral['_MEDIA_SERVER_3_']); unset($this->_fieldsGeneral['_MEDIA_SERVER_3_']);
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
} }
else else
@@ -197,7 +197,7 @@ class AdminPerformance extends AdminTab
{ {
Configuration::updateValue('PS_SMARTY_FORCE_COMPILE', Tools::getValue('smarty_force_compile', 0)); Configuration::updateValue('PS_SMARTY_FORCE_COMPILE', Tools::getValue('smarty_force_compile', 0));
Configuration::updateValue('PS_SMARTY_CACHE', Tools::getValue('smarty_cache', 0)); Configuration::updateValue('PS_SMARTY_CACHE', Tools::getValue('smarty_cache', 0));
Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.'); $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
@@ -246,7 +246,7 @@ class AdminPerformance extends AdminTab
'; ';
echo ' echo '
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;">
<fieldset> <fieldset>
<legend><img src="../img/admin/prefs.gif" /> '.$this->l('Smarty').'</legend> <legend><img src="../img/admin/prefs.gif" /> '.$this->l('Smarty').'</legend>
@@ -270,7 +270,7 @@ class AdminPerformance extends AdminTab
</form>'; </form>';
echo ' echo '
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;">
<fieldset> <fieldset>
<legend><img src="../img/admin/arrow_in.png" /> '.$this->l('CCC (Combine, Compress and Cache)').'</legend> <legend><img src="../img/admin/arrow_in.png" /> '.$this->l('CCC (Combine, Compress and Cache)').'</legend>
<p>'.$this->l('CCC allows you to reduce the loading time of your page. With these settings you will gain performance without even touching the code of your theme. Make sure, however, that your theme is compatible with PrestaShop 1.4+. Otherwise, CCC will cause problems.').'</p> <p>'.$this->l('CCC allows you to reduce the loading time of your page. With these settings you will gain performance without even touching the code of your theme. Make sure, however, that your theme is compatible with PrestaShop 1.4+. Otherwise, CCC will cause problems.').'</p>
@@ -325,7 +325,7 @@ class AdminPerformance extends AdminTab
</fieldset> </fieldset>
</form>'; </form>';
echo '<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;"> echo '<form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post" style="margin-top:10px;">
<fieldset> <fieldset>
<legend><img src="../img/admin/subdomain.gif" /> '.$this->l('Media servers (used only with CCC)').'</legend> <legend><img src="../img/admin/subdomain.gif" /> '.$this->l('Media servers (used only with CCC)').'</legend>
<p>'.$this->l('You must enter another domain or subdomain in order to use cookieless static content.').'</p> <p>'.$this->l('You must enter another domain or subdomain in order to use cookieless static content.').'</p>
@@ -353,7 +353,7 @@ class AdminPerformance extends AdminTab
echo ' echo '
<fieldset style="margin-top:10px;"> <fieldset style="margin-top:10px;">
<legend><img src="../img/admin/computer_key.png" /> '.$this->l('Ciphering').'</legend> <legend><img src="../img/admin/computer_key.png" /> '.$this->l('Ciphering').'</legend>
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<p>'.$this->l('Mcrypt is faster than our custom BlowFish class, but requires the PHP extension "mcrypt". If you change this configuration, all cookies will be reset.').'</p> <p>'.$this->l('Mcrypt is faster than our custom BlowFish class, but requires the PHP extension "mcrypt". If you change this configuration, all cookies will be reset.').'</p>
<label>'.$this->l('Algorithm').' </label> <label>'.$this->l('Algorithm').' </label>
<div class="margin-form"> <div class="margin-form">
@@ -373,7 +373,7 @@ class AdminPerformance extends AdminTab
$depth = Configuration::get('PS_CACHEFS_DIRECTORY_DEPTH'); $depth = Configuration::get('PS_CACHEFS_DIRECTORY_DEPTH');
echo '<fieldset style="margin-top: 10px;"> echo '<fieldset style="margin-top: 10px;">
<legend><img src="../img/admin/computer_key.png" /> '.$this->l('Caching').'</legend> <legend><img src="../img/admin/computer_key.png" /> '.$this->l('Caching').'</legend>
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<label>'.$this->l('Use cache:').' </label> <label>'.$this->l('Use cache:').' </label>
<div class="margin-form"> <div class="margin-form">
<input type="radio" name="active" id="active_on" value="1" '.(_PS_CACHE_ENABLED_ ? 'checked="checked" ' : '').'/> <input type="radio" name="active" id="active_on" value="1" '.(_PS_CACHE_ENABLED_ ? 'checked="checked" ' : '').'/>
@@ -404,7 +404,7 @@ class AdminPerformance extends AdminTab
<a id="addMemcachedServer" href="#" ><img src="../img/admin/add.gif" />'.$this->l('Add server').'</a> <a id="addMemcachedServer" href="#" ><img src="../img/admin/add.gif" />'.$this->l('Add server').'</a>
</div> </div>
<div id="formMemcachedServer" style="margin-top: 10px; display:none;"> <div id="formMemcachedServer" style="margin-top: 10px; display:none;">
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<label>'.$this->l('IP Address:').' </label> <label>'.$this->l('IP Address:').' </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="memcachedIp" /> <input type="text" name="memcachedIp" />
@@ -441,7 +441,7 @@ class AdminPerformance extends AdminTab
<td>'.$server['port'].'</td> <td>'.$server['port'].'</td>
<td>'.$server['weight'].'</td> <td>'.$server['weight'].'</td>
<td> <td>
<a href="'.$currentIndex.'&token='.Tools::getValue('token').'&deleteMemcachedServer='.(int)$server['id_memcached_server'].'" ><img src="../img/admin/delete.gif" /></a> <a href="'.self::$currentIndex.'&token='.Tools::getValue('token').'&deleteMemcachedServer='.(int)$server['id_memcached_server'].'" ><img src="../img/admin/delete.gif" /></a>
</td> </td>
</tr>'; </tr>';
echo ' echo '
+3 -3
View File
@@ -149,7 +149,7 @@ class AdminPreferences extends AdminTab
if ($val = Tools::getValue('PS_THEME')) if ($val = Tools::getValue('PS_THEME'))
{ {
if (rewriteSettingsFile(NULL, $val, NULL)) if (rewriteSettingsFile(NULL, $val, NULL))
Tools::redirectAdmin($this->currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
else else
$this->_errors[] = Tools::displayError('Cannot access settings file.'); $this->_errors[] = Tools::displayError('Cannot access settings file.');
} }
@@ -277,7 +277,7 @@ class AdminPreferences extends AdminTab
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
{ {
$this->submitConfiguration($fields); $this->submitConfiguration($fields);
Tools::redirectAdmin($this->currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
} }
} }
@@ -347,7 +347,7 @@ class AdminPreferences extends AdminTab
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\''.Tools::getRemoteAddr().'\'); $(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\''.Tools::getRemoteAddr().'\');
} }
</script> </script>
<form action="'.$this->currentIndex.'&submit'.$name.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submit'.$name.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset><legend><img src="../img/admin/'.strval($icon).'.gif" />'.$tabname.'</legend>'; <fieldset><legend><img src="../img/admin/'.strval($icon).'.gif" />'.$tabname.'</legend>';
foreach ($fields AS $key => $field) foreach ($fields AS $key => $field)
{ {
+44 -47
View File
@@ -37,7 +37,7 @@ class AdminProducts extends AdminTab
{ {
global $currentIndex; global $currentIndex;
$context = Context::getContext(); $context = Context::getContext();
$this->table = 'product'; $this->table = 'product';
$this->className = 'Product'; $this->className = 'Product';
$this->lang = true; $this->lang = true;
@@ -173,7 +173,6 @@ class AdminProducts extends AdminTab
public function postProcess($token = NULL) public function postProcess($token = NULL)
{ {
global $cookie, $currentIndex; global $cookie, $currentIndex;
/* Add a new product */ /* Add a new product */
if (Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitAddProductAndPreview')) if (Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitAddProductAndPreview'))
{ {
@@ -260,7 +259,7 @@ class AdminProducts extends AdminTab
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
{ {
$attachment->add(); $attachment->add();
Tools::redirectAdmin($currentIndex.'&id_product='.(int)(Tools::getValue($this->identifier)).'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=6&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.(int)(Tools::getValue($this->identifier)).'&id_category='.(int)(Tools::getValue('id_category')).'&addproduct&conf=4&tabs=6&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Invalid file'); $this->_errors[] = Tools::displayError('Invalid file');
@@ -275,7 +274,7 @@ class AdminProducts extends AdminTab
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
if ($id = (int)(Tools::getValue($this->identifier))) if ($id = (int)(Tools::getValue($this->identifier)))
if (Attachment::attachToProduct($id, $_POST['attachments'])) if (Attachment::attachToProduct($id, $_POST['attachments']))
Tools::redirectAdmin($currentIndex.'&id_product='.(int)$id.(isset($_POST['id_category']) ? '&id_category='.(int)$_POST['id_category'] : '').'&conf=4&add'.$this->table.'&tabs=6&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.(int)$id.(isset($_POST['id_category']) ? '&id_category='.(int)$_POST['id_category'] : '').'&conf=4&add'.$this->table.'&tabs=6&token='.($token ? $token : $this->token));
} }
/* Product duplication */ /* Product duplication */
@@ -310,7 +309,7 @@ class AdminProducts extends AdminTab
{ {
Hook::addProduct($product); Hook::addProduct($product);
Search::indexation(false); Search::indexation(false);
Tools::redirectAdmin($currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=19&token='.($token ? $token : $this->token));
} }
} }
else else
@@ -328,7 +327,7 @@ class AdminProducts extends AdminTab
if (Validate::isLoadedObject($object = $this->loadObject())) if (Validate::isLoadedObject($object = $this->loadObject()))
{ {
if ($object->toggleStatus()) if ($object->toggleStatus())
Tools::redirectAdmin($currentIndex.'&conf=5'.((($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token);
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
} }
@@ -358,10 +357,10 @@ class AdminProducts extends AdminTab
$object->deleteImages(); $object->deleteImages();
$object->deleted = 1; $object->deleted = 1;
if ($object->update()) if ($object->update())
Tools::redirectAdmin($currentIndex.'&conf=1&token='.($token ? $token : $this->token).$category_url); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.($token ? $token : $this->token).$category_url);
} }
elseif ($object->delete()) elseif ($object->delete())
Tools::redirectAdmin($currentIndex.'&conf=1&token='.($token ? $token : $this->token).$category_url); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.($token ? $token : $this->token).$category_url);
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
} }
@@ -405,7 +404,7 @@ class AdminProducts extends AdminTab
$id_category = Tools::getValue('id_category'); $id_category = Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.$id_category; $category_url = empty($id_category) ? '' : '&id_category='.$id_category;
Tools::redirectAdmin($currentIndex.'&conf=2&token='.$token.$category_url); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.$category_url);
} }
$this->_errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
} }
@@ -439,7 +438,7 @@ class AdminProducts extends AdminTab
} }
@unlink(_PS_TMP_IMG_DIR_.'/product_'.$image->id_product.'.jpg'); @unlink(_PS_TMP_IMG_DIR_.'/product_'.$image->id_product.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'/product_mini_'.$image->id_product.'.jpg'); @unlink(_PS_TMP_IMG_DIR_.'/product_mini_'.$image->id_product.'.jpg');
Tools::redirectAdmin($currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1'.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1'.'&token='.($token ? $token : $this->token));
} }
/* Update product image/legend */ /* Update product image/legend */
@@ -467,7 +466,7 @@ class AdminProducts extends AdminTab
$productId = (int)(Tools::getValue('id_product')); $productId = (int)(Tools::getValue('id_product'));
@unlink(_PS_TMP_IMG_DIR_.'/product_'.$productId.'.jpg'); @unlink(_PS_TMP_IMG_DIR_.'/product_'.$productId.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'/product_mini_'.$productId.'.jpg'); @unlink(_PS_TMP_IMG_DIR_.'/product_mini_'.$productId.'.jpg');
Tools::redirectAdmin($currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&tabs=1'.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&tabs=1'.'&token='.($token ? $token : $this->token));
} }
} }
@@ -475,7 +474,7 @@ class AdminProducts extends AdminTab
elseif (isset($_GET['imgPosition']) AND isset($_GET['imgDirection'])) elseif (isset($_GET['imgPosition']) AND isset($_GET['imgDirection']))
{ {
$image->positionImage((int)(Tools::getValue('imgPosition')), (int)(Tools::getValue('imgDirection'))); $image->positionImage((int)(Tools::getValue('imgPosition')), (int)(Tools::getValue('imgDirection')));
Tools::redirectAdmin($currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1&token='.($token ? $token : $this->token));
} }
} }
else else
@@ -570,7 +569,7 @@ class AdminProducts extends AdminTab
{ {
if (!$product->cache_default_attribute) if (!$product->cache_default_attribute)
Product::updateDefaultAttribute($product->id); Product::updateDefaultAttribute($product->id);
Tools::redirectAdmin($currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=3&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=3&token='.($token ? $token : $this->token));
} }
} }
} }
@@ -592,7 +591,7 @@ class AdminProducts extends AdminTab
else else
Product::updateDefaultAttribute($id_product); Product::updateDefaultAttribute($id_product);
Tools::redirectAdmin($currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Cannot delete attribute'); $this->_errors[] = Tools::displayError('Cannot delete attribute');
@@ -613,7 +612,7 @@ class AdminProducts extends AdminTab
$product->cache_default_attribute = 0; $product->cache_default_attribute = 0;
$product->update(); $product->update();
} }
Tools::redirectAdmin($currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Cannot delete attributes'); $this->_errors[] = Tools::displayError('Cannot delete attributes');
@@ -627,7 +626,7 @@ class AdminProducts extends AdminTab
{ {
$product->deleteDefaultAttributes(); $product->deleteDefaultAttributes();
$product->setDefaultAttribute((int)(Tools::getValue('id_product_attribute'))); $product->setDefaultAttribute((int)(Tools::getValue('id_product_attribute')));
Tools::redirectAdmin($currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&add'.$this->table.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&tabs=3&id_product='.$product->id.'&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Cannot make default attribute'); $this->_errors[] = Tools::displayError('Cannot make default attribute');
@@ -668,7 +667,7 @@ class AdminProducts extends AdminTab
} }
} }
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($currentIndex.'&id_product='.(int)$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=4&conf=4&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.(int)$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=4&conf=4&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Product must be created before adding features.'); $this->_errors[] = Tools::displayError('Product must be created before adding features.');
@@ -711,7 +710,7 @@ class AdminProducts extends AdminTab
$this->_errors = Tools::displayError('An error occurred while updating the specific price.'); $this->_errors = Tools::displayError('An error occurred while updating the specific price.');
} }
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&update'.$this->table.'&tabs=2&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&update'.$this->table.'&tabs=2&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('You do not have permission to add here.'); $this->_errors[] = Tools::displayError('You do not have permission to add here.');
@@ -748,7 +747,7 @@ class AdminProducts extends AdminTab
if (!$specificPrice->add()) if (!$specificPrice->add())
$this->_errors = Tools::displayError('An error occurred while updating the specific price.'); $this->_errors = Tools::displayError('An error occurred while updating the specific price.');
else else
Tools::redirectAdmin($currentIndex.'&id_product='.$id_product.'&add'.$this->table.'&tabs=2&conf=3&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$id_product.'&add'.$this->table.'&tabs=2&conf=3&token='.($token ? $token : $this->token));
} }
} }
else else
@@ -768,7 +767,7 @@ class AdminProducts extends AdminTab
if (!$specificPrice->delete()) if (!$specificPrice->delete())
$this->_errors[] = Tools::displayError('An error occurred while deleting the specific price'); $this->_errors[] = Tools::displayError('An error occurred while deleting the specific price');
else else
Tools::redirectAdmin($currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=1&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=1&token='.($token ? $token : $this->token));
} }
} }
else else
@@ -785,12 +784,12 @@ class AdminProducts extends AdminTab
if (!SpecificPrice::setPriorities($priorities)) if (!SpecificPrice::setPriorities($priorities))
$this->_errors[] = Tools::displayError('An error occurred while updating priorities.'); $this->_errors[] = Tools::displayError('An error occurred while updating priorities.');
else else
Tools::redirectAdmin($currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token));
} }
elseif (!SpecificPrice::setSpecificPriority((int)($obj->id), $priorities)) elseif (!SpecificPrice::setSpecificPriority((int)($obj->id), $priorities))
$this->_errors[] = Tools::displayError('An error occurred while setting priorities.'); $this->_errors[] = Tools::displayError('An error occurred while setting priorities.');
else else
Tools::redirectAdmin($currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$obj->id.'&add'.$this->table.'&tabs=2&conf=4&token='.($token ? $token : $this->token));
} }
/* Customization management */ /* Customization management */
elseif (Tools::isSubmit('submitCustomizationConfiguration')) elseif (Tools::isSubmit('submitCustomizationConfiguration'))
@@ -809,7 +808,7 @@ class AdminProducts extends AdminTab
if (!sizeof($this->_errors) AND !$product->update()) if (!sizeof($this->_errors) AND !$product->update())
$this->_errors[] = Tools::displayError('An error occurred while updating customization configuration.'); $this->_errors[] = Tools::displayError('An error occurred while updating customization configuration.');
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Product must be created before adding customization possibilities.'); $this->_errors[] = Tools::displayError('Product must be created before adding customization possibilities.');
@@ -829,7 +828,7 @@ class AdminProducts extends AdminTab
if (!sizeof($this->_errors) AND !$product->updateLabels()) if (!sizeof($this->_errors) AND !$product->updateLabels())
$this->_errors[] = Tools::displayError('An error occurred while updating customization.'); $this->_errors[] = Tools::displayError('An error occurred while updating customization.');
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin($currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token));
} }
else else
$this->_errors[] = Tools::displayError('Product must be created before adding customization possibilities.'); $this->_errors[] = Tools::displayError('Product must be created before adding customization possibilities.');
@@ -846,7 +845,7 @@ class AdminProducts extends AdminTab
if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position')))) if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
$this->_errors[] = Tools::displayError('Failed to update the position.'); $this->_errors[] = Tools::displayError('Failed to update the position.');
else else
Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) ? ('&id_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog')); Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) ? ('&id_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog'));
} }
else else
parent::postProcess(true); parent::postProcess(true);
@@ -1197,7 +1196,7 @@ class AdminProducts extends AdminTab
Hook::updateProduct($object); Hook::updateProduct($object);
Search::indexation(false); Search::indexation(false);
if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image) if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image)
Tools::redirectAdmin($currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
// Save and preview // Save and preview
if (Tools::isSubmit('submitAddProductAndPreview')) if (Tools::isSubmit('submitAddProductAndPreview'))
@@ -1214,10 +1213,10 @@ class AdminProducts extends AdminTab
} else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR ($id_image AND $id_image !== true)) // Save and stay on same form } else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR ($id_image AND $id_image !== true)) // Save and stay on same form
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin($currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=4&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=4&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token));
// Default behavior (save and back) // Default behavior (save and back)
Tools::redirectAdmin($currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=4&token='.($token ? $token : $this->token).'&onredirigeici'); Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=4&token='.($token ? $token : $this->token).'&onredirigeici');
} }
} }
else else
@@ -1267,12 +1266,12 @@ class AdminProducts extends AdminTab
} }
if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image) if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image)
Tools::redirectAdmin($currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&id_image='.$id_image.'&imageresize&toconf=3&submitAddAndStay='.(Tools::isSubmit('submitAdd'.$this->table.'AndStay') ? 'on' : 'off').'&token='.(($token ? $token : $this->token))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&id_image='.$id_image.'&imageresize&toconf=3&submitAddAndStay='.(Tools::isSubmit('submitAdd'.$this->table.'AndStay') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin($currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=3&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=3&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token));
// Default behavior (save and back) // Default behavior (save and back)
Tools::redirectAdmin($currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=3&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&conf=3&token='.($token ? $token : $this->token));
} }
} }
else else
@@ -1401,9 +1400,8 @@ class AdminProducts extends AdminTab
public function display($token = NULL) public function display($token = NULL)
{ {
global $currentIndex, $cookie; global $currentIndex, $cookie;
$id_shop = Context::getContext()->shop->getID(); $id_shop = Context::getContext()->shop->getID();
if (($id_category = (int)Tools::getValue('id_category'))) if (($id_category = (int)Tools::getValue('id_category')))
$currentIndex .= '&id_category='.$id_category; $currentIndex .= '&id_category='.$id_category;
$this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL, 0, NULL, $id_shop); $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL, 0, NULL, $id_shop);
@@ -1413,12 +1411,11 @@ class AdminProducts extends AdminTab
echo '<h3>'.(!$this->_listTotal ? ($this->l('No products found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('products') : $this->l('product')))).' '. echo '<h3>'.(!$this->_listTotal ? ($this->l('No products found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('products') : $this->l('product')))).' '.
$this->l('in category').' "'.stripslashes($this->_category->getName()).'"</h3>'; $this->l('in category').' "'.stripslashes($this->_category->getName()).'"</h3>';
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
echo '<a href="'.$currentIndex.'&id_category='.$id_category.'&add'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new product').'</a>'; echo '<a href="'.self::$currentIndex.'&id_category='.$id_category.'&add'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new product').'</a>';
echo '<div style="margin:10px;">'; echo '<div style="margin:10px;">';
$this->displayList($token); $this->displayList($token);
$this->displayAssoShop(); $this->displayAssoShop();
echo '</div>'; echo '</div>';
} }
/** /**
@@ -1561,7 +1558,7 @@ class AdminProducts extends AdminTab
</script> </script>
<script src="../js/tabpane.js" type="text/javascript"></script> <script src="../js/tabpane.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="../css/tabpane.css" /> <link type="text/css" rel="stylesheet" href="../css/tabpane.css" />
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post" enctype="multipart/form-data" name="product" id="product"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post" enctype="multipart/form-data" name="product" id="product">
'.$this->_displayDraftWarning($obj->active).' '.$this->_displayDraftWarning($obj->active).'
<input type="hidden" name="tabs" id="tabs" value="0" /> <input type="hidden" name="tabs" id="tabs" value="0" />
@@ -1742,7 +1739,7 @@ class AdminProducts extends AdminTab
<td class="cell border">'.$period.'</td> <td class="cell border">'.$period.'</td>
<td class="cell border">'.$specificPrice['from_quantity'].'</th> <td class="cell border">'.$specificPrice['from_quantity'].'</th>
<td class="cell border"><b>'.Tools::displayPrice(Tools::ps_round((float)($this->_getFinalPrice($specificPrice, (float)($obj->price), $taxRate)), 2), $current_specific_currency).'</b></td> <td class="cell border"><b>'.Tools::displayPrice(Tools::ps_round((float)($this->_getFinalPrice($specificPrice, (float)($obj->price), $taxRate)), 2), $current_specific_currency).'</b></td>
<td class="cell border"><a href="'.$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&updateproduct&deleteSpecificPrice&id_specific_price='.(int)($specificPrice['id_specific_price']).'&token='.Tools::getValue('token').'"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /></a></td> <td class="cell border"><a href="'.self::$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).'&updateproduct&deleteSpecificPrice&id_specific_price='.(int)($specificPrice['id_specific_price']).'&token='.Tools::getValue('token').'"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /></a></td>
</tr>'; </tr>';
$i++; $i++;
} }
@@ -3060,25 +3057,25 @@ class AdminProducts extends AdminTab
if ($image['position'] == $imagesTotal) if ($image['position'] == $imagesTotal)
echo '<span>[ <img src="../img/admin/down_d.gif" alt="" border="0"> ]</span>'; echo '<span>[ <img src="../img/admin/down_d.gif" alt="" border="0"> ]</span>';
else else
echo '<span>[ <a onclick="return hideLink();" href="'.$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=0&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a> ]</span>'; echo '<span>[ <a onclick="return hideLink();" href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=0&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a> ]</span>';
} }
elseif ($image['position'] == $imagesTotal) elseif ($image['position'] == $imagesTotal)
echo ' echo '
<span>[ <a onclick="return hideLink();" href="'.$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/up.gif" alt="" border="0"></a> ]</span> <span>[ <a onclick="return hideLink();" href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/up.gif" alt="" border="0"></a> ]</span>
<span>[ <img src="../img/admin/down_d.gif" alt="" border="0"> ]</span>'; <span>[ <img src="../img/admin/down_d.gif" alt="" border="0"> ]</span>';
else else
echo ' echo '
<span>[ <a onclick="return hideLink();" href="'.$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/up.gif" alt="" border="0"></a> ]</span> <span>[ <a onclick="return hideLink();" href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/up.gif" alt="" border="0"></a> ]</span>
<span>[ <a onclick="return hideLink();" href="'.$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=0&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a> ]</span>'; <span>[ <a onclick="return hideLink();" href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.$image['position'].'&imgDirection=0&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a> ]</span>';
echo '</td>'; echo '</td>';
if(Tools::isMultiShopActivated()) if(Tools::isMultiShopActivated())
foreach ($shops AS $shop) foreach ($shops AS $shop)
echo '<td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>'; echo '<td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>';
echo ' echo '
<td class="center"><a href="'.$currentIndex.'&id_image='.$image['id_image'].'&coverImage&token='.($token ? $token : $this->token).'"><img src="../img/admin/'.($image['cover'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td> <td class="center"><a href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&coverImage&token='.($token ? $token : $this->token).'"><img src="../img/admin/'.($image['cover'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td>
<td class="center"> <td class="center">
<a href="'.$currentIndex.'&id_image='.$image['id_image'].'&editImage&tabs=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/edit.gif" alt="'.$this->l('Modify this image').'" title="'.$this->l('Modify this image').'" /></a> <a href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&editImage&tabs=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/edit.gif" alt="'.$this->l('Modify this image').'" title="'.$this->l('Modify this image').'" /></a>
<a href="'.$currentIndex.'&id_image='.$image['id_image'].'&deleteImage&tabs=1&token='.($token ? $token : $this->token).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete this image').'" title="'.$this->l('Delete this image').'" /></a> <a href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&deleteImage&tabs=1&token='.($token ? $token : $this->token).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete this image').'" title="'.$this->l('Delete this image').'" /></a>
</td> </td>
</tr>'; </tr>';
} }
@@ -3410,13 +3407,13 @@ class AdminProducts extends AdminTab
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this combination').'" <img src="../img/admin/edit.gif" alt="'.$this->l('Modify this combination').'"
onclick="javascript:fillCombinaison(\''.$product_attribute['wholesale_price'].'\', \''.$product_attribute['price'].'\', \''.$product_attribute['weight'].'\', \''.$product_attribute['unit_impact'].'\', \''.$product_attribute['reference'].'\', \''.$product_attribute['supplier_reference'].'\', \''.$product_attribute['ean13'].'\', onclick="javascript:fillCombinaison(\''.$product_attribute['wholesale_price'].'\', \''.$product_attribute['price'].'\', \''.$product_attribute['weight'].'\', \''.$product_attribute['unit_impact'].'\', \''.$product_attribute['reference'].'\', \''.$product_attribute['supplier_reference'].'\', \''.$product_attribute['ean13'].'\',
\''.$product_attribute['quantity'].'\', \''.($attrImage ? $attrImage->id : 0).'\', Array('.$jsList.'), \''.$id_product_attribute.'\', \''.$product_attribute['default_on'].'\', \''.$product_attribute['ecotax'].'\', \''.$product_attribute['location'].'\', \''.$product_attribute['upc'].'\', \''.$product_attribute['minimal_quantity'].'\'); calcImpactPriceTI();" /></a>&nbsp; \''.$product_attribute['quantity'].'\', \''.($attrImage ? $attrImage->id : 0).'\', Array('.$jsList.'), \''.$id_product_attribute.'\', \''.$product_attribute['default_on'].'\', \''.$product_attribute['ecotax'].'\', \''.$product_attribute['location'].'\', \''.$product_attribute['upc'].'\', \''.$product_attribute['minimal_quantity'].'\'); calcImpactPriceTI();" /></a>&nbsp;
'.(!$product_attribute['default_on'] ? '<a href="'.$currentIndex.'&defaultProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'"> '.(!$product_attribute['default_on'] ? '<a href="'.self::$currentIndex.'&defaultProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">
<img src="../img/admin/asterisk.gif" alt="'.$this->l('Make this the default combination').'" title="'.$this->l('Make this combination the default one').'"></a>' : '').' <img src="../img/admin/asterisk.gif" alt="'.$this->l('Make this the default combination').'" title="'.$this->l('Make this combination the default one').'"></a>' : '').'
<a href="'.$currentIndex.'&deleteProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"> <a href="'.self::$currentIndex.'&deleteProductAttribute&id_product_attribute='.$id_product_attribute.'&id_product='.$obj->id.'&'.(Tools::isSubmit('id_category') ? 'id_category='.(int)(Tools::getValue('id_category')).'&' : '&').'token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this combination').'" /></a></td> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete this combination').'" /></a></td>
</tr>'; </tr>';
} }
echo '<tr><td colspan="7" align="center"><a href="'.$currentIndex.'&deleteAllProductAttributes&id_product='.$obj->id.'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete this combination').'" /> '.$this->l('Delete all combinations').'</a></td></tr>'; echo '<tr><td colspan="7" align="center"><a href="'.self::$currentIndex.'&deleteAllProductAttributes&id_product='.$obj->id.'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"><img src="../img/admin/delete.gif" alt="'.$this->l('Delete this combination').'" /> '.$this->l('Delete all combinations').'</a></td></tr>';
} }
else else
echo '<tr><td colspan="7" align="center"><i>'.$this->l('No combination yet').'.</i></td></tr>'; echo '<tr><td colspan="7" align="center"><i>'.$this->l('No combination yet').'.</i></td></tr>';
+1 -1
View File
@@ -66,7 +66,7 @@ class AdminProfiles extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/profiles.png" />'.$this->l('Profiles').'</legend> <fieldset><legend><img src="../img/admin/profiles.png" />'.$this->l('Profiles').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+1 -1
View File
@@ -54,7 +54,7 @@ class AdminQuickAccesses extends AdminTab
$new_window = $this->getFieldValue($obj, 'new_window'); $new_window = $this->getFieldValue($obj, 'new_window');
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/quick.gif" />'.$this->l('Quick Access menu').'</legend> <fieldset><legend><img src="../img/admin/quick.gif" />'.$this->l('Quick Access menu').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+1 -1
View File
@@ -81,7 +81,7 @@ class AdminRangePrice extends AdminTab
$carrierArray[] = '<option value="'.(int)($carrier['id_carrier']).'"'.(($carrier['id_carrier'] == $id_carrier) ? ' selected="selected"' : '').'>'.$carrier['name'].'</option><sup>*</sup>'; $carrierArray[] = '<option value="'.(int)($carrier['id_carrier']).'"'.(($carrier['id_carrier'] == $id_carrier) ? ' selected="selected"' : '').'>'.$carrier['name'].'</option><sup>*</sup>';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/t/AdminRangePrice.gif" />'.$this->l('Price ranges').'</legend> <fieldset><legend><img src="../img/t/AdminRangePrice.gif" />'.$this->l('Price ranges').'</legend>
<label>'.$this->l('Carrier').'</label> <label>'.$this->l('Carrier').'</label>
+1 -1
View File
@@ -80,7 +80,7 @@ class AdminRangeWeight extends AdminTab
$carrierArray[] = '<option value="'.(int)($carrier['id_carrier']).'"'.(($carrier['id_carrier'] == $id_carrier) ? ' selected="selected"' : '').'>'.$carrier['name'].'</option><sup>*</sup>'; $carrierArray[] = '<option value="'.(int)($carrier['id_carrier']).'"'.(($carrier['id_carrier'] == $id_carrier) ? ' selected="selected"' : '').'>'.$carrier['name'].'</option><sup>*</sup>';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/t/AdminRangeWeight.gif" />'.$this->l('Weight ranges').'</legend> <fieldset><legend><img src="../img/t/AdminRangeWeight.gif" />'.$this->l('Weight ranges').'</legend>
<label>'.$this->l('Carrier').'</label> <label>'.$this->l('Carrier').'</label>
+8 -8
View File
@@ -166,7 +166,7 @@ class AdminReferrers extends AdminTab
echo ' echo '
<div style="float: left; margin-right: 20px;"> <div style="float: left; margin-right: 20px;">
<fieldset style="width:630px"><legend><img src="../img/admin/tab-preferences.gif" /> '.$this->l('Settings').'</legend> <fieldset style="width:630px"><legend><img src="../img/admin/tab-preferences.gif" /> '.$this->l('Settings').'</legend>
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<label>'.$this->l('Save direct traffic').'</label> <label>'.$this->l('Save direct traffic').'</label>
<div class="float" style="margin-left: 200px;"> <div class="float" style="margin-left: 200px;">
<label class="t" for="tracking_dt_on"><img src="../img/admin/enabled.gif" alt="'.$this->l('Yes').'" title="'.$this->l('Yes').'" /></label> <label class="t" for="tracking_dt_on"><img src="../img/admin/enabled.gif" alt="'.$this->l('Yes').'" title="'.$this->l('Yes').'" /></label>
@@ -181,13 +181,13 @@ class AdminReferrers extends AdminTab
<input type="submit" class="button" value="'.$this->l(' Save ').'" name="submitSettings" /> <input type="submit" class="button" value="'.$this->l(' Save ').'" name="submitSettings" />
</form> </form>
<hr /> <hr />
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<p class="bold">'.$this->l('Indexation').'</p> <p class="bold">'.$this->l('Indexation').'</p>
<p>'.$this->l('There is a huge quantity of data, so each connection corresponding to a referrer is indexed. You can refresh this index by clicking on the button below. Be aware that it may take a long time and it is only needed if you modified or added a referrer and if you want your changes to be retroactive.').'</p> <p>'.$this->l('There is a huge quantity of data, so each connection corresponding to a referrer is indexed. You can refresh this index by clicking on the button below. Be aware that it may take a long time and it is only needed if you modified or added a referrer and if you want your changes to be retroactive.').'</p>
<input type="submit" class="button" value="'.$this->l('Refresh index').'" name="submitRefreshIndex" /> <input type="submit" class="button" value="'.$this->l('Refresh index').'" name="submitRefreshIndex" />
</form> </form>
<hr /> <hr />
<form action="'.$currentIndex.'&token='.Tools::getValue('token').'" method="post"> <form action="'.self::$currentIndex.'&token='.Tools::getValue('token').'" method="post">
<p class="bold">'.$this->l('Cache').'</p> <p class="bold">'.$this->l('Cache').'</p>
<p>'.$this->l('For you to sort and filter your data, it is cached. You can refresh the cache by clicking on the button below.').'</p> <p>'.$this->l('For you to sort and filter your data, it is cached. You can refresh the cache by clicking on the button below.').'</p>
<input type="submit" class="button" value="'.$this->l('Refresh cache').'" name="submitRefreshCache" /> <input type="submit" class="button" value="'.$this->l('Refresh cache').'" name="submitRefreshCache" />
@@ -213,7 +213,7 @@ class AdminReferrers extends AdminTab
if (Tools::isSubmit('submitSettings')) if (Tools::isSubmit('submitSettings'))
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
if (Configuration::updateValue('TRACKING_DIRECT_TRAFFIC', (int)(Tools::getValue('tracking_dt')))) if (Configuration::updateValue('TRACKING_DIRECT_TRAFFIC', (int)(Tools::getValue('tracking_dt'))))
Tools::redirectAdmin($currentIndex.'&conf=4&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.Tools::getValue('token'));
if (ModuleGraph::getDateBetween() != Configuration::get('PS_REFERRERS_CACHE_LIKE') OR Tools::isSubmit('submitRefreshCache')) if (ModuleGraph::getDateBetween() != Configuration::get('PS_REFERRERS_CACHE_LIKE') OR Tools::isSubmit('submitRefreshCache'))
Referrer::refreshCache(); Referrer::refreshCache();
@@ -235,7 +235,7 @@ class AdminReferrers extends AdminTab
$uri = Tools::getHttpHost(true, true).__PS_BASE_URI__; $uri = Tools::getHttpHost(true, true).__PS_BASE_URI__;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/affiliation.png" /> '.$this->l('Affiliate').'</legend> <fieldset><legend><img src="../img/admin/affiliation.png" /> '.$this->l('Affiliate').'</legend>
<label>'.$this->l('Name').'</label> <label>'.$this->l('Name').'</label>
@@ -470,11 +470,11 @@ class AdminReferrers extends AdminTab
} }
echo ' echo '
<td class="center" style="width: 60px"> <td class="center" style="width: 60px">
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&view'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&view'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'">
<img src="../img/admin/details.gif" border="0" alt="'.$this->l('View').'" title="'.$this->l('View').'" /></a> <img src="../img/admin/details.gif" border="0" alt="'.$this->l('View').'" title="'.$this->l('View').'" /></a>
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'">
<img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a> <img src="../img/admin/edit.gif" border="0" alt="'.$this->l('Edit').'" title="'.$this->l('Edit').'" /></a>
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.addslashes($this->l('Delete item ?')).'\');"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.addslashes($this->l('Delete item ?')).'\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a> <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>
</tr>'; </tr>';
} }
+7 -7
View File
@@ -70,7 +70,7 @@ class AdminReturn extends AdminTab
if ((int)($orderReturn->countProduct()) > 1) if ((int)($orderReturn->countProduct()) > 1)
{ {
if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int)(Tools::getValue('id_customization', 0)))) if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int)(Tools::getValue('id_customization', 0))))
Tools::redirectAdmin($currentIndex.'&conf=4token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4token='.$this->token);
else else
$this->_errors[] = Tools::displayError('An error occurred while deleting an order return detail.'); $this->_errors[] = Tools::displayError('An error occurred while deleting an order return detail.');
} }
@@ -104,7 +104,7 @@ class AdminReturn extends AdminTab
'{id_order_return}' => $id_order_return, '{id_order_return}' => $id_order_return,
'{state_order_return}' => $orderReturnState->name[(int)(Configuration::get('PS_LANG_DEFAULT'))]); '{state_order_return}' => $orderReturnState->name[(int)(Configuration::get('PS_LANG_DEFAULT'))]);
Mail::Send((int)($cookie->id_lang), 'order_return_state', Mail::l('Your order return state has changed'), $vars, $customer->email, $customer->firstname.' '.$customer->lastname); Mail::Send((int)($cookie->id_lang), 'order_return_state', Mail::l('Your order return state has changed'), $vars, $customer->email, $customer->firstname.' '.$customer->lastname);
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
} }
} }
else else
@@ -126,7 +126,7 @@ class AdminReturn extends AdminTab
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
$this->displayForm(); $this->displayForm();
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.self::$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
else else
echo $this->l('You do not have permission to edit here'); echo $this->l('You do not have permission to edit here');
@@ -152,7 +152,7 @@ class AdminReturn extends AdminTab
$id = $tr['id_'.$this->table]; $id = $tr['id_'.$this->table];
echo '<tr'.($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($state->color) AND $this->colorOnBackground) ? 'style="background-color: '.$state->color.'"' : '').'><td></td>'; echo '<tr'.($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($state->color) AND $this->colorOnBackground) ? 'style="background-color: '.$state->color.'"' : '').'><td></td>';
foreach ($this->fieldsDisplay AS $key => $params) foreach ($this->fieldsDisplay AS $key => $params)
echo '<td class="pointer" onclick="document.location = \''.$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'"'.'>'.$tr[$key].'</td>'; echo '<td class="pointer" onclick="document.location = \''.self::$currentIndex.'&id_'.$this->table.'='.$id.'&update'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'"'.'>'.$tr[$key].'</td>';
echo '</tr>'; echo '</tr>';
} }
} }
@@ -166,7 +166,7 @@ class AdminReturn extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<input type="hidden" name="id_order" value="'.$obj->id_order.'" /> <input type="hidden" name="id_order" value="'.$obj->id_order.'" />
<input type="hidden" name="id_customer" value="'.$obj->id_customer.'" /> <input type="hidden" name="id_customer" value="'.$obj->id_customer.'" />
@@ -226,7 +226,7 @@ class AdminReturn extends AdminTab
<td>'.$returnedCustomization['reference'].'</td> <td>'.$returnedCustomization['reference'].'</td>
<td class="center">'.$returnedCustomization['name'].'</td> <td class="center">'.$returnedCustomization['name'].'</td>
<td class="center">'.(int)($returnedCustomization['product_quantity']).'</td> <td class="center">'.(int)($returnedCustomization['product_quantity']).'</td>
<td class="center"><a href="'.$currentIndex.'&deleteorder_return_detail&id_order_detail='.$returnedCustomization['id_order_detail'].'&id_customization='.$returnedCustomization['id_customization'].'&id_order_return='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/delete.gif"></a></td> <td class="center"><a href="'.self::$currentIndex.'&deleteorder_return_detail&id_order_detail='.$returnedCustomization['id_order_detail'].'&id_customization='.$returnedCustomization['id_customization'].'&id_order_return='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/delete.gif"></a></td>
</tr>'; </tr>';
$customizationDatas = &$allCustomizedDatas[(int)($returnedCustomization['product_id'])][(int)($returnedCustomization['product_attribute_id'])][(int)($returnedCustomization['id_customization'])]['datas']; $customizationDatas = &$allCustomizedDatas[(int)($returnedCustomization['product_id'])][(int)($returnedCustomization['product_attribute_id'])][(int)($returnedCustomization['id_customization'])]['datas'];
foreach ($customizationDatas AS $type => $datas) foreach ($customizationDatas AS $type => $datas)
@@ -267,7 +267,7 @@ class AdminReturn extends AdminTab
<td>'.$product['product_reference'].'</td> <td>'.$product['product_reference'].'</td>
<td class="center">'.$product['product_name'].'</td> <td class="center">'.$product['product_name'].'</td>
<td class="center">'.$product['product_quantity'].'</td> <td class="center">'.$product['product_quantity'].'</td>
<td class="center"><a href="'.$currentIndex.'&deleteorder_return_detail&id_order_detail='.$product['id_order_detail'].'&id_order_return='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/delete.gif"></a></td> <td class="center"><a href="'.self::$currentIndex.'&deleteorder_return_detail&id_order_detail='.$product['id_order_detail'].'&id_order_return='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/delete.gif"></a></td>
</tr>'; </tr>';
echo ' echo '
+1 -1
View File
@@ -54,7 +54,7 @@ class AdminReturnStates extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/time.gif" />'.$this->l('Order statuses').'</legend> <fieldset><legend><img src="../img/admin/time.gif" />'.$this->l('Order statuses').'</legend>
<label>'.$this->l('Status name:').' </label> <label>'.$this->l('Status name:').' </label>
+1 -1
View File
@@ -145,7 +145,7 @@ class AdminScenes extends AdminTab
echo echo
'</script> '</script>
<form id="scenesForm" action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form id="scenesForm" action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/photo.gif" />'.$this->l('Image Maps').'</legend>'; <fieldset><legend><img src="../img/admin/photo.gif" />'.$this->l('Image Maps').'</legend>';
echo ' echo '
+8 -8
View File
@@ -203,7 +203,7 @@ class AdminSearch extends AdminTab
echo '<table cellspacing="0" cellpadding="0" class="table">'; echo '<table cellspacing="0" cellpadding="0" class="table">';
$irow = 0; $irow = 0;
foreach ($this->_list['categories'] AS $k => $category) foreach ($this->_list['categories'] AS $k => $category)
echo '<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"><td>'.rtrim(getPath($currentIndex.'?tab=AdminCatalog', $category['id_category'], '', $query), ' >').'</td></tr>'; echo '<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"><td>'.rtrim(getPath(self::$currentIndex.'?tab=AdminCatalog', $category['id_category'], '', $query), ' >').'</td></tr>';
echo '</table> echo '</table>
<div class="clear">&nbsp;</div>'; <div class="clear">&nbsp;</div>';
} }
@@ -224,17 +224,17 @@ class AdminSearch extends AdminTab
<td>'.$product['id_product'].'</td> <td>'.$product['id_product'].'</td>
<td align="center">'.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').'</td> <td align="center">'.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').'</td>
<td>'.$product['reference'].'</td> <td>'.$product['reference'].'</td>
<td><a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">'.stripslashes($product['nameh']).'</a></td> <td><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">'.stripslashes($product['nameh']).'</a></td>
<td>'.Tools::displayPrice($product['price'], $currency).'</td> <td>'.Tools::displayPrice($product['price'], $currency).'</td>
<td>'.stripslashes($product['tax_name']).'</td> <td>'.stripslashes($product['tax_name']).'</td>
<td align="center">'.$product['quantity'].'</td> <td align="center">'.$product['quantity'].'</td>
<td align="center">'.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').'</td> <td align="center">'.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'"> <td align="center"><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">
<img src="../img/admin/'.($product['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td> <img src="../img/admin/'.($product['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td>
<td> <td>
<a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'"> <a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this product').'" /></a>&nbsp; <img src="../img/admin/edit.gif" alt="'.$this->l('Modify this product').'" /></a>&nbsp;
<a href="'.$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&deleteproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'" <a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&deleteproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)).'"
onclick="return confirm(\''.$this->l('Do you want to delete this product?', __CLASS__, true, false).' ('.addslashes($product['name']).')\');"> onclick="return confirm(\''.$this->l('Do you want to delete this product?', __CLASS__, true, false).' ('.addslashes($product['name']).')\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this product').'" /></a> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete this product').'" /></a>
</td> </td>
@@ -268,11 +268,11 @@ class AdminSearch extends AdminTab
<td>'.Order::getCustomerNbOrders($customer['id_customer']).'</td> <td>'.Order::getCustomerNbOrders($customer['id_customer']).'</td>
<td class="center"><img src="../img/admin/'.($customer['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></td> <td class="center"><img src="../img/admin/'.($customer['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></td>
<td class="center" width="60px"> <td class="center" width="60px">
<a href="'.$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&viewcustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'"> <a href="'.self::$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&viewcustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'">
<img src="../img/admin/details.gif" alt="'.$this->l('View orders').'" /></a> <img src="../img/admin/details.gif" alt="'.$this->l('View orders').'" /></a>
<a href="'.$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&addcustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'"> <a href="'.self::$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&addcustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this customer').'" /></a> <img src="../img/admin/edit.gif" alt="'.$this->l('Modify this customer').'" /></a>
<a href="'.$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&deletecustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"> <a href="'.self::$currentIndex.'?tab=AdminCustomers&id_customer='.$customer['id_customer'].'&deletecustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)).'" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this customer').'" /></a> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete this customer').'" /></a>
</td> </td>
</tr>'; </tr>';
+1 -1
View File
@@ -52,7 +52,7 @@ class AdminSearchEngines extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend>'.$this->l('Referrer').'</legend> <fieldset><legend>'.$this->l('Referrer').'</legend>
<label>'.$this->l('Server').' </label> <label>'.$this->l('Server').' </label>
+4 -4
View File
@@ -76,7 +76,7 @@ class AdminShipping extends AdminTab
Configuration::updateValue($field, call_user_func($function, Tools::getValue($field))); Configuration::updateValue($field, call_user_func($function, Tools::getValue($field)));
} }
Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
} }
else else
@@ -113,7 +113,7 @@ class AdminShipping extends AdminTab
$priceList = rtrim($priceList, ','); $priceList = rtrim($priceList, ',');
/* Update delivery prices */ /* Update delivery prices */
$carrier->addDeliveryPrice($priceList); $carrier->addDeliveryPrice($priceList);
Tools::redirectAdmin($currentIndex.'&conf=6'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
} }
else else
$this->_errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).'); $this->_errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).');
@@ -147,7 +147,7 @@ class AdminShipping extends AdminTab
unset($confKeys['PS_SHIPPING_METHOD']); unset($confKeys['PS_SHIPPING_METHOD']);
echo ' echo '
<form action="'.$currentIndex.'&submitHandling'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitHandling'.$this->table.'=1&token='.$this->token.'" method="post">
<fieldset> <fieldset>
<legend><img src="../img/admin/delivery.gif" />'.$this->l('Handling').'</legend>'; <legend><img src="../img/admin/delivery.gif" />'.$this->l('Handling').'</legend>';
@@ -215,7 +215,7 @@ class AdminShipping extends AdminTab
echo '<br /><br /> echo '<br /><br />
<h2>'.$this->l('Fees by carrier, geographical zone, and ranges').'</h2> <h2>'.$this->l('Fees by carrier, geographical zone, and ranges').'</h2>
<form action="'.$currentIndex.'&token='.$this->token.'" id="fees" name="fees" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" id="fees" name="fees" method="post">
<fieldset> <fieldset>
<legend><img src="../img/admin/delivery.gif" />'.$this->l('Fees').'</legend>'; <legend><img src="../img/admin/delivery.gif" />'.$this->l('Fees').'</legend>';
+1 -1
View File
@@ -92,7 +92,7 @@ class AdminShop extends AdminTab
$disabled = ''; $disabled = '';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend>'.$this->l('Shop').'</legend> <fieldset><legend>'.$this->l('Shop').'</legend>
<span class="hint" name="help_box" style="display:block;">'.$this->l('You can\'t change the GroupShop when you have more than one Shop').'</span><br /> <span class="hint" name="help_box" style="display:block;">'.$this->l('You can\'t change the GroupShop when you have more than one Shop').'</span><br />
+1 -1
View File
@@ -93,7 +93,7 @@ class AdminShopUrl extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend>'.$this->l('Shop Url').'</legend> <fieldset><legend>'.$this->l('Shop Url').'</legend>
<label for="domain">'.$this->l('Domain').'</label> <label for="domain">'.$this->l('Domain').'</label>
+2 -2
View File
@@ -75,7 +75,7 @@ class AdminSlip extends AdminTab
echo ' echo '
<fieldset style="float:left;width:280px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('Print PDF').'</legend> <fieldset style="float:left;width:280px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('Print PDF').'</legend>
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<label style="width:90px">'.$this->l('From:').' </label> <label style="width:90px">'.$this->l('From:').' </label>
<div class="margin-form" style="padding-left:100px"> <div class="margin-form" style="padding-left:100px">
<input type="text" size="4" maxlength="10" name="date_from" value="'.date('Y-m-01').'" style="width: 120px;" /> <input type="text" size="4" maxlength="10" name="date_from" value="'.date('Y-m-01').'" style="width: 120px;" />
@@ -110,7 +110,7 @@ class AdminSlip extends AdminTab
<a href="pdf.php?id_order_slip='.$tr['id_order_slip'].'"> <a href="pdf.php?id_order_slip='.$tr['id_order_slip'].'">
<img src="../img/admin/details.gif" border="0" alt="'.$this->l('View').'" title="'.$this->l('View').'" /></a>'; <img src="../img/admin/details.gif" border="0" alt="'.$this->l('View').'" title="'.$this->l('View').'" /></a>';
echo ' echo '
<a href="'.$currentIndex.'&id_'.$this->table.'='.$tr['id_order_slip'].'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.$this->l('Delete item #', __CLASS__, true, false).$tr['id_order_slip'].$this->l('?', __CLASS__, true, false).'\');"> <a href="'.self::$currentIndex.'&id_'.$this->table.'='.$tr['id_order_slip'].'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.$this->l('Delete item #', __CLASS__, true, false).$tr['id_order_slip'].$this->l('?', __CLASS__, true, false).'\');">
<img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>'; <img src="../img/admin/delete.gif" border="0" alt="'.$this->l('Delete').'" title="'.$this->l('Delete').'" /></a>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
+3 -3
View File
@@ -76,11 +76,11 @@ class AdminStates extends AdminTab
if ($this->deleted) if ($this->deleted)
{ {
$object->deleted = 1; $object->deleted = 1;
if ($object->update()) Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); if ($object->update()) Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.$token);
} }
else if ($object->delete()) else if ($object->delete())
{ {
Tools::redirectAdmin($currentIndex.'&conf=1&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.$token);
} }
$this->_errors[] = Tools::displayError('An error occurred during deletion.'); $this->_errors[] = Tools::displayError('An error occurred during deletion.');
} }
@@ -107,7 +107,7 @@ class AdminStates extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('States').'</legend> <fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('States').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+1 -1
View File
@@ -64,7 +64,7 @@ class AdminStatsConf extends AdminPreferences
'month' => $this->l('Month'), 'month' => $this->l('Month'),
'year' => $this->l('Year')); 'year' => $this->l('Year'));
echo '<form action="'.$currentIndex.'&token='.$this->token.'&submitSettings=1" method="post"> echo '<form action="'.self::$currentIndex.'&token='.$this->token.'&submitSettings=1" method="post">
<fieldset><legend><img src="../img/admin/tab-preferences.gif" />'.$this->l('Settings').'</legend>'; <fieldset><legend><img src="../img/admin/tab-preferences.gif" />'.$this->l('Settings').'</legend>';
#Graph Engines #Graph Engines
+1 -1
View File
@@ -215,7 +215,7 @@ abstract class AdminStatsTab extends AdminPreferences
{ {
foreach ($modules AS $module) foreach ($modules AS $module)
if ($moduleInstance = Module::getInstanceByName($module['name'])) if ($moduleInstance = Module::getInstanceByName($module['name']))
echo '<h4><img src="../modules/'.$module['name'].'/logo.gif" /><a href="'.$currentIndex.'&token='.Tools::getValue('token').'&module='.$module['name'].'">'.$moduleInstance->displayName.'</a></h4>'; echo '<h4><img src="../modules/'.$module['name'].'/logo.gif" /><a href="'.self::$currentIndex.'&token='.Tools::getValue('token').'&module='.$module['name'].'">'.$moduleInstance->displayName.'</a></h4>';
} }
else else
echo $this->l('No module installed', 'AdminStatsTab'); echo $this->l('No module installed', 'AdminStatsTab');
+2 -2
View File
@@ -71,7 +71,7 @@ class AdminStockMvt extends AdminTab
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
$dl = 'name'; $dl = 'name';
echo '<form action="'.$this->currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'&addstock_mvt_reason" method="post"> echo '<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'&addstock_mvt_reason" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/search.gif" />'.$this->l('Stock Movement').'</legend> <fieldset><legend><img src="../img/admin/search.gif" />'.$this->l('Stock Movement').'</legend>
<label>'.$this->l('Name:').'</label> <label>'.$this->l('Name:').'</label>
@@ -149,7 +149,7 @@ class AdminStockMvt extends AdminTab
if (!isset($_GET['view'.$this->table])) if (!isset($_GET['view'.$this->table]))
echo ' echo '
<fieldset> <fieldset>
<form method="post" action="'.$this->currentIndex.'&token='.$this->token.'&rebuildMvt=1"> <form method="post" action="'.self::$currentIndex.'&token='.$this->token.'&rebuildMvt=1">
<label for="stock_rebuild">'.$this->l('Calculate the movement of inventory missing').'</label> <label for="stock_rebuild">'.$this->l('Calculate the movement of inventory missing').'</label>
<div class="margin-form"> <div class="margin-form">
<input class="button" type="submit" name="rebuildStock" value="'.$this->l('Submit').'" /> <input class="button" type="submit" name="rebuildStock" value="'.$this->l('Submit').'" />
+1 -1
View File
@@ -182,7 +182,7 @@ class AdminStores extends AdminTab
}; };
}); });
</script> </script>
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset> <fieldset>
<legend><img src="../img/admin/home.gif" />'.$this->l('Stores').'</legend> <legend><img src="../img/admin/home.gif" />'.$this->l('Stores').'</legend>
+1 -1
View File
@@ -56,7 +56,7 @@ class AdminSubDomains extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/subdomain.gif" /> '.$this->l('Subdomains').'</legend> <fieldset><legend><img src="../img/admin/subdomain.gif" /> '.$this->l('Subdomains').'</legend>
<label>'.$this->l('Subdomain:').' </label> <label>'.$this->l('Subdomain:').' </label>
+1 -1
View File
@@ -133,7 +133,7 @@ class AdminSuppliers extends AdminTab
$langtags = 'description¤smeta_title¤smeta_keywords¤smeta_description'; $langtags = 'description¤smeta_title¤smeta_keywords¤smeta_description';
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($supplier->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$supplier->id.'" />' : '').' '.($supplier->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$supplier->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/suppliers.gif" />'.$this->l('Suppliers').'</legend> <fieldset><legend><img src="../img/admin/suppliers.gif" />'.$this->l('Suppliers').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
+4 -4
View File
@@ -60,7 +60,7 @@ class AdminTabs extends AdminTab
{ {
global $currentIndex; global $currentIndex;
if ($tab->move($direction)) if ($tab->move($direction))
Tools::redirectAdmin($currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
else else
{ {
@@ -84,9 +84,9 @@ class AdminTabs extends AdminTab
$tab = $arrayTabs[$i]; $tab = $arrayTabs[$i];
echo '<th style="text-align:center;">'.stripslashes($tab['name']).'<br />'; echo '<th style="text-align:center;">'.stripslashes($tab['name']).'<br />';
if ($i) if ($i)
echo '<a href="'.$currentIndex.'&id_tab='.$tab['id_tab'].'&move=l&token='.$this->token.'"><img src="../img/admin/previous.gif" /></a>&nbsp;'; echo '<a href="'.self::$currentIndex.'&id_tab='.$tab['id_tab'].'&move=l&token='.$this->token.'"><img src="../img/admin/previous.gif" /></a>&nbsp;';
if ($i < sizeof($arrayTabs) - 1) if ($i < sizeof($arrayTabs) - 1)
echo '<a href="'.$currentIndex.'&id_tab='.$tab['id_tab'].'&move=r&token='.$this->token.'"><img src="../img/admin/next.gif" /></a></th>'; echo '<a href="'.self::$currentIndex.'&id_tab='.$tab['id_tab'].'&move=r&token='.$this->token.'"><img src="../img/admin/next.gif" /></a></th>';
} }
echo ' echo '
</tr> </tr>
@@ -118,7 +118,7 @@ class AdminTabs extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
'.($obj->position ? '<input type="hidden" name="position" value="'.$obj->position.'" />' : '').' '.($obj->position ? '<input type="hidden" name="position" value="'.$obj->position.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab.gif" />'.$this->l('Tabs').'</legend> <fieldset><legend><img src="../img/admin/tab.gif" />'.$this->l('Tabs').'</legend>
+1 -1
View File
@@ -70,7 +70,7 @@ class AdminTags extends AdminTab
$products2 = $obj->getProducts(false); $products2 = $obj->getProducts(false);
echo ' echo '
<form id="formTag" action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" class="width5"> <form id="formTag" action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" class="width5">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/t/AdminTags.gif" />'.$this->l('Tag').'</legend> <fieldset><legend><img src="../img/t/AdminTags.gif" />'.$this->l('Tag').'</legend>
<label>'.$this->l('Name').' </label> <label>'.$this->l('Name').' </label>
+6 -6
View File
@@ -78,7 +78,7 @@ class AdminTaxRulesGroup extends AdminTab
$param_product = Tools::getValue('id_product') ? '&id_product='.Tools::getValue('id_product') : ''; $param_product = Tools::getValue('id_product') ? '&id_product='.Tools::getValue('id_product') : '';
echo '<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.$param_product.'" method="post"> echo '<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.$param_product.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/dollar.gif" />'.$this->l('Tax Rules').'</legend> <fieldset><legend><img src="../img/admin/dollar.gif" />'.$this->l('Tax Rules').'</legend>
<input type="hidden" name="tabs" id="tabs" value="0" /> <input type="hidden" name="tabs" id="tabs" value="0" />
@@ -515,14 +515,14 @@ class AdminTaxRulesGroup extends AdminTab
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&update'.$this->table.'&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&update'.$this->table.'&token='.$token);
// Default behavior (save and back) // Default behavior (save and back)
$id_product = (int)Tools::getValue('id_product'); $id_product = (int)Tools::getValue('id_product');
if ($id_product) if ($id_product)
Tools::redirectAdmin('?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); Tools::redirectAdmin('?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)));
Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token); Tools::redirectAdmin(self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token);
} }
} }
else else
@@ -547,16 +547,16 @@ class AdminTaxRulesGroup extends AdminTab
$this->afterAdd($object); $this->afterAdd($object);
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$token);
$id_product = (int)Tools::getValue('id_product'); $id_product = (int)Tools::getValue('id_product');
if ($id_product) if ($id_product)
Tools::redirectAdmin('?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee))); Tools::redirectAdmin('?tab=AdminCatalog&id_product='.$id_product.'&updateproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee)));
Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token); Tools::redirectAdmin(self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token);
// Default behavior (save and back) // Default behavior (save and back)
Tools::redirectAdmin($currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token); Tools::redirectAdmin(self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=3&token='.$token);
} }
} }
else else
+5 -5
View File
@@ -68,7 +68,7 @@ class AdminTaxes extends AdminTab
$states = State::getStates((int)$cookie->id_lang); $states = State::getStates((int)$cookie->id_lang);
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/dollar.gif" />'.$this->l('Taxes').'</legend> <fieldset><legend><img src="../img/admin/dollar.gif" />'.$this->l('Taxes').'</legend>
<label>'.$this->l('Name:').' </label> <label>'.$this->l('Name:').' </label>
@@ -129,7 +129,7 @@ class AdminTaxes extends AdminTab
$this->_errors[] = Tools::displayError('An error occurred while updating object.').' <b>'.$this->table.'</b>'; $this->_errors[] = Tools::displayError('An error occurred while updating object.').' <b>'.$this->table.'</b>';
elseif ($this->postImage($object->id)) elseif ($this->postImage($object->id))
{ {
Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token);
} }
} }
else else
@@ -150,7 +150,7 @@ class AdminTaxes extends AdminTab
$this->_errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>'; $this->_errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>';
elseif (($_POST['id_'.$this->table] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect) elseif (($_POST['id_'.$this->table] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect)
{ {
Tools::redirectAdmin($currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token);
} }
} }
else else
@@ -173,7 +173,7 @@ class AdminTaxes extends AdminTab
$_cacheLang['DeleteItem'] = $this->l('This tax is currently in use in a tax rule. Are you sure?'); $_cacheLang['DeleteItem'] = $this->l('This tax is currently in use in a tax rule. Are you sure?');
echo ' echo '
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].'\');"> <a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].'\');">
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>'; <img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>';
} }
@@ -183,7 +183,7 @@ class AdminTaxes extends AdminTab
$confirm = ($value AND TaxRule::isTaxInUse($id)) ? 'onclick="return confirm(\''. $this->l('This tax is currently in use in a tax rule. If you continue this tax will be removed from the tax rule, are you sure?').'\')"' : ''; $confirm = ($value AND TaxRule::isTaxInUse($id)) ? 'onclick="return confirm(\''. $this->l('This tax is currently in use in a tax rule. If you continue this tax will be removed from the tax rule, are you sure?').'\')"' : '';
echo '<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&'.$active. echo '<a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&'.$active.
((int)$id_category AND (int)$id_product ? '&id_category='.$id_category : '').'&token='.($token!=NULL ? $token : $this->token).'" '.$confirm.'> ((int)$id_category AND (int)$id_product ? '&id_category='.$id_category : '').'&token='.($token!=NULL ? $token : $this->token).'" '.$confirm.'>
<img src="../img/admin/'.($value ? 'enabled.gif' : 'disabled.gif').'" <img src="../img/admin/'.($value ? 'enabled.gif' : 'disabled.gif').'"
alt="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" /></a>'; alt="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" /></a>';
+17 -17
View File
@@ -127,7 +127,7 @@ class AdminTranslations extends AdminTab
fwrite($fd, '$_'.$tab.'[\''.pSQL($key, true).'\'] = \''.pSQL($value, true).'\';'."\n"); fwrite($fd, '$_'.$tab.'[\''.pSQL($key, true).'\'] = \''.pSQL($value, true).'\';'."\n");
fwrite($fd, "\n?>"); fwrite($fd, "\n?>");
fclose($fd); fclose($fd);
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
} }
else else
die('Cannot write language file'); die('Cannot write language file');
@@ -161,7 +161,7 @@ class AdminTranslations extends AdminTab
} }
} }
if ($bool) if ($bool)
Tools::redirectLink($currentIndex.'&conf=14&token='.$this->token); Tools::redirectLink(self::$currentIndex.'&conf=14&token='.$this->token);
$this->_errors[] = $this->l('a part of the data has been copied but some language files could not be found or copied'); $this->_errors[] = $this->l('a part of the data has been copied but some language files could not be found or copied');
} }
@@ -246,7 +246,7 @@ class AdminTranslations extends AdminTab
if (!Language::checkAndAddLanguage($iso_code)) if (!Language::checkAndAddLanguage($iso_code))
$conf = 20; $conf = 20;
} }
Tools::redirectAdmin($currentIndex.'&conf='.(isset($conf) ? $conf : '15').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf='.(isset($conf) ? $conf : '15').'&token='.$this->token);
} }
$this->_errors[] = Tools::displayError('Archive cannot be extracted.'); $this->_errors[] = Tools::displayError('Archive cannot be extracted.');
} }
@@ -273,7 +273,7 @@ class AdminTranslations extends AdminTab
$conf = 20; $conf = 20;
if (!unlink($file)) if (!unlink($file))
$this->_errors[] = Tools::displayError('Cannot delete archive'); $this->_errors[] = Tools::displayError('Cannot delete archive');
Tools::redirectAdmin($currentIndex.'&conf='.(isset($conf) ? $conf : '15').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf='.(isset($conf) ? $conf : '15').'&token='.$this->token);
} }
$this->_errors[] = Tools::displayError('Archive cannot be extracted.'); $this->_errors[] = Tools::displayError('Archive cannot be extracted.');
if (!unlink($file)) if (!unlink($file))
@@ -551,7 +551,7 @@ class AdminTranslations extends AdminTab
foreach ($arr_find_and_write as $key=>$value) foreach ($arr_find_and_write as $key=>$value)
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']); $this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
} }
} }
else else
@@ -680,7 +680,7 @@ class AdminTranslations extends AdminTab
} }
} }
if (count($this->_errors) == 0) if (count($this->_errors) == 0)
Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token.$params_redirect); Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token.$params_redirect);
} }
public function display() public function display()
{ {
@@ -717,7 +717,7 @@ class AdminTranslations extends AdminTab
</a>'; </a>';
echo '<input type="hidden" name="token" value="'.$this->token.'" /></form></fieldset> echo '<input type="hidden" name="token" value="'.$this->token.'" /></form></fieldset>
<br /><br /><h2>'.$this->l('Translation exchange').'</h2>'; <br /><br /><h2>'.$this->l('Translation exchange').'</h2>';
echo '<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> echo '<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset class="width3"> <fieldset class="width3">
<legend> <legend>
<img src="../img/admin/import.gif" />'.$this->l('Add / Update a language').' <img src="../img/admin/import.gif" />'.$this->l('Add / Update a language').'
@@ -755,7 +755,7 @@ class AdminTranslations extends AdminTab
echo ' </div> echo ' </div>
</fieldset> </fieldset>
</form><br /><br />'; </form><br /><br />';
echo '<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> echo '<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset class="width3"> <fieldset class="width3">
<legend> <legend>
<img src="../img/admin/import.gif" />'.$this->l('Import a language pack manually').' <img src="../img/admin/import.gif" />'.$this->l('Import a language pack manually').'
@@ -768,7 +768,7 @@ class AdminTranslations extends AdminTab
</fieldset> </fieldset>
</form> </form>
<br /><br /> <br /><br />
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<fieldset class="width3"><legend><img src="../img/admin/export.gif" />'.$this->l('Export a language').'</legend> <fieldset class="width3"><legend><img src="../img/admin/export.gif" />'.$this->l('Export a language').'</legend>
<p>'.$this->l('Export data from one language to a file (language pack).').'<br />'. <p>'.$this->l('Export data from one language to a file (language pack).').'<br />'.
$this->l('Choose the theme from which you want to export translations.').'<br /> $this->l('Choose the theme from which you want to export translations.').'<br />
@@ -790,7 +790,7 @@ class AdminTranslations extends AdminTab
<br /><br />'; <br /><br />';
$allLanguages = Language::getLanguages(false); $allLanguages = Language::getLanguages(false);
echo ' echo '
<form action="'.$currentIndex.'&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
<fieldset class="width3"><legend><img src="../img/admin/copy_files.gif" />'.$this->l('Copy').'</legend> <fieldset class="width3"><legend><img src="../img/admin/copy_files.gif" />'.$this->l('Copy').'</legend>
<p>'.$this->l('Copies data from one language to another.').'<br />'. <p>'.$this->l('Copies data from one language to another.').'<br />'.
$this->l('Be careful, as it will replace all existing data for the destination language!').'<br />'. $this->l('Be careful, as it will replace all existing data for the destination language!').'<br />'.
@@ -996,7 +996,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&submitTranslationsFront=1&token='.$this->token.'" class="form">'; <form method="post" action="'.self::$currentIndex.'&submitTranslationsFront=1&token='.$this->token.'" class="form">';
$str_output .= $this->displayToggleButton(sizeof($_LANG) >= $count); $str_output .= $this->displayToggleButton(sizeof($_LANG) >= $count);
$str_output .= $this->displayAutoTranslate(); $str_output .= $this->displayAutoTranslate();
$str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsFront" value="'.$this->l('Update translations').'" class="button" /><br /><br />'; $str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsFront" value="'.$this->l('Update translations').'" class="button" /><br /><br />';
@@ -1075,7 +1075,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&submitTranslationsBack=1&token='.$this->token.'" class="form">'; <form method="post" action="'.self::$currentIndex.'&submitTranslationsBack=1&token='.$this->token.'" class="form">';
$str_output .= $this->displayToggleButton(); $str_output .= $this->displayToggleButton();
$str_output .= $this->displayAutoTranslate(); $str_output .= $this->displayAutoTranslate();
$str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsBack" value="'.$this->l('Update translations').'" class="button" /><br /><br />'; $str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsBack" value="'.$this->l('Update translations').'" class="button" /><br /><br />';
@@ -1154,7 +1154,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&submitTranslationsErrors=1&lang='.$lang.'&token='.$this->token.'" class="form"> <form method="post" action="'.self::$currentIndex.'&submitTranslationsErrors=1&lang='.$lang.'&token='.$this->token.'" class="form">
<input type="submit" name="submitTranslationsErrors" value="'.$this->l('Update translations').'" class="button" /><br /><br /> <input type="submit" name="submitTranslationsErrors" value="'.$this->l('Update translations').'" class="button" /><br /><br />
<table cellpadding="0" cellspacing="0" class="table">'; <table cellpadding="0" cellspacing="0" class="table">';
ksort($stringToTranslate); ksort($stringToTranslate);
@@ -1197,7 +1197,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= $this->l('Fields to translate').' : <b>'.$count.'</b>. '.$this->l('Click on the titles to open fieldsets').'.<br /><br /> $str_output .= $this->l('Fields to translate').' : <b>'.$count.'</b>. '.$this->l('Click on the titles to open fieldsets').'.<br /><br />
<form method="post" action="'.$currentIndex.'&submitTranslationsFields=1&token='.$this->token.'" class="form">'; <form method="post" action="'.self::$currentIndex.'&submitTranslationsFields=1&token='.$this->token.'" class="form">';
$str_output .= $this->displayToggleButton(); $str_output .= $this->displayToggleButton();
$str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsFields" value="'.$this->l('Update translations').'" class="button" /><br /><br />'; $str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsFields" value="'.$this->l('Update translations').'" class="button" /><br /><br />';
foreach ($classArray AS $className => $rules) foreach ($classArray AS $className => $rules)
@@ -1569,7 +1569,7 @@ class AdminTranslations extends AdminTab
// display form // display form
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&token='.$this->token.'&type=mails&lang='.$obj_lang->iso_code.'" class="form">'; <form method="post" action="'.self::$currentIndex.'&token='.$this->token.'&type=mails&lang='.$obj_lang->iso_code.'" class="form">';
$str_output .= $this->displayToggleButton(); $str_output .= $this->displayToggleButton();
$str_output .= $this->displaySubmitButtons(Tools::getValue('type')); $str_output .= $this->displaySubmitButtons(Tools::getValue('type'));
$str_output .= '<br/><br/>'; $str_output .= '<br/><br/>';
@@ -1785,7 +1785,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&submitTranslationsModules=1&token='.$this->token.'" class="form">'; <form method="post" action="'.self::$currentIndex.'&submitTranslationsModules=1&token='.$this->token.'" class="form">';
$str_output .= $this->displayToggleButton(); $str_output .= $this->displayToggleButton();
$str_output .= $this->displayAutoTranslate(); $str_output .= $this->displayAutoTranslate();
$str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsModules" value="'.$this->l('Update translations').'" class="button" /><br /><br />'; $str_output .= '<input type="hidden" name="lang" value="'.$lang.'" /><input type="submit" name="submitTranslationsModules" value="'.$this->l('Update translations').'" class="button" /><br /><br />';
@@ -1873,7 +1873,7 @@ class AdminTranslations extends AdminTab
if (!$this->suhosin_limit_exceed) if (!$this->suhosin_limit_exceed)
{ {
$str_output .= ' $str_output .= '
<form method="post" action="'.$currentIndex.'&submitTranslationsPDF=1&token='.$this->token.'" class="form"> <form method="post" action="'.self::$currentIndex.'&submitTranslationsPDF=1&token='.$this->token.'" class="form">
<script type="text/javascript"> <script type="text/javascript">
var openAll = \''.html_entity_decode($this->l('Expand all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\'; var openAll = \''.html_entity_decode($this->l('Expand all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
var closeAll = \''.html_entity_decode($this->l('Close all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\'; var closeAll = \''.html_entity_decode($this->l('Close all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
+3 -3
View File
@@ -103,7 +103,7 @@ class AdminWebservice extends AdminTab
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/access.png" />'.$this->l('Webservice Accounts').'</legend> <fieldset><legend><img src="../img/admin/access.png" />'.$this->l('Webservice Accounts').'</legend>
<label>'.$this->l('Key:').'</label> <label>'.$this->l('Key:').'</label>
@@ -239,7 +239,7 @@ echo '
{ {
$this->displayForm(); $this->displayForm();
if ($this->tabAccess['view']) if ($this->tabAccess['view'])
echo '<br /><br /><a href="'.((Tools::getValue('back')) ? Tools::getValue('back') : $currentIndex.'&token='.$this->token).'"><img src="../img/admin/arrow2.gif" /> '.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'</a><br />'; echo '<br /><br /><a href="'.((Tools::getValue('back')) ? Tools::getValue('back') : self::$currentIndex.'&token='.$this->token).'"><img src="../img/admin/arrow2.gif" /> '.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'</a><br />';
} }
else else
echo $this->l('You do not have permission to add here'); echo $this->l('You do not have permission to add here');
@@ -250,7 +250,7 @@ echo '
{ {
$this->displayForm(); $this->displayForm();
if ($this->tabAccess['view']) if ($this->tabAccess['view'])
echo '<br /><br /><a href="'.((Tools::getValue('back')) ? Tools::getValue('back') : $currentIndex.'&token='.$this->token).'"><img src="../img/admin/arrow2.gif" /> '.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'</a><br />'; echo '<br /><br /><a href="'.((Tools::getValue('back')) ? Tools::getValue('back') : self::$currentIndex.'&token='.$this->token).'"><img src="../img/admin/arrow2.gif" /> '.((Tools::getValue('back')) ? $this->l('Back') : $this->l('Back to list')).'</a><br />';
} }
else else
echo $this->l('You do not have permission to edit here'); echo $this->l('You do not have permission to edit here');
+1 -1
View File
@@ -54,7 +54,7 @@ class AdminZones extends AdminTab
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
echo ' echo '
<form action="'.$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post"> <form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Zones').'</legend> <fieldset><legend><img src="../img/admin/world.gif" />'.$this->l('Zones').'</legend>
<label>'.$this->l('Name').'</label> <label>'.$this->l('Name').'</label>
+12 -6
View File
@@ -37,7 +37,7 @@ abstract class AdminTabCore
protected $identifier = false; protected $identifier = false;
/** @var string Tab name */ /** @var string Tab name */
public $name; public $className;
/** @var string Security token */ /** @var string Security token */
public $token; public $token;
@@ -141,7 +141,7 @@ abstract class AdminTabCore
/** @var string specificConfirmDelete */ /** @var string specificConfirmDelete */
public $specificConfirmDelete = NULL; public $specificConfirmDelete = NULL;
public $currentIndex = ''; public static $currentIndex;
protected $identifiersDnd = array('id_product' => 'id_product', 'id_category' => 'id_category_to_move','id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms'); protected $identifiersDnd = array('id_product' => 'id_product', 'id_category' => 'id_category_to_move','id_cms_category' => 'id_cms_category_to_move', 'id_cms' => 'id_cms');
@@ -171,9 +171,15 @@ abstract class AdminTabCore
public function __construct() public function __construct()
{ {
global $cookie; global $cookie, $currentIndex;
$context = Context::getContext(); $context = Context::getContext();
$context->tab = $this; $context->tab = $this;
/*$currentIndex = $_SERVER['SCRIPT_NAME'].($tab ? '?tab='.$tab : '');
if ($back = Tools::getValue('back'))
$currentIndex .= '&back='.urlencode($back);
$this->currentIndex = $currentIndex;*/
$this->id = Tab::getCurrentTabId(); $this->id = Tab::getCurrentTabId();
$this->_conf = array( $this->_conf = array(
1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'),
@@ -1709,7 +1715,7 @@ abstract class AdminTabCore
<script type="text/javascript"> <script type="text/javascript">
id_language = Number('.$defaultLanguage.'); id_language = Number('.$defaultLanguage.');
</script> </script>
<form action="'.$this->currentIndex.'" id="'.$tab['name'].'" name="'.$tab['name'].'" method="post"> <form action="'.self::$currentIndex.'" id="'.$tab['name'].'" name="'.$tab['name'].'" method="post">
<fieldset>'; <fieldset>';
echo (isset($this->optionTitle) ? '<legend> echo (isset($this->optionTitle) ? '<legend>
<img src="'.(!empty($tab['module']) && file_exists($_SERVER['DOCUMENT_ROOT']._MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.gif') ? _MODULE_DIR_.$tab['module'].'/' : '../img/t/').$tab['class_name'].'.gif" />' <img src="'.(!empty($tab['module']) && file_exists($_SERVER['DOCUMENT_ROOT']._MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.gif') ? _MODULE_DIR_.$tab['module'].'/' : '../img/t/').$tab['class_name'].'.gif" />'
@@ -2033,7 +2039,7 @@ abstract class AdminTabCore
{ {
$html = ' $html = '
<table cellpadding="0" cellspacing="0" class="table"> <table cellpadding="0" cellspacing="0" class="table">
<form name="updateAssoShop" action="'.$this->currentIndex.'&submitFields'.$this->table.'=1&token='.$this->token.'" method="post"> <form name="updateAssoShop" action="'.self::$currentIndex.'&submitFields'.$this->table.'=1&token='.$this->token.'" method="post">
<input type="hidden" name="assoShopClass" value="'.$this->className.'" /> <input type="hidden" name="assoShopClass" value="'.$this->className.'" />
<tr> <tr>
<th style="width: 200px">'.$this->l('Shop association').'</th>'; <th style="width: 200px">'.$this->l('Shop association').'</th>';
@@ -2091,7 +2097,7 @@ abstract class AdminTabCore
$assos[$row['id_group_shop']][] = $row[$this->identifier]; $assos[$row['id_group_shop']][] = $row[$this->identifier];
if (!$this->_object) if (!$this->_object)
{ {
$html = '<form name="updateAssoGroupShop" action="'.$this->currentIndex.'&submitFields'.$this->table.'=1&token='.$this->token.'" method="post"> $html = '<form name="updateAssoGroupShop" action="'.self::$currentIndex.'&submitFields'.$this->table.'=1&token='.$this->token.'" method="post">
<input type="hidden" name="assoGroupShopClass" value="'.$this->className.'" /> <input type="hidden" name="assoGroupShopClass" value="'.$this->className.'" />
<table cellpadding="0" cellspacing="0" class="table"> <table cellpadding="0" cellspacing="0" class="table">
<tr> <tr>
+10 -16
View File
@@ -176,11 +176,13 @@ class CMSCategoryCore extends ObjectModel
); );
} }
static public function getRecurseCategory($id_lang = _USER_ID_LANG_, $current = 1, $active = 1, $links = 0, $id_shop = false, $context = null) static public function getRecurseCategory($id_lang = null, $current = 1, $active = 1, $links = 0, $id_shop = false, $context = null)
{ {
if (!$context) if (!$context)
$context = Context::getContext(); $context = Context::getContext();
$id_lang = is_null($id_lang) ? $context->language->id : $id_lang;
$category = Db::getInstance()->getRow(' $category = Db::getInstance()->getRow('
SELECT c.`id_cms_category`, c.`id_parent`, c.`level_depth`, cl.`name`, cl.`link_rewrite` SELECT c.`id_cms_category`, c.`id_parent`, c.`level_depth`, cl.`name`, cl.`link_rewrite`
FROM `'._DB_PREFIX_.'cms_category` c FROM `'._DB_PREFIX_.'cms_category` c
@@ -399,16 +401,6 @@ class CMSCategoryCore extends ObjectModel
{ {
return self::getChildren(1, $id_lang, $active); return self::getChildren(1, $id_lang, $active);
} }
/**
* @deprecated
**/
static public function getRootCMSCategory($id_lang = NULL)
{
Tools::displayAsDeprecated();
//get idLang
$id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang);
return new CMSCategory (1, $id_lang);
}
static public function getChildren($id_parent, $id_lang, $active = true) static public function getChildren($id_parent, $id_lang, $active = true)
{ {
@@ -544,20 +536,22 @@ class CMSCategoryCore extends ObjectModel
* @param integer $id_lang Language ID * @param integer $id_lang Language ID
* @return array Corresponding categories * @return array Corresponding categories
*/ */
public function getParentsCategories($idLang = null) public function getParentsCategories($idLang = null, $context = null)
{ {
if (!$context)
$context = Context::getContext();
//get idLang //get idLang
$idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); $idLang = is_null($idLang) ? $context->language->id : $idLang;
$categories = null; $categories = null;
$idCurrent = (int)($this->id); $idCurrent = $this->id;
while (true) while (true)
{ {
$query = ' $query = '
SELECT c.*, cl.* SELECT c.*, cl.*
FROM `'._DB_PREFIX_.'cms_category` c FROM `'._DB_PREFIX_.'cms_category` c
LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)($idLang).') LEFT JOIN `'._DB_PREFIX_.'cms_category_lang` cl ON (c.`id_cms_category` = cl.`id_cms_category` AND `id_lang` = '.(int)$idLang.')
WHERE c.`id_cms_category` = '.$idCurrent.' AND c.`id_parent` != 0 WHERE c.`id_cms_category` = '.(int)$idCurrent.' AND c.`id_parent` != 0
'; ';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query);
+11 -11
View File
@@ -193,18 +193,18 @@ class CategoryCore extends ObjectModel
{ {
if (!$context) if (!$context)
$context = Context::getContext(); $context = Context::getContext();
$idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); $idLang = is_null($idLang) ? $context->language->id : (int)$idLang;
$children = array(); $children = array();
if (($maxDepth == 0 OR $currentDepth < $maxDepth) AND $subcats = $this->getSubCategories((int)$idLang, true) AND sizeof($subcats)) if (($maxDepth == 0 OR $currentDepth < $maxDepth) AND $subcats = $this->getSubCategories($idLang, true) AND sizeof($subcats))
foreach ($subcats AS &$subcat) foreach ($subcats AS &$subcat)
{ {
if (!$subcat['id_category']) if (!$subcat['id_category'])
break; break;
elseif (!is_array($excludedIdsArray) || !in_array($subcat['id_category'], $excludedIdsArray)) elseif (!is_array($excludedIdsArray) || !in_array($subcat['id_category'], $excludedIdsArray))
{ {
$categ = new Category((int)$subcat['id_category'], (int)$idLang); $categ = new Category((int)$subcat['id_category'], $idLang);
$children[] = $categ->recurseLiteCategTree($maxDepth, $currentDepth + 1, (int)$idLang, $excludedIdsArray); $children[] = $categ->recurseLiteCategTree($maxDepth, $currentDepth + 1, $idLang, $excludedIdsArray);
} }
} }
@@ -574,13 +574,13 @@ class CategoryCore extends ObjectModel
return self::getChildren(1, $id_lang, $active); return self::getChildren(1, $id_lang, $active);
} }
static public function getRootCategory($id_lang = NULL, $id_shop = false) static public function getRootCategory($id_lang = NULL, $id_shop = false, $context = null)
{ {
if (!$id_shop) if (!$id_shop)
$id_shop = Configuration::get('PS_SHOP_DEFAULT'); $id_shop = Configuration::get('PS_SHOP_DEFAULT');
$shop = new Shop((int)$id_shop); $shop = new Shop($id_shop);
return new Category ((int)$shop->id_category, is_null($id_lang) ? (int)_USER_ID_LANG_ : (int)($id_lang)); return new Category ($shop->id_category, is_null($id_lang) ? $context->language->id : $id_lang);
} }
/** /**
@@ -790,19 +790,19 @@ class CategoryCore extends ObjectModel
* @param integer $id_lang Language ID * @param integer $id_lang Language ID
* @return array Corresponding categories * @return array Corresponding categories
*/ */
public function getParentsCategories($idLang = null) public function getParentsCategories($idLang = null, $context = null)
{ {
//get idLang //get idLang
$idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang); $idLang = is_null($idLang) ? $context->language->id : $idLang;
$categories = null; $categories = null;
$idCurrent = (int)($this->id); $idCurrent = $this->id;
while (true) while (true)
{ {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT c.*, cl.* SELECT c.*, cl.*
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)($idLang).') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$idLang.')
WHERE c.`id_category` = '.(int)$idCurrent.' AND c.`id_parent` != 0 WHERE c.`id_category` = '.(int)$idCurrent.' AND c.`id_parent` != 0
'); ');
+11 -13
View File
@@ -122,10 +122,6 @@ class FrontControllerCore
Tools::switchLanguage(); Tools::switchLanguage();
Tools::setCookieLanguage($cookie); Tools::setCookieLanguage($cookie);
/* attribute id_lang is often needed, so we create a constant for performance reasons */
if (!defined('_USER_ID_LANG_'))
define('_USER_ID_LANG_', (int)$cookie->id_lang);
if (isset($_GET['logout']) OR ($cookie->logged AND Customer::isBanned((int)$cookie->id_customer))) if (isset($_GET['logout']) OR ($cookie->logged AND Customer::isBanned((int)$cookie->id_customer)))
{ {
$cookie->logout(); $cookie->logout();
@@ -153,12 +149,13 @@ class FrontControllerCore
$cart->nbProducts() AND intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1 AND $cart->nbProducts() AND intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1 AND
!self::isInWhitelistForGeolocation()) !self::isInWhitelistForGeolocation())
unset($cookie->id_cart, $cart); unset($cookie->id_cart, $cart);
elseif ($cookie->id_customer != $cart->id_customer OR $cookie->id_lang != $cart->id_lang OR $cookie->id_currency != $cart->id_currency) // update cart values
elseif ($cookie->id_customer != $cart->id_customer OR $cookie->id_lang != $cart->id_lang OR $currency->id != $cart->id_currency)
{ {
if ($cookie->id_customer) if ($cookie->id_customer)
$cart->id_customer = (int)($cookie->id_customer); $cart->id_customer = (int)($cookie->id_customer);
$cart->id_lang = (int)($cookie->id_lang); $cart->id_lang = (int)($cookie->id_lang);
$cart->id_currency = (int)($cookie->id_currency); $cart->id_currency = (int)$currency->id;
$cart->update(); $cart->update();
} }
/* Select an address if not set */ /* Select an address if not set */
@@ -212,14 +209,16 @@ class FrontControllerCore
if (Validate::isLoadedObject($currency)) if (Validate::isLoadedObject($currency))
$smarty->ps_currency = $currency; $smarty->ps_currency = $currency;
if (Validate::isLoadedObject($ps_language = new Language((int)$cookie->id_lang))) if (!Validate::isLoadedObject($language = new Language($cookie->id_lang)))
$smarty->ps_language = $ps_language; $language = new Language(Configuration::get('PS_LANG_DEFAULT'));
$smarty->ps_language = $language;
$context->language = $language;
/* get page name to display it in body id */ /* get page name to display it in body id */
$pathinfo = pathinfo(__FILE__); $pathinfo = pathinfo(__FILE__);
$page_name = Dispatcher::$controller; $page_name = Dispatcher::$controller;
$page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name; $page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name;
$smarty->assign(Tools::getMetaTags($cookie->id_lang, $page_name)); $smarty->assign(Tools::getMetaTags($language->id, $page_name));
$smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI']))); $smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
/* Breadcrumb */ /* Breadcrumb */
@@ -228,15 +227,14 @@ class FrontControllerCore
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; $protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
$protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; $protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
$link = new Link($protocol_link, $protocol_content);
$context->link = $link;
if (!defined('_PS_BASE_URL_')) if (!defined('_PS_BASE_URL_'))
define('_PS_BASE_URL_', Tools::getShopDomain(true)); define('_PS_BASE_URL_', Tools::getShopDomain(true));
if (!defined('_PS_BASE_URL_SSL_')) if (!defined('_PS_BASE_URL_SSL_'))
define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));
$link = new Link($protocol_link, $protocol_content);
$context->link = $link;
$context->language = $ps_language;
$link->preloadPageLinks(); $link->preloadPageLinks();
$this->canonicalRedirection(); $this->canonicalRedirection();
@@ -262,7 +260,7 @@ class FrontControllerCore
'tpl_dir' => _PS_THEME_DIR_, 'tpl_dir' => _PS_THEME_DIR_,
'modules_dir' => _MODULE_DIR_, 'modules_dir' => _MODULE_DIR_,
'mail_dir' => _MAIL_DIR_, 'mail_dir' => _MAIL_DIR_,
'lang_iso' => $ps_language->iso_code, 'lang_iso' => $language->iso_code,
'come_from' => Tools::getHttpHost(true, true).Tools::htmlentitiesUTF8(str_replace('\'', '', urldecode($_SERVER['REQUEST_URI']))), 'come_from' => Tools::getHttpHost(true, true).Tools::htmlentitiesUTF8(str_replace('\'', '', urldecode($_SERVER['REQUEST_URI']))),
'cart_qties' => (int)$cart->nbProducts(), 'cart_qties' => (int)$cart->nbProducts(),
'currencies' => Currency::getCurrencies(), 'currencies' => Currency::getCurrencies(),
+2 -2
View File
@@ -489,7 +489,7 @@ abstract class ModuleCore
if (substr(realpath($filePath), 0, strlen($realpathModuleDir)) == $realpathModuleDir) if (substr(realpath($filePath), 0, strlen($realpathModuleDir)) == $realpathModuleDir)
{ {
self::$classInModule[$currentClass] = substr(dirname($filePath), strlen($realpathModuleDir)+1); self::$classInModule[$currentClass] = substr(dirname($filePath), strlen($realpathModuleDir)+1);
$file = _PS_MODULE_DIR_.self::$classInModule[$currentClass].'/'.$context->getContext()->language->iso_code.'.php'; $file = _PS_MODULE_DIR_.self::$classInModule[$currentClass].'/'.Context::getContext()->language->iso_code.'.php';
if (Tools::file_exists_cache($file) AND include_once($file)) if (Tools::file_exists_cache($file) AND include_once($file))
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE;
} }
@@ -578,7 +578,7 @@ abstract class ModuleCore
if (!count($errors) AND (int)$xml_module->need_instance == 0 AND !$needNewConfigFile) if (!count($errors) AND (int)$xml_module->need_instance == 0 AND !$needNewConfigFile)
{ {
$file = _PS_MODULE_DIR_.$module.'/'.$context->getContext()->language->iso_code.'.php'; $file = _PS_MODULE_DIR_.$module.'/'.Context::getContext()->language->iso_code.'.php';
if (Tools::file_exists_cache($file) AND include_once($file)) if (Tools::file_exists_cache($file) AND include_once($file))
if(isset($_MODULE) AND is_array($_MODULE)) if(isset($_MODULE) AND is_array($_MODULE))
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE; $_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE;
+3 -1
View File
@@ -286,8 +286,10 @@ abstract class ModuleGraphCore extends Module
return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer); return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer);
} }
protected static function getEmployee($employee = null) protected static function getEmployee($employee = null, $context = null)
{ {
if (!$context)
$context = Context::getContext();
if (!$employee) if (!$employee)
$employee = $context->employee; $employee = $context->employee;
-28
View File
@@ -829,33 +829,6 @@ class ProductCore extends ObjectModel
ORDER BY pl.`name`'); ORDER BY pl.`name`');
} }
/**
* Return the products in the same category than the default category of the instancied product
*
* @param integer $id_lang Language ID
* @return array Products
* @deprecated
*/
public function getDefaultCategoryProducts($idLang = NULL, $limit = NULL)
{
Tools::displayAsDeprecated();
//get idLang
$idLang = is_null($idLang) ? _USER_ID_LANG_ : (int)($idLang);
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT p.`id_product`, pl.`description_short`set, pl.`link_rewrite`, pl.`name`, i.`id_image`
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = cp.id_product)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)
WHERE cp.id_category = ' . (int)($this->id_category_default) . '
AND id_lang = ' . (int)($idLang) . '
AND p.`active` = 1
AND i.`cover` = 1
'. (is_null($limit) ? '' : ' LIMIT 0 , ' . (int)($limit)));
return $result;
}
public function isNew() public function isNew()
{ {
$result = Db::getInstance()->ExecuteS(' $result = Db::getInstance()->ExecuteS('
@@ -867,7 +840,6 @@ class ProductCore extends ObjectModel
return sizeof($result) > 0; return sizeof($result) > 0;
} }
public function productAttributeExists($attributesList, $currentProductAttribute = false) public function productAttributeExists($attributesList, $currentProductAttribute = false)
{ {
$result = Db::getInstance()->ExecuteS('SELECT pac.`id_attribute`, pac.`id_product_attribute` $result = Db::getInstance()->ExecuteS('SELECT pac.`id_attribute`, pac.`id_product_attribute`
+14 -12
View File
@@ -181,21 +181,23 @@ class SceneCore extends ObjectModel
* *
* @return array Products * @return array Products
*/ */
static public function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true) static public function getScenes($id_category, $id_lang = NULL, $onlyActive = true, $liteResult = true, $hideScenePosition = true, $context = null)
{ {
$id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang); if (!$context)
$context = Context::getContext();
$id_lang = is_null($id_lang) ? $context->language->id : $id_lang;
$scenes = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $scenes = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT s.* SELECT s.*
FROM `'._DB_PREFIX_.'scene_category` sc FROM `'._DB_PREFIX_.'scene_category` sc
LEFT JOIN `'._DB_PREFIX_.'scene` s ON (sc.id_scene = s.id_scene) LEFT JOIN `'._DB_PREFIX_.'scene` s ON (sc.id_scene = s.id_scene)
LEFT JOIN `'._DB_PREFIX_.'scene_lang` sl ON (sl.id_scene = s.id_scene) LEFT JOIN `'._DB_PREFIX_.'scene_lang` sl ON (sl.id_scene = s.id_scene)
WHERE sc.id_category = '.(int)($id_category).' AND sl.id_lang = '.(int)($id_lang).($onlyActive ? ' AND s.active = 1' : '').' WHERE sc.id_category = '.(int)$id_category.' AND sl.id_lang = '.(int)$id_lang.($onlyActive ? ' AND s.active = 1' : '').'
ORDER BY sl.name ASC'); ORDER BY sl.name ASC');
if (!$liteResult AND $scenes) if (!$liteResult AND $scenes)
foreach($scenes AS &$scene) foreach($scenes AS &$scene)
$scene = new Scene((int)($scene['id_scene']), (int)($id_lang), false, $hideScenePosition); $scene = new Scene($scene['id_scene'], $id_lang, false, $hideScenePosition);
return $scenes; return $scenes;
} }
@@ -204,28 +206,28 @@ class SceneCore extends ObjectModel
* *
* @return array Products * @return array Products
*/ */
public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true) public function getProducts($onlyActive = true, $id_lang = NULL, $liteResult = true, $context = null)
{ {
global $link; global $link;
if (!$context)
$id_lang = is_null($id_lang) ? _USER_ID_LANG_ : (int)($id_lang); $context = Context::getContext();
$id_lang = is_null($id_lang) ? $context->language->id : $id_lang;
$products = Db::getInstance()->ExecuteS(' $products = Db::getInstance()->ExecuteS('
SELECT s.* SELECT s.*
FROM `'._DB_PREFIX_.'scene_products` s FROM `'._DB_PREFIX_.'scene_products` s
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = s.id_product) LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product = s.id_product)
WHERE s.id_scene = '.(int)($this->id).($onlyActive ? ' AND p.active = 1' : '')); WHERE s.id_scene = '.(int)$this->id.($onlyActive ? ' AND p.active = 1' : ''));
if (!$liteResult AND $products) if (!$liteResult AND $products)
foreach ($products AS &$product) foreach ($products AS &$product)
{ {
$product['details'] = new Product((int)($product['id_product']), !$liteResult, (int)($id_lang)); $product['details'] = new Product($product['id_product'], !$liteResult, $id_lang);
$product['link'] = $link->getProductLink((int)($product['details']->id), $product['details']->link_rewrite, $product['details']->category, $product['details']->ean13); $product['link'] = $link->getProductLink($product['details']->id, $product['details']->link_rewrite, $product['details']->category, $product['details']->ean13);
$cover = Product::getCover((int)($product['details']->id)); $cover = Product::getCover($product['details']->id);
if(is_array($cover)) if(is_array($cover))
$product = array_merge($cover, $product); $product = array_merge($cover, $product);
} }
return $products; return $products;
} }
+3 -3
View File
@@ -44,9 +44,9 @@ class SitemapControllerCore extends FrontController
public function process() public function process()
{ {
parent::process(); parent::process();
$this->smarty->assign('categoriesTree', Category::getRootCategory(NULL, (int)$this->id_current_shop)->recurseLiteCategTree(0)); $this->smarty->assign('categoriesTree', Category::getRootCategory(NULL, $this->id_current_shop)->recurseLiteCategTree(0));
$this->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(_USER_ID_LANG_, 1, 1, 1, (int)$this->id_current_shop)); $this->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(Context::getContext()->language->id, 1, 1, 1, $this->id_current_shop));
$this->smarty->assign('voucherAllowed', (int)(Configuration::get('PS_VOUCHERS'))); $this->smarty->assign('voucherAllowed', (int)Configuration::get('PS_VOUCHERS'));
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer'); $blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
$blocksupplier = Module::getInstanceByName('blocksupplier'); $blocksupplier = Module::getInstanceByName('blocksupplier');
$this->smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id) ? true : false)); $this->smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id) ? true : false));