Look: Ajout picto sur statut entrepot
This commit is contained in:
parent
e0d479a2bb
commit
9a2c3419bd
@ -311,26 +311,64 @@ class Entrepot
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libellé du statut d'un entrepot (ouvert, fermé)
|
||||
* \return string Libellé
|
||||
*/
|
||||
function getLibStatut()
|
||||
{
|
||||
return $this->LibStatut($this->statut);
|
||||
}
|
||||
/**
|
||||
* \brief Retourne le libellé du statut d'un entrepot (ouvert, ferme)
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libellé d'un statut donné
|
||||
* \param statut id statut
|
||||
* \return string Libellé
|
||||
*/
|
||||
function LibStatut($statut)
|
||||
{
|
||||
return $this->statuts[$statut];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libellé d'un statut donné
|
||||
* \param statut Id statut
|
||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
||||
* \return string Libellé du statut
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load('stocks');
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
if ($statut == 0) return $langs->trans('Closed2');
|
||||
if ($statut == 1) return $langs->trans('Opened');
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return $langs->trans('Closed2');
|
||||
if ($statut == 1) return $langs->trans('Opened');
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2');
|
||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened');
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5');
|
||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2');
|
||||
if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened');
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
$prefix='Short';
|
||||
if ($statut == 0) return $langs->trans('Closed2').' '.img_picto($langs->trans('Closed2'),'statut5');
|
||||
if ($statut == 1) return $langs->trans('Opened').' '.img_picto($langs->trans('Opened'),'statut4');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||
|
||||
@ -144,13 +144,27 @@ if ($_GET["action"] == 'create')
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="40" value=""></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print '<textarea name="desc" rows="4" cols="60">';
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value=""></td></tr>';
|
||||
|
||||
print '<tr><td >'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.$entrepot->lieu.'"></td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
if ($conf->fckeditor->enabled)
|
||||
{
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc',$entrepot->description,200,'dolibarr_notes','In',false);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea name="desc" cols="70" rows="5">'.$entrepot->description.'</textarea>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">';
|
||||
print $entrepot->address;
|
||||
print '</textarea></td></tr>';
|
||||
@ -164,7 +178,9 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">';
|
||||
print '<select name="statut">';
|
||||
print '<option value="0" selected="true">'.$langs->trans("WarehouseClosed").'</option><option value="1">'.$langs->trans("WarehouseOpened").'</option>';
|
||||
print '<option value="0" selected="true">'.$langs->trans("WarehouseClosed").'</option>';
|
||||
print '<option value="1">'.$langs->trans("WarehouseOpened").'</option>';
|
||||
print '</select>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
||||
@ -208,11 +224,15 @@ else
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$entrepot->libelle.'</td>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($entrepot->description).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
@ -224,7 +244,7 @@ else
|
||||
print $entrepot->pays;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->statuts[$entrepot->statut].'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print $entrepot->nb_products();
|
||||
@ -358,21 +378,34 @@ else
|
||||
*/
|
||||
if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && 1)
|
||||
{
|
||||
print_fiche_titre('Edition de la fiche entrepot', $mesg);
|
||||
print_fiche_titre($langs->trans("WarehouseEdit"), $mesg);
|
||||
|
||||
print '<form action="fiche.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$entrepot->id.'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="40" value="'.$entrepot->libelle.'"></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print '<textarea name="desc" rows="4" cols="60">';
|
||||
print $entrepot->description;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value="'.$entrepot->libelle.'"></td></tr>';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.$entrepot->lieu.'"></td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
if ($conf->fckeditor->enabled)
|
||||
{
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc',$entrepot->description,200,'dolibarr_notes','In',false);
|
||||
$doleditor->Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<textarea name="desc" cols="70" rows="5">'.$entrepot->description.'</textarea>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">';
|
||||
print $entrepot->address;
|
||||
print '</textarea></td></tr>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -84,7 +84,7 @@ if ($result)
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?id=$objp->rowid\">".img_object($langs->trans("ShowStock"),"stock")." ".$objp->label."</a></td>\n";
|
||||
print '<td align="right">'.$entrepot->LibStatut($objp->statut).'</td>';
|
||||
print '<td align="right">'.$entrepot->LibStatut($objp->statut,3).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -67,42 +67,42 @@ $sql .= $db->plimit($limit + 1 ,$offset);
|
||||
$result = $db->query($sql) ;
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$i = 0;
|
||||
|
||||
llxHeader("","",$langs->trans("ListOfWarehouses"));
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste($langs->trans("ListOfWarehouses"), $page, "liste.php", "", $sortfield, $sortorder,'',$num);
|
||||
llxHeader("","",$langs->trans("ListOfWarehouses"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print_barre_liste($langs->trans("ListOfWarehouses"), $page, "liste.php", "", $sortfield, $sortorder,'',$num);
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php", "e.label","","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Status"),"liste.php", "e.statut","","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("LocationSummary"),"liste.php", "e.lieu","","","",$sortfield);
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num) {
|
||||
$entrepot=new Entrepot($db);
|
||||
|
||||
$var=True;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->ref.'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->label.'</a></td>';
|
||||
print '<td>'.$entrepot->LibStatut($objp->statut).'</td>';
|
||||
print '<td>'.$objp->lieu.'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print "</table>";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php", "e.label","","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("LocationSummary"),"liste.php", "e.lieu","","","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Status"),"liste.php", "e.statut",'','','align="right"',$sortfield);
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num) {
|
||||
$entrepot=new Entrepot($db);
|
||||
|
||||
$var=True;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="fiche.php?id='.$objp->ref.'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->label.'</a></td>';
|
||||
print '<td>'.$objp->lieu.'</td>';
|
||||
print '<td align="right">'.$entrepot->LibStatut($objp->statut,5).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user