31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/resource.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
38$langs->loadLangs(array(
'companies',
'resource',
'sendings'));
42$action =
GETPOST(
'action',
'aZ09');
47include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
51 $socid = $user->socid;
56if (!$user->hasRight(
'resource',
'read')) {
67if ($action ==
'addcontact' && $user->hasRight(
'resource',
'write')) {
68 if ($result > 0 && $id > 0) {
71 $result =
$object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
75 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
78 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
79 $langs->load(
"errors");
80 $mesg = $langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType");
87} elseif ($action ==
'swapstatut' && $user->hasRight(
'resource',
'write')) {
90} elseif ($action ==
'deletecontact' && $user->hasRight(
'resource',
'write')) {
95 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
107$form =
new Form($db);
109$contactstatic =
new Contact($db);
110$userstatic =
new User($db);
113llxHeader(
'', $langs->trans(
"Resource"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-resource page-card_contact');
117if ($id > 0 || !empty($ref)) {
119 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"ResourceSingular"), -1,
'resource');
122 $linkback =
'<a href="'.DOL_URL_ROOT.
'/resource/list.php'.(!empty($socid) ?
'?id='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
125 $morehtmlref =
'<div class="refidno">';
126 $morehtmlref .=
'</div>';
129 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
132 print
'<div class="fichecenter">';
133 print
'<div class="underbanner clearboth"></div>';
138 print
'<table class="border tableforfield centpercent">';
142 print
'<td class="titlefield">'.$langs->trans(
"ResourceType").
'</td>';
156 $hideaddcontactforuser = 1;
159 $hideaddcontactforthirdparty = 1;
164 include DOL_DOCUMENT_ROOT.
'/core/tpl/contacts.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 Dolibarr users.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
resource_prepare_head($object)
Prepare head for tabs.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.