diff --git a/htdocs/comm/projet/index.php3 b/htdocs/comm/projet/index.php3 index 33b35be24f1..c2b3270691e 100644 --- a/htdocs/comm/projet/index.php3 +++ b/htdocs/comm/projet/index.php3 @@ -25,12 +25,12 @@ $db = new Db(); */ if ($action == 'create') { - $pro = new Project(); + $pro = new Project($db); $pro->socidp = $socidp; $pro->ref = $ref; $pro->title = $title; - $pro->create($db, $user->id); + $pro->create( $user->id); } diff --git a/htdocs/comm/projet/project.class.php3 b/htdocs/comm/projet/project.class.php3 index ff8fe3fb8dd..2c84f8b3c1b 100644 --- a/htdocs/comm/projet/project.class.php3 +++ b/htdocs/comm/projet/project.class.php3 @@ -37,18 +37,19 @@ class Project { * */ - Function create($creatorid) { + Function create($creatorid) + { - $sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat) "; - $sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;"; + $sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat) "; + $sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;"; - if (!$this->db->query($sql) ) - { - print ''.$sql.'
'.$this->db->error(); - + if (!$this->db->query($sql) ) + { + print ''.$sql.'
'.$this->db->error(); + } - } + } /* * * diff --git a/htdocs/fichinter/fiche.php3 b/htdocs/fichinter/fiche.php3 index 5461887c5f2..35f80a68be2 100644 --- a/htdocs/fichinter/fiche.php3 +++ b/htdocs/fichinter/fiche.php3 @@ -35,8 +35,7 @@ if ($result) { } $db->free(); } -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; + llxHeader(); /* @@ -56,6 +55,9 @@ if ($action == 'add') { $fichinter->date = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear)); + $fichinter->socidp = $socidp; + $fichinter->duree = $duree; + $fichinter->projetidp = $projetidp; $fichinter->author = $user->id; @@ -65,6 +67,23 @@ if ($action == 'add') { $id = $fichinter->create(); } +if ($action == 'update') { + $fichinter = new Fichinter($db); + + $fichinter->date = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear)); + + $fichinter->socidp = $socidp; + $fichinter->duree = $duree; + + $fichinter->projetidp = $projetidp; + + $fichinter->author = $user->id; + $fichinter->note = $note; + + $fichinter->ref = $ref; + + $fichinter->update($id); +} /* * * Generation @@ -78,7 +97,7 @@ if ($action == 'generate') { $gljroot = "/home/www/dolibarr/dolibarr/htdocs"; - $command = 'export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"'; + $command = 'export LC_TIME=fr_FR ; export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"'; $command .= " ; ./tex-fichinter.pl --fichinter=".$id ; $command .= " --pdf --ps"; @@ -93,11 +112,16 @@ if ($action == 'generate') { } } /* + * * Mode creation * Creation d'une nouvelle propale * */ if ($action == 'create') { + + print_titre("Création d'une fiche d'intervention"); + + if ( $objsoc->prefix_comm ) { $numpr = "FI-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time()); @@ -130,6 +154,9 @@ if ($action == 'create') { $smonth = 1; $syear = date("Y", time()); print ''; + + print ""; + print "\n"; + print "\n"; /* * @@ -188,7 +216,7 @@ if ($action == 'create') { print ''; if ($numprojet==0) { print 'Cette société n\'a pas de projet. '; - print 'Créer un projet'; + print 'Créer un projet'; } print ''; @@ -209,6 +237,119 @@ if ($action == 'create') { print "Vous devez d'abord associer un prefixe commercial a cette societe" ; } } +/* + * + * Mode update + * Mise a jour de la fiche d'intervention + * + */ +if ($action == 'edit') { + + $fichinter = new Fichinter($db); + $fichinter->fetch($id); + + print_titre("Mettre à jour Fiche d'intervention"); + + + 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 '
Société".$objsoc->nom."
Date"; $cday = date("d", time()); print ""; print "
Numéro
Durée (en jours)
'; + print ""; + + print ""; + + print ''; + print ''; + + /* + * + * Projet associé + * + */ + print ''; + + + print ''; + print ''; + + print ''; + print "
Date"; + $cday = date("d", time()); + print ""; + $cmonth = date("n", time()); + print ""; + + print "
Numéro'.$fichinter->ref.'
Durée (en jours)
Projet'; + if ($numprojet==0) { + print 'Cette société n\'a pas de projet. '; + print 'Créer un projet'; + } + print '
Commentaires'; + print '
'; + print ""; + print '
"; + + print ""; + + print "
"; + +} + /* * Mode Fiche * Affichage de la fiche d'intervention @@ -221,28 +362,19 @@ if ($id) { $fichinter = new Fichinter($db); $fichinter->fetch($id); + print_titre("Fiche d'intervention"); + print ''; print ''; print ''; - + print ''; print ''; - - print ''; print "'; - if ($fichinter->statut == 0) { - - print ''; - - } - - print ''; - - print ''; print "
Date'.strftime("%A %d %B %Y",$fichinter->date).'
Numéro'.$fichinter->ref.'
Durée'.$fichinter->duree.'
Projet 
Commentaires"; print nl2br($fichinter->note); print '
ActionValider
ActionGénération du pdf
Documentsliste...'; $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf"; @@ -259,7 +391,35 @@ if ($id) { print '
"; - + + + print '
'; + + if ($fichinter->statut == 0) { + + + print ''; + print ''; + + print ''; + print ''; + + print ''; + + } else { + print ''; + print ''; + print ''; + print ''; + print ''; + } + + print '
Mettre à jour-Génération du pdf-Valider-----
'; + + + + + } /* @@ -276,11 +436,11 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; print "

"; - print ""; + print ""; print ""; - print ""; + print ""; print ""; - print ""; + print ""; print "\n"; $var=True; while ($i < $num) { @@ -288,9 +448,11 @@ if ( $db->query($sql) ) { $var=!$var; print ""; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; + + print ''; print "\n"; diff --git a/htdocs/fichinter/index.php3 b/htdocs/fichinter/index.php3 index ac21b5078e3..0e56224fae3 100644 --- a/htdocs/fichinter/index.php3 +++ b/htdocs/fichinter/index.php3 @@ -59,7 +59,7 @@ if ( $db->query($sql) ) { print "\n"; print "\n"; print "\n"; - + print ''; print "\n"; $i++; diff --git a/mysql/tables/llx_fichinter.sql b/mysql/tables/llx_fichinter.sql index 5982e2f91e0..f120e73dc23 100644 --- a/mysql/tables/llx_fichinter.sql +++ b/mysql/tables/llx_fichinter.sql @@ -38,7 +38,7 @@ create table llx_fichinter fk_statut smallint default 0, - duree integer, + duree real, note text,
NumSocieteSociétéDateStatutStatut 
fichid\">$objp->refidp\">$objp->nomidp\">$objp->nom".strftime("%d %B %Y",$objp->dp)."$objp->fk_statut[Fiche Inter]
idp\">$objp->nom".strftime("%d %B %Y",$objp->dp)."$objp->fk_statut[Fiche Inter]