alecpl
2012-04-12 c71e95b775f94ac39a0b83c7cdbd15c4f545f557
- Fix adding contact form fields in situation when the fieldset is empty.
Fixes issue with lost manager/assistant fields in LDAP addressbook


2 files modified
13 ■■■■ changed files
program/js/app.js 11 ●●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc 2 ●●● patch | view | raw | blame | history
program/js/app.js
@@ -4563,8 +4563,15 @@
      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],
program/steps/addressbook/func.inc
@@ -669,7 +669,7 @@
                }
            }
            if (!$content)
            if (!$content && !$edit_mode)
                continue;
            // also render add-field selector