27require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
40$langs->loadLangs(array(
'projects'));
42$action =
GETPOST(
'action',
'aZ09');
43$confirm =
GETPOST(
'confirm',
'alpha');
44$mine =
GETPOST(
'mode') ==
'mine' ? 1 : 0;
48$project_ref =
GETPOST(
'project_ref',
'alpha');
53if (!$user->hasRight(
'projet',
'lire')) {
57$hookmanager->initHooks(array(
'projettasknote'));
63if ($id > 0 || !empty($ref)) {
64 if (
$object->fetch($id, $ref) > 0) {
65 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_TASK') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
68 $projectstatic->fetch(
$object->fk_project);
69 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
70 $projectstatic->fetchComments();
72 if (!empty($projectstatic->socid)) {
73 $projectstatic->fetch_thirdparty();
76 $object->project = clone $projectstatic;
84if (!empty($project_ref) && !empty($withproject)) {
85 if ($projectstatic->fetch(0, $project_ref) > 0) {
86 $tasksarray =
$object->getTasksArray(
null,
null, $projectstatic->id, $socid, 0);
87 if (count($tasksarray) > 0) {
88 $id = $tasksarray[0]->id;
91 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'&withproject=1');
104$permissionnote = ($user->hasRight(
'projet',
'creer') || $user->hasRight(
'projet',
'all',
'creer'));
111$parameters = array();
112$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
116if (empty($reshook)) {
117 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
129$title =
$object->ref .
' - ' . $langs->trans(
"Notes");
130if (!empty($withproject)) {
131 $title .=
' | ' . $langs->trans(
"Project") . (!empty($projectstatic->ref) ?
': '.$projectstatic->ref :
'') ;
135llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project project-tasks page-task_note');
138 $projectstatic->fetch_thirdparty();
140 $userWrite = $projectstatic->restrictedProjectArea($user,
'write');
142 if (!empty($withproject)) {
146 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'));
152 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
154 $morehtmlref =
'<div class="refidno">';
156 $morehtmlref .= $projectstatic->title;
158 if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
159 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
161 $morehtmlref .=
'</div>';
164 if (!$user->hasRight(
'projet',
'all',
'lire')) {
165 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
166 $projectstatic->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
169 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
171 print
'<div class="fichecenter">';
172 print
'<div class="fichehalfleft">';
173 print
'<div class="underbanner clearboth"></div>';
175 print
'<table class="border tableforfield centpercent">';
179 print
'<tr><td class="tdtop">';
180 print $langs->trans(
"Usage");
184 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
185 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
186 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
190 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
191 $htmltext = $langs->trans(
"ProjectFollowTasks");
192 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
196 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"' :
'')).
'"> ';
197 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
198 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
202 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"' :
'')).
'"> ';
203 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
204 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
210 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
211 if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount,
'')) {
212 print
price($projectstatic->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency);
217 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
219 print($start ? $start :
'?');
222 print($end ? $end :
'?');
223 if ($projectstatic->hasDelay()) {
229 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
230 if ($projectstatic->public) {
231 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
232 print $langs->trans(
'SharedProject');
234 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
235 print $langs->trans(
'PrivateProject');
243 include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_view.tpl.php';
249 print
'<div class="fichehalfright">';
250 print
'<div class="underbanner clearboth"></div>';
252 print
'<table class="border tableforfield centpercent">';
256 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
257 print $form->showCategories($projectstatic->id,
'project', 1);
262 print
'<tr><td class="titlefield'.($projectstatic->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
263 if ($projectstatic->description) {
264 print
'<tr><td class="nottitleforfield" colspan="2">';
265 print
'<div class="longmessagecut">';
276 print
'<div class="clearboth"></div>';
284 print
dol_get_fiche_head($head,
'task_notes', $langs->trans(
'Task'), -1,
'projecttask', 0,
'',
'reposition');
287 $param = (
GETPOST(
'withproject') ?
'&withproject=1' :
'');
288 $linkback =
GETPOST(
'withproject') ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'">'.$langs->trans(
"BackToList").
'</a>' :
'';
290 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
291 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
292 $object->next_prev_filter =
"fk_projet:IN:".$db->sanitize($projectsListId);
294 $object->next_prev_filter =
"fk_projet:=:".((int) $projectstatic->id);
300 if (empty($withproject)) {
301 $morehtmlref .=
'<div class="refidno">';
302 $morehtmlref .= $langs->trans(
"Project").
': ';
303 $morehtmlref .= $projectstatic->getNomUrl(1);
304 $morehtmlref .=
'<br>';
307 $morehtmlref .= $langs->trans(
"ThirdParty").
': ';
308 if (is_object($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) {
309 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
311 $morehtmlref .=
'</div>';
314 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
316 print
'<div class="fichecenter">';
318 print
'<div class="underbanner clearboth"></div>';
320 $cssclass =
'titlefield';
322 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class to manage Dolibarr users.
dol_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.