fix unsharing of events

This commit is contained in:
Georg Ehrke 2012-04-13 21:49:24 -04:00
parent c65adc12d5
commit e256ac8791
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ if($sharetype == 'user' && !OC_User::userExists($sharewith)){
OC_JSON::error(array('message'=>'group not found'));
exit;
}
$success = OC_Calendar_Share::unshare(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::Event));
$success = OC_Calendar_Share::unshare(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT));
if($success){
OC_JSON::success();
}else{

View File

@ -19,7 +19,7 @@ foreach($sharedelements as $sharedelement){
?>
<strong><?php echo $l->t('Users');?>:</strong><br>
<select id="share_user" title="<?php echo $l->t('select users');?>" data-placeholder="<?php echo $l->t('select users'); ?>">
<option value=""></option>
<option value=""></option>
<?php
$allocusers = OC_User::getUsers();
$allusers = array();
@ -37,7 +37,7 @@ echo html_select_options($allusers, array());
<script>
$('#sharewithuser_<?php echo $user['share']; ?> > img').click(function(){
$('#share_user option[value="<?php echo $user['share']; ?>"]').removeAttr('disabled');
Calendar.UI.Share.unshare(<?php echo $id; ?>, 'calendar', '<?php echo $user['share']; ?>', 'user');
Calendar.UI.Share.unshare(<?php echo $id; ?>, '<?php echo (array_key_exists('calid', $_)?'calendar':'event');?>', '<?php echo $user['share']; ?>', 'user');
$('#sharewithuser_<?php echo $user['share']; ?>').remove();
$("#share_user").trigger("liszt:updated");
});
@ -63,7 +63,7 @@ echo html_select_options($allgroups, array());
<script>
$('#sharewithgroup_<?php echo $group['share']; ?> > img').click(function(){
$('#share_group option[value="<?php echo $group['share']; ?>"]').removeAttr('disabled');
Calendar.UI.Share.unshare(<?php echo $id; ?>, 'calendar', '<?php echo $group['share']; ?>', 'group');
Calendar.UI.Share.unshare(<?php echo $id; ?>, '<?php echo (array_key_exists('calid', $_)?'calendar':'event');?>, '<?php echo $group['share']; ?>', 'group'); ?>
$('#sharewithgroup_<?php echo $group['share']; ?>').remove();
$("#share_group").trigger("liszt:updated");
});