';
+
+ print '| '.$langs->trans("Ref").' | '.$fichinter->ref.' |
';
+
print "| ".$langs->trans("Date")." | ";
$sel->select_date($fichinter->date);
print " |
";
- print '| '.$langs->trans("Ref").' | '.$fichinter->ref.' |
';
print '| '.$langs->trans("Duration")." (".$langs->trans("days").') | |
';
if ($conf->projet->enabled)
{
- // Projet associ
+ // Projet associé
print '| '.$langs->trans("Project").' | ';
-
- $sel->select_array("projetidp",$listeprj,$fichinter->projet_id);
-
- if (sizeof($listeprj) == 0)
- {
- print 'Cette société n\'a pas de projet. ';
-
- $user->getrights("projet");
-
- if ($user->rights->projet->creer)
- {
- print 'Créer un projet';
- }
- }
+ $sel->select_project($fichinter->societe_id,$fichinter->projet_id,"projetidp");
print ' |
';
}
print '| '.$langs->trans("Description").' | ';
- print ' |
';
@@ -279,6 +265,7 @@ if ($_GET["action"] == 'edit')
print '';
+ print '';
}
/*
@@ -288,92 +275,97 @@ if ($_GET["action"] == 'edit')
if ($_GET["id"] && $_GET["action"] != 'edit')
{
- print_fiche_titre($langs->trans("Intervention"),$mesg);
+ if ($mesg) print $mesg."
";
+
+ dolibarr_fiche_head($head, $a, $langs->trans("InterventionCard"));
$fichinter = new Fichinter($db);
- if ($fichinter->fetch($_GET["id"]))
+ $result=$fichinter->fetch($_GET["id"]);
+ if (! $result > 0)
{
- $fichinter->fetch_client();
-
- print '';
- print '| '.$langs->trans("Company").' | '.$fichinter->client->nom.' |
';
- print '| Date | '.strftime("%A %d %B %Y",$fichinter->date).' |
';
- print '| '.$langs->trans("Ref").' | '.$fichinter->ref.' |
';
- print '| '.$langs->trans("Duration").' | '.$fichinter->duree.' |
';
-
- if ($conf->projet->enabled)
- {
- $fichinter->fetch_projet();
- print '| '.$langs->trans("Ref").' | '.$fichinter->projet.' |
';
- }
- print '| '.$langs->trans("Status").' | '.$fichinter->statut.' |
';
- print '| '.$langs->trans("Description").' | ';
- print '';
- print nl2br($fichinter->note);
- print ' |
';
-
- print '';
- print "
";
-
-
- /*
- * Barre d'actions
- *
- */
- print '
';
- print '';
-
- if ($user->societe_id == 0)
- {
-
- if ($fichinter->statut == 0)
- {
- print '
'.$langs->trans("Edit").'';
- }
-
- if ($fichinter->statut == 0)
- {
- print '
'.$langs->trans("Valid").'';
- }
-
- $file = $conf->fichinter->dir_output."/".$fichinter->ref."/".$fichinter->ref.pdf;
- if ($fichinter->statut == 0 or !file_exists($file))
- {
- $langs->load("bills");
- print '
'.$langs->trans("BuildPDF").'';
- }
-
- }
- print '
';
- print '
';
-
- print '';
-
-
- /*
- * Documents générés
- */
- $filename=sanitize_string($fichinter->ref);
- $filedir=$conf->fichinter->dir_output . "/".$fichinter->ref;
- $urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id;
- //$genallowed=$user->rights->expedition->creer;
- //$delallowed=$user->rights->expedition->supprimer;
- $genallowed=0;
- $delallowed=0;
-
- $var=true;
-
- print " \n";
- $sel->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$propal->modelpdf);
-
-
- print " |
\n";
-
+ dolibarr_print_error($db);
+ exit;
}
- else
+
+ $fichinter->fetch_client();
+
+ print '';
+ print '| '.$langs->trans("Ref").' | '.$fichinter->ref.' |
';
+ print '| '.$langs->trans("Company").' | '.$fichinter->client->nom.' |
';
+ print '| '.$langs->trans("Date").' | '.dolibarr_print_date($fichinter->date,"%A %d %B %Y").' |
';
+ print '| '.$langs->trans("Duration").' | '.$fichinter->duree.' |
';
+
+ if ($conf->projet->enabled)
{
- print "Fiche inexistante";
+ $fichinter->fetch_projet();
+ print '| '.$langs->trans("Ref").' | '.$fichinter->projet.' |
';
}
+ print '| '.$langs->trans("Status").' | '.$fichinter->getLibStatut().' |
';
+
+ print '| '.$langs->trans("Description").' | ';
+ print '';
+ print nl2br($fichinter->note);
+ print ' |
';
+
+ print '';
+ print "
";
+ print '';
+
+
+ /**
+ * Barre d'actions
+ *
+ */
+ print '';
+
+ if ($user->societe_id == 0)
+ {
+
+ if ($fichinter->statut == 0)
+ {
+ print '
'.$langs->trans("Edit").'';
+ }
+
+ if ($fichinter->statut == 0)
+ {
+ print '
'.$langs->trans("Valid").'';
+ }
+
+ $file = $conf->fichinter->dir_output."/".$fichinter->ref."/".$fichinter->ref.pdf;
+ if ($fichinter->statut == 0 or !file_exists($file))
+ {
+ $langs->load("bills");
+ print '
'.$langs->trans("BuildPDF").'';
+ }
+
+ }
+ print '
';
+
+ print '