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 ); |