Tomas Cohen Arazi
afd2418d73
Since we switched to Template Toolkit we don't need to stick with the sufix we used for HTML::Template::Pro. This patch changes the occurences of '.tmpl' in favour of '.tt'. To test: - Apply the patch - Install koha, and verify that every page can be accesed Regards To+ P.S. a followup will remove the glue code. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
37 lines
912 B
Perl
Executable file
37 lines
912 B
Perl
Executable file
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
#use warnings; FIXME - Bug 2505
|
|
use CGI;
|
|
use C4::SMS;
|
|
use C4::Output;
|
|
use C4::Auth;
|
|
|
|
my $query = new CGI;
|
|
my $message = $query->param( 'message' );
|
|
my $phone = $query->param( 'phone' );
|
|
my $operation = $query->param('operation');
|
|
my $result;
|
|
my $errorcode;
|
|
my ($template, $loggedinuser, $cookie)
|
|
= get_template_and_user({template_name => "sms/sms-home.tt",
|
|
query => $query,
|
|
type => "intranet",
|
|
authnotrequired => 0,
|
|
flagsrequired => {circulate => "circulate_remaining_permissions" },
|
|
debug => 1,
|
|
});
|
|
if ($operation eq "sendsms"){
|
|
$phone=parse_phone($phone);
|
|
if ($phone){
|
|
##write to a queue and exit
|
|
my $me=C4::Context->userenv;
|
|
$result=write_sms($me->{cardnumber},$message,$phone);
|
|
} else {
|
|
$errorcode=-1104;
|
|
}
|
|
}
|
|
my $error=error_codes($errorcode);
|
|
$template->param(error=>$error);
|
|
output_html_with_http_headers $query, $cookie, $template->output;
|
|
|