24require
"../../main.inc.php";
25require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
26require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
30$langs->load(
'projects');
32$action =
GETPOST(
'action',
'aZ09');
33$confirm =
GETPOST(
'confirm',
'alpha');
34$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
38$withproject =
GETPOST(
'withproject',
'int');
39$project_ref =
GETPOST(
'project_ref',
'alpha');
44if (!$user->rights->projet->lire) {
48$hookmanager->initHooks(array(
'projettasknote'));
51$object =
new Task($db);
52$projectstatic =
new Project($db);
54if ($id > 0 || !empty($ref)) {
55 if ($object->fetch($id, $ref) > 0) {
56 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object,
'fetchComments') && empty($object->comments)) {
57 $object->fetchComments();
59 $projectstatic->fetch($object->fk_project);
60 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
61 $projectstatic->fetchComments();
63 if (!empty($projectstatic->socid)) {
64 $projectstatic->fetch_thirdparty();
67 $object->project = clone $projectstatic;
75if (!empty($project_ref) && !empty($withproject)) {
76 if ($projectstatic->fetch(0, $project_ref) > 0) {
77 $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
78 if (count($tasksarray) > 0) {
79 $id = $tasksarray[0]->id;
82 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ?
'' :
'&mode='.$mode));
88 $object->fetch($id, $ref);
92restrictedArea($user,
'projet', $object->fk_project,
'projet&project');
94$permissionnote = ($user->hasRight(
'projet',
'creer') || $user->hasRight(
'projet',
'all',
'creer'));
101$parameters = array();
102$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
106if (empty($reshook)) {
107 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
114$form =
new Form($db);
115$userstatic =
new User($db);
119$title = $object->ref .
' - ' . $langs->trans(
"Notes");
120if (!empty($withproject)) {
121 $title .=
' | ' . $langs->trans(
"Project") . (!empty($projectstatic->ref) ?
': '.$projectstatic->ref :
'') ;
127if ($object->id > 0) {
128 $userWrite = $projectstatic->restrictedProjectArea($user,
'write');
130 if (!empty($withproject)) {
134 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'));
136 $param = (isset($mode) && $mode ==
'mine' ?
'&mode=mine' :
'');
139 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
141 $morehtmlref =
'<div class="refidno">';
143 $morehtmlref .= $projectstatic->title;
145 if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
146 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
148 $morehtmlref .=
'</div>';
151 if (empty($user->rights->projet->all->lire)) {
152 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
153 $projectstatic->next_prev_filter =
"rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
156 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
158 print
'<div class="fichecenter">';
159 print
'<div class="fichehalfleft">';
160 print
'<div class="underbanner clearboth"></div>';
162 print
'<table class="border tableforfield centpercent">';
165 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled(
'eventorganization')) {
166 print
'<tr><td class="tdtop">';
167 print $langs->trans(
"Usage");
170 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
171 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
172 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
173 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
176 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
177 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
178 $htmltext = $langs->trans(
"ProjectFollowTasks");
179 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
182 if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
183 print
'<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_bill_time ?
' checked="checked"' :
'')).
'"> ';
184 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
185 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
188 if (isModEnabled(
'eventorganization')) {
189 print
'<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_organize_event ?
' checked="checked"' :
'')).
'"> ';
190 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
191 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
197 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
198 if ($projectstatic->public) {
199 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
200 print $langs->trans(
'SharedProject');
202 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
203 print $langs->trans(
'PrivateProject');
208 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
209 if (strcmp($projectstatic->budget_amount,
'')) {
210 print
price($projectstatic->budget_amount,
'', $langs, 1, 0, 0, $conf->currency);
215 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
217 print ($start ? $start :
'?');
220 print ($end ? $end :
'?');
221 if ($projectstatic->hasDelay()) {
233 print
'<div class="fichehalfright">';
234 print
'<div class="underbanner clearboth"></div>';
236 print
'<table class="border centpercent tableforfield">';
239 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
240 print nl2br($projectstatic->description);
244 if (isModEnabled(
'categorie')) {
245 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
246 print $form->showCategories($projectstatic->id,
'project', 1);
255 print
'<div class="clearboth"></div>';
263 print
dol_get_fiche_head($head,
'task_notes', $langs->trans(
'Task'), -1,
'projecttask', 0,
'',
'reposition');
266 $param = (
GETPOST(
'withproject') ?
'&withproject=1' :
'');
267 $linkback =
GETPOST(
'withproject') ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'">'.$langs->trans(
"BackToList").
'</a>' :
'';
269 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
270 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
271 $object->next_prev_filter =
" fk_projet IN (".$db->sanitize($projectsListId).
")";
273 $object->next_prev_filter =
" fk_projet = ".((int) $projectstatic->id);
279 if (empty($withproject)) {
280 $morehtmlref .=
'<div class="refidno">';
281 $morehtmlref .= $langs->trans(
"Project").
': ';
282 $morehtmlref .= $projectstatic->getNomUrl(1);
283 $morehtmlref .=
'<br>';
286 $morehtmlref .= $langs->trans(
"ThirdParty").
': ';
287 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
288 $morehtmlref .=
'</div>';
291 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
293 print
'<div class="fichecenter">';
295 print
'<div class="underbanner clearboth"></div>';
297 $cssclass =
'titlefield';
299 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.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.
Class to manage Dolibarr users.
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
dol_now($mode='auto')
Return date for now.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
task_prepare_head($object)
Prepare array with list of tabs.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.