25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/webhook/class/target.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/webhook/lib/webhook_target.lib.php';
34 $langs->loadLangs(array(
'other'));
39 $action =
GETPOST(
'action',
'aZ09');
40 $cancel =
GETPOST(
'cancel',
'aZ09');
41 $backtopage =
GETPOST(
'backtopage',
'alpha');
43 if (
GETPOST(
'actioncode',
'array')) {
44 $actioncode =
GETPOST(
'actioncode',
'array', 3);
45 if (!count($actioncode)) {
52 $search_agenda_label =
GETPOST(
'search_agenda_label');
54 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
55 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
56 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
58 if (empty($page) || $page == -1) {
62 $offset = $limit * $page;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
66 $sortfield =
'a.datep,a.id';
69 $sortorder =
'DESC,DESC';
75 $diroutputmassaction = $conf->webhook->dir_output.
'/temp/massgeneration/'.$user->id;
76 $hookmanager->initHooks(array(
'targetagenda',
'globalcard'));
79 $extrafields->fetch_name_optionals_label($object->table_element);
82 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
83 if ($id > 0 || !empty($ref)) {
84 $upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity].
"/".$object->id;
89 $enablepermissioncheck = 0;
90 if ($enablepermissioncheck) {
91 $permissiontoread = $user->rights->webhook->target->read;
92 $permissiontoadd = $user->rights->webhook->target->write;
94 $permissiontoread = 1;
112 $parameters = array(
'id'=>$id);
113 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
118 if (empty($reshook)) {
120 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage)) {
121 header(
"Location: ".$backtopage);
126 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
128 $search_agenda_label =
'';
140 if ($object->id > 0) {
141 $title = $langs->trans(
"Agenda");
147 $langs->load(
"mails");
152 print
dol_get_fiche_head($head,
'agenda', $langs->trans(
"Target"), -1, $object->picto);
156 $linkback =
'<a href="'.dol_buildpath(
'/webhook/target_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
158 $morehtmlref =
'<div class="refidno">';
195 $morehtmlref .=
'</div>';
198 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
200 print
'<div class="fichecenter">';
201 print
'<div class="underbanner clearboth"></div>';
203 $object->info($object->id);
214 $objthirdparty = $object;
215 $objcon =
new stdClass();
217 $out =
'&origin='.urlencode($object->element.
'@'.$object->module).
'&originid='.urlencode($object->id);
218 $urlbacktopage = $_SERVER[
'PHP_SELF'].
'?id='.$object->id;
219 $out .=
'&backtopage='.urlencode($urlbacktopage);
220 $permok = $user->rights->agenda->myactions->create;
221 if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
223 if (get_class($objthirdparty) ==
'Societe') {
224 $out .=
'&socid='.urlencode($objthirdparty->id);
226 $out .= (!empty($objcon->id) ?
'&contactid='.urlencode($objcon->id) :
'');
233 print
'<div class="tabsAction">';
236 if (!empty($user->rights->agenda->myactions->create) || $user->hasRight(
'agenda',
'allactions',
'create')) {
237 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/comm/action/card.php?action=create'.$out.
'">'.$langs->trans(
"AddAction").
'</a>';
239 print
'<a class="butActionRefused classfortooltip" href="#">'.$langs->trans(
"AddAction").
'</a>';
245 if (
isModEnabled(
'agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
246 $param =
'&id='.$object->id.
'&socid='.$socid;
247 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
248 $param .=
'&contextpage='.urlencode($contextpage);
250 if ($limit > 0 && $limit != $conf->liste_limit) {
251 $param .=
'&limit='.urlencode($limit);
259 $filters[
'search_agenda_label'] = $search_agenda_label;
262 show_actions_done($conf, $langs, $db, $object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder, $object->module);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC', $module='')
Show html area with actions (done or not, ignore the name of function).
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
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_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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
targetPrepareHead($object)
Prepare array of tabs for Target.