Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable behaviour of whole-day appointments in calendar-view (19.1) #82

Open
wants to merge 3 commits into
base: 19.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions calendar/inc/class.calendar_hooks.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ static function settings($hook_data)
$export_tzs += Api\DateTime::getTimezones();
}
$link_title_options = calendar_bo::get_link_options();
$whole_day_behaviour_options = array(
'all_appointments' => lang('All as one-liners'),
'except_me' => lang('All as one-liners except mine'),
'default' => lang('Non-blocking as one-liners')
Copy link
Member

@ralfbecker ralfbecker Jul 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should be "" AND the first option, so nothing changes for existing installs.

Obviously the checking the preference need to be adapted too, "" is NOT stored!

);
$settings = array(
'1.section' => array(
'type' => 'section',
Expand Down Expand Up @@ -431,6 +436,14 @@ static function settings($hook_data)
'xmlrpc' => True,
'admin' => False,
),
'whole_day_behaviour' => array(
'type' => 'select',
'label' => 'Display behavior of whole-day appointments',
'name' => 'whole_day_behaviour',
'help' => 'How should a whole-day appointment be displayed?<br>By default blocking appointments are displayed spanning an entire day, non-blocking appointments are shown as one-liner above the dayview.',
'values' => $whole_day_behaviour_options,
'default' => 'default',
),
'2.5.section' => array(
'type' => 'section',
'title' => lang('Configuration settings'),
Expand Down
14 changes: 13 additions & 1 deletion calendar/js/et2_widget_daycol.js
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,19 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
}
if(!event.start.getUTCHours() && !event.start.getUTCMinutes() && event.end.getUTCHours() == 23 && event.end.getUTCMinutes() == 59)
{
event.whole_day_on_top = (event.non_blocking && event.non_blocking != '0');
var wholeDayBehaviour = egw.preference('whole_day_behaviour', 'calendar');
if (wholeDayBehaviour === 'all_appointments')
{
event.whole_day_on_top = true;
}
else if (wholeDayBehaviour === 'except_me')
{
event.whole_day_on_top = (event.creator != egw.user('account_id') && event.owner != egw.user('account_id'));
}
else
{
event.whole_day_on_top = (event.non_blocking && event.non_blocking != '0');
}
}
if (!event['whole_day_on_top'])
{
Expand Down
5 changes: 5 additions & 0 deletions calendar/lang/egw_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ alarm deleted calendar de Alarm gelöscht
alarm for %1 at %2 in %3 calendar de Alarm für %1 am %2 in %3
alarm management calendar de Alarm Management
alarms calendar de Alarme
all as one-liners calendar de Alle als Einzeiler
all as one-liners except mine calendar de Alle als Einzeiler (außer eigenen)
all categories calendar de Alle Kategorien
all day calendar de ganztägig
all events calendar de Alle Termine
Expand Down Expand Up @@ -164,6 +166,7 @@ delete this series of recurring events calendar de Diese Serie von wiederholende
deleted calendar de Gelöscht
deny resources reservation for private events calendar de Verbiete die Reservierung von Ressourcen für private Termine
directory with documents to insert entries calendar de Verzeichnis mit Dokumenten zum Einfügen von Kalendereinträgen
display behavior of whole-day appointments calendar de Anzeigeverhalten ganztägiger Termine
display holidays or birthdays as events in dayview calendar de Zeige Feier- oder Geburtstage in der Tagesansicht als Termine
display in header calendar de Im Titel anzeigen
display status of events calendar de Status von Terminen anzeigen
Expand Down Expand Up @@ -296,6 +299,7 @@ how many minutes should each interval last? calendar de Wie viele Minuten soll j
how many separate calendars to show before merging them together calendar de Ab der eingestellten Anzahl Benutzer werden die Kalender nicht mehr getrennt, sondern zusammenfasst in einem Kalender angezeigt.<br>So können die Kalender eines kleinen Teams getrennt dargestellt werden. Aber auch viele Kalender können durch die Konsolidierung dargestellt werden.<br>In der getrennten Darstellung können Termine zwischen den Kalendern verschoben oder eine Einladung per DnD ausgelöst werden.
how many weeks should the multiple week view show? calendar de Wie viele Wochen soll die Mehrwochenansicht zeigen?
how much entries to skip calendar de Wie viele Einträge sollen übersprungen werden
how should a whole-day appointment be displayed?<br>By default blocking appointments are displayed spanning an entire day, non-blocking appointments are shown as one-liner above the dayview. calendar de Wie soll ein ganztägiger Termin dargestellt werden?<br>Blockierende Termine werden als Block über den gesamten Tag dargestellt, nicht-blockierende Termine als Einzeiler oberhalb der Tagesansicht.
html link to the current record calendar de HTML-Link zum aktuellen Datensatz
ical calendar de iCal
ical / rfc2445 calendar de iCal / RFC2445
Expand Down Expand Up @@ -387,6 +391,7 @@ no response calendar de Keine Antwort
no rights to export more than %1 entries! calendar de Sie haben keine Rechte mehr als %1 Einträge zu exportieren!
no, users will need to contact users with direct booking permission calendar de Nein, Benutzer müssen sich mit Benutzern mit direkter Buchungsberechtigung in Verbindung setzen.
non blocking calendar de nicht blockierend
non-blocking as one-liners calendar de Nicht-blockierende als Einzeiler
not calendar de nicht
not rejected calendar de Nicht abgesagt
nothing to update, version is already %1. calendar de Nichts aktualisiert, Version ist bereits %1
Expand Down
5 changes: 5 additions & 0 deletions calendar/lang/egw_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ alarm deleted calendar en Alarm deleted.
alarm for %1 at %2 in %3 calendar en Alarm for %1 at %2 in %3
alarm management calendar en Alarm management
alarms calendar en Alarms
all as one-liners calendar en All as one-liners
all as one-liners except mine calendar en All as one-liners except mine
all categories calendar en All categories
all day calendar en All day
all events calendar en All events
Expand Down Expand Up @@ -164,6 +166,7 @@ delete this series of recurring events calendar en Delete this series of recurri
deleted calendar en Deleted.
deny resources reservation for private events calendar en Deny resources reservation for private events
directory with documents to insert entries calendar en Directory with documents to insert entries
display behavior of whole-day appointments calendar en Display behavior of whole-day appointments
display holidays or birthdays as events in dayview calendar en Display holidays or birthdays as events in dayview
display in header calendar en Display in header
display status of events calendar en Display status of events
Expand Down Expand Up @@ -296,6 +299,7 @@ how many minutes should each interval last? calendar en How many minutes should
how many separate calendars to show before merging them together calendar en Minimum number of users for showing a consolidated calendar view, if less user are selected the calendar is displayed separately for week or day view.
how many weeks should the multiple week view show? calendar en How many weeks should the multiple week view show?
how much entries to skip calendar en How much entries to skip?
how should a whole-day appointment be displayed?<br>By default blocking appointments are displayed spanning an entire day, non-blocking appointments are shown as one-liner above the dayview. calendar en How should a whole-day appointment be displayed?<br>By default blocking appointments are displayed spanning an entire day, non-blocking appointments are shown as one-liner above the dayview.
html link to the current record calendar en HTML link to the current record
ical calendar en iCal
ical / rfc2445 calendar en iCal / rfc2445
Expand Down Expand Up @@ -387,6 +391,7 @@ no response calendar en No response
no rights to export more than %1 entries! calendar en No rights to export more than %1 entries!
no, users will need to contact users with direct booking permission calendar en No, users will need to contact users with direct booking permission
non blocking calendar en Non blocking
non-blocking as one-liners calendar en Non-blocking as one-liners
not calendar en Not
not rejected calendar en Not rejected
nothing to update, version is already %1. calendar en Nothing to update, version is already %1.
Expand Down