Enhancement Auto and manual calendar. Better separation.
This commit is contained in:
parent
36e0deba3f
commit
fc9d6cef97
@ -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|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 $idorcode 'id' or 'code'
|
||||||
* @param string $excludetype Type to exclude ('system' or 'systemauto')
|
* @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 string $morefilter Add more SQL filter
|
||||||
* @param int $shortlabel 1=Get short label instead of long label
|
* @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.
|
* @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 (!empty($excludetype)) $sql .= " AND type <> '".$this->db->escape($excludetype)."'";
|
||||||
if ($morefilter) $sql .= " AND ".$morefilter;
|
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);
|
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -200,8 +200,12 @@ class CActionComm
|
|||||||
$keyfortrans = '';
|
$keyfortrans = '';
|
||||||
$transcode = '';
|
$transcode = '';
|
||||||
$code = $obj->code;
|
$code = $obj->code;
|
||||||
if ($onlyautoornot > 0 && $code == 'AC_OTH') $code = 'AC_MANUAL';
|
$typecalendar = $obj->type;
|
||||||
if ($onlyautoornot > 0 && $code == 'AC_OTH_AUTO') $code = 'AC_AUTO';
|
|
||||||
|
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)
|
if ($shortlabel)
|
||||||
{
|
{
|
||||||
$keyfortrans = "Action".$code.'Short';
|
$keyfortrans = "Action".$code.'Short';
|
||||||
@ -213,11 +217,18 @@ class CActionComm
|
|||||||
$transcode = $langs->trans($keyfortrans);
|
$transcode = $langs->trans($keyfortrans);
|
||||||
}
|
}
|
||||||
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
|
$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;
|
if ($typecalendar == 'system') {
|
||||||
$repid[-99] = $langs->trans("ActionAC_MANUAL");
|
$label = ' '.$label;
|
||||||
$repcode['AC_NON_AUTO'] = $langs->trans("ActionAC_MANUAL");
|
$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;
|
$repid[$obj->id] = $label;
|
||||||
$repcode[$obj->code] = $label;
|
$repcode[$obj->code] = $label;
|
||||||
|
|||||||
@ -541,6 +541,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
|||||||
{
|
{
|
||||||
$s = $hookmanager->resPrint;
|
$s = $hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$s .= "\n".'<!-- End div to calendars selectors -->'."\n";
|
||||||
} else // If javascript off
|
} else // If javascript off
|
||||||
{
|
{
|
||||||
$newparam = $param; // newparam is for birthday links
|
$newparam = $param; // newparam is for birthday links
|
||||||
@ -554,6 +556,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
|||||||
$link .= '</a>';
|
$link .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
|
||||||
// Load events from database into $eventarray
|
// Load events from database into $eventarray
|
||||||
$eventarray = array();
|
$eventarray = array();
|
||||||
|
|
||||||
@ -752,6 +756,7 @@ if ($resql)
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BIRTHDATES CALENDAR
|
||||||
// Complete $eventarray with birthdates
|
// Complete $eventarray with birthdates
|
||||||
if ($showbirthday)
|
if ($showbirthday)
|
||||||
{
|
{
|
||||||
@ -817,6 +822,7 @@ if ($showbirthday)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HOLIDAYS CALENDAR
|
||||||
if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
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";
|
$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
|
// Complete $eventarray with external import Ical
|
||||||
if (count($listofextcals))
|
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));
|
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.'<span class="marginleftonly"></span>'.$newcardbutton, '', $limit, 1, 0, 1, $viewmode);
|
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.'<span class="marginleftonly"></span>'.$newcardbutton, '', $limit, 1, 0, 1, $viewmode);
|
||||||
|
|
||||||
|
// Show div with list of calendars
|
||||||
print $s;
|
print $s;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Actions=Events
|
|||||||
Agenda=Agenda
|
Agenda=Agenda
|
||||||
TMenuAgenda=Agenda
|
TMenuAgenda=Agenda
|
||||||
Agendas=Agendas
|
Agendas=Agendas
|
||||||
LocalAgenda=Internal calendar
|
LocalAgenda=Default calendar
|
||||||
ActionsOwnedBy=Event owned by
|
ActionsOwnedBy=Event owned by
|
||||||
ActionsOwnedByShort=Owner
|
ActionsOwnedByShort=Owner
|
||||||
AffectedTo=Assigned to
|
AffectedTo=Assigned to
|
||||||
@ -20,7 +20,7 @@ MenuToDoActions=All incomplete events
|
|||||||
MenuDoneActions=All terminated events
|
MenuDoneActions=All terminated events
|
||||||
MenuToDoMyActions=My incomplete events
|
MenuToDoMyActions=My incomplete events
|
||||||
MenuDoneMyActions=My terminated events
|
MenuDoneMyActions=My terminated events
|
||||||
ListOfEvents=List of events (internal calendar)
|
ListOfEvents=List of events (default calendar)
|
||||||
ActionsAskedBy=Events reported by
|
ActionsAskedBy=Events reported by
|
||||||
ActionsToDoBy=Events assigned to
|
ActionsToDoBy=Events assigned to
|
||||||
ActionsDoneBy=Events done by
|
ActionsDoneBy=Events done by
|
||||||
@ -131,7 +131,7 @@ AgendaUrlOptions4=<b>logint=%s</b> to restrict output to actions assigned to use
|
|||||||
AgendaUrlOptionsProject=<b>project=__PROJECT_ID__</b> to restrict output to actions linked to project <b>__PROJECT_ID__</b>.
|
AgendaUrlOptionsProject=<b>project=__PROJECT_ID__</b> to restrict output to actions linked to project <b>__PROJECT_ID__</b>.
|
||||||
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> to exclude automatic events.
|
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> to exclude automatic events.
|
||||||
AgendaUrlOptionsIncludeHolidays=<b>includeholidays=1</b> to include events of holidays.
|
AgendaUrlOptionsIncludeHolidays=<b>includeholidays=1</b> to include events of holidays.
|
||||||
AgendaShowBirthdayEvents=Show birthdays of contacts
|
AgendaShowBirthdayEvents=Birthdays of contacts
|
||||||
AgendaHideBirthdayEvents=Hide birthdays of contacts
|
AgendaHideBirthdayEvents=Hide birthdays of contacts
|
||||||
Busy=Busy
|
Busy=Busy
|
||||||
ExportDataset_event1=List of agenda events
|
ExportDataset_event1=List of agenda events
|
||||||
|
|||||||
@ -64,10 +64,10 @@ ActionAC_SHIP=Send shipping by mail
|
|||||||
ActionAC_SUP_ORD=Send purchase order by mail
|
ActionAC_SUP_ORD=Send purchase order by mail
|
||||||
ActionAC_SUP_INV=Send vendor invoice by mail
|
ActionAC_SUP_INV=Send vendor invoice by mail
|
||||||
ActionAC_OTH=Other
|
ActionAC_OTH=Other
|
||||||
ActionAC_OTH_AUTO=Automatically inserted events
|
ActionAC_OTH_AUTO=Other auto
|
||||||
ActionAC_MANUAL=Manually inserted events
|
ActionAC_MANUAL=Manually inserted events
|
||||||
ActionAC_AUTO=Automatically inserted events
|
ActionAC_AUTO=Automatically inserted events
|
||||||
ActionAC_OTH_AUTOShort=Auto
|
ActionAC_OTH_AUTOShort=Other
|
||||||
Stats=Sales statistics
|
Stats=Sales statistics
|
||||||
StatusProsp=Prospect status
|
StatusProsp=Prospect status
|
||||||
DraftPropals=Draft commercial proposals
|
DraftPropals=Draft commercial proposals
|
||||||
|
|||||||
@ -130,7 +130,7 @@ AgendaUrlOptions4=<b>logint=%s</b>pour limiter l'export aux actions assignées
|
|||||||
AgendaUrlOptionsProject=<b>project=__PROJECT_ID__</b> pour restreindre aux événements associés au projet <b>__PROJECT_ID__</b>.
|
AgendaUrlOptionsProject=<b>project=__PROJECT_ID__</b> pour restreindre aux événements associés au projet <b>__PROJECT_ID__</b>.
|
||||||
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> pour exclure les événements automatiques.
|
AgendaUrlOptionsNotAutoEvent=<b>notactiontype=systemauto</b> pour exclure les événements automatiques.
|
||||||
AgendaUrlOptionsIncludeHolidays=<b>includeholidays=1</b> pour inclure les événements de type congé.
|
AgendaUrlOptionsIncludeHolidays=<b>includeholidays=1</b> pour inclure les événements de type congé.
|
||||||
AgendaShowBirthdayEvents=Afficher les anniversaires de contacts
|
AgendaShowBirthdayEvents=Anniversaires de contacts
|
||||||
AgendaHideBirthdayEvents=Masquer les anniversaires de contacts
|
AgendaHideBirthdayEvents=Masquer les anniversaires de contacts
|
||||||
Busy=Occupé
|
Busy=Occupé
|
||||||
ExportDataset_event1=Liste des événements de l'agenda
|
ExportDataset_event1=Liste des événements de l'agenda
|
||||||
|
|||||||
@ -64,10 +64,10 @@ ActionAC_SHIP=Envoi bon d'expédition par email
|
|||||||
ActionAC_SUP_ORD=Envoi commande fournisseur par email
|
ActionAC_SUP_ORD=Envoi commande fournisseur par email
|
||||||
ActionAC_SUP_INV=Envoi facture fournisseur par email
|
ActionAC_SUP_INV=Envoi facture fournisseur par email
|
||||||
ActionAC_OTH=Autre
|
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_MANUAL=Événements insérés manuellement
|
||||||
ActionAC_AUTO=Événements insérés automatiquement
|
ActionAC_AUTO=Événements insérés automatiquement
|
||||||
ActionAC_OTH_AUTOShort=Auto
|
ActionAC_OTH_AUTOShort=Autre
|
||||||
Stats=Statistiques de vente
|
Stats=Statistiques de vente
|
||||||
StatusProsp=Status prospection
|
StatusProsp=Status prospection
|
||||||
DraftPropals=Propositions brouillons
|
DraftPropals=Propositions brouillons
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user