When the patron search was split out of the patron app per bug
1701001,
the startup code that copied the current patron stat-cat list into
egCore.env was not moved over as well and remained in the patron app. As
a consequence, the patron search-to-hold dialog would fail to display
any patrons in the results list that had statistical categories assigned.
This patch moves that bit of initialization into the service.
To test
-------
[1] Ensure that some patron records have statistical categories assigned.
[2] In the web staff client, perform a catalog search, place a hold,
then use the 'Patron Search' button. Perform a search; note that
patrons with statistical categories are not displayed and that
errors are present in the browser debug console.
[3] Apply the patch and repeat step #2. This time, patrons that have
stat cats should be included in the results.
[4] Perform a patron search in the main patron search interface;
verify that patrons with statistical categories are retrieved.
[5] Directly go to the page listing stat cats for a patron (e.g.,
/eg/staff/circ/patron/$ID/stat_cats). Verify that the name
of the OU that owns the stat cat is displayed.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
]);
}
- return egCore.startup.go().then(function() {
-
- // This call requires orgs to be loaded, because it
- // calls egCore.org.ancestors(), so call it after startup
- return egCore.pcrud.search('actsc',
- {owner : egCore.org.ancestors(
- egCore.auth.user().ws_ou(), true)},
- {}, {atomic : true}
- ).then(function(cats) {
- egCore.env.absorbList(cats, 'actsc');
- });
- });
+ return egCore.startup.go();
}]};
$routeProvider.when('/circ/patron/search', {
}
service.resetPatronLists(); // initialize
- // Max recents setting is loaded and scrubbed during egStartup.
- // Copy it to a local variable here for ease of local access
- // after startup has run.
egCore.startup.go().then(
function() {
+ // Max recents setting is loaded and scrubbed during egStartup.
+ // Copy it to a local variable here for ease of local access
+ // after startup has run.
egCore.org.settings('ui.staff.max_recent_patrons')
.then(function(s) {
service.maxRecentPatrons = s['ui.staff.max_recent_patrons'];
});
+
+ // This call requires orgs to be loaded, because it
+ // calls egCore.org.ancestors(), so call it after startup
+ egCore.pcrud.search('actsc',
+ {owner : egCore.org.ancestors(
+ egCore.auth.user().ws_ou(), true)},
+ {}, {atomic : true}
+ ).then(function(cats) {
+ egCore.env.absorbList(cats, 'actsc');
+ });
}
);