my ($filename, $display_filename);
- if ($form->{type} eq "stylesheet") {
- $filename = "css/$myconfig->{stylesheet}";
- $display_filename = $myconfig->{stylesheet};
+ $filename = $form->{formname};
- } else {
- $filename = $form->{formname};
-
- if ($form->{language}) {
- my ($id, $template_code) = split(/--/, $form->{language});
- $filename .= "_${template_code}";
- }
+ if ($form->{language}) {
+ my ($id, $template_code) = split(/--/, $form->{language});
+ $filename .= "_${template_code}";
+ }
- if ($form->{printer}) {
- my ($id, $template_code) = split(/--/, $form->{printer});
- $filename .= "_${template_code}";
- }
+ if ($form->{printer}) {
+ my ($id, $template_code) = split(/--/, $form->{printer});
+ $filename .= "_${template_code}";
+ }
- $filename .= "." . ($form->{format} eq "html" ? "html" : "tex");
- if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) {
- $filename =~ s|.*/||;
- }
- $display_filename = $filename;
- $filename = SL::DB::Default->get->templates . "/$filename";
+ $filename .= "." . ($form->{format} eq "html" ? "html" : "tex");
+ if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) {
+ $filename =~ s|.*/||;
}
+ $display_filename = $filename;
+ $filename = SL::DB::Default->get->templates . "/$filename";
$main::lxdebug->leave_sub();
$main::auth->assert('admin');
- $form->isblank("formname", $locale->text("You're not editing a file.")) unless ($form->{type} eq "stylesheet");
+ $form->isblank("formname", $locale->text("You're not editing a file."));
my ($filename) = AM->prepare_template_filename(\%myconfig, $form);
if (my $error = AM->save_template($filename, $form->{content})) {
my $format = $form->{"format"} eq "html" ? "html" : "tex";
- $form->{"title"} = $form->{"type"} eq "stylesheet" ? $locale->text("Edit the stylesheet") : $locale->text("Edit templates");
+ $form->{"title"} = $locale->text("Edit templates");
if ($form->{"format"}) {
$form->{"title"} = uc($form->{"format"}) . " - " . $form->{"title"};
}
my @hidden = qw(type format);
- if (($form->{"type"} ne "stylesheet") && !$form->{"edit"}) {
+ if (!$form->{"edit"}) {
$options{"SHOW_EDIT_OPTIONS"} = 1;
#
push(@hidden, qw(formname language printer));
}
- if ($form->{formname} || ($form->{type} eq "stylesheet")) {
+ if ($form->{formname}) {
$options{"SHOW_CONTENT"} = 1;
($options{"filename"}, $options{"display_filename"})
'Edit the request_quotation' => 'Bearbeiten der Preisanfrage',
'Edit the sales_order' => 'Bearbeiten des Auftrags',
'Edit the sales_quotation' => 'Bearbeiten des Angebots',
- 'Edit the stylesheet' => 'Stilvorlage bearbeiten',
'Edit units' => 'Einheiten bearbeiten',
'Edit user signature' => 'Benutzersignatur bearbeiten',
'Editable' => 'Bearbeitbar',
action: display_template_form
format: tex
type: templates
-- parent: system_templates
- id: system_templates_stylesheet
- name: Stylesheet
- order: 300
- module: amtemplates.pl
- params:
- action: display_template_form
- type: stylesheet
- parent: system
id: system_general_ledger_corrections
name: General Ledger Corrections