29require
"../../main.inc.php";
30require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/task/modules_task.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
49$langs->loadlangs(array(
'projects',
'companies'));
51$action =
GETPOST(
'action',
'aZ09');
52$confirm =
GETPOST(
'confirm',
'alpha');
59$ref =
GETPOST(
"ref",
'alpha', 1);
60$taskref =
GETPOST(
"taskref",
'alpha');
62$project_ref =
GETPOST(
'project_ref',
'alpha');
63$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) :
'');
64$mode =
GETPOST(
'mode',
'alpha');
67$hookmanager->initHooks(array(
'projecttaskcard',
'globalcard'));
71$projectstatic =
new Project($db);
74$extrafields->fetch_name_optionals_label(
$object->table_element);
76$parameters = array(
'id' => $id);
77$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
83 $ret =
$object->fetch($id, $ref);
85 $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')) {
161 $task_origin =
new Task($db);
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);
196 $newobject =
new Task($db);
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();
209 if (
$object->delete($user) > 0) {
210 header(
'Location: '.DOL_URL_ROOT.
'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ?
'&withproject=1' :
''));
218if ($action ==
'confirm_close' && $confirm ==
"yes" && $user->hasRight(
'projet',
'creer')) {
219 $result = $projectstatic->fetch(
$object->fk_project);
220 $projectstatic->fetch_thirdparty();
223 header(
'Location: '.DOL_URL_ROOT.
'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ?
'&withproject=1' :
''));
232if (!empty($project_ref) && !empty($withproject)) {
233 if ($projectstatic->fetch(0, $project_ref) > 0) {
234 $tasksarray =
$object->getTasksArray(
null,
null, $projectstatic->id, $socid, 0);
235 if (count($tasksarray) > 0) {
236 $id = $tasksarray[0]->id;
238 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ?
'' :
'&mode='.$mode));
244if ($action ==
'builddoc' && $user->hasRight(
'projet',
'creer')) {
250 $outputlangs = $langs;
251 if (
GETPOST(
'lang_id',
'aZ09')) {
253 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
255 $result =
$object->generateDocument(
$object->model_pdf, $outputlangs);
263if ($action ==
'remove_file' && $user->hasRight(
'projet',
'creer')) {
264 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
266 $langs->load(
"other");
279if ($action ==
'reopen' && $user->hasRight(
'projet',
'creer')) {
290if ($action ==
'valid' && $user->hasRight(
'projet',
'creer')) {
305$form =
new Form($db);
311if (!empty($withproject)) {
312 $title .=
' | ' . $langs->trans(
"Project") . (!empty($projectstatic->ref) ?
': '.$projectstatic->ref :
'') ;
316llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project project-tasks page-task');
319if ($id > 0 || !empty($ref)) {
320 $res =
$object->fetch_optionals();
321 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_TASK') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
326 if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
327 $projectstatic->fetchComments();
329 if (!empty($projectstatic->socid)) {
330 $projectstatic->fetch_thirdparty();
333 $object->project = clone $projectstatic;
337 if (!empty($withproject)) {
341 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
343 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
347 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
349 $morehtmlref =
'<div class="refidno">';
351 $morehtmlref .= $projectstatic->title;
353 if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
354 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
356 $morehtmlref .=
'</div>';
359 if (!$user->hasRight(
'projet',
'all',
'lire')) {
360 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
361 $projectstatic->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
364 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
366 print
'<div class="fichecenter">';
367 print
'<div class="fichehalfleft">';
368 print
'<div class="underbanner clearboth"></div>';
370 print
'<table class="border tableforfield centpercent">';
374 print
'<tr><td class="tdtop">';
375 print $langs->trans(
"Usage");
379 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
380 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
381 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
385 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
386 $htmltext = $langs->trans(
"ProjectFollowTasks");
387 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
391 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"' :
'')).
'"> ';
392 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
393 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
396 if (isModEnabled(
'eventorganization')) {
397 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"' :
'')).
'"> ';
398 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
399 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
405 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
406 if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount,
'')) {
407 print
'<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
412 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
414 print($start ? $start :
'?');
417 print($end ? $end :
'?');
418 if ($projectstatic->hasDelay()) {
424 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
425 if ($projectstatic->public) {
426 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
427 print $langs->trans(
'SharedProject');
429 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
430 print $langs->trans(
'PrivateProject');
438 include DOL_DOCUMENT_ROOT .
'/core/tpl/extrafields_view.tpl.php';
445 print
'<div class="fichehalfright">';
446 print
'<div class="underbanner clearboth"></div>';
448 print
'<table class="border tableforfield centpercent">';
451 if (isModEnabled(
'category')) {
452 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
453 print $form->showCategories($projectstatic->id,
'project', 1);
458 print
'<tr><td class="titlefield'.($projectstatic->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
459 if ($projectstatic->description) {
460 print
'<tr><td class="nottitleforfield" colspan="2">';
461 print
'<div class="longmessagecut">';
472 print
'<div class="clearboth"></div>';
510 if ($action ==
'edit' && $user->hasRight(
'projet',
'creer')) {
511 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
512 print
'<input type="hidden" name="token" value="'.newToken().
'">';
513 print
'<input type="hidden" name="action" value="update">';
514 print
'<input type="hidden" name="withproject" value="'.$withproject.
'">';
515 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
517 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), 0,
'projecttask', 0,
'',
'');
519 print
'<table class="border centpercent">';
522 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
523 print
'<td><input class="minwidth100" name="taskref" value="'.$object->ref.
'"></td></tr>';
526 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
527 print
'<td><input class="minwidth500" name="label" value="'.$object->label.
'"></td></tr>';
530 if (empty($withproject)) {
531 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
532 print $projectstatic->getNomUrl(1);
536 print
'<td>'.$langs->trans(
"ThirdParty").
'</td><td>';
537 if ($projectstatic->thirdparty->id) {
538 print $projectstatic->thirdparty->getNomUrl(1);
546 print
'<tr><td>'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
548 $formother->selectProjectTasks(
$object->fk_task_parent, $projectstatic->id,
'task_parent', ($user->admin ? 0 : 1), 0, 0, 0,
$object->id,
'',
'minwidth100 widthcentpercentminusxx maxwidth500');
552 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
553 print $form->selectDate(
$object->date_start,
'date_start', 1, 1, 0,
'', 1, 0);
557 print
'<tr><td>'.$langs->trans(
"Deadline").
'</td><td>';
558 print $form->selectDate(
$object->date_end ?
$object->date_end : -1,
'date_end', 1, 1, 0,
'', 1, 0);
562 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
563 print $form->select_duration(
'planned_workload',
$object->planned_workload, 0,
'text');
567 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td>';
568 print $formother->select_percent(
$object->progress,
'progress', 0, 5, 0, 100, 1);
572 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
573 print $form->selectyesno(
'billable',
$object->billable);
578 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
582 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
584 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), $nbrows,
'90%');
585 print $doleditor->Create();
590 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
591 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>';
595 $parameters = array();
596 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
597 print $hookmanager->resPrint;
598 if (empty($reshook)) {
599 print
$object->showOptionals($extrafields,
'edit');
606 print $form->buttonsSaveCancel(
"Modify");
613 $param = ($withproject ?
'&withproject=1' :
'');
614 $linkback = $withproject ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'&restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>' :
'';
616 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), -1,
'projecttask', 0,
'',
'reposition');
618 if ($action ==
'clone') {
619 $formquestion = array(
620 'text' => $langs->trans(
"ConfirmClone"),
622 0 => array(
'type' =>
'checkbox',
'name' =>
'clone_change_dt',
'label' => $langs->trans(
"CloneChanges"),
'value' =>
true),
623 1 => array(
'type' =>
'checkbox',
'name' =>
'clone_affectation',
'label' => $langs->trans(
"CloneAffectation"),
'value' =>
true),
624 2 => array(
'type' =>
'checkbox',
'name' =>
'clone_prog',
'label' => $langs->trans(
"CloneProgression"),
'value' =>
true),
625 3 => array(
'type' =>
'checkbox',
'name' =>
'clone_time',
'label' => $langs->trans(
"CloneTimes"),
'value' =>
true),
626 4 => array(
'type' =>
'checkbox',
'name' =>
'clone_file',
'label' => $langs->trans(
"CloneFile"),
'value' =>
true),
629 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneTask"),
"confirm_clone", $formquestion,
'', 1, 300, 590);
632 if ($action ==
'close') {
633 $formquestion = array(
634 'text' => $langs->trans(
"ConfirmClosed"),
636 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"ToClose"), $langs->trans(
"ConfirmCloseTask"),
"confirm_close", $formquestion,
'', 1, 300, 590);
640 if ($action ==
'merge') {
641 $formquestion = array(
643 'name' =>
'task_origin',
644 'label' => $langs->trans(
'MergeOriginTask'),
646 'value' => $formproject->selectTasks(-1, 0,
'task_origin', 24, 0, $langs->trans(
'SelectTask'), 0, 0, 0,
'maxwidth500 minwidth200',
'',
'',
null, 1)
649 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);
652 if ($action ==
'delete') {
653 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
GETPOSTINT(
"id").
'&withproject='.$withproject, $langs->trans(
"DeleteATask"), $langs->trans(
"ConfirmDeleteATask"),
"confirm_delete");
656 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
657 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
658 $object->next_prev_filter =
"fk_projet:IN:".$db->sanitize($projectsListId);
660 $object->next_prev_filter =
"fk_projet:=:".((int) $projectstatic->id);
666 if (empty($withproject)) {
667 $morehtmlref .=
'<div class="refidno">';
668 $morehtmlref .= $langs->trans(
"Project").
': ';
669 $morehtmlref .= $projectstatic->getNomUrl(1);
670 $morehtmlref .=
'<br>';
673 $morehtmlref .= $langs->trans(
"ThirdParty").
': ';
674 if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
675 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
677 $morehtmlref .=
'</div>';
680 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
682 print
'<div class="fichecenter">';
683 print
'<div class="fichehalfleft">';
685 print
'<div class="underbanner clearboth"></div>';
686 print
'<table class="border centpercent tableforfield">';
689 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"ChildOfTask").
'</td><td>';
690 if (
$object->fk_task_parent > 0) {
691 $tasktmp =
new Task($db);
692 $tasktmp->fetch(
$object->fk_task_parent);
693 print $tasktmp->getNomUrl(1);
698 print
'<tr><td>'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"Deadline").
'</td><td colspan="3">';
700 print($start ? $start :
'?');
703 print($end ? $end :
'?');
710 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td colspan="3">';
711 if (
$object->planned_workload !=
'') {
717 print
'<td class="tdtop">'.$langs->trans(
"Description").
'</td><td colspan="3">';
724 print
'<div class="fichehalfright">';
726 print
'<div class="underbanner clearboth"></div>';
727 print
'<table class="border centpercent tableforfield">';
730 print
'<tr><td class="titlefieldmiddle">'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
737 print
'<tr><td>'.$langs->trans(
"ProgressCalculated").
'</td><td colspan="3">';
738 if (
$object->planned_workload !=
'') {
739 $tmparray =
$object->getSummaryOfTimeSpent();
740 if ($tmparray[
'total_duration'] > 0 && !empty(
$object->planned_workload)) {
741 print round($tmparray[
'total_duration'] /
$object->planned_workload * 100, 2).
' %';
746 print
'<span class="opacitymedium">'.$langs->trans(
"WorkloadNotDefined").
'</span>';
751 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
752 if (!is_null(
$object->budget_amount) && strcmp((
string)
$object->budget_amount,
'')) {
753 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
758 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
759 print
'<span>'.($object->billable ? $langs->trans(
'Yes') : $langs->trans(
'No')).
'</span>';
765 $parameters = array(
'socid' => $socid);
766 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
773 print
'<div class="clearboth"></div>';
779 if ($action !=
'edit') {
784 print
'<div class="tabsAction">';
786 $parameters = array();
787 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
789 if (empty($reshook)) {
791 if ($user->hasRight(
'projet',
'creer')) {
792 if (
$object->status == $object::STATUS_VALIDATED ||
$object->status == $object::STATUS_ONGOING) {
793 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>';
794 } elseif (
$object->status == $object::STATUS_DRAFT) {
795 print
'<a class="butAction reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=valid&token='.
newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Validate').
'</a>';
798 print
'<a class="butAction reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Modify').
'</a>';
801 if (
$object->status != $object::STATUS_CLOSED) {
802 print
'<a class="butAction classfortooltip reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=close&token='.
newToken().
'&withproject='.((int) $withproject).
'" title="'.$langs->trans(
"Close").
'">'.$langs->trans(
'Close').
'</a>';
805 print
'<a class="butAction reposition" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=clone&token='.
newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Clone').
'</a>';
807 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>';
809 print
'<a class="butActionRefused classfortooltip reposition" href="#" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
'Modify').
'</a>';
813 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
814 if ($permissiontodelete) {
816 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
818 print
dolGetButtonAction($langs->trans(
"TaskHasChild"), $langs->trans(
"Delete"),
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', -1);
821 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
827 print
'<div class="fichecenter"><div class="fichehalfleft">';
828 print
'<a name="builddoc"></a>';
834 $filedir =
$conf->project->multidir_output[
$object->entity].
"/".$subdir;
835 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
836 $genallowed = ($user->hasRight(
'projet',
'lire'));
837 $delallowed = ($user->hasRight(
'projet',
'creer'));
839 print $formfile->showdocuments(
'project_task', $subdir, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 0, 0,
'',
'',
'',
'',
'', $object);
842 $tmparray = $form->showLinkToObjectBlock($object, array(), array(
'project_task'), 1);
843 $linktoelem = $tmparray[
'linktoelem'];
844 $htmltoenteralink = $tmparray[
'htmltoenteralink'];
845 print $htmltoenteralink;
847 $compatibleImportElementsList = array();
848 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
850 print
'</div><div class="fichehalfright">';
853 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
855 $formactions->showactions($object,
'project_task', 0, 1,
'', 10,
'withproject='.$withproject);
857 print
'</div></div>';
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
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.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
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...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.