@@ -128,7 +128,7 @@ |
||
128 | 128 | |
129 | 129 | // Array to add new pages in new tabs |
130 | 130 | $this->tabs = array(); |
131 | - $this->tabs[] = array('data'=>'user:+skill_tab:Skills:hrm:1:/hrm/skill_tab.php?id=__ID__&objecttype=user'); // To add a new tab identified by code tabname1 |
|
131 | + $this->tabs[] = array('data'=>'user:+skill_tab:Skills:hrm:1:/hrm/skill_tab.php?id=__ID__&objecttype=user'); // To add a new tab identified by code tabname1 |
|
132 | 132 | //$this->tabs[] = array('data'=>'job:+tabname1:Poste:mylangfile@hrm:1:/hrm/poste_list.php?fk_job=__ID__'); // To add a new tab identified by code tabname1 |
133 | 133 | // Example: |
134 | 134 | // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@hrm:$user->rights->hrm->read:/hrm/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | case 'sellist': |
49 | 49 | $tmp = ''; |
50 | 50 | $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null |
51 | - if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
51 | + if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
52 | 52 | $tmpkeys = array_keys($tmpparam['options']); |
53 | 53 | $tmp = array_shift($tmpkeys); |
54 | 54 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | |
140 | 140 | // If we have a hash public (hashp), we guess the original_file. |
141 | -$ecmfile=''; |
|
141 | +$ecmfile = ''; |
|
142 | 142 | if (!empty($hashp)) { |
143 | 143 | include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
144 | 144 | $ecmfile = new EcmFiles($db); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | // Security: Delete string ../ or ..\ into $original_file |
199 | -$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
199 | +$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
200 | 200 | $original_file = str_replace('../', '/', $original_file); |
201 | 201 | $original_file = str_replace('..\\', '/', $original_file); |
202 | 202 |
@@ -81,7 +81,9 @@ |
||
81 | 81 | $TAllSkills = $static_skill->fetchAll(); |
82 | 82 | if (is_array($TAllSkills)) { |
83 | 83 | foreach ($TAllSkills as &$skill) { |
84 | - if (empty($skill->lines)) $skill->fetchLines(); |
|
84 | + if (empty($skill->lines)) { |
|
85 | + $skill->fetchLines(); |
|
86 | + } |
|
85 | 87 | if (count($skill->lines) < $conf->global->HRM_MAXRANK) { |
86 | 88 | $skill->createSkills(count($skill->lines) + 1); |
87 | 89 | } |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | $value = GETPOST('value', 'alpha'); |
52 | 52 | $label = GETPOST('label', 'alpha'); |
53 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
53 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
54 | 54 | |
55 | 55 | $scandir = GETPOST('scan_dir', 'alpha'); |
56 | 56 | $type = 'evaluation'; |
57 | 57 | |
58 | 58 | $arrayofparameters = array( |
59 | - 'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1), |
|
60 | - 'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'varchar','enabled'=>1), |
|
59 | + 'HRM_MAXRANK'=>array('type'=>'integer', 'enabled'=>1), |
|
60 | + 'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'varchar', 'enabled'=>1), |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | $error = 0; |
@@ -483,27 +483,27 @@ discard block |
||
483 | 483 | print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
484 | 484 | |
485 | 485 | foreach ($arrayofparameters as $constname => $val) { |
486 | - if ($val['enabled']==1) { |
|
486 | + if ($val['enabled'] == 1) { |
|
487 | 487 | $setupnotempty++; |
488 | 488 | print '<tr class="oddeven"><td>'; |
489 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
489 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
490 | 490 | print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>'; |
491 | 491 | print '</td><td>'; |
492 | 492 | |
493 | 493 | if ($val['type'] == 'textarea') { |
494 | - print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n"; |
|
494 | + print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
495 | 495 | print getDolGlobalString($constname); |
496 | 496 | print "</textarea>\n"; |
497 | 497 | } elseif ($val['type'] == 'integer') { |
498 | - print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . getDolGlobalString($constname) . '" type="number" step="1" min="0" max="50" >' . "\n"; |
|
498 | + print '<input class="flat" name="'.$constname.'" id="'.$constname.'" value="'.getDolGlobalString($constname).'" type="number" step="1" min="0" max="50" >'."\n"; |
|
499 | 499 | } elseif ($val['type'] == 'html') { |
500 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
500 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
501 | 501 | $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
502 | 502 | $doleditor->Create(); |
503 | 503 | } elseif ($val['type'] == 'yesno') { |
504 | 504 | print $form->selectyesno($constname, getDolGlobalString($constname), 1); |
505 | 505 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
506 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
506 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
507 | 507 | $formmail = new FormMail($db); |
508 | 508 | |
509 | 509 | $tmp = explode(':', $val['type']); |
@@ -515,10 +515,10 @@ discard block |
||
515 | 515 | //var_dump($modelmail); |
516 | 516 | $moreonlabel = ''; |
517 | 517 | if (!empty($arrayofmessagename[$modelmail->label])) { |
518 | - $moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
518 | + $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
519 | 519 | } |
520 | 520 | // The 'label' is the key that is unique if we exclude the language |
521 | - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; |
|
521 | + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; |
|
522 | 522 | } |
523 | 523 | } |
524 | 524 | print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -531,25 +531,25 @@ discard block |
||
531 | 531 | print img_picto('', 'category', 'class="pictofixedwidth"'); |
532 | 532 | print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); |
533 | 533 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
534 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
534 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
535 | 535 | $formcompany = new FormCompany($db); |
536 | 536 | print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname); |
537 | 537 | } elseif ($val['type'] == 'securekey') { |
538 | - print '<input required="required" type="text" class="flat" id="' . $constname . '" name="' . $constname . '" value="' . (GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)) . '" size="40">'; |
|
538 | + print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : getDolGlobalString($constname)).'" size="40">'; |
|
539 | 539 | if (!empty($conf->use_javascript_ajax)) { |
540 | - print ' ' . img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token' . $constname . '" class="linkobject"'); |
|
540 | + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | // Add button to autosuggest a key |
544 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
545 | - print dolJSToSetRandomPassword($constname, 'generate_token' . $constname); |
|
544 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
545 | + print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); |
|
546 | 546 | } elseif ($val['type'] == 'product') { |
547 | 547 | if (isModEnabled('product') || isModEnabled('service')) { |
548 | 548 | $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); |
549 | 549 | $form->select_produits($selected, $constname, '', 0); |
550 | 550 | } |
551 | 551 | } else { |
552 | - print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . getDolGlobalString($constname) . '">'; |
|
552 | + print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">'; |
|
553 | 553 | } |
554 | 554 | print '</td></tr>'; |
555 | 555 | } |
@@ -568,27 +568,27 @@ discard block |
||
568 | 568 | print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; |
569 | 569 | |
570 | 570 | foreach ($arrayofparameters as $constname => $val) { |
571 | - if ($val['enabled']==1) { |
|
571 | + if ($val['enabled'] == 1) { |
|
572 | 572 | $setupnotempty++; |
573 | 573 | print '<tr class="oddeven"><td>'; |
574 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
574 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
575 | 575 | print $form->textwithpicto($langs->trans($constname), $tooltiphelp); |
576 | 576 | print '</td><td>'; |
577 | 577 | |
578 | 578 | if ($val['type'] == 'textarea') { |
579 | 579 | print dol_nl2br(getDolGlobalString($constname)); |
580 | - } elseif ($val['type']== 'html') { |
|
580 | + } elseif ($val['type'] == 'html') { |
|
581 | 581 | print getDolGlobalString($constname); |
582 | 582 | } elseif ($val['type'] == 'yesno') { |
583 | 583 | print ajax_constantonoff($constname); |
584 | 584 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
585 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
585 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
586 | 586 | $formmail = new FormMail($db); |
587 | 587 | |
588 | 588 | $tmp = explode(':', $val['type']); |
589 | 589 | |
590 | 590 | $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); |
591 | - if ($template<0) { |
|
591 | + if ($template < 0) { |
|
592 | 592 | setEventMessages(null, $formmail->errors, 'errors'); |
593 | 593 | } |
594 | 594 | print $langs->trans($template->label); |
@@ -601,9 +601,9 @@ discard block |
||
601 | 601 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text |
602 | 602 | $toprint = array(); |
603 | 603 | foreach ($ways as $way) { |
604 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
604 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
605 | 605 | } |
606 | - print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
606 | + print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
607 | 607 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
608 | 608 | if (getDolGlobalString($constname) == 2) { |
609 | 609 | print $langs->trans("Prospect"); |
@@ -363,21 +363,30 @@ |
||
363 | 363 | |
364 | 364 | // Page |
365 | 365 | print '<td>'; |
366 | - if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) print $defaultvalue->page; |
|
367 | - else print '<input type="text" name="urlpage" value="'.dol_escape_htmltag($defaultvalue->page).'">'; |
|
366 | + if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) { |
|
367 | + print $defaultvalue->page; |
|
368 | + } else { |
|
369 | + print '<input type="text" name="urlpage" value="'.dol_escape_htmltag($defaultvalue->page).'">'; |
|
370 | + } |
|
368 | 371 | print '</td>'."\n"; |
369 | 372 | |
370 | 373 | // Field |
371 | 374 | print '<td>'; |
372 | - if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print $defaultvalue->param; |
|
373 | - else print '<input type="text" name="key" value="'.dol_escape_htmltag($defaultvalue->param).'">'; |
|
375 | + if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { |
|
376 | + print $defaultvalue->param; |
|
377 | + } else { |
|
378 | + print '<input type="text" name="key" value="'.dol_escape_htmltag($defaultvalue->param).'">'; |
|
379 | + } |
|
374 | 380 | print '</td>'."\n"; |
375 | 381 | |
376 | 382 | // Value |
377 | 383 | if ($mode != 'focus' && $mode != 'mandatory') { |
378 | 384 | print '<td>'; |
379 | - if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print dol_escape_htmltag($defaultvalue->value); |
|
380 | - else print '<input type="text" name="value" value="'.dol_escape_htmltag($defaultvalue->value).'">'; |
|
385 | + if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { |
|
386 | + print dol_escape_htmltag($defaultvalue->value); |
|
387 | + } else { |
|
388 | + print '<input type="text" name="value" value="'.dol_escape_htmltag($defaultvalue->value).'">'; |
|
389 | + } |
|
381 | 390 | print '</td>'; |
382 | 391 | } |
383 | 392 |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | |
141 | 141 | if (!$error) { |
142 | 142 | if ($action == 'add' || (GETPOST('add') && $action != 'update')) { |
143 | - $object->type=$mode; |
|
144 | - $object->user_id=0; |
|
145 | - $object->page=$defaulturl; |
|
146 | - $object->param=$defaultkey; |
|
147 | - $object->value=$defaultvalue; |
|
148 | - $object->entity=$conf->entity; |
|
149 | - $result=$object->create($user); |
|
143 | + $object->type = $mode; |
|
144 | + $object->user_id = 0; |
|
145 | + $object->page = $defaulturl; |
|
146 | + $object->param = $defaultkey; |
|
147 | + $object->value = $defaultvalue; |
|
148 | + $object->entity = $conf->entity; |
|
149 | + $result = $object->create($user); |
|
150 | 150 | if ($result < 0) { |
151 | 151 | $action = ''; |
152 | 152 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | if (GETPOST('actionmodify')) { |
162 | - $object->id=$id; |
|
163 | - $object->type=$mode; |
|
164 | - $object->page=$urlpage; |
|
165 | - $object->param=$key; |
|
166 | - $object->value=$value; |
|
167 | - $object->entity=$conf->entity; |
|
168 | - $result=$object->update($user); |
|
169 | - if ($result<0) { |
|
162 | + $object->id = $id; |
|
163 | + $object->type = $mode; |
|
164 | + $object->page = $urlpage; |
|
165 | + $object->param = $key; |
|
166 | + $object->value = $value; |
|
167 | + $object->entity = $conf->entity; |
|
168 | + $result = $object->update($user); |
|
169 | + if ($result < 0) { |
|
170 | 170 | $action = ''; |
171 | 171 | setEventMessages($object->error, $object->errors, 'errors'); |
172 | 172 | } else { |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | |
183 | 183 | // Delete line from delete picto |
184 | 184 | if ($action == 'delete') { |
185 | - $object->id=$id; |
|
186 | - $result=$object->delete($user); |
|
187 | - if ($result<0) { |
|
185 | + $object->id = $id; |
|
186 | + $result = $object->delete($user); |
|
187 | + if ($result < 0) { |
|
188 | 188 | $action = ''; |
189 | 189 | setEventMessages($object->error, $object->errors, 'errors'); |
190 | 190 | } |
@@ -339,11 +339,11 @@ discard block |
||
339 | 339 | // Limit to superadmin |
340 | 340 | if (isModEnabled('multicompany') && !$user->entity) { |
341 | 341 | print '<td>'; |
342 | - print '<input type="text" class="flat" size="1" disabled name="entity" value="' . $conf->entity . '">'; // We see environment, but to change it we must switch on other entity |
|
342 | + print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity |
|
343 | 343 | print '</td>'; |
344 | 344 | } else { |
345 | 345 | print '<td class="center">'; |
346 | - print '<input type="hidden" name="entity" value="' . $conf->entity . '">'; |
|
346 | + print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; |
|
347 | 347 | print '</td>'; |
348 | 348 | } |
349 | 349 | print '<td class="center">'; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | print '</td>'."\n"; |
356 | 356 | print '</tr>'."\n"; |
357 | 357 | |
358 | -$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity))); |
|
358 | +$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode, 't.entity'=>array($user->entity, $conf->entity))); |
|
359 | 359 | |
360 | 360 | if (!is_array($result) && $result < 0) { |
361 | 361 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | // Actions |
389 | 389 | print '<td class="center">'; |
390 | - if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { |
|
390 | + if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { |
|
391 | 391 | print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().'">'.img_edit().'</a>'; |
392 | 392 | print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().'">'.img_delete().'</a>'; |
393 | 393 | } else { |
@@ -172,7 +172,9 @@ |
||
172 | 172 | // extrafields filter key to make it works |
173 | 173 | $filter['ef.resource'] = $sql; |
174 | 174 | |
175 | -if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); |
|
175 | +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
|
176 | + $param .= '&contextpage='.urlencode($contextpage); |
|
177 | +} |
|
176 | 178 | |
177 | 179 | // Add $param from extra fields |
178 | 180 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
@@ -124,8 +124,8 @@ |
||
124 | 124 | $htmlname = 'activesynchro'; |
125 | 125 | } |
126 | 126 | |
127 | - $dolibarr2ldaplabel = $langs->trans("DolibarrToLDAP") . (($scriptonly == 1 || $scriptonly == 3) ? " (".$langs->trans("SupportedForLDAPExportScriptOnly").")" : ""); |
|
128 | - $ldap2dolibarrlabel = $langs->trans("LDAPToDolibarr") . (($scriptonly == 2 || $scriptonly == 3) ? " (".$langs->trans("SupportedForLDAPImportScriptOnly").")" : ""); |
|
127 | + $dolibarr2ldaplabel = $langs->trans("DolibarrToLDAP").(($scriptonly == 1 || $scriptonly == 3) ? " (".$langs->trans("SupportedForLDAPExportScriptOnly").")" : ""); |
|
128 | + $ldap2dolibarrlabel = $langs->trans("LDAPToDolibarr").(($scriptonly == 2 || $scriptonly == 3) ? " (".$langs->trans("SupportedForLDAPImportScriptOnly").")" : ""); |
|
129 | 129 | |
130 | 130 | $arraylist = array( |
131 | 131 | Ldap::SYNCHRO_NONE => $langs->trans("No"), |
@@ -175,10 +175,10 @@ |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | $i = 1; |
178 | - $filepath = $path . $filename . '.' . $ext; |
|
178 | + $filepath = $path.$filename.'.'.$ext; |
|
179 | 179 | |
180 | 180 | while (file_exists($filepath)) { |
181 | - $filepath = $path . $filename . '(' . $i . ').' . $ext; |
|
181 | + $filepath = $path.$filename.'('.$i.').'.$ext; |
|
182 | 182 | $i++; |
183 | 183 | } |
184 | 184 | file_put_contents($filepath, $data); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $result = $db->query($sql); |
79 | 79 | if ($result) { |
80 | 80 | $nbline = $db->num_rows($result); |
81 | - for ($i=0; $i < $nbline; $i++) { |
|
81 | + for ($i = 0; $i < $nbline; $i++) { |
|
82 | 82 | $object = $db->fetch_object($result); |
83 | 83 | if (($mode == "barcode" && $barcode == $object->barcode) || ($mode == "lotserial" && $barcode == $object->batch)) { |
84 | 84 | $warehouse->fetch(0, $product["Warehouse"]); |
@@ -88,22 +88,22 @@ discard block |
||
88 | 88 | $fk_product = $object->fk_product; |
89 | 89 | $reelqty = $object->reel; |
90 | 90 | |
91 | - $objectreturn = array('fk_warehouse'=>$warehouseid,'fk_product'=>$fk_product,'reelqty'=>$reelqty); |
|
91 | + $objectreturn = array('fk_warehouse'=>$warehouseid, 'fk_product'=>$fk_product, 'reelqty'=>$reelqty); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | 95 | if ($warehousefound < 1) { |
96 | - $response = array('status'=>'error','errorcode'=>'NotFound','message'=>'No warehouse found for barcode'.$barcode); |
|
96 | + $response = array('status'=>'error', 'errorcode'=>'NotFound', 'message'=>'No warehouse found for barcode'.$barcode); |
|
97 | 97 | } elseif ($warehousefound > 1) { |
98 | - $response = array('status'=>'error','errorcode'=>'TooManyWarehouse','message'=>'Too many warehouse found'); |
|
98 | + $response = array('status'=>'error', 'errorcode'=>'TooManyWarehouse', 'message'=>'Too many warehouse found'); |
|
99 | 99 | } else { |
100 | - $response = array('status'=>'success','message'=>'Warehouse found','object'=>$objectreturn); |
|
100 | + $response = array('status'=>'success', 'message'=>'Warehouse found', 'object'=>$objectreturn); |
|
101 | 101 | } |
102 | 102 | } else { |
103 | - $response = array('status'=>'error','errorcode'=>'NotFound','message'=>"No results found for barcode"); |
|
103 | + $response = array('status'=>'error', 'errorcode'=>'NotFound', 'message'=>"No results found for barcode"); |
|
104 | 104 | } |
105 | 105 | } else { |
106 | - $response = array('status'=>'error','errorcode'=>'ActionError','message'=>"Error on action"); |
|
106 | + $response = array('status'=>'error', 'errorcode'=>'ActionError', 'message'=>"Error on action"); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($action == "addnewlineproduct") { |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | |
123 | 123 | $result = $inventoryline->create($user); |
124 | 124 | if ($result > 0) { |
125 | - $response = array('status'=>'success','message'=>'Success on creating line','id_line'=>$result); |
|
125 | + $response = array('status'=>'success', 'message'=>'Success on creating line', 'id_line'=>$result); |
|
126 | 126 | } else { |
127 | - $response = array('status'=>'error','errorcode'=>'ErrorCreation','message'=>"Error on line creation"); |
|
127 | + $response = array('status'=>'error', 'errorcode'=>'ErrorCreation', 'message'=>"Error on line creation"); |
|
128 | 128 | } |
129 | 129 | } else { |
130 | - $response = array('status'=>'error','errorcode'=>'NoIdForInventory','message'=>"No id for inventory"); |
|
130 | + $response = array('status'=>'error', 'errorcode'=>'NoIdForInventory', 'message'=>"No id for inventory"); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 |