Bugzilla – Attachment 13184 Details for
Bug 7882
Add ability to move and reorder fields and subfields in MARC editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds jQueryUI sortable features to fields. Converts list items from div's to ul's Added Image files to be used for Drag and drop in frameworks added CSS changes for images
Adds-jQueryUI-sortable-features-to-fields-Converts.patch (text/plain), 9.59 KB, created by
Elliott Davis
on 2012-11-01 21:46:49 UTC
(
hide
)
Description:
Adds jQueryUI sortable features to fields. Converts list items from div's to ul's Added Image files to be used for Drag and drop in frameworks added CSS changes for images
Filename:
MIME Type:
Creator:
Elliott Davis
Created:
2012-11-01 21:46:49 UTC
Size:
9.59 KB
patch
obsolete
>From 6a59d44cd11789057646f2e8a4c64b5a17b323c5 Mon Sep 17 00:00:00 2001 >From: Elliott Davis <elliott@bywatersolutions.com> >Date: Thu, 13 Sep 2012 08:08:46 -0500 >Subject: [PATCH] Adds jQueryUI sortable features to fields. Converts list items from div's to ul's Added Image files to be used for Drag and drop in frameworks added CSS changes for images > >To Test: > >Go into catalogging and choose to add a new item with your favorite framework. >You should be able to move the fields and the subfields around >After making your desired number of changes choose to save >You should notice the marc record saved in the order that you arranged the fields > >http://bugs.koha-community.org/show_bug.cgi?id=7882 >--- > koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css | 6 ++- > .../prog/en/modules/cataloguing/addbiblio.tt | 62 +++++-------------- > .../intranet-tmpl/prog/img/cursor_split_16.png | Bin 0 -> 3206 bytes > 3 files changed, 22 insertions(+), 46 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/img/cursor_split_16.png > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >index d2489b3..9ac2d24 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css >@@ -1,7 +1,11 @@ > #addbibliotabs { > margin-top : 1em; > } >- >+ul li.tag { >+ list-style-type:none; >+ padding:0 0 0 25px; >+ background: url("../../img/cursor_split_16.png") no-repeat left bottom; >+} > #addbibliotabs .ui-tabs-panel { > float : left; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index ee8e9fa..0131769 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -8,9 +8,10 @@ > > var fields_in_use = {}; > $(document).ready(function() { >- $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) { >- $("#"+ui.panel.id+" input:eq(0)").focus(); >- }); >+ var $tabs = $('#addbibliotabs').tabs(); >+ $( "ul.sortable_field", $tabs ).sortable().disableSelection(); >+ $( "ul.sortable_subfield", $tabs ).sortable().disableSelection(); >+ > $('.tag').each(function() { > var field_id = this.getAttribute('id').substring(0, 7); > if (field_id in fields_in_use) { >@@ -597,37 +598,6 @@ function CreateKey(){ > return parseInt(Math.random() * 100000); > } > >-/** >- * This function allows to move a subfield up by clickink on the 'up' button . >- */ >-function upSubfield(index) { >- try{ >- var line = document.getElementById(index); // get the line where the user has clicked. >- } catch(e) { >- return; // this line doesn't exist... >- } >- var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>") >- >- // getting all subfields for this tag >- var subfields = tag.getElementsByTagName('div'); >- var subfieldsLength = subfields.length; >- >- if(subfieldsLength<=1) return; // nothing to do if there is just one subfield. >- >- // among all subfields >- for(var i=0;i<subfieldsLength;i++){ >- if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked : >- if(i==1){ // if the clicked subfield is on the top >- tag.appendChild(subfields[1]); >- return; >- } else { >- var lineAbove = subfields[i-1]; >- tag.insertBefore(line,lineAbove); >- return; >- } >- } >- } >-} > > function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > subfield = document.getElementById(index); >@@ -813,15 +783,15 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > [% FOREACH BIG_LOO IN BIG_LOOP %] > <!-- hide every tab except the 1st --> > [% IF ( BIG_LOO.number ) %] >- <div id="tab[% BIG_LOO.number %]XX"> >+ <ul id="tab[% BIG_LOO.number %]XX" class="sortable_field"> > [% ELSE %] >- <div id="tab[% BIG_LOO.number %]XX"> >+ <ul id="tab[% BIG_LOO.number %]XX" class="sortable_field"> > [% END %] > > > [% FOREACH innerloo IN BIG_LOO.innerloop %] > [% IF ( innerloo.tag ) %] >- <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> >+ <li class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> > <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]"> > [% UNLESS hide_marc %] > [% IF advancedMARCEditor %] >@@ -858,10 +828,10 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > > > </div> >- >+ <ul class="sortable_subfield"> > [% FOREACH subfield_loo IN innerloo.subfield_loop %] > <!-- One line on the marc editor --> >- <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 %]"> >+ <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 %]"> > > [% UNLESS advancedMARCEditor %] > [% 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"> >@@ -870,9 +840,10 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > > [% UNLESS hide_marc %] > <span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %] >- <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" /> >+ <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/cursor_split_16.png" alt="Move" title="Move" /> > [% ELSE %] >- <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" /> >+ <img class="buttonUp" src="[% themelang %]/../img/cursor_split_16.png" alt="Move" title="Move" /> >+ > [% END %] > <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" /> > </span> >@@ -897,16 +868,17 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? > [% END %] > > >- </div> >+ </li> > <!-- End of the line --> > > [% END %] >- </div> >+ </ul> > [% END %]<!-- tag --> > [% END %] >- </div> >+ </li> >+</ul> > [% END %] >-</div> >+ > <!-- Fields for fast add cataloguing --> > <input type="hidden" name="barcode" value="[% barcode %]" /> > <input type="hidden" name="branch" value="[% branch %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/img/cursor_split_16.png b/koha-tmpl/intranet-tmpl/prog/img/cursor_split_16.png >new file mode 100644 >index 0000000000000000000000000000000000000000..dc6d31da4d557a413f132153e916ee5dc18a0423 >GIT binary patch >literal 3206 >zcmd5<U5Fc16rNQqcDrqtib5;c>-5E+CiAzuNroib+5B`vyW2I*(tQxx$;{p4x|5mo >z&dnyf$W{~z1s~c~L@9^`A4PmnD5$hxWm}(o_Qe&YKDMO~g4(WUW|DNW8?{gnmu!+d >z_nhzh&bjBFdvk7P`t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O~U(b^@qrKQt*zTPUR$pt+kaj4V4k- >zWT8saEY@3T-npe(u&mHUA|^DwhQ;`FZ@Hs+iZLPv9D6Qi0kK8esJ@I2Y*Ogq^c1*_ >z@@vopLmDRZO0R~r2i*(X*$C-w%j}&GMja%dHcaFZn-5Ow5P3&ww_^Jzpj0I;f)}f{ >z1D~f(4M7_Z9SjfB;(B?BqJ9!Pe7?lZl02D)ca}IbB(bxmU5RPU!Y$o4F-1p+3uonG >zKc<eG&lE=WSb_sGMAFgKCF!3Bzdw^j4A-w(&9PmiF-A$b;opI#9XsMZ$J8LYg{B>p >z#gr`S3>@5k5<8^6#E>MfF&6zJT%C3G3NB$<bN@eL|4v;HV(3-~l7nY(+k}g*(7oxx >zpnF%wHZ)KQH{tJ3e$s+l^j?;mW5=C&*3>EHf(vh<23aU#-CR0-11G^~t&r79tsly# >zJ{lH(e&^i_7tZ~9^X7-#wV{(&R=%EG9T*%OytA>faq{-9AIG0SyVlp&Tet81(HzRW >zU*CK6`t{4)2fO8=i|RAUw8)hQP@228>(Jxl=bxTjU0vO{b3=J$-;TG%vzIRYv@w3> >zzIf`JGaL86eQDRwtNF77%>jBazW&)S+;fS2YmbR9-hHdOef##6)txh?(x1DJBoAF# >z8Q!z!_hYLAS3kb^#(SSXHTm7q{pr^)Ute4MjjIm7kcfS?a&P(hu?9D=jnnU+J+D6d >S#jN-9p^%%-emZgL&A$L4Jm=T| > >literal 0 >HcmV?d00001 > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7882
:
13184
|
13556
|
13789
|
14202
|
14908
|
18024
|
18025
|
18026
|
18027
|
22835
|
22836
|
23517
|
23521
|
23984
|
24227
|
24228
|
94638
|
94837
|
96344
|
96352
|
96384
|
96541
|
96542
|
96633
|
96634
|
96635