fix stickler

This commit is contained in:
Florian HENRY 2020-12-28 21:32:46 +01:00
parent 806b40662f
commit 1e438b686e
2 changed files with 7 additions and 8 deletions

View File

@ -8393,7 +8393,7 @@ abstract class CommonObject
* @param boolean $remove_existing True: Remove existings categories from Object if not supplies by $categories, False: let them
* @return int <0 if KO, >0 if OK
*/
public function setCategoriesCommon($categories, $type_categ='', $remove_existing=true)
public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = true)
{
dol_syslog(get_class($this)."::setCategoriesCommon Oject Id:".$this->id.' type_categ:'.$type_categ.' nb tag add:'.count($categories), LOG_DEBUG);

View File

@ -43,18 +43,18 @@ if ($massaction == 'preaffecttag')
$categ = new Categorie($db);
$categ_types=array();
$categ_type_array=$categ->getMapList();
foreach($categ_type_array as $categdef) {
foreach ($categ_type_array as $categdef) {
if (isset($object) && $categdef['obj_table']==$object->table_element) {
if (!array_key_exists($categdef['code'],$categ_types)) $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
if (!array_key_exists($categdef['code'], $categ_types)) $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
}
if (isset($objecttmp) && $categdef['obj_table']==$objecttmp->table_element) {
if (!array_key_exists($categdef['code'],$categ_types)) $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
if (!array_key_exists($categdef['code'], $categ_types)) $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class']));
}
}
$formquestion = array();
if (!empty($categ_types)) {
foreach($categ_types as $categ_type) {
foreach ($categ_types as $categ_type) {
$cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1);
$formquestion[]=
array('type' => 'other',
@ -66,7 +66,7 @@ if ($massaction == 'preaffecttag')
array('type' => 'other',
'name' => 'affecttag_type',
'label' => '',
'value' => '<input type="hidden" name="affecttag_type" id="affecttag_type" value="'.implode(",",array_keys($categ_types)).'"/>');
'value' => '<input type="hidden" name="affecttag_type" id="affecttag_type" value="'.implode(",", array_keys($categ_types)).'"/>');
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAffectTag"), $langs->trans("ConfirmAffectTagQuestion", count($toselect)), "affecttag", $formquestion, 1, 0, 200, 500, 1);
} else {
setEventMessage('CategTypeNotFound');
@ -83,8 +83,7 @@ if ($massaction == 'presend')
if (!GETPOST('cancel', 'alpha'))
{
foreach ($arrayofselected as $toselectid)
{
foreach ($arrayofselected as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0)
{