Bug 11500

Summary: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)
Product: Koha Reporter: David Cook <dcook>
Component: CatalogingAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: hayleypelham, jonathan.druart, katrin.fischer, lucas, m.de.rooy, martin.renvoize, maryse.simard
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Attachments: Bug 11500: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)
Bug 11500: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)
Bug 11500: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)
Bug 11500: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)

Description David Cook 2014-01-09 04:13:56 UTC
Currently, the dateformat system preference isn't used when cataloguing items with dates.

That is, if you're adding/modifying/viewing a date when cataloguing an item, you'll see it in 'iso' format. 

This makes sense since this is the date format that is used in the database, but staff might think that they can enter dates based on the dateformat syspref. 

If we handle the dates based on dateformat, we get around that.

Another idea is using the datepicker so that staff don't even need to manually enter dates. Like other parts of Koha, they could just pick the date (ideally in accordance with the dateformat syspref - like in circulation - but this could even work with iso format).

We've had one librarian bring it up, but I'm not sure this is something that we're necessarily going to pursue.

I thought I would bring it up anyone though.
Comment 1 Owen Leonard 2019-11-22 15:00:54 UTC Comment hidden (obsolete)
Comment 2 Maryse Simard 2019-11-22 21:29:37 UTC
Everything works on the add/edit item page, but the datepicker looks a bit off on the new order page. The dialog is missing the selects for the month and year as well as the "today" button.
Comment 3 Owen Leonard 2019-11-26 13:07:56 UTC Comment hidden (obsolete)
Comment 4 Maryse Simard 2019-11-29 22:03:12 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2019-12-05 14:39:42 UTC
Created attachment 96042 [details] [review]
Bug 11500: Use dateformat syspref and datepicker on additems.pl (and other item cataloguing pages)

This patch modifies the cataloging plugin dateaccessioned.pl so that it
triggers the addition of a datepicker widget to fields it is linked
with. Despite its name the plugin can be used on any item field which
requires a date.

To test, apply the patch and make sure you have one or more item
subfields linked to the dateaccessioned.pl plugin. For instance, in
MARC21:

 - Administration -> MARC bibliographic framework -> MARC structure ->
   952 -> Edit subfields:
   - subfields d ("Date acquired") and w ("Price effective from"):
     - Other options -> Plugin -> dateaccessioned.pl

 - Go to cataloging and add or edit an item on a bibliographic record
 - The "Date acquired" and "Price effective from" fields should be
   styled as datepickers.
 - Clicking in these fields should populate the field with today's date
   and trigger the datepicker popup.
 - Test that all the datepicker features work correctly.
 - Test that manual entry of a date works.

 - With the AcqCreateItem system preference set to "placing an order,"
   go to Acquisitions -> Vendor -> Add to basket.
   - Add a title to your basket using your preferred method.
   - In the "New order" form, find the section for adding an item.
   - Test the "Date acquired" and "Price effective from" fields, which
     should behave just like they did in the cataloging module.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Martin Renvoize 2019-12-23 12:09:21 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Lucas Gass 2020-01-13 22:38:35 UTC
backported to 19.11.x for 19.11.02
Comment 8 Lucas Gass 2020-01-13 22:46:22 UTC
backported to 19.05.x for 19.05.07
Comment 9 Katrin Fischer 2020-01-14 07:31:59 UTC
I wonder if this will not cause some trouble in late stables for the change in the cataloging workflow.
Comment 10 Hayley Pelham 2020-01-14 21:49:44 UTC
If it is decided that this should be backported to 18.11 (oldoldstable) can a patch please be added for 18.11 as there are merge conflicts. if it should not be added, that is fine
Comment 11 Jonathan Druart 2020-05-14 10:48:09 UTC
I think this patch caused bug 25473.