Erik Huelsmann | 16 Mar 11:21 2012
Picon

Re: [Ledger-smb-commits] SF.net SVN: ledger-smb:[4485] branches/1.3/bin

Hi Chris,


How about abstracting these tests into a generic method in the LedgerSMB::Template module: format_available($) which takes the format string as its argument and returns true or not?

The implementation can be as easy as:

sub format_available {
   my ($format) = <at> _;
   return ! eval { require "LedgerSMB::Template::$format"; };
}

?

Bye,


Erik.

On Fri, Mar 16, 2012 at 11:16 AM, <ehuelsmann-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> wrote:
Revision: 4485
         http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4485&view=rev
Author:   ehuelsmann
Date:     2012-03-16 10:16:52 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
Disable export buttons when the required Perl modules are missing (fixes 3473861).

Modified Paths:
--------------
   branches/1.3/bin/am.pl
   branches/1.3/bin/rp.pl

Modified: branches/1.3/bin/am.pl
===================================================================
--- branches/1.3/bin/am.pl      2012-03-16 07:16:58 UTC (rev 4484)
+++ branches/1.3/bin/am.pl      2012-03-16 10:16:52 UTC (rev 4485)
<at> <at> -252,6 +252,11 <at> <at>
        push <at> rows, \%column_data;
    }

+    my %can_load;
+    $can_load{CSV} = 1;
+    $can_load{XLS} = ! eval { require Excel::Template::Plus };
+    $can_load{ODS} = ! eval { require OpenOffice::OODoc };
+
    my <at> buttons;
    for my $type (qw(CSV XLS ODS)) {
        push <at> buttons, {
<at> <at> -260,6 +265,7 <at> <at>
            text => $locale->text("[_1] Report", $type),
            type => 'submit',
            class => 'submit',
+            disabled => $can_load{$type} ? "" : "disabled",
        };
    }
    my %hiddens = (

Modified: branches/1.3/bin/rp.pl
===================================================================
--- branches/1.3/bin/rp.pl      2012-03-16 07:16:58 UTC (rev 4484)
+++ branches/1.3/bin/rp.pl      2012-03-16 10:16:52 UTC (rev 4485)
<at> <at> -854,6 +854,12 <at> <at>
    $column_data{debit} = $totaldebit;
    $column_data{credit} = $totalcredit;

+
+    my %can_load;
+    $can_load{CSV} = 1;
+    $can_load{XLS} = ! eval { require Excel::Template::Plus };
+    $can_load{ODS} = ! eval { require OpenOffice::OODoc };
+
    my <at> buttons;
    for my $type (qw(CSV XLS ODS)) {
        push <at> buttons, {
<at> <at> -862,6 +868,7 <at> <at>
            text => $locale->text("[_1] Report", $type),
            type => 'submit',
            class => 'submit',
+            disabled => $can_load{$type} ? "" : "disabled",
        };
    }
    my $format;
<at> <at> -1265,6 +1272,11 <at> <at>
 ##        &menubar;
 ##    }

+    my %can_load;
+    $can_load{CSV} = 1;
+    $can_load{XLS} = ! eval { require Excel::Template::Plus };
+    $can_load{ODS} = ! eval { require OpenOffice::OODoc };
+
    for my $type (qw(CSV XLS ODS)) {
        push <at> buttons, {
            name => 'action',
<at> <at> -1272,6 +1284,7 <at> <at>
            text => $locale->text("[_1] Report", $type),
            type => 'submit',
            class => 'submit',
+            disabled => $can_load{$type} ? "" : "disabled",
        };
    }
    my $format;

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


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ledger-smb-commits mailing list
Ledger-smb-commits-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel@...
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
Chris Travers | 16 Mar 12:16 2012
Picon

Re: [Ledger-smb-commits] SF.net SVN: ledger-smb:[4485] branches/1.3/bin

On Fri, Mar 16, 2012 at 3:21 AM, Erik Huelsmann <ehuels@...> wrote:
> Hi Chris,
>
> How about abstracting these tests into a generic method in the
> LedgerSMB::Template module: format_available($) which takes the format
> string as its argument and returns true or not?
>
> The implementation can be as easy as:
>
> sub format_available {
>    my ($format) =  <at> _;
>    return ! eval { require "LedgerSMB::Template::$format"; };
> }

Sounds good.  Sounds like it would be helpful for 1.4 as well.

Best Wishes,
Chris Travers

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
Andres Basile | 16 Mar 15:09 2012
Picon

Re: Translation and css

Hello Chris, all,

I just installed a fresh SVN and when I tried to select Argentina as language I got that it is not present on language table. I had hardcoded on the chart sql to insert an entry there but I commented it on the files that I sent you. I think it should be added on:

Pg-database.sql -> on the INSERT statement at line 147.

As note on the installation, I have to force DBD::Pg module from CPAN in order to get it installed and I needed to install some others modules previously to that ones on Makefile.

#cpan -i File::Remove
# cpan -i Number::Format
# cpan -i Moose
# cpan -i Config::IniFiles
# cpan -f DBD::Pg
# for PKG in `grep require Makefile.PL | cut -d\' -f2`; do cpan $PKG; done
# sh install.sh

Thanks!!!

On Mon, Mar 5, 2012 at 7:16 AM, Chris Travers <chris.travers-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi;

sorry I missed this.  I was travelling internationally at the time

On Wed, Feb 22, 2012 at 9:37 AM, Andres Basile <basile <at> gmail.com> wrote:
Hello there!

I would like to contribute to the project, I already started es_ar locales and a css template, it would be wonderful if I could get some directions on a couple of topics:

On translation:
* I copied LedgerSMB.pot to po/es_AR.po as template then I added the menu entries that I found on menu_node table and added an entry on language table.
* I'm working on a chart account according to local legislation on coa/ar/chart/General.sql.
- Is it the right path?
- Like there is a gifi sql, would it be a sic code one?

Yes, it is the right path.  GIFI would be for tax mapping purposes if it's required.  I don't know Argentinian tax stuff enough to comment as to whether that would be helpful.

SIC tables are optional.  I don't recall if we provide one.  I will check. 

On template:
* I'm using the menu id to assign a gnu/gpl gnome icon to each menu li.
- Would it be a constant between releases?

It would be constant within 1.3.  Not guaranteed between say, 1,3 and 1.4 

Thank you!
Andres.-


Thanks!  Always glad to have help!

Chris Travers 
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel@...
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
Andres Basile | 16 Mar 23:20 2012
Picon

TRUNK: Log4Perl - Forgot to call init()

REV: 4488
I was getting a lot of errors on the Apace log regarding Log4Perl:

[Fri Mar 16 18:26:59 2012] [error] [client 192.168.1.2] Log4perl: Seems like no initialization happened. Forgot to call init()?, referer: http://192.168.1.64/ledgersmb/user.pl
[Fri Mar 16 18:27:40 2012] [error] [client 192.168.1.2] Log4perl: Seems like no initialization happened. Forgot to call init()?, referer: http://192.168.1.64/ledgersmb/ar.pl?login=user&action=add&module=ar.pl&

Testing I have initialized it on the handler and it worked for some modules but not for others. I was looking for a common place where paste it:
lsmb-request.pl -> Line 42
Log::Log4perl::init(\$LedgerSMB::Sysconfig::log4perl_config);

Digging I found a difference with 1.3.13 where it is working fine:
LedgerSMB/Log.pm:Log::Log4perl::init(\$LedgerSMB::Sysconfig::log4perl_config);
I didn't find the Log.pm on the SVN and just wonder why?

I'm not sure how it works, if it should be initiated on a central place for the whole ran... if each module has to instantiate its own or... if is it a bug at all...
Thanks.-
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ledger-smb-devel mailing list
Ledger-smb-devel@...
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
Chris Travers | 17 Mar 00:45 2012
Picon

Re: Translation and css

On Fri, Mar 16, 2012 at 7:09 AM, Andres Basile <basile@...> wrote:
> Hello Chris, all,
> I just installed a fresh SVN and when I tried to select Argentina as
> language I got that it is not present on language table. I had hardcoded on
> the chart sql to insert an entry there but I commented it on the files that
> I sent you. I think it should be added on:
>
> Pg-database.sql -> on the INSERT statement at line 147.

Added.
>
> As note on the installation, I have to force DBD::Pg module from CPAN in
> order to get it installed and I needed to install some others
> modules previously to that ones on Makefile.
>
> #cpan -i File::Remove
> # cpan -i Number::Format
> # cpan -i Moose
> # cpan -i Config::IniFiles
> # cpan -f DBD::Pg
> # for PKG in `grep require Makefile.PL | cut -d\' -f2`; do cpan $PKG; done
> # sh install.sh

For which version?

Best Wishes,
Chris Travers
>
> Thanks!!!
>
> On Mon, Mar 5, 2012 at 7:16 AM, Chris Travers <chris.travers@...>
> wrote:
>>
>> Hi;
>>
>> sorry I missed this.  I was travelling internationally at the time
>>
>> On Wed, Feb 22, 2012 at 9:37 AM, Andres Basile <basile@...> wrote:
>>>
>>> Hello there!
>>>
>>> I would like to contribute to the project, I already started es_ar
>>> locales and a css template, it would be wonderful if I could get some
>>> directions on a couple of topics:
>>>
>>> On translation:
>>> * I copied LedgerSMB.pot to po/es_AR.po as template then I added the menu
>>> entries that I found on menu_node table and added an entry on language
>>> table.
>>> * I'm working on a chart account according to local legislation
>>> on coa/ar/chart/General.sql.
>>> - Is it the right path?
>>> - Like there is a gifi sql, would it be a sic code one?
>>
>>
>> Yes, it is the right path.  GIFI would be for tax mapping purposes if it's
>> required.  I don't know Argentinian tax stuff enough to comment as to
>> whether that would be helpful.
>>
>> SIC tables are optional.  I don't recall if we provide one.  I will
>> check.
>>>
>>>
>>> On template:
>>> * I'm using the menu id to assign a gnu/gpl gnome icon to each menu li.
>>> - Would it be a constant between releases?
>>
>>
>> It would be constant within 1.3.  Not guaranteed between say, 1,3 and 1.4
>>>
>>>
>>> Thank you!
>>> Andres.-
>>>
>>
>> Thanks!  Always glad to have help!
>>
>> Chris Travers
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Virtualization & Cloud Management Using Capacity Planning
>>> Cloud computing makes use of virtualization - but cloud computing
>>> also focuses on allowing computing to be delivered as a service.
>>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>>> _______________________________________________
>>> Ledger-smb-devel mailing list
>>> Ledger-smb-devel@...
>>> https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Ledger-smb-devel mailing list
>> Ledger-smb-devel@...
>> https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
>>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Ledger-smb-devel mailing list
> Ledger-smb-devel@...
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel
>

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
Chris Travers | 17 Mar 00:50 2012
Picon

Re: Translation and css

On Fri, Mar 16, 2012 at 4:45 PM, Chris Travers
<chris.travers@...> wrote:
> On Fri, Mar 16, 2012 at 7:09 AM, Andres Basile <basile@...> wrote:
>> Hello Chris, all,
>> I just installed a fresh SVN and when I tried to select Argentina as
>> language I got that it is not present on language table. I had hardcoded on
>> the chart sql to insert an entry there but I commented it on the files that
>> I sent you. I think it should be added on:
>>
>> Pg-database.sql -> on the INSERT statement at line 147.
>
> Added.
>>
>> As note on the installation, I have to force DBD::Pg module from CPAN in
>> order to get it installed and I needed to install some others
>> modules previously to that ones on Makefile.
>>
>> #cpan -i File::Remove
>> # cpan -i Number::Format
>> # cpan -i Moose
>> # cpan -i Config::IniFiles
>> # cpan -f DBD::Pg
>> # for PKG in `grep require Makefile.PL | cut -d\' -f2`; do cpan $PKG; done
>> # sh install.sh
>
> For which version?

To be more specific, this is trunk, right?

Best Wishes,
Chris Travers

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

Gmane