[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. fa3cd5cc70598a6a749c8b51003088a4b10442c8

Evergreen Git git at git.evergreen-ils.org
Fri Oct 5 17:21:47 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_2 has been updated
       via  fa3cd5cc70598a6a749c8b51003088a4b10442c8 (commit)
      from  22fcbd3497069230a49d339e720b2c882d6dd585 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fa3cd5cc70598a6a749c8b51003088a4b10442c8
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Aug 6 15:18:35 2018 -0400

    LP#1785681 Patron address copy to clipboard
    
    Support copying formatted addresses to the clipboard in the browser
    staff client, similar to the XUL client.  Action is performed via a new
    link in the addresses section (next to "print") in the patron summary
    sidebar.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Garry Collum <gcollum at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
index c89a007..6b16b66 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
@@ -181,12 +181,26 @@
         <fieldset>
           <legend ng-class="{'patron-summary-alert': addr.valid() == 'f'}">
             {{addr.address_type()}} 
-            <a href class="pad-horiz patron-summary-act-link" 
-              ng-click="print_address(addr)">[% l('(print)') %]</a>
+            (<a href class="patron-summary-act-link" 
+                ng-click="copy_address(addr)">[%- l('copy') -%]</a><a 
+                href class="patron-summary-act-link" 
+                ng-click="print_address(addr)">[%- l('/print') -%]</a>)
           </legend>
           <div>{{addr.street1()}} {{addr.street2()}}</div>
           <div>{{addr.city()}}, {{addr.state()}} {{addr.post_code()}}</div>
         </fieldset>
+        <textarea id="patron-address-copy-{{addr.id()}}" rows="2" 
+          style="visibility:hidden">[%- l(
+            '[_1] [_2] [_3]
[_4] [_5]
[_6], [_7] [_8]', 
+            '{{patron().first_given_name()}}',
+            '{{patron().second_given_name()}}',
+            '{{patron().family_name()}}',
+            '{{addr.street1()}}',
+            '{{addr.street2()}}',
+            '{{addr.city()}}',
+            '{{addr.state()}}',
+            '{{addr.post_code()}}') 
+          -%]</textarea>
       </div>
     </div>
   </div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
index d37ed64..d007257 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
@@ -339,6 +339,24 @@ function($scope,  $q , $location , $filter , egCore , egNet , egUser , egAlertDi
         });
     }
 
+    $scope.copy_address = function(addr) {
+        // Alas, navigator.clipboard is not yet supported in FF and others.
+        var lNode = document.querySelector('#patron-address-copy-' + addr.id());
+
+        // Un-hide the textarea just long enough to copy its data.
+        // Using node.style instead of ng-show/ng-hide in hopes it 
+        // will be quicker, so the user never sees the textarea.
+        lNode.style.visibility = 'visible';
+        lNode.focus();
+        lNode.select();
+
+        if (!document.execCommand('copy')) {
+            console.error('Copy command failed');
+        }
+
+        lNode.style.visibility = 'hidden';
+    }
+
     $scope.toggle_expand_summary = function() {
         if ($scope.collapsePatronSummary) {
             $scope.collapsePatronSummary = false;

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/staff/circ/patron/t_summary.tt2  |   18 ++++++++++++++++--
 .../web/js/ui/default/staff/circ/patron/app.js     |   18 ++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list