From cc86326cb42b1dd03fbd15d6941207c8e82580f3 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 16 Dec 2011 10:29:31 +0000 Subject: [PATCH] * calendar: allow to send a meeting request to all participants, add action to calendar event edit to choose between sending meeting requests or a mail with the ics file of an event attached. --- calendar/inc/class.calendar_uiforms.inc.php | 15 ++++++++++----- calendar/lang/egw_de.lang | 12 +++--------- calendar/lang/egw_en.lang | 3 +++ felamimail/inc/class.bocompose.inc.php | 21 +++++++++++++++------ felamimail/inc/class.felamimail_bo.inc.php | 4 ++-- felamimail/inc/class.uicompose.inc.php | 4 +++- 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 524022d12b..417baebf3b 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -503,6 +503,7 @@ class calendar_uiforms extends calendar_ui break; case 'mail': + case 'sendrequest': case 'save': case 'print': case 'apply': @@ -510,8 +511,9 @@ class calendar_uiforms extends calendar_ui { switch ($button) { + case 'sendrequest': case 'mail': // just mail without edit-rights is ok - $js = $this->custom_mail($event,false); + $js = $this->custom_mail($event,false,($button=='sendrequest')); break 2; case 'print': // just print without edit-rights is ok $js = $this->custom_print($event,false); @@ -832,9 +834,9 @@ class calendar_uiforms extends calendar_ui $js = $this->custom_print($event,!$content['id'])."\n".$js; // first open the new window and then update the view } - if ($button == 'mail') + if ($button == 'mail' || $button == 'sendrequest') { - $js = $this->custom_mail($event,!$content['id'])."\n".$js; // first open the new window and then update the view + $js = $this->custom_mail($event,!$content['id'],($button=='sendrequest'))."\n".$js; // first open the new window and then update the view } } else @@ -1002,7 +1004,7 @@ class calendar_uiforms extends calendar_ui * @param boolean $added * @return string javascript window.open command */ - function custom_mail($event,$added) + function custom_mail($event,$added,$asrequest=false) { $to = array(); @@ -1057,9 +1059,10 @@ class calendar_uiforms extends calendar_ui 'preset[body]' => $body, 'preset[name]' => 'event.ics', 'preset[file]' => $ics_file, - 'preset[type]' => 'text/calendar; method=request', + 'preset[type]' => 'text/calendar'.($asrequest?'; method=request':''), 'preset[size]' => filesize($ics_file), ); + if ($asrequest) $vars['preset[msg]'] = lang('You attempt to mail a meetingrequest to the recipients above. Depending on the client this mail is opened with, the recipient may or may not see the mailbody below, but only see the meeting request attached.'); return "window.open('".egw::link('/index.php',$vars)."','_blank','width=700,height=700,scrollbars=yes,status=no');"; } @@ -1107,6 +1110,7 @@ class calendar_uiforms extends calendar_ui 'ical' => array('label' => 'Export', 'title' => 'Download this event as iCal'), 'print' => array('label' => 'Print', 'title' => 'Print this event'), 'mail' => array('label' => 'Mail all participants', 'title' => 'compose a mail to all participants after the event is saved'), + 'sendrequest' => array('label' => 'Send meetingrequest to all participants', 'title' => 'Send meetingrequest to all participants after the event is saved'), ), ); unset($sel_options['status']['G']); @@ -1488,6 +1492,7 @@ function replace_eTemplate_onsubmit() if (!isset($GLOBALS['egw_info']['user']['apps']['felamimail'])) // no mail without mail-app { unset($sel_options['action']['mail']); + unset($sel_options['action']['sendmeetingrequest']); } if (!$event['id']) // no ical export for new (not saved) events { diff --git a/calendar/lang/egw_de.lang b/calendar/lang/egw_de.lang index f27198e7ca..c7b2b42458 100644 --- a/calendar/lang/egw_de.lang +++ b/calendar/lang/egw_de.lang @@ -84,7 +84,6 @@ category acl only restrict adding a category to an event or changing status of a chair calendar de Vorsitz change history calendar de Änderungshistorie change your status calendar de Eigenen Status ändern -charset of file calendar de Zeichensatz der Datei check all calendar de Alle auswählen choose a category calendar de Wählen Sie eine Kategorie close the window calendar de Schließt das Fenster @@ -185,8 +184,6 @@ exceptions calendar de Ausnahmen execute a further action for this entry calendar de Führt einen weiteren Befehl für diesen Eintrag aus existing links calendar de Bestehende Verknüpfungen exists calendar de existiert -export calendar de Exportieren -export definitition to use for nextmatch export calendar de Export Profil der Listenansicht (Disketten Symbol) exports events from your calendar in ical format. calendar de Exportiert Termine im iCal Format exports events from your calendar into a csv file. calendar de Exportiert Termine im CSV Format extended calendar de Erweitert @@ -212,8 +209,6 @@ freetime search calendar de Terminsuche fri calendar de Fr full description calendar de vollständige Beschreibung fullname of person to notify calendar de Name der zu benachrichtigenden Person -general calendar de Allgemein -general fields: calendar de Allgemeine Felder global categories calendar de Globale Kategorien global public and group public calendar de Global öffentlich und Gruppen öffentlich global public only calendar de nur Global öffentlich @@ -252,9 +247,7 @@ if checked holidays falling on a weekend, are taken on the monday after. calenda if start day differs calendar de Wenn die Starttage abweichen if you dont set a password here, the information is available to everyone, who knows the url!!! calendar de Wenn Sie hier kein Passwort angeben, ist die Information für jeden verfügbar, der die Adresse (URL) kennt!!! if you select a range (month, week, etc) instead of a list of entries, these extra fields are available calendar de Falls Sie einen Bereich (Monat, Woche, Tag) anstatt einer Liste von Einträge ausgewählt haben, können Sie folgende Platzhalter für Ihre Felder definieren. -if you specify an export definition, it will be used when you export calendar de Wenn Sie Export Definition auswählen, wird diese für den Export verwendet. ignore conflict calendar de Konflikt ignorieren -import calendar de Importieren import csv-file common de CSV-Datei importieren imports events into your calendar from a csv file. csv means 'comma seperated values'. however in the options tab you can also choose other seperators. calendar de Importieren von Terminen von einer CSV Datei. CSV bedeutet: mit Komma getrennte Werte. Sie können in den Optionen des Import ebenso einen anderen Separator (Tab) wählen. imports events into your calendar from an ical file. calendar de Importiert Termin in Ihrem Kalender von einer iCal Datei. @@ -283,7 +276,6 @@ location to autoload from admin de Von wo sollen sie geladen werden location, start- and endtimes, ... calendar de Ort, Start- und Endzeiten mail all participants calendar de Mail an alle Teilnehmer make freebusy information available to not loged in persons? calendar de Die Belegtzeiten für nicht angemeldete Personen verfügbar machen? -manage mapping calendar de Feldzuordnung bearbeiten max. number of entries to show (leave empty for no restriction) calendar de Max. Anzahl von Einträgen die angezeigt werden sollen (Kein Eintrag = Keine Beschränkung) maximum available quantity of %1 exceeded! calendar de Maximale Anzahl von %1 erreicht! meeting request calendar de Termineinladung @@ -406,6 +398,8 @@ select resources calendar de Ressourcen auswählen select whether you want the pariticpant stati reset to unkown, if an event is shifted later on. calendar de Wählen Sie aus, in welchem Fall der Teilnehmerstatus von Teilnehmern zurückgesetzt werden soll, wenn ein Termin verschoben wird. select who should get the alarm calendar de Auswählen wer den Alarm erhalten soll selected range calendar de Ausgewählter Zeitraum +send meetingrequest to all participants calendar de Terminanforderung an alle Teilnehmer senden +send meetingrequest to all participants after the event is saved calendar de Terminanforderung an alle Teilnehmer senden nachdem der Termin gespeichert wurde series deleted calendar de Serientermin wurde gelöscht set a year only for one-time / non-regular holidays. calendar de Nur für einmalige bzw. unregelmäßige Feiertage das Jahr angeben. set new events to private calendar de Neue Termine als private Termine eintragen @@ -496,7 +490,6 @@ to-firstname calendar de An Vorname to-fullname calendar de An Vor- und Nachname to-lastname calendar de An Nachname tomorrow calendar de Morgen -translation calendar de Übersetzung tue calendar de Di two weeks calendar de zwei Wochen type of planner calendar de Planer Typ @@ -547,6 +540,7 @@ yes, only admins can purge deleted items admin de Ja, nur Administratoren könne yes, users can purge their deleted items admin de Ja, Benutzer können gelöschte Einträge selbst bereinigen you are not allowed to book the resource selected: calendar de Sie sind nicht berechtigt die ausgewählte Ressource zu buchen. you are not invited to that event! calendar de Sie sind zu diesem Termin nicht eingeladen! +you attempt to mail a meetingrequest to the recipients above. depending on the client this mail is opened with, the recipient may or may not see the mailbody below, but only see the meeting request attached. calendar de Sie sind im Begriff eine Terminanforderung an die oben eingetragenen Empfänger zu versenden. Abhängig vom MailClient wird der jeweilige Empfänger die unten stehende Nachricht nie zu Gesicht bekommen, sondern nur die vom MailClient aufbereitete Terminanforderung. you can either set a year or a occurence, not both !!! calendar de Sie können nur entweder das Jahr oder die Wiederholung angeben, nicht beides! you can only set a year or a occurence !!! calendar de Sie können nur ein Jahr oder eine Wiederholung angeben ! you do not have permission to read this record! calendar de Sie haben keine Berechtigung diesen Eintrag zu lesen! diff --git a/calendar/lang/egw_en.lang b/calendar/lang/egw_en.lang index 457d4333a3..ff1286eebe 100644 --- a/calendar/lang/egw_en.lang +++ b/calendar/lang/egw_en.lang @@ -398,6 +398,8 @@ select resources calendar en Select resources select whether you want the pariticpant stati reset to unkown, if an event is shifted later on. calendar en Select whether you want the participant status reset to unknown, if an event is shifted later on. select who should get the alarm calendar en Select who should get the alarm selected range calendar en Selected range +send meetingrequest to all participants calendar en Send meetingrequest to all participants +send meetingrequest to all participants after the event is saved calendar en Send meetingrequest to all participants after the event is saved series deleted calendar en Series deleted set a year only for one-time / non-regular holidays. calendar en Set a year only for one time / non regular holidays. set new events to private calendar en Set new events to private @@ -538,6 +540,7 @@ yes, only admins can purge deleted items admin en Yes, only admins can purge del yes, users can purge their deleted items admin en Yes, users can purge their deleted items you are not allowed to book the resource selected: calendar en You are not allowed to book the resource selected: you are not invited to that event! calendar en You are not invited to that event! +you attempt to mail a meetingrequest to the recipients above. depending on the client this mail is opened with, the recipient may or may not see the mailbody below, but only see the meeting request attached. calendar en You attempt to mail a meetingrequest to the recipients above. Depending on the client this mail is opened with, the recipient may or may not see the message below, but only see the meeting request attached. you can either set a year or a occurence, not both !!! calendar en You can either set a year or occurrence, not both! you can only set a year or a occurence !!! calendar en You can only set a year or occurrence! you do not have permission to read this record! calendar en You do not have permission to read this record! diff --git a/felamimail/inc/class.bocompose.inc.php b/felamimail/inc/class.bocompose.inc.php index 60f9617721..56d17f5955 100644 --- a/felamimail/inc/class.bocompose.inc.php +++ b/felamimail/inc/class.bocompose.inc.php @@ -798,6 +798,7 @@ { $signature = felamimail_bo::merge($signature,array($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id'))); } + if($_formData['mimeType'] =='html') { $_mailObject->IsHTML(true); if(!empty($signature)) { @@ -862,12 +863,20 @@ { egw_vfs::load_wrapper('vfs'); } - $_mailObject->AddAttachment ( - $attachment['file'], - $_mailObject->EncodeHeader($attachment['name']), - 'base64', - $attachment['type'] - ); + if ( stripos($attachment['type'],"text/calendar; method=")!==false ) + { + $_mailObject->AltExtended = file_get_contents($attachment['file']); + $_mailObject->AltExtendedContentType = $attachment['type']; + } + else + { + $_mailObject->AddAttachment ( + $attachment['file'], + $_mailObject->EncodeHeader($attachment['name']), + 'base64', + $attachment['type'] + ); + } } } $bofelamimail->closeConnection(); diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 5a7c8a49c8..a84ab19989 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -4017,8 +4017,8 @@ class felamimail_bo // check the mimetype by extension. as browsers seem to report crap // maybe its application/octet-stream -> this may mean that we could not determine the type // so we check for the suffix too - // trust vfs mime-types - if (substr($_formData['file'],0,6) !== 'vfs://' || $_formData['type'] == 'application/octet-stream') + // trust vfs mime-types, trust the mimetype if it contains a method + if ((substr($_formData['file'],0,6) !== 'vfs://' || $_formData['type'] == 'application/octet-stream') && stripos($_formData['type'],'method=')===false) { $buff = explode('.',$_formData['name']); $suffix = ''; diff --git a/felamimail/inc/class.uicompose.inc.php b/felamimail/inc/class.uicompose.inc.php index eb93711bc8..e3dc95f103 100644 --- a/felamimail/inc/class.uicompose.inc.php +++ b/felamimail/inc/class.uicompose.inc.php @@ -403,7 +403,9 @@ $this->t->set_var('ckeditorConfig', egw_ckeditor_config::get_ckeditor_config('simple-withimage'));//$editorObject->jsEncode($editorObject->config)); // check for some error messages from last posting attempt - if($errorInfo = $this->bocompose->getErrorInfo()) + $errorInfo = $this->bocompose->getErrorInfo(); + if (isset($_REQUEST['preset']['msg'])) $errorInfo = html::purify($_REQUEST['preset']['msg']); + if($errorInfo) { $this->t->set_var('errorInfo',"$errorInfo"); }