Go to the documentation of this file.
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');
43 $socid = $user->socid;
48 $result = $object->fetch($id, $ref);
50 print
'Record not found';
58 if ($action ==
'addcontact' && $user->rights->ficheinter->creer) {
59 if ($result > 0 && $id > 0) {
62 $result = $object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
66 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
69 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
70 $langs->load(
"errors");
71 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
73 $mesg = $object->error;
78 } elseif ($action ==
'swapstatut' && $user->rights->ficheinter->creer) {
80 $result = $object->swapContactStatus(
GETPOST(
'ligne',
'int'));
81 } elseif ($action ==
'deletecontact' && $user->rights->ficheinter->creer) {
83 $result = $object->delete_contact(
GETPOST(
'lineid',
'int'));
86 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
100 $contactstatic =
new Contact($db);
101 $userstatic =
new User($db);
104 llxHeader(
'', $langs->trans(
"Intervention"));
108 if ($id > 0 || !empty($ref)) {
109 $object->fetch_thirdparty();
112 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"InterventionCard"), -1,
'intervention');
116 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
119 $morehtmlref =
'<div class="refidno">';
124 $morehtmlref .= $langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
126 if (!empty($conf->project->enabled)) {
127 $langs->load(
"projects");
128 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
129 if ($user->rights->ficheinter->creer) {
130 if ($action !=
'classify') {
132 $morehtmlref .=
' : ';
134 if ($action ==
'classify') {
136 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
137 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
138 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
139 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
140 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
141 $morehtmlref .=
'</form>';
143 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
146 if (!empty($object->fk_project)) {
148 $proj->fetch($object->fk_project);
149 $morehtmlref .=
' : '.$proj->getNomUrl(1);
151 $morehtmlref .=
' - '.$proj->title;
158 $morehtmlref .=
'</div>';
160 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
166 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_USER)) {
167 $hideaddcontactforuser = 1;
169 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_THIPARTY)) {
170 $hideaddcontactforthirdparty = 1;
174 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
175 foreach ($dirtpls as $reldir) {
restrictedArea($user, $features, $objectid=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.
Class to manage projects.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Class to manage interventions.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage Dolibarr users.
fichinter_prepare_head($object)
Prepare array with list of tabs.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.