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;
45 if (!$sortfield) $sortfield =
"a.datep,a.id";
46 if (!$sortorder) $sortorder =
"DESC";
47 $offset = $limit * $page;
48 $pageprev = $page - 1;
49 $pagenext = $page + 1;
51 if (
GETPOST(
'actioncode',
'array'))
53 $actioncode =
GETPOST(
'actioncode',
'array', 3);
54 if (!count($actioncode)) $actioncode =
'0';
56 $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));
58 $search_agenda_label =
GETPOST(
'search_agenda_label');
74 $parameters = array(
'id'=>$socid);
75 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
76 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
79 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
82 $search_agenda_label =
'';
91 $form =
new Form($db);
94 if ($id > 0 || !empty($ref))
96 $object->fetch($id, $ref);
97 $object->fetch_thirdparty();
98 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) $object->fetchComments();
99 $object->info($object->id);
102 $title = $langs->trans(
"Project").
' - '.$object->ref.
' '.$object->name;
103 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.
' '.$object->name.
' - '.$langs->trans(
"Info");
104 $help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
109 print dol_get_fiche_head($head,
'agenda', $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
114 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
116 $morehtmlref =
'<div class="refidno">';
118 $morehtmlref .= $object->title;
120 if ($object->thirdparty->id > 0)
122 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1,
'project');
124 $morehtmlref .=
'</div>';
127 if (!$user->rights->projet->all->lire)
129 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
130 $object->next_prev_filter =
" rowid in (".(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
133 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
136 print '<div class="fichecenter">';
137 print '<div class="underbanner clearboth"></div>';
143 print '<div class="clearboth"></div>';
151 $permok = $user->rights->agenda->myactions->create;
154 $out .=
'&projectid='.$object->id;
159 $morehtmlcenter =
'';
160 if (!empty($conf->agenda->enabled))
162 $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
163 $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);
168 if (!empty($object->id))
172 $param =
'&id='.$object->id;
173 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.$contextpage;
174 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.$limit;
176 print_barre_liste($langs->trans(
"ActionsOnProject"), 0,
$_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlcenter,
'', 0, 1, 1);
180 $filters[
'search_agenda_label'] = $search_agenda_label;
181 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.
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.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
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).
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.
Class to manage projects.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an 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 ...
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.
project_prepare_head(Project $project)
Prepare array with list of tabs.
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.