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 $newclassname =
'CommercialProposal';
1016 print
'<tr><td>'.$langs->trans($newclassname).
'</td><td colspan="2">'.$objectsrc->getNomUrl(1).
'</td></tr>';
1045 if (is_object($objectsrc)) {
1046 print
'<input type="hidden" name="origin" value="'.$objectsrc->element.
'">';
1047 print
'<input type="hidden" name="originid" value="'.$objectsrc->id.
'">';
1048 } elseif ($origin ==
'project' && !empty($projectid)) {
1049 print
'<input type="hidden" name="projectid" value="'.$projectid.
'">';
1054 print $form->buttonsSaveCancel(
"CreateDraftIntervention");
1057 if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1058 $title = $langs->trans(
'Services');
1061 print
'<div class="div-table-responsive-no-min">';
1062 print
'<table class="noborder centpercent">';
1064 $objectsrc->printOriginLinesList(!
getDolGlobalString(
'FICHINTER_PRINT_PRODUCTS') ?
'services' :
'');
1072 print
'<form name="fichinter" action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
1073 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1074 print
'<input type="hidden" name="action" value="create">';
1075 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1079 if (is_object($objectsrc)) {
1080 print
'<input type="hidden" name="origin" value="'.$objectsrc->element.
'">';
1081 print
'<input type="hidden" name="originid" value="'.$objectsrc->id.
'">';
1082 } elseif ($origin ==
'project' && !empty($projectid)) {
1083 print
'<input type="hidden" name="projectid" value="'.$projectid.
'">';
1085 print
'<table class="border centpercent">';
1086 print
'<tr><td class="fieldrequired">'.$langs->trans(
"ThirdParty").
'</td><td>';
1087 print $form->select_company(
'',
'socid',
'',
'SelectThirdParty', 1, 0,
null, 0,
'minwidth300');
1088 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>';
1094 print $form->buttonsSaveCancel(
"CreateDraftIntervention");
1098} elseif ($id > 0 || !empty($ref)) {
1115 print
dol_get_fiche_head($head,
'card', $langs->trans(
"InterventionCard"), -1,
'intervention');
1120 if ($action ==
'delete') {
1121 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteIntervention'), $langs->trans(
'ConfirmDeleteIntervention'),
'confirm_delete',
'', 0, 1);
1125 if ($action ==
'validate') {
1127 $ref = substr(
$object->ref, 1, 4);
1128 if ($ref ==
'PROV') {
1129 $numref =
$object->getNextNumRef($soc);
1130 if (empty($numref)) {
1137 $text = $langs->trans(
'ConfirmValidateIntervention', $numref);
1138 if (isModEnabled(
'notification')) {
1139 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1140 $notify =
new Notify($db);
1142 $text .= $notify->confirmMessage(
'FICHINTER_VALIDATE',
$object->socid,
$object);
1145 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ValidateIntervention'), $text,
'confirm_validate',
'', 1, 1);
1149 if ($action ==
'classifydone') {
1150 $text = $langs->trans(
'ConfirmCloseIntervention');
1151 if (isModEnabled(
'notification')) {
1152 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1153 $notify =
new Notify($db);
1155 $text .= $notify->confirmMessage(
'FICHINTER_CLOSE',
$object->socid,
$object);
1157 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'CloseIntervention'), $text,
'confirm_done',
'', 0, 1);
1161 if ($action ==
'modify') {
1162 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ModifyIntervention'), $langs->trans(
'ConfirmModifyIntervention'),
'confirm_modify',
'', 0, 1);
1166 if ($action ==
'reopen') {
1167 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ReOpen'), $langs->trans(
'ConfirmReopenIntervention',
$object->ref),
'confirm_reopen',
'', 0, 1);
1171 if ($action ==
'ask_deleteline') {
1172 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&line_id='.$lineid, $langs->trans(
'DeleteInterventionLine'), $langs->trans(
'ConfirmDeleteInterventionLine'),
'confirm_deleteline',
'', 0, 1);
1176 if ($action ==
'clone') {
1178 $formquestion = array(
1184 array(
'type' =>
'other',
'name' =>
'socid',
'label' => $langs->trans(
"SelectThirdParty"),
'value' => $form->select_company(
GETPOSTINT(
'socid'),
'socid',
'',
'', 0, 0,
null, 0,
'minwidth200')));
1186 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneIntervention',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
1189 if (!$formconfirm) {
1190 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
1191 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters,
$object, $action);
1192 if (empty($reshook)) {
1193 $formconfirm .= $hookmanager->resPrint;
1194 } elseif ($reshook > 0) {
1195 $formconfirm = $hookmanager->resPrint;
1204 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
1207 $morehtmlref =
'<div class="refidno">';
1209 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'ref_client',
$object->ref_client,
$object, $user->hasRight(
'ficheinter',
'creer'),
'string',
'', 0, 1);
1210 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'ref_client',
$object->ref_client,
$object, $user->hasRight(
'ficheinter',
'creer'),
'string',
'',
null,
null,
'', 1);
1212 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'customer');
1214 if (isModEnabled(
'project')) {
1215 $langs->load(
"projects");
1216 $morehtmlref .=
'<br>';
1217 if ($usercancreate) {
1218 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
1219 if ($action !=
'classify') {
1220 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
1222 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
1224 if (!empty(
$object->fk_project)) {
1226 $proj->fetch(
$object->fk_project);
1227 $morehtmlref .= $proj->getNomUrl(1);
1229 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
1234 $morehtmlref .=
'</div>';
1236 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1239 print
'<div class="fichecenter">';
1240 print
'<div class="fichehalfleft">';
1241 print
'<div class="underbanner clearboth"></div>';
1243 print
'<table class="border tableforfield centpercent">';
1247 print
'<tr><td class="titlefield">'.$langs->trans(
"Dateo").
'</td>';
1254 print
'<tr><td>'.$langs->trans(
"Datee").
'</td>';
1261 print
'<tr><td>'.$langs->trans(
"Datet").
'</td>';
1269 print
'<tr><td class="titlefield">';
1270 print $form->editfieldkey(
"Description",
'description',
$object->description,
$object, $user->hasRight(
'ficheinter',
'creer'),
'textarea');
1272 print $form->editfieldval(
"Description",
'description',
$object->description,
$object, $user->hasRight(
'ficheinter',
'creer'),
'textarea:8');
1277 if (isModEnabled(
'contract')) {
1278 $langs->load(
'contracts');
1282 print
'<table class="nobordernopadding centpercent"><tr><td>';
1283 print $langs->trans(
'Contract');
1285 if ($action !=
'contrat') {
1286 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=contrat&id='.
$object->id.
'">';
1287 print
img_edit($langs->trans(
'SetContract'), 1);
1290 print
'</tr></table>';
1292 if ($action ==
'contrat') {
1294 $formcontract->formSelectContract($_SERVER[
"PHP_SELF"].
'?id='.
$object->id,
$object->socid,
$object->fk_contrat,
'contratid', 0, 1, 1);
1297 $contratstatic =
new Contrat($db);
1298 $contratstatic->fetch(
$object->fk_contrat);
1300 print $contratstatic->getNomUrl(0,
'', 1);
1311 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1316 print
'<div class="fichehalfright">';
1317 print
'<div class="underbanner clearboth"></div>';
1319 print
'<table class="border tableforfield centpercent">';
1323 print
'<tr><td class="titlefield">'.$langs->trans(
"TotalDuration").
'</td>';
1324 print
'<td>'.convertSecondToTime(
$object->duration,
'all', $conf->global->MAIN_DURATION_OF_WORKDAY).
' ('.
convertDurationtoHour(
$object->duration,
"s").
' '.$langs->trans(
"h").
')</td>';
1333 print
'<div class="clearboth"></div><br>';
1337 $blocname =
'contacts';
1338 $title = $langs->trans(
'ContactsAddresses');
1339 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1343 $blocname =
'notes';
1344 $title = $langs->trans(
'Notes');
1345 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_showhide.tpl.php';
1350 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" name="addinter" method="post">';
1351 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1352 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1353 if ($action ==
'editline') {
1354 print
'<input type="hidden" name="action" value="updateline">';
1355 print
'<input type="hidden" name="line_id" value="'.GETPOSTINT(
'line_id').
'">';
1357 print
'<input type="hidden" name="action" value="addline">';
1359 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1362 $sql =
'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
1363 $sql .=
' ft.date as date_intervention';
1364 $sql .=
' FROM '.MAIN_DB_PREFIX.
'fichinterdet as ft';
1365 $sql .=
' WHERE ft.fk_fichinter = '.((int)
$object->id);
1367 $sql .=
' AND ft.duree <> 0';
1369 $sql .=
' ORDER BY ft.rang ASC, ft.date ASC, ft.rowid';
1371 $resql = $db->query($sql);
1373 $num = $db->num_rows($resql);
1378 print
'<table class="noborder centpercent">';
1379 print
'<tr class="liste_titre">';
1383 print
'<td width="5" class="center linecolnum"></td>';
1386 print
'<td class="liste_titre">'.$langs->trans(
'Description').
'</td>';
1387 print
'<td class="liste_titre center">'.$langs->trans(
'Date').
'</td>';
1388 print
'<td class="liste_titre right">'.(!
getDolGlobalString(
'FICHINTER_WITHOUT_DURATION') ? $langs->trans(
'Duration') :
'').
'</td>';
1389 print
'<td class="liste_titre"> </td>';
1390 print
'<td class="liste_titre"> </td>';
1394 $objp = $db->fetch_object($resql);
1397 if ($action !=
'editline' ||
GETPOSTINT(
'line_id') != $objp->rowid) {
1398 print
'<tr class="oddeven">';
1402 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1406 print
'<a name="'.$objp->rowid.
'"></a>';
1410 $objectline->fetch($objp->rowid);
1411 $objectline->fetch_optionals();
1413 $extrafields->fetch_name_optionals_label($objectline->table_element);
1415 if (!empty($extrafields)) {
1416 $temps = $objectline->showOptionals($extrafields,
'view', array(),
'',
'', 1,
'line');
1417 if (!empty($temps)) {
1418 print
'<div style="padding-top: 10px" id="extrafield_lines_area_'.$line->id.
'" name="extrafield_lines_area_'.$line->id.
'">';
1427 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>';
1435 if (
$object->statut == 0 && $user->hasRight(
'ficheinter',
'creer')) {
1436 print
'<td class="center">';
1437 print
'<a class="editfielda marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&line_id='.$objp->rowid.
'#'.$objp->rowid.
'">';
1440 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1443 print
'<td class="center">';
1446 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=up&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1450 if ($i < $num - 1) {
1451 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=down&token='.
newToken().
'&line_id='.$objp->rowid.
'">';
1458 print
'<td colspan="2"> </td>';
1465 if (
$object->statut == 0 && $action ==
'editline' && $user->hasRight(
'ficheinter',
'creer') &&
GETPOSTINT(
'line_id') == $objp->rowid) {
1466 print
'<tr class="oddeven nohover">';
1470 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1474 print
'<a name="'.$objp->rowid.
'"></a>';
1477 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1478 $doleditor =
new DolEditor(
'np_desc', $objp->description,
'', 164,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_DETAILS'), ROWS_2,
'90%');
1479 $doleditor->Create();
1482 $objectline->fetch($objp->rowid);
1483 $objectline->fetch_optionals();
1485 $extrafields->fetch_name_optionals_label($objectline->table_element);
1487 if (!empty($extrafields)) {
1488 $temps = $objectline->showOptionals($extrafields,
'edit', array(),
'',
'', 1,
'line');
1489 if (!empty($temps)) {
1490 print
'<div style="padding-top: 10px" id="extrafield_lines_area_'.$line->id.
'" name="extrafield_lines_area_'.$line->id.
'">';
1499 print
'<td class="center nowrap">';
1501 print $form->selectDate($db->jdate($objp->date_intervention),
'di', 0, 0, 0,
"date_intervention");
1503 print $form->selectDate($db->jdate($objp->date_intervention),
'di', 1, 1, 0,
"date_intervention");
1508 print
'<td class="right">';
1510 $selectmode =
'select';
1512 $selectmode =
'text';
1514 $form->select_duration(
'duration', $objp->duree, 0, $selectmode);
1518 print
'<td class="center" colspan="5" valign="center">';
1519 print
'<input type="submit" class="button buttongen marginbottomonly button-save" name="save" value="'.$langs->trans(
"Save").
'">';
1520 print
'<input type="submit" class="button buttongen marginbottomonly button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'"></td>';
1530 if (
$object->statut == 0 && $user->hasRight(
'ficheinter',
'creer') && $action !=
'editline' && !
getDolGlobalString(
'FICHINTER_DISABLE_DETAILS')) {
1533 print
'<table class="noborder centpercent">';
1534 print
'<tr class="liste_titre">';
1538 print
'<td width="5" class="center linecolnum"></td>';
1542 print
'<a name="add"></a>';
1543 print $langs->trans(
'Description').
'</td>';
1544 print
'<td class="center">'.$langs->trans(
'Date').
'</td>';
1545 print
'<td class="right">'.(!
getDolGlobalString(
'FICHINTER_WITHOUT_DURATION') ? $langs->trans(
'Duration') :
'').
'</td>';
1546 print
'<td colspan="3"> </td>';
1550 print
'<tr class="oddeven nohover">'.
"\n";
1554 print
'<td class="center linecolnum">'.($i + 1).
'</td>';
1560 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1561 $doleditor =
new DolEditor(
'np_desc',
GETPOST(
'np_desc',
'restricthtml'),
'', 100,
'dolibarr_details',
'',
false,
true,
getDolGlobalString(
'FCKEDITOR_ENABLE_DETAILS'), ROWS_2,
'90%');
1562 $doleditor->Create();
1566 $extrafields->fetch_name_optionals_label($objectline->table_element);
1568 if (is_object($objectline)) {
1569 $temps = $objectline->showOptionals($extrafields,
'create', array(),
'',
'', 1,
'line');
1571 if (!empty($temps)) {
1572 print
'<div style="padding-top: 10px" id="extrafield_lines_area_create" name="extrafield_lines_area_create">';
1581 print
'<td class="center nowrap">';
1586 $timewithnohour =
dol_mktime(0, 0, 0, $timearray[
'mon'], $timearray[
'mday'], $timearray[
'year']);
1588 $timewithnohour =
dol_mktime($timearray[
'hours'], $timearray[
'minutes'], 0, $timearray[
'mon'], $timearray[
'mday'], $timearray[
'year']);
1594 print $form->selectDate($timewithnohour,
'di', 0, 0, 0,
"addinter");
1596 print $form->selectDate($timewithnohour,
'di', 1, 1, 0,
"addinter");
1601 print
'<td class="right">';
1603 $selectmode =
'select';
1605 $selectmode =
'text';
1611 print
'<td class="center" valign="middle" colspan="3"><input type="submit" class="button button-add" value="'.$langs->trans(
'Add').
'" name="addline"></td>';
1626 print
'</form>'.
"\n";
1638 print
'<div class="tabsAction">';
1640 $parameters = array();
1641 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
1643 if (empty($reshook)) {
1644 if ($user->socid == 0) {
1645 if ($action !=
'editdescription' && ($action !=
'presend')) {
1648 if ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'ficheinter',
'creer')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'ficheinter',
'ficheinter_advance',
'validate'))) {
1649 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.
'&action=validate&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a></div>';
1651 print
'<div class="inline-block divButActionRefused"><span class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans(
"NotEnoughPermissions")).
'">'.$langs->trans(
"Validate").
'</span></div>';
1657 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.
'&action=modify">';
1659 print $langs->trans(
"Modify");
1661 print $langs->trans(
"SetToDraft");
1668 if ($user->hasRight(
'ficheinter',
'creer')) {
1669 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>';
1671 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans(
'ReOpen').
'</a></div>';
1676 if (empty($user->socid)) {
1678 if (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || $user->hasRight(
'ficheinter',
'ficheinter_advance',
'send')) {
1679 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>';
1681 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans(
'SendMail').
'</a></div>';
1688 print
'<div class="inline-block divButAction">';
1689 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>';
1695 $langs->load(
"propal");
1697 if ($user->hasRight(
'propal',
'creer')) {
1698 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>';
1700 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"AddProp").
'</a></div>';
1707 $langs->load(
"bills");
1709 if ($user->hasRight(
'facture',
'creer')) {
1710 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>';
1712 print
'<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"AddBill").
'</a></div>';
1718 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>';
1720 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>';
1727 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>';
1731 if ($user->hasRight(
'ficheinter',
'creer')) {
1732 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>';
1736 print
'<div class="inline-block divButAction">';
1737 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
1745 if ($action !=
'presend') {
1746 print
'<div class="fichecenter"><div class="fichehalfleft">';
1752 $filedir = $conf->ficheinter->dir_output.
"/".$filename;
1753 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
1754 $genallowed = $user->hasRight(
'ficheinter',
'lire');
1755 $delallowed = $user->hasRight(
'ficheinter',
'creer');
1756 print $formfile->showdocuments(
'ficheinter', $filename, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $soc->default_lang);
1759 $linktoelem = $form->showLinkToObjectBlock(
$object,
null, array(
'fichinter'));
1760 $somethingshown = $form->showLinkedObjectBlock(
$object, $linktoelem);
1764 print
'<br><!-- Link to download main doc -->'.
"\n";
1770 print
'<br><!-- Link to sign -->';
1771 require_once DOL_DOCUMENT_ROOT.
'/core/lib/signature.lib.php';
1773 print showOnlineSignatureUrl(
'fichinter',
$object->ref,
$object).
'<br>';
1776 print
'</div><div class="fichehalfright">';
1780 $morehtmlcenter =
dolGetButtonTitle($langs->trans(
'SeeAll'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/fichinter/agenda.php?id='.
$object->id);
1783 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1785 $somethingshown = $formactions->showactions(
$object,
'fichinter', $socid, 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1787 print
'</div></div>';
1792 if (
GETPOST(
'modelselected')) {
1793 $action =
'presend';
1797 $modelmail =
'fichinter_send';
1798 $defaulttopic =
'SendInterventionRef';
1799 $diroutput = $conf->ficheinter->dir_output;
1800 $trackid =
'int'.$object->id;
1802 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.