diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 2750081f95e..a5506df34fa 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -205,7 +205,7 @@ if ($_GET["action"] == 'create') print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -224,50 +224,36 @@ if ($_GET["action"] == 'edit') $fichinter = new Fichinter($db); $fichinter->fetch($_GET["id"]); + dolibarr_fiche_head($head, $a, $langs->trans("EditIntervention")); + /* - * Initialisation de la liste des projets - */ - $prj = new Project($db); - $listeprj = $prj->liste_array($fichinter->societe_id); - - print_titre($langs->trans("EditIntervention")); - + * Initialisation de la liste des projets + */ print "
"; print ""; print ""; print ''; + + print ''; + print ""; - print ''; print ''; if ($conf->projet->enabled) { - // Projet associ + // Projet associé print ''; } print ''; - 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 '
'.$langs->trans("Ref").''.$fichinter->ref.'
".$langs->trans("Date").""; $sel->select_date($fichinter->date); print "
'.$langs->trans("Ref").''.$fichinter->ref.'
'.$langs->trans("Duration")." (".$langs->trans("days").')
'.$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 '
'.$langs->trans("Description").''; print '
'; - print ''; - print ''; - print ''; - print ''; - - if ($conf->projet->enabled) - { - $fichinter->fetch_projet(); - print ''; - } - print ''; - print ''; - print ''; - - print ''; - print "
'.$langs->trans("Company").''.$fichinter->client->nom.'
Date'.strftime("%A %d %B %Y",$fichinter->date).'
'.$langs->trans("Ref").''.$fichinter->ref.'
'.$langs->trans("Duration").''.$fichinter->duree.'
'.$langs->trans("Ref").''.$fichinter->projet.'
'.$langs->trans("Status").''.$fichinter->statut.'
'.$langs->trans("Description").''; - print nl2br($fichinter->note); - 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 ''; + print ''; + print ''; + print ''; + + if ($conf->projet->enabled) { - print "Fiche inexistante"; + $fichinter->fetch_projet(); + print ''; } + print ''; + + print ''; + print ''; + + print ''; + print "
'.$langs->trans("Ref").''.$fichinter->ref.'
'.$langs->trans("Company").''.$fichinter->client->nom.'
'.$langs->trans("Date").''.dolibarr_print_date($fichinter->date,"%A %d %B %Y").'
'.$langs->trans("Duration").''.$fichinter->duree.'
'.$langs->trans("Ref").''.$fichinter->projet.'
'.$langs->trans("Status").''.$fichinter->getLibStatut().'
'.$langs->trans("Description").''; + print nl2br($fichinter->note); + 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 '
'; + + /* + * 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->fichinter->creer; + //$delallowed=$user->rights->fichinter->supprimer; + $genallowed=0; + $delallowed=0; + + $var=true; + + print "
\n"; + $sel->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf); + + + print "
"; + + print " "; + + print "
\n"; + } $db->close(); diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 6c5afd4b1e2..72b4d8f099a 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -1,9 +1,12 @@ # Dolibarr language file - en_US - interventions Intervention=Intervention Interventions=Interventions +InterventionCard=InterventionCard NewIntervention=New intervention +EditIntervention=Editer intervention AddIntervention=Add intervention ListOfInterventions=List of interventions TemplatePDFInterventions=PDF template for intervention cards LastInterventions=Last %s interventions AllInterventions=All interventions +CreateDaftIntervention=Create draft \ No newline at end of file diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index 6eed6dd33cb..f9e21f110ed 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -1,10 +1,12 @@ # Dolibarr language file - fr_FR - interventions Intervention=Intervention Interventions=Interventions +InterventionCard=Fiche intervention NewIntervention=Nouvelle intervention AddIntervention=Créer intervention ListOfInterventions=Liste des interventions EditIntervention=Editer TemplatePDFInterventions=Modèle PDF des fiches d'interventions LastInterventions=Les %s dernières interventions -AllInterventions=Toutes les interventions \ No newline at end of file +AllInterventions=Toutes les interventions +CreateDaftIntervention=Créer brouillon \ No newline at end of file