27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
39$langs->loadLangs(array(
'projects',
'companies'));
42$idcomment =
GETPOST(
'idcomment',
'int');
43$ref =
GETPOST(
"ref",
'alpha', 1);
44$objectref =
GETPOST(
"taskref",
'alpha');
45$action =
GETPOST(
'action',
'aZ09');
46$confirm =
GETPOST(
'confirm',
'alpha');
47$withproject =
GETPOST(
'withproject',
'int');
52if (!$user->rights->projet->lire) {
57$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
63$extrafields->fetch_name_optionals_label($object->table_element);
66if ($id > 0 || !empty($ref)) {
67 $ret = $object->fetch($id, $ref);
69 $object->fetch_thirdparty();
70 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) {
71 $object->fetchComments();
78include DOL_DOCUMENT_ROOT.
'/core/actions_comments.inc.php';
84$title = $langs->trans(
'CommentPage');
93$tab =
'project_comment';
95print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), - 1, ($object->public ?
'projectpub' :
'project'));
97$param = ($mode ==
'mine' ?
'&mode=mine' :
'');
101if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
102 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
103 $tmpurl = preg_replace(
'/__SOCID__/', $object->socid, $tmpurl);
104 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
106 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
109$morehtmlref =
'<div class="refidno">';
111$morehtmlref .= $object->title;
113if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
114 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
116$morehtmlref .=
'</div>';
119if (empty($user->rights->projet->all->lire)) {
120 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
121 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
124dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
126print
'<div class="fichecenter">';
127print
'<div class="fichehalfleft">';
128print
'<div class="underbanner clearboth"></div>';
130print
'<table class="border centpercent">';
133print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
134if ($object->public) {
135 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
136 print $langs->trans(
'SharedProject');
138 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
139 print $langs->trans(
'PrivateProject');
144print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
145if (!is_null($object->budget_amount) && strcmp($object->budget_amount,
'')) {
146 print
price($object->budget_amount,
'', $langs, 1, 0, 0, $conf->currency);
151print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
166print
'<div class="fichehalfright">';
167print
'<div class="underbanner clearboth"></div>';
169print
'<table class="border centpercent">';
172print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
173print nl2br($object->description);
177if (isModEnabled(
'categorie')) {
178 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
179 print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
184print
'<td class="titlefield">'.$langs->trans(
"NbComments").
'</td><td>';
185print $object->getNbComments();
193print
'<div class="clearboth"></div>';
200include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_comment.tpl.php';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
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.
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_get_fiche_end($notab=0)
Return tab footer of a card.
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)
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.