27 require
"../../main.inc.php";
28 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/task/modules_task.php';
38 $langs->loadlangs(array(
'projects',
'companies'));
40 $action =
GETPOST(
'action',
'aZ09');
41 $confirm =
GETPOST(
'confirm',
'alpha');
44 $ref =
GETPOST(
"ref",
'alpha', 1);
45 $taskref =
GETPOST(
"taskref",
'alpha');
46 $withproject =
GETPOST(
'withproject',
'int');
47 $project_ref =
GETPOST(
'project_ref',
'alpha');
48 $planned_workload = ((
GETPOST(
'planned_workloadhour',
'int') !=
'' ||
GETPOST(
'planned_workloadmin',
'int') !=
'') ? (
GETPOST(
'planned_workloadhour',
'int') > 0 ?
GETPOST(
'planned_workloadhour',
'int') * 3600 : 0) + (
GETPOST(
'planned_workloadmin',
'int') > 0 ?
GETPOST(
'planned_workloadmin',
'int') * 60 : 0) :
'');
51 $hookmanager->initHooks(array(
'projecttaskcard',
'globalcard'));
53 $object =
new Task($db);
55 $projectstatic =
new Project($db);
58 $extrafields->fetch_name_optionals_label($object->table_element);
60 $parameters = array(
'id'=>$id);
61 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
66 if ($id > 0 || $ref) {
67 $object->fetch($id, $ref);
73 restrictedArea($user,
'projet', $object->fk_project,
'projet&project');
81 if ($action ==
'update' && !
GETPOST(
"cancel") && $user->rights->projet->creer) {
84 if (empty($taskref)) {
86 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
90 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
93 $object->oldcopy = clone $object;
95 $tmparray = explode(
'_',
GETPOST(
'task_parent'));
96 $task_parent = $tmparray[1];
97 if (empty($task_parent)) {
101 $object->ref = $taskref ? $taskref :
GETPOST(
"ref",
'alpha', 2);
102 $object->label =
GETPOST(
"label",
"alphanohtml");
103 if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
104 $object->description =
GETPOST(
'description',
"alphanohtml");
106 $object->description =
GETPOST(
'description',
"restricthtml");
108 $object->fk_task_parent = $task_parent;
109 $object->planned_workload = $planned_workload;
110 $object->date_start =
dol_mktime(
GETPOST(
'dateohour',
'int'),
GETPOST(
'dateomin',
'int'), 0,
GETPOST(
'dateomonth',
'int'),
GETPOST(
'dateoday',
'int'),
GETPOST(
'dateoyear',
'int'));
111 $object->date_end =
dol_mktime(
GETPOST(
'dateehour',
'int'),
GETPOST(
'dateemin',
'int'), 0,
GETPOST(
'dateemonth',
'int'),
GETPOST(
'dateeday',
'int'),
GETPOST(
'dateeyear',
'int'));
113 $object->budget_amount =
price2num(
GETPOST(
'budget_amount',
'alphanohtml'));
116 $ret = $extrafields->setOptionalsFromPost(
null, $object,
'@GETPOSTISSET');
122 $result = $object->update($user);
135 if ($action ==
'confirm_clone' && $confirm ==
'yes') {
137 $clone_prog =
GETPOST(
'clone_prog') ? 1 : 0;
138 $clone_time =
GETPOST(
'clone_time') ? 1 : 0;
139 $clone_affectation =
GETPOST(
'clone_affectation') ? 1 : 0;
140 $clone_change_dt =
GETPOST(
'clone_change_dt') ? 1 : 0;
141 $clone_notes =
GETPOST(
'clone_notes') ? 1 : 0;
142 $clone_file =
GETPOST(
'clone_file') ? 1 : 0;
143 $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);
148 $newobject =
new Task($db);
149 $newobject->fetch($result);
150 $newobject->fetch_optionals();
151 $newobject->fetch_thirdparty();
152 $object = $newobject;
157 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $user->rights->projet->supprimer) {
158 $result = $projectstatic->fetch($object->fk_project);
159 $projectstatic->fetch_thirdparty();
161 if ($object->delete($user) > 0) {
162 header(
'Location: '.DOL_URL_ROOT.
'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ?
'&withproject=1' :
''));
171 if (!empty($project_ref) && !empty($withproject)) {
172 if ($projectstatic->fetch(
'', $project_ref) > 0) {
173 $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
174 if (count($tasksarray) > 0) {
175 $id = $tasksarray[0]->id;
177 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ?
'' :
'&mode='.$mode));
183 if ($action ==
'builddoc' && $user->rights->projet->creer) {
186 $object->setDocModel($user,
GETPOST(
'model',
'alpha'));
189 $outputlangs = $langs;
190 if (
GETPOST(
'lang_id',
'aZ09')) {
192 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
194 $result = $object->generateDocument($object->model_pdf, $outputlangs);
202 if ($action ==
'remove_file' && $user->rights->projet->creer) {
203 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
205 $langs->load(
"other");
206 $upload_dir = $conf->project->dir_output;
224 $result = $projectstatic->fetch($object->fk_project);
226 $title = $object->ref;
227 if (!empty($withproject)) {
228 $title .=
' | ' . $langs->trans(
"Project") . (!empty($projectstatic->ref) ?
': '.$projectstatic->ref :
'') ;
235 if ($id > 0 || !empty($ref)) {
236 $res = $object->fetch_optionals();
237 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object,
'fetchComments') && empty($object->comments)) {
238 $object->fetchComments();
242 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic,
'fetchComments') && empty($projectstatic->comments)) {
243 $projectstatic->fetchComments();
245 if (!empty($projectstatic->socid)) {
246 $projectstatic->fetch_thirdparty();
249 $object->project = clone $projectstatic;
253 if (!empty($withproject)) {
257 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($projectstatic->public ?
'projectpub' :
'project'), 0,
'',
'');
259 $param = ($mode ==
'mine' ?
'&mode=mine' :
'');
263 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
265 $morehtmlref =
'<div class="refidno">';
267 $morehtmlref .= $projectstatic->title;
269 if (!empty($projectstatic->thirdparty->id) &&$projectstatic->thirdparty->id > 0) {
270 $morehtmlref .=
'<br>'.$projectstatic->thirdparty->getNomUrl(1,
'project');
272 $morehtmlref .=
'</div>';
275 if (empty($user->rights->projet->all->lire)) {
276 $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
277 $projectstatic->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
280 dol_banner_tab($projectstatic,
'project_ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
282 print
'<div class="fichecenter">';
283 print
'<div class="fichehalfleft">';
284 print
'<div class="underbanner clearboth"></div>';
286 print
'<table class="border tableforfield centpercent">';
289 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) ||
isModEnabled(
'eventorganization')) {
290 print
'<tr><td class="tdtop">';
291 print $langs->trans(
"Usage");
294 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
295 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
296 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
297 print
$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
300 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
301 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($projectstatic->usage_task ?
' checked="checked"' :
'')).
'"> ';
302 $htmltext = $langs->trans(
"ProjectFollowTasks");
303 print
$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
306 if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
307 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"' :
'')).
'"> ';
308 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
309 print
$form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
313 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"' :
'')).
'"> ';
314 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
315 print
$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
321 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
322 if ($projectstatic->public) {
323 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
324 print $langs->trans(
'SharedProject');
326 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
327 print $langs->trans(
'PrivateProject');
332 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
333 if (strcmp($projectstatic->budget_amount,
'')) {
334 print
'<span class="amount">'.price($projectstatic->budget_amount,
'', $langs, 1, 0, 0, $conf->currency).
'</span>';
339 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
341 print ($start ? $start :
'?');
344 print ($end ? $end :
'?');
345 if ($projectstatic->hasDelay()) {
358 print
'<div class="fichehalfright">';
359 print
'<div class="underbanner clearboth"></div>';
361 print
'<table class="border tableforfield centpercent">';
364 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
365 print nl2br($projectstatic->description);
370 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
371 print
$form->showCategories($projectstatic->id,
'project', 1);
380 print
'<div class="clearboth"></div>';
415 if ($action ==
'clone') {
416 $formquestion = array(
417 'text' => $langs->trans(
"ConfirmClone"),
419 array(
'type' =>
'checkbox',
'name' =>
'clone_change_dt',
'label' => $langs->trans(
"CloneChanges"),
'value' =>
true),
420 array(
'type' =>
'checkbox',
'name' =>
'clone_affectation',
'label' => $langs->trans(
"CloneAffectation"),
'value' =>
true),
421 array(
'type' =>
'checkbox',
'name' =>
'clone_prog',
'label' => $langs->trans(
"CloneProgression"),
'value' =>
true),
422 array(
'type' =>
'checkbox',
'name' =>
'clone_time',
'label' => $langs->trans(
"CloneTimes"),
'value' =>
true),
423 array(
'type' =>
'checkbox',
'name' =>
'clone_file',
'label' => $langs->trans(
"CloneFile"),
'value' =>
true),
427 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"ToClone"), $langs->trans(
"ConfirmCloneTask"),
"confirm_clone", $formquestion,
'', 1, 300, 590);
433 if ($action ==
'edit' && $user->rights->projet->creer) {
434 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
435 print
'<input type="hidden" name="token" value="'.newToken().
'">';
436 print
'<input type="hidden" name="action" value="update">';
437 print
'<input type="hidden" name="withproject" value="'.$withproject.
'">';
438 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
440 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), 0,
'projecttask', 0,
'',
'');
442 print
'<table class="border centpercent">';
445 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Ref").
'</td>';
446 print
'<td><input class="minwidth100" name="taskref" value="'.$object->ref.
'"></td></tr>';
449 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td>';
450 print
'<td><input class="minwidth500" name="label" value="'.$object->label.
'"></td></tr>';
453 if (empty($withproject)) {
454 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td colspan="3">';
455 print $projectstatic->getNomUrl(1);
459 print
'<td>'.$langs->trans(
"ThirdParty").
'</td><td colspan="3">';
460 if ($projectstatic->thirdparty->id) {
461 print $projectstatic->thirdparty->getNomUrl(1);
469 print
'<tr><td>'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
470 $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id,
'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
474 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
475 print
$form->selectDate($object->date_start,
'dateo', 1, 1, 0,
'', 1, 0);
479 print
'<tr><td>'.$langs->trans(
"Deadline").
'</td><td>';
480 print
$form->selectDate($object->date_end ? $object->date_end : -1,
'datee', 1, 1, 0,
'', 1, 0);
484 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
485 print
$form->select_duration(
'planned_workload', $object->planned_workload, 0,
'text');
489 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td>';
490 print $formother->select_percent($object->progress,
'progress', 0, 5, 0, 100, 1);
494 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
498 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
499 $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0);
500 if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
501 $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
503 $doleditor =
new DolEditor(
'description', $object->description,
'', 80,
'dolibarr_details',
'',
false,
true, $cked_enabled, $nbrows);
504 print $doleditor->Create();
507 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
508 print
'<td><input size="5" type="text" name="budget_amount" value="'.dol_escape_htmltag(
GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
price2num($object->budget_amount)).
'"></td>';
512 $parameters = array();
513 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
514 print $hookmanager->resPrint;
515 if (empty($reshook)) {
516 print $object->showOptionals($extrafields,
'edit');
523 print
$form->buttonsSaveCancel(
"Modify");
530 $param = ($withproject ?
'&withproject=1' :
'');
531 $linkback = $withproject ?
'<a href="'.DOL_URL_ROOT.
'/projet/tasks.php?id='.$projectstatic->id.
'&restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>' :
'';
533 print
dol_get_fiche_head($head,
'task_task', $langs->trans(
"Task"), -1,
'projecttask', 0,
'',
'reposition');
535 if ($action ==
'delete') {
536 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
GETPOST(
"id",
'int').
'&withproject='.$withproject, $langs->trans(
"DeleteATask"), $langs->trans(
"ConfirmDeleteATask"),
"confirm_delete");
539 if (!
GETPOST(
'withproject') || empty($projectstatic->id)) {
540 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
541 $object->next_prev_filter =
" fk_projet IN (".$db->sanitize($projectsListId).
")";
543 $object->next_prev_filter =
" fk_projet = ".((int) $projectstatic->id);
549 if (empty($withproject)) {
550 $morehtmlref .=
'<div class="refidno">';
551 $morehtmlref .= $langs->trans(
"Project").
': ';
552 $morehtmlref .= $projectstatic->getNomUrl(1);
553 $morehtmlref .=
'<br>';
556 $morehtmlref .= $langs->trans(
"ThirdParty").
': ';
557 if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) {
558 $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
560 $morehtmlref .=
'</div>';
563 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref, $param);
565 print
'<div class="fichecenter">';
566 print
'<div class="fichehalfleft">';
568 print
'<div class="underbanner clearboth"></div>';
569 print
'<table class="border centpercent tableforfield">';
572 print
'<tr><td>'.$langs->trans(
"ChildOfTask").
'</td><td>';
573 if ($object->fk_task_parent > 0) {
574 $tasktmp =
new Task($db);
575 $tasktmp->fetch($object->fk_task_parent);
576 print $tasktmp->getNomUrl(1);
581 print
'<tr><td class="titlefield">'.$langs->trans(
"DateStart").
' - '.$langs->trans(
"Deadline").
'</td><td colspan="3">';
583 print ($start ? $start :
'?');
586 print ($end ? $end :
'?');
587 if ($object->hasDelay()) {
593 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td colspan="3">';
594 if ($object->planned_workload !=
'') {
600 print
'<td class="tdtop">'.$langs->trans(
"Description").
'</td><td colspan="3">';
607 print
'<div class="fichehalfright">';
609 print
'<div class="underbanner clearboth"></div>';
610 print
'<table class="border centpercent tableforfield">';
613 print
'<tr><td class="titlefield">'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
614 if ($object->progress !=
'') {
615 print $object->progress.
' %';
620 print
'<tr><td>'.$langs->trans(
"ProgressCalculated").
'</td><td colspan="3">';
621 if ($object->planned_workload !=
'') {
622 $tmparray = $object->getSummaryOfTimeSpent();
623 if ($tmparray[
'total_duration'] > 0 && !empty($object->planned_workload)) {
624 print round($tmparray[
'total_duration'] / $object->planned_workload * 100, 2).
' %';
629 print
'<span class="opacitymedium">'.$langs->trans(
"WorkloadNotDefined").
'</span>';
634 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
635 if (strcmp($object->budget_amount,
'')) {
636 print
'<span class="amount">'.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).
'</span>';
642 $parameters = array(
'socid'=>$socid);
643 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
650 print
'<div class="clearboth"></div>';
656 if ($action !=
'edit') {
661 print
'<div class="tabsAction">';
663 $parameters = array();
664 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
666 if (empty($reshook)) {
668 if ($user->rights->projet->creer) {
669 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Modify').
'</a>';
670 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=clone&token='.
newToken().
'&withproject='.((int) $withproject).
'">'.$langs->trans(
'Clone').
'</a>';
672 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
'Modify').
'</a>';
676 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
677 if ($permissiontodelete) {
678 if (!$object->hasChildren() && !$object->hasTimeSpent()) {
679 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
681 print
dolGetButtonAction($langs->trans(
"TaskHasChild"), $langs->trans(
"Delete"),
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', 0);
684 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken().
'&withproject='.((
int) $withproject),
'delete', $permissiontodelete);
690 print
'<div class="fichecenter"><div class="fichehalfleft">';
691 print
'<a name="builddoc"></a>';
698 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
699 $genallowed = ($user->rights->projet->lire);
700 $delallowed = ($user->rights->projet->creer);
702 print $formfile->showdocuments(
'project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
704 print
'</div><div class="fichehalfright">';
707 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
709 $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
710 $formactions->showactions($object,
'task', $defaultthirdpartyid, 1,
'', 10,
'withproject='.$withproject);
712 print
'</div></div>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif($action=='specimen') elseif($action=='setmodel') elseif($action=='del') elseif($action=='setdoc') $formactions
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
Class to manage projects.
Class to manage translations.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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_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.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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...
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.