From b391b42da949cd0c2a9c8c1860042e19eb0e62c2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 24 Mar 2017 16:04:02 +0100 Subject: [PATCH] =?utf8?q?=C2=BBSystem=C2=AB=20=E2=86=92=20=C2=BBVorlagen?= =?utf8?q?=C2=AB=20=E2=86=92=20=C2=BBStilvorlage=C2=AB=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Die Funktion funktioniert seit der Aufteilung der Stylesheets in mehrere Unterdateien schlicht nicht mehr. Da sich bisher niemand beschwert hat, wird die Funktion wohl auch nicht benötigt. --- SL/AM.pm | 34 ++++++++++++++-------------------- bin/mozilla/amtemplates.pl | 8 ++++---- locale/de/all | 1 - menus/user/00-erp.yaml | 8 -------- 4 files changed, 18 insertions(+), 33 deletions(-) diff --git a/SL/AM.pm b/SL/AM.pm index e4e5ad7cd..606d3f66f 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -435,30 +435,24 @@ sub prepare_template_filename { 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(); diff --git a/bin/mozilla/amtemplates.pl b/bin/mozilla/amtemplates.pl index d32cf790a..c5a49820a 100644 --- a/bin/mozilla/amtemplates.pl +++ b/bin/mozilla/amtemplates.pl @@ -95,7 +95,7 @@ sub save_template { $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})) { @@ -126,7 +126,7 @@ sub display_template_form { 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"}; } @@ -135,7 +135,7 @@ sub display_template_form { my @hidden = qw(type format); - if (($form->{"type"} ne "stylesheet") && !$form->{"edit"}) { + if (!$form->{"edit"}) { $options{"SHOW_EDIT_OPTIONS"} = 1; # @@ -266,7 +266,7 @@ sub display_template_form { 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"}) diff --git a/locale/de/all b/locale/de/all index a0b2178ca..2625fc495 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1160,7 +1160,6 @@ $self->{texts} = { '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', diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index 3c492a6cf..53899b657 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -1315,14 +1315,6 @@ 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 -- 2.20.1