X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=ba2a86affddf3348ce7ceada250fc832ffb56a81;hb=84345dad925d4577c9b91aaf2ce7fbd33bcf262c;hp=d0510e8902a957c58d4ebcd7f0b904a8efe2cff8;hpb=b3673e83306a36c0582a08ea9eada300fe3987aa;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index d0510e890..ba2a86aff 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -25,7 +25,8 @@ # 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. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # customer/vendor module @@ -36,247 +37,201 @@ # $locale->text('Vendors') # $locale->text('Add Customer') # $locale->text('Add Vendor') +# $locale->text('Edit Customer') +# $locale->text('Edit Vendor') +# $locale->text('Customer saved!') +# $locale->text('Vendor saved!') +# $locale->text('Customer deleted!') +# $locale->text('Cannot delete customer!') +# $locale->text('Vendor deleted!') +# $locale->text('Cannot delete vendor!') -use CGI; -use CGI::Ajax; use POSIX qw(strftime); use SL::CT; +use SL::CTI; +use SL::CVar; +use SL::Request qw(flatten); +use SL::DB::Business; +use SL::DB::Default; +use SL::DB::DeliveryTerm; use SL::ReportGenerator; +use SL::Locale::String qw(t8); +use SL::MoreCommon qw(uri_encode); require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; +use strict; 1; # end of main -sub add { - $lxdebug->enter_sub(); +sub search { + $main::lxdebug->enter_sub(); - $form->{title} = "Add"; + $main::auth->assert('customer_vendor_edit'); - $form->{callback} = - "$form->{script}?action=add&db=$form->{db}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + my $form = $main::form; + my $locale = $main::locale; - CT->populate_drop_down_boxes(\%myconfig, \%$form); + $form->{IS_CUSTOMER} = $form->{db} eq 'customer'; - &form_header; - &form_footer; + $form->get_lists("business_types" => "ALL_BUSINESS_TYPES", + "salesmen" => "ALL_SALESMEN"); + $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0; - $lxdebug->leave_sub(); -} + $form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT'); + ($form->{CUSTOM_VARIABLES_FILTER_CODE}, + $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $form->{CUSTOM_VARIABLES}, + 'include_prefix' => 'l_', + 'include_value' => 'Y'); -sub search { - $lxdebug->enter_sub(); + $form->{title} = $form->{IS_CUSTOMER} ? $locale->text('Customers') : $locale->text('Vendors'); - my $vc_business_type = $form->{db} eq "customer" ? - $locale->text("Customer type") : $locale->text("Vendor type"); + setup_ct_search_action_bar(); - $form->get_lists("business_types" => "ALL_BUSINESS_TYPES"); - my (%labels, @values); + $form->header(); + print $form->parse_html_template('ct/search'); - my $business_types; - if (scalar(@{ $form->{ALL_BUSINESS_TYPES} }) != 0) { - push(@values, undef); - foreach my $item (@{ $form->{ALL_BUSINESS_TYPES} }) { - push(@values, $item->{id}); - $labels{$item->{id}} = $item->{description}; - } + $main::lxdebug->leave_sub(); +} - $business_types = - qq|