1/For the customer: - They wants to create themselves their topics (no freezed topics) - He could move report from a hierarchy to another (modify) - They need 2 level of hierarchy Suggests to use 2 authorised value lists: "GROUP" "SUBGROUP" When you register or modify a report, you first choose a "group" (code) and then a "subbgroup" (lib_opac wich represent the link between both). Liste N1 : GROUP Code lib lib_opac CIRC Circulation PRT CIRC Circulation RET CAT Catalogage BIB CAT Catalogage EX CAT Catalogage AUT ...etc Liste N2 : SUB_GROUP Code lib lib_OPAC PRT PRETS CIRC RET RETOURS CIRC BIB NOTICES BIB CAT EX NOTICES EX CAT AUT NOTICES AUT CAT 2 / From "Summary and Statistics" when saving the report, a proposal from the list of tabs (hierarchy) to classify the report as a topic of their choice. 3 / From .../cgi-bin/koha/reports/guided_reports.pl?phase= First show the top of hierarchies as tabs and then clicking on the opening of the hierarchy. Reports will be provided in a table with headers that are sortable. 4 / After you save the report ( .../cgi-bin/koha/reports/guided_reports.pl ) add a link from this page 'Start the new report'. 5 / Keep the link "Reports saved" under .../cgi-bin/koha/reports/guided_reports.pl?phase= But adding to the table "standard" one column "Posted in" going back the way the report is filed. Columns should also be sortable.
Created attachment 10394 [details] [review] bug_7993: Save reports with Group/Subgroup hierarchy This should make saved reports more manageable. Group/Subgroup hierarchy is stored in authorised_values, categories REPORT_GROUP and REPORT_SUBGROUP, connected by REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value Database changes: * authorised_values: expanded category to 16 chars * created default set of REPORT_GROUP authorised values to match hardcoded report areas * reports_dictionary: replaced area int with report_area text, converted values * saved_sql: added report_area, report_group and report_subgroup; report_area is not currently used, saved for the record C4/Reports/Guided.pm: * Replaced Area numeric values with the mnemonic codes * get_report_areas(): returns hardcoded areas list * created get_report_areas(): returns full hierarchy (groups with belonging subgroups) * save_report(): changed iterface, accepts fields hashref as input * update_sql(): changed iterface, accepts id and fields hashref as input * get_saved_reports():] - join to authorised_values to pick group and subgroup name - accept group and subgroup filter params * get_saved_report(): - changed iterface, return record hashref - join to authorised_values to pick group and subgroup name * build_authorised_value_list(): new sub, moved code from reports/guided_reports.pl * Updated interfaces in: cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report() reports/dictionary.pl: get_report_areas() reports/guided_reports.pl reports/guided_reports_start.tt: * Reports list: - added group/subgroup filter - display area/group/subgroup for the reports * Create report wizard: - carry area to the end - select group and subgroup when saving the report; group defaults to area, useful when report groups match areas * Update report and Create from SQL: added group/subgroup * Amended reports/guided_reports.pl accordingly Conflicts: C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl misc/cronjobs/runreport.pl reports/dictionary.pl reports/guided_reports.pl
Created attachment 10618 [details] [review] Bug 7993: Save reports with Group/Subgroup hierarchy This should make saved reports more manageable. Group/Subgroup hierarchy is stored in authorised_values, categories REPORT_GROUP and REPORT_SUBGROUP, connected by REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value Database changes: * authorised_values: expanded category to 16 chars * created default set of REPORT_GROUP authorised values to match hardcoded report areas * reports_dictionary: replaced area int with report_area text, converted values * saved_sql: added report_area, report_group and report_subgroup; report_area is not currently used, saved for the record C4/Reports/Guided.pm: * Replaced Area numeric values with the mnemonic codes * get_report_areas(): returns hardcoded areas list * created get_report_areas(): returns full hierarchy (groups with belonging subgroups) * save_report(): changed iterface, accepts fields hashref as input * update_sql(): changed iterface, accepts id and fields hashref as input * get_saved_reports():] - join to authorised_values to pick group and subgroup name - accept group and subgroup filter params * get_saved_report(): - changed iterface, return record hashref - join to authorised_values to pick group and subgroup name * build_authorised_value_list(): new sub, moved code from reports/guided_reports.pl * Updated interfaces in: cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report() reports/dictionary.pl: get_report_areas() reports/guided_reports.pl reports/guided_reports_start.tt: * Reports list: - added group/subgroup filter - display area/group/subgroup for the reports * Create report wizard: - carry area to the end - select group and subgroup when saving the report; group defaults to area, useful when report groups match areas * Update report and Create from SQL: added group/subgroup * Amended reports/guided_reports.pl accordingly Conflicts: C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl misc/cronjobs/runreport.pl reports/dictionary.pl reports/guided_reports.pl Rebased 2012/07/02 by Jared Camins-Esakov
This patch does not apply : CONFLICT (content): Merge conflict in svc/report CONFLICT (content): Merge conflict in opac/svc/report CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in C4/Reports/Guided.pm
Created attachment 11656 [details] [review] [SIGNED-OFF] Bug 7993: Save reports with Group/Subgroup hierarchy This should make saved reports more manageable. Group/Subgroup hierarchy is stored in authorised_values, categories REPORT_GROUP and REPORT_SUBGROUP, connected by REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value Database changes: * authorised_values: expanded category to 16 chars * created default set of REPORT_GROUP authorised values to match hardcoded report areas * reports_dictionary: replaced area int with report_area text, converted values * saved_sql: added report_area, report_group and report_subgroup; report_area is not currently used, saved for the record C4/Reports/Guided.pm: * Replaced Area numeric values with the mnemonic codes * get_report_areas(): returns hardcoded areas list * created get_report_areas(): returns full hierarchy (groups with belonging subgroups) * save_report(): changed iterface, accepts fields hashref as input * update_sql(): changed iterface, accepts id and fields hashref as input * get_saved_reports():] - join to authorised_values to pick group and subgroup name - accept group and subgroup filter params * get_saved_report(): - changed iterface, return record hashref - join to authorised_values to pick group and subgroup name * build_authorised_value_list(): new sub, moved code from reports/guided_reports.pl * Updated interfaces in: cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report() reports/dictionary.pl: get_report_areas() reports/guided_reports.pl reports/guided_reports_start.tt: * Reports list: - added group/subgroup filter - display area/group/subgroup for the reports * Create report wizard: - carry area to the end - select group and subgroup when saving the report; group defaults to area, useful when report groups match areas * Update report and Create from SQL: added group/subgroup * Amended reports/guided_reports.pl accordingly Conflicts: C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl misc/cronjobs/runreport.pl reports/dictionary.pl reports/guided_reports.pl Rebased 2012/07/02 by Jared Camins-Esakov Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Patch rebased on current master and tested OK.
QA comments: The qa tools says me the patch introduces wrong lines in a tt file: - xt/tt_valid.t tests... FAIL intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt: 520, 610, 727, 828 FAIL See Bug 8407 for more information. Please correct this and remove some useless commented lines (in opac/svc/report : else{warn}) Marked as Failed QA
Created attachment 11686 [details] [review] bug_7993: Save reports with Group/Subgroup hierarchy This should make saved reports more manageable. Group/Subgroup hierarchy is stored in authorised_values, categories REPORT_GROUP and REPORT_SUBGROUP, connected by REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value Database changes: * authorised_values: expanded category to 16 chars * created default set of REPORT_GROUP authorised values to match hardcoded report areas * reports_dictionary: replaced area int with report_area text, converted values * saved_sql: added report_area, report_group and report_subgroup; report_area is not currently used, saved for the record C4/Reports/Guided.pm: * Replaced Area numeric values with the mnemonic codes * get_report_areas(): returns hardcoded areas list * created get_report_areas(): returns full hierarchy (groups with belonging subgroups) * save_report(): changed iterface, accepts fields hashref as input * update_sql(): changed iterface, accepts id and fields hashref as input * get_saved_reports():] - join to authorised_values to pick group and subgroup name - accept group and subgroup filter params * get_saved_report(): - changed iterface, return record hashref - join to authorised_values to pick group and subgroup name * build_authorised_value_list(): new sub, moved code from reports/guided_reports.pl * Updated interfaces in: cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report() reports/dictionary.pl: get_report_areas() reports/guided_reports.pl reports/guided_reports_start.tt: * Reports list: - added group/subgroup filter - display area/group/subgroup for the reports * Create report wizard: - carry area to the end - select group and subgroup when saving the report; group defaults to area, useful when report groups match areas * Update report and Create from SQL: added group/subgroup * Amended reports/guided_reports.pl accordingly Conflicts: C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl misc/cronjobs/runreport.pl reports/dictionary.pl reports/guided_reports.pl svc/report opac/svc/report
I apologise but I did not know how to make a follow-up because I had conflicts when rebasing. Can you please either a) obsolete the signed-off patch and sign off the new one, or b) tell me how to produce a follow-up
Created attachment 11688 [details] [review] Bug 7993 Follow-up
Hello Srdjan, I made this follow-up by applying your patch over the initial one and resolving the conflicts. Please tell me if it contains all your changes (and nothing else). What did you do to have conflicts with signed-off patch? It's up-to-date according to master. Maybe you tried to apply the patch on a local branch not recently updated. To make a follow-up, just write another commit (if you are rebasing, fix your conflicts, git rebase --continue until you have finished, and then make another commit). Does it answer your question?
Thanks for that Julian, it looks good. What I did was rebased my local branch that I used for the patch to the master and got conflicts. At that point I was not sure which would be the starting point for my follow-up. So what I did was pretty much what you described, just need to know where to anchor my follow-up patch.
Created attachment 11775 [details] [review] [SIGNED-OFF] Bug 7993 Follow-up Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This patch is ok, but I found a problem with the first patch. I will submit another follow-up.
Created attachment 11776 [details] [review] Bug 7993: Several bug fixes - Re-display text input for sql params that are not linked to a list of values - Fix passing report id to template
Created attachment 11809 [details] [review] Signed off patch
Patch does not apply CONFLICT (content): Merge conflict in reports/guided_reports.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Created attachment 12095 [details] [review] Bug 7993: Save reports with Group/Subgroup hierarchy Patch was signed off. Rebase conflict was in reports/guided_reports.pl
Patch tested with a sandbox, by Delaye Stephane <stephane.delaye@biblibre.com>
Created attachment 12126 [details] [review] Bug 7993: Save reports with Group/Subgroup hierarchy This should make saved reports more manageable. Group/Subgroup hierarchy is stored in authorised_values, categories REPORT_GROUP and REPORT_SUBGROUP, connected by REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value Database changes: * authorised_values: expanded category to 16 chars * created default set of REPORT_GROUP authorised values to match hardcoded report areas * reports_dictionary: replaced area int with report_area text, converted values * saved_sql: added report_area, report_group and report_subgroup; report_area is not currently used, saved for the record C4/Reports/Guided.pm: * Replaced Area numeric values with the mnemonic codes * get_report_areas(): returns hardcoded areas list * created get_report_areas(): returns full hierarchy (groups with belonging subgroups) * save_report(): changed iterface, accepts fields hashref as input * update_sql(): changed iterface, accepts id and fields hashref as input * get_saved_reports():] - join to authorised_values to pick group and subgroup name - accept group and subgroup filter params * get_saved_report(): - changed iterface, return record hashref - join to authorised_values to pick group and subgroup name * build_authorised_value_list(): new sub, moved code from reports/guided_reports.pl * Updated interfaces in: cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report() reports/dictionary.pl: get_report_areas() reports/guided_reports.pl reports/guided_reports_start.tt: * Reports list: - added group/subgroup filter - display area/group/subgroup for the reports * Create report wizard: - carry area to the end - select group and subgroup when saving the report; group defaults to area, useful when report groups match areas * Update report and Create from SQL: added group/subgroup * Amended reports/guided_reports.pl accordingly Conflicts: C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl misc/cronjobs/runreport.pl reports/dictionary.pl reports/guided_reports.pl Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>
(In reply to comment #19) > Created attachment 12126 [details] [review] > Bug 7993: Save reports with Group/Subgroup hierarchy > > Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com> patch looks good, passing QA… $ koha-qa.pl testing 1 commit(s) (applied to commit 3f31617) * 4d90348 Bug 7993: Save reports with Group/Subgroup hierarchy C4/Reports/Guided.pm admin/authorised_values.pl installer/data/mysql/kohastructure.sql installer/data/mysql/updatedatabase.pl koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt misc/cronjobs/runreport.pl opac/svc/report reports/dictionary.pl reports/guided_reports.pl svc/report * C4/Reports/Guided.pm OK * admin/authorised_values.pl OK * installer/data/mysql/updatedatabase.pl OK * misc/cronjobs/runreport.pl OK * reports/dictionary.pl OK * reports/guided_reports.pl OK * koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt OK * koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt OK
Patch pushed to master However, a few questions/glitches: * the "type" and "Area" columns can't be filled when you edit an SQL directly, and can't be updated anyway. Shouldn't we do something for that ? * Shouldn't group/sub-group be the first columns ? * do we need the ID displayed ? * on my laptop, the "Notes" tab is really small, and would not deserve be larger (we could put subgroup in the same column as group, because it will not be used everyday * why are author column and date not sortable ?
Jenkins complain because of an incorrect pod doc. I've pushed a follow-up to fix it.
Ok in master