@@ -144,38 +144,38 @@ discard block |
||
144 | 144 | $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth'); |
145 | 145 | $search_date_start_startyear = GETPOSTINT('search_date_start_startyear'); |
146 | 146 | $search_date_start_startday = GETPOSTINT('search_date_start_startday'); |
147 | -$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
147 | +$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
148 | 148 | $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth'); |
149 | 149 | $search_date_start_endyear = GETPOSTINT('search_date_start_endyear'); |
150 | 150 | $search_date_start_endday = GETPOSTINT('search_date_start_endday'); |
151 | -$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
151 | +$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
152 | 152 | |
153 | 153 | $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); |
154 | 154 | $search_date_end_startyear = GETPOSTINT('search_date_end_startyear'); |
155 | 155 | $search_date_end_startday = GETPOSTINT('search_date_end_startday'); |
156 | -$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
156 | +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
157 | 157 | $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); |
158 | 158 | $search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); |
159 | 159 | $search_date_end_endday = GETPOSTINT('search_date_end_endday'); |
160 | -$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
160 | +$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
161 | 161 | |
162 | 162 | $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
163 | 163 | $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
164 | 164 | $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
165 | -$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
165 | +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
166 | 166 | $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
167 | 167 | $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
168 | 168 | $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
169 | -$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
169 | +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
170 | 170 | |
171 | 171 | $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); |
172 | 172 | $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); |
173 | 173 | $search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); |
174 | -$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
174 | +$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
175 | 175 | $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); |
176 | 176 | $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); |
177 | 177 | $search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); |
178 | -$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
178 | +$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
179 | 179 | |
180 | 180 | $search_category_array = array(); |
181 | 181 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | if ($searchCategoryProjectOperator == 0) { |
677 | 677 | $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")"; |
678 | 678 | } else { |
679 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); |
|
679 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject); |
|
680 | 680 | } |
681 | 681 | } |
682 | 682 | } |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); |
873 | 873 | } |
874 | 874 | if ($search_date_end_end) { |
875 | - $param .= '&search_date_end_end=' . urlencode($search_date_end_end); |
|
875 | + $param .= '&search_date_end_end='.urlencode($search_date_end_end); |
|
876 | 876 | } |
877 | 877 | if ($search_date_creation_startmonth) { |
878 | 878 | $param .= '&search_date_creation_startmonth='.urlencode($search_date_creation_startmonth); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $param .= '&search_date_modif_endday='.urlencode($search_date_modif_endday); |
921 | 921 | } |
922 | 922 | if ($search_date_modif_end) { |
923 | - $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); |
|
923 | + $param .= '&search_date_modif_end='.urlencode($search_date_modif_end); |
|
924 | 924 | } |
925 | 925 | if ($socid) { |
926 | 926 | $param .= '&socid='.urlencode($socid); |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | |
32 | 32 | // Load Dolibarr environment |
33 | 33 | require '../../main.inc.php'; |
34 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
41 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
42 | 42 | |
43 | 43 | // Load translation files required by the page |
44 | 44 | $langsLoad = array('projects', 'bills', 'orders', 'companies'); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
166 | 166 | } |
167 | 167 | |
168 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
168 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
169 | 169 | |
170 | 170 | // Purge search criteria |
171 | 171 | 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 |
@@ -351,10 +351,10 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
354 | - $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
354 | + $object->fetchTimeSpent(GETPOSTINT('lineid')); // load properties like $object->timespent_xxx |
|
355 | 355 | |
356 | 356 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
357 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
357 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
358 | 358 | |
359 | 359 | if ($result < 0) { |
360 | 360 | $langs->load("errors"); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | if (count($tasksarray) > 0) { |
375 | 375 | $id = $tasksarray[0]->id; |
376 | 376 | } else { |
377 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
377 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
378 | 378 | exit; |
379 | 379 | } |
380 | 380 | } |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | if (!($projectstatic->thirdparty->id > 0)) { |
412 | 412 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
413 | 413 | } else { |
414 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
415 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
416 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
414 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
415 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
416 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
417 | 417 | |
418 | 418 | $tmpinvoice = new Facture($db); |
419 | 419 | $tmptimespent = new Task($db); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | $arrayoftasks = array(); |
479 | 479 | foreach ($toselect as $key => $value) { |
480 | 480 | // Get userid, timepent |
481 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
481 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
482 | 482 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
483 | 483 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
484 | 484 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | } |
551 | 551 | |
552 | 552 | // Add lines |
553 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
553 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
554 | 554 | if ($lineid < 0) { |
555 | 555 | $error++; |
556 | 556 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -583,16 +583,16 @@ discard block |
||
583 | 583 | |
584 | 584 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
585 | 585 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
586 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
586 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
587 | 587 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
588 | 588 | |
589 | 589 | if (!empty($withdetail)) { |
590 | 590 | if (!empty($object->timespent_withhour)) { |
591 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
591 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
592 | 592 | } else { |
593 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
593 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
594 | 594 | } |
595 | - $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)); |
|
595 | + $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)); |
|
596 | 596 | } |
597 | 597 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
598 | 598 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $arrayoftasks = array(); |
671 | 671 | foreach ($toselect as $key => $value) { |
672 | 672 | // Get userid, timepent |
673 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
673 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
674 | 674 | // $object->id is now the task id |
675 | 675 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
676 | 676 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | // Add lines |
747 | 747 | $date_start = ''; |
748 | 748 | $date_end = ''; |
749 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
749 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
750 | 750 | $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); |
751 | 751 | if ($lineid < 0) { |
752 | 752 | $error++; |
@@ -756,8 +756,8 @@ discard block |
||
756 | 756 | |
757 | 757 | if (!$error) { |
758 | 758 | // Update lineid into line of timespent |
759 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
760 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(implode(',', $toselect)) . ')'; |
|
759 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
760 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).')'; |
|
761 | 761 | $result = $db->query($sql); |
762 | 762 | if (!$result) { |
763 | 763 | $error++; |
@@ -795,12 +795,12 @@ discard block |
||
795 | 795 | if (!($projectstatic->thirdparty->id > 0)) { |
796 | 796 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
797 | 797 | } else { |
798 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
799 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
800 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
798 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
799 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
800 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
801 | 801 | |
802 | 802 | |
803 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
803 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
804 | 804 | $tmpinter = new Fichinter($db); |
805 | 805 | $tmptimespent = new Task($db); |
806 | 806 | $fuser = new User($db); |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | $tmpinter->socid = $projectstatic->thirdparty->id; |
813 | 813 | $tmpinter->date = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); |
814 | 814 | $tmpinter->fk_project = $projectstatic->id; |
815 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
815 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
816 | 816 | |
817 | 817 | if ($interToUse) { |
818 | 818 | $tmpinter->fetch($interToUse); |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
846 | 846 | |
847 | 847 | // Add lines |
848 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
848 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
849 | 849 | } |
850 | 850 | } |
851 | 851 | |
@@ -876,9 +876,9 @@ discard block |
||
876 | 876 | //$result = $projectstatic->fetch($object->fk_project); |
877 | 877 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
878 | 878 | |
879 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
879 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
880 | 880 | if (!empty($withproject)) { |
881 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
881 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
882 | 882 | } |
883 | 883 | $help_url = ''; |
884 | 884 | |
@@ -927,13 +927,13 @@ discard block |
||
927 | 927 | |
928 | 928 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
929 | 929 | if ($search_user) { |
930 | - $param .= '&search_user=' . ((int) $search_user); |
|
930 | + $param .= '&search_user='.((int) $search_user); |
|
931 | 931 | } |
932 | 932 | if ($search_month) { |
933 | - $param .= '&search_month=' . ((int) $search_month); |
|
933 | + $param .= '&search_month='.((int) $search_month); |
|
934 | 934 | } |
935 | 935 | if ($search_year) { |
936 | - $param .= '&search_year=' . ((int) $search_year); |
|
936 | + $param .= '&search_year='.((int) $search_year); |
|
937 | 937 | } |
938 | 938 | |
939 | 939 | // Project card |
@@ -945,14 +945,14 @@ discard block |
||
945 | 945 | $morehtmlref .= $projectstatic->title; |
946 | 946 | // Thirdparty |
947 | 947 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
948 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
948 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
949 | 949 | } |
950 | 950 | $morehtmlref .= '</div>'; |
951 | 951 | |
952 | 952 | // Define a complementary filter for search of next/prev ref. |
953 | 953 | if (!$user->hasRight('projet', 'all', 'lire')) { |
954 | 954 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
955 | - $projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; |
|
955 | + $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; |
|
956 | 956 | } |
957 | 957 | |
958 | 958 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -970,25 +970,25 @@ discard block |
||
970 | 970 | print '</td>'; |
971 | 971 | print '<td>'; |
972 | 972 | if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { |
973 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
973 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
974 | 974 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
975 | 975 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
976 | 976 | print '<br>'; |
977 | 977 | } |
978 | 978 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
979 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
979 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
980 | 980 | $htmltext = $langs->trans("ProjectFollowTasks"); |
981 | 981 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
982 | 982 | print '<br>'; |
983 | 983 | } |
984 | 984 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
985 | - 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"' : '')) . '"> '; |
|
985 | + 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 | 986 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
987 | 987 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
988 | 988 | print '<br>'; |
989 | 989 | } |
990 | 990 | if (isModEnabled('eventorganization')) { |
991 | - 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"' : '')) . '"> '; |
|
991 | + 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 | 992 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
993 | 993 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
994 | 994 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | } |
997 | 997 | |
998 | 998 | // Visibility |
999 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
999 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1000 | 1000 | if ($projectstatic->public) { |
1001 | 1001 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1002 | 1002 | print $langs->trans('SharedProject'); |
@@ -1007,14 +1007,14 @@ discard block |
||
1007 | 1007 | print '</td></tr>'; |
1008 | 1008 | |
1009 | 1009 | // Budget |
1010 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1010 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1011 | 1011 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1012 | - print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1012 | + print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1013 | 1013 | } |
1014 | 1014 | print '</td></tr>'; |
1015 | 1015 | |
1016 | 1016 | // Date start - end project |
1017 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1017 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1018 | 1018 | $start = dol_print_date($projectstatic->date_start, 'day'); |
1019 | 1019 | print($start ? $start : '?'); |
1020 | 1020 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | $cols = 2; |
1030 | 1030 | $savobject = $object; |
1031 | 1031 | $object = $projectstatic; |
1032 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1032 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1033 | 1033 | $object = $savobject; |
1034 | 1034 | |
1035 | 1035 | print '</table>'; |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | |
1048 | 1048 | // Categories |
1049 | 1049 | if (isModEnabled('category')) { |
1050 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1050 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1051 | 1051 | print $form->showCategories($projectstatic->id, 'project', 1); |
1052 | 1052 | print "</td></tr>"; |
1053 | 1053 | } |
@@ -1076,12 +1076,12 @@ discard block |
||
1076 | 1076 | |
1077 | 1077 | if (!empty($projectidforalltimes)) { |
1078 | 1078 | // We are on tab 'Time Spent' of project |
1079 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1080 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1079 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1080 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1081 | 1081 | } else { |
1082 | 1082 | // We are on tab 'Time Spent' of task |
1083 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1084 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1083 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1084 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1085 | 1085 | } |
1086 | 1086 | } else { |
1087 | 1087 | $linktocreatetimeBtnStatus = -2; |
@@ -1126,19 +1126,19 @@ discard block |
||
1126 | 1126 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1127 | 1127 | |
1128 | 1128 | if ($action == 'deleteline') { |
1129 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
1129 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1130 | 1130 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1131 | 1131 | } |
1132 | 1132 | |
1133 | 1133 | $param = ($withproject ? '&withproject=1' : ''); |
1134 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1135 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1134 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1135 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1136 | 1136 | |
1137 | 1137 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1138 | 1138 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1139 | - $object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
1139 | + $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; |
|
1140 | 1140 | } else { |
1141 | - $object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id); |
|
1141 | + $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); |
|
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | $morehtmlref = ''; |
@@ -1146,12 +1146,12 @@ discard block |
||
1146 | 1146 | // Project |
1147 | 1147 | if (empty($withproject)) { |
1148 | 1148 | $morehtmlref .= '<div class="refidno">'; |
1149 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
1149 | + $morehtmlref .= $langs->trans("Project").': '; |
|
1150 | 1150 | $morehtmlref .= $projectstatic->getNomUrl(1); |
1151 | 1151 | $morehtmlref .= '<br>'; |
1152 | 1152 | |
1153 | 1153 | // Third party |
1154 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1154 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1155 | 1155 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1156 | 1156 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1157 | 1157 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | print '<table class="border centpercent tableforfield">'; |
1168 | 1168 | |
1169 | 1169 | // Task parent |
1170 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1170 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1171 | 1171 | if ($object->fk_task_parent > 0) { |
1172 | 1172 | $tasktmp = new Task($db); |
1173 | 1173 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | print '</td></tr>'; |
1177 | 1177 | |
1178 | 1178 | // Date start - Date end task |
1179 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1179 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1180 | 1180 | $start = dol_print_date($object->date_start, 'dayhour'); |
1181 | 1181 | print($start ? $start : '?'); |
1182 | 1182 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | print '</td></tr>'; |
1189 | 1189 | |
1190 | 1190 | // Planned workload |
1191 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1191 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1192 | 1192 | if ($object->planned_workload) { |
1193 | 1193 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1194 | 1194 | } |
@@ -1203,21 +1203,21 @@ discard block |
||
1203 | 1203 | print '<table class="border tableforfield centpercent">'; |
1204 | 1204 | |
1205 | 1205 | // Progress declared |
1206 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1207 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1206 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1207 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
1208 | 1208 | print '</td></tr>'; |
1209 | 1209 | |
1210 | 1210 | // Progress calculated |
1211 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1211 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1212 | 1212 | if ($object->planned_workload) { |
1213 | 1213 | $tmparray = $object->getSummaryOfTimeSpent(); |
1214 | 1214 | if ($tmparray['total_duration'] > 0) { |
1215 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1215 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1216 | 1216 | } else { |
1217 | 1217 | print '0 %'; |
1218 | 1218 | } |
1219 | 1219 | } else { |
1220 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1220 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1221 | 1221 | } |
1222 | 1222 | print '</td>'; |
1223 | 1223 | |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | print dol_get_fiche_end(); |
1234 | 1234 | } else { |
1235 | 1235 | if ($action == 'deleteline') { |
1236 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); |
|
1236 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOSTINT("lineid").($withproject ? '&withproject=1' : ''); |
|
1237 | 1237 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1238 | 1238 | } |
1239 | 1239 | } |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | |
1248 | 1248 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1249 | 1249 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1250 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
1250 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOSTINT('lineid').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
|
1251 | 1251 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1252 | 1252 | } |
1253 | 1253 | |
@@ -1266,10 +1266,10 @@ discard block |
||
1266 | 1266 | // Definition of fields for list |
1267 | 1267 | $arrayfields = array(); |
1268 | 1268 | $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1); |
1269 | - $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1); |
|
1269 | + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1', 'checked' => 1); |
|
1270 | 1270 | $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); |
1271 | 1271 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1272 | - if (! empty($allprojectforuser)) { |
|
1272 | + if (!empty($allprojectforuser)) { |
|
1273 | 1273 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1274 | 1274 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1275 | 1275 | } |
@@ -1285,82 +1285,82 @@ discard block |
||
1285 | 1285 | $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries")); |
1286 | 1286 | $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)); |
1287 | 1287 | // Extra fields |
1288 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1288 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1289 | 1289 | |
1290 | 1290 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
1291 | 1291 | |
1292 | 1292 | $param = ''; |
1293 | 1293 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1294 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
1294 | + $param .= '&contextpage='.urlencode($contextpage); |
|
1295 | 1295 | } |
1296 | 1296 | if ($limit > 0 && $limit != $conf->liste_limit) { |
1297 | 1297 | $param .= '&limit='.((int) $limit); |
1298 | 1298 | } |
1299 | 1299 | if ($search_month > 0) { |
1300 | - $param .= '&search_month=' . urlencode($search_month); |
|
1300 | + $param .= '&search_month='.urlencode($search_month); |
|
1301 | 1301 | } |
1302 | 1302 | if ($search_year > 0) { |
1303 | - $param .= '&search_year=' . urlencode($search_year); |
|
1303 | + $param .= '&search_year='.urlencode($search_year); |
|
1304 | 1304 | } |
1305 | 1305 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1306 | 1306 | $param .= '&search_user='.urlencode($search_user); |
1307 | 1307 | } |
1308 | 1308 | if ($search_task_ref != '') { |
1309 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1309 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1310 | 1310 | } |
1311 | 1311 | if ($search_company != '') { |
1312 | - $param .= '&$search_company=' . urlencode($search_company); |
|
1312 | + $param .= '&$search_company='.urlencode($search_company); |
|
1313 | 1313 | } |
1314 | 1314 | if ($search_company_alias != '') { |
1315 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1315 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1316 | 1316 | } |
1317 | 1317 | if ($search_project_ref != '') { |
1318 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1318 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1319 | 1319 | } |
1320 | 1320 | if ($search_project_label != '') { |
1321 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1321 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1322 | 1322 | } |
1323 | 1323 | if ($search_task_label != '') { |
1324 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1324 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
1325 | 1325 | } |
1326 | 1326 | if ($search_note != '') { |
1327 | - $param .= '&search_note=' . urlencode($search_note); |
|
1327 | + $param .= '&search_note='.urlencode($search_note); |
|
1328 | 1328 | } |
1329 | 1329 | if ($search_duration != '') { |
1330 | - $param .= '&search_field2=' . urlencode($search_duration); |
|
1330 | + $param .= '&search_field2='.urlencode($search_duration); |
|
1331 | 1331 | } |
1332 | 1332 | if ($optioncss != '') { |
1333 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1333 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1334 | 1334 | } |
1335 | 1335 | if ($search_date_startday) { |
1336 | - $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
1336 | + $param .= '&search_date_startday='.urlencode($search_date_startday); |
|
1337 | 1337 | } |
1338 | 1338 | if ($search_date_startmonth) { |
1339 | - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
1339 | + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
|
1340 | 1340 | } |
1341 | 1341 | if ($search_date_startyear) { |
1342 | - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
1342 | + $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
|
1343 | 1343 | } |
1344 | 1344 | if ($search_date_endday) { |
1345 | - $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
1345 | + $param .= '&search_date_endday='.urlencode($search_date_endday); |
|
1346 | 1346 | } |
1347 | 1347 | if ($search_date_endmonth) { |
1348 | - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
1348 | + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
|
1349 | 1349 | } |
1350 | 1350 | if ($search_date_endyear) { |
1351 | - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
1351 | + $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
|
1352 | 1352 | } |
1353 | 1353 | if ($search_timespent_starthour) { |
1354 | - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
1354 | + $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
|
1355 | 1355 | } |
1356 | 1356 | if ($search_timespent_startmin) { |
1357 | - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
1357 | + $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
|
1358 | 1358 | } |
1359 | 1359 | if ($search_timespent_endhour) { |
1360 | - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
1360 | + $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
|
1361 | 1361 | } |
1362 | 1362 | if ($search_timespent_endmin) { |
1363 | - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
1363 | + $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
|
1364 | 1364 | } |
1365 | 1365 | |
1366 | 1366 | /* |
@@ -1368,24 +1368,24 @@ discard block |
||
1368 | 1368 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1369 | 1369 | */ |
1370 | 1370 | if ($id) { |
1371 | - $param .= '&id=' . urlencode($id); |
|
1371 | + $param .= '&id='.urlencode($id); |
|
1372 | 1372 | } |
1373 | 1373 | if ($projectid) { |
1374 | - $param .= '&projectid=' . urlencode($projectid); |
|
1374 | + $param .= '&projectid='.urlencode($projectid); |
|
1375 | 1375 | } |
1376 | 1376 | if ($withproject) { |
1377 | - $param .= '&withproject=' . urlencode($withproject); |
|
1377 | + $param .= '&withproject='.urlencode($withproject); |
|
1378 | 1378 | } |
1379 | 1379 | // Add $param from hooks |
1380 | 1380 | $parameters = array(); |
1381 | 1381 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
1382 | 1382 | $param .= $hookmanager->resPrint; |
1383 | 1383 | |
1384 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1384 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1385 | 1385 | if ($optioncss != '') { |
1386 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1386 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1387 | 1387 | } |
1388 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1388 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1389 | 1389 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1390 | 1390 | if ($action == 'editline') { |
1391 | 1391 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1400,13 +1400,13 @@ discard block |
||
1400 | 1400 | } else { |
1401 | 1401 | print '<input type="hidden" name="action" value="list">'; |
1402 | 1402 | } |
1403 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1404 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1403 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1404 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1405 | 1405 | |
1406 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1407 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1408 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1409 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1406 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1407 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1408 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1409 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1410 | 1410 | print '<input type="hidden" name="page_y" value="">'; |
1411 | 1411 | |
1412 | 1412 | // Form to convert time spent into invoice |
@@ -1433,7 +1433,7 @@ discard block |
||
1433 | 1433 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1434 | 1434 | ); |
1435 | 1435 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1436 | - print "\n" . '<script type="text/javascript">'; |
|
1436 | + print "\n".'<script type="text/javascript">'; |
|
1437 | 1437 | print ' |
1438 | 1438 | $(document).ready(function () { |
1439 | 1439 | setDetailVisibility(); |
@@ -1450,8 +1450,8 @@ discard block |
||
1450 | 1450 | } |
1451 | 1451 | }); |
1452 | 1452 | '; |
1453 | - print '</script>' . "\n"; |
|
1454 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1453 | + print '</script>'."\n"; |
|
1454 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1455 | 1455 | print '</td>'; |
1456 | 1456 | print '</tr>'; |
1457 | 1457 | |
@@ -1486,14 +1486,14 @@ discard block |
||
1486 | 1486 | |
1487 | 1487 | print '<br>'; |
1488 | 1488 | print '<div class="center">'; |
1489 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1490 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1489 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1490 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1491 | 1491 | print '</div>'; |
1492 | 1492 | print '<br>'; |
1493 | 1493 | } else { |
1494 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1494 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1495 | 1495 | print '<div class="center">'; |
1496 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1496 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1497 | 1497 | print '</div>'; |
1498 | 1498 | $massaction = ''; |
1499 | 1499 | } |
@@ -1506,7 +1506,7 @@ discard block |
||
1506 | 1506 | print '<table class="noborder centpercent">'; |
1507 | 1507 | print '<tr>'; |
1508 | 1508 | print '<td class="titlefield">'; |
1509 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1509 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1510 | 1510 | print '</td>'; |
1511 | 1511 | print '<td>'; |
1512 | 1512 | $forminter = new FormIntervention($db); |
@@ -1516,14 +1516,14 @@ discard block |
||
1516 | 1516 | print '</table>'; |
1517 | 1517 | |
1518 | 1518 | print '<div class="center">'; |
1519 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1520 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1519 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1520 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1521 | 1521 | print '</div>'; |
1522 | 1522 | print '<br>'; |
1523 | 1523 | } else { |
1524 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1524 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1525 | 1525 | print '<div class="center">'; |
1526 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1526 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1527 | 1527 | print '</div>'; |
1528 | 1528 | $massaction = ''; |
1529 | 1529 | } |
@@ -1585,14 +1585,14 @@ discard block |
||
1585 | 1585 | $sql .= " AND t.fk_element =".((int) $object->id); |
1586 | 1586 | } elseif (!empty($projectidforalltimes)) { |
1587 | 1587 | // Limit on one project |
1588 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1588 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
1589 | 1589 | } elseif (!empty($allprojectforuser)) { |
1590 | 1590 | // Limit on on user |
1591 | 1591 | if (empty($search_user)) { |
1592 | 1592 | $search_user = $user->id; |
1593 | 1593 | } |
1594 | 1594 | if ($search_user > 0) { |
1595 | - $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1595 | + $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1596 | 1596 | } |
1597 | 1597 | } |
1598 | 1598 | |
@@ -1645,13 +1645,13 @@ discard block |
||
1645 | 1645 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1646 | 1646 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1647 | 1647 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1648 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1648 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1649 | 1649 | } |
1650 | 1650 | |
1651 | 1651 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1652 | 1652 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1653 | 1653 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1654 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1654 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1655 | 1655 | } |
1656 | 1656 | } |
1657 | 1657 | |
@@ -1699,13 +1699,13 @@ discard block |
||
1699 | 1699 | |
1700 | 1700 | if ($num >= 0) { |
1701 | 1701 | if (!empty($projectidforalltimes)) { |
1702 | - print '<!-- List of time spent for project -->' . "\n"; |
|
1702 | + print '<!-- List of time spent for project -->'."\n"; |
|
1703 | 1703 | |
1704 | 1704 | $title = $langs->trans("ListTaskTimeUserProject"); |
1705 | 1705 | |
1706 | 1706 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1707 | 1707 | } else { |
1708 | - print '<!-- List of time spent -->' . "\n"; |
|
1708 | + print '<!-- List of time spent -->'."\n"; |
|
1709 | 1709 | |
1710 | 1710 | $title = $langs->trans("ListTaskTimeForTask"); |
1711 | 1711 | |
@@ -1727,26 +1727,26 @@ discard block |
||
1727 | 1727 | * Form to add a new line of time spent |
1728 | 1728 | */ |
1729 | 1729 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
1730 | - print '<!-- table to add time spent -->' . "\n"; |
|
1730 | + print '<!-- table to add time spent -->'."\n"; |
|
1731 | 1731 | if (!empty($id)) { |
1732 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1732 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1733 | 1733 | } |
1734 | 1734 | |
1735 | 1735 | 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 |
1736 | 1736 | print '<table class="noborder nohover centpercent">'; |
1737 | 1737 | |
1738 | 1738 | print '<tr class="liste_titre">'; |
1739 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
1739 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
1740 | 1740 | if (!empty($allprojectforuser)) { |
1741 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
1741 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
1742 | 1742 | } |
1743 | 1743 | if (empty($id)) { |
1744 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
1744 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
1745 | 1745 | } |
1746 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
1747 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
1748 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1749 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1746 | + print '<td>'.$langs->trans("By").'</td>'; |
|
1747 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
1748 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1749 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1750 | 1750 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
1751 | 1751 | print '<td></td>'; |
1752 | 1752 | |
@@ -1800,14 +1800,14 @@ discard block |
||
1800 | 1800 | print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
1801 | 1801 | } else { |
1802 | 1802 | if ($nboftasks) { |
1803 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1803 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1804 | 1804 | } |
1805 | 1805 | } |
1806 | 1806 | print '</td>'; |
1807 | 1807 | |
1808 | 1808 | // Note |
1809 | 1809 | print '<td>'; |
1810 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1810 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1811 | 1811 | print '</td>'; |
1812 | 1812 | |
1813 | 1813 | // Duration - Time spent |
@@ -1875,7 +1875,7 @@ discard block |
||
1875 | 1875 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1876 | 1876 | |
1877 | 1877 | print '<div class="div-table-responsive">'; |
1878 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1878 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1879 | 1879 | |
1880 | 1880 | // Fields title search |
1881 | 1881 | // -------------------------------------------------------------------- |
@@ -1900,20 +1900,20 @@ discard block |
||
1900 | 1900 | } |
1901 | 1901 | // Thirdparty |
1902 | 1902 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1903 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1903 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1904 | 1904 | } |
1905 | 1905 | |
1906 | 1906 | // Thirdparty alias |
1907 | 1907 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
1908 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1908 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1909 | 1909 | } |
1910 | 1910 | |
1911 | 1911 | if (!empty($allprojectforuser)) { |
1912 | 1912 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
1913 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1913 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1914 | 1914 | } |
1915 | 1915 | if (!empty($arrayfields['p.project_label']['checked'])) { |
1916 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1916 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1917 | 1917 | } |
1918 | 1918 | } |
1919 | 1919 | // Task |
@@ -1931,7 +1931,7 @@ discard block |
||
1931 | 1931 | } |
1932 | 1932 | // Note |
1933 | 1933 | if (!empty($arrayfields['t.note']['checked'])) { |
1934 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1934 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1935 | 1935 | } |
1936 | 1936 | // Duration |
1937 | 1937 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1943 | 1943 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1944 | 1944 | } |
1945 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1945 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1946 | 1946 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1947 | 1947 | print '</div>'; |
1948 | 1948 | |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1951 | 1951 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1952 | 1952 | } |
1953 | - print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
1953 | + print '<div class="nowraponall">'.$langs->trans('at').' '; |
|
1954 | 1954 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1955 | 1955 | print '</div>'; |
1956 | 1956 | |
@@ -1966,7 +1966,7 @@ discard block |
||
1966 | 1966 | } |
1967 | 1967 | // Value billed |
1968 | 1968 | if (!empty($arrayfields['valuebilled']['checked'])) { |
1969 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
1969 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
1970 | 1970 | } |
1971 | 1971 | |
1972 | 1972 | /* |
@@ -1984,7 +1984,7 @@ discard block |
||
1984 | 1984 | print $searchpicto; |
1985 | 1985 | print '</td>'; |
1986 | 1986 | } |
1987 | - print '</tr>' . "\n"; |
|
1987 | + print '</tr>'."\n"; |
|
1988 | 1988 | |
1989 | 1989 | $totalarray = array(); |
1990 | 1990 | $totalarray['nbfield'] = 0; |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2095 | 2095 | print '<td class="center nowraponall">'; |
2096 | 2096 | if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { |
2097 | - print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">'; |
|
2097 | + print '<input type="hidden" name="lineid" value="'.GETPOSTINT('lineid').'">'; |
|
2098 | 2098 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2099 | 2099 | print '<br>'; |
2100 | 2100 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2102,7 +2102,7 @@ discard block |
||
2102 | 2102 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2103 | 2103 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2104 | 2104 | print ' '; |
2105 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2105 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2106 | 2106 | print img_split('', 'class="pictofixedwidth"'); |
2107 | 2107 | print '</a>'; |
2108 | 2108 | } |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | $selected = 1; |
2122 | 2122 | } |
2123 | 2123 | print ' '; |
2124 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2124 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2125 | 2125 | } |
2126 | 2126 | } |
2127 | 2127 | } |
@@ -2239,7 +2239,7 @@ discard block |
||
2239 | 2239 | } |
2240 | 2240 | } |
2241 | 2241 | } elseif ($action !== 'createtime') { |
2242 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2242 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2243 | 2243 | } |
2244 | 2244 | |
2245 | 2245 | // Task label |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2270 | 2270 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
2271 | 2271 | } else { |
2272 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2272 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2273 | 2273 | } |
2274 | 2274 | } else { |
2275 | 2275 | $userstatic->id = $task_time->fk_user; |
@@ -2289,7 +2289,7 @@ discard block |
||
2289 | 2289 | if (!empty($arrayfields['t.note']['checked'])) { |
2290 | 2290 | if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2291 | 2291 | print '<td class="small">'; |
2292 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2292 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2293 | 2293 | print '</td>'; |
2294 | 2294 | } else { |
2295 | 2295 | print '<td class="small tdoverflowmax150 classfortooltip" title="'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($task_time->note)).'">'; |
@@ -2300,7 +2300,7 @@ discard block |
||
2300 | 2300 | $totalarray['nbfield']++; |
2301 | 2301 | } |
2302 | 2302 | } elseif ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2303 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2303 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2304 | 2304 | } |
2305 | 2305 | |
2306 | 2306 | // Time spent |
@@ -2361,7 +2361,7 @@ discard block |
||
2361 | 2361 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2362 | 2362 | |
2363 | 2363 | print '<td class="nowraponall right">'; |
2364 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2364 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2365 | 2365 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2366 | 2366 | print '</span>'; |
2367 | 2367 | print '</td>'; |
@@ -2412,7 +2412,7 @@ discard block |
||
2412 | 2412 | print $langs->trans("No"); |
2413 | 2413 | } |
2414 | 2414 | } else { |
2415 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2415 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2416 | 2416 | } |
2417 | 2417 | } |
2418 | 2418 | print '</td>'; |
@@ -2443,7 +2443,7 @@ discard block |
||
2443 | 2443 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2444 | 2444 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2445 | 2445 | print ' '; |
2446 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2446 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2447 | 2447 | print img_split('', 'class="pictofixedwidth"'); |
2448 | 2448 | print '</a>'; |
2449 | 2449 | } |
@@ -2462,7 +2462,7 @@ discard block |
||
2462 | 2462 | $selected = 1; |
2463 | 2463 | } |
2464 | 2464 | print ' '; |
2465 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2465 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2466 | 2466 | } |
2467 | 2467 | } |
2468 | 2468 | } |
@@ -2552,7 +2552,7 @@ discard block |
||
2552 | 2552 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2553 | 2553 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2554 | 2554 | } else { |
2555 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2555 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2556 | 2556 | } |
2557 | 2557 | } else { |
2558 | 2558 | $userstatic->id = $task_time->fk_user; |
@@ -2569,13 +2569,13 @@ discard block |
||
2569 | 2569 | if (!empty($arrayfields['t.note']['checked'])) { |
2570 | 2570 | print '<td class="tdoverflowmax300">'; |
2571 | 2571 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2572 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2572 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2573 | 2573 | } else { |
2574 | 2574 | print dol_nl2br($task_time->note); |
2575 | 2575 | } |
2576 | 2576 | print '</td>'; |
2577 | 2577 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2578 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2578 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2579 | 2579 | } |
2580 | 2580 | |
2581 | 2581 | // Time spent |
@@ -2708,7 +2708,7 @@ discard block |
||
2708 | 2708 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2709 | 2709 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2710 | 2710 | } else { |
2711 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2711 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2712 | 2712 | } |
2713 | 2713 | } else { |
2714 | 2714 | $userstatic->id = $task_time->fk_user; |
@@ -2725,13 +2725,13 @@ discard block |
||
2725 | 2725 | if (!empty($arrayfields['t.note']['checked'])) { |
2726 | 2726 | print '<td class="small tdoverflowmax300"">'; |
2727 | 2727 | if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2728 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2728 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2729 | 2729 | } else { |
2730 | 2730 | print dol_nl2br($task_time->note); |
2731 | 2731 | } |
2732 | 2732 | print '</td>'; |
2733 | 2733 | } elseif ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { |
2734 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2734 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2735 | 2735 | } |
2736 | 2736 | |
2737 | 2737 | // Time spent |
@@ -2803,14 +2803,14 @@ discard block |
||
2803 | 2803 | $i++; |
2804 | 2804 | if ($i == 1) { |
2805 | 2805 | if ($num < $limit && empty($offset)) { |
2806 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2806 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2807 | 2807 | } else { |
2808 | 2808 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2809 | 2809 | } |
2810 | 2810 | } elseif (isset($totalarray['totaldurationfield']) && $totalarray['totaldurationfield'] == $i) { |
2811 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2811 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2812 | 2812 | } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { |
2813 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2813 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2814 | 2814 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2815 | 2815 | } else { |
2816 | 2816 | print '<td></td>'; |
@@ -2826,8 +2826,8 @@ discard block |
||
2826 | 2826 | $totalnboffields++; |
2827 | 2827 | } |
2828 | 2828 | } |
2829 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2830 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2829 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2830 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2831 | 2831 | print '</td></tr>'; |
2832 | 2832 | } |
2833 | 2833 |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft); |
139 | 139 | |
140 | 140 | // Common permissions |
141 | -$usercanread = ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire")); |
|
141 | +$usercanread = ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire")); |
|
142 | 142 | $usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
143 | 143 | $usercandelete = (($user->hasRight("fournisseur", "commande", "supprimer") || $user->hasRight("supplier_order", "supprimer")) || ($usercancreate && isset($object->statut) && $object->statut == $object::STATUS_DRAFT)); |
144 | 144 | |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | $usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_order_advance", "validate"))); |
147 | 147 | |
148 | 148 | // Additional area permissions |
149 | -$usercanapprove = $user->hasRight("fournisseur", "commande", "approuver"); |
|
150 | -$usercanapprovesecond = $user->hasRight("fournisseur", "commande", "approve2"); |
|
151 | -$usercanorder = $user->hasRight("fournisseur", "commande", "commander"); |
|
149 | +$usercanapprove = $user->hasRight("fournisseur", "commande", "approuver"); |
|
150 | +$usercanapprovesecond = $user->hasRight("fournisseur", "commande", "approve2"); |
|
151 | +$usercanorder = $user->hasRight("fournisseur", "commande", "commander"); |
|
152 | 152 | if (empty($conf->reception->enabled)) { |
153 | 153 | $usercanreceive = $user->hasRight("fournisseur", "commande", "receptionner"); |
154 | 154 | } else { |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | |
158 | 158 | // Permissions for includes |
159 | 159 | $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
160 | -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
161 | -$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php |
|
160 | +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
161 | +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php |
|
162 | 162 | $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
163 | 163 | |
164 | 164 | // Project permission |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $idprod = GETPOSTINT('idprod'); |
437 | 437 | } |
438 | 438 | |
439 | - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
439 | + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
440 | 440 | |
441 | 441 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
442 | 442 | $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
1241 | 1241 | $object->fk_account = GETPOSTINT('fk_account'); |
1242 | 1242 | $object->note_private = GETPOST('note_private', 'restricthtml'); |
1243 | - $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1243 | + $object->note_public = GETPOST('note_public', 'restricthtml'); |
|
1244 | 1244 | $object->delivery_date = $datelivraison; |
1245 | 1245 | $object->fk_incoterms = GETPOSTINT('incoterm_id'); |
1246 | 1246 | $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); |
1632 | 1632 | $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); |
1633 | 1633 | $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); |
1634 | - $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0)); |
|
1634 | + $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0)); |
|
1635 | 1635 | $shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0)); |
1636 | 1636 | $demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0)); |
1637 | 1637 | //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0)); |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | // Payment term |
1752 | 1752 | print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>'; |
1753 | 1753 | print img_picto('', 'payment', 'class="pictofixedwidth"'); |
1754 | - print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1); |
|
1754 | + print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1); |
|
1755 | 1755 | print '</td></tr>'; |
1756 | 1756 | |
1757 | 1757 | // Payment mode |
@@ -2001,7 +2001,7 @@ discard block |
||
2001 | 2001 | 'morecss' => 'minwidth300' |
2002 | 2002 | ) |
2003 | 2003 | ); |
2004 | - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1); |
|
2004 | + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1); |
|
2005 | 2005 | } |
2006 | 2006 | |
2007 | 2007 | // Confirmation of cancellation |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | $morehtmlref = '<div class="refidno">'; |
2055 | 2055 | // Ref supplier |
2056 | 2056 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); |
2057 | - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2057 | + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2058 | 2058 | // Thirdparty |
2059 | 2059 | $morehtmlref .= '<br>'; |
2060 | 2060 | if (getDolGlobalString('MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER') && !empty($usercancreate) && $action == 'edit_thirdparty') { |
@@ -2340,40 +2340,40 @@ discard block |
||
2340 | 2340 | |
2341 | 2341 | print '<tr>'; |
2342 | 2342 | // Amount HT |
2343 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
2344 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2343 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
2344 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2345 | 2345 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2346 | 2346 | // Multicurrency Amount HT |
2347 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2347 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2348 | 2348 | } |
2349 | 2349 | print '</tr>'; |
2350 | 2350 | |
2351 | 2351 | print '<tr>'; |
2352 | 2352 | // Amount VAT |
2353 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
2354 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2353 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
2354 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2355 | 2355 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2356 | 2356 | // Multicurrency Amount VAT |
2357 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2357 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2358 | 2358 | } |
2359 | 2359 | print '</tr>'; |
2360 | 2360 | |
2361 | 2361 | // Amount Local Taxes |
2362 | 2362 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
2363 | 2363 | print '<tr>'; |
2364 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
2365 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2364 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
2365 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2366 | 2366 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2367 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2367 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2368 | 2368 | } |
2369 | 2369 | print '</tr>'; |
2370 | 2370 | |
2371 | 2371 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
2372 | 2372 | print '<tr>'; |
2373 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
2374 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2373 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
2374 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2375 | 2375 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2376 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2376 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2377 | 2377 | } |
2378 | 2378 | print '</tr>'; |
2379 | 2379 | } |
@@ -2381,16 +2381,16 @@ discard block |
||
2381 | 2381 | |
2382 | 2382 | $alert = ''; |
2383 | 2383 | if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->supplier_order_min_amount) { |
2384 | - $alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->supplier_order_min_amount)); |
|
2384 | + $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); |
|
2385 | 2385 | } |
2386 | 2386 | |
2387 | 2387 | print '<tr>'; |
2388 | 2388 | // Amount TTC |
2389 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
2390 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . $alert . '</td>'; |
|
2389 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
2390 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).$alert.'</td>'; |
|
2391 | 2391 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2392 | 2392 | // Multicurrency Amount TTC |
2393 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2393 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2394 | 2394 | } |
2395 | 2395 | print '</tr>'; |
2396 | 2396 |
@@ -1127,8 +1127,8 @@ discard block |
||
1127 | 1127 | $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); |
1128 | 1128 | $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); |
1129 | 1129 | $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); |
1130 | - $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1131 | - $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1130 | + $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1131 | + $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1132 | 1132 | $stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport); |
1133 | 1133 | $stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport); |
1134 | 1134 | |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | foreach ($aliasesarray as $aliasshortcuttocreate) { |
1404 | 1404 | if (trim($aliasshortcuttocreate)) { |
1405 | 1405 | $filealias = $conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; |
1406 | - $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1406 | + $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1407 | 1407 | if (!$result) { |
1408 | 1408 | $this->errors[] = 'Failed to write file '.basename($filealias); |
1409 | 1409 | $error++; |
@@ -1424,7 +1424,7 @@ discard block |
||
1424 | 1424 | $filetpl = $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php'; |
1425 | 1425 | } |
1426 | 1426 | $filewrapper = $pathofwebsite.'/wrapper.php'; |
1427 | - dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1427 | + dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1428 | 1428 | } |
1429 | 1429 | |
1430 | 1430 | if ($error) { |
@@ -2012,7 +2012,7 @@ discard block |
||
2012 | 2012 | $destContent = file_get_contents($fileNeeded['fullname']); |
2013 | 2013 | |
2014 | 2014 | $numOfPageDest = $this->extractNumberFromFilename($fileNeeded['name']); |
2015 | - $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest,$numOfPageSource)); |
|
2015 | + $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest, $numOfPageSource)); |
|
2016 | 2016 | $differences['file_destination'] = $fileNeeded; |
2017 | 2017 | } |
2018 | 2018 | return $differences; |
@@ -2053,10 +2053,10 @@ discard block |
||
2053 | 2053 | $linefound = array(); |
2054 | 2054 | $countNumPage = count($exceptNumPge); |
2055 | 2055 | |
2056 | - for ($i = 0;$i < $countNumPage; $i++) { |
|
2056 | + for ($i = 0; $i < $countNumPage; $i++) { |
|
2057 | 2057 | $linefound[$i] = array(); |
2058 | - $linefound[$i]['meta'] = '/content="' . preg_quote($exceptNumPge[$i], '/') . '" \/>/'; |
|
2059 | - $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/'; |
|
2058 | + $linefound[$i]['meta'] = '/content="'.preg_quote($exceptNumPge[$i], '/').'" \/>/'; |
|
2059 | + $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", '.preg_quote($exceptNumPge[$i], '/').'\);/'; |
|
2060 | 2060 | } |
2061 | 2061 | |
2062 | 2062 | if (isset($linefound[1])) { |
@@ -2079,13 +2079,13 @@ discard block |
||
2079 | 2079 | if ($lineContent1 !== $lineContent2) { |
2080 | 2080 | if (isset($lines1[$lineNum]) && !isset($lines2[$lineNum])) { |
2081 | 2081 | // Ligne deleted de la source |
2082 | - $diff["Supprimée à la ligne " . ($lineNum + 1)] = $lineContent1; |
|
2082 | + $diff["Supprimée à la ligne ".($lineNum + 1)] = $lineContent1; |
|
2083 | 2083 | } elseif (!isset($lines1[$lineNum]) && isset($lines2[$lineNum])) { |
2084 | 2084 | // Nouvelle ligne added dans la destination |
2085 | - $diff["Ajoutée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2085 | + $diff["Ajoutée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2086 | 2086 | } else { |
2087 | 2087 | // Différence found it |
2088 | - $diff["Modifiée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2088 | + $diff["Modifiée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2089 | 2089 | } |
2090 | 2090 | } |
2091 | 2091 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | if (empty($this->piece_num)) { |
374 | 374 | $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; |
375 | 375 | $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
376 | - $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
376 | + $sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
377 | 377 | |
378 | 378 | $resqlnum = $this->db->query($sqlnum); |
379 | 379 | if ($resqlnum) { |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
556 | 556 | |
557 | 557 | global $action; |
558 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
558 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
559 | 559 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
560 | 560 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
561 | 561 | if ($reshook > 0) { |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $sql .= " t.date_validated as date_validation"; |
792 | 792 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; |
793 | 793 | $sql .= ' WHERE 1 = 1'; |
794 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
794 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
795 | 795 | if (null !== $ref) { |
796 | 796 | $sql .= " AND t.rowid = ".((int) $ref); |
797 | 797 | } else { |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | } |
943 | 943 | } |
944 | 944 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
945 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
945 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
946 | 946 | if (count($sqlwhere) > 0) { |
947 | 947 | $sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere); |
948 | 948 | } |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | } |
1110 | 1110 | } |
1111 | 1111 | } |
1112 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1112 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
1113 | 1113 | if ($showAlreadyExportMovements == 0) { |
1114 | 1114 | $sql .= " AND t.date_export IS NULL"; |
1115 | 1115 | } |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | } |
1236 | 1236 | } |
1237 | 1237 | } |
1238 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1238 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
1239 | 1239 | if (count($sqlwhere) > 0) { |
1240 | 1240 | $sql .= " AND ".implode(" ".$filtermode." ", $sqlwhere); |
1241 | 1241 | } |
@@ -1605,7 +1605,7 @@ discard block |
||
1605 | 1605 | if (!empty($journal)) { |
1606 | 1606 | $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; |
1607 | 1607 | } |
1608 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1608 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1609 | 1609 | // Exclusion of validated entries at the time of deletion |
1610 | 1610 | $sql .= " AND date_validated IS NULL"; |
1611 | 1611 | $sql .= $sql_filter; |
@@ -1650,8 +1650,8 @@ discard block |
||
1650 | 1650 | $sql = "DELETE"; |
1651 | 1651 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1652 | 1652 | $sql .= " WHERE piece_num = ".(int) $piecenum; |
1653 | - $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1654 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1653 | + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1654 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1655 | 1655 | $sql .= $sql_filter; |
1656 | 1656 | |
1657 | 1657 | $resql = $this->db->query($sql); |
@@ -1774,7 +1774,7 @@ discard block |
||
1774 | 1774 | } |
1775 | 1775 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1776 | 1776 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
1777 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1777 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1778 | 1778 | |
1779 | 1779 | dol_syslog(__METHOD__, LOG_DEBUG); |
1780 | 1780 | $result = $this->db->query($sql); |
@@ -1813,7 +1813,7 @@ discard block |
||
1813 | 1813 | global $conf; |
1814 | 1814 | |
1815 | 1815 | $sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1816 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1816 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1817 | 1817 | |
1818 | 1818 | dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG); |
1819 | 1819 | |
@@ -1857,7 +1857,7 @@ discard block |
||
1857 | 1857 | } |
1858 | 1858 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1859 | 1859 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
1860 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1860 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1861 | 1861 | |
1862 | 1862 | dol_syslog(__METHOD__, LOG_DEBUG); |
1863 | 1863 | $result = $this->db->query($sql); |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; |
1923 | 1923 | $sql .= " date_validated as date_validation"; |
1924 | 1924 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
1925 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1925 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1926 | 1926 | |
1927 | 1927 | dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG); |
1928 | 1928 | |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | |
2000 | 2000 | if (!$error) { |
2001 | 2001 | // Delete if there is an empty line |
2002 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
2002 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
2003 | 2003 | $resql = $this->db->query($sql); |
2004 | 2004 | if (!$resql) { |
2005 | 2005 | $error++; |
@@ -2017,7 +2017,7 @@ discard block |
||
2017 | 2017 | $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; |
2018 | 2018 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
2019 | 2019 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'"; |
2020 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity); |
|
2020 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity); |
|
2021 | 2021 | $sql .= $sql_filter; |
2022 | 2022 | $resql = $this->db->query($sql); |
2023 | 2023 | if (!$resql) { |
@@ -2028,7 +2028,7 @@ discard block |
||
2028 | 2028 | } |
2029 | 2029 | |
2030 | 2030 | if (!$error) { |
2031 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2031 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2032 | 2032 | $resql = $this->db->query($sql); |
2033 | 2033 | if (!$resql) { |
2034 | 2034 | $error++; |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | } |
2039 | 2039 | } elseif ($direction == 1) { |
2040 | 2040 | if (!$error) { |
2041 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2041 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2042 | 2042 | $resql = $this->db->query($sql); |
2043 | 2043 | if (!$resql) { |
2044 | 2044 | $error++; |
@@ -2056,7 +2056,7 @@ discard block |
||
2056 | 2056 | $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; |
2057 | 2057 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
2058 | 2058 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; |
2059 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2059 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2060 | 2060 | $sql .= $sql_filter; |
2061 | 2061 | $resql = $this->db->query($sql); |
2062 | 2062 | if (!$resql) { |
@@ -2067,7 +2067,7 @@ discard block |
||
2067 | 2067 | } |
2068 | 2068 | |
2069 | 2069 | if (!$error) { |
2070 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2070 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2071 | 2071 | $sql .= $sql_filter; |
2072 | 2072 | $resql = $this->db->query($sql); |
2073 | 2073 | if (!$resql) { |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | $sql .= " AND aa.active = 1"; |
2125 | 2125 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; |
2126 | 2126 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
2127 | - $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2127 | + $sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2128 | 2128 | $sql .= " ORDER BY account_number ASC"; |
2129 | 2129 | |
2130 | 2130 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
@@ -2188,7 +2188,7 @@ discard block |
||
2188 | 2188 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; |
2189 | 2189 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; |
2190 | 2190 | $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; |
2191 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2191 | + $sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2192 | 2192 | |
2193 | 2193 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
2194 | 2194 | $resql = $this->db->query($sql); |
@@ -2228,7 +2228,7 @@ discard block |
||
2228 | 2228 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
2229 | 2229 | $sql .= " AND aa.active = 1"; |
2230 | 2230 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid"; |
2231 | - $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2231 | + $sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2232 | 2232 | |
2233 | 2233 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
2234 | 2234 | $resql = $this->db->query($sql); |
@@ -2261,7 +2261,7 @@ discard block |
||
2261 | 2261 | global $conf; |
2262 | 2262 | |
2263 | 2263 | $alias = trim($alias); |
2264 | - $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias; |
|
2264 | + $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias."." : $alias; |
|
2265 | 2265 | |
2266 | 2266 | if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) { |
2267 | 2267 | $result = $this->loadFiscalPeriods($force, 'active'); |
@@ -2272,10 +2272,10 @@ discard block |
||
2272 | 2272 | $sql_list = array(); |
2273 | 2273 | if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) { |
2274 | 2274 | foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { |
2275 | - $sql_list[] = "('" . $this->db->idate($fiscal_period['date_start']) . "' <= {$alias}doc_date AND {$alias}doc_date <= '" . $this->db->idate($fiscal_period['date_end']) . "')"; |
|
2275 | + $sql_list[] = "('".$this->db->idate($fiscal_period['date_start'])."' <= {$alias}doc_date AND {$alias}doc_date <= '".$this->db->idate($fiscal_period['date_end'])."')"; |
|
2276 | 2276 | } |
2277 | 2277 | } |
2278 | - self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? ' AND (' . implode(' OR ', $sql_list) . ')' : ''; |
|
2278 | + self::$can_modify_bookkeeping_sql_cached[$alias] = !empty($sql_list) ? ' AND ('.implode(' OR ', $sql_list).')' : ''; |
|
2279 | 2279 | } |
2280 | 2280 | |
2281 | 2281 | return self::$can_modify_bookkeeping_sql_cached[$alias]; |
@@ -2395,8 +2395,8 @@ discard block |
||
2395 | 2395 | if ($mode == 'active') { |
2396 | 2396 | if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { |
2397 | 2397 | $sql = "SELECT date_start, date_end"; |
2398 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2399 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2398 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2399 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2400 | 2400 | $sql .= " AND statut = 0"; |
2401 | 2401 | |
2402 | 2402 | $resql = $this->db->query($sql); |
@@ -2418,8 +2418,8 @@ discard block |
||
2418 | 2418 | if ($mode == 'closed') { |
2419 | 2419 | if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { |
2420 | 2420 | $sql = "SELECT date_start, date_end"; |
2421 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2422 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2421 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2422 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2423 | 2423 | $sql .= " AND statut = 1"; |
2424 | 2424 | |
2425 | 2425 | $resql = $this->db->query($sql); |
@@ -2454,10 +2454,10 @@ discard block |
||
2454 | 2454 | $list = array(); |
2455 | 2455 | |
2456 | 2456 | $sql = "SELECT rowid, label, date_start, date_end, statut"; |
2457 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2458 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2457 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2458 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2459 | 2459 | if (!empty($filter)) { |
2460 | - $sql .= " AND (" . $filter . ')'; |
|
2460 | + $sql .= " AND (".$filter.')'; |
|
2461 | 2461 | } |
2462 | 2462 | $sql .= $this->db->order('date_start', 'ASC'); |
2463 | 2463 | |
@@ -2494,13 +2494,13 @@ discard block |
||
2494 | 2494 | |
2495 | 2495 | $sql = "SELECT YEAR(b.doc_date) as year"; |
2496 | 2496 | for ($i = 1; $i <= 12; $i++) { |
2497 | - $sql .= ", SUM(" . $this->db->ifsql("MONTH(b.doc_date)=" . $i, "1", "0") . ") AS month" . $i; |
|
2497 | + $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date)=".$i, "1", "0").") AS month".$i; |
|
2498 | 2498 | } |
2499 | 2499 | $sql .= ", COUNT(b.rowid) as total"; |
2500 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as b"; |
|
2501 | - $sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'"; |
|
2502 | - $sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'"; |
|
2503 | - $sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy |
|
2500 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; |
|
2501 | + $sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'"; |
|
2502 | + $sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'"; |
|
2503 | + $sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy |
|
2504 | 2504 | |
2505 | 2505 | // Get count for each month into the fiscal period |
2506 | 2506 | if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { |
@@ -2530,7 +2530,7 @@ discard block |
||
2530 | 2530 | 'total' => (int) $obj->total, |
2531 | 2531 | ); |
2532 | 2532 | for ($i = 1; $i <= 12; $i++) { |
2533 | - $year_list['count'][$i] = (int) $obj->{'month' . $i}; |
|
2533 | + $year_list['count'][$i] = (int) $obj->{'month'.$i}; |
|
2534 | 2534 | } |
2535 | 2535 | |
2536 | 2536 | $list[] = $year_list; |
@@ -2558,11 +2558,11 @@ discard block |
||
2558 | 2558 | $now = dol_now(); |
2559 | 2559 | |
2560 | 2560 | // Specify as export : update field date_validated on selected month/year |
2561 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; |
|
2562 | - $sql .= " SET date_validated = '" . $this->db->idate($now) . "'"; |
|
2563 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2564 | - $sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
2565 | - $sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
2561 | + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
|
2562 | + $sql .= " SET date_validated = '".$this->db->idate($now)."'"; |
|
2563 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2564 | + $sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'"; |
|
2565 | + $sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'"; |
|
2566 | 2566 | $sql .= " AND date_validated IS NULL"; |
2567 | 2567 | |
2568 | 2568 | dol_syslog(__METHOD__, LOG_DEBUG); |
@@ -2594,27 +2594,27 @@ discard block |
||
2594 | 2594 | $accounting_groups_used_for_income_statement = array_filter(array_map('trim', explode(',', getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT'))), 'strlen'); |
2595 | 2595 | |
2596 | 2596 | foreach ($accounting_groups_used_for_income_statement as $item) { |
2597 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
2597 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
2598 | 2598 | } |
2599 | 2599 | |
2600 | 2600 | $sql = 'SELECT'; |
2601 | 2601 | $sql .= " t.numero_compte,"; |
2602 | 2602 | $sql .= " aa.pcg_type,"; |
2603 | 2603 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as accounting_result"; |
2604 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
2605 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2606 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2607 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); |
|
2608 | - $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid = ' . ((int) getDolGlobalInt('CHARTOFACCOUNTS')) . ')'; |
|
2609 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
2610 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
2611 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
2604 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
2605 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2606 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
2607 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
2608 | + $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
|
2609 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
2610 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
2611 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
2612 | 2612 | $sql .= ' GROUP BY t.numero_compte, aa.pcg_type'; |
2613 | 2613 | |
2614 | 2614 | $resql = $this->db->query($sql); |
2615 | 2615 | if (!$resql) { |
2616 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
2617 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
2616 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
2617 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
2618 | 2618 | } else { |
2619 | 2619 | while ($obj = $this->db->fetch_object($resql)) { |
2620 | 2620 | $income_statement_amount += $obj->accounting_result; |
@@ -2653,7 +2653,7 @@ discard block |
||
2653 | 2653 | return -1; |
2654 | 2654 | } elseif (empty($fiscal_period->id)) { |
2655 | 2655 | $langs->loadLangs(array('errors', 'compta')); |
2656 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
2656 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
2657 | 2657 | return -1; |
2658 | 2658 | } |
2659 | 2659 | |
@@ -2672,7 +2672,7 @@ discard block |
||
2672 | 2672 | return -1; |
2673 | 2673 | } elseif (empty($new_fiscal_period->id)) { |
2674 | 2674 | $langs->loadLangs(array('errors', 'compta')); |
2675 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
2675 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
2676 | 2676 | return -1; |
2677 | 2677 | } |
2678 | 2678 | |
@@ -2692,7 +2692,7 @@ discard block |
||
2692 | 2692 | $journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL')); |
2693 | 2693 | if (empty($journal_id)) { |
2694 | 2694 | $langs->loadLangs(array('errors', 'accountancy')); |
2695 | - $this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
2695 | + $this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
2696 | 2696 | $error++; |
2697 | 2697 | } |
2698 | 2698 | |
@@ -2706,7 +2706,7 @@ discard block |
||
2706 | 2706 | $error++; |
2707 | 2707 | } elseif ($result == 0) { |
2708 | 2708 | $langs->loadLangs(array('errors', 'accountancy')); |
2709 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
2709 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
2710 | 2710 | $error++; |
2711 | 2711 | } |
2712 | 2712 | } |
@@ -2718,7 +2718,7 @@ discard block |
||
2718 | 2718 | $pcg_type_filter = array(); |
2719 | 2719 | $tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement); |
2720 | 2720 | foreach ($tmp as $item) { |
2721 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
2721 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
2722 | 2722 | } |
2723 | 2723 | |
2724 | 2724 | $sql = 'SELECT'; |
@@ -2730,14 +2730,14 @@ discard block |
||
2730 | 2730 | } |
2731 | 2731 | $sql .= " aa.pcg_type,"; |
2732 | 2732 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance"; |
2733 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
2734 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2735 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2736 | - $sql .= " AND aa.entity = ". ((int) $conf->entity); |
|
2733 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
2734 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2735 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
2736 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
2737 | 2737 | $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
2738 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
2739 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
2740 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
2738 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
2739 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
2740 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
2741 | 2741 | $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; |
2742 | 2742 | if ($separate_auxiliary_account) { |
2743 | 2743 | $sql .= ' ,t.subledger_account, t.subledger_label'; |
@@ -2746,8 +2746,8 @@ discard block |
||
2746 | 2746 | |
2747 | 2747 | $resql = $this->db->query($sql); |
2748 | 2748 | if (!$resql) { |
2749 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
2750 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
2749 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
2750 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
2751 | 2751 | |
2752 | 2752 | $error++; |
2753 | 2753 | } else { |
@@ -2889,7 +2889,7 @@ discard block |
||
2889 | 2889 | return -1; |
2890 | 2890 | } elseif (empty($fiscal_period->id)) { |
2891 | 2891 | $langs->loadLangs(array('errors', 'compta')); |
2892 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
2892 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
2893 | 2893 | return -1; |
2894 | 2894 | } |
2895 | 2895 | |
@@ -2908,7 +2908,7 @@ discard block |
||
2908 | 2908 | return -1; |
2909 | 2909 | } elseif (empty($new_fiscal_period->id)) { |
2910 | 2910 | $langs->loadLangs(array('errors', 'compta')); |
2911 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
2911 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
2912 | 2912 | return -1; |
2913 | 2913 | } |
2914 | 2914 | |
@@ -2928,7 +2928,7 @@ discard block |
||
2928 | 2928 | return -1; |
2929 | 2929 | } elseif ($result == 0) { |
2930 | 2930 | $langs->loadLangs(array('errors', 'accountancy')); |
2931 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal'); |
|
2931 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal'); |
|
2932 | 2932 | return -1; |
2933 | 2933 | } |
2934 | 2934 | |
@@ -2936,18 +2936,18 @@ discard block |
||
2936 | 2936 | $this->db->begin(); |
2937 | 2937 | |
2938 | 2938 | $sql = 'SELECT t.rowid'; |
2939 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
2940 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2941 | - $sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'"; |
|
2942 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
2943 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
2944 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
2945 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
2939 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
2940 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
2941 | + $sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'"; |
|
2942 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
2943 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
2944 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
2945 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
2946 | 2946 | |
2947 | 2947 | $resql = $this->db->query($sql); |
2948 | 2948 | if (!$resql) { |
2949 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
2950 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
2949 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
2950 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
2951 | 2951 | |
2952 | 2952 | $error++; |
2953 | 2953 | } else { |
@@ -2962,7 +2962,7 @@ discard block |
||
2962 | 2962 | break; |
2963 | 2963 | } elseif ($result == 0) { |
2964 | 2964 | $langs->loadLangs(array('errors', 'accountancy')); |
2965 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid; |
|
2965 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid; |
|
2966 | 2966 | $error++; |
2967 | 2967 | break; |
2968 | 2968 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | $messages = $this->messages; |
84 | 84 | |
85 | - usort($messages, function ($itemA, $itemB) { |
|
85 | + usort($messages, function($itemA, $itemB) { |
|
86 | 86 | if ($itemA['time'] === $itemB['time']) { |
87 | 87 | return 0; |
88 | 88 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if ($type = $severity & (1 << $i)) { |
142 | 142 | $label = $this->friendlyErrorType($type); |
143 | 143 | $this->messages[] = [ |
144 | - 'message' => $message . ' (' . $fileName . ':' . $line . ')', |
|
144 | + 'message' => $message.' ('.$fileName.':'.$line.')', |
|
145 | 145 | 'message_html' => null, |
146 | 146 | 'is_string' => true, |
147 | 147 | 'label' => $label, |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday'); |
66 | 66 | $search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth'); |
67 | 67 | $search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear'); |
68 | -$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
68 | +$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
69 | 69 | $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); |
70 | 70 | $search_date_create_startday = GETPOSTINT('search_date_create_startday'); |
71 | 71 | $search_date_create_startmonth = GETPOSTINT('search_date_create_startmonth'); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $search_date_create_endday = GETPOSTINT('search_date_create_endday'); |
74 | 74 | $search_date_create_endmonth = GETPOSTINT('search_date_create_endmonth'); |
75 | 75 | $search_date_create_endyear = GETPOSTINT('search_date_create_endyear'); |
76 | -$search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear); // Use tzserver |
|
76 | +$search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear); // Use tzserver |
|
77 | 77 | $search_date_create_end = dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear); |
78 | 78 | $search_billed = GETPOSTINT("search_billed"); |
79 | 79 | $search_status = GETPOST('search_status', 'intcomma'); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | // if the VAT reverse-charge is activated by default in supplier card to resume the information |
331 | 331 | $objecttmp->vat_reverse_charge = $soc->vat_reverse_charge; |
332 | 332 | |
333 | - $objecttmp->fk_project = $rcp->fk_project; |
|
333 | + $objecttmp->fk_project = $rcp->fk_project; |
|
334 | 334 | //$objecttmp->multicurrency_code = $rcp->multicurrency_code; |
335 | 335 | if (empty($createbills_onebythird)) { |
336 | 336 | $objecttmp->ref_supplier = $rcp->ref; |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
366 | - $res = $objecttmp->create($user); // This should create the supplier invoice + links into $objecttmp->linked_objects + add a link to ->origin_id |
|
366 | + $res = $objecttmp->create($user); // This should create the supplier invoice + links into $objecttmp->linked_objects + add a link to ->origin_id |
|
367 | 367 | |
368 | 368 | //var_dump($objecttmp->error);exit; |
369 | 369 | if ($res > 0) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); |
143 | 143 | $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); |
144 | 144 | $separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : ''); |
145 | -$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
145 | +$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
146 | 146 | $charset = GETPOST('charset', 'aZ09'); |
147 | 147 | $separator_used = str_replace('\t', "\t", $separator); |
148 | 148 | |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $maxfilesizearray = getMaxFileSizeArray(); |
641 | 641 | $maxmin = $maxfilesizearray['maxmin']; |
642 | 642 | if ($maxmin > 0) { |
643 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
643 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
644 | 644 | } |
645 | 645 | print '<input type="file" name="userfile" size="20" maxlength="80"> '; |
646 | 646 | $out = (!getDolGlobalString('MAIN_UPLOAD_DOC') ? ' disabled' : ''); |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | //var_dump($_SESSION["dol_array_match_file_to_database_select"]); |
760 | 760 | $serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : ''; |
761 | 761 | $fieldsarray = explode(',', $serialized_array_match_file_to_database); |
762 | - $array_match_file_to_database = array(); // Same than $fieldsarray but with mapped value only (col1 => 's.fielda', col2 => 's.fieldb'...) |
|
762 | + $array_match_file_to_database = array(); // Same than $fieldsarray but with mapped value only (col1 => 's.fielda', col2 => 's.fieldb'...) |
|
763 | 763 | foreach ($fieldsarray as $elem) { |
764 | 764 | $tabelem = explode('=', $elem, 2); |
765 | 765 | $key = $tabelem[0]; |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | foreach ($fieldstarget as $code => $line) { |
1112 | 1112 | //var_dump($line); |
1113 | 1113 | |
1114 | - $tmparray = explode('|', $line["label"]); // If label of field is several translation keys separated with | |
|
1114 | + $tmparray = explode('|', $line["label"]); // If label of field is several translation keys separated with | |
|
1115 | 1115 | $labeltoshow = ''; |
1116 | 1116 | foreach ($tmparray as $tmpkey => $tmpval) { |
1117 | 1117 | $labeltoshow .= ($labeltoshow ? ' '.$langs->trans('or').' ' : '').$langs->transnoentities($tmpval); |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | //var_dump($fieldssource); |
1142 | 1142 | //var_dump($fieldstarget); |
1143 | 1143 | |
1144 | - $modetoautofillmapping = 'session'; // Use setup in session |
|
1144 | + $modetoautofillmapping = 'session'; // Use setup in session |
|
1145 | 1145 | if ($initialloadofstep4) { |
1146 | 1146 | $modetoautofillmapping = 'guess'; |
1147 | 1147 | } |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | // - Then we set to disabled all fields that are selected |
1350 | 1350 | print 'function setOptionsToDisabled() {'."\n"; |
1351 | 1351 | print ' console.log("Remove the disabled flag everywhere");'."\n"; |
1352 | - print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options |
|
1352 | + print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options |
|
1353 | 1353 | print ' arrayofselectedvalues = [];'."\n"; |
1354 | 1354 | |
1355 | 1355 | print ' $("select.targetselectchange").each(function(){'."\n"; |
@@ -1363,10 +1363,10 @@ discard block |
||
1363 | 1363 | print ' console.log(arrayofselectedvalues);'."\n"; |
1364 | 1364 | print ' console.log("Set the option to disabled for every entry that is currently selected somewhere else (so into arrayofselectedvalues)");'."\n"; |
1365 | 1365 | |
1366 | - print ' $.each(arrayofselectedvalues, function(key, value) {'."\n"; // Loop on each selected value |
|
1366 | + print ' $.each(arrayofselectedvalues, function(key, value) {'."\n"; // Loop on each selected value |
|
1367 | 1367 | print ' if (value != -1) {'."\n"; |
1368 | 1368 | print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n"; |
1369 | - print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected |
|
1369 | + print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected |
|
1370 | 1370 | print ' }'."\n"; |
1371 | 1371 | print ' });'."\n"; |
1372 | 1372 | print '}'."\n"; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $object = new MouvementStock($db); |
118 | 118 | $extrafields = new ExtraFields($db); |
119 | 119 | $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; |
120 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
120 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
121 | 121 | |
122 | 122 | $formfile = new FormFile($db); |
123 | 123 | |
@@ -697,10 +697,10 @@ discard block |
||
697 | 697 | $sql .= " AND e.rowid = ".((int) $id); |
698 | 698 | } |
699 | 699 | if (!empty($search_date_start)) { |
700 | - $sql .= " AND m.datem >= '" . $db->idate($search_date_start) . "'"; |
|
700 | + $sql .= " AND m.datem >= '".$db->idate($search_date_start)."'"; |
|
701 | 701 | } |
702 | 702 | if (!empty($search_date_end)) { |
703 | - $sql .= " AND m.datem <= '" . $db->idate($search_date_end) . "'"; |
|
703 | + $sql .= " AND m.datem <= '".$db->idate($search_date_end)."'"; |
|
704 | 704 | } |
705 | 705 | if ($idproduct > 0) { |
706 | 706 | $sql .= " AND p.rowid = ".((int) $idproduct); |