added more edit widgets to circ-mod grid. moved from permacruc to pcrud for read...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Dec 2008 21:26:03 +0000 (21:26 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 18 Dec 2008 21:26:03 +0000 (21:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11621 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
Open-ILS/web/js/ui/default/conify/global/config/standing_penalty.js
Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js
Open-ILS/web/js/ui/default/conify/global/permission/grp_penalty_threshold.js
Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2

index cb9881d..a9acefc 100644 (file)
@@ -13,7 +13,7 @@ function buildCMGrid() {
     dojo.connect(store, 'onSet', cmGridChanged);
 
     fieldmapper.standardRequest(
-        ['open-ils.permacrud', 'open-ils.permacrud.search.ccm'],
+        ['open-ils.pcrud', 'open-ils.pcrud.search.ccm'],
         {   async: true,
             params: [openils.User.authtoken, {code:{'!=':null}}],
             onresponse: function (r) { 
@@ -39,12 +39,13 @@ function saveChanges() {
     /* loop through the changed objects in cmCache and update them in the DB */
 }
 
-function getMagneticMedia(rowIdx, item) {
-    if(!item) return '';
-    var magMed = this.grid.store.getValue(item, this.field);
-    if(openils.Util.isTrue(magMed))
-        return "<span style='color:green;'>&#x2713;</span>";
-    return "<span style='color:red;'>&#x2717;</span>";
+function formatMagneticMedia(inDatum) {
+    switch (inDatum) {
+        case 't':
+            return "<span style='color:green;'>&#x2713;</span>";
+        case 'f':
+            return "<span style='color:red;'>&#x2717;</span>";
+    }
 }
 
 function cmCreate(args) {
index 07aac2b..ddeb67c 100644 (file)
@@ -8,7 +8,7 @@ function spBuildGrid() {
     spGrid.setStore(store);
     spGrid.render();
     fieldmapper.standardRequest(
-        ['open-ils.permacrud', 'open-ils.permacrud.search.csp'],
+        ['open-ils.pcrud', 'open-ils.pcrud.search.csp'],
         {   async: true,
             params: [openils.User.authtoken, {id:{'!=':null}}, {order_by:{csp:'id'}}],
             onresponse: function(r) {
index 9e323ed..79622f0 100644 (file)
@@ -9,7 +9,7 @@ var zsList;
 
 function buildZSGrid() {
     fieldmapper.standardRequest(
-        ['open-ils.permacrud', 'open-ils.permacrud.search.czs.atomic'],
+        ['open-ils.pcrud', 'open-ils.pcrud.search.czs.atomic'],
         {   async: true,
             params: [openils.User.authtoken, {name:{'!=':null}}],
             oncomplete: function(r) {
index cd5a1c3..12b2e5e 100644 (file)
@@ -90,7 +90,7 @@ var GPT = {
     loadCsp : function(onload) {
         GPT.penaltyMap = {};
         fieldmapper.standardRequest(
-            ['open-ils.permacrud', 'open-ils.permacrud.search.csp.atomic'],
+            ['open-ils.pcrud', 'open-ils.pcrud.search.csp.atomic'],
             {   async: true,
                 params: [openils.User.authtoken, {id:{'<':100}}],
                 oncomplete: function(r) {
index 0f142d5..b3eaebf 100644 (file)
     <button dojoType='dijit.form.Button' onclick='deleteFromGrid();'>Delete Selected</button>
     <button dojoType='dijit.form.Button' onclick='saveChanges();' disabled='disabled' jsId='cmSaveButton'>Save Changes</button>
 
+    <script type ="text/javascript">
+        function formatSIPMediaType(inDatum) {
+            switch (inDatum) {
+                case '000':
+                    return 'Other';
+                case '001':
+                    return 'Book';
+                case '002':
+                    return 'Magazine';
+                case '003':
+                    return 'Bound Journal';
+                case '004':
+                    return 'Audio Tape';
+                case '005':
+                    return 'Video Tape';
+                case '006':
+                    return 'CD/CDROM';
+                case '007':
+                    return 'Diskette';
+                case '008':
+                    return 'Book with diskette';
+                case '009':
+                    return 'Book with CD';
+                case '010':
+                    return 'Book with audio tape';
+            }
+        }   
+    </script>
     <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
         <table jsId="cmGrid" dojoType="dojox.grid.DataGrid" query="{name: '*'}" rowSelector='20px'>
             <thead>
                     <th field="name" width='auto' editable='true' 
                         cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox'>Name</th>
                     <th field="description" width='auto'>Description</th>
-                    <th field="sip2_media_type" width='auto'>SIP2 Media Type</th>
-                    <th field="magnetic_media" width='auto' get='getMagneticMedia'>Magnetic Media</th>
+                    <th field="sip2_media_type" width='auto' editable='true' 
+                        cellType='dojox.grid.cells.Select' 
+                        options='Other,Book,Magazine,Bound Journal,Audio Tape,Video Tape,CD/CDROM,Diskette,Book with Diskette,Book with CD,Book with Audio Tape' 
+                        values='000,001,002,003,004,005,006,007,008,009,010' 
+                        formatter='formatSIPMediaType'>SIP2 Media Type</th>
+                    <th field="magnetic_media" editable='true' cellType='dojox.grid.cells.Select' 
+                        options='No,Yes' values='f,t' formatter='formatMagneticMedia'>Magnetic Media</th>
                 </tr>
             </thead>
         </table>    
     </div>
 </div>
+
 [% END %]