# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
__PACKAGE__->meta->make_manager_class;
+sub income_accno_id {
+ my ($self, $taxzone) = @_;
+ my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
+ my $method = 'income_accno_id_' . $taxzone_id;
+
+ return $self->$method;
+}
+
+sub expense_accno_id {
+ my ($self, $taxzone) = @_;
+ my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
+ my $method = 'expense_accno_id_' . $taxzone_id;
+
+ return $self->$method;
+}
+
1;
sub initialize {
my $self = shift;
- $self->make_attr_auto_helpers;
+ $self->make_attr_auto_helpers unless $self->is_initialized;
$self->SUPER::initialize(@_);
}
class => 'SL::DB::Assembly',
column_map => { id => 'id' },
},
+ partsgroup => {
+ type => 'one to one',
+ class => 'SL::DB::PartsGroup',
+ column_map => { partsgroup_id => 'id' },
+ },
);
__PACKAGE__->meta->initialize;
sub is_type {
my $self = shift;
my $type = lc(shift || '');
+ die 'invalid type' unless $type =~ /^(?:part|service|assembly)$/;
- if ($type =~ m/^part/) {
- return !$self->assembly && $self->inventory_accno_id ? 1 : 0;
-
- } elsif ($type =~ m/^service/) {
- return !$self->inventory_accno_id && !$self->assembly ? 1 : 0;
+ return $self->type eq $type ? 1 : 0;
+}
- } elsif ($type =~ m/^assembl/) {
- return $self->assembly ? 1 : 0;
+sub is_part { $_[0]->is_type('part') }
+sub is_assembly { $_[0]->is_type('assembly') }
+sub is_service { $_[0]->is_type('service') }
+sub type {
+ my ($self, $type) = @_;
+ if (@_ > 1) {
+ die 'invalid type' unless $type =~ /^(?:part|service|assembly)$/;
+ $self->assembly( $type eq 'assembly' ? 1 : 0);
+ $self->inventory_accno_id($type ne 'service' ? 1 : undef);
}
- confess "Unknown type parameter '$type'";
+ return 'assembly' if $self->assembly;
+ return 'part' if $self->inventory_accno_id;
+ return 'service';
+}
+
+sub new_part {
+ my ($class, %params) = @_;
+ $class->new(%params, type => 'part');
+}
+
+sub new_assembly {
+ my ($class, %params) = @_;
+ $class->new(%params, type => 'assembly');
+}
+
+sub new_service {
+ my ($class, %params) = @_;
+ $class->new(%params, type => 'service');
+}
+
+sub orphaned {
+ my ($self) = @_;
+ die 'not an accessor' if @_ > 1;
+
+ my @relations = qw(
+ SL::DB::InvoiceItem
+ SL::DB::OrderItem
+ SL::DB::Inventory
+ SL::DB::RMAItem
+ );
+
+ for my $class (@relations) {
+ eval "require $class";
+ return 0 if $class->_get_manager_class->get_all_count(query => [ parts_id => $self->id ]);
+ }
+ return 1;
}
sub get_sellprice_info {
shift->unit_obj->convertible_units;
}
+# autogenerated accessor is slightly off...
+sub buchungsgruppe {
+ shift->buchungsgruppen(@_);
+}
+
1;
__END__
This is a standard Rose::DB::Object based model and can be used as one.
-=head1 FUNCTIONS
+=head1 TYPES
+
+Although the base class is called C<Part> we usually talk about C<Articles> if
+we mean instances of this class. This is because articles come in three
+flavours called:
=over 4
-=item is_type $type
+=item Part - a single part
+
+=item Service - a part without onhand, and without inventory accounting
+
+=item Assembly - a collection of both parts and services
+
+=back
+
+These types are sadly represented by data inside the class and cannot be
+migrated into a flag. To work around this, each C<Part> object knows what type
+it currently is. Since the type ist data driven, there ist no explicit setting
+method for it, but you can construct them explicitly with C<new_part>,
+C<new_service>, and C<new_assembly>. A Buchungsgruppe should be supplied in this
+case, but it will use the default Buchungsgruppe if you don't.
+
+Matching these there are assorted helper methods dealing with type:
+
+=head2 new_part PARAMS
+
+=head2 new_service PARAMS
+
+=head2 new_assembly PARAMS
+
+Will set the appropriate data fields so that the resulting instance will be of
+tthe requested type. Since part of the distinction are accounting targets,
+providing a C<Buchungsgruppe> is recommended. If none is given the constructor
+will load a default one and set the accounting targets from it.
+
+=head2 type
+
+Returns the type as a string. Can be one of C<part>, C<service>, C<assembly>.
+
+=head2 is_type TYPE
Tests if the current object is a part, a service or an
assembly. C<$type> must be one of the words 'part', 'service' or
Returns 1 if the requested type matches, 0 if it doesn't and
C<confess>es if an unknown C<$type> parameter is encountered.
-=item get_sellprice_info %params
+=head2 is_part
+
+=head2 is_service
+
+=head2 is_assembly
+
+Shorthand for is_type('part') etc.
+
+=head1 FUNCTIONS
+
+=head2 get_sellprice_info %params
Retrieves the C<sellprice> and C<price_factor_id> for a part under
different conditions and returns a hash reference with those two keys.
If none of the above conditions is met then the information from
C<$self> is used.
-=item get_ordered_qty %params
+=head2 get_ordered_qty %params
Retrieves the quantity that has been ordered from a vendor but that
has not been delivered yet. Only open purchase orders are considered.
-=item get_uncommissioned_qty %params
+=head2 orphaned
-Retrieves the quantity that has been ordered by a customer but that
-has not been commissioned yet. Only open sales orders are considered.
+Checks if this articke is used in orders, invoices, delivery orders or
+assemblies.
-=back
+=head2 buchungsgruppe BUCHUNGSGRUPPE
+
+Used to set the accounting informations from a L<SL:DB::Buchungsgruppe> object.
+Please note, that this is a write only accessor, the original Buchungsgruppe can
+not be retrieved from an article once set.
=head1 AUTHOR
use Template;
use URI;
use List::Util qw(first max min sum);
-use List::MoreUtils qw(any);
+use List::MoreUtils qw(any apply);
use strict;
}
if (%main::myconfig) {
- map({ $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys(%main::myconfig));
- my $jsc_dateformat = $main::myconfig{"dateformat"};
- $jsc_dateformat =~ s/d+/\%d/gi;
- $jsc_dateformat =~ s/m+/\%m/gi;
- $jsc_dateformat =~ s/y+/\%Y/gi;
- $additional_params->{"myconfig_jsc_dateformat"} = $jsc_dateformat;
+ $::myconfig{jsc_dateformat} = apply {
+ s/d+/\%d/gi;
+ s/m+/\%m/gi;
+ s/y+/\%Y/gi;
+ } $::myconfig{"dateformat"};
$additional_params->{"myconfig"} ||= \%::myconfig;
+ map { $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys %::myconfig;
}
$additional_params->{"conf_dbcharset"} = $main::dbcharset;
use strict;
+{ # This will give you an id for identifying html tags and such.
+ # It's guaranteed to be unique unless you exceed 10 mio calls per request.
+ # Do not use these id's to store information across requests.
+my $_id_sequence = int rand 1e7;
+sub _tag_id {
+ return $_id_sequence = ($_id_sequence + 1) % 1e7;
+}
+}
+
sub _H {
my $string = shift;
return $::locale->quote_special_chars('HTML', $string);
return $code;
}
+sub javascript {
+ my ($self, $data) = @_;
+ return $self->html_tag('script', $data, type => 'text/javascript');
+}
+
+sub date_tag {
+ my ($self, $name, $value, @slurp) = @_;
+ my %params = _hashify(@slurp);
+ my $name_e = _H($name);
+ my $seq = _tag_id();
+
+ $params{cal_align} ||= 'BR';
+
+ $self->input_tag($name, $value,
+ size => 11,
+ title => _H($::myconfig{dateformat}),
+ onBlur => 'check_right_date_format(this)',
+ %params,
+ ) . ((!$params{no_cal}) ?
+ $self->html_tag('img', undef,
+ src => 'image/calendar.png',
+ id => "trigger$seq",
+ title => _H($::myconfig{dateformat}),
+ %params,
+ ) .
+ $self->javascript(
+ "Calendar.setup({ inputField: '$name_e', ifFormat: '$::myconfig{jsc_dateformat}', align: '$params{cal_align}', button: 'trigger$seq' });"
+ ) : '');
+}
+
1;
__END__
created with said C<label>. No attribute named C<label> is created in
that case.
+=item C<date_tag $name, $value, %attributes>
+
+=item C<date_tag $name, $value, cal_align =E<gt> $align_code, %attributes>
+
+Creates a date input field, with an attached javascript that will open a
+calendar on click. The javascript ist by default anchoered at the bottom right
+sight. This can be overridden with C<cal_align>, see Calendar documentation for
+the details, usually you'll want a two letter abbreviation of the alignment.
+Right + Bottom becomes C<BL>.
+
=back
=head2 CONVERSION FUNCTIONS
# member file
$memberfile = "users/members";
-# Wenn nicht Bilanzierung dann auf 1 setzen
+# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
+# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
$eur = 1;
# location of sendmail
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
# set language for login and admin
+# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
$language = "de";
# Oracle
-/* stylesheet for LX-Office ERP
-Getestet mit W3C CSS-Validator:
-Keine Fehler oder Warnungen gefunden
-*/
+/* Stylesheet for Lx-Office
+ * Name: Mobile.css*/
+
+/* The look of links */
A { font-size: 8pt; }
A:link { color: black; text-decoration: none; }
A:visited { color: black; text-decoration: none; }
}
input:focus, textarea:focus, select:focus {
- background-color:yellow;
+ background-color: yellow;
}
body {
font-size:8pt;
color: black;
}
+
+.message_error_login {
+ color: #000000;
+ border: 1px solid #8b0000;
+ background-color: #ffcccc;
+ padding: 3px;
+}
+.message_ok {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #ADFFB6;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
+.message_error {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #FFAAAA;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
+.message_hint {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #FFFE47;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
.listtop {
background-color: #b8d1f3;
text-align:left;
background:#D4D0C8;
}
-.message_ok {
- font-size: 10pt;
- padding:3px;
- background-color: lightgreen;
- color: black;
- font-weight: bolder;
- text-align:center;
- border-style:solid;
- border-width:thin;
-}
-
-.message_error {
- font-size: 10pt;
- padding:5px;
- background-color: #FFAAAA;
- color: white;
- font-weight: bolder;
- text-align:center;
- border-style:solid;
- border-width:thin;
-}
/* Bei Listen den Farbwechsel zur besseren Lesbarkeit: */
.listrow1 { background-color: #C8D4C6; color: black; vertical-align: top; }
-/* stylesheet for LX-Office ERP
-Getestet mit W3C CSS-Validator:
-Keine Fehler oder Warnungen gefunden
-*/
+/* Stylesheet for Lx-Office
+ * Name: Win2000.css*/
+/* The look of links */
A:link { color: black; text-decoration: none; }
A:visited { color: black; text-decoration: none; }
A:active { color: black; text-decoration: underline; }
A:hover {
color:white;
background-color: #093280;
- font-size: 10pt;
+ /*font-size: 10pt;*/
text-decoration: none;
}
input:focus, textarea:focus, select:focus {
- background-color:yellow;
+ background-color: yellow;
}
body {
font-size:10pt;
color: black;
}
+
+.message_error_login {
+ color: #000000;
+ border: 1px solid #8b0000;
+ background-color: #ffcccc;
+ padding: 3px;
+}
+.message_ok {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #ADFFB6;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
+.message_error {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #FFAAAA;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
+.message_hint {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #FFFE47;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
+
.listtop {
background-color: #b8d1f3;
text-align:left;
-/* stylesheet for LX-Office ERP */
+/* Stylesheet for Lx-Office
+ * Name: lx-office-erp.css*/
/* The look of links */
A:link { color: mediumblue; text-decoration: none; }
}
input:focus, textarea:focus, select:focus {
- background-color:yellow;
+ background-color: yellow;
}
body {
color: black;
}
+.message_error_login {
+ color: #000000;
+ border: 1px solid #8b0000;
+ background-color: #ffcccc;
+ padding: 3px;
+}
.message_ok {
font-size: 12pt;
padding:5px;
- background-color: lightgreen;
+ background-color: #ADFFB6;
color: black;
font-weight: bolder;
text-align:center;
border-style:solid;
border-width:thin;
}
-
.message_error {
font-size: 12pt;
padding:5px;
border-style:solid;
border-width:thin;
}
+.message_hint {
+ font-size: 12pt;
+ padding:5px;
+ background-color: #FFFE66;
+ color: black;
+ font-weight: bolder;
+ text-align:center;
+ border-style:solid;
+ border-width:thin;
+}
/*
Überschriftsbalken
.unbalanced_ledger {
background-color: #ffa0a0;
}
-
-.error_message {
- color: #000000;
- border: 1px solid #8b0000;
- background-color: #ffcccc;
- padding: 3px;
-}
-
'Amended Advance Turnover Tax Return (Nr. 10)' => 'Ist dies eine berichtigte Anmeldung? (Nr. 10/Zeile 15 Steuererklärung)',
'Amount' => 'Betrag',
'Amount Due' => 'Betrag fällig',
+ 'Amount has to be greater then zero! Wrong row number: ' => 'Leere Eingabe oder Werte kleiner, gleich null eingegeben. Fehler in Reihe Nummer: ',
'Annotations' => 'Anmerkungen',
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.',
'Ap aging on %s' => 'Offene Verbindlichkeiten zum %s',
'Lx-Office can fix these problems automatically.' => 'Lx-Office kann solche Probleme automatisch beheben.',
'Lx-Office has been switched to group-based access restrictions.' => 'Lx-Office wurde auf eine gruppenbasierte Benutzerzugriffsverwaltung umgestellt.',
'Lx-Office has found one or more problems in the general ledger.' => 'Lx-Office hat ein oder mehrere Probleme im Hauptbuch gefunden.',
- 'Lx-Office is about to update the database <b>#1</b>.' => 'Lx-Office wird gleich die Datenbank <b>#1</b> aktualisieren.',
+ 'Lx-Office is about to update the database [ #1 ].' => 'Lx-Office wird gleich die Datenbank [ #1 ] aktualisieren.',
'Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.' => 'Lx-Office enthält jetzt auch echte Lagerverwaultung anstatt reiner Mengenzählung.',
'MAILED' => 'Gesendet',
'MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES' => 'Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte wählen Sie ein anderes Menü in der Benutzerkonfiguration im Administrationsmenü aus.',
'May ' => 'Mai',
'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
'Medium Number' => 'Datenträgernummer',
+ 'Members not of' => 'Benutzer nicht in Gruppe',
+ 'Members of' => 'Benutzer in Gruppe',
'Memo' => 'Memo',
'Menu' => 'Menü',
'Message' => 'Nachricht',
'No valid number entered for pricegroup "#1".' => 'Für Preisgruppe "#1" wurde keine gültige Nummer eingegeben.',
'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
'No warehouse has been created yet or the quantity of the bins is not configured yet.' => 'Es wurde noch kein Lager angelegt, bzw. die dazugehörigen Lagerplätze sind noch nicht konfiguriert.',
- 'Amount has to be greater then zero! Wrong row number: ' => 'Leere Eingabe oder Werte kleiner, gleich null eingegeben. Fehler in Reihe Nummer: ',
'No.' => 'Position',
'Non-taxable Purchases' => 'Nicht zu versteuernde Einkäufe',
'Non-taxable Sales' => 'Nicht zu versteuernde Verkäufe',
'User name' => 'Benutzername',
'User saved!' => 'Benutzer gespeichert!',
'Username' => 'Benutzername',
- 'Users in<br>this group' => 'Benutzer in<br>dieser Gruppe',
- 'Users not in this group' => 'Benutzer nicht in dieser Gruppe',
'Ust-IDNr' => 'USt-IdNr.',
'Valid from' => 'Gültig ab',
'Valid until' => 'gültig bis',
'Amended Advance Turnover Tax Return (Nr. 10)' => 'Ist dies eine berichtigte Anmeldung? (Nr. 10/Zeile 15 Steuererklärung)',
'Amount' => 'Betrag',
'Amount Due' => 'Betrag fällig',
+ 'Amount has to be greater then zero! Wrong row number: ' => '"Betrag" muss größer Null sein. Fehlerhafte Zeile: ',
'Annotations' => 'Hilfe',
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.',
'Ap aging on %s' => 'Offene Verbindlichkeiten zum %s',
'Lx-Office can fix these problems automatically.' => 'Lx-Office kann solche Probleme automatisch beheben.',
'Lx-Office has been switched to group-based access restrictions.' => 'Lx-Office wurde auf eine gruppenbasierte Benutzerzugriffsverwaltung umgestellt.',
'Lx-Office has found one or more problems in the general ledger.' => 'Lx-Office hat ein oder mehrere Probleme im Hauptbuch gefunden.',
- 'Lx-Office is about to update the database <b>#1</b>.' => 'Lx-Office wird gleich die Datenbank <b>#1</b> aktualisieren.',
+ 'Lx-Office is about to update the database [ #1 ].' => '',
'Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.' => 'Lx-Office enthält jetzt auch echte Lagerverwaultung anstatt reiner Mengenzählung.',
'MAILED' => 'Gesendet',
'MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES' => 'Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte wählen Sie ein anderes Menü in der Benutzerkonfiguration im Administrationsmenü aus.',
'May ' => 'Mai',
'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
'Medium Number' => 'Datenträgernummer',
+ 'Members not of' => 'Nicht Mitglied in',
+ 'Members of' => 'Mitglied in',
'Memo' => 'Memo',
'Menu' => 'Menü',
'Message' => 'Nachricht',
'No valid number entered for pricegroup "#1".' => 'Für Preisgruppe "#1" wurde keine gültige Nummer eingegeben.',
'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
'No warehouse has been created yet or the quantity of the bins is not configured yet.' => 'Es wurde noch kein Lager angelegt, bzw. die dazugehörigen Lagerplätze sind noch nicht konfiguriert.',
- 'Amount has to be greater then zero! Wrong row number: ' => '"Betrag" muss größer Null sein. Fehlerhafte Zeile: ',
'No.' => 'Position',
'Non-taxable Purchases' => 'Nicht zu versteuernde Einkäufe',
'Non-taxable Sales' => 'Nicht zu versteuernde Verkäufe',
'The following warnings occured during an upgrade to the document templates:' => 'Die folgenden Warnungen traten während einer Aktualisierung der Dokumentenvorlagen auf:',
'The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>' => 'Die Formeln müssen in der folgenden Syntax eingegeben werden:<br>Bei normalen Artikeln:<br>Variablenname = Variable Einheit;<br>Variablenname2 = Variable2 Einheit2;<br>...<br>###<br>Variable + Variable2 * ( Variable - Variable2 )<br>Variablennamen und Einheiten dürfen nur aus alphanumerischen Zeichen bestehen.<br>Es muss jeweils die Gesamte Zeile eingegeben werden',
'The greetings have been saved.' => 'Die Anreden wurden gespeichert',
- 'The group has been added.' => 'Die Gruppe wurde erfasst.',
+ 'The group has been added.' => 'Die neue Gruppe wurde angelegt.',
'The group has been deleted.' => 'Die Gruppe wurde gelöscht.',
'The group has been saved.' => 'Die Gruppe wurde gespeichert.',
'The group memberships have been saved.' => 'Die Gruppenmitgliedschaften wurden gespeichert.',
'The pg_restore process could not be started.' => 'Der pg_restore-Prozess konnte nicht gestartet werden.',
'The preferred one is to install packages provided by your operating system distribution (e.g. Debian or RPM packages).' => 'Die bevorzugte Art, ein Perl-Modul zu installieren, ist durch Installation eines von Ihrem Betriebssystem zur Verfügung gestellten Paketes (z.B. Debian-Pakete oder RPM).',
'The program\'s exit code was #1 ("0" usually means that everything went OK).' => 'Der Exitcode des Programms war #1 ("0" bedeutet normalerweise, dass die Wiederherstellung erfolgreich war).',
- 'The project has been added.' => 'Das Projekt wurde erfasst.',
+ 'The project has been added.' => 'Das neue Projekt wurde angelegt.',
'The project has been saved.' => 'Das Projekt wurde gespeichert.',
'The restoration process has started. Here\'s the output of the "pg_restore" command:' => 'Der Wiederherstellungsprozess wurde gestartet. Hier ist die Ausgabe des "pg_restore"-Programmes:',
'The restoration process is complete. Please review "pg_restore"\'s output to find out if the restoration was successful.' => 'Die Wiederherstellung ist abgeschlossen. Bitte sehen Sie sich die Ausgabe von "pg_restore" an, um festzustellen, ob die Wiederherstellung erfolgreich war.',
'User name' => 'Benutzername',
'User saved!' => 'Benutzer gespeichert!',
'Username' => 'Benutzername',
- 'Users in<br>this group' => 'Benutzer in<br>dieser Gruppe',
- 'Users not in this group' => 'Benutzer nicht in dieser Gruppe',
'Ust-IDNr' => 'USt-IdNr.',
'Valid from' => 'Gültig ab',
'Valid until' => 'gültig bis',
'Lx-Office can fix these problems automatically.' => '',
'Lx-Office has been switched to group-based access restrictions.' => '',
'Lx-Office has found one or more problems in the general ledger.' => '',
- 'Lx-Office is about to update the database <b>#1</b>.' => '',
+ 'Lx-Office is about to update the database [ #1 ].' => '',
'Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.' => '',
'MAILED' => '',
'MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES' => '',
'May ' => '',
'May set the BCC field when sending emails' => '',
'Medium Number' => '',
+ 'Members not of' => 'Not members of',
+ 'Members of' => 'Members of',
'Memo' => '',
'Menu' => '',
'Message' => '',
'User name' => '',
'User saved!' => '',
'Username' => '',
- 'Users in<br>this group' => '',
- 'Users not in this group' => '',
'Ust-IDNr' => '',
'Valid from' => '',
'Valid until' => '',
'User name' => '',
'User saved!' => '',
'Username' => '',
- 'Users in<br>this group' => '',
- 'Users not in this group' => '',
+ 'Members of' => '',
+ 'Members not of' => '',
'Ust-IDNr' => '',
'Valid from' => '',
'Valid until' => '',
module=am.pl
action=show_history_search
-[System--Administration area]
-module=admin.pl
-action=login
-
[Program]
<h2>[% 'Administration' | $T8 %]</h2>
[% IF error_message %]
- <p><span class="error_message">[% error_message %]</span></p>
+ <p><span class="message_error_login">[% error_message %]</span></p>
[% END %]
<form method="post" action="admin.pl">
<div class="listtop">[% 'Delete group' | $T8 %]</div>
- <p>[% 'Do you really want to delete this group:' | $T8 %] [% name %] ?</p>
+ <p class="message_hint">[% 'Do you really want to delete this group:' | $T8 %] [% name %] ?</p>
<input type="hidden" name="delete_nextsub" value="delete_group">
- <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
<button type="button" onclick="history.back()">[% 'Back' | $T8 %]</button>
+ <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
</form>
<form name="Form" method="post" action="admin.pl">
<input type="hidden" name="group_id" value="[% HTML.escape(group_id) %]">
-
<input type="hidden" name="back_nextsub" value="edit_groups">
[% IF message %]
- <p>[% message %]</p>
+ <p class="message_ok">[% message %]</p>
[% END %]
- <div class="listtop">[% 'Edit group ' | $T8 %] [% HTML.escape(name) %]</div>
+ <div class="listtop">[% 'Edit group ' | $T8 %]: [% HTML.escape(name) %]</div>
+
+ <p><input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]"></p>
+
+ <hr>
- <table width="100%">
- <tr>
- <td>
+ <p class="listheading">[% 'Rename the group' | $T8 %]</p>
+ <table>
+ <tr><td><div style="">[% 'Name' | $T8 %]</th><td><input name="name" maxlength="50" value="[% HTML.escape(name) %]"></td></tr>
+ <tr><th>[% 'Description' | $T8 %]</th><td><input name="description" value="[% HTML.escape(description) %]"></td></tr>
+ </table>
+ <br>
+ <input type="hidden" name="save_nextsub" value="save_group">
+ <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
+
+ <hr>
+ <br>
+ <div class="listtop">[% 'Group membership' | $T8 %]</div>
<table>
- <tr class="listheading">
- <td><b>[% 'Users in<br>this group' | $T8 %]</b></td>
- <td> </td>
- <td><b>[% 'Users not in this group' | $T8 %]</b></td>
+ <tr>
+ <td><p class="listheading">[% 'Members of' | $T8 %]<br>[% HTML.escape(name) %]</p></td>
+ <td> </td>
+ <td><p class="listheading">[% 'Members not of' | $T8 %]<br>[% HTML.escape(name) %]</p></td>
</tr>
<tr>
</select>
</td>
</tr>
-
- <tr>
- <td>
- <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
- </td>
- </tr>
</table>
-
- <hr>
-
- <table>
- <tr class="listheading">
- <td colspan="2">[% 'Edit rights' | $T8 %]</td>
- </tr>
+ <hr>
+ <br>
+ <div class="listtop">[% 'Edit rights' | $T8 %]</div>
[% FOREACH right = RIGHTS %]
- <tr>
- <td>
+
[% IF right.is_section %]
- <i>[% right.description %]</i>
+ <br>
+ <h4 style="border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #ddd;">[% right.description %]</h4>
[% ELSE %]
+ <p style="/*font-size: 11px;*/ margin: 0;">
<input type="checkbox" name="[% HTML.escape(right.right) %]_granted" id="[% HTML.escape(right.right) %]_granted" [% IF right.granted %]checked[% END %]>
<label for="[% HTML.escape(right.right) %]_granted">[% IF right.description %][% right.description %][% ELSE %]<i>[% HTML.escape(right.right) %]</i>[% END %]</label>
+ </p>
[% END %]
- </td>
- </tr>
- [% END %]
- <tr>
- <td>
- <input type="hidden" name="save_nextsub" value="save_group">
- <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
-
- <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
- </td>
- </tr>
- </table>
-
- <hr>
-
- <table>
- <tr class="listheading">
- <td colspan="2">[% 'Rename the group' | $T8 %]</td>
- </tr>
-
- <tr>
- <td>[% 'Name' | $T8 %]:</td>
- <td><input name="name" maxlength="50" value="[% HTML.escape(name) %]"></td>
- </tr>
-
- <tr>
- <td>[% 'Description' | $T8 %]:</td>
- <td><input name="description" value="[% HTML.escape(description) %]"></td>
- </tr>
+ [% END %]
- <tr>
- <td>
- <input type="hidden" name="save_nextsub" value="save_group">
- <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
-
- <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
+ <hr>
+ <input type="hidden" name="save_nextsub" value="save_group">
+ <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
+
+ <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
</form>
-
</body>
</html>
<div class="listtop">[% 'Edit group membership' | $T8 %]</div>
+ <p><input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]"></p>
<p>[% 'Select the checkboxes that match users to the groups they should belong to.' | $T8 %]</p>
<form action="admin.pl">
<p>
<input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
- <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
</p>
</form>
[%- USE T8 %]
[% USE HTML %]<body>
- <form name="Form" method="post" action="admin.pl">
-
+ <div class="listtop">[% 'Edit groups' | $T8 %]</div>
[% IF message %]
- <p>[% message %]</p>
+ <p class="message_ok">[% message %]</p>
[% END %]
- <div class="listtop">[% 'Edit groups' | $T8 %]</div>
+ <form method="post" action="admin.pl">
+ <input type="hidden" name="back_nextsub" value="list_users">
+ <p><input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]"></p>
+ </form>
+
+ <div class="listheading">[% 'Add a new group' | $T8 %]</div>
+ <form method="post" action="admin.pl">
+ <br>
+ <table border="0">
+ <tr><td>[% 'Name' | $T8 %] </td><td><input name="name" maxlength="50"></td></tr>
+ <tr><td>[% 'Description' | $T8 %] </td><td><input name="description"></td></tr>
+ </table>
+ <input type="hidden" name="add_nextsub" value="add_group">
+ <p><input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]"></p>
+ <hr>
+ </form>
+
+
+ <form name="Form" method="post" action="admin.pl">
- <p><input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]"></p>
<div class="listheading">[% 'Edit and delete a group' | $T8 %]</div>
<input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
[% END %]
<input type="hidden" name="back_nextsub" value="list_users">
- <input type="submit" class="submit" name="action" value="[% 'Back' | $T8 %]">
</p>
</form>
<hr size="2" noshade>
- <div class="listheading">[% 'Add a new group' | $T8 %]</div>
-
- <form method="post" action="admin.pl">
- <p>
- <table border="0">
- <tr>
- <td>[% 'Name' | $T8 %]:</td>
- <td><input name="name" maxlength="50"></td>
- </tr>
-
- <tr>
- <td>[% 'Description' | $T8 %]:</td>
- <td><input name="description"></td>
- </tr>
- </table>
- </p>
-
- <p>
- <input type="hidden" name="add_nextsub" value="add_group">
- <input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]">
- </p>
-
- </form>
-
</body>
</html>
<th class="listtop">[% 'Login Name' | $T8 %]</th>
<th class="listtop">[% 'Name' | $T8 %]</th>
<th class="listtop">[% 'Company' | $T8 %]</th>
- <th class="listtop">[% 'Driver' | $T8 %]</th>
- <th class="listtop">[% 'Host' | $T8 %]</th>
- <th class="listtop">[% 'Dataset' | $T8 %]</th>
<th class="listtop">[% 'Templates' | $T8 %]</th>
+ <th class="listtop">[% 'Print' | $T8 %]</th>
+ <th class="listtop">[% 'Language' | $T8 %]</th>
+ <th class="listtop">[% 'Dataset' | $T8 %]</th>
+ <th class="listtop">[% 'Host' | $T8 %]</th>
+<!-- <th class="listtop">[% 'Driver' | $T8 %]</th> -->
</tr>
[% FOREACH row = MEMBERS %]
<tr class="listrow[% loop.count % 2 %]">
- <td><a href="admin.pl?action=edit&login=[% HTML.url(row.login) %]">[% HTML.escape(row.login) %]</a></td>
- <td>[% HTML.escape(row.name) %]</td>
- <td>[% HTML.escape(row.company) %]</td>
- <td>[% HTML.escape(row.dbdriver) %]</td>
- <td>[% IF row.dbhost %][% HTML.escape(row.dbhost) %][% ELSE %]localhost[% END %]</td>
- <td>[% HTML.escape(row.dbname) %]</td>
- <td>[% HTML.escape(row.templates) %]</td>
+ <td> <a href="admin.pl?action=edit&login=[% HTML.url(row.login) %]">[% HTML.escape(row.login) %]</a></td>
+ <td> [% HTML.escape(row.name) %]</td>
+ <td> [% HTML.escape(row.company) %]</td>
+ <td> [% HTML.escape(row.templates) %]</td>
+ <td> [% HTML.escape(row.template_format) %]</td>
+ <td> [% HTML.escape(row.countrycode) %]</td>
+ <td> [% HTML.escape(row.dbname) %]</td>
+ <td> [% IF row.dbhost %][% HTML.escape(row.dbhost) %][% ELSE %]localhost[% END %]</td>
+<!-- <td> [% HTML.escape(row.dbdriver) %]</td> -->
</tr>
[% END %]
- <td colspan="7"><hr size="3" noshade></td>
</table>
+ <hr size="3" noshade>
</p>
[% END %]
<input type="submit" class="submit" name="action" value="[% 'Logout' | $T8 %]">
+ <div style="background-color: #FFFFDA; font-size: 12px; padding: 0.5em; max-width: 720px; margin: 1em;">
<p>[% 'Click on login name to edit!' | $T8 %]</p>
-
<p>[% 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' | $T8 %]</p>
+ </div>
</form>
<form method="post" action="login.pl">
[%- IF connection_ok %]
- <p>[% 'The connection was established successfully.' | $T8 %]</p>
+ <p class="message_ok">[% 'The connection was established successfully.' | $T8 %]</p>
[%- ELSE %]
- <p>
+ <p class="message_error">
[% 'The connection to the database could not be established.' | $T8 %]
[% 'Error message from the database driver:' | $T8 %]
</p>
</tr>
[%- END %]
[%- ELSE %]
- <tr><td colspan='3'>[% 'No data was found.' | $T8 %]</td></tr>
+ <tr><td colspan='3'><p class="message_hint">[% 'No data was found.' | $T8 %]</p></td></tr>
[%- END %]
</table>
</td>
<body>
[%- IF params.error %]
- <p><div class="error_message">[% params.error %]</div></p>
+ <p><div class="message_error">[% params.error %]</div></p>
[%- END %]
<p><div class="listtop">[% title %]</div></p>
<input type="hidden" name="action" value="login">
<p><input type="button" class="submit" onclick="history.back()" value="[% 'Back' | $T8 %]"></p>
+ <p class="message_hint">
+ [% LxERP.t8('Lx-Office is about to update the database [ #1 ].', dbname) | html %]
+ </p>
<p>
- [% LxERP.t8('Lx-Office is about to update the database <b>#1</b>.', dbname) | html %]
- </p>
- <p>
[% 'You should create a backup of the database before proceeding because the backup might not be reversible.' | $T8 %]
</p>
decides wether it should be a text field or a drop down box,
generates the HTML code, and fixes everything just right.
- call: INCLUDE generic/multibox.html var = var, var2 = ....
+ call: PROCESS generic/multibox.html var = var, var2 = ....
options and variables:
name : name of the select/textfield
select_name : if a select is displayed, use a different name. ex.: department for textinput, but department_id for selects
readonly : softly prevents modification
-%]
-[%- DEFAULT
- limit = limit != '' ? limit : vclimit != '' ? vclimit : 200
- show_text = allow_textbox and DATA.size and limit < DATA.size ? 1 : 0
- id = id != '' ? id : name
- default = default != '' ? default : $name
--%]
[%-
- name = (select_name != '' and ! show_text) ? select_name : name
+ Multibox__limit = limit != '' ? limit : vclimit != '' ? vclimit : 200
+ Multibox__show_text = allow_textbox and DATA.size and Multibox__limit < DATA.size ? 1 : 0
+ Multibox__id = id != '' ? id : name
+ Multibox__default = default != '' ? default : $name
+ Multibox__name = (select_name != '' and ! Multibox__show_text) ? select_name : name
-%]
-[%- FOREACH row = DATA %]
- [%-
- row.id = row.$id_key != '' ? row.$id_key : $id_sub(row)
- row.label = row.$label_key != '' ? row.$label_key
- : $label_sub(row) != '' ? $label_sub(row)
- : row.id
- row.selected = default == row.id
- -%]
-[%- END -%]
-[%- IF show_text %]
+[%- IF Multibox__show_text %]
<input type="text"
- [%- IF name %] name="[% HTML.escape(name) %]"[% END -%]
- [%- IF id %] id="[% HTML.escape(id) %]"[% END -%]
- [%- IF default %] value="[% HTML.escape(default) %]"[% END -%]
- [%- IF style %] style="[% HTML.escape(style) %]"[% END -%]
- [%- IF readonly %] readonly[% END -%]
+ [%- IF Multibox__name %] name="[% Multibox__name | html %]"[% END -%]
+ [%- IF Multibox__id %] id="[% Multibox__id | html %]"[% END -%]
+ [%- IF Multibox__default %] value="[% Multibox__default | html %]"[% END -%]
+ [%- IF style %] style="[% style | html %]"[% END -%]
+ [%- IF readonly %] readonly[% END -%]
[%- -%]>
[%- IF select -%]
<input type="button" onclick="[% select %]" value="?">
[%- END -%]
[%- ELSE %]
<select
- [%- IF name %] name="[% HTML.escape(name) %]"[% END -%]
- [%- IF id %] id="[% HTML.escape(id) %]"[% END -%]
- [%- IF style %] style="[% HTML.escape(style) %]"[% END -%]
- [%- IF onChange %] onChange="[% HTML.escape(onChange) %]"[% END -%]
- [%- IF readonly %] disabled[% END -%]
+ [%- IF Multibox__name %] name="[% Multibox__name | html %]"[% END -%]
+ [%- IF Multibox__id %] id="[% Multibox__id | html %]"[% END -%]
+ [%- IF style %] style="[% style | html %]"[% END -%]
+ [%- IF onChange %] onChange="[% onChange | html %]"[% END -%]
+ [%- IF readonly %] disabled[% END -%]
[%- -%]>
[%- IF show_empty %]
<option value=""></option>
[%- END %]
[%- FOREACH row = DATA %]
- <option value="[% row.id | html %]"[% IF row.selected %] selected[% END %]>[% HTML.escape(row.label) %]</option>
+ [%-
+ Multibox__row_id = row.$id_key != '' ? row.$id_key : $id_sub(row)
+ Multibox__row_label = row.$label_key != '' ? row.$label_key
+ : $label_sub(row) != '' ? $label_sub(row)
+ : Multibox__row_id
+ Multibox__row_selected = Multibox__default == Multibox__row_id
+ %]
+ <option value="[% Multibox__row_id | html %]"[% IF Multibox__row_selected %] selected[% END %]>[% Multibox__row_label | html %]</option>
[%- END %]
</select>
[%- END %]
<h3 class="login" align="center">[% 'Lx-Office' | $T8 %] [% version %]</h3>
[% IF error_message %]
- <p><span class="error_message">[% error_message %]</span></p>
+ <p><span class="message_error_login">[% error_message %]</span></p>
[% END %]
<p>
</table>
</p>
[% ELSE %]
- <p>[% 'No data was found.' | $T8 %]</p>
+ <p class="message_hint">[% 'No data was found.' | $T8 %]</p>
[% END %]
[% RAW_BOTTOM_INFO_TEXT %]
</table>
</p>
[% ELSE %]
- <p>[% 'No data was found.' | $T8 %]</p>
+ <p class="message_hint">[% 'No data was found.' | $T8 %]</p>
[% END %]
[% RAW_BOTTOM_INFO_TEXT %]
<body>
[%- IF error_message %]
- <p><div class="error_message">[% error_message %]</div></p>
+ <p><div class="message_error">[% error_message %]</div></p>
[%- END %]
<p><div class="listtop">[% title %]</div></p>