function displayFreeModule($module, $activatedModules) { $activated = false; foreach ($activatedModules as $actMod) { if ($actMod == $module) { $activated = true; break; } } ?> <div class="row"> <input type="checkbox" name="modules[]" id="module-<?php echo \Pasteque\esc_attr($module); ?> " value="<?php echo \Pasteque\esc_attr($module); ?> " <?php if ($activated) { echo "checked=\"true\""; } ?> /> <label for="module-<?php echo \Pasteque\esc_attr($module); ?> "><?php \pi18n($module, PLUGIN_NAME); ?> </label> </div> <?php }
function show_update($dbVer) { tpl_open(); ?> <h1><?php \pi18n("Update"); ?> </h1> <p><?php \pi18n("Update notice"); ?> </p> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"> <?php form_value_hidden("update", "update", $dbVer); ?> <label for="country"><?php \pi18n("Pays"); ?> <select id="country" name="country"> <option value="belgique">Belgique</option> <option value="france">France</option> <option value="luxembourg">Luxembourg</option> <option value="united_kingdom">United Kingdom</option> </select> <?php \Pasteque\form_send(); ?> </form> <?php tpl_close(); }
?> </div> <?php } else { ?> <p><?php \pi18n("%d compositions", PLUGIN_NAME, count($compositions)); ?> </p> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th></th> <th><?php \pi18n("Composition.label"); ?> </th> <th></th> </tr> </thead> <tbody> <?php $par = false; foreach ($compositions as $composition) { $par = !$par; 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"; }
<script type="text/javascript"> addProduct = function(productId) { var product = catalog.products[productId]; if (jQuery("#line-" + productId).length > 0) { // Add quantity to existing line var qty = jQuery("#line-" + productId + "-qty"); var currVal = qty.val(); qty.val(parseInt(currVal) + 1); } else { // Add line var html = "<tr id=\"line-" + product['id'] + "\">\n"; html += "<td><img class=\"thumbnail\" src=\"" + product['img'] + "\" /></td>\n"; html += "<td>" + product['reference'] + "</td>\n"; html += "<td>" + product['label'] + "</td>\n"; html += "<td class=\"qty-cell\"><input class=\"qty\" id=\"line-" + product['id'] + "-qty\" type=\"numeric\" name=\"qty-" + product['id'] + "\" value=\"1\" />\n"; html += "<td><a class=\"btn-delete\" href=\"\" onClick=\"javascript:deleteLine('" + product['id'] + "');return false;\"><?php \pi18n("Delete"); ?> </a></td>\n"; html += "</tr>\n"; jQuery("#list").append(html); } } deleteLine = function(productId) { jQuery("#line-" + productId).detach(); } </script> <?php
</th> <th></th> </tr> </thead> <tbody> <?php foreach ($currencies as $currency) { ?> <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'); ?>
$user = new \Pasteque\User($_POST['name'], null, null, $_POST['roleId'], true, false); $id = $srv->create($user); if ($id !== false) { $message = \i18n("User saved. <a href=\"%s\">Go to the user page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'user_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $user = null; if (isset($_GET['id'])) { $user = $srv->get($_GET['id']); } ?> <h1><?php \pi18n("Edit an user", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post"> <?php \Pasteque\form_hidden("edit", $user, "id"); ?> <?php
?> </th> <th><?php \pi18n("Stock.SellValue"); ?> </th> <th><?php \pi18n("Stock.BuyValue"); ?> </th> <th><?php \pi18n("QuantityMin"); ?> </th> <th><?php \pi18n("QuantityMax"); ?> </th> </tr> </thead> <tbody> <?php foreach ($prdCat[$category->id] as $product) { if (!isset($prdLevel[$product->id])) { continue; } // Level lines $par = !$par; $prdRef = ""; $prdLabel = ""; $imgSrc = "";
$cashReg = new \Pasteque\CashRegister($_POST['label'], $_POST['locationId']); $id = $srv->create($cashReg); if ($id !== false) { $message = \i18n("Cash register saved. <a href=\"%s\">Go to the cash register page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'cashregister_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $cashReg = null; if (isset($_GET['id'])) { $cashReg = $srv->get($_GET['id']); } ?> <h1><?php \pi18n("Edit a cash register", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post" enctype="multipart/form-data"> <?php \Pasteque\form_hidden("edit", $cashReg, "id"); ?> <?php
// Pastèque is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Pastèque. If not, see <http://www.gnu.org/licenses/>. namespace BaseBackup; ?> <h1><?php \pi18n("Backup", PLUGIN_NAME); ?> </h1> <div class="hint"><p><?php \pi18n("Backup_help", PLUGIN_NAME); ?> </p></div><?php $user_id = \Pasteque\get_user_id(); $dbhost = \Pasteque\get_db_host($user_id); $dbuser = \Pasteque\get_db_user($user_id); $dbpasswd = \Pasteque\get_db_password($user_id); $database = \Pasteque\get_db_name($user_id); $dbport = \Pasteque\get_db_port($user_id); // Looking for an existing file (we do only allow one dump per day) // Filename scheme is pasteque-[date]-[database]-[randomstring].sql.gz // randomstring is for security, to make URL unfindable // Tip: create a firewall rule to ban bruteforce on this randomstring $dir = opendir("cache"); while (($f = readdir($dir)) != false) { if (preg_match("/pasteque-[0-9]{8}-" . $database . "-.[a-z0-9]*.sql.gz/", $f) == 1) {
<?php if ($category !== null && $category->hasImage) { ?> <img id="img" class="image-preview" src="?<?php echo \Pasteque\PT::URL_ACTION_PARAM; ?> =img&w=category&id=<?php echo $category->id; ?> " /> <a class="btn" id="clear" href="" onClick="javascript:clearImage(); return false;"><?php \pi18n("Delete"); ?> </a> <a class="btn" style="display:none" id="restore" href="" onClick="javascript:restoreImage(); return false;"><?php \pi18n("Restore"); ?> </a><br /> <?php } ?> <input type="file" name="image" /> </div> </div> <div class="row actions"> <?php \Pasteque\form_save(); ?> </div> </form>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </div> <h1><?php \pi18n("Main title"); ?> </h1> <p><?php \pi18n("Introduction"); ?> </p> <h2><?php \pi18n("Download"); ?> </h2> <p><?php \pi18n("Download instructions"); ?> </p> <h2><?php \pi18n("Documentation"); ?> </h2> <p><?php \pi18n("Documentation instructions"); ?> </p> <?php
</a></p> <?php \Pasteque\tpl_msg_box($message, $error); ?> <p><?php \pi18n("%d roles", PLUGIN_NAME, count($roles)); ?> </p> <table cellspacing="0" cellpadding="0"> <thead> <tr> <th><?php \pi18n("Role.name"); ?> </th> <th></th> </tr> </thead> <tbody> <?php foreach ($roles as $role) { ?> <tr> <td><?php echo $role->name; ?> </td> <td class="edition">
<div> <div id="product-sub-container" class="product-container"></div> </div> </fieldset> </div> <!-- to change --> <div id="product" class="row"> <fieldSet> <legend><?php \pi18n('Product', PLUGIN_NAME); ?> </legend> <div id="catalog-picker"></div> <div class="row" id="btnAddAllPrd"> <input type="button" onclick="javascript:addAllPrd()" value="<?php pi18n('Add all products of the category', PLUGIN_NAME); ?> "> </div> </fieldSet> </div> </div> <input type="hidden" name="subgroupData" id="subgroupData" /> <?php \Pasteque\form_save(); ?> </form> <?php \Pasteque\init_catalog("catalog", "catalog-picker", "productPicked", $categories, $products); ?>
<td><?php echo $area->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'area_edit', array("id" => $area->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("area", $area->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php } ?> </tbody> </table> <?php if (count($areas) == 0) { ?> <div class="alert"><?php \pi18n("No area found", PLUGIN_NAME); ?> </div> <?php }
\pi18n('Edit'); ?> " title="<?php \pi18n('Edit'); ?> "></a> </td> </tr> >>>>>>> Get rid of par for odd/even, CSS RULES <?php } } ?> </tbody> </table> <?php } } } // archive end ?> <?php if (count($products) == 0) { ?> <div class="alert"><?php \pi18n("No product found", PLUGIN_NAME); ?> </div> <?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); ?> </button> </div> </form> <?php
?> <div class="row"> <label for="barcode"><?php \pi18n("Product.barcode"); ?> </label> <div style="display:inline-block; max-width:65%;"> <img id="barcodeImg" src="" /> <input id="barcode" type="text" name="barcode" <?php if ($product != NULL) { echo 'value="' . $product->barcode . '"'; } ?> /> <a class="btn" href="" onClick="javascript:generateBarcode(); return false;"><?php \pi18n("Generate"); ?> </a> </div> </div> <?php if ($attributes) { ?> <?php \Pasteque\form_input("edit", "Product", $product, "attributeSetId", "pick", array("model" => "AttributeSet", "nullable" => true)); ?> <?php } ?> </fieldset>
function tpl_menu() { global $MENU; echo "<a class=\"responsive-button\" href=\"#menu-container\">≡</a>"; echo "<nav id=\"menu-container\" role=\"menu-container\">\n"; echo "<div id=\"logo\"><a href=\"#\"><img src=\"" . get_template_url() . "img/logo.png\"></a></div>\n"; foreach ($MENU->getSections() as $section) { echo "\t<div class=\"menu-section\" onclick=\"\$(this).find('.menu').slideToggle()\">\n"; echo "\t\t<div class=\"menu-section-title\">"; \pi18n($section->getName(), $section->getNameDomain()); echo "</div>\n"; echo "\t\t<ul class=\"menu\">\n"; foreach ($section->getEntries() as $entry) { echo "\t\t\t<li>"; if ($entry->getImg() !== NULL && $entry->getImg() != "") { $img = get_template_url() . "img/" . $entry->getImg(); } else { $img = get_template_url() . "img/menu_default.png"; } $style = "style=\"background-image:url('{$img}');\""; switch ($entry->getType()) { case MenuEntry::ACTION: $url = get_url_action($entry->getAction()); break; case MenuEntry::REPORT: $url = get_report_url($entry->getNameDomain(), $entry->getAction(), 'display'); break; } echo "<a {$style} href=\"" . $url . "\">" . __($entry->getName(), $entry->getNameDomain()) . "</a></li>\n"; } echo "\t\t</ul>\n"; echo "\t</div>\n"; } echo "</nav>"; }
\Pasteque\form_input("edit", "Customer", $cust, "custTaxId", "pick", array("model" => "CustTaxCat", "nullable" => true)); ?> <?php if ($discounts) { \Pasteque\form_input("edit", "Customer", $cust, "discountProfileId", "pick", array("model" => "DiscountProfile", "nullable" => true)); } ?> <?php if ($tariffAreas) { \Pasteque\form_input("edit", "Customer", $cust, "tariffAreaId", "pick", array("model" => "TariffArea", "nullable" => true)); } ?> </fieldset> <fieldset> <legend><?php \pi18n("Personnal data", PLUGIN_NAME); ?> </legend> <?php \Pasteque\form_input("edit", "Customer", $cust, "firstName", "string"); ?> <?php \Pasteque\form_input("edit", "Customer", $cust, "lastName", "string"); ?> <?php \Pasteque\form_input("edit", "Customer", $cust, "email", "string"); ?> <?php \Pasteque\form_input("edit", "Customer", $cust, "phone1", "string"); ?> <?php
<legend><?php \pi18n("Attribute", PLUGIN_NAME); ?> </legend> <?php \Pasteque\form_hidden("edit", $attribute, "id"); ?> <?php \Pasteque\form_input("edit", "Attribute", $attribute, "label", "string", array("required" => true)); ?> </fieldset> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th><?php \pi18n("AttributeValue.value"); ?> </th> <th></th> </tr> </thead> <tbody id="list"> <?php if ($attribute !== null) { foreach ($attribute->values as $value) { ?> <tr id="line-<?php echo $value->id; ?> "> <td><?php
<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 } $par = false; foreach ($providers as $provider) { printprovider($provider, 0, $par); } ?> </tbody> </table> <?php if (count($providers) == 0) { ?> <div class="alert"><?php \pi18n("No provider found", PLUGIN_NAME); ?> </div> <?php }
<td><?php echo $set->label; ?> </td> <td class="edition"> <?php \Pasteque\tpl_btn("edition", \Pasteque\get_module_url_action(PLUGIN_NAME, 'set_edit', array("id" => $set->id)), "", 'img/edit.png', \i18n('Edit'), \i18n('Edit')); ?> <form action="<?php echo \Pasteque\get_current_url(); ?> " method="post"><?php \Pasteque\form_delete("set", $set->id, \Pasteque\get_template_url() . 'img/delete.png'); ?> </form> </td> </tr> <?php } ?> </tbody> </table> <?php if (count($sets) == 0) { ?> <div class="alert"><?php \pi18n("No attribute set found", PLUGIN_NAME); ?> </div> <?php }
<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 } ?> </tbody> </table> <?php
<?php } ?> </table> <table cellpadding="0" cellspacing="0"> <thead> <th colspan="2"><?php \pi18n("Sales by category", PLUGIN_NAME); ?> </th> </thead> <tbody> <?php foreach ($zticket->catSales as $cat) { ?> <tr> <td><?php \pi18n(\Pasteque\CategoriesService::get($cat['id'])->label, PLUGIN_NAME); ?> </td> <td class="numeric"><?php \pi18nCurr($cat['amount']); ?> </td> </tr> <?php } ?> </table> <?php
$custTax = new \Pasteque\CustTaxCat($_POST['label'], $tax_cat_id); $id = \Pasteque\CustTaxCatsService::create($custTax); if ($id !== FALSE) { $message = \i18n("Tax saved. <a href=\"%s\">Go to the tax page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'cust_tax_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $custTax = NULL; if (isset($_GET['id'])) { $custTax = \Pasteque\CustTaxCatsService::get($_GET['id']); } ?> <h1><?php \pi18n("Edit a customer tax", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post"> <?php \Pasteque\form_hidden("edit", $custTax, "id"); ?> <?php
<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"); ?> </button> </div> </form> <?php
?> <?php \Pasteque\tpl_msg_box($message, $error); ?> <p><?php \pi18n("%d resources", PLUGIN_NAME, count($resources)); ?> </p> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th><?php \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>
$profile = new \Pasteque\DiscountProfile($_POST['label'], $_POST['rate']); $id = $srv->create($profile); if ($id !== false) { $message = \i18n("Discount profile saved. <a href=\"%s\">Go to the profile page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'discountprofile_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $profile = null; if (isset($_GET['id'])) { $profile = $srv->get($_GET['id']); } ?> <h1><?php \pi18n("Edit a profile", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post" enctype="multipart/form-data"> <?php \Pasteque\form_hidden("edit", $profile, "id"); ?> <?php
<a class="btn" id="clear" href="" onClick="javascript:clearImage(); return false;"><?php \pi18n("Delete"); ?> </a> <a class="btn" style="display:none" id="restore" href="" onClick="javascript:restoreImage(); return false;"><?php \pi18n("Restore"); ?> </a><br /> <?php } ?> <input type="file" name="image" /> </div> </div> <legend><?php \pi18n("Contact data", PLUGIN_NAME); ?> </legend> <?php \Pasteque\form_input("edit", "Provider", $provider, "firstName", "string"); ?> <?php \Pasteque\form_input("edit", "Provider", $provider, "lastName", "string"); ?> <?php \Pasteque\form_input("edit", "Provider", $provider, "email", "string"); ?> <?php \Pasteque\form_input("edit", "Provider", $provider, "phone1", "string"); ?> <?php
\Pasteque\form_input("edit", "TaxCat", $taxCat, "label", "string", array("required" => true)); ?> </fieldset> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th><?php \pi18n("Tax.label"); ?> </th> <th><?php \pi18n("Tax.rate"); ?> </th> <th><?php \pi18n("Tax.startDate"); ?> </th> </tr> </thead> <tbody id="list"> <?php if ($taxCat !== null) { foreach ($taxCat->taxes as $tax) { ?> <tr> <td><?php \Pasteque\form_input($tax->id, "Tax", $tax, "label", "string", array("required" => true, "nolabel" => true, "nameid" => true)); ?> </td> <td><?php