X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSetup.pm;h=fec1c2d08eaf55db584d592e23044b2a052c3e10;hp=d265d937f8764ca69476748f2f69b6528e551bd4;hb=83053569b3d965924e2e1d4f5b199609ec7c29af;hpb=5e05724a635a22776f1b973f5d7e77989da4e048 diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm index d265d937f..fec1c2d08 100644 --- a/FS/FS/Setup.pm +++ b/FS/FS/Setup.pm @@ -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,21 +153,29 @@ sub populate_initial_data { foreach my $table ( keys %$data ) { + #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"; + } } @@ -173,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' }, @@ -266,7 +291,7 @@ sub initial_data { #which would only sell regular packages of services. Click on View/Edit #agent types and Add a new agent type. 'agent_type' => [ - { 'atype' => 'internal' }, + { 'atype' => 'Internal' }, ], #Allow this agent type to sell the package you created above. @@ -340,7 +365,12 @@ sub initial_data { #not yet.... - #) + #usage classes + 'usage_class' => [], + + #phone types + 'phone_type' => [], + ; \%hash; @@ -352,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, @@ -457,6 +487,10 @@ sub msgcat_messages { 'en_US' => 'Username in use', }, + 'phonenum_in_use' => { + 'en_US' => 'Phone number in use', + }, + 'illegal_email_invoice_address' => { 'en_US' => 'Illegal email invoice address', },