From c60651db387d570d41cee7eff1c6d521ef220442 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 22 May 2017 08:40:25 +0000 Subject: [PATCH] Bug 17047: Minor changes - search on reports module is now also validated by pressing enter. - AutoShare now initialized with nothing autmaticaly shared. - To create a report you now have to click on New report => New report from Mana. - Error messages are displayed in case of fail - Correct the display of sql reports containing "'" - Importing a report from Mana now opens the edit page - You don't get message after a successful import from mana (you simply get redirected) - Fix an error when cretaing subscription - Fix mana search - Correct encoding issues Signed-off-by: Brendan A Gallagher Signed-off-by: Kyle M Hall --- Koha/SharedContent.pm | 2 +- Koha/Subscription.pm | 1 + .../atomicupdate/mana_03-add_mana_autoshare.sql | 2 +- .../intranet-tmpl/prog/en/includes/calendar.inc | 2 +- .../en/includes/mana/mana-report-search-result.inc | 2 +- .../mana/mana-subscription-search-result.inc | 3 +- .../prog/en/includes/reports-toolbar.inc | 141 +++++++++++++++++++++ .../en/modules/reports/guided_reports_start.tt | 122 ++---------------- .../prog/en/modules/serials/serials-search.tt | 2 +- .../prog/en/modules/serials/subscription-add.tt | 1 - .../intranet-tmpl/prog/js/subscription-add.js | 17 ++- reports/guided_reports.pl | 1 + serials/serials-search.pl | 3 + serials/subscription-add.pl | 2 +- svc/mana/share | 19 +++ 15 files changed, 194 insertions(+), 126 deletions(-) diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm index 9bd4d09..55d10c5 100644 --- a/Koha/SharedContent.pm +++ b/Koha/SharedContent.pm @@ -42,7 +42,7 @@ sub manaRequest { my $response = $userAgent->request($mana_request); - eval { $result = from_json( $response->decoded_content ); }; + eval { $result = from_json( $response->decoded_content, { utf8 => 1} ); }; $result->{code} = $response->code; if ( $@ ){ $result->{msg} = $response->{_msg}; diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm index 4000b72..24595a5 100644 --- a/Koha/Subscription.pm +++ b/Koha/Subscription.pm @@ -61,6 +61,7 @@ sub get_search_info { my $self=shift; my $searched_sub_id = shift; my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } ); + return unless $biblio; my $biblioitem = Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } ); diff --git a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql b/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql index 353ffc1..f5cc363 100644 --- a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql +++ b/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql @@ -1,2 +1,2 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'); +('AutoShareWithMana','','','defines datas automatically shared with mana','multiple'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index f13a1fa..d07da51 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -118,7 +118,7 @@ jQuery(function($){ dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], weekHeader: _("Wk"), dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]", - firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %], + firstDay: '[% Koha.Preference('CalendarFirstDayOfWeek') %]', isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], showMonthAfterYear: false, yearSuffix: ''}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc index 455f453..2de9fea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc @@ -30,7 +30,7 @@ [% END %] [% IF ( report.report_name ) %][% report.report_name %][% END %] -
+
[% IF report.notes.length > 200 %] [% report.notes.substr(0,200) %]Show More
+ +[% IF Koha.Preference('Mana')==1 %] + +[% END %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 615db9b..41bbb9e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -150,6 +150,13 @@ canned reports and writing custom SQL reports.

+[% IF report_converted %] +
+ The report "[% report_converted %]" has been converted. +
+[% END %] + + [% IF ( saved1 ) %] [% IF ( savedreports ) %]

Saved reports

@@ -174,14 +181,8 @@ canned reports and writing custom SQL reports.

[% END %] - [% IF (Koha.Preference('Mana') == 1) %] - - [% END %] - -

[% savedreport.sql %]

+
@@ -213,7 +214,7 @@ canned reports and writing custom SQL reports.

[% IF ( CAN_user_reports_delete_reports ) %] [% END %] - +
@@ -1117,10 +1118,6 @@ Sub report: } }); - $('#search_form').submit(function () { - return false; - }); - $("#addColumn").on("click",function(){ addColumn(); }); @@ -1325,103 +1318,6 @@ Sub report: