Bug 17981: Move svc/letters to svc/letters/get
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 24 Jan 2017 09:09:26 +0000 (10:09 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 Apr 2018 13:51:50 +0000 (10:51 -0300)
To allow another script under svc/letters

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
svc/letters [deleted file]
svc/letters/get [new file with mode: 0755]

index c3c4b42..d9405d9 100644 (file)
                     $.ajax({
                         data: { code: new_lettercode, branchcode: new_branchcode },
                         type: 'GET',
-                        url: '/cgi-bin/koha/svc/letters/',
+                        url: '/cgi-bin/koha/svc/letters/get/',
                         success: function (data) {
                              if ( data.letters.length > 0 ) {
                                  if( new_branchcode == '' ) {
diff --git a/svc/letters b/svc/letters
deleted file mode 100755 (executable)
index cfb77e7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/perl
-
-# This file is part of Koha.
-#
-# Copyright 2014 BibLibre
-#
-# Koha is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Koha is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Koha; if not, see <http://www.gnu.org/licenses>.
-
-use Modern::Perl;
-
-use C4::Service;
-use C4::Letters qw( GetLetters );
-
-=head1 NAME
-
-svc/letters - Web service for getting letters
-
-=head1 SYNOPSIS
-
-  GET /svc/letters
-
-=head1 DESCRIPTION
-
-For the moment, this service is only used to get a letter from a letter code.
-
-=head1 METHODS
-
-=cut
-
-=head2 set_preference
-
-=over 4
-
-GET /svc/letters/$code
-
-=back
-
-Used to get letters with a given letter code.
-
-=cut
-
-our ( $query, $response ) = C4::Service->init( tools => 'edit_notices' );
-
-sub get_letters {
-    my $letters = GetLetters({ code => $query->param('code'), branchcode => $query->param('branchcode') });
-    $response->param( letters => $letters );
-    C4::Service->return_success( $response );
-}
-
-C4::Service->dispatch(
-    [ 'GET /', [ 'code' ], \&get_letters ],
-);
diff --git a/svc/letters/get b/svc/letters/get
new file mode 100755 (executable)
index 0000000..b6b6bdb
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Copyright 2014 BibLibre
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
+
+use Modern::Perl;
+
+use C4::Service;
+use C4::Letters qw( GetLetters );
+
+=head1 NAME
+
+svc/letters/get - Web service for getting letters
+
+=head1 SYNOPSIS
+
+  GET /svc/letters/get
+
+=head1 DESCRIPTION
+
+For the moment, this service is only used to get a letter from a letter code.
+
+=head1 METHODS
+
+=cut
+
+=head2 set_preference
+
+=over 4
+
+GET /svc/letters/get/$code
+
+=back
+
+Used to get letters with a given letter code.
+
+=cut
+
+our ( $query, $response ) = C4::Service->init( tools => 'edit_notices' );
+
+sub get_letters {
+    my $letters = GetLetters({ code => $query->param('code'), branchcode => $query->param('branchcode') });
+    $response->param( letters => $letters );
+    C4::Service->return_success( $response );
+}
+
+C4::Service->dispatch(
+    [ 'GET /', [ 'code' ], \&get_letters ],
+);