- added roles to UI

- enabling again resource booking without direct booking permission
  (status is then unknown, not accepted)
This commit is contained in:
Ralf Becker 2009-10-12 19:16:42 +00:00
parent a3c57c48b3
commit 0548cf5770
9 changed files with 120 additions and 79 deletions

View File

@ -122,6 +122,17 @@ class calendar_bo
MCAL_M_SATURDAY => 'Saturday',
MCAL_M_SUNDAY => 'Sunday',
);
/**
* Standard iCal attendee roles
*
* @var array
*/
var $roles = array(
'REQ-PARTICIPANT' => 'Requested',
'CHAIR' => 'Chair',
'OPT-PARTICIPANT' => 'Optional',
'NON-PARTICIPANT' => 'None',
);
/**
* @var array $resources registered scheduling resources of the calendar (gets chached in the session for performance reasons)
*/
@ -1547,8 +1558,12 @@ class calendar_bo
// add role, if not a regular participant
if ($role != 'REQ-PARTICIPANT')
{
if (isset($this->roles[$role]))
{
$role = $this->roles[$role];
}
// allow to use cats as roles (beside regular iCal ones)
if (substr($role,0,6) == 'X-CAT-' && ($cat_id = (int)substr($role,6)) > 0)
elseif (substr($role,0,6) == 'X-CAT-' && ($cat_id = (int)substr($role,6)) > 0)
{
$role = $GLOBALS['egw']->categories->id2name($cat_id);
}

View File

@ -888,7 +888,7 @@ ORDER BY cal_user_type, cal_usre_id
if (strlen($status) > 1 && preg_match('/^.([0-9]*)(.*)$/',$status,$matches))
{
if ((int)$matches[1] > 0) $quantity = (int)$matches[1];
$role = $matches[2];
if ($matches[2]) $role = $matches[2];
$status = $status[0];
}
}

View File

@ -129,13 +129,9 @@ class calendar_uiforms extends calendar_ui
{
$res_data = $this->bo->resources[$uid[0]];
list($id,$quantity) = explode(':',substr($uid,1));
$participants[$uid] = $participant_types[$uid[0]][$id] = ($res_data['new_status'] ? ExecMethod($res_data['new_status'],$id) : 'U').
((int) $quantity > 1 ? (int)$quantity : '');
// if new_status == 'x', resource is not bookable
if(strpos($participant_types[$uid[0]][$id],'x') !== false)
if (($status = $res_data['new_status'] ? ExecMethod($res_data['new_status'],$id) : 'U'))
{
unset($participant_types[$uid[0]][$id]);
unset($participants[$uid]);
$participants[$uid] = $participant_types[$uid[0]][$id] = $status.((int) $quantity > 1 ? (int)$quantity : '');
}
}
}
@ -233,12 +229,14 @@ class calendar_uiforms extends calendar_ui
$event['recur_data'] = 1 << (int)date('w',$event['start']);
}
$event['participants'] = $event['participant_types'] = array();
_debug_array($content['participants']);
foreach($content['participants'] as $key => $data)
{
switch($key)
{
case 'delete': // handled in default
case 'quantity': // handled in new_resource
case 'role': // handled in add, account or resource
case 'cal_resources':
break;
@ -248,21 +246,22 @@ class calendar_uiforms extends calendar_ui
if (($email = $_POST['exec']['participants']['resource']['query']) &&
(preg_match('/^(.*<)?([a-z0-9_.-]+@[a-z0-9_.-]{5,})>?$/i',$email,$matches)))
{
$status = calendar_so::combine_status('U',$content['participants']['quantity'],$content['participants']['role']);
// check if email belongs to account or contact --> prefer them over just emails
if (($data = $GLOBALS['egw']->accounts->name2id($matches[2],'account_email')))
{
$event['participants'][$data] = $event['participant_types']['u'][$data] = 'U';
$event['participants'][$data] = $event['participant_types']['u'][$data] = $status;
}
elseif ((list($data) = ExecMethod2('addressbook.addressbook_bo.search',array(
'email' => $matches[2],
'email_home' => $matches[2],
),true,'','','',false,'OR')))
{
$event['participants']['c'.$data['id']] = $event['participant_types']['c'][$data['id']] = 'U';
$event['participants']['c'.$data['id']] = $event['participant_types']['c'][$data['id']] = $status;
}
else
{
$event['participants']['e'.$email] = $event['participant_types']['e'][$email] = 'U';
$event['participants']['e'.$email] = $event['participant_types']['e'][$email] = $status;
}
}
elseif (!$content['participants']['account'] && !$content['participants']['resource'])
@ -282,37 +281,21 @@ class calendar_uiforms extends calendar_ui
}
foreach($this->bo->resources as $type => $data) if ($data['app'] == $app) break;
$uid = $this->bo->resources[$type]['app'] == $app ? $type.$id : false;
// check if new entry is no contact or no account
// check if new entry is no account (or contact entry of an account)
if ($app != 'addressbook' || !($data = $GLOBALS['egw']->accounts->name2id($id,'person_id')))
{
$quantity = $content['participants']['quantity'] ? $content['participants']['quantity'] : 1;
if ($app == "resources" && !empty($id)) {
$bores = CreateObject('resources.bo_resources');
$selectedres = $bores->read($id);
$cats = $bores->acl->get_cats(EGW_ACL_DIRECT_BOOKING);
if (is_array($cats) && $selectedres['bookable'] == 1 &&
$selectedres['cat_id'] && array_key_exists($selectedres['cat_id'],$cats))
{
if ($selectedres['quantity'] && $selectedres['quantity'] < $quantity) {
$msg .= lang('You requested more than available for the selected resource:').$selectedres['name']." ".lang('quantity').":".$selectedres['quantity']." < $quantity";
break;
}
// to do: Test for overbooking/maybe this is handled sufficient by the conflict handling of dates
#$msg = lang('The resource you selected is already overbooked:').$selectedres['name'];
} else {
// you are not allowed to book, or the resource is overbooked already
$msg .= lang('You are not allowed to book the resource selected:').$selectedres['name'];
break;
}
}
if ($uid && $id)
{
$status = isset($this->bo->resources[$type]['new_status']) ? ExecMethod($this->bo->resources[$type]['new_status'],$id) : 'U';
$event['participants'][$uid] = $event['participant_types'][$type][$id] = $status.((int) $quantity > 1 ? (int)$quantity : '');
}
else
{
unset($quantity);
if ($status)
{
$event['participants'][$uid] = $event['participant_types'][$type][$id] =
calendar_so::combine_status($status,$content['participants']['quantity'],$content['participants']['role']);
}
else
{
$msg .= lang('Permission denied!');
}
}
break;
}
@ -321,7 +304,7 @@ class calendar_uiforms extends calendar_ui
foreach(is_array($data) ? $data : explode(',',$data) as $uid)
{
if ($uid) $event['participants'][$uid] = $event['participant_types']['u'][$uid] =
$uid == $this->bo->user ? 'A' : 'U';
calendar_so::combine_status($uid == $this->bo->user ? 'A' : 'U',1,$content['participants']['role']);
}
break;
@ -387,6 +370,7 @@ class calendar_uiforms extends calendar_ui
break;
}
}
_debug_array($event['participants']);
}
$preserv = array(
'view' => $view,
@ -633,7 +617,7 @@ class calendar_uiforms extends calendar_ui
}
$js .= 'window.close();';
echo "<html><body onload=\"$js\"></body></html>\n";
$GLOBALS['egw']->common->egw_exit();
common::egw_exit();
}
return $this->edit($event,$preserv,$msg,$js,$event['id'] ? $event['id'] : $content['link_to']['to_id']);
}
@ -772,6 +756,7 @@ class calendar_uiforms extends calendar_ui
'recur_type' => &$this->bo->recur_types,
'status' => $this->bo->verbose_status,
'duration' => $this->durations,
'role' => $this->bo->roles,
'action' => array(
'copy' => array('label' => 'Copy', 'title' => 'Copy this event'),
'ical' => array('label' => 'Export', 'title' => 'Download this event as iCal'),
@ -799,7 +784,7 @@ class calendar_uiforms extends calendar_ui
else
{
$GLOBALS['egw']->framework->render('<p class="redItalic" align="center">'.lang('Permission denied')."</p>\n",null,true);
$GLOBALS['egw']->common->egw_exit();
common::egw_exit();
}
}
$event =& $this->default_add_event();
@ -840,7 +825,6 @@ class calendar_uiforms extends calendar_ui
}
$view = $preserv['view'] = $preserv['view'] || $event['id'] && !$this->bo->check_perms(EGW_ACL_EDIT,$event);
//echo "view=$view, event="; _debug_array($event);
// shared locking of entries to edit
if (!$view && ($locktime = $GLOBALS['egw_info']['server']['Lock_Time_Calender']) && $event['id'])
{
@ -855,7 +839,7 @@ class calendar_uiforms extends calendar_ui
{
$msg .= ' '.lang('This entry is currently opened by %1!',
(($lock_uid = $GLOBALS['egw']->accounts->name2id(substr($lock['owner'],7),'account_email')) ?
$GLOBALS['egw']->common->grab_owner_name($lock_uid) : $lock['owner']));
common::grab_owner_name($lock_uid) : $lock['owner']));
}
elseif($lock)
{
@ -898,20 +882,36 @@ class calendar_uiforms extends calendar_ui
foreach($participants as $id => $status)
{
$uid = $type == 'u' ? $id : $type.$id;
calendar_so::split_status($status,$quantity,$role);
$preserv['participants'][$row] = $content['participants'][$row] = array(
'app' => $name == 'accounts' ? ($GLOBALS['egw']->accounts->get_type($id) == 'g' ? 'Group' : 'User') : $name,
'uid' => $uid,
'status' => $status[0],
'old_status' => $status[0],
'quantity' => substr($status,1),
'status' => $status,
'old_status' => $status,
'quantity' => $quantity > 1 || $uid[0] == 'r' ? $quantity : '', // only display quantity for resources or if > 1
'role' => $role,
);
$readonlys[$row.'[quantity]'] = $type == 'u' || !isset($this->bo->resources[$type]['max_quantity']);
// replace iCal roles with a nicer label and remove regular REQ-PARTICIPANT
if (isset($this->bo->roles[$role]))
{
$content['participants'][$row]['role'] = lang($this->bo->roles[$role]);
}
// allow third party apps to use categories for roles
elseif(substr($role,0,6) == 'X-CAT-')
{
$content['participants'][$row]['role'] = $GLOBALS['egw']->categories->id2name(substr($role,6));
}
else
{
$content['participants'][$row]['role'] = lang(str_replace('X-','',$role));
}
//echo "<p>$uid ($quantity): $role --> {$content['participants'][$row]['role']}</p>\n";
$readonlys[$row.'[status]'] = !$this->bo->check_status_perms($uid,$event);
$readonlys["delete[$uid]"] = $preserv['hide_delete'] || !$this->bo->check_perms(EGW_ACL_EDIT,$event);
// todo: make the participants available as links with email as title
if ($name == 'accounts')
{
$content['participants'][$row++]['title'] = $GLOBALS['egw']->common->grab_owner_name($id);
$content['participants'][$row++]['title'] = common::grab_owner_name($id);
}
elseif (($info = $this->bo->resource_info($uid)))
{
@ -944,7 +944,7 @@ class calendar_uiforms extends calendar_ui
{
$readonlys[$row.'[quantity]'] = $readonlys["delete[$member]"] = true;
}
$content['participants'][$row++]['title'] = $GLOBALS['egw']->common->grab_owner_name($member);
$content['participants'][$row++]['title'] = common::grab_owner_name($member);
}
}
}
@ -1515,7 +1515,6 @@ class calendar_uiforms extends calendar_ui
#error_log(__METHOD__.print_r($content,true));
if (is_numeric($cal_id = $content ? $content : $_REQUEST['cal_id']))
{
#if (!($ical =& ExecMethod2('calendar.calendar_ical.exportVCal',$cal_id,'2.0','PUBLISH',false)))
if (!($ical =& $boical->exportVCal(array($cal_id),'2.0','PUBLISH',false)))
{
$msg = lang('Permission denied');
@ -1524,9 +1523,9 @@ class calendar_uiforms extends calendar_ui
}
else
{
$GLOBALS['egw']->browser->content_header('event.ics','text/calendar',bytes($ical));
html::content_header('event.ics','text/calendar',bytes($ical));
echo $ical;
$GLOBALS['egw']->common->egw_exit();
common::egw_exit();
}
}
if (is_array($content))
@ -1546,10 +1545,9 @@ class calendar_uiforms extends calendar_ui
else
{
$ical =& $boical->exportVCal($events,'2.0','PUBLISH',false);
#$ical =& ExecMethod2('calendar.calendar_ical.exportVCal',$events,'2.0'/*$content['version']*/,'PUBLISH',false);
$GLOBALS['egw']->browser->content_header($content['file'] ? $content['file'] : 'event.ics','text/calendar',bytes($ical));
html::content_header($content['file'] ? $content['file'] : 'event.ics','text/calendar',bytes($ical));
echo $ical;
$GLOBALS['egw']->common->egw_exit();
common::egw_exit();
}
}
if (!is_array($content))
@ -1566,8 +1564,7 @@ class calendar_uiforms extends calendar_ui
$content['msg'] = $msg;
$GLOBALS['egw_info']['flags']['app_header'] = lang('calendar') . ' - ' . lang('iCal Export');
$etpl = CreateObject('etemplate.etemplate','calendar.export');
$etpl = new etemplate('calendar.export');
$etpl->exec('calendar.calendar_uiforms.export',$content);
}

View File

@ -50,7 +50,9 @@ calendar-fieldname calendar de Kalender Feldname
can't add alarms in the past !!! calendar de Kann keine Alarme in der Vergangenheit setzen !!!
can't aquire lock! calendar de Kann Termin nicht sperren!
canceled calendar de Abgesagt
chair calendar de Vorsitz
charset of file calendar de Zeichensatz der Datei
check all calendar de Alle auswählen
close the window calendar de Schließt das Fenster
compose a mail to all participants after the event is saved calendar de Schreibe eine Mail an alle Teilnehmer nachdem der Termin gespeichert wurde
conflict calendar de Konflikt
@ -79,6 +81,7 @@ default length of newly created events. the length is in minutes, eg. 60 for 1 h
default type of resources application selected in the calendar particpants research form. calendar de Vorgabe für die gewählte Anwendung bei der Ressourcensuche im Kartenreiter Teilnehmer
default type of resources selection calendar de Vorgabe für die Ressourcensuche
default week view calendar de Vorgabe Wochenansicht
delete selected events calendar de Ausgewählte Termine löschen
delete series calendar de Serie löschen
delete this alarm calendar de Diesen Alarm löschen
delete this event calendar de Diesen Termin löschen
@ -228,6 +231,7 @@ one week calendar de eine Woche
one year calendar de ein Jahr
only the initial date of that recuring event is checked! calendar de Nur das Startdatum diese wiederholenden Termins wird geprüft!
open todo's: calendar de unerledigte Aufgaben:
optional calendar de Optional
overlap holiday calendar de überlappender Feiertag
owner too calendar de Auch Besitzer
participants calendar de Teilnehmer
@ -258,10 +262,12 @@ repeating event information calendar de Informationen zu sich wiederholenden Ere
repeating interval, eg. 2 to repeat every second week calendar de Wiederholungsintervall, zB. 2 für jeder zweite Woche
repetition calendar de Wiederholung
repetitiondetails (or empty) calendar de Details der Wiederholung (oder leer)
requested calendar de Erforderlich
reset calendar de Zurücksetzen
resources calendar de Ressourcen
resources except conflicting ones calendar de Ressourcen ausgenommen bereits gebuchte
resources with conflict detection calendar de Ressourcen mit bereits gebuchten
role calendar de Rolle
rule calendar de Regel
sat calendar de Sa
saves the changes made calendar de Speichert die Änderungen
@ -269,6 +275,7 @@ saves the event ignoring the conflict calendar de Speichert den Konflikt ignorie
scheduling conflict calendar de Terminüberschneidung
select a %1 calendar de %1 auswählen
select a time calendar de eine Zeit auswählen
select multiple contacts for a further action calendar de Mehrere Adressen für weiteren Befehl auswählen
select resources calendar de Ressourcen auswählen
select who should get the alarm calendar de Auswählen wer den Alarm erhalten soll
selected range calendar de Ausgewählter Zeitraum

View File

@ -50,7 +50,9 @@ calendar-fieldname calendar en calendar-Fieldname
can't add alarms in the past !!! calendar en Can't add alarms in the past !!!
can't aquire lock! calendar en Can't aquire lock!
canceled calendar en Canceled
chair calendar en Chair
charset of file calendar en Charset of file
check all calendar en Check all
close the window calendar en Close the window
compose a mail to all participants after the event is saved calendar en compose a mail to all participants after the event is saved
conflict calendar en Conflict
@ -79,6 +81,7 @@ default length of newly created events. the length is in minutes, eg. 60 for 1 h
default type of resources application selected in the calendar particpants research form. calendar en Default type of resources application selected in the calendar particpants research form.
default type of resources selection calendar en Default type of resources selection
default week view calendar en default week view
delete selected events calendar en Delete selected events
delete series calendar en Delete series
delete this alarm calendar en Delete this alarm
delete this event calendar en Delete this event
@ -228,6 +231,7 @@ one week calendar en one week
one year calendar en one year
only the initial date of that recuring event is checked! calendar en Only the initial date of that recuring event is checked!
open todo's: calendar en open ToDo's:
optional calendar en Optional
overlap holiday calendar en overlap holiday
owner too calendar en Owner too
participants calendar en Participants
@ -258,10 +262,12 @@ repeating event information calendar en Repeating Event Information
repeating interval, eg. 2 to repeat every second week calendar en repeating interval, eg. 2 to repeat every second week
repetition calendar en Repetition
repetitiondetails (or empty) calendar en Repetitiondetails (or empty)
requested calendar en Requested
reset calendar en Reset
resources calendar en Resources
resources except conflicting ones calendar en Resources except conflicting ones
resources with conflict detection calendar en Resources with conflict detection
role calendar en Role
rule calendar en Rule
sat calendar en Sat
saves the changes made calendar en saves the changes made
@ -269,6 +275,7 @@ saves the event ignoring the conflict calendar en Saves the event ignoring the c
scheduling conflict calendar en Scheduling conflict
select a %1 calendar en select a %1
select a time calendar en select a time
select multiple contacts for a further action calendar en Select multiple contacts for a further action
select resources calendar en Select resources
select who should get the alarm calendar en Select who should get the alarm
selected range calendar en Selected range

View File

@ -2,7 +2,7 @@
/**
* eGroupWare - eTemplates for Application calendar
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2009-10-03 09:29
* generated by soetemplate::dump4setup() 2009-10-12 21:06
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package calendar
@ -27,7 +27,7 @@ $templ_data[] = array('name' => 'calendar.edit.general','template' => '','lang'
$templ_data[] = array('name' => 'calendar.edit.links','template' => '','lang' => '','group' => '0','version' => '1.0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:7:{s:1:"A";s:2:"95";s:2:"c1";s:2:"th";s:2:"h1";s:6:",@view";s:2:"c2";s:3:"row";s:2:"h2";s:6:",@view";s:2:"c3";s:2:"th";s:2:"c4";s:11:"row_off,top";}i:1;a:2:{s:1:"A";a:3:{s:4:"span";s:3:"all";s:4:"type";s:5:"label";s:5:"label";s:16:"Create new links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:3:{s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";s:4:"type";s:7:"link-to";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"span";s:3:"all";s:4:"type";s:5:"label";s:5:"label";s:14:"Existing links";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:4;a:2:{s:1:"A";a:3:{s:4:"span";s:3:"all";s:4:"name";s:7:"link_to";s:4:"type";s:9:"link-list";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"cols";i:2;s:4:"rows";i:4;s:4:"size";s:17:"100%,210,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '','modified' => '1231922193',);
$templ_data[] = array('name' => 'calendar.edit.participants','template' => '','lang' => '','group' => '0','version' => '1.3.004','data' => 'a:1:{i:0;a:7:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:5:{s:1:"A";s:2:"95";s:2:"c3";s:4:",top";s:2:"c1";s:3:"row";s:2:"c2";s:2:"th";s:2:"h1";s:8:",@no_add";}i:1;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"New";}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:27:"User or group,calendar+,,10";s:4:"name";s:7:"account";s:4:"help";s:13:"User or group";}i:2;a:3:{s:4:"type";s:10:"link-entry";s:4:"name";s:8:"resource";s:4:"size";s:14:"@cal_resources";}}s:1:"C";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"1,,3";s:4:"name";s:8:"quantity";}s:1:"D";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}s:1:"E";a:1:{s:4:"type";s:5:"label";}}i:2;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Participants";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Status";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";}}i:3;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:11:"${row}[app]";}s:1:"B";a:6:{s:4:"type";s:5:"label";s:4:"data";a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:26:"accounts_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:13:"${row}[title]";s:7:"no_lang";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:3:"int";s:4:"name";s:16:"${row}[quantity]";s:4:"size";s:4:"1,,3";}s:1:"D";a:4:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[status]";s:7:"no_lang";s:1:"1";s:8:"onchange";i:1;}s:1:"E";a:9:{s:4:"type";s:6:"button";s:4:"data";a:2:{i:0;a:1:{s:2:"h1";s:19:",!@resources_status";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:16:"resources_select";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:27:"resources_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:22:"delete[$row_cont[uid]]";s:5:"align";s:6:"center";s:5:"label";s:6:"Delete";s:8:"onchange";i:1;s:4:"size";s:6:"delete";}}}s:4:"rows";i:3;s:4:"cols";i:5;s:4:"size";s:17:"100%,210,,,,,auto";s:4:"name";s:12:"participants";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '','modified' => '1248274661',);
$templ_data[] = array('name' => 'calendar.edit.participants','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:7:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:6:{s:1:"A";s:2:"95";s:2:"c3";s:4:",top";s:2:"c1";s:3:"row";s:2:"c2";s:2:"th";s:2:"h1";s:8:",@no_add";s:1:"D";s:2:"70";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"New";}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:27:"User or group,calendar+,,10";s:4:"name";s:7:"account";s:4:"help";s:13:"User or group";}i:2;a:3:{s:4:"type";s:10:"link-entry";s:4:"name";s:8:"resource";s:4:"size";s:14:"@cal_resources";}}s:1:"C";a:4:{s:4:"type";s:3:"int";s:4:"size";s:4:"1,,3";s:4:"name";s:8:"quantity";s:5:"align";s:6:"center";}s:1:"D";a:3:{s:4:"type";s:6:"select";s:4:"name";s:4:"role";s:4:"span";s:11:",selectRole";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";s:5:"align";s:6:"center";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:2;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Participants";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";s:5:"align";s:6:"center";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Role";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Status";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";}}i:3;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:11:"${row}[app]";}s:1:"B";a:6:{s:4:"type";s:5:"label";s:4:"data";a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:26:"accounts_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:13:"${row}[title]";s:7:"no_lang";s:1:"1";}s:1:"C";a:5:{s:4:"type";s:3:"int";s:4:"name";s:16:"${row}[quantity]";s:4:"size";s:4:"1,,3";s:8:"readonly";s:1:"1";s:5:"align";s:6:"center";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:4:"name";s:12:"${row}[role]";}s:1:"E";a:4:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[status]";s:7:"no_lang";s:1:"1";s:8:"onchange";i:1;}s:1:"F";a:9:{s:4:"type";s:6:"button";s:4:"data";a:2:{i:0;a:1:{s:2:"h1";s:19:",!@resources_status";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:16:"resources_select";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:27:"resources_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:22:"delete[$row_cont[uid]]";s:5:"align";s:6:"center";s:5:"label";s:6:"Delete";s:8:"onchange";i:1;s:4:"size";s:6:"delete";}}}s:4:"rows";i:3;s:4:"cols";i:6;s:4:"size";s:17:"100%,210,,,,,auto";s:4:"name";s:12:"participants";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '.selectRole select { width: 100%; }','modified' => '1248274661',);
$templ_data[] = array('name' => 'calendar.edit.print','template' => '','lang' => '','group' => '0','version' => '1.6.001','data' => 'a:1:{i:0;a:7:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:6:{s:1:"A";s:2:"95";s:2:"c3";s:4:",top";s:2:"c1";s:3:"row";s:2:"c2";s:2:"th";s:2:"h1";s:8:",@no_add";s:1:"D";s:24:",@hide_status_recurrence";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"New";}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:14:"select-account";s:4:"size";s:27:"User or group,calendar+,,10";s:4:"name";s:7:"account";s:4:"help";s:13:"User or group";}i:2;a:3:{s:4:"type";s:10:"link-entry";s:4:"name";s:8:"resource";s:4:"size";s:14:"@cal_resources";}}s:1:"C";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"1,,3";s:4:"name";s:8:"quantity";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:2;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Participants";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:10:"All future";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Status";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";}}i:3;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:11:"${row}[app]";}s:1:"B";a:6:{s:4:"type";s:5:"label";s:4:"data";a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:26:"accounts_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:13:"${row}[title]";s:7:"no_lang";s:1:"1";}s:1:"C";a:3:{s:4:"type";s:3:"int";s:4:"name";s:16:"${row}[quantity]";s:4:"size";s:4:"1,,3";}s:1:"D";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:25:"${row}[status_recurrence]";s:5:"align";s:6:"center";}s:1:"E";a:4:{s:4:"type";s:6:"select";s:4:"name";s:14:"${row}[status]";s:7:"no_lang";s:1:"1";s:8:"onchange";i:1;}s:1:"F";a:9:{s:4:"type";s:6:"button";s:4:"data";a:2:{i:0;a:1:{s:2:"h1";s:19:",!@resources_status";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:16:"resources_select";s:4:"name";s:6:"${row}";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:27:"resources_status[$row_cont]";s:8:"onchange";s:1:"1";s:4:"help";s:30:"Accept or reject an invitation";s:7:"no_lang";s:1:"1";}}}s:4:"rows";i:1;s:4:"cols";i:2;s:4:"name";s:22:"delete[$row_cont[uid]]";s:5:"align";s:6:"center";s:5:"label";s:6:"Delete";s:8:"onchange";i:1;s:4:"size";s:6:"delete";}}}s:4:"rows";i:3;s:4:"cols";i:6;s:4:"size";s:17:"100%,200,,,,,auto";s:4:"name";s:12:"participants";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"200";i:6;s:4:"auto";}}}','size' => '100%,200,,,,,auto','style' => '','modified' => '1229280346',);
@ -43,7 +43,7 @@ $templ_data[] = array('name' => 'calendar.freetimesearch.rows','template' => '',
$templ_data[] = array('name' => 'calendar.import','template' => '','lang' => '','group' => '0','version' => '1.0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:9:"iCal file";}s:1:"B";a:3:{s:4:"type";s:4:"file";s:4:"name";s:9:"ical_file";s:6:"needed";s:1:"1";}}i:3;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:4;s:4:"cols";i:2;s:5:"align";s:6:"center";s:7:"options";a:0:{}}}','size' => '','style' => '','modified' => '1131469789',);
$templ_data[] = array('name' => 'calendar.list','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:18:"calendar.list.rows";s:4:"name";s:2:"nm";}}i:3;a:1:{s:1:"A";a:9:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:5:"label";s:9:"Check all";s:4:"name";s:9:"check_all";s:4:"help";s:9:"Check all";s:6:"needed";s:1:"1";s:5:"align";s:5:"right";i:1;a:6:{s:4:"type";s:6:"button";s:4:"name";s:9:"deleteall";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:23:"Delete selected Envents";s:7:"onclick";s:43:"return confirm(\'Delete selected Envents?\');";}i:2;a:7:{s:4:"type";s:6:"button";s:4:"size";s:9:"arrow_ltr";s:5:"label";s:9:"Check all";s:4:"name";s:9:"check_all";s:4:"help";s:9:"Check all";s:7:"onclick";s:70:"toggle_all(this.form,form::name(\'nm[rows][checked][]\')); return false;";s:4:"span";s:14:",checkAllArrow";}}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.noWrap { white-space: nowrap; }','modified' => '1250536279',);
$templ_data[] = array('name' => 'calendar.list','template' => '','lang' => '','group' => '0','version' => '1.7.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:18:"calendar.list.rows";s:4:"name";s:2:"nm";}}i:3;a:1:{s:1:"A";a:9:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:5:"label";s:9:"Check all";s:4:"name";s:9:"check_all";s:4:"help";s:9:"Check all";s:6:"needed";s:1:"1";s:5:"align";s:5:"right";i:1;a:6:{s:4:"type";s:6:"button";s:4:"name";s:9:"deleteall";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:22:"Delete selected events";s:7:"onclick";s:42:"return confirm(\'Delete selected events?\');";}i:2;a:7:{s:4:"type";s:6:"button";s:4:"size";s:9:"arrow_ltr";s:5:"label";s:9:"Check all";s:4:"name";s:9:"check_all";s:4:"help";s:9:"Check all";s:7:"onclick";s:70:"toggle_all(this.form,form::name(\'nm[rows][checked][]\')); return false;";s:4:"span";s:14:",checkAllArrow";}}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.noWrap { white-space: nowrap; }','modified' => '1250536279',);
$templ_data[] = array('name' => 'calendar.list.dates','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:10:{s:4:"type";s:4:"hbox";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:1:"4";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Start";}i:2;a:2:{s:4:"type";s:4:"date";s:4:"name";s:9:"startdate";}i:3;a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"End";}i:4;a:2:{s:4:"type";s:4:"date";s:4:"name";s:7:"enddate";}s:4:"span";s:12:",custom_hide";}}','size' => '','style' => '.custom_hide { visibility: hidden; }','modified' => '1173420675',);

View File

@ -69,12 +69,13 @@
</rows>
</grid>
</template>
<template id="calendar.edit.participants" template="" lang="" group="0" version="1.3.004">
<template id="calendar.edit.participants" template="" lang="" group="0" version="1.7.001">
<grid width="100%" height="210" overflow="auto" id="participants">
<columns>
<column width="95"/>
<column/>
<column/>
<column width="70"/>
<column/>
<column/>
</columns>
@ -87,21 +88,26 @@
</menulist>
<link-entry id="resource" options="@cal_resources"/>
</vbox>
<int options="1,,3" id="quantity"/>
<button label="Add" id="add"/>
<int options="1,,3" id="quantity" align="center"/>
<menulist class="selectRole">
<menupopup id="role"/>
</menulist>
<button label="Add" id="add" align="center"/>
<description/>
</row>
<row class="th">
<description value="Type"/>
<description value="Participants"/>
<description value="Quantity"/>
<description value="Quantity" align="center"/>
<description value="Role"/>
<description value="Status"/>
<description value="Actions"/>
</row>
<row valign="top">
<description id="${row}[app]"/>
<description rows="1" cols="2" id="${row}[title]" no_lang="1"/>
<int id="${row}[quantity]" options="1,,3"/>
<int id="${row}[quantity]" options="1,,3" readonly="true" align="center"/>
<description id="${row}[role]"/>
<menulist>
<menupopup id="${row}[status]" no_lang="1" onchange="1"/>
</menulist>
@ -109,6 +115,9 @@
</row>
</rows>
</grid>
<styles>
.selectRole select { width: 100%; }
</styles>
</template>
<template id="calendar.edit.recurrence" template="" lang="" group="0" version="1.7.001">
<grid width="100%" height="210">

View File

@ -2,7 +2,7 @@
<!-- $Id$ -->
<overlay>
<template id="calendar.list.rows" template="" lang="" group="0" version="1.7.002">
<grid width="100%">
<grid width="100%" height="200" overflow="auto">
<columns>
<column/>
<column width="40%"/>
@ -99,7 +99,7 @@
</row>
<row>
<hbox label="Check all" id="check_all" statustext="Check all" needed="1" align="right">
<button id="deleteall" image="delete" label="Delete" statustext="Delete selected Envents" onclick="return confirm('Delete selected Envents?');"/>
<button id="deleteall" image="delete" label="Delete" statustext="Delete selected events" onclick="return confirm('Delete selected events?');"/>
<button image="arrow_ltr" label="Check all" id="check_all" statustext="Check all" onclick="toggle_all(this.form,form::name('nm[rows][checked][]')); return false;" class="checkAllArrow"/>
</hbox>
</row>

View File

@ -147,13 +147,15 @@ class bo_resources
*/
function read($res_id)
{
if(!$this->acl->is_permitted($this->so->get_value('cat_id',$res_id),EGW_ACL_READ))
if (!($data = $this->so->read(array('res_id' => $res_id))))
{
echo lang('You are not permitted to get information about this resource!') . '<br>';
echo lang('Notify your administrator to correct this situation') . '<br>';
return false;
return null; // not found
}
return $this->so->read(array('res_id' => $res_id));
if (!$this->acl->is_permitted($data['cat_id'],EGW_ACL_READ))
{
return false; // permission denied
}
return $data;
}
/**
@ -322,13 +324,15 @@ class bo_resources
* returns status for a new calendar entry depending on resources ACL
* @author Cornelius Weiss <egw@von-und-zu-weiss.de>
* @param int $res_id single id
* @return array
* @return string|boolean false if resource not found, no read rights or not bookable, else A if user has direkt booking rights or U if no dirket booking
*/
function get_calendar_new_status($res_id)
{
$data = $this->so->search(array('res_id' => $res_id),'res_id,cat_id,bookable');
if($data[0]['bookable'] == 0) return 'x';
return $this->acl->is_permitted($data[0]['cat_id'],EGW_ACL_DIRECT_BOOKING) ? A : U;
if (!($data = $this->read($res_id)) || !$data['bookable'])
{
return false;
}
return $this->acl->is_permitted($data['cat_id'],EGW_ACL_DIRECT_BOOKING) ? A : U;
}
/**
@ -478,16 +482,18 @@ class bo_resources
*
* @author Cornelius Weiss <egw@von-und-zu-weiss.de>
* @param int|array $resource
* @return string/boolean string with title, null if resource does not exist or false if no perms to view it
* @return string|boolean string with title, null if resource does not exist or false if no perms to view it
*/
function link_title( $resource )
{
if (!is_array($resource))
{
if (!($resource = $this->so->read(array('res_id' => $resource)))) return null;
if (!($resource = $this->read(array('res_id' => $resource)))) return $resource;
}
elseif (!$this->acl->is_permitted($resource['cat_id'],EGW_ACL_READ))
{
return false;
}
if (!$this->acl->is_permitted($resource['cat_id'],EGW_ACL_READ)) return false;
return $resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':'');
}