This project is mirrored from git://git.koha-community.org/koha.git. Updated .
  1. 25 Oct, 2017 1 commit
  2. 19 May, 2017 1 commit
    • joubu's avatar
      Bug 17898: Automagically convert SQL reports · f22d2e72
      joubu authored
      Bug 17196 move the marcxml out of the biblioitems table.
      That will break SQL reports using it.
      It would be handy to propose an automagically way to convert the SQL
      reports.
      
      We do not want to update the reports automatically without user inputs,
      it will be too hasardous.
      However we can lead the user to convert them.
      
      In this patchset I suggest to warn the user if a report is subject to be
      updated.
      
      TODO: Add a way to mark this job done (using a pref?) to remove the
      check and not to display false positives.
      
      Test plan:
      - Create some SQL reports (see https://wiki.koha-community.org/wiki/SQL_Reports_Library)
      - Go on the report list page (/reports/guided_reports.pl?phase=Use saved)
      - For the reports using biblioitems.marcxml you will see a new column
      warning you that it is obsolete
      - Click on update link
      => that will open a modal with the converted SQL query
      - Click on the update button
      => you will be informed that the query has been updated
      
      If all the reports are updated, the new column "Update" will no longer
      be displayed.
      Signed-off-by: default avatarTomas Cohen Arazi <tomascohen@theke.io>
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      f22d2e72
  3. 31 Mar, 2017 1 commit
  4. 07 Nov, 2016 1 commit
  5. 25 Sep, 2016 1 commit
    • joubu's avatar
      Bug 14435: Add the ability to store result's report · cf903171
      joubu authored
      At one time it was possible to store the results of a report into the
      saved_reports table.
      This allowed the librarians to compare different results, from the Koha
      interface.
      
      This patch is a proof of concept and is not very polished (understood:
      it cannot be pushed like that).
      
      Test plan:
      Execute the runreport.pl cronjob script with the new --store-results
      option.
      This will serialize into json the results and put it into the
      saved_reports table.
      
      On the "Saved report" list, the "Saved results" column is now populated
      with a date (note that you can have several date for a given report).
      If you click on this link, the data will be displayed in a simple table.
      Signed-off-by: Chris Cormack's avatarChris Cormack <chris@bigballofwax.co.nz>
      Signed-off-by: default avatarKatrin Fischer  <katrin.fischer@bsz-bw.de>
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      cf903171
  6. 08 Sep, 2016 1 commit
    • joubu's avatar
      Bug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm · 3bb15783
      joubu authored
      This patch replaces sql queries done in some pl script and in
      C4::Reports::Guided.
      Since we have now a Koha::Patron::Categories module, we should use it
      where it is possible.
      
      Test plan:
      - Prerequisite: Be sure you have several patron categories created, with
        different option enabled, and limit some to certain libraries.
      - On the 'Circulation and fine rules' admin page (admin/smart-rules.pl),
        all the patron categories should be displayed (even the ones limited to
        another library), ordered by description. Try to add/update existing rules.
      - On the overdue rules page (tools/overduerules.pl), all the patron
        categories with overduenoticerequired set should be displayed.
        Try to add/update existing rules.
      - On the following reports:
          reports/borrowers_stats.pl
          reports/issues_avg_stats.pl
      The patron categories should be displayed. Note that there is an
      inconsistency with these 2 reports: the patron categories limited to
      other libraries are displayed on them, when they are not on the other
      reports. This should certainly be fixed (on another bug report).
      Signed-off-by: Chris Cormack's avatarChris Cormack <chris@bigballofwax.co.nz>
      Signed-off-by: default avatarMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      3bb15783
  7. 24 Mar, 2016 3 commits
  8. 02 Mar, 2016 1 commit
    • joubu's avatar
      Bug 15800: Koha::AuthorisedValues - Remove C4::Koha::IsAuthorisedValueCategory · 0fdc1021
      joubu authored
      C4::Koha::IsAuthorisedValueCategory contains only 2 useful calls, from
      C4::Reports::Guided and reports/guided_reports.pl
      It can be replaced with
        Koha::AuthorisedValues->search({ category => $authorised_value})->count
      
      Test plan:
      1/ Create a sql report using an authorised value category, something
      like:
        SELECT COUNT(*) FROM items where itemlost=<<lost|LOST>>
      2/ Execute the report and confirm that everything works fine.
      3/ Create a sql report using a nonexistent authorised value categor,
      something like:
        SELECT COUNT(*) FROM items where itemlost=<<lost|NONEXIST>>
      4/ When saving the report, you should get a warning message
        "lost: The authorized value category (NONEXIST) you selected does not exist."
      5/ Save anyway and execute the report, you should get the same warning
      message.
      
      QA:
        git grep IsAuthorisedValueCategory
      should not return any results
        prove t/db_dependent/ReportsGuided.t
      should return green
      Signed-off-by: default avatarHector Castro <hector.hecaxmmx@gmail.com>
      Works as described
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      
      Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com 
      0fdc1021
  9. 24 Feb, 2016 1 commit
  10. 26 Oct, 2015 1 commit
  11. 25 Sep, 2015 1 commit
  12. 22 Jun, 2015 1 commit
  13. 04 Jun, 2015 2 commits
  14. 26 May, 2015 2 commits
  15. 19 May, 2015 1 commit
  16. 06 May, 2015 1 commit
    • joubu's avatar
      Bug 10976: Fix typo itemtype vs itemtypes · 856887ab
      joubu authored
      When creating a new report, the limit step let you choose
      itype|itemtype.
      But it should be itype|itemtypes.
      If you try to create a guided report and you choose this option as a
      limit, you will get a warning on saving it:
        Errors found when processing parameters for report:
        itype: The authorized value category (itemtype) you selected does not exist.
      
      Looking at the code: reports/guided_reports.pl l.657
        elsif ( $authorised_value eq "itemtypes" ) {
      
      Test plan:
      0/ Don't apply the patch
      1/ Create a guided report, select Koha itemtype as a limit(step 4)
      2/ Confirm you get the error when saving
      3/ Apply the patch and repeat step 1
      4/ There is no error and the report should work correctly
      
      Tested with steps in comment #4/#5, error is gone after applying patch.
      Signed-off-by: default avatarMarc Véron <veron@veron.ch>
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <katrin.fischer.83@web.de>
      Signed-off-by: Tomas Cohen Arazi's avatarTomas Cohen Arazi <tomascohen@gmail.com>
      856887ab
  17. 22 Apr, 2015 1 commit
  18. 20 Apr, 2015 1 commit
  19. 13 Jan, 2015 1 commit
  20. 31 Oct, 2014 1 commit
    • Mark Tompsett's avatar
      Bug 13141: Add ability for biblio_framework to be a dropdown in Guided Reports · 82c65678
      Mark Tompsett authored
      By tweaking the GetReservedAuthorisedValues function in
      C4::Reports::Guided, biblio_framework can be added as a dropdown
      list into the guided reports parameters.
      
      The change in C4/Reports/Guided.pm required a test, which is
      found in t/db_dependent/ReportsGuided.t
      
      Code was then added to reports/guided_reports.pl to build the
      appropriate hash to trigger the proper dropdown list.
      
      TEST PLAN
      ---------
      1) Apply patch
      2) prove -v t/db_dependent/ReportsGuided.t
         -- all should pass, this confirms that both
            C4/Reports/Guided.pm and this test file work.
      3) Log into staff client
      4) Reports
      5) Create from SQL
      6) Enter appropriate information like:
      Report name: Test 13141
      -- no need to change Report group or Report is public or Notes or Type
      SQL:
      SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',
           biblio.biblionumber,'\">',biblio.biblionumber,'</a>') AS
           BiblioNumbers, title, author, frameworkcode
      FROM biblio
      WHERE frameworkcode=<<Enter the frameworkcode|biblio_framework>>
      
      7) Save report
      8) Run report
         -- The parameter entry page should have a drop down of
            framework codes.
      9) Select a framework code, and click Run the report
         -- The displayed SQL should have a "frameworkcode=" portion
            matching the selected framework.
      10) Run the koha qa test tool.
      Signed-off-by: default avatarOwen Leonard <oleonard@myacpl.org>
      Test plan followed successfully.
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      Signed-off-by: Tomas Cohen Arazi's avatarTomas Cohen Arazi <tomascohen@gmail.com>
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <katrin.fischer.83@web.de>
      Signed-off-by: Tomas Cohen Arazi's avatarTomas Cohen Arazi <tomascohen@gmail.com>
      82c65678
  21. 16 Oct, 2014 1 commit
  22. 15 Oct, 2014 1 commit
  23. 23 Sep, 2014 1 commit
  24. 09 May, 2014 2 commits
  25. 20 Apr, 2014 1 commit
    • Galen Charlton's avatar
      Bug 9915: (follow-up) use SQL placeholders · 1931d2d2
      Galen Charlton authored
      This patch teaches C4::Reports::Guided::execute_query()
      how to accept a list of query parameter values.  It then
      follows-up on the main patch by simplifying how it converts
      report parameters to a complete SQL query, and removes the
      use of DBI->quote() and complicated regexes.
      
      To test:
      
      [1] Verify that using the OPAC svc/report service with
          sql_params continues to work.
      [2] Verify that there are no regressions with running
          reports from the staff interface, both via the web
          service and the reports interface.
      [3] Verify that prove -v /db_dependent/Reports_Guided.t passes.
      Signed-off-by: Galen Charlton's avatarGalen Charlton <gmc@esilibrary.com>
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
      Passes all tests and QA script.
      No regressions found.
      Signed-off-by: Galen Charlton's avatarGalen Charlton <gmc@esilibrary.com>
      1931d2d2
  26. 19 Apr, 2014 1 commit
    • joubu's avatar
      Bug 9216: make columns.def file translatable · bece83f8
      joubu authored
      The SQL column headers is stored into the columns.def file.
      This file is not managed by the translation script.
      
      This patch makes possible the headers translation.
      Note: The translation xml tags were added to avoid all lines being put
      on a single line.
      
      Test plan:
      1/ update your po file
      cd misc/translate;
      perl translate -f columns update LANG # Replace by another language here
      2/ translate header columns (search "columns.def" in your po file).
      3/ install the translated columns.def
      perl translate -f columns install LANG # Replace by another language here
      4/ go on the report module > create a new report > next > next
      5/ change the language
      on the 3rd step, you should see the column header translated.
      Signed-off-by: Bernardo Gonzalez Kriegel's avatarBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
      Work as described, no koha-qa errors
      
      [on es-ES about a third of the strings translated!! :-) ]
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
      Works as described and fixes a long standing translation
      problem.
      Passes all tests and QA script.
      Signed-off-by: Galen Charlton's avatarGalen Charlton <gmc@esilibrary.com>
      bece83f8
  27. 12 Mar, 2014 1 commit
    • Owen Leonard's avatar
      Bug 11718 - Use new DataTables include in reports templates · d6c40ebe
      Owen Leonard authored
      Bug 10649 introduced a new include file for adding DataTables-related
      JavaScript assets. This patch adds use of this include file to all
      circ-related pages which use DataTables.
      
      Apply the patch and test the following pages to confirm that table
      sorting works correctly:
      
      - Reports -> Guided reports -> Use saved
        (reports/guided_reports.pl?phase=Use saved):
        "Creation date" sorting has been reconfigured to use the title-string
        method for sorting on an unformatted date. C4:Reports::Guided.pm has
        been modified to pass an unformatted date to the template. Sorting
        should work correctly for all settings of the dateformat system pref.
      
      - Reports -> Catalog by item type
        (reports/manager.pl?report_name=itemtypes)
      
      - Reports -> Serials statistics wizard (reports/serials_stats.pl):
        The subscription begin and subscription end columns have been modified
        to use the title-string filter for sorting. An unformatted date is now
        passed from reports/serials_stats.pl to the template, where the
        KohaDates filter is used for formatting. Sorting is based on the
        unformatted date. Sorting should work correctly for all settings of
        the dateformat system pref.
      
        - Sorting of titles should now exclude article from sorting.
        - Minor template improvements:
          - Vendor name now links to vendor details.
          - Subscription title now links to subscription details.
          - Library name is now shown instead of branchcode.
      Signed-off-by: Aleisha Amohia's avatarAleisha <aleishaamohia@hotmail.com>
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
      Passes all tests and QA script.
      Checked all pages, no regressions or Javascript errors detected.
      Signed-off-by: Galen Charlton's avatarGalen Charlton <gmc@esilibrary.com>
      d6c40ebe
  28. 21 Aug, 2013 4 commits
  29. 26 Apr, 2013 1 commit
    • Tomas Cohen Arazi's avatar
      Bug 9659 - Better handling of non-existent authorised value categories used in SQL reports · cdc5e111
      Tomas Cohen Arazi authored
      A user might create a SQL report that relies on non-existent authorised value categories.
      Because of a typo, or just because they copy&pasted the report from the Wiki.
      
      Use cases are:
      
      - The user creates a report from SQL
        a) Uses bad authorised values
        b) Clicks 'Save Report'
        c) Koha lists the problematic authorised values
        d) The user decides to
        e-1) Save it anyway, it gets saved
        e-2) Edit the report, it gets back to where it chose 'Save Report'
      
      - The user edits an already saved report (Update SQL)
        a) Uses bad authorised values
        b) Clicks 'Update SQL'
        c) Koha lists the problematic authorised values
        d) The user decides to
        e-1) Save it anyway, it gets saved
        e-2) Edit the report, it gets back to where it chose 'Update SQL'
      
      - The user tries to run a saved report that contains bad authorised values, Koha advertises the problem and provides the user with a button 'Edit SQL' to fix things.
      
      To test, just create a report from SQL using invalid authorised values like this (misspelled 'branch'):
      
      SELECT *
      FROM itemtypes
      WHERE hola=<<Test branch1|branchee>> AND
            hola2=<<Test branch2|brancha>>
      
      Regards
      To+
      
      Notes:
      - I added several comments on the code.
      - Fixed an annoying warning of uninitialised variable also (refactored some tiny bits to do it).
      - Added the following methods
         -  C4::Reports::Guided::GetReservedAuthorisedValues
         -  C4::Reports::Guided::GetParametersFromSQL
         -  C4::Reports::Guided::IsAuthorisedValueValid
         -  C4::Reports::Guided::ValidateSQLParameters
         -  C4::Koha::IsAuthorisedValueCategory
      - Those methods could have been used to refactor this guided reports code as its *a bit messy*. I chose to do it in a new bug of course :-D.
      - Fixed some trivial perlcritic -5 errors
      - Removed some debugging stuff left by mistake
      - Fixed some POD problems
      - Optimal SQL-driven IsAuthorisedValueCategory method
      - Thanks to Owen and Jared for their patience heh.
      
      Sponsored-by: Universidad Nacional de Córdoba
      Signed-off-by: Bernardo Gonzalez Kriegel's avatarBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
      
      Comment: Work as described. No koha-qa errors.
      
      Test:
      Tried with examples (from help and test plan) reports, correctly
      identifies invalid authorized values, and no problem with
      authorized ones.
      
      NOTE: Online help for this does not states that partial values
      need to be between '%' in a SQLish way. Perhaps this could be
      addressed inserting % in values or adding a checkbox (partial|exact).
      Or changing help.
      Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
      Passes all tests and QA script.
      Signed-off-by: Jared Camins-Esakov's avatarJared Camins-Esakov <jcamins@cpbibliography.com>
      cdc5e111
  30. 19 Sep, 2012 1 commit
  31. 18 Sep, 2012 1 commit
    • Srdjan Jankovic's avatar
      Bug 7993: Save reports with Group/Subgroup hierarchy · 42acfbf7
      Srdjan Jankovic authored
      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: default avatarDelaye Stephane <stephane.delaye@biblibre.com>
      Signed-off-by: default avatarPaul Poulain <paul.poulain@biblibre.com>
      42acfbf7
  32. 05 Sep, 2012 1 commit
    • Jared Camins-Esakov's avatar
      Bug 8622: Fix theme fallback · 33113e69
      Jared Camins-Esakov authored
      This patch does the following:
      1) Enables fallback for includes between different themes and different
         languages (with the exact same precedence as for .tt files)
      2) Enable fallback for XSLT files between different themes and different
         languages (again, same precedence)
      3) Change the semantics of the TT [% themelang %] variable so that it always
         refers to the preferred theme and language, rather than the fallback
         theme/language. As a result, all themes must include all javascript,
         css and image resources they use.
      
      Note that these changes actually have no impact whatsoever on an
      installation where the default (prog) themes are in use.
      Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
      Signed-off-by: mjames's avatarMason James <mtj@kohaaloha.com>
      Signed-off-by: default avatarPaul Poulain <paul.poulain@biblibre.com>
      33113e69