longdescription => 'html',
partnotes => 'html',
notes => 'html',
+ $print_form->get_variable_content_types_for_cvars,
},
);
use SL::DBUtils;
use SL::DB::AdditionalBillingAddress;
use SL::DB::Customer;
+use SL::DB::CustomVariableConfig;
use SL::DB::Default;
use SL::DB::PaymentTerm;
use SL::DB::Vendor;
}
sub get_variable_content_types {
+ my ($self) = @_;
+
my %html_variables = (
longdescription => 'html',
partnotes => 'html',
header_text => 'html',
footer_text => 'html',
);
- return \%html_variables;
+
+ return {
+ %html_variables,
+ $self->get_variable_content_types_for_cvars,
+ };
+}
+
+sub get_variable_content_types_for_cvars {
+ my ($self) = @_;
+ my $html_configs = SL::DB::Manager::CustomVariableConfig->get_all(where => [ type => 'htmlfield' ]);
+ my %types;
+
+ if (@{ $html_configs }) {
+ my %prefix_by_module = (
+ Contacts => 'cp_cvar_',
+ CT => 'vc_cvar_',
+ IC => 'ic_cvar_',
+ Projects => 'project_cvar_',
+ ShipTo => 'shiptocvar_',
+ );
+
+ foreach my $cfg (@{ $html_configs }) {
+ my $prefix = $prefix_by_module{$cfg->module};
+ $types{$prefix . $cfg->name} = 'html' if $prefix;
+ }
+ }
+
+ return %types;
}
sub current_date {
%\tableofcontents
+%%%% Deaktiviertes Beispiel, wie benutzerdefinierte Variablen ausgegeben werden können: %%%%
+%% \newpage
+%%
+%% \section{Benutzerdefinierte Variablen}
+%%
+%% %$ ( FOREACH cvar = rspec.cvars_by_config ) $
+%% Name: $ ( KiviLatex.filter(cvar.config.name) ) $
+%%
+%% Wert:% $ ( IF cvar.config.type == 'htmlfield' ) $
+%% $ ( KiviLatex.filter_html(cvar.value_as_text) ) $
+%% % $ ( ELSE ) $
+%% $ ( KiviLatex.filter(cvar.value_as_text) ) $
+%% % $ ( END ) $
+%%
+%% %$ ( END ) $
+%%%% ENDE Beispiel für benutzerdefinierte Variablen %%%%
+
%% Versionen
\newpage