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
1c142f2f
Commit
1c142f2f
authored
Feb 23, 2013
by
Cédric Houbart
Browse files
Split sold and archived products in list
parent
80a9fad4
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/base_products/actions/products.php
View file @
1c142f2f
...
...
@@ -34,6 +34,8 @@ $products = \Pasteque\ProductsService::getAll();
<p>
<?php
\
pi18n
(
"%d products"
,
PLUGIN_NAME
,
count
(
$products
));
?>
</p>
<h2>
<?php
\
pi18n
(
"Catalog"
,
PLUGIN_NAME
);
?>
</h2>
<table
cellpadding=
"0"
cellspacing=
"0"
>
<thead>
<tr>
...
...
@@ -46,7 +48,9 @@ $products = \Pasteque\ProductsService::getAll();
<tbody>
<?php
$par
=
FALSE
;
$archive
=
FALSE
;
foreach
(
$products
as
$product
)
{
if
(
$product
->
visible
)
{
$par
=
!
$par
;
?>
<tr
class=
"row-
<?php
echo
$par
?
'par'
:
'odd'
;
?>
"
>
...
...
@@ -59,10 +63,47 @@ $par = !$par;
</td>
</tr>
<?php
}
else
{
$archive
=
TRUE
;
}
}
?>
</tbody>
</table>
<?php
if
(
$archive
)
{
?>
<h2>
<?php
\
pi18n
(
"Archived"
,
PLUGIN_NAME
);
?>
</h2>
<table
cellpadding=
"0"
cellspacing=
"0"
>
<thead>
<tr>
<th></th>
<th>
<?php
\
pi18n
(
"Product.reference"
);
?>
</th>
<th>
<?php
\
pi18n
(
"Product.label"
);
?>
</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$par
=
FALSE
;
foreach
(
$products
as
$product
)
{
if
(
!
$product
->
visible
)
{
$par
=
!
$par
;
?>
<tr
class=
"row-
<?php
echo
$par
?
'par'
:
'odd'
;
?>
"
>
<td><img
class=
"thumbnail"
src=
"?
<?php
echo
\
Pasteque\URL_ACTION_PARAM
;
?>
=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>
<form
action=
"
<?php
echo
\
Pasteque\get_current_url
();
?>
"
method=
"post"
>
<?php
\
Pasteque\form_delete
(
"product"
,
$product
->
id
,
\
Pasteque\get_template_url
()
.
'img/delete.png'
)
?>
</form>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php
}
// archive end ?>
<?
php
if
(
count
(
$products
)
==
0
)
{
?>
...
...
modules/base_products/base_products.php
View file @
1c142f2f
...
...
@@ -22,7 +22,7 @@ namespace BaseProducts;
function
init
()
{
global
$MENU
;
$MENU
->
addSection
(
"catalog"
,
"Catalog
ue
"
,
PLUGIN_NAME
);
$MENU
->
addSection
(
"catalog"
,
"Catalog"
,
PLUGIN_NAME
);
$MENU
->
registerModuleEntry
(
"catalog"
,
PLUGIN_NAME
,
"menu_tax.png"
,
"Taxes"
,
"taxes"
);
$MENU
->
registerModuleEntry
(
"catalog"
,
PLUGIN_NAME
,
"menu_category.png"
,
"Categories"
,
"categories"
);
$MENU
->
registerModuleEntry
(
"catalog"
,
PLUGIN_NAME
,
"menu_product.png"
,
"Products"
,
"products"
);
...
...
modules/base_products/languages/default.locale
View file @
1c142f2f
{
"Catalog": "Catalog",
"Products": "Products",
"Add a product": "Add a product",
"%d products": "%d products",
"No product found": "No product found",
"Archived": "Archived",
"Edit a product": "Edit a product",
"Display": "Display",
"Price": "Price",
...
...
modules/base_products/languages/fr-FR.locale
View file @
1c142f2f
{
"Catalog": "Catalogue",
"Products": "Produits",
"Add a product": "Ajouter un produit",
"%d products": "%d produits",
"No product found": "Aucun produit trouvé",
"Edit a product": "Édition d'un produit",
"Archived": "Archives",
"Display": "Affichage",
"Price": "Prix",
"Referencing": "Referencement",
...
...
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