Change calendar link registry's add to use javascript so we can open client side

This commit is contained in:
nathangray 2019-01-10 15:01:05 -07:00
parent 01dfdd9b1d
commit 03aa34460a
2 changed files with 5 additions and 6 deletions

View File

@ -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(

View File

@ -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('&'),