Fix onclick handler for calendar yearly planner and year view

This commit is contained in:
Hadi Nategh 2014-01-09 09:38:55 +00:00
parent b6ca39d9dd
commit a9c800229c
2 changed files with 14 additions and 6 deletions

View File

@ -574,7 +574,7 @@ class calendar_uiviews extends calendar_ui
'" data-tooltip ="'.$tooltip .
'" style="position: absolute; left: '.$left.'%; width: '.$width.'%; height: '.
$row_height.'%; top: '.($n * $row_height).'%;'.
'background-color: '.$color.';" '.'" data-date ="'.$this->bo->date2string($event['start']).' '.
'background-color: '.$color.';" '.'" data-date ="'.$this->bo->date2string($event['start']).'|'.$data['popup'].'" '.
'>'."\n".$data['html'].$indent."</div>\n";
}
}
@ -1772,7 +1772,14 @@ class calendar_uiviews extends calendar_ui
}
else
{
// Replaced with jquery click handler due to CSP consern
if ($event['recur_type'] != MCAL_RECUR_NONE)
{
$popup = $event['id']."|r";
}
else
{
$popup = $event['id']."|n";
}
}
//_debug_array($event);
@ -2740,7 +2747,7 @@ class calendar_uiviews extends calendar_ui
$tooltip = html::htmlspecialchars(str_replace(array("\n","\r","'",'"'),array('','',"\\'",'&quot;'),$data['tooltip']));
return $indent.'<div class="calendar_plannerEvent'.($data['private'] ? 'Private' : '').'" style="left: '.$left.
'%; width: '.$width.'%; background-color: '.$color.';"'.'data-tooltip="'. $tooltip.'" '.
'>'."\n".$data['html'].$indent."</div>\n";
'" data-date ="'.$this->bo->date2string($event['start']).'|'.$data['popup'].'">'."\n".$data['html'].$indent."</div>\n";
}
/**

View File

@ -270,9 +270,10 @@ app.classes.calendar = AppJS.extend(
//Click Handler for calendar planner
jQuery("div.calendar_plannerEvent").on({
click:function(ev){
var eventId = ev.currentTarget.id.replace(/drag_/g,'').split("_")[0];
var startDate = ev.currentTarget.getAttribute('data-resize').split("|")[0];
if (ev.currentTarget.id.match(/drag_/g))
var eventId = ev.currentTarget.getAttribute('data-date').split("|")[1];
var startDate = ev.currentTarget.getAttribute('data-date').split("|")[0];
var recurrFlag = ev.currentTarget.getAttribute('data-date').split("|")[2];
if (recurrFlag == "n")
{
egw.open(eventId,'calendar','edit');
}