i18n, RT#12515
[freeside.git] / FS / FS / Setup.pm
index 2dc9038..fec1c2d 100644 (file)
@@ -53,6 +53,8 @@ sub create_initial_data {
   populate_access();
 
   populate_msgcat();
+
+  populate_numbering();
   
   if ( $oldAutoCommit ) {
     dbh->commit or die dbh->errstr;
@@ -60,6 +62,11 @@ sub create_initial_data {
 
 }
 
+sub populate_numbering {
+  eval "use FS::lata_Data;"; # this automatically populates the lata table, if unpopulated
+  eval "use FS::msa_Data;"; # this automatically populates the msa table, if unpopulated
+}
+
 sub populate_locales {
 
   use Locale::Country;
@@ -96,7 +103,7 @@ sub populate_addl_locales {
 
 sub _add_country {
 
-  use Locale::SubCountry;
+  use Locale::SubCountry 1.44;
 
   my( $country ) = shift;
 
@@ -146,23 +153,29 @@ sub populate_initial_data {
 
   foreach my $table ( keys %$data ) {
 
-    warn "popuilating $table\n";
+    #warn "popuilating $table\n";
 
     my $class = "FS::$table";
     eval "use $class;";
     die $@ if $@;
 
     $class->_populate_initial_data(%opt)
-      if $class->can('_populate_inital_data');
+      if $class->can('_populate_initial_data');
 
     my @records = @{ $data->{$table} };
 
     foreach my $record ( @records ) {
+
       my $args = delete($record->{'_insert_args'}) || [];
       my $object = $class->new( $record );
       my $error = $object->insert( @$args );
       die "error inserting record into $table: $error\n"
         if $error;
+
+      #my $pkey = $object->primary_key;
+      #my $pkeyvalue = $object->$pkey();
+      #warn "  inserted $pkeyvalue\n";
+
     }
 
   }
@@ -175,6 +188,16 @@ sub initial_data {
   #tie my %hash, 'Tie::DxHash', 
   tie my %hash, 'Tie::IxHash', 
 
+    #bootstrap user
+    'access_user' => [
+      { 'username'  => 'fs_bootstrap',
+        '_password' => 'changeme', #will trigger warning if you try to enable
+        'last'      => 'User',
+        'first'     => 'Bootstrap',
+        'disabled'  => 'Y',
+      },
+    ],
+
     #superuser group
     'access_group' => [
       { 'groupname' => 'Superuser' },
@@ -342,11 +365,12 @@ sub initial_data {
 
     #not yet....
 
-  #)
-
     #usage classes
     'usage_class' => [],
 
+    #phone types
+    'phone_type' => [],
+
   ;
 
   \%hash;
@@ -358,7 +382,7 @@ sub populate_access {
   use FS::AccessRight;
   use FS::access_right;
 
-  foreach my $rightname ( FS::AccessRight->rights ) {
+  foreach my $rightname ( FS::AccessRight->default_superuser_rights ) {
     my $access_right = new FS::access_right {
       'righttype'   => 'FS::access_group',
       'rightobjnum' => 1, #$supergroup->groupnum,