X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSetup.pm;h=5422cc85ff214860dc39d8fba7b297077ae5c1a1;hp=3c8e817d6272c7c8686a958a14e4ae6092953076;hb=20f38e4c256094bd938b732950e8f93319f851a5;hpb=48bade3f01a672f235d61a29ad0d0b792fc80eab diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm index 3c8e817d6..5422cc85f 100644 --- a/FS/FS/Setup.pm +++ b/FS/FS/Setup.pm @@ -146,21 +146,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"; + } } @@ -266,7 +274,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,11 +348,12 @@ sub initial_data { #not yet.... - #) - #usage classes 'usage_class' => [], + #phone types + 'phone_type' => [], + ; \%hash; @@ -356,7 +365,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,