Works on canvas capability
This commit is contained in:
parent
01811b5727
commit
31ced81af6
@ -107,6 +107,43 @@ class ProductDefault extends Product
|
|||||||
$sql.= $this->db->order($sortfield,$sortorder);
|
$sql.= $this->db->order($sortfield,$sortorder);
|
||||||
$sql.= $this->db->plimit($limit + 1 ,$offset);
|
$sql.= $this->db->plimit($limit + 1 ,$offset);
|
||||||
|
|
||||||
|
$this->list_title = array();
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("Ref");
|
||||||
|
$titlelist["sortfield"] = 'p.ref';
|
||||||
|
$titlelist["align"] = 'left';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("Label");
|
||||||
|
$titlelist["sortfield"] = 'p.label';
|
||||||
|
$titlelist["align"] = 'left';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("BarCode");
|
||||||
|
$titlelist["sortfield"] = 'p.barcode';
|
||||||
|
$titlelist["align"] = 'center';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("DateModification");
|
||||||
|
$titlelist["sortfield"] = 'p.tms';
|
||||||
|
$titlelist["align"] = 'center';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("SellingPrice");
|
||||||
|
$titlelist["sortfield"] = 'p.price';
|
||||||
|
$titlelist["align"] = 'right';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("Stock");
|
||||||
|
$titlelist["sortfield"] = '';
|
||||||
|
$titlelist["align"] = 'right';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
|
$titlelist["title"] = $langs->trans("Status");
|
||||||
|
$titlelist["sortfield"] = 'p.envente';
|
||||||
|
$titlelist["align"] = 'right';
|
||||||
|
array_push($this->list_title,$titlelist);
|
||||||
|
|
||||||
$this->list_datas = array();
|
$this->list_datas = array();
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -117,13 +154,12 @@ class ProductDefault extends Product
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
|
$titlelist = array();
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$datas["id"] = $obj->rowid;
|
$datas["id"] = $obj->rowid;
|
||||||
$datas["label"] = $obj->label;
|
|
||||||
$datas["barcode"] = $obj->barcode;
|
|
||||||
$datas["datem"] = dol_print_date($this->db->jdate($obj->datem),'day');
|
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
@ -131,15 +167,24 @@ class ProductDefault extends Product
|
|||||||
$this->type = $obj->fk_product_type;
|
$this->type = $obj->fk_product_type;
|
||||||
$datas["ref"] = $this->getNomUrl(1,'',24);
|
$datas["ref"] = $this->getNomUrl(1,'',24);
|
||||||
|
|
||||||
// Stock
|
// Label
|
||||||
$this->load_stock();
|
$datas["label"] = $obj->label;
|
||||||
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas["stock"] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
|
|
||||||
else $datas["stock"] = $this->stock_reel;
|
// Barcode
|
||||||
|
$datas["barcode"] = $obj->barcode;
|
||||||
|
|
||||||
|
// Date modification
|
||||||
|
$datas["datem"] = dol_print_date($this->db->jdate($obj->datem),'day');
|
||||||
|
|
||||||
// Selling price
|
// Selling price
|
||||||
if ($obj->price_base_type == 'TTC') $datas["sellingprice"] = price($obj->price_ttc).' '.$langs->trans("TTC");
|
if ($obj->price_base_type == 'TTC') $datas["sellingprice"] = price($obj->price_ttc).' '.$langs->trans("TTC");
|
||||||
else $datas["sellingprice"] = price($obj->price).' '.$langs->trans("HT");
|
else $datas["sellingprice"] = price($obj->price).' '.$langs->trans("HT");
|
||||||
|
|
||||||
|
// Stock
|
||||||
|
$this->load_stock();
|
||||||
|
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas["stock"] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
|
||||||
|
else $datas["stock"] = $this->stock_reel;
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
$datas["status"] = $this->LibStatut($obj->statut,5);
|
$datas["status"] = $this->LibStatut($obj->statut,5);
|
||||||
|
|
||||||
|
|||||||
@ -35,37 +35,24 @@
|
|||||||
<table class="liste" width="100%">
|
<table class="liste" width="100%">
|
||||||
<tr class="liste_titre">
|
<tr class="liste_titre">
|
||||||
|
|
||||||
<td class="liste_titre">{$langs->trans('Ref')}
|
{section name=mysec loop=$titlelist}
|
||||||
<a href="liste.php?sortfield=p.ref&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
{strip}
|
||||||
|
|
||||||
|
{if $titlelist[mysec].sortfield}
|
||||||
|
<td class="liste_titre" align="{$titlelist[mysec].align}">{$titlelist[mysec].title}
|
||||||
|
<a href="liste.php?sortfield={$titlelist[mysec].sortfield}&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
||||||
</a>
|
</a>
|
||||||
<a href="liste.php?sortfield=p.ref&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
<a href="liste.php?sortfield={$titlelist[mysec].sortfield}&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
{else}
|
||||||
|
<td class="liste_titre" align="{$titlelist[mysec].align}">{$titlelist[mysec].title}</td>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<td class="liste_titre">{$langs->trans('Label')}
|
{/strip}
|
||||||
<a href="liste.php?sortfield=p.label&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
{/section}
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
|
||||||
</a>
|
|
||||||
<a href="liste.php?sortfield=p.label&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td class="liste_titre">{$langs->trans('BarCode')}
|
|
||||||
<a href="liste.php?sortfield=p.barcode&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
|
||||||
</a>
|
|
||||||
<a href="liste.php?sortfield=p.barcode&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td class="liste_titre" align="center">{$langs->trans('DateModification')}</td>
|
|
||||||
<td class="liste_titre" align="right">{$langs->trans('SellingPrice')}</td>
|
|
||||||
<td class="liste_titre" align="right">{$langs->trans('Stock')}</td>
|
|
||||||
<td class="liste_titre" align="right">{$langs->trans('Status')}</td>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -224,6 +224,7 @@ if ($resql)
|
|||||||
|
|
||||||
if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php'))
|
if ($_GET["canvas"] <> '' && file_exists('canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php'))
|
||||||
{
|
{
|
||||||
|
$smarty->assign('titlelist', $object->list_title);
|
||||||
$smarty->assign('datas', $object->list_datas);
|
$smarty->assign('datas', $object->list_datas);
|
||||||
$smarty->assign('url_root', $dolibarr_main_url_root);
|
$smarty->assign('url_root', $dolibarr_main_url_root);
|
||||||
$smarty->assign('theme', $conf->theme);
|
$smarty->assign('theme', $conf->theme);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user