public function postProcess() { if ($this->ajax) { return parent::postProcess(); } $this->redirect_after = $this->context->link->getAdminLink('AdminModules', true) . '&module_name=' . $this->module->name . '&tab_module=' . $this->module->tab . '&configure=' . $this->module->name; }
public function postProcess() { if (($imgName = Tools::getValue('imgName', false)) !== false) { unlink($this->img_path . $imgName); } parent::postProcess(); }
public function postProcess() { if (($id_thumb = Tools::getValue('deleteThumb', false)) !== false) { if (file_exists(_PS_CAT_IMG_DIR_ . (int) Tools::getValue('id_category') . '-' . (int) $id_thumb . '_thumb.jpg') && !unlink(_PS_CAT_IMG_DIR_ . (int) Tools::getValue('id_category') . '-' . (int) $id_thumb . '_thumb.jpg')) { $this->context->controller->errors[] = Tools::displayError('Error while delete'); } if (empty($this->context->controller->errors)) { Tools::clearSmartyCache(); } Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminCategories') . '&id_category=' . (int) Tools::getValue('id_category') . '&updatecategory'); } parent::postProcess(); }
public function postProcess() { if ($this->action) { if (!$this->tabAccess['add'] === '1') { $this->errors[] = Tools::displayError('You do not have write access.'); } if (Tools::getIsset('id_attachment') && Tools::getIsset('id_product_download') && (int) Tools::getValue('id_attachment') && (int) Tools::getValue('id_product_download')) { $this->errors[] = Tools::displayError('You can not choose an attachment and a download at the same time.'); } if (Tools::getIsset('id_attachment') && Tools::getIsset('id_product_download') && !(int) Tools::getValue('id_attachment') && !(int) Tools::getValue('id_product_download')) { $this->errors[] = Tools::displayError('You have to choose an attachment OR a download.'); } } parent::postProcess(); }
public function postProcess() { if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd' . $this->table)) { if (($id = (int) Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj)) { $previousPosts = $obj->getPosts(); $removedPosts = array(); foreach ($previousPosts as $post) { if (!in_array($post['id_simpleblog_post'], $_POST['posts'])) { $removedPosts[] = $post['id_simpleblog_post']; } } $obj->setPosts($_POST['posts']); } } return parent::postProcess(); }
public function postProcess() { $return = parent::postProcess(); if (Tools::getValue('submitAdd' . $this->table) && Validate::isLoadedObject($return)) { $carriers = Carrier::getCarriers($this->context->language->iso_code, false, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); $carrier_box = array(); foreach ($carriers as $carrier) { if (Tools::getIsset('carrierBox_' . $carrier['id_carrier'])) { $carrier_box[] = $carrier['id_carrier']; } } $return->updateCarriers($carrier_box); $return->updateGroups(Tools::getValue('groupBox')); } return $return; }
public function postProcess() { if (Tools::isSubmit('submitOptionsconfiguration')) { if ($_FILES['htl_header_image']['name']) { $this->validateHotelHeaderImage($_FILES['htl_header_image']); if (!count($this->errors)) { $img_path = _PS_IMG_DIR_ . 'hotel_header_image.png'; if (ImageManager::resize($_FILES['htl_header_image']['tmp_name'], $img_path)) { Configuration::updateValue('WK_HOTEL_HEADER_IMAGE', 'hotel_header_image.png'); } else { $this->errors[] = Tools::displayError('Some error occured while uoploading image.Please try again.'); } } } } parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit('submit' . $this->className)) { if (!$this->manageLinkList()) { return false; } $hook_name = Hook::getNameById(Tools::getValue('id_hook')); if (!Hook::isModuleRegisteredOnHook($this->module, $hook_name, $this->context->shop->id)) { Hook::registerHook($this->module, $hook_name); } $this->module->_clearCache($this->module->templateFile); Tools::redirectAdmin($this->context->link->getAdminLink('Admin' . $this->name)); } elseif (Tools::isSubmit('delete' . $this->className)) { if (!$this->deleteLinkList()) { return false; } $this->module->_clearCache($this->module->templateFile); Tools::redirectAdmin($this->context->link->getAdminLink('Admin' . $this->name)); } return parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit('submitOrderNumber')) { if (!Validate::isInt($this->number_from)) { $this->errors[] = $this->l('Invalid "From" number'); } if (!Validate::isInt($this->number_to)) { $this->errors[] = $this->l('Invalid "To" number'); } if (!count($this->errors)) { $invoices = $this->getByNumberInterval($this->number_from, $this->number_to); if (count($invoices)) { //generate XML $this->generateCSV($invoices); } else { $this->errors[] = $this->l('No invoice has been found for this period.'); } } } else { parent::postProcess(); } }
public function postProcess() { if (Tools::isSubmit('submitAddconfiguration') && !($this->tabAccess['add'] === '1')) { $this->errors[] = Tools::displayError('You do not have the required permission to export stock.'); } if (count($this->errors)) { return; } if (Tools::isSubmit('submitAddconfiguration')) { // get source warehouse id $date_begin = Tools::getValue('date_begin', ''); $date_endin = Tools::getValue('date_endin', ''); if (!$date_begin) { $this->errors[] = Tools::displayError($this->l('You must set a beginning date')); } else { $date_begin = explode('-', $date_begin); $date_begin = mktime(0, 0, 0, $date_begin[1], $date_begin[2], $date_begin[0]); $date_begin = date('Y-m-d', $date_begin); } if (!$date_endin) { $this->errors[] = Tools::displayError($this->l('You must set an ending date.')); } else { $date_endin = explode('-', $date_endin); $date_endin = mktime(0, 0, 0, $date_endin[1], $date_endin[2], $date_endin[0]); $date_endin = date('Y-m-d', $date_endin); } if ($date_endin < $date_begin) { $this->errors[] = Tools::displayError($this->l('Beginning date cannot be inferior to ending date.')); } if (count($this->errors)) { return; } else { $this->processExportOrder($date_begin, $date_endin); } } parent::postProcess(); }
public function postProcess() { if (($imgName = Tools::getValue('imgName', false)) !== false) { unlink($this->img_path . $imgName); } //export process if (Tools::getValue('exportGroup')) { $group = $this->getSliderGroupByID(Tools::getValue('id_group')); $sliders = $this->getSlidesByGroup(Tools::getValue('id_group')); $languageField = array('title', 'link', 'image', 'thumbnail', 'video', 'layersparams'); $languages = Language::getLanguages(); $langList = array(); foreach ($languages as $lang) { $langList[$lang['id_lang']] = $lang['iso_code']; } foreach ($sliders as $slider) { $curentLang = 'en'; foreach ($slider as $key => $value) { if ($key == 'id_lang') { $curentLang = $langList[$value]; continue; } if (in_array($key, $languageField)) { $group['sliders'][$slider['id']][$key][$curentLang] = $value; } else { $group['sliders'][$slider['id']][$key] = $value; } } } $export_file = fopen(_PS_MODULE_DIR_ . 'pssliderlayer/exports/export_group_' . Tools::getValue('id_group') . '_' . time() . '.txt', 'w') or die('Unable to open file!'); fwrite($export_file, PsSliderSlide::base64Encode(Tools::jsonEncode($group))); fclose($export_file); Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules') . '&configure=pssliderlayer&id_group=' . (int) Tools::getValue('id_group') . '&exported=1'); //$this->context->smarty->assign(array('export_msg' => $this->l('Successful export: ')._PS_MODULE_DIR_.'pssliderlayer/exports/export_group_'.Tools::getValue('id_group').'_'.time().'.txt')); } parent::postProcess(); }
public function postProcess() { if (($imgName = Tools::getValue('imgName', false)) !== false) { unlink($this->img_path . $imgName); } //export process if (Tools::getValue('exportGroup')) { $group = $this->getSliderGroupByID(Tools::getValue('id_group')); $sliders = $this->getSlidesByGroup(Tools::getValue('id_group')); $languageField = array('title', 'link', 'image', 'thumbnail', 'video', 'layersparams'); $languages = Language::getLanguages(); $langList = array(); foreach ($languages as $lang) { $langList[$lang['id_lang']] = $lang['iso_code']; } foreach ($sliders as $slider) { $curentLang = 'en'; foreach ($slider as $key => $value) { if ($key == 'id_lang') { $curentLang = $langList[$value]; continue; } if (in_array($key, $languageField)) { $group['sliders'][$slider['id']][$key][$curentLang] = $value; } else { $group['sliders'][$slider['id']][$key] = $value; } } } header('Content-Type: plain/text'); header('Content-Disposition: Attachment; filename=export_group_' . Tools::getValue('id_group') . '_' . time() . '.txt'); header('Pragma: no-cache'); die(SliderLayer::base64Encode(Tools::jsonEncode($group))); } parent::postProcess(); }
public function postProcess() { if (!in_array($this->display, array('edit', 'add'))) { $this->multishop_context_group = false; } if (Tools::isSubmit('forcedeleteImage') || isset($_FILES['image']) && $_FILES['image']['size'] > 0 || Tools::getValue('deleteImage')) { $this->processForceDeleteImage(); if (Tools::isSubmit('forcedeleteImage')) { Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminCategories') . '&conf=7'); } } if (Tools::isSubmit('submitAddsmart_blog_post')) { if (Tools::getValue('id_smart_blog_post')) { $this->processUpdate(); } else { $this->processAdd(); } } else { parent::postProcess(true); } }
public function postProcess() { parent::postProcess(); if (Tools::getIsset('validatelgconsultas')) { $this->processStatus(); } }
public function postProcess() { global $currentIndex, $cookie; if (Tools::isSubmit("submitReply")) { $gdpkwf = "reply_message"; $govlcpl = "seller"; $ftuupcco = "subject"; $rvvtzela = "lines"; $faquwrdwqh = "org_message"; ${$gdpkwf} = Tools::getValue("reply_message"); $baufyha = "from_email"; ${"GLOBALS"}["wmyijql"] = "template"; ${"GLOBALS"}["spzytu"] = "filename3"; $fyyqqth = "donotreply_email"; if (empty(${${"GLOBALS"}["kbawkgknby"]})) { $this->_errors[] = $this->l('Reply message cannot be empty.'); return; } ${"GLOBALS"}["wsrxtkjgwdo"] = "subject"; $eooeymlgfc = "template"; $gbljtm = "template"; ${"GLOBALS"}["jhpuzbbjttsc"] = "id_seller"; ${"GLOBALS"}["izfgeakl"] = "id_seller"; ${$faquwrdwqh} = new AgileSellerMessage(Tools::getValue("id_agile_sellermessage")); $udgdyykwvols = "id_seller"; $mgbfixnhl = "from_email"; $jlsqhtzk = "message"; ${${"GLOBALS"}["izfgeakl"]} = intval($org_message->id_seller); if (${${"GLOBALS"}["tvkbeiydii"]} <= 0) { ${${"GLOBALS"}["tvkbeiydii"]} = 1; } ${$govlcpl} = new Employee(${${"GLOBALS"}["jhpuzbbjttsc"]} > 0 ? ${$udgdyykwvols} : 1); ${$fyyqqth} = Configuration::get("ASMGER_DONOTREPLY_EMAIL"); $cvvqjb = "filename2"; ${"GLOBALS"}["debbhsy"] = "folder"; ${${"GLOBALS"}["iuhbbj"]} = intval(Configuration::get("ASMGER_HIDE_EMAIL")); if (${${"GLOBALS"}["iuhbbj"]}) { ${$mgbfixnhl} = ${${"GLOBALS"}["bvbgyisb"]}; } else { ${$baufyha} = $message->from_email; } ${${"GLOBALS"}["kbawkgknby"]} .= "\n"; ${${"GLOBALS"}["xdnowvwdcl"]} = explode("\n", $org_message->message); ${"GLOBALS"}["qxxbjgw"] = "reply_message"; foreach (${$rvvtzela} as ${${"GLOBALS"}["pdoumcxzgc"]}) { $ywsqpbc = "line"; $liksjnekbj = "reply_message"; ${$liksjnekbj} .= ">" . ${$ywsqpbc} . "\n"; } ${$eooeymlgfc} = "mtocustomer"; ${"GLOBALS"}["mdxxjpvv"] = "id_lang"; ${${"GLOBALS"}["gmwigdp"]} = array("{seller_name}" => $seller->firstname . " " . $seller->lastname, "{shop_name}" => Configuration::get("PS_SHOP_NAME"), "{shop_url}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, "{message}" => str_replace("\n", "<br />", ${${"GLOBALS"}["qxxbjgw"]})); ${${"GLOBALS"}["mdxxjpvv"]} = $cookie->id_lang; ${$ftuupcco} = $org_message->subject; $kbnrhnf = "reply_message"; ${"GLOBALS"}["wwaoagy"] = "filename1"; ${${"GLOBALS"}["kguvhubqv"]} = Language::getIsoById((int) ${${"GLOBALS"}["cuzhqwdmtqu"]}); if (file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["kguvhubqv"]} . "/" . ${${"GLOBALS"}["wmyijql"]} . ".txt") and file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["kguvhubqv"]} . "/" . ${$gbljtm} . ".html")) { Mail::Send(${${"GLOBALS"}["cuzhqwdmtqu"]}, ${${"GLOBALS"}["rpkfpmkdil"]}, ${${"GLOBALS"}["wsrxtkjgwdo"]}, ${${"GLOBALS"}["gmwigdp"]}, $org_message->from_email, NULL, $seller->email, $seller->firstname . " " . $seller->lastname, NULL, NULL, dirname(__FILE__) . "/mails/"); } $this->confirmations[] = $this->l('Your reply message has been sent.'); if (isset($_FILES["fileUpload1"]["name"]) and !empty($_FILES["fileUpload1"]["name"]) and !empty($_FILES["fileUpload1"]["tmp_name"])) { $vyndzfch = "filename1"; ${$vyndzfch} = uniqid() . substr($_FILES["fileUpload1"]["name"], -5); } if (isset($_FILES["fileUpload2"]["name"]) and !empty($_FILES["fileUpload2"]["name"]) and !empty($_FILES["fileUpload2"]["tmp_name"])) { $aeiyzcf = "filename2"; ${$aeiyzcf} = uniqid() . substr($_FILES["fileUpload2"]["name"], -5); } if (isset($_FILES["fileUpload3"]["name"]) and !empty($_FILES["fileUpload3"]["name"]) and !empty($_FILES["fileUpload3"]["tmp_name"])) { ${${"GLOBALS"}["pxytvf"]} = uniqid() . substr($_FILES["fileUpload3"]["name"], -5); } ${$jlsqhtzk} = new AgileSellerMessage($org_message->id); $message->id = 0; $message->is_customer_message = 0; $message->ip_address = ""; $message->from_email = $seller->email; $message->from_name = $seller->firstname . " " . $seller->lastname; if (intval(Configuration::get("ASMGER_APPROVAL_REQUIRED"))) { $message->active = 0; } else { $message->active = 1; } $message->message = ${$kbnrhnf}; ${${"GLOBALS"}["rfvzmfktr"]} = agilesellermessenger::prepareAttFolder(intval(${${"GLOBALS"}["tvkbeiydii"]})); if (isset(${${"GLOBALS"}["wwaoagy"]}) and rename($_FILES["fileUpload1"]["tmp_name"], ${${"GLOBALS"}["rfvzmfktr"]} . ${${"GLOBALS"}["ucoovzvk"]})) { ${"GLOBALS"}["rahdjx"] = "fname"; ${${"GLOBALS"}["zosheebdwtd"]} = basename($_FILES["fileUpload1"]["name"]); $message->attshname1 = ${${"GLOBALS"}["rahdjx"]}; $message->attpsname1 = ${${"GLOBALS"}["ucoovzvk"]}; } else { $message->attshname1 = NULL; $message->attpsname1 = NULL; } if (isset(${${"GLOBALS"}["psylbktwy"]}) and rename($_FILES["fileUpload2"]["tmp_name"], ${${"GLOBALS"}["debbhsy"]} . ${$cvvqjb})) { $vmesrrutxnu = "fname"; ${$vmesrrutxnu} = basename($_FILES["fileUpload2"]["name"]); $message->attshname2 = ${${"GLOBALS"}["zosheebdwtd"]}; $message->attpsname2 = ${${"GLOBALS"}["psylbktwy"]}; } else { $message->attshname2 = NULL; $message->attpsname2 = NULL; } if (isset(${${"GLOBALS"}["pxytvf"]}) and rename($_FILES["fileUpload3"]["tmp_name"], ${${"GLOBALS"}["rfvzmfktr"]} . ${${"GLOBALS"}["spzytu"]})) { ${${"GLOBALS"}["zosheebdwtd"]} = basename($_FILES["fileUpload3"]["name"]); $message->attshname3 = ${${"GLOBALS"}["zosheebdwtd"]}; $message->attpsname3 = ${${"GLOBALS"}["pxytvf"]}; } else { $message->attshname3 = NULL; $message->attpsname3 = NULL; } $message->save(); return; } parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit('submitAdd' . $this->table)) { //$newFilename="image_".time().".jpg"; $slideshowInfos = $this->getSlideshow((int) Tools::getValue('id_opartslideshow_slideshow')); $obj = new MyImage((int) Tools::getValue('id_opartslideshow_slideshow_image')); $errors = ""; if (isset($_FILES['image_file']) && is_uploaded_file($_FILES['image_file']['tmp_name'])) { $filename = Tools::getValue('filename'); if (file_exists($this->imgDir . $filename)) { unlink($this->imgDir . $filename); if (file_exists(_PS_ROOT_DIR_ . "/img/tmp/" . $this->table . '_' . $filename)) { unlink(_PS_ROOT_DIR_ . "/img/tmp/" . $this->table . '_' . $filename); } //on rechange le filename pour eviter la mise en cache de la nouvelle image $filename = "image_" . time() . ".jpg"; $changeFilename = true; } $sizes = getimagesize($_FILES['image_file']['tmp_name']); if ($error = ImageManager::validateUpload($_FILES['image_file'])) { $errors .= $error; } elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image_file']['tmp_name'], $tmpName)) { return false; } if ($sizes[0] == $slideshowInfos['width'] && $sizes[1] == $slideshowInfos['height']) { rename($tmpName, $this->imgDir . $filename); chmod($this->imgDir . $filename, 0705); } elseif (!ImageManager::resize($tmpName, $this->imgDir . $filename, $slideshowInfos['width'], $slideshowInfos['height'])) { $errors .= Tools::displayError($this->l('An error occurred during the image upload.')); } if (file_exists($tmpName)) { unlink($tmpName); } $obj->copyFromPost(); if (isset($changeFilename) && $changeFilename === true) { $obj->filename = $filename; } } else { $obj->copyFromPost(); } $obj->save(); } else { parent::postProcess(); } }
public function postProcess() { if (Tools::isSubmit('viewsimpleblog_category') && ($id_simpleblog_category = (int) Tools::getValue('id_simpleblog_category')) && ($SimpleBlogCategory = new SimpleBlogCategory($id_simpleblog_category, $this->context->language->id)) && Validate::isLoadedObject($SimpleBlogCategory)) { $redir = $SimpleBlogCategory->getObjectLink($id_lang); Tools::redirectAdmin($redir); } if (Tools::isSubmit('deleteCover')) { $this->deleteCover((int) Tools::getValue('id_simpleblog_category')); } if (($id_simpleblog_category = (int) Tools::getValue('id_simpleblog_category')) && ($direction = Tools::getValue('move')) && Validate::isLoadedObject($SimpleBlogCategory = new SimpleBlogCategory($id_simpleblog_category))) { if ($SimpleBlogCategory->move($direction)) { Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token); } } elseif (Tools::getValue('position') && !Tools::isSubmit('submitAdd' . $this->table)) { if ($this->tabAccess['edit'] !== '1') { $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (!Validate::isLoadedObject($object = new SimpleBlogCategory((int) Tools::getValue($this->identifier)))) { $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)'); } if (!$object->updatePosition((int) Tools::getValue('way'), (int) Tools::getValue('position'))) { $this->errors[] = Tools::displayError('Failed to update the position.'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=5&token=' . Tools::getAdminTokenLite('AdminSimpleBlogCategories')); } } else { // Temporary add the position depend of the selection of the parent category if (!Tools::isSubmit('id_simpleblog_category')) { $_POST['position'] = SimpleBlogCategory::getNbCats(Tools::getValue('id_parent')); } } return parent::postProcess(); }
/** * Process posting data */ public function postProcess() { //$errors = array(); $languages = Language::getLanguages(false); if (Tools::isSubmit('submitChangeLayout')) { //Configuration::set('OVIC_CURRENT_OPTION',(int)Tools::getValue('id_option',Configuration::get('OVIC_CURRENT_OPTION'))); Configuration::updateValue('OVIC_LAYOUT_COLUMN', (int) Tools::getValue('colsetting', Configuration::get('OVIC_LAYOUT_COLUMN'))); $this->ProcessLayoutColumn(); Tools::clearCache(); } elseif (Tools::isSubmit('submitSelectOption')) { $id_option = (int) Tools::getValue('id_option'); Configuration::updateValue('OVIC_CURRENT_OPTION', $id_option); $optionObject = new Options($id_option); if (strlen($optionObject->column) > 0) { Configuration::updateValue('OVIC_LAYOUT_COLUMN', (int) substr($optionObject->column, 0, 1)); } $this->ProcessLayoutColumn(); Tools::clearCache(); } elseif (Tools::isSubmit('changeleftactive')) { $pagemeta = Tools::getValue('pagemeta'); $id_theme_meta = $this->getIdThemeMetaByPage($pagemeta); $this->processLeftMeta($id_theme_meta); Tools::clearCache(); } elseif (Tools::isSubmit('changerightactive')) { $pagemeta = Tools::getValue('pagemeta'); $id_theme_meta = $this->getIdThemeMetaByPage($pagemeta); $this->processRightMeta($id_theme_meta); Tools::clearCache(); } elseif (Tools::isSubmit('submitMultiSave')) { Configuration::updateValue('OVIC_FONT_LINK', $this->getHtmlValue('FONT_LINK')); Configuration::updateValue('OVIC_MAIN_COLOR', Tools::getValue("MAIN_COLOR")); Configuration::updateValue('OVIC_BTN_COLOR', Tools::getValue("BTN_COLOR")); Configuration::updateValue('OVIC_BTN_HOVER_COLOR', Tools::getValue("BTN_HOVER_COLOR")); Configuration::updateValue('OVIC_BTN_TEXT_COLOR', Tools::getValue("BTN_TEXT_COLOR")); Configuration::updateValue('OVIC_BTN_TEXT_HOVER_COLOR', Tools::getValue("BTN_TEXT_HOVER_COLOR")); Tools::clearCache(); } Tools::clearCache(); parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit('viewsimpleblog_post') && ($id_simpleblog_post = (int) Tools::getValue('id_simpleblog_post')) && ($SimpleBlogPost = new SimpleBlogPost($id_simpleblog_post, $this->context->language->id)) && Validate::isLoadedObject($SimpleBlogPost)) { $redir = $SimpleBlogPost->getObjectLink($id_lang); Tools::redirectAdmin($redir); } if (Tools::isSubmit('deleteCover')) { $this->deleteCover((int) Tools::getValue('id_simpleblog_post')); } if (Tools::isSubmit('deleteFeatured')) { $this->deleteFeatured((int) Tools::getValue('id_simpleblog_post')); } return parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit("submitBulkbulkaprovalproduct")) { if (isset($_POST[$this->table . "Box"])) { $qgpxumkun = "productids"; $gacdrxw = "id"; ${$qgpxumkun} = $_POST[$this->table . "Box"]; foreach (${${"GLOBALS"}["mhjsffjq"]} as ${$gacdrxw}) { ${"GLOBALS"}["yeuwem"] = "id"; $xktdphwcv = "sql"; $qhfvlkp = "sql"; if (intval(${${"GLOBALS"}["yeuwem"]}) <= 0) { continue; } $oriqudkuocp = "sql"; ${"GLOBALS"}["bbrdftu"] = "id"; ${${"GLOBALS"}["yrerppqbfi"]} = "SELECT * FROM " . _DB_PREFIX_ . "product_owner WHERE id_product =" . ${${"GLOBALS"}["zqcowl"]}; ${${"GLOBALS"}["wkovngcfk"]} = Db::getInstance()->getRow(${${"GLOBALS"}["yrerppqbfi"]}); if (!isset(${${"GLOBALS"}["wkovngcfk"]}["id_product"])) { ${$xktdphwcv} = "INSERT INTO " . _DB_PREFIX_ . "product_owner (id_product,id_owner,approved,date_add) VALUES (" . ${${"GLOBALS"}["bbrdftu"]} . ",0,1,'" . date("Y-m-d H:i:s") . "')"; } else { ${$qhfvlkp} = "UPDATE " . _DB_PREFIX_ . "product_owner SET approved=1 WHERE id_product=" . (int) ${${"GLOBALS"}["zqcowl"]}; } Db::getInstance()->Execute(${$oriqudkuocp}); } } else { $this->_errors[] = "No product was selected to approve."; } return; } parent::postProcess(); }
/** * Process posting data */ public function postProcess() { $errors = array(); $languages = Language::getLanguages(false); if (Tools::isSubmit('submitnewOption')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); $addaction = false; } else { $option = new Options(); $addaction = true; } $option->column = Tools::getValue('colselected'); $option->active = (int) Tools::getValue('active'); $name_set = false; foreach ($languages as $language) { $option_name = Tools::getValue('option_name_' . $language['id_lang']); if (strlen($option_name) > 0) { $name_set = true; } $option->name[$language['id_lang']] = $option_name; } if (!$name_set) { $lang_title = Language::getLanguage($this->context->language->id); $errors[] = Tools::displayError('This item title field is required at least in ' . $lang_title['name']); } if (isset($_FILES['option_img']) && strlen($_FILES['option_img']['name']) > 0) { $img_name = time() . $_FILES['option_img']['name']; $img_name = preg_replace('/[^A-Za-z0-9\\-.]/', '', $img_name); // Removes special chars. //_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $this->name .DIRECTORY_SEPARATOR $main_name = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'oviclayoutcontrol' . DIRECTORY_SEPARATOR . 'thumbnails' . DIRECTORY_SEPARATOR . $img_name; if (!move_uploaded_file($_FILES['option_img']['tmp_name'], $main_name)) { $errors[] = Tools::displayError('An error occurred during the image upload.'); } else { $option->image = $img_name; if (Tools::getValue('old_img') != '') { $filename = Tools::getValue('old_img'); if (file_exists(_PS_MODULE_DIR_ . 'oviclayoutcontrol/thumbnails/' . $filename)) { @unlink(_PS_MODULE_DIR_ . 'oviclayoutcontrol/thumbnails/' . $filename); } } } } else { $option->image = Tools::getValue('old_img'); } if (!count($errors)) { if ($addaction) { if (!$option->add()) { $errors[] = Tools::displayError('An error occurred while saving data.'); } else { if (Tools::getIsset('id_copy_option')) { $id_copy_option = Tools::getValue('id_copy_option'); OvicLayoutControl::copyHookModule($id_copy_option, $option->id); } else { OvicLayoutControl::registerDefaultHookModule($option->id); } } } else { if (!$option->update()) { $errors[] = Tools::displayError('An error occurred while update data.'); } } if (!count($errors)) { Tools::redirectAdmin(self::$currentIndex . '&conf=3&token=' . Tools::getValue('token')); } } } elseif (Tools::isSubmit('changeactive')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); $option->active = !$option->active; if (!$option->update()) { $errors[] = Tools::displayError('Could not change'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=5&token=' . Tools::getValue('token')); } } } elseif (Tools::isSubmit('removeoption')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); if (!$option->delete()) { $errors[] = Tools::displayError('An error occurred during deletion'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=1&token=' . Tools::getValue('token')); } } } else { $this->context->controller->errors = array_merge($this->context->controller->errors, $errors); } parent::postProcess(); }
public function postProcess() { if (!$this->redirect_after) { parent::postProcess(); } }
public function postProcess() { $id_shops = array(); if (Tools::isSubmit('mass_csv_form_submit')) { if (Shop::getContext() == Shop::CONTEXT_ALL) { $shops = Shop::getShops(); if (!empty($shops)) { foreach ($shops as $s) { $id_shops[] = $s['id_shop']; } } } elseif (Shop::getContext() == Shop::CONTEXT_GROUP) { $shopid = Shop::getContextShopGroupID(true); $shops = ShopGroup::getShopsFromGroup($shopid); if (!empty($shops)) { foreach ($shops as $s) { $id_shops[] = $s['id_shop']; } } } if (empty($id_shops)) { $id_shops[] = Shop::getContextShopID(); } $id_shops = array_unique($id_shops); if (is_uploaded_file($_FILES['csv_file']['tmp_name'])) { $mimes = array('application/vnd.ms-excel', 'text/plain', 'text/csv', 'text/tsv'); if (!in_array($_FILES['csv_file']['type'], $mimes)) { $this->errors[] = Tools::displayError($this->l('Error : Problem with file upload. Please retry or check your file.')); return false; } if (move_uploaded_file($_FILES['csv_file']['tmp_name'], $this->mod->cache_dir . $_FILES['csv_file']['name'])) { $old_file_name = $_FILES['csv_file']['name']; $csv_content = Tools::file_get_contents($this->mod->cache_dir . $old_file_name); $array = $this->csvToArray($csv_content); if (empty($array)) { $this->errors[] = Tools::displayError($this->l('Error : Problem with file upload. Please retry or check your file.')); parent::postProcess(); return false; } foreach ($array as $value) { if (!empty($value[0])) { $new = !empty($value[1]) ? trim($value[1]) : '/'; $type = !empty($value[2]) ? trim($value[2]) : '301'; $regex = !empty($value[3]) ? (int) $value[3] : 0; $redirect = new Redirect(); $redirect->old = trim($value[0]); $redirect->new = $new; $redirect->type = $type; $redirect->regex = (bool) $regex; $redirect->active = true; $redirect->add(); /*foreach ($id_shops as $v) { $db->execute('INSERT INTO `'._DB_PREFIX_.'redirect_shop` (`id_redirect_shop`,`id_redirect`, `id_shop`) VALUES (NULL,'.(int)$redirect->id.','.(int)$v.')'); }*/ } } } Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminRedirect') . '&conf=4'); } } parent::postProcess(); }
public function postProcess() { return parent::postProcess(); }
public function postProcess() { if (Tools::isSubmit('submitCloseClaim')) { $id_mf_claim = (int) Tools::getValue('id_mf_claim'); if (!$id_mf_claim || !Validate::isUnsignedId($id_mf_claim)) { $this->errors[] = $this->l('The claim is no longer valid.'); } else { $claim = new MediafinanzClaim($id_mf_claim); if (!Validate::isLoadedObject($claim)) { $this->errors[] = $this->l('The Claim cannot be found'); } else { try { $res = $this->module->closeClaim($claim->file_number); if ($res) { $this->confirmations[] = $this->l('The Claim has been closed'); } else { $this->errors[] = $this->l('The Claim has not been closed'); } } catch (Exception $e) { $this->errors[] = $this->l('The Claim has not been closed'); $this->errors[] = $e->getMessage(); Mediafinanz::logToFile($e->getMessage(), 'general'); } } } } if (Tools::isSubmit('submitBookDirectPayment')) { $id_mf_claim = (int) Tools::getValue('id_mf_claim'); $amount = str_replace(',', '.', Tools::getValue('paidAmount')); if (!$id_mf_claim || !Validate::isUnsignedId($id_mf_claim)) { $this->errors[] = $this->l('The Claim is no longer valid.'); } else { $claim = new MediafinanzClaim($id_mf_claim); if (!Validate::isLoadedObject($claim)) { $this->errors[] = $this->l('The Claim cannot be found'); } elseif (!Validate::isDate(Tools::getValue('dateOfPayment'))) { $this->errors[] = $this->l('The date of payment is invalid'); } elseif (!Validate::isPrice($amount)) { $this->errors[] = $this->l('The paid amount is invalid.'); } else { try { $direct_payment = array('dateOfPayment' => Tools::getValue('dateOfPayment'), 'paidAmount' => $amount); $res = $this->module->bookDirectPayment($claim->file_number, $direct_payment); if ($res) { $this->confirmations[] = $this->l('Direct payment has been booked'); } else { $this->errors[] = $this->l('Direct payment has not been booked'); } } catch (Exception $e) { $this->errors[] = $this->l('Direct payment has not been booked'); $this->errors[] = $e->getMessage(); Mediafinanz::logToFile($e->getMessage(), 'general'); } } } } if (Tools::isSubmit('submitMessage')) { $id_mf_claim = (int) Tools::getValue('id_mf_claim'); $msg_text = Tools::getValue('message'); if (!$id_mf_claim || !Validate::isUnsignedId($id_mf_claim)) { $this->errors[] = $this->l('The claim is no longer valid.'); } elseif (empty($msg_text)) { $this->errors[] = $this->l('The message cannot be blank.'); } elseif (!Validate::isMessage($msg_text)) { $this->errors[] = $this->l('This message is invalid (HTML is not allowed).'); } if (!count($this->errors)) { $claim = new MediafinanzClaim($id_mf_claim); if (Validate::isLoadedObject($claim)) { try { $res = $this->module->sendMessage($claim->file_number, $msg_text); if (!$res) { $this->errors[] = $this->l('The Message has not been sent'); } else { $this->confirmations[] = $this->l('The Message has been sent'); } } catch (Exception $e) { $this->errors[] = $this->l('The Message has not been sent'); $this->errors[] = $e->getMessage(); Mediafinanz::logToFile($e->getMessage(), 'general'); } } else { $this->errors[] = $this->l('The Claim not found'); } } } /*if (Tools::isSubmit('update_claims_statuses')) {*/ if ($this->display == '') { try { $this->module->updateClaimsStatuses(); } catch (Exception $e) { $this->_errors[] = $e->getMessage(); Mediafinanz::logToFile($e->getMessage(), 'general'); } } //} if (Tools::isSubmit('submitCreateClaims')) { $order_ids = Tools::getValue('order_list'); $claim = Tools::getValue('claim'); $debtor = Tools::getValue('debtor'); $list = Db::getInstance()->executeS('SELECT a.`id_order`, a.`id_shop` FROM `' . _DB_PREFIX_ . 'orders` a LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON (o.`id_order` = a.`id_order` AND o.`id_shop` = a.`id_shop`) LEFT JOIN ' . _DB_PREFIX_ . 'mf_claims c ON a.`id_order`=c.`id_order` AND c.`sandbox`=' . (int) Configuration::get('MEDIAFINANZ_SANDBOX') . ' WHERE c.`id_order` IS NULL AND a.`id_order` IN (' . implode(', ', array_map('intval', $order_ids)) . ')' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'a', 'shop')); foreach ($list as $row) { $id = $row['id_order']; $debtor_to = array('id' => $debtor[$id]['id'], 'address' => $debtor[$id]['address'], 'firstname' => $debtor[$id]['firstname'], 'lastname' => $debtor[$id]['lastname'], 'company' => $debtor[$id]['company'], 'co' => '', 'street' => $debtor[$id]['street'], 'postcode' => $debtor[$id]['postcode'], 'city' => $debtor[$id]['city'], 'country' => $debtor[$id]['country'], 'telephone1' => $debtor[$id]['telephone1'], 'telephone2' => $debtor[$id]['telephone2'], 'email' => $debtor[$id]['email']); $claim_to = array('invoice' => $claim[$id]['invoice'], 'type' => $claim[$id]['type'], 'reason' => $claim[$id]['reason'], 'originalValue' => $claim[$id]['originalvalue'], 'overdueFees' => $claim[$id]['overduefees'], 'dateOfOrigin' => $claim[$id]['dateoforigin'], 'dateOfLastReminder' => $claim[$id]['dateoflastreminder'], 'note' => $claim[$id]['note']); try { $result = $this->module->newClaim($claim_to, $debtor_to); if (!empty($result->fileNumber)) { $mf = new MediafinanzClaim(); $mf->id_order = $claim[$id]['invoice']; $mf->file_number = $result->fileNumber; $mf->firstname = $debtor[$id]['firstname']; $mf->lastname = $debtor[$id]['lastname']; $mf->id_shop = $row['id_shop']; $mf->sandbox = (int) Configuration::get('MEDIAFINANZ_SANDBOX'); $mf->add(); $claim_status = $this->module->getClaimStatus($result->fileNumber, $row['id_shop']); if ($mf->status_code != $claim_status->statusCode) { $mf->status_code = $claim_status->statusCode; $mf->status_text = $claim_status->statusText; if (isset($claim_status->statusDetails)) { $mf->status_details = $claim_status->statusDetails; } else { $mf->status_details = ''; } $mf->date_change = date('Y-m-d H:i:s'); $mf->save(); } //change state $this->module->changeOrderState($claim[$id]['invoice'], Configuration::get('PS_OS_MF_INKASSO')); } else { foreach ($result->errorList as $error_msg) { $this->errors[] = $this->l('Order') . ' - ' . $row['id_order'] . ': ' . $error_msg; } } } catch (Exception $e) { $this->errors[] = $this->l('Order') . ' - ' . $row['id_order'] . ': ' . $e->getMessage(); Mediafinanz::logToFile($this->l('Order') . ' - ' . $row['id_order'] . ': ' . $e->getMessage(), 'general'); } } } parent::postProcess(); }
public function postProcess() { if (!$this->redirect_after) { parent::postProcess(); } if ($this->display == 'edit' || $this->display == 'add') { $this->addJqueryUI(array('ui.core', 'ui.widget')); $this->addjQueryPlugin(array('date')); $this->addCSS(array(_PS_JS_DIR_ . 'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css')); } }
public function postProcess() { parent::postProcess(); }
/** * Process posting data */ public function postProcess() { $languages = Language::getLanguages(false); $current_theme = Theme::getThemeInfo($this->context->shop->id_theme); //$theme_arr['theme_id'] = $theme->id; // $theme_arr['theme_name'] = $theme->name; // $theme_arr['theme_directory'] = $theme->directory; if (Tools::isSubmit('submitnewOption')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); $addaction = false; } else { $option = new Options(); $addaction = true; } $option->column = Tools::getValue('colselected'); $option->theme = strtolower($current_theme['theme_name']); $option->alias = Tools::getValue('alias'); $option->active = (int) Tools::getValue('active'); $name_set = false; $option_name = Tools::getValue('option_name'); if (strlen($option_name) > 0) { $name_set = true; $option->name = $option_name; } if (!$name_set) { $lang_title = Language::getLanguage($this->context->language->id); $this->errors[] = Tools::displayError('This item title field is required'); } if (strlen($option->alias) > 0) { if (OvicLayoutControl::isAvailablebyAlias($option->alias) > 0) { $this->errors[] = Tools::displayError('Alias is avaiable in database'); } } else { $this->errors[] = Tools::displayError('This item alias field is required'); } if (isset($_FILES['option_img']) && strlen($_FILES['option_img']['name']) > 0) { $img_name = time() . $_FILES['option_img']['name']; $img_name = preg_replace('/[^A-Za-z0-9\\-.]/', '', $img_name); // Removes special chars. //_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $this->name .DIRECTORY_SEPARATOR $main_name = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'oviclayoutcontrol' . DIRECTORY_SEPARATOR . 'thumbnails' . DIRECTORY_SEPARATOR . $img_name; if (!move_uploaded_file($_FILES['option_img']['tmp_name'], $main_name)) { $this->errors[] = Tools::displayError('An error occurred during the image upload.'); } else { $option->image = $img_name; if (Tools::getValue('old_img') != '') { $filename = Tools::getValue('old_img'); if (file_exists(_PS_MODULE_DIR_ . 'oviclayoutcontrol/thumbnails/' . $filename)) { @unlink(_PS_MODULE_DIR_ . 'oviclayoutcontrol/thumbnails/' . $filename); } } } } else { $option->image = Tools::getValue('old_img'); } if (!count($this->errors)) { if ($addaction) { if (!$option->add()) { $this->errors[] = Tools::displayError('An error occurred while saving data.'); } else { if (Tools::getIsset('id_copy_option')) { $id_copy_option = (int) Tools::getValue('id_copy_option'); $source_option = new Options($id_copy_option); OvicLayoutControl::copyHookModule($source_option, $option); OvicLayoutControl::copyOptionStyle($source_option, $option); } else { OvicLayoutControl::registerDefaultHookModule($option->id); } } } else { if (!$option->update()) { $this->errors[] = Tools::displayError('An error occurred while update data.'); } } if (!count($this->errors)) { Tools::redirectAdmin(self::$currentIndex . '&conf=3&token=' . Tools::getValue('token')); } } } elseif (Tools::isSubmit('changeactive')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); $option->active = !$option->active; if (!$option->update()) { $this->errors[] = Tools::displayError('Could not change'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=5&token=' . Tools::getValue('token')); } } } elseif (Tools::isSubmit('removeoption')) { $id_option = Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $option = new Options($id_option); if (!$option->delete()) { $this->errors[] = Tools::displayError('An error occurred during deletion'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=1&token=' . Tools::getValue('token')); } } } elseif (Tools::isSubmit('submitMultiSave')) { $id_option = (int) Tools::getValue('id_option'); if ($id_option && Validate::isUnsignedId($id_option)) { $fonts = array(); foreach (OvicLayoutControl::$OptionFonts as $font) { $fonts[$font] = Tools::getValue($font); } $colors = array(); foreach (OvicLayoutControl::$OptionColors as $color) { $colors[$color] = Tools::getValue($color); } $option = new Options($id_option); $where = "`theme` = '" . $option->theme . "' AND `alias` = '" . $option->alias . "'"; $sql = 'SELECT `alias` FROM `' . _DB_PREFIX_ . 'ovic_options_style` WHERE ' . $where; if (Db::getInstance()->getRow($sql)) { $result = Db::getInstance()->update('ovic_options_style', array('color' => Tools::jsonEncode($colors), 'font' => Tools::jsonEncode($fonts)), $where); } else { // Register module in hook $result = Db::getInstance()->insert('ovic_options_style', array('theme' => $option->theme, 'alias' => $option->alias, 'color' => Tools::jsonEncode($colors), 'font' => Tools::jsonEncode($fonts))); } if ($result) { Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . Tools::getValue('token') . '&view=detail&id_option=' . $id_option); } else { $this->errors[] = Tools::displayError('An error occurred while saving data.'); } } } parent::postProcess(); }
/** * Process posting data */ public function postProcess() { //$errors = array(); $id_shop = (int) $this->context->shop->id; $languages = Language::getLanguages(false); if (Tools::isSubmit('submitChangeLayout')) { //Configuration::set('OVIC_CURRENT_OPTION',(int)Tools::getValue('id_option',Configuration::get('OVIC_CURRENT_OPTION'))); Configuration::updateValue('OVIC_LAYOUT_COLUMN', (int) Tools::getValue('colsetting', Configuration::get('OVIC_LAYOUT_COLUMN', null, null, $id_shop)), false, null, $id_shop); $this->ProcessLayoutColumn(); parent::postProcess(); Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminLayoutSetting')); } elseif (Tools::isSubmit('submitSelectOption')) { $id_option = (int) Tools::getValue('id_option'); Configuration::updateValue('OVIC_CURRENT_OPTION', $id_option, false, null, $id_shop); $optionObject = new Options($id_option); Configuration::updateValue('OVIC_CURRENT_DIR', str_replace(' ', '_', $optionObject->alias), false, null, $id_shop); if (strlen($optionObject->column) > 0) { Configuration::updateValue('OVIC_LAYOUT_COLUMN', (int) substr($optionObject->column, 0, 1), false, null, $id_shop); } $this->ProcessLayoutColumn(); parent::postProcess(); //$this->importDatas(); Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminLayoutSetting')); } elseif (Tools::isSubmit('changeleftactive')) { $pagemeta = Tools::getValue('pagemeta'); $id_theme_meta = $this->getIdThemeMetaByPage($pagemeta); $this->processLeftMeta($id_theme_meta); } elseif (Tools::isSubmit('changerightactive')) { $pagemeta = Tools::getValue('pagemeta'); $id_theme_meta = $this->getIdThemeMetaByPage($pagemeta); $this->processRightMeta($id_theme_meta); } Tools::clearCache(); parent::postProcess(); }
public function postProcess() { if (Tools::getValue('id_product')) { $_POST['id_product'] = join(Tools::getValue('id_product'), ','); } else { $_POST['id_product'] = ''; } if (Tools::isSubmit('viewsimpleblog_post') && ($id_simpleblog_post = (int) Tools::getValue('id_simpleblog_post')) && ($SimpleBlogPost = new SimpleBlogPost($id_simpleblog_post, $this->context->language->id)) && Validate::isLoadedObject($SimpleBlogPost)) { Tools::redirectAdmin(Context::getContext()->link->getModuleLink('ph_simpleblog', 'single', array('rewrite' => $SimpleBlogPost->link_rewrite, 'sb_category' => $SimpleBlogPost->category_rewrite))); } if (Tools::isSubmit('deleteCover')) { $this->deleteCover((int) Tools::getValue('id_simpleblog_post')); } if (Tools::isSubmit('deleteFeatured')) { $this->deleteFeatured((int) Tools::getValue('id_simpleblog_post')); } if (Tools::isSubmit('is_featuredsimpleblog_post')) { $SimpleBlogPost = new SimpleBlogPost((int) Tools::getValue('id_simpleblog_post')); $SimpleBlogPost->is_featured = !$SimpleBlogPost->is_featured; $SimpleBlogPost->update(); Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminSimpleBlogPosts') . '&conf=4'); } return parent::postProcess(); }