Skip to content
Snippets Groups Projects
Commit 4df9fb38 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Add option AGENDA_ALWAYS_HIDE_AUTO

parent 0fba70d4
Branches
Tags
No related merge requests found
...@@ -483,6 +483,13 @@ if ($resql) ...@@ -483,6 +483,13 @@ if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// Discard auto action if option is on
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO')
{
$i++;
continue;
}
// Create a new object action // Create a new object action
$event=new ActionComm($db); $event=new ActionComm($db);
$event->id=$obj->id; $event->id=$obj->id;
......
...@@ -156,7 +156,7 @@ if ($type) $param.="&type=".$type; ...@@ -156,7 +156,7 @@ if ($type) $param.="&type=".$type;
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
$sql.= " a.fk_contact, a.note, a.label, a.percent as percent,"; $sql.= " a.fk_contact, a.note, a.label, a.percent as percent,";
$sql.= " c.code as acode, c.libelle,"; $sql.= " c.code as code, c.libelle,";
$sql.= " ua.login as loginauthor, ua.rowid as useridauthor,"; $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,"; $sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
//$sql.= " ud.login as logindone, ud.rowid as useriddone,"; //$sql.= " ud.login as logindone, ud.rowid as useriddone,";
...@@ -292,6 +292,13 @@ if ($resql) ...@@ -292,6 +292,13 @@ if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// Discard auto action if option is on
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO')
{
$i++;
continue;
}
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
...@@ -299,7 +306,7 @@ if ($resql) ...@@ -299,7 +306,7 @@ if ($resql)
// Action (type) // Action (type)
print '<td>'; print '<td>';
$actionstatic->id=$obj->id; $actionstatic->id=$obj->id;
$actionstatic->type_code=$obj->acode; $actionstatic->type_code=$obj->code;
$actionstatic->libelle=$obj->label; $actionstatic->libelle=$obj->label;
print $actionstatic->getNomUrl(1,28); print $actionstatic->getNomUrl(1,28);
print '</td>'; print '</td>';
......
...@@ -395,6 +395,13 @@ if ($resql) ...@@ -395,6 +395,13 @@ if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// Discard auto action if option is on
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO')
{
$i++;
continue;
}
// Create a new object action // Create a new object action
$event=new ActionComm($db); $event=new ActionComm($db);
$event->id=$obj->id; $event->id=$obj->id;
......
...@@ -266,6 +266,8 @@ class FormActions ...@@ -266,6 +266,8 @@ class FormActions
if ($selected == 'manual') $selected='AC_OTH'; if ($selected == 'manual') $selected='AC_OTH';
if ($selected == 'auto') $selected='AC_OTH_AUTO'; if ($selected == 'auto') $selected='AC_OTH_AUTO';
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
print $form->selectarray($htmlname, $arraylist, $selected); print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment