[open-ils-commits] [GIT] Evergreen ILS branch master updated. e2ee72f29c097ba64f68ed5134b266acf9b723a8

Evergreen Git git at git.evergreen-ils.org
Thu Mar 2 22:01:11 EST 2017


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, master has been updated
       via  e2ee72f29c097ba64f68ed5134b266acf9b723a8 (commit)
      from  68716e678b057e1b8f8334070420ec3d725ce885 (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 e2ee72f29c097ba64f68ed5134b266acf9b723a8
Author: Kyle Huckins <khuckins at catalystdevworks.com>
Date:   Wed Nov 30 10:10:48 2016 -0800

    LP#1511358 Patron Survey Interface
    
    Add patron survey interface and link to interface
    in "Other" dropdown beneath Statistical Categories.
    
    Display surveys similarly to how notes are displayed,
    as well as how surveys are displayed in the existing
    XUL staff client.
    
    Signed-off-by: Kyle Huckins <khuckins at catalystdevworks.com>
    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2
index 7e16ec4..c1b8196 100644
--- a/Open-ILS/src/templates/staff/circ/patron/index.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2
@@ -158,6 +158,11 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
             </a>
           </li>
           <li>
+            <a href="./circ/patron/{{patron().id()}}/surveys">
+              [% l('Surveys') %]
+            </a>
+          </li>
+          <li>
             <a href="./circ/patron/{{patron().id()}}/group">
               [% l('Group Member Details') %]
             </a>
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_surveys.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_surveys.tt2
new file mode 100644
index 0000000..bd059b8
--- /dev/null
+++ b/Open-ILS/src/templates/staff/circ/patron/t_surveys.tt2
@@ -0,0 +1,27 @@
+<div class="strong-text-2">[% l('Surveys') %]</div>
+<div class="row pad-vert" ng-repeat="survey in surveys">
+  <div class="col-md-12">
+    <div class="row">
+      <div class="col-md-2 strong-text">[% l('Survey') %] #{{survey.id()}}</div>
+      <div class="col-md-6 strong-text">{{survey.description()}}</div>
+      <div class="col-md-4">
+        <div class="pull-right">
+          <span class="pad-horiz alert alert-warning strong-text" ng-if="survey.required() == 't'">[% l('Required') %]</span>
+          <span class="pad-horiz  alert alert-info strong-text " ng-if="survey.opac() == 't'">[% l('OPAC Visible') %]</span>
+        </div>
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-md-12 well" style="margin-left:12px">
+        <ol>
+          <li ng-repeat="question in survey.questions()">{{question.question()}}
+            <div class="row" ng-repeat="response in question.responses() | limitTo:-1">
+              <span class="col-md-4">[% l('Last Answered on: ') %]{{response.answer_date() | date}}</span>
+              <span class="col-md-3">[% l('Answer: ') %] <span class="strong-text">{{response.answer().answer()}}</span></span>
+          </div>
+          </li>
+        </ol>
+      </div>
+    </div>
+  </div>
+</div>
\ No newline at end of file
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 1dc380f..e075c4f 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
@@ -214,6 +214,12 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap',
         resolve : resolver
     });
 
+    $routeProvider.when('/circ/patron/:id/surveys', {
+        templateUrl: './circ/patron/t_surveys',
+        controller: 'PatronSurveyCtrl',
+        resolve : resolver
+    });
+
     $routeProvider.otherwise({redirectTo : '/circ/patron/search'});
 })
 
@@ -1633,6 +1639,33 @@ function($scope,  $routeParams , $q , egCore , patronSvc) {
     });
 }])
 
+.controller('PatronSurveyCtrl',
+       ['$scope','$routeParams','$location','egCore','patronSvc',
+function($scope,  $routeParams , $location , egCore , patronSvc) {
+    $scope.initTab('other', $routeParams.id);
+    var usr_id = $routeParams.id;
+    var org_ids = egCore.org.fullPath(egCore.auth.user().ws_ou(), true);
+    $scope.surveys = [];
+    // fetch the surveys
+    egCore.pcrud.search('asvr',
+        {usr : usr_id},
+        {flesh : 4, flesh_fields : {
+            asvr : ['question', 'survey', 'answer'],
+            asv : ['responses', 'questions'],
+            asvq : ['responses', 'question']
+    }},
+        {authoritative : true})
+    .then(null, null, function(survey) {
+        var sameSurveyId = false;
+        if (survey.survey().id() && $scope.surveys.length > 0) {
+            for (sid = 0; sid < $scope.surveys.length; sid++) {
+                if (survey.survey().id() == $scope.surveys[sid].id()) sameSurveyId = true; 
+            }
+        }
+        if (!sameSurveyId) $scope.surveys.push(survey.survey());
+    });
+}])
+
 .controller('PatronFetchLastCtrl',
        ['$scope','$location','egCore',
 function($scope , $location , egCore) {

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

Summary of changes:
 Open-ILS/src/templates/staff/circ/patron/index.tt2 |    5 +++
 .../src/templates/staff/circ/patron/t_surveys.tt2  |   27 ++++++++++++++++
 .../web/js/ui/default/staff/circ/patron/app.js     |   33 ++++++++++++++++++++
 3 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_surveys.tt2


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list