X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTicketSystem.pm;h=c1553f17a2a4c3e535e616e11f61620b9a7ae893;hb=7f5e32275a5a2674fd1d220cd651b222b9831476;hp=77d0dae9f8524f058f0e067767f03e21aee63912;hpb=75afcbb38b49064f2cc1a73e894ac99a483bd112;p=freeside.git diff --git a/FS/FS/TicketSystem.pm b/FS/FS/TicketSystem.pm index 77d0dae9f..c1553f17a 100644 --- a/FS/FS/TicketSystem.pm +++ b/FS/FS/TicketSystem.pm @@ -88,7 +88,7 @@ sub _upgrade_data { my $CurrentUser = $RT::SystemUser; # selfservice and cron users - foreach my $username ('%%%SELFSERVICE_USER', 'fs_daily') { + foreach my $username ('%%%SELFSERVICE_USER%%%', 'fs_daily') { my $User = RT::User->new($CurrentUser); $User->Load($username); if (!defined($User->Id)) { @@ -136,7 +136,8 @@ sub _upgrade_data { # Load from RT data file our (@Groups, @Users, @ACL, @Queues, @ScripActions, @ScripConditions, - @Templates, @CustomFields, @Scrips, @Attributes, @Initial, @Final); + @Templates, @CustomFields, @Scrips, @Attributes, @Initial, @Final, + %Delete_Scrips); my $datafile = '%%%RT_PATH%%%/etc/initialdata'; eval { require $datafile }; if ( $@ ) { @@ -211,6 +212,11 @@ sub _upgrade_data { my ($val, $msg) = $item->Delete; warn "error deleting scrip: $msg\n" if !$val; } + elsif ( exists $Delete_Scrips{$c}{$a}{$t} and $item->Creator == 1 ) { + warn "Deleting obsolete scrip $c $a [$t]\n"; + my ($val, $msg) = $item->Delete; + warn "error deleting scrip: $msg\n" if !$val; + } else { $scrip{$c}{$a}{$t} = $item->id; }