feature regarding recuring events. ask user to edit either an exeption or the series. this was sponsored (together with the listview features) by

Verwaltung UNI-MAINZ, and developed by S.Becker.
This commit is contained in:
Klaus Leithoff 2008-02-07 13:59:34 +00:00
parent e3ee4fb7dc
commit d57e906f65
2 changed files with 44 additions and 12 deletions

View File

@ -490,14 +490,32 @@ class uical
* @param int $height=400 height of the window
* @return string javascript (using single quotes)
*/
function popup($link,$target='_blank',$width=750,$height=410)
function popup($link,$target='_blank',$width=750,$height=410,$Link_confirm_abort='',$Link_confirm_text='')
{
//Handle Exception for Calandar
if (($Link_confirm_abort) && ($Link_confirm_text))
{
$returnvalue = 'javascript:var check=confirm(\''.$Link_confirm_text.'\');';
$returnvalue .=' if (check==true) {';
// open confirm =0kay
$returnvalue .= 'egw_openWindowCentered2('.($link == 'this.href' ? $link : "'".$link."'").','.
($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes')";
$returnvalue .= '}';
//open confirm =Abort
$returnvalue .=' else {';
$returnvalue .= 'egw_openWindowCentered2('.($Link_confirm_abort == 'this.href' ? $Link_confirm_abort : "'".$Link_confirm_abort."'").','.
($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes')";
$returnvalue .= '}';
return $returnvalue;
}
else {
return 'egw_openWindowCentered2('.($link == 'this.href' ? $link : "'".$link."'").','.
($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes')";
return 'window.open('.($link == 'this.href' ? $link : "'".$link."'").','.
($target == 'this.target' ? $target : "'".$target."'").','.
"'dependent=yes,width=$width,height=$height,scrollbars=yes,status=yes')";
}
}
/**

View File

@ -964,7 +964,7 @@ class uiviews extends uical
$droppableID='drop_'.$droppableDateTime.'_O'.$owner;
$html .= $indent."\t".'<div id="' . $droppableID . '" style="height:'. $this->rowHeight .'%; top: '. $i*$this->rowHeight .
'%;" class="calAddEvent" onclick="'.$this->popup($GLOBALS['egw']->link('/index.php',$linkData)).';return false;"></div>'."\n";
'%;" class="calAddEvent" onclick="??'.$this->popup($GLOBALS['egw']->link('/index.php',$linkData)).';return false;"></div>'."\n";
if(is_object($this->dragdrop) && $dropPermission)
{
@ -1208,7 +1208,21 @@ class uiviews extends uical
$html = $tpl->fp('out',$block);
$view_link = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start'])));
if ($event['recur_type']!= MCAL_RECUR_NONE)
{
$view_link_confirm_abort = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start']),'exception'=>1));
$view_link_confirm_text=lang('Du you want to edit serialevent als exception? - Ok = Edit Exception, Abort = Edit Serial');
$popup = $is_private ? '' : ' onclick="'.$this->popup($view_link_confirm_abort,null,750,410,$view_link,$view_link_confirm_text).'; return false;"';
}
else
{
$popup = $is_private ? '' : ' onclick="'.$this->popup($view_link).'; return false;"';
}
//_debug_array($event);
//echo $event['id']."?<br>";
if ($return_array)
{