checkout payload for non-cat
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Feb 2006 17:06:07 +0000 (17:06 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 2 Feb 2006 17:06:07 +0000 (17:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2934 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/error.js
Open-ILS/xul/staff_client/server/circ/checkout.js

index 31d970e..91524f9 100644 (file)
@@ -38,7 +38,7 @@ util.error.prototype = {
                'D_CONSTRUCTOR' : false, 'D_FIREFOX' : false, 'D_LEGACY' : false, 'D_DATA' : false,
 
                'D_CLAM' : false, 'D_PAGED_TREE' : false, 'D_GRID_LIST' : false, 'D_HTML_TABLE' : false,
-               'D_TAB' : false, 'D_LIST' : true,
+               'D_TAB' : false, 'D_LIST' : false,
 
                'D_AUTH' : true, 'D_OPAC' : true, 'D_CAT' : true,
 
@@ -55,9 +55,9 @@ util.error.prototype = {
 
                'D_PATRON_UTILS' : false, 'D_CIRC_UTILS' : false,
 
-               'D_FILE' : true, 'D_EXPLODE' : false, 'D_FM_UTILS' : false, 'D_PRINT' : false, 'D_SES' : true,
+               'D_FILE' : false, 'D_EXPLODE' : false, 'D_FM_UTILS' : false, 'D_PRINT' : false, 'D_SES' : true,
                'D_SES_FUNC' : false, 'D_SES_RESULT' : true, 'D_SPAWN' : false, 'D_STRING' : false,
-               'D_UTIL' : false, 'D_WIN' : true, 'D_WIDGETS' : false
+               'D_UTIL' : false, 'D_WIN' : false, 'D_WIDGETS' : false
        },
 
        'filter_console_init' : function (p) {
index 4789fe5..e8427d2 100644 (file)
@@ -148,21 +148,36 @@ circ.checkout.prototype = {
                                        [ obj.session, params ]
                                );
                                if (checkout.ilsevent == 0) {
-                                       if (!checkout.payload) {
-                                               checkout.payload = {};
-                                               if (!checkout.payload.circ) {
-                                                       checkout.payload.circ = new aoc();
+                                       if (!checkout.payload) checkout.payload = {};
+                                       if (!checkout.payload.circ) {
+                                               checkout.payload.circ = new aoc();
+                                               if (checkout.payload.noncat_circ) {
+                                                       checkout.payload.circ.circ_lib( checkout.payload.noncat_circ.circ_lib() );
+                                                       checkout.payload.circ.circ_staff( checkout.payload.noncat_circ.staff() );
+                                                       checkout.payload.circ.usr( checkout.payload.noncat_circ.patron() );
+                                                       
+                                                       JSAN.use('util.date');
+                                                       var c = checkout.payload.noncat_circ.circ_time();
+                                                       var d = c == "now" ? new Date() : util.date.db_date2Date( c );
+                                                       var t =obj.data.hash.cnct[ checkout.payload.noncat_circ.item_type() ];
+                                                       var cd = t.circ_duration() || "14 days";
+                                                       var i = util.date.interval_to_seconds( cd ) * 1000;
+                                                       d.setTime( Date.parse(d) + i );
+                                                       checkout.payload.circ.due_date( util.date.formatted_date(d,'%F') );
+
                                                }
-                                               if (!checkout.payload.mvr) {
-                                                       checkout.payload.mvr = new mvr();
-                                                       checkout.payload.mvr.title(
-                                                               /* assuming noncat */
-                                                               obj.data.hash.cnct[ params.noncat_type ].name()
+                                       }
+                                       if (!checkout.payload.record) {
+                                               checkout.payload.record = new mvr();
+                                               if (checkout.payload.noncat_circ) {
+                                                       checkout.payload.record.title(
+                                                               obj.data.hash.cnct[ checkout.payload.noncat_circ.item_type() ].name()
                                                        );
                                                }
-                                               if (!checkout.payload.acp) {
-                                                       checkout.payload.acp = new acp();
-                                               }
+                                       }
+                                       if (!checkout.payload.copy) {
+                                               checkout.payload.copy = new acp();
+                                               checkout.payload.copy.barcode( 'special' );
                                        }
                                        obj.list.append(
                                                {