namespace ProductCompositions; $message = NULL; $error = NULL; if (isset($_POST['delete-comp'])) { if (\Pasteque\CompositionsService::delete($_POST['delete-comp'])) { $message = \i18n("Changes saved"); } else { $error = \i18n("Unable to save changes"); } } $compositions = \Pasteque\CompositionsService::getAll(); //Title echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Compositions", PLUGIN_NAME))); //Buttons $buttons = \Pasteque\addButton(\i18n("Add composition", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "composition_edit")); echo \Pasteque\row(\Pasteque\buttonGroup($buttons)); //Information \Pasteque\tpl_msg_box($message, $error); //Counter echo \Pasteque\row(\Pasteque\counterDiv(\i18n("%d compositions", PLUGIN_NAME, count($compositions)))); if (count($compositions) == 0) { echo \Pasteque\errorDiv(\i18n("No category found", PLUGIN_NAME)); } else { $content[0][0] = \i18n("Composition.label"); $i = 1; foreach ($compositions as $composition) { if ($composition->hasImage) { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product&id=" . $composition->id; } else { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product";
namespace BaseProducts; $message = NULL; $error = NULL; if (isset($_GET['delete-taxcat'])) { if (\Pasteque\TaxesService::deleteCat($_GET['delete-taxcat'])) { $message = \i18n("Changes saved"); } else { $error = \i18n("Unable to delete tax. Tax cannot be deleted when in use.", PLUGIN_NAME); } } $taxes = \Pasteque\TaxesService::getAll(); //Title echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Taxes", PLUGIN_NAME))); //Buttons $buttons = \Pasteque\addButton(\i18n("Add a tax", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, 'tax_edit')); echo \Pasteque\row(\Pasteque\buttonGroup($buttons)); //Informations \Pasteque\tpl_msg_box($message, $error); //Counter echo \Pasteque\row(\Pasteque\counterDiv(\i18n("%d taxes", PLUGIN_NAME, count($taxes)))); if (count($taxes) == 0) { echo \Pasteque\errorDiv(\i18n("No tax found", PLUGIN_NAME)); } else { $content[0][0] = \i18n("TaxCat.label"); $i = 1; foreach ($taxes as $tax) { $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, 'tax_edit', array("id" => $tax->id))); $btn_group .= \Pasteque\deleteButton(\i18n('Delete', PLUGIN_NAME), \Pasteque\get_current_url() . "&delete-taxcat=" . $tax->id); $content[$i][0] = $tax->label; $content[$i][0] .= \Pasteque\buttonGroup($btn_group, "pull-right");
$message = NULL; $error = NULL; if (isset($_POST['delete-cat'])) { if (\Pasteque\CategoriesService::deleteCat($_POST['delete-cat'])) { $message = \i18n("Changes saved"); } else { $error = \i18n("Unable to save changes"); $error .= " " . \i18n("Only empty category can be deleted", PLUGIN_NAME); } } $categories = \Pasteque\CategoriesService::getAll(); //Title echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Categories", PLUGIN_NAME))); //Buttons $buttons = \Pasteque\addButton(\i18n('Add a category', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "category_edit")); $buttons .= \Pasteque\importButton(\i18n('Import categories', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "categoriesManagement")); echo \Pasteque\row(\Pasteque\buttonGroup($buttons)); //Information \Pasteque\tpl_msg_box($message, $error); //Counter echo \Pasteque\row(\Pasteque\counterDiv(\i18n("%d categories", PLUGIN_NAME, count($categories)))); if (count($categories) == 0) { echo \Pasteque\errorDiv(\i18n("No category found", PLUGIN_NAME)); } else { $content[0][0] = \i18n("Category.label"); $i = 1; foreach ($categories as $category) { if ($category->hasImage) { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category&id=" . $category->id; } else {
$totalProducts = \Pasteque\ProductsService::getTotal($hidden); } } $categories = \Pasteque\CategoriesService::getAll(); $prdCat = array(); $archivesCat = array(); foreach ($products as $product) { if ($product->categoryId !== \Pasteque\CompositionsService::CAT_ID) { $prdCat[$product->categoryId][] = $product; } // Archive will be filled on display loop } //Title echo \Pasteque\row(\Pasteque\mainTitle(\i18n("Products", PLUGIN_NAME))); //Buttons $buttons = \Pasteque\addButton(\i18n("Add a product", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "product_edit")); $buttons .= \Pasteque\importButton(\i18n("Import products", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "productsManagement")); $buttons .= \Pasteque\exportButton(\i18n("Export products", PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "products_export")); echo \Pasteque\row(\Pasteque\buttonGroup($buttons)); //Information \Pasteque\tpl_msg_box($message, $error); ?> <div id="search"> <div class="title"><?php \pi18n("Search"); ?> </div> <h5><?php \pi18n("by category", PLUGIN_NAME); ?>