diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index 3b932b2f59c..870bb8c109e 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -144,7 +144,7 @@ class CActionComm
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
- * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
+ * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param string $morefilter Add more SQL filter
* @param int $shortlabel 1=Get short label instead of long label
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
@@ -166,7 +166,7 @@ class CActionComm
}
if (!empty($excludetype)) $sql .= " AND type <> '".$this->db->escape($excludetype)."'";
if ($morefilter) $sql .= " AND ".$morefilter;
- $sql .= " ORDER BY module, position, type";
+ $sql .= " ORDER BY type, position, module";
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -200,8 +200,12 @@ class CActionComm
$keyfortrans = '';
$transcode = '';
$code = $obj->code;
- if ($onlyautoornot > 0 && $code == 'AC_OTH') $code = 'AC_MANUAL';
- if ($onlyautoornot > 0 && $code == 'AC_OTH_AUTO') $code = 'AC_AUTO';
+ $typecalendar = $obj->type;
+
+ if ($onlyautoornot > 0 && $typecalendar == 'system') $code = 'AC_MANUAL';
+ elseif ($onlyautoornot > 0 && $typecalendar == 'systemauto') $code = 'AC_AUTO';
+ elseif ($onlyautoornot > 0) $code = 'AC_'.strtoupper($obj->module);
+
if ($shortlabel)
{
$keyfortrans = "Action".$code.'Short';
@@ -213,11 +217,18 @@ class CActionComm
$transcode = $langs->trans($keyfortrans);
}
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
- if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE) && !preg_match('/auto/i', $code))
+ if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
- $label = ' '.$label;
- $repid[-99] = $langs->trans("ActionAC_MANUAL");
- $repcode['AC_NON_AUTO'] = $langs->trans("ActionAC_MANUAL");
+ if ($typecalendar == 'system') {
+ $label = ' '.$label;
+ $repid[-99] = $langs->trans("ActionAC_MANUAL");
+ $repcode['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");
+ }
}
$repid[$obj->id] = $label;
$repcode[$obj->code] = $label;
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index d5f5edbb143..10c95f0b64b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -541,6 +541,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
{
$s = $hookmanager->resPrint;
}
+
+ $s .= "\n".''."\n";
} else // If javascript off
{
$newparam = $param; // newparam is for birthday links
@@ -554,6 +556,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$link .= '';
}
+
+// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
// Load events from database into $eventarray
$eventarray = array();
@@ -752,6 +756,7 @@ if ($resql)
dol_print_error($db);
}
+// BIRTHDATES CALENDAR
// Complete $eventarray with birthdates
if ($showbirthday)
{
@@ -817,6 +822,7 @@ if ($showbirthday)
}
}
+// HOLIDAYS CALENDAR
if ($conf->global->AGENDA_SHOW_HOLIDAYS)
{
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
@@ -900,6 +906,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
}
}
+// EXTERNAL CALENDAR
// Complete $eventarray with external import Ical
if (count($listofextcals))
{
@@ -1205,9 +1212,11 @@ if (is_readable($color_file))
}
if (!is_array($theme_datacolor)) $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
+$massactionbutton ='';
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode);
+// Show div with list of calendars
print $s;
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 33e0c01aad6..d16188d40d4 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -4,7 +4,7 @@ Actions=Events
Agenda=Agenda
TMenuAgenda=Agenda
Agendas=Agendas
-LocalAgenda=Internal calendar
+LocalAgenda=Default calendar
ActionsOwnedBy=Event owned by
ActionsOwnedByShort=Owner
AffectedTo=Assigned to
@@ -20,7 +20,7 @@ MenuToDoActions=All incomplete events
MenuDoneActions=All terminated events
MenuToDoMyActions=My incomplete events
MenuDoneMyActions=My terminated events
-ListOfEvents=List of events (internal calendar)
+ListOfEvents=List of events (default calendar)
ActionsAskedBy=Events reported by
ActionsToDoBy=Events assigned to
ActionsDoneBy=Events done by
@@ -131,7 +131,7 @@ AgendaUrlOptions4=logint=%s to restrict output to actions assigned to use
AgendaUrlOptionsProject=project=__PROJECT_ID__ to restrict output to actions linked to project __PROJECT_ID__.
AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic events.
AgendaUrlOptionsIncludeHolidays=includeholidays=1 to include events of holidays.
-AgendaShowBirthdayEvents=Show birthdays of contacts
+AgendaShowBirthdayEvents=Birthdays of contacts
AgendaHideBirthdayEvents=Hide birthdays of contacts
Busy=Busy
ExportDataset_event1=List of agenda events
diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang
index 10c536e0d48..2181b48ecb4 100644
--- a/htdocs/langs/en_US/commercial.lang
+++ b/htdocs/langs/en_US/commercial.lang
@@ -64,10 +64,10 @@ ActionAC_SHIP=Send shipping by mail
ActionAC_SUP_ORD=Send purchase order by mail
ActionAC_SUP_INV=Send vendor invoice by mail
ActionAC_OTH=Other
-ActionAC_OTH_AUTO=Automatically inserted events
+ActionAC_OTH_AUTO=Other auto
ActionAC_MANUAL=Manually inserted events
ActionAC_AUTO=Automatically inserted events
-ActionAC_OTH_AUTOShort=Auto
+ActionAC_OTH_AUTOShort=Other
Stats=Sales statistics
StatusProsp=Prospect status
DraftPropals=Draft commercial proposals
diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang
index 072fd057dbf..7ecd5800861 100644
--- a/htdocs/langs/fr_FR/agenda.lang
+++ b/htdocs/langs/fr_FR/agenda.lang
@@ -130,7 +130,7 @@ AgendaUrlOptions4=logint=%spour limiter l'export aux actions assignées
AgendaUrlOptionsProject=project=__PROJECT_ID__ pour restreindre aux événements associés au projet __PROJECT_ID__.
AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto pour exclure les événements automatiques.
AgendaUrlOptionsIncludeHolidays=includeholidays=1 pour inclure les événements de type congé.
-AgendaShowBirthdayEvents=Afficher les anniversaires de contacts
+AgendaShowBirthdayEvents=Anniversaires de contacts
AgendaHideBirthdayEvents=Masquer les anniversaires de contacts
Busy=Occupé
ExportDataset_event1=Liste des événements de l'agenda
diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang
index 9b5721326d1..badec05e8c2 100644
--- a/htdocs/langs/fr_FR/commercial.lang
+++ b/htdocs/langs/fr_FR/commercial.lang
@@ -64,10 +64,10 @@ ActionAC_SHIP=Envoi bon d'expédition par email
ActionAC_SUP_ORD=Envoi commande fournisseur par email
ActionAC_SUP_INV=Envoi facture fournisseur par email
ActionAC_OTH=Autre
-ActionAC_OTH_AUTO=Évènements insérés automatiquement
+ActionAC_OTH_AUTO=Autre auto
ActionAC_MANUAL=Événements insérés manuellement
ActionAC_AUTO=Événements insérés automatiquement
-ActionAC_OTH_AUTOShort=Auto
+ActionAC_OTH_AUTOShort=Autre
Stats=Statistiques de vente
StatusProsp=Status prospection
DraftPropals=Propositions brouillons