summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
authorGeorg Ehrke <ownclouddev@georgswebsite.de>2012-02-21 19:36:42 +0100
committerGeorg Ehrke <ownclouddev@georgswebsite.de>2012-02-21 19:36:42 +0100
commite227a65f66bfa26ea2fb110bc6908281bd61d8bc (patch)
treef60313bc519b707b6b7fed31a42efe4dc8dce034 /apps/calendar
parent70a369e16d9499ed76e3bf18713beb0176a528fd (diff)
parentd8734cee02233241120a1ad027a495bff8d045cd (diff)
downloadnextcloud-server-e227a65f66bfa26ea2fb110bc6908281bd61d8bc.tar.gz
nextcloud-server-e227a65f66bfa26ea2fb110bc6908281bd61d8bc.zip
Merge remote-tracking branch 'origin/calendar_sharing' into calendar_sharing
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/ajax/share/unshare.php3
-rw-r--r--apps/calendar/js/calendar.js10
-rw-r--r--apps/calendar/lib/share.php4
3 files changed, 8 insertions, 9 deletions
diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php
index ec3150a89aa..25a0ef48fcf 100644
--- a/apps/calendar/ajax/share/unshare.php
+++ b/apps/calendar/ajax/share/unshare.php
@@ -30,8 +30,7 @@ switch($sharetype){
if($sharetype == 'user' && !OC_User::userExists($sharewith)){
OC_JSON::error(array('message'=>'user not found'));
exit;
-}
-if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
+}elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
OC_JSON::error(array('message'=>'group not found'));
exit;
}
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index e9c33f7c454..cd4a82a71b3 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -537,13 +537,13 @@ Calendar={
$('#share_user').live('change', function(){
if($('#sharewithuser_' + $('#share_user option:selected').text()).length == 0){
Calendar.UI.Share.share(Calendar.UI.Share.currentid, Calendar.UI.Share.idtype, $('#share_user option:selected').text(), 'user');
- 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_' + $('#share_user option:selected').text() + ' > img').click(function(){
$('#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' );
- $(this).parent().remove();
$("#share_user").trigger("liszt:updated");
+ $(this).parent().remove();
});
$('#share_user option:selected').attr('disabled', 'disabled');
$("#share_user").trigger("liszt:updated");
@@ -552,13 +552,13 @@ Calendar={
$('#share_group').live('change', function(){
if($('#sharewithgroup_' + $('#share_group option:selected').text()).length == 0){
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_' + $('#share_group option:selected').text() + ' > img').click(function(){
$('#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');
- $(this).parent().remove();
$("#share_group").trigger("liszt:updated");
+ $(this).parent().remove();
});
$('#share_group option:selected').attr('disabled', 'disabled');
$("#share_group").trigger("liszt:updated");
@@ -811,7 +811,7 @@ $(document).ready(function(){
eventDrop: Calendar.UI.moveEvent,
eventResize: Calendar.UI.resizeEvent,
eventRender: function(event, element) {
- element.find('span.fc-event-title').html(element.find('span.fc-event-title').text());
+ element.find('.fc-event-title').html(element.find('.fc-event-title').text());
element.tipsy({
className: 'tipsy-event',
opacity: 0.9,
diff --git a/apps/calendar/lib/share.php b/apps/calendar/lib/share.php
index 33bf50f68ad..d66095b9771 100644
--- a/apps/calendar/lib/share.php
+++ b/apps/calendar/lib/share.php
@@ -27,10 +27,10 @@ class OC_Calendar_Share{
}else{
$group_where .= ' OR ';
}
- $group_where .= ' (share = "' . $group . '" and sharetype = "group") ';
+ $group_where .= ' (share = \'' . $group . '\' AND sharetype = \'group\') ';
$i++;
}
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ((share = ? AND sharetype = "user") ' . $group_where . ') AND owner <> ?' . ((!is_null($active) && $active)?' AND active = 1':''));
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ((share = ? AND sharetype = \'user\') ' . $group_where . ') AND owner <> ?' . ((!is_null($active) && $active)?' AND active = 1)':')'));
$result = $stmt->execute(array($userid, $userid));
$return = array();
while( $row = $result->fetchRow()){