This column tells when the Item or Biblio has been received for the first time into a library. Date-of-acquisition (dateaccessioned) answers, when the Item has been ordered. Date-of-receival (datereceived) answers, when the Item has arrived to the library or when the first Item for the Biblio has for the first time arrived to the library. This is very useful regarding statistics of acquisitions if they are based on the date received instead of the date acquired. Also other cool stuff can be built on top of it, like better searches for new material. This patch adds new DB columns items.datereceived, biblioitems.datereceived, deleteditems.datereceived, deletedbiblioitems.datereceived and populates those columns from the acorders.datereceived if the Item has been acquired using the acquisitions module, or from the items.dateaccessioned-column if no acquisitions module has been used. Biblioitems.datereceived is always the oldest timestamp from all the Items the Biblio has.
Created attachment 35908 [details] [review] Bug 13707 - Adding a new column datereceived for items and biblioitems. Value accessors.
Created attachment 35909 [details] [review] Bug 13707 - Adding a new column datereceived for items and biblioitems. New sortable Zebra index.
Created attachment 35910 [details] [review] Bug 13707 - Adding a new column datereceived for items and biblioitems This column tells when the Item or Biblio has been received for the first time into a library. Date-of-acquisition (dateaccessioned) answers, when the Item has been ordered. Date-of-receival (datereceived) answers, when the Item has arrived to the library or when the first Item for the Biblio has for the first time arrived to the library. This is very useful regarding statistics of acquisitions if they are based on the date received instead of the date acquired. Also other cool stuff can be built on top of it, like better searches for new material. This patch adds new DB columns items.datereceived, biblioitems.datereceived, deleteditems.datereceived, deletedbiblioitems.datereceived and populates those columns from the acorders.datereceived if the Item has been acquired using the acquisitions module, or from the items.dateaccessioned-column if no acquisitions module has been used. Biblioitems.datereceived is always the oldest timestamp from all the Items the Biblio has.
Created attachment 35917 [details] [review] Bug 13707 - Adding a new column datereceived for items and biblioitems. New sortable Zebra index. For new Biblios, this feature is automatically enabled, but if you want to make your existing biblios searchable, you must update your MARC Records from the koha DB. The easiest way is to run 'misc/batchRebuildBiblioTables.pl --upstream' to update your MARC Records from the koha DB, but you need to have Bugg 13703 deployed. After that Zebra needs to be fully reindexed. TEST PLAN: (index search) 1. Add a new Biblio. 2. Add an Item to it, either via the acquisitions module or the cataloguing module. 3. Reindex zebra partially with the "./rebuild_zebra.pl -b -z -v" or wait a while if automatic Zebra indexing is enabled in your environment. 4. Make the following search to the search box: datereceived=2015-12-04 where the Date is the day when you added those Items from step 2. (should be today) 5. You should find the Biblio you just added. TEST PLAN: (sorting search) 0. You need to prepare a searchable index of Records with the datereceived indexed. The easiest way is to use the batchRebuildBiblioTables.pl but some records can be manually created as well. M. Manual path: M.1. Add new Biblios, and Items to the using the cataloguing module's additems.pl. You can set the datereceived from the Item-form, so set some Items to past and some Items to have a datereceived in the future. Be aware that the first Item created sets the Parent Biblio's datereceived. M.2. Make a search which should find all the Biblios you manually made. ALL PATHS 3. Sort based on the datereceived (Receival date - Newest to oldest) 4. All the Records should be ordered with the most newly received Biblio on top. Note: Since we can only put Dates to Zebra, sorting is only based on the day-portion of the datereceived. The time-portion is only for potential statistical/logistical optimization reasons.
Created attachment 35933 [details] [review] Bug 13707 - Adding a new column datereceived for items and biblioitems. New sortable Zebra index. For new Biblios, this feature is automatically enabled, but if you want to make your existing biblios searchable, you must update your MARC Records from the koha DB. The easiest way is to run 'misc/batchRebuildBiblioTables.pl --upstream' to update your MARC Records from the koha DB, but you need to have Bugg 13703 deployed. After that Zebra needs to be fully reindexed. TEST PLAN: (index search) 1. Add a new Biblio. 2. Add an Item to it, either via the acquisitions module or the cataloguing module. 3. Reindex zebra partially with the "./rebuild_zebra.pl -b -z -v" or wait a while if automatic Zebra indexing is enabled in your environment. 4. Make the following search to the search box: datereceived=2015-12-04 where the Date is the day when you added those Items from step 2. (should be today) 5. You should find the Biblio you just added. TEST PLAN: (sorting search) 0. You need to prepare a searchable index of Records with the datereceived indexed. The easiest way is to use the batchRebuildBiblioTables.pl but some records can be manually created as well. M. Manual path: M.1. Add new Biblios, and Items to the using the cataloguing module's additems.pl. You can set the datereceived from the Item-form, so set some Items to past and some Items to have a datereceived in the future. Be aware that the first Item created sets the Parent Biblio's datereceived. M.2. Make a search which should find all the Biblios you manually made. ALL PATHS 3. Sort based on the datereceived (Receival date - Newest to oldest) 4. All the Records should be ordered with the most newly received Biblio on top. Note: Since we can only put Dates to Zebra, sorting is only based on the day-portion of the datereceived. The time-portion is only for potential statistical/logistical optimization reasons.
Created attachment 35944 [details] [review] Bug 13707 - 1. Adding a new column datereceived for items and biblioitems This column tells when the Item or Biblio has been received for the first time into a library. Date-of-acquisition (dateaccessioned) answers, when the Item has been ordered. Date-of-receival (datereceived) answers, when the Item has arrived to the library or when the first Item for the Biblio has for the first time arrived to the library. This is very useful regarding statistics of acquisitions if they are based on the date received instead of the date acquired. Also other cool stuff can be built on top of it, like better searches for new material. This patch adds new DB columns items.datereceived, biblioitems.datereceived, deleteditems.datereceived, deletedbiblioitems.datereceived and populates those columns from the acorders.datereceived if the Item has been acquired using the acquisitions module, or from the items.dateaccessioned-column if no acquisitions module has been used. Biblioitems.datereceived is always the oldest timestamp from all the Items the Biblio has.
Created attachment 35945 [details] [review] Bug 13707 - 2. Adding a new column datereceived for items and biblioitems. Value accessors. This makes sure that the datereceived-columns are populated, eg the Item and biblio get the date of receival. This happens when an Item is added using the cataloguin/additem.pl or the acqui/finishreceive.pl TEST PLAN: (cataloguing) 1. Add a new Biblio, either via Z39.50 or cataloguing/addbiblio.pl 2. Add an Item for the new Biblio using the cataloguing/additem.pl. This is the default view you get after saving the Biblio. 3. Observe that the new Item has a datereceived-field with current time as the timestamp. 4. Observe that the new Biblio has datereceived populated in the field where you have it mapped to. This defaults to 942$1. TEST PLAN: (acquisitions) 1. Add a new Biblio, either via Z39.50 or cataloguing/addbiblio.pl 2. Add an Item for the new Biblio using the acquisitions workflow. Close the basketgroup. 3. Receive the Item using the acqui/finishreceive.pl. 4. Observe that the new Item has a datereceived-field with current time as the timestamp. 5. Observe that the new Biblio has datereceived populated in the field where you have it mapped to. This defaults to 942$1. TEST PLAN: (break it, after any test path) 10. Receive new Items using both the acquisitions module and the cataloguin module. 11. Observe that Biblio's datereceived-field (942$1) doesn't change, but remains as the value set when receiving the first Item. 12. Observe that each Item gets the original timestamp when it has been received.
Created attachment 35946 [details] [review] Bug 13707 - 3. Adding a new column datereceived for items and biblioitems. New sortable Zebra index. For new Biblios, this feature is automatically enabled, but if you want to make your existing biblios searchable, you must update your MARC Records from the koha DB. The easiest way is to run 'misc/batchRebuildBiblioTables.pl --upstream' to update your MARC Records from the koha DB, but you need to have Bugg 13703 deployed. After that Zebra needs to be fully reindexed. TEST PLAN: (index search) 1. Add a new Biblio. 2. Add an Item to it, either via the acquisitions module or the cataloguing module. 3. Reindex zebra partially with the "./rebuild_zebra.pl -b -z -v" or wait a while if automatic Zebra indexing is enabled in your environment. 4. Make the following search to the search box: datereceived=2015-12-04 where the Date is the day when you added those Items from step 2. (should be today) 5. You should find the Biblio you just added. TEST PLAN: (sorting search) 0. You need to prepare a searchable index of Records with the datereceived indexed. The easiest way is to use the batchRebuildBiblioTables.pl but some records can be manually created as well. M. Manual path: M.1. Add new Biblios, and Items to the using the cataloguing module's additems.pl. You can set the datereceived from the Item-form, so set some Items to past and some Items to have a datereceived in the future. Be aware that the first Item created sets the Parent Biblio's datereceived. M.2. Make a search which should find all the Biblios you manually made. ALL PATHS 3. Sort based on the datereceived (Receival date - Newest to oldest) 4. All the Records should be ordered with the most newly received Biblio on top. Note: Since we can only put Dates to Zebra, sorting is only based on the day-portion of the datereceived. The time-portion is only for potential statistical/logistical optimization reasons.
Created attachment 35966 [details] [review] Bug 13707 - 2. Adding a new column datereceived for items and biblioitems. Value accessors. This makes sure that the datereceived-columns are populated, eg the Item and biblio get the date of receival. This happens when an Item is added using the cataloguin/additem.pl or the acqui/finishreceive.pl TEST PLAN: (cataloguing) 1. Add a new Biblio, either via Z39.50 or cataloguing/addbiblio.pl 2. Add an Item for the new Biblio using the cataloguing/additem.pl. This is the default view you get after saving the Biblio. 3. Observe that the new Item has a datereceived-field with current time as the timestamp. 4. Observe that the new Biblio has datereceived populated in the field where you have it mapped to. This defaults to 942$1. TEST PLAN: (acquisitions) 1. Add a new Biblio, either via Z39.50 or cataloguing/addbiblio.pl 2. Add an Item for the new Biblio using the acquisitions workflow. Close the basketgroup. 3. Receive the Item using the acqui/finishreceive.pl. 4. Observe that the new Item has a datereceived-field with current time as the timestamp. 5. Observe that the new Biblio has datereceived populated in the field where you have it mapped to. This defaults to 942$1. TEST PLAN: (break it, after any test path) 10. Receive new Items using both the acquisitions module and the cataloguin module. 11. Observe that Biblio's datereceived-field (942$1) doesn't change, but remains as the value set when receiving the first Item. 12. Observe that each Item gets the original timestamp when it has been received.
Created attachment 35967 [details] [review] Bug 13707 - 3. Adding a new column datereceived for items and biblioitems. New sortable Zebra index. For new Biblios, this feature is automatically enabled, but if you want to make your existing biblios searchable, you must update your MARC Records from the koha DB. The databaseupdate.pl -script does this for you. Also the table 'marc_subfield_structure' has an case-insensitive collation preventing adding subfield 'R' when 'r' is present. The collation is changed to utf8_bin. This has no adverse side effects since there is no need for complex text-based sorting using this table. After that Zebra needs to be fully reindexed. TEST PLAN: (index search) 1. Add a new Biblio. 2. Add an Item to it, either via the acquisitions module or the cataloguing module. 3. Reindex zebra partially with the "./rebuild_zebra.pl -b -z -v" or wait a while if automatic Zebra indexing is enabled in your environment. 4. Make the following search to the search box: datereceived=2015-12-04 where the Date is the day when you added those Items from step 2. (should be today) 5. You should find the Biblio you just added. TEST PLAN: (sorting search) 0. You need to prepare a searchable index of Records with the datereceived indexed. The easiest way is to use the batchRebuildBiblioTables.pl but some records can be manually created as well. M. Manual path: M.1. Add new Biblios, and Items to the using the cataloguing module's additems.pl. You can set the datereceived from the Item-form, so set some Items to past and some Items to have a datereceived in the future. Be aware that the first Item created sets the Parent Biblio's datereceived. M.2. Make a search which should find all the Biblios you manually made. ALL PATHS 3. Sort based on the datereceived (Receival date - Newest to oldest) 4. All the Records should be ordered with the most newly received Biblio on top. Note: Since we can only put Dates to Zebra, sorting is only based on the day-portion of the datereceived. The time-portion is only for potential statistical/logistical optimization reasons.
Created attachment 35968 [details] [review] Bug 13707 - 4. Adding a new column datereceived for items and biblioitems. Unit tests.
Pushed this to production here. Waiting for trouble! Have fun!
Created attachment 35970 [details] [review] KD-245 - Bug 13707 - 5. Prepared searches. NOT FOR MASTER An example on how to utilize this new search index.
Created attachment 42391 [details] [review] Bug 13707 - 3. Adding a new column datereceived for items and biblioitems. New sortable Zebra index.
Created attachment 42394 [details] [review] Bug 13707 - 1. Adding a new column datereceived for items and biblioitems
Applying: Bug 13707 - 2. Adding a new column datereceived for items and biblioitems. Value accessors. fatal: sha1 information is lacking or useless (C4/Biblio.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 13707 - 2. Adding a new column datereceived for items and biblioitems. Value accessors.
Created attachment 64343 [details] [review] Bug 13707: (squashable) Column 'datereceived' in where clause is ambiguous To test: 1. prove t/db_dependent/Acquisition.t
Created attachment 64344 [details] [review] Bug 13707: (follow-up) Fix failing unit test t/db_dependent/Datereceived.t To replicate: 1. Before applying patch, prove t/db_dependent/Datereceived.t To test: 1. Apply patch 2. prove t/db_dependent/Datereceived.t