\pi18n("Resource.label"); ?> </th> <th></th> </tr> </thead> <tbody> <ul class="resources-list"> <?php foreach ($resources as $res) { ?> <tr> <td><?php echo $res->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn('btn-edition', \Pasteque\get_module_url_action(PLUGIN_NAME, 'resource_edit', array("id" => $res->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <?php \Pasteque\tpl_btn('btn-delete', \Pasteque\get_current_url() . "&delete-resource=" . $res->id, "", 'img/delete.png', \i18n('Delete'), \i18n('Delete'), true); ?> </td> </tr> <?php } ?> </tbody> </table> <?php
<?php \Pasteque\form_input("edit", "Provider", $provider, "visible", "boolean"); ?> </fieldset> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($provider !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'providers'); ?> " method="post"> <?php \Pasteque\form_delete("prov", $provider->id); ?> </form> <?php } ?> <script type="text/javascript"> clearImage = function() { jQuery("#img").hide(); jQuery("#clear").hide(); jQuery("#restore").show();
$content[0][0] = ""; $content[0][1] = \i18n("Product.reference"); $content[0][2] = \i18n("Product.label"); $i = 1; if (isset($archivesCat[$category->id])) { foreach ($archivesCat[$category->id] as $product) { if (!$product->visible) { if ($product->hasImage) { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product&id=" . $product->id; } else { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=product"; } $content[$i][0] = "<img class=\"img img-thumbnail thumbnail\" src=\"?" . $imgSrc . "\">"; $content[$i][1] = $product->reference; $content[$i][2] = $product->label; $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, 'product_edit', array("id" => $product->id))); $content[$i][2] .= \Pasteque\buttonGroup($btn_group, "pull-right"); $i++; } } } if (sizeof($content) > 1) { echo \Pasteque\row(\Pasteque\secondaryTitle(\Pasteque\esc_html($category->label) . " - " . \i18n("Archived", PLUGIN_NAME))); echo \Pasteque\row(\Pasteque\standardTable($content)); } unset($content); } } if (count($products) == 0) { echo \Pasteque\errorDiv(\i18n("No product found", PLUGIN_NAME)); }
<tbody> <?php foreach ($profiles as $profile) { ?> <tr> <td><?php echo $profile->label; ?> </td> <td><?php echo $profile->rate; ?> </td> <td class="edition"> <a href="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'discountprofile_edit', array('id' => $profile->id)); ?> "><img src="<?php echo \Pasteque\get_template_url(); ?> img/edit.png" alt="<?php \pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> </td> </tr> <?php }
echo \Pasteque\get_current_url(); ?> " method="post"> <?php \Pasteque\form_hidden("edit", $custTax, "id"); ?> <?php \Pasteque\form_input("edit", "CustTaxCat", $custTax, "label", "string", array("required" => true)); ?> <?php \Pasteque\form_input("edit", "CustTaxCat", $custTax, "taxCatId", "pick", array("model" => "Tax", "nullable" => true)); ?> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($custTax !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'cust_taxes'); ?> " method="post"> <?php \Pasteque\form_delete("custtax", $custTax->id); ?> </form> <?php }
$scaled = isset($_POST['scaled']) ? 1 : 0; $visible = isset($_POST['visible']) ? 1 : 0; $discount_enabled = FALSE; $discount_rate = 0.0; if (isset($_POST['discountRate'])) { $discount_enabled = isset($_POST['discountEnabled']) ? 1 : 0; $discount_rate = $_POST['discountRate']; } $attr = null; if (isset($_POST['attributeSetId']) && $_POST['attributeSetId'] !== "") { $attr = $_POST['attributeSetId']; } $prd = new \Pasteque\Product($_POST['reference'], $_POST['label'], $_POST['realsell'], $catId, $provId, $disp_order, $taxCatId, $visible, $scaled, $_POST['priceBuy'], $attr, $_POST['barcode'], $img !== null, $discount_enabled, $discount_rate); $id = \Pasteque\ProductsService::create($prd, $img); if ($id !== FALSE) { $message = \i18n("Product saved. <a href=\"%s\">Go to the product page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'product_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } } $product = NULL; $vatprice = ""; $price = ""; if (isset($_GET['id'])) { $product = \Pasteque\ProductsService::get($_GET['id']); $taxCat = \Pasteque\TaxesService::get($product->taxCatId); $tax = $taxCat->getCurrentTax(); $vatprice = $product->priceSell * (1 + $tax->rate); $price = sprintf("%.2f", $product->priceSell);
function printprovider($printprovider, $level, &$par) { $par = !$par; if ($printprovider->hasImage) { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=provider&id=" . $printprovider->id; } else { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=provider"; } ?> <tr class="row-<?php echo $par ? 'par' : 'odd'; ?> "> <td> <?php for ($i = 0; $i < $level; $i++) { echo " "; } ?> <img class="thumbnail" src="?<?php echo $imgSrc; ?> " /> <td><?php echo $printprovider->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'provider_edit', array("id" => $printprovider->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("prov", $printprovider->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php }
<td><?php \Pasteque\form_input("attr", "Attribute", null, "id", "pick", array("model" => "Attribute", "nullable" => true, "nolabel" => true, "array" => true, "nameid" => true)); ?> </td> </tr> <?php } ?> </tbody> </table> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($set !== null) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'sets'); ?> " method="post"> <?php \Pasteque\form_delete("set", $set->id); ?> </form> <?php }
\Pasteque\form_input("edit", "Currency", $currency, "thousandsSeparator", "string"); ?> <?php \Pasteque\form_input("edit", "Currency", $currency, "format", "string", array("required" => true)); ?> <?php \Pasteque\form_input("edit", "Currency", $currency, "isMain", "boolean"); ?> <?php \Pasteque\form_input("edit", "Currency", $currency, "isActive", "boolean"); ?> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($currency->id !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'currencies'); ?> " method="post"> <?php \Pasteque\form_delete("cat", $currency->id); ?> </form> <?php }
<form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post" enctype="multipart/form-data"> <?php \Pasteque\form_hidden("edit", $location, "id"); ?> <?php \Pasteque\form_input("edit", "Location", $location, "label", "string", array("required" => true)); ?> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($location !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'locations'); ?> " method="post"> <?php \Pasteque\form_delete("location", $location->id); ?> </form> <?php }
</td> <td><?php \pi18nDatetime($session->openDate); ?> </td> <td class="numeric"><?php echo $session->tickets; ?> </td> <td class="numeric"><?php \pi18nCurr($session->total); ?> </td> <td class="edition"> <a href="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'session_details', array('id' => $session->id)); ?> "><img src="<?php echo \Pasteque\get_template_url(); ?> img/edit.png" alt="<?php \pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> </td> </tr> <?php }
</th> <th></th> </tr> </thead> <tbody> <?php foreach ($custTaxCats as $custTax) { ?> <tr> <td><?php echo $custTax->label; ?> </td> <td class="edition"> <a href="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'cust_tax_edit', array('id' => $custTax->id)); ?> "><img src="<?php echo \Pasteque\get_template_url(); ?> img/edit.png" alt="<?php \pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php
</th> <th></th> </tr> </thead> <tbody> <?php foreach ($attributes as $attr) { ?> <tr> <td><?php echo $attr->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'attribute_edit', array("id" => $attr->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("attribute", $attr->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php } ?> </tbody> </table>
function printCategory($printCategory, $level, &$par) { $par = !$par; if ($printCategory->hasImage) { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category&id=" . $printCategory->id; } else { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category"; } ?> <tr class="row-<?php echo $par ? 'par' : 'odd'; ?> "> <td> <?php for ($i = 0; $i < $level; $i++) { echo " "; } ?> <img class="thumbnail" src="?<?php echo $imgSrc; ?> " /> <td><?php echo $printCategory->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'category_edit', array("id" => $printCategory->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("cat", $printCategory->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php $categories = \Pasteque\CategoriesService::getChildren($printCategory->id); $level++; foreach ($categories as $childCategory) { printCategory($childCategory, $level, $par); } }
?> " method="post" enctype="multipart/form-data"> <?php \Pasteque\form_hidden("edit", $profile, "id"); ?> <?php \Pasteque\form_input("edit", "DiscountProfile", $profile, "label", "string", array("required" => true)); ?> <?php \Pasteque\form_input("edit", "DiscountProfile", $profile, "rate", "float", array("required" => true)); ?> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($profile !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'discountprofiles'); ?> " method="post"> <?php \Pasteque\form_delete("profile", $profile->id); ?> </form> <?php }
?> =img&w=product&id=<?php echo $product->id; ?> " /> <td><?php echo $product->reference; ?> </td> <td><?php echo $product->label; ?> </td> <td class="edition"> <a href="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'product_edit', array('id' => $product->id)); ?> "><img src="<?php echo \Pasteque\get_template_url(); ?> img/edit.png" alt="<?php \pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> </td> </tr> >>>>>>> Get rid of par for odd/even, CSS RULES <?php
} } ?> <h1><?php \pi18n("Import products from csv file", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" method="post" action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'productsManagement'); ?> " enctype="multipart/form-data"> <div class="row"> <label for='csv' > <?php \pi18n("File", PLUGIN_NAME); ?> : </label> <input type="file" name="csv"> </div> <div class="row actions"> <button class="btn-send" type="submit" id="envoyer" name="envoyer" > <?php \pi18n("send", PLUGIN_NAME);
</th> <th></th> </tr> </thead> <tbody> <?php foreach ($locations as $location) { ?> <tr> <td><?php echo $location->label; ?> </td> <td class="edition"> <a href="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'location_edit', array('id' => $location->id)); ?> "><img src="<?php echo \Pasteque\get_template_url(); ?> img/edit.png" alt="<?php \pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> </td> </tr> <?php }
?> " method="post" enctype="multipart/form-data"> <?php \Pasteque\form_hidden("edit", $cashReg, "id"); ?> <?php \Pasteque\form_input("edit", "CashRegister", $cashReg, "label", "string", array("required" => true)); ?> <?php \Pasteque\form_input("edit", "CashRegister", $cashReg, "locationId", "pick", array("model" => "Location")); ?> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($cashReg !== NULL) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'cashregisters'); ?> " method="post"> <?php \Pasteque\form_delete("cashreg", $cashReg->id); ?> </form> <?php }
?> <h1><?php \pi18n('Composition edit', PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <?php if (isset($composition)) { ?> <form method='post' action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'composition'); ?> "> <input type="hidden" value="<?php echo $composition->id; ?> " name="delete-comp"> <input type='submit' class='btn-delete' value='<?php \pi18n('Delete this composition', PLUGIN_NAME); ?> '/> </form> <?php } ?>
$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 { $imgSrc = \Pasteque\PT::URL_ACTION_PARAM . "=img&w=category"; } $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, 'category_edit', array("id" => $category->id))); $btn_group .= \Pasteque\deleteButton(\i18n('Delete', PLUGIN_NAME), \Pasteque\get_current_url() . "&delete-cat=" . $category->id); $content[$i][0] .= "<img class=\"img img-thumbnail thumbnail pull-left\" src=\"?" . $imgSrc . "\">"; $content[$i][0] .= $category->label; $content[$i][0] .= \Pasteque\buttonGroup($btn_group, "pull-right"); $i++; } echo \Pasteque\row(\Pasteque\standardTable($content)); }
?> </tbody> </table> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form> <?php if ($attribute !== null) { ?> <form action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'attributes'); ?> " method="post"> <?php \Pasteque\form_delete("attribute", $attribute->id); ?> </form> <?php } ?> <script type="text/javascript"> del = function(id) { jQuery("#line-" + id).remove(); jQuery("form.edit").append("<input type=\"hidden\" name=\"delete[]\" value=\"" + id + "\" />"); } </script>
<tr> <td><?php echo $currency->label; ?> </td> <td><?php if ($currency->isMain) { \pi18n("Main", PLUGIN_NAME); } else { echo $currency->rate; } ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'currency_edit', array("id" => $currency->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("currency", $currency->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php } ?> </tbody> </table>
$err[] = \i18n($mess); } \Pasteque\tpl_msg_box(NULL, $err); } else { import_csv($csv, $date); } } } ?> <h1><?php \pi18n("Import category from csv file", PLUGIN_NAME); ?> </h1> <form class="edit" method="post" action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'categoriesManagement'); ?> " enctype="multipart/form-data"> <div class="row"> <label for='csv' > <?php \pi18n("File", PLUGIN_NAME); ?> : </label> <input type="file" name="csv"> </div> <div class="row actions"> <button class="btn-send" type="submit" id="envoyer" name="envoyer" > <?php \pi18n("send", PLUGIN_NAME);
?> <tr class="row-<?php echo $par ? 'par' : 'odd'; ?> "> <td><img class="thumbnail" src="?<?php echo $imgSrc; ?> " /> <td><?php echo $composition->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'composition_edit', array("productId" => $composition->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("comp", $composition->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php } } ?> </tbody>
} } } ?> <h1><?php \pi18n("Import areas from csv file", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" method="post" action="<?php echo \Pasteque\get_module_url_action(PLUGIN_NAME, 'areas_import'); ?> " enctype="multipart/form-data"> <div class="row"> <label for='csv' > <?php \pi18n("File", PLUGIN_NAME); ?> : </label> <input type="file" name="csv"> </div> <div class="row actions"> <button class="btn-send" type="submit" id="envoyer" name="envoyer" > <?php \pi18n("Send");
} } $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"; } $btn_group = \Pasteque\editButton(\i18n('Edit', PLUGIN_NAME), \Pasteque\get_module_url_action(PLUGIN_NAME, "composition_edit", array("productId" => $composition->id))); $btn_group .= \Pasteque\deleteButton(\i18n('Delete', PLUGIN_NAME), \Pasteque\get_current_url() . "&delete-comp=" . $composition->id); $content[$i][0] .= "<img class=\"img img-thumbnail thumbnail pull-left\" src=\"?" . $imgSrc . "\">"; $content[$i][0] .= $composition->label; $content[$i][0] .= \Pasteque\buttonGroup($btn_group, "pull-right"); $i++; } }
<th><?php \pi18n("CashRegister.label"); ?> </th> <th></th> </tr> </thead> <tbody> <?php foreach ($cashRegs as $cashReg) { ?> <tr> <td><?php echo $cashReg->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn('btn-edition', \Pasteque\get_module_url_action(PLUGIN_NAME, 'cashregister_edit', array("id" => $cashReg->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <?php \Pasteque\tpl_btn('btn-delete', \Pasteque\get_current_url() . "&delete-cashreg=" . $cashReg->id, "", 'img/delete.png', \i18n('Delete'), \i18n('Delete'), true); ?> </td> </tr> <?php } ?> </tbody> </table> <?php