--- Comment #27 from Alex Buckley <> ---
Created attachment 92248
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

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 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 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 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/ 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

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

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 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

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

You are receiving this mail because:
You are watching all bug changes.
Koha-bugs mailing list
website :
git :
bugs :

Reply via email to