Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c1551e49

Von Moritz Bunkus vor mehr als 2 Jahren hinzugefügt

  • ID c1551e49adc832aae84be606c74794679ebc1bec
  • Vorgänger 7608d92e
  • Nachfolger 9f3c46ff

Benutzerdef. Var. als HTML-Feld: Druckunterstützung

Unterschiede anzeigen:

SL/BackgroundJob/CreatePeriodicInvoices.pm
451 451
      longdescription => 'html',
452 452
      partnotes       => 'html',
453 453
      notes           => 'html',
454
      $::form->get_variable_content_types_for_cvars,
454 455
    },
455 456
  );
456 457

  
SL/Controller/Order.pm
2118 2118
          longdescription => 'html',
2119 2119
          partnotes       => 'html',
2120 2120
          notes           => 'html',
2121
          $::form->get_variable_content_types_for_cvars,
2121 2122
        },
2122 2123
      );
2123 2124
      1;
SL/DN.pm
1217 1217
                     longdescription => 'html',
1218 1218
                     partnotes       => 'html',
1219 1219
                     notes           => 'html',
1220
                     $print_form->get_variable_content_types_for_cvars,
1220 1221
                   },
1221 1222
  );
1222 1223

  
SL/Form.pm
61 61
use SL::DBUtils;
62 62
use SL::DB::AdditionalBillingAddress;
63 63
use SL::DB::Customer;
64
use SL::DB::CustomVariableConfig;
64 65
use SL::DB::Default;
65 66
use SL::DB::PaymentTerm;
66 67
use SL::DB::Vendor;
......
2713 2714
}
2714 2715

  
2715 2716
sub get_variable_content_types {
2717
  my ($self) = @_;
2718

  
2716 2719
  my %html_variables = (
2717 2720
    longdescription  => 'html',
2718 2721
    partnotes        => 'html',
......
2725 2728
    header_text      => 'html',
2726 2729
    footer_text      => 'html',
2727 2730
  );
2728
  return \%html_variables;
2731

  
2732
  return {
2733
    %html_variables,
2734
    $self->get_variable_content_types_for_cvars,
2735
  };
2736
}
2737

  
2738
sub get_variable_content_types_for_cvars {
2739
  my ($self)       = @_;
2740
  my $html_configs = SL::DB::Manager::CustomVariableConfig->get_all(where => [ type => 'htmlfield' ]);
2741
  my %types;
2742

  
2743
  if (@{ $html_configs }) {
2744
    my %prefix_by_module = (
2745
      Contacts => 'cp_cvar_',
2746
      CT       => 'vc_cvar_',
2747
      IC       => 'ic_cvar_',
2748
      Projects => 'project_cvar_',
2749
      ShipTo   => 'shiptocvar_',
2750
    );
2751

  
2752
    foreach my $cfg (@{ $html_configs }) {
2753
      my $prefix = $prefix_by_module{$cfg->module};
2754
      $types{$prefix . $cfg->name} = 'html' if $prefix;
2755
    }
2756
  }
2757

  
2758
  return %types;
2729 2759
}
2730 2760

  
2731 2761
sub current_date {
templates/print/marei/requirement_spec.tex
59 59

  
60 60
%\tableofcontents
61 61

  
62
%%%% Deaktiviertes Beispiel, wie benutzerdefinierte Variablen ausgegeben werden können: %%%%
63
%% \newpage
64
%%
65
%% \section{Benutzerdefinierte Variablen}
66
%%
67
%% %$ ( FOREACH cvar = rspec.cvars_by_config ) $
68
%% Name: $ ( KiviLatex.filter(cvar.config.name) ) $
69
%%
70
%% Wert:% $ ( IF cvar.config.type == 'htmlfield' ) $
71
%% $ ( KiviLatex.filter_html(cvar.value_as_text) ) $
72
%% % $ ( ELSE ) $
73
%% $ ( KiviLatex.filter(cvar.value_as_text) ) $
74
%% % $ ( END ) $
75
%%
76
%% %$ ( END ) $
77
%%%% ENDE Beispiel für benutzerdefinierte Variablen %%%%
78

  
62 79
%% Versionen
63 80
\newpage
64 81

  

Auch abrufbar als: Unified diff