Fix some app_id vs id issues breaking drag & drop

This commit is contained in:
Nathan Gray 2015-12-01 22:02:47 +00:00
parent 0d5760ad39
commit e172ff448b
4 changed files with 17 additions and 10 deletions

View File

@ -787,6 +787,8 @@ class calendar_ui
{ {
$icons = calendar_uiviews::integration_get_icons($app,$app_id,$event); $icons = calendar_uiviews::integration_get_icons($app,$app_id,$event);
} }
$event['app'] = $app;
$event['app_id'] = $app_id;
} }
else else
{ {
@ -798,8 +800,14 @@ class calendar_ui
$event['class'] .= 'rowNoView '; $event['class'] .= 'rowNoView ';
} }
$event['app'] = 'calendar'; if(!$event['app'])
$event['app_id'] = $event['id']; {
$event['app'] = 'calendar';
}
if(!$event['app_id'])
{
$event['app_id'] = $event['id'];
}
if ($event['recur_type'] != MCAL_RECUR_NONE) if ($event['recur_type'] != MCAL_RECUR_NONE)
{ {

View File

@ -231,7 +231,7 @@ app.classes.calendar = AppJS.extend(
if (match[1]== _id) do_refresh = true; if (match[1]== _id) do_refresh = true;
} }
}); });
if (jQuery('div [data-app="infolog"][data-id="'+_id+'"]').length > 0) do_refresh = true; if (jQuery('div [data-app="infolog"][data-app_id="'+_id+'"]').length > 0) do_refresh = true;
switch (_type) switch (_type)
{ {
case 'add': case 'add':
@ -797,13 +797,12 @@ app.classes.calendar = AppJS.extend(
// Integrated infolog event // Integrated infolog event
//Get infologID if in case if it's an integrated infolog event //Get infologID if in case if it's an integrated infolog event
var infolog_id = widget.options.value.id.split('infolog')[1]; if (widget.options.value.app == 'infolog')
if (infolog_id)
{ {
// If it is an integrated infolog event we need to edit infolog entry // If it is an integrated infolog event we need to edit infolog entry
egw().json( egw().json(
'stylite_infolog_calendar_integration::ajax_moveInfologEvent', 'stylite_infolog_calendar_integration::ajax_moveInfologEvent',
[infolog_id, widget.options.value.start, widget.options.value.duration], [widget.options.value.app_id, widget.options.value.start, widget.options.value.duration],
// Remove loading spinner // Remove loading spinner
function() {if(widget.div) widget.div.removeClass('loading');} function() {if(widget.div) widget.div.removeClass('loading');}
).sendRequest(); ).sendRequest();

View File

@ -661,7 +661,7 @@ et2_register_widget(et2_calendar_event, ["calendar-event"]);
*/ */
et2_calendar_event.recur_prompt = function(event_data, callback) et2_calendar_event.recur_prompt = function(event_data, callback)
{ {
var edit_id = event_data.id; var edit_id = event_data.app_id;
var edit_date = event_data.start; var edit_date = event_data.start;
var egw = this.egw ? (typeof this.egw == 'function' ? this.egw() : this.egw) : (window.opener || window).egw; var egw = this.egw ? (typeof this.egw == 'function' ? this.egw() : this.egw) : (window.opener || window).egw;
var that = this; var that = this;

View File

@ -426,7 +426,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
// If it is an integrated infolog event we need to edit infolog entry // If it is an integrated infolog event we need to edit infolog entry
egw().json('stylite_infolog_calendar_integration::ajax_moveInfologEvent', egw().json('stylite_infolog_calendar_integration::ajax_moveInfologEvent',
[event_data.id, event_widget._parent.date_helper.getValue()||false,duration], [event_data.app_id, event_widget._parent.date_helper.getValue()||false,duration],
function() {loading.remove();} function() {loading.remove();}
).sendRequest(true); ).sendRequest(true);
} }
@ -458,7 +458,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
// Check for modifying a series that started before today // Check for modifying a series that started before today
var tempDate = new Date(); var tempDate = new Date();
var today = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate(),0,-tempDate.getTimezoneOffset(),0); var today = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate(),0,-tempDate.getTimezoneOffset(),0);
if (today >= new Date(event_widget.options.value.start)) if (event_widget.options.value.recur_type && today >= new Date(event_widget.options.value.start))
{ {
et2_dialog.show_dialog(function(_button_id) et2_dialog.show_dialog(function(_button_id)
{ {
@ -469,7 +469,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
} }
else else
{ {
return false; loading.remove();
} }
}, },
egw.lang("Do you really want to change the start of this series? If you do, the original series will be terminated as of today and a new series for the future reflecting your changes will be created."), egw.lang("Do you really want to change the start of this series? If you do, the original series will be terminated as of today and a new series for the future reflecting your changes will be created."),