From be5826057e8d0c43cca337a8b86eefd80b33e58a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Oct 2008 19:27:32 +0000 Subject: [PATCH] Fix: http://matelli.fr/showcases/patchs-dolibarr/fix-number-of-processing-orders.html --- htdocs/commande/index.php | 313 +++++++++++++++++++------------------- 1 file changed, 157 insertions(+), 156 deletions(-) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 7fa463e9599..064b338d9e7 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/commande/index.php - \ingroup commande - \brief Page acceuil espace commandes - \version $Id$ -*/ + \file htdocs/commande/index.php + \ingroup commande + \brief Page acceuil espace commandes + \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); @@ -35,10 +35,10 @@ $langs->load("orders"); // Sécurité accés client $socid=''; if ($_GET["socid"]) { $socid=$_GET["socid"]; } -if ($user->societe_id > 0) +if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } @@ -81,27 +81,27 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc if ( $db->query($sql) ) { - $langs->load("orders"); - $num = $db->num_rows(); - if ($num) - { - $i = 0; - print ''; - print ''; - print ''; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object(); - print ""; - print '"; - print ''; - $i++; - } - print "
'.$langs->trans("DraftOrders").'
'; - print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'

"; - } + $langs->load("orders"); + $num = $db->num_rows(); + if ($num) + { + $i = 0; + print ''; + print ''; + print ''; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object(); + print ""; + print '"; + print ''; + $i++; + } + print "
'.$langs->trans("DraftOrders").'
'; + print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'

"; + } } /* @@ -118,48 +118,48 @@ $sql .= " ORDER BY c.rowid DESC"; if ( $db->query($sql) ) { - print ''; - print ''; - print ''; + print '
'.$langs->trans("OrdersToProcess").'
'; + print ''; + print ''; - $num = $db->num_rows(); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object(); - print ""; - print '"; + print ''; - print ''; - $i++; - } - } + $commandestatic->id=$obj->rowid; + $commandestatic->ref=$obj->ref; - print "
'.$langs->trans("OrdersToProcess").'
'; - - $commandestatic->id=$obj->rowid; - $commandestatic->ref=$obj->ref; - - print ''; - print ''; - - print ''; - - print '
'; - print $commandestatic->getNomUrl(1); - print ''; - print ' '; - print ''; - $filename=sanitize_string($obj->ref); - $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); - print '
'; + $num = $db->num_rows(); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object(); + print "
'; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'

"; + print ''; + print ''; + + print ''; + + print '
'; + print $commandestatic->getNomUrl(1); + print ''; + print ' '; + print ''; + $filename=sanitize_string($obj->ref); + $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); + print '
'; + + print ''; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).''; + $i++; + } + } + + print "
"; } @@ -180,50 +180,51 @@ $sql .= " ORDER BY c.rowid DESC"; if ( $db->query($sql) ) { - print ''; - print ''; - print ''; + $num = $db->num_rows(); + + print '
'.$langs->trans("OnProcessOrders").' ('.$num.')
'; + print ''; + print ''; - $num = $db->num_rows(); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object(); - print ""; - print ''; - - print ''; - print ''; - print ''; - $i++; - } - } - print "
'.$langs->trans("OnProcessOrders").' ('.$num.')
'; - - $commandestatic->id=$obj->rowid; - $commandestatic->ref=$obj->ref; - - print ''; - print ''; - - print ''; - - print '
'; - print $commandestatic->getNomUrl(1); - print ''; - print ' '; - print ''; - $filename=sanitize_string($obj->ref); - $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); - print '
'; - - print '
'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'

"; + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object(); + print ""; + print ''; + + $commandestatic->id=$obj->rowid; + $commandestatic->ref=$obj->ref; + + print ''; + print ''; + + print ''; + + print '
'; + print $commandestatic->getNomUrl(1); + print ''; + print ' '; + print ''; + $filename=sanitize_string($obj->ref); + $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); + print '
'; + + print ''; + + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''; + print ''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).''; + print ''; + $i++; + } + } + print "
"; } /* @@ -245,52 +246,52 @@ $sql.= $db->plimit($max, 0); $resql=$db->query($sql); if ($resql) { - print ''; - print ''; - print ''; + print '
'.$langs->trans("LastClosedOrders",$max).'
'; + print ''; + print ''; - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - - print ""; - print ''; - - print ''; - print ''; - print ''; - print ''; - $i++; - } - } - print "
'.$langs->trans("LastClosedOrders",$max).'
'; - - $commandestatic->id=$obj->rowid; - $commandestatic->ref=$obj->ref; - - print ''; - print ''; - - print ''; - - print '
'; - print $commandestatic->getNomUrl(1); - print ''; - print ' '; - print ''; - $filename=sanitize_string($obj->ref); - $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); - print '
'; - - print '
'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''.dolibarr_print_date($obj->datec).''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'

"; + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + + print ""; + print ''; + + $commandestatic->id=$obj->rowid; + $commandestatic->ref=$obj->ref; + + print ''; + print ''; + + print ''; + + print '
'; + print $commandestatic->getNomUrl(1); + print ''; + print ' '; + print ''; + $filename=sanitize_string($obj->ref); + $filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1); + print '
'; + + print ''; + + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''; + print ''.dolibarr_print_date($obj->datec).''; + print ''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).''; + print ''; + $i++; + } + } + print "
"; }