From: Kyle Huckins Date: Wed, 30 Nov 2016 18:10:48 +0000 (-0800) Subject: LP#1511358 Patron Survey Interface X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=e2ee72f29c097ba64f68ed5134b266acf9b723a8 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 Signed-off-by: Terran McCanna Signed-off-by: Kathy Lussier --- 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) {
  • + + [% l('Surveys') %] + +
  • +
  • [% l('Group Member Details') %] 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 @@ +
    [% l('Surveys') %]
    +
    +
    +
    +
    [% l('Survey') %] #{{survey.id()}}
    +
    {{survey.description()}}
    +
    +
    + [% l('Required') %] + [% l('OPAC Visible') %] +
    +
    +
    +
    +
    +
      +
    1. {{question.question()}} +
      + [% l('Last Answered on: ') %]{{response.answer_date() | date}} + [% l('Answer: ') %] {{response.answer().answer()}} +
      +
    2. +
    +
    +
    +
    +
    \ 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) {