// Licensed Materials - Property of IBM // // IBM Cognos Products: ps // // (C) Copyright IBM Corp. 2005, 2011 // // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated). // initialize the job options dialog function initJobOptions(IsIndexUpdateServiceInstalled) { if (document.pform.controller_state) { document.pform.controller_state.value = ''; } updateReportOptionSection(); updateReportOptionsSummary(); updateDeploymentOptionsSummary(); if (IsIndexUpdateServiceInstalled == 'true') { updateIndexUpdateTaskOptionSection(); } } // user has clicked the OK button on the jobOptions dialog function onClickOKJobOptions() { var frm = document.pform; if (frm.override_default_options.checked) { if (!validateRunOptions()) { return; } } if (frm.m_new_class && frm.m_new_class.value != '') { frm.m.value = 'portal/new_job2.xts'; } else { frm.m.value = 'portal/properties_job.xts'; } frm.ps_nav_op.value = 'stack-down-save'; frm.userHitOK.value = 'true'; frm.submit(); } // user clicked on the expand/collapse icon for report options function clickReportOptionSection() { document.pform.report_options_collapsed.value = (document.pform.report_options_collapsed.value == 'false') ? 'true' : 'false'; updateReportOptionSection(); updateReportOptionsSummary(); } // make sure the report options section is in a valid state function updateReportOptionSection() { frm = document.pform; var cacheSetting = 'none'; if (document.pform.m_ro_promptCacheMode) { cacheSetting = document.pform.m_ro_promptCacheMode.value; } // report options is expanded if (frm.report_options_collapsed.value == 'false') { hideDynamicDiv('collapsedReportOptions'); showDynamicSection('expandedReportOptions'); if (document.pform.override_default_options.checked) { // show the cache options div showDynamicDiv('savePromptCacheDiv'); if (cacheSetting == 'create') { showDiv('overrideCacheOptionsDiv'); } else { showDiv('overrideOptionsDiv'); } } else { // hide the cache options div hideDynamicDiv('savePromptCacheDiv'); if (cacheSetting == 'create') { showDiv('defaultOptionsCacheMode'); } else { showDiv('defaultOptions'); } } } // report options are collapsed else { showDynamicDiv('collapsedReportOptions'); hideDynamicSection('expandedReportOptions'); if (cacheSetting == 'create') { showDiv('defaultOptionsCacheMode'); } else { showDiv('defaultOptions'); } } } // handles the logic to only show one of the divs function showDiv(divID) { if (divID == 'overrideCacheOptionsDiv') { showDynamicDiv('overrideCacheOptionsDiv'); } else { hideDynamicDiv('overrideCacheOptionsDiv'); } if (divID == 'overrideOptionsDiv') { showDynamicDiv('overrideOptionsDiv'); } else { hideDynamicDiv('overrideOptionsDiv'); } if (divID == 'defaultOptions') { showDynamicDiv('defaultOptions'); } else { hideDynamicDiv('defaultOptions'); } if (divID == 'defaultOptionsCacheMode') { showDynamicDiv('defaultOptionsCacheMode'); } else { hideDynamicDiv('defaultOptionsCacheMode'); } } // when the user toggles the override checked for the run options function toggleCheckbox() { frm = document.pform; var cacheSetting = 'none'; if (document.pform.m_ro_promptCacheMode) { cacheSetting = document.pform.m_ro_promptCacheMode.value; } toggledynamicDiv('savePromptCacheDiv'); if (cacheSetting == 'create') { toggledynamicDiv('defaultOptionsCacheMode'); toggledynamicDiv('overrideCacheOptionsDiv'); } else { toggledynamicDiv('defaultOptions'); toggledynamicDiv('overrideOptionsDiv'); } } // expend collapse the deploy options function clickDeploymentOptionSection() { document.pform.deployment_options_collapsed.value = (document.pform.deployment_options_collapsed.value == 'false') ? 'true' : 'false'; updateDeploymentOptionSection(); updateDeploymentOptionsSummary(); } // make sure the deploy options section is in a valid state function updateDeploymentOptionSection() { var frm = document.pform; // make sure the divs exist. They won't if user does not have $hasCSTCapability if (document.getElementById('collapsedDeploymentOptions') && document.getElementById('expandedDeploymentOptions') && document.getElementById('overrideDeploymentOptionsDiv') && document.getElementById('defaultDeploymentOptionsDiv')) { if (frm.deployment_options_collapsed.value == 'false') { hideDynamicDiv('collapsedDeploymentOptions'); showDynamicSection('expandedDeploymentOptions'); if (frm.override_default_deployment_options.checked) { showDynamicDiv('overrideDeploymentOptionsDiv'); hideDynamicDiv('defaultDeploymentOptionsDiv'); } else { hideDynamicDiv('overrideDeploymentOptionsDiv'); showDynamicDiv('defaultDeploymentOptionsDiv'); } } else { showDynamicDiv('collapsedDeploymentOptions'); hideDynamicSection('expandedDeploymentOptions'); } } } // update the deployment options summary used when the deploy section is collapsed. function updateDeploymentOptionsSummary() { var frm = document.pform; // make sure the divs exist. They won't if user does not have $hasCSTCapability if (document.getElementById('collapsedDeploymentOptions') && document.getElementById('expandedDeploymentOptions') && document.getElementById('overrideDeploymentOptionsDiv') && document.getElementById('defaultDeploymentOptionsDiv')) { // only update the summaryText if the section collapsed if (frm.deployment_options_collapsed.value == 'false') { return; } if (!frm.override_default_deployment_options.checked) { document.getElementById('deploymentOptionSummary').innerHTML = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET'];; return; } var summaryText = ''; if (frm.deploymentro_upgrade) { for(var i=0; frm.deploymentro_upgrade.length > i; i++) { if (frm.deploymentro_upgrade[i].value=='upgrade' && frm.deploymentro_upgrade[i].checked) { summaryText = g_jobOptions_msg_array['IDS_DEPLOYMENT_SELECT_UPGRADE_RADIO_UPGRADE']; } if (frm.deploymentro_upgrade[i].value=='keep' && frm.deploymentro_upgrade[i].checked) { summaryText = g_jobOptions_msg_array['IDS_DEPLOYMENT_SELECT_UPGRADE_RADIO_KEEP']; } } } if (frm.deploymentro_preserveStoreIDs) { for(var i=0; frm.deploymentro_preserveStoreIDs.length > i; i++) { if (frm.deploymentro_preserveStoreIDs[i].value=='true' && frm.deploymentro_preserveStoreIDs[i].checked) { summaryText = summaryText + g_jobOptions_msg_array['IDS_DEPLOYMENT_OPTIONS_INCLUDE_PRESERVE_STOREIDS']; } if (frm.deploymentro_preserveStoreIDs[i].value=='false' && frm.deploymentro_preserveStoreIDs[i].checked) { summaryText = summaryText + g_jobOptions_msg_array['IDS_DEPLOYMENT_OPTIONS_DO_NOT_INCLUDE_PRESERVE_STOREIDS']; } } } if (summaryText == '') { summaryText = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET']; } document.getElementById('deploymentOptionSummary').innerHTML = summaryText; } } // Index Update section function clickIndexUpdateTaskOptionSection() { if (!document.pform.index_update_task_options_collapsed) { return; } document.pform.index_update_task_options_collapsed.value = (document.pform.index_update_task_options_collapsed.value == 'false') ? 'true' : 'false'; updateIndexUpdateTaskOptionSection(); updateIndexUpdateTaskOptionSummary(); } function updateIndexUpdateTaskOptionSection() { frm = document.pform; if (frm.index_update_task_options_collapsed.value == 'false') { hideDynamicDiv('collapsedIndexUpdateTaskOptions'); showDynamicSection('expandedIndexUpdateTaskOptions'); if (document.pform.override_default_index_update_task_options.checked) { showDynamicDiv('overrideIndexUpdateTaskOptionsDiv'); hideDynamicDiv('defaultIndexUpdateTaskOptionsDiv'); } else { hideDynamicDiv('overrideIndexUpdateTaskOptionsDiv'); showDynamicDiv('defaultIndexUpdateTaskOptionsDiv'); } } else { showDynamicDiv('collapsedIndexUpdateTaskOptions'); hideDynamicSection('expandedIndexUpdateTaskOptions'); } } function updateIndexUpdateTaskOptionSummary() { frm = document.pform; // only update the summaryText if the section collapsed if (frm.index_update_task_options_collapsed.value == 'false') return; if (!frm.override_default_index_update_task_options.checked) { document.getElementById('indexUpdateTaskOptionSummary').innerHTML = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET']; return; } var summaryText = ''; if (frm.m_io_force) { for(var i=0; frm.m_io_force.length > i; i++) { if (document.pform.m_io_force[i].value=='false' && document.pform.m_io_force[i].checked) { summaryText = g_jobOptions_msg_array['IDS_INDEX_UPDATE_FORCE_OPTION_CHANGED_ENTRIES']; } if (document.pform.m_io_force[i].value=='true' && document.pform.m_io_force[i].checked) { summaryText = g_jobOptions_msg_array['IDS_INDEX_UPDATE_FORCE_OPTION_ALL_ENTRIES']; } } } if (summaryText == '') { summaryText = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET']; } document.getElementById('indexUpdateTaskOptionSummary').innerHTML = summaryText; } // update the summary for the report options. Only needed when the report options section is collapsed function updateReportOptionsSummary() { frm = document.pform; // only update the summaryText if the section collapsed if (frm.report_options_collapsed.value == 'false') { return; } if (!frm.override_default_options.checked) { document.getElementById('reportOptionSummary').innerHTML = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET']; return; } var summaryText = ''; var needDelimiter = true; if (document.pform.m_ro_promptCacheMode) { var cacheSetting = document.pform.m_ro_promptCacheMode.value; } else { var cacheSetting = 'none'; } var listSeparator = g_jobOptions_msg_array['IDS_LIST_SEPARATOR']; if (cacheSetting == 'create') { summaryText += g_jobOptions_msg_array['IDS_STEP_RUN_REFRESH_REPORT_CACHE']; } else { summaryText += g_jobOptions_msg_array['IDS_STEP_RUN_PRODUCE_OUTPUTS']; // build up the format summary // HTML if (frm.m_ro_outputF_HTML_Type && frm.m_ro_outputF_HTML_Type.checked) { for (var i=0; i < frm.m_ro_outputFormat_HTML.length; i++) { if (frm.m_ro_outputFormat_HTML[i].selected) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += frm.m_ro_outputFormat_HTML[i].text; if (frm.m_ro_outputFormat_HTML[i].value == 'HTML' && frm.m_ro_selectionBasedFeatures && frm.m_ro_selectionBasedFeatures.checked) { summaryText += ' (' + g_jobOptions_msg_array['IDS_OTHERRUN_ENABLE_INTERACTIVITY'] + ')'; } needDelimiter = true; } } } // PDF // PDF format may be disabled in system.xml if (frm.m_ro_outputFormat_PDF && frm.m_ro_outputFormat_PDF.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_FORMAT_PDF']; if (document.getElementById('g_PDFOptionSummary') && g_PDFOptionSummary != '') { summaryText += ' (' + g_PDFOptionSummary + ')'; } needDelimiter = true; } // Excel 2000 if (frm.m_ro_outputF_XLS2000_Type && frm.m_ro_outputF_XLS2000_Type.checked) { for (var i=0; i < frm.m_ro_outputFormat_XLS2000.length; i++) { if (frm.m_ro_outputFormat_XLS2000[i].selected) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += frm.m_ro_outputFormat_XLS2000[i].text; } } needDelimiter = true; } // Excel 2002 if (frm.m_ro_outputFormat_XLWA && frm.m_ro_outputFormat_XLWA.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_FORMAT_XLS_2002']; needDelimiter = true; } // CSV if (frm.m_ro_outputFormat_CSV && frm.m_ro_outputFormat_CSV.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_FORMAT_CSV']; needDelimiter = true; } // XML if (frm.m_ro_outputFormat_XML && frm.m_ro_outputFormat_XML.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_FORMAT_XML']; needDelimiter = true; } // A11Y if (frm.m_go_accessibilityFeatures && frm.m_go_accessibilityFeatures.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_PROP_RUN_A11Y_SUPPORT']; needDelimiter = true; } // languages if (document.getElementById('g_outputLocaleSummary') && g_outputLocaleSummary != '') { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_outputLocaleSummary; needDelimiter = true; } // save the reports if (frm.m_ro_saveOutput && frm.m_ro_saveOutput.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_SAVE_REPORTS']; needDelimiter = true; } // save the report to the file system if (frm.m_ro_archive && frm.m_ro_archive.checked && document.getElementById('g_archiveSummary')) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_SAVE_FILE_SYSTEM'] + ' (' + g_archiveSummary + ')'; needDelimiter = true; } // print if (frm.m_ro_print && frm.m_ro_print.checked) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_PRINT_REPORTS'] + ' ' + frm.select_printerAddress.value; needDelimiter = true; } // email if (frm.m_ro_email.checked && document.getElementById('g_emailSummary')) { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_emailSummary; needDelimiter = true; } // burst if (frm.m_ro_burst.checked && cacheSetting=='none') { if (needDelimiter == true) { summaryText += listSeparator + ' '; } summaryText += g_jobOptions_msg_array['IDS_OTHERRUN_BURST_MULTIPLE_REPORTS']; needDelimiter = true; } } if (summaryText == '') { summaryText = g_jobOptions_msg_array['IDS_PROP_JOB_NO_DEFAULT_SET']; } document.getElementById('reportOptionSummary').innerHTML = summaryText; }