[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6066] trunk



Revision: 6066
          http://sourceforge.net/p/ledger-smb/code/6066
Author:   einhverfr
Date:     2013-09-20 09:35:45 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
Dojo widget themes now configurable
Also fixed the 0's appearing in odd empty inputs

Modified Paths:
--------------
    trunk/CONTRIBUTORS
    trunk/LedgerSMB/App_State.pm
    trunk/LedgerSMB/Company_Config.pm
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/Scripts/configuration.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/Template/HTML.pm
    trunk/LedgerSMB.pm
    trunk/UI/Configuration/settings.html
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Fixes.sql

Modified: trunk/CONTRIBUTORS
===================================================================
--- trunk/CONTRIBUTORS	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/CONTRIBUTORS	2013-09-20 09:35:45 UTC (rev 6066)
@@ -99,6 +99,10 @@
 Frans van der Star <f.van.der.star @ gmail.com> provided additional 
 documentation regarding Ubuntu 11.10 installation.
 
+Bob Miller [email redacted] has contributed DNS hosting and documentation 
+regarding integrating LedgerSMB with other corporate systems, for example, 
+authenticating LedgerSMB from LDAP.
+
 Victor Sterpu <victor @ ambra.ro> has contributed some bug fixes to COGS 
 handling.
 
@@ -129,6 +133,7 @@
 Berend Tober < btober @ ieee.org > has contributed some to the 
 documentation and a number of bugfixes
 
+
 Original Authors of SQL-Ledger:
 ===================================
 Dieter Simader <dsimader @ sql-ledger.com>

Modified: trunk/LedgerSMB/App_State.pm
===================================================================
--- trunk/LedgerSMB/App_State.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/App_State.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -55,7 +55,6 @@
 
 our $DBH;
 
-
 =item Roles
 
 This is a list (array) of role names for the current user.

Modified: trunk/LedgerSMB/Company_Config.pm
===================================================================
--- trunk/LedgerSMB/Company_Config.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/Company_Config.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -31,13 +31,14 @@
 use strict;
 use base qw(LedgerSMB);
 use LedgerSMB::Setting;
+use LedgerSMB::App_State;
 
 my @company_settings = qw(templates businessnumber weightunit curr
                           default_email_from default_email_to
                           default_email_bcc  default_email_cc
                           separate_duties company_name company_email
                           company_phone company_fax businessnumber
-                          company_address);
+                          company_address dojo_theme);
 
 our $VERSION = 1.0;
 our $settings = {};
@@ -54,4 +55,5 @@
           $settings->{$key } = $ref->{value};
        }
    }
+   $LedgerSMB::App_State::Company_Config = $settings;
 }

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/Form.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -76,7 +76,6 @@
 our $logger = Log::Log4perl->get_logger('LedgerSMB::Form');
 
 # To be later set in config, but also hardwired in Template::HTML --CT
-my $dojo_theme = 'claro';
 
 =item new Form([$argstr])
 
@@ -98,6 +97,7 @@
     my $argstr = shift;
 
     $ENV{CONTENT_LENGTH} = 0 unless defined $ENV{CONTENT_LENGTH};
+    my $dojo_theme = $LedgerSMB::Sysconfig::dojo_template;
 
     if ( ( $ENV{CONTENT_LENGTH} != 0 ) 
          && ( $ENV{CONTENT_LENGTH} > $LedgerSMB::Sysconfig::max_post_size ) 
@@ -620,9 +620,13 @@
     my ( $self, $init, $headeradd ) = @_;
 
     return if $self->{header} or $ENV{LSMB_NOHEAD};
+
     $ENV{LSMB_NOHEAD} = 1; # Only run once.
     my ( $stylesheet, $favicon, $charset );
 
+    my $dojo_theme = $self->{dojo_theme};
+    $dojo_theme ||= $LedgerSMB::Sysconfig::dojo_theme;
+    $self->{dojo_theme} = $dojo_theme; # Needed for theming of old screens
     if ( $ENV{GATEWAY_INTERFACE} ) {
         if ( $self->{stylesheet} && ( -f "css/$self->{stylesheet}" ) ) {
             $stylesheet =
@@ -1354,6 +1358,13 @@
     # Expect @{$self->{_roles}} to go away sometime during 1.4/1.5 development
     # -CT
 
+    $sth = $self->{dbh}->prepare("
+            SELECT value FROM defaults 
+             WHERE setting_key = 'dojo_theme'");
+    $sth->execute;
+
+    ($self->{dojo_theme}) = $sth->fetchrow_array;
+    $LedgerSMB::App_State::dojo_theme = $self->{dojo_theme};
     $sth = $dbh->prepare('SELECT check_expiration()');
     $sth->execute;
     ($self->{warn_expire}) = $sth->fetchrow_array;

Modified: trunk/LedgerSMB/Scripts/configuration.pm
===================================================================
--- trunk/LedgerSMB/Scripts/configuration.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/Scripts/configuration.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -106,6 +106,9 @@
    ] },
    { title => $locale->text('Misc Settings'),
      items => [  
+       { name => 'dojo_theme',
+         type => 'SELECT_ONE',
+        label => $locale->text('Widgit Themes') },
        { name => 'check_prefix', label => $locale->text('Check Prefix') },
        { name => 'check_max_invoices',
         label =>  $locale->text('Max Invoices per Check Stub') },
@@ -168,6 +171,12 @@
         if ! defined $request->{inventory_accno_id};
 
     my %selects = (
+        'dojo_theme'  =>     {name => 'dojo_theme', # TODO autodetect
+                           options => [{text => 'Claro', value => 'claro'},
+                                       {text => 'Nihilo', value => 'nihilo'},
+                                       {text => 'Soria', value => 'soria'},
+                                       {text => 'Tundra', value => 'tundra'},],
+                   default_values  => [$request->{dojo_theme}]},
         'fxloss_accno_id' => {name => 'fxloss_accno_id',
                            options => $fx_loss_accounts,
                          text_attr => 'text',

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/Sysconfig.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -21,6 +21,7 @@
 our $images = getcwd() . '/images'; 
 our $cssdir = 'css/';
 our $fs_cssdir = 'css/';
+our $dojo_theme = 'claro';
 
 our $force_username_case = undef; # don't force case
 
@@ -101,7 +102,7 @@
 for my $var (
     qw(pathsep log_level cssdir DBI_TRACE check_max_invoices language auth
     db_autoupdate force_username_case max_post_size cookie_name
-    return_accno no_db_str tempdir cache_templates fs_cssdir)
+    return_accno no_db_str tempdir cache_templates fs_cssdir dojo_theme)
   )
 {
     ${$var} = $cfg->val('main', $var) if $cfg->val('main', $var);

Modified: trunk/LedgerSMB/Template/HTML.pm
===================================================================
--- trunk/LedgerSMB/Template/HTML.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB/Template/HTML.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -50,6 +50,9 @@
 use CGI::Simple::Standard qw(:html);
 use Template;
 use LedgerSMB::Template::TTI18N;
+use LedgerSMB::Sysconfig;
+use LedgerSMB::Company_Config;
+use LedgerSMB::App_State;
 
 my $binmode = ':utf8';
 binmode STDOUT, $binmode;
@@ -107,8 +110,14 @@
 	my $output;
 	my $source;
         $parent->{binmode} = $binmode;
-         
-	$cleanvars->{dojo_theme} = 'claro';
+
+        my $dojo_theme; 
+        if ($LedgerSMB::App_State::DBH){
+           $LedgerSMB::Company_Config->initialize() 
+                   unless $LedgerSMB::App_State::Company_Config;
+           $dojo_theme = $LedgerSMB::App_State::Company_Config->{dojo_theme}
+        } 
+	$cleanvars->{dojo_theme} ||= $dojo_theme;
 	
 	if ($parent->{outputfile}) {
 		$output = "$parent->{outputfile}.html";

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/LedgerSMB.pm	2013-09-20 09:35:45 UTC (rev 6066)
@@ -719,8 +719,8 @@
     while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) {
 	for (0 .. $#names){
             #   numeric            float4/real
-            $ref->{$names[$_]} ||=0;
             if ($types[$_] == 3 or $types[$_] == 2) {
+                $ref->{$names[$_]} ||=0;
                 $ref->{$names[$_]} = LedgerSMB::PGNumber->from_db($ref->{$names[$_]}, 'datetime') if defined $ref->{$names[$_]};
             }
             #    DATE                TIMESTAMP

Modified: trunk/UI/Configuration/settings.html
===================================================================
--- trunk/UI/Configuration/settings.html	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/UI/Configuration/settings.html	2013-09-20 09:35:45 UTC (rev 6066)
@@ -1,19 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
-		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-	<title><?lsmb form.titlebar ?></title>
-	<meta http-equiv="Pragma" content="no-cache" />
-	<meta http-equiv="Expires" content="-1" />
-	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-	<link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
-
-	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
-	<meta name="robots" content="noindex,nofollow" />
-        
-</head>
-<?lsmb PROCESS elements.html ?> 
+<?lsmb INCLUDE 'ui-header.html';
+PROCESS elements.html ?> 
 		 
 <body class="<?lsmb dojo_theme ?>">
 <form method="post" action="<?lsmb form.script ?>">

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/sql/Pg-database.sql	2013-09-20 09:35:45 UTC (rev 6066)
@@ -1348,6 +1348,7 @@
 batch_cc|B-11111
 check_prefix|CK
 decimal_places|2
+dojo_theme|claro
 \.
 
 -- */

Modified: trunk/sql/modules/Fixes.sql
===================================================================
--- trunk/sql/modules/Fixes.sql	2013-09-20 06:59:41 UTC (rev 6065)
+++ trunk/sql/modules/Fixes.sql	2013-09-20 09:35:45 UTC (rev 6066)
@@ -201,3 +201,7 @@
 BEGIN;
 INSERT INTO lsmb_module(id, label) values (7, 'Timecards');
 COMMIT;
+
+BEGIN;
+INSERT INTO defaults (setting_key, value) values ('dojo_theme', 'claro');
+COMMIT;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits