- my ($retval, $msg) = $scrip->Delete;
- if ($retval) {
- push @actions, loc("Scrip deleted");
- }
- else {
- push @actions, $msg;
+ my $a = $scrip->FirstAttribute('Immutable');
+ if ( defined($a) and $a->Content ) {
+ # then disable the scrip instead of deleting it
+ my ($retval, $msg) = $scrip->SetStage('Disabled');
+ if ( $retval ) {
+ push @actions, loc("Scrip disabled (cannot delete system scrips)");
+ } else {
+ push @actions, $msg;
+ push @not_deleted, $id;
+ }
+ } else { # not an immutable scrip
+ my ($retval, $msg) = $scrip->Delete;
+ if ($retval) {
+ push @actions, loc("Scrip deleted");
+ }
+ else {
+ push @actions, $msg;
+ push @not_deleted, $id;
+ }