@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | print '<div class="fichecenter">'; |
68 | 68 | print '<div class="fichehalfleft">'; |
69 | 69 | print '<div class="underbanner clearboth"></div>'; |
70 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
70 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
71 | 71 | $mode_info['fields'] = dol_sort_array($mode_info['fields'], 'position'); |
72 | 72 | foreach ($mode_info['fields'] as $field_key => $field_info) { |
73 | 73 | if (!empty($field_info['enabled_field'])) { |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | print '<table class="border centpercent tableforfield">'; |
95 | 95 | } |
96 | 96 | |
97 | - $key = $mode_key . '_' . $field_key; |
|
97 | + $key = $mode_key.'_'.$field_key; |
|
98 | 98 | $value = $assetdepreciationoptions->deprecation_options[$mode_key][$field_key]; |
99 | 99 | |
100 | - print '<tr class="field_' . $key . '"><td'; |
|
101 | - print ' class="' . (empty($field_info['tdcss']) ? 'titlefield' : $field_info['tdcss']) . ' fieldname_' . $key; |
|
100 | + print '<tr class="field_'.$key.'"><td'; |
|
101 | + print ' class="'.(empty($field_info['tdcss']) ? 'titlefield' : $field_info['tdcss']).' fieldname_'.$key; |
|
102 | 102 | if ($field_info['type'] == 'text' || $field_info['type'] == 'html') { |
103 | 103 | print ' tdtop'; |
104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | } |
114 | 114 | } |
115 | 115 | print '</td>'; |
116 | - print '<td class="valuefield fieldname_' . $key; |
|
116 | + print '<td class="valuefield fieldname_'.$key; |
|
117 | 117 | if ($field_info['type'] == 'text') { |
118 | 118 | print ' wordbreak'; |
119 | 119 | } |
120 | 120 | if (!empty($field_info['cssview'])) { |
121 | - print ' ' . $field_info['cssview']; |
|
121 | + print ' '.$field_info['cssview']; |
|
122 | 122 | } |
123 | 123 | print '">'; |
124 | 124 | if (in_array($field_info['type'], array('text', 'html'))) { |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | } |
127 | 127 | if ($field_key == 'lang') { |
128 | 128 | $langs->load("languages"); |
129 | - $labellang = ($value ? $langs->trans('Language_' . $value) : ''); |
|
129 | + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); |
|
130 | 130 | print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); |
131 | 131 | print $labellang; |
132 | 132 | } else { |
133 | 133 | if (isset($field_info['copytoclipboard']) && $field_info['copytoclipboard'] == 2) { |
134 | - $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key . '_', 0); |
|
134 | + $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key.'_', 0); |
|
135 | 135 | print showValueWithClipboardCPButton($out, 0, $out); |
136 | 136 | } else { |
137 | - print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key . '_', 0); |
|
137 | + print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key.'_', 0); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | if (in_array($field_info['type'], array('text', 'html'))) { |
@@ -133,7 +133,7 @@ |
||
133 | 133 | $this->db = $db; |
134 | 134 | $this->name = "standard"; |
135 | 135 | $this->description = $langs->trans('DocumentModelStandardPDF'); |
136 | - $this->update_main_doc_field = 0; // Save the name of generated file as the main doc when generating a doc with this template |
|
136 | + $this->update_main_doc_field = 0; // Save the name of generated file as the main doc when generating a doc with this template |
|
137 | 137 | |
138 | 138 | // Page size for A4 format |
139 | 139 | $this->type = 'pdf'; |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | if ($contactid > 0) { |
218 | 218 | $contact = new Contact($this->db); |
219 | 219 | $res = $contact->fetch($contactid); |
220 | - if (! in_array($contact, $linked_contacts)) { |
|
221 | - $error_msg = $langs->trans('Error'). ': '; |
|
220 | + if (!in_array($contact, $linked_contacts)) { |
|
221 | + $error_msg = $langs->trans('Error').': '; |
|
222 | 222 | $error_msg .= $langs->transnoentities('TicketWrongContact'); |
223 | 223 | setEventMessages($error_msg, [], 'errors'); |
224 | 224 | $ok = 0; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $sendto = ''; |
230 | 230 | if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) { |
231 | 231 | $sendto = $contact->email; |
232 | - } elseif ( !empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) { |
|
232 | + } elseif (!empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) { |
|
233 | 233 | // if sending to all contacts or sending to contacts while mass closing |
234 | 234 | $temp_emails = []; |
235 | 235 | foreach ($linked_contacts as $contact) { |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | if ($qualified) { |
370 | - $message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>'; |
|
370 | + $message_customer .= '<li>'.$langs->trans($key).' : '.$value.'</li>'; |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | } |
@@ -80,32 +80,32 @@ discard block |
||
80 | 80 | $h = 0; |
81 | 81 | $head = array(); |
82 | 82 | |
83 | - $head[$h][0] = DOL_URL_ROOT . '/asset/card.php?id=' . $object->id; |
|
83 | + $head[$h][0] = DOL_URL_ROOT.'/asset/card.php?id='.$object->id; |
|
84 | 84 | $head[$h][1] = $langs->trans("Card"); |
85 | 85 | $head[$h][2] = 'card'; |
86 | 86 | $h++; |
87 | 87 | |
88 | 88 | if (empty($object->not_depreciated)) { |
89 | - $head[$h][0] = DOL_URL_ROOT . '/asset/depreciation_options.php?id=' . $object->id; |
|
89 | + $head[$h][0] = DOL_URL_ROOT.'/asset/depreciation_options.php?id='.$object->id; |
|
90 | 90 | $head[$h][1] = $langs->trans("AssetDepreciationOptions"); |
91 | 91 | $head[$h][2] = 'depreciation_options'; |
92 | 92 | $h++; |
93 | 93 | } |
94 | 94 | |
95 | - $head[$h][0] = DOL_URL_ROOT . '/asset/accountancy_codes.php?id=' . $object->id; |
|
95 | + $head[$h][0] = DOL_URL_ROOT.'/asset/accountancy_codes.php?id='.$object->id; |
|
96 | 96 | $head[$h][1] = $langs->trans("AssetAccountancyCodes"); |
97 | 97 | $head[$h][2] = 'accountancy_codes'; |
98 | 98 | $h++; |
99 | 99 | |
100 | 100 | if (empty($object->not_depreciated)) { |
101 | - $head[$h][0] = DOL_URL_ROOT . '/asset/depreciation.php?id=' . $object->id; |
|
101 | + $head[$h][0] = DOL_URL_ROOT.'/asset/depreciation.php?id='.$object->id; |
|
102 | 102 | $head[$h][1] = $langs->trans("AssetDepreciation"); |
103 | 103 | $head[$h][2] = 'depreciation'; |
104 | 104 | $h++; |
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($object->disposal_date) && $object->disposal_date !== "") { |
108 | - $head[$h][0] = DOL_URL_ROOT . '/asset/disposal.php?id=' . $object->id; |
|
108 | + $head[$h][0] = DOL_URL_ROOT.'/asset/disposal.php?id='.$object->id; |
|
109 | 109 | $head[$h][1] = $langs->trans("AssetDisposal"); |
110 | 110 | $head[$h][2] = 'disposal'; |
111 | 111 | $h++; |
@@ -119,29 +119,29 @@ discard block |
||
119 | 119 | if (!empty($object->note_public)) { |
120 | 120 | $nbNote++; |
121 | 121 | } |
122 | - $head[$h][0] = DOL_URL_ROOT . '/asset/note.php?id=' . $object->id; |
|
122 | + $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
|
123 | 123 | $head[$h][1] = $langs->trans('Notes'); |
124 | 124 | if ($nbNote > 0) { |
125 | - $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : ''); |
|
125 | + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
126 | 126 | } |
127 | 127 | $head[$h][2] = 'note'; |
128 | 128 | $h++; |
129 | 129 | } |
130 | 130 | |
131 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
132 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
133 | - $upload_dir = $conf->asset->dir_output . "/asset/" . dol_sanitizeFileName($object->ref); |
|
131 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
132 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
133 | + $upload_dir = $conf->asset->dir_output."/asset/".dol_sanitizeFileName($object->ref); |
|
134 | 134 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
135 | 135 | $nbLinks = Link::count($db, $object->element, $object->id); |
136 | - $head[$h][0] = DOL_URL_ROOT . '/asset/document.php?id=' . $object->id; |
|
136 | + $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
|
137 | 137 | $head[$h][1] = $langs->trans('Documents'); |
138 | 138 | if (($nbFiles + $nbLinks) > 0) { |
139 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>'; |
|
139 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
140 | 140 | } |
141 | 141 | $head[$h][2] = 'document'; |
142 | 142 | $h++; |
143 | 143 | |
144 | - $head[$h][0] = DOL_URL_ROOT . '/asset/agenda.php?id=' . $object->id; |
|
144 | + $head[$h][0] = DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id; |
|
145 | 145 | $head[$h][1] = $langs->trans("Events"); |
146 | 146 | $head[$h][2] = 'agenda'; |
147 | 147 | $h++; |
@@ -176,17 +176,17 @@ discard block |
||
176 | 176 | $h = 0; |
177 | 177 | $head = array(); |
178 | 178 | |
179 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/card.php?id=' . $object->id; |
|
179 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/card.php?id='.$object->id; |
|
180 | 180 | $head[$h][1] = $langs->trans("Card"); |
181 | 181 | $head[$h][2] = 'card'; |
182 | 182 | $h++; |
183 | 183 | |
184 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/depreciation_options.php?id=' . $object->id; |
|
184 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/depreciation_options.php?id='.$object->id; |
|
185 | 185 | $head[$h][1] = $langs->trans("AssetDepreciationOptions"); |
186 | 186 | $head[$h][2] = 'depreciation_options'; |
187 | 187 | $h++; |
188 | 188 | |
189 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/accountancy_codes.php?id=' . $object->id; |
|
189 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/accountancy_codes.php?id='.$object->id; |
|
190 | 190 | $head[$h][1] = $langs->trans("AssetAccountancyCodes"); |
191 | 191 | $head[$h][2] = 'accountancy_codes'; |
192 | 192 | $h++; |
@@ -199,16 +199,16 @@ discard block |
||
199 | 199 | if (!empty($object->note_public)) { |
200 | 200 | $nbNote++; |
201 | 201 | } |
202 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/note.php?id=' . $object->id; |
|
202 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/note.php?id='.$object->id; |
|
203 | 203 | $head[$h][1] = $langs->trans('Notes'); |
204 | 204 | if ($nbNote > 0) { |
205 | - $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : ''); |
|
205 | + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
206 | 206 | } |
207 | 207 | $head[$h][2] = 'note'; |
208 | 208 | $h++; |
209 | 209 | } |
210 | 210 | |
211 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id; |
|
211 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/agenda.php?id='.$object->id; |
|
212 | 212 | $head[$h][1] = $langs->trans("Events"); |
213 | 213 | $head[$h][2] = 'agenda'; |
214 | 214 | $h++; |
@@ -58,16 +58,16 @@ |
||
58 | 58 | public $total_ht; |
59 | 59 | public $total_tva; |
60 | 60 | public $total_ttc; |
61 | - public $amount_ht; // deprecated |
|
61 | + public $amount_ht; // deprecated |
|
62 | 62 | public $amount_tva; // deprecated |
63 | 63 | public $amount_ttc; // deprecated |
64 | 64 | |
65 | 65 | public $multicurrency_total_ht; |
66 | 66 | public $multicurrency_total_tva; |
67 | 67 | public $multicurrency_total_ttc; |
68 | - public $multicurrency_amount_ht; // deprecated |
|
69 | - public $multicurrency_amount_tva; // deprecated |
|
70 | - public $multicurrency_amount_ttc; // deprecated |
|
68 | + public $multicurrency_amount_ht; // deprecated |
|
69 | + public $multicurrency_amount_tva; // deprecated |
|
70 | + public $multicurrency_amount_ttc; // deprecated |
|
71 | 71 | |
72 | 72 | // Vat rate |
73 | 73 | public $tva_tx; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php'; |
89 | 89 | |
90 | -call_user_func(function () { |
|
90 | +call_user_func(function() { |
|
91 | 91 | $loader = Luracast\Restler\AutoLoader::instance(); |
92 | 92 | spl_autoload_register($loader); |
93 | 93 | return $loader; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // If MAIN_API_DEBUG is set to 1, we save logs into file "dolibarr_api.log" |
162 | 162 | if (!empty($conf->global->MAIN_API_DEBUG)) { |
163 | 163 | $r = $api->r; |
164 | - $r->onCall(function () use ($r) { |
|
164 | + $r->onCall(function() use ($r) { |
|
165 | 165 | // Don't log Luracast Restler Explorer recources calls |
166 | 166 | //if (!preg_match('/^explorer/', $r->url)) { |
167 | 167 | // 'method' => $api->r->requestMethod, |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | - if (! $endpointisallowed) { |
|
347 | + if (!$endpointisallowed) { |
|
348 | 348 | dol_syslog('The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES', LOG_WARNING); |
349 | 349 | print 'The API with endpoint /'.$classfile.' is forbidden by config API_ENDPOINT_RULES'; |
350 | 350 | header('HTTP/1.1 501 API is forbidden by API_ENDPOINT_RULES'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | print '<div class="fichecenter">'; |
68 | 68 | print '<div class="fichehalfleft">'; |
69 | 69 | print '<div class="underbanner clearboth"></div>'; |
70 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
70 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
71 | 71 | $mode_info['fields'] = dol_sort_array($mode_info['fields'], 'position'); |
72 | 72 | foreach ($mode_info['fields'] as $field_key => $field_info) { |
73 | 73 | if (!empty($field_info['enabled_field'])) { |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | print '<table class="border centpercent tableforfield">'; |
95 | 95 | } |
96 | 96 | |
97 | - $key = $mode_key . '_' . $field_key; |
|
97 | + $key = $mode_key.'_'.$field_key; |
|
98 | 98 | $value = $assetdepreciationoptions->deprecation_options[$mode_key][$field_key]; |
99 | 99 | |
100 | - print '<tr class="field_' . $key . '"><td'; |
|
101 | - print ' class="' . (empty($field_info['tdcss']) ? 'titlefield' : $field_info['tdcss']) . ' fieldname_' . $key; |
|
100 | + print '<tr class="field_'.$key.'"><td'; |
|
101 | + print ' class="'.(empty($field_info['tdcss']) ? 'titlefield' : $field_info['tdcss']).' fieldname_'.$key; |
|
102 | 102 | if ($field_info['type'] == 'text' || $field_info['type'] == 'html') { |
103 | 103 | print ' tdtop'; |
104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | } |
114 | 114 | } |
115 | 115 | print '</td>'; |
116 | - print '<td class="valuefield fieldname_' . $key; |
|
116 | + print '<td class="valuefield fieldname_'.$key; |
|
117 | 117 | if ($field_info['type'] == 'text') { |
118 | 118 | print ' wordbreak'; |
119 | 119 | } |
120 | 120 | if (!empty($field_info['cssview'])) { |
121 | - print ' ' . $field_info['cssview']; |
|
121 | + print ' '.$field_info['cssview']; |
|
122 | 122 | } |
123 | 123 | print '">'; |
124 | 124 | if (in_array($field_info['type'], array('text', 'html'))) { |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | } |
127 | 127 | if ($field_key == 'lang') { |
128 | 128 | $langs->load("languages"); |
129 | - $labellang = ($value ? $langs->trans('Language_' . $value) : ''); |
|
129 | + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); |
|
130 | 130 | print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); |
131 | 131 | print $labellang; |
132 | 132 | } else { |
133 | 133 | if (isset($field_info['copytoclipboard']) && $field_info['copytoclipboard'] == 2) { |
134 | - $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key . '_', 0); |
|
134 | + $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key.'_', 0); |
|
135 | 135 | print showValueWithClipboardCPButton($out, 0, $out); |
136 | 136 | } else { |
137 | - print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key . '_', 0); |
|
137 | + print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value, '', '', $mode_key.'_', 0); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | if (in_array($field_info['type'], array('text', 'html'))) { |
@@ -813,7 +813,7 @@ |
||
813 | 813 | } |
814 | 814 | if (!empty($arrayfields['duration']['checked'])) { |
815 | 815 | print '<td class="right">'; |
816 | - $nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates |
|
816 | + $nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates |
|
817 | 817 | $totalduration += $nbopenedday; |
818 | 818 | print $nbopenedday; |
819 | 819 | //print ' '.$langs->trans('DurationDays'); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $amount = $credit; |
107 | 107 | } |
108 | 108 | |
109 | - return "'" . $this->db->escape(abs($amount)) . "'"; |
|
109 | + return "'".$this->db->escape(abs($amount))."'"; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return "''"; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $sens = 'C'; |
135 | 135 | } |
136 | 136 | |
137 | - return "'" . $this->db->escape($sens) . "'"; |
|
137 | + return "'".$this->db->escape($sens)."'"; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return "''"; |