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 "| Société | ".$objsoc->nom." |
";
+
print "| Date | ";
$cday = date("d", time());
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 "";
+
+ 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 '| Date | '.strftime("%A %d %B %Y",$fichinter->date).' |
';
print '| Numéro | '.$fichinter->ref.' |
';
-
+ print '| Durée | '.$fichinter->duree.' |
';
print '| Projet | |
';
-
-
print '| Commentaires | ';
print "";
print nl2br($fichinter->note);
print ' |
';
- if ($fichinter->statut == 0) {
-
- print '| Action | Valider |
';
-
- }
-
- print '| Action | Génération du pdf |
';
-
-
print '| Documents | liste...';
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf";
@@ -259,7 +391,35 @@ if ($id) {
print ' |
';
print "
";
-
+
+
+ print '
';
+
+ if ($fichinter->statut == 0) {
+
+
+ print '| Mettre à jour | ';
+ print '- | ';
+
+ print 'Génération du pdf | ';
+ print '- | ';
+
+ print 'Valider | ';
+
+ } else {
+ print '- | ';
+ print '- | ';
+ print '- | ';
+ print '- | ';
+ print '- | ';
+ }
+
+ print '
';
+
+
+
+
+
}
/*
@@ -276,11 +436,11 @@ if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "";
- print "";
+ print "
";
print "| Num | ";
- print "Societe | ";
+ print "Société | ";
print "Date | ";
- print "Statut | ";
+ print "Statut | | ";
print "
\n";
$var=True;
while ($i < $num) {
@@ -288,9 +448,11 @@ if ( $db->query($sql) ) {
$var=!$var;
print "";
print "| fichid\">$objp->ref | \n";
- print "idp\">$objp->nom | \n";
+ print "idp\">$objp->nom | \n";
print "".strftime("%d %B %Y",$objp->dp)." | \n";
print "$objp->fk_statut | \n";
+
+ print '[Fiche Inter] | ';
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 "idp\">$objp->nom | \n";
print "".strftime("%d %B %Y",$objp->dp)." | \n";
print "$objp->fk_statut | \n";
-
+ print '[Fiche Inter] | ';
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,