Skip to content

Commit

Permalink
Bug 11349: Change .tmpl -> .tt in scripts using templates
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
tomascohen committed Jul 17, 2014
1 parent 9fe36e0 commit afd2418
Show file tree
Hide file tree
Showing 363 changed files with 591 additions and 554 deletions.
4 changes: 2 additions & 2 deletions C4/Acquisition.pm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ sub GetBasketAsCSV {
my @orders = GetOrders($basketno);
my $contract = GetContract($basket->{'contractnumber'});

my $template = C4::Templates::gettemplate("acqui/csv/basket.tmpl", "intranet", $cgi);
my $template = C4::Templates::gettemplate("acqui/csv/basket.tt", "intranet", $cgi);

my @rows;
foreach my $order (@orders) {
Expand Down Expand Up @@ -356,7 +356,7 @@ sub GetBasketGroupAsCSV {
my ($basketgroupid, $cgi) = @_;
my $baskets = GetBasketsByBasketgroup($basketgroupid);

my $template = C4::Templates::gettemplate('acqui/csv/basketgroup.tmpl', 'intranet', $cgi);
my $template = C4::Templates::gettemplate('acqui/csv/basketgroup.tt', 'intranet', $cgi);

my @rows;
for my $basket (@$baskets) {
Expand Down
6 changes: 3 additions & 3 deletions C4/Auth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ C4::Auth - Authenticates Koha users
my ($template, $borrowernumber, $cookie)
= get_template_and_user(
{
template_name => "opac-main.tmpl",
template_name => "opac-main.tt",
query => $query,
type => "opac",
authnotrequired => 0,
Expand All @@ -106,7 +106,7 @@ automatically. This gets loaded into the template.
my ($template, $borrowernumber, $cookie)
= get_template_and_user(
{
template_name => "opac-main.tmpl",
template_name => "opac-main.tt",
query => $query,
type => "opac",
authnotrequired => 0,
Expand Down Expand Up @@ -1046,7 +1046,7 @@ sub checkauth {
$LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;

my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt';
my $template = C4::Templates::gettemplate($template_name, $type, $query );
$template->param(
branchloop => GetBranchesLoop(),
Expand Down
6 changes: 3 additions & 3 deletions C4/InstallAuth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ InstallAuth - Authenticates Koha users for Install process
my $query = new CGI;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "opac-main.tmpl",
= get_template_and_user({template_name => "opac-main.tt",
query => $query,
type => "opac",
authnotrequired => 1,
Expand Down Expand Up @@ -81,7 +81,7 @@ InstallAuth - Authenticates Koha users for Install process
=item get_template_and_user
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "opac-main.tmpl",
= get_template_and_user({template_name => "opac-main.tt",
query => $query,
type => "opac",
authnotrequired => 1,
Expand Down Expand Up @@ -234,7 +234,7 @@ sub checkauth {

my $dbh = C4::Context->dbh();
my $template_name;
$template_name = "installer/auth.tmpl";
$template_name = "installer/auth.tt";

# state variables
my $loggedin = 0;
Expand Down
2 changes: 1 addition & 1 deletion about.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
my $query = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "about.tmpl",
template_name => "about.tt",
query => $query,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/acqui-home.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ =head1 DESCRIPTION

my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{ template_name => 'acqui/acqui-home.tmpl',
{ template_name => 'acqui/acqui-home.tt',
query => $query,
type => 'intranet',
authnotrequired => 0,
Expand Down
4 changes: 2 additions & 2 deletions acqui/addorder.pl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ =head1 CGI PARAMETERS
|| ( ($budget_expenditure+0) && ($budget_used + $total) > $budget_expenditure) )
{
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => "acqui/addorder.tmpl",
template_name => "acqui/addorder.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down Expand Up @@ -212,7 +212,7 @@ =head1 CGI PARAMETERS
# get_template_and_user used only to check auth & get user id
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/booksellers.tmpl",
template_name => "acqui/booksellers.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/addorderiso2709.pl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

my $input = new CGI;
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
template_name => "acqui/addorderiso2709.tmpl",
template_name => "acqui/addorderiso2709.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/aqbasketuser_search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
my $dbh = C4::Context->dbh;

my ( $template, $loggedinuser, $cookie, $staff_flags ) = get_template_and_user(
{ template_name => "acqui/aqbasketuser_search.tmpl",
{ template_name => "acqui/aqbasketuser_search.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/basket.pl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ =head1 CGI PARAMETERS

my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{
template_name => "acqui/basket.tmpl",
template_name => "acqui/basket.tt",
query => $query,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/basketgroup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ =head1 CGI PARAMETERS
our $input=new CGI;

our ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/basketgroup.tmpl",
= get_template_and_user({template_name => "acqui/basketgroup.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/basketheader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ =head1 CGI PARAMETERS
my $input = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/basketheader.tmpl",
template_name => "acqui/basketheader.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/booksellers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ =head1 CGI PARAMETERS

my $query = CGI->new;
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{ template_name => 'acqui/booksellers.tmpl',
{ template_name => 'acqui/booksellers.tt',
query => $query,
type => 'intranet',
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/check_budget_total.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ =head1 DESCRIPTION
my $total = $input->param('total');

my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "acqui/ajax.tmpl",
{ template_name => "acqui/ajax.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/histsearch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ =head1 CGI PARAMETERS
my $dbh = C4::Context->dbh;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/histsearch.tmpl",
template_name => "acqui/histsearch.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/invoice.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ =head1 DESCRIPTION
my $input = new CGI;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => 'acqui/invoice.tmpl',
template_name => 'acqui/invoice.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/invoices.pl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ =head1 DESCRIPTION
my $input = CGI->new;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{
template_name => 'acqui/invoices.tmpl',
template_name => 'acqui/invoices.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
Expand Down
18 changes: 10 additions & 8 deletions acqui/lateorders.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ =head1 CGI PARAMETERS
use Koha::DateUtils;

my $input = new CGI;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => "acqui/lateorders.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {acquisition => 'order_receive'},
debug => 1,
});
my ($template, $loggedinuser, $cookie) = get_template_and_user(
{
template_name => "acqui/lateorders.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => { acquisition => 'order_receive' },
debug => 1,
}
);

my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
my $delay = $input->param('delay') // 0;
Expand Down
2 changes: 1 addition & 1 deletion acqui/modordernotes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ =head1 DESCRIPTION

my $input = new CGI;
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
template_name => 'acqui/modordernotes.tmpl',
template_name => 'acqui/modordernotes.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/neworderbiblio.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ =head1 CGI PARAMETERS
# getting the template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/neworderbiblio.tmpl",
template_name => "acqui/neworderbiblio.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
4 changes: 2 additions & 2 deletions acqui/neworderempty.pl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ =head1 CGI PARAMETERS

our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{
template_name => "acqui/neworderempty.tmpl",
template_name => "acqui/neworderempty.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down Expand Up @@ -514,7 +514,7 @@ sub Load_Duplicate {
my ($duplicatetitle)= @_;
($template, $loggedinuser, $cookie) = get_template_and_user(
{
template_name => "acqui/neworderempty_duplicate.tmpl",
template_name => "acqui/neworderempty_duplicate.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/newordersuggestion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ =head1 CGI PARAMETERS
my $dbh = C4::Context->dbh;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "acqui/newordersuggestion.tmpl",
template_name => "acqui/newordersuggestion.tt",
type => "intranet",
query => $input,
flagsrequired => { acquisition => 'order_manage' },
Expand Down
2 changes: 1 addition & 1 deletion acqui/orderreceive.pl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ =head1 CGI PARAMETERS

my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{
template_name => "acqui/orderreceive.tmpl",
template_name => "acqui/orderreceive.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/parcel.pl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ sub get_gst {
}

my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/parcel.tmpl",
= get_template_and_user({template_name => "acqui/parcel.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/parcels.pl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ =head1 CGI PARAMETERS
$resultsperpage ||= 20;

our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{ template_name => 'acqui/parcels.tmpl',
{ template_name => 'acqui/parcels.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/supplier.pl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ =head1 CGI PARAMETERS
}
my $op = $query->param('op') || 'display';
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'acqui/supplier.tmpl',
{ template_name => 'acqui/supplier.tt',
query => $query,
type => 'intranet',
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/transferorder.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

my $input = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "acqui/transferorder.tmpl",
{ template_name => "acqui/transferorder.tt",
query => $input,
type => "intranet",
flagsrequired => { acquisition => 'order_manage' },
Expand Down
2 changes: 1 addition & 1 deletion acqui/uncertainprice.pl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ =head1 CGI PARAMETERS
my $input=new CGI;

my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/uncertainprice.tmpl",
= get_template_and_user({template_name => "acqui/uncertainprice.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion acqui/z3950_search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "acqui/z3950_search.tmpl",
template_name => "acqui/z3950_search.tt",
query => $input,
type => "intranet",
flagsrequired => { acquisition => 'order_manage' },
Expand Down
2 changes: 1 addition & 1 deletion admin/admin-home.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

my $query = new CGI;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/admin-home.tmpl",
= get_template_and_user({template_name => "admin/admin-home.tt",
query => $query,
type => "intranet",
authnotrequired => 0,
Expand Down
15 changes: 8 additions & 7 deletions admin/aqbudgetperiods.pl
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ =head1 admin/aqbudgetperiods.pl
$searchfield =~ s/\,//g;

my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user(
{ template_name => "admin/aqbudgetperiods.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => { acquisition => 'period_manage' },
debug => 1,
}
{
template_name => "admin/aqbudgetperiods.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => { acquisition => 'period_manage' },
debug => 1,
}
);


Expand Down
2 changes: 1 addition & 1 deletion admin/aqcontract.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
my $bookseller = GetBookSellerFromId($booksellerid);

my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "admin/aqcontract.tmpl",
{ template_name => "admin/aqcontract.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion admin/aqplan.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
my $dbh = C4::Context->dbh;

my ( $template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user(
{ template_name => "admin/aqplan.tmpl",
{ template_name => "admin/aqplan.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion admin/auth_subfields_structure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sub auth_subfield_structure_exists {
my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl";

my ($template, $borrowernumber, $cookie) = get_template_and_user(
{ template_name => "admin/auth_subfields_structure.tmpl",
{ template_name => "admin/auth_subfields_structure.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
2 changes: 1 addition & 1 deletion admin/auth_tag_structure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

# open template
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/auth_tag_structure.tmpl",
= get_template_and_user({template_name => "admin/auth_tag_structure.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
Expand Down
Loading

0 comments on commit afd2418

Please sign in to comment.