diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 4e1a64cd20c..0acb4e0bedd 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -437,13 +437,15 @@ if ($result) { // Get thirdparty $tmppayment->fetch($links[$key]['url_id']); $arrayofamounts = $tmppayment->getAmountsArray(); - foreach ($arrayofamounts as $invoiceid => $amount) - { - $tmpinvoice->fetch($invoiceid); - $tmpinvoice->fetch_thirdparty(); - if ($tmpinvoice->thirdparty->code_compta) + if (is_array($arrayofamounts)) { + foreach ($arrayofamounts as $invoiceid => $amount) { - $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount; + $tmpinvoice->fetch($invoiceid); + $tmpinvoice->fetch_thirdparty(); + if ($tmpinvoice->thirdparty->code_compta) + { + $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount; + } } } } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d3b918b9849..e9e6be408c8 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -719,7 +719,7 @@ if ($rowid > 0) { print ''.$langs->trans("Ref").''.$object->id.''; - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; print ''.$langs->trans("Status").''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index e661bde6ea7..f2c3b785160 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -37,6 +37,7 @@ $langs->loadLangs(array('members', 'languages')); $id = GETPOST('rowid', 'int'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); +$ref = GETPOST('ref', 'alphanohtml'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); @@ -67,15 +68,17 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad $object->fetch($id); $current_lang = $langs->getDefaultLang(); + $forcelangprod = GETPOST("forcelangprod", 'aZ09'); + // update of object - if ($_POST["forcelangprod"] == $current_lang) { - $object->label = $_POST["libelle"]; - $object->description = dol_htmlcleanlastbr($_POST["desc"]); - $object->other = dol_htmlcleanlastbr($_POST["other"]); + if ($forcelangprod == $current_lang) { + $object->label = GETPOST("libelle", 'alphanohtml'); + $object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); + $object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); } else { - $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; - $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); - $object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]); + $object->multilangs[$forcelangprod]["label"] = GETPOST("libelle", 'alphanohtml'); + $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); + $object->multilangs[$forcelangprod]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); } // backup into database @@ -95,13 +98,13 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a foreach ($object->multilangs as $key => $value) { // saving new values in the object if ($key == $current_lang) { - $object->label = $_POST["libelle-".$key]; - $object->description = dol_htmlcleanlastbr($_POST["desc-".$key]); - $object->other = dol_htmlcleanlastbr($_POST["other-".$key]); + $object->label = GETPOST("libelle-".$key, 'alphanohtml'); + $object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); + $object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); } else { - $object->multilangs[$key]["label"] = $_POST["libelle-".$key]; - $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]); - $object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]); + $object->multilangs[$key]["label"] = GETPOST("libelle-".$key, 'alphanohtml'); + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); + $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); } } @@ -205,7 +208,7 @@ if ($action == 'edit') { print '
'; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); @@ -264,7 +267,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { print '
'.$langs->trans('Language').''; print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1); print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index e182a91d32a..03610100c9c 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -769,6 +769,7 @@ class Categories extends DolibarrApi $objects = $result; $cleaned_objects = array(); + $objects_api = null; if ($type == 'member') { $objects_api = new Members(); } elseif ($type == 'customer' || $type == 'supplier') { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 3aca92708a7..f55b3403546 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1891,13 +1891,12 @@ class Categorie extends CommonObject return ""; } + $searchCategorySqlList = array(); foreach ($searchList as $searchCategory) { if (intval($searchCategory) == -2) { $searchCategorySqlList[] = " cp.fk_categorie IS NULL"; } elseif (intval($searchCategory) > 0) { - $searchCategorySqlList[] = " ".$rowIdName - ." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type - ." WHERE fk_categorie = ".$searchCategory.")"; + $searchCategorySqlList[] = " ".$rowIdName." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type." WHERE fk_categorie = ".((int) $searchCategory).")"; } }