Remove another inline-script in calendar dayView which was causing CSP violation

This commit is contained in:
Hadi Nategh 2014-02-24 09:48:22 +00:00
parent 107a48ce2c
commit 68864a0683
2 changed files with 12 additions and 9 deletions

View File

@ -545,8 +545,8 @@ class calendar_ui
$vars['hour'] = $hour; $vars['hour'] = $hour;
$vars['minute'] = $minute; $vars['minute'] = $minute;
} }
return html::a_href($content,'/index.php',$vars,' target="_blank" title="'.html::htmlspecialchars(lang('Add')). return html::a_href($content,'',$vars,' data-date="' .$vars['date'].'|'.$vars['hour'].'|'.$vars['minute']
'" onclick="'.$this->popup('this.href','this.target').'; return false;"'); . '" title="'.html::htmlspecialchars(lang('Add')).'"');
} }
/** /**

View File

@ -410,14 +410,17 @@ app.classes.calendar = AppJS.extend(
}) })
//Click event handler for calendar cells //Click event handler for calendar cells
.on("click","div.calendar_calAddEvent",function(ev){ .on("click","div.calendar_calAddEvent, div.calendar_calTimeRowTime",function(ev){
var timestamp = ev.target.getAttribute('data-date').split("|"); var timestamp = ev.target.getAttribute('data-date').split("|");
var owner = ev.target.getAttribute('id').split("_"); if (typeof ev.target.getAttribute('id') != 'undefined' && ev.target.getAttribute('id'))
var ownerId = owner[2].match( /Ogroup/g)?owner[2].replace( /Ogroup/g, '-'):owner[2].replace( /^\D+/g, '');
if (owner[2].match( /Or/g))
{ {
ownerId = 'r' + ownerId; var owner = ev.target.getAttribute('id').split("_");
var ownerId = owner[2].match( /Ogroup/g)?owner[2].replace( /Ogroup/g, '-'):owner[2].replace( /^\D+/g, '');
if (owner[2].match( /Or/g))
{
ownerId = 'r' + ownerId;
}
} }
var eventInfo = var eventInfo =
@ -427,7 +430,7 @@ app.classes.calendar = AppJS.extend(
minute: timestamp[2] minute: timestamp[2]
}; };
if (ownerId != 0) if (typeof ownerId !='undefined' && ownerId != 0)
{ {
$j(eventInfo).extend(eventInfo,{owner: ownerId}); $j(eventInfo).extend(eventInfo,{owner: ownerId});
} }