- var cb = document.forms.prof_annu[cat + '_sel'];
- var id = cb.value;
- var text = cb.options[cb.selectedIndex].text;
- var html = '<tr id="' + cat + '_' + id + '">'
- + ' <td>'
- + ' <input type="hidden" name="' + cat + '[' + id + ']" value="' + text + '" />'
- + ' </td>'
- + ' <td>'
- + ' <div style="float: left; width: 70%">'
- + text
- + ' </div>'
- + ' <a href="javascript:removeGroup(\'' + cat + '\', ' + id + ')">'
- + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
- + ' </a>'
- + ' </td>'
- + '</tr>';
- $('#' + cat).after(html);
- updateGroup(cat);
+ $('#' + id + '_comment').hide();
+ $('#' + id + '_comment').find("[name='" + pref + "[comment]']").val('');
+ $('#' + id + '_addComment').show();
+}
+
+function renumberPhone(prefname, prefid, i)
+{
+ var telid = i - 1;
+ var telprefOld = prefname + '[' + i + ']';
+ var telpref = prefname + '[' + telid + ']';
+ var idOld = prefid + '_' + i;
+ var id = prefid + '_' + telid;
+
+ $('#' + idOld).attr('id', id);
+ $('#' + id).find('div.titre').html('N°' + i);
+ $('#' + id).find('a.removeTel').attr('href', 'javascript:removeTel(\'' + prefname + '\',\'' + prefid + '\',' + telid + ')');
+ $('#' + id).find('select').attr('name', telpref + '[type]');
+ $('#' + id).find("[name='" + telprefOld + "[display]']").attr('name', telpref + '[display]');
+ $('#' + id).find("[name='" + telprefOld + "[comment]']").attr('name', telpref + '[comment]');
+ $('#' + id).find('a.removePhoneComment').attr('href', 'javascript:removePhoneComment(' + id + ',' + telpref + ')');
+ $('#' + id).find('#' + idOld + '_addComment').attr('id', id + '_addComment');
+ $('#' + id).find('#' + id + '_addComment').attr('href', 'javascript:addPhoneComment(' + id + ')');
+ $('#' + id).find('#' + idOld + '_comment').attr('id', id + '_comment');
+ $('#' + id).find("[name='" + telprefOld + "[pub]']").attr('name', telpref + '[pub]');