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"));
38$lineid =
GETPOST(
'lineid',
'int');
39$socid =
GETPOST(
'socid',
'int');
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);
57restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element,
'',
'rowid', $isdraft);
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) {
84 $result = $object->swapContactStatus(
GETPOST(
'ligne',
'int'));
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');
107$form =
new Form($db);
109$contactstatic =
new Contact($db);
110$userstatic =
new User($db);
119 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"KnowledgeRecord"), -1, $object->picto);
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(!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.
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='', $dragdropfile=0)
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.
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.
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.