Bug 19520

Summary: Show more information about rotating collections
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: ToolsAssignee: Josef Moravec <josef.moravec>
Status: BLOCKED --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: black23, marjorie.barry-vila
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19519    
Bug Blocks:    
Attachments: Bug 19520: Update database
Bug 19520: Update databse schema files
Bug 19520: Add tests
Bug 19520: Add more information about rotating collections
Bug 19520: Update database
Bug 19520: Update databse schema files
Bug 19520: Add tests
Bug 19520: Add more information about rotating collections
Bug 19520: Update database
Bug 19520: Update databse schema files
Bug 19520: Add tests
Bug 19520: Add more information about rotating collections

Description Josef Moravec 2017-10-23 19:01:01 UTC
On colections list and detail:
- Number of items in collection
- Number of transferred/untransferred items
- Librarian who created the collection
- Date of creation
- Date of last transfer
Comment 1 Josef Moravec 2018-03-13 22:18:03 UTC
Created attachment 72819 [details] [review]
Bug 19520: Update database
Comment 2 Josef Moravec 2018-03-13 22:18:07 UTC
Created attachment 72820 [details] [review]
Bug 19520: Update databse schema files
Comment 3 Josef Moravec 2018-03-13 22:18:11 UTC
Created attachment 72821 [details] [review]
Bug 19520: Add tests
Comment 4 Josef Moravec 2018-03-13 22:18:14 UTC
Created attachment 72822 [details] [review]
Bug 19520: Add more information about rotating collections

Test plan:
1) Apply the patch
2) Update database
3)
) prove t/db_dependent/Koha/RotatingCollections.t
Comment 5 Mark Tompsett 2018-03-14 17:02:58 UTC
Comment on attachment 72819 [details] [review]
Bug 19520: Update database

Review of attachment 72819 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/atomicupdate/Bug19520_Add_more_information_to_rotating_collections.perl
@@ +5,5 @@
> +    $dbh->do( "ALTER TABLE collections ADD CONSTRAINT `collections_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE");
> +
> +    $dbh->do( "ALTER TABLE collections ADD COLUMN createdOn datetime default NULL AFTER createdBy" );
> +
> +    $dbh->do( "ALTER TABLE collections ADD COLUMN lastTransferredOn datetime default NULL AFTER createdOn" );

These 4 do's should be encapsulated by !column_exists checks.

@@ +10,5 @@
> +
> +    # or perform some test and warn
> +    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
> +    #    warn "There is something wrong";
> +    # }

And you don't need comments. :)
Comment 6 Josef Moravec 2018-03-25 19:47:05 UTC
Created attachment 73260 [details] [review]
Bug 19520: Update database
Comment 7 Josef Moravec 2018-03-25 19:47:10 UTC
Created attachment 73261 [details] [review]
Bug 19520: Update databse schema files
Comment 8 Josef Moravec 2018-03-25 19:47:14 UTC
Created attachment 73262 [details] [review]
Bug 19520: Add tests
Comment 9 Josef Moravec 2018-03-25 19:47:18 UTC
Created attachment 73263 [details] [review]
Bug 19520: Add more information about rotating collections

Test plan:
1) Apply the patch
2) Update database
3) prove t/db_dependent/Koha/RotatingCollections.t
Comment 10 Josef Moravec 2018-03-25 19:47:43 UTC
(In reply to M. Tompsett from comment #5)
> Comment on attachment 72819 [details] [review] [review]
> Bug 19520: Update database
> 
> Review of attachment 72819 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> :::
> installer/data/mysql/atomicupdate/
> Bug19520_Add_more_information_to_rotating_collections.perl
> @@ +5,5 @@
> > +    $dbh->do( "ALTER TABLE collections ADD CONSTRAINT `collections_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE");
> > +
> > +    $dbh->do( "ALTER TABLE collections ADD COLUMN createdOn datetime default NULL AFTER createdBy" );
> > +
> > +    $dbh->do( "ALTER TABLE collections ADD COLUMN lastTransferredOn datetime default NULL AFTER createdOn" );
> 
> These 4 do's should be encapsulated by !column_exists checks.
> 
> @@ +10,5 @@
> > +
> > +    # or perform some test and warn
> > +    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
> > +    #    warn "There is something wrong";
> > +    # }
> 
> And you don't need comments. :)

Done, thanks ;)
Comment 11 Josef Moravec 2018-03-28 15:35:23 UTC
Created attachment 73394 [details] [review]
Bug 19520: Update database
Comment 12 Josef Moravec 2018-03-28 15:35:27 UTC
Created attachment 73395 [details] [review]
Bug 19520: Update databse schema files
Comment 13 Josef Moravec 2018-03-28 15:35:30 UTC
Created attachment 73396 [details] [review]
Bug 19520: Add tests
Comment 14 Josef Moravec 2018-03-28 15:35:33 UTC
Created attachment 73397 [details] [review]
Bug 19520: Add more information about rotating collections

Test plan:
1) Apply the patch
2) Update database
3) prove t/db_dependent/Koha/RotatingCollections.t
Comment 15 Michal Denar 2018-09-19 20:18:32 UTC
Josef, can You rebase this bug?

Thank You


Mike