*** empty log message ***
This commit is contained in:
parent
2b80e003b6
commit
d0406838c3
@ -25,12 +25,12 @@ $db = new Db();
|
|||||||
*/
|
*/
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
|
||||||
$pro = new Project();
|
$pro = new Project($db);
|
||||||
$pro->socidp = $socidp;
|
$pro->socidp = $socidp;
|
||||||
$pro->ref = $ref;
|
$pro->ref = $ref;
|
||||||
$pro->title = $title;
|
$pro->title = $title;
|
||||||
|
|
||||||
$pro->create($db, $user->id);
|
$pro->create( $user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,8 @@ class Project {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function create($creatorid) {
|
Function create($creatorid)
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat) ";
|
$sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat) ";
|
||||||
$sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;";
|
$sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;";
|
||||||
|
|||||||
@ -35,8 +35,7 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
$bc[0]="bgcolor=\"#90c090\"";
|
|
||||||
$bc[1]="bgcolor=\"#b0e0b0\"";
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
/*
|
/*
|
||||||
@ -56,6 +55,9 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$fichinter->date = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear));
|
$fichinter->date = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear));
|
||||||
|
|
||||||
|
$fichinter->socidp = $socidp;
|
||||||
|
$fichinter->duree = $duree;
|
||||||
|
|
||||||
$fichinter->projetidp = $projetidp;
|
$fichinter->projetidp = $projetidp;
|
||||||
|
|
||||||
$fichinter->author = $user->id;
|
$fichinter->author = $user->id;
|
||||||
@ -65,6 +67,23 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$id = $fichinter->create();
|
$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
|
* Generation
|
||||||
@ -78,7 +97,7 @@ if ($action == 'generate') {
|
|||||||
|
|
||||||
$gljroot = "/home/www/dolibarr/dolibarr/htdocs";
|
$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 .= " ; ./tex-fichinter.pl --fichinter=".$id ;
|
||||||
$command .= " --pdf --ps";
|
$command .= " --pdf --ps";
|
||||||
@ -93,11 +112,16 @@ if ($action == 'generate') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
*
|
||||||
* Mode creation
|
* Mode creation
|
||||||
* Creation d'une nouvelle propale
|
* Creation d'une nouvelle propale
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
|
||||||
|
print_titre("Création d'une fiche d'intervention");
|
||||||
|
|
||||||
|
|
||||||
if ( $objsoc->prefix_comm ) {
|
if ( $objsoc->prefix_comm ) {
|
||||||
|
|
||||||
$numpr = "FI-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time());
|
$numpr = "FI-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time());
|
||||||
@ -127,6 +151,121 @@ if ($action == 'create') {
|
|||||||
$strmonth[11] = "Novembre";
|
$strmonth[11] = "Novembre";
|
||||||
$strmonth[12] = "Décembre";
|
$strmonth[12] = "Décembre";
|
||||||
|
|
||||||
|
$smonth = 1;
|
||||||
|
$syear = date("Y", time());
|
||||||
|
print '<table border="1" cellspadding="3" cellspacing="0" width="100%">';
|
||||||
|
|
||||||
|
print "<tr><td>Société</td><td><b>".$objsoc->nom."</td></tr>";
|
||||||
|
|
||||||
|
print "<tr><td>Date</td><td>";
|
||||||
|
$cday = date("d", time());
|
||||||
|
print "<select name=\"pday\">";
|
||||||
|
for ($day = 1 ; $day < $sday + 32 ; $day++) {
|
||||||
|
if ($day == $cday) {
|
||||||
|
print "<option value=\"$day\" SELECTED>$day";
|
||||||
|
} else {
|
||||||
|
print "<option value=\"$day\">$day";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</select>";
|
||||||
|
$cmonth = date("n", time());
|
||||||
|
print "<select name=\"pmonth\">";
|
||||||
|
for ($month = $smonth ; $month < $smonth + 12 ; $month++) {
|
||||||
|
if ($month == $cmonth) {
|
||||||
|
print "<option value=\"$month\" SELECTED>" . $strmonth[$month];
|
||||||
|
} else {
|
||||||
|
print "<option value=\"$month\">" . $strmonth[$month];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</select>";
|
||||||
|
|
||||||
|
print "<select name=\"pyear\">";
|
||||||
|
|
||||||
|
for ($year = $syear ; $year < $syear + 5 ; $year++) {
|
||||||
|
print "<option value=\"$year\">$year";
|
||||||
|
}
|
||||||
|
print "</select></td></tr>";
|
||||||
|
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||||
|
|
||||||
|
print "<tr><td>Numéro</td><td><input name=\"ref\" value=\"$numpr\"></td></tr>\n";
|
||||||
|
print "<tr><td>Durée (en jours)</td><td><input name=\"duree\"></td></tr>\n";
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Projet associé
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
print '<tr><td valign="top">Projet</td><td><select name="projetidp">';
|
||||||
|
print '<option value="0"></option>';
|
||||||
|
|
||||||
|
$sql = "SELECT p.rowid, p.title FROM llx_projet as p WHERE p.fk_soc = $socidp";
|
||||||
|
|
||||||
|
if ( $db->query($sql) ) {
|
||||||
|
$i = 0 ;
|
||||||
|
$numprojet = $db->num_rows();
|
||||||
|
while ($i < $numprojet) {
|
||||||
|
$projet = $db->fetch_object($i);
|
||||||
|
print "<option value=\"$projet->rowid\">$projet->title</option>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$db->free();
|
||||||
|
} else {
|
||||||
|
print $db->error();
|
||||||
|
}
|
||||||
|
print '</select>';
|
||||||
|
if ($numprojet==0) {
|
||||||
|
print 'Cette société n\'a pas de projet. ';
|
||||||
|
print '<a href=/comm/projet/fiche.php3?socidp='.$socidp.'&action=create>Créer un projet</a>';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td valign="top">Commentaires</td>';
|
||||||
|
print "<td><textarea name=\"note\" wrap=\"soft\" cols=\"60\" rows=\"15\"></textarea>";
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td colspan="2" align="center">';
|
||||||
|
print "<input type=\"submit\" value=\"Enregistrer\">";
|
||||||
|
print '</td></tr>';
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
print "<hr noshade>";
|
||||||
|
} else {
|
||||||
|
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 "<form action=\"$PHP_SELF?id=$id\" method=\"post\">";
|
||||||
|
|
||||||
|
$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;
|
$smonth = 1;
|
||||||
$syear = date("Y", time());
|
$syear = date("Y", time());
|
||||||
print '<table border="1" cellspadding="3" cellspacing="0" width="100%">';
|
print '<table border="1" cellspadding="3" cellspacing="0" width="100%">';
|
||||||
@ -159,9 +298,10 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
print "</select></td></tr>";
|
print "</select></td></tr>";
|
||||||
|
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||||
|
|
||||||
print "<tr><td>Numéro</td><td><input name=\"ref\" value=\"$numpr\"></td></tr>\n";
|
print '<tr><td>Numéro</td><td>'.$fichinter->ref.'</td></tr>';
|
||||||
|
print '<tr><td>Durée (en jours)</td><td><input name="duree" value="'.$fichinter->duree.'"></td></tr>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -188,13 +328,15 @@ if ($action == 'create') {
|
|||||||
print '</select>';
|
print '</select>';
|
||||||
if ($numprojet==0) {
|
if ($numprojet==0) {
|
||||||
print 'Cette société n\'a pas de projet. ';
|
print 'Cette société n\'a pas de projet. ';
|
||||||
print '<a href=projet/fiche.php3?socidp='.$socidp.'&action=create>Créer un projet</a>';
|
print '<a href=/comm/projet/fiche.php3?socidp='.$socidp.'&action=create>Créer un projet</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td valign="top">Commentaires</td>';
|
print '<tr><td valign="top">Commentaires</td>';
|
||||||
print "<td><textarea name=\"note\" wrap=\"soft\" cols=\"60\" rows=\"15\"></textarea>";
|
print '<td><textarea name="note" wrap="soft" cols="60" rows="15">';
|
||||||
|
print $fichinter->note;
|
||||||
|
print '</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="center">';
|
print '<tr><td colspan="2" align="center">';
|
||||||
@ -205,10 +347,9 @@ if ($action == 'create') {
|
|||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
print "<hr noshade>";
|
print "<hr noshade>";
|
||||||
} else {
|
|
||||||
print "Vous devez d'abord associer un prefixe commercial a cette societe" ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mode Fiche
|
* Mode Fiche
|
||||||
* Affichage de la fiche d'intervention
|
* Affichage de la fiche d'intervention
|
||||||
@ -221,28 +362,19 @@ if ($id) {
|
|||||||
$fichinter = new Fichinter($db);
|
$fichinter = new Fichinter($db);
|
||||||
$fichinter->fetch($id);
|
$fichinter->fetch($id);
|
||||||
|
|
||||||
|
print_titre("Fiche d'intervention");
|
||||||
|
|
||||||
print '<table border="1" cellspadding="3" cellspacing="0" width="100%">';
|
print '<table border="1" cellspadding="3" cellspacing="0" width="100%">';
|
||||||
print '<tr><td width="20%">Date</td><td>'.strftime("%A %d %B %Y",$fichinter->date).'</td></tr>';
|
print '<tr><td width="20%">Date</td><td>'.strftime("%A %d %B %Y",$fichinter->date).'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>Numéro</td><td>'.$fichinter->ref.'</td></tr>';
|
print '<tr><td>Numéro</td><td>'.$fichinter->ref.'</td></tr>';
|
||||||
|
print '<tr><td>Durée</td><td>'.$fichinter->duree.'</td></tr>';
|
||||||
print '<tr><td valign="top">Projet</td><td> </td></tr>';
|
print '<tr><td valign="top">Projet</td><td> </td></tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td valign="top">Commentaires</td>';
|
print '<tr><td valign="top">Commentaires</td>';
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print nl2br($fichinter->note);
|
print nl2br($fichinter->note);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if ($fichinter->statut == 0) {
|
|
||||||
|
|
||||||
print '<tr><td valign="top">Action</td><td><a href="fiche.php3?id='.$id.'&action=valid">Valider</a></td></tr>';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td valign="top">Action</td><td><a href="fiche.php3?id='.$id.'&action=generate">Génération du pdf</a></td></tr>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td>Documents</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'">liste...</a>';
|
print '<tr><td>Documents</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'">liste...</a>';
|
||||||
|
|
||||||
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf";
|
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf";
|
||||||
@ -260,6 +392,34 @@ if ($id) {
|
|||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|
||||||
|
print '<br><table border="1" cellspadding="3" cellspacing="0" width="100%"><tr>';
|
||||||
|
|
||||||
|
if ($fichinter->statut == 0) {
|
||||||
|
|
||||||
|
|
||||||
|
print '<td align="center" width="20%"><a href="fiche.php3?id='.$id.'&action=edit">Mettre à jour</a></td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
|
||||||
|
print '<td align="center" width="20%"><a href="fiche.php3?id='.$id.'&action=generate">Génération du pdf</a></td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
|
||||||
|
print '<td align="center" width="20%"><a href="fiche.php3?id='.$id.'&action=valid">Valider</a></td>';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
print '<td align="center" width="20%">-</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr></table>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -276,11 +436,11 @@ if ( $db->query($sql) ) {
|
|||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
print "<TR bgcolor=\"orange\">";
|
print "<TR class=\"liste_titre\">";
|
||||||
print "<TD>Num</TD>";
|
print "<TD>Num</TD>";
|
||||||
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
|
print "<TD>Société</td>";
|
||||||
print "<TD>Date</TD>";
|
print "<TD>Date</TD>";
|
||||||
print "<TD>Statut</TD>";
|
print "<TD>Statut</TD><td> </td>";
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
@ -288,10 +448,12 @@ if ( $db->query($sql) ) {
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<TR $bc[$var]>";
|
print "<TR $bc[$var]>";
|
||||||
print "<TD><a href=\"fiche.php3?id=$objp->fichid\">$objp->ref</a></TD>\n";
|
print "<TD><a href=\"fiche.php3?id=$objp->fichid\">$objp->ref</a></TD>\n";
|
||||||
print "<TD><a href=\"../comm/index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
print "<TD><a href=\"/comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||||
print "<TD>$objp->fk_statut</TD>\n";
|
print "<TD>$objp->fk_statut</TD>\n";
|
||||||
|
|
||||||
|
print '<TD align="center"><a href="fiche.php3?socidp='.$objp->idp.'&action=create">[Fiche Inter]</A></td>';
|
||||||
|
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -59,7 +59,7 @@ if ( $db->query($sql) ) {
|
|||||||
print "<TD><a href=\"../comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
print "<TD><a href=\"../comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
|
||||||
print "<TD>$objp->fk_statut</TD>\n";
|
print "<TD>$objp->fk_statut</TD>\n";
|
||||||
|
print '<TD align="center"><a href="fiche.php3?socidp='.$objp->idp.'&action=create">[Fiche Inter]</A></td>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -38,7 +38,7 @@ create table llx_fichinter
|
|||||||
|
|
||||||
fk_statut smallint default 0,
|
fk_statut smallint default 0,
|
||||||
|
|
||||||
duree integer,
|
duree real,
|
||||||
|
|
||||||
note text,
|
note text,
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user