[open-ils-commits] r17388 - in branches/rel_2_0/Open-ILS: examples web/js/ui/default/conify/global/asset web/opac/locale/en-US web/templates/default/conify/global/asset xul/staff_client/chrome/content/main (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 30 13:03:55 EDT 2010


Author: senator
Date: 2010-08-30 13:03:51 -0400 (Mon, 30 Aug 2010)
New Revision: 17388

Added:
   branches/rel_2_0/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js
   branches/rel_2_0/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2
Modified:
   branches/rel_2_0/Open-ILS/examples/fm_IDL.xml
   branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Log:
Backport r17387, basic copy template editor


Modified: branches/rel_2_0/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/rel_2_0/Open-ILS/examples/fm_IDL.xml	2010-08-30 17:02:22 UTC (rev 17387)
+++ branches/rel_2_0/Open-ILS/examples/fm_IDL.xml	2010-08-30 17:03:51 UTC (rev 17388)
@@ -4404,7 +4404,7 @@
 
 	<class id="act" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_template" oils_persist:tablename="asset.copy_template" reporter:label="Asset Copy Template">
 		<fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
-			<field reporter:label="ID" name="id" reporter:datatype="id"/>
+			<field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
 			<field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
 			<field reporter:label="Creator" name="creator" reporter:datatype="link"/>
 			<field reporter:label="Editor" name="editor" reporter:datatype="link"/>

Added: branches/rel_2_0/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js	                        (rev 0)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/conify/global/asset/copy_template.js	2010-08-30 17:03:51 UTC (rev 17388)
@@ -0,0 +1,60 @@
+dojo.require("dojo.data.ItemFileWriteStore");
+dojo.require("dijit.form.CurrencyTextBox");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require("openils.widget.AutoGrid");
+dojo.require("openils.PermaCrud");
+dojo.require("openils.widget.OrgUnitFilteringSelect");
+
+var pcrud;
+var actOwner;
+var actList;
+
+function actInit() {
+    pcrud = new openils.PermaCrud();
+
+    new openils.User().buildPermOrgSelector(
+        "ADMIN_ASSET_COPY_TEMPLATE",
+        actOwnerSelect,
+        null,
+        function() {
+            dojo.connect(
+                actOwnerSelect,
+                "onChange",
+                function() {
+                    actOwner = fieldmapper.aou.findOrgUnit(this.attr("value"));
+                    actGrid.resetStore();
+                    buildActGrid();
+                }
+            );
+            buildActGrid();
+        }
+    );
+}
+
+function buildActGrid() {
+    if (!actOwner)
+        actOwner = fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou());
+
+    pcrud.search(
+        "act", {
+            "owning_lib": fieldmapper.aou.orgNodeTrail(actOwner, true /* asId */)
+        }, {
+            "async": true,
+            "onresponse": function(r) {
+                if ((actList = openils.Util.readResponse(r))) {
+                    actList = openils.Util.objectSort(actList);
+                    actList.forEach(
+                        function(o) {
+                            actGrid.store.newItem(act.toStoreItem(o));
+                        }
+                    );
+                }
+            },
+            "oncomplete": function() {
+                actGrid.hideLoadProgressIndicator();
+            }
+        }
+    );
+}
+
+openils.Util.addOnLoad(actInit);

Modified: branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-30 17:02:22 UTC (rev 17387)
+++ branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-30 17:03:51 UTC (rev 17388)
@@ -682,6 +682,8 @@
 <!ENTITY staff.main.menu.admin.local_admin.hold_matrix_matchpoint.label "Hold Policies">
 <!ENTITY staff.main.menu.admin.local_admin.work_log.label "Work Log">
 <!ENTITY staff.main.menu.admin.local_admin.work_log.accesskey "W">
+<!ENTITY staff.main.menu.admin.local_admin.copy_template.label "Copy Template Editor">
+<!ENTITY staff.main.menu.admin.local_admin.copy_template.accesskey "T">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.label "Patrons with Negative Balances">
 <!ENTITY staff.main.menu.admin.local_admin.patrons_due_refunds.accesskey "N">
 

Added: branches/rel_2_0/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2	                        (rev 0)
+++ branches/rel_2_0/Open-ILS/web/templates/default/conify/global/asset/copy_template.tt2	2010-08-30 17:03:51 UTC (rev 17388)
@@ -0,0 +1,33 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_title = "Copy Templates" %]
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/conify/global/asset/copy_template.js"> </script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane"
+         layoutAlign="top" class="oils-header-panel">
+        <div>Copy Templates</div>
+        <div>
+            <button dojoType="dijit.form.Button"
+                onClick="actGrid.showCreateDialog()">New Copy Template</button>
+            <button dojoType="dijit.form.Button"
+                onClick="actGrid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <div class="oils-acq-basic-roomy">
+        <span>Show templates available at or above</span>
+        <select
+            dojoType="openils.widget.OrgUnitFilteringSelect"
+            jsId="actOwnerSelect"
+            searchAttr="shortname" labelAttr="shortname">
+        </select>
+    </div>
+    <table jsId="actGrid"
+        dojoType="openils.widget.AutoGrid"
+        fieldOrder="['name', 'owning_lib']"
+        suppressFields="['creator','editor','edit_date', 'create_date']"
+        query="{id: '*'}"
+        fmClass="act"
+        autoHeight="true"
+        editOnEnter="true">
+    </table>
+</div>
+[% END %]

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-08-30 17:02:22 UTC (rev 17387)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu.js	2010-08-30 17:03:51 UTC (rev 17388)
@@ -655,6 +655,12 @@
                     );
                 }
             ],
+            "cmd_local_admin_copy_template": [
+                ["oncommand"],
+                function() {
+                    open_eg_web_page("conify/global/asset/copy_template");
+                }
+            ],
             'cmd_local_admin_patrons_due_refunds' : [
                 ['oncommand'],
                 function() {

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul	2010-08-30 17:02:22 UTC (rev 17387)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul	2010-08-30 17:03:51 UTC (rev 17388)
@@ -126,6 +126,7 @@
     <command id="cmd_local_admin_hold_matrix_matchpoint"/>
     <command id="cmd_local_admin_work_log"/>
     <command id="cmd_local_admin_patrons_due_refunds"/>
+    <command id="cmd_local_admin_copy_template"/>
 
     <!-- server admin menu commands -->
     <command id="cmd_server_admin_org_type"/>
@@ -365,6 +366,7 @@
                 <menuitem label="&staff.main.menu.admin.local_admin.conify.survey.label;" command="cmd_local_admin_survey"/>
                 <menuitem label="&staff.server.admin.index.transit_list;" command="cmd_local_admin_transit_list"/>
                 <menuitem label="&staff.main.menu.admin.local_admin.work_log.label;" accesskey="&staff.main.menu.admin.local_admin.work_log.accesskey;" command="cmd_local_admin_work_log"/>
+                <menuitem label="&staff.main.menu.admin.local_admin.copy_template.label;" accesskey="&staff.main.menu.admin.local_admin.copy_template.accesskey;" command="cmd_local_admin_copy_template"/>
             </menupopup>
         </menu>
         <menu id="main.menu.admin.server" label="&staff.main.menu.admin.server_admin.label;">



More information about the open-ils-commits mailing list