@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
128 | 128 | $sql .= " WHERE b.num_releve < '" . $db->escape($numref) . "'"; |
129 | 129 | $sql .= " AND b.num_releve <> ''"; |
130 | -$sql .= " AND b.fk_account = " . ((int)$object->id); |
|
130 | +$sql .= " AND b.fk_account = " . ((int) $object->id); |
|
131 | 131 | $sql .= " ORDER BY b.num_releve DESC"; |
132 | 132 | $sql .= $db->plimit(1); |
133 | 133 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $sql = "SELECT b.num_releve as num"; |
150 | 150 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
151 | 151 | $sql .= " WHERE b.num_releve > '" . $db->escape($numref) . "'"; |
152 | -$sql .= " AND b.fk_account = " . ((int)$object->id); |
|
152 | +$sql .= " AND b.fk_account = " . ((int) $object->id); |
|
153 | 153 | $sql .= " ORDER BY b.num_releve ASC"; |
154 | 154 | $sql .= $db->plimit(1); |
155 | 155 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if (empty($numref)) { |
181 | 181 | $sql .= " OR b.num_releve is null"; |
182 | 182 | } |
183 | -$sql .= " AND b.fk_account = " . ((int)$object->id); |
|
183 | +$sql .= " AND b.fk_account = " . ((int) $object->id); |
|
184 | 184 | $sql .= " AND b.fk_account = ba.rowid"; |
185 | 185 | $sql .= " AND ba.entity IN (" . getEntity($object->element) . ")"; |
186 | 186 | $sql .= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if ($action == 'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) { |
196 | 196 | // Test to check newbankreceipt does not exists yet |
197 | 197 | $sqltest = "SELECT b.rowid FROM " . MAIN_DB_PREFIX . "bank as b, " . MAIN_DB_PREFIX . "bank_account as ba"; |
198 | - $sqltest .= " WHERE b.fk_account = ba.rowid AND ba.entity = " . ((int)$conf->entity); |
|
198 | + $sqltest .= " WHERE b.fk_account = ba.rowid AND ba.entity = " . ((int) $conf->entity); |
|
199 | 199 | $sqltest .= " AND num_releve = '" . $db->escape($newbankreceipt) . "'"; |
200 | 200 | $sqltest .= $db->plimit(1); // Need the first one only |
201 | 201 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | // Update bank receipt name |
214 | 214 | if (!$error) { |
215 | 215 | $sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "bank SET num_releve = '" . $db->escape($newbankreceipt) . "'"; |
216 | - $sqlupdate .= " WHERE num_releve = '" . $db->escape($oldbankreceipt) . "' AND fk_account = " . ((int)$id); |
|
216 | + $sqlupdate .= " WHERE num_releve = '" . $db->escape($oldbankreceipt) . "' AND fk_account = " . ((int) $id); |
|
217 | 217 | |
218 | 218 | $resql = $db->query($sqlupdate); |
219 | 219 | if (!$resql) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $param .= '&limit=' . $limit; |
252 | 252 | } |
253 | 253 | if ($id > 0) { |
254 | - $param .= '&id=' . urlencode((string)($id)); |
|
254 | + $param .= '&id=' . urlencode((string) ($id)); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | if (empty($numref)) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | // List of all standing receipts |
274 | 274 | $sql = "SELECT DISTINCT(b.num_releve) as numr"; |
275 | 275 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
276 | - $sql .= " WHERE b.fk_account = " . ((int)$object->id); |
|
276 | + $sql .= " WHERE b.fk_account = " . ((int) $object->id); |
|
277 | 277 | $sql .= " AND b.num_releve IS NOT NULL AND b.num_releve <> '' AND b.num_releve <> '0'"; |
278 | 278 | $sql .= $db->order($sortfield, $sortorder); |
279 | 279 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
391 | 391 | $sql .= " WHERE b.num_releve < '" . $db->escape($objp->numr) . "'"; |
392 | 392 | $sql .= " AND b.num_releve <> ''"; |
393 | - $sql .= " AND b.fk_account = " . ((int)$object->id); |
|
393 | + $sql .= " AND b.fk_account = " . ((int) $object->id); |
|
394 | 394 | $resqlstart = $db->query($sql); |
395 | 395 | if ($resqlstart) { |
396 | 396 | $obj = $db->fetch_object($resqlstart); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $sql = "SELECT sum(b.amount) as amount"; |
404 | 404 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
405 | 405 | $sql .= " WHERE b.num_releve = '" . $db->escape($objp->numr) . "'"; |
406 | - $sql .= " AND b.fk_account = " . ((int)$object->id); |
|
406 | + $sql .= " AND b.fk_account = " . ((int) $object->id); |
|
407 | 407 | $resqlend = $db->query($sql); |
408 | 408 | if ($resqlend) { |
409 | 409 | $obj = $db->fetch_object($resqlend); |
@@ -448,11 +448,11 @@ discard block |
||
448 | 448 | $morehtmlright = ''; |
449 | 449 | $morehtmlright .= '<div class="pagination"><ul>'; |
450 | 450 | if ($foundprevious) { |
451 | - $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundprevious) . '&ve=' . urlencode($ve) . '&account=' . ((int)$object->id) . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>'; |
|
451 | + $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundprevious) . '&ve=' . urlencode($ve) . '&account=' . ((int) $object->id) . '"><i class="fa fa-chevron-left" title="' . dol_escape_htmltag($langs->trans("Previous")) . '"></i></a></li>'; |
|
452 | 452 | } |
453 | 453 | $morehtmlright .= '<li class="pagination"><span class="active">' . $langs->trans("AccountStatement") . " " . $numref . '</span></li>'; |
454 | 454 | if ($foundnext) { |
455 | - $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundnext) . '&ve=' . urlencode($ve) . '&account=' . ((int)$object->id) . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>'; |
|
455 | + $morehtmlright .= '<li class="pagination"><a class="paginationnext" href="' . $_SERVER["PHP_SELF"] . '?num=' . urlencode($foundnext) . '&ve=' . urlencode($ve) . '&account=' . ((int) $object->id) . '"><i class="fa fa-chevron-right" title="' . dol_escape_htmltag($langs->trans("Next")) . '"></i></a></li>'; |
|
456 | 456 | } |
457 | 457 | $morehtmlright .= '</ul></div>'; |
458 | 458 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b"; |
482 | 482 | $sql .= " WHERE b.num_releve < '" . $db->escape($numref) . "'"; |
483 | 483 | $sql .= " AND b.num_releve <> ''"; |
484 | - $sql .= " AND b.fk_account = " . ((int)$object->id); |
|
484 | + $sql .= " AND b.fk_account = " . ((int) $object->id); |
|
485 | 485 | |
486 | 486 | $resql = $db->query($sql); |
487 | 487 | if ($resql) { |
@@ -668,8 +668,8 @@ discard block |
||
668 | 668 | $sql .= " FROM " . MAIN_DB_PREFIX . "bank_categ as ct"; |
669 | 669 | $sql .= ", " . MAIN_DB_PREFIX . "bank_class as cl"; |
670 | 670 | $sql .= " WHERE ct.rowid = cl.fk_categ"; |
671 | - $sql .= " AND ct.entity = " . ((int)$conf->entity); |
|
672 | - $sql .= " AND cl.lineid = " . ((int)$objp->rowid); |
|
671 | + $sql .= " AND ct.entity = " . ((int) $conf->entity); |
|
672 | + $sql .= " AND cl.lineid = " . ((int) $objp->rowid); |
|
673 | 673 | |
674 | 674 | $resc = $db->query($sql); |
675 | 675 | if ($resc) { |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | $result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', ''); |
81 | 81 | |
82 | -$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php |
|
82 | +$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php |
|
83 | 83 | |
84 | 84 | /* |
85 | 85 | * Actions |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $search_date_endday = GETPOSTINT('search_date_endday'); |
117 | 117 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
118 | 118 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
119 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
119 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
120 | 120 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
121 | 121 | $search_date_end_startday = GETPOSTINT('search_date_end_startday'); |
122 | 122 | $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $search_date_end_endday = GETPOSTINT('search_date_end_endday'); |
125 | 125 | $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); |
126 | 126 | $search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); |
127 | -$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
127 | +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
128 | 128 | $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); |
129 | 129 | $search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday'); |
130 | 130 | $search_date_delivery_startmonth = GETPOSTINT('search_date_delivery_startmonth'); |
@@ -682,19 +682,19 @@ discard block |
||
682 | 682 | $sql .= natural_search(array_keys($fieldstosearchall), $search_all); |
683 | 683 | } |
684 | 684 | if ($search_fk_cond_reglement > 0) { |
685 | - $sql .= " AND p.fk_cond_reglement = " . ((int)$search_fk_cond_reglement); |
|
685 | + $sql .= " AND p.fk_cond_reglement = " . ((int) $search_fk_cond_reglement); |
|
686 | 686 | } |
687 | 687 | if ($search_fk_shipping_method > 0) { |
688 | - $sql .= " AND p.fk_shipping_method = " . ((int)$search_fk_shipping_method); |
|
688 | + $sql .= " AND p.fk_shipping_method = " . ((int) $search_fk_shipping_method); |
|
689 | 689 | } |
690 | 690 | if ($search_fk_input_reason > 0) { |
691 | - $sql .= " AND p.fk_input_reason = " . ((int)$search_fk_input_reason); |
|
691 | + $sql .= " AND p.fk_input_reason = " . ((int) $search_fk_input_reason); |
|
692 | 692 | } |
693 | 693 | if ($search_fk_mode_reglement > 0) { |
694 | - $sql .= " AND p.fk_mode_reglement = " . ((int)$search_fk_mode_reglement); |
|
694 | + $sql .= " AND p.fk_mode_reglement = " . ((int) $search_fk_mode_reglement); |
|
695 | 695 | } |
696 | 696 | if ($socid > 0) { |
697 | - $sql .= ' AND s.rowid = ' . ((int)$socid); |
|
697 | + $sql .= ' AND s.rowid = ' . ((int) $socid); |
|
698 | 698 | } |
699 | 699 | if ($search_status != '' && $search_status != '-1') { |
700 | 700 | $sql .= ' AND p.fk_statut IN (' . $db->sanitize($search_status) . ')'; |
@@ -733,14 +733,14 @@ discard block |
||
733 | 733 | $sql .= " FROM llx_element_contact as ec"; |
734 | 734 | $sql .= " INNER JOIN llx_c_type_contact as tc"; |
735 | 735 | $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'"; |
736 | - $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = " . ((int)$search_user) . ")"; |
|
736 | + $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = " . ((int) $search_user) . ")"; |
|
737 | 737 | } |
738 | 738 | // Search on sale representative |
739 | 739 | if ($search_sale && $search_sale != '-1') { |
740 | 740 | if ($search_sale == -2) { |
741 | 741 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)"; |
742 | 742 | } elseif ($search_sale > 0) { |
743 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
743 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
744 | 744 | } |
745 | 745 | } |
746 | 746 | // Search for tag/category ($searchCategoryCustomerList is an array of ID) |
@@ -754,9 +754,9 @@ discard block |
||
754 | 754 | $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc)"; |
755 | 755 | } elseif (intval($searchCategoryCustomer) > 0) { |
756 | 756 | if ($searchCategoryCustomerOperator == 0) { |
757 | - $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = " . ((int)$searchCategoryCustomer) . ")"; |
|
757 | + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM " . MAIN_DB_PREFIX . "categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = " . ((int) $searchCategoryCustomer) . ")"; |
|
758 | 758 | } else { |
759 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryCustomer); |
|
759 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryCustomer); |
|
760 | 760 | } |
761 | 761 | } |
762 | 762 | } |
@@ -784,9 +784,9 @@ discard block |
||
784 | 784 | $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)"; |
785 | 785 | } elseif (intval($searchCategoryProduct) > 0) { |
786 | 786 | if ($searchCategoryProductOperator == 0) { |
787 | - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = " . ((int)$searchCategoryProduct) . ")"; |
|
787 | + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck, " . MAIN_DB_PREFIX . "propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = " . ((int) $searchCategoryProduct) . ")"; |
|
788 | 788 | } else { |
789 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int)$searchCategoryProduct); |
|
789 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryProduct); |
|
790 | 790 | } |
791 | 791 | } |
792 | 792 | } |
@@ -889,64 +889,64 @@ discard block |
||
889 | 889 | $param .= '&contextpage=' . urlencode($contextpage); |
890 | 890 | } |
891 | 891 | if ($limit > 0 && $limit != $conf->liste_limit) { |
892 | - $param .= '&limit=' . ((int)$limit); |
|
892 | + $param .= '&limit=' . ((int) $limit); |
|
893 | 893 | } |
894 | 894 | if ($search_all) { |
895 | 895 | $param .= '&search_all=' . urlencode($search_all); |
896 | 896 | } |
897 | 897 | if ($search_date_startday) { |
898 | - $param .= '&search_date_startday=' . urlencode((string)($search_date_startday)); |
|
898 | + $param .= '&search_date_startday=' . urlencode((string) ($search_date_startday)); |
|
899 | 899 | } |
900 | 900 | if ($search_date_startmonth) { |
901 | - $param .= '&search_date_startmonth=' . urlencode((string)($search_date_startmonth)); |
|
901 | + $param .= '&search_date_startmonth=' . urlencode((string) ($search_date_startmonth)); |
|
902 | 902 | } |
903 | 903 | if ($search_date_startyear) { |
904 | - $param .= '&search_date_startyear=' . urlencode((string)($search_date_startyear)); |
|
904 | + $param .= '&search_date_startyear=' . urlencode((string) ($search_date_startyear)); |
|
905 | 905 | } |
906 | 906 | if ($search_date_endday) { |
907 | - $param .= '&search_date_endday=' . urlencode((string)($search_date_endday)); |
|
907 | + $param .= '&search_date_endday=' . urlencode((string) ($search_date_endday)); |
|
908 | 908 | } |
909 | 909 | if ($search_date_endmonth) { |
910 | - $param .= '&search_date_endmonth=' . urlencode((string)($search_date_endmonth)); |
|
910 | + $param .= '&search_date_endmonth=' . urlencode((string) ($search_date_endmonth)); |
|
911 | 911 | } |
912 | 912 | if ($search_date_endyear) { |
913 | - $param .= '&search_date_endyear=' . urlencode((string)($search_date_endyear)); |
|
913 | + $param .= '&search_date_endyear=' . urlencode((string) ($search_date_endyear)); |
|
914 | 914 | } |
915 | 915 | if ($search_date_end_startday) { |
916 | - $param .= '&search_date_end_startday=' . urlencode((string)($search_date_end_startday)); |
|
916 | + $param .= '&search_date_end_startday=' . urlencode((string) ($search_date_end_startday)); |
|
917 | 917 | } |
918 | 918 | if ($search_date_end_startmonth) { |
919 | - $param .= '&search_date_end_startmonth=' . urlencode((string)($search_date_end_startmonth)); |
|
919 | + $param .= '&search_date_end_startmonth=' . urlencode((string) ($search_date_end_startmonth)); |
|
920 | 920 | } |
921 | 921 | if ($search_date_end_startyear) { |
922 | - $param .= '&search_date_end_startyear=' . urlencode((string)($search_date_end_startyear)); |
|
922 | + $param .= '&search_date_end_startyear=' . urlencode((string) ($search_date_end_startyear)); |
|
923 | 923 | } |
924 | 924 | if ($search_date_end_endday) { |
925 | - $param .= '&search_date_end_endday=' . urlencode((string)($search_date_end_endday)); |
|
925 | + $param .= '&search_date_end_endday=' . urlencode((string) ($search_date_end_endday)); |
|
926 | 926 | } |
927 | 927 | if ($search_date_end_endmonth) { |
928 | - $param .= '&search_date_end_endmonth=' . urlencode((string)($search_date_end_endmonth)); |
|
928 | + $param .= '&search_date_end_endmonth=' . urlencode((string) ($search_date_end_endmonth)); |
|
929 | 929 | } |
930 | 930 | if ($search_date_end_endyear) { |
931 | - $param .= '&search_date_end_endyear=' . urlencode((string)($search_date_end_endyear)); |
|
931 | + $param .= '&search_date_end_endyear=' . urlencode((string) ($search_date_end_endyear)); |
|
932 | 932 | } |
933 | 933 | if ($search_date_delivery_startday) { |
934 | - $param .= '&search_date_delivery_startday=' . urlencode((string)($search_date_delivery_startday)); |
|
934 | + $param .= '&search_date_delivery_startday=' . urlencode((string) ($search_date_delivery_startday)); |
|
935 | 935 | } |
936 | 936 | if ($search_date_delivery_startmonth) { |
937 | - $param .= '&search_date_delivery_startmonth=' . urlencode((string)($search_date_delivery_startmonth)); |
|
937 | + $param .= '&search_date_delivery_startmonth=' . urlencode((string) ($search_date_delivery_startmonth)); |
|
938 | 938 | } |
939 | 939 | if ($search_date_delivery_startyear) { |
940 | - $param .= '&search_date_delivery_startyear=' . urlencode((string)($search_date_delivery_startyear)); |
|
940 | + $param .= '&search_date_delivery_startyear=' . urlencode((string) ($search_date_delivery_startyear)); |
|
941 | 941 | } |
942 | 942 | if ($search_date_delivery_endday) { |
943 | - $param .= '&search_date_delivery_endday=' . urlencode((string)($search_date_delivery_endday)); |
|
943 | + $param .= '&search_date_delivery_endday=' . urlencode((string) ($search_date_delivery_endday)); |
|
944 | 944 | } |
945 | 945 | if ($search_date_delivery_endmonth) { |
946 | - $param .= '&search_date_delivery_endmonth=' . urlencode((string)($search_date_delivery_endmonth)); |
|
946 | + $param .= '&search_date_delivery_endmonth=' . urlencode((string) ($search_date_delivery_endmonth)); |
|
947 | 947 | } |
948 | 948 | if ($search_date_delivery_endyear) { |
949 | - $param .= '&search_date_delivery_endyear=' . urlencode((string)($search_date_delivery_endyear)); |
|
949 | + $param .= '&search_date_delivery_endyear=' . urlencode((string) ($search_date_delivery_endyear)); |
|
950 | 950 | } |
951 | 951 | if ($search_ref) { |
952 | 952 | $param .= '&search_ref=' . urlencode($search_ref); |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $param .= '&search_societe_alias=' . urlencode($search_societe_alias); |
965 | 965 | } |
966 | 966 | if ($search_user > 0) { |
967 | - $param .= '&search_user=' . urlencode((string)($search_user)); |
|
967 | + $param .= '&search_user=' . urlencode((string) ($search_user)); |
|
968 | 968 | } |
969 | 969 | if ($search_sale > 0) { |
970 | 970 | $param .= '&search_sale=' . urlencode($search_sale); |
@@ -997,31 +997,31 @@ discard block |
||
997 | 997 | $param .= '&search_zip=' . urlencode($search_zip); |
998 | 998 | } |
999 | 999 | if ($socid > 0) { |
1000 | - $param .= '&socid=' . urlencode((string)($socid)); |
|
1000 | + $param .= '&socid=' . urlencode((string) ($socid)); |
|
1001 | 1001 | } |
1002 | 1002 | if ($optioncss != '') { |
1003 | 1003 | $param .= '&optioncss=' . urlencode($optioncss); |
1004 | 1004 | } |
1005 | 1005 | if ($search_categ_cus > 0) { |
1006 | - $param .= '&search_categ_cus=' . urlencode((string)($search_categ_cus)); |
|
1006 | + $param .= '&search_categ_cus=' . urlencode((string) ($search_categ_cus)); |
|
1007 | 1007 | } |
1008 | 1008 | if ($search_product_category != '') { |
1009 | - $param .= '&search_product_category=' . urlencode((string)($search_product_category)); |
|
1009 | + $param .= '&search_product_category=' . urlencode((string) ($search_product_category)); |
|
1010 | 1010 | } |
1011 | 1011 | if ($search_fk_cond_reglement > 0) { |
1012 | - $param .= '&search_fk_cond_reglement=' . urlencode((string)($search_fk_cond_reglement)); |
|
1012 | + $param .= '&search_fk_cond_reglement=' . urlencode((string) ($search_fk_cond_reglement)); |
|
1013 | 1013 | } |
1014 | 1014 | if ($search_fk_shipping_method > 0) { |
1015 | - $param .= '&search_fk_shipping_method=' . urlencode((string)($search_fk_shipping_method)); |
|
1015 | + $param .= '&search_fk_shipping_method=' . urlencode((string) ($search_fk_shipping_method)); |
|
1016 | 1016 | } |
1017 | 1017 | if ($search_fk_input_reason > 0) { |
1018 | - $param .= '&search_fk_input_reason=' . urlencode((string)($search_fk_input_reason)); |
|
1018 | + $param .= '&search_fk_input_reason=' . urlencode((string) ($search_fk_input_reason)); |
|
1019 | 1019 | } |
1020 | 1020 | if ($search_fk_mode_reglement > 0) { |
1021 | - $param .= '&search_fk_mode_reglement=' . urlencode((string)($search_fk_mode_reglement)); |
|
1021 | + $param .= '&search_fk_mode_reglement=' . urlencode((string) ($search_fk_mode_reglement)); |
|
1022 | 1022 | } |
1023 | 1023 | if ($search_type_thirdparty > 0) { |
1024 | - $param .= '&search_type_thirdparty=' . urlencode((string)($search_type_thirdparty)); |
|
1024 | + $param .= '&search_type_thirdparty=' . urlencode((string) ($search_type_thirdparty)); |
|
1025 | 1025 | } |
1026 | 1026 | if ($search_town) { |
1027 | 1027 | $param .= '&search_town=' . urlencode($search_town); |
@@ -1036,25 +1036,25 @@ discard block |
||
1036 | 1036 | $param .= '&search_town=' . urlencode($search_town); |
1037 | 1037 | } |
1038 | 1038 | if ($search_country) { |
1039 | - $param .= '&search_country=' . urlencode((string)($search_country)); |
|
1039 | + $param .= '&search_country=' . urlencode((string) ($search_country)); |
|
1040 | 1040 | } |
1041 | 1041 | if ($search_date_signature_startday) { |
1042 | - $param .= '&search_date_signature_startday=' . urlencode((string)($search_date_signature_startday)); |
|
1042 | + $param .= '&search_date_signature_startday=' . urlencode((string) ($search_date_signature_startday)); |
|
1043 | 1043 | } |
1044 | 1044 | if ($search_date_signature_startmonth) { |
1045 | - $param .= '&search_date_signature_startmonth=' . urlencode((string)($search_date_signature_startmonth)); |
|
1045 | + $param .= '&search_date_signature_startmonth=' . urlencode((string) ($search_date_signature_startmonth)); |
|
1046 | 1046 | } |
1047 | 1047 | if ($search_date_signature_startyear) { |
1048 | - $param .= '&search_date_signature_startyear=' . urlencode((string)($search_date_signature_startyear)); |
|
1048 | + $param .= '&search_date_signature_startyear=' . urlencode((string) ($search_date_signature_startyear)); |
|
1049 | 1049 | } |
1050 | 1050 | if ($search_date_signature_endday) { |
1051 | - $param .= '&search_date_signature_endday=' . urlencode((string)($search_date_signature_endday)); |
|
1051 | + $param .= '&search_date_signature_endday=' . urlencode((string) ($search_date_signature_endday)); |
|
1052 | 1052 | } |
1053 | 1053 | if ($search_date_signature_endmonth) { |
1054 | - $param .= '&search_date_signature_endmonth=' . urlencode((string)($search_date_signature_endmonth)); |
|
1054 | + $param .= '&search_date_signature_endmonth=' . urlencode((string) ($search_date_signature_endmonth)); |
|
1055 | 1055 | } |
1056 | 1056 | if ($search_date_signature_endyear) { |
1057 | - $param .= '&search_date_signature_endyear=' . urlencode((string)($search_date_signature_endyear)); |
|
1057 | + $param .= '&search_date_signature_endyear=' . urlencode((string) ($search_date_signature_endyear)); |
|
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | // Add $param from extra fields |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; |
58 | 58 | |
59 | 59 | // $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; |
60 | -$showbirthday = 0; // will be hidden here |
|
60 | +$showbirthday = 0; // will be hidden here |
|
61 | 61 | |
62 | 62 | // If not choice done on calendar owner, we filter on user. |
63 | 63 | if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $week = $prev['week']; |
259 | 259 | |
260 | -$day = (int)$day; |
|
260 | +$day = (int) $day; |
|
261 | 261 | $next = dol_get_next_day($day, $month, $year); |
262 | 262 | $next_year = $year + 1; |
263 | 263 | $next_month = $month; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | } |
290 | 290 | if ($resourceid > 0) { |
291 | - $param .= "&search_resourceid=" . urlencode((string)($resourceid)); |
|
291 | + $param .= "&search_resourceid=" . urlencode((string) ($resourceid)); |
|
292 | 292 | } |
293 | 293 | if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) { |
294 | 294 | $param .= "&search_status=" . urlencode($status); |
@@ -300,16 +300,16 @@ discard block |
||
300 | 300 | $param .= "&search_filtert=" . urlencode($filtert); |
301 | 301 | } |
302 | 302 | if ($usergroup > 0) { |
303 | - $param .= "&search_usergroup=" . urlencode((string)($usergroup)); |
|
303 | + $param .= "&search_usergroup=" . urlencode((string) ($usergroup)); |
|
304 | 304 | } |
305 | 305 | if ($socid > 0) { |
306 | - $param .= "&search_socid=" . urlencode((string)($socid)); |
|
306 | + $param .= "&search_socid=" . urlencode((string) ($socid)); |
|
307 | 307 | } |
308 | 308 | if ($showbirthday) { |
309 | 309 | $param .= "&search_showbirthday=1"; |
310 | 310 | } |
311 | 311 | if ($pid) { |
312 | - $param .= "&search_projectid=" . urlencode((string)($pid)); |
|
312 | + $param .= "&search_projectid=" . urlencode((string) ($pid)); |
|
313 | 313 | } |
314 | 314 | if ($type) { |
315 | 315 | $param .= "&search_type=" . urlencode($type); |
@@ -324,12 +324,12 @@ discard block |
||
324 | 324 | $param .= '&end_h=' . urlencode($end_h); |
325 | 325 | } |
326 | 326 | if ($begin_d != '') { |
327 | - $param .= '&begin_d=' . urlencode((string)($begin_d)); |
|
327 | + $param .= '&begin_d=' . urlencode((string) ($begin_d)); |
|
328 | 328 | } |
329 | 329 | if ($end_d != '') { |
330 | - $param .= '&end_d=' . urlencode((string)($end_d)); |
|
330 | + $param .= '&end_d=' . urlencode((string) ($end_d)); |
|
331 | 331 | } |
332 | -$param .= "&maxprint=" . urlencode((string)($maxprint)); |
|
332 | +$param .= "&maxprint=" . urlencode((string) ($maxprint)); |
|
333 | 333 | |
334 | 334 | $paramnoactionodate = $param; |
335 | 335 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | $week = $prev['week']; |
345 | 345 | |
346 | -$day = (int)$day; |
|
346 | +$day = (int) $day; |
|
347 | 347 | $next = dol_get_next_day(31, 12, $year); |
348 | 348 | $next_year = $year + 1; |
349 | 349 | $next_month = $month; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $nav .= ' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>'; |
377 | 377 | |
378 | 378 | // Must be after the nav definition |
379 | -$param .= '&year=' . urlencode((string)($year)) . '&month=' . urlencode((string)($month)) . ($day ? '&day=' . urlencode((string)($day)) : ''); |
|
379 | +$param .= '&year=' . urlencode((string) ($year)) . '&month=' . urlencode((string) ($month)) . ($day ? '&day=' . urlencode((string) ($day)) : ''); |
|
380 | 380 | //print 'x'.$param; |
381 | 381 | |
382 | 382 | |
@@ -575,10 +575,10 @@ discard block |
||
575 | 575 | } |
576 | 576 | } |
577 | 577 | if ($resourceid > 0) { |
578 | - $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . ((int)$resourceid); |
|
578 | + $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . ((int) $resourceid); |
|
579 | 579 | } |
580 | 580 | if ($pid) { |
581 | - $sql .= " AND a.fk_project = " . ((int)$pid); |
|
581 | + $sql .= " AND a.fk_project = " . ((int) $pid); |
|
582 | 582 | } |
583 | 583 | // If the internal user must only see his customers, force searching by him |
584 | 584 | $search_sale = 0; |
@@ -590,12 +590,12 @@ discard block |
||
590 | 590 | if ($search_sale == -2) { |
591 | 591 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)"; |
592 | 592 | } elseif ($search_sale > 0) { |
593 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
593 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
594 | 594 | } |
595 | 595 | } |
596 | 596 | // Search on socid |
597 | 597 | if ($socid) { |
598 | - $sql .= " AND a.fk_soc = " . ((int)$socid); |
|
598 | + $sql .= " AND a.fk_soc = " . ((int) $socid); |
|
599 | 599 | } |
600 | 600 | // We must filter on assignment table |
601 | 601 | if ($filtert > 0 || $usergroup > 0) { |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $sql .= ')'; |
627 | 627 | } |
628 | 628 | if ($type) { |
629 | - $sql .= " AND ca.id = " . ((int)$type); |
|
629 | + $sql .= " AND ca.id = " . ((int) $type); |
|
630 | 630 | } |
631 | 631 | if ($status == '0') { |
632 | 632 | $sql .= " AND a.percent = 0"; |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $sql .= "ar.fk_element = " . $filtert; |
653 | 653 | } |
654 | 654 | if ($usergroup > 0) { |
655 | - $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . ((int)$usergroup); |
|
655 | + $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . ((int) $usergroup); |
|
656 | 656 | } |
657 | 657 | $sql .= ")"; |
658 | 658 | } |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | $mois = dol_print_date($daykey, '%m', 'tzuserrel'); |
1004 | 1004 | $jour = dol_print_date($daykey, '%d', 'tzuserrel'); |
1005 | 1005 | |
1006 | - if ($day == $jour && (int)$month == (int)$mois && $year == $annee) { // Is it the day we are looking for when calling function ? |
|
1006 | + if ($day == $jour && (int) $month == (int) $mois && $year == $annee) { // Is it the day we are looking for when calling function ? |
|
1007 | 1007 | // Scan all event for this date |
1008 | 1008 | foreach ($eventarray[$daykey] as $index => $event) { |
1009 | 1009 | //print 'daykey='.$daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."<br>\n"; |
@@ -1079,9 +1079,9 @@ discard block |
||
1079 | 1079 | //if ($username->id == 1 && $day==1) print 'h='.$h; |
1080 | 1080 | $newcolor = ''; //init |
1081 | 1081 | if (empty($event->fulldayevent)) { |
1082 | - $a = dol_mktime((int)$h, 0, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1083 | - $b = dol_mktime((int)$h, 30, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1084 | - $c = dol_mktime((int)$h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1082 | + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1083 | + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1084 | + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); |
|
1085 | 1085 | |
1086 | 1086 | $dateendtouse = $event->date_end_in_calendar; |
1087 | 1087 | if ($dateendtouse == $event->date_start_in_calendar) { |
@@ -426,7 +426,7 @@ |
||
426 | 426 | print '<table class="border centpercent tableforfield">' . "\n"; |
427 | 427 | |
428 | 428 | // Common attributes |
429 | - $keyforbreak = 'fk_c_ticket_category'; // We change column just before this field |
|
429 | + $keyforbreak = 'fk_c_ticket_category'; // We change column just before this field |
|
430 | 430 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
431 | 431 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
432 | 432 | $object->fields['answer']['enabled'] = 0; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | require_once constant('DOL_DOCUMENT_ROOT') . '/hrm/lib/hrm_skillrank.lib.php'; |
46 | 46 | |
47 | 47 | // Load translation files required by the page |
48 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
48 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
49 | 49 | |
50 | 50 | // Get parameters |
51 | 51 | $id = GETPOSTINT('id'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if ($action == 'close') { |
176 | 176 | // save evaldet lines to user; |
177 | 177 | $sk = new SkillRank($db); |
178 | - $SkillrecordsForActiveUser = $sk->fetchAll('ASC', 'fk_skill', 0, 0, "(fk_object:=:" . ((int)$object->fk_user) . ") AND (objecttype:=:'" . $db->escape(SkillRank::SKILLRANK_TYPE_USER) . "')", 'AND'); |
|
178 | + $SkillrecordsForActiveUser = $sk->fetchAll('ASC', 'fk_skill', 0, 0, "(fk_object:=:" . ((int) $object->fk_user) . ") AND (objecttype:=:'" . $db->escape(SkillRank::SKILLRANK_TYPE_USER) . "')", 'AND'); |
|
179 | 179 | |
180 | 180 | $errors = 0; |
181 | 181 | // we go through the evaldets of the eval |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_user ON (skdet_user.fk_skill = sk.rowid AND skdet_user.rankorder = ed.rankorder)'; |
551 | 551 | //$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "hrm_skillrank as skr ON (j.rowid = skr.fk_object AND skr.fk_skill = ed.fk_skill AND skr.objecttype = 'job')"; |
552 | 552 | $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_required ON (skdet_required.fk_skill = sk.rowid AND skdet_required.rankorder = ed.required_rank)'; |
553 | - $sql .= " WHERE e.rowid =" . ((int)$object->id); |
|
553 | + $sql .= " WHERE e.rowid =" . ((int) $object->id); |
|
554 | 554 | |
555 | 555 | // echo $sql; |
556 | 556 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | require_once constant('DOL_DOCUMENT_ROOT') . '/hrm/lib/hrm_job.lib.php'; |
42 | 42 | |
43 | 43 | // Load translation files required by the page |
44 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
44 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
45 | 45 | |
46 | 46 | // Get parameters |
47 | 47 | $id = GETPOSTINT('id'); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | require_once constant('DOL_DOCUMENT_ROOT') . '/hrm/lib/hrm_skill.lib.php'; |
42 | 42 | |
43 | 43 | // Load translation files required by the page |
44 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
44 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
45 | 45 | |
46 | 46 | // Get parameters |
47 | 47 | $id = GETPOSTINT('id'); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | // Default sort order (if not yet defined by previous GETPOST) |
531 | 531 | if (!$sortfield) { |
532 | - reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
532 | + reset($objectline->fields); // Reset is required to avoid key() to return null. |
|
533 | 533 | $sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition. |
534 | 534 | } |
535 | 535 | if (!$sortorder) { |
@@ -562,11 +562,11 @@ discard block |
||
562 | 562 | foreach ($objectline->fields as $key => $val) { |
563 | 563 | // If $val['visible']==0, then we never show the field |
564 | 564 | if (!empty($val['visible'])) { |
565 | - $visible = (int)dol_eval($val['visible'], 1, 1, '1'); |
|
565 | + $visible = (int) dol_eval($val['visible'], 1, 1, '1'); |
|
566 | 566 | $arrayfields['t.' . $key] = array( |
567 | 567 | 'label' => $val['label'], |
568 | 568 | 'checked' => (($visible < 0) ? 0 : 1), |
569 | - 'enabled' => (abs($visible) != 3 && (int)dol_eval($val['enabled'], 1, 1, '1')), |
|
569 | + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), |
|
570 | 570 | 'position' => $val['position'], |
571 | 571 | 'help' => isset($val['help']) ? $val['help'] : '' |
572 | 572 | ); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | } else { |
602 | 602 | $sql .= " WHERE 1 = 1 "; |
603 | 603 | } |
604 | - $sql .= " AND fk_skill = " . ((int)$id); |
|
604 | + $sql .= " AND fk_skill = " . ((int) $id); |
|
605 | 605 | |
606 | 606 | $resql = $db->query($sql); |
607 | 607 | $nbtotalofrecords = $db->num_rows($resql); |
@@ -99,8 +99,8 @@ |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | // List of targets fields |
102 | -$headerlinefields = array(); // Array of fields (label to show) |
|
103 | -$contentlinevalues = array(); // Array of example values |
|
102 | +$headerlinefields = array(); // Array of fields (label to show) |
|
103 | +$contentlinevalues = array(); // Array of example values |
|
104 | 104 | $i = 0; |
105 | 105 | foreach ($fieldstarget as $code => $label) { |
106 | 106 | $withoutstar = preg_replace('/\*/', '', $fieldstarget[$code]); |