return @{ $self->{stylesheet} };
}
+sub get_stylesheet_for_user {
+ my $css_path = 'css';
+ if (my $user_style = $::myconfig{stylesheet}) {
+ $user_style =~ s/\.css$//; # nuke trailing .css, this is a remnand of pre 2.7.0 stylesheet handling
+ $css_path = "$css_path/$user_style" if -d "$css_path/$user_style";
+ } else {
+ $css_path = "$css_path/lx-office-erp";
+ }
+ $::myconfig{css_path} = $css_path; # needed for menunew, FIXME: don't do this here
+
+ return $css_path;
+}
+
sub header {
$::lxdebug->enter_sub;
$::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++;
+ my $css_path = $self->get_stylesheet_for_user;
+
$self->{favicon} ||= "favicon.ico";
$self->{titlebar} = "$self->{title} - $self->{titlebar}" if $self->{title};
push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
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>',
- '<link rel="stylesheet" type="text/css" href="js/jscalendar/calendar-win2k-1.css">',
- '<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>',
- '<script type="text/javascript" src="js/part_selection.js"></script>',
- '<script type="text/javascript" src="js/jquery-ui.js"></script>',
- '<script type="text/javascript" src="js/jqModal.js"></script>',
- '<link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.12.custom.css">';
- push @header, $self->{javascript} if $self->{javascript};
+ push @header, map { qq|<script type="text/javascript" src="js/$_.js"></script>| }
+ qw(jquery common jscalendar/calendar jscalendar/lang/calendar-de jscalendar/calendar-setup part_selection jquery-ui jqModal switchmenuframe);
+ push @header, map { qq|<link rel="stylesheet" type="text/css" href="$css_path/$_.css">| }
+ qw(main menu tabcontent list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header ui-lightness/jquery-ui-1.8.12.custom);
+ push @header, map { qq|<link rel="stylesheet" type="text/css" href="js/jscalendar/calendar-win2k-1.css">| }
push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] };
push @header, "<script type='text/javascript'>function fokus(){ document.$self->{fokus}.focus(); }</script>" if $self->{fokus};
push @header, sprintf "<script type='text/javascript'>top.document.title='%s';</script>",
EOT
print " $_\n" for @header;
print <<EOT;
- <link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css">
<meta name="robots" content="noindex,nofollow">
- <link rel="stylesheet" type="text/css" href="css/tabcontent.css">
<script type="text/javascript" src="js/tabcontent.js">
/***********************************************
$main::lxdebug->enter_sub(2);
my ($self, $myconfig, $amount, $places, $dash) = @_;
+ $dash ||= '';
if ($amount eq "") {
$amount = 0;
$amount *= 1;
$places *= -1;
- my ($actual_places) = ($amount =~ /\.(\d+)/);
- $actual_places = length($actual_places);
- $places = $actual_places > $places ? $actual_places : $places;
+ if ($amount =~ /\.(\d+)/) {
+ my $actual_places = length $1;
+ $places = $actual_places if $actual_places > $places;
+ }
}
}
$amount = $self->round_amount($amount, $places);
$p[0] =~ s/\B(?=(...)*$)/$d[1]/g if $d[1]; # add 1,000 delimiters
$amount = $p[0];
- $amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne '');
+ $amount .= $d[0].($p[1]||'').(0 x ($places - length ($p[1]||''))) if ($places || $p[1] ne '');
$amount = do {
($dash =~ /-/) ? ($neg ? "($amount)" : "$amount" ) :
$formname ||= $self->{formname};
$self->{recipient_locale} ||= Locale->lang_to_locale($self->{language});
- my $recipient_locale = Locale->new($self->{recipient_locale});
+ local $::locale = Locale->new($self->{recipient_locale});
my %formname_translations = (
- bin_list => $recipient_locale->text('Bin List'),
- credit_note => $recipient_locale->text('Credit Note'),
- invoice => $recipient_locale->text('Invoice'),
- pick_list => $recipient_locale->text('Pick List'),
- proforma => $recipient_locale->text('Proforma Invoice'),
- purchase_order => $recipient_locale->text('Purchase Order'),
- request_quotation => $recipient_locale->text('RFQ'),
- sales_order => $recipient_locale->text('Confirmation'),
- sales_quotation => $recipient_locale->text('Quotation'),
- storno_invoice => $recipient_locale->text('Storno Invoice'),
- sales_delivery_order => $recipient_locale->text('Delivery Order'),
- purchase_delivery_order => $recipient_locale->text('Delivery Order'),
- dunning => $recipient_locale->text('Dunning'),
+ bin_list => $main::locale->text('Bin List'),
+ credit_note => $main::locale->text('Credit Note'),
+ invoice => $main::locale->text('Invoice'),
+ pick_list => $main::locale->text('Pick List'),
+ proforma => $main::locale->text('Proforma Invoice'),
+ purchase_order => $main::locale->text('Purchase Order'),
+ request_quotation => $main::locale->text('RFQ'),
+ sales_order => $main::locale->text('Confirmation'),
+ sales_quotation => $main::locale->text('Quotation'),
+ storno_invoice => $main::locale->text('Storno Invoice'),
+ sales_delivery_order => $main::locale->text('Delivery Order'),
+ purchase_delivery_order => $main::locale->text('Delivery Order'),
+ dunning => $main::locale->text('Dunning'),
);
$main::lxdebug->leave_sub();
my ($login) = selectrow_query($self, $dbh, qq|SELECT login FROM employee WHERE id = ?|, conv_i($params{id}));
if ($login) {
- my $user = User->new($login);
+ my $user = User->new(login => $login);
map { $self->{$params{prefix} . "_${_}"} = $user->{$_}; } qw(address businessnumber co_ustid company duns email fax name signature taxnumber tel);
$self->{$params{prefix} . '_login'} = $login;