added some confirmation alerts
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:10:17 +0000 (15:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:10:17 +0000 (15:10 +0000)
made some minor style changes
added ability for users to login via barcode or username

git-svn-id: svn://svn.open-ils.org/ILS/trunk@3288 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/config.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/locale/en-US/opac_common.dtd
Open-ILS/web/opac/skin/default/js/myopac.js
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/xml/advanced/advanced_refined.xml
Open-ILS/web/opac/skin/default/xml/common/login.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_bookbags.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_prefs.xml

index 07561f4..812aac7 100644 (file)
@@ -114,6 +114,10 @@ G.user     = null; /* global user object */
 G.ui           = {} /* cache of UI components */
 
 
+/* regexes */
+var REGEX_BARCODE = /^\d+/; /* starts with a number */
+
+
 /* call me after page init and I will load references 
        to all of the ui object id's defined below 
        They will be stored in G.ui.<page>.<thingy>
index 33e498d..60c3e52 100644 (file)
@@ -3,6 +3,7 @@
 /* define it again here for pages that don't load RemoteRequest */
 function isXUL() { try { if(IAMXUL) return true;}catch(e){return false;}; }
 
+
 var cookieManager = new HTTP.Cookies();
 
 var __ilsEvent; /* the last event the occurred */
@@ -464,9 +465,16 @@ function doLogin() {
       return null;
    }
 
-   var auth_request = new Request( LOGIN_COMPLETE, 
-               uname, hex_md5(seed + hex_md5(passwd)), "opac", getOrigLocation());
+       var args = {
+               password : hex_md5(seed + hex_md5(passwd)), 
+               type            : "opac", 
+               org             : getOrigLocation()
+       };
+
+       if( uname.match(REGEX_BARCODE) ) args.barcode = uname; /* make this better */
+       else args.username = uname;
 
+   var auth_request = new Request( LOGIN_COMPLETE, args );
 
    auth_request.send(true);
    var auth_result = auth_request.result();
index 66d2bf3..a21b7ac 100644 (file)
@@ -66,4 +66,4 @@
 <!ENTITY opac.title.advanced "Evergreen Advanced Search">
 <!ENTITY opac.title.reqitems "Evergreen Request Items">
 <!ENTITY opac.title.cnbrowse "Evergreen Call Number Browse">
-<!ENTITY opac.login.login "Login with your username and password">
+<!ENTITY opac.login.login "Login">
index f6dea23..87fc390 100644 (file)
@@ -197,6 +197,8 @@ function myOPACRenewCirc(circid) {
                if(circsCache[i].id() == circid)
                        circ = circsCache[i];
 
+       if(!confirm($('myopac_renew_confirm').innerHTML)) return;
+
        var req = new Request(RENEW_CIRC, G.user.session, 
                { patron : G.user.id(), copyid : circ.target_copy() } );
        req.send(true);
@@ -485,6 +487,7 @@ function _myOPACSummaryShowUer(r) {
 
        var user = r.getResultObject();
        fleshedUser = user;
+       if(!user) return;
 
        appendClear($('myopac_summary_first'),text(user.first_given_name()));
        appendClear($('myopac_summary_middle'),text(user.second_given_name()));
@@ -725,6 +728,7 @@ function myOPACExpandBookbag( id, name ) {
 }
 
 function myOPACRemoveBBItem( id, containerid, container_name ) {
+       if(!confirm($('myopac_remove_bb_item_confirm').innerHTML)) return;
        containerRemoveItem( id );
        myOPACFetchBBItems( containerid, $('myopac_bookbag_row_' + containerid), true);
        myOPACExpandBookbag( containerid, container_name );
index 8f37795..656b051 100644 (file)
@@ -58,7 +58,7 @@ function rdetailViewMarc(r,id) {
 
        var d = new Date();
 
-       var div = elem('div', { class : 'hide_me' });
+       var div = elem('div', { "class" : 'hide_me' });
        var span = div.appendChild( elem('span') );
 
        buildunAPISpan( span, 'biblio-record_entry', record.doc_id() );
index a7d2d71..4404762 100644 (file)
@@ -1,6 +1,6 @@
 <table class='data_grid' width='80%'>
        <thead>
-               <tr><td colspan='3'>&opac.advanced.refined.title;</td></tr>
+               <tr><td colspan='4'>&opac.advanced.refined.title;</td></tr>
        </thead>
        <tbody style='text-align: left'>
                <tr>
index 37c5190..a1e4773 100644 (file)
                config.ids.altcanvas.login                      = config.ids.login.box;
        </script>
 
-       <div class='login_text color_1'>
+       <br/>
+
+       <div class='login_text color_1' style='padding: 4px; text-align: center;'>
                <span>&opac.login.login;</span>
        </div>
 
        <br/>
 
-       <table>
+       <table class='data_grid' style='margin-left: 20px;' width='95%'>
                <tbody>
                        <tr>
-                               <td><span class='login_text'>&common.username;</span></td>
+                               <td><span class='login_text'>Enter your username or library barcode</span></td>
                                <td>
                                        <span class='login_text'>
                                                <input id='login_username' type='text' size='16'> </input>
                                        </span>
                                </td>
                        </tr>
-                       <tr><td><br/></td></tr>
-                       <tr>
-                               <td>
-                                       <span class='login_text'>
-                                       <a href="javascript:void(0);" id='login_button'> &common.login; </a>
+                       <tr><td><br/></td><td/></tr>
+                       <tr class='color_1'>
+                               <td colspan='2' align='center'>
+                                       <span class='login_text' style='margin-right: 20px;'>
+                                       <input type='submit' value='Login'  id='login_button'/>
                                        </span>
-                               </td>
-                               <td>
-                                       <span class='login_text'>
-                                               <a href='javascript:void(0);' id='login_cancel_button'> &common.cancel; </a>
+                                       <span class='login_text' style='margin-left: 20px;'>
+                                               <input type='submit' id='login_cancel_button' value='&common.cancel;'/>
                                        </span>
                                </td>
                        </tr>
                </tbody>
        </table>
-
 </div>
 
 
index 06d04da..65caeff 100644 (file)
        <!--
        <div style='overflow: auto; max-height: 200px;' class='hide_me'>
        -->
+       <div style='width: 99%; text-align: center'> <b id='myopac_bookbag_items_name'> </b></div>
+       <br/>
+
+       <div class='hide_me' style='width: 100%; text-align: center; font-weight: 700; margin-top: 10px;'
+               id='myopac_bookbag_no_items'>The selected bookbag contains no items...</div>
 
-               <div style='width: 99%; text-align: center'> <b id='myopac_bookbag_items_name'> </b></div>
-               <br/>
-
-               <div class='hide_me' style='width: 100%; text-align: center; font-weight: 700; margin-top: 10px;'
-                       id='myopac_bookbag_no_items'>The selected bookbag contains no items...</div>
-
-               <table width='100%' class='hide_me data_grid data_grid_center' id='myopac_bookbag_items_table'>
-                       <thead> 
-                               <tr> <td>Title</td> <td>Authors</td> <td>Remove this item?</td> </tr> 
-                       </thead>
-                       <tbody id='myopac_bookbag_items_tbody'>
-                               <tr id='myopac_bookbag_items_row'>
-                                       <td> <a name='myopac_bookbag_items_title' class='classic_link'> </a> </td>
-                                       <td> <a name='myopac_bookbag_items_author' class='classic_link'> </a> </td>
-                                       <td><a name='myopac_bookbag_items_remove' class='classic_link'>remove</a></td>  
-                               </tr>
-                       </tbody>
-               </table>
+       <table width='100%' class='hide_me data_grid data_grid_center' id='myopac_bookbag_items_table'>
+               <thead> 
+                       <tr> <td>Title</td> <td>Authors</td> <td>Remove this item?</td> </tr> 
+               </thead>
+               <tbody id='myopac_bookbag_items_tbody'>
+                       <tr id='myopac_bookbag_items_row'>
+                               <td> <a name='myopac_bookbag_items_title' class='classic_link'> </a> </td>
+                               <td> <a name='myopac_bookbag_items_author' class='classic_link'> </a> </td>
+                               <td><a name='myopac_bookbag_items_remove' class='classic_link'>remove</a></td>  
+                       </tr>
+               </tbody>
+       </table>
        <!--</div>-->
 
        <span id='bb_publish_text' class='hide_me'>
                To see the public view of a published Bookbag, click the "View" link in the 
                "Published" column of the Bookbag list at the top of this page.
        </span>
+
+       <span id='myopac_remove_bb_item_confirm' class='hide_me'>
+               Are you sure you wish to remove this bookbag item?
+       </span>
+
 </div>
 
+
index f2c7466..15ef4a4 100644 (file)
@@ -46,6 +46,8 @@
 
        <div id='myopac_renew_success' class='hide_me'>Item successfully renewed</div>
 
+       <span class='hide_me' id='myopac_renew_confirm'>Are you sure you wish to renew this item?</span>
+
 </div>
 
 
index 319a235..248e4a8 100644 (file)
@@ -1,7 +1,7 @@
 
 <div id='myopac_prefs_div' xmlns:xi="http://www.w3.org/2001/XInclude" >
 
-       <table width='100%' class='data_grid'>
+       <table width='100%' class='data_grid' style='margin-top: 20px;'>
 
                <br/>
                <thead>
                                </td>
                        </tr>
 
+                       <tr><td colspan='2'><br/></td></tr>
+
                        <tr>
-                               <td align='middle' colspan='2'>
+                               <td align='center' class='color_3' colspan='2'>
                                        <button onclick='myOPACSavePrefs();' 
-                                               id='myopac_prefs_submit'>Save Changes</button>
+                                               id='myopac_prefs_submit'>Save Preference Changes</button>
                                </td>
                        </tr>
 
+                       <!--
                        <tr>
                                <td colspan='2' align='center'><br/><b> * More To Come...</b></td>
                        </tr>
+                       -->
 
                </tbody>
        </table>