Commit 587849e0 authored by Julien Fastré's avatar Julien Fastré
Browse files

add export of categories

parent c32c8391
......@@ -47,6 +47,8 @@ $categories = \Pasteque\CategoriesService::getAll();
\i18n('Add a category', PLUGIN_NAME), 'img/btn_add.png');?></li>
<li><?php \Pasteque\tpl_btn('btn bt_import', \Pasteque\get_module_url_action(PLUGIN_NAME, "categoriesManagement"),
\i18n('Import categories', PLUGIN_NAME), 'img/btn_add.png');?></li>
<li><?php \Pasteque\tpl_btn('btn bt_export ', \Pasteque\get_report_url(PLUGIN_NAME, "categories_export"),
\i18n('Export categories', PLUGIN_NAME), 'img/btn_add.png');?></li>
</ul>
</div>
......
......@@ -17,7 +17,7 @@
"Categories": "Categories",
"Edit categories": "Edit categories",
"Import categories": "Importer des catégories",
"Export categories":"Exporter les catégories",
"Add a category": "Add a category",
"%d categories": "%d categories",
"No category found": "No category found",
......
......@@ -17,6 +17,7 @@
"Categories": "Categories",
"Edit a category": "Édition d'une categorie",
"Export categories":"Export des categories",
"Add a category": "Ajouter une catégorie",
"%d categories": "%d catégories",
"No category found": "Pas de categorie trouvée",
......
<?php
// Pastèque Web back office, Users module
//
// Copyright (C) 2013 Scil (http://scil.coop)
//
// This file is part of Pastèque.
//
// Pastèque is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// 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 BaseProducts;
$sql = "SELECT a.NAME AS NAME, p.NAME AS PARENT_NAME, a.DISPORDER AS DISPORDER"
. " FROM `CATEGORIES` a LEFT JOIN `CATEGORIES` p ON a.`PARENTID` = p.`ID`";
$fields = array('NAME', 'PARENT_NAME', 'DISPORDER');
$headers = array(\i18n("Category.label"),
\i18n("Category.parent"),
\i18n("Category.dispOrder"));
$report = new \Pasteque\Report(PLUGIN_NAME, "categories_export",
\i18n("Export categories", PLUGIN_NAME),
$sql, $headers, $fields);
\Pasteque\register_report($report);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment