28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
40$langs->loadLangs(array(
'projects',
'companies'));
44$ref =
GETPOST(
"ref",
'alpha', 1);
45$objectref =
GETPOST(
"taskref",
'alpha');
46$action =
GETPOST(
'action',
'aZ09');
47$confirm =
GETPOST(
'confirm',
'alpha');
53if (!$user->hasRight(
'projet',
'lire')) {
58$hookmanager->initHooks(array(
'projectcard',
'globalcard'));
64$extrafields->fetch_name_optionals_label(
$object->table_element);
67if ($id > 0 || !empty($ref)) {
68 $ret =
$object->fetch($id, $ref);
71 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
79include DOL_DOCUMENT_ROOT.
'/core/actions_comments.inc.php';
85$title = $langs->trans(
'CommentPage');
94$tab =
'project_comment';
98$param = ($mode ==
'mine' ?
'&mode=mine' :
'');
102if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
103 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
104 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
105 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
107 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
110$morehtmlref =
'<div class="refidno">';
114if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
115 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
117$morehtmlref .=
'</div>';
120if (!$user->hasRight(
'projet',
'all',
'lire')) {
121 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
122 $object->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0').
")";
125dol_banner_tab($object,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
127print
'<div class="fichecenter">';
128print
'<div class="fichehalfleft">';
129print
'<div class="underbanner clearboth"></div>';
131print
'<table class="border centpercent">';
134print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
136 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
137 print $langs->trans(
'SharedProject');
139 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
140 print $langs->trans(
'PrivateProject');
145print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
146if (!is_null(
$object->budget_amount) && strcmp(
$object->budget_amount,
'')) {
147 print
price(
$object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
152print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
167print
'<div class="fichehalfright">';
168print
'<div class="underbanner clearboth"></div>';
170print
'<table class="border centpercent">';
173print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
174print nl2br(
$object->description);
178if (isModEnabled(
'category')) {
179 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
180 print $form->showCategories(
$object->id, Categorie::TYPE_PROJECT, 1);
185print
'<td class="titlefield">'.$langs->trans(
"NbComments").
'</td><td>';
194print
'<div class="clearboth"></div>';
201include DOL_DOCUMENT_ROOT.
'/core/tpl/bloc_comment.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.