From: Jan Schneider Date: Wed, 19 May 2010 17:21:36 +0000 (+0200) Subject: Use a button instead of onchange events to add users/groups. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cec0cb34c9e4daec91acb0f9743e06411762507c;p=horde.git Use a button instead of onchange events to add users/groups. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index d5cc6b6ff..d5e16f51b 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3005,13 +3005,11 @@ KronolithCore = { var tr = elm.up('tr'), row = tr.cloneNode(true).store('remove', true), - td = row.down('td'); + td = row.down('td'), + clearName = elm.tagName == 'SELECT' ? elm.options[elm.selectedIndex].text: elm.getValue(); - td.down('label').remove(); - // For some strange prototype/firefox box, an instance .remove() - // doesn't work here. - Element.remove(td.down(elm.tagName)); - td.insert((elm.tagName == 'SELECT' ? elm.options[elm.selectedIndex].text: elm.getValue()).escapeHTML()) + td.update(); + td.insert(clearName.escapeHTML()) .insert(new Element('input', { type: 'hidden', name: (what == 'user' ? 'u' : 'g') + '_names[' + value + ']', value: value })); row.select('input[type=checkbox]').each(function(input) { input.writeAttribute('name', input.name.replace(/\[.*?$/, '[' + value + ']')) @@ -3746,6 +3744,14 @@ KronolithCore = { } break; + case 'kronolithCinternalPUAdd': + case 'kronolithCinternalPGAdd': + case 'kronolithCtasklistsPUAdd': + case 'kronolithCtasklistsPGAdd': + var info = id.match(/kronolithC(.*)P(.)/); + this.insertGroupOrUser(info[1], info[2] == 'U' ? 'user' : 'group'); + break; + case 'kronolithNavDay': case 'kronolithNavWeek': case 'kronolithNavMonth': diff --git a/kronolith/templates/chunks/permissions.inc b/kronolith/templates/chunks/permissions.inc index 79c7eb120..49b8cba00 100644 --- a/kronolith/templates/chunks/permissions.inc +++ b/kronolith/templates/chunks/permissions.inc @@ -183,10 +183,10 @@ if (count($groups) > 1) { - + hasCapability('list') && ($GLOBALS['conf']['auth']['list_users'] == 'list' || $GLOBALS['conf']['auth']['list_users'] == 'both')): ?> - listUsers() as $user): ?> @@ -195,8 +195,9 @@ if (count($groups) > 1) { - + + " /> @@ -234,14 +235,15 @@ if (count($groups) > 1) { - + - $group): ?> + " />