30require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
47$langs->loadLangs(array(
'interventions',
'sendings',
'companies'));
51$action =
GETPOST(
'action',
'aZ09');
54if ($user->isExternalUser()) {
55 $socid = $user->isExternalUser();
60$result =
$object->fetch($id, $ref);
62 print
'Record not found';
66$usercancreate = $user->hasRight(
'ficheinter',
'creer');
73if ($action ==
'addcontact' && $user->hasRight(
'ficheinter',
'creer')) {
74 if ($result > 0 && $id > 0) {
77 $result =
$object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
81 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
84 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
85 $langs->load(
"errors");
86 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
91 setEventMessages($mesg,
null,
'errors');
93} elseif ($action ==
'swapstatut' && $user->hasRight(
'ficheinter',
'creer')) {
96} elseif ($action ==
'deletecontact' && $user->hasRight(
'ficheinter',
'creer')) {
101 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
104 dol_print_error($db);
113$form =
new Form($db);
115$contactstatic =
new Contact($db);
116$userstatic =
new User($db);
119$title =
$object->ref .
" - " . $langs->trans(
'ContactsAddresses');
120$help_url =
'EN:Module_Interventions|FR:Module_Fiches_d\'interventions';
122llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-fichinter page-card_contact');
126if ($id > 0 || !empty($ref)) {
134 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
137 $morehtmlref =
'<div class="refidno">';
141 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'ref_client',
$object->ref_client, $object, 0,
'string',
'', 0, 1);
142 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'ref_client',
$object->ref_client, $object, 0,
'string',
'',
null,
null,
'', 1);
144 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'customer');
147 $langs->load(
"projects");
148 $morehtmlref .=
'<br>';
149 if ($usercancreate && 0) {
150 $morehtmlref .= img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
151 if ($action !=
'classify') {
152 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
154 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid, (
string)
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
156 if (!empty(
$object->fk_project)) {
158 $proj->fetch(
$object->fk_project);
159 $morehtmlref .= $proj->getNomUrl(1);
161 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
166 $morehtmlref .=
'</div>';
168 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
175 $hideaddcontactforuser = 1;
178 $hideaddcontactforthirdparty = 1;
182 $dirtpls = array_merge(
$conf->modules_parts[
'tpl'], array(
'/core/tpl'));
183 foreach ($dirtpls as $reldir) {
185 if (file_exists($file)) {
186 $res = @include $file;
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class to manage Dolibarr users.
fichinter_prepare_head($object)
Prepare array with list of tabs.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.