Bug 20678 - Save draft records without committing them to the catalogue
Summary: Save draft records without committing them to the catalogue
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 20699 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-29 10:32 UTC by Alex Buckley
Modified: 2024-03-06 17:24 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 20678 - Save draft MARC record without committing to catalog (16.13 KB, patch)
2018-04-29 10:53 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 : Added removal of biblio from reservoir after saving to catalog (6.04 KB, patch)
2018-04-29 23:43 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Added unit test for new subroutine DeleteBiblioInBatch() (1.69 KB, patch)
2018-04-29 23:44 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Added new Draft records interface in cataloging (21.35 KB, patch)
2018-05-02 01:30 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Fixed update of number of records in draft batch file (9.93 KB, patch)
2018-05-02 01:31 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Added cataloging subpermission for cataloging (7.01 KB, patch)
2018-05-02 01:32 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20699 - Implemented a save marc as draft feature (40.08 KB, patch)
2018-05-08 21:41 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20699 - Implemented a save marc as draft feature (41.59 KB, patch)
2018-05-08 21:48 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20699 - Implemented a save marc as draft feature (41.63 KB, patch)
2018-08-21 03:41 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Implemented a save marc as draft feature (42.89 KB, patch)
2018-09-16 00:46 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678 - Implemented a save marc as draft feature (43.51 KB, patch)
2019-08-15 22:18 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20699 - Implemented a save marc as draft feature (44.24 KB, patch)
2020-07-28 07:02 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 20678: Save biblio records as a draft record (44.68 KB, patch)
2020-07-29 00:40 UTC, Alex Buckley
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2018-04-29 10:32:49 UTC
One of our clients has requested the functionality to be able to save a MARC record as a draft so they can return to continue cataloguing it later.

This will be achieved by saving the record to the 'reservoir' in much the same way that staged records are stored in the 'import_*' tables but not in the biblio table. 

The functionality has been achieved in the first patch I will attach, and unit tests for this will come later.
Comment 1 Alex Buckley 2018-04-29 10:53:44 UTC Comment hidden (obsolete)
Comment 2 Alex Buckley 2018-04-29 10:54:07 UTC
Unit test patch to come
Comment 3 Alex Buckley 2018-04-29 23:43:47 UTC Comment hidden (obsolete)
Comment 4 Alex Buckley 2018-04-29 23:44:21 UTC Comment hidden (obsolete)
Comment 5 Frédéric Demians 2018-04-30 16:35:10 UTC
Isn't it possible to achieve the same result with the OpacSuppression syspref?
Comment 6 Alex Buckley 2018-04-30 20:57:59 UTC
More patches will be applied to this bug report shortly to introduce a standalone interface in Cataloging interface to administer draft records. 

Thanks for your comment Frédéric, the OPACSuppression syspref provides similar functionality in terms of hiding some biblio records from search results.

However the big benefit of this draft record functionality is that all draft records are listed on a single interface together. 

This will save librarians of large libraries having to remember all the titles of half finished biblios they were halfway through cataloging, so they can find them in the staff client, to continue editing the biblios. 

i.e. it is giving more options to librarians.
Comment 7 Alex Buckley 2018-05-02 01:30:49 UTC Comment hidden (obsolete)
Comment 8 Alex Buckley 2018-05-02 01:31:22 UTC Comment hidden (obsolete)
Comment 9 Alex Buckley 2018-05-02 01:32:11 UTC Comment hidden (obsolete)
Comment 10 Alex Buckley 2018-05-08 21:41:17 UTC Comment hidden (obsolete)
Comment 11 Alex Buckley 2018-05-08 21:48:26 UTC Comment hidden (obsolete)
Comment 12 Alex Buckley 2018-08-21 03:41:19 UTC Comment hidden (obsolete)
Comment 13 Alex Buckley 2018-08-21 03:42:18 UTC
Just attached the save marc draft commit rebased against 18.05.02 so it now applies cleanly, ready for testing :)
Comment 14 Elaine Bradtke 2018-08-21 17:16:25 UTC
It would be better to make the button say "Save as Draft" rather than save without cataloguing.  We have been using the OpacSuppression syspref and a report that shows  suppressed records, when training new staff, but this sounds more elegant.
Comment 15 Liz Rea 2018-08-21 21:03:38 UTC
Hi Elaine,

The reason that we went with "save without cataloguing" is that the word Draft is both a noun and a verb. Save without cataloguing is easier to translate.

Cheers,
Liz
Comment 16 Katrin Fischer 2018-08-21 22:04:27 UTC
In a sentence it should work I think "save as draft" makes it clear that draft is a not a verb here. The problem is when draft appears without any context - then it's hard to tell what is really meant.

Save without cataloguing somehow doesn't sound right to me, because even creating a draft means you are cataloguing. Maybe what's meant is: Save without adding to catalog (which is too long, I admit it).
Comment 17 Elaine Bradtke 2018-08-27 17:01:02 UTC
+1 'save as draft'
To a cataloguer, 'save without cataloguing' makes no sense. It makes one wonder what's going to happen to the data when the button is pushed.
Comment 18 Alex Buckley 2018-09-16 00:22:00 UTC
*** Bug 20699 has been marked as a duplicate of this bug. ***
Comment 19 Alex Buckley 2018-09-16 00:46:21 UTC
Created attachment 78920 [details] [review]
Bug 20678 - Implemented a save marc as draft feature

This patch implements the ability to save marc records to the reservior
(in a similar way to how imported staged records are stored in the
 reservior).

The purpose of this feature is to be able to train junior library staff
and catalogers by letting them practise cataloging biblio records and saving them as drafts
(stored in the reservoir). Because these draft records are stored in the
reservoir they are not returned as OPAC search results.

This patch implements a new 'editcatalogue' subpermission called 'commit_MARC_records_to_catalog'. A staff member must have this subpermission
enabled to commit a record to the catalog.

In the addbiblio.pl interface users with all editcatalogue
subpermissions (which should be staff experienced with cataloging) will see 4 'Save' options:

* Save and review record
* Save and edit items
* Save and continue editing
* Save without cataloging

Junior staff should have all editcatalog subpermissions except for
'commit_MARC_records_to_catalog' and they will see one save option 'Save
without cataloging' and this saves the record as a draft.

To view and administer all draft records you can click on the 'View
draft records' button in the toolbar on the addbooks.pl page.

Here draft records are listed newest to oldest and individual draft records can be edited/deleted or all draft records
can be deleted in one go.

Test plan:

Test plan:
1. Go to addbooks.pl and notice there is no 'View draft reocrds' button
in the toolbar alongside 'New record'

2. Apply patch

3. Restart plack, memcached

4. Update your database, this can be achieved by runnning
installer/data/mysql/updatedatabase.pl or in Koha staff client going to
Adminstration->Global system preferences->Local use and amending the
Version syspref value

5. Create two user accounts one with superlibrarian permissions and the
other with all editcatalogue subpermissions except for
'commit_MARC_records_to_catalog' and also enable the catalogue
permission so this user can access the staff client.

6. Log in as user 1 (superlibrarian) go to Cataloging->New record and
select the 'Save' dropdown box and notice you have 4 options. Select
'Save and view record' and notice you have created a biblio in the
catalog.

7. Log out and log in as user 2 go to Cataloging->New record and
click the 'Save' button and notice that there is only one option 'Save
without cataloging'. Meaning you are restricted to only creating a draft
record.

8. Select 'Save without cataloging' and you are re-directed to the
Cataloging main page. Now select the 'View draft records' button and
view your draft record in the table of draft records.

9. Select the 'Edit' link and notice the addbiblio.pl page for the draft
record is loaded

10. Return to the View draft records interface and delete the draft
record and notice that after the page reloads the record is no longer
displayed in the table.

11. Create 2 more draft records and return to the View draft records
interface and select 'Delete all drafts from reservoir' and notice the
drafts table is emptied

12. Create 1 more draft record and then log out

13. Log in as user 1 (superlibrarian) and go to the View draft records
interface.

14. Select the 'Edit' link

15. Select any save option except for 'Save without cataloguing' and
notice the record is now committed to the catalog.

16. Return to the 'View draft records' interface and notice the record
you just committed to the catalog has been removed as a draft record in
the reservoir.

17. Run the unit test t/db_dependent/ImportBatch.t in koha-shell

18. Notice that unit test 12 passes: 'ok 12 - No biblio expected since
we deleted the biblio from the batch'

19. Log out and back in as the second user and search for a biblio
record which is in the catalog (i.e. not a draft record) and notice both
in the staff client search results and the biblio detail page the links
to edit the record and items associated with the biblio record are not
displayed. This is because the user you are logged in as has all
edit_catalogue permissions except
CAN_user_editcatalogue_commit_MARC_records_to_catalog which is
neccessary to add/edit/delete biblios or items in the catalog.

Sponsored-By: Toi Ohomai Institute of Technology, New Zealand
Comment 20 Alex Buckley 2018-09-16 00:50:25 UTC
Rebased against master on 16th of sept 2018. 

We (Catalyst) believe the best way to get this feature upstreamed is for those who would like the wording to be changed to 'Save as draft' to make a dependent bug report with a patch implementing that wording change.

i.e. we should try and get this useful new feature as it is into master and then those who have differing views on the wording can make a dependent patch which implements the wording they would like.
Comment 21 Owen Leonard 2018-09-16 22:34:59 UTC
(In reply to Alex Buckley from comment #20)
> Rebased against master on 16th of sept 2018. 
> 
> We (Catalyst) believe the best way to get this feature upstreamed is for
> those who would like the wording to be changed to 'Save as draft' to make a
> dependent bug report with a patch implementing that wording change.

I'm fine with this.

However, I see a couple of bugs:

On the "View drafts" view, the DataTables controls don't seem to be working. They display incorrectly and don't appear to do anything.

As Alex and I discussed, there is an issue with the way the current patch implements insertion of a "drafts" staged record. A follow-up should improve it.

I think the "Delete all drafts" should have a confirmation alert.
Comment 22 Katrin Fischer 2018-10-24 20:33:25 UTC
(In reply to Alex Buckley from comment #20)
> Rebased against master on 16th of sept 2018. 
> 
> We (Catalyst) believe the best way to get this feature upstreamed is for
> those who would like the wording to be changed to 'Save as draft' to make a
> dependent bug report with a patch implementing that wording change.
> 
> i.e. we should try and get this useful new feature as it is into master and
> then those who have differing views on the wording can make a dependent
> patch which implements the wording they would like.

I'd like to add something here. Changing the wording later might create a lot of work for a lot of people:

- developers
- testers
- documentation writers
- translators

Why not change the little detail now? If I see it correctly, it would be only one line to change: 

+                    <li><a id="previewrecord" name="previewrecord" href="#">Save without cataloging</a></li>
Comment 23 Brian 2018-12-18 01:27:58 UTC
Any progress on Bug 20678?

Carnegie Team
Comment 24 David Cook 2018-12-18 06:37:37 UTC
(In reply to Katrin Fischer from comment #22)
> Why not change the little detail now? If I see it correctly, it would be
> only one line to change: 
> 

+1
Comment 25 Alex Buckley 2018-12-18 21:26:19 UTC
(In reply to Katrin in comment #22):

Hi Katrin, 

Fair enough I will make that wording change to 'Save as Draft'. I am revisiting this now and over the Christmas period when I will hopefully have some time. 

Sorry for the delay on this one, it is definitely a priority for me to work on to try to get into 19.05

Cheers,
Alex
Comment 26 Katrin Fischer 2018-12-18 21:46:45 UTC
Hi Alex, thx! Just to be sure: Save as _d_raft! :)
Comment 27 Alex Buckley 2019-08-15 22:18:52 UTC
Created attachment 92248 [details] [review]
Bug 20678 - Implemented a save marc as draft feature

This patch implements the ability to save marc records to the reservior
(in a similar way to how imported staged records are stored in the
 reservior).

The purpose of this feature is to be able to train junior library staff
and catalogers by letting them practise cataloging biblio records and saving them as drafts
(stored in the reservoir). Because these draft records are stored in the
reservoir they are not returned as OPAC search results.

This patch implements a new 'editcatalogue' subpermission called 'commit_MARC_records_to_catalog'. A staff member must have this subpermission
enabled to commit a record to the catalog.

In the addbiblio.pl interface users with all editcatalogue
subpermissions (which should be staff experienced with cataloging) will see 4 'Save' options:

* Save and review record
* Save and edit items
* Save and continue editing
* Save without cataloging

Junior staff should have all editcatalog subpermissions except for
'commit_MARC_records_to_catalog' and they will see one save option 'Save
without cataloging' and this saves the record as a draft.

To view and administer all draft records you can click on the 'View
draft records' button in the toolbar on the addbooks.pl page.

Here draft records are listed newest to oldest and individual draft records can be edited/deleted or all draft records
can be deleted in one go.

Test plan:

Test plan:
1. Go to addbooks.pl and notice there is no 'View draft reocrds' button
in the toolbar alongside 'New record'

2. Apply patch

3. Restart plack, memcached

4. Update your database, this can be achieved by runnning
installer/data/mysql/updatedatabase.pl or in Koha staff client going to
Adminstration->Global system preferences->Local use and amending the
Version syspref value

5. Create two user accounts one with superlibrarian permissions and the
other with all editcatalogue subpermissions except for
'commit_MARC_records_to_catalog' and also enable the catalogue
permission so this user can access the staff client.

6. Log in as user 1 (superlibrarian) go to Cataloging->New record and
select the 'Save' dropdown box and notice you have 4 options. Select
'Save and view record' and notice you have created a biblio in the
catalog.

7. Log out and log in as user 2 go to Cataloging->New record and
click the 'Save' button and notice that there is only one option 'Save
without cataloging'. Meaning you are restricted to only creating a draft
record.

8. Select 'Save without cataloging' and you are re-directed to the
Cataloging main page. Now select the 'View draft records' button and
view your draft record in the table of draft records.

9. Select the 'Edit' link and notice the addbiblio.pl page for the draft
record is loaded

10. Return to the View draft records interface and delete the draft
record and notice that after the page reloads the record is no longer
displayed in the table.

11. Create 2 more draft records and return to the View draft records
interface and select 'Delete all drafts from reservoir' and notice the
drafts table is emptied

12. Create 1 more draft record and then log out

13. Log in as user 1 (superlibrarian) and go to the View draft records
interface.

14. Select the 'Edit' link

15. Select any save option except for 'Save without cataloguing' and
notice the record is now committed to the catalog.

16. Return to the 'View draft records' interface and notice the record
you just committed to the catalog has been removed as a draft record in
the reservoir.

17. Run the unit test t/db_dependent/ImportBatch.t in koha-shell

18. Notice that unit test 12 passes: 'ok 12 - No biblio expected since
we deleted the biblio from the batch'

19. Log out and back in as the second user and search for a biblio
record which is in the catalog (i.e. not a draft record) and notice both
in the staff client search results and the biblio detail page the links
to edit the record and items associated with the biblio record are not
displayed. This is because the user you are logged in as has all
edit_catalogue permissions except
CAN_user_editcatalogue_commit_MARC_records_to_catalog which is
neccessary to add/edit/delete biblios or items in the catalog.

Sponsored-By: Toi Ohomai Institute of Technology, New Zealand
Comment 28 Alex Buckley 2019-08-15 22:22:10 UTC
Hi all, 

I am going to continue to work on this enhancement, as we have had a lot of libraries say the ability to save a draft record would be very useful to them.

I have changed the wording to 'Save as draft' and have rebased the patch against master. I have noticed a few bugs which I want to fix up next. 

Thanks
Alex
Comment 29 Aleisha Amohia 2020-02-18 01:11:58 UTC
Hey Alex, when you continue work on this, just a reminder to add changes to installer/data/mysql/sysprefs.sql and installer/data/mysql/userpermissions.sql !
Comment 30 Alex Buckley 2020-07-28 07:02:37 UTC
Created attachment 107454 [details] [review]
Bug 20699 - Implemented a save marc as draft feature

This patch implements the ability to save marc records to the reservior
(in a similar way to how imported staged records are stored in the
 reservior).

The purpose of this feature is to be able to train junior library staff
and catalogers by letting them practise cataloging biblio records and saving them as drafts
(stored in the reservoir). Because these draft records are stored in the
reservoir they are not returned as OPAC search results.

This patch implements a new 'editcatalogue' subpermission called 'commit_MARC_records_to_catalog'. A staff member must have this subpermission
enabled to commit a record to the catalog.

In the addbiblio.pl interface users with all editcatalogue
subpermissions (which should be staff experienced with cataloging) will see 4 'Save' options:

* Save and review record
* Save and edit items
* Save and continue editing
* Save without cataloging

Junior staff should have all editcatalog subpermissions except for
'commit_MARC_records_to_catalog' and they will see one save option 'Save
without cataloging' and this saves the record as a draft.

To view and administer all draft records you can click on the 'View
draft records' button in the toolbar on the addbooks.pl page.

Here draft records are listed newest to oldest and individual draft records can be edited/deleted or all draft records
can be deleted in one go.

Test plan:

Test plan:
1. Go to addbooks.pl and notice there is no 'View draft reocrds' button
in the toolbar alongside 'New record'

2. Apply patch

3. Restart plack, memcached

4. Update your database, this can be achieved by runnning
installer/data/mysql/updatedatabase.pl or in Koha staff client going to
Adminstration->Global system preferences->Local use and amending the
Version syspref value

5. Create two user accounts one with superlibrarian permissions and the
other with all editcatalogue subpermissions except for
'commit_MARC_records_to_catalog' and also enable the catalogue
permission so this user can access the staff client.

6. Log in as user 1 (superlibrarian) go to Cataloging->New record and
select the 'Save' dropdown box and notice you have 4 options. Select
'Save and view record' and notice you have created a biblio in the
catalog.

7. Log out and log in as user 2 go to Cataloging->New record and
click the 'Save' button and notice that there is only one option 'Save
without cataloging'. Meaning you are restricted to only creating a draft
record.

8. Select 'Save without cataloging' and you are re-directed to the
Cataloging main page. Now select the 'View draft records' button and
view your draft record in the table of draft records.

9. Select the 'Edit' link and notice the addbiblio.pl page for the draft
record is loaded

10. Return to the View draft records interface and delete the draft
record and notice that after the page reloads the record is no longer
displayed in the table.

11. Create 2 more draft records and return to the View draft records
interface and select 'Delete all drafts from reservoir' and notice the
drafts table is emptied

12. Create 1 more draft record and then log out

13. Log in as user 1 (superlibrarian) and go to the View draft records
interface.

14. Select the 'Edit' link

15. Select any save option except for 'Save without cataloguing' and
notice the record is now committed to the catalog.

16. Return to the 'View draft records' interface and notice the record
you just committed to the catalog has been removed as a draft record in
the reservoir.

17. Run the unit test t/db_dependent/ImportBatch.t in koha-shell

18. Notice that unit test 12 passes: 'ok 12 - No biblio expected since
we deleted the biblio from the batch'

19. Log out and back in as the second user and search for a biblio
record which is in the catalog (i.e. not a draft record) and notice both
in the staff client search results and the biblio detail page the links
to edit the record and items associated with the biblio record are not
displayed. This is because the user you are logged in as has all
edit_catalogue permissions except
CAN_user_editcatalogue_commit_MARC_records_to_catalog which is
neccessary to add/edit/delete biblios or items in the catalog.

Sponsored-By: Toi Ohomai Institute of Technology, New Zealand
Comment 31 Alex Buckley 2020-07-29 00:40:20 UTC
Created attachment 107472 [details] [review]
Bug 20678: Save biblio records as a draft record

Allow junior/in-training library staff to save a incomplete bibliographic
record as a draft. It will not be returned for OPAC searches or most
staff client searches (it will be returned for Cataloguing module searches when the 'Drafts only'
checkbox is selected).

This patch implements:

* New 'editcatalogue' subpermission called 'commit_MARC_records_to_catalog'.
Without this subpermission ticked a staff member will only be able to save draft records).

* A new 'Save' option in the addbiblio.pl page: 'Save as draft'.

* View/edit/delete draft records in new cataloguing module page:
draftrecords.pl

Junior staff should have all editcatalog subpermissions except for
'commit_MARC_records_to_catalog' and they will see one save option 'Save
as draft' in the addbiblio.pl page.

Test plan:
1. Go to addbooks.pl and notice there is no 'View draft records' button
in the toolbar alongside 'New record'

2. Apply patch

3. Restart memcached, plack, update database

4. Create two user accounts:

* A superlibrarian permissions
* Patron with all editcatalogue subpermissions except for
'commit_MARC_records_to_catalog'. Also enable this patron to view the
staff client

5. Log in as user 1 (superlibrarian) go to Cataloging->New record and
select the 'Save' dropdown box and notice you have 4 options. Select
'Save and view record' and notice you have created a biblio in the
catalog.

6. Log in as user 2 go to Cataloging->New record and
click the 'Save' button and notice that there is only one option 'Save
as draft'.

7. Select 'Save as draft' and you are re-directed to the
Cataloging main page. Now select the 'View draft records' button and
view your draft record in the table of draft records.

8. Select the 'Edit' link and notice the addbiblio.pl page for the draft
record is loaded

9. Return to the View draft records interface and delete the draft
record and notice that after the page reloads the record is no longer
displayed in the table.

10. Create 2 more draft records and return to the View draft records
interface and select 'Delete all drafts from reservoir' and notice the
drafts table is emptied

11. Create 1 more draft record and then log out

12. Log in as user 1 (superlibrarian) and go to the 'View draft records'
interface.

13. Select the 'Edit' link

14. Select any save option except for 'Save as draft' and
notice the record is now returned for OPAC and staff client searches

15. Return to the 'View draft records' interface and notice the record
you just committed to the catalog has been removed as a draft record in
the reservoir.

16. Run the unit test t/db_dependent/ImportBatch.t in koha-shell

17. Notice that unit test 12 passes: 'ok 12 - No biblio expected since
we deleted the biblio from the batch'

18. Log out and back in as the second user and search for a biblio
record which is in the catalog (i.e. not a draft record) and notice both
in the staff client search results and the biblio detail page the links
to edit the record and items associated with the biblio record are not
displayed. This is because the user you are logged in as has all
edit_catalogue permissions except
CAN_user_editcatalogue_commit_MARC_records_to_catalog which is
neccessary to add/edit/delete biblios or items in the catalog.

Sponsored-By: Toi Ohomai Institute of Technology, New Zealand
Comment 32 Alex Buckley 2023-06-27 23:14:19 UTC
I don't have capacity to work on this, but if someone else wants to work on this they can.
Comment 33 Heather 2023-08-03 16:34:49 UTC
I just found this and it looks wonderful--it's not just useful for junior catalogers, but useful for cataloging something that could take a REALLY long time (i.e., there are items that require research, there are times when one is doing original cataloging and gets interrupted, etc.)

Is it ready to test for signing-off??
--h2