|
@@ -34,14 +34,14 @@ discard block |
|
|
block discarded – undo |
|
34
|
34
|
|
|
35
|
35
|
// Load Dolibarr environment |
|
36
|
36
|
require '../../main.inc.php'; |
|
37
|
|
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
38
|
|
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
39
|
|
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
40
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
41
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
42
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
43
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
44
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
|
37
|
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
|
38
|
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
|
39
|
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
|
40
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
|
41
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
|
42
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
|
43
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
|
44
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
45
|
45
|
|
|
46
|
46
|
/** |
|
47
|
47
|
* @var Conf $conf |
|
@@ -180,7 +180,7 @@ discard block |
|
|
block discarded – undo |
|
180
|
180
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
181
|
181
|
} |
|
182
|
182
|
|
|
183
|
|
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
|
183
|
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
184
|
184
|
|
|
185
|
185
|
// Purge search criteria |
|
186
|
186
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
|
@@ -361,10 +361,10 @@ discard block |
|
|
block discarded – undo |
|
361
|
361
|
} |
|
362
|
362
|
|
|
363
|
363
|
if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
|
364
|
|
- $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
|
364
|
+ $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
365
|
365
|
|
|
366
|
366
|
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
|
367
|
|
- $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
|
367
|
+ $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
368
|
368
|
|
|
369
|
369
|
if ($result < 0) { |
|
370
|
370
|
$langs->load("errors"); |
|
@@ -384,7 +384,7 @@ discard block |
|
|
block discarded – undo |
|
384
|
384
|
if (count($tasksarray) > 0) { |
|
385
|
385
|
$id = $tasksarray[0]->id; |
|
386
|
386
|
} else { |
|
387
|
|
- header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
|
387
|
+ header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
388
|
388
|
exit; |
|
389
|
389
|
} |
|
390
|
390
|
} |
|
@@ -422,9 +422,9 @@ discard block |
|
|
block discarded – undo |
|
422
|
422
|
if (!($projectstatic->thirdparty->id > 0)) { |
|
423
|
423
|
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
|
424
|
424
|
} else { |
|
425
|
|
- include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
426
|
|
- include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
427
|
|
- include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
|
425
|
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
|
426
|
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
|
427
|
+ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
428
|
428
|
|
|
429
|
429
|
$tmpinvoice = new Facture($db); |
|
430
|
430
|
$tmptimespent = new Task($db); |
|
@@ -490,7 +490,7 @@ discard block |
|
|
block discarded – undo |
|
490
|
490
|
$arrayoftasks = array(); |
|
491
|
491
|
foreach ($toselect as $key => $value) { |
|
492
|
492
|
// Get userid, timepent |
|
493
|
|
- $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
|
493
|
+ $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
494
|
494
|
$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
|
495
|
495
|
$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
|
496
|
496
|
} |
|
@@ -563,7 +563,7 @@ discard block |
|
|
block discarded – undo |
|
563
|
563
|
} |
|
564
|
564
|
|
|
565
|
565
|
// Add lines |
|
566
|
|
- $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); |
|
|
566
|
+ $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); |
|
567
|
567
|
if ($lineid < 0) { |
|
568
|
568
|
$error++; |
|
569
|
569
|
setEventMessages(null, $tmpinvoice->errors, 'errors'); |
|
@@ -596,16 +596,16 @@ discard block |
|
|
block discarded – undo |
|
596
|
596
|
|
|
597
|
597
|
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
|
598
|
598
|
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
|
599
|
|
- $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
|
599
|
+ $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
600
|
600
|
$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
|
601
|
601
|
|
|
602
|
602
|
if (!empty($withdetail)) { |
|
603
|
603
|
if (!empty($object->timespent_withhour)) { |
|
604
|
|
- $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
|
604
|
+ $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
605
|
605
|
} else { |
|
606
|
|
- $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
|
606
|
+ $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
607
|
607
|
} |
|
608
|
|
- $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
|
608
|
+ $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
609
|
609
|
} |
|
610
|
610
|
$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
|
611
|
611
|
$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
|
@@ -683,7 +683,7 @@ discard block |
|
|
block discarded – undo |
|
683
|
683
|
$arrayoftasks = array(); |
|
684
|
684
|
foreach ($toselect as $key => $value) { |
|
685
|
685
|
// Get userid, timepent |
|
686
|
|
- $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object) |
|
|
686
|
+ $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object) |
|
687
|
687
|
// $object->id is now the task id |
|
688
|
688
|
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
|
689
|
689
|
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
|
@@ -759,7 +759,7 @@ discard block |
|
|
block discarded – undo |
|
759
|
759
|
// Add lines |
|
760
|
760
|
$date_start = ''; |
|
761
|
761
|
$date_end = ''; |
|
762
|
|
- $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
|
762
|
+ $lineName = $ftask->ref.' - '.$ftask->label; |
|
763
|
763
|
$lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht); |
|
764
|
764
|
if ($lineid < 0) { |
|
765
|
765
|
$error++; |
|
@@ -769,8 +769,8 @@ discard block |
|
|
block discarded – undo |
|
769
|
769
|
|
|
770
|
770
|
if (!$error) { |
|
771
|
771
|
// Update lineid into line of timespent |
|
772
|
|
- $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
773
|
|
- $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
|
772
|
+ $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
|
773
|
+ $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
774
|
774
|
$result = $db->query($sql); |
|
775
|
775
|
if (!$result) { |
|
776
|
776
|
$error++; |
|
@@ -806,12 +806,12 @@ discard block |
|
|
block discarded – undo |
|
806
|
806
|
if (!($projectstatic->thirdparty->id > 0)) { |
|
807
|
807
|
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
|
808
|
808
|
} else { |
|
809
|
|
- include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
810
|
|
- include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
811
|
|
- include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
|
809
|
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
|
810
|
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
|
811
|
+ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
812
|
812
|
|
|
813
|
813
|
|
|
814
|
|
- require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
|
814
|
+ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
815
|
815
|
$tmpinter = new Fichinter($db); |
|
816
|
816
|
$tmptimespent = new Task($db); |
|
817
|
817
|
$fuser = new User($db); |
|
@@ -823,7 +823,7 @@ discard block |
|
|
block discarded – undo |
|
823
|
823
|
$tmpinter->socid = $projectstatic->thirdparty->id; |
|
824
|
824
|
$tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
|
825
|
825
|
$tmpinter->fk_project = $projectstatic->id; |
|
826
|
|
- $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
|
826
|
+ $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
827
|
827
|
|
|
828
|
828
|
if ($interToUse) { |
|
829
|
829
|
$tmpinter->fetch($interToUse); |
|
@@ -856,7 +856,7 @@ discard block |
|
|
block discarded – undo |
|
856
|
856
|
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
|
857
|
857
|
|
|
858
|
858
|
// Add lines |
|
859
|
|
- $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']); |
|
|
859
|
+ $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), (int) $value['date'], $value['timespent']); |
|
860
|
860
|
|
|
861
|
861
|
if ($lineid > 0) { |
|
862
|
862
|
// Link timespent to intervention |
|
@@ -900,9 +900,9 @@ discard block |
|
|
block discarded – undo |
|
900
|
900
|
//$result = $projectstatic->fetch($object->fk_project); |
|
901
|
901
|
$arrayofselected = is_array($toselect) ? $toselect : array(); |
|
902
|
902
|
|
|
903
|
|
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
|
903
|
+$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
904
|
904
|
if (!empty($withproject)) { |
|
905
|
|
- $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
|
905
|
+ $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
906
|
906
|
} |
|
907
|
907
|
$help_url = ''; |
|
908
|
908
|
|
|
@@ -951,13 +951,13 @@ discard block |
|
|
block discarded – undo |
|
951
|
951
|
|
|
952
|
952
|
$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
|
953
|
953
|
if ($search_user) { |
|
954
|
|
- $param .= '&search_user=' . ((int) $search_user); |
|
|
954
|
+ $param .= '&search_user='.((int) $search_user); |
|
955
|
955
|
} |
|
956
|
956
|
if ($search_month) { |
|
957
|
|
- $param .= '&search_month=' . ((int) $search_month); |
|
|
957
|
+ $param .= '&search_month='.((int) $search_month); |
|
958
|
958
|
} |
|
959
|
959
|
if ($search_year) { |
|
960
|
|
- $param .= '&search_year=' . ((int) $search_year); |
|
|
960
|
+ $param .= '&search_year='.((int) $search_year); |
|
961
|
961
|
} |
|
962
|
962
|
|
|
963
|
963
|
// Project card |
|
@@ -969,14 +969,14 @@ discard block |
|
|
block discarded – undo |
|
969
|
969
|
$morehtmlref .= $projectstatic->title; |
|
970
|
970
|
// Thirdparty |
|
971
|
971
|
if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
|
972
|
|
- $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
|
972
|
+ $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
973
|
973
|
} |
|
974
|
974
|
$morehtmlref .= '</div>'; |
|
975
|
975
|
|
|
976
|
976
|
// Define a complementary filter for search of next/prev ref. |
|
977
|
977
|
if (!$user->hasRight('projet', 'all', 'lire')) { |
|
978
|
978
|
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
|
979
|
|
- $projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
|
979
|
+ $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); |
|
980
|
980
|
} |
|
981
|
981
|
|
|
982
|
982
|
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
|
@@ -994,25 +994,25 @@ discard block |
|
|
block discarded – undo |
|
994
|
994
|
print '</td>'; |
|
995
|
995
|
print '<td>'; |
|
996
|
996
|
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
|
997
|
|
- print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
|
997
|
+ print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
998
|
998
|
$htmltext = $langs->trans("ProjectFollowOpportunity"); |
|
999
|
999
|
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
|
1000
|
1000
|
print '<br>'; |
|
1001
|
1001
|
} |
|
1002
|
1002
|
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
|
1003
|
|
- print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
|
1003
|
+ print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
1004
|
1004
|
$htmltext = $langs->trans("ProjectFollowTasks"); |
|
1005
|
1005
|
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
|
1006
|
1006
|
print '<br>'; |
|
1007
|
1007
|
} |
|
1008
|
1008
|
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
|
1009
|
|
- 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"' : '')) . '"> '; |
|
|
1009
|
+ 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"' : '')).'"> '; |
|
1010
|
1010
|
$htmltext = $langs->trans("ProjectBillTimeDescription"); |
|
1011
|
1011
|
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
|
1012
|
1012
|
print '<br>'; |
|
1013
|
1013
|
} |
|
1014
|
1014
|
if (isModEnabled('eventorganization')) { |
|
1015
|
|
- 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"' : '')) . '"> '; |
|
|
1015
|
+ 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"' : '')).'"> '; |
|
1016
|
1016
|
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
|
1017
|
1017
|
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
|
1018
|
1018
|
} |
|
@@ -1020,14 +1020,14 @@ discard block |
|
|
block discarded – undo |
|
1020
|
1020
|
} |
|
1021
|
1021
|
|
|
1022
|
1022
|
// Budget |
|
1023
|
|
- print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
|
1023
|
+ print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1024
|
1024
|
if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
|
1025
|
|
- print '<span class="amount">' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
|
1025
|
+ print '<span class="amount">'.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1026
|
1026
|
} |
|
1027
|
1027
|
print '</td></tr>'; |
|
1028
|
1028
|
|
|
1029
|
1029
|
// Date start - end project |
|
1030
|
|
- print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
|
1030
|
+ print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1031
|
1031
|
$start = dol_print_date($projectstatic->date_start, 'day'); |
|
1032
|
1032
|
print($start ? $start : '?'); |
|
1033
|
1033
|
$end = dol_print_date($projectstatic->date_end, 'day'); |
|
@@ -1039,7 +1039,7 @@ discard block |
|
|
block discarded – undo |
|
1039
|
1039
|
print '</td></tr>'; |
|
1040
|
1040
|
|
|
1041
|
1041
|
// Visibility |
|
1042
|
|
- print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
|
1042
|
+ print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1043
|
1043
|
if ($projectstatic->public) { |
|
1044
|
1044
|
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
|
1045
|
1045
|
print $langs->trans('SharedProject'); |
|
@@ -1053,7 +1053,7 @@ discard block |
|
|
block discarded – undo |
|
1053
|
1053
|
$cols = 2; |
|
1054
|
1054
|
$savobject = $object; |
|
1055
|
1055
|
$object = $projectstatic; |
|
1056
|
|
- include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
|
1056
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1057
|
1057
|
$object = $savobject; |
|
1058
|
1058
|
|
|
1059
|
1059
|
print '</table>'; |
|
@@ -1066,7 +1066,7 @@ discard block |
|
|
block discarded – undo |
|
1066
|
1066
|
|
|
1067
|
1067
|
// Categories |
|
1068
|
1068
|
if (isModEnabled('category')) { |
|
1069
|
|
- print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
|
1069
|
+ print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1070
|
1070
|
print $form->showCategories($projectstatic->id, 'project', 1); |
|
1071
|
1071
|
print "</td></tr>"; |
|
1072
|
1072
|
} |
|
@@ -1105,12 +1105,12 @@ discard block |
|
|
block discarded – undo |
|
1105
|
1105
|
|
|
1106
|
1106
|
if (!empty($projectidforalltimes)) { |
|
1107
|
1107
|
// We are on tab 'Time Spent' of project |
|
1108
|
|
- $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1109
|
|
- $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
|
1108
|
+ $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
|
1109
|
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1110
|
1110
|
} else { |
|
1111
|
1111
|
// We are on tab 'Time Spent' of task |
|
1112
|
|
- $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1113
|
|
- $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
|
1112
|
+ $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
|
1113
|
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1114
|
1114
|
} |
|
1115
|
1115
|
} else { |
|
1116
|
1116
|
$linktocreatetimeBtnStatus = -2; |
|
@@ -1155,19 +1155,19 @@ discard block |
|
|
block discarded – undo |
|
1155
|
1155
|
print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
|
1156
|
1156
|
|
|
1157
|
1157
|
if ($action == 'deleteline') { |
|
1158
|
|
- $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
|
1158
|
+ $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1159
|
1159
|
print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
|
1160
|
1160
|
} |
|
1161
|
1161
|
|
|
1162
|
1162
|
$param = ($withproject ? '&withproject=1' : ''); |
|
1163
|
|
- $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1164
|
|
- $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
|
1163
|
+ $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
|
1164
|
+ $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1165
|
1165
|
|
|
1166
|
1166
|
if (!GETPOST('withproject') || empty($projectstatic->id)) { |
|
1167
|
1167
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
|
1168
|
|
- $object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId); |
|
|
1168
|
+ $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); |
|
1169
|
1169
|
} else { |
|
1170
|
|
- $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); |
|
|
1170
|
+ $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); |
|
1171
|
1171
|
} |
|
1172
|
1172
|
|
|
1173
|
1173
|
$morehtmlref = ''; |
|
@@ -1175,12 +1175,12 @@ discard block |
|
|
block discarded – undo |
|
1175
|
1175
|
// Project |
|
1176
|
1176
|
if (empty($withproject)) { |
|
1177
|
1177
|
$morehtmlref .= '<div class="refidno">'; |
|
1178
|
|
- $morehtmlref .= $langs->trans("Project") . ': '; |
|
|
1178
|
+ $morehtmlref .= $langs->trans("Project").': '; |
|
1179
|
1179
|
$morehtmlref .= $projectstatic->getNomUrl(1); |
|
1180
|
1180
|
$morehtmlref .= '<br>'; |
|
1181
|
1181
|
|
|
1182
|
1182
|
// Third party |
|
1183
|
|
- $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
|
1183
|
+ $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1184
|
1184
|
if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
|
1185
|
1185
|
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
|
1186
|
1186
|
} |
|
@@ -1196,7 +1196,7 @@ discard block |
|
|
block discarded – undo |
|
1196
|
1196
|
print '<table class="border centpercent tableforfield">'; |
|
1197
|
1197
|
|
|
1198
|
1198
|
// Task parent |
|
1199
|
|
- print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
|
1199
|
+ print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1200
|
1200
|
if ($object->fk_task_parent > 0) { |
|
1201
|
1201
|
$tasktmp = new Task($db); |
|
1202
|
1202
|
$tasktmp->fetch($object->fk_task_parent); |
|
@@ -1205,7 +1205,7 @@ discard block |
|
|
block discarded – undo |
|
1205
|
1205
|
print '</td></tr>'; |
|
1206
|
1206
|
|
|
1207
|
1207
|
// Date start - Date end task |
|
1208
|
|
- print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
|
1208
|
+ print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1209
|
1209
|
$start = dol_print_date($object->date_start, 'dayhour'); |
|
1210
|
1210
|
print($start ? $start : '?'); |
|
1211
|
1211
|
$end = dol_print_date($object->date_end, 'dayhour'); |
|
@@ -1217,7 +1217,7 @@ discard block |
|
|
block discarded – undo |
|
1217
|
1217
|
print '</td></tr>'; |
|
1218
|
1218
|
|
|
1219
|
1219
|
// Planned workload |
|
1220
|
|
- print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
|
1220
|
+ print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1221
|
1221
|
if ($object->planned_workload) { |
|
1222
|
1222
|
print convertSecondToTime($object->planned_workload, 'allhourmin'); |
|
1223
|
1223
|
} |
|
@@ -1232,21 +1232,21 @@ discard block |
|
|
block discarded – undo |
|
1232
|
1232
|
print '<table class="border tableforfield centpercent">'; |
|
1233
|
1233
|
|
|
1234
|
1234
|
// Progress declared |
|
1235
|
|
- print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1236
|
|
- print $object->progress != '' ? $object->progress . ' %' : ''; |
|
|
1235
|
+ print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
|
1236
|
+ print $object->progress != '' ? $object->progress.' %' : ''; |
|
1237
|
1237
|
print '</td></tr>'; |
|
1238
|
1238
|
|
|
1239
|
1239
|
// Progress calculated |
|
1240
|
|
- print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
|
1240
|
+ print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1241
|
1241
|
if ($object->planned_workload) { |
|
1242
|
1242
|
$tmparray = $object->getSummaryOfTimeSpent(); |
|
1243
|
1243
|
if ($tmparray['total_duration'] > 0) { |
|
1244
|
|
- print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
|
1244
|
+ print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1245
|
1245
|
} else { |
|
1246
|
1246
|
print '0 %'; |
|
1247
|
1247
|
} |
|
1248
|
1248
|
} else { |
|
1249
|
|
- print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
|
1249
|
+ print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1250
|
1250
|
} |
|
1251
|
1251
|
print '</td>'; |
|
1252
|
1252
|
|
|
@@ -1262,7 +1262,7 @@ discard block |
|
|
block discarded – undo |
|
1262
|
1262
|
print dol_get_fiche_end(); |
|
1263
|
1263
|
} else { |
|
1264
|
1264
|
if ($action == 'deleteline') { |
|
1265
|
|
- $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
|
1265
|
+ $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1266
|
1266
|
print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
|
1267
|
1267
|
} |
|
1268
|
1268
|
} |
|
@@ -1276,7 +1276,7 @@ discard block |
|
|
block discarded – undo |
|
1276
|
1276
|
|
|
1277
|
1277
|
if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
|
1278
|
1278
|
// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
|
1279
|
|
- $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
|
1279
|
+ $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT('lineid').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
|
1280
|
1280
|
$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
|
1281
|
1281
|
} |
|
1282
|
1282
|
|
|
@@ -1295,10 +1295,10 @@ discard block |
|
|
block discarded – undo |
|
1295
|
1295
|
// Definition of fields for list |
|
1296
|
1296
|
$arrayfields = array(); |
|
1297
|
1297
|
$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1'); |
|
1298
|
|
- $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1'); |
|
|
1298
|
+ $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => '1'); |
|
1299
|
1299
|
$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); |
|
1300
|
1300
|
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
|
1301
|
|
- if (! empty($allprojectforuser)) { |
|
|
1301
|
+ if (!empty($allprojectforuser)) { |
|
1302
|
1302
|
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1']; |
|
1303
|
1303
|
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1']; |
|
1304
|
1304
|
} |
|
@@ -1314,82 +1314,82 @@ discard block |
|
|
block discarded – undo |
|
1314
|
1314
|
$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries")); |
|
1315
|
1315
|
$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
|
1316
|
1316
|
// Extra fields |
|
1317
|
|
- include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
|
1317
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1318
|
1318
|
|
|
1319
|
1319
|
$arrayfields = dol_sort_array($arrayfields, 'position'); |
|
1320
|
1320
|
|
|
1321
|
1321
|
$param = ''; |
|
1322
|
1322
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
|
1323
|
|
- $param .= '&contextpage=' . urlencode($contextpage); |
|
|
1323
|
+ $param .= '&contextpage='.urlencode($contextpage); |
|
1324
|
1324
|
} |
|
1325
|
1325
|
if ($limit > 0 && $limit != $conf->liste_limit) { |
|
1326
|
1326
|
$param .= '&limit='.((int) $limit); |
|
1327
|
1327
|
} |
|
1328
|
1328
|
if ($search_month > 0) { |
|
1329
|
|
- $param .= '&search_month=' . urlencode((string) ($search_month)); |
|
|
1329
|
+ $param .= '&search_month='.urlencode((string) ($search_month)); |
|
1330
|
1330
|
} |
|
1331
|
1331
|
if ($search_year > 0) { |
|
1332
|
|
- $param .= '&search_year=' . urlencode((string) ($search_year)); |
|
|
1332
|
+ $param .= '&search_year='.urlencode((string) ($search_year)); |
|
1333
|
1333
|
} |
|
1334
|
1334
|
if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
|
1335
|
1335
|
$param .= '&search_user='.urlencode($search_user); |
|
1336
|
1336
|
} |
|
1337
|
1337
|
if ($search_task_ref != '') { |
|
1338
|
|
- $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
|
1338
|
+ $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1339
|
1339
|
} |
|
1340
|
1340
|
if ($search_company != '') { |
|
1341
|
|
- $param .= '&$search_company=' . urlencode($search_company); |
|
|
1341
|
+ $param .= '&$search_company='.urlencode($search_company); |
|
1342
|
1342
|
} |
|
1343
|
1343
|
if ($search_company_alias != '') { |
|
1344
|
|
- $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
|
1344
|
+ $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1345
|
1345
|
} |
|
1346
|
1346
|
if ($search_project_ref != '') { |
|
1347
|
|
- $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
|
1347
|
+ $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1348
|
1348
|
} |
|
1349
|
1349
|
if ($search_project_label != '') { |
|
1350
|
|
- $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
|
1350
|
+ $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1351
|
1351
|
} |
|
1352
|
1352
|
if ($search_task_label != '') { |
|
1353
|
|
- $param .= '&search_task_label=' . urlencode($search_task_label); |
|
|
1353
|
+ $param .= '&search_task_label='.urlencode($search_task_label); |
|
1354
|
1354
|
} |
|
1355
|
1355
|
if ($search_note != '') { |
|
1356
|
|
- $param .= '&search_note=' . urlencode($search_note); |
|
|
1356
|
+ $param .= '&search_note='.urlencode($search_note); |
|
1357
|
1357
|
} |
|
1358
|
1358
|
if ($search_duration != '') { |
|
1359
|
|
- $param .= '&search_field2=' . urlencode((string) ($search_duration)); |
|
|
1359
|
+ $param .= '&search_field2='.urlencode((string) ($search_duration)); |
|
1360
|
1360
|
} |
|
1361
|
1361
|
if ($optioncss != '') { |
|
1362
|
|
- $param .= '&optioncss=' . urlencode($optioncss); |
|
|
1362
|
+ $param .= '&optioncss='.urlencode($optioncss); |
|
1363
|
1363
|
} |
|
1364
|
1364
|
if ($search_date_startday) { |
|
1365
|
|
- $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); |
|
|
1365
|
+ $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); |
|
1366
|
1366
|
} |
|
1367
|
1367
|
if ($search_date_startmonth) { |
|
1368
|
|
- $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); |
|
|
1368
|
+ $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth)); |
|
1369
|
1369
|
} |
|
1370
|
1370
|
if ($search_date_startyear) { |
|
1371
|
|
- $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); |
|
|
1371
|
+ $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear)); |
|
1372
|
1372
|
} |
|
1373
|
1373
|
if ($search_date_endday) { |
|
1374
|
|
- $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); |
|
|
1374
|
+ $param .= '&search_date_endday='.urlencode((string) ($search_date_endday)); |
|
1375
|
1375
|
} |
|
1376
|
1376
|
if ($search_date_endmonth) { |
|
1377
|
|
- $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); |
|
|
1377
|
+ $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth)); |
|
1378
|
1378
|
} |
|
1379
|
1379
|
if ($search_date_endyear) { |
|
1380
|
|
- $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); |
|
|
1380
|
+ $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear)); |
|
1381
|
1381
|
} |
|
1382
|
1382
|
if ($search_timespent_starthour) { |
|
1383
|
|
- $param .= '&search_timespent_duration_starthour=' . urlencode((string) ($search_timespent_starthour)); |
|
|
1383
|
+ $param .= '&search_timespent_duration_starthour='.urlencode((string) ($search_timespent_starthour)); |
|
1384
|
1384
|
} |
|
1385
|
1385
|
if ($search_timespent_startmin) { |
|
1386
|
|
- $param .= '&search_timespent_duration_startmin=' . urlencode((string) ($search_timespent_startmin)); |
|
|
1386
|
+ $param .= '&search_timespent_duration_startmin='.urlencode((string) ($search_timespent_startmin)); |
|
1387
|
1387
|
} |
|
1388
|
1388
|
if ($search_timespent_endhour) { |
|
1389
|
|
- $param .= '&search_timespent_duration_endhour=' . urlencode((string) ($search_timespent_endhour)); |
|
|
1389
|
+ $param .= '&search_timespent_duration_endhour='.urlencode((string) ($search_timespent_endhour)); |
|
1390
|
1390
|
} |
|
1391
|
1391
|
if ($search_timespent_endmin) { |
|
1392
|
|
- $param .= '&search_timespent_duration_endmin=' . urlencode((string) ($search_timespent_endmin)); |
|
|
1392
|
+ $param .= '&search_timespent_duration_endmin='.urlencode((string) ($search_timespent_endmin)); |
|
1393
|
1393
|
} |
|
1394
|
1394
|
|
|
1395
|
1395
|
/* |
|
@@ -1397,24 +1397,24 @@ discard block |
|
|
block discarded – undo |
|
1397
|
1397
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
|
1398
|
1398
|
*/ |
|
1399
|
1399
|
if ($id) { |
|
1400
|
|
- $param .= '&id=' . urlencode((string) ($id)); |
|
|
1400
|
+ $param .= '&id='.urlencode((string) ($id)); |
|
1401
|
1401
|
} |
|
1402
|
1402
|
if ($projectid) { |
|
1403
|
|
- $param .= '&projectid=' . urlencode((string) ($projectid)); |
|
|
1403
|
+ $param .= '&projectid='.urlencode((string) ($projectid)); |
|
1404
|
1404
|
} |
|
1405
|
1405
|
if ($withproject) { |
|
1406
|
|
- $param .= '&withproject=' . urlencode((string) ($withproject)); |
|
|
1406
|
+ $param .= '&withproject='.urlencode((string) ($withproject)); |
|
1407
|
1407
|
} |
|
1408
|
1408
|
// Add $param from hooks |
|
1409
|
1409
|
$parameters = array('param' => &$param); |
|
1410
|
1410
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
|
1411
|
1411
|
$param .= $hookmanager->resPrint; |
|
1412
|
1412
|
|
|
1413
|
|
- print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
|
1413
|
+ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1414
|
1414
|
if ($optioncss != '') { |
|
1415
|
|
- print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
|
1415
|
+ print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1416
|
1416
|
} |
|
1417
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
|
1417
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1418
|
1418
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
|
1419
|
1419
|
if ($action == 'editline') { |
|
1420
|
1420
|
print '<input type="hidden" name="action" value="updateline">'; |
|
@@ -1429,13 +1429,13 @@ discard block |
|
|
block discarded – undo |
|
1429
|
1429
|
} else { |
|
1430
|
1430
|
print '<input type="hidden" name="action" value="list">'; |
|
1431
|
1431
|
} |
|
1432
|
|
- print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1433
|
|
- print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
|
1432
|
+ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
|
1433
|
+ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1434
|
1434
|
|
|
1435
|
|
- print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1436
|
|
- print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1437
|
|
- print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1438
|
|
- print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
|
1435
|
+ print '<input type="hidden" name="id" value="'.$id.'">'; |
|
|
1436
|
+ print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
|
1437
|
+ print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
|
1438
|
+ print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1439
|
1439
|
print '<input type="hidden" name="page_y" value="">'; |
|
1440
|
1440
|
|
|
1441
|
1441
|
// Form to convert time spent into invoice |
|
@@ -1462,7 +1462,7 @@ discard block |
|
|
block discarded – undo |
|
1462
|
1462
|
'onelineperperiod' => 'OneLinePerTimeSpentLine', |
|
1463
|
1463
|
); |
|
1464
|
1464
|
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
|
1465
|
|
- print "\n" . '<script type="text/javascript">'; |
|
|
1465
|
+ print "\n".'<script type="text/javascript">'; |
|
1466
|
1466
|
print ' |
|
1467
|
1467
|
$(document).ready(function () { |
|
1468
|
1468
|
setDetailVisibility(); |
|
@@ -1479,8 +1479,8 @@ discard block |
|
|
block discarded – undo |
|
1479
|
1479
|
} |
|
1480
|
1480
|
}); |
|
1481
|
1481
|
'; |
|
1482
|
|
- print '</script>' . "\n"; |
|
1483
|
|
- print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
|
1482
|
+ print '</script>'."\n"; |
|
|
1483
|
+ print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1484
|
1484
|
print '</td>'; |
|
1485
|
1485
|
print '</tr>'; |
|
1486
|
1486
|
|
|
@@ -1530,14 +1530,14 @@ discard block |
|
|
block discarded – undo |
|
1530
|
1530
|
|
|
1531
|
1531
|
print '<br>'; |
|
1532
|
1532
|
print '<div class="center">'; |
|
1533
|
|
- print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1534
|
|
- print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
|
1533
|
+ print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
|
1534
|
+ print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1535
|
1535
|
print '</div>'; |
|
1536
|
1536
|
print '<br>'; |
|
1537
|
1537
|
} else { |
|
1538
|
|
- print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
|
1538
|
+ print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1539
|
1539
|
print '<div class="center">'; |
|
1540
|
|
- print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
|
1540
|
+ print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1541
|
1541
|
print '</div>'; |
|
1542
|
1542
|
$massaction = ''; |
|
1543
|
1543
|
} |
|
@@ -1550,7 +1550,7 @@ discard block |
|
|
block discarded – undo |
|
1550
|
1550
|
print '<table class="noborder centpercent">'; |
|
1551
|
1551
|
print '<tr>'; |
|
1552
|
1552
|
print '<td class="titlefield">'; |
|
1553
|
|
- print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
|
1553
|
+ print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1554
|
1554
|
print '</td>'; |
|
1555
|
1555
|
print '<td>'; |
|
1556
|
1556
|
$forminter = new FormIntervention($db); |
|
@@ -1560,14 +1560,14 @@ discard block |
|
|
block discarded – undo |
|
1560
|
1560
|
print '</table>'; |
|
1561
|
1561
|
|
|
1562
|
1562
|
print '<div class="center">'; |
|
1563
|
|
- print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1564
|
|
- print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
|
1563
|
+ print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
|
1564
|
+ print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1565
|
1565
|
print '</div>'; |
|
1566
|
1566
|
print '<br>'; |
|
1567
|
1567
|
} else { |
|
1568
|
|
- print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
|
1568
|
+ print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1569
|
1569
|
print '<div class="center">'; |
|
1570
|
|
- print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
|
1570
|
+ print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1571
|
1571
|
print '</div>'; |
|
1572
|
1572
|
$massaction = ''; |
|
1573
|
1573
|
} |
|
@@ -1637,14 +1637,14 @@ discard block |
|
|
block discarded – undo |
|
1637
|
1637
|
$sql .= " AND t.fk_element =".((int) $object->id); |
|
1638
|
1638
|
} elseif (!empty($projectidforalltimes)) { |
|
1639
|
1639
|
// Limit on one project |
|
1640
|
|
- $sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")"; |
|
|
1640
|
+ $sql .= " AND pt.fk_projet IN (".$db->sanitize((string) $projectidforalltimes).")"; |
|
1641
|
1641
|
} elseif (!empty($allprojectforuser)) { |
|
1642
|
1642
|
// Limit on on user |
|
1643
|
1643
|
if (empty($search_user) && !empty($arrayfields['author']['checked'])) { |
|
1644
|
1644
|
$search_user = $user->id; |
|
1645
|
1645
|
} |
|
1646
|
1646
|
if ($search_user > 0) { |
|
1647
|
|
- $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
|
1647
|
+ $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1648
|
1648
|
} |
|
1649
|
1649
|
} |
|
1650
|
1650
|
|
|
@@ -1697,13 +1697,13 @@ discard block |
|
|
block discarded – undo |
|
1697
|
1697
|
if ($search_timespent_starthour || $search_timespent_startmin) { |
|
1698
|
1698
|
$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
|
1699
|
1699
|
$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
|
1700
|
|
- $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
|
1700
|
+ $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1701
|
1701
|
} |
|
1702
|
1702
|
|
|
1703
|
1703
|
if ($search_timespent_endhour || $search_timespent_endmin) { |
|
1704
|
1704
|
$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
|
1705
|
1705
|
$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
|
1706
|
|
- $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
|
1706
|
+ $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1707
|
1707
|
} |
|
1708
|
1708
|
} |
|
1709
|
1709
|
|
|
@@ -1751,13 +1751,13 @@ discard block |
|
|
block discarded – undo |
|
1751
|
1751
|
|
|
1752
|
1752
|
if ($num >= 0) { |
|
1753
|
1753
|
if (!empty($projectidforalltimes)) { |
|
1754
|
|
- print '<!-- List of time spent for project -->' . "\n"; |
|
|
1754
|
+ print '<!-- List of time spent for project -->'."\n"; |
|
1755
|
1755
|
|
|
1756
|
1756
|
$title = $langs->trans("ListTaskTimeUserProject"); |
|
1757
|
1757
|
|
|
1758
|
1758
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
|
1759
|
1759
|
} else { |
|
1760
|
|
- print '<!-- List of time spent -->' . "\n"; |
|
|
1760
|
+ print '<!-- List of time spent -->'."\n"; |
|
1761
|
1761
|
|
|
1762
|
1762
|
$title = $langs->trans("ListTaskTimeForTask"); |
|
1763
|
1763
|
|
|
@@ -1779,26 +1779,26 @@ discard block |
|
|
block discarded – undo |
|
1779
|
1779
|
* Form to add a new line of time spent |
|
1780
|
1780
|
*/ |
|
1781
|
1781
|
if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
|
1782
|
|
- print '<!-- table to add time spent -->' . "\n"; |
|
|
1782
|
+ print '<!-- table to add time spent -->'."\n"; |
|
1783
|
1783
|
if (!empty($id)) { |
|
1784
|
|
- print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
|
1784
|
+ print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1785
|
1785
|
} |
|
1786
|
1786
|
|
|
1787
|
1787
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
|
1788
|
1788
|
print '<table class="noborder nohover centpercent">'; |
|
1789
|
1789
|
|
|
1790
|
1790
|
print '<tr class="liste_titre">'; |
|
1791
|
|
- print '<td>' . $langs->trans("Date") . '</td>'; |
|
|
1791
|
+ print '<td>'.$langs->trans("Date").'</td>'; |
|
1792
|
1792
|
if (!empty($allprojectforuser)) { |
|
1793
|
|
- print '<td>' . $langs->trans("Project") . '</td>'; |
|
|
1793
|
+ print '<td>'.$langs->trans("Project").'</td>'; |
|
1794
|
1794
|
} |
|
1795
|
1795
|
if (empty($id)) { |
|
1796
|
|
- print '<td>' . $langs->trans("Task") . '</td>'; |
|
|
1796
|
+ print '<td>'.$langs->trans("Task").'</td>'; |
|
1797
|
1797
|
} |
|
1798
|
|
- print '<td>' . $langs->trans("By") . '</td>'; |
|
1799
|
|
- print '<td>' . $langs->trans("Note") . '</td>'; |
|
1800
|
|
- print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1801
|
|
- print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
|
1798
|
+ print '<td>'.$langs->trans("By").'</td>'; |
|
|
1799
|
+ print '<td>'.$langs->trans("Note").'</td>'; |
|
|
1800
|
+ print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
|
1801
|
+ print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1802
|
1802
|
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
|
1803
|
1803
|
print '<td></td>'; |
|
1804
|
1804
|
|
|
@@ -1852,14 +1852,14 @@ discard block |
|
|
block discarded – undo |
|
1852
|
1852
|
print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
|
1853
|
1853
|
} else { |
|
1854
|
1854
|
if ($nboftasks) { |
|
1855
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
|
1855
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1856
|
1856
|
} |
|
1857
|
1857
|
} |
|
1858
|
1858
|
print '</td>'; |
|
1859
|
1859
|
|
|
1860
|
1860
|
// Note |
|
1861
|
1861
|
print '<td>'; |
|
1862
|
|
- print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
|
1862
|
+ print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1863
|
1863
|
print '</td>'; |
|
1864
|
1864
|
|
|
1865
|
1865
|
// Duration - Time spent |
|
@@ -1927,7 +1927,7 @@ discard block |
|
|
block discarded – undo |
|
1927
|
1927
|
$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
|
1928
|
1928
|
|
|
1929
|
1929
|
print '<div class="div-table-responsive">'; |
|
1930
|
|
- print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
|
1930
|
+ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1931
|
1931
|
|
|
1932
|
1932
|
// Fields title search |
|
1933
|
1933
|
// -------------------------------------------------------------------- |
|
@@ -1952,20 +1952,20 @@ discard block |
|
|
block discarded – undo |
|
1952
|
1952
|
} |
|
1953
|
1953
|
// Thirdparty |
|
1954
|
1954
|
if (!empty($arrayfields['p.fk_soc']['checked'])) { |
|
1955
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
|
1955
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1956
|
1956
|
} |
|
1957
|
1957
|
|
|
1958
|
1958
|
// Thirdparty alias |
|
1959
|
1959
|
if (!empty($arrayfields['s.name_alias']['checked'])) { |
|
1960
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
|
1960
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1961
|
1961
|
} |
|
1962
|
1962
|
|
|
1963
|
1963
|
if (!empty($allprojectforuser)) { |
|
1964
|
1964
|
if (!empty($arrayfields['p.project_ref']['checked'])) { |
|
1965
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
|
1965
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1966
|
1966
|
} |
|
1967
|
1967
|
if (!empty($arrayfields['p.project_label']['checked'])) { |
|
1968
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
|
1968
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1969
|
1969
|
} |
|
1970
|
1970
|
} |
|
1971
|
1971
|
// Task |
|
@@ -1983,7 +1983,7 @@ discard block |
|
|
block discarded – undo |
|
1983
|
1983
|
} |
|
1984
|
1984
|
// Note |
|
1985
|
1985
|
if (!empty($arrayfields['t.note']['checked'])) { |
|
1986
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
|
1986
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1987
|
1987
|
} |
|
1988
|
1988
|
// Duration |
|
1989
|
1989
|
if (!empty($arrayfields['t.element_duration']['checked'])) { |
|
@@ -1994,7 +1994,7 @@ discard block |
|
|
block discarded – undo |
|
1994
|
1994
|
if ($search_timespent_starthour || $search_timespent_startmin) { |
|
1995
|
1995
|
$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
|
1996
|
1996
|
} |
|
1997
|
|
- print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
|
1997
|
+ print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1998
|
1998
|
print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
|
1999
|
1999
|
print '</div>'; |
|
2000
|
2000
|
|
|
@@ -2002,7 +2002,7 @@ discard block |
|
|
block discarded – undo |
|
2002
|
2002
|
if ($search_timespent_endhour || $search_timespent_endmin) { |
|
2003
|
2003
|
$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
|
2004
|
2004
|
} |
|
2005
|
|
- print '<div class="nowraponall">' . $langs->trans('to') . ' '; |
|
|
2005
|
+ print '<div class="nowraponall">'.$langs->trans('to').' '; |
|
2006
|
2006
|
print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
|
2007
|
2007
|
print '</div>'; |
|
2008
|
2008
|
|
|
@@ -2018,7 +2018,7 @@ discard block |
|
|
block discarded – undo |
|
2018
|
2018
|
} |
|
2019
|
2019
|
// Value billed |
|
2020
|
2020
|
if (!empty($arrayfields['valuebilled']['checked'])) { |
|
2021
|
|
- print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
|
2021
|
+ print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
2022
|
2022
|
} |
|
2023
|
2023
|
|
|
2024
|
2024
|
/* |
|
@@ -2036,7 +2036,7 @@ discard block |
|
|
block discarded – undo |
|
2036
|
2036
|
print $searchpicto; |
|
2037
|
2037
|
print '</td>'; |
|
2038
|
2038
|
} |
|
2039
|
|
- print '</tr>' . "\n"; |
|
|
2039
|
+ print '</tr>'."\n"; |
|
2040
|
2040
|
|
|
2041
|
2041
|
|
|
2042
|
2042
|
$totalarray = array(); |
|
@@ -2154,7 +2154,7 @@ discard block |
|
|
block discarded – undo |
|
2154
|
2154
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
|
2155
|
2155
|
print '<td class="center nowraponall">'; |
|
2156
|
2156
|
if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2157
|
|
- print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">'; |
|
|
2157
|
+ print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">'; |
|
2158
|
2158
|
print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
2159
|
2159
|
print '<br>'; |
|
2160
|
2160
|
print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
@@ -2165,7 +2165,7 @@ discard block |
|
|
block discarded – undo |
|
2165
|
2165
|
print '</a>'; |
|
2166
|
2166
|
|
|
2167
|
2167
|
if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
|
2168
|
|
- print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
|
2168
|
+ print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2169
|
2169
|
print img_split('', 'class="pictofixedwidth paddingleft"'); |
|
2170
|
2170
|
print '</a>'; |
|
2171
|
2171
|
} |
|
@@ -2183,12 +2183,12 @@ discard block |
|
|
block discarded – undo |
|
2183
|
2183
|
|
|
2184
|
2184
|
// Disable select if task not billable or already invoiced |
|
2185
|
2185
|
$disabled = (intval($task_time->billable) != 1 || $invoiced); |
|
2186
|
|
- $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
|
2186
|
+ $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2187
|
2187
|
if ($disabled) { |
|
2188
|
2188
|
// If disabled, a dbl-click very close outside the control |
|
2189
|
2189
|
// will re-enable it, so that user is not blocked if needed. |
|
2190
|
|
- print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
2191
|
|
- print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
|
2190
|
+ print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
|
2191
|
+ print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
2192
|
2192
|
} else { |
|
2193
|
2193
|
print $ctrl; |
|
2194
|
2194
|
} |
|
@@ -2311,7 +2311,7 @@ discard block |
|
|
block discarded – undo |
|
2311
|
2311
|
} |
|
2312
|
2312
|
} |
|
2313
|
2313
|
} elseif ($action !== 'createtime') { |
|
2314
|
|
- print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
|
2314
|
+ print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2315
|
2315
|
} |
|
2316
|
2316
|
|
|
2317
|
2317
|
// Task label |
|
@@ -2340,9 +2340,9 @@ discard block |
|
|
block discarded – undo |
|
2340
|
2340
|
} |
|
2341
|
2341
|
if (count($contactsoftask) > 0) { |
|
2342
|
2342
|
print img_object('', 'user', 'class="pictofixedwidth hideonsmartphone"'); |
|
2343
|
|
- print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td |
|
|
2343
|
+ print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'minwidth100 maxwidth100'); // maxwidth must be lowed than minwidth of the td |
|
2344
|
2344
|
} else { |
|
2345
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
|
2345
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2346
|
2346
|
} |
|
2347
|
2347
|
} else { |
|
2348
|
2348
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2364,7 +2364,7 @@ discard block |
|
|
block discarded – undo |
|
2364
|
2364
|
if (!empty($arrayfields['t.note']['checked'])) { |
|
2365
|
2365
|
if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2366
|
2366
|
print '<td class="small">'; |
|
2367
|
|
- print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
|
2367
|
+ print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2368
|
2368
|
print '</td>'; |
|
2369
|
2369
|
} else { |
|
2370
|
2370
|
print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
|
@@ -2375,7 +2375,7 @@ discard block |
|
|
block discarded – undo |
|
2375
|
2375
|
$totalarray['nbfield']++; |
|
2376
|
2376
|
} |
|
2377
|
2377
|
} elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2378
|
|
- print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
|
2378
|
+ print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2379
|
2379
|
} |
|
2380
|
2380
|
|
|
2381
|
2381
|
// Time spent |
|
@@ -2436,7 +2436,7 @@ discard block |
|
|
block discarded – undo |
|
2436
|
2436
|
$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
|
2437
|
2437
|
|
|
2438
|
2438
|
print '<td class="nowraponall right">'; |
|
2439
|
|
- print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
|
2439
|
+ print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2440
|
2440
|
print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
|
2441
|
2441
|
print '</span>'; |
|
2442
|
2442
|
print '</td>'; |
|
@@ -2492,7 +2492,7 @@ discard block |
|
|
block discarded – undo |
|
2492
|
2492
|
} |
|
2493
|
2493
|
} |
|
2494
|
2494
|
} else { |
|
2495
|
|
- print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
|
2495
|
+ print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2496
|
2496
|
} |
|
2497
|
2497
|
} |
|
2498
|
2498
|
print '</td>'; |
|
@@ -2526,7 +2526,7 @@ discard block |
|
|
block discarded – undo |
|
2526
|
2526
|
print '</a>'; |
|
2527
|
2527
|
|
|
2528
|
2528
|
if (getDolGlobalString('PROJECT_ALLOW_SPLIT_TIMESPENT')) { |
|
2529
|
|
- print '<a class="reposition editfielda paddingleft" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
|
2529
|
+ print '<a class="reposition editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2530
|
2530
|
print img_split('', 'class="pictofixedwidth paddingleft"'); |
|
2531
|
2531
|
print '</a>'; |
|
2532
|
2532
|
} |
|
@@ -2544,12 +2544,12 @@ discard block |
|
|
block discarded – undo |
|
2544
|
2544
|
|
|
2545
|
2545
|
// Disable select if task not billable or already invoiced |
|
2546
|
2546
|
$disabled = (intval($task_time->billable) != 1 || $invoiced); |
|
2547
|
|
- $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
|
2547
|
+ $ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2548
|
2548
|
if ($disabled) { |
|
2549
|
2549
|
// If disabled, a dbl-click very close outside the control |
|
2550
|
2550
|
// will re-enable it, so that user is not blocked if needed. |
|
2551
|
|
- print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>'; |
|
2552
|
|
- print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>'; |
|
|
2551
|
+ print '<span id="cbsp'.$task_time->rowid.'">'.$ctrl.'</span>'; |
|
|
2552
|
+ print '<script>$("#cbsp'.$task_time->rowid.'").dblclick(()=>{ $("#cb'.$task_time->rowid.'").removeAttr("disabled") })</script>'; |
|
2553
|
2553
|
} else { |
|
2554
|
2554
|
print $ctrl; |
|
2555
|
2555
|
} |
|
@@ -2648,7 +2648,7 @@ discard block |
|
|
block discarded – undo |
|
2648
|
2648
|
print img_object('', 'user', 'class="hideonsmartphone"'); |
|
2649
|
2649
|
print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask); |
|
2650
|
2650
|
} else { |
|
2651
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
|
2651
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2652
|
2652
|
} |
|
2653
|
2653
|
} else { |
|
2654
|
2654
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2665,13 +2665,13 @@ discard block |
|
|
block discarded – undo |
|
2665
|
2665
|
if (!empty($arrayfields['t.note']['checked'])) { |
|
2666
|
2666
|
print '<td class="tdoverflowmax300">'; |
|
2667
|
2667
|
if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2668
|
|
- print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
|
2668
|
+ print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2669
|
2669
|
} else { |
|
2670
|
2670
|
print dol_nl2br($task_time->note); |
|
2671
|
2671
|
} |
|
2672
|
2672
|
print '</td>'; |
|
2673
|
2673
|
} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2674
|
|
- print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_2 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
|
2674
|
+ print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_2.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2675
|
2675
|
} |
|
2676
|
2676
|
|
|
2677
|
2677
|
// Time spent |
|
@@ -2813,7 +2813,7 @@ discard block |
|
|
block discarded – undo |
|
2813
|
2813
|
print img_object('', 'user', 'class="hideonsmartphone"'); |
|
2814
|
2814
|
print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask); |
|
2815
|
2815
|
} else { |
|
2816
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
|
2816
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2817
|
2817
|
} |
|
2818
|
2818
|
} else { |
|
2819
|
2819
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2830,13 +2830,13 @@ discard block |
|
|
block discarded – undo |
|
2830
|
2830
|
if (!empty($arrayfields['t.note']['checked'])) { |
|
2831
|
2831
|
print '<td class="small tdoverflowmax300"">'; |
|
2832
|
2832
|
if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2833
|
|
- print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_2 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
|
2833
|
+ print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_2.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2834
|
2834
|
} else { |
|
2835
|
2835
|
print dol_nl2br($task_time->note); |
|
2836
|
2836
|
} |
|
2837
|
2837
|
print '</td>'; |
|
2838
|
2838
|
} elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
|
2839
|
|
- print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
|
2839
|
+ print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2840
|
2840
|
} |
|
2841
|
2841
|
|
|
2842
|
2842
|
// Time spent |
|
@@ -2910,14 +2910,14 @@ discard block |
|
|
block discarded – undo |
|
2910
|
2910
|
$i++; |
|
2911
|
2911
|
if ($i == 1) { |
|
2912
|
2912
|
if ($num < $limit && empty($offset)) { |
|
2913
|
|
- print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
|
2913
|
+ print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2914
|
2914
|
} else { |
|
2915
|
2915
|
print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
|
2916
|
2916
|
} |
|
2917
|
2917
|
} elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
|
2918
|
|
- print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
|
2918
|
+ print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2919
|
2919
|
} elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
|
2920
|
|
- print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
|
2920
|
+ print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2921
|
2921
|
//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
|
2922
|
2922
|
} else { |
|
2923
|
2923
|
print '<td></td>'; |
|
@@ -2933,8 +2933,8 @@ discard block |
|
|
block discarded – undo |
|
2933
|
2933
|
$totalnboffields++; |
|
2934
|
2934
|
} |
|
2935
|
2935
|
} |
|
2936
|
|
- print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2937
|
|
- print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
|
2936
|
+ print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
|
2937
|
+ print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2938
|
2938
|
print '</td></tr>'; |
|
2939
|
2939
|
} |
|
2940
|
2940
|
|