Go to the documentation of this file.
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')) {
48 $actioncode =
GETPOST(
'actioncode',
'array', 3);
49 if (!count($actioncode)) {
53 $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));
55 $search_agenda_label =
GETPOST(
'search_agenda_label');
57 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61 if (empty($page) || $page == -1) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
68 $sortfield =
'a.datep,a.id';
71 $sortorder =
'DESC,DESC';
77 $hookmanager->initHooks(array(
'agendaresource'));
79 $object =
new DolResource($db);
82 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
84 $result =
restrictedArea($user,
'resource', $object->id,
'resource');
87 if (!$user->rights->resource->read) {
96 $parameters = array(
'id'=>$id);
97 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
102 if (empty($reshook)) {
104 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage)) {
105 header(
"Location: ".$backtopage);
110 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
112 $search_agenda_label =
'';
122 $contactstatic =
new Contact($db);
125 if ($object->id > 0) {
126 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
127 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
129 $langs->load(
"companies");
132 $title = $langs->trans(
"Agenda");
133 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
134 $title = $object->ref.
" - ".$title;
139 $langs->load(
"mails");
141 $type = $langs->trans(
'ResourceSingular');
145 $titre = $langs->trans(
"ResourceSingular");
148 $linkback =
'<a href="'.DOL_URL_ROOT.
'/resource/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
150 $morehtmlref =
'<div class="refidno">';
151 $morehtmlref .=
'</div>';
154 if ($user->socid && !in_array(
'resource', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
158 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
160 print
'<div class="fichecenter">';
161 print
'<div class="underbanner clearboth"></div>';
167 if (
isModEnabled(
'agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
168 $param =
'&id='.$object->id.
'&socid='.$socid;
169 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
170 $param .=
'&contextpage='.urlencode($contextpage);
172 if ($limit > 0 && $limit != $conf->liste_limit) {
173 $param .=
'&limit='.urlencode($limit);
176 print_barre_liste($langs->trans(
"ActionsOnResource"), 0, $_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlcenter,
'', 0, 1, 1);
180 $filters[
'search_agenda_label'] = $search_agenda_label;
183 show_actions_done($conf, $langs, $db, $object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
restrictedArea($user, $features, $objectid=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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
resource_prepare_head($object)
Prepare head for tabs.
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).
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.
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.
isModEnabled($module)
Is Dolibarr module enabled.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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 ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.