Summary: | Adding the ability to define customised basketgroups PDF layouts | ||
---|---|---|---|
Product: | Koha | Reporter: | Mathieu Saby <mathsabypro> |
Component: | Acquisitions | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | jonathan.druart, marjorie.barry-vila, patrick.robitaille, severine.queune, veron |
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: | ||
Circulation function: | |||
Bug Depends on: | 10746 | ||
Bug Blocks: | |||
Attachments: |
[PATCH] Bug 10135 : Add the ability to define customised basketgroups pdf layouts
Example to test : new layout "msaby" [PATCH] Bug 10135 : Add the ability to define customised basketgroups pdf layouts |
Description
Mathieu Saby
2013-04-27 17:04:13 UTC
I have prepared a patch for improving Koha behavior ; it is checking all *.pm files in acqui/pdfformat and building a list from there names. These names is used to create an option list OrderPdfFormat syspref. So, in a standard Koha, you will have 2 choices, like before, but if you create an other pm file in acqui/pdfformat (and if needed, new pdf files in koha-tmpl/prof/pdf), you will have new choices. M. Saby Created attachment 17756 [details] [review] [PATCH] Bug 10135 : Add the ability to define customised basketgroups pdf layouts This patch create a sub in Koha.pm which get the list of .pm files in acqui/pdfformat. The list is used to build an option list for OrderPdfFormat syspref, instead of a free input. In a standard Koha, only the design of OrderPdfFormat should be altered. If you put a new .pm file in acqui/pdfformat (and if needed a new pdf file in koha-tmpl/intranet/prog/pdf), you will see the name of the file as a new option in OrderPdfFormat. To test : A. in a standard Koha, check everything is working like before: - 1. you have 2 options in OrderPdfFormat (pdfformat::layout2pages ; pdfformat::layout3pages) - 2. select one layout, and try to print a basketgroup - 3. select the 2d layout, and try to print a basketgroup B. check you can add a new layout - 1. Either create your own layout if you know how to do Or dowload and apply the 2d attachment to this bug. It contains an example : a layout named "pdfformat::msaby" - 2. Check the new layout is visible in OrderPdfFormat - 3. Select it, and try to print a basketgroup - 4. Select one of the "old" layouts, and try to print a basketgroup. M. Saby Created attachment 17757 [details] [review] Example to test : new layout "msaby" This is not a part of the enhancement, but just an example to test it. (see test plan) M. Saby Created attachment 18226 [details] [review] [PATCH] Bug 10135 : Add the ability to define customised basketgroups pdf layouts correction of a typo Mathieu, your patch adds a new routine. Could you provide a unit test for it please? Marked as Failed QA. OK. But this is a QA issue, and the patch has not been tested yet. I think Pierre Angot want to so so. Could I set it again in "need sign off" ? Mathieu Maybe there is also other QA issue, for example, what is the best location in Koha directory hierarchy to store customized layout templates? Mathieu A new type of this kind for syspref is not a best choice I think. Why do you want to list the directory? The value can be filled manually. I agree with your changes in /acqui/basketgroup.pl I think we just want: - if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages'){ eval { eval "require $pdfformat"; import $pdfformat; }; if ($@){ + print $input->header; + print $input->start_html; # FIXME Should do a nicer page + print "<h1>Invalid PDF Format set</h1>"; + print "Please go to the systempreferences and set a valid pdfformat"; + exit; } - } - else { - print $input->header; - print $input->start_html; # FIXME Should do a nicer page - print "<h1>Invalid PDF Format set</h1>"; - print "Please go to the systempreferences and set a valid pdfformat"; - exit; - } I completely disagree with others changes. Someone added a control to prevent librarians to choose a non existing layout : at present we only can choose only layout2pages and layout3pages. So I thought we cannot just let librarians put any value in the syspref, as this could create a new way to "break" Koha. That's why I thought we could use a dropdow menu like the one beeing used for opac templates, to be sure a librarian cannot use a non existing layout. But maybe that's useless. That's why I asked the help of koha-devel list in december, but I had no real advice, so I decided to realize my idea ;-) http://web.archiveorange.com/archive/v/O5wWPk28B1FY7zsUFIz8 I believe I asked Chris too, but I cannot find his answer. Maybe I dreamt... Mathieu Still valid? yes. Still valid, but maybe we should mark it WONTFIX and move away from the PDF printing in favor of something more flexible/easier to customize? I've filed bug 31723 for this. I'll go ahead and close it, please reopen if you disagree! |