Fix: Restore broken features in shipping module
This commit is contained in:
parent
e856b3dc61
commit
7d79116734
@ -2163,11 +2163,11 @@ class Commande extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie nom clicable (avec eventuellement le picto)
|
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||||
\param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
\param option Sur quoi pointe le lien: 0=fiche commande,3=fiche compta commande,4=fiche expedition commande
|
* \param option Sur quoi pointe le lien: 0=fiche commande,3=fiche compta commande,4=fiche expedition commande
|
||||||
\return string Chaine avec URL
|
* \return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option=0)
|
function getNomUrl($withpicto=0,$option=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@ -793,6 +793,31 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||||
|
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
|
* \return string Chaine avec URL
|
||||||
|
*/
|
||||||
|
function getNomUrl($withpicto=0)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$result='';
|
||||||
|
$urlOption='';
|
||||||
|
|
||||||
|
|
||||||
|
$lien = '<a href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$this->id.'">';
|
||||||
|
$lienfin='</a>';
|
||||||
|
|
||||||
|
$picto='sending';
|
||||||
|
$label=$langs->trans("ShowSending").': '.$this->ref;
|
||||||
|
|
||||||
|
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
|
||||||
|
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||||
|
$result.=$lien.$this->ref.$lienfin;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libelle du statut d'une expedition
|
* \brief Retourne le libelle du statut d'une expedition
|
||||||
* \return string Libelle
|
* \return string Libelle
|
||||||
|
|||||||
@ -21,12 +21,13 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/expedition/index.php
|
* \file htdocs/expedition/index.php
|
||||||
* \ingroup expedition
|
* \ingroup expedition
|
||||||
* \brief Page accueil du module expedition
|
* \brief Home page of shipping area.
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
require(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
|
require(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
@ -37,6 +38,7 @@ $langs->load("sendings");
|
|||||||
|
|
||||||
$orderstatic=new Commande($db);
|
$orderstatic=new Commande($db);
|
||||||
$companystatic=new Societe($db);
|
$companystatic=new Societe($db);
|
||||||
|
$shipment=new Expedition($db);
|
||||||
|
|
||||||
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
||||||
llxHeader('',$langs->trans("Sendings"),$helpurl);
|
llxHeader('',$langs->trans("Sendings"),$helpurl);
|
||||||
@ -92,9 +94,17 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print "<tr $bc[$var]><td nowrap=\"nowrap\"><a href=\"fiche.php?id=".$obj->rowid."\">".$obj->ref."</a></td>";
|
print "<tr ".$bc[$var]."><td nowrap=\"nowrap\">";
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
|
$shipment->id=$obj->rowid;
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$obj->commande_id.'">'.$obj->commande_ref.'</a></td></tr>';
|
$shipment->ref=$obj->ref;
|
||||||
|
print $shipment->getNomUrl(1);
|
||||||
|
print "</td>";
|
||||||
|
print '<td>';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a>';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($obj->commande_id) print '<a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$obj->commande_id.'">'.$obj->commande_ref.'</a>';
|
||||||
|
print '</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
|||||||
@ -51,11 +51,12 @@ $offset = $limit * $_GET["page"] ;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$companystatic=new Societe($db);
|
$companystatic=new Societe($db);
|
||||||
|
$shipment=new Expedition($db);
|
||||||
|
|
||||||
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
||||||
llxHeader('',$langs->trans('ListOfSendings'),$helpurl);
|
llxHeader('',$langs->trans('ListOfSendings'),$helpurl);
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.ref, e.date_expedition, e.fk_statut";
|
$sql = "SELECT e.rowid, e.ref, e.date_delivery, e.date_expedition, e.fk_statut";
|
||||||
$sql.= ", s.nom as socname, s.rowid as socid";
|
$sql.= ", s.nom as socname, s.rowid as socid";
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."expedition as e";
|
$sql.= " FROM (".MAIN_DB_PREFIX."expedition as e";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all
|
if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all
|
||||||
@ -98,10 +99,11 @@ if ($resql)
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","e.ref","",$param,'width="15%"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"),"liste.php","e.ref","",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom", "", $param,'width="25%" align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom", "", $param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Date"),"liste.php","e.date_expedition","",$param, 'width="25%" align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateDeliveryPlanned"),"liste.php","e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),"liste.php","e.fk_statut","",$param,'width="10%" align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateReceived"),"liste.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Status"),"liste.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
@ -111,8 +113,11 @@ if ($resql)
|
|||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td><a href=\"fiche.php?id=".$objp->rowid."\">".img_object($langs->trans("ShowSending"),"sending").'</a> ';
|
print "<td>";
|
||||||
print "<a href=\"fiche.php?id=".$objp->rowid."\">".$objp->ref."</a></td>\n";
|
$shipment->id=$objp->rowid;
|
||||||
|
$shipment->ref=$objp->ref;
|
||||||
|
print $shipment->getNomUrl(1);
|
||||||
|
print "</td>\n";
|
||||||
// Third party
|
// Third party
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->id=$objp->socid;
|
$companystatic->id=$objp->socid;
|
||||||
@ -120,14 +125,18 @@ if ($resql)
|
|||||||
$companystatic->nom=$objp->socname;
|
$companystatic->nom=$objp->socname;
|
||||||
print $companystatic->getNomUrl(1);
|
print $companystatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Date
|
// Date delivery planed
|
||||||
print "<td align=\"center\">";
|
print "<td align=\"center\">";
|
||||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
print dol_print_date($db->jdate($objp->date_delivery),"day");
|
||||||
/*$now = time();
|
/*$now = time();
|
||||||
if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 )
|
if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 )
|
||||||
{
|
{
|
||||||
}*/
|
}*/
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
// Date real
|
||||||
|
print "<td align=\"center\">";
|
||||||
|
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';
|
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user