summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-04-12 08:39:40 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-04-12 08:39:40 +0000
commiteced3c00ed1c84ea4531646cd1746e4708ebcf8f (patch)
treec73a892bd23c132eec60348710432333a4024b34
parentb9219099df876ada5f2c83613f43b942a6eb0ca1 (diff)
- Fix adding contact form fields in situation when the fieldset is empty.
Fixes issue with lost manager/assistant fields in LDAP addressbook git-svn-id: https://svn.roundcube.net/trunk@6065 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/js/app.js11
-rw-r--r--roundcubemail/program/steps/addressbook/func.inc2
2 files changed, 10 insertions, 3 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 963049b4e..978a31627 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -4563,8 +4563,15 @@ function rcube_webmail()
var lastelem = $('.ff_'+col),
appendcontainer = $('#contactsection'+section+' .contactcontroller'+col);
- if (!appendcontainer.length)
- appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col).insertAfter($('#contactsection'+section+' .contactfieldgroup').last());
+ if (!appendcontainer.length) {
+ var sect = $('#contactsection'+section),
+ lastgroup = $('.contactfieldgroup', sect).last();
+ appendcontainer = $('<fieldset>').addClass('contactfieldgroup contactcontroller'+col);
+ if (lastgroup.length)
+ appendcontainer.insertAfter(lastgroup);
+ else
+ sect.prepend(appendcontainer);
+ }
if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') {
var input, colprop = this.env.coltypes[col],
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc
index eb8a0e597..e32ce5a12 100644
--- a/roundcubemail/program/steps/addressbook/func.inc
+++ b/roundcubemail/program/steps/addressbook/func.inc
@@ -669,7 +669,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
}
}
- if (!$content)
+ if (!$content && !$edit_mode)
continue;
// also render add-field selector