@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | |
30 | 30 | require '../main.inc.php'; |
31 | -require_once DOL_DOCUMENT_ROOT . '/bom/lib/bom.lib.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
33 | 33 | |
34 | 34 | // Load translation files required by the page |
35 | 35 | $langs->loadLangs(array('mrp', 'admin')); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * Actions |
58 | 58 | */ |
59 | 59 | |
60 | -require DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php'; |
|
60 | +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; |
|
61 | 61 | |
62 | 62 | |
63 | 63 | /* |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | llxHeader('', $langs->trans("BOMsSetup"), $help_url); |
69 | 69 | |
70 | 70 | |
71 | -$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>'; |
|
71 | +$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; |
|
72 | 72 | print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); |
73 | 73 | |
74 | 74 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | print dol_get_fiche_head($head, 'bomline_extrafields', $langs->trans("ExtraFields"), -1, 'account'); |
78 | 78 | |
79 | -require DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_view.tpl.php'; |
|
79 | +require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; |
|
80 | 80 | |
81 | 81 | print dol_get_fiche_end(); |
82 | 82 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // Buttons |
85 | 85 | if ($action != 'create' && $action != 'edit') { |
86 | 86 | print '<div class="tabsAction">'; |
87 | - print '<a class="butAction reposition" href="' . $_SERVER["PHP_SELF"] . '?action=create">' . $langs->trans("NewAttribute") . '</a>'; |
|
87 | + print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>'; |
|
88 | 88 | print "</div>"; |
89 | 89 | } |
90 | 90 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | print '<br><div id="newattrib"></div>'; |
97 | 97 | print load_fiche_titre($langs->trans('NewAttribute')); |
98 | 98 | |
99 | - require DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; |
|
99 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /* |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | print "<br>"; |
107 | 107 | print load_fiche_titre($langs->trans("FieldEdition", $attrname)); |
108 | 108 | |
109 | - require DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; |
|
109 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // End of page |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | print '<div class="div-table-responsive-no-min">'; |
200 | 200 | print '<table class="noborder centpercent">'; |
201 | 201 | print '<tr class="liste_titre">'; |
202 | -print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '') . "\n"; |
|
202 | +print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '')."\n"; |
|
203 | 203 | print getTitleFieldOfList("Value", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); |
204 | 204 | print getTitleFieldOfList("Comment", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); |
205 | -print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n"; |
|
205 | +print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
|
206 | 206 | if (isModEnabled('multicompany') && !$user->entity) { |
207 | - print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n"; |
|
207 | + print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
|
208 | 208 | } |
209 | 209 | print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); |
210 | 210 | print "</tr>\n"; |
@@ -227,12 +227,12 @@ discard block |
||
227 | 227 | // Limit to superadmin |
228 | 228 | if (isModEnabled('multicompany') && !$user->entity) { |
229 | 229 | print '<td>'; |
230 | - print '<input type="text" class="flat" size="1" name="entity" value="' . $conf->entity . '">'; |
|
230 | + print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">'; |
|
231 | 231 | print '</td>'; |
232 | 232 | print '<td class="center">'; |
233 | 233 | } else { |
234 | 234 | print '<td class="center">'; |
235 | - print '<input type="hidden" name="entity" value="' . $conf->entity . '">'; |
|
235 | + print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; |
|
236 | 236 | } |
237 | 237 | print '<input type="submit" class="button button-add small" id="add" name="add" value="'.$langs->trans("Add").'">'; |
238 | 238 | print "</td>\n"; |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | $value = GETPOST('value', 'alpha'); |
43 | 43 | $label = GETPOST('label', 'alpha'); |
44 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
44 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
45 | 45 | |
46 | 46 | $scandir = GETPOST('scan_dir', 'alpha'); |
47 | 47 | $type = 'myobject'; |
48 | 48 | |
49 | 49 | $arrayofparameters = array( |
50 | - 'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1), |
|
50 | + 'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea', 'enabled'=>1), |
|
51 | 51 | 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), |
52 | 52 | 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), |
53 | 53 | 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | |
82 | 82 | if ($cancel) { |
83 | - $action =''; |
|
83 | + $action = ''; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
@@ -216,26 +216,26 @@ discard block |
||
216 | 216 | print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
217 | 217 | |
218 | 218 | foreach ($arrayofparameters as $constname => $val) { |
219 | - if ($val['enabled']==1) { |
|
219 | + if ($val['enabled'] == 1) { |
|
220 | 220 | $setupnotempty++; |
221 | 221 | print '<tr class="oddeven"><td><!-- '.$constname.' -->'; |
222 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
223 | - $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : ''); |
|
222 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
223 | + $tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : ''); |
|
224 | 224 | print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>'; |
225 | 225 | print '</td><td>'; |
226 | 226 | |
227 | 227 | if ($val['type'] == 'textarea') { |
228 | - print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
228 | + print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
229 | 229 | print getDolGlobalString($constname); |
230 | 230 | print "</textarea>\n"; |
231 | - } elseif ($val['type']== 'html') { |
|
232 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
231 | + } elseif ($val['type'] == 'html') { |
|
232 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
233 | 233 | $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
234 | 234 | $doleditor->Create(); |
235 | 235 | } elseif ($val['type'] == 'yesno') { |
236 | 236 | print $form->selectyesno($constname, getDolGlobalString($constname), 1); |
237 | 237 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
238 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
238 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
239 | 239 | $formmail = new FormMail($db); |
240 | 240 | |
241 | 241 | $tmp = explode(':', $val['type']); |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | //var_dump($modelmail); |
248 | 248 | $moreonlabel = ''; |
249 | 249 | if (!empty($arrayofmessagename[$modelmail->label])) { |
250 | - $moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
250 | + $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
251 | 251 | } |
252 | 252 | // The 'label' is the key that is unique if we exclude the language |
253 | - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; |
|
253 | + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $form->select_produits($selected, $constname, '', 0); |
282 | 282 | } |
283 | 283 | } else { |
284 | - print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">'; |
|
284 | + print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">'; |
|
285 | 285 | } |
286 | 286 | print '</td></tr>'; |
287 | 287 | } |
@@ -298,24 +298,24 @@ discard block |
||
298 | 298 | print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
299 | 299 | |
300 | 300 | foreach ($arrayofparameters as $constname => $val) { |
301 | - if ($val['enabled']==1) { |
|
301 | + if ($val['enabled'] == 1) { |
|
302 | 302 | $setupnotempty++; |
303 | 303 | print '<tr class="oddeven">'; |
304 | 304 | print '<td><!-- '.$constname.' -->'; |
305 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
306 | - $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : ''); |
|
305 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
306 | + $tooltiphelp .= (($langs->trans($constname.'Tooltip2') && $langs->trans($constname.'Tooltip2') != $constname.'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname.'Tooltip2') : ''); |
|
307 | 307 | print $form->textwithpicto($langs->trans($constname), $tooltiphelp); |
308 | 308 | print '</td><td>'; |
309 | 309 | |
310 | 310 | if ($val['type'] == 'textarea') { |
311 | 311 | print dol_nl2br(getDolGlobalString($constname)); |
312 | - } elseif ($val['type']== 'html') { |
|
312 | + } elseif ($val['type'] == 'html') { |
|
313 | 313 | print getDolGlobalString($constname); |
314 | 314 | } elseif ($val['type'] == 'yesno') { |
315 | 315 | print ajax_constantonoff($constname); |
316 | 316 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
317 | 317 | if (getDolGlobalString($constname)) { |
318 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
318 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
319 | 319 | $formmail = new FormMail($db); |
320 | 320 | |
321 | 321 | $tmp = explode(':', $val['type']); |
@@ -341,18 +341,18 @@ discard block |
||
341 | 341 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text |
342 | 342 | $toprint = array(); |
343 | 343 | foreach ($ways as $way) { |
344 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
344 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
345 | 345 | } |
346 | - print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
346 | + print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
347 | 347 | } |
348 | 348 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
349 | - if (getDolGlobalString($constname)==2) { |
|
349 | + if (getDolGlobalString($constname) == 2) { |
|
350 | 350 | print $langs->trans("Prospect"); |
351 | - } elseif (getDolGlobalString($constname)==3) { |
|
351 | + } elseif (getDolGlobalString($constname) == 3) { |
|
352 | 352 | print $langs->trans("ProspectCustomer"); |
353 | - } elseif (getDolGlobalString($constname)==1) { |
|
353 | + } elseif (getDolGlobalString($constname) == 1) { |
|
354 | 354 | print $langs->trans("Customer"); |
355 | - } elseif (getDolGlobalString($constname)==0) { |
|
355 | + } elseif (getDolGlobalString($constname) == 0) { |
|
356 | 356 | print $langs->trans("NorProspectNorCustomer"); |
357 | 357 | } |
358 | 358 | } elseif ($val['type'] == 'product') { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public $product_ref; |
72 | 72 | |
73 | 73 | public $fourn_id; //supplier id |
74 | - public $fourn_name; // supplier name |
|
74 | + public $fourn_name; // supplier name |
|
75 | 75 | public $fourn_qty; // quantity for price (can be set by get_buyprice) |
76 | 76 | public $fourn_pu; // unit price for quantity (can be set by get_buyprice) |
77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public $fourn_remise_percent; // discount for quantity (percent) |
80 | 80 | public $fourn_remise; // discount for quantity (amount) |
81 | 81 | |
82 | - public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set |
|
82 | + public $fourn_charges; // when getDolGlobalString('PRODUCT_CHARGES') is set |
|
83 | 83 | |
84 | 84 | public $product_fourn_id; // product-supplier id |
85 | 85 | public $product_fourn_entity; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | public $fk_availability; |
96 | 96 | |
97 | 97 | public $fourn_unitprice; |
98 | - public $fourn_unitprice_with_discount; // not saved into database |
|
98 | + public $fourn_unitprice_with_discount; // not saved into database |
|
99 | 99 | public $fourn_tva_tx; |
100 | 100 | public $fourn_tva_npr; |
101 | 101 | |
@@ -610,8 +610,8 @@ discard block |
||
610 | 610 | |
611 | 611 | $this->fk_product = $obj->fk_product; |
612 | 612 | $this->product_id = $obj->fk_product; |
613 | - $this->product_ref = $obj->product_ref; |
|
614 | - $this->status = $obj->status; |
|
613 | + $this->product_ref = $obj->product_ref; |
|
614 | + $this->status = $obj->status; |
|
615 | 615 | $this->status_buy = $obj->status_buy; |
616 | 616 | $this->fourn_id = $obj->fk_soc; |
617 | 617 | $this->fourn_ref = $obj->ref_fourn; // deprecated |
@@ -719,8 +719,8 @@ discard block |
||
719 | 719 | |
720 | 720 | $prodfourn->product_ref = $record["product_ref"]; |
721 | 721 | $prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"]; |
722 | - $prodfourn->status = $record["status"]; |
|
723 | - $prodfourn->status_buy = $record["status_buy"]; |
|
722 | + $prodfourn->status = $record["status"]; |
|
723 | + $prodfourn->status_buy = $record["status_buy"]; |
|
724 | 724 | $prodfourn->product_fourn_id = $record["product_fourn_id"]; |
725 | 725 | $prodfourn->product_fourn_entity = $record["entity"]; |
726 | 726 | $prodfourn->ref_supplier = $record["ref_fourn"]; |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | } |
1302 | 1302 | |
1303 | 1303 | global $action; |
1304 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1304 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1305 | 1305 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
1306 | 1306 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1307 | 1307 | if ($reshook > 0) { |
@@ -56,8 +56,8 @@ |
||
56 | 56 | |
57 | 57 | // Permissions |
58 | 58 | $permissionnote = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); // Used by the include of actions_setnotes.inc.php |
59 | -$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
60 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
|
59 | +$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
60 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
|
61 | 61 | |
62 | 62 | |
63 | 63 | /* |
@@ -85,8 +85,8 @@ |
||
85 | 85 | // Init Hooks |
86 | 86 | $hookmanager->initHooks(array('ordersuppliercardinfo')); |
87 | 87 | |
88 | -$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
89 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
|
88 | +$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")); |
|
89 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php |
|
90 | 90 | |
91 | 91 | |
92 | 92 | /* |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | // Get Parameters |
43 | -$id = GETPOST('id', 'int'); |
|
44 | -$action = GETPOST('action', 'alpha'); |
|
45 | -$confirm = GETPOST('confirm', 'alpha'); |
|
43 | +$id = GETPOST('id', 'int'); |
|
44 | +$action = GETPOST('action', 'alpha'); |
|
45 | +$confirm = GETPOST('confirm', 'alpha'); |
|
46 | 46 | |
47 | 47 | $socid = 0; |
48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | // Load object |
56 | 56 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
57 | 57 | |
58 | -$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice |
|
58 | +$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice |
|
59 | 59 | |
60 | 60 | // Security check |
61 | 61 | if ($user->socid) { |
@@ -21,11 +21,11 @@ |
||
21 | 21 | protected $openned = false; |
22 | 22 | protected $filename; |
23 | 23 | protected $pclzip; |
24 | - /** |
|
25 | - * Class constructor |
|
26 | - * |
|
27 | - * @throws PclZipProxyException |
|
28 | - */ |
|
24 | + /** |
|
25 | + * Class constructor |
|
26 | + * |
|
27 | + * @throws PclZipProxyException |
|
28 | + */ |
|
29 | 29 | public function __construct($forcedir='') |
30 | 30 | { |
31 | 31 | if (! class_exists('PclZip')) { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('ODTPHP_PATHTOPCLZIP')) define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
2 | +if (!defined('ODTPHP_PATHTOPCLZIP')) define('ODTPHP_PATHTOPCLZIP', 'pclzip/'); |
|
3 | 3 | require_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; |
4 | 4 | require_once 'ZipInterface.php'; |
5 | 5 | class PclZipProxyException extends Exception |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @throws PclZipProxyException |
28 | 28 | */ |
29 | - public function __construct($forcedir='') |
|
29 | + public function __construct($forcedir = '') |
|
30 | 30 | { |
31 | - if (! class_exists('PclZip')) { |
|
31 | + if (!class_exists('PclZip')) { |
|
32 | 32 | throw new PclZipProxyException('PclZip class not loaded - PclZip library |
33 | 33 | is required for using PclZipProxy'); ; |
34 | 34 | } |
35 | - if ($forcedir) $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); // $this->tmpdir must not contains / at the end |
|
35 | + if ($forcedir) $this->tmpdir = preg_replace('|[//\/]$|', '', $forcedir); // $this->tmpdir must not contains / at the end |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | } |
90 | 90 | $localname = preg_replace("/(?:\.|\/)*(.*)/", "\\1", $localname); |
91 | 91 | $localpath = dirname($localname); |
92 | - $tmpfilename = $this->tmpdir . '/' . basename($localname); |
|
92 | + $tmpfilename = $this->tmpdir.'/'.basename($localname); |
|
93 | 93 | if (false !== file_put_contents($tmpfilename, $contents)) { |
94 | 94 | //print "tmpfilename=".$tmpfilename; |
95 | 95 | //print "localname=".$localname; |
96 | - $res=$this->pclzip->delete(PCLZIP_OPT_BY_NAME, $localname); |
|
96 | + $res = $this->pclzip->delete(PCLZIP_OPT_BY_NAME, $localname); |
|
97 | 97 | $add = $this->pclzip->add($tmpfilename, |
98 | 98 | PCLZIP_OPT_REMOVE_PATH, $this->tmpdir, |
99 | 99 | PCLZIP_OPT_ADD_PATH, $localpath); |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | if (isSet($localname)) { |
125 | 125 | $localname = preg_replace("/(?:\.|\/)*(.*)/", "\\1", $localname); |
126 | 126 | $localpath = dirname($localname); |
127 | - $tmpfilename = $this->tmpdir . '/' . basename($localname); |
|
127 | + $tmpfilename = $this->tmpdir.'/'.basename($localname); |
|
128 | 128 | } else { |
129 | 129 | $localname = basename($filename); |
130 | - $tmpfilename = $this->tmpdir . '/' . $localname; |
|
130 | + $tmpfilename = $this->tmpdir.'/'.$localname; |
|
131 | 131 | $localpath = ''; |
132 | 132 | } |
133 | 133 | if (file_exists($filename)) { |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('ODTPHP_PATHTOPCLZIP')) define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
2 | +if (! defined('ODTPHP_PATHTOPCLZIP')) { |
|
3 | + define('ODTPHP_PATHTOPCLZIP','pclzip/'); |
|
4 | +} |
|
3 | 5 | require_once ODTPHP_PATHTOPCLZIP.'pclzip.lib.php'; |
4 | 6 | require_once 'ZipInterface.php'; |
5 | 7 | class PclZipProxyException extends Exception |
@@ -32,7 +34,10 @@ discard block |
||
32 | 34 | throw new PclZipProxyException('PclZip class not loaded - PclZip library |
33 | 35 | is required for using PclZipProxy'); ; |
34 | 36 | } |
35 | - if ($forcedir) $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); // $this->tmpdir must not contains / at the end |
|
37 | + if ($forcedir) { |
|
38 | + $this->tmpdir=preg_replace('|[//\/]$|','',$forcedir); |
|
39 | + } |
|
40 | + // $this->tmpdir must not contains / at the end |
|
36 | 41 | } |
37 | 42 | |
38 | 43 | /** |
@@ -121,7 +121,7 @@ |
||
121 | 121 | || !file_exists($filename)) { |
122 | 122 | return false; |
123 | 123 | } |
124 | - if (isSet($localname)) { |
|
124 | + if (isset($localname)) { |
|
125 | 125 | $localname = preg_replace("/(?:\.|\/)*(.*)/", "\\1", $localname); |
126 | 126 | $localpath = dirname($localname); |
127 | 127 | $tmpfilename = $this->tmpdir . '/' . basename($localname); |
@@ -17,11 +17,11 @@ |
||
17 | 17 | { |
18 | 18 | protected $zipArchive; |
19 | 19 | protected $filename; |
20 | - /** |
|
21 | - * Class constructor |
|
22 | - * |
|
23 | - * @throws PhpZipProxyException |
|
24 | - */ |
|
20 | + /** |
|
21 | + * Class constructor |
|
22 | + * |
|
23 | + * @throws PhpZipProxyException |
|
24 | + */ |
|
25 | 25 | public function __construct() |
26 | 26 | { |
27 | 27 | if (! class_exists('ZipArchive')) { |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function __construct() |
26 | 26 | { |
27 | - if (! class_exists('ZipArchive')) { |
|
27 | + if (!class_exists('ZipArchive')) { |
|
28 | 28 | throw new PhpZipProxyException('Zip extension not loaded - check your php settings, PHP5.2 minimum with zip extension |
29 | 29 | is required for using PhpZipProxy'); ; |
30 | 30 | } |