mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
disable adding from month view if insufficient rights
This commit is contained in:
parent
db2739bbb3
commit
cdcde444b7
@ -104,7 +104,7 @@
|
|||||||
$this->cal_event = CreateObject('calendar.calendar_item');
|
$this->cal_event = CreateObject('calendar.calendar_item');
|
||||||
$this->stream->next_record();
|
$this->stream->next_record();
|
||||||
// Load the calendar event data from the db into the cal_event structure
|
// Load the calendar event data from the db into the cal_event structure
|
||||||
// Use http://www.php.net/manual/en/function.mcal-fetch-event.phpas the reference
|
// Use http://www.php.net/manual/en/function.mcal-fetch-event.php as the reference
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -794,7 +794,8 @@
|
|||||||
function display_week($startdate,$weekly,$cellcolor,$display_name = False,$owner=0,$monthstart=0,$monthend=0) {
|
function display_week($startdate,$weekly,$cellcolor,$display_name = False,$owner=0,$monthstart=0,$monthend=0) {
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
|
global $rights;
|
||||||
|
|
||||||
$str = '';
|
$str = '';
|
||||||
$gr_events = CreateObject('calendar.calendar_item');
|
$gr_events = CreateObject('calendar.calendar_item');
|
||||||
$lr_events = CreateObject('calendar.calendar_item');
|
$lr_events = CreateObject('calendar.calendar_item');
|
||||||
@ -830,8 +831,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->printer_friendly) {
|
if (!$this->printer_friendly) {
|
||||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/edit_entry.php','year='.$date_year.'&month='.$date['month'].'&day='.$date['day']).'">'
|
$str = '';
|
||||||
. '<img src="'.$phpgw->common->get_image_path('calendar').'/new.gif" width="10" height="10" alt="'.lang('New Entry').'" border="0" align="right"></a>';
|
if($rights & PHPGW_ACL_ADD) {
|
||||||
|
$str .= '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/edit_entry.php','year='.$date_year.'&month='.$date['month'].'&day='.$date['day']).'">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$str .= '<img src="'.$phpgw->common->get_image_path('calendar').'/new.gif" width="10" height="10" ';
|
||||||
|
|
||||||
|
if($rights & PHPGW_ACL_ADD) {
|
||||||
|
$str .= 'alt="'.lang('New Entry').'" ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$str .= 'border="0" align="right">';
|
||||||
|
|
||||||
|
if($rights & PHPGW_ACL_ADD) {
|
||||||
|
$str .= '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
$p->set_var('new_event_link',$str);
|
$p->set_var('new_event_link',$str);
|
||||||
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/day.php','month='.$date['month'].'&day='.$date['day'].'&year='.$date['year']).'">'.$date['day'].'</a>';
|
$str = '<a href="'.$phpgw->link($phpgw_info['server']['webserver_url'].'/calendar/day.php','month='.$date['month'].'&day='.$date['day'].'&year='.$date['year']).'">'.$date['day'].'</a>';
|
||||||
$p->set_var('day_number',$str);
|
$p->set_var('day_number',$str);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
if (floor($PHP_VERSION ) == 4) {
|
if (floor($PHP_VERSION ) == 4) {
|
||||||
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday, $filter, $keywords;
|
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday, $filter, $keywords;
|
||||||
global $matrixtype, $participants, $owner, $phpgw;
|
global $matrixtype, $participants, $owner, $phpgw, $grants, $rights;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"]))
|
if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"]))
|
||||||
@ -24,9 +24,21 @@
|
|||||||
|
|
||||||
if(!isset($owner)) { $owner = 0; }
|
if(!isset($owner)) { $owner = 0; }
|
||||||
|
|
||||||
|
$grants = $phpgw->acl->get_grants('calendar');
|
||||||
|
|
||||||
if(!isset($owner) || !$owner) {
|
if(!isset($owner) || !$owner) {
|
||||||
$owner = $phpgw_info['user']['account_id'];
|
$owner = $phpgw_info['user']['account_id'];
|
||||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||||
|
} else {
|
||||||
|
if($grants[$owner])
|
||||||
|
{
|
||||||
|
$rights = $grants[$owner];
|
||||||
|
if (!($rights & PHPGW_ACL_READ))
|
||||||
|
{
|
||||||
|
$owner = $phpgw_info['user']['account_id'];
|
||||||
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($filter) || !$filter)
|
if(!isset($filter) || !$filter)
|
||||||
@ -119,7 +131,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
$grants = $phpgw->acl->get_grants('calendar');
|
|
||||||
if(count($grants) > 0)
|
if(count($grants) > 0)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
@ -138,7 +149,7 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<select name="owner" onchange="document.setowner.submit()">
|
<select name="owner" onchange="document.setowner.submit()">
|
||||||
<?php
|
<?php
|
||||||
while(list($grantor,$rights) = each($grants))
|
while(list($grantor,$temp_rights) = each($grants))
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $grantor; ?>"<?php if($grantor==$owner) echo " selected"; ?>><?php echo $phpgw->common->grab_owner_name($grantor); ?></option>
|
<option value="<?php echo $grantor; ?>"<?php if($grantor==$owner) echo " selected"; ?>><?php echo $phpgw->common->grab_owner_name($grantor); ?></option>
|
||||||
|
@ -50,21 +50,21 @@
|
|||||||
else
|
else
|
||||||
$thisyear = $year;
|
$thisyear = $year;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if(!isset($owner)) { $owner = 0; }
|
||||||
|
|
||||||
if(!isset($owner)) { $owner = 0; }
|
if(!isset($owner) || !$owner) {
|
||||||
|
$owner = $phpgw_info['user']['account_id'];
|
||||||
if(!isset($owner) || !$owner) {
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||||
$owner = $phpgw_info['user']['account_id'];
|
} else {
|
||||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
|
$grants = $phpgw->acl->get_grants('calendar');
|
||||||
} else {
|
if($grants[$owner])
|
||||||
$grants = $phpgw->acl->get_grants('calendar');
|
|
||||||
if($grants[$owner])
|
|
||||||
{
|
|
||||||
$rights = $grants[$owner];
|
|
||||||
if (!($rights & PHPGW_ACL_READ))
|
|
||||||
{
|
{
|
||||||
$owner = $phpgw_info['user']['account_id'];
|
$rights = $grants[$owner];
|
||||||
|
if (!($rights & PHPGW_ACL_READ))
|
||||||
|
{
|
||||||
|
$owner = $phpgw_info['user']['account_id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user