diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index d4bf707d0dd..533f44663b2 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -23,10 +23,10 @@ * \version $Id$ */ -function printBookmarksList ($aDb, $aLangs) +function printBookmarksList ($aDb, $aLangs) { global $conf; - + $db = $aDb; $langs = $aLangs; @@ -37,13 +37,22 @@ function printBookmarksList ($aDb, $aLangs) $langs->load("bookmarks"); $url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:''); - + $ret = ''; // Menu bookmark - $ret.= '
'; + $ret.= ''; // Menu with all bookmarks if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) { @@ -54,12 +63,12 @@ function printBookmarksList ($aDb, $aLangs) $ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' '; $ret.= dolibarr_trunc($obj->title, 30).'';
-/*
- * Liste des categories
- */
-$companystatic->LoadSupplierCateg();
-
-if (sizeof($companystatic->SupplierCategories))
-{
- print '
\n"; -} - - - /* * */ @@ -121,9 +93,9 @@ if ($resql) print " \n"; $db->free($resql); } -else +else { - dolibarr_print_error($db); + dolibarr_print_error($db); } @@ -132,56 +104,56 @@ else */ if ($conf->fournisseur->enabled) { - $langs->load("orders"); - $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.nom, s.rowid as socid"; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE c.fk_soc = s.rowid AND c.fk_statut = 0"; - if ($socid) - { - $sql .= " AND c.fk_soc = ".$socid; - } + $langs->load("orders"); + $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.nom, s.rowid as socid"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s"; + $sql.= " WHERE c.fk_soc = s.rowid AND c.fk_statut = 0"; + if ($socid) + { + $sql .= " AND c.fk_soc = ".$socid; + } - $resql = $db->query($sql); - if ($resql) - { - $total = 0; - $num = $db->num_rows($resql); - if ($num) - { - print '
'.price($obj->total_ttc).' | ';
+ $i++;
+ $total += $obj->total_ttc;
+ }
+ if ($total>0)
+ {
+ $var=!$var;
+ print ''.$langs->trans("Total").' | '.price($total)." | \n"; - } - } + } + } } /** @@ -248,10 +220,6 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) } } -/* - * - * - */ print " | \n";
print ''; @@ -260,7 +228,7 @@ print ' | ';
*
*/
$max=10;
-$sql = "SELECT s.rowid as socid, s.nom, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm";
+$sql = "SELECT s.rowid as socid, s.nom, s.ville, s.datec, s.datea, s.tms, st.libelle as stcomm, s.prefix_comm";
$sql.= " , code_fournisseur, code_compta_fournisseur";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
@@ -268,7 +236,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFI
$sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur=1";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;
-$sql.= " ORDER BY s.datec DESC";
+$sql.= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
@@ -281,7 +249,7 @@ if ($resql)
print '
'; + + print '
\n"; +} + print " | |||||||||||||||||||||||||||||||