From 7c9b5fcafe0769499fc7fc3b9bea1365ed82d8d4 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 24 Nov 2007 08:09:03 +0000 Subject: 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 --- UI/Contact/contact.css | 20 ++ UI/Contact/contact.html | 475 +++++++++++++++++++++++++++++++++++++++++++++++ UI/Contact/customer.css | 20 -- UI/Contact/customer.html | 329 -------------------------------- ledgersmb-httpd.conf | 2 +- scripts/customer.pl | 23 +-- scripts/login.pl | 3 + scripts/payment.pl | 6 + 8 files changed, 515 insertions(+), 363 deletions(-) create mode 100644 UI/Contact/contact.css create mode 100644 UI/Contact/contact.html delete mode 100644 UI/Contact/customer.css delete mode 100644 UI/Contact/customer.html diff --git a/UI/Contact/contact.css b/UI/Contact/contact.css new file mode 100644 index 00000000..e93cd0bd --- /dev/null +++ b/UI/Contact/contact.css @@ -0,0 +1,20 @@ +label { + text-align: right; + margin-left: auto; + margin-right: 0em; +} + +input { margin-left: 0em; + margin-right: auto; +} + +ul.navigation li { + display: inline; + padding-left: 1em; + padding-right: 1em; + padding-top: 0.5em; + padding-bottom: 0.5em; + margin-right: 1em; + margin-left: 1em; + margin-bottom: 0em; +} diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html new file mode 100644 index 00000000..f2d14531 --- /dev/null +++ b/UI/Contact/contact.html @@ -0,0 +1,475 @@ + + + + +
+ + +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ % / + + + +
+ +
+ + +
+ +
+ + + + + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + [edit] + [delete] +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
+
+ + + + + + + + + + + + + +
+ []   + [] +
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + +
+ [Edit] + [Delete] +
+
+ + +
+
+
+
+
+ + + diff --git a/UI/Contact/customer.css b/UI/Contact/customer.css deleted file mode 100644 index e93cd0bd..00000000 --- a/UI/Contact/customer.css +++ /dev/null @@ -1,20 +0,0 @@ -label { - text-align: right; - margin-left: auto; - margin-right: 0em; -} - -input { margin-left: 0em; - margin-right: auto; -} - -ul.navigation li { - display: inline; - padding-left: 1em; - padding-right: 1em; - padding-top: 0.5em; - padding-bottom: 0.5em; - margin-right: 1em; - margin-left: 1em; - margin-bottom: 0em; -} diff --git a/UI/Contact/customer.html b/UI/Contact/customer.html deleted file mode 100644 index e39bfdcc..00000000 --- a/UI/Contact/customer.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - -
- - -
-
- -
- - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - -
- - - - - -
- - - - - days -
- - - - - -
- - %/ - days - - - -
-
- - - -
- -
- - - - - - - -
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
- - [edit] - [delete] -
-
- - -
-
- - -
-
- -
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
-
- - - - - - - - - - - - - -
- []   - [] -
-
- - -
- -
-
- -
-
-
-
- -
-
-
- - - - - - - - - - - - - -
') ?>
- [Edit] - [Delete] -
-
- - -
- -
-
- -
-
-
-
- - - diff --git a/ledgersmb-httpd.conf b/ledgersmb-httpd.conf index f3460ffb..7a7f5d02 100644 --- a/ledgersmb-httpd.conf +++ b/ledgersmb-httpd.conf @@ -17,7 +17,7 @@ Alias /ledgersmb WORKING_DIR/ # advised that you should use SSL protection on any and all network # connections that access this application in order to protect usernames and # passwords. - Order Allow,Deny + Order Deny,Allow Allow from 127.0.0.1 Deny from All 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 -- cgit v1.2.3