@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // Load Dolibarr environment |
39 | 39 | require '../../main.inc.php'; |
40 | -require DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php'; |
|
40 | +require DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; |
|
41 | 41 | |
42 | 42 | // Security check |
43 | 43 | if (!isModEnabled('variants')) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if (GETPOST('roworder', 'alpha', 3)) { |
62 | 62 | $roworder = GETPOST('roworder', 'alpha', 3); |
63 | 63 | |
64 | - dol_syslog("AjaxOrderAttribute roworder=" . $roworder, LOG_DEBUG); |
|
64 | + dol_syslog("AjaxOrderAttribute roworder=".$roworder, LOG_DEBUG); |
|
65 | 65 | |
66 | 66 | $rowordertab = explode(',', $roworder); |
67 | 67 | $newrowordertab = array(); |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | $object = new Commande($db); |
75 | 75 | |
76 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
76 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
77 | 77 | $permissiontoadd = $usercancreate; |
78 | 78 | |
79 | 79 | // Security check |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | |
25 | 25 | // Load Dolibarr environment |
26 | 26 | require '../main.inc.php'; |
27 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php'; |
|
28 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; |
|
29 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; |
|
27 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php'; |
|
30 | 30 | |
31 | 31 | // Load translation files required by the page |
32 | 32 | $langs->loadLangs(array("assets", "companies")); |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $extrafields->fetch_name_optionals_label($object->table_element); |
49 | 49 | |
50 | 50 | // Load object |
51 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
51 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
52 | 52 | if ($id > 0 || !empty($ref)) { |
53 | - $upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id; |
|
53 | + $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Security check (enable the most restrictive one) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | // Object card |
100 | 100 | // ------------------------------------------------------------ |
101 | - $linkback = '<a href="' . DOL_URL_ROOT . '/asset/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
101 | + $linkback = '<a href="'.DOL_URL_ROOT.'/asset/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
102 | 102 | |
103 | 103 | $morehtmlref = '<div class="refidno">'; |
104 | 104 | $morehtmlref .= '</div>'; |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | print '<div class="fichecenter">'; |
135 | 135 | print '<div class="fichehalfleft">'; |
136 | 136 | print '<div class="underbanner clearboth"></div>'; |
137 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
138 | - print '<tr><td class="titlefield">' . $langs->trans('AssetBaseDepreciationHT') . '</td><td>' . price($depreciation_info['base_depreciation_ht']) . '</td></tr>'; |
|
139 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationBeginDate') . '</td><td>' . dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day') . '</td></tr>'; |
|
137 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
138 | + print '<tr><td class="titlefield">'.$langs->trans('AssetBaseDepreciationHT').'</td><td>'.price($depreciation_info['base_depreciation_ht']).'</td></tr>'; |
|
139 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationBeginDate').'</td><td>'.dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day').'</td></tr>'; |
|
140 | 140 | print '</table>'; |
141 | 141 | |
142 | 142 | // We close div and reopen for second column |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | |
146 | 146 | print '<div class="underbanner clearboth"></div>'; |
147 | 147 | print '<table class="border centpercent tableforfield">'; |
148 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationDuration') . '</td><td>' . $depreciation_info['duration'] . ' ( ' . $depreciation_info['duration_type'] . ' )</td></tr>'; |
|
149 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationRate') . '</td><td>' . $depreciation_info['rate'] . '</td></tr>'; |
|
148 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationDuration').'</td><td>'.$depreciation_info['duration'].' ( '.$depreciation_info['duration_type'].' )</td></tr>'; |
|
149 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationRate').'</td><td>'.$depreciation_info['rate'].'</td></tr>'; |
|
150 | 150 | print '</table>'; |
151 | 151 | print '</div>'; |
152 | 152 | print '</div>'; |
@@ -160,21 +160,21 @@ discard block |
||
160 | 160 | |
161 | 161 | print '<tr class="liste_titre">'; |
162 | 162 | print '<td class="width20"></td>'; |
163 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
164 | - print '<td class="center">' . $langs->trans("AssetDepreciationDate") . '</td>'; |
|
165 | - print '<td class="right">' . $langs->trans("AssetDepreciationHT") . '</td>'; |
|
166 | - print '<td class="right">' . $langs->trans("AssetCumulativeDepreciationHT") . '</td>'; |
|
167 | - print '<td class="right">' . $langs->trans("AssetResidualHT") . '</td>'; |
|
163 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
164 | + print '<td class="center">'.$langs->trans("AssetDepreciationDate").'</td>'; |
|
165 | + print '<td class="right">'.$langs->trans("AssetDepreciationHT").'</td>'; |
|
166 | + print '<td class="right">'.$langs->trans("AssetCumulativeDepreciationHT").'</td>'; |
|
167 | + print '<td class="right">'.$langs->trans("AssetResidualHT").'</td>'; |
|
168 | 168 | print '</tr>'; |
169 | 169 | |
170 | 170 | if (empty($lines)) { |
171 | - print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
171 | + print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
172 | 172 | } else { |
173 | 173 | foreach ($lines as $line) { |
174 | 174 | print '<tr class="oddeven">'; |
175 | - print '<td>' . ($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')) . '</td>'; |
|
176 | - print '<td >' . (empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']) . '</td>'; |
|
177 | - print '<td class="center">' . dol_print_date($line['depreciation_date'], 'day') . '</td>'; |
|
175 | + print '<td>'.($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')).'</td>'; |
|
176 | + print '<td >'.(empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']).'</td>'; |
|
177 | + print '<td class="center">'.dol_print_date($line['depreciation_date'], 'day').'</td>'; |
|
178 | 178 | print '<td class="right">'; |
179 | 179 | print price($line['depreciation_ht']); |
180 | 180 | print '</td>'; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $customerStatic->loadCacheOfProspStatus(); |
126 | 126 | if (!empty($customerStatic->cacheprospectstatus)) { |
127 | 127 | foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) { |
128 | - $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; |
|
128 | + $this->type_statuscommprospect[$dataProspectSt['id']] = $dataProspectSt['label']; |
|
129 | 129 | } |
130 | 130 | } else { |
131 | 131 | $this->type_statuscommprospect = array( |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | } |
629 | 629 | } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') { |
630 | 630 | if ($arrayquery['options_'.$key] > 0) { |
631 | - $sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; |
|
631 | + $sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; |
|
632 | 632 | } |
633 | 633 | } else { |
634 | 634 | if (is_array($arrayquery['options_'.$key])) { |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | if (is_array($cpt)) { |
628 | 628 | $listofaccount = ''; |
629 | 629 | foreach ($cpt as $cptcursor) { |
630 | - if (! is_null($cptcursor)) { |
|
630 | + if (!is_null($cptcursor)) { |
|
631 | 631 | if ($listofaccount) { |
632 | 632 | $listofaccount .= ","; |
633 | 633 | } |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | |
777 | 777 | $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; |
778 | 778 | $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; |
779 | - $sql .= " WHERE c.active = " . (int) $active; |
|
779 | + $sql .= " WHERE c.active = ".(int) $active; |
|
780 | 780 | $sql .= " AND c.entity = ".$conf->entity; |
781 | 781 | if ($categorytype >= 0) { |
782 | 782 | $sql .= " AND c.category_type = 1"; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $maxfilesizearray = getMaxFileSizeArray(); |
180 | 180 | $maxmin = $maxfilesizearray['maxmin']; |
181 | 181 | if ($maxmin > 0) { |
182 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
182 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
183 | 183 | } |
184 | 184 | $texte .= ' <input type="file" name="uploadfile">'; |
185 | 185 | $texte .= '<input type="hidden" value="RECEPTION_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); |
274 | 274 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
275 | 275 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
276 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
276 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
277 | 277 | //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; |
278 | 278 | // Get extension (ods or odt) |
279 | 279 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | if ($format == '1') { |
283 | 283 | $format = '%Y%m%d%H%M%S'; |
284 | 284 | } |
285 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
285 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
286 | 286 | } else { |
287 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
287 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
288 | 288 | } |
289 | - $file = $dir . '/' . $filename; |
|
289 | + $file = $dir.'/'.$filename; |
|
290 | 290 | //print "newdir=".$dir; |
291 | 291 | //print "newfile=".$newfile; |
292 | 292 | //print "file=".$file; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | dol_mkdir($conf->reception->dir_temp); |
296 | 296 | if (!is_writable($conf->reception->dir_temp)) { |
297 | 297 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->reception->dir_temp); |
298 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
298 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
299 | 299 | return -1; |
300 | 300 | } |
301 | 301 |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $maxfilesizearray = getMaxFileSizeArray(); |
187 | 187 | $maxmin = $maxfilesizearray['maxmin']; |
188 | 188 | if ($maxmin > 0) { |
189 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
189 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
190 | 190 | } |
191 | 191 | $texte .= ' <input type="file" name="uploadfile">'; |
192 | 192 | $texte .= '<input type="hidden" value="EXPEDITION_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); |
281 | 281 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
282 | 282 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
283 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
283 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
284 | 284 | //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; |
285 | 285 | // Get extension (ods or odt) |
286 | 286 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | if ($format == '1') { |
290 | 290 | $format = '%Y%m%d%H%M%S'; |
291 | 291 | } |
292 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
292 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
293 | 293 | } else { |
294 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
294 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
295 | 295 | } |
296 | - $file = $dir . '/' . $filename; |
|
296 | + $file = $dir.'/'.$filename; |
|
297 | 297 | //print "newdir=".$dir; |
298 | 298 | //print "newfile=".$newfile; |
299 | 299 | //print "file=".$file; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | dol_mkdir($conf->expedition->dir_temp); |
303 | 303 | if (!is_writable($conf->expedition->dir_temp)) { |
304 | 304 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->expedition->dir_temp); |
305 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
305 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
306 | 306 | return -1; |
307 | 307 | } |
308 | 308 |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $maxfilesizearray = getMaxFileSizeArray(); |
181 | 181 | $maxmin = $maxfilesizearray['maxmin']; |
182 | 182 | if ($maxmin > 0) { |
183 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
183 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
184 | 184 | } |
185 | 185 | $texte .= ' <input type="file" name="uploadfile">'; |
186 | 186 | $texte .= '<input type="hidden" value="BOM_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); |
277 | 277 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
278 | 278 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
279 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
279 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
280 | 280 | //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; |
281 | 281 | // Get extension (ods or odt) |
282 | 282 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -285,11 +285,11 @@ discard block |
||
285 | 285 | if ($format == '1') { |
286 | 286 | $format = '%Y%m%d%H%M%S'; |
287 | 287 | } |
288 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
288 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
289 | 289 | } else { |
290 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
290 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
291 | 291 | } |
292 | - $file = $dir . '/' . $filename; |
|
292 | + $file = $dir.'/'.$filename; |
|
293 | 293 | //print "newdir=".$dir; |
294 | 294 | //print "newfile=".$newfile; |
295 | 295 | //print "file=".$file; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | dol_mkdir($conf->bom->dir_temp); |
299 | 299 | if (!is_writable($conf->bom->dir_temp)) { |
300 | 300 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->bom->dir_temp); |
301 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
301 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
302 | 302 | return -1; |
303 | 303 | } |
304 | 304 |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); |
270 | 270 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
271 | 271 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
272 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
272 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
273 | 273 | //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; |
274 | 274 | // Get extension (ods or odt) |
275 | 275 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -278,11 +278,11 @@ discard block |
||
278 | 278 | if ($format == '1') { |
279 | 279 | $format = '%Y%m%d%H%M%S'; |
280 | 280 | } |
281 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
281 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
282 | 282 | } else { |
283 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
283 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
284 | 284 | } |
285 | - $file = $dir . '/' . $filename; |
|
285 | + $file = $dir.'/'.$filename; |
|
286 | 286 | //print "newdir=".$dir; |
287 | 287 | //print "newfile=".$newfile; |
288 | 288 | //print "file=".$file; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | dol_mkdir($conf->mrp->dir_temp); |
292 | 292 | if (!is_writable($conf->mrp->dir_temp)) { |
293 | 293 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mrp->dir_temp); |
294 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
294 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
295 | 295 | return -1; |
296 | 296 | } |
297 | 297 |