当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderState::isRemovable方法代码示例

本文整理汇总了PHP中OrderState::isRemovable方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderState::isRemovable方法的具体用法?PHP OrderState::isRemovable怎么用?PHP OrderState::isRemovable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrderState的用法示例。


在下文中一共展示了OrderState::isRemovable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postProcess

 public function postProcess()
 {
     global $cookie;
     $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id);
     if ($this->tabAccess['add'] === '1' and Tools::isSubmit('submitAdd' . $this->table)) {
         $this->deleted = false;
         $_POST['invoice'] = Tools::getValue('invoice', 0);
         $_POST['delivery'] = Tools::getValue('delivery', 0);
         $_POST['logable'] = Tools::getValue('logable', 0);
         $_POST['send_email'] = Tools::getValue('send_email', 0);
         $_POST['hidden'] = Tools::getValue('hidden', 0);
         if (!$_POST['send_email']) {
             $languages = Language::getLanguages(false);
             foreach ($languages as $language) {
                 $_POST['template_' . (int) $language['id_lang']] = '';
             }
         }
         parent::postProcess();
     } elseif ($this->tabAccess['delete'] === '1' and isset($_GET['delete' . $this->table])) {
         $orderState = new OrderState((int) $_GET['id_order_state'], $cookie->id_lang);
         if (!$orderState->isRemovable()) {
             $this->_errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
         } else {
             parent::postProcess();
         }
     } elseif ($this->tabAccess['delete'] === '1' and isset($_POST['submitDelorder_state'])) {
         foreach ($_POST[$this->table . 'Box'] as $selection) {
             $orderState = new OrderState((int) $selection, $cookie->id_lang);
             if (!$orderState->isRemovable()) {
                 $this->_errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
                 break;
             }
         }
         if (empty($this->_errors)) {
             parent::postProcess();
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:40,代码来源:AdminOrdersStates.php

示例2: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitAdd' . $this->table)) {
         $_POST['invoice'] = Tools::getValue('invoice');
         $_POST['logable'] = Tools::getValue('logable');
         $_POST['send_email'] = Tools::getValue('send_email');
         $_POST['hidden'] = Tools::getValue('hidden');
         if (!$_POST['send_email']) {
             $languages = Language::getLanguages();
             foreach ($languages as $language) {
                 $_POST['template_' . $language['id_lang']] = '';
             }
         }
         parent::postProcess();
     } elseif (isset($_GET['delete' . $this->table])) {
         $orderState = new OrderState(intval($_GET['id_order_state']));
         if (!$orderState->isRemovable()) {
             $this->_errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
         } else {
             parent::postProcess();
         }
     } elseif (isset($_POST['submitDelorder_state'])) {
         foreach ($_POST[$this->table . 'Box'] as $selection) {
             $orderState = new OrderState(intval($selection));
             if (!$orderState->isRemovable()) {
                 $this->_errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
                 break;
             }
         }
         if (empty($this->_errors)) {
             parent::postProcess();
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:sealence,项目名称:local,代码行数:36,代码来源:AdminOrdersStates.php

示例3: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit($this->table . 'Orderby') || Tools::isSubmit($this->table . 'Orderway')) {
         $this->filter = true;
     }
     if (Tools::isSubmit('submitAddorder_return_state') || Tools::isSubmit('submitAddorder_return_state')) {
         $id_order_return_state = Tools::getValue('id_order_return_state');
         // Create Object OrderReturnState
         $order_return_state = new OrderReturnState((int) $id_order_return_state);
         $order_return_state->color = Tools::getValue('color');
         $order_return_state->name = array();
         $languages = Language::getLanguages(false);
         foreach ($languages as $language) {
             $order_return_state->name[$language['id_lang']] = Tools::getValue('name_' . $language['id_lang']);
         }
         // Update object
         if (!$order_return_state->save()) {
             $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s return state.');
         } else {
             Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . $this->token);
         }
     }
     if (Tools::isSubmit('submitBulkdeleteorder_return_state')) {
         $this->className = 'OrderReturnState';
         $this->table = 'order_return_state';
         $this->boxes = Tools::getValue('order_return_stateBox');
         parent::processBulkDelete();
     }
     if (Tools::isSubmit('deleteorder_return_state')) {
         $id_order_return_state = Tools::getValue('id_order_return_state');
         // Create Object OrderReturnState
         $order_return_state = new OrderReturnState((int) $id_order_return_state);
         if (!$order_return_state->delete()) {
             $this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s return state.');
         } else {
             Tools::redirectAdmin(self::$currentIndex . '&conf=1&token=' . $this->token);
         }
     }
     if (Tools::isSubmit('submitAdd' . $this->table)) {
         $this->deleted = false;
         // Disabling saving historisation
         $_POST['invoice'] = (int) Tools::getValue('invoice_on');
         $_POST['logable'] = (int) Tools::getValue('logable_on');
         $_POST['send_email'] = (int) Tools::getValue('send_email_on');
         $_POST['hidden'] = (int) Tools::getValue('hidden_on');
         $_POST['shipped'] = (int) Tools::getValue('shipped_on');
         $_POST['paid'] = (int) Tools::getValue('paid_on');
         $_POST['delivery'] = (int) Tools::getValue('delivery_on');
         if (!$_POST['send_email']) {
             $languages = Language::getLanguages(false);
             foreach ($languages as $language) {
                 $_POST['template_' . $language['id_lang']] = '';
             }
         }
         return parent::postProcess();
     } else {
         if (Tools::isSubmit('delete' . $this->table)) {
             $order_state = new OrderState(Tools::getValue('id_order_state'), $this->context->language->id);
             if (!$order_state->isRemovable()) {
                 $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
             } else {
                 return parent::postProcess();
             }
         } else {
             if (Tools::isSubmit('submitBulkdelete' . $this->table)) {
                 foreach (Tools::getValue($this->table . 'Box') as $selection) {
                     $order_state = new OrderState((int) $selection, $this->context->language->id);
                     if (!$order_state->isRemovable()) {
                         $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
                         break;
                     }
                 }
                 if (!count($this->errors)) {
                     return parent::postProcess();
                 }
             } else {
                 return parent::postProcess();
             }
         }
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:81,代码来源:AdminStatusesController.php


注:本文中的OrderState::isRemovable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。