} else { $title = _AM_OLEDRION_ADD_MANUFACTURER; $item = $h_oledrion_manufacturer->create(true); $label_submit = _AM_OLEDRION_ADD; $edit = false; } $sform = new XoopsThemeForm($title, 'frmmanufacturer', $baseurl); $sform->setExtra('enctype="multipart/form-data"'); $sform->addElement(new XoopsFormHidden('op', 'manufacturers')); $sform->addElement(new XoopsFormHidden('action', 'saveedit')); $sform->addElement(new XoopsFormHidden('manu_id', $item->getVar('manu_id'))); $sform->addElement(new XoopsFormText(_OLEDRION_LASTNAME, 'manu_name', 50, 255, $item->getVar('manu_name', 'e')), true); $sform->addElement(new XoopsFormText(_OLEDRION_COMM_NAME, 'manu_commercialname', 50, 255, $item->getVar('manu_commercialname', 'e')), false); $sform->addElement(new XoopsFormText(_OLEDRION_EMAIL, 'manu_email', 50, 255, $item->getVar('manu_email', 'e')), false); $sform->addElement(new XoopsFormText(_OLEDRION_SITEURL, 'manu_url', 50, 255, $item->getVar('manu_url', 'e')), false); $editor = oledrion_utils::getWysiwygForm(_OLEDRION_MANUFACTURER_INF, 'manu_bio', $item->getVar('manu_bio', 'e'), 15, 60, 'bio_hidden'); if ($editor) { $sform->addElement($editor, false); } // Les 5 images for ($i = 1; $i <= 5; $i++) { if ($action == 'edit' && $item->pictureExists($i)) { $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br />'); $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl($i) . "' alt='' border='0' />")); $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture' . $i); $deleteCheckbox->addOption(1, _DELETE); $pictureTray->addElement($deleteCheckbox); $sform->addElement($pictureTray); unset($pictureTray, $deleteCheckbox); } $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE . ' ' . $i, 'attachedfile' . $i, oledrion_utils::getModuleOption('maxuploadsize')), false);
ksort($vendors); $xoopsTpl->assign('disc_vendor_id_options', $vendors); $xoopsTpl->assign('disc_vendor_id_selected', $item->getVar('disc_vendor_id')); // Catégorie $xoopsTpl->assign('disc_cat_cid_options', $categoriesSelect); // Produits $products = $h_oledrion_products->getList(); $products[0] = _ALL; ksort($products); $xoopsTpl->assign('disc_product_id_options', $products); $xoopsTpl->assign('disc_product_id_selected', $item->getVar('disc_product_id')); $productsSelect = $h_oledrion_products->productSelector(new oledrion_parameters(array('caption' => _AM_OLEDRION_DISCOUNT_PRODUCT, 'name' => 'disc_product_id', 'value' => $item->getVar('disc_product_id'), 'size' => 1, 'multiple' => false, 'values' => null, 'showAll' => true, 'sort' => 'product_title', 'order' => 'ASC', 'formName' => 'frmdiscount', 'description' => _AM_OLEDRION_DISCOUNT_HELP1, 'withNull' => _ALL))); $xoopsTpl->assign('disc_product_id', $productsSelect->render()); $xoopsTpl->assign('discount', $discountForTemplate); $xoopsTpl->assign('currencyName', oledrion_utils::getModuleOption('money_full')); $editor = oledrion_utils::getWysiwygForm(_AM_OLEDRION_DISCOUNT_DESCR, 'disc_description', $item->getVar('disc_description', 'e'), 15, 60, 'description_hidden'); $xoopsTpl->assign('editor', $editor->render()); $xoopsTpl->display('db:oledrion_admin_discounts.html'); show_footer(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'copy': // Duplication d'une réduction // **************************************************************************************************************** xoops_cp_header(); $id = isset($_GET['id']) ? intval($_GET['id']) : 0; if (empty($id)) { oledrion_utils::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5); } $opRedirect = 'discounts';
$vatSelect->addOptionArray($vatsForDisplay); $sform->addElement($vatSelect, true); $sform->addElement(new XoopsFormText(_OLEDRION_PRICE, 'product_price', 20, 20, $item->getVar('product_price', 'e')), true); $sform->addElement(new XoopsFormText(_AM_OLEDRION_DISCOUNT_HLP, 'product_discount_price', 20, 20, $item->getVar('product_discount_price', 'e')), false); $sform->addElement(new XoopsFormText(_OLEDRION_SHIPPING_PRICE, 'product_shipping_price', 20, 20, $item->getVar('product_shipping_price', 'e')), false); $sform->addElement(new XoopsFormText(_OLEDRION_ECOTAXE, 'product_ecotaxe', 10, 10, $item->getVar('product_ecotaxe', 'e')), false); } $sform->addElement(new XoopsFormText(_OLEDRION_STOCK_QUANTITY, 'product_stock', 10, 10, $item->getVar('product_stock', 'e')), false); $alertStock = new XoopsFormText(_OLEDRION_STOCK_ALERT, 'product_alert_stock', 10, 10, $item->getVar('product_alert_stock', 'e')); $alertStock->setDescription(_AM_OLEDRION_STOCK_HLP); $sform->addElement($alertStock, false); $editor2 = oledrion_utils::getWysiwygForm(_OLEDRION_SUMMARY, 'product_summary', $item->getVar('product_summary', 'e'), 15, 60, 'summary_hidden'); if ($editor2) { $sform->addElement($editor2, false); } $editor = oledrion_utils::getWysiwygForm(_OLEDRION_DESCRIPTION, 'product_description', $item->getVar('product_description', 'e'), 15, 60, 'description_hidden'); if ($editor) { $sform->addElement($editor, false); } // Tags if (oledrion_utils::getModuleOption('use_tags')) { require_once XOOPS_ROOT_PATH . '/modules/tag/include/formtag.php'; $sform->addElement(new XoopsFormTag('item_tag', 60, 255, $item->getVar('product_id'), 0)); } // META Data if ($manual_meta) { $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_KEYWORDS, 'product_metakeywords', 50, 255, $item->getVar('product_metakeywords', 'e')), false); $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_DESCRIPTION, 'product_metadescription', 50, 255, $item->getVar('product_metadescription', 'e')), false); $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_PAGETITLE, 'product_metatitle', 50, 255, $item->getVar('product_metatitle', 'e')), false); } // Fichier attaché
$deleteCheckbox = new XoopsFormCheckBox('', 'delpicture'); $deleteCheckbox->addOption(1, _DELETE); $pictureTray->addElement($deleteCheckbox); $sform->addElement($pictureTray); unset($pictureTray, $deleteCheckbox); } $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', oledrion_utils::getModuleOption('maxuploadsize')), false); $editor = oledrion_utils::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'cat_description', $item->getVar('cat_description', 'e'), 15, 60, 'description_hidden'); if ($editor) { $sform->addElement($editor, false); } $editor3 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_FOOTER, 'cat_footer', $item->getVar('cat_footer', 'e'), 15, 60, 'footer_hidden'); if ($editor3) { $sform->addElement($editor3, false); } $editor2 = oledrion_utils::getWysiwygForm(_MI_OLEDRION_ADVERTISEMENT, 'cat_advertisement', $item->getVar('cat_advertisement', 'e'), 15, 60, 'pub_hidden'); if ($editor2) { $sform->addElement($editor2, false); } // META Data if ($manual_meta) { $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_KEYWORDS, 'cat_metakeywords', 50, 255, $item->getVar('cat_metakeywords', 'e')), false); $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_DESCRIPTION, 'cat_metadescription', 50, 255, $item->getVar('cat_metadescription', 'e')), false); $sform->addElement(new XoopsFormText(_AM_OLEDRION_META_PAGETITLE, 'cat_metatitle', 50, 255, $item->getVar('cat_metatitle', 'e')), false); } $button_tray = new XoopsFormElementTray('', ''); $submit_btn = new XoopsFormButton('', 'post', $label_submit, 'submit'); $button_tray->addElement($submit_btn); $sform->addElement($button_tray); $sform = oledrion_utils::formMarkRequiredFields($sform); $sform->display();
if ($editor3) { $sform->addElement($editor3, false); } $editor4 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_OFFLINEPAY_TEXT, 'welcome4', $registry->getfile(OLEDRION_TEXTFILE4), 5, 60, 'hometext4_hidden'); if ($editor4) { $sform->addElement($editor4, false); } $editor5 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_RESTRICT_TEXT, 'welcome5', $registry->getfile(OLEDRION_TEXTFILE5), 5, 60, 'hometext5_hidden'); if ($editor5) { $sform->addElement($editor5, false); } $editor6 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_CHECKOUT_TEXT1, 'welcome6', $registry->getfile(OLEDRION_TEXTFILE6), 5, 60, 'hometext6_hidden'); if ($editor6) { $sform->addElement($editor6, false); } $editor7 = oledrion_utils::getWysiwygForm(_AM_OLEDRION_CHECKOUT_TEXT2, 'welcome7', $registry->getfile(OLEDRION_TEXTFILE7), 5, 60, 'hometext7_hidden'); if ($editor7) { $sform->addElement($editor7, false); } $button_tray = new XoopsFormElementTray('', ''); $submit_btn = new XoopsFormButton('', 'post', _AM_OLEDRION_MODIFY, 'submit'); $button_tray->addElement($submit_btn); $sform->addElement($button_tray); $sform = oledrion_utils::formMarkRequiredFields($sform); $sform->display(); break; // **************************************************************************************************************** // **************************************************************************************************************** case 'savetexts': // Sauvegarde des textes d'accueil ******************************************************** // ****************************************************************************************************************