@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $this->db = $db; |
137 | 137 | $this->name = "vinci"; |
138 | 138 | $this->description = $langs->trans('DocumentModelStandardPDF'); |
139 | - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template |
|
139 | + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template |
|
140 | 140 | |
141 | 141 | // Page size for A4 format |
142 | 142 | $this->type = 'pdf'; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | if ($this->getColumnStatus('desc')) { |
565 | 565 | $pdf->startTransaction(); //description |
566 | 566 | $des = $prod -> description; |
567 | - $descr = $des;//implode("<br>", $des); |
|
567 | + $descr = $des; //implode("<br>", $des); |
|
568 | 568 | |
569 | 569 | $this->printStdColumnContent($pdf, $curY, 'desc', $descr); |
570 | 570 | |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | $pdf->SetFont('', 'B', $default_font_size + 3); |
1200 | 1200 | $pdf->SetXY($posx, $posy); |
1201 | 1201 | $pdf->SetTextColor(0, 0, 60); |
1202 | - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("QtyToProduce").": " .$object->qty, '', 'R'); |
|
1202 | + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("QtyToProduce").": ".$object->qty, '', 'R'); |
|
1203 | 1203 | |
1204 | 1204 | |
1205 | 1205 | $pdf->SetTextColor(0, 0, 60); |
@@ -1120,7 +1120,9 @@ |
||
1120 | 1120 | global $langs, $conf, $mysoc; |
1121 | 1121 | |
1122 | 1122 | $ltrdirection = 'L'; |
1123 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1123 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1124 | + $ltrdirection = 'R'; |
|
1125 | + } |
|
1124 | 1126 | |
1125 | 1127 | // Load translation files required by the page |
1126 | 1128 | $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); |
@@ -905,13 +905,13 @@ discard block |
||
905 | 905 | $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; |
906 | 906 | $sql .= " AND ug.fk_user = u.rowid "; |
907 | 907 | } else { |
908 | - if ($usergroup > 0) { |
|
908 | + if ($usergroup > 0) { |
|
909 | 909 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; |
910 | 910 | } |
911 | 911 | $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
912 | 912 | } |
913 | 913 | $sql .= " AND u.statut = 1"; |
914 | - if ($usergroup > 0) { |
|
914 | + if ($usergroup > 0) { |
|
915 | 915 | $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); |
916 | 916 | } |
917 | 917 | |
@@ -1134,8 +1134,8 @@ discard block |
||
1134 | 1134 | // We are in a particular day for $username, now we scan all events |
1135 | 1135 | foreach ($eventarray as $daykey => $notused) { |
1136 | 1136 | $annee = dol_print_date($daykey, '%Y'); |
1137 | - $mois = dol_print_date($daykey, '%m'); |
|
1138 | - $jour = dol_print_date($daykey, '%d'); |
|
1137 | + $mois = dol_print_date($daykey, '%m'); |
|
1138 | + $jour = dol_print_date($daykey, '%d'); |
|
1139 | 1139 | |
1140 | 1140 | if ($day == $jour && $month == $mois && $year == $annee) { // Is it the day we are looking for when calling function ? |
1141 | 1141 | // Scan all event for this date |
@@ -304,8 +304,11 @@ |
||
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
307 | - if (!$error) $db->commit(); |
|
308 | - else $db->rollback(); |
|
307 | + if (!$error) { |
|
308 | + $db->commit(); |
|
309 | + } else { |
|
310 | + $db->rollback(); |
|
311 | + } |
|
309 | 312 | } |
310 | 313 | } |
311 | 314 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $search_date_order_endday = GETPOST('search_date_order_endday', 'int'); |
65 | 65 | $search_date_order_endmonth = GETPOST('search_date_order_endmonth', 'int'); |
66 | 66 | $search_date_order_endyear = GETPOST('search_date_order_endyear', 'int'); |
67 | -$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver |
|
67 | +$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver |
|
68 | 68 | $search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear); |
69 | 69 | |
70 | 70 | $search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int'); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int'); |
74 | 74 | $search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int'); |
75 | 75 | $search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int'); |
76 | -$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
76 | +$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
77 | 77 | $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); |
78 | 78 | |
79 | 79 | $search_date_valid_startday = GETPOST('search_date_valid_startday', 'int'); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $search_date_valid_endday = GETPOST('search_date_valid_endday', 'int'); |
83 | 83 | $search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int'); |
84 | 84 | $search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int'); |
85 | -$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
85 | +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
86 | 86 | $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); |
87 | 87 | |
88 | 88 | $search_date_approve_startday = GETPOST('search_date_approve_startday', 'int'); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $search_date_approve_endday = GETPOST('search_date_approve_endday', 'int'); |
92 | 92 | $search_date_approve_endmonth = GETPOST('search_date_approve_endmonth', 'int'); |
93 | 93 | $search_date_approve_endyear = GETPOST('search_date_approve_endyear', 'int'); |
94 | -$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver |
|
94 | +$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver |
|
95 | 95 | $search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear); |
96 | 96 | |
97 | 97 | $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | $db->begin(); |
372 | 372 | |
373 | - $default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S'); |
|
373 | + $default_ref_supplier = dol_print_date(dol_now(), '%Y%m%d%H%M%S'); |
|
374 | 374 | |
375 | 375 | foreach ($orders as $id_order) { |
376 | 376 | $cmd = new CommandeFournisseur($db); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $objecttmp->fk_project = $cmd->fk_project; |
390 | 390 | $objecttmp->multicurrency_code = $cmd->multicurrency_code; |
391 | 391 | $objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier; |
392 | - $default_ref_supplier+=1; |
|
392 | + $default_ref_supplier += 1; |
|
393 | 393 | |
394 | 394 | $datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
395 | 395 | if (empty($datefacture)) { |
@@ -885,9 +885,9 @@ discard block |
||
885 | 885 | if ($search_user > 0) { |
886 | 886 | $sql .= " AND EXISTS ("; |
887 | 887 | $sql .= " SELECT ec.rowid "; |
888 | - $sql .= " FROM " . MAIN_DB_PREFIX . "element_contact as ec"; |
|
889 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact"; |
|
890 | - $sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = " . ((int) $search_user); |
|
888 | + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; |
|
889 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact"; |
|
890 | + $sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = ".((int) $search_user); |
|
891 | 891 | $sql .= " AND tc.element = 'order_supplier' AND tc.source = 'internal'"; |
892 | 892 | $sql .= ")"; |
893 | 893 | } |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | if ($searchCategoryProductOperator == 0) { |
932 | 932 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
933 | 933 | } else { |
934 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
934 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
935 | 935 | } |
936 | 936 | } |
937 | 937 | } |
@@ -152,7 +152,9 @@ |
||
152 | 152 | accessforbidden(); |
153 | 153 | } |
154 | 154 | $result = restrictedArea($user, 'eventorganization'); |
155 | -if (!$permissiontoread) accessforbidden(); |
|
155 | +if (!$permissiontoread) { |
|
156 | + accessforbidden(); |
|
157 | +} |
|
156 | 158 | |
157 | 159 | |
158 | 160 | /* |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // Default sort order (if not yet defined by previous GETPOST) |
89 | 89 | if (!$sortfield) { |
90 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
90 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
91 | 91 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
92 | 92 | } |
93 | 93 | if (!$sortorder) { |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) { |
161 | 161 | $project = new Project($db); |
162 | 162 | //If "set" fields keys is in projects fields |
163 | - $project_attr=preg_replace('/^set/', '', $action); |
|
163 | + $project_attr = preg_replace('/^set/', '', $action); |
|
164 | 164 | if (array_key_exists($project_attr, $project->fields)) { |
165 | 165 | $result = $project->fetch($projectid, $projectref); |
166 | 166 | if ($result < 0) { |
167 | 167 | setEventMessages(null, $project->errors, 'errors'); |
168 | 168 | } else { |
169 | - $project->{$project_attr}=GETPOST($project_attr); |
|
170 | - $result=$project->update($user); |
|
169 | + $project->{$project_attr} = GETPOST($project_attr); |
|
170 | + $result = $project->update($user); |
|
171 | 171 | if ($result < 0) { |
172 | 172 | setEventMessages(null, $project->errors, 'errors'); |
173 | 173 | } |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; |
260 | - $title = $langs->trans("Project") . ' - ' . $langs->trans("EventOrganizationConfOrBoothes") . ' - ' . $project->ref . ' ' . $project->name; |
|
260 | + $title = $langs->trans("Project").' - '.$langs->trans("EventOrganizationConfOrBoothes").' - '.$project->ref.' '.$project->name; |
|
261 | 261 | if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $project->name) { |
262 | - $title = $project->ref . ' ' . $project->name . ' - ' . $langs->trans("ListOfConferencesOrBooths"); |
|
262 | + $title = $project->ref.' '.$project->name.' - '.$langs->trans("ListOfConferencesOrBooths"); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
565 | 565 | } |
566 | 566 | if (preg_match('/_dtend$/', $key)) { |
567 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
567 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
568 | 568 | } |
569 | 569 | } |
570 | 570 | } |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
665 | 665 | |
666 | -print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid)?'?projectid='.$projectid:'').'">'."\n"; |
|
666 | +print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid) ? '?projectid='.$projectid : '').'">'."\n"; |
|
667 | 667 | if ($optioncss != '') { |
668 | 668 | print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
669 | 669 | } |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | |
678 | 678 | $title = $langs->trans("EventOrganizationConfOrBoothes"); |
679 | 679 | |
680 | -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd); |
|
680 | +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id) ? '?projectid='.$project->id : ''), '', $permissiontoadd); |
|
681 | 681 | |
682 | 682 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
683 | 683 | |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">'; |
747 | 747 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
748 | 748 | print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
749 | - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { |
|
749 | + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { |
|
750 | 750 | print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1); |
751 | 751 | } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
752 | 752 | print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($searchkey).'">'; |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | if ($key == 'status') { |
857 | 857 | print $object->getLibStatut(5); |
858 | 858 | } elseif ($key == 'ref') { |
859 | - print $object->getNomUrl(1, 0, '', (($projectid > 0)?'withproject':'')); |
|
859 | + print $object->getNomUrl(1, 0, '', (($projectid > 0) ? 'withproject' : '')); |
|
860 | 860 | } else { |
861 | 861 | print $object->showOutputField($val, $key, $object->$key, ''); |
862 | 862 | } |
@@ -206,12 +206,12 @@ |
||
206 | 206 | $entry .= '</td>'; |
207 | 207 | $entry .= '<td class="right" width="20px;">'; |
208 | 208 | if ($user->rights->categorie->creer) { |
209 | - $entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>'; |
|
209 | + $entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>'; |
|
210 | 210 | } |
211 | 211 | $entry .= '</td>'; |
212 | 212 | $entry .= '<td class="right" width="20px;">'; |
213 | 213 | if ($user->rights->categorie->supprimer) { |
214 | - $entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>'; |
|
214 | + $entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>'; |
|
215 | 215 | } |
216 | 216 | $entry .= '</td>'; |
217 | 217 |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | |
141 | 141 | // Add here list of permission defined by an id, a label, a boolean and two constant strings. |
142 | 142 | // Example: |
143 | - $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) |
|
144 | - $this->rights[$r][1] = 'Générer / modifier la clé API des utilisateurs'; // Permission label |
|
145 | - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) |
|
146 | - $this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) |
|
147 | - $this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) |
|
143 | + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) |
|
144 | + $this->rights[$r][1] = 'Générer / modifier la clé API des utilisateurs'; // Permission label |
|
145 | + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) |
|
146 | + $this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) |
|
147 | + $this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) |
|
148 | 148 | $r++; |
149 | 149 | |
150 | 150 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | { |
248 | 248 | // Remove old constants with entity fields different of 0 |
249 | 249 | $sql = array( |
250 | - "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('MAIN_MODULE_API'), // API can't be enabled per environment. Why ? |
|
250 | + "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('MAIN_MODULE_API'), // API can't be enabled per environment. Why ? |
|
251 | 251 | "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('API_PRODUCTION_MODE') // Not in production mode by default at activation |
252 | 252 | ); |
253 | 253 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
81 | 81 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
82 | 82 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
83 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
83 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
84 | 84 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
85 | 85 | $search_date_when_startday = GETPOST('search_date_when_startday', 'int'); |
86 | 86 | $search_date_when_startmonth = GETPOST('search_date_when_startmonth', 'int'); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $search_date_when_endday = GETPOST('search_date_when_endday', 'int'); |
89 | 89 | $search_date_when_endmonth = GETPOST('search_date_when_endmonth', 'int'); |
90 | 90 | $search_date_when_endyear = GETPOST('search_date_when_endyear', 'int'); |
91 | -$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver |
|
91 | +$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver |
|
92 | 92 | $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); |
93 | 93 | $search_recurring = GETPOST('search_recurring', 'int'); |
94 | 94 | $search_frequency = GETPOST('search_frequency', 'alpha'); |
@@ -49,7 +49,9 @@ |
||
49 | 49 | $socid = GETPOST('socid', 'int'); |
50 | 50 | |
51 | 51 | // Security check |
52 | -if ($user->socid) $socid = $user->socid; |
|
52 | +if ($user->socid) { |
|
53 | + $socid = $user->socid; |
|
54 | +} |
|
53 | 55 | |
54 | 56 | $search_ref = GETPOST('search_ref', 'alpha'); |
55 | 57 | $search_date_startday = GETPOST('search_date_startday', 'int'); |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | // Security check |
54 | 54 | if ($user->socid) $socid = $user->socid; |
55 | 55 | |
56 | -$search_ref = GETPOST('search_ref', 'alpha'); |
|
57 | -$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
58 | -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
59 | -$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
56 | +$search_ref = GETPOST('search_ref', 'alpha'); |
|
57 | +$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
58 | +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
59 | +$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
60 | 60 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
61 | -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
61 | +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
62 | 62 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
63 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
63 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
64 | 64 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
65 | 65 | $search_company = GETPOST('search_company', 'alpha'); |
66 | 66 | $search_payment_type = GETPOST('search_payment_type'); |
67 | -$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); |
|
67 | +$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); |
|
68 | 68 | $search_bank_account = GETPOST('search_bank_account', 'int'); |
69 | -$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' |
|
69 | +$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' |
|
70 | 70 | |
71 | 71 | $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
72 | 72 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | $sql .= natural_search('p.ref', $search_ref); |
208 | 208 | } |
209 | 209 | if ($search_date_start) { |
210 | - $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; |
|
210 | + $sql .= " AND p.datep >= '".$db->idate($search_date_start)."'"; |
|
211 | 211 | } |
212 | 212 | if ($search_date_end) { |
213 | - $sql .=" AND p.datep <= '" . $db->idate($search_date_end) . "'"; |
|
213 | + $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | if ($search_company) { |
@@ -340,8 +340,8 @@ discard block |
||
340 | 340 | } |
341 | 341 | |
342 | 342 | $res = $line->fetch_product(); |
343 | - if ($res > 0 ) { |
|
344 | - if ( $line->product->isMandatoryPeriod() && $line->product->isService()) { |
|
343 | + if ($res > 0) { |
|
344 | + if ($line->product->isMandatoryPeriod() && $line->product->isService()) { |
|
345 | 345 | print 'jQuery("#date_start").addClass("error");'; |
346 | 346 | } |
347 | 347 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | |
357 | 357 | $res = $line->fetch_product(); |
358 | 358 | // on doit fetch le product là !!! pour connaître le type |
359 | - if ($res > 0 ) { |
|
359 | + if ($res > 0) { |
|
360 | 360 | if ($line->product->isMandatoryperiod() && $line->product->isService()) { |
361 | 361 | print 'jQuery("#date_end").addClass("error");'; |
362 | 362 | } |