Make a translate button available in the name column of copy locations editor
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Jul 2010 19:24:28 +0000 (19:24 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 12 Jul 2010 19:24:28 +0000 (19:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16913 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/CopyLocations.pm
Open-ILS/xul/staff_client/server/admin/copy_locations.js
Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml

index 8172d44..0ebe1c7 100644 (file)
@@ -14,7 +14,7 @@ my $U = "OpenILS::Application::AppUtils";
 __PACKAGE__->register_method(
        api_name                => "open-ils.circ.copy_location.retrieve.all",
        method          => 'cl_retrieve_all',
-       argc                    =>      1,
+       argc                    =>      2,
        signature       => q/
                Retrieves the ranged set of copy locations for the requested org.
                If no org is provided, all copy locations are returned
@@ -24,16 +24,16 @@ __PACKAGE__->register_method(
                /);
 
 sub cl_retrieve_all {
-       my( $self, $client, $org_id ) = @_;
+       my( $self, $client, $org_id, $no_i18n ) = @_;
 
        if(!$org_id) {
                my $otree = $U->get_org_tree();
                $org_id = $otree->id;
        }
 
-    return new_editor()->search_asset_copy_location({
+    return new_editor()->search_asset_copy_location([{
         owning_lib => $U->get_org_full_path($org_id)
-    });
+    }, {"no_i18n" => scalar($no_i18n)}]);
 }
 
 __PACKAGE__->register_method(
index 253942f..51e5da0 100644 (file)
@@ -49,7 +49,7 @@ function clGo() {
 
 function clGo2() {    
     locationSet = {};
-    var req = new Request(RETRIEVE_CL, focusOrg);
+    var req = new Request(RETRIEVE_CL, focusOrg, true /* no i18n */);
     req.request._last = true;
     req.callback(clAppendLocation);
     req.send();
@@ -165,6 +165,15 @@ function clBuildRow( tbody, row, cl ) {
     edit.onclick = function() { clEdit( cl, tbody, row ); };
     checkPermOrgDisabled(edit, cl.owning_lib(), 'UPDATE_COPY_LOCATION');
 
+    if (!window._cl_per_row)
+        window._cl_per_row = [];
+    window._cl_per_row.push(cl);
+    new openils.widget.TranslatorPopup({
+        "targetObject":
+            "window._cl_per_row[" + (window._cl_per_row.length - 1) + "]",
+        "field": "name"
+    }, $n(row, "cl_xlate_popup"));
+
     var del = $n( row, 'cl_delete' );
     del.onclick = function() { clDelete( cl, tbody, row ); };
     checkPermOrgDisabled(del, cl.owning_lib(), 'DELETE_COPY_LOCATION');
index 7be5e24..b1f5906 100644 (file)
 
     <head>
         <title>&staff.server.admin.copy_locations.title;</title>
+        <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">
+            dojo.require("fieldmapper.AutoIDL");
+            dojo.require("openils.widget.TranslatorPopup");
+        </script>
         <script language='javascript' src='/opac/common/js/utils.js'> </script>
         <script language='javascript' src='/opac/common/js//config.js'> </script>
         <script language='javascript' src='/opac/common/js/CGI.js'> </script>
         <script language='javascript' src='/opac/common/js/Cookie.js'> </script>
     
         <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
-        <script language='javascript' src='/opac/common/js/fmall.js'> </script>
-        <script language='javascript' src='/opac/common/js/fmgen.js'> </script>
         <script language='javascript' src='/opac/common/js/Cookies.js'> </script>
         <script language='javascript' src='/opac/common/js/opac_utils.js'> </script>
         <script language='javascript' src='/opac/common/js/<!--#echo var="locale"-->/OrgTree.js'> </script>
                 </thead>
                 <tbody id='cl_tbody'>
                     <tr id='cl_row'>
-                        <td name='cl_name'> </td>
+                        <td>
+                            <span name='cl_name'></span>
+                            <span name="cl_xlate_popup"></span>
+                        </td>
                         <td name='cl_owner'> </td>
                         <td name='cl_holdable'> </td>
                         <td name='cl_hold_verify'> </td>