Ejemplo n.º 1
0
 protected function afterUpdate($new_shop)
 {
     $categories = Tools::getValue('categoryBox');
     array_unshift($categories, Configuration::get('PS_ROOT_CATEGORY'));
     if (!Category::updateFromShop($categories, $new_shop->id)) {
         $this->errors[] = $this->l('You need to select at least the root category.');
     }
     if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
         $new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
     }
     return parent::afterUpdate($new_shop);
 }
Ejemplo n.º 2
0
 /**
  * @param Employee $object
  *
  * @return bool
  */
 protected function afterUpdate($object)
 {
     $res = parent::afterUpdate($object);
     // Update cookie if needed
     if (Tools::getValue('id_employee') == $this->context->employee->id && ($passwd = Tools::getValue('passwd')) && $object->passwd != $this->context->employee->passwd) {
         $this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
         if (Tools::getValue('passwd_send_email')) {
             $params = array('{email}' => $object->email, '{lastname}' => $object->lastname, '{firstname}' => $object->firstname, '{passwd}' => $passwd);
             Mail::Send($object->id_lang, 'password', Mail::l('Your new password', $object->id_lang), $params, $object->email, $object->firstname . ' ' . $object->lastname);
         }
     }
     return $res;
 }
Ejemplo n.º 3
0
 protected function afterUpdate($object)
 {
     $res = parent::afterUpdate($object);
     // Update cookie if needed
     if (Tools::getValue('id_employee') == $this->context->employee->id && Tools::getValue('passwd') && $object->passwd != $this->context->employee->passwd) {
         $this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
     }
     return $res;
 }
Ejemplo n.º 4
0
 /**
  * @param Shop $new_shop
  * @return bool
  */
 protected function afterUpdate($new_shop)
 {
     $categories = Tools::getValue('categoryBox');
     if (!is_array($categories)) {
         $this->errors[] = $this->l('Please create some sub-categories for this root category.');
         return false;
     }
     array_unshift($categories, Configuration::get('PS_ROOT_CATEGORY'));
     if (!Category::updateFromShop($categories, $new_shop->id)) {
         $this->errors[] = $this->l('You need to select at least the root category.');
     }
     if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
         $new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
     }
     if (Tools::isSubmit('submitAddshopAndStay') || Tools::isSubmit('submitAddshop')) {
         $this->redirect_after = self::$currentIndex . '&shop_id=' . (int) $new_shop->id . '&conf=4&token=' . $this->token;
     }
     return parent::afterUpdate($new_shop);
 }
Ejemplo n.º 5
0
 protected function afterUpdate($new_shop)
 {
     if (!Category::updateFromShop(Tools::getValue('categoryBox'), $new_shop->id)) {
         $this->errors[] = $this->l('You need to select at least the root category.');
     }
     if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
         $new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
     }
     return parent::afterUpdate($new_shop);
 }