diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index d67882d5251..358f2164be3 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -101,8 +101,7 @@ if ($result) print_liste_field_titre($langs->trans("Company"),"clients.php","s.nom","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),"clients.php","s.ville","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("CustomerCode"),"clients.php","s.code_client","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),"clients.php","datec","",$param,'align="center"',$sortfield,$sortorder); - print ' '; + print_liste_field_titre($langs->trans("DateCreation"),"clients.php","datec","",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; @@ -112,8 +111,8 @@ if ($result) print ''; print ''; print ''; - print ' '; - print ''; + print ''; + print ''; print "\n"; $var=True; @@ -130,19 +129,8 @@ if ($result) print ' '.stripslashes($obj->nom).''; print ''.$obj->ville.''; print ''.$obj->code_client.''; - print ''.dolibarr_print_date($obj->datec).''; - print ''; - if (defined("MAIN_MODULE_DOSSIER") && MAIN_MODULE_DOSSIER == 1) - { - print ''; - print img_folder(); - print ''; - } - else - { - print " "; - } - print "\n"; + print ''.dolibarr_print_date($obj->datec).''; + print "\n"; $i++; } //print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 001e7e0f54b..090ba11bd1a 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -18,16 +18,16 @@ */ /** - \file htdocs/compta/clients.php - \ingroup compta - \brief Page accueil des clients - \version $Id$ -*/ - + \file htdocs/compta/clients.php + \ingroup compta + \brief Page accueil des clients + \version $Id$ + */ + require_once("./pre.inc.php"); if (! $user->rights->societe->lire) - accessforbidden(); +accessforbidden(); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); @@ -49,22 +49,22 @@ $pagenext = $page + 1; llxHeader(); // Sécurité accés client -if ($user->societe_id > 0) +if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } if ($action == 'attribute_prefix') { - $societe = new Societe($db, $socid); - $societe->attribute_prefix($db, $socid); + $societe = new Societe($db, $socid); + $societe->attribute_prefix($db, $socid); } if ($action == 'note') { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$note."' WHERE rowid=".$socid; - $result = $db->query($sql); + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$note."' WHERE rowid=".$socid; + $result = $db->query($sql); } @@ -73,18 +73,18 @@ if ($action == 'note') * */ if ($mode == 'search') { - if ($mode-search == 'soc') { - $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; - $sql .= " WHERE lower(s.nom) like '%".addslashes(strtolower($socname))."%'"; - } - - if ( $db->query($sql) ) { - if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(); - $socid = $obj->rowid; - } - $db->free(); - } + if ($mode-search == 'soc') { + $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; + $sql .= " WHERE lower(s.nom) like '%".addslashes(strtolower($socname))."%'"; + } + + if ( $db->query($sql) ) { + if ( $db->num_rows() == 1) { + $obj = $db->fetch_object(); + $socid = $obj->rowid; + } + $db->free(); + } } @@ -104,39 +104,39 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc if (strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=$stcomm"; + $sql .= " AND s.fk_stcomm=$stcomm"; } if ($socname) { - $sql .= " AND s.nom like '%".addslashes(strtolower($socname))."%'"; - $sortfield = "s.nom"; - $sortorder = "ASC"; + $sql .= " AND s.nom like '%".addslashes(strtolower($socname))."%'"; + $sortfield = "s.nom"; + $sortorder = "ASC"; } if ($_GET["search_nom"]) { - $sql .= " AND s.nom like '%".addslashes(strtolower($_GET["search_nom"]))."%'"; + $sql .= " AND s.nom like '%".addslashes(strtolower($_GET["search_nom"]))."%'"; } if ($_GET["search_compta"]) { - $sql .= " AND s.code_compta like '%".addslashes($_GET["search_compta"])."%'"; + $sql .= " AND s.code_compta like '%".addslashes($_GET["search_compta"])."%'"; } if ($_GET["search_code_client"]) { - $sql .= " AND s.code_client like '%".addslashes($_GET["search_code_client"])."%'"; + $sql .= " AND s.code_client like '%".addslashes($_GET["search_code_client"])."%'"; } if (strlen($begin)) { - $sql .= " AND s.nom like '".addslashes($begin)."'"; + $sql .= " AND s.nom like '".addslashes($begin)."'"; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".$socid; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); @@ -144,91 +144,80 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $ $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); - $i = 0; - - if ($action == 'facturer') { - print_barre_liste("Liste des clients facturables", $page, "clients.php","",$sortfield,$sortorder,'',$num); - } - else { - print_barre_liste($langs->trans("ListOfCustomers"), $page, "clients.php","",$sortfield,$sortorder,'',$num); - } - - print ''; - print ''; + $num = $db->num_rows(); + $i = 0; - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","","",'valign="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="center"',$sortfield,$sortorder); - print ''; - print "\n"; - - // Lignes des champs de filtre - print ''; - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - print "\n"; - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object(); - - $var=!$var; - - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print '\n"; + + // Lignes des champs de filtre + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + print "\n"; + + $var=True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object(); + + $var=!$var; + + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $i++; + } + print "
 
'; - print ' '; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - print img_object($langs->trans("ShowCustomer"),"company"); - print ' '.$obj->nom.''.$obj->ville.' '.$obj->code_client.' '.$obj->code_compta.' '.dolibarr_print_date($obj->datec).''; - if (defined("MAIN_MODULE_DOSSIER") && MAIN_MODULE_DOSSIER == 1) - { - print ''; - print img_folder(); - print ''; + if ($action == 'facturer') { + print_barre_liste("Liste des clients facturables", $page, "clients.php","",$sortfield,$sortorder,'',$num); } - else - { - print " "; + else { + print_barre_liste($langs->trans("ListOfCustomers"), $page, "clients.php","",$sortfield,$sortorder,'',$num); } + print '
'; + + print ''; + print ''; - print "\n"; - $i++; - } - print "
"; - $db->free(); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","","",'valign="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder); + print "
'; + print ' '; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print img_object($langs->trans("ShowCustomer"),"company"); + print ' '.$obj->nom.''.$obj->ville.' '.$obj->code_client.' '.$obj->code_compta.' '.dolibarr_print_date($obj->datec).'
"; + + print ''; + + $db->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - 1.46 $'); ?> diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 28efe2727d9..71dc2eb56bc 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -355,7 +355,7 @@ if ($result) $i++; } - if ($num > $limit) print_barre_liste($titre ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords); + if ($num > $limit) print_barre_liste('' ,$page, "index.php", '&begin='.$begin.'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num,$nbtotalofrecords, ''); print ""; diff --git a/htdocs/dossier/client/fiche.php b/htdocs/dossier/client/fiche.php deleted file mode 100644 index 4f16c62f58b..00000000000 --- a/htdocs/dossier/client/fiche.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Copyright (C) 2004-2008 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * 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/dossier/client/fiche.php - * \brief Page des dossiers clients - * \version $Id$ - * \TODO Remove dossier directory and link to it on code where a test - * is made on MAIN_MODULE_DOSSIER. - */ - -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT.'/client.class.php'); - -if (!$user->rights->facture->lire) - accessforbidden(); - - -$facs = array(); -$client = new client($db, $_GET["id"]); -$client->fetch($_GET["id"]); -$client->read_factures(); -$facs = $client->factures; - -llxHeader("",'Dossier', $client); - - -/* - * Sécurité accés client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -if ($_GET["facid"]) -{ - require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); - - $fac = new Facture($db); - $fac->fetch($_GET["facid"]); - - $file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf"; - $file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png"; - - // Si image n'existe pas, on la genere - if (! file_exists($file_img)) - { - $converttool=""; - if (file_exists("/usr/bin/convert")) $converttool="/usr/bin/convert"; - elseif (file_exists("/usr/local/bin/convert")) $converttool="/usr/local/bin/convert"; - if ($converttool) { - // Si convert est dispo - //print "x $file_img $converttool $file $file_img x"; - exec("$converttool $file $file_img"); - } - } - - if (file_exists($file_img)) - { - // image.php has been deleted because was a serious security hole - // All image output must be throw wrapper viewimage.php - print '
'; - } - -} - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/dossier/client/pre.inc.php b/htdocs/dossier/client/pre.inc.php deleted file mode 100644 index 22983d34ae1..00000000000 --- a/htdocs/dossier/client/pre.inc.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ -require("../../main.inc.php"); - - -function llxHeader($head = "", $title="", $soc="") { - global $user, $conf, $langs; - $langs->load("bills"); - - /* - * - * - */ - top_menu($head, $title); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/comm/fiche.php?socid=".$soc->id, $soc->nom); - - $menu->add(DOL_URL_ROOT."/dossier/client/fiche.php?id=".$soc->id, $langs->trans("Bills")); - - if ($soc) { - foreach($soc->factures as $key=>$value) - { - $menu->add_submenu(DOL_URL_ROOT."/dossier/client/fiche.php?id=".$soc->id."&facid=".$value[0], $value[1]); - } - } - - left_menu($menu->liste); -} - -?>