diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 69b9210519..96548d62a7 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -43,12 +43,10 @@ class calendar_hooks 'view' => 'listview', 'ajax'=>'true' ), - 'add' => array( - 'menuaction' => 'calendar.calendar_uiforms.ajax_add', - ), + // If calendar is not loaded, load it first, then add + 'add' => 'javascript:var promise = framework.setActiveApp(framework.getApplicationByName(\'calendar\')); if(promise) {promise.then(function() {et2_call(\'app.calendar.add\',params);});} else { app.calendar.add(params);}', 'add_app' => 'link_app', 'add_id' => 'link_id', - 'add_popup' => '850x590', 'file_access' => 'calendar.calendar_bo.file_access', 'file_access_user' => true, // file_access supports 4th parameter $user 'mime' => array( diff --git a/calendar/js/app.js b/calendar/js/app.js index 70fe7c628d..d95aa625b0 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -216,6 +216,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( break; case 'calendar.add': + this.et2.getWidgetById('title').input.select(); // Fall through to get all the edit stuff too case 'calendar.edit': if (typeof content.data['conflicts'] == 'undefined') @@ -1640,7 +1641,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( { // Set this to open the add template in a popup //options.template = 'calendar.add'; - return this.egw.open(null, 'calendar', 'add', options, '_blank', 'calendar'); + return this.egw.open(null, 'calendar', 'edit', options, '_blank', 'calendar'); } // Open dialog to use as target @@ -1648,7 +1649,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( // Call the server, get it into the dialog - options = jQuery.extend({template: 'calendar.add'}, this.egw.link_get_registry('calendar','add'), options); + options = jQuery.extend({menuaction: 'calendar.calendar_uiforms.ajax_add', template: 'calendar.add'}, options); this.egw.json( this.egw.link('/json.php', options), //menuaction + options.join('&'),