Don't show import tab if user doesn't have edit permissions.
authorJan Schneider <jan@horde.org>
Mon, 22 Mar 2010 22:26:13 +0000 (23:26 +0100)
committerJan Schneider <jan@horde.org>
Mon, 22 Mar 2010 22:26:27 +0000 (23:26 +0100)
kronolith/js/kronolith.js

index 8a3f0b1..12705a6 100644 (file)
@@ -2344,7 +2344,6 @@ KronolithCore = {
             switch (type) {
             case 'internal':
                 kronolithCTagAc.reset();
-                $('kronolithCalendar' + type + 'LinkImport').up('span').hide();
                 // Fall through.
             case 'tasklists':
                 $('kronolithCalendar' + type + 'LinkExport').up('span').hide();
@@ -2370,7 +2369,11 @@ KronolithCore = {
             case 'internal':
                 kronolithCTagAc.reset(Kronolith.conf.calendars.internal[calendar].tg);
                 $('kronolithCalendar' + type + 'ImportCal').setValue(calendar);
-                $('kronolithCalendar' + type + 'LinkImport').up('span').show();
+                if (info.edit) {
+                    $('kronolithCalendar' + type + 'LinkImport').up('li').show();
+                } else {
+                    $('kronolithCalendar' + type + 'LinkImport').up('li').hide();
+                }
                 // Fall through.
             case 'tasklists':
                 $('kronolithCalendar' + type + 'Description').setValue(info.desc);