From: Victoria Lewis Date: Wed, 19 Aug 2015 17:03:30 +0000 (-0700) Subject: LP1437112 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=88ecde1bc3cf15a55bb5462b3d8bd468ebcbd4c7;p=working%2FEvergreen.git LP1437112 Preparing to branch off of user/vlewis/lp1437122-not_possible_to_set_workstation_preferences Signed-off-by: Victoria Lewis modified: ../../../../../../src/templates/opac/parts/org_selector.tt2 modified: ../../../../../../src/templates/staff/admin/workstation/index.tt2 new file: ../../../../../../src/templates/staff/admin/workstation/t_search_prefs.tt2 modified: ../../../../../../src/templates/staff/admin/workstation/t_splash.tt2 modified: ../admin/workstation/app.js --- diff --git a/Open-ILS/src/templates/opac/parts/org_selector.tt2 b/Open-ILS/src/templates/opac/parts/org_selector.tt2 index ab4d7c91f0..433ac80138 100644 --- a/Open-ILS/src/templates/opac/parts/org_selector.tt2 +++ b/Open-ILS/src/templates/opac/parts/org_selector.tt2 @@ -12,13 +12,13 @@ PROCESS get_library; BLOCK build_org_selector; node_stack = [{org => org_unit || ctx.aouct_tree || ctx.aou_tree}]; - inherited_vis = ctx.get_cgf('opac.org_unit.non_inherited_visibility').enabled == 'f'; + inherited_vis = ctx.get_cgf('opac.org_unit.non_inherited_visibility').enabled == 'f'; #get configuration 'opac.org_unit's option for non-inherited visibility and disable it(f) IF !name; - name = loc_name; + name = loc_name; #If name doesn't exist, set it to loc_name - Defined in misc_util.tt2 get_library END; IF !value; - value = loc_value; + value = loc_value;#If value doesn't exist, set it to loc_value - Defined in misc_util.tt2 get_library END; # if the selected org unit is out of hiding scope, @@ -32,14 +32,14 @@ BLOCK build_org_selector; name='[% name %]'> [%- WHILE node_stack.size > 0; - node = node_stack.pop(); - org_unit = node.org; - loc_grp = node.loc_grp; - ou_id = org_unit.id; + node = node_stack.pop(); #node becomes the popped node stack + org_unit = node.org; #org_unit becomes node's org + loc_grp = node.loc_grp; #loc_grp(location) becomes the node_stack's array? + ou_id = org_unit.id; #ou_id shorthand for org_unit.id css_class = ''; - disabled = ''; + disabled = ''; #clear css_class, disabled, and selected selected = ''; - visible = org_unit.opac_visible == 't'; + visible = org_unit.opac_visible == 't'; #enable visibility for org_unit's opac_visible option # org and all children are invisible. NEXT IF !visible AND inherited_vis AND !ctx.is_staff; @@ -59,6 +59,7 @@ BLOCK build_org_selector; END; # add the child org units + # Allows child org_units to be displayed FOR child IN org_unit.children.reverse; node_stack.push({org => child}); END; @@ -116,17 +117,19 @@ BLOCK build_org_selector; SET pad_depth = pad_depth + 1 IF loc_grp; # determine the depth by calculating the distance from the root + # This gives the Search Library dropdown its child-parent padding porg = ctx.get_aou(org_unit.parent_ou); WHILE porg; SET pad_depth = pad_depth + 1 IF porg.opac_visible == 't' OR ctx.is_staff; porg = ctx.get_aou(porg.parent_ou); END; - + pad_depth = pad_depth * 2; - display_name = loc_grp ? loc_grp.name : org_unit.name %] + display_name = loc_grp ? loc_grp.name : org_unit.name #If there is a loc_grp, use loc_grp.name. Otherwise use org_unit.name? + %] [%- END %] diff --git a/Open-ILS/src/templates/staff/admin/workstation/index.tt2 b/Open-ILS/src/templates/staff/admin/workstation/index.tt2 index 3f927a4445..6ed2561078 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/index.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/index.tt2 @@ -22,3 +22,7 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
[% END %] + + + + diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2 new file mode 100644 index 0000000000..9f1288c8b5 --- /dev/null +++ b/Open-ILS/src/templates/staff/admin/workstation/t_search_prefs.tt2 @@ -0,0 +1,127 @@ +[% PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/org_selector.tt2"; + WRAPPER "opac/parts/myopac/prefs_base.tt2"; + myopac_page = "prefs"; + prefs_page = 'prefs_settings' %] + +

[% l('Search and History Preferences') %]

+ +
+ + + + + [% IF ctx.updated_user_settings %] + + [% END %] + + [%- setting = 'opac.hits_per_page' -%] + + + + + [%- setting = 'opac.default_search_location'; -%] + + + + + [%- setting = 'opac.default_pickup_location'; -%] + + + + + [%- setting = 'history.circ.retention_start' -%] + + [% circ_name = l('Keep history of checked out items?') %] + + + + [%- setting = 'history.hold.retention_start' -%] + + [% hold_name = l('Keep history of holds?') %] + + + + [%- setting = 'opac.temporary_list_no_warn' -%] + + [% skip_warn = l('Skip warning when adding to temporary book list?') %] + + + + [%- setting = 'circ.holds_behind_desk'; IF ctx.behind_desk_supported -%] + + [% behind_desk = l('Pickup holds from behind the desk when possible?') %] + + + + [% END %] + + + + +
+
+ [% l('Account Successfully Updated') %] +
+
+ + [% l('Search Hits Help') %] +
+ [%- thang = ctx.user.home_ou.id; + IF ctx.user_setting_map.$setting; + thang = ctx.user_setting_map.$setting; + END; + id = setting; + INCLUDE build_org_selector name=setting value=thang; + %] +
+ [%- thang = ctx.user.home_ou.id; + IF ctx.user_setting_map.$setting; + thang = ctx.user_setting_map.$setting; + END; + id = setting; + INCLUDE build_org_selector name=setting value=thang can_have_vols_only=1; + %] +
+ +
+ +
+ +
+ +
+ +
+ [% INCLUDE "opac/parts/myopac/prefs_hints.tt2" %] +[% END %] diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2 index 8ceb795857..6bf95305c0 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2 @@ -90,6 +90,15 @@ + +
+ +
diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js index ae771ec60e..b30f9c6ac7 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js @@ -31,6 +31,12 @@ angular.module('egWorkstationAdmin', controller: 'StoredPrefsCtrl', resolve : resolver }); + + $routeProvider.when('/admin/workstation/search/prefs', { + templateUrl: './admin/workstation/t_search_prefs', + controller: 'SearchPrefsCtrl', + resolve : resolver + }); // default page @@ -48,7 +54,6 @@ function($scope , $window , $location , egCore , egConfirmDialog) { var allWorkstations = []; var permMap = {}; $scope.contextOrg = egCore.org.get(egCore.auth.user().ws_ou()); - egCore.perm.hasPermAt('REGISTER_WORKSTATION', true) .then(function(orgList) { @@ -64,7 +69,7 @@ function($scope , $window , $location , egCore , egConfirmDialog) { // fetch the stored WS info egCore.hatch.getItem('eg.workstation.all') .then(function(all) { - allWorkstations = all || []; + allWorkstations = all || []; $scope.workstations = allWorkstations.map(function(w) { return w.name }); return egCore.hatch.getItem('eg.workstation.default'); @@ -172,6 +177,61 @@ function($scope , $window , $location , egCore , egConfirmDialog) { 'eg.hatch.url', $scope.hatchURL); } }]) +/* + * Search Preferences Controller + */ +.controller('SearchPrefsCtrl', + ['$scope','$window','$location', 'egCore', 'egOrg','egConfirmDialog', 'egAuth', +function($scope , $window , $location, egCore, egOrg, egConfirmDialog, egAuth) { + console.log('SearchPrefsCtrl'); + $scope.setContext = function(ctx) { + $scope.context = ctx; + $scope.isTestView = false; + $scope.actionPending = false; + } + //-----UI.js import + // avoid linking the full fleshed tree to the scope by + // tossing in a flattened list. -- Does this work as intended? + $scope.orgList = egOrg.list().map(function(org) { + return { + id : org.id(), + shortname : org.shortname(), //ex. CONS for example consortium + depth : org.ou_type().depth() //depth of the org unit + } + }); + $scope.getSelectedName = function() { + if ($scope.selected) + return $scope.selected.shortname(); + return $scope.label; + } + + $scope.orgChanged = function(org) { + $scope.selected = egOrg.get(org.id); + if ($scope.onchange) $scope.onchange($scope.selected); + } + + if (!$scope.selected) + $scope.selected = egOrg.get(egAuth.user().ws_ou()); + //-----End of UI.js import + + // --------------------- + // Hatch Configs + $scope.hatchURL = egCore.hatch.hatchURL(); + $scope.hatchRequired = + egCore.hatch.getLocalItem('eg.hatch.required'); + + $scope.updateHatchRequired = function() { + egCore.hatch.setLocalItem( + 'eg.hatch.required', $scope.hatchRequired); + } + + $scope.updateHatchURL = function() { + egCore.hatch.setLocalItem( + 'eg.hatch.url', $scope.hatchURL); + } + + +}]) .controller('PrintConfigCtrl', ['$scope','egCore',