27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 $langs->loadLangs(array(
'interventions',
'sendings',
'companies'));
40 $action =
GETPOST(
'action',
'aZ09');
44 $socid = $user->socid;
49 $result = $object->fetch($id, $ref);
51 print
'Record not found';
59 if ($action ==
'addcontact' && $user->rights->ficheinter->creer) {
60 if ($result > 0 && $id > 0) {
63 $result = $object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
67 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
70 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
71 $langs->load(
"errors");
72 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
74 $mesg = $object->error;
79 } elseif ($action ==
'swapstatut' && $user->rights->ficheinter->creer) {
81 $result = $object->swapContactStatus(
GETPOST(
'ligne',
'int'));
82 } elseif ($action ==
'deletecontact' && $user->rights->ficheinter->creer) {
84 $result = $object->delete_contact(
GETPOST(
'lineid',
'int'));
87 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".$object->id);
101 $contactstatic =
new Contact($db);
102 $userstatic =
new User($db);
105 llxHeader(
'', $langs->trans(
"Intervention"));
109 if ($id > 0 || !empty($ref)) {
110 $object->fetch_thirdparty();
113 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"InterventionCard"), -1,
'intervention');
117 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
120 $morehtmlref =
'<div class="refidno">';
125 $morehtmlref .= $langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1);
128 $langs->load(
"projects");
129 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
130 if ($user->rights->ficheinter->creer) {
131 if ($action !=
'classify') {
133 $morehtmlref .=
' : ';
135 if ($action ==
'classify') {
137 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
138 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
139 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
140 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
141 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
142 $morehtmlref .=
'</form>';
144 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
147 if (!empty($object->fk_project)) {
149 $proj->fetch($object->fk_project);
150 $morehtmlref .=
' : '.$proj->getNomUrl(1);
152 $morehtmlref .=
' - '.$proj->title;
159 $morehtmlref .=
'</div>';
161 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
167 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_USER)) {
168 $hideaddcontactforuser = 1;
170 if (!empty($conf->global->FICHINTER_HIDE_ADD_CONTACT_THIPARTY)) {
171 $hideaddcontactforthirdparty = 1;
175 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
176 foreach ($dirtpls as $reldir) {
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage interventions.
Class to manage projects.
Class to manage Dolibarr users.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
fichinter_prepare_head($object)
Prepare array with list of tabs.
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.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
isModEnabled($module)
Is Dolibarr module enabled.
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.