29require
"../../main.inc.php";
37require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/task/modules_task.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
48$langs->loadlangs(array(
'projects',
'companies'));
50$action =
GETPOST(
'action',
'aZ09');
51$confirm =
GETPOST(
'confirm',
'alpha');
58$ref =
GETPOST(
"ref",
'alpha', 1);
59$taskref =
GETPOST(
"taskref",
'alpha');
61$project_ref =
GETPOST(
'project_ref',
'alpha');
62$planned_workload = ((
GETPOST(
'planned_workloadhour') !=
'' ||
GETPOST(
'planned_workloadmin') !=
'') ? (
GETPOSTINT(
'planned_workloadhour') > 0 ?
GETPOSTINT(
'planned_workloadhour') * 3600 : 0) + (
GETPOSTINT(
'planned_workloadmin') > 0 ?
GETPOSTINT(
'planned_workloadmin') * 60 : 0) :
'');
63$mode =
GETPOST(
'mode',
'alpha');
66$hookmanager->initHooks(array(
'projecttaskcard',
'globalcard'));
73$extrafields->fetch_name_optionals_label(
$object->table_element);
75$parameters = array(
'id' => $id);
76$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
82 $ret =
$object->fetch($id, $ref);
84 $projectstatic->fetch(
$object->fk_project);
101if ($action ==
'update' && !
GETPOST(
"cancel") && $user->hasRight(
'projet',
'creer')) {
102 if (empty($taskref)) {
104 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
108 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
113 $tmparray = explode(
'_',
GETPOST(
'task_parent'));
114 $task_parent = $tmparray[1];
115 if (empty($task_parent)) {
126 $object->fk_task_parent = $task_parent;
127 $object->planned_workload = $planned_workload;
133 if (
GETPOST(
'progress') ==
'100') {
134 $object->status = $object::STATUS_CLOSED;
135 } elseif (
GETPOST(
'progress') !=
'0') {
136 $object->status = $object::STATUS_ONGOING;
140 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
146 $result =
$object->update($user);
159if ($action ==
'confirm_merge' && $confirm ==
'yes' && $user->hasRight(
'projet',
'creer')) {
163 if ($task_origin_id <= 0) {
164 $langs->load(
'errors');
165 setEventMessages($langs->trans(
'ErrorTaskIdIsMandatory', $langs->transnoentitiesnoconv(
'MergeOriginTask')),
null,
'errors');
167 if (!$error && $task_origin->fetch($task_origin_id) < 1) {
172 $result =
$object->mergeTask($task_origin_id);
183if ($action ==
'confirm_clone' && $confirm ==
'yes' && $user->hasRight(
'projet',
'creer')) {
185 $clone_prog =
GETPOST(
'clone_prog') ? 1 : 0;
186 $clone_time =
GETPOST(
'clone_time') ? 1 : 0;
187 $clone_affectation =
GETPOST(
'clone_affectation') ? 1 : 0;
188 $clone_change_dt =
GETPOST(
'clone_change_dt') ? 1 : 0;
189 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
190 $clone_file =
GETPOST(
'clone_file') ? 1 : 0;
191 $result =
$object->createFromClone($user,
$object->id,
$object->fk_project,
$object->fk_task_parent, $clone_change_dt, $clone_affectation, $clone_time, $clone_file, $clone_notes, $clone_prog);
197 $newobject->fetch($result);
198 $newobject->fetch_optionals();
199 $newobject->fetch_thirdparty();
205if ($action ==
'confirm_delete' && $confirm ==
"yes" && $user->hasRight(
'projet',
'supprimer')) {
206 $result = $projectstatic->fetch(
$object->fk_project);
207 $projectstatic->fetch_thirdparty();
210 if (
$object->delete($user) > 0) {
211 header(
'Location: '.DOL_URL_ROOT.
'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ?
'&withproject=1' :
''));
219if ($action ==
'confirm_close' && $confirm ==
"yes" && $user->hasRight(
'projet',
'creer')) {
220 $result = $projectstatic->fetch(
$object->fk_project);
221 $projectstatic->fetch_thirdparty();
231if (!empty($project_ref) && !empty($withproject)) {
232 if ($projectstatic->fetch(0, $project_ref) > 0) {
233 $tasksarray =
$object->getTasksArray(
null,
null, $projectstatic->id, $socid, 0);
234 if (count($tasksarray) > 0) {
235 $id = $tasksarray[0]->id;
237 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ?
'' :
'&mode='.$mode));
243if ($action ==
'builddoc' && $user->hasRight(
'projet',
'creer')) {
249 $outputlangs = $langs;
250 if (
GETPOST(
'lang_id',
'aZ09')) {
252 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
254 $result =
$object->generateDocument(
$object->model_pdf, $outputlangs);
262if ($action ==
'remove_file' && $user->hasRight(
'projet',
'creer')) {
263 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
265 $langs->load(
"other");
278if ($action ==
'reopen' && $user->hasRight(
'projet',
'creer')) {
289if ($action ==
'valid' && $user->hasRight(
'projet',
'creer')) {
310if (!empty($withproject)) {
311 $title .=
' | ' . $langs->trans(
"Project") . (!empty($projectstatic->ref) ?
': '.$projectstatic->ref :
'') ;
315llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project project-tasks page-task');
318if ($id > 0 || !empty($ref)) {
319 $res =
$object->fetch_optionals();
324 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
325 $projectstatic->fetchComments();
327 if (!empty($projectstatic->socid)) {
328 $projectstatic->fetch_thirdparty();
331 $object->project = clone $projectstatic;
335 if (!empty($withproject)) {
339 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
341 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
345 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
347 $morehtmlref =
'<div class="refidno">';
349 $morehtmlref .= $projectstatic->title;
351 if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
352 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
354 $morehtmlref .=
'</div>';
357 if (!$user->hasRight(
'projet',
'all',
'lire')) {
358 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
359 $projectstatic->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
362 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
364 print
'<div class="fichecenter">';
365 print
'<div class="fichehalfleft">';
366 print
'<div class="underbanner clearboth"></div>';
368 print
'<table class="border tableforfield centpercent">';
372 print
'<tr><td class="tdtop">';
373 print $langs->trans(
"Usage");
377 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
378 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
379 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
383 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
384 $htmltext = $langs->trans(
"ProjectFollowTasks");
385 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
389 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"' :
'')).
'"> ';
390 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
391 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
395 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"' :
'')).
'"> ';
396 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
397 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
403 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
404 if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount,
'')) {
405 print
'<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
410 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
412 print($start ? $start :
'?');
415 print($end ? $end :
'?');
416 if ($projectstatic->hasDelay()) {
422 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
423 if ($projectstatic->public) {
424 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
425 print $langs->trans(
'SharedProject');
427 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
428 print $langs->trans(
'PrivateProject');
436 include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_view.tpl.php';
443 print
'<div class="fichehalfright">';
444 print
'<div class="underbanner clearboth"></div>';
446 print
'<table class="border tableforfield centpercent">';
450 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
451 print $form->showCategories($projectstatic->id,
'project', 1);
456 print
'<tr><td class="titlefield'.($projectstatic->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
457 if ($projectstatic->description) {
458 print
'<tr><td class="nottitleforfield" colspan="2">';
459 print
'<div class="longmessagecut">';
470 print
'<div class="clearboth"></div>';
485 if ($action ==
'edit' && $user->hasRight(
'projet',
'creer')) {
486 print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
487 print
'<input type="hidden" name="token" value="'.newToken().
'">';
488 print
'<input type="hidden" name="action" value="update">';
489 print
'<input type="hidden" name="withproject" value="'.$withproject.
'">';
490 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
492 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), 0,
'projecttask', 0,
'',
'');
494 $param = (
GETPOST(
'withproject') ?
'&withproject=1' :
'');
495 $linkback =
GETPOST(
'withproject') ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'">'.$langs->trans(
"BackToList").
'</a>' :
'';
497 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
498 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
499 $object->next_prev_filter =
"fk_projet:IN:".$db->sanitize($projectsListId);
501 $object->next_prev_filter =
"fk_projet:=:".((int) $projectstatic->id);
504 print
'<table class="border centpercent">';
507 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
508 print
'<td><input class="minwidth100" name="taskref" value="'.$object->ref.
'"></td></tr>';
511 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
512 print
'<td><input class="minwidth500" name="label" value="'.$object->label.
'"></td></tr>';
515 if (empty($withproject)) {
516 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
517 print $projectstatic->getNomUrl(1);
521 print
'<td>'.$langs->trans(
"ThirdParty").
'</td><td>';
522 if ($projectstatic->thirdparty->id) {
523 print $projectstatic->thirdparty->getNomUrl(1);
531 print
'<tr><td>'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
533 $formother->selectProjectTasks(
$object->fk_task_parent, $projectstatic->id,
'task_parent', ($user->admin ? 0 : 1), 0, 0, 0,
$object->id,
'',
'minwidth100 widthcentpercentminusxx maxwidth500');
537 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
538 print $form->selectDate(
$object->date_start,
'date_start', 1, 1, 0,
'', 1, 0);
542 print
'<tr><td>'.$langs->trans(
"Deadline").
'</td><td>';
543 print $form->selectDate(
$object->date_end ?
$object->date_end : -1,
'date_end', 1, 1, 0,
'', 1, 0);
547 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
548 print $form->select_duration(
'planned_workload',
$object->planned_workload, 0,
'text');
552 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td>';
553 print $formother->select_percent(
$object->progress,
'progress', 0, 5, 0, 100, 1);
557 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
558 print $form->selectyesno(
'billable',
$object->billable);
563 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
567 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
569 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), $nbrows,
'90%');
570 print $doleditor->Create();
575 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
576 print
'<td><input class="width75" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
price2num(
$object->budget_amount)).
'"></td>';
580 $parameters = array();
581 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
582 print $hookmanager->resPrint;
583 if (empty($reshook)) {
584 print
$object->showOptionals($extrafields,
'edit');
591 print $form->buttonsSaveCancel(
"Modify");
598 $param = ($withproject ?
'&withproject=1' :
'');
599 $linkback = $withproject ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'&restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>' :
'';
601 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), -1,
'projecttask', 0,
'',
'reposition');
603 if ($action ==
'clone') {
604 $formquestion = array(
605 'text' => $langs->trans(
"ConfirmClone"),
607 0 => array(
'type' =>
'checkbox',
'name' =>
'clone_change_dt',
'label' => $langs->trans(
"CloneChanges"),
'value' =>
true),
608 1 => array(
'type' =>
'checkbox',
'name' =>
'clone_affectation',
'label' => $langs->trans(
"CloneAffectation"),
'value' =>
true),
609 2 => array(
'type' =>
'checkbox',
'name' =>
'clone_prog',
'label' => $langs->trans(
"CloneProgression"),
'value' =>
true),
610 3 => array(
'type' =>
'checkbox',
'name' =>
'clone_time',
'label' => $langs->trans(
"CloneTimes"),
'value' =>
true),
611 4 => array(
'type' =>
'checkbox',
'name' =>
'clone_file',
'label' => $langs->trans(
"CloneFile"),
'value' =>
true),
614 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneTask"),
"confirm_clone", $formquestion,
'', 1, 300, 590);
617 if ($action ==
'close') {
618 $formquestion = array(
619 'text' => $langs->trans(
"ConfirmClosed"),
621 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClose"), $langs->trans(
"ConfirmCloseTask"),
"confirm_close", $formquestion,
'', 1, 300, 590);
625 if ($action ==
'merge') {
626 $formquestion = array(
628 'name' =>
'task_origin',
629 'label' => $langs->trans(
'MergeOriginTask'),
631 'value' => $formproject->selectTasks(-1, 0,
'task_origin', 24, 0, $langs->trans(
'SelectTask'), 0, 0, 0,
'maxwidth500 minwidth200',
'',
'',
null, 1)
634 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id.(GETPOST(
'withproject') ?
"&withproject=1" :
""), $langs->trans(
"MergeTasks"), $langs->trans(
"ConfirmMergeTasks"),
"confirm_merge", $formquestion,
'yes', 1, 250);
637 if ($action ==
'delete') {
638 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
GETPOSTINT(
"id").
'&withproject='.$withproject, $langs->trans(
"DeleteATask"), $langs->trans(
"ConfirmDeleteATask"),
"confirm_delete");
641 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
642 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
643 $object->next_prev_filter =
"fk_projet:IN:".$db->sanitize($projectsListId);
645 $object->next_prev_filter =
"fk_projet:=:".((int) $projectstatic->id);
651 if (empty($withproject)) {
652 $morehtmlref .=
'<div class="refidno">';
653 $morehtmlref .= $langs->trans(
"Project").
': ';
654 $morehtmlref .= $projectstatic->getNomUrl(1);
655 $morehtmlref .=
'<br>';
658 $morehtmlref .= $langs->trans(
"ThirdParty").
': ';
659 if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
660 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
662 $morehtmlref .=
'</div>';
665 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
667 print
'<div class="fichecenter">';
668 print
'<div class="fichehalfleft">';
670 print
'<div class="underbanner clearboth"></div>';
671 print
'<table class="border centpercent tableforfield">';
674 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"ChildOfTask").
'</td><td>';
675 if (
$object->fk_task_parent > 0) {
677 $tasktmp->fetch(
$object->fk_task_parent);
678 print $tasktmp->getNomUrl(1);
683 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"Deadline").
'</td><td colspan="3">';
685 print($start ? $start :
'?');
688 print($end ? $end :
'?');
695 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td colspan="3">';
696 if (
$object->planned_workload !=
'') {
702 print
'<td class="tdtop">'.$langs->trans(
"Description").
'</td><td colspan="3">';
709 print
'<div class="fichehalfright">';
711 print
'<div class="underbanner clearboth"></div>';
712 print
'<table class="border centpercent tableforfield">';
715 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
722 print
'<tr><td>'.$langs->trans(
"ProgressCalculated").
'</td><td colspan="3">';
723 if (
$object->planned_workload !=
'') {
724 $tmparray =
$object->getSummaryOfTimeSpent();
725 if ($tmparray[
'total_duration'] > 0 && !empty(
$object->planned_workload)) {
726 print round($tmparray[
'total_duration'] /
$object->planned_workload * 100, 2).
' %';
731 print
'<span class="opacitymedium">'.$langs->trans(
"WorkloadNotDefined").
'</span>';
736 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
737 if (!is_null(
$object->budget_amount) && strcmp((
string)
$object->budget_amount,
'')) {
738 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
743 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
744 print
'<span>'.($object->billable ? $langs->trans(
'Yes') : $langs->trans(
'No')).
'</span>';
750 $parameters = array(
'socid' => $socid);
751 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
758 print
'<div class="clearboth"></div>';
764 if ($action !=
'edit') {
769 print
'<div class="tabsAction">';
771 $parameters = array();
772 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
774 if (empty($reshook)) {
776 if ($user->hasRight(
'projet',
'creer')) {
777 if (
$object->status == $object::STATUS_VALIDATED ||
$object->status == $object::STATUS_ONGOING) {
778 print
'<a class="butAction classfortooltip reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=reopen&token='.newToken().
'&withproject='.((int) $withproject).
'" title="'.$langs->trans(
"SetToDraft").
'">'.$langs->trans(
'SetToDraft').
'</a>';
779 } elseif (
$object->status == $object::STATUS_DRAFT) {
780 print
'<a class="butAction reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=valid&token='.newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Validate').
'</a>';
783 print
'<a class="butAction reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=edit&token='.newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Modify').
'</a>';
786 if (
$object->status != $object::STATUS_CLOSED) {
787 print
'<a class="butAction classfortooltip reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=confirm_close&confirm=yes&token='.newToken().
'&withproject='.((int) $withproject).
'" title="'.$langs->trans(
"Close").
'">'.$langs->trans(
'Close').
'</a>';
790 print
'<a class="butAction butActionClone reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=clone&token='.newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Clone').
'</a>';
792 print
'<a class="butActionDelete classfortooltip reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=merge&token='.newToken().
'&withproject='.((int) $withproject).
'" title="'.$langs->trans(
"MergeTasks").
'">'.$langs->trans(
'Merge').
'</a>';
794 print
'<a class="butActionRefused classfortooltip reposition" href="#" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
'Modify').
'</a>';
798 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
799 if ($permissiontodelete) {
801 print dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
803 print dolGetButtonAction($langs->trans(
"TaskHasChild"), $langs->trans(
"Delete"),
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.newToken().
'&withproject='.((
int) $withproject),
'delete', -1);
806 print dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
812 print
'<div class="fichecenter"><div class="fichehalfleft">';
813 print
'<a name="builddoc"></a>';
819 $filedir =
$conf->project->multidir_output[
$object->entity ??
$conf->entity].
"/".$subdir;
820 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
821 $genallowed = ($user->hasRight(
'projet',
'lire'));
822 $delallowed = ($user->hasRight(
'projet',
'creer'));
824 print $formfile->showdocuments(
'project_task', $subdir, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
827 $tmparray = $form->showLinkToObjectBlock($object, array(), array(
'project_task'), 1);
828 $linktoelem = $tmparray[
'linktoelem'];
829 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
830 print $htmltoenteralink;
832 $compatibleImportElementsList = array();
833 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
835 print
'</div><div class="fichehalfright">';
838 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
840 $formactions->showactions($object,
'project_task', 0, 1,
'', 10,
'withproject='.$withproject);
842 print
'</div></div>';
$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 a WYSIWYG editor.
Class to manage projects.
const STATUS_VALIDATED
Validated status (To do).
const STATUS_DRAFT
Draft status.
const STATUS_CLOSED
Finished status.
Class to manage translations.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
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_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.