Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SAMBUMBA
pasteque-server
Commits
587849e0
Commit
587849e0
authored
Apr 10, 2015
by
Julien Fastré
Browse files
add export of categories
parent
c32c8391
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/base_products/actions/categories.php
View file @
587849e0
...
...
@@ -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>
...
...
modules/base_products/languages/default.locale
View file @
587849e0
...
...
@@ -17,7 +17,7 @@
"Categories": "Categories",
"Edit categories": "Edit categories",
"
Im
port categories":
"Im
porter
d
es catégories",
"
Ex
port categories":
"Ex
porter
l
es catégories",
"Add a category": "Add a category",
"%d categories": "%d categories",
"No category found": "No category found",
...
...
modules/base_products/languages/fr.locale
View file @
587849e0
...
...
@@ -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",
...
...
modules/base_products/reports/categories_export.php
0 → 100644
View file @
587849e0
<?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
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment