1 /***************************************************************************
2 * Copyright (C) 2003-2011 Polytechnique.org *
3 * http://opensource.polytechnique.org/ *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************/
21 // Page initialization {{{1
23 function wizPage_onLoad(id
)
28 while ($('.edu_' + i
).length
!= 0) {
34 checkCurrentAddress();
41 while ($('#medal_' + i
).length
!= 0) {
47 if ($('#jobs_0').find("[name='jobs[0][name]']").val() == '') {
48 registerEnterpriseAutocomplete(0);
55 var educationDegreeAll
;
56 var educationDegreeName
;
61 // Publicity follows the following ordering: private < ax < public.
63 publicity
['private'] = 0;
65 publicity
['public'] = 2;
69 function toggleNamesAdvanced()
71 $('.names_advanced').toggle();
74 function addSearchName(isFemale
)
77 while ($('#search_name_' + i
).length
!= 0) {
80 $('#search_name_' + i
).updateHtml('profile/ajax/searchname/' + i + '/' + isFemale
,
82 $('#searchname').before(data
);
86 function removeSearchName(i
, isFemale
)
88 $('#search_name_' + i
).remove();
89 updateNameDisplay(isFemale
);
92 function updateNameDisplay(isFemale
)
94 var lastnames
= new Array('lastname_main', 'lastname_ordinary', 'lastname_marital', 'pseudonym');
95 var firstnames
= new Array('firstname_main', 'firstname_ordinary');
98 for (var i
= 0; i
< 4; ++i
) {
99 searchnames
+= $('.names_advanced').find('[name*=' + lastnames
[i
] + ']').val() + ';';
102 for (var i
= 0; i
< 2; ++i
) {
103 searchnames
+= $('.names_advanced').find('[name*=' + firstnames
[i
] + ']').val() + ';';
107 var has_private
= false;
108 for (var i
= 0; i
< 10; ++i
) {
109 if ($('#search_name_' + i
).find(':text').val()) {
110 searchnames
+= ';' + $('#search_name_' + i
).find('[name*=type]').val() + ';' + $('#search_name_' + i
).find(':text').val();
114 searchnames
+= (has_private
? '' : ';');
115 $.xget('profile/ajax/buildnames/' + searchnames + '/' + isFemale
,
117 var name
= data
.split(';');
118 $('#public_name').html(name
[0]);
119 $('#private_name').html(name
[0] + name
[1]);
125 function togglePromotionEdition()
127 $(".promotion_edition").toggle();
130 // Nationalities {{{1
132 function delNationality(i
)
134 $('#nationality' + i
).hide().find('select').val('');
137 function addNationality()
140 if ($('#nationality2').find('select').val() == "") {
142 } else if ($('#nationality3').find('select').val() == "") {
145 if ((i
== 2) || (i
== 3)) {
146 $('#nationality' + i
).show();
152 function prepareType(id
)
154 var edu
= $('.edu_' + id
).find("[name='edus[" + id
+ "][eduid]']").val() - 1;
155 var sel
= $('.edu_' + id
).find('[name=edu_' + id
+ '_tmp]').val();
157 if (educationDegree
[edu
]) {
158 var length
= educationDegree
[edu
].length
;
162 for (i
= 0; i
< length
; ++i
) {
163 html
+= '<option value="' + educationDegree
[edu
][i
] + '"';
164 if (sel
== educationDegree
[edu
][i
]) {
165 html
+= ' selected="selected"';
167 html
+= '>' + educationDegreeName
[educationDegree
[edu
][i
] - 1] + '</option>';
169 // XXX: to be removed once SQL table profile_merge_issues is.
170 if (sel
!= '' && html
== '') {
171 html
+= '<option value="' + sel
+ '" selected="selected">' + educationDegreeName
[sel
- 1] + '</option>';
173 $('.edu_' + id
).find("[name='edus[" + id
+ "][degreeid]']").html(html
);
183 while (!$('#edu_add').hasClass(prefix
+ i
)) {
184 if ($('.' + prefix
+ i
).length
!= 0) {
190 class_parity
= 'pair';
192 class_parity
= 'impair';
194 $('#edu_add').removeClass(prefix
+ i
);
196 $('#edu_add').addClass(prefix
+ i
);
198 $.xget('profile/ajax/edu/' + i + '/' + class_parity
,
200 $('#edu_add').before(data
);
205 function removeEdu(i
)
208 $('.' + prefix
+ i
).remove();
209 while (!$('#edu_add').hasClass(prefix
+ i
)) {
210 $('.' + prefix
+ i
).toggleClass('pair');
211 $('.' + prefix
+ i
).toggleClass('impair');
218 function addNetworking()
221 while ($('#networking_' + i
).length
!= 0) {
225 var html
= '<tr id="networking_' + i
+ '">'
226 + ' <td colspan="2">'
227 + ' <div style="float: left; width: 200px;">'
228 + ' <span class="flags">'
229 + ' <input type="checkbox" name="networking[' + i
+ '][pub]"/>'
230 + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
232 + ' <select name="networking[' + i
+ '][type]" onchange="javascript:updateNetworking(' + i
+ ');">';
233 for (nw
in nw_list
) {
234 if (namefirst
== '') {
237 html
+= ' <option value="' + nw_list
[nw
] + '">' + nw
+ '</option>';
240 + ' <input type="hidden" name="networking[' + i
+ '][name]" value="' + namefirst
+ '"/>'
242 + ' <div style="float: left">'
243 + ' <input type="text" name="networking[' + i
+ '][address]" value="" size="30"/>'
244 + ' <a href="javascript:removeNetworking(' + i
+ ')">'
245 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
251 $('#networking').before(html
);
254 function removeNetworking(id
)
256 $('#networking_' + id
).remove();
259 function updateNetworking(i
)
261 $('#networking_' + i
).find("[name='networking[" + i
+ "][name]']").val($('#networking_' + i
).find('select option:selected').text());
269 while ($('#hobby_' + i
).length
!= 0) {
272 var html
= '<tr id="hobby_' + i
+ '">'
273 + ' <td colspan="2">'
274 + ' <div style="float: left; width: 200px;">'
275 + ' <span class="flags">'
276 + ' <input type="checkbox" name="hobbies[' + i
+ '][pub]"/>'
277 + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
279 + ' <select name="hobbies[' + i
+ '][type]">'
280 + ' <option value="Sport">Sport</option>'
281 + ' <option value="Loisir">Loisir</option>'
282 + ' <option value="Hobby">Hobby</option>'
285 + ' <div style="float: left">'
286 + ' <input type="text" name="hobbies[' + i
+ '][text]" value="" size="30"/>'
287 + ' <a href="javascript:removeHobby(' + i
+ ')">'
288 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
294 $('#hobby').before(html
);
297 function removeHobby(id
)
299 $('#hobby_' + id
).remove();
304 function toggleAddress(id
, val
)
306 $('#addresses_' + id
+ '_grayed').toggle();
307 $('#addresses_' + id
).toggle();
308 $('#addresses_' + id
+ '_cont').find('[name*=removed]').val(val
);
309 checkCurrentAddress();
312 function checkCurrentAddress(id
)
314 var hasCurrentAddress
= id
? true : false;
316 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
317 if ($('#addresses_' + i
+ '_cont').find('[name*=removed]').val() == 1) {
318 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', false);
320 if (!hasCurrentAddress
&& $('#addresses_' + i
+ '_cont').find('[name*=current]:checked').length
!= 0) {
321 hasCurrentAddress
= true;
323 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', false);
327 if (!hasCurrentAddress
) {
329 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
330 if ($('#addresses_' + i
+ '_cont').find('[name*=removed]').val() == 0) {
331 $('#addresses_' + i
+ '_cont').find('[name*=current]').attr('checked', 'checked');
338 $('#addresses_' + id
+ '_cont').find('[name*=current]').attr('checked', 'checked');
342 function addAddress(pid
)
345 while ($('#addresses_' + i
+ '_cont').length
!= 0) {
348 $('#add_address').before('<div id="addresses_' + i
+ '_cont"></div>');
349 $('#addresses_' + i
+ '_cont').updateHtml('profile/ajax/address/' + i + '/' + pid
,
350 checkCurrentAddress());
353 function addressChanged(prefid
, color
)
355 var text
= $('#' + prefid
+ '_cont').find("[name*='[text]']").val();
356 $('#' + prefid
+ '_cont').find('[name*=changed]').val("1");
357 $.xpost('map_url/', { text
:text
, color
:color
}, function(data
) {
359 $('#' + prefid
+ '_static_map_url').show();
360 $('#' + prefid
+ '_static_map_url').find('img').attr('src', data
);
362 $('#' + prefid
+ '_static_map_url').hide();
363 $('#' + prefid
+ '_geocoding_removal').find('[name*=request]:checkbox').removeAttr('checked');
368 function deleteGeocoding(prefid
)
370 if($('#' + prefid
+ '_geocoding_removal').find('[name*=request]:checkbox:checked').length
== 0) {
375 "La localisation de l'adresse sert à deux choses : te placer dans "
376 + "le planisphère et te faire apparaître dans la recherche avancée par "
377 + "pays, région, département, ville... La supprimer t'en fera disparaître. "
378 + "\nIl ne faut le faire que si cette localisation "
379 + "est réellement erronée. Avant de supprimer cette localisation, l'équipe de "
380 + "Polytechnique.org tentera de la réparer.\n\nConfirmes-tu ta "
381 + "demande de suppression de cette localisation ?");
386 function addTel(prefid
, prefname
, subField
, mainField
, mainId
)
389 var prefix
= prefid
+ '_';
390 while ($('#' + prefix
+ i
).length
!= 0) {
393 $('#' + prefix
+ 'add').before('<div id="' + prefix
+ i
+ '" style="clear: both; padding-top: 4px; padding-bottom: 4px"></div>');
394 $('#' + prefix
+ i
).updateHtml('profile/ajax/tel/' + prefid + '/' + prefname
+ '/' + i + '/' + subField
+ '/' + mainField + '/' + mainId
);
397 function removeTel(prefname
, prefid
, id
)
400 while ($('#' + prefid
+ '_' + total
).length
!= 0) {
403 $('#' + prefid
+ '_' + id
).remove();
404 for (var i
= parseInt(id
) + 1; i
< total
; ++i
) {
405 renumberPhone(prefname
, prefid
, i
);
409 function addPhoneComment(id
)
411 $('#' + id
+ '_comment').show();
412 $('#' + id
+ '_addComment').hide();
415 function removePhoneComment(id
, pref
)
417 $('#' + id
+ '_comment').hide();
418 $('#' + id
+ '_comment').find("[name='" + pref
+ "[comment]']").val('');
419 $('#' + id
+ '_addComment').show();
422 function renumberPhone(prefname
, prefid
, i
)
425 var telprefOld
= prefname
+ '[' + i
+ ']';
426 var telpref
= prefname
+ '[' + telid
+ ']';
427 var idOld
= prefid
+ '_' + i
;
428 var id
= prefid
+ '_' + telid
;
430 $('#' + idOld
).attr('id', id
);
431 $('#' + id
).find('div.titre').html('N°' + i
);
432 $('#' + id
).find('a.removeTel').attr('href', 'javascript:removeTel(\'' + prefname
+ '\',\'' + prefid
+ '\',' + telid
+ ')');
433 $('#' + id
).find('select').attr('name', telpref
+ '[type]');
434 $('#' + id
).find("[name='" + telprefOld
+ "[display]']").attr('name', telpref
+ '[display]');
435 $('#' + id
).find("[name='" + telprefOld
+ "[comment]']").attr('name', telpref
+ '[comment]');
436 $('#' + id
).find('a.removePhoneComment').attr('href', 'javascript:removePhoneComment(' + id
+ ',' + telpref
+ ')');
437 $('#' + id
).find('#' + idOld
+ '_addComment').attr('id', id
+ '_addComment');
438 $('#' + id
).find('#' + id
+ '_addComment').attr('href', 'javascript:addPhoneComment(' + id
+ ')');
439 $('#' + id
).find('#' + idOld
+ '_comment').attr('id', id
+ '_comment');
440 $('#' + id
).find("[name='" + telprefOld
+ "[pub]']").attr('name', telpref
+ '[pub]');
447 var id
= $('#binets_table').find('[name=binets_sel]').val();
448 var text
= $('#binets_table').find('select option:selected').text();
449 var html
= '<tr id="binets_' + id
+ '">'
451 + ' <input type="hidden" name="binets[' + id
+ ']" value="' + text
+ '" />'
454 + ' <div style="float: left; width: 70%">'
457 + ' <a href="javascript:removeElement(\'binets\',' + id
+ ')">'
458 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
462 $('#binets_table').after(html
);
463 updateElement('binets');
466 function updateGroupSubLink()
468 var href
= $('[name*=groupesx_sub]').val() ? $('[name*=groupesx_sub]').val() : 'http://www.polytechnique.net';
469 $('#groupesx_sub').attr('href', href
);
474 function prepareMedal(i
)
476 getMedalName($('#medal_' + i
).find('[name="medals[' + i
+ '][id]"]').val());
480 function updateMedal()
482 var val
= $('#medals').find('[name*=medal_sel]').val();
484 if ((multiple
[val
] && subgrades
[val
]) || $('.medal_name_' + val
).length
== 0) {
485 $('#medal_add').show();
487 $('#medal_add').hide();
491 function getMedalName(id
)
493 $('.medal_name_' + id
).html(names
[id
]);
496 function buildGrade(i
)
498 var id
= $('#medal_' + i
).find('[name="medals[' + i
+ '][id]"]').val();
499 var current
= $('#medal_' + i
).find('[name="medals_' + i
+ '_grade"]').val();
500 var subg
= subgrades
[id
];
501 var obj
= $('#medal_grade_' + i
);
503 obj
.prepend('<input type="hidden" name="medals[' + i
+ '][grade]" value="0" />');
505 var html
= 'Agrafe : <select name="medals[' + i
+ '][grade]">';
506 html
+= '<option value="0">Non précisée</option>';
507 for (var grade
= 0; grade
< subg
.length
; ++grade
) {
508 html
+= '<option value="' + subg
[grade
][0] + '"';
509 if (subg
[grade
][0] == current
) {
510 html
+= ' selected="selected"';
512 html
+= '>' + subg
[grade
][1] + '</option>';
519 function makeAddProcess(i
, id
)
521 return function(data
)
523 $('#medals').after(data
);
533 while ($('#medal_' + i
).length
!= 0) {
537 var id
= $('#medals').find('[name=medal_sel]').val();
538 $.xget('profile/ajax/medal/' + i + '/' + id
, makeAddProcess(i
, id
));
541 function removeMedal(id
)
544 while ($('#medal_' + total
).length
!= 0) {
547 $('#medal_' + id
).remove();
548 for (var i
= parseInt(id
) + 1; i
< total
; ++i
) {
554 function renumberMedal(i
)
558 $('#medal_' + i
).attr('id', 'medal_' + new_i
);
559 $('#medal_grade_' + i
).attr('id', 'medal_grade_' + new_i
);
560 $('#medal_grade_' + new_i
).find("[name='medals_" + i
+ "_grade']").attr('name', 'medals_' + new_i
+ '_grade');
561 $('#medal_grade_' + new_i
).find("[name='medals[" + i
+ "][id]']").attr('name', 'medals[' + new_i
+ '][id]');
562 $('#medal_grade_' + new_i
).find("[name='medals[" + i
+ "][valid]']").attr('name', 'medals[' + new_i
+ '][valid]');
563 $('#medal_grade_' + new_i
).find("[name='medals[" + i
+ "][grade]']").attr('name', 'medals[' + new_i
+ '][grade]');
564 $('#medal_' + new_i
).find('a.removeMedal').attr('href', 'javascript:removeMedal(' + new_i
+ ')');
569 function removeJob(id
, pref
)
571 $('#' + id
+ '_cont').hide();
572 if ($('#' + id
).find("[name='" + pref
+ "[new]']").val() == '0') {
573 $('#' + id
+ '_grayed').show();
574 $('#' + id
+ '_grayed_name').html($('#' + id
).find("[name='" + pref
+ "[name]']").val());
576 $('#' + id
).find("[name='" + pref
+ "[removed]']").val('1');
579 function restoreJob(id
, pref
)
581 $('#' + id
+ '_cont').show();
582 $('#' + id
+ '_grayed').hide();
583 $('#' + id
).find("[name='" + pref
+ "[removed]']").val('0');
586 function makeAddJob(id
)
588 return function(data
)
590 $('#add_job').before(data
);
591 registerEnterpriseAutocomplete(id
);
598 while ($('#jobs_' + i
).length
!= 0) {
601 $.xget('profile/ajax/job/' + i + '/' + pid
, makeAddJob(i
));
604 function addEntreprise(id
)
606 $('.entreprise_' + id
).toggle();
610 * Adds a job term in job profile page
611 * @param jobid id of profile's job among his different jobs
612 * @param jtid id of job term to add
613 * @param full_name full text of job term
614 * @return false if the term already exist for this job, true otherwise
616 function addJobTerm(jobid
, jtid
, full_name
)
624 formvarname
= 'terms';
626 parentpath
= '#jobs_'+jobid
+' ';
627 formvarname
= 'jobs['+jobid
+'][terms]';
629 var lastJobTerm
= $(parentpath
+ '.jobs_term:last');
630 if (lastJobTerm
.length
!= 0) {
631 termid
= parseInt(lastJobTerm
.children('input').attr('name').replace(/^(jobs\[[0-9]+\]\[terms\]|terms)\[([0-9]+)\]\[jtid\]/, '$2')) + 1;
632 if ($('#job'+jobid
+'_term'+jtid
).length
> 0) {
636 var newdiv
= '<div class="jobs_term" id="job'+jobid
+'_term'+jtid
+'">'+
637 '<span>'+full_name
+'</span>'+
638 '<input type="hidden" name="'+formvarname
+'['+termid
+'][jtid]" value="'+jtid
+'" />'+
639 '<img title="Retirer ce mot-clef" alt="retirer" src="images/icons/cross.gif" />'+
641 if (lastJobTerm
.length
== 0) {
642 $(parentpath
+ '.jobs_terms').prepend(newdiv
);
644 lastJobTerm
.after(newdiv
);
646 $('#job'+jobid
+'_term'+jtid
+' img').css('cursor','pointer').click(removeJobTerm
);
651 * Remove a job term in job profile page.
652 * Must be called from a button in a div containing the term
654 function removeJobTerm()
656 $(this).parent().remove();
660 * Prepare display for autocomplete suggestions in job terms
661 * @param row an array of (title of term, id of term)
662 * @return text to display
663 * If id is negative, it is because there are too much terms to
666 function displayJobTerm(row
)
669 return '... <em>parcourir les résultats dans un arbre</em> ...';
675 * Function called when a job term has been selected from autocompletion
677 * @param li is the list item (<li>) that has been clicked
678 * The context is the jsquery autocomplete object.
680 function selectJobTerm(li
)
682 var jobid
= this.extraParams
.jobid
;
683 if (li
.extra
[0] >= 0) {
684 addJobTerm(jobid
,li
.extra
[0],$(li
).text());
688 search_input
= $('.term_search')[0];
690 search_input
= $('#jobs_'+jobid
+' .term_search')[0];
692 if (li
.extra
[0] >= 0) {
693 search_input
.value
= '';
694 search_input
.focus();
696 search_input
.value
= li
.selectValue
.replace(/%$/,'');
697 toggleJobTermsTree(jobid
, li
.selectValue
);
702 * Function to show or hide a terms tree in job edition
703 * @param jobid is the id of the job currently edited
705 function toggleJobTermsTree(jobid
, textfilter
)
707 $('#term_tree_comment').toggle();
713 treepath
= '#jobs_'+jobid
+' ';
715 treepath
+= '.term_tree';
716 if ($(treepath
+ ' ul').length
> 0) {
717 $(treepath
).empty().removeClass().addClass('term_tree');
722 createJobTermsTree(treepath
, 'profile/ajax/tree/jobterms/all', 'job' + jobid
, 'chooseJobTerm', textfilter
);
726 * Function called when a job term is chosen from terms tree
727 * @param treeid is the full id of the tree (must look like job3)
728 * @param jtid is the id of the job term chosen
729 * @param fullname is the complete name (understandable without context) of the term
731 function chooseJobTerm(treeid
, jtid
, fullname
)
733 addJobTerm(treeid
.replace(/^job(.*)$/, '$1'), jtid
, fullname
);
738 function addSkill(cat
)
740 var val
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel]').val();
741 var text
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel] :selected').text();
742 $.xget('profile/ajax/skill/' + cat + '/' + val
,
744 $('#' + cat
).append(data
);
745 $('#' + cat
+ '_' + val
+ '_title').text(text
);
752 function addCountry()
754 var val
= $('#countries_table').find('[name=countries_sel] :selected').val();
755 var text
= $('#countries_table').find('[name=countries_sel] :selected').text();
756 var html
= '<div id="countries_' + val
+ '" style="clear: both; margin-bottom: 0.7em">'
757 + ' <a href="javascript:removeElement(\'countries\',\'' + val
+ '\')" style="display: block; float:right">'
758 + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce pays" />'
760 + ' <div style="float: left; width: 50%">' + text
+ '</div>'
761 + ' <input type="hidden" name="countries[' + val
+ ']" value="' + text
+ '" />'
763 $('#countries').append(html
);
764 updateElement('countries');
767 function registerEnterpriseAutocomplete(id
)
769 $('.enterprise_name').each(function() {
770 if (id
== -1 || this.name
== "jobs[" + id
+ "][name]") {
771 $(this).autocomplete({
772 source
: $.plURL('search/autocomplete/entreprise/') + this.name
,
773 change
: function(event
, ui
) {
774 if (ui
.item
!= null && ui
.item
.field
!= null) {
775 $(this).val(ui
.item
.field
);
783 // {{{1 Multiusage functions
785 function updateElement(cat
)
787 var val
= $('#' + cat
+ '_table').find('[name=' + cat
+ '_sel]').val();
788 if (val
== '' || $('#' + cat
+ '_' + val
).length
!= 0) {
789 $('#' + cat
+ '_add').hide();
791 $('#' + cat
+ '_add').show();
795 function removeElement(cat
, id
)
797 $('#' + cat
+ '_' + id
).remove();
801 function updateSubPublicity(subFieldId
, name
, mainPub
)
803 var subPub
= $(subFieldId
).find("[name='" + name
+ "']:checked").val();
804 if (publicity
[subPub
] > publicity
[mainPub
]) {
805 $(subFieldId
).find("[name='" + name
+ "']:checked").removeAttr('checked');
806 $(subFieldId
).find('[value=' + mainPub
+ ']').attr('checked', 'checked');
810 function updatePublicity(mainField
, mainId
, subField
, subId
)
812 var mainFieldId
= '#' + mainField
+ '_' + mainId
;
813 var mainPub
= $(mainFieldId
).find("[name='" + mainField
+ "[" + mainId
+ "][pub]']:checked").val();
815 var subFields
= subField
.split(',');
816 for (var i
=0; i
< subFields
.length
; ++i
) {
817 var subFieldBaseId
= mainFieldId
+ '_' + subFields
[i
];
818 var name
= mainField
+ '[' + mainId
+ '][' + subFields
[i
] + ']';
819 if ($(subFieldBaseId
).length
!= 0) {
820 updateSubPublicity(subFieldBaseId
, name
+ '[pub]', mainPub
);
821 updateSubPublicity(subFieldBaseId
, mainField
+ '[' + mainId
+ '][' + subFields
[i
] + '_pub]', mainPub
);
824 while ($(subFieldBaseId
+ '_' + subId
).length
!= 0) {
825 updateSubPublicity(subFieldBaseId
+ '_' + subId
, name
+ '[' + subId
+ '][pub]', mainPub
);
831 updateSubPublicity(mainFieldId
+ '_' + subField
, mainField
+ '[' + mainId
+ '][' + subField
+ '_pub]', mainPub
);
832 updateSubPublicity(mainFieldId
+ '_' + subField
, mainField
+ '[' + mainId
+ '][' + subField
+ '][pub]', mainPub
);
834 updateSubPublicity(mainFieldId
+ '_' + subField
+ '_' + subId
, mainField
+ '[' + mainId
+ '][' + subField
+ '][' + subId
+ '][pub]', mainPub
);
839 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: