31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/resource.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
38 $langs->load(
"companies");
43 $action =
GETPOST(
'action',
'aZ09');
44 $cancel =
GETPOST(
'cancel',
'aZ09');
45 $backtopage =
GETPOST(
'backtopage',
'alpha');
47 if (
GETPOST(
'actioncode',
'array'))
49 $actioncode =
GETPOST(
'actioncode',
'array', 3);
50 if (!count($actioncode)) $actioncode =
'0';
52 $actioncode =
GETPOST(
"actioncode",
"alpha", 3) ?
GETPOST(
"actioncode",
"alpha", 3) : (
GETPOST(
"actioncode") ==
'0' ?
'0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
54 $search_agenda_label =
GETPOST(
'search_agenda_label');
56 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
57 $sortfield =
GETPOST(
"sortfield",
'alpha');
58 $sortorder =
GETPOST(
"sortorder",
'alpha');
60 if (empty($page) || $page == -1) { $page = 0; }
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
64 if (!$sortfield) $sortfield =
'a.datep,a.id';
65 if (!$sortorder) $sortorder =
'DESC,DESC';
67 $object =
new DolResource($db);
68 $object->fetch($id, $ref);
73 $hookmanager->initHooks(array(
'agendaresource'));
76 if (!$user->rights->resource->read)
86 $parameters = array(
'id'=>$id);
87 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
88 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
93 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage))
95 header(
"Location: ".$backtopage);
100 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
103 $search_agenda_label =
'';
113 $contactstatic =
new Contact($db);
114 $form =
new Form($db);
118 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
119 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
121 $langs->load(
"companies");
124 $title = $langs->trans(
"Agenda");
125 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.
" - ".$title;
128 if (!empty($conf->notification->enabled)) $langs->load(
"mails");
129 $type = $langs->trans(
'ResourceSingular');
133 $titre = $langs->trans(
"ResourceSingular");
136 $linkback =
'<a href="'.DOL_URL_ROOT.
'/resource/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
138 $morehtmlref =
'<div class="refidno">';
139 $morehtmlref .=
'</div>';
142 if ($user->socid && !in_array(
'resource', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav = 0;
144 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
146 print '<div class="fichecenter">';
147 print '<div class="underbanner clearboth"></div>';
153 if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
155 $param =
'&id='.$object->id.
'&socid='.$socid;
156 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
157 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
159 print_barre_liste($langs->trans(
"ActionsOnResource"), 0,
$_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlcenter,
'', 0, 1, 1);
163 $filters[
'search_agenda_label'] = $search_agenda_label;
166 show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
resource_prepare_head($object)
Prepare head for tabs.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.