summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-24 08:09:03 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-24 08:09:03 +0000
commit7c9b5fcafe0769499fc7fc3b9bea1365ed82d8d4 (patch)
tree3ef5e03596bed20fb10160a81ad40dc81f515094 /scripts
parent2a2154e7ebac202704a8971babbd6df9591aebed (diff)
Moving Customer templates to be generally used by vendors, etc.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1898 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'scripts')
-rw-r--r--scripts/customer.pl23
-rw-r--r--scripts/login.pl3
-rw-r--r--scripts/payment.pl6
3 files changed, 19 insertions, 13 deletions
diff --git a/scripts/customer.pl b/scripts/customer.pl
index c1cee521..cf1f734e 100644
--- a/scripts/customer.pl
+++ b/scripts/customer.pl
@@ -41,6 +41,7 @@ of the customer informations.
=cut
+
sub get {
my ($request) = @_;
@@ -50,7 +51,8 @@ sub get {
my $result = $customer->get();
my $template = LedgerSMB::Template->new( user => $user,
- template => 'Customer/customer', language => $user->{language},
+ template => 'contact', language => $user->{language},
+ path => 'UI/Contact',
format => 'HTML');
$template->render($results);
@@ -67,14 +69,7 @@ sub add_location {
$customer->get_metadata();
- my $template = LedgerSMB::Template->new(
- user => $user,
- template => 'customer',
- path => 'UI/Customer',
- locale => $request->{_locale},
- format => 'HTML');
- $request->{script} = 'Customer/customer';
- $template->render($customer);
+ _render_main_screen($customer);
}
@@ -93,6 +88,7 @@ This method creates a blank screen for entering a customer's information.
sub add {
my ($request) = @_;
my $customer = LedgerSMB::DBObject::Customer->new(base => $request, copy => 'all');
+ $customer->set( entity_class=> '2' );
_render_main_screen($customer);
}
@@ -123,7 +119,7 @@ sub search {
my $results = $customer->search($customer->{search_pattern});
my $template = LedgerSMB::Template->new( user => $user,
- template => 'Customer/customer', language => $user->{language},
+ template => 'Contact/customer', language => $user->{language},
format => 'HTML');
$template->render($results);
@@ -134,7 +130,7 @@ sub search {
my $template = LedgerSMB::Template->new(
user => $user,
- path => 'UI/Customer' ,
+ path => 'UI/Contact' ,
template => 'customer_search',
locale => $request->{_locale},
format => 'HTML');
@@ -178,12 +174,13 @@ sub _render_main_screen{
$customer->{creditlimit} = "$customer->{creditlimit}";
$customer->{discount} = "$customer->{discount}";
+ $customer->{script} = "customer.pl";
my $template = LedgerSMB::Template->new(
user => $customer->{_user},
- template => 'customer',
+ template => 'contact',
locale => $customer->{_locale},
- path => 'UI/Customer',
+ path => 'UI/Contact',
format => 'HTML'
);
$template->render($customer);
diff --git a/scripts/login.pl b/scripts/login.pl
index 537d8b61..f74a6164 100644
--- a/scripts/login.pl
+++ b/scripts/login.pl
@@ -18,6 +18,9 @@ sub __default {
$locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language})
or $request->error( __FILE__ . ':' . __LINE__ .
": Locale not loaded: $!\n" );
+
+ $request->{stylesheet} = "ledgersmb.css";
+ $request->{titlebar} = "LedgerSMB $request->{VERSION}";
my $template = LedgerSMB::Template->new(
user =>$request->{_user},
locale => $locale,
diff --git a/scripts/payment.pl b/scripts/payment.pl
index b6dd87d4..9faa97e4 100644
--- a/scripts/payment.pl
+++ b/scripts/payment.pl
@@ -51,6 +51,12 @@ use LedgerSMB::Template;
use LedgerSMB::DBObject::Payment;
use LedgerSMB::DBObject::Date;
use strict;
+
+# CT: A few notes for future refactoring of this code:
+# 1: I don't think it is a good idea to make the UI too dependant on internal
+# code structures but I don't see a good alternative at the moment.
+# 2: CamelCasing: -1
+
=pod
=item payment