View | Details | Raw Unified | Return to bug 11944
Collapse All | Expand All

(-)a/serials/subscription-frequency.pl (-3 / +3 lines)
Lines 17-28 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use CGI qw ( -utf8 );
21
use CGI qw ( -utf8 );
21
use C4::Context;
22
use C4::Context;
22
use C4::Serials::Frequency;
23
use C4::Serials::Frequency;
23
use C4::Auth qw/check_cookie_auth/;
24
use C4::Auth qw/check_cookie_auth/;
24
use URI::Escape;
25
use JSON qw( to_json );
25
use strict;
26
26
27
my $input=new CGI;
27
my $input=new CGI;
28
my $frqid=$input->param("frequency_id");
28
my $frqid=$input->param("frequency_id");
Lines 33-36 if ($auth_status ne "ok") { Link Here
33
my $frequencyrecord=GetSubscriptionFrequency($frqid);
33
my $frequencyrecord=GetSubscriptionFrequency($frqid);
34
binmode STDOUT, ":encoding(UTF-8)";
34
binmode STDOUT, ":encoding(UTF-8)";
35
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
35
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
36
print "{".join (",",map { "\"$_\":\"".uri_escape_utf8($frequencyrecord->{$_})."\"" }sort keys %$frequencyrecord)."}";
36
print to_json( $frequencyrecord );
(-)a/serials/subscription-numberpattern.pl (-3 / +3 lines)
Lines 21-27 use Modern::Perl; Link Here
21
use CGI qw ( -utf8 );
21
use CGI qw ( -utf8 );
22
use C4::Serials::Numberpattern;
22
use C4::Serials::Numberpattern;
23
use C4::Auth qw/check_cookie_auth/;
23
use C4::Auth qw/check_cookie_auth/;
24
use URI::Escape;
24
use JSON qw( to_json );
25
25
26
my $input=new CGI;
26
my $input=new CGI;
27
27
Lines 34-39 if ($auth_status ne "ok") { Link Here
34
my $numpatternid=$input->param("numberpattern_id");
34
my $numpatternid=$input->param("numberpattern_id");
35
35
36
my $numberpatternrecord=GetSubscriptionNumberpattern($numpatternid);
36
my $numberpatternrecord=GetSubscriptionNumberpattern($numpatternid);
37
37
binmode STDOUT, ":encoding(UTF-8)";
38
binmode STDOUT, ":encoding(UTF-8)";
38
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
39
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
39
print "{",join (",",map {"\"$_\":\"".(uri_escape_utf8($numberpatternrecord->{$_}) // '')."\"" }sort keys %$numberpatternrecord),"}";
40
print to_json( $numberpatternrecord );
40
- 

Return to bug 11944