26require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/knowledgemanagement/class/knowledgerecord.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php';
34$langs->loadLangs(array(
"knowledgemanagement",
"companies",
"other",
"mails"));
40$action =
GETPOST(
'action',
'aZ09');
45$diroutputmassaction = $conf->knowledgemanagement->dir_output.
'/temp/massgeneration/'.$user->id;
46$hookmanager->initHooks(array(
'knowledgerecordcontact',
'globalcard'));
48$extrafields->fetch_name_optionals_label(
$object->table_element);
51include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
56$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
59$permission = $user->hasRight(
'knowledgemanagement',
'knowledgerecord',
'write');
66if ($action ==
'addcontact' && $permission) {
69 $result =
$object->add_contact($contactid, $typeid,
GETPOST(
"source",
'aZ09'));
72 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
75 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
76 $langs->load(
"errors");
77 setEventMessages($langs->trans(
"ErrorThisContactIsAlreadyDefinedAsThisType"),
null,
'errors');
82} elseif ($action ==
'swapstatut' && $permission) {
85} elseif ($action ==
'deletecontact' && $permission) {
87 $result =
$object->delete_contact($lineid);
90 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
102$title = $langs->trans(
'KnowledgeRecord').
" - ".$langs->trans(
'ContactsAddresses');
105llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-knowledgemanagement page-contact');
107$form =
new Form($db);
109$contactstatic =
new Contact($db);
110$userstatic =
new User($db);
121 $linkback =
'<a href="'.dol_buildpath(
'/knowledgemanagement/knowledgerecord_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
123 $morehtmlref =
'<div class="refidno">';
161 $morehtmlref .=
'</div>';
163 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
170 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array(
'/core/tpl'));
171 foreach ($dirtpls as $reldir) {
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 for KnowledgeRecord.
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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
knowledgerecordPrepareHead($object)
Prepare array of tabs for KnowledgeRecord.
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.