@@ -30,14 +30,14 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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++; |
@@ -798,12 +798,12 @@ discard block |
||
798 | 798 | if (!($projectstatic->thirdparty->id > 0)) { |
799 | 799 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
800 | 800 | } else { |
801 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
802 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
803 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
801 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
802 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
803 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
804 | 804 | |
805 | 805 | |
806 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
806 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
807 | 807 | $tmpinter = new Fichinter($db); |
808 | 808 | $tmptimespent = new Task($db); |
809 | 809 | $fuser = new User($db); |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | $tmpinter->socid = $projectstatic->thirdparty->id; |
816 | 816 | $tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
817 | 817 | $tmpinter->fk_project = $projectstatic->id; |
818 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
818 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
819 | 819 | |
820 | 820 | if ($interToUse) { |
821 | 821 | $tmpinter->fetch($interToUse); |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
849 | 849 | |
850 | 850 | // Add lines |
851 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
851 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | |
@@ -879,9 +879,9 @@ discard block |
||
879 | 879 | //$result = $projectstatic->fetch($object->fk_project); |
880 | 880 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
881 | 881 | |
882 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
882 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
883 | 883 | if (!empty($withproject)) { |
884 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
884 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
885 | 885 | } |
886 | 886 | $help_url = ''; |
887 | 887 | |
@@ -930,13 +930,13 @@ discard block |
||
930 | 930 | |
931 | 931 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
932 | 932 | if ($search_user) { |
933 | - $param .= '&search_user=' . ((int) $search_user); |
|
933 | + $param .= '&search_user='.((int) $search_user); |
|
934 | 934 | } |
935 | 935 | if ($search_month) { |
936 | - $param .= '&search_month=' . ((int) $search_month); |
|
936 | + $param .= '&search_month='.((int) $search_month); |
|
937 | 937 | } |
938 | 938 | if ($search_year) { |
939 | - $param .= '&search_year=' . ((int) $search_year); |
|
939 | + $param .= '&search_year='.((int) $search_year); |
|
940 | 940 | } |
941 | 941 | |
942 | 942 | // Project card |
@@ -948,14 +948,14 @@ discard block |
||
948 | 948 | $morehtmlref .= $projectstatic->title; |
949 | 949 | // Thirdparty |
950 | 950 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
951 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
951 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
952 | 952 | } |
953 | 953 | $morehtmlref .= '</div>'; |
954 | 954 | |
955 | 955 | // Define a complementary filter for search of next/prev ref. |
956 | 956 | if (!$user->hasRight('projet', 'all', 'lire')) { |
957 | 957 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
958 | - $projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")"; |
|
958 | + $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -973,25 +973,25 @@ discard block |
||
973 | 973 | print '</td>'; |
974 | 974 | print '<td>'; |
975 | 975 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
976 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
976 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
977 | 977 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
978 | 978 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
979 | 979 | print '<br>'; |
980 | 980 | } |
981 | 981 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
982 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
982 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
983 | 983 | $htmltext = $langs->trans("ProjectFollowTasks"); |
984 | 984 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
985 | 985 | print '<br>'; |
986 | 986 | } |
987 | 987 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
988 | - 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"' : '')) . '"> '; |
|
988 | + 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"' : '')).'"> '; |
|
989 | 989 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
990 | 990 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
991 | 991 | print '<br>'; |
992 | 992 | } |
993 | 993 | if (isModEnabled('eventorganization')) { |
994 | - 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"' : '')) . '"> '; |
|
994 | + 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"' : '')).'"> '; |
|
995 | 995 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
996 | 996 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
997 | 997 | } |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | } |
1000 | 1000 | |
1001 | 1001 | // Visibility |
1002 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
1002 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1003 | 1003 | if ($projectstatic->public) { |
1004 | 1004 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1005 | 1005 | print $langs->trans('SharedProject'); |
@@ -1010,14 +1010,14 @@ discard block |
||
1010 | 1010 | print '</td></tr>'; |
1011 | 1011 | |
1012 | 1012 | // Budget |
1013 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1013 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1014 | 1014 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1015 | - print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1015 | + print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1016 | 1016 | } |
1017 | 1017 | print '</td></tr>'; |
1018 | 1018 | |
1019 | 1019 | // Date start - end project |
1020 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1020 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1021 | 1021 | $start = dol_print_date($projectstatic->date_start, 'day'); |
1022 | 1022 | print($start ? $start : '?'); |
1023 | 1023 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | $cols = 2; |
1033 | 1033 | $savobject = $object; |
1034 | 1034 | $object = $projectstatic; |
1035 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1035 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1036 | 1036 | $object = $savobject; |
1037 | 1037 | |
1038 | 1038 | print '</table>'; |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | |
1051 | 1051 | // Categories |
1052 | 1052 | if (isModEnabled('categorie')) { |
1053 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1053 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1054 | 1054 | print $form->showCategories($projectstatic->id, 'project', 1); |
1055 | 1055 | print "</td></tr>"; |
1056 | 1056 | } |
@@ -1079,12 +1079,12 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | if (!empty($projectidforalltimes)) { |
1081 | 1081 | // We are on tab 'Time Spent' of project |
1082 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1083 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1082 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1083 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1084 | 1084 | } else { |
1085 | 1085 | // We are on tab 'Time Spent' of task |
1086 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1087 | - $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 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1087 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1088 | 1088 | } |
1089 | 1089 | } else { |
1090 | 1090 | $linktocreatetimeBtnStatus = -2; |
@@ -1129,19 +1129,19 @@ discard block |
||
1129 | 1129 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1130 | 1130 | |
1131 | 1131 | if ($action == 'deleteline') { |
1132 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1132 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
1133 | 1133 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1134 | 1134 | } |
1135 | 1135 | |
1136 | 1136 | $param = ($withproject ? '&withproject=1' : ''); |
1137 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1138 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1137 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1138 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1139 | 1139 | |
1140 | 1140 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1141 | 1141 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1142 | - $object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
1142 | + $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; |
|
1143 | 1143 | } else { |
1144 | - $object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id); |
|
1144 | + $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); |
|
1145 | 1145 | } |
1146 | 1146 | |
1147 | 1147 | $morehtmlref = ''; |
@@ -1149,12 +1149,12 @@ discard block |
||
1149 | 1149 | // Project |
1150 | 1150 | if (empty($withproject)) { |
1151 | 1151 | $morehtmlref .= '<div class="refidno">'; |
1152 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
1152 | + $morehtmlref .= $langs->trans("Project").': '; |
|
1153 | 1153 | $morehtmlref .= $projectstatic->getNomUrl(1); |
1154 | 1154 | $morehtmlref .= '<br>'; |
1155 | 1155 | |
1156 | 1156 | // Third party |
1157 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1157 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1158 | 1158 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1159 | 1159 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1160 | 1160 | } |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | print '<table class="border centpercent tableforfield">'; |
1171 | 1171 | |
1172 | 1172 | // Task parent |
1173 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1173 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1174 | 1174 | if ($object->fk_task_parent > 0) { |
1175 | 1175 | $tasktmp = new Task($db); |
1176 | 1176 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | print '</td></tr>'; |
1180 | 1180 | |
1181 | 1181 | // Date start - Date end task |
1182 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1182 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1183 | 1183 | $start = dol_print_date($object->date_start, 'dayhour'); |
1184 | 1184 | print($start ? $start : '?'); |
1185 | 1185 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | print '</td></tr>'; |
1192 | 1192 | |
1193 | 1193 | // Planned workload |
1194 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1194 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1195 | 1195 | if ($object->planned_workload) { |
1196 | 1196 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1197 | 1197 | } |
@@ -1206,21 +1206,21 @@ discard block |
||
1206 | 1206 | print '<table class="border tableforfield centpercent">'; |
1207 | 1207 | |
1208 | 1208 | // Progress declared |
1209 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1210 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1209 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1210 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
1211 | 1211 | print '</td></tr>'; |
1212 | 1212 | |
1213 | 1213 | // Progress calculated |
1214 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1214 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1215 | 1215 | if ($object->planned_workload) { |
1216 | 1216 | $tmparray = $object->getSummaryOfTimeSpent(); |
1217 | 1217 | if ($tmparray['total_duration'] > 0) { |
1218 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1218 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1219 | 1219 | } else { |
1220 | 1220 | print '0 %'; |
1221 | 1221 | } |
1222 | 1222 | } else { |
1223 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1223 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1224 | 1224 | } |
1225 | 1225 | print '</td>'; |
1226 | 1226 | |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | print dol_get_fiche_end(); |
1237 | 1237 | } else { |
1238 | 1238 | if ($action == 'deleteline') { |
1239 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1239 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
1240 | 1240 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1241 | 1241 | } |
1242 | 1242 | } |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | |
1251 | 1251 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1252 | 1252 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1253 | - $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); |
|
1253 | + $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); |
|
1254 | 1254 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1255 | 1255 | } |
1256 | 1256 | |
@@ -1269,10 +1269,10 @@ discard block |
||
1269 | 1269 | // Definition of fields for list |
1270 | 1270 | $arrayfields = array(); |
1271 | 1271 | $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); |
1272 | - $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); |
|
1272 | + $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1); |
|
1273 | 1273 | $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); |
1274 | 1274 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1275 | - if (! empty($allprojectforuser)) { |
|
1275 | + if (!empty($allprojectforuser)) { |
|
1276 | 1276 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1277 | 1277 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1278 | 1278 | } |
@@ -1288,82 +1288,82 @@ discard block |
||
1288 | 1288 | $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); |
1289 | 1289 | $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
1290 | 1290 | // Extra fields |
1291 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1291 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1292 | 1292 | |
1293 | 1293 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
1294 | 1294 | |
1295 | 1295 | $param = ''; |
1296 | 1296 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1297 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
1297 | + $param .= '&contextpage='.urlencode($contextpage); |
|
1298 | 1298 | } |
1299 | 1299 | if ($limit > 0 && $limit != $conf->liste_limit) { |
1300 | 1300 | $param .= '&limit='.((int) $limit); |
1301 | 1301 | } |
1302 | 1302 | if ($search_month > 0) { |
1303 | - $param .= '&search_month=' . urlencode($search_month); |
|
1303 | + $param .= '&search_month='.urlencode($search_month); |
|
1304 | 1304 | } |
1305 | 1305 | if ($search_year > 0) { |
1306 | - $param .= '&search_year=' . urlencode($search_year); |
|
1306 | + $param .= '&search_year='.urlencode($search_year); |
|
1307 | 1307 | } |
1308 | 1308 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1309 | 1309 | $param .= '&search_user='.urlencode($search_user); |
1310 | 1310 | } |
1311 | 1311 | if ($search_task_ref != '') { |
1312 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1312 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1313 | 1313 | } |
1314 | 1314 | if ($search_company != '') { |
1315 | - $param .= '&$search_company=' . urlencode($search_company); |
|
1315 | + $param .= '&$search_company='.urlencode($search_company); |
|
1316 | 1316 | } |
1317 | 1317 | if ($search_company_alias != '') { |
1318 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1318 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1319 | 1319 | } |
1320 | 1320 | if ($search_project_ref != '') { |
1321 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1321 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1322 | 1322 | } |
1323 | 1323 | if ($search_project_label != '') { |
1324 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1324 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1325 | 1325 | } |
1326 | 1326 | if ($search_task_label != '') { |
1327 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1327 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
1328 | 1328 | } |
1329 | 1329 | if ($search_note != '') { |
1330 | - $param .= '&search_note=' . urlencode($search_note); |
|
1330 | + $param .= '&search_note='.urlencode($search_note); |
|
1331 | 1331 | } |
1332 | 1332 | if ($search_duration != '') { |
1333 | - $param .= '&search_field2=' . urlencode($search_duration); |
|
1333 | + $param .= '&search_field2='.urlencode($search_duration); |
|
1334 | 1334 | } |
1335 | 1335 | if ($optioncss != '') { |
1336 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1336 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1337 | 1337 | } |
1338 | 1338 | if ($search_date_startday) { |
1339 | - $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
1339 | + $param .= '&search_date_startday='.urlencode($search_date_startday); |
|
1340 | 1340 | } |
1341 | 1341 | if ($search_date_startmonth) { |
1342 | - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
1342 | + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
|
1343 | 1343 | } |
1344 | 1344 | if ($search_date_startyear) { |
1345 | - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
1345 | + $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
|
1346 | 1346 | } |
1347 | 1347 | if ($search_date_endday) { |
1348 | - $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
1348 | + $param .= '&search_date_endday='.urlencode($search_date_endday); |
|
1349 | 1349 | } |
1350 | 1350 | if ($search_date_endmonth) { |
1351 | - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
1351 | + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
|
1352 | 1352 | } |
1353 | 1353 | if ($search_date_endyear) { |
1354 | - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
1354 | + $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
|
1355 | 1355 | } |
1356 | 1356 | if ($search_timespent_starthour) { |
1357 | - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
1357 | + $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
|
1358 | 1358 | } |
1359 | 1359 | if ($search_timespent_startmin) { |
1360 | - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
1360 | + $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
|
1361 | 1361 | } |
1362 | 1362 | if ($search_timespent_endhour) { |
1363 | - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
1363 | + $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
|
1364 | 1364 | } |
1365 | 1365 | if ($search_timespent_endmin) { |
1366 | - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
1366 | + $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
|
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | /* |
@@ -1371,24 +1371,24 @@ discard block |
||
1371 | 1371 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1372 | 1372 | */ |
1373 | 1373 | if ($id) { |
1374 | - $param .= '&id=' . urlencode($id); |
|
1374 | + $param .= '&id='.urlencode($id); |
|
1375 | 1375 | } |
1376 | 1376 | if ($projectid) { |
1377 | - $param .= '&projectid=' . urlencode($projectid); |
|
1377 | + $param .= '&projectid='.urlencode($projectid); |
|
1378 | 1378 | } |
1379 | 1379 | if ($withproject) { |
1380 | - $param .= '&withproject=' . urlencode($withproject); |
|
1380 | + $param .= '&withproject='.urlencode($withproject); |
|
1381 | 1381 | } |
1382 | 1382 | // Add $param from hooks |
1383 | 1383 | $parameters = array(); |
1384 | 1384 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
1385 | 1385 | $param .= $hookmanager->resPrint; |
1386 | 1386 | |
1387 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1387 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1388 | 1388 | if ($optioncss != '') { |
1389 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1389 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1390 | 1390 | } |
1391 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1391 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1392 | 1392 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1393 | 1393 | if ($action == 'editline') { |
1394 | 1394 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1403,13 +1403,13 @@ discard block |
||
1403 | 1403 | } else { |
1404 | 1404 | print '<input type="hidden" name="action" value="list">'; |
1405 | 1405 | } |
1406 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1407 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1406 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1407 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1408 | 1408 | |
1409 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1410 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1411 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1412 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1409 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1410 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1411 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1412 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1413 | 1413 | print '<input type="hidden" name="page_y" value="">'; |
1414 | 1414 | |
1415 | 1415 | // Form to convert time spent into invoice |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1437 | 1437 | ); |
1438 | 1438 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1439 | - print "\n" . '<script type="text/javascript">'; |
|
1439 | + print "\n".'<script type="text/javascript">'; |
|
1440 | 1440 | print ' |
1441 | 1441 | $(document).ready(function () { |
1442 | 1442 | setDetailVisibility(); |
@@ -1453,8 +1453,8 @@ discard block |
||
1453 | 1453 | } |
1454 | 1454 | }); |
1455 | 1455 | '; |
1456 | - print '</script>' . "\n"; |
|
1457 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1456 | + print '</script>'."\n"; |
|
1457 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1458 | 1458 | print '</td>'; |
1459 | 1459 | print '</tr>'; |
1460 | 1460 | |
@@ -1489,14 +1489,14 @@ discard block |
||
1489 | 1489 | |
1490 | 1490 | print '<br>'; |
1491 | 1491 | print '<div class="center">'; |
1492 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1493 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1492 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1493 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1494 | 1494 | print '</div>'; |
1495 | 1495 | print '<br>'; |
1496 | 1496 | } else { |
1497 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1497 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1498 | 1498 | print '<div class="center">'; |
1499 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1499 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1500 | 1500 | print '</div>'; |
1501 | 1501 | $massaction = ''; |
1502 | 1502 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | print '<table class="noborder centpercent">'; |
1510 | 1510 | print '<tr>'; |
1511 | 1511 | print '<td class="titlefield">'; |
1512 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1512 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1513 | 1513 | print '</td>'; |
1514 | 1514 | print '<td>'; |
1515 | 1515 | $forminter = new FormIntervention($db); |
@@ -1519,14 +1519,14 @@ discard block |
||
1519 | 1519 | print '</table>'; |
1520 | 1520 | |
1521 | 1521 | print '<div class="center">'; |
1522 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1523 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1522 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1523 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1524 | 1524 | print '</div>'; |
1525 | 1525 | print '<br>'; |
1526 | 1526 | } else { |
1527 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1527 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1528 | 1528 | print '<div class="center">'; |
1529 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1529 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1530 | 1530 | print '</div>'; |
1531 | 1531 | $massaction = ''; |
1532 | 1532 | } |
@@ -1588,14 +1588,14 @@ discard block |
||
1588 | 1588 | $sql .= " AND t.fk_element =".((int) $object->id); |
1589 | 1589 | } elseif (!empty($projectidforalltimes)) { |
1590 | 1590 | // Limit on one project |
1591 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1591 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
1592 | 1592 | } elseif (!empty($allprojectforuser)) { |
1593 | 1593 | // Limit on on user |
1594 | 1594 | if (empty($search_user)) { |
1595 | 1595 | $search_user = $user->id; |
1596 | 1596 | } |
1597 | 1597 | if ($search_user > 0) { |
1598 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1598 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1599 | 1599 | } |
1600 | 1600 | } |
1601 | 1601 | |
@@ -1648,13 +1648,13 @@ discard block |
||
1648 | 1648 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1649 | 1649 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1650 | 1650 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1651 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1651 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1652 | 1652 | } |
1653 | 1653 | |
1654 | 1654 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1655 | 1655 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1656 | 1656 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1657 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1657 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1658 | 1658 | } |
1659 | 1659 | } |
1660 | 1660 | |
@@ -1702,13 +1702,13 @@ discard block |
||
1702 | 1702 | |
1703 | 1703 | if ($num >= 0) { |
1704 | 1704 | if (!empty($projectidforalltimes)) { |
1705 | - print '<!-- List of time spent for project -->' . "\n"; |
|
1705 | + print '<!-- List of time spent for project -->'."\n"; |
|
1706 | 1706 | |
1707 | 1707 | $title = $langs->trans("ListTaskTimeUserProject"); |
1708 | 1708 | |
1709 | 1709 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1710 | 1710 | } else { |
1711 | - print '<!-- List of time spent -->' . "\n"; |
|
1711 | + print '<!-- List of time spent -->'."\n"; |
|
1712 | 1712 | |
1713 | 1713 | $title = $langs->trans("ListTaskTimeForTask"); |
1714 | 1714 | |
@@ -1730,26 +1730,26 @@ discard block |
||
1730 | 1730 | * Form to add a new line of time spent |
1731 | 1731 | */ |
1732 | 1732 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
1733 | - print '<!-- table to add time spent -->' . "\n"; |
|
1733 | + print '<!-- table to add time spent -->'."\n"; |
|
1734 | 1734 | if (!empty($id)) { |
1735 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1735 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1736 | 1736 | } |
1737 | 1737 | |
1738 | 1738 | 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 |
1739 | 1739 | print '<table class="noborder nohover centpercent">'; |
1740 | 1740 | |
1741 | 1741 | print '<tr class="liste_titre">'; |
1742 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
1742 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
1743 | 1743 | if (!empty($allprojectforuser)) { |
1744 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
1744 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
1745 | 1745 | } |
1746 | 1746 | if (empty($id)) { |
1747 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
1747 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
1748 | 1748 | } |
1749 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
1750 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
1751 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1752 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1749 | + print '<td>'.$langs->trans("By").'</td>'; |
|
1750 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
1751 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1752 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1753 | 1753 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
1754 | 1754 | print '<td></td>'; |
1755 | 1755 | |
@@ -1803,14 +1803,14 @@ discard block |
||
1803 | 1803 | print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
1804 | 1804 | } else { |
1805 | 1805 | if ($nboftasks) { |
1806 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1806 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1807 | 1807 | } |
1808 | 1808 | } |
1809 | 1809 | print '</td>'; |
1810 | 1810 | |
1811 | 1811 | // Note |
1812 | 1812 | print '<td>'; |
1813 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1813 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1814 | 1814 | print '</td>'; |
1815 | 1815 | |
1816 | 1816 | // Duration - Time spent |
@@ -1835,7 +1835,7 @@ discard block |
||
1835 | 1835 | if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { |
1836 | 1836 | print '<td class="nowraponall">'; |
1837 | 1837 | print img_picto('', 'service'); |
1838 | - print $form->select_produits((GETPOSTISSET('fk_product')?GETPOST("fk_product", 'int'):''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); |
|
1838 | + print $form->select_produits((GETPOSTISSET('fk_product') ?GETPOST("fk_product", 'int') : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); |
|
1839 | 1839 | print '</td>'; |
1840 | 1840 | } |
1841 | 1841 | } |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1879 | 1879 | |
1880 | 1880 | print '<div class="div-table-responsive">'; |
1881 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1881 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1882 | 1882 | |
1883 | 1883 | // Fields title search |
1884 | 1884 | // -------------------------------------------------------------------- |
@@ -1903,20 +1903,20 @@ discard block |
||
1903 | 1903 | } |
1904 | 1904 | // Thirdparty |
1905 | 1905 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1906 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1906 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | // Thirdparty alias |
1910 | 1910 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
1911 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1911 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1912 | 1912 | } |
1913 | 1913 | |
1914 | 1914 | if (!empty($allprojectforuser)) { |
1915 | 1915 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
1916 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1916 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1917 | 1917 | } |
1918 | 1918 | if (!empty($arrayfields['p.project_label']['checked'])) { |
1919 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1919 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1920 | 1920 | } |
1921 | 1921 | } |
1922 | 1922 | // Task |
@@ -1934,7 +1934,7 @@ discard block |
||
1934 | 1934 | } |
1935 | 1935 | // Note |
1936 | 1936 | if (!empty($arrayfields['t.note']['checked'])) { |
1937 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1937 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1938 | 1938 | } |
1939 | 1939 | // Duration |
1940 | 1940 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1945,7 +1945,7 @@ discard block |
||
1945 | 1945 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1946 | 1946 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1947 | 1947 | } |
1948 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1948 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1949 | 1949 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1950 | 1950 | print '</div>'; |
1951 | 1951 | |
@@ -1953,7 +1953,7 @@ discard block |
||
1953 | 1953 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1954 | 1954 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1955 | 1955 | } |
1956 | - print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
1956 | + print '<div class="nowraponall">'.$langs->trans('at').' '; |
|
1957 | 1957 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1958 | 1958 | print '</div>'; |
1959 | 1959 | |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | } |
1970 | 1970 | // Value billed |
1971 | 1971 | if (!empty($arrayfields['valuebilled']['checked'])) { |
1972 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
1972 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
1973 | 1973 | } |
1974 | 1974 | |
1975 | 1975 | /* |
@@ -1987,7 +1987,7 @@ discard block |
||
1987 | 1987 | print $searchpicto; |
1988 | 1988 | print '</td>'; |
1989 | 1989 | } |
1990 | - print '</tr>' . "\n"; |
|
1990 | + print '</tr>'."\n"; |
|
1991 | 1991 | |
1992 | 1992 | $totalarray = array(); |
1993 | 1993 | $totalarray['nbfield'] = 0; |
@@ -2097,7 +2097,7 @@ discard block |
||
2097 | 2097 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2098 | 2098 | print '<td class="center nowraponall">'; |
2099 | 2099 | if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { |
2100 | - print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">'; |
|
2100 | + print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">'; |
|
2101 | 2101 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2102 | 2102 | print '<br>'; |
2103 | 2103 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2106 | 2106 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2107 | 2107 | print ' '; |
2108 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2108 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2109 | 2109 | print img_split('', 'class="pictofixedwidth"'); |
2110 | 2110 | print '</a>'; |
2111 | 2111 | } |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | $selected = 1; |
2125 | 2125 | } |
2126 | 2126 | print ' '; |
2127 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2127 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2128 | 2128 | } |
2129 | 2129 | } |
2130 | 2130 | } |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | } |
2243 | 2243 | } |
2244 | 2244 | } elseif ($action !== 'createtime') { |
2245 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2245 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2246 | 2246 | } |
2247 | 2247 | |
2248 | 2248 | // Task label |
@@ -2272,7 +2272,7 @@ discard block |
||
2272 | 2272 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2273 | 2273 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
2274 | 2274 | } else { |
2275 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2275 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2276 | 2276 | } |
2277 | 2277 | } else { |
2278 | 2278 | $userstatic->id = $task_time->fk_user; |
@@ -2292,7 +2292,7 @@ discard block |
||
2292 | 2292 | if (!empty($arrayfields['t.note']['checked'])) { |
2293 | 2293 | if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2294 | 2294 | print '<td class="small">'; |
2295 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2295 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2296 | 2296 | print '</td>'; |
2297 | 2297 | } else { |
2298 | 2298 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2303,7 +2303,7 @@ discard block |
||
2303 | 2303 | $totalarray['nbfield']++; |
2304 | 2304 | } |
2305 | 2305 | } elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2306 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2306 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2307 | 2307 | } |
2308 | 2308 | |
2309 | 2309 | // Time spent |
@@ -2364,7 +2364,7 @@ discard block |
||
2364 | 2364 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2365 | 2365 | |
2366 | 2366 | print '<td class="nowraponall right">'; |
2367 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2367 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2368 | 2368 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2369 | 2369 | print '</span>'; |
2370 | 2370 | print '</td>'; |
@@ -2397,7 +2397,7 @@ discard block |
||
2397 | 2397 | if ($task_time->invoice_id) { |
2398 | 2398 | $result = $tmpinvoice->fetch($task_time->invoice_id); |
2399 | 2399 | if ($result > 0) { |
2400 | - if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2400 | + if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2401 | 2401 | print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); |
2402 | 2402 | } else { |
2403 | 2403 | print $tmpinvoice->getNomUrl(1); |
@@ -2415,7 +2415,7 @@ discard block |
||
2415 | 2415 | print $langs->trans("No"); |
2416 | 2416 | } |
2417 | 2417 | } else { |
2418 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2418 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2419 | 2419 | } |
2420 | 2420 | } |
2421 | 2421 | print '</td>'; |
@@ -2446,7 +2446,7 @@ discard block |
||
2446 | 2446 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2447 | 2447 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2448 | 2448 | print ' '; |
2449 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2449 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2450 | 2450 | print img_split('', 'class="pictofixedwidth"'); |
2451 | 2451 | print '</a>'; |
2452 | 2452 | } |
@@ -2465,7 +2465,7 @@ discard block |
||
2465 | 2465 | $selected = 1; |
2466 | 2466 | } |
2467 | 2467 | print ' '; |
2468 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2468 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2469 | 2469 | } |
2470 | 2470 | } |
2471 | 2471 | } |
@@ -2555,7 +2555,7 @@ discard block |
||
2555 | 2555 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2556 | 2556 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2557 | 2557 | } else { |
2558 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2558 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2559 | 2559 | } |
2560 | 2560 | } else { |
2561 | 2561 | $userstatic->id = $task_time->fk_user; |
@@ -2572,13 +2572,13 @@ discard block |
||
2572 | 2572 | if (!empty($arrayfields['t.note']['checked'])) { |
2573 | 2573 | print '<td class="tdoverflowmax300">'; |
2574 | 2574 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2575 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2575 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2576 | 2576 | } else { |
2577 | 2577 | print dol_nl2br($task_time->note); |
2578 | 2578 | } |
2579 | 2579 | print '</td>'; |
2580 | 2580 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2581 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2581 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2582 | 2582 | } |
2583 | 2583 | |
2584 | 2584 | // Time spent |
@@ -2711,7 +2711,7 @@ discard block |
||
2711 | 2711 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2712 | 2712 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2713 | 2713 | } else { |
2714 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2714 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2715 | 2715 | } |
2716 | 2716 | } else { |
2717 | 2717 | $userstatic->id = $task_time->fk_user; |
@@ -2728,13 +2728,13 @@ discard block |
||
2728 | 2728 | if (!empty($arrayfields['t.note']['checked'])) { |
2729 | 2729 | print '<td class="small tdoverflowmax300"">'; |
2730 | 2730 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2731 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2731 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2732 | 2732 | } else { |
2733 | 2733 | print dol_nl2br($task_time->note); |
2734 | 2734 | } |
2735 | 2735 | print '</td>'; |
2736 | 2736 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2737 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2737 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2738 | 2738 | } |
2739 | 2739 | |
2740 | 2740 | // Time spent |
@@ -2806,14 +2806,14 @@ discard block |
||
2806 | 2806 | $i++; |
2807 | 2807 | if ($i == 1) { |
2808 | 2808 | if ($num < $limit && empty($offset)) { |
2809 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2809 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2810 | 2810 | } else { |
2811 | 2811 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2812 | 2812 | } |
2813 | 2813 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
2814 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2814 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2815 | 2815 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
2816 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2816 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2817 | 2817 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2818 | 2818 | } else { |
2819 | 2819 | print '<td></td>'; |
@@ -2829,8 +2829,8 @@ discard block |
||
2829 | 2829 | $totalnboffields++; |
2830 | 2830 | } |
2831 | 2831 | } |
2832 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2833 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2832 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2833 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2834 | 2834 | print '</td></tr>'; |
2835 | 2835 | } |
2836 | 2836 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | // Parameters |
35 | 35 | $action = GETPOST('action', 'aZ09'); |
36 | 36 | $backtopage = GETPOST('backtopage', 'alpha'); |
37 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
37 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
38 | 38 | |
39 | 39 | $value = GETPOST('value', 'alpha'); |
40 | 40 | $label = GETPOST('label', 'alpha'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // Retrieve existing API Key |
71 | 71 | //$apiKey = dolibarr_get_const($db, 'MAIN_AI_CHATGPT_API_KEY'); |
72 | 72 | |
73 | -$setupnotempty =+ count($formSetup->items); |
|
73 | +$setupnotempty = + count($formSetup->items); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) |
40 | 40 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist'; |
41 | 41 | |
42 | -$paiementid = GETPOST('paiementid', 'int'); |
|
42 | +$paiementid = GETPOST('paiementid', 'int'); |
|
43 | 43 | |
44 | 44 | $search_ref = GETPOST("search_ref", "alpha"); |
45 | 45 | $search_date_startday = GETPOST('search_date_startday', 'int'); |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | $sql .= natural_search('pd.rowid', $search_ref); |
188 | 188 | } |
189 | 189 | if ($search_date_start) { |
190 | - $sql .= " AND pd.datep >= '" . $db->idate($search_date_start) . "'"; |
|
190 | + $sql .= " AND pd.datep >= '".$db->idate($search_date_start)."'"; |
|
191 | 191 | } |
192 | 192 | if ($search_date_end) { |
193 | - $sql .= " AND pd.datep <= '" . $db->idate($search_date_end) . "'"; |
|
193 | + $sql .= " AND pd.datep <= '".$db->idate($search_date_end)."'"; |
|
194 | 194 | } |
195 | 195 | if ($search_account > 0) { |
196 | 196 | $sql .= " AND b.fk_account=".((int) $search_account); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | // Output page |
257 | 257 | // -------------------------------------------------------------------- |
258 | 258 | |
259 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
259 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
260 | 260 | |
261 | 261 | $param = ''; |
262 | 262 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | |
532 | 532 | // Ref |
533 | 533 | if (!empty($arrayfields['pd.rowid']['checked'])) { |
534 | - print '<td><a href="' . DOL_URL_ROOT . '/don/payment/card.php?id=' . $obj->payment_id . '">' . img_object($langs->trans("Payment"), "payment") . ' ' . $obj->payment_id . '</a></td>'; |
|
534 | + print '<td><a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$obj->payment_id.'">'.img_object($langs->trans("Payment"), "payment").' '.$obj->payment_id.'</a></td>'; |
|
535 | 535 | if (!$i) { |
536 | 536 | $totalarray['nbfield']++; |
537 | 537 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | |
613 | 613 | // Amount |
614 | 614 | if (!empty($arrayfields['pd.amount']['checked'])) { |
615 | - print '<td ><span class="amount">' . price($obj->amount) . '</span></td>'; |
|
615 | + print '<td ><span class="amount">'.price($obj->amount).'</span></td>'; |
|
616 | 616 | if (!$i) { |
617 | 617 | $totalarray['nbfield']++; |
618 | 618 | $totalarray['pos'][$totalarray['nbfield']] = 'amount'; |
@@ -23,41 +23,41 @@ discard block |
||
23 | 23 | * \remarks To run this script as CLI: phpunit filename.php |
24 | 24 | */ |
25 | 25 | |
26 | -global $conf,$user,$langs,$db,$mysoc; |
|
26 | +global $conf, $user, $langs, $db, $mysoc; |
|
27 | 27 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
28 | 28 | //require_once 'PHPUnit/Autoload.php'; |
29 | 29 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
30 | 30 | require_once dirname(__FILE__).'/../../htdocs/core/lib/profid.lib.php'; |
31 | 31 | |
32 | -if (! defined('NOREQUIREUSER')) { |
|
32 | +if (!defined('NOREQUIREUSER')) { |
|
33 | 33 | define('NOREQUIREUSER', '1'); |
34 | 34 | } |
35 | -if (! defined('NOREQUIREDB')) { |
|
35 | +if (!defined('NOREQUIREDB')) { |
|
36 | 36 | define('NOREQUIREDB', '1'); |
37 | 37 | } |
38 | -if (! defined('NOREQUIRESOC')) { |
|
38 | +if (!defined('NOREQUIRESOC')) { |
|
39 | 39 | define('NOREQUIRESOC', '1'); |
40 | 40 | } |
41 | -if (! defined('NOREQUIRETRAN')) { |
|
41 | +if (!defined('NOREQUIRETRAN')) { |
|
42 | 42 | define('NOREQUIRETRAN', '1'); |
43 | 43 | } |
44 | -if (! defined('NOCSRFCHECK')) { |
|
44 | +if (!defined('NOCSRFCHECK')) { |
|
45 | 45 | define('NOCSRFCHECK', '1'); |
46 | 46 | } |
47 | -if (! defined('NOTOKENRENEWAL')) { |
|
47 | +if (!defined('NOTOKENRENEWAL')) { |
|
48 | 48 | define('NOTOKENRENEWAL', '1'); |
49 | 49 | } |
50 | -if (! defined('NOREQUIREMENU')) { |
|
50 | +if (!defined('NOREQUIREMENU')) { |
|
51 | 51 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
52 | 52 | } |
53 | -if (! defined('NOREQUIREHTML')) { |
|
53 | +if (!defined('NOREQUIREHTML')) { |
|
54 | 54 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
55 | 55 | } |
56 | -if (! defined('NOREQUIREAJAX')) { |
|
56 | +if (!defined('NOREQUIREAJAX')) { |
|
57 | 57 | define('NOREQUIREAJAX', '1'); |
58 | 58 | } |
59 | -if (! defined("NOLOGIN")) { |
|
60 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
59 | +if (!defined("NOLOGIN")) { |
|
60 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | parent::__construct($name); |
89 | 89 | |
90 | 90 | //$this->sharedFixture |
91 | - global $conf,$user,$langs,$db; |
|
92 | - $this->savconf=$conf; |
|
93 | - $this->savuser=$user; |
|
94 | - $this->savlangs=$langs; |
|
95 | - $this->savdb=$db; |
|
91 | + global $conf, $user, $langs, $db; |
|
92 | + $this->savconf = $conf; |
|
93 | + $this->savuser = $user; |
|
94 | + $this->savlangs = $langs; |
|
95 | + $this->savdb = $db; |
|
96 | 96 | |
97 | 97 | print __METHOD__." db->type=".$db->type." user->id=".$user->id; |
98 | 98 | //print " - db ".$db->db; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public static function setUpBeforeClass(): void |
108 | 108 | { |
109 | - global $conf,$user,$langs,$db; |
|
109 | + global $conf, $user, $langs, $db; |
|
110 | 110 | //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
111 | 111 | |
112 | 112 | print __METHOD__."\n"; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function tearDownAfterClass(): void |
121 | 121 | { |
122 | - global $conf,$user,$langs,$db; |
|
122 | + global $conf, $user, $langs, $db; |
|
123 | 123 | //$db->rollback(); |
124 | 124 | |
125 | 125 | print __METHOD__."\n"; |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function setUp(): void |
134 | 134 | { |
135 | - global $conf,$user,$langs,$db; |
|
136 | - $conf=$this->savconf; |
|
137 | - $user=$this->savuser; |
|
138 | - $langs=$this->savlangs; |
|
135 | + global $conf, $user, $langs, $db; |
|
136 | + $conf = $this->savconf; |
|
137 | + $user = $this->savuser; |
|
138 | + $langs = $this->savlangs; |
|
139 | 139 | //$db=$this->savdb; |
140 | 140 | |
141 | 141 | print __METHOD__."\n"; |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | public function testIsValidLuhn() |
162 | 162 | { |
163 | 163 | // Tests OK |
164 | - $this->assertTrue(isValidLuhn(972487086)); // int |
|
165 | - $this->assertTrue(isValidLuhn("972487086")); // string |
|
164 | + $this->assertTrue(isValidLuhn(972487086)); // int |
|
165 | + $this->assertTrue(isValidLuhn("972487086")); // string |
|
166 | 166 | // Tests KO |
167 | - $this->assertFalse(isValidLuhn(123456789)); // int |
|
168 | - $this->assertFalse(isValidLuhn("123456789")); // string |
|
167 | + $this->assertFalse(isValidLuhn(123456789)); // int |
|
168 | + $this->assertFalse(isValidLuhn("123456789")); // string |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | { |
180 | 180 | // Tests OK |
181 | 181 | $this->assertTrue(isValidSiren("732829320")); |
182 | - $this->assertTrue(isValidSiren(" 732 829 320 ")); // formatted with spaces |
|
182 | + $this->assertTrue(isValidSiren(" 732 829 320 ")); // formatted with spaces |
|
183 | 183 | // Tests NOK |
184 | - $this->assertFalse(isValidSiren("123456ABC")); // not numeric |
|
185 | - $this->assertFalse(isValidSiren("43336767")); // Luhn test OK but length != 9 |
|
186 | - $this->assertFalse(isValidSiren("123456789")); // 9 digits but Luhn test KO |
|
184 | + $this->assertFalse(isValidSiren("123456ABC")); // not numeric |
|
185 | + $this->assertFalse(isValidSiren("43336767")); // Luhn test OK but length != 9 |
|
186 | + $this->assertFalse(isValidSiren("123456789")); // 9 digits but Luhn test KO |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -197,12 +197,12 @@ discard block |
||
197 | 197 | { |
198 | 198 | // Tests OK |
199 | 199 | $this->assertTrue(isValidSiret("73282932000074")); |
200 | - $this->assertTrue(isValidSiret(" 732 829 320 00074 ")); // formatted with spaces |
|
201 | - $this->assertTrue(isValidSiret("35600000049837")); // Specific cases of "La Poste" companies |
|
200 | + $this->assertTrue(isValidSiret(" 732 829 320 00074 ")); // formatted with spaces |
|
201 | + $this->assertTrue(isValidSiret("35600000049837")); // Specific cases of "La Poste" companies |
|
202 | 202 | // Tests NOK |
203 | - $this->assertFalse(isValidSiret("123456ABC12345")); // not numeric |
|
204 | - $this->assertFalse(isValidSiret("3624679471379")); // Luhn test OK but length != 14 |
|
205 | - $this->assertFalse(isValidSiret("12345678912345")); // 14 digits but Luhn test KO |
|
203 | + $this->assertFalse(isValidSiret("123456ABC12345")); // not numeric |
|
204 | + $this->assertFalse(isValidSiret("3624679471379")); // Luhn test OK but length != 14 |
|
205 | + $this->assertFalse(isValidSiret("12345678912345")); // 14 digits but Luhn test KO |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | { |
217 | 217 | // Tests OK |
218 | 218 | $this->assertTrue(isValidTinForPT("123456789")); |
219 | - $this->assertTrue(isValidTinForPT(" 123 456 789 ")); // formatted with spaces |
|
219 | + $this->assertTrue(isValidTinForPT(" 123 456 789 ")); // formatted with spaces |
|
220 | 220 | // Tests NOK |
221 | - $this->assertFalse(isValidTinForPT("123456ABC")); // not numeric |
|
222 | - $this->assertFalse(isValidTinForPT("12345678")); // length != 9 |
|
221 | + $this->assertFalse(isValidTinForPT("123456ABC")); // not numeric |
|
222 | + $this->assertFalse(isValidTinForPT("12345678")); // length != 9 |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | { |
234 | 234 | // Tests OK |
235 | 235 | $this->assertTrue(isValidTinForDZ("123456789123456")); |
236 | - $this->assertTrue(isValidTinForDZ(" 12345 67891 23456 ")); // formatted with spaces |
|
236 | + $this->assertTrue(isValidTinForDZ(" 12345 67891 23456 ")); // formatted with spaces |
|
237 | 237 | // Tests NOK |
238 | - $this->assertFalse(isValidTinForDZ("123456789123ABC")); // not numeric |
|
239 | - $this->assertFalse(isValidTinForDZ("123456789123")); // length != 15 |
|
238 | + $this->assertFalse(isValidTinForDZ("123456789123ABC")); // not numeric |
|
239 | + $this->assertFalse(isValidTinForDZ("123456789123")); // length != 15 |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | $this->assertTrue(isValidTinForBE("0123.123.123")); |
253 | 253 | $this->assertTrue(isValidTinForBE("1234.123.123")); |
254 | 254 | // Tests NOK |
255 | - $this->assertFalse(isValidTinForBE("2345.123.123")); // First digit shall be 0 or 1 |
|
256 | - $this->assertFalse(isValidTinForBE("1234 123 123")); // formatted with spaces instead of dots |
|
257 | - $this->assertFalse(isValidTinForBE("1234123123")); // without dots formatting |
|
258 | - $this->assertFalse(isValidTinForBE("ABCD.123.123")); // not digits only |
|
255 | + $this->assertFalse(isValidTinForBE("2345.123.123")); // First digit shall be 0 or 1 |
|
256 | + $this->assertFalse(isValidTinForBE("1234 123 123")); // formatted with spaces instead of dots |
|
257 | + $this->assertFalse(isValidTinForBE("1234123123")); // without dots formatting |
|
258 | + $this->assertFalse(isValidTinForBE("ABCD.123.123")); // not digits only |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | // TODO |