@@ -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 | /* |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | // Default sort order (if not yet defined by previous GETPOST) |
87 | 87 | if (!$sortfield) { |
88 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
88 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
89 | 89 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
90 | 90 | } |
91 | 91 | if (!$sortorder) { |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | |
158 | 158 | if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) { |
159 | 159 | //If "set" fields keys is in projects fields |
160 | - $project_attr=preg_replace('/^set/', '', $action); |
|
160 | + $project_attr = preg_replace('/^set/', '', $action); |
|
161 | 161 | if (array_key_exists($project_attr, $project->fields)) { |
162 | 162 | $result = $project->fetch($projectid, $projectref); |
163 | 163 | if ($result < 0) { |
164 | 164 | setEventMessages(null, $project->errors, 'errors'); |
165 | 165 | } else { |
166 | 166 | $projectid = $project->id; |
167 | - $project->{$project_attr}=GETPOST($project_attr); |
|
168 | - $result=$project->update($user); |
|
167 | + $project->{$project_attr} = GETPOST($project_attr); |
|
168 | + $result = $project->update($user); |
|
169 | 169 | if ($result < 0) { |
170 | 170 | setEventMessages(null, $project->errors, 'errors'); |
171 | 171 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | if ($permissiontoadd && (($action == 'setstatus' && $confirm == "yes") || $massaction == 'setstatus')) { |
228 | 228 | $db->begin(); |
229 | - $error = 0;$nbok = 0; |
|
229 | + $error = 0; $nbok = 0; |
|
230 | 230 | $objecttmp = new $objectclass($db); |
231 | 231 | foreach ($toselect as $key => $idselect) { |
232 | 232 | $result = $objecttmp->fetch($idselect); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | } else { |
244 | 244 | setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); |
245 | - $error ++; |
|
245 | + $error++; |
|
246 | 246 | break; |
247 | 247 | } |
248 | 248 | } |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | } |
293 | 293 | |
294 | 294 | $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; |
295 | - $title = $langs->trans("Project") . ' - ' . $langs->trans("EventOrganizationConfOrBoothes") . ' - ' . $project->ref . ' ' . $project->name; |
|
295 | + $title = $langs->trans("Project").' - '.$langs->trans("EventOrganizationConfOrBoothes").' - '.$project->ref.' '.$project->name; |
|
296 | 296 | if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $project->name) { |
297 | - $title = $project->ref . ' ' . $project->name . ' - ' . $langs->trans("ListOfConferencesOrBooths"); |
|
297 | + $title = $project->ref.' '.$project->name.' - '.$langs->trans("ListOfConferencesOrBooths"); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | } |
725 | 725 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
726 | 726 | |
727 | -print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid)?'?projectid='.$projectid:'').'">'."\n"; |
|
727 | +print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].(!empty($projectid) ? '?projectid='.$projectid : '').'">'."\n"; |
|
728 | 728 | if ($optioncss != '') { |
729 | 729 | print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
730 | 730 | } |
@@ -740,10 +740,10 @@ discard block |
||
740 | 740 | |
741 | 741 | |
742 | 742 | $newcardbutton = ''; |
743 | -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); |
|
744 | -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); |
|
743 | +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); |
|
744 | +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); |
|
745 | 745 | $newcardbutton .= dolGetButtonTitleSeparator(); |
746 | -$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); |
|
746 | +$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); |
|
747 | 747 | |
748 | 748 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
749 | 749 | |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
896 | 896 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
897 | 897 | } |
898 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
898 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
899 | 899 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
900 | 900 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
901 | 901 | $totalarray['nbfield']++; |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | if ($key == 'status') { |
1009 | 1009 | print $object->getLibStatut(5); |
1010 | 1010 | } elseif ($key == 'ref') { |
1011 | - print $object->getNomUrl(1, 0, '', (($projectid > 0)?'withproject':'')); |
|
1011 | + print $object->getNomUrl(1, 0, '', (($projectid > 0) ? 'withproject' : '')); |
|
1012 | 1012 | } else { |
1013 | 1013 | print $object->showOutputField($val, $key, $object->$key, ''); |
1014 | 1014 | } |
@@ -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 |
@@ -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 | } |
@@ -4025,7 +4025,9 @@ discard block |
||
4025 | 4025 | } |
4026 | 4026 | } |
4027 | 4027 | } |
4028 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4028 | + if ($nbMandated > 0 ) { |
|
4029 | + $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4030 | + } |
|
4029 | 4031 | |
4030 | 4032 | |
4031 | 4033 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2); |
@@ -5276,9 +5278,12 @@ discard block |
||
5276 | 5278 | |
5277 | 5279 | $parameters = array(); |
5278 | 5280 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
5279 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
5280 | - if (empty($reshook)) |
|
5281 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
5281 | + if ($reshook < 0) { |
|
5282 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
5283 | + } |
|
5284 | + if (empty($reshook)) { |
|
5285 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
5286 | + } |
|
5282 | 5287 | } |
5283 | 5288 | } |
5284 | 5289 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | // General $Variables |
83 | -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility |
|
83 | +$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility |
|
84 | 84 | $ref = GETPOST('ref', 'alpha'); |
85 | 85 | $socid = GETPOST('socid', 'int'); |
86 | 86 | $action = GETPOST('action', 'aZ09'); |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | $error++; |
1010 | 1010 | } |
1011 | 1011 | |
1012 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
1012 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
1013 | 1013 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); |
1014 | 1014 | |
1015 | 1015 | // Replacement invoice |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
1098 | 1098 | $object->model_pdf = GETPOST('model'); |
1099 | 1099 | $object->fk_project = GETPOST('projectid', 'int'); |
1100 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
1100 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
1101 | 1101 | $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); |
1102 | 1102 | $object->fk_account = GETPOST('fk_account', 'int'); |
1103 | 1103 | $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
1390 | 1390 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
1391 | 1391 | $object->ref_client = GETPOST('ref_client'); |
1392 | - $object->ref_customer = GETPOST('ref_client'); |
|
1392 | + $object->ref_customer = GETPOST('ref_client'); |
|
1393 | 1393 | $object->model_pdf = GETPOST('model'); |
1394 | 1394 | $object->fk_project = GETPOST('projectid', 'int'); |
1395 | 1395 | $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -1941,7 +1941,7 @@ discard block |
||
1941 | 1941 | $object->fk_project = GETPOST('projectid', 'int'); |
1942 | 1942 | $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); |
1943 | 1943 | $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); |
1944 | - $object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2); |
|
1944 | + $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); |
|
1945 | 1945 | $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); |
1946 | 1946 | $object->fk_account = GETPOST('fk_account', 'int'); |
1947 | 1947 | |
@@ -2025,7 +2025,7 @@ discard block |
||
2025 | 2025 | |
2026 | 2026 | // Set if we used free entry or predefined product |
2027 | 2027 | $predef = ''; |
2028 | - $product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); |
|
2028 | + $product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : ''); |
|
2029 | 2029 | |
2030 | 2030 | $price_ht = ''; |
2031 | 2031 | $price_ht_devise = ''; |
@@ -2219,8 +2219,8 @@ discard block |
||
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time |
2222 | - if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
2223 | - $product_desc=''; |
|
2222 | + if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
2223 | + $product_desc = ''; |
|
2224 | 2224 | } |
2225 | 2225 | |
2226 | 2226 | if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { |
@@ -2470,7 +2470,7 @@ discard block |
||
2470 | 2470 | // Define special_code for special lines |
2471 | 2471 | $special_code = GETPOST('special_code', 'int'); |
2472 | 2472 | if ($special_code == 3) { |
2473 | - $special_code = 0; // Options should not exists on invoices |
|
2473 | + $special_code = 0; // Options should not exists on invoices |
|
2474 | 2474 | } |
2475 | 2475 | |
2476 | 2476 | $line = new FactureLigne($db); |
@@ -3084,7 +3084,7 @@ discard block |
||
3084 | 3084 | |
3085 | 3085 | if (isModEnabled('multicurrency')) { |
3086 | 3086 | $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
3087 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
3087 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
3088 | 3088 | } |
3089 | 3089 | |
3090 | 3090 | //Replicate extrafields |
@@ -3136,7 +3136,7 @@ discard block |
||
3136 | 3136 | |
3137 | 3137 | // when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value |
3138 | 3138 | if ($socid > 0 && $fk_account) { // A company has already been set and it has a default fk_account |
3139 | - $fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company |
|
3139 | + $fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company |
|
3140 | 3140 | } else { // No company forced |
3141 | 3141 | $fk_account = GETPOST("fk_account", 'int'); |
3142 | 3142 | } |
@@ -3167,7 +3167,7 @@ discard block |
||
3167 | 3167 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
3168 | 3168 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
3169 | 3169 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
3170 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
3170 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
3171 | 3171 | if ($soc->id > 0) { |
3172 | 3172 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
3173 | 3173 | } |
@@ -3756,7 +3756,7 @@ discard block |
||
3756 | 3756 | // Payment mode |
3757 | 3757 | print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">'; |
3758 | 3758 | print img_picto('', 'bank', 'class="pictofixedwidth"'); |
3759 | - print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0)? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); |
|
3759 | + print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1); |
|
3760 | 3760 | print '</td></tr>'; |
3761 | 3761 | |
3762 | 3762 | // Bank Account |
@@ -3831,7 +3831,7 @@ discard block |
||
3831 | 3831 | print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>'; |
3832 | 3832 | print '<td colspan="2" class="maxwidthonsmartphone">'; |
3833 | 3833 | print img_picto('', 'currency', 'class="pictofixedwidth"'); |
3834 | - print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code'); |
|
3834 | + print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code'); |
|
3835 | 3835 | print '</td></tr>'; |
3836 | 3836 | } |
3837 | 3837 | |
@@ -4198,14 +4198,14 @@ discard block |
||
4198 | 4198 | $nbMandated = 0; |
4199 | 4199 | foreach ($object->lines as $line) { |
4200 | 4200 | $res = $line->fetch_product(); |
4201 | - if ($res > 0 ) { |
|
4202 | - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { |
|
4201 | + if ($res > 0) { |
|
4202 | + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
|
4203 | 4203 | $nbMandated++; |
4204 | 4204 | break; |
4205 | 4205 | } |
4206 | 4206 | } |
4207 | 4207 | } |
4208 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4208 | + if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4209 | 4209 | |
4210 | 4210 | |
4211 | 4211 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2); |
@@ -4820,40 +4820,40 @@ discard block |
||
4820 | 4820 | } |
4821 | 4821 | print '<tr>'; |
4822 | 4822 | // Amount HT |
4823 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
4824 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
4823 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
4824 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
4825 | 4825 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
4826 | 4826 | // Multicurrency Amount HT |
4827 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
4827 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
4828 | 4828 | } |
4829 | 4829 | print '</tr>'; |
4830 | 4830 | |
4831 | 4831 | print '<tr>'; |
4832 | 4832 | // Amount VAT |
4833 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
4834 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
4833 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
4834 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
4835 | 4835 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
4836 | 4836 | // Multicurrency Amount VAT |
4837 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
4837 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
4838 | 4838 | } |
4839 | 4839 | print '</tr>'; |
4840 | 4840 | |
4841 | 4841 | // Amount Local Taxes |
4842 | 4842 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
4843 | 4843 | print '<tr>'; |
4844 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
4845 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
4844 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
4845 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
4846 | 4846 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
4847 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
4847 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
4848 | 4848 | } |
4849 | 4849 | print '</tr>'; |
4850 | 4850 | |
4851 | 4851 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
4852 | 4852 | print '<tr>'; |
4853 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
4854 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
4853 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
4854 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
4855 | 4855 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
4856 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
4856 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
4857 | 4857 | } |
4858 | 4858 | print '</tr>'; |
4859 | 4859 | } |
@@ -4915,11 +4915,11 @@ discard block |
||
4915 | 4915 | |
4916 | 4916 | print '<tr>'; |
4917 | 4917 | // Amount TTC |
4918 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
4919 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
4918 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
4919 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
4920 | 4920 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
4921 | 4921 | // Multicurrency Amount TTC |
4922 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
4922 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
4923 | 4923 | } |
4924 | 4924 | print '</tr>'; |
4925 | 4925 | |
@@ -5318,7 +5318,7 @@ discard block |
||
5318 | 5318 | print '</td>'; |
5319 | 5319 | print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'; |
5320 | 5320 | //print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' '; |
5321 | - print price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td> </td></tr>'; |
|
5321 | + print price(price2num($object->multicurrency_tx * $resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td> </td></tr>'; |
|
5322 | 5322 | } |
5323 | 5323 | |
5324 | 5324 | // Retained warranty : usualy use on construction industry |
@@ -5566,7 +5566,7 @@ discard block |
||
5566 | 5566 | $langs->load("contracts"); |
5567 | 5567 | |
5568 | 5568 | if ($usercancreatecontract) { |
5569 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
5569 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
5570 | 5570 | } |
5571 | 5571 | } |
5572 | 5572 | } |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | return 0; // Module not active, we do nothing |
76 | 76 | } |
77 | 77 | |
78 | - $error=0; |
|
78 | + $error = 0; |
|
79 | 79 | |
80 | 80 | // Actions |
81 | 81 | if ($action == 'PROJECT_VALIDATE') { |
82 | 82 | if (!empty($conf->global->EVENTORGANIZATION_TASK_LABEL) && !empty($object->usage_organize_event)) { |
83 | 83 | $taskToDo = explode("\n", $conf->global->EVENTORGANIZATION_TASK_LABEL); |
84 | - if (is_array($taskToDo) && count($taskToDo)>0) { |
|
84 | + if (is_array($taskToDo) && count($taskToDo) > 0) { |
|
85 | 85 | // Load translation files required by the page |
86 | 86 | $langs->loadLangs(array("eventorganization")); |
87 | 87 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | $task->fk_project = $object->id; |
93 | 93 | $defaultref = ''; |
94 | 94 | $obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; |
95 | - if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . ".php")) { |
|
96 | - require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . '.php'; |
|
95 | + if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) { |
|
96 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; |
|
97 | 97 | $modTask = new $obj; |
98 | 98 | $defaultref = $modTask->getNextValue($object->thirdparty, null); |
99 | 99 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $result = $task->create($user); |
110 | 110 | if ($result < 0) { |
111 | - $this->errors=array_merge($this->errors, $task->errors); |
|
111 | + $this->errors = array_merge($this->errors, $task->errors); |
|
112 | 112 | $error++; |
113 | 113 | } |
114 | 114 | } |
@@ -81,12 +81,12 @@ |
||
81 | 81 | $response = array(); |
82 | 82 | while ($i < $num) { |
83 | 83 | $obj = $db->fetch_object($resql); |
84 | - $response[] = array('title'=>$obj->question,'ref'=>$obj->ref,'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url'=>$obj->url); |
|
84 | + $response[] = array('title'=>$obj->question, 'ref'=>$obj->ref, 'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)), 'url'=>$obj->url); |
|
85 | 85 | $i++; |
86 | 86 | } |
87 | 87 | } else { |
88 | 88 | dol_print_error($db); |
89 | 89 | } |
90 | - $response =json_encode($response); |
|
90 | + $response = json_encode($response); |
|
91 | 91 | echo $response; |
92 | 92 | } |
@@ -302,7 +302,7 @@ |
||
302 | 302 | |
303 | 303 | $multicurrency = new MultiCurrency($this->db); |
304 | 304 | |
305 | - if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) { |
|
305 | + if (!$multicurrency->checkCodeAlreadyExists($conf->currency)) { |
|
306 | 306 | $langs->loadCacheCurrencies(''); |
307 | 307 | |
308 | 308 | $multicurrency->code = $conf->currency; |