<%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2009 %> <% button_id = "button_close_#{@job.id}" form_id = "edit_job_#{@job.id}" @title_section = t('.dialog_title') @title_section = @title_section + ' ' + t('common.view_only_mode') if @view_only @title_item = h @job.name @help_link_anchor = HELP_URL_CONFIG['jobs']['job_settings'] %> <% form_for(@job, :html => { :id => form_id, :class => "edit_job", :autocomplete => "off", :onsubmit => "try {helpsys.CntMgr.getController('#{form_id}').submitForm();} catch(e) {console.log(e);};return false;"}) do |form| %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-general", :section_title => t('common.general_title')}) do %>

<%= t_label('common.name') %>

<%= h @job.name %>

<%= t_label('common.description') %>

<%= h @job.description %>

<%= hidden_field_tag "job_target_id", @job.target_id %> <%= hidden_field_tag "job_target_type", @job.target_type %>

<%= t_label('common.agent_or_group') %>

<% if @job.target_type == AgentGroup.to_s && !@job.target.nil? %> <% if @job.target.group_utilization? %> <% elsif @job.target.group_preferred? %> <% else %> <% end %> <% else %> <% end %> <%= h @job.target.name unless @job.target.nil? %>

<%= t_label("common.queue") %>

<%= h @job.job_queue_name %>

<%= t_label("job.default_priority") %>

<%= h @job.default_priority %>

<%= t_label("jobs.job.calendar") %>

<%= h @job.calendar.name unless @job.calendar.nil? %>

<%= t_label("jobs.job.timezone_option") %>

<%= h @job.timezone_type_text %>

<%= t_label('common.tags') %>

<%= h @job.tag_list %>

<% end %> <%= render( :partial => 'edit_schedule', :layout => 'shared/edit_section', :locals => { :section_id => "job-schedule", :section_title => t('.job_schedule'), :details_only => true}) %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-exceptions", :section_title => t('.exception_tab')}) do %>

<%= t_label('jobs.job.runtime_range_allowed') %>

<%= @job.runtime_range_allowed_text %>

<%= t_label('jobs.job.non_working_options') %>

<%= @job.non_workday_option_text %>

<%= t('jobs.omit_members')%>

<% end %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-agent-environment", :section_title => t('.agent_environment_tab')}) do %> <% if @job.agent_environment_type == "IbmiAgentEnvironment" %>

<%= t_label('jobs.edit_ibmi_agent_environment.ibmi_environment') %>

<%= h @job.agent_environment.name %>

<%= t_label("jobs.edit_ibmi_agent_environment.ibmi_job_name") %>

<%= h @job.ibmi_job_name %>

<% else %> <% if !@job.agent_environment.nil? && @job.agent_environment.shared? %>

<%= t_label("jobs.edit_agent_environment.shared_environment_label") %>

<%= h @job.agent_environment.name %>

<% elsif !@job.agent_environment.nil? && @job.agent_environment.merged? %>

<%= t_label("jobs.edit_agent_environment.shared_environment_label") %>

<%= h @job.agent_environment.referenced_shared.name %>

<% end %> <% unless @job.agent_environment.shared? && current_user.has_exclude_authority_to?(:AgentEnvironments, @job.agent_environment.id) %> <% if @job.agent_environment.run_type_option == AgentEnvironment::RUN_TYPE_AGENT %>

<%= t_label('agent_environments.edit_general.environment_type') %>

<%= t("agent_environments.edit_general.run_agent_heading") %>

<% elsif @job.agent_environment.run_type_option != AgentEnvironment::RUN_TYPE_SHARED %>

<%= t_label("jobs.edit_agent_environment.user_label") %>

<% if !@job.agent_environment.nil? && (!@job.agent_environment.merged? || @job.agent_environment.user_profile != "*SHARED") %>

<%= h @job.agent_environment.user_profile %>

<% elsif !@job.agent_environment.nil? && @job.agent_environment.merged? && !current_user.has_exclude_authority_to?(:AgentEnvironment, @job.agent_environment.referenced_shared_id) %>

<%= h @job.agent_environment.referenced_shared.user_profile %>

<% else %>

<% end %>
<% end %>

<%= t_label("jobs.edit_agent_environment.working_path_label") %>

<% if !@job.agent_environment.nil? && (!@job.agent_environment.merged? || @job.agent_environment.working_path != "*SHARED") %>

<%= h @job.agent_environment.working_path %>

<% elsif !@job.agent_environment.nil? && @job.agent_environment.merged? && !current_user.has_exclude_authority_to?(:AgentEnvironment, @job.agent_environment.referenced_shared_id) %>

<%= h @job.agent_environment.referenced_shared.working_path %>

<% else %>

<% end %>

<%= t_label("jobs.agent_environment.agent_environment_variables") %>

<%= t('jobs.agent_environment_variable_count', :count => @environment_variable_count) %>

<% end %> <% end %> <% end %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-commands", :section_title => t('.commands_tab')}) do %>
<% if @job.command_set.command_set_type == CommandSet::PRIVATE_IBMI || @job.command_set.command_set_type == CommandSet::SHARED_IBMI%>

<%= t_label('common.ibmi_command_set') %>

<% else %>

<%= t_label('common.command_set') %>

<% end %> <% if !@job.command_set.nil? %> <% if @job.command_set.shared? %>

<%= h @job.command_set.name %>

<% elsif @job.command_set.commands.count == 1 %>

<%= t('jobs.job.command', :count => @job.command_set.commands.count) %>

<% else %>

<%= t('jobs.job.commands', :count => @job.command_set.commands.count) %>

<% end %> <% end %>
<% end %> <% if @job.schedule_type == Job::SAP_RUN_INTERCEPTED_JOB %> <%= render( :partial => 'edit_missed_job', :layout => 'shared/edit_section', :locals => { :section_id => "job-missed-job", :section_title => t('jobs.missed_options_tab'), :details_only => true}) %> <% else render( :layout => 'shared/edit_section', :locals => { :section_id => "job-missed-job", :section_title => t('jobs.missed_options_tab')}) do %>

<%= t_label('jobs.missed_job_option.header') %>

<%= show_missed_job_options(@job.missed_action) %>

<%= t 'jobs.edit_missed_job.not_applicable' %>

<% end %> <% end %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-joblog", :section_title => t('jobs.job.control_tab')}) do %> <% if !@job.copy_joblog_to_server %>

<%= t('jobs.job.job_log_not_saved') %>

<% else %>

<%= t('jobs.job.job_log_saved') %>

<% end %> <% end %> <% render( :layout => 'shared/edit_section', :locals => { :section_id => "job-control", :section_title => t('jobs.control.job_history_purge')}) do %> <% if @job.system_defaults_for_job_history_purge label_text = t('jobs.job.using_defaults') else if @job.job_history_purge case @job.job_history_purge_option when SystemSetting::PURGE_BY_RUNS label_text = @job.job_history_runs_to_keep == 1 ? t('jobs.job.job_purged_after_run') : t('jobs.job.job_purged_after_runs', :runs => @job.job_history_runs_to_keep) when SystemSetting::PURGE_BY_DAYS label_text = @job.job_history_days_to_keep == 1 ? t('jobs.job.job_purged_keep_day') : t('jobs.job.job_purged_keep_days', :days => @job.job_history_days_to_keep) else label_text = "" end else label_text = t('jobs.job.job_history_not_purged') end end %>

<%= label_text %>

<% end %>
<%= standard_buttons(button_id) %>
<% end %>