// Fix double entities on AdminLog listing #PSCFV-10472

This commit is contained in:
Rémi Gaillard committed 2013-10-07 19:37:58 +02:00
1 parent 4daaa206d2
commit 7d0e9a5f06
3 files changed
+10 -10

No files matched your search

+4 -4
View File
@@ -693,7 +693,7 @@ class AdminControllerCore extends Controller
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token; $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token;
$this->errors[] = Tools::displayError('An error occurred during deletion.'); $this->errors[] = Tools::displayError('An error occurred during deletion.');
if ($res) if ($res)
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s deletion', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
} }
} }
else else
@@ -744,7 +744,7 @@ class AdminControllerCore extends Controller
/* voluntary do affectation here */ /* voluntary do affectation here */
elseif (($_POST[$this->identifier] = $this->object->id) && $this->postImage($this->object->id) && !count($this->errors) && $this->_redirect) elseif (($_POST[$this->identifier] = $this->object->id) && $this->postImage($this->object->id) && !count($this->errors) && $this->_redirect)
{ {
Logger::addLog(sprintf($this->l('%s addition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s addition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
$parent_id = (int)Tools::getValue('id_parent', 1); $parent_id = (int)Tools::getValue('id_parent', 1);
$this->afterAdd($this->object); $this->afterAdd($this->object);
$this->updateAssoShop($this->object->id); $this->updateAssoShop($this->object->id);
@@ -844,7 +844,7 @@ class AdminControllerCore extends Controller
if (empty($this->redirect_after) && $this->redirect_after !== false) if (empty($this->redirect_after) && $this->redirect_after !== false)
$this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token; $this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token;
} }
Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s edition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id);
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating an object.'). $this->errors[] = Tools::displayError('An error occurred while updating an object.').
@@ -2768,7 +2768,7 @@ class AdminControllerCore extends Controller
} }
if ($delete_ok) if ($delete_ok)
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$to_delete->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s deletion', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$to_delete->id, true, (int)$this->context->employee->id);
else else
$this->errors[] = sprintf(Tools::displayError('Can\'t delete #%d'), $id); $this->errors[] = sprintf(Tools::displayError('Can\'t delete #%d'), $id);
} }
+2 -2
View File
@@ -2853,9 +2853,9 @@ class AdminImportControllerCore extends AdminController
if ($import_type !== false) if ($import_type !== false)
{ {
$log_message = sprintf($this->l('%s import'), $import_type); $log_message = sprintf($this->l('%s import', 'AdminTab', false, false), $import_type);
if (Tools::getValue('truncate')) if (Tools::getValue('truncate'))
$log_message .= ' '.$this->l('with truncate'); $log_message .= ' '.$this->l('with truncate', 'AdminTab', false, false);
Logger::addLog($log_message, 1, null, $import_type, null, true, (int)$this->context->employee->id); Logger::addLog($log_message, 1, null, $import_type, null, true, (int)$this->context->employee->id);
} }
} }
@@ -630,7 +630,7 @@ class AdminProductsControllerCore extends AdminController
{ {
$id_category = (int)Tools::getValue('id_category'); $id_category = (int)Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category; $category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category;
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s deletion', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id);
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url; $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url;
} }
else else
@@ -729,7 +729,7 @@ class AdminProductsControllerCore extends AdminController
if (!count($this->errors)) if (!count($this->errors))
{ {
if ($product->delete()) if ($product->delete())
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$product->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s deletion', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$product->id, true, (int)$this->context->employee->id);
else else
$success = false; $success = false;
} }
@@ -1714,7 +1714,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->object->add()) if ($this->object->add())
{ {
Logger::addLog(sprintf($this->l('%s addition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s addition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
$this->addCarriers(); $this->addCarriers();
$this->updateAccessories($this->object); $this->updateAccessories($this->object);
$this->updatePackItems($this->object); $this->updatePackItems($this->object);
@@ -1836,7 +1836,7 @@ class AdminProductsControllerCore extends AdminController
if ($object->update()) if ($object->update())
{ {
Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); Logger::addLog(sprintf($this->l('%s edition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
if (in_array($this->context->shop->getContext(), array(Shop::CONTEXT_SHOP, Shop::CONTEXT_ALL))) if (in_array($this->context->shop->getContext(), array(Shop::CONTEXT_SHOP, Shop::CONTEXT_ALL)))
{ {
if ($this->isTabSubmitted('Shipping')) if ($this->isTabSubmitted('Shipping'))