dolibarr  19.0.0-dev
contact.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 // Load Dolibarr environment
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
32 if (isModEnabled('categorie')) {
33  require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
34 }
35 
36 // Load translation files required by the page
37 $langsLoad=array('projects', 'companies');
38 if (isModEnabled('eventorganization')) {
39  $langsLoad[]='eventorganization';
40 }
41 
42 $langs->loadLangs($langsLoad);
43 
44 $id = GETPOST('id', 'int');
45 $ref = GETPOST('ref', 'alpha');
46 $lineid = GETPOST('lineid', 'int');
47 $socid = GETPOST('socid', 'int');
48 $action = GETPOST('action', 'aZ09');
49 
50 $mine = GETPOST('mode') == 'mine' ? 1 : 0;
51 //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
52 
53 $object = new Project($db);
54 
55 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
56 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
57  $object->fetchComments();
58 }
59 
60 // Security check
61 $socid = 0;
62 //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
63 $result = restrictedArea($user, 'projet', $id, 'projet&project');
64 
65 $hookmanager->initHooks(array('projectcontactcard', 'globalcard'));
66 
67 
68 /*
69  * Actions
70  */
71 
72 $parameters = array('id'=>$id);
73 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
74 if ($reshook < 0) {
75  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
76 }
77 
78 if (empty($reshook)) {
79  // Test if we can add contact to the tasks at the same times, if not or not required, make a redirect
80  $formconfirmtoaddtasks = '';
81  if ($action == 'addcontact') {
82  $form = new Form($db);
83 
84  $source=GETPOST("source", 'aZ09');
85 
86  $taskstatic = new Task($db);
87  $task_array = $taskstatic->getTasksArray(0, 0, $object->id, 0, 0);
88  $nbTasks = count($task_array);
89 
90  //If no task avaiblable, redirec to to add confirm
91  $type_to = (GETPOST('typecontact') ? 'typecontact='.GETPOST('typecontact') : 'type='.GETPOST('type'));
92  $personToAffect = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
93  $affect_to = (GETPOST('userid') ? 'userid='.$personToAffect : 'contactid='.$personToAffect);
94  $url_redirect='?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
95 
96  if ($personToAffect > 0 && (empty($conf->global->PROJECT_HIDE_TASKS) || $nbTasks > 0)) {
97  $text = $langs->trans('AddPersonToTask');
98  $textbody = $text.' (<a href="#" class="selectall">'.$langs->trans("SelectAll").'</a>)';
99  $formquestion = array('text' => $textbody);
100 
101  $task_to_affect = array();
102  foreach ($task_array as $task) {
103  $task_already_affected=false;
104  $personsLinked = $task->liste_contact(-1, $source);
105  if (!is_array($personsLinked) && count($personsLinked) < 0) {
106  setEventMessage($object->error, 'errors');
107  } else {
108  foreach ($personsLinked as $person) {
109  if ($person['id']==$personToAffect) {
110  $task_already_affected = true;
111  break;
112  }
113  }
114  if (!$task_already_affected) {
115  $task_to_affect[$task->id] = $task->id;
116  }
117  }
118  }
119 
120  if (empty($task_to_affect)) {
121  $action = 'addcontact_confirm';
122  } else {
123  $formcompany = new FormCompany($db);
124  foreach ($task_array as $task) {
125  $key = $task->id;
126  $val = $task->ref . ' '.dol_trunc($task->label);
127  $formquestion[] = array(
128  'type' => 'other',
129  'name' => 'person_'.$key.',person_role_'.$key,
130  'label' => '<input type="checkbox" class="flat'.(in_array($key, $task_to_affect) ? ' taskcheckboxes"' : '" checked disabled').' id="person_'.$key.'" name="person_'.$key.'" value="1"> <label for="person_'.$key.'">'.$val.'<label>',
131  'value' => $formcompany->selectTypeContact($taskstatic, '', 'person_role_'.$key, $source, 'position', 0, 'minwidth100imp', 0, 1)
132  );
133  }
134  $formquestion[] = array('type'=> 'other', 'name'=>'tasksavailable', 'label'=>'', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',', array_keys($task_to_affect)).'">');
135  }
136 
137  $formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);
138  $formconfirmtoaddtasks .='
139  <script>
140  $(document).ready(function() {
141  var saveprop = false;
142  $(".selectall").click(function(){
143  console.log("We click on select all with "+saveprop);
144  if (!saveprop) {
145  $(".taskcheckboxes").prop("checked", true);
146  saveprop = true;
147  } else {
148  $(".taskcheckboxes").prop("checked", false);
149  saveprop = false;
150  }
151  });
152  });
153  </script>';
154  } else {
155  $action = 'addcontact_confirm';
156  }
157  }
158 
159  // Add new contact
160  if ($action == 'addcontact_confirm' && $user->rights->projet->creer) {
161  $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
162  $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
163 
164  if (! ($contactid > 0)) {
165  $error++;
166  $langs->load("errors");
167  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
168  }
169 
170  $result = 0;
171  $result = $object->fetch($id);
172 
173  if (!$error && $result > 0 && $id > 0) {
174  $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
175 
176  if ($result == 0) {
177  $langs->load("errors");
178  setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
179  } elseif ($result < 0) {
180  if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
181  $langs->load("errors");
182  setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
183  } else {
184  setEventMessages($object->error, $object->errors, 'errors');
185  }
186  }
187 
188  $affecttotask=GETPOST('tasksavailable', 'intcomma');
189  if (!empty($affecttotask)) {
190  require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
191  $task_to_affect = explode(',', $affecttotask);
192  if (!empty($task_to_affect)) {
193  foreach ($task_to_affect as $task_id) {
194  if (GETPOSTISSET('person_'.$task_id) && GETPOST('person_'.$task_id, 'san_alpha')) {
195  $tasksToAffect = new Task($db);
196  $result=$tasksToAffect->fetch($task_id);
197  if ($result < 0) {
198  setEventMessages($tasksToAffect->error, null, 'errors');
199  } else {
200  $result = $tasksToAffect->add_contact($contactid, GETPOST('person_role_'.$task_id), GETPOST("source", 'aZ09'));
201  if ($result < 0) {
202  if ($tasksToAffect->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
203  $langs->load("errors");
204  setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
205  } else {
206  setEventMessages($tasksToAffect->error, $tasksToAffect->errors, 'errors');
207  }
208  }
209  }
210  }
211  }
212  }
213  }
214  }
215 
216  if ($result >= 0) {
217  header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
218  exit;
219  }
220  }
221 
222  // Change contact's status
223  if ($action == 'swapstatut' && $user->rights->projet->creer) {
224  if ($object->fetch($id)) {
225  $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
226  } else {
227  dol_print_error($db);
228  }
229  }
230 
231  // Delete a contact
232  if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->projet->creer) {
233  $object->fetch($id);
234  $result = $object->delete_contact(GETPOST("lineid", 'int'));
235 
236  if ($result >= 0) {
237  header("Location: contact.php?id=".$object->id);
238  exit;
239  } else {
240  dol_print_error($db);
241  }
242  }
243 }
244 
245 
246 /*
247  * View
248  */
249 
250 $form = new Form($db);
251 $contactstatic = new Contact($db);
252 $userstatic = new User($db);
253 
254 $title = $langs->trans('ProjectContact').' - '.$object->ref.' '.$object->name;
255 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
256  $title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectContact');
257 }
258 
259 $help_url = 'EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos|DE:Modul_Projekte';
260 
261 llxHeader('', $title, $help_url);
262 
263 
264 
265 if ($id > 0 || !empty($ref)) {
266  /*
267  * View
268  */
269  if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
270  $object->fetchComments();
271  }
272  // To verify role of users
273  //$userAccess = $object->restrictedProjectArea($user,'read');
274  $userWrite = $object->restrictedProjectArea($user, 'write');
275  //$userDelete = $object->restrictedProjectArea($user,'delete');
276  //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
277 
278  $head = project_prepare_head($object);
279  print dol_get_fiche_head($head, 'contact', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
280 
281  $formconfirm = $formconfirmtoaddtasks;
282 
283  // Call Hook formConfirm
284  $parameters = array('formConfirm' => $formconfirm);
285  $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
286  if (empty($reshook)) {
287  $formconfirm .= $hookmanager->resPrint;
288  } elseif ($reshook > 0) {
289  $formconfirm = $hookmanager->resPrint;
290  }
291 
292  // Print form confirm
293  print $formconfirm;
294 
295  // Project card
296 
297  $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
298 
299  $morehtmlref = '<div class="refidno">';
300  // Title
301  $morehtmlref .= dol_escape_htmltag($object->title);
302  $morehtmlref .= '<br>';
303  // Thirdparty
304  if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
305  $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project');
306  }
307  $morehtmlref .= '</div>';
308 
309  // Define a complementary filter for search of next/prev ref.
310  if (empty($user->rights->projet->all->lire)) {
311  $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
312  $object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
313  }
314 
315  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
316 
317 
318  print '<div class="fichecenter">';
319  print '<div class="fichehalfleft">';
320  print '<div class="underbanner clearboth"></div>';
321 
322  print '<table class="border tableforfield centpercent">';
323 
324  // Usage
325  if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
326  print '<tr><td class="tdtop">';
327  print $langs->trans("Usage");
328  print '</td>';
329  print '<td>';
330  if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
331  print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'"> ';
332  $htmltext = $langs->trans("ProjectFollowOpportunity");
333  print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
334  print '<br>';
335  }
336  if (empty($conf->global->PROJECT_HIDE_TASKS)) {
337  print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'"> ';
338  $htmltext = $langs->trans("ProjectFollowTasks");
339  print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
340  print '<br>';
341  }
342  if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
343  print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'"> ';
344  $htmltext = $langs->trans("ProjectBillTimeDescription");
345  print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
346  print '<br>';
347  }
348  if (isModEnabled('eventorganization')) {
349  print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
350  $htmltext = $langs->trans("EventOrganizationDescriptionLong");
351  print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
352  }
353  print '</td></tr>';
354  }
355 
356  // Visibility
357  print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
358  if ($object->public) {
359  print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
360  print $langs->trans('SharedProject');
361  } else {
362  print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
363  print $langs->trans('PrivateProject');
364  }
365  print '</td></tr>';
366 
367  if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) {
368  // Opportunity status
369  print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
370  $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
371  if ($code) {
372  print $langs->trans("OppStatus".$code);
373  }
374 
375  // Opportunity percent
376  print ' <span title="'.$langs->trans("OpportunityProbability").'"> / ';
377  if (strcmp($object->opp_percent, '')) {
378  print price($object->opp_percent, 0, $langs, 1, 0).' %';
379  }
380  print '</span></td></tr>';
381 
382  // Opportunity Amount
383  print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
384  if (strcmp($object->opp_amount, '')) {
385  print '<span class="amount">'.price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency).'</span>';
386  if (strcmp($object->opp_percent, '')) {
387  print ' &nbsp; &nbsp; &nbsp; <span title="'.dol_escape_htmltag($langs->trans('OpportunityWeightedAmount')).'"><span class="opacitymedium">'.$langs->trans("Weighted").'</span>: <span class="amount">'.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).'</span></span>';
388  }
389  }
390  print '</td></tr>';
391  }
392 
393  // Budget
394  print '<tr><td>'.$langs->trans("Budget").'</td><td>';
395  if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
396  print '<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
397  }
398  print '</td></tr>';
399 
400  // Date start - end project
401  print '<tr><td>'.$langs->trans("Dates").'</td><td>';
402  $start = dol_print_date($object->date_start, 'day');
403  print ($start ? $start : '?');
404  $end = dol_print_date($object->date_end, 'day');
405  print ' <span class="opacitymedium">-</span> ';
406  print ($end ? $end : '?');
407  if ($object->hasDelay()) {
408  print img_warning("Late");
409  }
410  print '</td></tr>';
411 
412  // Other attributes
413  $cols = 2;
414  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
415 
416  print "</table>";
417 
418  print '</div>';
419  print '<div class="fichehalfright">';
420  print '<div class="underbanner clearboth"></div>';
421 
422  print '<table class="border tableforfield centpercent">';
423 
424  // Description
425  print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
426  print dol_htmlentitiesbr($object->description);
427  print '</td></tr>';
428 
429  // Categories
430  if (isModEnabled('categorie')) {
431  print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
432  print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
433  print "</td></tr>";
434  }
435 
436  print '</table>';
437 
438  print '</div>';
439  print '</div>';
440 
441  print '<div class="clearboth"></div>';
442 
443  print dol_get_fiche_end();
444 
445  print '<br>';
446 
447  // Contacts lines (modules that overwrite templates must declare this into descriptor)
448  $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
449  foreach ($dirtpls as $reldir) {
450  $res = @include dol_buildpath($reldir.'/contacts.tpl.php');
451  if ($res) {
452  break;
453  }
454  }
455 }
456 
457 // End of page
458 llxFooter();
459 $db->close();
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.
Definition: agenda.php:118
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 contact/addresses.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage tasks.
Definition: task.class.php:40
Class to manage Dolibarr users.
Definition: user.class.php:48
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
isModEnabled($module)
Is Dolibarr module enabled.
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...
$formconfirm
if ($action == 'delbookkeepingyear') {
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
Definition: project.lib.php:39
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.