From 7dec4f49595c7c3221ae1e0abc02ced471178568 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 20 Jun 2003 14:29:44 +0000 Subject: [PATCH] pre release --- htdocs/comm/addpropal.php3 | 184 ++++++++++++-------------- htdocs/comm/contact.php3 | 2 +- htdocs/comm/people.php3 | 23 +++- htdocs/comm/projet/fiche.php3 | 115 ++++++++++------ htdocs/comm/projet/project.class.php3 | 6 +- 5 files changed, 175 insertions(+), 155 deletions(-) diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index 37a4ca26d90..81ca8e6a533 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -49,71 +49,39 @@ print_titre("Nouvelle proposition commerciale"); * Creation d'une nouvelle propale * */ -if ($action == 'create') { - if ( $objsoc->prefix_comm ) { +if ($action == 'create') +{ + if ( $objsoc->prefix_comm ) + { - $numpr = "PR-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time()); + $numpr = "PR-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time()); - $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; + $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; - if ( $db->query($sql) ) { - $num = $db->result(0, 0); - $db->free(); - if ($num > 0) { - $numpr .= "." . ($num + 1); - } - } + if ( $db->query($sql) ) + { + $num = $db->result(0, 0); + $db->free(); + if ($num > 0) + { + $numpr .= "." . ($num + 1); + } + } print "
"; print ""; - print '
'; + print ''; - $strmonth[1] = "Janvier"; - $strmonth[2] = "Février"; - $strmonth[3] = "Mars"; - $strmonth[4] = "Avril"; - $strmonth[5] = "Mai"; - $strmonth[6] = "Juin"; - $strmonth[7] = "Juillet"; - $strmonth[8] = "Août"; - $strmonth[9] = "Septembre"; - $strmonth[10] = "Octobre"; - $strmonth[11] = "Novembre"; - $strmonth[12] = "Décembre"; - - $smonth = 1; - $syear = date("Y", time()); - print '
'; - print ''; + print ''; + + print '"; + print_date_select(); + print ""; print ''; print "\n"; @@ -125,27 +93,34 @@ if ($action == 'create') { print "'; /* * @@ -176,31 +151,39 @@ if ($action == 'create') { } print ''; - print "
Société'.$objsoc->nom.'
Société'.$objsoc->nom.''; + print "Commentaires :
"; + print ''; + print "
Date"; - $cday = date("d", time()); - print ""; - $cmonth = date("n", time()); - print ""; - - print "
Auteur'.$user->fullname.'
Num
Contact'; - if ($numdest==0) { - print 'Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; - print 'Ajouter un contact'; - } + + if ($numdest==0) + { + print 'Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; + print 'Ajouter un contact'; + } print '
"; + print "
"; + /* * * Liste des elements * */ $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p ORDER BY p.ref"; - if ( $db->query($sql) ) { - $opt = ""; - if ($result) { - $num = $db->num_rows(); $i = 0; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $opt .= "\n"; - $i++; - } + if ( $db->query($sql) ) + { + $opt = ""; + if ($result) + { + $num = $db->num_rows(); $i = 0; + while ($i < $num) + { + $objp = $db->fetch_object( $i); + $opt .= "\n"; + $i++; + } + } + $db->free(); } - $db->free(); - } else { - print $db->error(); - } + else + { + print $db->error(); + } + + print_titre("Services/Produits"); + print ""; - print "\n"; print ""; print "\n"; @@ -214,25 +197,22 @@ if ($action == 'create') { print "\n"; print "\n"; + print "
Service/Produits
Remise :
"; /* * Si il n'y a pas de contact pour la societe on ne permet pas la creation de propale */ - if ($numdest > 0) { - print ""; - } - print ""; - print "Commentaires :
"; - print ""; - - print ""; - + if ($numdest > 0) + { + print ""; + } print "
"; - print "
"; - } else { - print "Vous devez d'abord associer un prefixe commercial a cette societe" ; } + else + { + print "Vous devez d'abord associer un prefixe commercial a cette societe" ; + } } /* diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 index 3d8b72e1bb9..2dedf6a951d 100644 --- a/htdocs/comm/contact.php3 +++ b/htdocs/comm/contact.php3 @@ -119,7 +119,7 @@ if ($result) print ""; - print "$obj->name"; + print ''.$obj->name.''; print "$obj->firstname"; print 'filtrer '; diff --git a/htdocs/comm/people.php3 b/htdocs/comm/people.php3 index b77a260844a..6213b355b94 100644 --- a/htdocs/comm/people.php3 +++ b/htdocs/comm/people.php3 @@ -69,13 +69,12 @@ if ($action == 'update') } } -llxHeader(); +/* + * + * + */ -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; +llxHeader(); if ($socid > 0) { @@ -220,13 +219,23 @@ if ($socid > 0) * * */ + if (defined("MAIN_MODULE_FICHEINTER") && MAIN_MODULE_FICHEINTER) + { + print "

"; + print_titre("Fiche d'intervention"); + } + /* + * + * + */ + print '

'; print ""; print ""; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u "; $sql .= " WHERE a.fk_soc = $objsoc->idp "; $sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND c.id=a.fk_action "; diff --git a/htdocs/comm/projet/fiche.php3 b/htdocs/comm/projet/fiche.php3 index a7319d500fb..7805f787e4e 100644 --- a/htdocs/comm/projet/fiche.php3 +++ b/htdocs/comm/projet/fiche.php3 @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2003 Rodolphe Quiedeville * * $Id$ * $Source$ @@ -28,7 +28,8 @@ llxHeader("","../"); $db = new Db(); -if ($action == 'create') { +if ($action == 'create') +{ print_titre("Nouveau projet"); print '
'; @@ -66,53 +67,81 @@ if ($action == 'create') { $projet = new Project($db); $projet->fetch($id); - print '
ActionFaxEmail
'; - print ''; + $projet->societe->fetch($projet->societe->id); - print ''; - print ''; - print '
Société
Ref'.$projet->ref.'
Titre'.$projet->title.'
'; - $propales = $projet->get_propal_list(); - - if (sizeof($propales)>0 && is_array($propales)) { - - print '

Listes des propales associées au projet'; - print ''; - - print ""; - print ""; - print ''; - print ''; - print ''; - print ''; - - for ($i = 0; $ifetch($propales[$i]); - - $var=!$var; - print ""; - print "\n"; - - print ''; + if ($action == 'edit') + { + + print '
RéfDatePrixStatut
id\">$propale->ref'.strftime("%d %B %Y",$propale->datep).'
'; + print ''; - print ''; - print ''; - print ''; - - $total = $total + $propale->price; + print ''; + print ''; + print '
Société'.$projet->societe->nom.'
'.price($propale->price).'statut
Ref'.$projet->ref.'
Titre'.$projet->title.'
'; + + } + else + { + print ''; + print ''; + + print ''; + print ''; + print '
Société'.$projet->societe->nom.'
Ref'.$projet->ref.'
Titre'.$projet->title.'
'; + + $propales = $projet->get_propal_list(); + + if (sizeof($propales)>0 && is_array($propales)) { + + print '

Listes des propales associées au projet'; + print ''; + + print ""; + print ""; + print ''; + print ''; + print ''; + print ''; + + for ($i = 0; $ifetch($propales[$i]); + + $var=!$var; + print ""; + print "\n"; + + print ''; + + print ''; + print ''; + print ''; + + $total = $total + $propale->price; + } + + print ''; + print ''; + print ''; + print "
RéfDatePrixStatut
id\">$propale->ref'.strftime("%d %B %Y",$propale->datep).''.price($propale->price).'statut
'.$i.' propalesTotal : '.price($total).'Euros HT
"; + } else { + print "pas de propales"; + } } - print ''.$i.' propales'; - print 'Total : '.price($total).''; - print 'Euros HT'; - print ""; - - } else { - print "pas de propales"; - } + print "

"; + + print ""; + + print ""; + + print ""; + + print ""; + + print "
Editer---
"; } diff --git a/htdocs/comm/projet/project.class.php3 b/htdocs/comm/projet/project.class.php3 index 2c84f8b3c1b..fb0f38e9528 100644 --- a/htdocs/comm/projet/project.class.php3 +++ b/htdocs/comm/projet/project.class.php3 @@ -27,9 +27,11 @@ class Project { var $ref; var $title; var $socidp; + var $societe; Function Project($DB) { $this->db = $DB; + $this->societe = new Societe($DB); } /* * @@ -58,7 +60,7 @@ class Project { Function fetch($rowid) { - $sql = "SELECT title, ref FROM llx_projet WHERE rowid=$rowid;"; + $sql = "SELECT fk_soc, title, ref FROM llx_projet WHERE rowid=$rowid;"; if ($this->db->query($sql) ) { if ($this->db->num_rows()) { @@ -67,7 +69,7 @@ class Project { $this->id = $rowid; $this->ref = $obj->ref; $this->title = $obj->title; - + $this->societe->id = $obj->fk_soc; $this->db->free(); } } else {