/
var
/
www
/
html
/
sugar13
/
modules
/
WorkFlowAlerts
/
Upload File
HOME
<!-- /* * Your installation or use of this SugarCRM file is subject to the applicable * terms available at * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/. * If you do not agree to all of the applicable terms or do not have the * authority to bind the entity as an authorized representative, then do not * install or use this SugarCRM file. * * Copyright (C) SugarCRM Inc. All rights reserved. */ --> <!-- BEGIN: embeded --> <script type="text/javascript" src="cache/include/javascript/sugar_grp1.js?v={VERSION_MARK}"></script> <script type="text/javascript" src="include/workflow/jutils.js?v={VERSION_MARK}"></script> {JAVASCRIPT_LANGUAGE_FILES} <script> function togglelanguage(run_clear){ var radio_object = document.EditView.user_type; if(!radio_object) return ""; var radioLength = radio_object.length; if(run_clear == 'clear_field'){ //Clear the fields before proceeding clear_field('rel_module1'); clear_field('rel_module2'); clear_field('field_value'); reset_text('EditView'); } for(var i = 0; i < radioLength; i++) { if(radio_object[i].checked) { //alert(radio_object[i].value); this.document.getElementById('lang_' + radio_object[i].value).style.display= ''; var target_value = radio_object[i].value; } else { this.document.getElementById('lang_' + radio_object[i].value).style.display= 'none'; } } if(target_value){ if(target_value == 'specific_user' || target_value == 'specific_role' || target_value == 'specific_team' || target_value == 'login_user' || target_value == 'assigned_team_target' ){ //make save button visible, next button invisible this.document.getElementById('next_div').style.display= 'none'; this.document.getElementById('save_div').style.display= ''; } else { //make next button visible, save button invisible this.document.getElementById('next_div').style.display= ''; this.document.getElementById('save_div').style.display= 'none'; } } else { this.document.getElementById('save_div').style.display= 'none'; } //end function togglelanguage } function changehref_text(href_object, selected_text){ this.document.getElementById(href_object).innerHTML = selected_text; //end function changehref_text } function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } </script> <script> function get_selector(user_type){ var base_module = this.document.getElementById('base_module').value; var rel_module1 = this.document.getElementById('rel_module1').value; var rel_module2 = this.document.getElementById('rel_module2').value; var link_location = "index.php?module=WorkFlowAlerts&action=Selector&sugar_body_only=true&base_module={BASE_MODULE}"; link_location += '&rel_module1=' + rel_module1 + '&rel_module2=' + rel_module2 + '&user_type=' + user_type; window.open(link_location, "Test","width=300,height=100,resizable=1,scrollbars=1"); //end function get_selector } function get_single_selector(user_type, type){ var value = get_value('field_value'); var href_object = 'href_' + user_type; var opener_id = 'field_value'; //type, value, dom_name, opener_id, href_object var link_location = "index.php?module=Expressions&action=SingleSelector&sugar_body_only=true"; link_location += '&type=' + type + '&value=' + value + '&opener_id=' + opener_id + '&href_object=' + href_object; window.open(link_location, "Test","width=400,height=100,resizable=1,scrollbars=1"); //end function get_selector } //Used for the address types function get_single_selector2(href_object, type, dom_name, value_field, meta_filter_name){ var value = get_value(value_field); var opener_id = value_field; //type, value, dom_name, opener_id, href_object var link_location = "index.php?module=Expressions&action=SingleSelector&sugar_body_only=true"; link_location += '&type=' + type + '&value=' + value + '&opener_id=' + opener_id + '&href_object=' + href_object + '&dom_name=' + dom_name; link_location += '&meta_filter_name=' + meta_filter_name; window.open(link_location, "Test","width=400,height=100,resizable=1,scrollbars=1"); //end function get_selector } function confirm_safety(type){ var radio_object = document.EditView.user_type; var checked_value = getCheckedValue(radio_object); var select_option = SUGAR.language.get('WorkFlow', 'LBL_SELECT_OPTION'); var select_value = SUGAR.language.get('WorkFlowAlerts', 'LBL_SELECT_VALUE'); if(type=='next'){ if(checked_value!=""){ return check_specific_type(checked_value); } else { alert(select_option); return false; } } if(type=='save'){ if(checked_value != 'login_user' && checked_value != 'assigned_team_target'){ return confirm_value_present('field_value', select_value); } return true; } //end function confirm_safety } </script> <!-- END: embeded --> <!-- BEGIN: main --> {SET_RETURN_JS} <table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr> <form name="EditView" id="EditView" method="POST" action="index.php"> {sugar_csrf_form_token} <input type="hidden" name="module" value="WorkFlowAlerts"> <input type="hidden" id='record' name="record" value="{ID}"> <input type="hidden" id='parent_id' name="parent_id" value="{PARENT_ID}"> <input type="hidden" name="action" value="CreateStep2"> <input type="hidden" name="return_module" value="{RETURN_MODULE}"> <input type="hidden" name="return_id" value="{RETURN_ID}"> <input type="hidden" name="return_action" value="{RETURN_ACTION}"> <input type="hidden" name="sugar_body_only" value="true"> <input type="hidden" id='field_value' name="field_value" value="{FIELD_VALUE}"> <input type="hidden" id='base_module' name="base_module" value="{BASE_MODULE}"> <input type="hidden" id ='rel_module1' name="rel_module1" value="{REL_MODULE1}"> <input type="hidden" id ='rel_module2' name="rel_module2" value="{REL_MODULE2}"> <td></td></tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> {TOP_BLOCK} <tr> <td> </td> </tr> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="50px"> {BOTTOM_BLOCK} <tr> <td> </td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> <tr id='next_div'> <td align='right' colspan='2'> <input type='submit' class='button' value='{APP.LBL_NEXT_BUTTON_LABEL}' id='next' name='next' title='{MOD.LBL_NEXT_BUTTON}' onclick="return confirm_safety('next');"> <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="window.close();" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} "> </td> </tr> <tr id='save_div'> <td align='right' colspan='2'> <input type='submit' class='button' value='{APP.LBL_SAVE_BUTTON_LABEL}' id='save' name='save' title='{APP.LBL_SAVE_BUTTON_LABEL}' onclick="if(confirm_safety('save')) { this.form.action.value='Save'; return true; } else return false;"> <input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="window.close();" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} "> </td> </tr> </form> </table> <script> togglelanguage('no'); {SPECIAL_JAVASCRIPT} </script> <!-- END: main -->