|
@@ -30,14 +30,14 @@ discard block |
|
|
block discarded – undo |
30
|
30
|
|
31
|
31
|
// Load Dolibarr environment |
32
|
32
|
require '../../main.inc.php'; |
33
|
|
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
34
|
|
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
35
|
|
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
36
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
37
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
38
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
39
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
40
|
|
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
33
|
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
34
|
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
35
|
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
36
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
37
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
38
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
39
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
40
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
41
|
41
|
|
42
|
42
|
// Load translation files required by the page |
43
|
43
|
$langsLoad = array('projects', 'bills', 'orders', 'companies'); |
|
@@ -164,7 +164,7 @@ discard block |
|
|
block discarded – undo |
164
|
164
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
165
|
165
|
} |
166
|
166
|
|
167
|
|
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
167
|
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
168
|
168
|
|
169
|
169
|
// Purge search criteria |
170
|
170
|
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 |
|
@@ -354,10 +354,10 @@ discard block |
|
|
block discarded – undo |
354
|
354
|
} |
355
|
355
|
|
356
|
356
|
if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
357
|
|
- $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
357
|
+ $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
358
|
358
|
|
359
|
359
|
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
360
|
|
- $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
360
|
+ $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
361
|
361
|
|
362
|
362
|
if ($result < 0) { |
363
|
363
|
$langs->load("errors"); |
|
@@ -377,7 +377,7 @@ discard block |
|
|
block discarded – undo |
377
|
377
|
if (count($tasksarray) > 0) { |
378
|
378
|
$id = $tasksarray[0]->id; |
379
|
379
|
} else { |
380
|
|
- header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
380
|
+ header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
381
|
381
|
exit; |
382
|
382
|
} |
383
|
383
|
} |
|
@@ -414,9 +414,9 @@ discard block |
|
|
block discarded – undo |
414
|
414
|
if (!($projectstatic->thirdparty->id > 0)) { |
415
|
415
|
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
416
|
416
|
} else { |
417
|
|
- include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
418
|
|
- include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
419
|
|
- include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
417
|
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
418
|
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
419
|
+ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
420
|
420
|
|
421
|
421
|
$tmpinvoice = new Facture($db); |
422
|
422
|
$tmptimespent = new Task($db); |
|
@@ -481,7 +481,7 @@ discard block |
|
|
block discarded – undo |
481
|
481
|
$arrayoftasks = array(); |
482
|
482
|
foreach ($toselect as $key => $value) { |
483
|
483
|
// Get userid, timepent |
484
|
|
- $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
484
|
+ $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
485
|
485
|
$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
486
|
486
|
$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
487
|
487
|
} |
|
@@ -553,7 +553,7 @@ discard block |
|
|
block discarded – undo |
553
|
553
|
} |
554
|
554
|
|
555
|
555
|
// Add lines |
556
|
|
- $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
556
|
+ $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
557
|
557
|
if ($lineid < 0) { |
558
|
558
|
$error++; |
559
|
559
|
setEventMessages(null, $tmpinvoice->errors, 'errors'); |
|
@@ -586,16 +586,16 @@ discard block |
|
|
block discarded – undo |
586
|
586
|
|
587
|
587
|
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
588
|
588
|
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
589
|
|
- $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
589
|
+ $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
590
|
590
|
$arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
591
|
591
|
|
592
|
592
|
if (!empty($withdetail)) { |
593
|
593
|
if (!empty($object->timespent_withhour)) { |
594
|
|
- $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
594
|
+ $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
595
|
595
|
} else { |
596
|
|
- $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
596
|
+ $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
597
|
597
|
} |
598
|
|
- $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)); |
|
598
|
+ $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)); |
599
|
599
|
} |
600
|
600
|
$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
601
|
601
|
$arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
|
@@ -673,7 +673,7 @@ discard block |
|
|
block discarded – undo |
673
|
673
|
$arrayoftasks = array(); |
674
|
674
|
foreach ($toselect as $key => $value) { |
675
|
675
|
// Get userid, timepent |
676
|
|
- $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
676
|
+ $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
677
|
677
|
// $object->id is now the task id |
678
|
678
|
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
679
|
679
|
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
|
@@ -749,7 +749,7 @@ discard block |
|
|
block discarded – undo |
749
|
749
|
// Add lines |
750
|
750
|
$date_start = ''; |
751
|
751
|
$date_end = ''; |
752
|
|
- $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
752
|
+ $lineName = $ftask->ref.' - '.$ftask->label; |
753
|
753
|
$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); |
754
|
754
|
if ($lineid < 0) { |
755
|
755
|
$error++; |
|
@@ -759,8 +759,8 @@ discard block |
|
|
block discarded – undo |
759
|
759
|
|
760
|
760
|
if (!$error) { |
761
|
761
|
// Update lineid into line of timespent |
762
|
|
- $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
763
|
|
- $sql .= ' WHERE rowid IN (' . $db->sanitize(join(',', $toselect)) . ')'; |
|
762
|
+ $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
763
|
+ $sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')'; |
764
|
764
|
$result = $db->query($sql); |
765
|
765
|
if (!$result) { |
766
|
766
|
$error++; |
|
@@ -796,12 +796,12 @@ discard block |
|
|
block discarded – undo |
796
|
796
|
if (!($projectstatic->thirdparty->id > 0)) { |
797
|
797
|
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
798
|
798
|
} else { |
799
|
|
- include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
800
|
|
- include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
801
|
|
- include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
799
|
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
800
|
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
801
|
+ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
802
|
802
|
|
803
|
803
|
|
804
|
|
- require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
804
|
+ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
805
|
805
|
$tmpinter = new Fichinter($db); |
806
|
806
|
$tmptimespent = new Task($db); |
807
|
807
|
$fuser = new User($db); |
|
@@ -813,7 +813,7 @@ discard block |
|
|
block discarded – undo |
813
|
813
|
$tmpinter->socid = $projectstatic->thirdparty->id; |
814
|
814
|
$tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
815
|
815
|
$tmpinter->fk_project = $projectstatic->id; |
816
|
|
- $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
816
|
+ $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
817
|
817
|
|
818
|
818
|
if ($interToUse) { |
819
|
819
|
$tmpinter->fetch($interToUse); |
|
@@ -846,7 +846,7 @@ discard block |
|
|
block discarded – undo |
846
|
846
|
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
847
|
847
|
|
848
|
848
|
// Add lines |
849
|
|
- $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
849
|
+ $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
850
|
850
|
} |
851
|
851
|
} |
852
|
852
|
|
|
@@ -877,9 +877,9 @@ discard block |
|
|
block discarded – undo |
877
|
877
|
//$result = $projectstatic->fetch($object->fk_project); |
878
|
878
|
$arrayofselected = is_array($toselect) ? $toselect : array(); |
879
|
879
|
|
880
|
|
-$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
880
|
+$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
881
|
881
|
if (!empty($withproject)) { |
882
|
|
- $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
882
|
+ $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
883
|
883
|
} |
884
|
884
|
$help_url = ''; |
885
|
885
|
|
|
@@ -928,13 +928,13 @@ discard block |
|
|
block discarded – undo |
928
|
928
|
|
929
|
929
|
$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
930
|
930
|
if ($search_user) { |
931
|
|
- $param .= '&search_user=' . ((int) $search_user); |
|
931
|
+ $param .= '&search_user='.((int) $search_user); |
932
|
932
|
} |
933
|
933
|
if ($search_month) { |
934
|
|
- $param .= '&search_month=' . ((int) $search_month); |
|
934
|
+ $param .= '&search_month='.((int) $search_month); |
935
|
935
|
} |
936
|
936
|
if ($search_year) { |
937
|
|
- $param .= '&search_year=' . ((int) $search_year); |
|
937
|
+ $param .= '&search_year='.((int) $search_year); |
938
|
938
|
} |
939
|
939
|
|
940
|
940
|
// Project card |
|
@@ -946,14 +946,14 @@ discard block |
|
|
block discarded – undo |
946
|
946
|
$morehtmlref .= $projectstatic->title; |
947
|
947
|
// Thirdparty |
948
|
948
|
if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
949
|
|
- $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
949
|
+ $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
950
|
950
|
} |
951
|
951
|
$morehtmlref .= '</div>'; |
952
|
952
|
|
953
|
953
|
// Define a complementary filter for search of next/prev ref. |
954
|
954
|
if (empty($user->rights->projet->all->lire)) { |
955
|
955
|
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
956
|
|
- $projectstatic->next_prev_filter = " rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")"; |
|
956
|
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; |
957
|
957
|
} |
958
|
958
|
|
959
|
959
|
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
|
@@ -971,25 +971,25 @@ discard block |
|
|
block discarded – undo |
971
|
971
|
print '</td>'; |
972
|
972
|
print '<td>'; |
973
|
973
|
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { |
974
|
|
- print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
974
|
+ print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
975
|
975
|
$htmltext = $langs->trans("ProjectFollowOpportunity"); |
976
|
976
|
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
977
|
977
|
print '<br>'; |
978
|
978
|
} |
979
|
979
|
if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
980
|
|
- print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
980
|
+ print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
981
|
981
|
$htmltext = $langs->trans("ProjectFollowTasks"); |
982
|
982
|
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
983
|
983
|
print '<br>'; |
984
|
984
|
} |
985
|
985
|
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
986
|
|
- 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"' : '')) . '"> '; |
|
986
|
+ 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"' : '')).'"> '; |
987
|
987
|
$htmltext = $langs->trans("ProjectBillTimeDescription"); |
988
|
988
|
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
989
|
989
|
print '<br>'; |
990
|
990
|
} |
991
|
991
|
if (isModEnabled('eventorganization')) { |
992
|
|
- 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"' : '')) . '"> '; |
|
992
|
+ 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"' : '')).'"> '; |
993
|
993
|
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
994
|
994
|
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
995
|
995
|
} |
|
@@ -997,7 +997,7 @@ discard block |
|
|
block discarded – undo |
997
|
997
|
} |
998
|
998
|
|
999
|
999
|
// Visibility |
1000
|
|
- print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
1000
|
+ print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
1001
|
1001
|
if ($projectstatic->public) { |
1002
|
1002
|
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1003
|
1003
|
print $langs->trans('SharedProject'); |
|
@@ -1008,14 +1008,14 @@ discard block |
|
|
block discarded – undo |
1008
|
1008
|
print '</td></tr>'; |
1009
|
1009
|
|
1010
|
1010
|
// Budget |
1011
|
|
- print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1011
|
+ print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
1012
|
1012
|
if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1013
|
|
- print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1013
|
+ print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
1014
|
1014
|
} |
1015
|
1015
|
print '</td></tr>'; |
1016
|
1016
|
|
1017
|
1017
|
// Date start - end project |
1018
|
|
- print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1018
|
+ print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
1019
|
1019
|
$start = dol_print_date($projectstatic->date_start, 'day'); |
1020
|
1020
|
print ($start ? $start : '?'); |
1021
|
1021
|
$end = dol_print_date($projectstatic->date_end, 'day'); |
|
@@ -1030,7 +1030,7 @@ discard block |
|
|
block discarded – undo |
1030
|
1030
|
$cols = 2; |
1031
|
1031
|
$savobject = $object; |
1032
|
1032
|
$object = $projectstatic; |
1033
|
|
- include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1033
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
1034
|
1034
|
$object = $savobject; |
1035
|
1035
|
|
1036
|
1036
|
print '</table>'; |
|
@@ -1048,7 +1048,7 @@ discard block |
|
|
block discarded – undo |
1048
|
1048
|
|
1049
|
1049
|
// Categories |
1050
|
1050
|
if (isModEnabled('categorie')) { |
1051
|
|
- print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1051
|
+ print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
1052
|
1052
|
print $form->showCategories($projectstatic->id, 'project', 1); |
1053
|
1053
|
print "</td></tr>"; |
1054
|
1054
|
} |
|
@@ -1077,12 +1077,12 @@ discard block |
|
|
block discarded – undo |
1077
|
1077
|
|
1078
|
1078
|
if (!empty($projectidforalltimes)) { |
1079
|
1079
|
// We are on tab 'Time Spent' of project |
1080
|
|
- $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
1081
|
|
- $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1080
|
+ $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1081
|
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
1082
|
1082
|
} else { |
1083
|
1083
|
// We are on tab 'Time Spent' of task |
1084
|
|
- $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
1085
|
|
- $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1084
|
+ $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1085
|
+ $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
1086
|
1086
|
} |
1087
|
1087
|
} else { |
1088
|
1088
|
$linktocreatetimeBtnStatus = -2; |
|
@@ -1127,19 +1127,19 @@ discard block |
|
|
block discarded – undo |
1127
|
1127
|
print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1128
|
1128
|
|
1129
|
1129
|
if ($action == 'deleteline') { |
1130
|
|
- $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1130
|
+ $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
1131
|
1131
|
print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1132
|
1132
|
} |
1133
|
1133
|
|
1134
|
1134
|
$param = ($withproject ? '&withproject=1' : ''); |
1135
|
|
- $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
1136
|
|
- $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1135
|
+ $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1136
|
+ $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
1137
|
1137
|
|
1138
|
1138
|
if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1139
|
1139
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1140
|
|
- $object->next_prev_filter = " fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
1140
|
+ $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")"; |
1141
|
1141
|
} else { |
1142
|
|
- $object->next_prev_filter = " fk_projet = " . ((int) $projectstatic->id); |
|
1142
|
+ $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id); |
1143
|
1143
|
} |
1144
|
1144
|
|
1145
|
1145
|
$morehtmlref = ''; |
|
@@ -1147,12 +1147,12 @@ discard block |
|
|
block discarded – undo |
1147
|
1147
|
// Project |
1148
|
1148
|
if (empty($withproject)) { |
1149
|
1149
|
$morehtmlref .= '<div class="refidno">'; |
1150
|
|
- $morehtmlref .= $langs->trans("Project") . ': '; |
|
1150
|
+ $morehtmlref .= $langs->trans("Project").': '; |
1151
|
1151
|
$morehtmlref .= $projectstatic->getNomUrl(1); |
1152
|
1152
|
$morehtmlref .= '<br>'; |
1153
|
1153
|
|
1154
|
1154
|
// Third party |
1155
|
|
- $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1155
|
+ $morehtmlref .= $langs->trans("ThirdParty").': '; |
1156
|
1156
|
if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1157
|
1157
|
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1158
|
1158
|
} |
|
@@ -1168,7 +1168,7 @@ discard block |
|
|
block discarded – undo |
1168
|
1168
|
print '<table class="border centpercent tableforfield">'; |
1169
|
1169
|
|
1170
|
1170
|
// Task parent |
1171
|
|
- print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1171
|
+ print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
1172
|
1172
|
if ($object->fk_task_parent > 0) { |
1173
|
1173
|
$tasktmp = new Task($db); |
1174
|
1174
|
$tasktmp->fetch($object->fk_task_parent); |
|
@@ -1177,7 +1177,7 @@ discard block |
|
|
block discarded – undo |
1177
|
1177
|
print '</td></tr>'; |
1178
|
1178
|
|
1179
|
1179
|
// Date start - Date end task |
1180
|
|
- print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1180
|
+ print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
1181
|
1181
|
$start = dol_print_date($object->date_start, 'dayhour'); |
1182
|
1182
|
print ($start ? $start : '?'); |
1183
|
1183
|
$end = dol_print_date($object->date_end, 'dayhour'); |
|
@@ -1189,7 +1189,7 @@ discard block |
|
|
block discarded – undo |
1189
|
1189
|
print '</td></tr>'; |
1190
|
1190
|
|
1191
|
1191
|
// Planned workload |
1192
|
|
- print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1192
|
+ print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
1193
|
1193
|
if ($object->planned_workload) { |
1194
|
1194
|
print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1195
|
1195
|
} |
|
@@ -1204,21 +1204,21 @@ discard block |
|
|
block discarded – undo |
1204
|
1204
|
print '<table class="border tableforfield centpercent">'; |
1205
|
1205
|
|
1206
|
1206
|
// Progress declared |
1207
|
|
- print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
1208
|
|
- print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1207
|
+ print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1208
|
+ print $object->progress != '' ? $object->progress.' %' : ''; |
1209
|
1209
|
print '</td></tr>'; |
1210
|
1210
|
|
1211
|
1211
|
// Progress calculated |
1212
|
|
- print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1212
|
+ print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
1213
|
1213
|
if ($object->planned_workload) { |
1214
|
1214
|
$tmparray = $object->getSummaryOfTimeSpent(); |
1215
|
1215
|
if ($tmparray['total_duration'] > 0) { |
1216
|
|
- print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1216
|
+ print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
1217
|
1217
|
} else { |
1218
|
1218
|
print '0 %'; |
1219
|
1219
|
} |
1220
|
1220
|
} else { |
1221
|
|
- print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1221
|
+ print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
1222
|
1222
|
} |
1223
|
1223
|
print '</td>'; |
1224
|
1224
|
|
|
@@ -1243,7 +1243,7 @@ discard block |
|
|
block discarded – undo |
1243
|
1243
|
|
1244
|
1244
|
if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1245
|
1245
|
// We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1246
|
|
- $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
1246
|
+ $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
1247
|
1247
|
$formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1248
|
1248
|
} |
1249
|
1249
|
|
|
@@ -1262,10 +1262,10 @@ discard block |
|
|
block discarded – undo |
1262
|
1262
|
// Definition of fields for list |
1263
|
1263
|
$arrayfields = array(); |
1264
|
1264
|
$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); |
1265
|
|
- $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); |
|
1265
|
+ $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1); |
1266
|
1266
|
$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); |
1267
|
1267
|
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1268
|
|
- if (! empty($allprojectforuser)) { |
|
1268
|
+ if (!empty($allprojectforuser)) { |
1269
|
1269
|
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1270
|
1270
|
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1271
|
1271
|
} |
|
@@ -1281,82 +1281,82 @@ discard block |
|
|
block discarded – undo |
1281
|
1281
|
$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled) ? 0 : 1)); |
1282
|
1282
|
$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((!empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT)) ? 0 : 1) && $projectstatic->usage_bill_time)); |
1283
|
1283
|
// Extra fields |
1284
|
|
- include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1284
|
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
1285
|
1285
|
|
1286
|
1286
|
$arrayfields = dol_sort_array($arrayfields, 'position'); |
1287
|
1287
|
|
1288
|
1288
|
$param = ''; |
1289
|
1289
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1290
|
|
- $param .= '&contextpage=' . urlencode($contextpage); |
|
1290
|
+ $param .= '&contextpage='.urlencode($contextpage); |
1291
|
1291
|
} |
1292
|
1292
|
if ($limit > 0 && $limit != $conf->liste_limit) { |
1293
|
1293
|
$param .= '&limit='.((int) $limit); |
1294
|
1294
|
} |
1295
|
1295
|
if ($search_month > 0) { |
1296
|
|
- $param .= '&search_month=' . urlencode($search_month); |
|
1296
|
+ $param .= '&search_month='.urlencode($search_month); |
1297
|
1297
|
} |
1298
|
1298
|
if ($search_year > 0) { |
1299
|
|
- $param .= '&search_year=' . urlencode($search_year); |
|
1299
|
+ $param .= '&search_year='.urlencode($search_year); |
1300
|
1300
|
} |
1301
|
1301
|
if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1302
|
1302
|
$param .= '&search_user='.urlencode($search_user); |
1303
|
1303
|
} |
1304
|
1304
|
if ($search_task_ref != '') { |
1305
|
|
- $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1305
|
+ $param .= '&search_task_ref='.urlencode($search_task_ref); |
1306
|
1306
|
} |
1307
|
1307
|
if ($search_company != '') { |
1308
|
|
- $param .= '&$search_company=' . urlencode($search_company); |
|
1308
|
+ $param .= '&$search_company='.urlencode($search_company); |
1309
|
1309
|
} |
1310
|
1310
|
if ($search_company_alias != '') { |
1311
|
|
- $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1311
|
+ $param .= '&$search_company_alias='.urlencode($search_company_alias); |
1312
|
1312
|
} |
1313
|
1313
|
if ($search_project_ref != '') { |
1314
|
|
- $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1314
|
+ $param .= '&$search_project_ref='.urlencode($search_project_ref); |
1315
|
1315
|
} |
1316
|
1316
|
if ($search_project_label != '') { |
1317
|
|
- $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1317
|
+ $param .= '&$search_project_label='.urlencode($search_project_label); |
1318
|
1318
|
} |
1319
|
1319
|
if ($search_task_label != '') { |
1320
|
|
- $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1320
|
+ $param .= '&search_task_label='.urlencode($search_task_label); |
1321
|
1321
|
} |
1322
|
1322
|
if ($search_note != '') { |
1323
|
|
- $param .= '&search_note=' . urlencode($search_note); |
|
1323
|
+ $param .= '&search_note='.urlencode($search_note); |
1324
|
1324
|
} |
1325
|
1325
|
if ($search_duration != '') { |
1326
|
|
- $param .= '&search_field2=' . urlencode($search_duration); |
|
1326
|
+ $param .= '&search_field2='.urlencode($search_duration); |
1327
|
1327
|
} |
1328
|
1328
|
if ($optioncss != '') { |
1329
|
|
- $param .= '&optioncss=' . urlencode($optioncss); |
|
1329
|
+ $param .= '&optioncss='.urlencode($optioncss); |
1330
|
1330
|
} |
1331
|
1331
|
if ($search_date_startday) { |
1332
|
|
- $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
1332
|
+ $param .= '&search_date_startday='.urlencode($search_date_startday); |
1333
|
1333
|
} |
1334
|
1334
|
if ($search_date_startmonth) { |
1335
|
|
- $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
1335
|
+ $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
1336
|
1336
|
} |
1337
|
1337
|
if ($search_date_startyear) { |
1338
|
|
- $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
1338
|
+ $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
1339
|
1339
|
} |
1340
|
1340
|
if ($search_date_endday) { |
1341
|
|
- $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
1341
|
+ $param .= '&search_date_endday='.urlencode($search_date_endday); |
1342
|
1342
|
} |
1343
|
1343
|
if ($search_date_endmonth) { |
1344
|
|
- $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
1344
|
+ $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
1345
|
1345
|
} |
1346
|
1346
|
if ($search_date_endyear) { |
1347
|
|
- $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
1347
|
+ $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
1348
|
1348
|
} |
1349
|
1349
|
if ($search_timespent_starthour) { |
1350
|
|
- $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
1350
|
+ $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
1351
|
1351
|
} |
1352
|
1352
|
if ($search_timespent_startmin) { |
1353
|
|
- $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
1353
|
+ $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
1354
|
1354
|
} |
1355
|
1355
|
if ($search_timespent_endhour) { |
1356
|
|
- $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
1356
|
+ $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
1357
|
1357
|
} |
1358
|
1358
|
if ($search_timespent_endmin) { |
1359
|
|
- $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
1359
|
+ $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
1360
|
1360
|
} |
1361
|
1361
|
|
1362
|
1362
|
/* |
|
@@ -1364,24 +1364,24 @@ discard block |
|
|
block discarded – undo |
1364
|
1364
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1365
|
1365
|
*/ |
1366
|
1366
|
if ($id) { |
1367
|
|
- $param .= '&id=' . urlencode($id); |
|
1367
|
+ $param .= '&id='.urlencode($id); |
1368
|
1368
|
} |
1369
|
1369
|
if ($projectid) { |
1370
|
|
- $param .= '&projectid=' . urlencode($projectid); |
|
1370
|
+ $param .= '&projectid='.urlencode($projectid); |
1371
|
1371
|
} |
1372
|
1372
|
if ($withproject) { |
1373
|
|
- $param .= '&withproject=' . urlencode($withproject); |
|
1373
|
+ $param .= '&withproject='.urlencode($withproject); |
1374
|
1374
|
} |
1375
|
1375
|
// Add $param from hooks |
1376
|
1376
|
$parameters = array(); |
1377
|
1377
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
1378
|
1378
|
$param .= $hookmanager->resPrint; |
1379
|
1379
|
|
1380
|
|
- print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1380
|
+ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
1381
|
1381
|
if ($optioncss != '') { |
1382
|
|
- print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1382
|
+ print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
1383
|
1383
|
} |
1384
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1384
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
1385
|
1385
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1386
|
1386
|
if ($action == 'editline') { |
1387
|
1387
|
print '<input type="hidden" name="action" value="updateline">'; |
|
@@ -1396,13 +1396,13 @@ discard block |
|
|
block discarded – undo |
1396
|
1396
|
} else { |
1397
|
1397
|
print '<input type="hidden" name="action" value="list">'; |
1398
|
1398
|
} |
1399
|
|
- print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
1400
|
|
- print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1399
|
+ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1400
|
+ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
1401
|
1401
|
|
1402
|
|
- print '<input type="hidden" name="id" value="' . $id . '">'; |
1403
|
|
- print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
1404
|
|
- print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
1405
|
|
- print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1402
|
+ print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1403
|
+ print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1404
|
+ print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1405
|
+ print '<input type="hidden" name="tab" value="'.$tab.'">'; |
1406
|
1406
|
print '<input type="hidden" name="page_y" value="">'; |
1407
|
1407
|
|
1408
|
1408
|
// Form to convert time spent into invoice |
|
@@ -1429,7 +1429,7 @@ discard block |
|
|
block discarded – undo |
1429
|
1429
|
'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1430
|
1430
|
); |
1431
|
1431
|
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1432
|
|
- print "\n" . '<script type="text/javascript">'; |
|
1432
|
+ print "\n".'<script type="text/javascript">'; |
1433
|
1433
|
print ' |
1434
|
1434
|
$(document).ready(function () { |
1435
|
1435
|
setDetailVisibility(); |
|
@@ -1446,8 +1446,8 @@ discard block |
|
|
block discarded – undo |
1446
|
1446
|
} |
1447
|
1447
|
}); |
1448
|
1448
|
'; |
1449
|
|
- print '</script>' . "\n"; |
1450
|
|
- print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1449
|
+ print '</script>'."\n"; |
|
1450
|
+ print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
1451
|
1451
|
print '</td>'; |
1452
|
1452
|
print '</tr>'; |
1453
|
1453
|
|
|
@@ -1482,14 +1482,14 @@ discard block |
|
|
block discarded – undo |
1482
|
1482
|
|
1483
|
1483
|
print '<br>'; |
1484
|
1484
|
print '<div class="center">'; |
1485
|
|
- print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
1486
|
|
- print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1485
|
+ print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1486
|
+ print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
1487
|
1487
|
print '</div>'; |
1488
|
1488
|
print '<br>'; |
1489
|
1489
|
} else { |
1490
|
|
- print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1490
|
+ print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
1491
|
1491
|
print '<div class="center">'; |
1492
|
|
- print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1492
|
+ print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
1493
|
1493
|
print '</div>'; |
1494
|
1494
|
$massaction = ''; |
1495
|
1495
|
} |
|
@@ -1502,7 +1502,7 @@ discard block |
|
|
block discarded – undo |
1502
|
1502
|
print '<table class="noborder centpercent">'; |
1503
|
1503
|
print '<tr>'; |
1504
|
1504
|
print '<td class="titlefield">'; |
1505
|
|
- print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1505
|
+ print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
1506
|
1506
|
print '</td>'; |
1507
|
1507
|
print '<td>'; |
1508
|
1508
|
$forminter = new FormIntervention($db); |
|
@@ -1512,14 +1512,14 @@ discard block |
|
|
block discarded – undo |
1512
|
1512
|
print '</table>'; |
1513
|
1513
|
|
1514
|
1514
|
print '<div class="center">'; |
1515
|
|
- print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
1516
|
|
- print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1515
|
+ print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1516
|
+ print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
1517
|
1517
|
print '</div>'; |
1518
|
1518
|
print '<br>'; |
1519
|
1519
|
} else { |
1520
|
|
- print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1520
|
+ print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
1521
|
1521
|
print '<div class="center">'; |
1522
|
|
- print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1522
|
+ print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
1523
|
1523
|
print '</div>'; |
1524
|
1524
|
$massaction = ''; |
1525
|
1525
|
} |
|
@@ -1580,13 +1580,13 @@ discard block |
|
|
block discarded – undo |
1580
|
1580
|
$sql .= " AND t.fk_element =".((int) $object->id); |
1581
|
1581
|
} elseif (!empty($projectidforalltimes)) { |
1582
|
1582
|
// Limit on one project |
1583
|
|
- $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1583
|
+ $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
1584
|
1584
|
} elseif (!empty($allprojectforuser)) { |
1585
|
1585
|
// Limit on on user |
1586
|
1586
|
if (empty($search_user)) { |
1587
|
1587
|
$search_user = $user->id; |
1588
|
1588
|
} |
1589
|
|
- if ($search_user > 0) $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1589
|
+ if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); |
1590
|
1590
|
} |
1591
|
1591
|
|
1592
|
1592
|
if ($search_note) { |
|
@@ -1638,13 +1638,13 @@ discard block |
|
|
block discarded – undo |
1638
|
1638
|
if ($search_timespent_starthour || $search_timespent_startmin) { |
1639
|
1639
|
$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1640
|
1640
|
$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1641
|
|
- $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1641
|
+ $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
1642
|
1642
|
} |
1643
|
1643
|
|
1644
|
1644
|
if ($search_timespent_endhour || $search_timespent_endmin) { |
1645
|
1645
|
$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1646
|
1646
|
$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1647
|
|
- $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1647
|
+ $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
1648
|
1648
|
} |
1649
|
1649
|
} |
1650
|
1650
|
|
|
@@ -1692,13 +1692,13 @@ discard block |
|
|
block discarded – undo |
1692
|
1692
|
|
1693
|
1693
|
if ($num >= 0) { |
1694
|
1694
|
if (!empty($projectidforalltimes)) { |
1695
|
|
- print '<!-- List of time spent for project -->' . "\n"; |
|
1695
|
+ print '<!-- List of time spent for project -->'."\n"; |
1696
|
1696
|
|
1697
|
1697
|
$title = $langs->trans("ListTaskTimeUserProject"); |
1698
|
1698
|
|
1699
|
1699
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1700
|
1700
|
} else { |
1701
|
|
- print '<!-- List of time spent -->' . "\n"; |
|
1701
|
+ print '<!-- List of time spent -->'."\n"; |
1702
|
1702
|
|
1703
|
1703
|
$title = $langs->trans("ListTaskTimeForTask"); |
1704
|
1704
|
|
|
@@ -1720,26 +1720,26 @@ discard block |
|
|
block discarded – undo |
1720
|
1720
|
* Form to add a new line of time spent |
1721
|
1721
|
*/ |
1722
|
1722
|
if ($action == 'createtime' && $user->rights->projet->time) { |
1723
|
|
- print '<!-- table to add time spent -->' . "\n"; |
|
1723
|
+ print '<!-- table to add time spent -->'."\n"; |
1724
|
1724
|
if (!empty($id)) { |
1725
|
|
- print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1725
|
+ print '<input type="hidden" name="taskid" value="'.$id.'">'; |
1726
|
1726
|
} |
1727
|
1727
|
|
1728
|
1728
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table |
1729
|
1729
|
print '<table class="noborder nohover centpercent">'; |
1730
|
1730
|
|
1731
|
1731
|
print '<tr class="liste_titre">'; |
1732
|
|
- print '<td>' . $langs->trans("Date") . '</td>'; |
|
1732
|
+ print '<td>'.$langs->trans("Date").'</td>'; |
1733
|
1733
|
if (!empty($allprojectforuser)) { |
1734
|
|
- print '<td>' . $langs->trans("Project") . '</td>'; |
|
1734
|
+ print '<td>'.$langs->trans("Project").'</td>'; |
1735
|
1735
|
} |
1736
|
1736
|
if (empty($id)) { |
1737
|
|
- print '<td>' . $langs->trans("Task") . '</td>'; |
|
1737
|
+ print '<td>'.$langs->trans("Task").'</td>'; |
1738
|
1738
|
} |
1739
|
|
- print '<td>' . $langs->trans("By") . '</td>'; |
1740
|
|
- print '<td>' . $langs->trans("Note") . '</td>'; |
1741
|
|
- print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
1742
|
|
- print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1739
|
+ print '<td>'.$langs->trans("By").'</td>'; |
|
1740
|
+ print '<td>'.$langs->trans("Note").'</td>'; |
|
1741
|
+ print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1742
|
+ print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
1743
|
1743
|
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
1744
|
1744
|
print '<td></td>'; |
1745
|
1745
|
|
|
@@ -1793,14 +1793,14 @@ discard block |
|
|
block discarded – undo |
1793
|
1793
|
print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); |
1794
|
1794
|
} else { |
1795
|
1795
|
if ($nboftasks) { |
1796
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1796
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
1797
|
1797
|
} |
1798
|
1798
|
} |
1799
|
1799
|
print '</td>'; |
1800
|
1800
|
|
1801
|
1801
|
// Note |
1802
|
1802
|
print '<td>'; |
1803
|
|
- print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1803
|
+ print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
1804
|
1804
|
print '</td>'; |
1805
|
1805
|
|
1806
|
1806
|
// Duration - Time spent |
|
@@ -1868,7 +1868,7 @@ discard block |
|
|
block discarded – undo |
1868
|
1868
|
$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1869
|
1869
|
|
1870
|
1870
|
print '<div class="div-table-responsive">'; |
1871
|
|
- print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1871
|
+ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
1872
|
1872
|
|
1873
|
1873
|
// Fields title search |
1874
|
1874
|
// -------------------------------------------------------------------- |
|
@@ -1893,20 +1893,20 @@ discard block |
|
|
block discarded – undo |
1893
|
1893
|
} |
1894
|
1894
|
// Thirdparty |
1895
|
1895
|
if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1896
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1896
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
1897
|
1897
|
} |
1898
|
1898
|
|
1899
|
1899
|
// Thirdparty alias |
1900
|
1900
|
if (!empty($arrayfields['s.name_alias']['checked'])) { |
1901
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1901
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
1902
|
1902
|
} |
1903
|
1903
|
|
1904
|
1904
|
if (!empty($allprojectforuser)) { |
1905
|
1905
|
if (!empty($arrayfields['p.project_ref']['checked'])) { |
1906
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1906
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
1907
|
1907
|
} |
1908
|
1908
|
if (!empty($arrayfields['p.project_label']['checked'])) { |
1909
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1909
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
1910
|
1910
|
} |
1911
|
1911
|
} |
1912
|
1912
|
// Task |
|
@@ -1924,7 +1924,7 @@ discard block |
|
|
block discarded – undo |
1924
|
1924
|
} |
1925
|
1925
|
// Note |
1926
|
1926
|
if (!empty($arrayfields['t.note']['checked'])) { |
1927
|
|
- print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1927
|
+ print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
1928
|
1928
|
} |
1929
|
1929
|
// Duration |
1930
|
1930
|
if (!empty($arrayfields['t.element_duration']['checked'])) { |
|
@@ -1935,7 +1935,7 @@ discard block |
|
|
block discarded – undo |
1935
|
1935
|
if ($search_timespent_starthour || $search_timespent_startmin) { |
1936
|
1936
|
$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1937
|
1937
|
} |
1938
|
|
- print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1938
|
+ print '<div class="nowraponall">'.$langs->trans('from').' '; |
1939
|
1939
|
print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1940
|
1940
|
print '</div>'; |
1941
|
1941
|
|
|
@@ -1943,7 +1943,7 @@ discard block |
|
|
block discarded – undo |
1943
|
1943
|
if ($search_timespent_endhour || $search_timespent_endmin) { |
1944
|
1944
|
$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1945
|
1945
|
} |
1946
|
|
- print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
1946
|
+ print '<div class="nowraponall">'.$langs->trans('at').' '; |
1947
|
1947
|
print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1948
|
1948
|
print '</div>'; |
1949
|
1949
|
|
|
@@ -1959,7 +1959,7 @@ discard block |
|
|
block discarded – undo |
1959
|
1959
|
} |
1960
|
1960
|
// Value billed |
1961
|
1961
|
if (!empty($arrayfields['valuebilled']['checked'])) { |
1962
|
|
- print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
1962
|
+ print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
1963
|
1963
|
} |
1964
|
1964
|
|
1965
|
1965
|
/* |
|
@@ -1977,7 +1977,7 @@ discard block |
|
|
block discarded – undo |
1977
|
1977
|
print $searchpicto; |
1978
|
1978
|
print '</td>'; |
1979
|
1979
|
} |
1980
|
|
- print '</tr>' . "\n"; |
|
1980
|
+ print '</tr>'."\n"; |
1981
|
1981
|
|
1982
|
1982
|
$totalarray = array(); |
1983
|
1983
|
$totalarray['nbfield'] = 0; |
|
@@ -2087,7 +2087,7 @@ discard block |
|
|
block discarded – undo |
2087
|
2087
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2088
|
2088
|
print '<td class="center nowraponall">'; |
2089
|
2089
|
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { |
2090
|
|
- print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">'; |
|
2090
|
+ print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">'; |
2091
|
2091
|
print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2092
|
2092
|
print ' '; |
2093
|
2093
|
print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
@@ -2095,7 +2095,7 @@ discard block |
|
|
block discarded – undo |
2095
|
2095
|
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2096
|
2096
|
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2097
|
2097
|
print ' '; |
2098
|
|
- print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2098
|
+ print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
2099
|
2099
|
print img_split('', 'class="pictofixedwidth"'); |
2100
|
2100
|
print '</a>'; |
2101
|
2101
|
} |
|
@@ -2114,7 +2114,7 @@ discard block |
|
|
block discarded – undo |
2114
|
2114
|
$selected = 1; |
2115
|
2115
|
} |
2116
|
2116
|
print ' '; |
2117
|
|
- print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2117
|
+ print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
2118
|
2118
|
} |
2119
|
2119
|
} |
2120
|
2120
|
} |
|
@@ -2232,7 +2232,7 @@ discard block |
|
|
block discarded – undo |
2232
|
2232
|
} |
2233
|
2233
|
} |
2234
|
2234
|
} elseif ($action !== 'createtime') { |
2235
|
|
- print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2235
|
+ print '<input type="hidden" name="taskid" value="'.$id.'">'; |
2236
|
2236
|
} |
2237
|
2237
|
|
2238
|
2238
|
// Task label |
|
@@ -2262,7 +2262,7 @@ discard block |
|
|
block discarded – undo |
2262
|
2262
|
print img_object('', 'user', 'class="hideonsmartphone"'); |
2263
|
2263
|
print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
2264
|
2264
|
} else { |
2265
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2265
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
2266
|
2266
|
} |
2267
|
2267
|
} else { |
2268
|
2268
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2282,7 +2282,7 @@ discard block |
|
|
block discarded – undo |
2282
|
2282
|
if (!empty($arrayfields['t.note']['checked'])) { |
2283
|
2283
|
print '<td class="small">'; |
2284
|
2284
|
if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2285
|
|
- print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2285
|
+ print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
2286
|
2286
|
} else { |
2287
|
2287
|
print dol_nl2br($task_time->note); |
2288
|
2288
|
} |
|
@@ -2291,7 +2291,7 @@ discard block |
|
|
block discarded – undo |
2291
|
2291
|
$totalarray['nbfield']++; |
2292
|
2292
|
} |
2293
|
2293
|
} elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2294
|
|
- print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2294
|
+ print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
2295
|
2295
|
} |
2296
|
2296
|
|
2297
|
2297
|
// Time spent |
|
@@ -2351,7 +2351,7 @@ discard block |
|
|
block discarded – undo |
2351
|
2351
|
$value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2352
|
2352
|
|
2353
|
2353
|
print '<td class="nowraponall right">'; |
2354
|
|
- print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2354
|
+ print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
2355
|
2355
|
print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2356
|
2356
|
print '</span>'; |
2357
|
2357
|
print '</td>'; |
|
@@ -2384,7 +2384,7 @@ discard block |
|
|
block discarded – undo |
2384
|
2384
|
if ($task_time->invoice_id) { |
2385
|
2385
|
$result = $tmpinvoice->fetch($task_time->invoice_id); |
2386
|
2386
|
if ($result > 0) { |
2387
|
|
- if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2387
|
+ if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { |
2388
|
2388
|
print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); |
2389
|
2389
|
} else { |
2390
|
2390
|
print $tmpinvoice->getNomUrl(1); |
|
@@ -2402,7 +2402,7 @@ discard block |
|
|
block discarded – undo |
2402
|
2402
|
print $langs->trans("No"); |
2403
|
2403
|
} |
2404
|
2404
|
} else { |
2405
|
|
- print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2405
|
+ print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
2406
|
2406
|
} |
2407
|
2407
|
} |
2408
|
2408
|
print '</td>'; |
|
@@ -2433,7 +2433,7 @@ discard block |
|
|
block discarded – undo |
2433
|
2433
|
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2434
|
2434
|
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2435
|
2435
|
print ' '; |
2436
|
|
- print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2436
|
+ print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
2437
|
2437
|
print img_split('', 'class="pictofixedwidth"'); |
2438
|
2438
|
print '</a>'; |
2439
|
2439
|
} |
|
@@ -2452,7 +2452,7 @@ discard block |
|
|
block discarded – undo |
2452
|
2452
|
$selected = 1; |
2453
|
2453
|
} |
2454
|
2454
|
print ' '; |
2455
|
|
- print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2455
|
+ print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
2456
|
2456
|
} |
2457
|
2457
|
} |
2458
|
2458
|
} |
|
@@ -2542,7 +2542,7 @@ discard block |
|
|
block discarded – undo |
2542
|
2542
|
print img_object('', 'user', 'class="hideonsmartphone"'); |
2543
|
2543
|
print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2544
|
2544
|
} else { |
2545
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2545
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
2546
|
2546
|
} |
2547
|
2547
|
} else { |
2548
|
2548
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2559,13 +2559,13 @@ discard block |
|
|
block discarded – undo |
2559
|
2559
|
if (!empty($arrayfields['t.note']['checked'])) { |
2560
|
2560
|
print '<td class="tdoverflowmax300">'; |
2561
|
2561
|
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2562
|
|
- print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2562
|
+ print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
2563
|
2563
|
} else { |
2564
|
2564
|
print dol_nl2br($task_time->note); |
2565
|
2565
|
} |
2566
|
2566
|
print '</td>'; |
2567
|
2567
|
} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2568
|
|
- print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2568
|
+ print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
2569
|
2569
|
} |
2570
|
2570
|
|
2571
|
2571
|
// Time spent |
|
@@ -2698,7 +2698,7 @@ discard block |
|
|
block discarded – undo |
2698
|
2698
|
print img_object('', 'user', 'class="hideonsmartphone"'); |
2699
|
2699
|
print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2700
|
2700
|
} else { |
2701
|
|
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2701
|
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
2702
|
2702
|
} |
2703
|
2703
|
} else { |
2704
|
2704
|
$userstatic->id = $task_time->fk_user; |
|
@@ -2715,13 +2715,13 @@ discard block |
|
|
block discarded – undo |
2715
|
2715
|
if (!empty($arrayfields['t.note']['checked'])) { |
2716
|
2716
|
print '<td class="small tdoverflowmax300"">'; |
2717
|
2717
|
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2718
|
|
- print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2718
|
+ print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
2719
|
2719
|
} else { |
2720
|
2720
|
print dol_nl2br($task_time->note); |
2721
|
2721
|
} |
2722
|
2722
|
print '</td>'; |
2723
|
2723
|
} elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2724
|
|
- print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2724
|
+ print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
2725
|
2725
|
} |
2726
|
2726
|
|
2727
|
2727
|
// Time spent |
|
@@ -2793,14 +2793,14 @@ discard block |
|
|
block discarded – undo |
2793
|
2793
|
$i++; |
2794
|
2794
|
if ($i == 1) { |
2795
|
2795
|
if ($num < $limit && empty($offset)) { |
2796
|
|
- print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2796
|
+ print '<td class="left">'.$langs->trans("Total").'</td>'; |
2797
|
2797
|
} else { |
2798
|
2798
|
print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2799
|
2799
|
} |
2800
|
2800
|
} elseif ($totalarray['totaldurationfield'] == $i) { |
2801
|
|
- print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2801
|
+ print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
2802
|
2802
|
} elseif ($totalarray['totalvaluefield'] == $i) { |
2803
|
|
- print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2803
|
+ print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
2804
|
2804
|
//} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2805
|
2805
|
} else { |
2806
|
2806
|
print '<td></td>'; |
|
@@ -2816,8 +2816,8 @@ discard block |
|
|
block discarded – undo |
2816
|
2816
|
$totalnboffields++; |
2817
|
2817
|
} |
2818
|
2818
|
} |
2819
|
|
- print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
2820
|
|
- print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2819
|
+ print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2820
|
+ print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
2821
|
2821
|
print '</td></tr>'; |
2822
|
2822
|
} |
2823
|
2823
|
|