26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 $langs->loadLangs(array(
'interventions',
'sendings',
'companies'));
39 $action =
GETPOST(
'action',
'aZ09');
42 if ($user->socid) $socid = $user->socid;
46 $result = $object->fetch($id, $ref);
49 print 'Record not found';
57 if ($action ==
'addcontact' && $user->rights->ficheinter->creer)
59 if ($result > 0 && $id > 0)
63 $result = $object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
68 header(
"Location: ".
$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
71 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
72 $langs->load(
"errors");
73 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
75 $mesg = $object->error;
83 elseif ($action ==
'swapstatut' && $user->rights->ficheinter->creer)
85 $result = $object->swapContactStatus(
GETPOST(
'ligne',
'int'));
89 elseif ($action ==
'deletecontact' && $user->rights->ficheinter->creer)
91 $result = $object->delete_contact(
GETPOST(
'lineid',
'int'));
95 header(
"Location: ".
$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
107 $form =
new Form($db);
109 $contactstatic =
new Contact($db);
110 $userstatic =
new User($db);
113 llxHeader(
'', $langs->trans(
"Intervention"));
117 if ($id > 0 || !empty($ref))
119 $object->fetch_thirdparty();
126 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
129 $morehtmlref =
'<div class="refidno">';
134 $morehtmlref .= $langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
136 if (!empty($conf->projet->enabled))
138 $langs->load(
"projects");
139 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
140 if ($user->rights->ficheinter->creer)
142 if ($action !=
'classify') {
144 $morehtmlref .=
' : ';
146 if ($action ==
'classify') {
148 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
149 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
150 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
151 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
152 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
153 $morehtmlref .=
'</form>';
155 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
158 if (!empty($object->fk_project)) {
160 $proj->fetch($object->fk_project);
161 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$object->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
162 $morehtmlref .= $proj->ref;
163 $morehtmlref .=
'</a>';
169 $morehtmlref .=
'</div>';
171 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
177 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser = 1;
178 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_THIPARTY)) $hideaddcontactforthirdparty = 1;
181 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
182 foreach ($dirtpls as $reldir)
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage interventions.
Class to manage Dolibarr users.
fichinter_prepare_head($object)
Prepare array with list of tabs.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.