public function initProcess() { $this->id_object = Tools::getValue('id_' . $this->table); if (Tools::isSubmit('changeShowPricesVal') && $this->id_object) { $this->action = 'change_show_prices_val'; } parent::initProcess(); }
public function initProcess() { parent::initProcess(); // This is a composite page, we don't want the "options" display mode if ($this->display == 'options') { $this->display = ''; } }
public function initProcess() { parent::initProcess(); $access = Profile::getProfileAccess($this->context->employee->id_profile, (int) Tab::getIdFromClassName('AdminOrders')); if ($access['view'] === '1' && ($action = Tools::getValue('submitAction'))) { $this->action = $action; } else { $this->errors[] = Tools::displayError('You do not have permission to view this.'); } }
public function initProcess() { if ((isset($_GET['new_window' . $this->table]) || isset($_GET['new_window'])) && Tools::getValue($this->identifier)) { if ($this->access('edit')) { $this->action = 'newWindow'; } else { $this->errors[] = $this->trans('You do not have permission to edit this.', array(), 'Admin.Notifications.Error'); } } parent::initProcess(); }
public function initProcess() { if (Tools::isSubmit('generate')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'generate'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } parent::initProcess(); }
public function initProcess() { parent::initProcess(); $this->checkCacheFolder(); $access = Profile::getProfileAccess($this->context->employee->id_profile, (int) Tab::getIdFromClassName('AdminOrders')); if ($access['view'] === '1' && ($action = Tools::getValue('submitAction'))) { $this->action = $action; } else { $this->errors[] = $this->trans('You do not have permission to view this.', array(), 'Admin.Notifications.Error'); } }
public function initProcess() { if ((isset($_GET['new_window' . $this->table]) || isset($_GET['new_window'])) && Tools::getValue($this->identifier)) { if ($this->tabAccess['edit'] === '1') { $this->action = 'newWindow'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } parent::initProcess(); }
public function initProcess() { if (!defined('PS_MASS_PRODUCT_CREATION')) { define('PS_MASS_PRODUCT_CREATION', true); } if (Tools::isSubmit('generate')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'generate'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } parent::initProcess(); }
public function initProcess() { $this->id_object = Tools::getValue('id_' . $this->table); if (Tools::isSubmit('changeShowPricesVal') && $this->id_object) { $this->action = 'change_show_prices_val'; } if (Tools::getIsset('viewgroup')) { $this->list_id = 'customer_group'; if (isset($_POST['submitReset' . $this->list_id])) { $this->processResetFilters(); } } else { $this->list_id = 'group'; } parent::initProcess(); }
public function initProcess() { if (Tools::isSubmit('deletetax_rule')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'delete_tax_rule'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::isSubmit('submitBulkdeletetax_rule')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'bulk_delete_tax_rules'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::getValue('action') == 'create_rule') { if ($this->tabAccess['add'] === '1') { $this->action = 'create_rule'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } else { parent::initProcess(); } }
public function initProcess() { parent::initProcess(); if (Tools::getValue('export' . $this->table)) { $this->display = 'export'; $this->action = 'export'; } }
public function initProcess() { if (!defined('PS_MASS_PRODUCT_CREATION')) { define('PS_MASS_PRODUCT_CREATION', true); } if (Tools::isSubmit('generate')) { if ($this->access('edit')) { $this->action = 'generate'; } else { $this->errors[] = $this->trans('You do not have permission to add this.', array(), 'Admin.Notifications.Error'); } } parent::initProcess(); }
public function initProcess() { if (Tools::isSubmit('submitAddaddress') || Tools::isSubmit('deleteaddress') || Tools::isSubmit('submitBulkdeleteaddress') || Tools::isSubmit('exportaddress')) { $this->table = 'address'; $this->className = 'Address'; $this->identifier = 'id_address'; $this->deleted = true; $this->fields_list = $this->getAddressFieldsList(); } parent::initProcess(); }
public function initProcess() { $this->setTypeAttribute(); parent::initProcess(); if ($this->table == 'attribute') { $this->display = 'editAttributes'; $this->id_attribute = (int) Tools::getValue('id_attribute'); } }
public function initProcess() { // Are we working on feature values? if (Tools::getValue('id_feature_value') || Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('addfeature_value') || Tools::isSubmit('updatefeature_value') || Tools::isSubmit('submitBulkdeletefeature_value')) { $this->setTypeValue(); } if (Tools::getIsset('viewfeature')) { $this->list_id = 'feature_value'; if (isset($_POST['submitReset' . $this->list_id])) { $this->processResetFilters(); } } else { $this->list_id = 'feature'; $this->_defaultOrderBy = 'position'; $this->_defaultOrderWay = 'ASC'; } parent::initProcess(); }
public function initProcess() { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature.'); return false; } if (Tools::getIsset('detailsproduct')) { $this->list_id = 'product_attribute'; if (isset($_POST['submitReset' . $this->list_id])) { $this->processResetFilters(); } } else { $this->list_id = 'product'; } parent::initProcess(); }
public function initProcess() { parent::initProcess(); if (Tools::isSubmit('submitGuestToCustomer') && $this->id_object) { if ($this->tabAccess['edit'] === '1') { $this->action = 'guest_to_customer'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('changeNewsletterVal') && $this->id_object) { if ($this->tabAccess['edit'] === '1') { $this->action = 'change_newsletter_val'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('changeOptinVal') && $this->id_object) { if ($this->tabAccess['edit'] === '1') { $this->action = 'change_optin_val'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } // When deleting, first display a form to select the type of deletion if ($this->action == 'delete' || $this->action == 'bulkdelete') { if (Tools::getValue('deleteMode') == 'real' || Tools::getValue('deleteMode') == 'deleted') { $this->delete_mode = Tools::getValue('deleteMode'); } else { $this->action = 'select_delete'; } } }
public function initProcess() { // Are we working on feature values? if (Tools::getValue('id_feature_value') || Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('addfeature_value') || Tools::isSubmit('updatefeature_value') || Tools::isSubmit('submitBulkdeletefeature_value')) { $this->setTypeValue(); } parent::initProcess(); if ($this->table == 'feature_value' && ($this->display == 'edit' || $this->display == 'add')) { $this->display = 'editFeatureValue'; } }
public function initProcess() { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); return false; } parent::initProcess(); }
public function initProcess() { // Are we working on feature values? if (Tools::getValue('id_feature_value') || Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value') || Tools::isSubmit('addfeature_value') || Tools::isSubmit('updatefeature_value') || Tools::isSubmit('submitBulkdeletefeature_value')) { $this->setTypeValue(); } parent::initProcess(); }
/** * @see AdminController::initProcess() */ public function initProcess() { if (Tools::isSubmit('SubmitExchangesRates')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'exchangeRates'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } if (Tools::isSubmit('submitAddcurrency') && !Tools::getValue('id_currency') && Currency::exists(Tools::getValue('iso_code'), Tools::getValue('iso_code_num'))) { $this->errors[] = Tools::displayError('This currency already exists.'); } if (Tools::isSubmit('submitAddcurrency') && (double) Tools::getValue('conversion_rate') <= 0) { $this->errors[] = Tools::displayError('The currency conversion rate can not be equal to 0.'); } parent::initProcess(); }
public function initProcess() { if (Tools::getIsset('details' . $this->table)) { $this->list_id = 'details'; if (isset($_POST['submitReset' . $this->list_id])) { $this->processResetFilters(); } } else { $this->list_id = 'tab'; } return parent::initProcess(); }
public function initProcess() { $this->setTypeAttribute(); if (Tools::getIsset('viewattribute_group')) { $this->list_id = 'attribute_values'; if (isset($_POST['submitReset' . $this->list_id])) { $this->processResetFilters(); } } else { $this->list_id = 'attribute_group'; } parent::initProcess(); if ($this->table == 'attribute') { $this->display = 'editAttributes'; $this->id_attribute = (int) Tools::getValue('id_attribute'); } }
public function initProcess() { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } if (Tools::isSubmit('detailsproduct')) { $this->list_id = 'details'; } else { $this->list_id = 'stock'; } parent::initProcess(); }
public function initProcess() { if ((isset($_GET['responsive' . $this->table]) || isset($_GET['responsive'])) && Tools::getValue($this->identifier)) { if ($this->tabAccess['edit'] === '1') { $this->action = 'responsive'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } else { if ((isset($_GET['default_left_column' . $this->table]) || isset($_GET['default_left_column'])) && Tools::getValue($this->identifier)) { if ($this->tabAccess['edit'] === '1') { $this->action = 'defaultleftcolumn'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } else { if ((isset($_GET['default_right_column' . $this->table]) || isset($_GET['default_right_column'])) && Tools::getValue($this->identifier)) { if ($this->tabAccess['edit'] === '1') { $this->action = 'defaultrightcolumn'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } else { if (Tools::getIsset('id_theme_meta') && Tools::getIsset('leftmeta')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'leftmeta'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } else { if (Tools::getIsset('id_theme_meta') && Tools::getIsset('rightmeta')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'rightmeta'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } } } } } parent::initProcess(); // This is a composite page, we don't want the "options" display mode if ($this->display == 'options' || $this->display == 'list') { $this->display = ''; } }
public function initProcess() { if (Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddproduct')) { $this->id_object = (int) Tools::getValue('id_product'); //echo 123; var_dump($this->id_object); $this->object = new Product($this->id_object); if ($this->object->is_virtual && (int) Tools::getValue('type_product') != 2) { if ($id_product_download = (int) ProductDownload::getIdFromIdProduct($this->id_object)) { $product_download = new ProductDownload($id_product_download); if (!$product_download->deleteFile($id_product_download)) { $this->errors[] = Tools::displayError('Cannot delete file'); } } } } // Delete a product in the download folder if (Tools::getValue('deleteVirtualProduct')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'deleteVirtualProduct'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::isSubmit('submitAddProductAndPreview')) { $this->display = 'edit'; $this->action = 'save'; if (Tools::getValue('id_product')) { $this->id_object = Tools::getValue('id_product'); $this->object = new Product((int) Tools::getValue('id_product')); } } elseif (Tools::isSubmit('submitAttachments')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'attachments'; $this->tab_display = 'attachments'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::getIsset('duplicate' . $this->table)) { if ($this->tabAccess['add'] === '1') { $this->action = 'duplicate'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } elseif (Tools::getValue('id_image') && Tools::getValue('ajax')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'image'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitProductAttribute')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'productAttribute'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitFeatures') || Tools::isSubmit('submitFeaturesAndStay')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'features'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitPricesModification')) { if ($this->tabAccess['add'] === '1') { $this->action = 'pricesModification'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } elseif (Tools::isSubmit('deleteSpecificPrice')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'deleteSpecificPrice'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::isSubmit('submitSpecificPricePriorities')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'specificPricePriorities'; $this->tab_display = 'prices'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitCustomizationConfiguration')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'customizationConfiguration'; $this->tab_display = 'customization'; $this->display = 'edit'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitProductCustomization')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'productCustomization'; $this->tab_display = 'customization'; $this->display = 'edit'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } if (!$this->action) { parent::initProcess(); } else { $this->id_object = (int) Tools::getValue($this->identifier); } if (isset($this->available_tabs[Tools::getValue('key_tab')])) { $this->tab_display = Tools::getValue('key_tab'); } // Set tab to display if not decided already if (!$this->tab_display && $this->action) { if (in_array($this->action, array_keys($this->available_tabs))) { $this->tab_display = $this->action; } } // And if still not set, use default if (!$this->tab_display) { if (in_array($this->default_tab, $this->available_tabs)) { $this->tab_display = $this->default_tab; } else { $this->tab_display = key($this->available_tabs); } } }
public function initProcess() { if (Tools::isSubmit('add' . $this->table . 'root')) { if ($this->tabAccess['add']) { $this->action = 'add' . $this->table . 'root'; $this->display = 'edit'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit here.'); } } parent::initProcess(); if ($this->action == 'delete' || $this->action == 'bulkdelete') { if (Tools::getIsset('cancel')) { Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminCategories')); } elseif (Tools::getValue('deleteMode') == 'link' || Tools::getValue('deleteMode') == 'linkanddisable' || Tools::getValue('deleteMode') == 'delete') { $this->delete_mode = Tools::getValue('deleteMode'); } else { $this->action = 'select_delete'; } } }
public function initProcess() { if (Tools::isSubmit('submitAddofferAndStay') || Tools::isSubmit('submitAddoffer')) { $this->id_object = (int) Tools::getValue('id_offer'); $this->object = new AphOffer($this->id_object); } // Offer images management if (Tools::getValue('id_image') && Tools::getValue('ajax')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'image'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('id_offer')) { $post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024); if ($post_max_size && isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] && $_SERVER['CONTENT_LENGTH'] > $post_max_size) { $this->errors[] = sprintf(Tools::displayError('The uploaded file exceeds the "Maximum size for a downloadable product" set in preferences (%1$dMB) or the post_max_size/ directive in php.ini (%2$dMB).'), number_format(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE')), $post_max_size / 1024 / 1024); } } if (!$this->action) { parent::initProcess(); } else { $this->id_object = (int) Tools::getValue($this->identifier); } if (isset($this->available_tabs[Tools::getValue('key_tab')])) { $this->tab_display = Tools::getValue('key_tab'); } // Set tab to display if not decided already if (!$this->tab_display && $this->action) { if (in_array($this->action, array_keys($this->available_tabs))) { $this->tab_display = $this->action; } } // And if still not set, use default if (!$this->tab_display) { if (in_array($this->default_tab, $this->available_tabs)) { $this->tab_display = $this->default_tab; } else { $this->tab_display = key($this->available_tabs); } } }
public function initProcess() { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate the Advanced Stock Management feature before you can use this feature.'); return false; } parent::initProcess(); }
public function initProcess() { if (Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddproduct')) { $this->id_object = (int) Tools::getValue('id_product'); $this->object = new Product($this->id_object); if ($this->isTabSubmitted('Informations') && $this->object->is_virtual && (int) Tools::getValue('type_product') != 2) { if ($id_product_download = (int) ProductDownload::getIdFromIdProduct($this->id_object)) { $product_download = new ProductDownload($id_product_download); if (!$product_download->deleteFile($id_product_download)) { $this->errors[] = Tools::displayError('Cannot delete file'); } } } } // Delete a product in the download folder if (Tools::getValue('deleteVirtualProduct')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'deleteVirtualProduct'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::isSubmit('submitAddProductAndPreview')) { $this->display = 'edit'; $this->action = 'save'; if (Tools::getValue('id_product')) { $this->id_object = Tools::getValue('id_product'); $this->object = new Product((int) Tools::getValue('id_product')); } } elseif (Tools::isSubmit('submitAttachments')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'attachments'; $this->tab_display = 'attachments'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::getIsset('duplicate' . $this->table)) { if ($this->tabAccess['add'] === '1') { $this->action = 'duplicate'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } elseif (Tools::getValue('id_image') && Tools::getValue('ajax')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'image'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitProductAttribute')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'productAttribute'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitFeatures') || Tools::isSubmit('submitFeaturesAndStay')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'features'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitPricesModification')) { if ($this->tabAccess['add'] === '1') { $this->action = 'pricesModification'; } else { $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } elseif (Tools::isSubmit('deleteSpecificPrice')) { if ($this->tabAccess['delete'] === '1') { $this->action = 'deleteSpecificPrice'; } else { $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } } elseif (Tools::isSubmit('submitSpecificPricePriorities')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'specificPricePriorities'; $this->tab_display = 'prices'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitCustomizationConfiguration')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'customizationConfiguration'; $this->tab_display = 'customization'; $this->display = 'edit'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('submitProductCustomization')) { if ($this->tabAccess['edit'] === '1') { $this->action = 'productCustomization'; $this->tab_display = 'customization'; $this->display = 'edit'; } else { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } elseif (Tools::isSubmit('id_product')) { $post_max_size = Tools::getMaxUploadSize(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1024 * 1024); if ($post_max_size && isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] && $_SERVER['CONTENT_LENGTH'] > $post_max_size) { $this->errors[] = sprintf(Tools::displayError('The uploaded file exceeds the "Maximum size for a downloadable product" set in preferences (%1$dMB) or the post_max_size/ directive in php.ini (%2$dMB).'), number_format(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE')), $post_max_size / 1024 / 1024); } } if (!$this->action) { parent::initProcess(); } else { $this->id_object = (int) Tools::getValue($this->identifier); } if (isset($this->available_tabs[Tools::getValue('key_tab')])) { $this->tab_display = Tools::getValue('key_tab'); } // Set tab to display if not decided already if (!$this->tab_display && $this->action) { if (in_array($this->action, array_keys($this->available_tabs))) { $this->tab_display = $this->action; } } // And if still not set, use default if (!$this->tab_display) { if (in_array($this->default_tab, $this->available_tabs)) { $this->tab_display = $this->default_tab; } else { $this->tab_display = key($this->available_tabs); } } }