fix sharing calendar manager

remotes/origin/stable4
Georg Ehrke 13 years ago
parent 1a0c273a20
commit 66ac6c232c
  1. 8
      apps/calendar/js/calendar.js
  2. 2
      apps/calendar/templates/share.dropdown.php

@ -540,9 +540,10 @@ Calendar={
var newitem = '<li id="sharewithuser_' + $('#share_user option:selected').text() +'"><input type="checkbox" width="12px" style="visibility:hidden;" title="' + $('#share_user option:selected').text() + '">' + $('#share_user option:selected').text() + ' <img src="/owncloud/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li>'; var newitem = '<li id="sharewithuser_' + $('#share_user option:selected').text() +'"><input type="checkbox" width="12px" style="visibility:hidden;" title="' + $('#share_user option:selected').text() + '">' + $('#share_user option:selected').text() + ' <img src="/owncloud/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li>';
$('#sharewithuser_list').append(newitem); $('#sharewithuser_list').append(newitem);
$('#sharewithuser_' + $('#share_user option:selected').text() + ' > img').click(function(){ $('#sharewithuser_' + $('#share_user option:selected').text() + ' > img').click(function(){
$('#share_user option[value="' + $(this).parent().text() + '"]').attr('disabled', 'false'); $('#share_user option[value="' + $(this).parent().text() + '"]').removeAttr('disabled');
Calendar.UI.Share.unshare(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $(this).parent().text(), 'user' ); Calendar.UI.Share.unshare(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $(this).parent().text(), 'user' );
$(this).parent().remove(); $(this).parent().remove();
$("#share_user").trigger("liszt:updated");
}); });
$('#share_user option:selected').attr('disabled', 'disabled'); $('#share_user option:selected').attr('disabled', 'disabled');
$("#share_user").trigger("liszt:updated"); $("#share_user").trigger("liszt:updated");
@ -553,10 +554,11 @@ Calendar={
Calendar.UI.Share.share(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $('#share_group option:selected').text(), 'group'); Calendar.UI.Share.share(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $('#share_group option:selected').text(), 'group');
var newitem = '<li id="sharewithgroup_' + $('#share_group option:selected').text() +'"><input type="checkbox" width="12px" style="visibility:hidden;" title="' + $('#share_group option:selected').text() + '">' + $('#share_group option:selected').text() + ' <img src="/owncloud/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li>'; var newitem = '<li id="sharewithgroup_' + $('#share_group option:selected').text() +'"><input type="checkbox" width="12px" style="visibility:hidden;" title="' + $('#share_group option:selected').text() + '">' + $('#share_group option:selected').text() + ' <img src="/owncloud/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li>';
$('#sharewithgroup_list').append(newitem); $('#sharewithgroup_list').append(newitem);
$('#sharewithgroup_' + $('#share_user option:selected').text() + ' > img').click(function(){ $('#sharewithgroup_' + $('#share_group option:selected').text() + ' > img').click(function(){
$('#share_group option[value="' + $(this).parent().text() + '"]').attr('disabled', 'false'); $('#share_group option[value="' + $(this).parent().text() + '"]').removeAttr('disabled');
Calendar.UI.Share.unshare(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $(this).parent().text(), 'group'); Calendar.UI.Share.unshare(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $(this).parent().text(), 'group');
$(this).parent().remove(); $(this).parent().remove();
$("#share_group").trigger("liszt:updated");
}); });
$('#share_group option:selected').attr('disabled', 'disabled'); $('#share_group option:selected').attr('disabled', 'disabled');
$("#share_group").trigger("liszt:updated"); $("#share_group").trigger("liszt:updated");

@ -53,7 +53,7 @@ echo html_select_options($allgroups, array());
</select><br> </select><br>
<ul id="sharewithgroup_list"> <ul id="sharewithgroup_list">
<?php foreach($groups as $group): ?> <?php foreach($groups as $group): ?>
<li id="sharewithuser_<?php echo $group['share']; ?>"><input type="checkbox" width="12px" <?php echo ($group['permissions']?'checked="checked"':'')?> style="visibility:hidden;" title="<?php echo $l->t('Editable'); ?>"><?php echo $group['share']; ?><img src="<?php echo OC::$WEBROOT; ?>/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li> <li id="sharewithgroup_<?php echo $group['share']; ?>"><input type="checkbox" width="12px" <?php echo ($group['permissions']?'checked="checked"':'')?> style="visibility:hidden;" title="<?php echo $l->t('Editable'); ?>"><?php echo $group['share']; ?><img src="<?php echo OC::$WEBROOT; ?>/core/img/actions/delete.svg" class="svg action" style="display:none;float:right;"></li>
<script> <script>
$('#sharewithgroup_<?php echo $group['share']; ?> > img').click(function(){ $('#sharewithgroup_<?php echo $group['share']; ?> > img').click(function(){
$('#share_group option[value="<?php echo $group['share']; ?>"]').removeAttr('disabled'); $('#share_group option[value="<?php echo $group['share']; ?>"]').removeAttr('disabled');

Loading…
Cancel
Save