Jonathan Druart
4a51122e26
This is the main commit message. A plugin already exists to manage curbside pickups. This new enhancehemnt is suggesting an implementation that is ready to be integrated into Koha core in order to provide the feature out-of-the-box. What has been done in this patch set: - Deal with installations using the existing plugin (upgrade the DB schema and migrate their data) - Add a new syspref (CurbsidePickup) and two new permissions: * parameters.manage_curbside_pickups * circulate.manage_curbside_pickups - Add an administration page to setup the configuration: admin/curbside_pickup.pl - Add a circulation page to manage the existing pickups, and create new one - Add a new OPAC view "your curbside pickups" to let patron manage their pickups, and create new ones - Add link from the "member" toolbar Improvements compared to the plugin: - Ability to create several pickup windows per day - Better display of the pickup times (not in a dropdown list) - Ability to disable pickups for patrons without waiting holds - Display pickups on the patron circulation page - Display pickups of the library on the homepage - Prevent pickup to be created on a holiday - Better error handling (exceptions) - Unit tests More improvements are already planned, see related bug reports. Test plan: After you setup the feature correctly from the administration view, you will be able to use the schedule curbside pickups from the staff interface, and from the OPAC interface if you selected "patron-scheduled pickup" A. Staff interface 1. Go to Circulation > Curbside pickups => If the logged-in user has the circulate.manage_curbside_pickups permission you will be able to create and manage curbside pickups 2. Go to a patron detail page and click the "Schedule pickup" button in the toolbar 3. If the patron has waiting holds and you selected "Enable for waiting holds only", of if you didn't select the option, you will be able to select a pickup date and slots to create a pickup. 4. Confirm that you cannot create more pickups per slot than what you defined in the curbside pickup configuration for this library 5. Confirm that you cannot create a pickup if the feature is disabled for the library 6. Notice that you can mark the pickup as "stage and ready", then "patron is outside" and finally "delivered today". You can also rollback the change 7. Notice that once the pickup has been marked as delivered, the item has been checked out and that a new notice has been generated (if the patron has "Hold_Filled" in their messaging preferences 8. Confirm that the information about current pickups is displayed on the circulation page of the patron B. OPAC interface 1. Create a new curbside pickup from the OPAC 2. Confirm that the same limitations as from the staff interface are in effect (waiting holds, number of patron per slots, etc.) 3. Confirm that you can cancel a pickup and alert staff of you arrival 4. Confirm that you cannot cancel a pickup that has been delivered already Sponsored-by: Association KohaLa - https://koha-fr.org/ Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
72 lines
2.9 KiB
PHP
72 lines
2.9 KiB
PHP
[% USE Koha %]
|
|
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE KohaDates %]
|
|
[% Asset.js("lib/moment/moment.min.js") | $raw %]
|
|
[% Asset.js("lib/moment/moment-timezone-with-data-10-year-range.min.js") | $raw %]
|
|
<!-- js-date-format.inc -->
|
|
<script>
|
|
(function() {
|
|
var def_date_format = '[% Koha.Preference('dateformat') | html %]';
|
|
var def_time_format = '[% Koha.Preference('TimeFormat') | html %]';
|
|
var def_tz = '[% KohaDates.tz | html %]';
|
|
|
|
var get_date_pattern = function(format) {
|
|
var date_pattern = 'YYYY-MM-DD';
|
|
if(format == 'us') date_pattern = 'MM/DD/YYYY';
|
|
if(format == 'metric') date_pattern = 'DD/MM/YYYY';
|
|
if(format == 'dmydot') date_pattern = 'DD.MM.YYYY';
|
|
return date_pattern;
|
|
};
|
|
|
|
var get_time_pattern = function(format) {
|
|
var time_pattern = 'HH:mm';
|
|
if(format == '12hr') time_pattern = 'hh:mm a';
|
|
return time_pattern;
|
|
};
|
|
|
|
/*
|
|
* A JS equivilent of the KohaDates TT Plugin. Passed an rfc3339 formatted date string,
|
|
* or JS Date, the function will return a date string formatted as per the koha instance config.
|
|
* Optionally accepts a dateformat parameter to allow override of the configured output format
|
|
* as well as a 'withtime' boolean denoting whether to include time or not in the output string.
|
|
*/
|
|
window.$date = function(value, options) {
|
|
if(!value) return '';
|
|
var tz = (options&&options.tz)||def_tz;
|
|
var m = moment(value);
|
|
if((m.creationData().format !== 'YYYY-MM-DD')&&tz) m.tz(tz);
|
|
|
|
var dateformat = (options&&options.dateformat)||def_date_format;
|
|
var withtime = (options&&options.withtime)||false;
|
|
|
|
if(dateformat=='rfc3339' && withtime) return m.format();
|
|
|
|
var timeformat = (options&&options.timeformat)||def_time_format;
|
|
var date_pattern = get_date_pattern(dateformat);
|
|
var time_pattern = !withtime?'':' '+get_time_pattern(timeformat);
|
|
|
|
return m.format(date_pattern+time_pattern);
|
|
}
|
|
|
|
window.$datetime = function(value, options) {
|
|
options = options||{};
|
|
options.withtime = true;
|
|
return $date(value, options);
|
|
};
|
|
|
|
window.$time = function(value, options) {
|
|
if(!value) return '';
|
|
var tz = (options&&options.tz)||def_tz;
|
|
var m = moment(value);
|
|
if(tz) m.tz(tz);
|
|
|
|
var dateformat = (options&&options.dateformat);
|
|
var timeformat = (dateformat=='rfc3339'&&'24hr')||(options&&options.timeformat)||def_time_format;
|
|
|
|
return m.format(get_time_pattern(timeformat)+(dateformat=='rfc3339'?':ss'+(!m.isUTC()?'Z':''):''))+(dateformat=='rfc3339' && m.isUTC()?'Z':'');
|
|
}
|
|
|
|
})();
|
|
</script>
|
|
<!-- / js-date-format.inc -->
|