Bug 15801 - Move the framework related code to Koha::BiblioFramework[s] - part 2
Summary: Move the framework related code to Koha::BiblioFramework[s] - part 2
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 14889
Blocks: 15779 15803 16792 19372
  Show dependency treegraph
 
Reported: 2016-02-11 14:32 UTC by Jonathan Druart
Modified: 2017-09-27 15:50 UTC (History)
4 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 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.58 KB, patch)
2016-02-11 15:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (29.36 KB, patch)
2016-02-11 15:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.89 KB, patch)
2016-02-11 15:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.59 KB, patch)
2016-03-10 11:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.89 KB, patch)
2016-03-10 11:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.86 KB, patch)
2016-03-10 11:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.85 KB, patch)
2016-04-15 08:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.59 KB, patch)
2016-05-10 15:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.90 KB, patch)
2016-05-10 15:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.87 KB, patch)
2016-05-10 15:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.85 KB, patch)
2016-05-11 13:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: minor fixes (2.73 KB, patch)
2016-05-11 13:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.69 KB, patch)
2016-05-11 13:59 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.99 KB, patch)
2016-05-11 13:59 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.95 KB, patch)
2016-05-11 13:59 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15801: minor fixes (2.84 KB, patch)
2016-05-11 14:00 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.68 KB, patch)
2016-08-12 08:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.66 KB, patch)
2016-08-12 08:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.93 KB, patch)
2016-08-12 08:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: minor fixes (2.86 KB, patch)
2016-08-12 08:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.72 KB, patch)
2016-09-19 09:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.66 KB, patch)
2016-09-19 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (11.92 KB, patch)
2016-09-19 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: minor fixes (2.85 KB, patch)
2016-09-19 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.84 KB, patch)
2016-10-14 07:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.77 KB, patch)
2016-10-14 07:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (12.31 KB, patch)
2016-10-14 07:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 15801: minor fixes (2.98 KB, patch)
2016-10-14 07:41 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop (9.58 KB, patch)
2016-10-24 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks (27.69 KB, patch)
2016-10-24 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo (12.26 KB, patch)
2016-10-24 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15801: minor fixes (2.94 KB, patch)
2016-10-24 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-02-11 14:32:37 UTC
Three subroutines from the C4::Koha module deal with biblio frameworks and could be replaced or moved to Koha::BiblioFramework:
- getframeworks
- getframeworkinfo
- GetFrameworksLoop
Comment 1 Jonathan Druart 2016-02-11 15:18:33 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-02-11 15:18:36 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-02-11 15:18:40 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-02-11 15:19:13 UTC
To test this patch, makes sure you have the last patch from bug 14889 applied:
  Bug 14889: Fix typo in Koha/BiblioFrameworks.pm
Comment 5 Jonathan Druart 2016-03-10 11:22:06 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-03-10 11:22:13 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-03-10 11:22:17 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-03-10 11:22:31 UTC
Patches rebased.
Comment 9 Mirko Tietgen 2016-04-14 19:02:31 UTC
Can't apply.

>fatal: sha1 information is lacking or useless (C4/Koha.pm).
>Dem Repository fehlen notwendige Blobs um auf einen 3-Wege-Merge zurückzufallen.
>Kann nicht zu 3-Wege-Merge zurückfallen.
>Anwendung des Patches fehlgeschlagen bei 0001 Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo
Comment 10 Jonathan Druart 2016-04-15 08:14:57 UTC Comment hidden (obsolete)
Comment 11 Bernardo Gonzalez Kriegel 2016-05-10 01:06:37 UTC
Sorry, does not apply again.
I promise to test and sign.

Applying: Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
fatal: sha1 information is lacking or useless (C4/Koha.pm).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Comment 12 Jonathan Druart 2016-05-10 15:26:16 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2016-05-10 15:26:46 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2016-05-10 15:27:40 UTC Comment hidden (obsolete)
Comment 15 Bernardo Gonzalez Kriegel 2016-05-11 13:06:52 UTC
Hi Jonathan

1) Small qa fail
 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
 FAIL   forbidden patterns
                forbidden pattern: tab char (line 66)

2) Bad: Can't change framework on edit, think that this code needs change

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt

line 495+            [% FOREACH frameworkcodeloo IN frameworkcodeloop %]

3) Test plan for third patch: don't get a warning, only a link to fast catalog if FA is present and have right permissions.


All other parts of all test plans works.
Comment 16 Jonathan Druart 2016-05-11 13:35:52 UTC Comment hidden (obsolete)
Comment 17 Jonathan Druart 2016-05-11 13:35:56 UTC Comment hidden (obsolete)
Comment 18 Jonathan Druart 2016-05-11 13:37:01 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #15)
> Hi Jonathan

Hi Bernardo, Thanks for testing :)

> 1) Small qa fail
>  FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
>  FAIL   forbidden patterns
>                 forbidden pattern: tab char (line 66)

Fixed.

> 2) Bad: Can't change framework on edit, think that this code needs change
> 
> koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
> 
> line 495+            [% FOREACH frameworkcodeloo IN frameworkcodeloop %]

Fixed as well.


> 3) Test plan for third patch: don't get a warning, only a link to fast
> catalog if FA is present and have right permissions.

I have updated the test plan, actually you should see a "Fast cataloguing" like if the FA framework exists.
Comment 19 Bernardo Gonzalez Kriegel 2016-05-11 13:59:39 UTC Comment hidden (obsolete)
Comment 20 Bernardo Gonzalez Kriegel 2016-05-11 13:59:51 UTC Comment hidden (obsolete)
Comment 21 Bernardo Gonzalez Kriegel 2016-05-11 13:59:58 UTC Comment hidden (obsolete)
Comment 22 Bernardo Gonzalez Kriegel 2016-05-11 14:00:07 UTC Comment hidden (obsolete)
Comment 23 Jonathan Druart 2016-08-12 08:46:39 UTC
Created attachment 54348 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop

The C4::Koha::GetFrameworksLoop retrieves biblio frameworks and returns
them ordered by the description (frameworktext). If a parameter is
passed, a selected flag is set. The selection of the options should be
done on the template side.
These 2 calls can be replaced with
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });

Test plan:
1/ Go on a Labeled MARC biblio view (catalogue/labeledMARCdetail.pl)
You should see a dropdown list with the biblio frameworks. The framework
of the record should be selected by default
2/ Create a sql report using the biblio_framework parameter, something
like:
  SELECT COUNT(*) FROM biblio WHERE frameworkcode=<<framework|biblio_framework>>
Save and execute the report.
You should get a dropdown list with the framework list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both dropdowns Ok
No errors
Comment 24 Jonathan Druart 2016-08-12 08:46:43 UTC
Created attachment 54349 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks

C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors
Comment 25 Jonathan Druart 2016-08-12 08:46:50 UTC
Created attachment 54350 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo

This was the "Get" subroutine for the framework, it can be easily
replaced with a call to the Koha::BiblioFrameworks->find method.
This patch also replaces some confusing wordings (framework vs frameworkcode).

Test plan:
On the circulation home page, you should see a "Fast cataloguing" link
if the FA framework exists.

Note that the admin/marctagstructure.pl has already been tested in the
previous patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Link pops Ok
No errors
Comment 26 Jonathan Druart 2016-08-12 08:46:53 UTC
Created attachment 54351 [details] [review]
Bug 15801: minor fixes

- Fix a tab
- Fix a variable name in a template

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

With all patches applied no errors.
Comment 27 Katrin Fischer 2016-09-18 21:10:36 UTC
A bit too many conflicts for me to fix - can you please take a look, Jonathan?
Comment 28 Jonathan Druart 2016-09-19 09:10:58 UTC
Created attachment 55688 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop

The C4::Koha::GetFrameworksLoop retrieves biblio frameworks and returns
them ordered by the description (frameworktext). If a parameter is
passed, a selected flag is set. The selection of the options should be
done on the template side.
These 2 calls can be replaced with
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });

Test plan:
1/ Go on a Labeled MARC biblio view (catalogue/labeledMARCdetail.pl)
You should see a dropdown list with the biblio frameworks. The framework
of the record should be selected by default
2/ Create a sql report using the biblio_framework parameter, something
like:
  SELECT COUNT(*) FROM biblio WHERE frameworkcode=<<framework|biblio_framework>>
Save and execute the report.
You should get a dropdown list with the framework list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both dropdowns Ok
No errors
Comment 29 Jonathan Druart 2016-09-19 09:11:09 UTC
Created attachment 55689 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks

C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors
Comment 30 Jonathan Druart 2016-09-19 09:11:14 UTC
Created attachment 55690 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo

This was the "Get" subroutine for the framework, it can be easily
replaced with a call to the Koha::BiblioFrameworks->find method.
This patch also replaces some confusing wordings (framework vs frameworkcode).

Test plan:
On the circulation home page, you should see a "Fast cataloguing" link
if the FA framework exists.

Note that the admin/marctagstructure.pl has already been tested in the
previous patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Link pops Ok
No errors
Comment 31 Jonathan Druart 2016-09-19 09:11:19 UTC
Created attachment 55691 [details] [review]
Bug 15801: minor fixes

- Fix a tab
- Fix a variable name in a template

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

With all patches applied no errors.
Comment 32 Marcel de Rooy 2016-10-14 06:57:02 UTC
QA: Looking here now
Comment 33 Marcel de Rooy 2016-10-14 07:41:44 UTC
Created attachment 56452 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop

The C4::Koha::GetFrameworksLoop retrieves biblio frameworks and returns
them ordered by the description (frameworktext). If a parameter is
passed, a selected flag is set. The selection of the options should be
done on the template side.
These 2 calls can be replaced with
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });

Test plan:
1/ Go on a Labeled MARC biblio view (catalogue/labeledMARCdetail.pl)
You should see a dropdown list with the biblio frameworks. The framework
of the record should be selected by default
2/ Create a sql report using the biblio_framework parameter, something
like:
  SELECT COUNT(*) FROM biblio WHERE frameworkcode=<<framework|biblio_framework>>
Save and execute the report.
You should get a dropdown list with the framework list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both dropdowns Ok
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 34 Marcel de Rooy 2016-10-14 07:41:50 UTC
Created attachment 56453 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks

C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 35 Marcel de Rooy 2016-10-14 07:41:54 UTC
Created attachment 56454 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo

This was the "Get" subroutine for the framework, it can be easily
replaced with a call to the Koha::BiblioFrameworks->find method.
This patch also replaces some confusing wordings (framework vs frameworkcode).

Test plan:
On the circulation home page, you should see a "Fast cataloguing" link
if the FA framework exists.

Note that the admin/marctagstructure.pl has already been tested in the
previous patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Link pops Ok
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 36 Marcel de Rooy 2016-10-14 07:41:58 UTC
Created attachment 56455 [details] [review]
Bug 15801: minor fixes

- Fix a tab
- Fix a variable name in a template

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

With all patches applied no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 37 Jonathan Druart 2016-10-24 13:24:30 UTC
Created attachment 56766 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::GetFrameworksLoop

The C4::Koha::GetFrameworksLoop retrieves biblio frameworks and returns
them ordered by the description (frameworktext). If a parameter is
passed, a selected flag is set. The selection of the options should be
done on the template side.
These 2 calls can be replaced with
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });

Test plan:
1/ Go on a Labeled MARC biblio view (catalogue/labeledMARCdetail.pl)
You should see a dropdown list with the biblio frameworks. The framework
of the record should be selected by default
2/ Create a sql report using the biblio_framework parameter, something
like:
  SELECT COUNT(*) FROM biblio WHERE frameworkcode=<<framework|biblio_framework>>
Save and execute the report.
You should get a dropdown list with the framework list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Both dropdowns Ok
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 38 Jonathan Druart 2016-10-24 13:24:36 UTC
Created attachment 56767 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks

C4::Koha::getframeworks returned a hashref of biblio frameworks.
It was mainly used to generate the dropdown list of frameworks.
The scripts modified in this patch did not necessary order the element
by description (frameworktext), the displays were not consistent from
one screen to another.
Using the same search method everywhere:
  Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
We will know always get the framework in the same order.

Test plan:
Following the different pages modified by this patch, and make sure the
frameworks are displayed correctly in the dropdown list:
1/ acqui/z3950_search.pl - Create an order from an external source.
2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field
3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select
another framework than the default one and click on the 'Search' button
4/ catalogue/MARCdetail.pl - On the MARC defail page, change the
framework you want to use to display the record
5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its
framework. When editing, the framework of the record should be selected
by default
6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click
on the "New record" button. You should see all the frameworks
7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first
step (select the merge reference), you should be allowed to select the
framework to use.
8/ tools/inventory.pl - On the inventory page, the "Item statuses" part
should be populated as before this patch
9/ tools/manage-marc-import.pl - Stage records for import. Before
importing them into the catalog, you should see the framework dropdown
list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok.
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 39 Jonathan Druart 2016-10-24 13:24:48 UTC
Created attachment 56768 [details] [review]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworkinfo

This was the "Get" subroutine for the framework, it can be easily
replaced with a call to the Koha::BiblioFrameworks->find method.
This patch also replaces some confusing wordings (framework vs frameworkcode).

Test plan:
On the circulation home page, you should see a "Fast cataloguing" link
if the FA framework exists.

Note that the admin/marctagstructure.pl has already been tested in the
previous patch.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Link pops Ok
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 40 Jonathan Druart 2016-10-24 13:24:54 UTC
Created attachment 56769 [details] [review]
Bug 15801: minor fixes

- Fix a tab
- Fix a variable name in a template

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

With all patches applied no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 41 Kyle M Hall (khall) 2016-10-28 12:06:31 UTC
Pushed to master for 16.11, thanks Jonathan!