Lines 8-16
Link Here
|
8 |
|
8 |
|
9 |
var fields_in_use = {}; |
9 |
var fields_in_use = {}; |
10 |
$(document).ready(function() { |
10 |
$(document).ready(function() { |
11 |
$('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) { |
11 |
var $tabs = $('#addbibliotabs').tabs(); |
12 |
$("#"+ui.panel.id+" input:eq(0)").focus(); |
12 |
$( "ul.sortable_field", $tabs ).sortable().disableSelection(); |
13 |
}); |
13 |
$( "ul.sortable_subfield", $tabs ).sortable().disableSelection(); |
|
|
14 |
|
14 |
$('.tag').each(function() { |
15 |
$('.tag').each(function() { |
15 |
var field_id = this.getAttribute('id').substring(0, 7); |
16 |
var field_id = this.getAttribute('id').substring(0, 7); |
16 |
if (field_id in fields_in_use) { |
17 |
if (field_id in fields_in_use) { |
Lines 597-633
function CreateKey(){
Link Here
|
597 |
return parseInt(Math.random() * 100000); |
598 |
return parseInt(Math.random() * 100000); |
598 |
} |
599 |
} |
599 |
|
600 |
|
600 |
/** |
|
|
601 |
* This function allows to move a subfield up by clickink on the 'up' button . |
602 |
*/ |
603 |
function upSubfield(index) { |
604 |
try{ |
605 |
var line = document.getElementById(index); // get the line where the user has clicked. |
606 |
} catch(e) { |
607 |
return; // this line doesn't exist... |
608 |
} |
609 |
var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>") |
610 |
|
611 |
// getting all subfields for this tag |
612 |
var subfields = tag.getElementsByTagName('div'); |
613 |
var subfieldsLength = subfields.length; |
614 |
|
615 |
if(subfieldsLength<=1) return; // nothing to do if there is just one subfield. |
616 |
|
617 |
// among all subfields |
618 |
for(var i=0;i<subfieldsLength;i++){ |
619 |
if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked : |
620 |
if(i==1){ // if the clicked subfield is on the top |
621 |
tag.appendChild(subfields[1]); |
622 |
return; |
623 |
} else { |
624 |
var lineAbove = subfields[i-1]; |
625 |
tag.insertBefore(line,lineAbove); |
626 |
return; |
627 |
} |
628 |
} |
629 |
} |
630 |
} |
631 |
|
601 |
|
632 |
function unHideSubfield(index,labelindex) { // FIXME :: is it used ? |
602 |
function unHideSubfield(index,labelindex) { // FIXME :: is it used ? |
633 |
subfield = document.getElementById(index); |
603 |
subfield = document.getElementById(index); |
Lines 813-827
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
Link Here
|
813 |
[% FOREACH BIG_LOO IN BIG_LOOP %] |
783 |
[% FOREACH BIG_LOO IN BIG_LOOP %] |
814 |
<!-- hide every tab except the 1st --> |
784 |
<!-- hide every tab except the 1st --> |
815 |
[% IF ( BIG_LOO.number ) %] |
785 |
[% IF ( BIG_LOO.number ) %] |
816 |
<div id="tab[% BIG_LOO.number %]XX"> |
786 |
<ul id="tab[% BIG_LOO.number %]XX" class="sortable_field"> |
817 |
[% ELSE %] |
787 |
[% ELSE %] |
818 |
<div id="tab[% BIG_LOO.number %]XX"> |
788 |
<ul id="tab[% BIG_LOO.number %]XX" class="sortable_field"> |
819 |
[% END %] |
789 |
[% END %] |
820 |
|
790 |
|
821 |
|
791 |
|
822 |
[% FOREACH innerloo IN BIG_LOO.innerloop %] |
792 |
[% FOREACH innerloo IN BIG_LOO.innerloop %] |
823 |
[% IF ( innerloo.tag ) %] |
793 |
[% IF ( innerloo.tag ) %] |
824 |
<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> |
794 |
<li class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> |
825 |
<div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> |
795 |
<div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> |
826 |
[% UNLESS hide_marc %] |
796 |
[% UNLESS hide_marc %] |
827 |
[% IF advancedMARCEditor %] |
797 |
[% IF advancedMARCEditor %] |
Lines 858-867
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
Link Here
|
858 |
|
828 |
|
859 |
|
829 |
|
860 |
</div> |
830 |
</div> |
861 |
|
831 |
<ul class="sortable_subfield"> |
862 |
[% FOREACH subfield_loo IN innerloo.subfield_loop %] |
832 |
[% FOREACH subfield_loo IN innerloo.subfield_loop %] |
863 |
<!-- One line on the marc editor --> |
833 |
<!-- One line on the marc editor --> |
864 |
<div class="subfield_line" style="[% subfield_loo.visibility %]; float: left; clear: left; width: 100%;" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]"> |
834 |
<li class="subfield_line" style="[% subfield_loo.visibility %]; float: left; clear: left; width: 100%;" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]"> |
865 |
|
835 |
|
866 |
[% UNLESS advancedMARCEditor %] |
836 |
[% UNLESS advancedMARCEditor %] |
867 |
[% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield"> |
837 |
[% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield"> |
Lines 870-878
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
Link Here
|
870 |
|
840 |
|
871 |
[% UNLESS hide_marc %] |
841 |
[% UNLESS hide_marc %] |
872 |
<span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %] |
842 |
<span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %] |
873 |
<img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" /> |
843 |
<img class="buttonUp" style="display:none;" src="[% themelang %]/../img/cursor_split_16.png" alt="Move" title="Move" /> |
874 |
[% ELSE %] |
844 |
[% ELSE %] |
875 |
<img class="buttonUp" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" /> |
845 |
<img class="buttonUp" src="[% themelang %]/../img/cursor_split_16.png" alt="Move" title="Move" /> |
|
|
846 |
|
876 |
[% END %] |
847 |
[% END %] |
877 |
<input title="[% subfield_loo.marc_lib_plain %]" style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text" tabindex="0" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" size="1" maxlength="1" class="flat" /> |
848 |
<input title="[% subfield_loo.marc_lib_plain %]" style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text" tabindex="0" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" size="1" maxlength="1" class="flat" /> |
878 |
</span> |
849 |
</span> |
Lines 897-912
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
Link Here
|
897 |
[% END %] |
868 |
[% END %] |
898 |
|
869 |
|
899 |
|
870 |
|
900 |
</div> |
871 |
</li> |
901 |
<!-- End of the line --> |
872 |
<!-- End of the line --> |
902 |
|
873 |
|
903 |
[% END %] |
874 |
[% END %] |
904 |
</div> |
875 |
</ul> |
905 |
[% END %]<!-- tag --> |
876 |
[% END %]<!-- tag --> |
906 |
[% END %] |
877 |
[% END %] |
907 |
</div> |
878 |
</li> |
|
|
879 |
</ul> |
908 |
[% END %] |
880 |
[% END %] |
909 |
</div> |
881 |
|
910 |
<!-- Fields for fast add cataloguing --> |
882 |
<!-- Fields for fast add cataloguing --> |
911 |
<input type="hidden" name="barcode" value="[% barcode %]" /> |
883 |
<input type="hidden" name="barcode" value="[% barcode %]" /> |
912 |
<input type="hidden" name="branch" value="[% branch %]" /> |
884 |
<input type="hidden" name="branch" value="[% branch %]" /> |