Merge remote-tracking branch 'origin/master' into htmlarea_tinymce

This commit is contained in:
Hadi Nategh 2018-10-23 17:11:12 +02:00
commit 9a331446c8
4 changed files with 33 additions and 15 deletions

View File

@ -144,6 +144,8 @@ class calendar_import_ical implements importexport_iface_import_plugin {
$owner = $plugin_options['cal_owner']; $owner = $plugin_options['cal_owner'];
// Purge // Purge
if($plugin_options['empty_before_import'])
{
$remove_past = new Api\DateTime(); $remove_past = new Api\DateTime();
$remove_future = new Api\DateTime(); $remove_future = new Api\DateTime();
$plugin_options = array_merge(array('remove_past' => 100, 'remove_future' => 365), $plugin_options); $plugin_options = array_merge(array('remove_past' => 100, 'remove_future' => 365), $plugin_options);
@ -156,6 +158,7 @@ class calendar_import_ical implements importexport_iface_import_plugin {
array('from' => $remove_past, 'to' => $remove_future), array('from' => $remove_past, 'to' => $remove_future),
$plugin_options['no_notification'] $plugin_options['no_notification']
); );
}
// User wants conflicting events to not be imported // User wants conflicting events to not be imported
if($_definition->plugin_options['skip_conflicts']) if($_definition->plugin_options['skip_conflicts'])

View File

@ -70,7 +70,7 @@ class calendar_wizard_import_ical
{ {
$content['text'] = $this->steps['wizard_step55']; $content['text'] = $this->steps['wizard_step55'];
$content['step'] = 'wizard_step55'; $content['step'] = 'wizard_step55';
foreach(array('skip_conflicts','remove_past','remove_future') as $field) foreach(array('skip_conflicts','empty_before_import','remove_past','remove_future') as $field)
{ {
if(!$content[$field] && array_key_exists($field, $content['plugin_options'])) if(!$content[$field] && array_key_exists($field, $content['plugin_options']))
{ {

View File

@ -1602,6 +1602,17 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.owner.set_label(''); this.owner.set_label('');
this.div.removeClass('calendar_TimeGridNoLabel'); this.div.removeClass('calendar_TimeGridNoLabel');
// Check to see if it's our own calendar, with just us showing
if(typeof _owner == 'object' && _owner.length == 1 && _owner[0] == this.egw().user('account_id'))
{
var rowCount = 0;
this._parent.iterateOver(function(widget) {
if(!widget.disabled) rowCount++;
},this, et2_calendar_timegrid);
// Just us, show week number
if(rowCount == 1) _owner = false;
}
if(typeof _owner == 'string' && isNaN(_owner)) if(typeof _owner == 'string' && isNaN(_owner))
{ {
this.set_label(''); this.set_label('');
@ -1610,7 +1621,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
// Label is empty, but give extra space for the owner name // Label is empty, but give extra space for the owner name
this.div.removeClass('calendar_TimeGridNoLabel'); this.div.removeClass('calendar_TimeGridNoLabel');
} }
else if (!_owner || typeof _owner == 'object' && _owner.length) else if (!_owner || typeof _owner == 'object' && _owner.length > 1)
{ {
// Don't show owners if more than one, show week number // Don't show owners if more than one, show week number
this.owner.set_value(''); this.owner.set_value('');

View File

@ -9,9 +9,13 @@
<description value="Do not import conflicting events"/> <description value="Do not import conflicting events"/>
<checkbox id="skip_conflicts"/> <checkbox id="skip_conflicts"/>
</hbox> </hbox>
<description/>
<hbox>
<description id="delete_title" value="Empty target calendar before importing" font_style="b" class="et2_bold"/> <description id="delete_title" value="Empty target calendar before importing" font_style="b" class="et2_bold"/>
<integer label="How many days to be removed in the past (default 100)" id="remove_past"/> <checkbox id="empty_before_import" onchange="var enabled = widget.getValue() == 'true'; var past = widget.getRoot().getWidgetById('remove_past'); var future = widget.getRoot().getWidgetById('remove_future');past.set_disabled(!enabled);future.set_disabled(!enabled);return true;"/>
<integer label="How many days to be removed in the future (default 365)" id="remove_future"/> </hbox>
<integer label="How many days to be removed in the past (default 100)" id="remove_past" disabled="!@empty_before_import"/>
<integer label="How many days to be removed in the future (default 365)" id="remove_future" disabled="!@empty_before_import"/>
</vbox> </vbox>
<styles> <styles>
#importexport-wizardbox_delete_title { #importexport-wizardbox_delete_title {