Working on Asset Call Number Class, doesn't fully work yet though :)
authorJoseph Lewis <joehms22@gmail.com>
Sat, 28 May 2011 04:53:34 +0000 (22:53 -0600)
committerJoseph Lewis <joehms22@gmail.com>
Sat, 28 May 2011 04:53:34 +0000 (22:53 -0600)
Open-ILS/xul/staff_client/server/admin/asset_call_number.html
Open-ILS/xul/staff_client/server/admin/asset_call_number.js

index 403155e..b01a5e5 100644 (file)
@@ -1,9 +1,4 @@
 <?xml version='1.0' encoding="UTF-8"?>
-
-<!--
-This file is to aid in editing of the asset_call_number_class.
--->
-
 <!DOCTYPE html PUBLIC 
     "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
@@ -11,61 +6,51 @@ This file is to aid in editing of the asset_call_number_class.
 ]>
 
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
-
+<!-- This file is to aid in editing of the asset_call_number_class. -->
     <head>
-        <title>&staff.server.admin.asset_call_number.title;</title>
-        <script type='text/javascript' src='/opac/common/js/utils.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/config.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/CGI.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/JSON_v1.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/fmall.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/fmgen.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/opac_utils.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/<!--#echo var="locale"-->/OrgTree.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/org_utils.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/init.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/RemoteRequest.js'> </script>
-        <script type='text/javascript' src='/opac/common/js/Date.W3CDTF.js'> </script>
-        <script type='text/javascript' src='adminlib.js'> </script>
-        <script type='text/javascript' src='asset_call_number.js'> </script>
-
-        <link rel="stylesheet" type="text/css" media="all" 
-            href="/opac/common/js/jscalendar/calendar-brown.css" title="win2k-cold-1" />
-        <script type="text/javascript" src="/opac/common/js/jscalendar/calendar.js"></script>
-        <script type="text/javascript" src="/opac/common/js/jscalendar/lang/calendar-en.js"></script>
-        <script type="text/javascript" src="/opac/common/js/jscalendar/calendar-setup.js"></script>
-
+        <title>Asset Call Number Editor (Not Translated)</title>
         <link type='text/css' rel='stylesheet' href='admin.css'/>
+
+        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
+        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/openils_dojo.js"></script>
+        <script type='text/javascript' src='asset_call_number.js'> </script>
+        
+        <style>
+        .desc {
+                       font-weight:normal;
+                       vertical-align:top;
+                       text-align:left;
+               }
+        </style>
     </head>
     
-    <body onLoad="init_asset_call();">
+    <body onload="init_asset_call();">
         <h1 align="center">Classification System Editor</h1>
-        <hr>
+        <hr />
         <table>
             <tr>
                 <td>
-                    <!-- TODO Dynamic Load -->
-                    <select name="call_class" size="20" onchange="select_asset_call_class(this.selectedIndex, this.options[this.selectedIndex].value);">
-                        <option selected>Generic</option>
-                        <option>Library of Congress (LC)</option>
-                        <option>Dewey (DDC)</option>
+                    <select id="accselect" size="20" onchange="select_asset_call_class(this.selectedIndex, this.options[this.selectedIndex].value);">
                     </select>
                 </td>
                 <td valign="top">
                     <table valign="top">
                         <tr>
-                            <td colspan="3">
-                                <input id="class_name" type="text" size="22" value="Generic" style="font-weight:thick; font-size:20pt;"  />
+                                                       <td class="desc">Name:</td>
+                            <td>
+                            <input id="nameInput" type="text" size="22" value="Generic" />
                             </td>
+                            <td></td>
+                                
                         </tr>
             <tr>
-                <td align="right"><b>Normalizer:</b> </td>
-                <td><select size="0"><option>asset.label_normalizer_generic</option></select><br></td>
+                <td class="desc">Normalizer:</td>
+                <td><select size="0"><option>asset.label_normalizer_generic</option></select><br /></td>
                 <td></td>
             </tr>
             <tr>
-                <td align="right" valign="top"><b>Tag/Subfields:</b></td>
-                <td>
+                <td class="desc">Tag/Subfields:</td>
+                <td id="inputArea">
                 <input type="text" value="050ab" /><br />
                 <input type="text" value="055ab" /><br />
                 <input type="text" value="060ab" /><br />
@@ -76,7 +61,7 @@ This file is to aid in editing of the asset_call_number_class.
                 <input type="text" value="088ab" /><br />
                 <input type="submit" value="Add" />
                 </td>
-                <td><p style="display:block; background-color:#999;"><b>Context help (probably a bubble):</b><br>To delete an entry remove all text from the box and press enter.</p></td>
+                <td></td>
             </tr>
             <tr>
                 <td></td>
@@ -84,10 +69,10 @@ This file is to aid in editing of the asset_call_number_class.
             </tr>
             </table>
 
-            <br>
+            <br />
 
             </td>
             </tr>
             </table>
     </body>
-</html>
\ No newline at end of file
+</html>
index a5de57d..46d69dc 100644 (file)
@@ -1,28 +1,51 @@
-/**
-    <class id="call_num_class" controller="open-ils.cstore" oils_obj:fieldmapper="asset::call_number_class" oils_persist:readonly="true">
-        <oils_persist:source_definition>
-            SELECT * FROM  asset.call_number_class;
-        </oils_persist:source_definition>
-        <fields>
-            <field reporter:label="Asset ID" name="id" reporter:datatype="int"/>
-            <field reporter:label="Name" name="name" reporter:datatype="text"/>
-            <field reporter:label="Normalizer" name="normalizer" reporter:datatype="text"/>
-            <field reporter:label="Field" name="field" reporter:datatype="text"/>
-        </fields>
-        <links />
-    </class>
-**/
-
+dojo.require('fieldmapper.AutoIDL');
+dojo.require("fieldmapper.Fieldmapper");
+dojo.require("fieldmapper.dojoData");
+dojo.require("fieldmapper.OrgUtils");
+dojo.require('dojo.cookie');
+dojo.require('openils.CGI');
+dojo.require('openils.User');
+dojo.require('openils.Event');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.AutoFieldWidget');
+dojo.require('openils.widget.ProgressDialog');
+dojo.require('openils.CGI')
+dojo.require('openils.PermaCrud');
 
 var numItems = 0;
+var authtoken;
+var user;
+var classifications;
+
+var normalizers = ['asset.label_normalizer']; //A list of normalizers for now...
 
-var normalizers = ['asset.label_normalizer']
+// Document elements, there must be a better way like JQuery...
+var accselect;
+var nameInput;
 
 function init_asset_call() {
-    //TODO fetch lists.
+    
+    authtoken = new openils.CGI().param('ses') || dojo.cookie('ses');
+       classifications = new openils.PermaCrud({authtoken:authtoken}).retrieveAll('acnc');
+    
+    // Get names of all elements.
+    accselect = document.getElementById('accselect');
+    nameInput = document.getElementById('nameInput');
+    
+    for(i in classifications) {
+               var tmp = document.createElement('option');
+               tmp.text = classifications[i].name();
+               accselect.add(tmp, null);
+       }
+
     
     //TODO fetch normalizers.
     
+    
+    for( norm in normalizers ) {
+        alert(normalizers[norm]);
+    }
+    
     //Populate listbox.
     
     //Populate namefield.
@@ -38,4 +61,4 @@ function select_asset_call_class(selection_index, selection_name) {
 
 function update_normalizer_list() {
     //TODO fetch lists, and update with current 
-}
\ No newline at end of file
+}