<%perl>; # Output the header and other necessities. $m->comp('/widgets/wrappers/sharky/header.mc', title => "$disp Profile", context => "Admin | Profile | $disp | "" . $job->get_name . """ ); $m->out(qq{
\n}); # Output a hidden field with the ID, if we have one. $m->comp('/widgets/profile/hidden.mc', value => $id, name => 'job_id') if defined $id; if ($job->has_failed) { $m->comp( '/widgets/wrappers/sharky/table_top.mc', caption => 'Job Failure', number => ++$i, ); $m->print(qq{
\n}); $m->out('' . $lang->maketext('This job has failed') . '

' . $lang->maketext( 'The error message is available below. No further execution ' . 'attempts will be made on this job unless you check the "Reset ' . 'this Job" checkbox below.' ) . '

' . '
'
      .  $job->get_error_message
      . '
'); $m->comp( '/widgets/profile/checkbox.mc', name => 'reset', id => 'reset', value => '1', ); $m->print(' '); $m->print("
\n"); $m->comp('/widgets/wrappers/sharky/table_bottom.mc'); } # Display the Basics. $m->comp( '/widgets/wrappers/sharky/table_top.mc', caption => 'Properties', number => ++$i ); # Dump out the fields for display. $m->comp( '/widgets/profile/dumpRemainingFields.mc', readOnly => $no_edit, objref => $job, fieldsUsed => { comp_time => 1, sched_time => 1, type => 1, } ); # Type should really be read-only $m->comp("/widgets/profile/displayFormElement.mc", key => 'type', objref => $job, readOnly => 1, ); $m->comp("/widgets/select_time/select_time.mc", base_name => 'sched_time' , def_date => $job->get_sched_time(ISO_8601_FORMAT), useTable => 1, disp => "Scheduled Time" ); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); if (ref $job eq 'Bric::Util::Job::Dist') { # Show a list of the Distribution Profiles. $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Destinations", number => 2); $m->out(qq{
    }); foreach my $st ($job->get_server_types) { $m->out(qq{
  1. } . $st->get_name . "
  2. \n"); } $m->out("
\n"); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); # Show a list of the Resources. $m->comp("/widgets/wrappers/sharky/table_top.mc", caption => "Resources", number => 3 ); $m->out(qq{
    }); foreach my $st ($job->get_resources) { $m->out(qq{
  1. } . $st->get_uri . "
  2. \n"); } $m->out("
\n"); $m->comp("/widgets/wrappers/sharky/table_bottom.mc"); } # Add the form buttons and other necessities. $m->comp("/widgets/profile/formButtons.mc", type => $type, section => $widget, no_del => $no_del, no_save => $no_edit, chk_label => 'Cancel this Job', ret_val => 'return_dgreen', widget => $type); $m->out("
\n"); $m->comp('/widgets/wrappers/sharky/footer.mc', param => \%ARGS ); <%once>; my $class = "Bric::Util::Job"; my $widget = 'profile'; my $type = 'job'; my $disp = get_disp_name($type); <%args> $id => undef <%init>; # Do any redirects first. do_queued_redirect(); # Instantiate an object. my $job = $ARGS{obj} ? $ARGS{obj} : defined $id ? $class->lookup({ id => $id}) : $class->new; $id ||= $job->get_id; # Check authorization. chk_authz($job, $id ? READ : CREATE); my $no_edit = !chk_authz($job, ($id ? EDIT : CREATE), 1); my $no_del = !$id || $no_edit; my $i = 0; <%doc> ############################################################################### =head1 NAME =head1 VERSION $LastChangedRevision$ =head1 DATE $LastChangedDate$ =head1 SYNOPSIS /admin/profile/job/dhandler - Distribution Job Profile. =head1 DESCRIPTION This element displays Distribution Job profiles for editing.