changeset 17:3bd5fe8166b8

switch to using vurl as well for better display, and it gets saved
author Charlie Root
date Sat, 13 Jan 2018 17:06:41 -0500
parents 165944ca08e7
children e8f197ce1af3
files plugins/calendar/calendar.php plugins/calendar/calendar_ui.js plugins/calendar/skins/larry/templates/eventedit.html
diffstat 3 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/calendar/calendar.php	Sat Jan 13 09:45:02 2018 -0500
+++ b/plugins/calendar/calendar.php	Sat Jan 13 17:06:41 2018 -0500
@@ -3320,9 +3320,14 @@
       }
       else {
 	// hack around missing database_driver implementation of that method
+	$mbox_u = str_replace('/','%2F',$mbox); // e.g. Bookings%2FBigHouse%2FPending
+	$url = "https://hppllc.org/roundcube/?_task=mail&_mbox=$mbox_u&_uid=$uid";
 	$event['links'] = array(
-				array('mailurl' => "https://hppllc.org/roundcube/?_task=mail&_mbox=Bookings%2FBigHouse%2FPending&_uid=$uid",
+				array('mailurl' => $url,
 				      'subject' => 'link to original email'));
+	$event['vurl'] = $url; // so it gets saved
+
+	rcube::write_log('cal',"$mbox $mbox_u ".$event['links'][0]['mailurl']);
       }
       // copy mail attachments to event
       if ($message->attachments) {
--- a/plugins/calendar/calendar_ui.js	Sat Jan 13 09:45:02 2018 -0500
+++ b/plugins/calendar/calendar_ui.js	Sat Jan 13 17:06:41 2018 -0500
@@ -399,8 +399,7 @@
       if (event.location)
         $('#event-location').html('@ ' + text2html(event.location)).show();
       if (event.description)
-        $('#event-description').show().html(event.description);
-                                     //children('.event-text').html(text2html(event.description, 300, 6));
+        $('#event-description').show().children('.event-text').html(text2html(event.description, 300, 6));
       if (event.vurl)
         $('#event-url').show().children('.event-text').html(render_link(event.vurl));
       
@@ -671,6 +670,7 @@
       // event details
       var title = $('#edit-title').val(event.title || '');
       var location = $('#edit-location').val(event.location || '');
+      var description = $('#edit-description').text(event.description || '');
       var vurl = $('#edit-url').val(event.vurl || '');
       var categories = $('#edit-categories').val(event.categories);
       var calendars = $('#edit-calendar').val(event.calendar);
@@ -722,16 +722,12 @@
         $('<option>').attr('value', event.categories).text(event.categories).appendTo(categories).prop('selected', true);
       }
 
-      var description;
       if ($.isArray(event.links) && event.links.length) {
-	render_message_links(event.links, $('#edit-event-links .event-text'), true, 'calendar');
-	// hack! database_driver doesn't save the links property :-(
-	description = $('#edit-description').html("<div><a href='"+event.links[0].mailurl+"'>"+event.links[0].subject+"</a>\n<textarea class='text' rows='5' cols='40'>"+(event.description || '')+"</textarea></div>");
-	$('#edit-event-links').show();
+          render_message_links(event.links, $('#edit-event-links .event-text'), true, 'calendar');
+          $('#edit-event-links').show();
       }
       else {
-	description = $('#edit-description').html("<div><textarea class='text' rows='5' cols='40'>"+(event.description || '')+"</textarea></div>");
-        $('#edit-event-links').hide();
+          $('#edit-event-links').hide();
       }
 
       // show warning if editing a recurring event
--- a/plugins/calendar/skins/larry/templates/eventedit.html	Sat Jan 13 09:45:02 2018 -0500
+++ b/plugins/calendar/skins/larry/templates/eventedit.html	Sat Jan 13 17:06:41 2018 -0500
@@ -18,12 +18,7 @@
 			<div class="event-section">
 				<label for="edit-description"><roundcube:label name="calendar.description" /></label>
 				<br />
-				<div name="description" id="edit-description"></div>
-			</div>
-			<div class="event-section">
-				<label for="edit-url"><roundcube:label name="calendar.url" /></label>
-				<br />
-				<input type="text" class="text" name="vurl" id="edit-url" size="40" />
+				<textarea name="description" id="edit-description" class="text" rows="5" cols="40"></textarea>
 			</div>
 			<div class="event-section">
 				<label style="float:right;padding-right:0.5em"><input type="checkbox" name="allday" id="edit-allday" value="1" /><roundcube:label name="calendar.all-day" /></label>
@@ -75,6 +70,11 @@
 				<div class="event-text"></div>
 				<br style="clear:left">
 			</div>
+			<div class="event-section">
+				<label for="edit-url"><roundcube:label name="calendar.url" /></label>
+				<br />
+				<input type="text" class="text" name="vurl" id="edit-url" size="40" />
+			</div>
 		</div>
 		<!-- recurrence settings -->
 		<div id="event-panel-recurrence">
@@ -130,4 +130,4 @@
 	<roundcube:object name="plugin.edit_attendees_notify" id="edit-attendees-notify" class="event-dialog-message" style="display:none" />
 	<roundcube:object name="plugin.edit_recurring_warning" class="event-dialog-message edit-recurring-warning" style="display:none" />
 	<div id="edit-localchanges-warning" class="event-dialog-message" style="display:none"><roundcube:label name="calendar.localchangeswarning" /></div>
-</div>
\ No newline at end of file
+</div>