use SL::Auth::DB;
use SL::Auth::LDAP;
use SL::AM;
+use SL::DB;
use SL::Common;
use SL::DBUtils;
use SL::Mailer;
_recode_recursively(SL::Iconv->new($encoding, $db_charset), $self);
- $self->{action} = lc $self->{action};
- $self->{action} =~ s/( |-|,|\#)/_/g;
-
#$self->{version} = "2.6.1"; # Old hardcoded but secure style
open VERSION_FILE, "VERSION"; # New but flexible code reads version from VERSION-file
$self->{version} = <VERSION_FILE>;
pop @segments;
$uri->path_segments(@segments);
- my $session_cookie_value = $main::auth->get_session_id();
- $session_cookie_value ||= 'NO_SESSION';
+ my $session_cookie_value = $main::auth->get_session_id();
- $session_cookie = $cgi->cookie('-name' => $main::auth->get_session_cookie_name(),
- '-value' => $session_cookie_value,
- '-path' => $uri->path,
- '-secure' => $ENV{HTTPS});
+ if ($session_cookie_value) {
+ $session_cookie = $cgi->cookie('-name' => $main::auth->get_session_cookie_name(),
+ '-value' => $session_cookie_value,
+ '-path' => $uri->path,
+ '-secure' => $ENV{HTTPS});
+ }
}
my %cgi_params = ('-type' => $params{content_type});
$cgi_params{'-charset'} = $params{charset} if ($params{charset});
+ $cgi_params{'-cookie'} = $session_cookie if ($session_cookie);
- my $output = $cgi->header('-cookie' => $session_cookie,
- %cgi_params);
+ my $output = $cgi->header(%cgi_params);
$main::lxdebug->leave_sub();
push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
push @header, '<script type="text/javascript" src="js/jquery.js"></script>',
'<script type="text/javascript" src="js/common.js"></script>',
- '<style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>',
+ '<style type="text/css">@import url(js/jscalendar/calendar-win2k-1.css);</style>',
'<script type="text/javascript" src="js/jscalendar/calendar.js"></script>',
'<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>',
'<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>',
$file = "templates/webpages/${file}.html";
} else {
- my $info = "Web page template '${file}' not found.\n" .
- "Please re-run 'locales.pl' in 'locale/${language}'.";
- print(qq|<pre>$info</pre>|);
+ my $info = "Web page template '${file}' not found.\n";
+ print qq|<pre>$info</pre>|;
::end_of_request();
}
map { $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys %::myconfig;
}
- $additional_params->{"conf_dbcharset"} = $main::dbcharset;
- $additional_params->{"conf_webdav"} = $main::webdav;
- $additional_params->{"conf_lizenzen"} = $main::lizenzen;
- $additional_params->{"conf_latex_templates"} = $main::latex;
- $additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates;
- $additional_params->{"conf_vertreter"} = $main::vertreter;
- $additional_params->{"conf_show_best_before"} = $main::show_best_before;
+ $additional_params->{"conf_dbcharset"} = $::dbcharset;
+ $additional_params->{"conf_webdav"} = $::webdav;
+ $additional_params->{"conf_lizenzen"} = $::lizenzen;
+ $additional_params->{"conf_latex_templates"} = $::latex;
+ $additional_params->{"conf_opendocument_templates"} = $::opendocument_templates;
+ $additional_params->{"conf_vertreter"} = $::vertreter;
+ $additional_params->{"conf_show_best_before"} = $::show_best_before;
+ $additional_params->{"conf_parts_image_css"} = $::parts_image_css;
+ $additional_params->{"conf_parts_listing_images"} = $::parts_listing_images;
+ $additional_params->{"conf_parts_show_image"} = $::parts_show_image;
if (%main::debug_options) {
map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
$ext_for_format = 'xml';
} elsif ( $self->{"format"} =~ /elster(?:winston|taxbird)/i ) {
- $template_type = 'xml';
+ $template_type = 'XML';
} elsif ( $self->{"format"} =~ /excel/i ) {
$template_type = 'Excel';
bin_list => $main::locale->text('Bin List'),
credit_note => $main::locale->text('Credit Note'),
invoice => $main::locale->text('Invoice'),
- packing_list => $main::locale->text('Packing List'),
pick_list => $main::locale->text('Pick List'),
proforma => $main::locale->text('Proforma Invoice'),
purchase_order => $main::locale->text('Purchase Order'),
sales_order => $main::locale->text('Confirmation'),
sales_quotation => $main::locale->text('Quotation'),
storno_invoice => $main::locale->text('Storno Invoice'),
- storno_packing_list => $main::locale->text('Storno Packing List'),
sales_delivery_order => $main::locale->text('Delivery Order'),
purchase_delivery_order => $main::locale->text('Delivery Order'),
dunning => $main::locale->text('Dunning'),
undef $standard_dbh;
}
- $standard_dbh ||= $self->dbconnect_noauto($myconfig);
+ $standard_dbh ||= SL::DB::create->dbh;
$main::lxdebug->leave_sub(2);
# $main::locale->text('invoice')
# $main::locale->text('proforma')
# $main::locale->text('sales_order')
-# $main::locale->text('packing_list')
# $main::locale->text('pick_list')
# $main::locale->text('purchase_order')
# $main::locale->text('bin_list')
=head1 SPECIAL FUNCTIONS
-=over 4
-
-=item _store_value()
+=head2 C<_store_value()>
parses a complex var name, and stores it in the form.
filter.status[] => $form->{status}->[ val1, val2, ... ]
-=item update_business PARAMS
+=head2 C<update_business> PARAMS
PARAMS (not named):
\%config, - config hashref
special behaviour for empty strings in customerinitnumber field:
will in this case not increase the value, and return undef.
-=item redirect_header $url
+=head2 C<redirect_header> $url
Generates a HTTP redirection header for the new C<$url>. Constructs an
absolute URL including scheme, host name and port. If C<$url> is a
print $::form->redirect_header('oe.pl?action=edit&id=1234');
print $::form->redirect_header('http://www.lx-office.org/');
+=head2 C<header>
+
+Generates a general purpose http/html header and includes most of the scripts
+ans stylesheets needed.
+
+Only one header will be generated. If the method was already called in this
+request it will not output anything and return undef. Also if no
+HTTP_USER_AGENT is found, no header is generated.
+
+Although header does not accept parameters itself, it will honor special
+hashkeys of its Form instance:
+
+=over 4
+
+=item refresh_time
+
+=item refresh_url
+
+If one of these is set, a http-equiv refresh is generated. Missing parameters
+default to 3 seconds and the refering url.
+
+=item stylesheet
+
+=item stylesheets
+
+If these are arrayrefs the contents will be inlined into the header.
+
+=item landscape
+
+If true, a css snippet will be generated that sets the page in landscape mode.
+
+=item favicon
+
+Used to override the default favicon.
+
+=item title
+
+A html page title will be generated from this
+
=back
=cut