Go to the documentation of this file.
25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 $langs->load(
"projects");
36 $socid =
GETPOST(
'socid',
'int');
37 $action =
GETPOST(
'action',
'aZ09');
39 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
40 $sortfield =
GETPOST(
"sortfield",
"aZ09comma");
41 $sortorder =
GETPOST(
"sortorder",
'aZ09comma');
43 $page = is_numeric($page) ? $page : 0;
44 $page = $page == -1 ? 0 : $page;
46 $sortfield =
"a.datep,a.id";
51 $offset = $limit * $page;
52 $pageprev = $page - 1;
53 $pagenext = $page + 1;
55 if (
GETPOST(
'actioncode',
'array')) {
56 $actioncode =
GETPOST(
'actioncode',
'array', 3);
57 if (!count($actioncode)) {
61 $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));
63 $search_agenda_label =
GETPOST(
'search_agenda_label');
65 $hookmanager->initHooks(array(
'projectcardinfo'));
73 if (!$user->rights->projet->lire) {
83 $parameters = array(
'id'=>$socid);
84 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
90 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
92 $search_agenda_label =
'';
104 if ($id > 0 || !empty($ref)) {
105 $object->fetch($id, $ref);
106 $object->fetch_thirdparty();
107 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) {
108 $object->fetchComments();
110 $object->info($object->id);
113 $title = $langs->trans(
"Project").
' - '.$object->ref.
' '.$object->name;
114 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
115 $title = $object->ref.
' '.$object->name.
' - '.$langs->trans(
"Info");
117 $help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
122 print
dol_get_fiche_head($head,
'agenda', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
127 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
129 $morehtmlref =
'<div class="refidno">';
131 $morehtmlref .= $object->title;
133 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
134 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1,
'project');
136 $morehtmlref .=
'</div>';
139 if (empty($user->rights->projet->all->lire)) {
140 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
141 $object->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
144 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
147 print
'<div class="fichecenter">';
148 print
'<div class="underbanner clearboth"></div>';
154 print
'<div class="clearboth"></div>';
162 $permok = $user->rights->agenda->myactions->create;
164 $out .=
'&projectid='.$object->id;
169 $morehtmlcenter =
'';
171 $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
172 $morehtmlcenter .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/comm/action/card.php?action=create'.$out.
'&socid='.$object->socid.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$object->id),
'', $addActionBtnRight);
177 if (!empty($object->id)) {
180 $param =
'&id='.$object->id;
181 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
182 $param .=
'&contextpage='.$contextpage;
184 if ($limit > 0 && $limit != $conf->liste_limit) {
185 $param .=
'&limit='.$limit;
188 print_barre_liste($langs->trans(
"ActionsOnProject"), 0, $_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlcenter,
'', 0, 1, 1);
192 $filters[
'search_agenda_label'] = $search_agenda_label;
193 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.
Class to manage projects.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
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.
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.
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.
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.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
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.