% include("/elements/header.html", 'Invoice templates') %>
<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
<% $display %>
|
% my( $logo_label, $logo_link_label)= length( $templatename )
% ? labels("logo_$templatename.png")
% : ( '', 'edit' );
<% $logo_label %> Logo
(<% $logo_link_label %>)
% foreach my $suffix (qw( returnaddress notes footer), '' ) {
% my $file = "invoice_html$suffix$tname";
% my($label, $link_label) = length($templatename)
% ? labels($file)
% : ( '', 'edit' );
<% $label %> <% $suffix2name{$suffix} %>
(<% $link_label %>)
% }
|
% my( $logo_label, $logo_link_label)= length( $templatename )
% ? labels("logo_$templatename.eps")
% : ( '', 'edit' );
<% $logo_label %> Logo
(<% $logo_link_label %>)
% foreach my $suffix (qw( returnaddress notes footer smallfooter), '' ) {
% my $file = "invoice_latex$suffix$tname";
% my($label, $link_label) = length($templatename)
% ? labels($file)
% : ( '', 'edit' );
<% $label %> <% $suffix2name{$suffix} %>
(<% $link_label %>)
% }
|
% my( $txt_label, $txtlink_label)=
% length( $templatename )
% ? labels("invoice_template_$templatename.png")
% : ( 'Main template', 'edit' );
<% $txt_label %>
(<% $txtlink_label %>)
|
% }
<% include("/elements/footer.html") %>
<%once>
my %suffix2name = (
'returnaddress' => 'Return address',
'notes' => 'Notes',
'footer' => 'Footer',
'smallfooter' => 'Small footer',
'' => 'Main template',
);
my $conf = new FS::Conf;
sub labels {
my $filename = shift;
if ( $conf->exists($filename) ) {
( 'Custom', 'edit' );
} else {
( 'Standard', 'customize' );
}
}
%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my @templatenames = $conf->invoice_templatenames;
%init>