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

SF.net SVN: ledger-smb:[5177] branches/1.3



Revision: 5177
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5177&view=rev
Author:   ehuelsmann
Date:     2012-11-09 12:59:59 +0000 (Fri, 09 Nov 2012)
Log Message:
-----------
Improve upgrade experience by offering a list of countries to select from.

Modified Paths:
--------------
    branches/1.3/UI/setup/upgrade_info.html
    branches/1.3/scripts/setup.pl

Modified: branches/1.3/UI/setup/upgrade_info.html
===================================================================
--- branches/1.3/UI/setup/upgrade_info.html	2012-11-09 12:58:18 UTC (rev 5176)
+++ branches/1.3/UI/setup/upgrade_info.html	2012-11-09 12:59:59 UTC (rev 5177)
@@ -13,9 +13,11 @@
 } ?>
 <div class="form">
 <div class="input_row">
-<?lsmb INCLUDE input element_data = {
+<?lsmb INCLUDE select element_data = {
+                          options = countries
+                       value_attr = 'code'
+                        text_attr = 'country'
                             name  = 'default_country'
-                            type  = 'text'
                            label  = text('Default Country') #'
                             class = 'country'
 } ?>

Modified: branches/1.3/scripts/setup.pl
===================================================================
--- branches/1.3/scripts/setup.pl	2012-11-09 12:58:18 UTC (rev 5176)
+++ branches/1.3/scripts/setup.pl	2012-11-09 12:59:59 UTC (rev 5177)
@@ -1,4 +1,3 @@
-
 =head1 NAME
 
 LedgerSMB::Scripts::setup
@@ -19,6 +18,7 @@
 #
 package LedgerSMB::Scripts::setup;
 
+use Locale::Country;
 use LedgerSMB::Auth;
 use LedgerSMB::Database;
 use strict;
@@ -465,6 +465,16 @@
     unshift @{$request->{ar_accounts}}, {};
     unshift @{$request->{ap_accounts}}, {};
 
+    @{$request->{countries}} = ();
+    foreach my $iso2 (all_country_codes()) {
+        push @{$request->{countries}}, { code    => uc($iso2),
+                                         country => code2country($iso2) };
+    }
+    @{$request->{countries}} =
+        sort { $a->{country} cmp $b->{country} } @{$request->{countries}};
+    unshift @{$request->{countries}}, {};
+
+
     my $template = LedgerSMB::Template->new(
             path => 'UI/setup',
             template => 'upgrade_info',

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