mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
3424c33af1
commit
387ea73bf3
|
|
@ -37,7 +37,7 @@ $langs->loadLangs(array("users", "admin", "other"));
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ class Categorie extends CommonObject
|
|||
}
|
||||
$sql .= ", visible = '".$this->db->escape($this->visible)."'";
|
||||
$sql .= ", fk_parent = ".$this->fk_parent;
|
||||
$sql .= ", fk_user_modif = ". (int) $user->id;
|
||||
$sql .= ", fk_user_modif = ".(int) $user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -921,7 +921,7 @@ class ActionComm extends CommonObject
|
|||
|
||||
$res = $this->db->query($sql);
|
||||
if (!$res) {
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ class Account extends CommonObject
|
|||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields=array(
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25),
|
||||
'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30),
|
||||
|
|
|
|||
|
|
@ -536,13 +536,13 @@ if ($action == "order" and $placeid != 0)
|
|||
}
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
|
||||
$invoice->fetch($placeid); //Reload object before send to printer
|
||||
$printer->orderprinter=1;
|
||||
$printer->orderprinter = 1;
|
||||
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='1' and fk_facture=".$invoice->id; // Set as printed
|
||||
$db->query($sql);
|
||||
$invoice->fetch($placeid); //Reload object after set lines as printed
|
||||
$linestoprint=0;
|
||||
$linestoprint = 0;
|
||||
|
||||
foreach ($invoice->lines as $line)
|
||||
{
|
||||
|
|
@ -564,7 +564,7 @@ if ($action == "order" and $placeid != 0)
|
|||
}
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
|
||||
$invoice->fetch($placeid); //Reload object before send to printer
|
||||
$printer->orderprinter=2;
|
||||
$printer->orderprinter = 2;
|
||||
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='2' and fk_facture=".$invoice->id; // Set as printed
|
||||
|
|
@ -712,8 +712,8 @@ function TakeposPrinting(id){
|
|||
|
||||
function TakeposConnector(id){
|
||||
var invoice='<?php
|
||||
$data=json_encode($invoice);
|
||||
$data=base64_encode($data);
|
||||
$data = json_encode($invoice);
|
||||
$data = base64_encode($data);
|
||||
echo $data;
|
||||
?>';
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
|||
|
||||
$morehtmlright = '';
|
||||
if ($account->id == 0) {
|
||||
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=create');
|
||||
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create');
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank_account');
|
||||
|
|
@ -395,49 +395,49 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
|||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
if($account->id > 0) {
|
||||
if ($account->id > 0) {
|
||||
print '<tr class="oddeven">';
|
||||
// Label
|
||||
print '<td>' . $account->label . '</td>';
|
||||
print '<td>'.$account->label.'</td>';
|
||||
// Bank name
|
||||
print '<td>' . $account->bank . '</td>';
|
||||
print '<td>'.$account->bank.'</td>';
|
||||
// Account number
|
||||
print '<td>';
|
||||
$string = '';
|
||||
foreach ($account->getFieldsToShow() as $val) {
|
||||
if ($val == 'BankCode') {
|
||||
$string .= $account->code_banque . ' ';
|
||||
$string .= $account->code_banque.' ';
|
||||
} elseif ($val == 'BankAccountNumber') {
|
||||
$string .= $account->number . ' ';
|
||||
$string .= $account->number.' ';
|
||||
} elseif ($val == 'DeskCode') {
|
||||
$string .= $account->code_guichet . ' ';
|
||||
$string .= $account->code_guichet.' ';
|
||||
} elseif ($val == 'BankAccountNumberKey') {
|
||||
$string .= $account->cle_rib . ' ';
|
||||
$string .= $account->cle_rib.' ';
|
||||
}
|
||||
}
|
||||
if (!empty($account->label) && $account->number) {
|
||||
if (!checkBanForAccount($account)) {
|
||||
$string .= ' ' . img_picto($langs->trans("ValueIsNotValid"), 'warning');
|
||||
$string .= ' '.img_picto($langs->trans("ValueIsNotValid"), 'warning');
|
||||
} else {
|
||||
$string .= ' ' . img_picto($langs->trans("ValueIsValid"), 'info');
|
||||
$string .= ' '.img_picto($langs->trans("ValueIsValid"), 'info');
|
||||
}
|
||||
}
|
||||
|
||||
print $string;
|
||||
print '</td>';
|
||||
// IBAN
|
||||
print '<td>' . $account->iban;
|
||||
print '<td>'.$account->iban;
|
||||
if (!empty($account->iban)) {
|
||||
if (!checkIbanForAccount($account)) {
|
||||
print ' ' . img_picto($langs->trans("IbanNotValid"), 'warning');
|
||||
print ' '.img_picto($langs->trans("IbanNotValid"), 'warning');
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
// BIC
|
||||
print '<td>' . $account->bic;
|
||||
print '<td>'.$account->bic;
|
||||
if (!empty($account->bic)) {
|
||||
if (!checkSwiftForAccount($account)) {
|
||||
print ' ' . img_picto($langs->trans("SwiftNotValid"), 'warning');
|
||||
print ' '.img_picto($langs->trans("SwiftNotValid"), 'warning');
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -445,7 +445,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
|||
// Edit/Delete
|
||||
print '<td class="right nowraponall">';
|
||||
if ($user->rights->hrm->employee->write || $user->rights->user->creer) {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&bankid=' . $account->id . '&action=edit">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&bankid='.$account->id.'&action=edit">';
|
||||
print img_picto($langs->trans("Modify"), 'edit');
|
||||
print '</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ if ($action == 'unsetshowsubcontainers')
|
|||
exit;
|
||||
}
|
||||
|
||||
if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchkey)
|
||||
if (($action == 'replacesite' || $action == 'replacesiteconfirm') && !$searchkey)
|
||||
{
|
||||
$action = 'replacesite';
|
||||
}
|
||||
|
|
@ -373,13 +373,13 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha'))
|
|||
if (empty($user->rights->website->writephp)) {
|
||||
setEventMessages("NotAllowedToAddDynamicContent", null, 'errors');
|
||||
}
|
||||
elseif (! $replacestring) {
|
||||
elseif (!$replacestring) {
|
||||
setEventMessages("ErrorReplaceStringEmpty", null, 'errors');
|
||||
}
|
||||
else {
|
||||
$nbreplacement = 0;
|
||||
|
||||
foreach($toselect as $keyselected) {
|
||||
foreach ($toselect as $keyselected) {
|
||||
$objectpage = $listofpages['list'][$keyselected];
|
||||
if ($objectpage->pageurl) {
|
||||
dol_syslog("Replace string into page ".$objectpage->pageurl);
|
||||
|
|
@ -3543,7 +3543,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
|
|||
$massactionbutton .= '<div class="massactionother hidden">';
|
||||
$massactionbutton .= $langs->trans("ReplaceString");
|
||||
$massactionbutton .= '<input type="text" name="replacestring" value="'.dol_escape_htmltag(GETPOST('replacestring', 'none')).'">';
|
||||
$massactionbutton .='</div>';
|
||||
$massactionbutton .= '</div>';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user