Enhancement in bookmark module

This commit is contained in:
Laurent Destailleur 2009-01-23 16:03:24 +00:00
parent 31fb99d450
commit 6254a6a217
10 changed files with 161 additions and 139 deletions

View File

@ -23,10 +23,10 @@
* \version $Id$ * \version $Id$
*/ */
function printBookmarksList ($aDb, $aLangs) function printBookmarksList ($aDb, $aLangs)
{ {
global $conf; global $conf;
$db = $aDb; $db = $aDb;
$langs = $aLangs; $langs = $aLangs;
@ -37,13 +37,22 @@ function printBookmarksList ($aDb, $aLangs)
$langs->load("bookmarks"); $langs->load("bookmarks");
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:''); $url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
$ret = ''; $ret = '';
// Menu bookmark // Menu bookmark
$ret.= '<div class="menu_titre"><a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/liste.php">'.$langs->trans('Bookm').'</a></div>'; $ret.= '<div class="menu_titre">';
$ret.= '<table class="nobordernopadding" width="100%"><tr class="no"><td>';
$ret.= '<a class="vmenu" href="'.DOL_URL_ROOT.'/bookmarks/liste.php">'.$langs->trans('Bookm').'</a>';
// $ret.='</div>';
// Menu New bookmark // Menu New bookmark
$ret.= '<div class="menu_contenu"><a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url).'">'; // $ret.= '<div class="menu_contenu">';
$ret.= $langs->trans('NewBookmark').'</a><br></div>'; $ret.= '</td><td align="right">';
$ret.= '<a class="vsmenu" href="'.DOL_URL_ROOT.'/bookmarks/fiche.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url).'">';
// $ret.= $langs->trans('NewBookmark');
$ret.=img_object($langs->trans('AddThisPageToBookmarks'),'bookmark');
$ret.= '</a>';
$ret.= '</td></tr></table>';
$ret.= '</div>';
// Menu with all bookmarks // Menu with all bookmarks
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
{ {
@ -54,12 +63,12 @@ function printBookmarksList ($aDb, $aLangs)
$ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' '; $ret.=' '.img_object($langs->trans("BookmarkThisPage"),'bookmark').' ';
$ret.= dolibarr_trunc($obj->title, 30).'</a><br></div>'; $ret.= dolibarr_trunc($obj->title, 30).'</a><br></div>';
} }
} else { } else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
$ret .= '<div class="menu_fin"></div>'; $ret .= '<div class="menu_fin"></div>';

View File

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/** /**
* \file htdocs/bookmarks/fiche.php * \file htdocs/bookmarks/fiche.php
* \brief Page affichage/creation des bookmarks * \brief Page affichage/creation des bookmarks
@ -41,15 +41,23 @@ $target=isset($_GET["target"])?$_GET["target"]:$_POST["target"];
*/ */
if ($action == 'add' || $action == 'addproduct') if ($action == 'add' || $action == 'addproduct')
{ {var_dump($_POST);
if ($_POST["cancel"])
{
$urlsource=isset($_GET["urlsource"])?$_GET["urlsource"]:(isset($url)?$url:DOL_URL_ROOT.'/bookmarks/liste.php');
header("Location: ".$urlsource);
exit;
}
$mesg=''; $mesg='';
$bookmark=new Bookmark($db); $bookmark=new Bookmark($db);
$bookmark->fk_user=$user->id; $bookmark->fk_user=$user->id;
$bookmark->title=$title; $bookmark->title=$title;
$bookmark->url=$url; $bookmark->url=$url;
$bookmark->target=$target; $bookmark->target=$target;
// TODO Remove because this test is now always false
if ($action == 'add' && $_GET["socid"]) // Link to third party card if ($action == 'add' && $_GET["socid"]) // Link to third party card
{ {
require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
@ -63,6 +71,7 @@ if ($action == 'add' || $action == 'addproduct')
$title=$bookmark->title; $title=$bookmark->title;
$url=$bookmark->url; $url=$bookmark->url;
} }
// TODO Remove because this test is now always false
if ($action == 'addproduct' && $_GET["id"]) // Link to product card if ($action == 'addproduct' && $_GET["id"]) // Link to product card
{ {
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
@ -76,14 +85,14 @@ if ($action == 'add' || $action == 'addproduct')
$title=$bookmark->title; $title=$bookmark->title;
$url=$bookmark->url; $url=$bookmark->url;
} }
if (! $title) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle")); if (! $title) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
if (! $url) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink")); if (! $url) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));
if (! $mesg) if (! $mesg)
{ {
$bookmark->favicon='none'; $bookmark->favicon='none';
$res=$bookmark->create(); $res=$bookmark->create();
if ($res > 0) if ($res > 0)
{ {
@ -121,7 +130,7 @@ if ($_GET["action"] == 'delete')
$bookmark->target=$user->id; $bookmark->target=$user->id;
$bookmark->title='xxx'; $bookmark->title='xxx';
$bookmark->favicon='xxx'; $bookmark->favicon='xxx';
$res=$bookmark->remove(); $res=$bookmark->remove();
if ($res > 0) if ($res > 0)
{ {
@ -165,9 +174,14 @@ if ($action == 'create')
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow")); $liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
$html->select_array('target',$liste,1); $html->select_array('target',$liste,1);
print '</td><td>'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</td></tr>'; print '</td><td>'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</td></tr>';
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("CreateBookmark").'"></td></tr>';
print '<tr><td colspan="3" align="center">';
print '<input type="submit" class="button" value="'.$langs->trans("CreateBookmark").'" name="create"> &nbsp; ';
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
print '</td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
@ -179,7 +193,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
*/ */
$bookmark=new Bookmark($db); $bookmark=new Bookmark($db);
$bookmark->fetch($_GET["id"]); $bookmark->fetch($_GET["id"]);
dolibarr_fiche_head($head, $hselected, $langs->trans("Bookmark")); dolibarr_fiche_head($head, $hselected, $langs->trans("Bookmark"));
@ -195,7 +209,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
print '</table>'; print '</table>';
print "</div>\n"; print "</div>\n";
print "<div class=\"tabsAction\">\n"; print "<div class=\"tabsAction\">\n";
// Supprimer // Supprimer

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,11 +19,11 @@
*/ */
/** /**
\file htdocs/fourn/index.php \file htdocs/fourn/index.php
\ingroup fournisseur \ingroup fournisseur
\brief Page accueil de la zone fournisseurs \brief Page accueil de la zone fournisseurs
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.commande.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.commande.class.php');
@ -40,8 +40,8 @@ $result = restrictedArea($user, 'societe',$socid,'');
/* /*
* Affichage page * Affichage page
*/ */
$commandestatic=new CommandeFournisseur($db); $commandestatic=new CommandeFournisseur($db);
$facturestatic=new FactureFournisseur($db); $facturestatic=new FactureFournisseur($db);
@ -55,34 +55,6 @@ print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
* Liste des categories
*/
$companystatic->LoadSupplierCateg();
if (sizeof($companystatic->SupplierCategories))
{
print '<table class="liste" width="100%">';
print '<tr class="liste_titre"><td colspan="2">';
print $langs->trans("Category");
print "</td></tr>\n";
$var=True;
foreach ($companystatic->SupplierCategories as $rowid => $label)
{
$var=!$var;
print "<tr $bc[$var]>\n";
print '<td><a href="liste.php?cat='.$rowid.'">'.stripslashes($label).'</a>';
print '</td><td align="right">';
print '<a href="stats.php?cat='.$rowid.'">('.$langs->trans("Stats").')</a>';
print "</tr>\n";
}
print "</table>\n";
print "<br>\n";
}
/* /*
* *
*/ */
@ -121,9 +93,9 @@ if ($resql)
print "<br>\n"; print "<br>\n";
$db->free($resql); $db->free($resql);
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
@ -132,56 +104,56 @@ else
*/ */
if ($conf->fournisseur->enabled) if ($conf->fournisseur->enabled)
{ {
$langs->load("orders"); $langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.nom, s.rowid as socid"; $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.= " 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"; $sql.= " WHERE c.fk_soc = s.rowid AND c.fk_statut = 0";
if ($socid) if ($socid)
{ {
$sql .= " AND c.fk_soc = ".$socid; $sql .= " AND c.fk_soc = ".$socid;
} }
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$total = 0; $total = 0;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num) if ($num)
{ {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("DraftOrders").'</td></tr>'; print '<td colspan="3">'.$langs->trans("DraftOrders").'</td></tr>';
$i = 0; $i = 0;
$var = true; $var = true;
while ($i < $num) while ($i < $num)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td nowrap="nowrap">'; print '<tr '.$bc[$var].'><td nowrap="nowrap">';
$commandestatic->id=$obj->rowid; $commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref; $commandestatic->ref=$obj->ref;
print $commandestatic->getNomUrl(1,'',16); print $commandestatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->nom=$obj->nom; $companystatic->nom=$obj->nom;
$companystatic->client=0; $companystatic->client=0;
print $companystatic->getNomUrl(1,'',16); print $companystatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>'; print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>';
$i++; $i++;
$total += $obj->total_ttc; $total += $obj->total_ttc;
} }
if ($total>0) if ($total>0)
{ {
$var=!$var; $var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
} }
print "</table>"; print "</table>";
print "<br>\n"; print "<br>\n";
} }
} }
} }
/** /**
@ -248,10 +220,6 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
} }
} }
/*
*
*
*/
print "</td>\n"; print "</td>\n";
print '<td valign="top" width="70%" class="notopnoleft">'; print '<td valign="top" width="70%" class="notopnoleft">';
@ -260,7 +228,7 @@ print '<td valign="top" width="70%" class="notopnoleft">';
* *
*/ */
$max=10; $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"; $sql.= " , code_fournisseur, code_compta_fournisseur";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; 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"; $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"; $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 (!$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; if ($socid) $sql .= " AND s.rowid = ".$socid;
$sql.= " ORDER BY s.datec DESC"; $sql.= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -281,7 +249,7 @@ if ($resql)
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("BoxTitleLastSuppliers",min($max,$num))."</td>\n"; print '<td colspan="2">'.$langs->trans("BoxTitleLastSuppliers",min($max,$num))."</td>\n";
print '<td align="right">'.$langs->trans("DateCreation")."</td>\n"; print '<td align="right">'.$langs->trans("DateModification")."</td>\n";
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
@ -294,18 +262,47 @@ if ($resql)
print '<td><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").'</a>'; print '<td><a href="fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").'</a>';
print "&nbsp;<a href=\"fiche.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n"; print "&nbsp;<a href=\"fiche.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n";
print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>'; print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>';
print '<td align="right">'.dolibarr_print_date($obj->datec,'day').'</td>'; print '<td align="right">'.dolibarr_print_date($obj->tms,'day').'</td>';
print "</tr>\n"; print "</tr>\n";
} }
print "</table>\n"; print "</table>\n";
$db->free($resql); $db->free($resql);
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
/*
* List of categories
*/
$companystatic->LoadSupplierCateg();
if (sizeof($companystatic->SupplierCategories))
{
print '<br>';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre"><td colspan="2">';
print $langs->trans("Category");
print "</td></tr>\n";
$var=True;
foreach ($companystatic->SupplierCategories as $rowid => $label)
{
$var=!$var;
print "<tr $bc[$var]>\n";
print '<td><a href="liste.php?cat='.$rowid.'">'.stripslashes($label).'</a>';
print '</td><td align="right">';
print '<a href="stats.php?cat='.$rowid.'">('.$langs->trans("Stats").')</a>';
print "</tr>\n";
}
print "</table>\n";
print "<br>\n";
}
print "</td></tr>\n"; print "</td></tr>\n";
print "</table>\n"; print "</table>\n";

View File

@ -62,12 +62,12 @@ class box_clients extends ModeleBoxes {
$langs->load("boxes"); $langs->load("boxes");
$this->max=$max; $this->max=$max;
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max));
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.datec as dc"; $sql = "SELECT s.nom, s.rowid as socid, s.tms";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -77,7 +77,7 @@ class box_clients extends ModeleBoxes {
{ {
$sql .= " AND s.rowid = $user->societe_id"; $sql .= " AND s.rowid = $user->societe_id";
} }
$sql .= " ORDER BY s.datec DESC "; $sql .= " ORDER BY s.tms DESC ";
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$result = $db->query($sql); $result = $db->query($sql);
@ -85,24 +85,24 @@ class box_clients extends ModeleBoxes {
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
//$customerstatic=new Client($db); //$customerstatic=new Client($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datec=$db->jdate($objp->dc); $datem=$objp->tms;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg, 'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->nom,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dolibarr_print_date($datec, "day")); 'text' => dolibarr_print_date($datem, "day"));
$i++; $i++;
} }

View File

@ -61,12 +61,12 @@ class box_fournisseurs extends ModeleBoxes {
$langs->load("boxes"); $langs->load("boxes");
$this->max=$max; $this->max=$max;
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max));
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.datec as dc"; $sql = "SELECT s.nom, s.rowid as socid, s.tms";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -76,21 +76,21 @@ class box_fournisseurs extends ModeleBoxes {
{ {
$sql .= " AND s.rowid = ".$user->societe_id; $sql .= " AND s.rowid = ".$user->societe_id;
} }
$sql .= " ORDER BY s.datec DESC "; $sql .= " ORDER BY s.tms DESC ";
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
//$supplierstatic=new Fournisseur($db); //$supplierstatic=new Fournisseur($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datec=$db->jdate($objp->dc); $datem=$objp->tms;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg, 'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
@ -98,9 +98,9 @@ class box_fournisseurs extends ModeleBoxes {
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->nom,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dolibarr_print_date($datec, "day")); 'text' => dolibarr_print_date($datem, "day"));
$i++; $i++;
} }

View File

@ -53,7 +53,7 @@ class box_prospect extends ModeleBoxes {
$this->db=$DB; $this->db=$DB;
$this->param=$param; $this->param=$param;
$this->boxlabel=$langs->trans("BoxLastProspects"); $this->boxlabel=$langs->trans("BoxLastProspects");
} }
@ -66,12 +66,12 @@ class box_prospect extends ModeleBoxes {
global $user, $langs, $db; global $user, $langs, $db;
$this->max=$max; $this->max=$max;
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastProspects",$max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProspects",$max));
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec as dc"; $sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.tms";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -81,7 +81,7 @@ class box_prospect extends ModeleBoxes {
{ {
$sql .= " AND s.rowid = ".$user->societe_id; $sql .= " AND s.rowid = ".$user->societe_id;
} }
$sql .= " ORDER BY s.datec DESC"; $sql .= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0); $sql .= $db->plimit($max, 0);
dolibarr_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG); dolibarr_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
@ -89,14 +89,14 @@ class box_prospect extends ModeleBoxes {
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$prospectstatic=new Prospect($db); $prospectstatic=new Prospect($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$datec=$db->jdate($objp->dc); $datem=$objp->tms;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg, 'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);
@ -104,16 +104,16 @@ class box_prospect extends ModeleBoxes {
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->nom,
'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dolibarr_print_date($datec, "day")); 'text' => dolibarr_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3))); 'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3)));
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects"));
} }
else else

View File

@ -1,4 +1,5 @@
# Dolibarr language file - en_US - marque pages # Dolibarr language file - en_US - marque pages
CHARSET=UTF-8 CHARSET=UTF-8
Bookm=Bookmarks Bookm=Bookmarks
NewBookmark=New bookmark NewBookmark=New bookmark
AddThisPageToBookmarks=Add this page to bookmarks

View File

@ -1,4 +1,5 @@
# Dolibarr language file - fr_FR - marque pages # Dolibarr language file - fr_FR - marque pages
CHARSET=UTF-8 CHARSET=UTF-8
Bookm=Marque pages Bookm=Marque pages
NewBookmark=Nouveau marque page NewBookmark=Nouveau marque page
AddThisPageToBookmarks=Placer cette page dans les marques-pages

View File

@ -23,13 +23,13 @@ BoxTitleNbOfCustomers=Nombre de clients
BoxTitleLastRssInfos=Les %s dernières infos de %s BoxTitleLastRssInfos=Les %s dernières infos de %s
BoxTitleLastProducts=Les %s derniers produits/services enregistrés BoxTitleLastProducts=Les %s derniers produits/services enregistrés
BoxTitleLastCustomerOrders=Les %s dernières commandes clients modifiées BoxTitleLastCustomerOrders=Les %s dernières commandes clients modifiées
BoxTitleLastSuppliers=Les %s derniers fournisseurs enregistrés BoxTitleLastSuppliers=Les %s derniers fournisseurs modifiées
BoxTitleLastCustomers=Les %s derniers clients enregistrés BoxTitleLastCustomers=Les %s derniers clients modifiées
BoxTitleLastCustomersOrProspects=Les %s derniers clients ou prospects enregistrés BoxTitleLastCustomersOrProspects=Les %s derniers clients ou prospects enregistrés
BoxTitleLastPropals=Les %s dernières propositions enregistrés BoxTitleLastPropals=Les %s dernières propositions enregistrés
BoxTitleLastCustomerBills=Les %s dernières factures clients enregistrées BoxTitleLastCustomerBills=Les %s dernières factures clients enregistrées
BoxTitleLastSupplierBills=Les %s dernières factures fournisseurs enregistrées BoxTitleLastSupplierBills=Les %s dernières factures fournisseurs enregistrées
BoxTitleLastProspects=Les %s derniers prospects enregistrés BoxTitleLastProspects=Les %s derniers prospects modifiés
BoxTitleLastProductsInContract=Les %s derniers produits/services contractés BoxTitleLastProductsInContract=Les %s derniers produits/services contractés
BoxTitleOldestUnpayedCustomerBills=Les %s plus anciennes factures clients impayées BoxTitleOldestUnpayedCustomerBills=Les %s plus anciennes factures clients impayées
BoxTitleOldestUnpayedSupplierBills=Les %s plus anciennes factures fournisseurs impayées BoxTitleOldestUnpayedSupplierBills=Les %s plus anciennes factures fournisseurs impayées

View File

@ -629,7 +629,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
/* /*
* Fiche societe en mode edition * Fiche societe en mode edition
*/ */
print_titre($langs->trans("EditCompany")); print_fiche_titre($langs->trans("EditCompany"));
if ($socid) if ($socid)
{ {