Bug 9154 - On item edit page, highlight row of item being edited
authorOwen Leonard <oleonard@myacpl.org>
Tue, 27 Nov 2012 19:34:27 +0000 (14:34 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 2 Dec 2012 14:14:53 +0000 (09:14 -0500)
This patch changes the item edit page to add a highlighting
background color to the row in the table of all items corresponding
to the item being edited. Changes to JavaScript have been made
to allow row color changes on hover.

Other minor edits: Capitalization corrections.

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
String changes, changes to JavaScript.
All tests pass.

Test plan:
1) 'Edit items' on a record with some items.
2) Check edited item is highlighted correctly in table above.
3) Add, edit, delete an item, should all work the same as before.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt

index d35a471..79ceb48 100644 (file)
@@ -155,4 +155,12 @@ a.tagnum {
 .floating {
        -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
        box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
+}
+
+tr.active td {
+    background-color: #FFFFCC;
+}
+
+tr.active.highlight td {
+    background-color: #FEF4B4;
 }
\ No newline at end of file
index 2c33df8..0222046 100644 (file)
@@ -87,8 +87,8 @@ function confirm_deletion(biblionumber,itemnumber) {
 
 $(document).ready(function() {
     $("#cataloguing_additem_itemlist  tr").hover(
-        function () {$(this).attr("class","highlight");},
-        function () {$(this).attr("class",""         );}
+        function () {$(this).addClass("highlight");},
+        function () {$(this).removeClass("highlight");}
     );
 });
 //]]>
@@ -131,7 +131,11 @@ $(document).ready(function() {
                 [% END %]
             </tr>
                 [% FOREACH item_loo IN item_loop %]
+                [% IF ( item_loo.itemnumber == itemnumber) %]
+                <tr id="row[% item_loo.itemnumber %]" class="active">
+                [% ELSE %]
                 <tr id="row[% item_loo.itemnumber %]">
+                [% END %]
                     [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a></td>
 <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
 [% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
@@ -197,8 +201,8 @@ $(document).ready(function() {
     -->
 
     <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
-    <input type="submit" name="add_duplicate_submit" value="Add &amp; Duplicate" onclick="return Check(this.form)" />
-    <input type="submit" name="add_multiple_copies" value="Add Multiple Copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
+    <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
+    <input type="submit" name="add_multiple_copies" value="Add multiple copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
        <label for="number_of_copies">Number of copies to add : </label>
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
        <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) &amp;&amp; CheckMultipleAdd(this.form.number_of_copies.value);" />
@@ -208,7 +212,7 @@ $(document).ready(function() {
     <input type="hidden" name="tag" value="[% itemtagfield %]" />
     <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
     <input type="hidden" name="field_value" value="[% itemnumber %]" />
-    <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
+    <input type="submit" value="Save changes" onclick="return Check(this.form)" />
     [% END %]</fieldset>
     
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />