Reset copies button and misc
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Jun 2006 06:20:52 +0000 (06:20 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Jun 2006 06:20:52 +0000 (06:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4783 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/cat/copy_editor.xul

index 09e9b05..c58ab8a 100644 (file)
@@ -66,6 +66,7 @@ function my_init() {
                if (g.copies.length > 0 && g.copies[0].id() < 0) {
                        document.getElementById('copy_notes').setAttribute('hidden','true');
                        g.apply("status",5 /* In Process */);
+                       $('save').setAttribute('label','Create Copies');
                } else {
                        g.panes_and_field_names.left_pane = 
                                [
@@ -160,6 +161,11 @@ function my_init() {
                }
 
                /******************************************************************************************************/
+               /* Backup copies :) */
+
+               g.original_copies = js2JSON( g.copies );
+
+               /******************************************************************************************************/
                /* Do it */
 
                g.summarize( g.copies );
@@ -174,6 +180,16 @@ function my_init() {
 }
 
 /******************************************************************************************************/
+/* Restore backup copies */
+
+g.reset = function() {
+       g.changed = {};
+       g.copies = JSON2js( g.original_copies );
+       g.summarize( g.copies );
+       g.render();
+}
+
+/******************************************************************************************************/
 /* Apply a value to a specific field on all the copies being edited */
 
 g.apply = function(field,value) {
index 15d4a07..251ecd1 100644 (file)
@@ -39,7 +39,9 @@
        <groupbox flex="1" style="overflow: auto">
                <caption id="caption" label="Copy Viewer"/>
 
-               <hbox id="input_placeholder"/>
+               <hbox id="top_nav">
+                       <button label="Reset" accesskey="R" oncommand="g.reset()"/>
+               </hbox>
 
                <hbox flex="1" style="overflow: scroll">
                        <vbox flex="1">
                <hbox id="nav">
                        <spacer flex="1"/>
                        <button id="copy_notes" label="Copy Notes" accesskey="N" oncommand="g.copy_notes();"/>
-                       <button id="save" label="Modify" hidden="true" accesskey="M"
-                               oncommand="g.stash_and_close();"/>
-                       <button id="cancel" label="Close" accesskey="C" 
-                               oncommand="window.close();"/>
+                       <button id="save" label="Modify Copies" hidden="true" accesskey="M" oncommand="g.stash_and_close();"/>
+                       <button id="cancel" label="Close" accesskey="C" oncommand="window.close();"/>
                </hbox>
 
                <spacer/>