]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/conify/global/config/sms_carrier.js
SMS texting
[Evergreen.git] / Open-ILS / web / js / ui / default / conify / global / config / sms_carrier.js
1 dojo.require('dojox.grid.DataGrid');
2 dojo.require('openils.widget.AutoGrid');
3 dojo.require('dojox.grid.cells.dijit');
4 dojo.require('dojo.data.ItemFileWriteStore');
5 dojo.require('dijit.Dialog');
6 dojo.require('openils.PermaCrud');
7
8 var thingList;
9
10 function thingInit() {
11
12     thingGrid.disableSelectorForRow = function(rowIdx) {
13         var item = thingGrid.getItem(rowIdx);
14         return (thingGrid.store.getValue(item, 'id') < 0);
15     }
16
17     buildGrid();
18 }
19
20 function buildGrid() {
21
22     fieldmapper.standardRequest(
23         ['open-ils.pcrud', 'open-ils.pcrud.search.csc.atomic'],
24         {   async: true,
25             params: [
26                 openils.User.authtoken,
27                 {"id":{"!=":null}},
28                 {"order_by":{"csc":"name"}}
29             ],
30             oncomplete: function(r) {
31                 if(thingList = openils.Util.readResponse(r)) {
32                     thingList = openils.Util.objectSort(thingList,'name');
33                     dojo.forEach(thingList,
34                                  function(e) {
35                                      thingGrid.store.newItem(csc.toStoreItem(e));
36                                  }
37                                 );
38                 }
39             }
40         }
41     );
42 }
43
44 openils.Util.addOnLoad(thingInit);
45
46