dolibarr 18.0.6
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24// Load Dolibarr environment
25require '../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
27
28// Load translation files required by the page
29$langs->loadLangs(array('bookmarks', 'admin'));
30
31// Get Parameters
32$action = GETPOST('action', 'aZ09');
33$massaction = GETPOST('massaction', 'alpha');
34$show_files = GETPOST('show_files', 'int');
35$confirm = GETPOST('confirm', 'alpha');
36$cancel = GETPOST('cancel', 'alpha');
37$toselect = GETPOST('toselect', 'array');
38$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
39$backtopage = GETPOST('backtopage', 'alpha');
40$optioncss = GETPOST('optioncss', 'alpha');
41$mode = GETPOST('mode', 'aZ');
42
43$id = GETPOST("id", 'int');
44$search_title = GETPOST('search_title', 'alpha');
45
46// Load variable for pagination
47$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
48$sortfield = GETPOST('sortfield', 'aZ09comma');
49$sortorder = GETPOST('sortorder', 'aZ09comma');
50$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
51if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
52 // If $page is not defined, or '' or -1 or if we click on clear filters
53 $page = 0;
54}
55$offset = $limit * $page;
56$pageprev = $page - 1;
57$pagenext = $page + 1;
58if (!$sortfield) {
59 $sortfield = 'b.position';
60}
61if (!$sortorder) {
62 $sortorder = 'ASC';
63}
64
65// Initialize Objects
66$object = new Bookmark($db);
67$extrafields = new ExtraFields($db);
68$arrayfields = array();
69$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
70
71if ($id > 0) {
72 $object->fetch($id);
73}
74
75$object->fields = dol_sort_array($object->fields, 'position');
76$arrayfields = dol_sort_array($arrayfields, 'position');
77
78// Security check
79restrictedArea($user, 'bookmark', $object);
80
81// Permissions
82$permissiontoread = $user->hasRight('bookmark', 'lire');
83$permissiontoadd = $user->hasRight('bookmark', 'creer');
84$permissiontodelete = ($user->hasRight('bookmark', 'supprimer') || ($permissiontoadd && $object->fk_user == $user->id));
85
86
87/*
88 * Actions
89 */
90
91if (GETPOST('cancel', 'alpha')) {
92 $action = 'list';
93 $massaction = '';
94}
95if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
96 $massaction = '';
97}
98
99$parameters = array();
100$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
101if ($reshook < 0) {
102 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
103}
104
105if (empty($reshook)) {
106 // Selection of new fields
107 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
108
109 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
110 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
111 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
112 }
113
114 // Mass actions
115 $objectclass = 'Bookmark';
116 $objectlabel = 'Bookmark';
117 $uploaddir = $conf->bookmark->dir_output;
118 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
119
120 if ($action == 'delete' && $permissiontodelete) {
121 $object->fetch($id);
122 $res = $object->delete($user);
123 if ($res > 0) {
124 header("Location: ".$_SERVER["PHP_SELF"]);
125 exit;
126 } else {
127 setEventMessages($object->error, $object->errors, 'errors');
128 $action = '';
129 }
130 }
131}
132
133
134/*
135 * View
136 */
137
138$form = new Form($db);
139
140$now = dol_now();
141
142//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
143$help_url = '';
144$title = $langs->trans("Bookmarks");
145$morejs = array();
146$morecss = array();
147
148
149// Build and execute select
150// --------------------------------------------------------------------
151$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
152$sql .= " u.login, u.lastname, u.firstname";
153// Add fields from extrafields
154if (!empty($extrafields->attributes[$object->table_element]['label'])) {
155 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
156 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
157 }
158}
159// Add fields from hooks
160$parameters = array();
161$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
162$sql .= $hookmanager->resPrint;
163$sql = preg_replace('/,\s*$/', '', $sql);
164
165$sqlfields = $sql; // $sql fields to remove for count total
166
167$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
168$sql .= " WHERE 1=1";
169if ($search_title) {
170 $sql .= natural_search('title', $search_title);
171}
172$sql .= " AND b.entity IN (".getEntity('bookmark').")";
173if (!$user->admin) {
174 $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
175}
176
177// Count total nb of records
178$nbtotalofrecords = '';
179if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
180 /* The fast and low memory method to get and count full list converts the sql into a sql count */
181 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
182 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
183 $resql = $db->query($sqlforcount);
184 if ($resql) {
185 $objforcount = $db->fetch_object($resql);
186 $nbtotalofrecords = $objforcount->nbtotalofrecords;
187 } else {
188 dol_print_error($db);
189 }
190
191 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
192 $page = 0;
193 $offset = 0;
194 }
195 $db->free($resql);
196}
197
198// Complete request and execute it with limit
199$sql .= $db->order($sortfield.", position", $sortorder);
200if ($limit) {
201 $sql .= $db->plimit($limit + 1, $offset);
202}
203
204$resql = $db->query($sql);
205if (!$resql) {
206 dol_print_error($db);
207 exit;
208}
209
210$num = $db->num_rows($resql);
211
212
213// Output page
214// --------------------------------------------------------------------
215
216llxHeader('', $title);
217
218$arrayofselected = is_array($toselect) ? $toselect : array();
219
220$param = '';
221if (!empty($mode)) {
222 $param .= '&mode='.urlencode($mode);
223}
224if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
225 $param .= '&contextpage='.urlencode($contextpage);
226}
227if ($limit > 0 && $limit != $conf->liste_limit) {
228 $param .= '&limit='.((int) $limit);
229}
230if ($optioncss != '') {
231 $param .= '&optioncss='.urlencode($optioncss);
232}
233// Add $param from extra fields
234include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
235// Add $param from hooks
236$parameters = array();
237$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
238$param .= $hookmanager->resPrint;
239
240// List of mass actions available
241$arrayofmassactions = array(
242 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
243 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
244 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
245 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
246);
247if (!empty($permissiontodelete)) {
248 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
249}
250if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
251 $arrayofmassactions = array();
252}
253$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
254
255print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
256if ($optioncss != '') {
257 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
258}
259print '<input type="hidden" name="token" value="'.newToken().'">';
260print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
261print '<input type="hidden" name="action" value="list">';
262print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
263print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
264print '<input type="hidden" name="page" value="'.$page.'">';
265print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
266print '<input type="hidden" name="page_y" value="">';
267print '<input type="hidden" name="mode" value="'.$mode.'">';
268
269
270$newcardbutton = '';
271$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', $permissiontoadd);
272
273print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
274
275// Add code for pre mass action (confirmation or email presend form)
276$topicmail = "SendBookmarkRef";
277$modelmail = "bookmark";
278$objecttmp = new Bookmark($db);
279$trackid = 'bookmark'.$object->id;
280include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
281
282$moreforfilter = '';
283
284$parameters = array();
285$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
286if (empty($reshook)) {
287 $moreforfilter .= $hookmanager->resPrint;
288} else {
289 $moreforfilter = $hookmanager->resPrint;
290}
291
292if (!empty($moreforfilter)) {
293 print '<div class="liste_titre liste_titre_bydiv centpercent">';
294 print $moreforfilter;
295 print '</div>';
296}
297
298$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
299$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
300$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
301
302print '<div class="div-table-responsive">';
303print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
304
305// Fields title search
306// --------------------------------------------------------------------
307// TODO
308
309$totalarray = array();
310$totalarray['nbfield'] = 0;
311
312// Fields title label
313// --------------------------------------------------------------------
314print '<tr class="liste_titre">';
315if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
316 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
317 $totalarray['nbfield']++;
318}
319print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
320$totalarray['nbfield']++;
321print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
322$totalarray['nbfield']++;
323print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
324$totalarray['nbfield']++;
325print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
326$totalarray['nbfield']++;
327print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
328$totalarray['nbfield']++;
329print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
330$totalarray['nbfield']++;
331print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
332$totalarray['nbfield']++;
333if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
334 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
335 $totalarray['nbfield']++;
336}
337print '</tr>'."\n";
338
339// Loop on record
340// --------------------------------------------------------------------
341$i = 0;
342$savnbfield = $totalarray['nbfield'];
343$totalarray = array();
344$totalarray['nbfield'] = 0;
345$imaxinloop = ($limit ? min($num, $limit) : $num);
346while ($i < $imaxinloop) {
347 $obj = $db->fetch_object($resql);
348 if (empty($obj)) {
349 break; // Should not happen
350 }
351
352 $object->id = $obj->rowid;
353 $object->ref = $obj->rowid;
354
355 if ($mode == 'kanban') {
356 if ($i == 0) {
357 print '<tr><td colspan="'.$savnbfield.'">';
358 print '<div class="box-flex-container">';
359 }
360 // Output Kanban
361 print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
362 if ($i == ($imaxinloop - 1)) {
363 print '</div>';
364 print '</td></tr>';
365 }
366 } else {
367 // Show here line of result
368 $j = 0;
369 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
370 // Action column
371 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
372 print '<td class="nowrap center">';
373 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
374 $selected = 0;
375 if (in_array($object->id, $arrayofselected)) {
376 $selected = 1;
377 }
378 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
379 }
380 print '</td>';
381 if (!$i) {
382 $totalarray['nbfield']++;
383 }
384 }
385
386 // Id
387 print '<td class="nowraponall">';
388 print $object->getNomUrl(1);
389 print '</td>';
390
391 $linkintern = 1;
392 if (preg_match('/^http/i', $obj->url)) {
393 $linkintern = 0;
394 }
395 $title = $obj->title;
396 $link = $obj->url;
397 $canedit = $permissiontoadd;
398 $candelete = $permissiontodelete;
399
400 // Title
401 print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
402 print dol_escape_htmltag($title);
403 print "</td>\n";
404
405 // Url
406 print '<td class="tdoverflowmax200">';
407 if (empty($linkintern)) {
408 print img_picto('', 'url', 'class="pictofixedwidth"');
409 print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
410 } else {
411 //print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
412 print '<a class="" href="'.$obj->url.'">';
413 }
414 print $link;
415 print '</a>';
416 print "</td>\n";
417
418 // Target
419 print '<td class="tdoverflowmax100 center">';
420 if ($obj->target == 0) {
421 print $langs->trans("BookmarkTargetReplaceWindowShort");
422 }
423 if ($obj->target == 1) {
424 print $langs->trans("BookmarkTargetNewWindowShort");
425 }
426 print "</td>\n";
427
428 // Author
429 print '<td class="tdoverflowmax100 center">';
430 if ($obj->fk_user > 0) {
431 if (empty($conf->cache['users'][$obj->fk_user])) {
432 $tmpuser = new User($db);
433 $tmpuser->fetch($obj->fk_user);
434 $conf->cache['users'][$obj->fk_user] = $tmpuser;
435 }
436 $tmpuser = $conf->cache['users'][$obj->fk_user];
437 print $tmpuser->getNomUrl(-1);
438 } else {
439 print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
440 if (!$user->admin) {
441 $candelete = false;
442 $canedit = false;
443 }
444 }
445 print "</td>\n";
446
447 // Date creation
448 print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
449
450 // Position
451 print '<td class="right">'.$obj->position."</td>";
452
453 // Action column
454 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
455 print '<td class="nowrap center">';
456 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
457 $selected = 0;
458 if (in_array($object->id, $arrayofselected)) {
459 $selected = 1;
460 }
461 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
462 }
463 print '</td>';
464 if (!$i) {
465 $totalarray['nbfield']++;
466 }
467 }
468
469 print "</tr>\n";
470 }
471
472 $i++;
473}
474
475// Show total line
476include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
477
478// If no record found
479if ($num == 0) {
480 $colspan = 1;
481 foreach ($arrayfields as $key => $val) {
482 if (!empty($val['checked'])) {
483 $colspan++;
484 }
485 }
486 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
487}
488
489$db->free($resql);
490
491$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
492$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
493print $hookmanager->resPrint;
494
495print '</table>'."\n";
496print '</div>'."\n";
497
498print '</form>'."\n";
499
500
501// End of page
502llxFooter();
503$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:56
llxFooter()
Empty footer.
Definition wrapper.php:70
Class to manage bookmarks.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
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.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.