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.
'/core/lib/project.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38 $langs->loadLangs(array(
'projects',
'companies'));
41 $idcomment =
GETPOST(
'idcomment',
'int');
42 $ref =
GETPOST(
"ref",
'alpha', 1);
43 $objectref =
GETPOST(
"taskref",
'alpha');
44 $action =
GETPOST(
'action',
'aZ09');
45 $confirm =
GETPOST(
'confirm',
'alpha');
46 $withproject =
GETPOST(
'withproject',
'int');
51 if (!$user->rights->projet->lire) {
56 $hookmanager->initHooks(array(
'projectcard',
'globalcard'));
62 $extrafields->fetch_name_optionals_label($object->table_element);
65 if ($id > 0 || !empty($ref)) {
66 $ret = $object->fetch($id, $ref);
68 $object->fetch_thirdparty();
69 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) {
70 $object->fetchComments();
77 include DOL_DOCUMENT_ROOT.
'/core/actions_comments.inc.php';
83 $title = $langs->trans(
'CommentPage');
92 $tab =
'project_comment';
94 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), - 1, ($object->public ?
'projectpub' :
'project'));
96 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
100 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
102 $morehtmlref =
'<div class="refidno">';
104 $morehtmlref .= $object->title;
106 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
107 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty').
' : '.$object->thirdparty->getNomUrl(1,
'project');
109 $morehtmlref .=
'</div>';
112 if (empty($user->rights->projet->all->lire)) {
113 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
114 $object->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ? join(
',', array_keys($objectsListId)) :
'0').
")";
117 dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
119 print
'<div class="fichecenter">';
120 print
'<div class="fichehalfleft">';
121 print
'<div class="underbanner clearboth"></div>';
123 print
'<table class="border centpercent">';
126 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
127 if ($object->public) {
128 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
129 print $langs->trans(
'SharedProject');
131 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
132 print $langs->trans(
'PrivateProject');
137 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"DateEnd").
'</td><td>';
146 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
147 if (strcmp($object->budget_amount,
'')) {
148 print
price($object->budget_amount,
'', $langs, 1, 0, 0, $conf->currency);
159 print
'<div class="fichehalfright">';
160 print
'<div class="underbanner clearboth"></div>';
162 print
'<table class="border centpercent">';
165 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
166 print nl2br($object->description);
171 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
172 print
$form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
177 print
'<td class="titlefield">'.$langs->trans(
"NbComments").
'</td><td>';
178 print $object->getNbComments();
186 print
'<div class="clearboth"></div>';
193 include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_comment.tpl.php';