* Calendar/Filemanager: display warning when clicking on an iCal file with more then 1 event, only first one is displayed

This commit is contained in:
Ralf Becker 2015-09-16 11:37:20 +00:00
parent 1e75cd8a92
commit a10f45ec79
3 changed files with 11 additions and 3 deletions

View File

@ -1202,8 +1202,9 @@ class calendar_uiforms extends calendar_ui
* edit_single int timestamp of single event edited, unset/null otherwise * edit_single int timestamp of single event edited, unset/null otherwise
* @param string $msg ='' msg to display * @param string $msg ='' msg to display
* @param mixed $link_to_id ='' from or for the link-widget * @param mixed $link_to_id ='' from or for the link-widget
* @param string $msg_type =null default automatic detect, if it contains "error"
*/ */
function edit($event=null,$preserv=null,$msg='',$link_to_id='') function edit($event=null,$preserv=null,$msg='',$link_to_id='',$msg_type=null)
{ {
$sel_options = array( $sel_options = array(
'recur_type' => &$this->bo->recur_types, 'recur_type' => &$this->bo->recur_types,
@ -1258,7 +1259,7 @@ class calendar_uiforms extends calendar_ui
if (!empty($_GET['ical'])) if (!empty($_GET['ical']))
{ {
$ical = new calendar_ical(); $ical = new calendar_ical();
if (!($events = $ical->icaltoegw($_GET['ical'], '', 'utf-8')) || count($events) != 1) if (!($events = $ical->icaltoegw($_GET['ical'], '', 'utf-8')))
{ {
error_log(__METHOD__."('$_GET[ical]') error parsing iCal!"); error_log(__METHOD__."('$_GET[ical]') error parsing iCal!");
$msg = lang('Error: importing the iCal'); $msg = lang('Error: importing the iCal');
@ -1266,6 +1267,11 @@ class calendar_uiforms extends calendar_ui
} }
else else
{ {
if (count($events) > 1)
{
$msg = lang('%1 events in iCal file, only first one imported and displayed!', count($events));
$msg_type = 'notice'; // no not hide automatic
}
// as icaltoegw returns timestamps in server-time, we have to convert them here to user-time // as icaltoegw returns timestamps in server-time, we have to convert them here to user-time
$this->bo->db2data($events, 'ts'); $this->bo->db2data($events, 'ts');
@ -1415,9 +1421,9 @@ class calendar_uiforms extends calendar_ui
'edit_single' => $preserv['edit_single'], // need to be in content too, as it is used in the template 'edit_single' => $preserv['edit_single'], // need to be in content too, as it is used in the template
'tabs' => $preserv['tabs'], 'tabs' => $preserv['tabs'],
'view' => $view, 'view' => $view,
'msg' => $msg,
'query_delete_exceptions' => (int)($event['recur_type'] && $event['recur_exception']), 'query_delete_exceptions' => (int)($event['recur_type'] && $event['recur_exception']),
)); ));
egw_framework::message($msg, $msg_type);
$content['duration'] = $content['end'] - $content['start']; $content['duration'] = $content['end'] - $content['start'];
if (isset($this->durations[$content['duration']])) $content['end'] = ''; if (isset($this->durations[$content['duration']])) $content['end'] = '';

View File

@ -2,6 +2,7 @@
%1 days calendar de %1 Tage %1 days calendar de %1 Tage
%1 event(s) %2 calendar de %1 Termin(e) %2 %1 event(s) %2 calendar de %1 Termin(e) %2
%1 event(s) %2, %3 failed because of insufficent rights !!! calendar de %1 Termin(e) %2, %3 wegen fehlender Rechte !!! %1 event(s) %2, %3 failed because of insufficent rights !!! calendar de %1 Termin(e) %2, %3 wegen fehlender Rechte !!!
%1 events in ical file, only first one imported and displayed! calendar de %1 Termine in der iCal Datei, nur der erste wurde importiert und angezeigt!
%1 hours calendar de %1 Stunden %1 hours calendar de %1 Stunden
%1 minutes calendar de %1 Minuten %1 minutes calendar de %1 Minuten
%1 participants removed because of missing invite grants calendar de %1 Teilnehmer entfernt wegen fehlender Einladungsrechte %1 participants removed because of missing invite grants calendar de %1 Teilnehmer entfernt wegen fehlender Einladungsrechte

View File

@ -2,6 +2,7 @@
%1 days calendar en %1 days %1 days calendar en %1 days
%1 event(s) %2 calendar en %1 event(s) %2 %1 event(s) %2 calendar en %1 event(s) %2
%1 event(s) %2, %3 failed because of insufficent rights !!! calendar en %1 event(s) %2, %3 failed because of insufficient rights! %1 event(s) %2, %3 failed because of insufficent rights !!! calendar en %1 event(s) %2, %3 failed because of insufficient rights!
%1 events in ical file, only first one imported and displayed! calendar en %1 events in iCal file, only first one imported and displayed!
%1 hours calendar en %1 hours %1 hours calendar en %1 hours
%1 minutes calendar en %1 minutes %1 minutes calendar en %1 minutes
%1 participants removed because of missing invite grants calendar en %1 participants removed because of missing invite grants. %1 participants removed because of missing invite grants calendar en %1 participants removed because of missing invite grants.