From: Moritz Bunkus Date: Thu, 16 Jun 2011 11:54:38 +0000 (+0200) Subject: Feature "Lizenzen" entfernt X-Git-Tag: release-2.7.0beta1~388 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=217d32f3531a3565d647a1cfd0f3deb9b9ec1365;p=kivitendo-erp.git Feature "Lizenzen" entfernt Hat grob gesehen niemand benutzt, es funktionierte nicht, und wurde seit gefühlten 20 Jahren nicht weiter entwickelt. --- diff --git a/SL/Auth.pm b/SL/Auth.pm index 415898061..9398f557b 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -855,7 +855,6 @@ sub all_rights_full { ["customer_vendor_edit", $locale->text("Create and edit customers and vendors")], ["part_service_assembly_edit", $locale->text("Create and edit parts, services, assemblies")], ["project_edit", $locale->text("Create and edit projects")], - ["license_edit", $locale->text("Manage license keys")], ["--ar", $locale->text("AR")], ["sales_quotation_edit", $locale->text("Create and edit sales quotations")], ["sales_order_edit", $locale->text("Create and edit sales orders")], diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index 54b4b49f3..946c3046b 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -44,8 +44,6 @@ use SL::DB::Inventory; use SL::DB::Invoice; use SL::DB::InvoiceItem; use SL::DB::Language; -use SL::DB::License; -use SL::DB::LicenseInvoice; use SL::DB::MakeModel; use SL::DB::Note; use SL::DB::Order; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 7f281e34c..5a4fc5e01 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -67,8 +67,6 @@ my %lxoffice_package_names = ( inventory => 'inventory', invoice => 'invoice_item', language => 'language', - license => 'license', - licenseinvoice => 'license_invoice', makemodel => 'make_model', notes => 'note', orderitems => 'order_item', diff --git a/SL/DB/License.pm b/SL/DB/License.pm deleted file mode 100644 index b75add7fe..000000000 --- a/SL/DB/License.pm +++ /dev/null @@ -1,13 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::License; - -use strict; - -use SL::DB::MetaSetup::License; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/DB/LicenseInvoice.pm b/SL/DB/LicenseInvoice.pm deleted file mode 100644 index 9a03e3ab4..000000000 --- a/SL/DB/LicenseInvoice.pm +++ /dev/null @@ -1,13 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::LicenseInvoice; - -use strict; - -use SL::DB::MetaSetup::LicenseInvoice; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/DB/MetaSetup/Licemse.pm b/SL/DB/MetaSetup/Licemse.pm deleted file mode 100644 index aea45d2d7..000000000 --- a/SL/DB/MetaSetup/Licemse.pm +++ /dev/null @@ -1,27 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::Licemse; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'license', - - columns => [ - id => { type => 'integer', not_null => 1, sequence => 'id' }, - parts_id => { type => 'integer' }, - customer_id => { type => 'integer' }, - comment => { type => 'text' }, - validuntil => { type => 'date' }, - issuedate => { type => 'date', default => 'now' }, - quantity => { type => 'integer' }, - licensenumber => { type => 'text' }, - ], - - primary_key_columns => [ 'id' ], -); - -1; -; diff --git a/SL/DB/MetaSetup/License.pm b/SL/DB/MetaSetup/License.pm deleted file mode 100644 index 6ea5da525..000000000 --- a/SL/DB/MetaSetup/License.pm +++ /dev/null @@ -1,27 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::License; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'license', - - columns => [ - id => { type => 'integer', not_null => 1, sequence => 'id' }, - parts_id => { type => 'integer' }, - customer_id => { type => 'integer' }, - comment => { type => 'text' }, - validuntil => { type => 'date' }, - issuedate => { type => 'date', default => 'now' }, - quantity => { type => 'integer' }, - licensenumber => { type => 'text' }, - ], - - primary_key_columns => [ 'id' ], -); - -1; -; diff --git a/SL/DB/MetaSetup/LicenseInvoice.pm b/SL/DB/MetaSetup/LicenseInvoice.pm deleted file mode 100644 index b14f2caa8..000000000 --- a/SL/DB/MetaSetup/LicenseInvoice.pm +++ /dev/null @@ -1,22 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::LicenseInvoice; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'licenseinvoice', - - columns => [ - trans_id => { type => 'integer' }, - license_id => { type => 'integer' }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], -); - -1; -; diff --git a/SL/Form.pm b/SL/Form.pm index 582d2aff8..b2127e7ff 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -819,7 +819,6 @@ sub _prepare_html_template { $additional_params->{"conf_dbcharset"} = $::lx_office_conf{system}->{dbcharset}; $additional_params->{"conf_webdav"} = $::lx_office_conf{features}->{webdav}; - $additional_params->{"conf_lizenzen"} = $::lx_office_conf{features}->{lizenzen}; $additional_params->{"conf_latex_templates"} = $::lx_office_conf{print_templates}->{latex}; $additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument}; $additional_params->{"conf_vertreter"} = $::lx_office_conf{features}->{vertreter}; diff --git a/SL/IC.pm b/SL/IC.pm index bad463e5a..31993641c 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -671,7 +671,7 @@ sub delete { my %columns = ( "assembly" => "id", "parts" => "id" ); - for my $table (qw(prices partstax makemodel inventory assembly license translation parts)) { + for my $table (qw(prices partstax makemodel inventory assembly translation parts)) { my $column = defined($columns{$table}) ? $columns{$table} : "parts_id"; do_query($form, $dbh, qq|DELETE FROM $table WHERE $column = ?|, @values); } diff --git a/SL/IS.pm b/SL/IS.pm index e3390fce1..261b342a2 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -148,7 +148,7 @@ sub invoice_details { my @arrays = qw(runningnumber number description longdescription qty ship unit bin - deliverydate_oe ordnumber_oe transdate_oe licensenumber validuntil + deliverydate_oe ordnumber_oe transdate_oe validuntil partnotes serialnumber reqdate sellprice listprice netprice discount p_discount discount_sub nodiscount_sub linetotal nodiscount_linetotal tax_rate projectnumber projectdescription @@ -214,22 +214,7 @@ sub invoice_details { push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description}; push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"}; push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"}; - - if ($form->{lizenzen}) { - if ($form->{"licensenumber_$i"}) { - $query = qq|SELECT licensenumber, validuntil FROM license WHERE id = ?|; - my ($licensenumber, $validuntil) = selectrow_query($form, $dbh, $query, conv_i($form->{"licensenumber_$i"})); - push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, $licensenumber); - push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, $locale->date($myconfig, $validuntil, 0)); - - } else { - push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, ""); - push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, ""); - } - } - - # listprice - push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"}); + push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"}); my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"}); my ($dec) = ($sellprice =~ /\.(\d+)/); @@ -740,14 +725,6 @@ sub post_invoice { conv_i($form->{"marge_price_factor_$i"})); do_query($form, $dbh, $query, @values); - if ($form->{lizenzen} && $form->{"licensenumber_$i"}) { - $query = - qq|INSERT INTO licenseinvoice (trans_id, license_id) - VALUES ((SELECT id FROM invoice WHERE trans_id = ? ORDER BY oid DESC LIMIT 1), ?)|; - @values = (conv_i($form->{"id"}), conv_i($form->{"licensenumber_$i"})); - do_query($form, $dbh, $query, @values); - } - CVar->save_custom_variables(module => 'IC', sub_module => 'invoice', trans_id => $invoice_id, @@ -1359,14 +1336,6 @@ sub reverse_invoice { my @values = (conv_i($form->{id})); do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE trans_id = ?|, @values); do_query($form, $dbh, qq|DELETE FROM invoice WHERE trans_id = ?|, @values); - - if ($form->{lizenzen}) { - $query = - qq|DELETE FROM licenseinvoice - WHERE trans_id in (SELECT id FROM invoice WHERE trans_id = ?)|; - do_query($form, $dbh, $query, @values); - } - do_query($form, $dbh, qq|DELETE FROM shipto WHERE (trans_id = ?) AND (module = 'AR')|, @values); $main::lxdebug->leave_sub(); @@ -1583,12 +1552,6 @@ sub retrieve_invoice { } - if ($form->{lizenzen}) { - $query = qq|SELECT l.licensenumber, l.id AS licenseid FROM license l, licenseinvoice li WHERE l.id = li.license_id AND li.trans_id = ?|; - my ($licensenumber, $licenseid) = selectrow_query($form, $dbh, $query, conv_i($ref->{invoice_pos})); - $ref->{lizenzen} = ""; - } - $ref->{qty} *= -1 if $form->{type} eq "credit_note"; chop $ref->{taxaccounts}; @@ -1943,20 +1906,6 @@ sub retrieve_item { $ref->{onhand} *= 1; push @{ $form->{item_list} }, $ref; - - if ($form->{lizenzen}) { - if ($ref->{inventory_accno} > 0) { - $query = - qq|SELECT l.* - FROM license l - WHERE l.parts_id = ? AND NOT l.id IN (SELECT li.license_id FROM licenseinvoice li)|; - my $stw = prepare_execute_query($form, $dbh, $query, conv_i($ref->{id})); - while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) { - push @{ $form->{LIZENZEN}{ $ref->{id} } }, $ptr; - } - $stw->finish; - } - } } $sth->finish; $_->[1]->finish for @translation_queries; diff --git a/SL/LICENSES.pm b/SL/LICENSES.pm deleted file mode 100644 index ca9c679f9..000000000 --- a/SL/LICENSES.pm +++ /dev/null @@ -1,218 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -#===================================================================== -# SQL-Ledger Accounting -# Copyright (c) 2002 -# -# Author: Philip Reetz -# Email: p.reetz@linet-services.de -# Web: http://www.linet-services.de/ -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# Software license module -# Backend routines -#====================================================================== - -package LICENSES; - -use SL::Form; - -use strict; - -sub save_license { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - my $dbh = $form->dbconnect($myconfig); - - my $query = - qq| INSERT INTO license (licensenumber) VALUES ('$form->{licensenumber}')|; - my $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - $sth->finish(); - - $query = - qq|SELECT l.id FROM license l WHERE l.licensenumber = '$form->{licensenumber}'|; - $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - my ($license_id) = $sth->fetchrow_array; - $sth->finish(); - - # save license - $query = qq|UPDATE license SET - validuntil = '$form->{validuntil}', - licensenumber = '$form->{licensenumber}', - parts_id = $form->{parts_id}, - customer_id = $form->{customer_id}, - comment = '$form->{comment}', - quantity = $form->{quantity} - WHERE id=$license_id|; - $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - $sth->finish(); - - $dbh->disconnect(); - - $main::lxdebug->leave_sub(); - - return $license_id; -} - -sub get_customers { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - my $ref; - my $dbh = $form->dbconnect($myconfig); - - my $f = $dbh->quote('%' . $form->{"customer_name"} . '%'); - my $query = qq|SELECT * FROM customer WHERE name ilike $f|; - my $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - $form->{"all_customers"} = []; - while ($ref = $sth->fetchrow_hashref("NAME_lc")) { - push(@{ $form->{"all_customers"} }, $ref); - } - $sth->finish(); - $dbh->disconnect(); - $main::lxdebug->leave_sub(); -} - -sub search { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - my ($ref, $sth, $f, $s, $query); - my $dbh = $form->dbconnect($myconfig); - - if ($form->{"partnumber"} || $form->{"description"}) { - $f = "(parts_id IN (SELECT id FROM parts WHERE "; - if ($form->{"partnumber"}) { - $f .= - "(partnumber ILIKE " - . $dbh->quote('%' . $form->{"partnumber"} . '%') . ")"; - } - if ($form->{"description"}) { - $f .= " AND " if ($form->{"partnumber"}); - $f .= - "(description ILIKE " - . $dbh->quote('%' . $form->{"description"} . '%') . ")"; - } - $f .= "))"; - } - - if ($form->{"customer_name"}) { - $f .= " AND " if ($f); - $f .= - "(l.customer_id IN (SELECT id FROM customer WHERE name ILIKE " - . $dbh->quote('%' . $form->{"customer_name"} . '%') . "))"; - } - - if (!$form->{"all"} && $form->{"expiring_in"}) { - $f .= " AND " if ($f); - $f .= - "(validuntil < now() + " - . $dbh->quote("" . $form->{"expiring_in"} . " months") . ")"; - } - - if (!$form->{"show_expired"}) { - $f .= " AND " if ($f); - $f .= "(validuntil >= now())"; - } - - if ($f) { - $f = "WHERE (inventory_accno_id notnull) AND $f"; - } else { - $f = "WHERE (inventory_accno_id notnull)"; - } - - if ($form->{"sortby"} eq "partnumber") { - $s = "p.partnumber"; - } elsif ($form->{"sortby"} eq "description") { - $s = "p.description"; - } elsif ($form->{"sortby"} eq "name") { - $s = "c.name"; - } elsif ($form->{"sortby"} eq "validuntil") { - $s = "l.validuntil"; - } else { - $s = "l.validuntil"; - } - if ($form->{"sortasc"}) { - $s .= " ASC"; - } else { - $s .= " DESC"; - } - - $query = - "SELECT l.*, p.partnumber, p.description, c.name, a.invnumber " - . "FROM license l " - . "LEFT JOIN parts p ON (p.id = l.parts_id) " - . "LEFT JOIN customer c ON (c.id = l.customer_id) " - . "LEFT JOIN ar a ON " - . "(a.id = (SELECT i.trans_id FROM invoice i WHERE i.id = " - . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id))) " - . "$f ORDER BY $s"; - - $sth = $dbh->prepare($query); - $sth->execute() || $form->dberror($query); - $form->{"licenses"} = []; - while ($ref = $sth->fetchrow_hashref("NAME_lc")) { - push(@{ $form->{"licenses"} }, $ref); - } - - $sth->finish(); - $dbh->disconnect(); - $main::lxdebug->leave_sub(); -} - -sub get_license { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - my ($ref, $sth, $query); - my $dbh = $form->dbconnect($myconfig); - - $query = - "SELECT l.*, p.partnumber, p.description, c.name, c.street, " - . "c.zipcode, c.city, c.country, c.contact, c.phone, c.fax, c.homepage, " - . "c.email, c.notes, c.customernumber, c.language, a.invnumber " - . "FROM license l " - . "LEFT JOIN parts p ON (p.id = l.parts_id) " - . "LEFT JOIN customer c ON (c.id = l.customer_id) " - . "LEFT JOIN ar a ON " - . "(a.id = (SELECT i.trans_id FROM invoice i WHERE i.id = " - . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id))) " - . "LEFT JOIN invoice i ON " - . "(i.id = " - . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id)) " - . "WHERE l.id = " - . $form->{"id"}; - $sth = $dbh->prepare($query); - $sth->execute() || $form->dberror($query); - $form->{"license"} = $sth->fetchrow_hashref("NAME_lc"); - $sth->finish(); - $dbh->disconnect(); - $main::lxdebug->leave_sub(); -} - -1; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index a213a4753..e15a15f36 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -148,7 +148,6 @@ sub display_row { { id => 'qty', width => 5, value => $locale->text('Qty'), display => 1, }, { id => 'price_factor', width => 5, value => $locale->text('Price Factor'), display => !$is_delivery_order, }, { id => 'unit', width => 5, value => $locale->text('Unit'), display => 1, }, - { id => 'license', width => 10, value => $locale->text('License'), display => 0, }, { id => 'serialnr', width => 10, value => $locale->text('Serial No.'), display => 0, }, { id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, }, { id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, }, @@ -500,8 +499,6 @@ sub item_selected { partsgroup formel longdescription not_discountable partnotes lastcost price_factor_id price_factor); - push @new_fields, 'lizenzen' if $::lx_office_conf{features}->{lizenzen}; - my $ic_cvar_configs = CVar->get_configs(module => 'IC'); push @new_fields, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; @@ -1795,50 +1792,6 @@ sub ship_to { $main::lxdebug->leave_sub(); } -sub new_license { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - _check_io_auth(); - - my $row = shift; - - # change callback - $form->{old_callback} = $form->escape($form->{callback}, 1); - $form->{callback} = $form->escape("$form->{script}?action=display_form", 1); - $form->{old_callback} = $form->escape($form->{old_callback}, 1); - - # delete action - delete $form->{action}; - my $customer = $form->{customer}; - map { $form->{"old_$_"} = $form->{"${_}_$row"} } qw(partnumber description); - - # save all other form variables in a previousform variable - $form->{row} = $row; - my $previousform; - foreach my $key (keys %$form) { - next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); - - # escape ampersands - $form->{$key} =~ s/&/%26/g; - $previousform .= qq|$key=$form->{$key}&|; - } - chop $previousform; - $previousform = $form->escape($previousform, 1); - - $form->{script} = "licenses.pl"; - - map { $form->{$_} = $form->{"old_$_"} } qw(partnumber description); - map { $form->{$_} = $form->escape($form->{$_}, 1) } - qw(partnumber description); - $form->{callback} = - qq|$form->{script}?action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$form->{name}&type=$form->{type}&customer=$customer&partnumber=$form->{partnumber}&description=$form->{description}&previousform="$previousform"&initial=1|; - $form->redirect; - - $main::lxdebug->leave_sub(); -} - sub relink_accounts { $main::lxdebug->enter_sub(); diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 3945d7f9d..eee3b1d0f 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -134,7 +134,6 @@ sub invoice_links { # create links $form->{webdav} = $::lx_office_conf{features}->{webdav}; - $form->{lizenzen} = $::lx_office_conf{features}->{lizenzen}; $form->create_links("AR", \%myconfig, "customer"); @@ -562,16 +561,6 @@ sub update { $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); - if ($::lx_office_conf{features}->{lizenzen}) { - if ($form->{"inventory_accno_$i"} ne "") { - $form->{"lizenzen_$i"} = qq||; - foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) { - $form->{"lizenzen_$i"} .= qq||; - } - $form->{"lizenzen_$i"} .= qq||; - } - } - # get pricegroups for parts IS->get_pricegroups_for_parts(\%myconfig, \%$form); diff --git a/bin/mozilla/licenses.pl b/bin/mozilla/licenses.pl deleted file mode 100644 index fb065f254..000000000 --- a/bin/mozilla/licenses.pl +++ /dev/null @@ -1,755 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -#===================================================================== -# SQL-Ledger Accounting -# Copyright (c) 2002 -# -# Author: Moritz Bunkus -# Email: m.bunkus@linet-services.de -# Web: http://www.linet-services.de/ -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# Software license module -# -#====================================================================== - -use SL::IC; -use SL::IS; -use SL::LICENSES; - -require "bin/mozilla/common.pl"; - -use strict; - -sub quot { - $main::lxdebug->enter_sub(); - $_[0] =~ s/\"/\"/g; - $main::lxdebug->leave_sub(); - return $_[0]; -} - -sub form_header { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - - $form->{jsscript} = 1; - $form->header(); - - print( - qq| - -
{script}>|); - $main::lxdebug->leave_sub(); -} - -sub form_footer { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - - my @items = qw(old_callback previousform); - push @items, @{ $form->{"hidden"} } if ref $form->{hidden} eq 'ARRAY'; - map({ - print("{$_}) . "\">\n" - ); - } @items); - - print( - qq|
- - -|); - $main::lxdebug->leave_sub(); -} - -sub set_std_hidden { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - $form->{"hidden"} = ["comment", "validuntil", "quantity", @_]; - $main::lxdebug->leave_sub(); -} - -sub print_part_selection { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my $locale = $main::locale; - - form_header(); - set_std_hidden("business"); - - print( - qq| - - - - - - - - - - - - |); - - my $j = 1; - for (my $i = 1; $i <= scalar(@{ $form->{"parts"} }); $i++) { - my %p = %{ $form->{"parts"}->[$i - 1] }; - my $checked; - if ($i == 1) { - $checked = "checked"; - } else { - $checked = ""; - } - - print( - qq| - - - - - |); - - $j = ($j + 1) % 2; - } - - print( - qq| -
| - . $locale->text('Select from one of the items below') . qq|
 | . $locale->text('Part Number') . qq|| . $locale->text('Description') . qq|
| . $p{"partnumber"} . qq|| . $p{"description"} . qq|

- - -text('Continue') . qq|>|); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -sub print_customer_selection { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my $locale = $main::locale; - - form_header(); - set_std_hidden("parts_id", "partnumber", "description"); - - print( - qq| - - - - - - - - - - - - - - |); - - print(qq||); - - my $j = 1; - for (my $i = 1; $i <= scalar(@{ $form->{"all_customers"} }); $i++) { - my %c = %{ $form->{"all_customers"}->[$i - 1] }; - my $checked; - if ($i == 1) { - $checked = "checked"; - } else { - $checked = ""; - } - - print( - qq| - - - - - - - |); - - $j = ($j + 1) % 2; - } - - print( - qq| -
| - . $locale->text('Select from one of the names below') . qq|
 | . $locale->text('Customer Number') . qq|| . $locale->text('Company Name') . qq|| . $locale->text('Street') . qq|| . $locale->text('Zipcode') . qq|| . $locale->text('City') . qq|

$c{"customernumber"}$c{"name"}$c{"street"}$c{"zipcode"}$c{"city"}
- - -text('Continue') . qq|>|); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -sub print_license_form { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - print( - qq| - - - - - -
| . $locale->text("Add License") . qq|
- - - - - - - - - - |); - if ($form->{"all_customer"}) { - print(qq||); - } else { - print( qq||); - } - print( - qq| - - - - - - - - - - - - - - - - - - - - -
| . $locale->text('Part Number') . qq|{"partnumber"}) . qq|\">
| . $locale->text('Description') . qq|{"description"}) . qq|\">
| . $locale->text('Company Name') . qq|{"customer_name"}) - . qq|\">
| . $locale->text('Comment') . qq|{"comment"}) . qq|\">
| . $locale->text('Valid until') . qq|{"validuntil"}) . qq|\"> -
| . $locale->text('Quantity') . qq|{"quantity"}) . qq|\">
| . $locale->text('License key') . qq|{"licensenumber"}) . qq|\">
| . $locale->text('Own Product') . qq|
- - text('Update') . qq|\"> - |); - - if ($_[0]) { - print( - qq|  - text('Save') . qq|\">\n|); - } - print( - qq| - - -| . - $form->write_trigger(\%myconfig, 1, "validuntil", "BL", - "trigger_validuntil")); - - $main::lxdebug->leave_sub(); -} - -sub add { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my $locale = $main::locale; - - $form->{title} = $locale->text('Add License'); - - if (!$::lx_office_conf{features}->{lizenzen}) { - $form->error( - $locale->text( - 'The licensing module has been deactivated in the configuration.') - ); - } - - $form->{"initial"} = 1; - - do_add(); - $main::lxdebug->leave_sub(); -} - -sub do_add { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $form->{"hidden"} = ["parts_id"]; - form_header(); - - if ($form->{"ndx"}) { - my $ndx = $form->{"ndx"}; - foreach (keys(%{$form})) { - next unless (/^new_.*_${ndx}$/); - s/^new_//; - s/_${ndx}$//; - $form->{$_} = $form->{"new_${_}_${ndx}"}; - } - } - - if ($form->{"customer"}) { - $form->{"customer_id"} = (split(/--/, $form->{"customer"}))[1]; - } - - if ($form->{"customer_name"}) { - LICENSES->get_customers(\%myconfig, $form); - if (scalar(@{ $form->{"all_customers"} }) == 1) { - my %c = %{ $form->{"all_customers"}->[0] }; - $form->{"customer_id"} = $c{"id"}; - $form->{"customer_name"} = $c{"name"}; - } elsif (scalar(@{ $form->{"all_customers"} }) == 0) { - $form->{"customer_name"} = ""; - delete($form->{"customer_id"}); - } else { - print_customer_selection(); - return; - } - } elsif (defined($form->{"customer_name"})) { - delete($form->{"customer_id"}); - } - - if ($form->{"partnumber"} || $form->{"description"}) { - $form->{"sort"} = "p.partnumber"; - $form->{searchitems} = "part"; - IC->all_parts(\%myconfig, $form); - if (scalar(@{ $form->{"parts"} }) == 1) { - map({ $form->{$_} = $form->{"parts"}->[0]->{$_}; } - ("partnumber", "description")); - $form->{"parts_id"} = $form->{"parts"}->[0]->{"id"}; - - } elsif (scalar(@{ $form->{"parts"} }) == 0) { - map({ $form->{$_} = ""; }("partnumber", "description", "parts_id")); - - } else { - print_part_selection(); - return; - } - } else { - delete($form->{"parts_id"}); - } - - $form->all_vc(\%myconfig, "customer", ""); - - print_license_form($form->{"parts_id"} && $form->{"customer_id"}); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -sub update { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - - do_add(); - - $main::lxdebug->leave_sub(); -} - -sub continue { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - call_sub($form->{"nextsub"}); - $main::lxdebug->leave_sub(); -} - -sub save { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - ($form->{customername}, $form->{customer_id}) = split /--/, - $form->{customer}; - - $form->isblank("customer", $locale->text('Customer missing!')); - - if ( $form->{quantity} eq "" - || $form->{quantity} !~ /^[0-9]*$/ - || $form->{quantity} < 1) { - $form->error($locale->text('Please enter a number of licenses.')); - } - - if (!$form->{licensenumber} || $form->{licensenumber} eq "") { - $form->error($locale->text('Please enter a license key.')); - } - - my $rc = LICENSES->save_license(\%myconfig, \%$form); - - # load previous variables - if ($form->{previousform}) { - - # save the new form variables before splitting previousform - my %newform; - map { $newform{$_} = $form->{$_} } keys %$form; - - my $previousform = $form->unescape($form->{previousform}); - - # don't trample on previous variables - map { delete $form->{$_} } keys %newform; - - # now take it apart and restore original values - foreach my $item (split /&/, $previousform) { - my ($key, $value) = split /=/, $item, 2; - $value =~ s/%26/&/g; - $form->{$key} = $value; - } - - $form->{"lizenzen_$form->{row}"} = - ""; - $form->{rowcount}--; - - delete $form->{action}; - - # restore original callback - my $callback = $form->unescape($form->{callback}); - $form->{callback} = $form->unescape($form->{old_callback}); - delete $form->{old_callback}; - - # put callback together - foreach my $key (keys %$form) { - next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); - - # do single escape for Apache 2.0 - my $value = $form->escape($form->{$key}, 1); - $callback .= qq|&$key=$value|; - } - $form->{callback} = $callback; - - # redirect - $form->redirect; - - } else { - form_header(); - - print("Die Lizenz wurde gespeichert.\n"); - form_footer(); - } - - $main::lxdebug->leave_sub(); -} - -sub search { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my $locale = $main::locale; - - $form->{title} = $locale->text('Licenses'); - - if (!$::lx_office_conf{features}->{lizenzen}) { - $form->error( - $locale->text( - 'The licensing module has been deactivated in the configuration.') - ); - } - - form_header(); - - print( - qq| - - - - - -
| . $locale->text("Licenses") . qq|
- - - - - - - - - - - - - - - - -
| . $locale->text('Part Number') . qq|
| . $locale->text('Description') . qq|
| . $locale->text('Company Name') . qq|
| . $locale->text('Include in Report') . qq|| - . $locale->text('All') - . qq| | - . $locale->text('Expiring in x month(s)') - . qq| 
- | - . $locale->text('Expired licenses') . qq|
- -
- - - -text('Continue') . qq|\"> - - |); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -sub do_search { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - LICENSES->search(\%myconfig, $form); - - my $callback = ""; - map { $callback .= "\&${_}=" . $form->escape($form->{$_}, 1) } - qw(db partnumber description customer_name all expiring_in show_expired); - my $details = $form->{"script"} . "?action=details" . $callback . "\&id="; - my $invdetails = "is.pl?action=edit" . $callback . "\&id="; - $callback = $form->{"script"} . "?action=do_search" . $callback; - - $form->{"sortby"} = "validuntil" unless ($form->{"sortby"}); - $form->{"sortasc"} *= 1; - my %columns; - foreach (("partnumber", "description", "name", "validuntil", "invnumber")) { - $columns{$_} = $callback . "\&sortby=${_}\&sortasc="; - if ($form->{"sortby"} eq $_) { - $columns{$_} .= (1 - $form->{"sortasc"}); - } else { - $columns{$_} .= "1"; - } - } - - form_header(); - - print( - qq| - - - - - |); - if (scalar(@{ $form->{"licenses"} }) == 0) { - print(qq|
| . $locale->text("Licenses") . qq|
| - . $locale->text( - "No licenses were found that match the search criteria.") - . qq||); - ::end_of_request(); - } - - print( - qq| - - - - - - - - - - |); - - my $j = 1; - for (my $i = 0; $i < scalar(@{ $form->{"licenses"} }); $i++) { - my $ref = $form->{"licenses"}->[$i]; - print( - qq| - - - - - - - |); - $j = ($j + 1) % 2; - } - - $form->{"num_licenses"} = scalar(@{ $form->{"licenses"} }); - push(@{ $form->{"hidden"} }, "num_licenses"); - - print( - qq| -
" - . $locale->text('Part Number') - . qq|" - . $locale->text('Description') - . qq|" . $locale->text('Company Name') . qq|" - . $locale->text('Valid until') - . qq|" - . $locale->text('Invoice Number') - . qq|
{"id"} . qq| - {"id"}\">$ref->{"partnumber"}{"id"}\">$ref->{"description"}{"id"}\">$ref->{"name"}{"id"}\">$ref->{"validuntil"}| - . ( - $ref->{"invnumber"} - ? qq|{"invnumber"}\">$ref->{"invnumber"}| - : qq| | - ) - . qq|
- - -
- - - -

- -text("Add") . qq|\"> - |); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -sub details { - $main::lxdebug->enter_sub(); - - $main::auth->assert('license_edit'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - LICENSES->get_license(\%myconfig, $form); - map( - { $form->{$_} = $form->{"license"}->{$_}; } keys(%{ $form->{"license"} })); - - form_header(); - - print( - qq| - - - - - -
| . $locale->text("View License") . qq|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| . $locale->text('Part Number') . qq|$form->{"partnumber"}
| . $locale->text('Description') . qq|$form->{"description"}
| . $locale->text('Company Name') . qq|$form->{"name"}
| . $locale->text('Comment') . qq|$form->{"comment"}
| . $locale->text('Valid until') . qq|$form->{"validuntil"}
| . $locale->text('Quantity') . qq|$form->{"quantity"}
| . $locale->text('License key') . qq|$form->{"licensenumber"}
- - -


- - - -text("Add") . qq|\"> - |); - - form_footer(); - $main::lxdebug->leave_sub(); -} - -1; diff --git a/config/lx_office.conf.default b/config/lx_office.conf.default index f1e7621c6..41bfa54a2 100644 --- a/config/lx_office.conf.default +++ b/config/lx_office.conf.default @@ -73,7 +73,6 @@ dbcharset = UTF-8 [features] # Activate certain optional features and modules. webdav = 0 -lizenzen = 1 vertreter = 0 # Show fields used for the best before date diff --git a/locale/de/all b/locale/de/all index 202c43bf9..8659da886 100644 --- a/locale/de/all +++ b/locale/de/all @@ -783,8 +783,6 @@ $self->{texts} = { 'Expense/Asset' => 'Aufwand/Anlagen', 'Expenses EU with UStId' => 'Aufwand EU m. UStId', 'Expenses EU without UStId' => 'Aufwand EU o. UStId', - 'Expired licenses' => 'Abgelaufene Lizenzen', - 'Expiring in x month(s)' => 'Die in x Monat(en) ablaufen', 'Export Buchungsdaten' => 'Export Buchungsdaten', 'Export Stammdaten' => 'Export Stammdaten', 'Export as CSV' => 'Als CSV exportieren', @@ -1020,8 +1018,6 @@ $self->{texts} = { 'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.', 'Left' => 'Links', 'Liability' => 'Passiva/Mittelherkunft', - 'License' => 'Lizenz', - 'License key' => 'Lizenzschlüssel', 'Licenses' => 'Lizenzen', 'Limit part selection' => 'Artikelauswahl eingrenzen', 'Line Total' => 'Zeilensumme', @@ -1077,7 +1073,6 @@ $self->{texts} = { 'Make (with X being a number)' => 'Lieferant (X ist eine fortlaufende Zahl)', 'Make default profile' => 'Zu Standardprofil machen', 'Manage Custom Variables' => 'Benutzerdefinierte Variablen', - 'Manage license keys' => 'Lizenzschlüssel verwalten', 'Mandantennummer' => 'Mandantennummer', 'Mandatory Departments' => 'Benutzer muss Abteilungen vergeben', 'Mar' => 'März', @@ -1171,7 +1166,6 @@ $self->{texts} = { 'No file has been uploaded yet.' => 'Es wurde noch keine Datei hochgeladen.', 'No group has been selected, or the group does not exist anymore.' => 'Es wurde keine Gruppe ausgewählt, oder die Gruppe wurde in der Zwischenzeit gelöscht.', 'No groups have been added yet.' => 'Es wurden noch keine Gruppen angelegt.', - 'No licenses were found that match the search criteria.' => 'Es wurden keine Lizenzen gefunden, auf die die Suchkriterien zutreffen.', 'No or an unknown authenticantion module specified in "config/lx_office.conf".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/lx_office.conf" angegeben.', 'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.', 'No payment term has been created yet.' => 'Es wurden noch keine Zahlungsbedingungen angelegt.', @@ -1258,7 +1252,6 @@ $self->{texts} = { 'Output Number Format' => 'Zahlenformat (Ausgabe)', 'Outputformat' => 'Ausgabeformat', 'Overdue sales quotations and requests for quotations' => 'Überfällige Angebote und Preisanfragen', - 'Own Product' => 'eigenes Produkt', 'PAYMENT POSTED' => 'Rechung gebucht', 'PDF' => 'PDF', 'PDF (OpenDocument/OASIS)' => 'PDF (OpenDocument/OASIS)', @@ -1315,8 +1308,6 @@ $self->{texts} = { 'Please Check the bank information for each customer:' => 'Bitte überprüfen Sie die Bankinformationen der Kunden:', 'Please Check the bank information for each vendor:' => 'Bitte überprüfen Sie die Kontoinformationen der Lieferanten:', 'Please ask your administrator to create warehouses and bins.' => 'Bitten Sie Ihren Administrator, dass er Lager und Lagerplätze anlegt.', - 'Please enter a license key.' => 'Bitte geben Sie einen Lizenzschlüssel an.', - 'Please enter a number of licenses.' => 'Bitte geben Sie die Anzahl Lizenzschlüssel an.', 'Please enter a profile name.' => 'Bitte geben Sie einen Profilnamen an.', 'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.', 'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage für die neue Datenbank benutzt wird:', @@ -1785,7 +1776,6 @@ $self->{texts} = { 'The group has been saved.' => 'Die Gruppe wurde gespeichert.', 'The group memberships have been saved.' => 'Die Gruppenmitgliedschaften wurden gespeichert.', 'The group name is missing.' => 'Der Gruppenname fehlt.', - 'The licensing module has been deactivated in the configuration.' => 'Das Lizenzverwaltungsmodul wurde in der Konfiguration deaktiviert.', 'The list has been printed.' => 'Die Liste wurde ausgedruckt.', 'The login is missing.' => 'Das Login fehlt.', 'The long description is missing.' => 'Der Langtext fehlt.', @@ -2009,7 +1999,6 @@ $self->{texts} = { 'Vendors' => 'Lieferanten', 'Verrechnungseinheit' => 'Verrechnungseinheit', 'Version' => 'Version', - 'View License' => 'Lizenz ansehen', 'View SEPA export' => 'SEPA-Export-Details ansehen', 'View warehouse content' => 'Lagerbestand ansehen', 'View/edit all employees sales documents' => 'Bearbeiten/ansehen der Verkaufsdokumente aller Mitarbeiter', diff --git a/scripts/mklinks.sh b/scripts/mklinks.sh index 52b8bb4d9..07c195710 100755 --- a/scripts/mklinks.sh +++ b/scripts/mklinks.sh @@ -4,11 +4,11 @@ for i in am dispatcher login; do rm $i.pl 2> /dev/null ln -s admin.pl $i.pl done -for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do +for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do rm $i.pl 2> /dev/null ln -s am.pl $i.pl done -rm generictranslations.pl 2> /dev/null +rm generictranslations.pl licenses.pl 2> /dev/null ln -s common.pl generictranslations.pl rm dispatcher.fcgi 2> /dev/null ln -s dispatcher.fpl dispatcher.fcgi diff --git a/templates/webpages/ir/form_header.html b/templates/webpages/ir/form_header.html index 63d514072..f47d87fa6 100644 --- a/templates/webpages/ir/form_header.html +++ b/templates/webpages/ir/form_header.html @@ -22,8 +22,6 @@ - -

[% title %]

[%- INCLUDE 'common/flash.html' %] diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index 50d8f5758..96cbb6fb3 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -21,8 +21,6 @@ - -

[% title %]

[% saved_message %]