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).'
'; } - + } else { - + dolibarr_print_error($db); } - } + } $ret .= ''; diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php index cba62ef7f86..86dd94c44dd 100644 --- a/htdocs/bookmarks/fiche.php +++ b/htdocs/bookmarks/fiche.php @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /** * \file htdocs/bookmarks/fiche.php * \brief Page affichage/creation des bookmarks @@ -41,15 +41,23 @@ $target=isset($_GET["target"])?$_GET["target"]:$_POST["target"]; */ 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=''; - + $bookmark=new Bookmark($db); $bookmark->fk_user=$user->id; $bookmark->title=$title; $bookmark->url=$url; $bookmark->target=$target; - + + // TODO Remove because this test is now always false if ($action == 'add' && $_GET["socid"]) // Link to third party card { require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); @@ -63,6 +71,7 @@ if ($action == 'add' || $action == 'addproduct') $title=$bookmark->title; $url=$bookmark->url; } + // TODO Remove because this test is now always false if ($action == 'addproduct' && $_GET["id"]) // Link to product card { require_once(DOL_DOCUMENT_ROOT."/product.class.php"); @@ -76,14 +85,14 @@ if ($action == 'add' || $action == 'addproduct') $title=$bookmark->title; $url=$bookmark->url; } - + if (! $title) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle")); if (! $url) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink")); if (! $mesg) { $bookmark->favicon='none'; - + $res=$bookmark->create(); if ($res > 0) { @@ -121,7 +130,7 @@ if ($_GET["action"] == 'delete') $bookmark->target=$user->id; $bookmark->title='xxx'; $bookmark->favicon='xxx'; - + $res=$bookmark->remove(); if ($res > 0) { @@ -165,9 +174,14 @@ if ($action == 'create') $liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow")); $html->select_array('target',$liste,1); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").''; - print ''; + + print ''; + print '   '; + print ''; + print ''; + print ''; - + print ''; } @@ -179,7 +193,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"])) */ $bookmark=new Bookmark($db); $bookmark->fetch($_GET["id"]); - + dolibarr_fiche_head($head, $hselected, $langs->trans("Bookmark")); @@ -195,7 +209,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"])) print ''; print "\n"; - + print "
\n"; // Supprimer diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 1a659185dba..9fe58c6480a 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2008 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ */ /** - \file htdocs/fourn/index.php - \ingroup fournisseur - \brief Page accueil de la zone fournisseurs - \version $Id$ -*/ + \file htdocs/fourn/index.php + \ingroup fournisseur + \brief Page accueil de la zone fournisseurs + \version $Id$ + */ require("./pre.inc.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); $facturestatic=new FactureFournisseur($db); @@ -55,34 +55,6 @@ print ''; print ''; + $i++; + $total += $obj->total_ttc; + } + if ($total>0) + { + $var=!$var; + print '"; + } + print "
'; -/* - * Liste des categories - */ -$companystatic->LoadSupplierCateg(); - -if (sizeof($companystatic->SupplierCategories)) -{ - print ''; - print '\n"; - $var=True; - - foreach ($companystatic->SupplierCategories as $rowid => $label) - { - $var=!$var; - print "\n"; - print '\n"; - } - print "
'; - print $langs->trans("Category"); - print "
'.stripslashes($label).''; - print ''; - print '('.$langs->trans("Stats").')'; - print "
\n"; - 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 ''; - print ''; - print ''; + $resql = $db->query($sql); + if ($resql) + { + $total = 0; + $num = $db->num_rows($resql); + if ($num) + { + print '
'.$langs->trans("DraftOrders").'
'; + print ''; + print ''; - $i = 0; - $var = true; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print ''; - print ''; - print ''; - $i++; - $total += $obj->total_ttc; - } - if ($total>0) - { - $var=!$var; - print '"; - } - print "
'.$langs->trans("DraftOrders").'
'; + $i = 0; + $var = true; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print '
'; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; print $commandestatic->getNomUrl(1,'',16); print ''; + print ''; $companystatic->id=$obj->socid; $companystatic->nom=$obj->nom; $companystatic->client=0; print $companystatic->getNomUrl(1,'',16); print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."
"; + print '
'.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($total)."
"; print "
\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 ''; print '\n"; - print '\n"; + print '\n"; print "\n"; $var=True; @@ -294,18 +262,47 @@ if ($resql) print '\n"; print ''; - print ''; + print ''; print "\n"; } print "
'.$langs->trans("BoxTitleLastSuppliers",min($max,$num))."'.$langs->trans("DateCreation")."'.$langs->trans("DateModification")."
'.img_object($langs->trans("ShowSupplier"),"company").''; print " socid."\">".$obj->nom."'.$obj->code_fournisseur.' '.dolibarr_print_date($obj->datec,'day').''.dolibarr_print_date($obj->tms,'day').'
\n"; $db->free($resql); } -else +else { dolibarr_print_error($db); } + +/* + * List of categories + */ +$companystatic->LoadSupplierCateg(); + +if (sizeof($companystatic->SupplierCategories)) +{ + print '
'; + + print ''; + print '\n"; + $var=True; + + foreach ($companystatic->SupplierCategories as $rowid => $label) + { + $var=!$var; + print "\n"; + print '\n"; + } + print "
'; + print $langs->trans("Category"); + print "
'.stripslashes($label).''; + print ''; + print '('.$langs->trans("Stats").')'; + print "
\n"; + print "
\n"; +} + print "\n"; print "\n"; diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php index b98cd9cb285..91a2582fb4f 100644 --- a/htdocs/includes/boxes/box_clients.php +++ b/htdocs/includes/boxes/box_clients.php @@ -62,12 +62,12 @@ class box_clients extends ModeleBoxes { $langs->load("boxes"); $this->max=$max; - + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max)); 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"; $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"; @@ -77,7 +77,7 @@ class box_clients extends ModeleBoxes { { $sql .= " AND s.rowid = $user->societe_id"; } - $sql .= " ORDER BY s.datec DESC "; + $sql .= " ORDER BY s.tms DESC "; $sql .= $db->plimit($max, 0); $result = $db->query($sql); @@ -85,24 +85,24 @@ class box_clients extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $i = 0; //$customerstatic=new Client($db); while ($i < $num) { $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"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); $this->info_box_contents[$i][2] = array('td' => 'align="right"', - 'text' => dolibarr_print_date($datec, "day")); + 'text' => dolibarr_print_date($datem, "day")); $i++; } diff --git a/htdocs/includes/boxes/box_fournisseurs.php b/htdocs/includes/boxes/box_fournisseurs.php index a4b8416ea78..8d89992efae 100644 --- a/htdocs/includes/boxes/box_fournisseurs.php +++ b/htdocs/includes/boxes/box_fournisseurs.php @@ -61,12 +61,12 @@ class box_fournisseurs extends ModeleBoxes { $langs->load("boxes"); $this->max=$max; - + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max)); 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"; $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"; @@ -76,21 +76,21 @@ class box_fournisseurs extends ModeleBoxes { { $sql .= " AND s.rowid = ".$user->societe_id; } - $sql .= " ORDER BY s.datec DESC "; + $sql .= " ORDER BY s.tms DESC "; $sql .= $db->plimit($max, 0); - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - + $i = 0; //$supplierstatic=new Fournisseur($db); while ($i < $num) { $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"', 'logo' => $this->boximg, '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"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); - + $this->info_box_contents[$i][2] = array('td' => 'align="right"', - 'text' => dolibarr_print_date($datec, "day")); + 'text' => dolibarr_print_date($datem, "day")); $i++; } diff --git a/htdocs/includes/boxes/box_prospect.php b/htdocs/includes/boxes/box_prospect.php index 211f958783e..484fed226dc 100644 --- a/htdocs/includes/boxes/box_prospect.php +++ b/htdocs/includes/boxes/box_prospect.php @@ -53,7 +53,7 @@ class box_prospect extends ModeleBoxes { $this->db=$DB; $this->param=$param; - + $this->boxlabel=$langs->trans("BoxLastProspects"); } @@ -66,12 +66,12 @@ class box_prospect extends ModeleBoxes { global $user, $langs, $db; $this->max=$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"; $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"; @@ -81,7 +81,7 @@ class box_prospect extends ModeleBoxes { { $sql .= " AND s.rowid = ".$user->societe_id; } - $sql .= " ORDER BY s.datec DESC"; + $sql .= " ORDER BY s.tms DESC"; $sql .= $db->plimit($max, 0); dolibarr_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG); @@ -89,14 +89,14 @@ class box_prospect extends ModeleBoxes { if ($resql) { $num = $db->num_rows($resql); - + $i = 0; $prospectstatic=new Prospect($db); while ($i < $num) { $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"', 'logo' => $this->boximg, '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"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid); - + $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"', 'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3))); $i++; } - + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); } else diff --git a/htdocs/langs/en_US/bookmarks.lang b/htdocs/langs/en_US/bookmarks.lang index 9d82e083589..bc0d329a1a1 100644 --- a/htdocs/langs/en_US/bookmarks.lang +++ b/htdocs/langs/en_US/bookmarks.lang @@ -1,4 +1,5 @@ # Dolibarr language file - en_US - marque pages CHARSET=UTF-8 Bookm=Bookmarks -NewBookmark=New bookmark \ No newline at end of file +NewBookmark=New bookmark +AddThisPageToBookmarks=Add this page to bookmarks \ No newline at end of file diff --git a/htdocs/langs/fr_FR/bookmarks.lang b/htdocs/langs/fr_FR/bookmarks.lang index 2190b5754cc..ae7c57be840 100644 --- a/htdocs/langs/fr_FR/bookmarks.lang +++ b/htdocs/langs/fr_FR/bookmarks.lang @@ -1,4 +1,5 @@ # Dolibarr language file - fr_FR - marque pages CHARSET=UTF-8 Bookm=Marque pages -NewBookmark=Nouveau marque page \ No newline at end of file +NewBookmark=Nouveau marque page +AddThisPageToBookmarks=Placer cette page dans les marques-pages \ No newline at end of file diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index 72338b32a72..d3d0093da1a 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -23,13 +23,13 @@ BoxTitleNbOfCustomers=Nombre de clients BoxTitleLastRssInfos=Les %s dernières infos de %s BoxTitleLastProducts=Les %s derniers produits/services enregistrés BoxTitleLastCustomerOrders=Les %s dernières commandes clients modifiées -BoxTitleLastSuppliers=Les %s derniers fournisseurs enregistrés -BoxTitleLastCustomers=Les %s derniers clients enregistrés +BoxTitleLastSuppliers=Les %s derniers fournisseurs modifiées +BoxTitleLastCustomers=Les %s derniers clients modifiées BoxTitleLastCustomersOrProspects=Les %s derniers clients ou prospects enregistrés BoxTitleLastPropals=Les %s dernières propositions enregistrés BoxTitleLastCustomerBills=Les %s dernières factures clients 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 BoxTitleOldestUnpayedCustomerBills=Les %s plus anciennes factures clients impayées BoxTitleOldestUnpayedSupplierBills=Les %s plus anciennes factures fournisseurs impayées diff --git a/htdocs/soc.php b/htdocs/soc.php index 91a891befbd..0f305454db2 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -629,7 +629,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') /* * Fiche societe en mode edition */ - print_titre($langs->trans("EditCompany")); + print_fiche_titre($langs->trans("EditCompany")); if ($socid) {