Merge remote branch 'working/user/dbwells/serial_items_and_note_fixes'
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 25 Apr 2012 20:24:04 +0000 (16:24 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 25 Apr 2012 20:24:04 +0000 (16:24 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/util/browser.js
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
README
autogen.sh [deleted file]

index 14c4cd3..7b98020 100644 (file)
@@ -439,44 +439,70 @@ function set_opac() {
                 $('record_back_to_results').disabled = true;
                 $('record_pos').setAttribute('value','');
 
+                function safe_to_proceed() {
+                    if (typeof xulG.is_tab_locked == 'undefined') { return true; }
+                    if (! xulG.is_tab_locked()) { return true; }
+                    var r = window.confirm(
+                        document.getElementById('offlineStrings').getString(
+                           'generic.unsaved_data_warning'
+                        )
+                    );
+                    if (r) {
+                        while ( xulG.unlock_tab() > 0 ) {};
+                        return true;
+                    } else {
+                        return false;
+                    }
+                }
+
                 win.attachEvt("rdetail", "nextPrevDrawn",
                     function(rIndex,rCount){
                         $('record_pos').setAttribute('value', document.getElementById('offlineStrings').getFormattedString('cat.record.counter', [(1+rIndex), rCount ? rCount : 1]));
                         if (win.rdetailNext) {
-                            g.f_record_next = function() { 
-                                g.view_override = g.view; 
-                                win.rdetailNext(); 
+                            g.f_record_next = function() {
+                                if (safe_to_proceed()) {
+                                    g.view_override = g.view;
+                                    win.rdetailNext();
+                                }
                             }
                             $('record_next').disabled = false;
                         }
                         if (win.rdetailPrev) {
-                            g.f_record_prev = function() { 
-                                g.view_override = g.view; 
-                                win.rdetailPrev(); 
+                            g.f_record_prev = function() {
+                                if (safe_to_proceed()) {
+                                    g.view_override = g.view;
+                                    win.rdetailPrev();
+                                }
                             }
                             $('record_prev').disabled = false;
                         }
                         if (win.rdetailStart) {
                             g.f_record_start = function() { 
-                                g.view_override = g.view; 
-                                win.rdetailStart(); 
+                                if (safe_to_proceed()) {
+                                    g.view_override = g.view;
+                                    win.rdetailStart();
+                                }
                             }
                             $('record_start').disabled = false;
                         }
                         if (win.rdetailEnd) {
                             g.f_record_end = function() { 
-                                g.view_override = g.view; 
-                                win.rdetailEnd(); 
+                                if (safe_to_proceed()) {
+                                    g.view_override = g.view;
+                                    win.rdetailEnd();
+                                }
                             }
                             $('record_end').disabled = false;
                         }
                         if (win.rdetailBackToResults) {
                             g.f_record_back_to_results = function() {
-                                g.view_override = g.view;
-                                win.rdetailBackToResults();
-                                if (g.view != "opac") {
-                                    set_opac();
-                                    opac_wrapper_set_help_context();
+                                if (safe_to_proceed()) {
+                                    g.view_override = g.view;
+                                    win.rdetailBackToResults();
+                                    if (g.view != "opac") {
+                                        set_opac();
+                                        opac_wrapper_set_help_context();
+                                    }
                                 }
                             }
                             $('record_back_to_results').disabled = false;
@@ -531,6 +557,7 @@ function set_opac() {
         content_params.lock_tab = xulG.lock_tab;
         content_params.unlock_tab = xulG.unlock_tab;
         content_params.inspect_tab = xulG.inspect_tab;
+        content_params.is_tab_locked = xulG.is_tab_locked;
         content_params.new_patron_tab = xulG.new_patron_tab;
         content_params.set_patron_tab = xulG.set_patron_tab;
         content_params.volume_item_creator = xulG.volume_item_creator;
@@ -709,6 +736,7 @@ function bib_in_new_tab() {
         content_params.lock_tab = xulG.lock_tab;
         content_params.unlock_tab = xulG.unlock_tab;
         content_params.inspect_tab = xulG.inspect_tab;
+        content_params.is_tab_locked = xulG.is_tab_locked;
         content_params.new_patron_tab = xulG.new_patron_tab;
         content_params.set_patron_tab = xulG.set_patron_tab;
         content_params.volume_item_creator = xulG.volume_item_creator;
index 113ea93..c004f05 100644 (file)
@@ -2240,6 +2240,14 @@ commands:
         var panel = this.controller.view.panels.childNodes[ idx ];
         while ( panel.lastChild ) panel.removeChild( panel.lastChild );
 
+        content_params.is_tab_locked = function() {
+            dump('is_tab_locked\n');
+            var id = tab.getAttribute('id');
+            if (typeof obj.tab_semaphores[id] == 'undefined') {
+                return false;
+            }
+            return obj.tab_semaphores[id] > 0;
+        }
         content_params.lock_tab = function() { 
             dump('lock_tab\n');
             var id = tab.getAttribute('id');
index 37f0466..88c0fe3 100644 (file)
@@ -293,6 +293,7 @@ util.browser.prototype = {
                 };
             }
             if (!cw.xulG.inspect_tab) { cw.xulG.inspect_tab = function() { return window.xulG.inspect_tab(); }; }
+            if (!cw.xulG.is_tab_locked) { cw.xulG.is_tab_locked = function() { return window.xulG.is_tab_locked(); }; }
             if (!cw.xulG.new_patron_tab) { cw.xulG.new_patron_tab = function(a,b) { return window.xulG.new_patron_tab(a,b); }; }
             if (!cw.xulG.set_patron_tab) { cw.xulG.set_patron_tab = function(a,b) { return window.xulG.set_patron_tab(a,b); }; }
             if (!cw.xulG.volume_item_creator) { cw.xulG.volume_item_creator = function(a) { return window.xulG.volume_item_creator(a); }; }
index 961ad06..23cd01a 100644 (file)
@@ -296,6 +296,7 @@ menu.tab7.accesskey=7
 menu.tab8.accesskey=8
 menu.tab9.accesskey=9
 menu.tab10.accesskey=0
+generic.unsaved_data_warning=This action may cause you to lose unsaved information in the current interface. Continue anyway?
 browser.reload.unsaved_data_warning=This page may have unsaved data. Reload it anyway?
 menu.close_tab.unsaved_data_warning=This tab may have unsaved data. Close it anyway?
 menu.replace_tab.unsaved_data_warning=This tab may have unsaved data. Replace it anyway?
diff --git a/README b/README
index 3f0365b..271fbbf 100644 (file)
--- a/README
+++ b/README
@@ -54,7 +54,7 @@ source directory to generate the configure script and Makefiles:
 
 [source, bash]
 ------------------------------------------------------------------------------
-./autogen.sh
+autoreconf -f -i
 ------------------------------------------------------------------------------
 
 After running `make install`, developers also need to install the Dojo Toolkit
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755 (executable)
index 5d0eacb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-# autogen.sh - generates configure using the autotools
-
-: ${LIBTOOLIZE=libtoolize}
-: ${ACLOCAL=aclocal}
-: ${AUTOHEADER=autoheader}
-: ${AUTOMAKE=automake}
-: ${AUTOCONF=autoconf}
-
-
-${LIBTOOLIZE} --force --copy
-${ACLOCAL}
-${AUTOMAKE} --add-missing --copy
-
-
-${AUTOCONF}
-
-echo 
-echo "---------------------------------------------"
-echo "autogen finished running, now run ./configure"
-echo "---------------------------------------------"