From 466c3f52303e58ddea8547ea69971469d20c7743 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 16 Jan 2018 10:41:51 +0000 Subject: [PATCH] Bug 17047 - Fix template code in subscription-add.js Fix errors when saving a serial Provide a more visible message when sharing a report without note Fix Internal server error when trying to share a new report Make update DB idempotent Rebased-by: Alex Arnaud (2018-07-04) Signed-off-by: Michal Denar Signed-off-by: Michal Denar --- Koha/SharedContent.pm | 1 - .../mysql/atomicupdate/mana_01-add_mana_id.perl | 13 ++++++++++ .../mana_01-add_mana_id_in_subscription.sql | 2 -- .../atomicupdate/mana_03-add_mana_autoshare.sql | 2 +- .../mysql/atomicupdate/mana_04-add_mana_token.sql | 2 +- installer/data/mysql/atomicupdate/skeleton.perl | 2 +- .../prog/en/includes/reports-toolbar.inc | 6 ----- .../prog/en/includes/serials-toolbar.inc | 2 +- .../en/modules/reports/guided_reports_start.tt | 29 +++++++++++++++------- .../prog/en/modules/serials/serials-search.tt | 1 + .../prog/en/modules/serials/subscription-add.tt | 2 ++ koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js | 3 +++ .../intranet-tmpl/prog/js/subscription-add.js | 4 +-- serials/subscription-add.pl | 4 +-- 14 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl delete mode 100644 installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm index ca484c1..a6b8584 100644 --- a/Koha/SharedContent.pm +++ b/Koha/SharedContent.pm @@ -178,7 +178,6 @@ sub buildRequest { my $url = "$MANA_IP/$resource.json"; my $request = HTTP::Request->new( POST => $url ); - $content->{bulk_import} = 0; my $json = to_json( $content, { utf8 => 1 } ); $request->content($json); diff --git a/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl b/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl new file mode 100644 index 0000000..1e5fdbd --- /dev/null +++ b/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl @@ -0,0 +1,13 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'subscription', 'mana_id' ) ) { + $dbh->do( "ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL" ); + } + + if( !column_exists( 'saved_sql', 'mana_id' ) ) { + $dbh->do( "ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL" ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17047 - Add column mana_id in subscription and saved_sql tables)\n"; +} diff --git a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql b/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql deleted file mode 100644 index a7443db..0000000 --- a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL; -ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL; 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 f5cc363..a8b3519 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 +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('AutoShareWithMana','','','defines datas automatically shared with mana','multiple'); diff --git a/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql b/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql index 200f3e5..3c94ccd 100644 --- a/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql +++ b/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql @@ -1,2 +1,2 @@ -INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea'); diff --git a/installer/data/mysql/atomicupdate/skeleton.perl b/installer/data/mysql/atomicupdate/skeleton.perl index 66e599c..c63e6eb 100644 --- a/installer/data/mysql/atomicupdate/skeleton.perl +++ b/installer/data/mysql/atomicupdate/skeleton.perl @@ -1,4 +1,4 @@ -$DBversion = 'XXX'; # will be replaced by the RM +$DBversion = 'XXX'; if( CheckVersion( $DBversion ) ) { # you can use $dbh here like: # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc index bfb1e0f..41cdcbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc @@ -139,12 +139,6 @@ [% END %] + [% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
[% IF CAN_user_serials_create_subscription %] 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 4959935..dec3441 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 @@ -352,10 +352,12 @@ canned reports and writing custom SQL reports.

Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.

[% END %] + [% IF ( languages_loop ) %] [% UNLESS ( one_language_enabled ) %] - -
+
  • Id:
  • Name:
    @@ -374,7 +376,7 @@ canned reports and writing custom SQL reports.

    -
    +