From bc37c0ad55dc590636270024b67f9dbd47a719df Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 29 Jul 2002 10:26:12 +0000 Subject: [PATCH] . --- htdocs/comm/action/index.php3 | 4 +-- htdocs/comm/addpropal.php3 | 6 ++-- htdocs/comm/clients.php3 | 6 ++-- htdocs/comm/fiche.php3 | 6 ++-- htdocs/comm/pre.inc.php3 | 2 ++ htdocs/comm/projet/index.php3 | 56 +++++++++++++++-------------------- htdocs/comm/propal.php3 | 41 +++++++++++++------------ htdocs/compta/pre.inc.php3 | 2 +- htdocs/compta/propal.php3 | 6 ++-- htdocs/index.php3 | 4 +-- htdocs/lib/functions.inc.php3 | 4 +++ htdocs/main.inc.php3 | 38 ++++++++++++++++++------ htdocs/product/fiche.php3 | 2 +- htdocs/propal.class.php3 | 8 ----- htdocs/societe.class.php3 | 16 ++++------ htdocs/user.class.php3 | 5 +++- 16 files changed, 107 insertions(+), 99 deletions(-) diff --git a/htdocs/comm/action/index.php3 b/htdocs/comm/action/index.php3 index c883daa50ff..f7baee2412a 100644 --- a/htdocs/comm/action/index.php3 +++ b/htdocs/comm/action/index.php3 @@ -190,14 +190,14 @@ $sql .= " WHERE a.fk_soc = $socid AND c.id=a.fk_action AND a.fk_user_author = u. print ""; if ($oldyear == strftime("%Y",$obj->da) ) { - print '|'; + print ' '; } else { print "" .strftime("%Y",$obj->da)."\n"; $oldyear = strftime("%Y",$obj->da); } if ($oldmonth == strftime("%Y%b",$obj->da) ) { - print '|'; + print ' '; } else { print "" .strftime("%b",$obj->da)."\n"; $oldmonth = strftime("%Y%b",$obj->da); diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index 54369c68372..9b4f2f48bb0 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -132,7 +132,7 @@ if ($action == 'create') { $smonth = 1; $syear = date("Y", time()); print ''; - print ''; + print ''; print "'; @@ -218,7 +218,7 @@ if ($action == 'create') { } print ''; if ($numprojet==0) { - print '
Cette societe n\'a pas de projet.
'; + print 'Cette societe n\'a pas de projet.
'; print 'Créer un projet'; } print ''; diff --git a/htdocs/comm/clients.php3 b/htdocs/comm/clients.php3 index da56fc38aef..7cbd0addc89 100644 --- a/htdocs/comm/clients.php3 +++ b/htdocs/comm/clients.php3 @@ -113,8 +113,8 @@ if ($action == 'stcomm') { } } if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; + +$offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -164,7 +164,7 @@ if ($mode == 'search') { $sortorder = "ASC"; } - $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); + $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $result = $db->query($sql); if ($result) { diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index 33749f6eb1a..91664cdef85 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -182,8 +182,8 @@ if ($socid > 0) { * Propales * */ - $var=!$var; - print "
Société'.$objsoc->nom.'
Société'.$objsoc->nom.'
Date"; $cday = date("d", time()); print "'; if ($numdest==0) { - print '
Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; + print 'Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; print 'Ajouter un contact'; } print '
"; + + print '
'; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; $sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " AND s.idp = $objsoc->idp ORDER BY p.datep DESC"; @@ -191,7 +191,7 @@ if ($socid > 0) { if ( $db->query($sql) ) { $num = $db->num_rows(); if ($num >0 ) { - print ""; + print ""; } $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; while ($i < $num && $i < 4) { diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index 63dc631093b..1028e9f2018 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -50,6 +50,8 @@ function llxHeader($head = "", $urlp = "") { $menu->add("projet/", "Projets"); + $menu->add("/comm/configuration/", "Configuration"); + left_menu($menu->liste); } diff --git a/htdocs/comm/projet/index.php3 b/htdocs/comm/projet/index.php3 index 51b9a75abfb..3dfbfb9a9d4 100644 --- a/htdocs/comm/projet/index.php3 +++ b/htdocs/comm/projet/index.php3 @@ -3,21 +3,36 @@ * * $Id$ * $Source$ + * + * 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. + * */ require("./pre.inc.php3"); require("./project.class.php3"); llxHeader("","../"); +print_titre("Projets"); print '
idp\">liste des propales ($num)
idp\">Liste des propales ($num)
'; -print ''; +print ''; + if($socidp) { print ''; } print '
Projets
[Nouveau projet]
'; - - $db = new Db(); /* * Traitements des actions @@ -33,8 +48,6 @@ if ($action == 'create') { $pro->create( $user->id); } - - /* * * Affichage @@ -47,16 +60,12 @@ if ($sortorder == "") { $sortorder="ASC"; } -$yn["t"] = "oui"; -$yn["f"] = "non"; - if ($page == -1) { $page = 0 ; } $limit = 26; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; - /* * * @@ -75,35 +84,18 @@ if ($socidp) { $sql .= " AND s.idp = $socidp"; } if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; + print '

'; - $oldstatut = -1; - $subtotal = 0; + print ""; + print ""; + print ""; + print "\n"; + while ($i < $num) { $objp = $db->fetch_object( $i); - if ($objp->statut <> $oldstatut ) { - $oldstatut = $objp->statut; - - if ($i > 0) { - print "\n"; - print "\n"; - } - $subtotal = 0; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - } - $var=!$var; print ""; - print "\n"; print "\n"; print "\n"; print "\n"; diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index af28a42fdb2..2efc346a968 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -36,21 +36,6 @@ llxHeader(); $db = new Db(); -if ($sortfield == "") { - $sortfield="lower(p.label)"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - -$yn["t"] = "oui"; -$yn["f"] = "non"; - -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; if ($action == 'setstatut') { /* @@ -116,10 +101,10 @@ if ($propalid) { print "
SocieteRéfTitre
Total : ".price($subtotal)."Euros HT
[Tous]SocieteRéfTitreDateStatut [statutid\">Filtre]
[idp\">Filtre]idp\">$objp->nomprojectid\">$objp->refprojectid\">$objp->title
"; - print ""; + print ''; print ""; - print ''; + print ''; if ($obj->fk_projet) { $projet = new Project(); @@ -441,6 +426,20 @@ if ($propalid) { * * */ + + if ($sortfield == "") { + $sortfield="p.fk_statut, datep "; + } + if ($sortorder == "") { + $sortorder="ASC"; + } + + if ($page == -1) { $page = 0 ; } + $limit = 26; + $offset = $limit * $page ; + $pageprev = $page - 1; + $pagenext = $page + 1; + print "
Sociétéidp\">$obj->nomidp\">Autres propales
Société'.$obj->nom.'Note :
". nl2br($obj->note)."
date'.strftime("%A %d %B %Y",$obj->dp).'
Date'.strftime("%A %d %B %Y",$obj->dp).'
"; print ""; print "
Propositions commerciales
"; @@ -463,7 +462,7 @@ if ($propalid) { $sql .= " AND date_format(p.datep, '%Y') = $year"; } - $sql .= " ORDER BY p.fk_statut, datep DESC"; + $sql .= " ORDER BY $sortfield ASC"; if ( $db->query($sql) ) { $num = $db->num_rows(); @@ -485,9 +484,9 @@ if ($propalid) { $subtotal = 0; print ''; - print "Réf"; - print "Société"; - print "Date"; + print "Réf"; + print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); + print "Date"; print "Prix"; print "Statut statutid\">"; print ''; diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index e633ddd1fdb..2e91d62d198 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -45,7 +45,7 @@ function llxHeader($head = "") { $menu->add_submenu("comp.php3","Comparatif"); $menu->add_submenu("casoc.php3","Par société"); - $menu->add_submenu("pointmort.php3","Point mort"); + // $menu->add_submenu("pointmort.php3","Point mort"); $menu->add("tva/index.php3","TVA"); diff --git a/htdocs/compta/propal.php3 b/htdocs/compta/propal.php3 index 9cd918fc157..b880d53d1b3 100644 --- a/htdocs/compta/propal.php3 +++ b/htdocs/compta/propal.php3 @@ -116,11 +116,11 @@ if ($propalid) { print ""; - print ""; + print ''; print ""; // - print ''; + print ''; if ($obj->fk_projet) { $projet = new Project(); @@ -221,7 +221,7 @@ if ($propalid) { print "\n"; print "\n"; print "\n"; - print "\n"; + print ''; print ""; $total = $total + $objp->amount; $i++; diff --git a/htdocs/index.php3 b/htdocs/index.php3 index 7acde7b825e..982ae37355c 100644 --- a/htdocs/index.php3 +++ b/htdocs/index.php3 @@ -24,7 +24,7 @@ require("./pre.inc.php3"); llxHeader(); ?>

Dolibarr

- ' . $user->prenom . ' ' . $user->nom .' ['.$user->code.']';?> + ' . $user->prenom . ' ' . $user->nom .' ['.$user->code.']';?>

@@ -35,7 +35,7 @@ llxHeader();
Sociétéidp\">$obj->nomidp\">Autres propales
'.translate("Company").''.$obj->nom.'Note :
". nl2br($obj->note)."
date'.strftime("%A %d %B %Y",$obj->dp).'
'.translate("Date").''.strftime("%A %d %B %Y",$obj->dp).'
".strftime("%d %B %Y",$objp->df)."$objp->author$objp->amount'.price($objp->amount).'
- Commercial + diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3 index 4961d07e388..382eaa0282c 100644 --- a/htdocs/lib/functions.inc.php3 +++ b/htdocs/lib/functions.inc.php3 @@ -20,6 +20,10 @@ * $Source$ * */ +//function translate($texte) { +// return $texte; +//} + function print_liste_field_titre($name, $file, $field, $begin="") { global $conf; diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index ef75533eb2f..e7907574eb7 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -27,29 +27,49 @@ require ($GLOBALS["DOCUMENT_ROOT"]."/product.class.php3"); require ($GLOBALS["DOCUMENT_ROOT"]."/user.class.php3"); require ($GLOBALS["DOCUMENT_ROOT"]."/menu.class.php3"); require ($GLOBALS["DOCUMENT_ROOT"]."/societe.class.php3"); - +require ($GLOBALS["DOCUMENT_ROOT"]."/rtplang.class.php"); $conf = new Conf(); - $db = new Db(); -$user = new User($db); -$user->fetch($GLOBALS["REMOTE_USER"]); -$db->close(); +$user = new User($db); + +$user->fetch($GLOBALS["REMOTE_USER"]); + +if ($user->limite_liste <> $conf->liste_limit) { + $conf->liste_limit = $user->limite_liste; +} + +$db->close(); +/* + */ +if(!isset($application_lang)) + $application_lang = "fr"; + +$rtplang = new rtplang("langs", "en", "en", $application_lang); +$rtplang->debug=1; +/* + */ $bc[0]="class=\"impair\""; $bc[1]="class=\"pair\""; $a = setlocale("LC_TIME", "FRENCH"); function top_menu($head) { - global $user, $conf; + global $user, $conf, $rtplang; + + print $rtplang->lang_header(); print ""; print $head; - print "\n"; + print ''; print ''; + print "\n"; print 'Dolibarr'; + print "\n"; + + print "\n"; print ''; @@ -160,9 +180,9 @@ function llxFooter($foot='') { * */ print "
\n"; - print "$foot
"; + print "

"; print '[Bug report] '; - print '[Source Code] '; + print '[Source Code] '.$foot.'
'; print ""; } diff --git a/htdocs/product/fiche.php3 b/htdocs/product/fiche.php3 index 1eccc0c2cfc..078bda8843b 100644 --- a/htdocs/product/fiche.php3 +++ b/htdocs/product/fiche.php3 @@ -101,7 +101,7 @@ if ($action == 'create') { print '"; - print ' '; + print ' '; print ''; print ''; } diff --git a/htdocs/propal.class.php3 b/htdocs/propal.class.php3 index 67e00daf1c6..c7a0e6879a4 100644 --- a/htdocs/propal.class.php3 +++ b/htdocs/propal.class.php3 @@ -210,13 +210,5 @@ class Propal { } } - - - - - - - } ?> - diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index 8bf2412ace4..97c575a8c44 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -18,12 +18,9 @@ * $Id$ * $Source$ * - * Classe Company - * */ class Societe { - var $bs; var $db; var $id; @@ -35,9 +32,7 @@ class Societe { var $fax; var $url; var $siren; - var $client; - var $note; Function Societe($DB, $id=0) { @@ -48,7 +43,11 @@ class Societe { return 1; } - + /* + * + * + * + */ Function create() { $sql = "INSERT INTO societe (nom, datec, datea, client) "; @@ -199,8 +198,5 @@ class Societe { } -/* - * $Id$ - * $Source$ - */ + ?> diff --git a/htdocs/user.class.php3 b/htdocs/user.class.php3 index 47fb884ba53..701bc9de180 100644 --- a/htdocs/user.class.php3 +++ b/htdocs/user.class.php3 @@ -21,7 +21,6 @@ */ class User { - var $bs; var $db; var $id; @@ -36,11 +35,15 @@ class User { var $compta; var $webcal_login; + var $limite_liste; + Function User($DB, $id=0) { $this->db = $DB; $this->id = $id; + $this->limite_liste = 20; + return 1; } /*