[% IF ( latestserial.status1 ) %]Expected[% END %] [% IF ( latestserial.status2 ) %]Arrived[% END %] [% IF ( latestserial.status3 ) %]Late[% END %] ... These statements are repeated multiple times, in the following files: intranet-tmpl/prog/en/modules/catalogue/detail.tt intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt intranet-tmpl/prog/en/modules/serials/claims.tt intranet-tmpl/prog/en/modules/serials/serials-recieve.tt intranet-tmpl/prog/en/modules/serials/serials-collection.tt intranet-tmpl/prog/en/modules/serials/serials-edit.tt intranet-tmpl/prog/en/modules/serials/subscription-detail.tt opac-tmpl/prog/en/modules/opac-full-serial-issues.tt opac-tmpl/prog/en/modules/opac-detail.tt To prevent things from getting out of sync, they should be folded into a single TT block or macro.
Created attachment 78175 [details] [review] Bug 12187: Duplicate TT code for serial statuses Instead of duplicating the code for serial statuses in multiple files, move all of them into single include file, and use that. Needs a test plan, but I haven't used serials.
Hi Pasi, I'm used to serials features and can esily test the different pages, but I don't have any idea about the differences in using .pl or .tt pages... Can you enlighten me about the different points or behaviours I need to pay attention ? Or do I just work as usual on the pages you mentioned and check there are no issues ? Thanks ! Séverine
Patch no longer applies 8-(
Created attachment 98966 [details] [review] Bug 12187: Duplicate TT code for serial statuses Instead of duplicating the code for serial statuses in multiple files, move all of them into single include file, and use that. Needs a test plan, but I haven't used serials. Rebased
Thanks Bernardo! I don't know anything about serials, so will wait for a test plan.
Created attachment 101743 [details] [review] Bug 12187: (follow-up) Reindent new include file This patch re-indents the new include file so that it is consistent with coding guidelines. Taking this opportunity to add a full test plan: Instead of duplicating the code for serial statuses in multiple files, move all of them into single include file, and use that. To test, apply the patch and go to Serials. - Search for a subscription which has multiple issues. - On the subscription detail page, open the "Issues" tab. - Statuses in the "Status" column should display correctly. - Click the "Serial collection" link in the sidebar. - In the table of issues, the "Status" colunn should display the correct information. - Select some isues and click the "Edit serials" button. - In the "Status" column, the options should display correctly. - Test setting various statuses and saving. The statuses should save correctly. - Click "Claims" in the sidebar menu and select a vendor. - In the list of missing issues the "Status" column should show the correct information. - In the catalog, locate the bibliographic record for a subscription with issues. - Under the "Subscriptions" tab check the "Status" column. Status information should be displayed correctly.
Created attachment 102047 [details] [review] Bug 12187: Duplicate TT code for serial statuses Instead of duplicating the code for serial statuses in multiple files, move all of them into single include file, and use that. Needs a test plan, but I haven't used serials. Rebased Signed-off-by: David Nind <david@davidnind.com>
Created attachment 102048 [details] [review] Bug 12187: (follow-up) Reindent new include file This patch re-indents the new include file so that it is consistent with coding guidelines. Taking this opportunity to add a full test plan: Instead of duplicating the code for serial statuses in multiple files, move all of them into single include file, and use that. To test, apply the patch and go to Serials. - Search for a subscription which has multiple issues. - On the subscription detail page, open the "Issues" tab. - Statuses in the "Status" column should display correctly. - Click the "Serial collection" link in the sidebar. - In the table of issues, the "Status" colunn should display the correct information. - Select some isues and click the "Edit serials" button. - In the "Status" column, the options should display correctly. - Test setting various statuses and saving. The statuses should save correctly. - Click "Claims" in the sidebar menu and select a vendor. - In the list of missing issues the "Status" column should show the correct information. - In the catalog, locate the bibliographic record for a subscription with issues. - Under the "Subscriptions" tab check the "Status" column. Status information should be displayed correctly. Signed-off-by: David Nind <david@davidnind.com>
Hi Pasi, That's great! I would recommend 2 things: 1. Add a comment at the top of the include file to add a bit of doc 2. Replace HideStatuses with an array: HideStatuses=[1,8] Then use grep in the include file What do you think? Keep in mind that we use snake_case instead of CamelCase for var names.
Bug 32752 resolved this I think. :) *** This bug has been marked as a duplicate of bug 32752 ***