38require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/modules/fichinter/modules_fichinter.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44if (isModEnabled(
'project')) {
45 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
48if (isModEnabled(
'contract')) {
49 require_once DOL_DOCUMENT_ROOT.
"/core/class/html.formcontract.class.php";
50 require_once DOL_DOCUMENT_ROOT.
"/contrat/class/contrat.class.php";
53 require_once DOL_DOCUMENT_ROOT.
"/core/modules/fichinter/mod_" .
getDolGlobalString(
'FICHEINTER_ADDON').
'.php';
55require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
59$langs->loadLangs(array(
'bills',
'companies',
'interventions',
'stocks'));
63$ref_client =
GETPOST(
'ref_client',
'alpha');
66$action =
GETPOST(
'action',
'alpha');
67$cancel =
GETPOST(
'cancel',
'alpha');
68$confirm =
GETPOST(
'confirm',
'alpha');
69$backtopage =
GETPOST(
'backtopage',
'alpha');
72$origin =
GETPOST(
'origin',
'alpha');
74$note_public =
GETPOST(
'note_public',
'restricthtml');
75$note_private =
GETPOST(
'note_private',
'restricthtml');
86$hookmanager->initHooks(array(
'interventioncard',
'globalcard'));
92$extrafields->fetch_name_optionals_label(
$object->table_element);
95if ($id > 0 || !empty($ref)) {
96 $ret =
$object->fetch($id, $ref);
98 $ret =
$object->fetch_thirdparty();
107 $socid = $user->socid;
111$permissionnote = $user->hasRight(
'ficheinter',
'creer');
112$permissiondellink = $user->hasRight(
'ficheinter',
'creer');
113$permissiontodelete = ((
$object->statut ==
Fichinter::STATUS_DRAFT && $user->hasRight(
'ficheinter',
'creer')) || $user->hasRight(
'ficheinter',
'supprimer'));
115$usercancreate = $user->hasRight(
'ficheinter',
'creer');
122$parameters = array(
'socid' => $socid);
123$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
128if (empty($reshook)) {
129 $backurlforlist = DOL_URL_ROOT.
'/fichinter/list.php';
131 if (empty($backtopage) || ($cancel && empty($id))) {
132 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
133 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
134 $backtopage = $backurlforlist;
136 $backtopage = DOL_URL_ROOT.
'/fichinter/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
142 if (!empty($backtopageforcancel)) {
143 header(
"Location: ".$backtopageforcancel);
145 } elseif (!empty($backtopage)) {
146 header(
"Location: ".$backtopage);
152 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
154 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
157 if ($action ==
'confirm_clone' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'creer')) {
158 if (1 == 0 && !
GETPOST(
'clone_content') && !
GETPOST(
'clone_receivers')) {
165 $result =
$object->createFromClone($user, $socid);
167 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?id='.$result);
178 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'creer')) {
179 $result =
$object->setValid($user);
184 $outputlangs = $langs;
187 $newlang =
GETPOST(
'lang_id',
'aZ09');
190 $newlang =
$object->thirdparty->default_lang;
192 if (!empty($newlang)) {
194 $outputlangs->setDefaultLang($newlang);
199 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
204 } elseif ($action ==
'confirm_modify' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'creer')) {
205 $result =
$object->setDraft($user);
209 $outputlangs = $langs;
212 $newlang =
GETPOST(
'lang_id',
'aZ09');
215 $newlang =
$object->thirdparty->default_lang;
217 if (!empty($newlang)) {
219 $outputlangs->setDefaultLang($newlang);
224 header(
'Location: ' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
229 } elseif ($action ==
'confirm_done' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'creer')) {
230 $result =
$object->setClose($user);
235 $outputlangs = $langs;
238 $newlang =
GETPOST(
'lang_id',
'aZ09');
241 $newlang =
$object->thirdparty->default_lang;
243 if (!empty($newlang)) {
245 $outputlangs->setDefaultLang($newlang);
250 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
255 } elseif ($action ==
'add' && $user->hasRight(
'ficheinter',
'creer')) {
256 $selectedLines =
GETPOST(
'toselect',
'array');
264 $object->ref_client = $ref_client;
271 if (!empty($origin) && !empty($originid)) {
274 $element = $subelement =
GETPOST(
'origin',
'alphanohtml');
275 if (preg_match(
'/^([^_]+)_([^_]+)/i',
GETPOST(
'origin',
'alphanohtml'), $regs)) {
277 $subelement = $regs[2];
281 if ($element ==
'order') {
282 $element = $subelement =
'commande';
284 if ($element ==
'propal') {
285 $element =
'comm/propal';
286 $subelement =
'propal';
288 if ($element ==
'contract') {
289 $element = $subelement =
'contrat';
293 $object->origin_id = $originid;
298 $object->linked_objects = array_merge(
$object->linked_objects,
GETPOST(
'other_linked_objects',
'array:int'));
304 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
318 $classname = ucfirst($subelement);
319 $srcobject =
new $classname($db);
322 $result = $srcobject->fetch(
$object->origin_id);
324 $srcobject->fetch_thirdparty();
325 $lines = $srcobject->lines;
326 if (empty($lines) && method_exists($srcobject,
'fetch_lines')) {
327 $srcobject->fetch_lines();
328 $lines = $srcobject->lines;
331 if (is_array($lines)) {
332 $num = count($lines);
334 for ($i = 0; $i < $num; $i++) {
335 if (!in_array($lines[$i]->
id, $selectedLines)) {
345 if ($lines[$i]->fk_product > 0) {
347 $prod->id = $lines[$i]->fk_product;
351 $prod->getMultiLangs();
353 $prod->fetch($lines[$i]->fk_product);
354 $outputlangs = $langs;
356 if (empty($newlang) &&
GETPOST(
'lang_id',
'aZ09')) {
357 $newlang =
GETPOST(
'lang_id',
'aZ09');
359 if (empty($newlang)) {
360 $newlang = $srcobject->thirdparty->default_lang;
362 if (!empty($newlang)) {
364 $outputlangs->setDefaultLang($newlang);
366 $label = (!empty($prod->multilangs[$outputlangs->defaultlang][
"libelle"])) ? $prod->multilangs[$outputlangs->defaultlang][
"libelle"] : $lines[$i]->product_label;
368 $prod->fetch($lines[$i]->fk_product);
369 $label = $lines[$i]->product_label;
372 if ($prod->duration_value && $conf->global->FICHINTER_USE_SERVICE_DURATION) {
373 switch ($prod->duration_unit) {
382 $mult = 3600 * 24 * 7;
385 $mult = (int) 3600 * 24 * (365 / 12);
388 $mult = 3600 * 24 * 365;
391 $duration = $prod->duration_value * $mult * $lines[$i]->qty;
394 $desc = $lines[$i]->product_ref;
402 $desc .=
' ('.$langs->trans(
'Quantity').
': '.$lines[$i]->qty.
')';
405 $date_intervention =
dol_mktime(0, 0, 0, $timearray[
'mon'], $timearray[
'mday'], $timearray[
'year']);
414 $extrafields->fetch_name_optionals_label(
$object->table_element_line);
415 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line, $predef);
434 $langs->load(
"errors");
440 $langs->load(
"errors");
447 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
455 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element);
457 $object->array_options = $array_options;
459 $result =
$object->create($user);
463 $langs->load(
"errors");
471 $mesg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"ThirdParty"));
475 } elseif ($action ==
'update' && $user->hasRight(
'ficheinter',
'creer')) {
482 $object->ref_client = $ref_client;
484 $result =
$object->update($user);
488 } elseif ($action ==
'classin' && $user->hasRight(
'ficheinter',
'creer')) {
494 } elseif ($action ==
'setcontract' && $user->hasRight(
'contrat',
'creer')) {
500 } elseif ($action ==
'setref_client' && $user->hasRight(
'ficheinter',
'creer')) {
502 $result =
$object->setRefClient($user,
GETPOST(
'ref_client',
'alpha'));
506 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'supprimer')) {
507 $result =
$object->delete($user);
512 header(
'Location: '.DOL_URL_ROOT.
'/fichinter/list.php?leftmenu=ficheinter&restore_lastsearch_values=1');
514 } elseif ($action ==
'setdescription' && $user->hasRight(
'ficheinter',
'creer')) {
515 $result =
$object->set_description($user,
GETPOST(
'description'));
519 } elseif ($action ==
"addline" && $user->hasRight(
'ficheinter',
'creer')) {
522 $mesg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Description"));
526 $mesg = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Duration"));
530 $mesg = $langs->trans(
"ErrorValueTooHigh");
536 $desc =
GETPOST(
'np_desc',
'restricthtml');
541 $extrafields->fetch_name_optionals_label(
$object->table_element_line);
542 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line);
554 $outputlangs = $langs;
557 $newlang =
GETPOST(
'lang_id',
'aZ09');
560 $newlang =
$object->thirdparty->default_lang;
562 if (!empty($newlang)) {
564 $outputlangs->setDefaultLang($newlang);
573 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
580 } elseif ($action ==
'classifybilled' && $user->hasRight(
'ficheinter',
'creer')) {
584 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
589 } elseif ($action ==
'classifyunbilled' && $user->hasRight(
'ficheinter',
'creer')) {
593 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
598 } elseif ($action ==
'confirm_reopen' && $user->hasRight(
'ficheinter',
'creer')) {
602 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
607 } elseif ($action ==
'updateline' && $user->hasRight(
'ficheinter',
'creer') &&
GETPOST(
'save',
'alpha')) {
610 if ($objectline->fetch($lineid) <= 0) {
615 if (
$object->fetch($objectline->fk_fichinter) <= 0) {
621 $desc =
GETPOST(
'np_desc',
'restricthtml');
625 $objectline->date = $date_inter;
626 $objectline->desc = $desc;
627 $objectline->duration = $duration;
630 $extrafields->fetch_name_optionals_label(
$object->table_element_line);
631 $array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line);
632 if (is_array($array_options)) {
633 $objectline->array_options = array_merge($objectline->array_options, $array_options);
636 $result = $objectline->update($user);
643 $outputlangs = $langs;
646 $newlang =
GETPOST(
'lang_id',
'aZ09');
649 $newlang =
$object->thirdparty->default_lang;
651 if (!empty($newlang)) {
653 $outputlangs->setDefaultLang($newlang);
659 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
661 } elseif ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $user->hasRight(
'ficheinter',
'creer')) {
664 if ($objectline->fetch($lineid) <= 0) {
668 $result = $objectline->deleteLine($user);
670 if (
$object->fetch($objectline->fk_fichinter) <= 0) {
676 $outputlangs = $langs;
679 $newlang =
GETPOST(
'lang_id',
'aZ09');
682 $newlang =
$object->thirdparty->default_lang;
684 if (!empty($newlang)) {
686 $outputlangs->setDefaultLang($newlang);
691 } elseif ($action ==
'up' && $user->hasRight(
'ficheinter',
'creer')) {
696 $outputlangs = $langs;
699 $newlang =
GETPOST(
'lang_id',
'aZ09');
702 $newlang =
$object->thirdparty->default_lang;
704 if (!empty($newlang)) {
706 $outputlangs->setDefaultLang($newlang);
712 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#'.$lineid);
714 } elseif ($action ==
'down' && $user->hasRight(
'ficheinter',
'creer')) {
718 $outputlangs = $langs;
721 $newlang =
GETPOST(
'lang_id',
'aZ09');
724 $newlang =
$object->thirdparty->default_lang;
726 if (!empty($newlang)) {
728 $outputlangs->setDefaultLang($newlang);
734 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#'.$lineid);
739 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
742 $triggersendname =
'FICHINTER_SENTBYMAIL';
743 $autocopy =
'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
744 $trackid =
'int'.$object->id;
745 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
748 $upload_dir = $conf->ficheinter->dir_output;
749 $permissiontoadd = $user->hasRight(
'ficheinter',
'creer');
750 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
752 if ($action ==
'update_extras' && $user->hasRight(
'ficheinter',
'creer')) {
756 $ret = $extrafields->setOptionalsFromPost(
null,
$object,
GETPOST(
'attribute',
'restricthtml'));
763 $result =
$object->insertExtraFields(
'INTERVENTION_MODIFY');
771 $action =
'edit_extras';
775 if (
getDolGlobalString(
'MAIN_DISABLE_CONTACTS_TAB') && $user->hasRight(
'ficheinter',
'creer')) {
776 if ($action ==
'addcontact') {
777 if ($result > 0 && $id > 0) {
780 $result =
$object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
784 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
787 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
788 $langs->load(
"errors");
789 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
794 } elseif ($action ==
'swapstatut') {
797 } elseif ($action ==
'deletecontact') {
802 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
816$form =
new Form($db);
818if (isModEnabled(
'contract')) {
821if (isModEnabled(
'project')) {
826$help_url =
'EN:Module_Interventions';
828llxHeader(
'', $langs->trans(
"Intervention"), $help_url);
830if ($action ==
'create') {
835 print
load_fiche_titre($langs->trans(
"AddIntervention"),
'',
'intervention');
844 $res = $soc->fetch($socid);
850 $element = $subelement =
GETPOST(
'origin',
'alphanohtml');
851 if (preg_match(
'/^([^_]+)_([^_]+)/i',
GETPOST(
'origin',
'alphanohtml'), $regs)) {
853 $subelement = $regs[2];
856 if ($element ==
'project') {
860 if ($element ==
'order' || $element ==
'commande') {
861 $element = $subelement =
'commande';
863 if ($element ==
'propal') {
864 $element =
'comm/propal';
865 $subelement =
'propal';
867 if ($element ==
'contract') {
868 $element = $subelement =
'contrat';
873 $classname = ucfirst($subelement);
874 $objectsrc =
new $classname($db);
875 $objectsrc->fetch(
GETPOST(
'originid'));
876 if (empty($objectsrc->lines) && method_exists($objectsrc,
'fetch_lines')) {
877 $objectsrc->fetch_lines();
878 $lines = $objectsrc->lines;
880 $objectsrc->fetch_thirdparty();
882 $projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project :
'');
884 $soc = $objectsrc->thirdparty;
886 $note_private = (!empty($objectsrc->note) ? $objectsrc->note : (!empty($objectsrc->note_private) ? $objectsrc->note_private :
GETPOST(
'note_private',
'restricthtml')));
887 $note_public = (!empty($objectsrc->note_public) ? $objectsrc->note_public :
GETPOST(
'note_public',
'restricthtml'));
890 $objectsrc->fetch_optionals();
891 $object->array_options = $objectsrc->array_options;
894 $srccontactslist = $objectsrc->liste_contact(-1,
'external', 1);
900 if (!$conf->global->FICHEINTER_ADDON) {
901 dol_print_error($db, $langs->trans(
"Error").
" ".$langs->trans(
"Error_FICHEINTER_ADDON_NotDefined"));
917 print
'<form name="fichinter" action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
918 print
'<input type="hidden" name="token" value="'.newToken().
'">';
919 print
'<input type="hidden" name="socid" value='.$soc->id.
'>';
920 print
'<input type="hidden" name="action" value="add">';
921 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
925 print
'<table class="border centpercent">';
927 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"ThirdParty").
'</td><td>'.$soc->getNomUrl(1).
'</td></tr>';
930 print
'<tr><td class="fieldrequired">'.$langs->trans(
'Ref').
'</td><td>'.$langs->trans(
"Draft").
'</td></tr>';
933 print
'<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans(
'RefCustomer').
'</td><td class="valuefieldcreate">';
934 print
'<input type="text" name="ref_client" value="'.GETPOST(
'ref_client').
'"></td>';
938 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
940 print
'<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.
GETPOST(
'description').
'</textarea>';
944 if (isModEnabled(
'project')) {
947 $langs->load(
"project");
949 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
956 $numprojet = $formproject->select_projects($soc->id, $projectid,
'projectid');
957 if ($numprojet == 0) {
958 print
' <a href="'.DOL_URL_ROOT.
'/projet/card.php?socid='.$soc->id.
'&action=create"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddProject").
'"></span></a>';
964 if (isModEnabled(
'contract')) {
965 $langs->load(
"contracts");
966 print
'<tr><td>'.$langs->trans(
"Contract").
'</td><td>';
967 $numcontrat = $formcontract->select_contract($soc->id,
GETPOSTINT(
'contratid'),
'contratid', 0, 1, 1);
968 if ($numcontrat == 0) {
969 print
' <a href="'.DOL_URL_ROOT.
'/contrat/card.php?socid='.$soc->id.
'&action=create"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddContract").
'"></span></a>';
976 print
'<td>'.$langs->trans(
"DefaultModel").
'</td>';
979 print $form->selectarray(
'model', $liste, $conf->global->FICHEINTER_ADDON_PDF);
984 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
986 $doleditor =
new DolEditor(
'note_public', $note_public,
'', 80,
'dolibarr_notes',
'In', 0,
false, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3,
'90%');
987 print $doleditor->Create(1);
992 if (empty($user->socid)) {
994 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
996 $doleditor =
new DolEditor(
'note_private', $note_private,
'', 80,
'dolibarr_notes',
'In', 0,
false, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3,
'90%');
997 print $doleditor->Create(1);
1003 $parameters = array();
1004 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
1005 print $hookmanager->resPrint;
1006 if (empty($reshook)) {
1007 print
$object->showOptionals($extrafields,
'create');
1011 if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1012 $newclassname = $classname;
1013 if ($newclassname ==
'Propal') {
1014 $langs->load(
'propal');
1015 $newclassname =
'CommercialProposal';
1017 print
'<tr><td>'.$langs->trans($newclassname).
'</td><td colspan="2">'.$objectsrc->getNomUrl(1).
'</td></tr>';
1046 if (is_object($objectsrc)) {
1047 print
'<input type="hidden" name="origin" value="'.$objectsrc->element.
'">';
1048 print
'<input type="hidden" name="originid" value="'.$objectsrc->id.
'">';
1049 } elseif ($origin ==
'project' && !empty($projectid)) {
1050 print
'<input type="hidden" name="projectid" value="'.$projectid.
'">';
1055 print $form->buttonsSaveCancel(
"CreateDraftIntervention");
1058 if (!empty($origin) && !empty($originid) && is_object($objectsrc) && !
getDolGlobalInt(
'FICHINTER_DISABLE_DETAILS')) {
1059 $title = $langs->trans(
'Services');
1062 print
'<div class="div-table-responsive-no-min">';
1063 print
'<table class="noborder centpercent">';
1065 $objectsrc->printOriginLinesList(!
getDolGlobalString(
'FICHINTER_PRINT_PRODUCTS') ?
'services' :
'');
1073 print
'<form name="fichinter" action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
1074 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1075 print
'<input type="hidden" name="action" value="create">';
1076 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1080 if (is_object($objectsrc)) {
1081 print
'<input type="hidden" name="origin" value="'.$objectsrc->element.
'">';
1082 print
'<input type="hidden" name="originid" value="'.$objectsrc->id.
'">';
1083 } elseif ($origin ==
'project' && !empty($projectid)) {
1084 print
'<input type="hidden" name="projectid" value="'.$projectid.
'">';
1086 print
'<table class="border centpercent">';
1087 print
'<tr><td class="fieldrequired">'.$langs->trans(
"ThirdParty").
'</td><td>';
1088 print $form->select_company(
'',
'socid',
'',
'SelectThirdParty', 1, 0,
null, 0,
'minwidth300');
1089 print
' <a href="'.DOL_URL_ROOT.
'/societe/card.php?action=create&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create').
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"AddThirdParty").
'"></span></a>';
1095 print $form->buttonsSaveCancel(
"CreateDraftIntervention");
1099} elseif ($id > 0 || !empty($ref)) {
1116 print
dol_get_fiche_head($head,
'card', $langs->trans(
"InterventionCard"), -1,
'intervention');
1121 if ($action ==
'delete') {
1122 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteIntervention'), $langs->trans(
'ConfirmDeleteIntervention'),
'confirm_delete',
'', 0, 1);
1126 if ($action ==
'validate') {
1128 $ref = substr(
$object->ref, 1, 4);
1129 if ($ref ==
'PROV') {
1130 $numref =
$object->getNextNumRef($soc);
1131 if (empty($numref)) {
1138 $text = $langs->trans(
'ConfirmValidateIntervention', $numref);
1139 if (isModEnabled(
'notification')) {
1140 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1141 $notify =
new Notify($db);
1143 $text .= $notify->confirmMessage(
'FICHINTER_VALIDATE',
$object->socid,
$object);
1146 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateIntervention'), $text,
'confirm_validate',
'', 1, 1);
1150 if ($action ==
'classifydone') {
1151 $text = $langs->trans(
'ConfirmCloseIntervention');
1152 if (isModEnabled(
'notification')) {
1153 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1154 $notify =
new Notify($db);
1156 $text .= $notify->confirmMessage(
'FICHINTER_CLOSE',
$object->socid,
$object);
1158 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'CloseIntervention'), $text,
'confirm_done',
'', 0, 1);
1162 if ($action ==
'modify') {
1163 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ModifyIntervention'), $langs->trans(
'ConfirmModifyIntervention'),
'confirm_modify',
'', 0, 1);
1167 if ($action ==
'reopen') {
1168 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReopenIntervention',
$object->ref),
'confirm_reopen',
'', 0, 1);
1172 if ($action ==
'ask_deleteline') {
1173 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&line_id='.$lineid, $langs->trans(
'DeleteInterventionLine'), $langs->trans(
'ConfirmDeleteInterventionLine'),
'confirm_deleteline',
'', 0, 1);
1177 if ($action ==
'clone') {
1179 $formquestion = array(
1185 array(
'type' =>
'other',
'name' =>
'socid',
'label' => $langs->trans(
"SelectThirdParty"),
'value' => $form->select_company(
GETPOSTINT(
'socid'),
'socid',
'',
'', 0, 0,
null, 0,
'minwidth200')));
1187 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneIntervention',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
1190 if (!$formconfirm) {
1191 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
1192 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters,
$object, $action);
1193 if (empty($reshook)) {
1194 $formconfirm .= $hookmanager->resPrint;
1195 } elseif ($reshook > 0) {
1196 $formconfirm = $hookmanager->resPrint;
1205 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
1208 $morehtmlref =
'<div class="refidno">';
1210 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'ref_client',
$object->ref_client,
$object, $user->hasRight(
'ficheinter',
'creer'),
'string',
'', 0, 1);
1211 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'ref_client',
$object->ref_client,
$object, $user->hasRight(
'ficheinter',
'creer'),
'string',
'',
null,
null,
'', 1);
1213 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'customer');
1215 if (isModEnabled(
'project')) {
1216 $langs->load(
"projects");
1217 $morehtmlref .=
'<br>';
1218 if ($usercancreate) {
1219 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
1220 if ($action !=
'classify') {
1221 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
1223 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
1225 if (!empty(
$object->fk_project)) {
1227 $proj->fetch(
$object->fk_project);
1228 $morehtmlref .= $proj->getNomUrl(1);
1230 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
1235 $morehtmlref .=
'</div>';
1237 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1240 print
'<div class="fichecenter">';
1241 print
'<div class="fichehalfleft">';
1242 print
'<div class="underbanner clearboth"></div>';
1244 print
'<table class="border tableforfield centpercent">';
1248 print
'<tr><td class="titlefield">'.$langs->trans(
"Dateo").
'</td>';
1255 print
'<tr><td>'.$langs->trans(
"Datee").
'</td>';
1262 print
'<tr><td>'.$langs->trans(
"Datet").
'</td>';
1270 print
'<tr><td class="titlefield">';
1271 print $form->editfieldkey(
"Description",
'description',
$object->description,
$object, $user->hasRight(
'ficheinter',
'creer'),
'textarea');
1273 print $form->editfieldval(
"Description",
'description',
$object->description,
$object, $user->hasRight(
'ficheinter',
'creer'),
'textarea:8');
1278 if (isModEnabled(
'contract')) {
1279 $langs->load(
'contracts');
1283 print
'<table class="nobordernopadding centpercent"><tr><td>';
1284 print $langs->trans(
'Contract');
1286 if ($action !=
'editcontract') {
1287 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editcontract&id='.
$object->id.
'">';
1288 print
img_edit($langs->trans(
'SetContract'), 1);
1291 print
'</tr></table>';
1293 if ($action ==
'editcontract') {
1295 $formcontract->formSelectContract($_SERVER[
"PHP_SELF"].
'?id='.
$object->id,
$object->socid,
$object->fk_contrat,
'contratid', 0, 1, 1);
1298 $contratstatic =
new Contrat($db);
1299 $contratstatic->fetch(
$object->fk_contrat);
1301 print $contratstatic->getNomUrl(0,
'', 1);
1312 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1317 print
'<div class="fichehalfright">';
1318 print
'<div class="underbanner clearboth"></div>';
1320 print
'<table class="border tableforfield centpercent">';
1324 print
'<tr><td class="titlefield">'.$langs->trans(
"TotalDuration").
'</td>';
1325 print
'<td>'.convertSecondToTime(
$object->duration,
'all', $conf->global->MAIN_DURATION_OF_WORKDAY).
' ('.
convertDurationtoHour(
$object->duration,
"s").
' '.$langs->trans(
"h").
')</td>';
1334 print
'<div class="clearboth"></div><br>';
1338 $blocname =
'contacts';
1339 $title = $langs->trans(
'ContactsAddresses');
1340 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1344 $blocname =
'notes';
1345 $title = $langs->trans(
'Notes');
1346 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1351 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" name="addinter" method="post">';
1352 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1353 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1354 if ($action ==
'editline') {
1355 print
'<input type="hidden" name="action" value="updateline">';
1356 print
'<input type="hidden" name="line_id" value="'.GETPOSTINT(
'line_id').
'">';
1358 print
'<input type="hidden" name="action" value="addline">';
1360 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1363 $sql =
'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
1364 $sql .=
' ft.date as date_intervention';
1365 $sql .=
' FROM '.MAIN_DB_PREFIX.
'fichinterdet as ft';
1366 $sql .=
' WHERE ft.fk_fichinter = '.((int)
$object->id);
1368 $sql .=
' AND ft.duree <> 0';
1370 $sql .=
' ORDER BY ft.rang ASC, ft.date ASC, ft.rowid';
1372 $resql = $db->query($sql);
1374 $num = $db->num_rows($resql);
1379 print
'<table class="noborder centpercent">';
1380 print
'<tr class="liste_titre">';
1384 print
'<td width="5" class="center linecolnum"></td>';
1387 print
'<td class="liste_titre">'.$langs->trans(
'Description').
'</td>';
1388 print
'<td class="liste_titre center">'.$langs->trans(
'Date').
'</td>';
1389 print
'<td class="liste_titre right">'.(!
getDolGlobalString(
'FICHINTER_WITHOUT_DURATION') ? $langs->trans(
'Duration') :
'').
'</td>';
1390 print
'<td class="liste_titre"> </td>';
1391 print
'<td class="liste_titre"> </td>';
1395 $objp = $db->fetch_object($resql);
1398 if ($action !=
'editline' ||
GETPOSTINT(
'line_id') != $objp->rowid) {
1399 print
'<tr class="oddeven">';
1403 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1407 print
'<a name="'.$objp->rowid.
'"></a>';
1411 $objectline->fetch($objp->rowid);
1412 $objectline->fetch_optionals();
1414 $extrafields->fetch_name_optionals_label($objectline->table_element);
1416 if (!empty($extrafields)) {
1417 $temps = $objectline->showOptionals($extrafields,
'view', array(),
'',
'', 1,
'line');
1418 if (!empty($temps)) {
1419 print
'<div style="padding-top: 10px" id="extrafield_lines_area_'.$line->id.
'" name="extrafield_lines_area_'.$line->id.
'">';
1428 print
'<td class="center" width="150">'.(!
getDolGlobalString(
'FICHINTER_DATE_WITHOUT_HOUR') ?
dol_print_date($db->jdate($objp->date_intervention),
'dayhour') :
dol_print_date($db->jdate($objp->date_intervention),
'day')).
'</td>';
1436 if (
$object->statut == 0 && $user->hasRight(
'ficheinter',
'creer')) {
1437 print
'<td class="center">';
1438 print
'<a class="editfielda marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&line_id='.$objp->rowid.
'#'.$objp->rowid.
'">';
1441 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1444 print
'<td class="center">';
1447 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=up&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1451 if ($i < $num - 1) {
1452 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=down&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1459 print
'<td colspan="2"> </td>';
1466 if (
$object->statut == 0 && $action ==
'editline' && $user->hasRight(
'ficheinter',
'creer') &&
GETPOSTINT(
'line_id') == $objp->rowid) {
1467 print
'<tr class="oddeven nohover">';
1471 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1475 print
'<a name="'.$objp->rowid.
'"></a>';
1478 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1479 $doleditor =
new DolEditor(
'np_desc', $objp->description,
'', 164,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_DETAILS'), ROWS_2,
'90%');
1480 $doleditor->Create();
1483 $objectline->fetch($objp->rowid);
1484 $objectline->fetch_optionals();
1486 $extrafields->fetch_name_optionals_label($objectline->table_element);
1488 if (!empty($extrafields)) {
1489 $temps = $objectline->showOptionals($extrafields,
'edit', array(),
'',
'', 1,
'line');
1490 if (!empty($temps)) {
1491 print
'<div style="padding-top: 10px" id="extrafield_lines_area_'.$line->id.
'" name="extrafield_lines_area_'.$line->id.
'">';
1500 print
'<td class="center nowrap">';
1502 print $form->selectDate($db->jdate($objp->date_intervention),
'di', 0, 0, 0,
"date_intervention");
1504 print $form->selectDate($db->jdate($objp->date_intervention),
'di', 1, 1, 0,
"date_intervention");
1509 print
'<td class="right">';
1511 $selectmode =
'select';
1513 $selectmode =
'text';
1515 $form->select_duration(
'duration', $objp->duree, 0, $selectmode);
1519 print
'<td class="center" colspan="5" valign="center">';
1520 print
'<input type="submit" class="button buttongen marginbottomonly button-save" name="save" value="'.$langs->trans(
"Save").
'">';
1521 print
'<input type="submit" class="button buttongen marginbottomonly button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'"></td>';
1531 if (
$object->statut == 0 && $user->hasRight(
'ficheinter',
'creer') && $action !=
'editline' && !
getDolGlobalString(
'FICHINTER_DISABLE_DETAILS')) {
1534 print
'<table class="noborder centpercent">';
1535 print
'<tr class="liste_titre">';
1539 print
'<td width="5" class="center linecolnum"></td>';
1543 print
'<a name="add"></a>';
1544 print $langs->trans(
'Description').
'</td>';
1545 print
'<td class="center">'.$langs->trans(
'Date').
'</td>';
1546 print
'<td class="right">'.(!
getDolGlobalString(
'FICHINTER_WITHOUT_DURATION') ? $langs->trans(
'Duration') :
'').
'</td>';
1547 print
'<td colspan="3"> </td>';
1551 print
'<tr class="oddeven nohover">'.
"\n";
1555 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1561 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1562 $doleditor =
new DolEditor(
'np_desc',
GETPOST(
'np_desc',
'restricthtml'),
'', 100,
'dolibarr_details',
'',
false,
true,
getDolGlobalString(
'FCKEDITOR_ENABLE_DETAILS'), ROWS_2,
'90%');
1563 $doleditor->Create();
1567 $extrafields->fetch_name_optionals_label($objectline->table_element);
1569 if (is_object($objectline)) {
1570 $temps = $objectline->showOptionals($extrafields,
'create', array(),
'',
'', 1,
'line');
1572 if (!empty($temps)) {
1573 print
'<div style="padding-top: 10px" id="extrafield_lines_area_create" name="extrafield_lines_area_create">';
1582 print
'<td class="center nowrap">';
1587 $timewithnohour =
dol_mktime(0, 0, 0, $timearray[
'mon'], $timearray[
'mday'], $timearray[
'year']);
1589 $timewithnohour =
dol_mktime($timearray[
'hours'], $timearray[
'minutes'], 0, $timearray[
'mon'], $timearray[
'mday'], $timearray[
'year']);
1595 print $form->selectDate($timewithnohour,
'di', 0, 0, 0,
"addinter");
1597 print $form->selectDate($timewithnohour,
'di', 1, 1, 0,
"addinter");
1602 print
'<td class="right">';
1604 $selectmode =
'select';
1606 $selectmode =
'text';
1612 print
'<td class="center" valign="middle" colspan="3"><input type="submit" class="button button-add" value="'.$langs->trans(
'Add').
'" name="addline"></td>';
1627 print
'</form>'.
"\n";
1639 print
'<div class="tabsAction">';
1641 $parameters = array();
1642 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1644 if (empty($reshook)) {
1645 if ($user->socid == 0) {
1646 if ($action !=
'editdescription' && ($action !=
'presend')) {
1649 if ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'ficheinter',
'creer')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'ficheinter',
'ficheinter_advance',
'validate'))) {
1650 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a></div>';
1652 print
'<div class="inline-block divButActionRefused"><span class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span></div>';
1658 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.
'&action=modify">';
1660 print $langs->trans(
"Modify");
1662 print $langs->trans(
"SetToDraft");
1669 if ($user->hasRight(
'ficheinter',
'creer')) {
1670 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reopen&token='.
newToken().
'">'.$langs->trans(
'ReOpen').
'</a></div>';
1672 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans(
'ReOpen').
'</a></div>';
1677 if (empty($user->socid)) {
1679 if (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || $user->hasRight(
'ficheinter',
'ficheinter_advance',
'send')) {
1680 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=presend&token='.
newToken().
'&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a></div>';
1682 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans(
'SendMail').
'</a></div>';
1689 print
'<div class="inline-block divButAction">';
1690 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/fichinter/card-rec.php?id='.
$object->id.
'&action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF'].
'?id='.
$object->id).
'">'.$langs->trans(
"ChangeIntoRepeatableIntervention").
'</a>';
1696 $langs->load(
"propal");
1698 if ($user->hasRight(
'propal',
'creer')) {
1699 print
'<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/comm/propal/card.php?action=create&origin='.
$object->element.
'&originid='.
$object->id.
'&socid='.
$object->socid.
'">'.$langs->trans(
"AddProp").
'</a></div>';
1701 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"AddProp").
'</a></div>';
1708 $langs->load(
"bills");
1710 if ($user->hasRight(
'facture',
'creer')) {
1711 print
'<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/compta/facture/card.php?action=create&origin='.
$object->element.
'&originid='.
$object->id.
'&socid='.
$object->socid.
'">'.$langs->trans(
"AddBill").
'</a></div>';
1713 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"AddBill").
'</a></div>';
1719 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=classifybilled&token='.
newToken().
'">'.$langs->trans(
"InterventionClassifyBilled").
'</a></div>';
1721 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=classifyunbilled&token='.
newToken().
'">'.$langs->trans(
"InterventionClassifyUnBilled").
'</a></div>';
1728 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=classifydone&token='.
newToken().
'">'.$langs->trans(
"InterventionClassifyDone").
'</a></div>';
1732 if ($user->hasRight(
'ficheinter',
'creer')) {
1733 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&socid='.
$object->socid.
'&action=clone&token='.
newToken().
'&object=ficheinter">'.$langs->trans(
"ToClone").
'</a></div>';
1737 print
'<div class="inline-block divButAction">';
1738 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
1746 if ($action !=
'presend') {
1747 print
'<div class="fichecenter"><div class="fichehalfleft">';
1753 $filedir = $conf->ficheinter->dir_output.
"/".$filename;
1754 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1755 $genallowed = $user->hasRight(
'ficheinter',
'lire');
1756 $delallowed = $user->hasRight(
'ficheinter',
'creer');
1757 print $formfile->showdocuments(
'ficheinter', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $soc->default_lang);
1760 $linktoelem = $form->showLinkToObjectBlock(
$object,
null, array(
'fichinter'));
1761 $somethingshown = $form->showLinkedObjectBlock(
$object, $linktoelem);
1765 print
'<br><!-- Link to download main doc -->'.
"\n";
1771 print
'<br><!-- Link to sign -->';
1772 require_once DOL_DOCUMENT_ROOT.
'/core/lib/signature.lib.php';
1774 print showOnlineSignatureUrl(
'fichinter',
$object->ref,
$object).
'<br>';
1777 print
'</div><div class="fichehalfright">';
1781 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/fichinter/agenda.php?id='.
$object->id);
1784 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1786 $somethingshown = $formactions->showactions(
$object,
'fichinter', $socid, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1788 print
'</div></div>';
1793 if (
GETPOST(
'modelselected')) {
1794 $action =
'presend';
1798 $modelmail =
'fichinter_send';
1799 $defaulttopic =
'SendInterventionRef';
1800 $diroutput = $conf->ficheinter->dir_output;
1801 $trackid =
'int'.$object->id;
1803 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage contracts.
Class to manage a WYSIWYG editor.
Class to manage interventions.
const STATUS_BILLED
Billed.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
const STATUS_CLOSED
Closed.
Class to manage intervention lines.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Class to manage the table of subscription to notifications.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
convertDurationtoHour($duration_value, $duration_unit)
Convert duration to hour.
convertTime2Seconds($iHours=0, $iMinutes=0, $iSeconds=0)
Convert hours and minutes into seconds.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
fichinter_prepare_head($object)
Prepare array with list of tabs.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_down($titlealt='default', $selected=0, $moreclass='')
Show down arrow logo.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
showDirectDownloadLink($object)
Return string with full Url.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
img_up($titlealt='default', $selected=0, $moreclass='')
Show top arrow logo.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.