Bugzilla – Attachment 77145 Details for
Bug 8628
Add digital signs to the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8628: [FOLLOW-UP] Fixing internal server error and rebase issues
Bug-8628-FOLLOW-UP-Fixing-internal-server-error-an.patch (text/plain), 9.50 KB, created by
Aleisha Amohia
on 2018-07-20 01:39:46 UTC
(
hide
)
Description:
Bug 8628: [FOLLOW-UP] Fixing internal server error and rebase issues
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2018-07-20 01:39:46 UTC
Size:
9.50 KB
patch
obsolete
>From 6f54dc8bc2eb97145267d2b42014d78eb38fd38f Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Fri, 20 Jul 2018 01:03:46 +0000 >Subject: [PATCH] Bug 8628: [FOLLOW-UP] Fixing internal server error and rebase > issues > >This patch addresses the comments in Comment 23 >Test that >1) all qa test tools pass >2) datatable on tools/signs.pl is not broken >3) features uses report group "SIGN" instead of "SIG" >4) you can complete the main test plan (no server errors) >--- > .../intranet-tmpl/prog/en/modules/tools/signs.tt | 60 ++++++++++++---------- > opac/opac-signs.pl | 7 +-- > tools/signs.pl | 23 +++++---- > 3 files changed, 50 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt >index ed683ff..362315b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/signs.tt >@@ -1,31 +1,10 @@ > [% USE Koha %] >+[% USE Asset %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Digital signs</title> > [% INCLUDE 'doc-head-close.inc' %] >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- $("#table_signs").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, >- ], >- "sPaginationType": "four_button" >- })); >- $("#table_streams").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, >- ], >- "sPaginationType": "four_button" >- })); >- >- $(".detach").on("click", function(){ >- return confirmDelete(_("Are you sure you want to detach this stream from this sign?")); >- }); >- }); >-//]]> >-</script> >+[% Asset.css("css/datatables.css") %] > </head> > <body id="tools_signs" class="tools"> > [% INCLUDE 'header.inc' %] >@@ -92,9 +71,9 @@ > [% UNLESS ( reports ) %] > <div class="dialog alert"> > <h3>No reports found</h3> >- <p>No reports with group code "SIG" were found. Please <a >+ <p>No reports with group code "SIGN" were found. Please <a > href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create+report+from+SQL&submit=Create+report+from+SQL">create >- a new report</a> with group code "SIG" and try again.</p> >+ a new report</a> with group code "SIGN" and try again.</p> > </div> > [% END %] > >@@ -464,6 +443,35 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript"> >+ //<![CDATA[ >+ $(document).ready(function() { >+ $("#table_signs").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, >+ ], >+ "sPaginationType": "four_button" >+ })); >+ $("#table_streams").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSearchable": false, "bSortable": false }, >+ ], >+ "sPaginationType": "four_button" >+ })); >+ >+ $(".detach").on("click", function(){ >+ return confirmDelete(_("Are you sure you want to detach this stream from this sign?")); >+ }); >+ }); >+ //]]> >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] > > [% BLOCK display_records %] >diff --git a/opac/opac-signs.pl b/opac/opac-signs.pl >index 70a65b8..3581a95 100755 >--- a/opac/opac-signs.pl >+++ b/opac/opac-signs.pl >@@ -26,6 +26,7 @@ use C4::Context; > use C4::Koha; > use C4::Items; > use Koha::AuthorisedValues; >+use Koha::Reports; > use Koha::Signs; > use Koha::SignStreams; > use Koha::SignsToStreams; >@@ -55,11 +56,11 @@ if ( C4::Context->preference('OPACDigitalSigns') ) { > my %record_cache = (); > foreach my $s ( @signstostreams ) { > my $stream = Koha::SignStreams->find( $s->sign_stream_id ); >- my $sql = get_saved_report($stream->saved_sql_id); >+ my $sql = Koha::Reports->find($stream->saved_sql_id); > my $params = Koha::SignsToStreams->find({ sign_to_stream_id => $s->sign_to_stream_id }); > > # Generate SQL with added params >- my $newsql = $sql->{'savedsql'}; >+ my $newsql = $sql->savedsql; > foreach my $param ( split /&/, $params->params ) { > my ( $key, $value ) = split /=|<|>/, $param; # The < and > in the split are just to prevent software errors, the sign in the query must be changed in the report itself > $newsql =~ s/$key/$value/g; >@@ -74,7 +75,7 @@ if ( C4::Context->preference('OPACDigitalSigns') ) { > my @processed_records; > foreach my $rec ( @{$records} ) { > unless (defined $record_cache{$rec->{'biblionumber'}}) { >- my $marc = GetMarcBiblio( $rec->{'biblionumber'} ); >+ my $marc = GetMarcBiblio({ biblionumber => $rec->{'biblionumber'} }); > if ( ! $marc ) { > next; > } >diff --git a/tools/signs.pl b/tools/signs.pl >index ea714ac..b62a671 100755 >--- a/tools/signs.pl >+++ b/tools/signs.pl >@@ -36,6 +36,7 @@ use Koha::Signs; > use Koha::SignStream; > use Koha::SignStreams; > use Koha::SignsToStreams; >+use Koha::Reports; > > use CGI; > use C4::Auth; >@@ -70,7 +71,7 @@ if ( $op eq 'add_stream' ) { > > $template->param( > 'op' => 'stream_form', >- 'reports' => get_saved_reports( { group => 'SIG' } ), >+ 'reports' => get_saved_reports( { group => 'SIGN' } ), > ); > > } elsif ( $op eq 'edit_stream' && $sign_stream_id ne '') { >@@ -80,7 +81,7 @@ if ( $op eq 'add_stream' ) { > $template->param( > 'op' => 'stream_form', > 'stream' => $stream, >- 'reports' => get_saved_reports( { group => 'SIG' } ), >+ 'reports' => get_saved_reports( { group => 'SIGN' } ), > 'script_name' => $script_name > ); > >@@ -97,8 +98,8 @@ if ( $op eq 'add_stream' ) { > > } elsif ( $op eq 'view_stream' && $sign_stream_id ne '' ) { > my $stream = Koha::SignStreams->find( $sign_stream_id ); >- my $report = get_saved_report($stream->saved_sql_id); >- my $sql = $report->{'savedsql'}; >+ my $report = Koha::Reports->find($stream->saved_sql_id); >+ my $sql = $report->savedsql; > my ( $records, $error ) = execute_query( $sql, 0, 999999 ); > if ( $records && not $error ) { > $records = $records->fetchall_arrayref({}); >@@ -181,10 +182,10 @@ if ( $op eq 'add_stream' ) { > > foreach my $s ( @signstostreams ) { > my $stream = Koha::SignStreams->find( $s->sign_stream_id ); >- my $sql = get_saved_report($stream->saved_sql_id); >+ my $sql = Koha::Reports->find($stream->saved_sql_id); > my $params = Koha::SignsToStreams->find({ sign_to_stream_id => $s->sign_to_stream_id }); > # Generate SQL with added params >- my $newsql = $sql->{'savedsql'}; >+ my $newsql = $sql->savedsql; > foreach my $param ( split /&/, $params->params ) { > my ( $key, $value ) = split /=|<|>/, $param; # The < and > in the split are just to prevent software errors, the sign in the query must be changed in the report itself > $newsql =~ s/$key/$value/g; >@@ -246,8 +247,8 @@ if ( $op eq 'add_stream' ) { > > # Check if the SQL associated with the stream needs parameters > my $stream = Koha::SignStreams->find( $sign_stream_id ); >- my $sql = get_saved_report($stream->saved_sql_id); >- if ( $sql->{'savedsql'} =~ m/WHERE/ ) { >+ my $sql = Koha::Reports->find($stream->saved_sql_id); >+ if ( $sql->savedsql =~ m/WHERE/ ) { > print $cgi->redirect( $script_name . '?op=get_params&sign_to_stream_id=' . $sign_to_stream->sign_to_stream_id . '&sign_stream_id=' . $sign_stream_id . '&sign_id=' . $sign_id ); > } else { > print $cgi->redirect( $script_name . '?op=edit_streams&sign_id=' . $sign_id ); >@@ -256,10 +257,10 @@ if ( $op eq 'add_stream' ) { > } elsif ( $op eq 'get_params' && $sign_to_stream_id ne '' && $sign_stream_id ne '' && $sign_id ne '' ) { > > my $stream = Koha::SignStreams->find( $sign_stream_id ); >- my $sql = get_saved_report($stream->saved_sql_id); >+ my $sql = Koha::Reports->find($stream->saved_sql_id); > my $params = Koha::SignsToStreams->find({ sign_to_stream_id => $sign_to_stream_id }); > # Generate SQL with added params >- my $newsql = $sql->{'savedsql'}; >+ my $newsql = $sql->savedsql; > foreach my $param ( split /&/, $params->params ) { > my ( $key, $value ) = split /=|<|>/, $param; # The < and > in the split are just to prevent software errors, the sign in the query must be changed in the report itself > $newsql =~ s/$key/$value/g; >@@ -302,7 +303,7 @@ if ( $op eq 'add_stream' ) { > $template->param( > 'streams' => \@streams, > 'signs' => \@signs, >- 'reports' => get_saved_reports( { group => 'SIG' } ), >+ 'reports' => get_saved_reports( { group => 'SIGN' } ), > 'OPACBaseURL' => C4::Context->preference( 'OPACBaseURL' ) || '', > 'else' => 1 > ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8628
:
42703
|
42704
|
45968
|
45969
|
58602
|
58603
|
58604
|
58605
|
62338
|
64249
|
66246
|
66247
|
66248
|
66249
|
66250
|
77025
|
77026
|
77027
|
77028
|
77141
|
77142
|
77143
|
77144
|
77145
|
78709
|
80248
|
80249
|
80250
|
80252
|
82896
|
82897
|
82898
|
82899
|
82900
|
82901
|
83312
|
88821
|
88822
|
88823
|
88824
|
88825
|
88826
|
93054
|
93055
|
93056
|
93057
|
93058
|
93059
|
93066
|
93067
|
93068
|
93069
|
93070
|
93071
|
99608
|
99609
|
99610
|
99611
|
99612
|
99613
|
99614
|
99615
|
99616
|
99617
|
99618
|
99619
|
99620
|
99621
|
99622
|
99623
|
99624
|
99717
|
99718
|
99801
|
118472
|
118473
|
118474
|
118475
|
118476
|
118477
|
118478
|
118479
|
118480
|
119455
|
131223
|
131224
|
145645
|
145646
|
145647
|
145648
|
145649
|
145650
|
145651
|
145652
|
145653
|
145654
|
147000
|
147001
|
147002
|
147003
|
147004
|
147005
|
147006
|
147007
|
147008
|
147009
|
147010