FIX : PR Returns
This commit is contained in:
parent
cf647cfc21
commit
cf8b0910d9
1 changed files with 30 additions and 25 deletions
|
|
@ -172,7 +172,7 @@ class CActionComm
|
|||
if ($morefilter) {
|
||||
$sql .= " AND ".$morefilter;
|
||||
}
|
||||
$sql .= " ORDER BY type, position, module";
|
||||
$sql .= " ORDER BY position, type, module";
|
||||
|
||||
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
@ -180,6 +180,9 @@ class CActionComm
|
|||
$nump = $this->db->num_rows($resql);
|
||||
if ($nump) {
|
||||
$idforallfornewmodule = 96;
|
||||
$TSystem = array();
|
||||
$TSystemAuto = array();
|
||||
$TModule = array();
|
||||
$i = 0;
|
||||
while ($i < $nump) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
|
@ -267,21 +270,17 @@ class CActionComm
|
|||
}
|
||||
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
|
||||
if (($onlyautoornot == -1 || $onlyautoornot == -2) && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if ($typecalendar == 'system') {
|
||||
if ($typecalendar == 'system' || $typecalendar == 'user') {
|
||||
$label = ' '.$label;
|
||||
$repid[-99] = $langs->trans("ActionAC_MANUAL");
|
||||
$repcode['AC_NON_AUTO'] = '-- '.$langs->trans("ActionAC_MANUAL");
|
||||
$TSystem['id'][-99] = $langs->trans("ActionAC_MANUAL");
|
||||
$TSystem['code']['AC_NON_AUTO'] = '-- '.$langs->trans("ActionAC_MANUAL");
|
||||
}
|
||||
if ($typecalendar == 'systemauto') {
|
||||
$label = ' '.$label;
|
||||
$repid[-98] = $langs->trans("ActionAC_AUTO");
|
||||
$repcode['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO");
|
||||
}
|
||||
if($typecalendar == 'user') {
|
||||
$label = ' '.$label;
|
||||
$repid[-97] = $langs->trans("ActionAC_USER");
|
||||
$repcode['ActionAC_USER'] = '-- '.$langs->trans("ActionAC_USER");
|
||||
$TSystemAuto['id'][-98] = $langs->trans("ActionAC_AUTO");
|
||||
$TSystemAuto['code']['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO");
|
||||
}
|
||||
|
||||
if ($typecalendar == 'module') {
|
||||
//TODO check if possible to push it between system and systemauto
|
||||
if (preg_match('/@/', $obj->module)) {
|
||||
|
|
@ -293,30 +292,36 @@ class CActionComm
|
|||
if (!isset($repcode['AC_ALL_'.strtoupper($module)])) { // If first time for this module
|
||||
$idforallfornewmodule--;
|
||||
}
|
||||
$repid[$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module));
|
||||
$repcode['AC_ALL_'.strtoupper($module)] = '-- '.$langs->trans("Module").' '.ucfirst($module);
|
||||
$TModule['id'][$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module));
|
||||
$TModule['code']['AC_ALL_'.strtoupper($module)] = '-- '.$langs->trans("Module").' '.ucfirst($module);
|
||||
}
|
||||
|
||||
}
|
||||
$repid[$obj->id] = $label;
|
||||
$repcode[$obj->code] = $label;
|
||||
$repall[$obj->code] = array('id' => $label, 'label' => $label, 'type' => $typecalendar, 'color' => $obj->color, 'picto' => $obj->picto);
|
||||
if($typecalendar == 'system' || $typecalendar == 'user') {
|
||||
$TSystem['id'][$obj->id] = $label;
|
||||
$TSystem['code'][$obj->code] = $label;
|
||||
$TSystem['all'][$obj->code] = array('id' => $label, 'label' => $label, 'type' => $typecalendar, 'color' => $obj->color, 'picto' => $obj->picto);
|
||||
} elseif($typecalendar == 'systemauto') {
|
||||
$TSystemAuto['id'][$obj->id] = $label;
|
||||
$TSystemAuto['code'][$obj->code] = $label;
|
||||
$TSystemAuto['all'][$obj->code] = array('id' => $label, 'label' => $label, 'type' => $typecalendar, 'color' => $obj->color, 'picto' => $obj->picto);
|
||||
}
|
||||
|
||||
if ($onlyautoornot > 0 && preg_match('/^module/', $obj->type) && $obj->module) {
|
||||
$repcode[$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
|
||||
$repall[$obj->code]['label'] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
|
||||
$TModule['code'][$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
|
||||
$TModule['all'][$obj->code]['label'] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($idorcode == 'id') {
|
||||
$this->liste_array = $repid;
|
||||
} elseif ($idorcode == 'code') {
|
||||
$this->liste_array = $repcode;
|
||||
} else {
|
||||
$this->liste_array = $repall;
|
||||
}
|
||||
if(empty($idorcode)) $idorcode = 'all';
|
||||
$TType = $TSystem[$idorcode];
|
||||
if(! empty($TSystemAuto[$idorcode])) $TType = array_merge($TSystem[$idorcode], $TSystemAuto[$idorcode]);
|
||||
if(! empty($TModule[$idorcode])) $TType = array_merge($TSystem[$idorcode], $TModule[$idorcode]);
|
||||
$this->liste_array = $TType;
|
||||
|
||||
|
||||
return $this->liste_array;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue