/
var
/
www
/
html
/
sugardemo
/
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 togglefield_select(field_num){ var focus_field = 'mod_' + field_num; var setting = this.document.getElementById(focus_field).checked; var target_row = 'lang_' + field_num; if(setting==true){ this.document.getElementById(target_row).style.display=''; } else { this.document.getElementById(target_row).style.display='none'; } //end function togglefield_select } function togglelanguage(reset_values){ var radio_object = document.EditView.user_display_type; if(!radio_object) return ""; var radioLength = radio_object.length; 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'; } } //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.ESCAPE_URL}"; 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(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 select_option = SUGAR.language.get('WorkFlow', 'LBL_SELECT_OPTION'); var select_name = SUGAR.language.get('WorkFlowAlerts', 'LBL_SELECT_NAME'); var select_email = SUGAR.language.get('WorkFlowAlerts', 'LBL_SELECT_EMAIL'); var select_filter = SUGAR.language.get('WorkFlowAlerts', 'LBL_SELECT_FILTER'); var select_name_email = SUGAR.language.get('WorkFlowAlerts', 'LBL_SELECT_NAME_EMAIL'); if((safety_rel_filters())==false){ return false; } if(type=='rel_user_custom'){ var check_one = ""; var check_two = ""; var check_three = ""; //make sure you have the select email, name selected if(this.document.getElementById('mod_rel_custom1').checked==true){ check_one = confirm_value_present('field_value', select_name); check_two = confirm_value_present('rel_email_value', select_email); } else { alert(select_name_email); return false; } //make sure you have fields selected for these //if filter is checked, then make sure something is selected if(this.document.getElementById('mod_rel_custom2').checked==true){ check_three = confirm_value_present('rel_custom2_lhs_field', select_filter); } else { check_three = true; } if(check_one==false || check_two==false || check_three==false){ //alert('test1' + check_one + 'test2' + check_two + 'test3' + check_three); return false; } else { return true; } } if(type=='trig_user_custom'){ var check_one = ""; var check_two = ""; //make sure you have the select email, name selected if(this.document.getElementById('mod_rel_custom1').checked==true){ check_one = confirm_value_present('field_value', select_name); check_two = confirm_value_present('rel_email_value', select_email); } else { alert(select_name_email); return false; } //make sure you have fields selected for these if(check_one==false || check_two==false){ //alert('test1' + check_one + 'test2' + check_two + 'test3' + check_three); return false; } else { return true; } //end if trig_user_custom } var radio_object = document.EditView.user_display_type; var checked_value = getCheckedValue(radio_object); if(checked_value==""){ alert(select_option); return false; } else { 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" 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.ESCAPE_HTML_ATTR}"> <input type="hidden" id='parent_id' name="parent_id" value="{PARENT_ID.ESCAPE_HTML_ATTR}"> <input type="hidden" name="action" value="Save"> <input type="hidden" name="return_module" value="{RETURN_MODULE.ESCAPE_HTML_ATTR}"> <input type="hidden" name="return_id" value="{RETURN_ID.ESCAPE_HTML_ATTR}"> <input type="hidden" name="return_action" value="{RETURN_ACTION.ESCAPE_HTML_ATTR}"> <input type="hidden" name="sugar_body_only" value="true"> <input type="hidden" id='user_type' name="user_type" value="{USER_TYPE.ESCAPE_HTML_ATTR}"> <input type="hidden" id='base_module' name="base_module" value="{BASE_MODULE.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='rel_module1' name="rel_module1" value="{REL_MODULE1.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='rel_module2' name="rel_module2" value="{REL_MODULE2.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel__set_type' name="rel__set_type" value="{REL_SET_TYPE.ESCAPE_HTML_ATTR}"> <td></td></tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <!-- BEGIN: top_frame --> <tr> <td width="10%" scope="row"><slot><input id='{RADIO_ID.ESCAPE_HTML_ATTR}' name='{RADIO_NAME.ESCAPE_HTML_ATTR}' type='radio' tabindex='2' value ='{RADIO_VALUE.ESCAPE_HTML_ATTR}' onclick='togglelanguage("true");' {RADIO_DISABLE}></slot></td> <td width="90%" scope="row"><slot>{RADIO_DISPLAY.SANITIZE_HTML}{RADIO_DISPLAY2.SANITIZE_HTML}{RADIO_DISPLAY3.SANITIZE_HTML}</slot></td> </tr> <!-- END: top_frame --> <!-- BEGIN: rel_custom_frame_top --> <input type="hidden" id ='rel_email_value' name="rel_email_value" value="{REL_EMAIL_VALUE.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='field_value' name="field_value" value="{FIELD_VALUE.ESCAPE_HTML_ATTR}"> <tr> <td width="10%" scope="row"><slot><input id='mod_rel_custom1' name='mod_rel_custom1' type='checkbox' tabindex='2' onclick="togglefield_select('rel_custom1');" {REL_CUSTOM1_CHECKED}></slot></td> <td width="90%" scope="row"><slot>{MOD.LBL_REL_CUSTOM_STRING.ESCAPE_HTML}</slot></td> </tr> <tr> <td width="10%" scope="row"><slot><input id='mod_rel_custom2' name='mod_rel_custom2' type='checkbox' tabindex='2' onclick="togglefield_select('rel_custom2');" {REL_CUSTOM2_CHECKED}></slot></td> <td width="90%" scope="row"><slot>{MOD.LBL_FILTER_BY.ESCAPE_HTML}{MOD.LBL_SPECIFIC_FIELD.ESCAPE_HTML}</slot></td> </tr> <!-- END: rel_custom_frame_top --> <!-- BEGIN: trig_custom_frame_top --> <input type="hidden" id ='rel_email_value' name="rel_email_value" value="{REL_EMAIL_VALUE.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='field_value' name="field_value" value="{FIELD_VALUE.ESCAPE_HTML_ATTR}"> <tr> <td width="10%" scope="row"><slot><input id='mod_rel_custom1' name='mod_rel_custom1' type='checkbox' tabindex='2' onclick="togglefield_select('rel_custom1');" {REL_CUSTOM1_CHECKED}></slot></td> <td width="90%" scope="row"><slot>{MOD.LBL_REL_CUSTOM_STRING.ESCAPE_HTML}</slot></td> </tr> <!-- END: trig_custom_frame_top --> <tr> <td> </td> </tr> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="50px"> <tr> <td>{PREV_DISPLAY_TEXT}</td> </tr> <!-- BEGIN: bottom_frame --> <tr id='lang_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}'> <td><slot>{HREF_TEXT1.SANITIZE_HTML}<a id='href_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' href=# onclick="get_single_selector('{SINGLE_SELECTOR_ARRAY.ESCAPE_JS}','dom_array', 'wflow_relate_type_dom', 'relate_type_{USER_DISPLAY_TYPE.ESCAPE_JS}');">{HREF_TEXT2.SANITIZE_HTML}</a>{HREF_TEXT3.SANITIZE_HTML} {MOD.LBL_ADDRESS_TYPE.ESCAPE_HTML}<a id='href_add_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' href=# onclick="get_single_selector('{SINGLE_SELECTOR_ARRAY_ADD.ESCAPE_JS}','dom_array', '{ADDRESS_TYPE_DOM.ESCAPE_JS}', 'address_type_{USER_DISPLAY_TYPE.ESCAPE_JS}');">{ADDRESS_TYPE_TARGET.SANITIZE_HTML}</a> </slot></td> <input type="hidden" id ='relate_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' name="relate_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}" value="{RELATE_TYPE.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='address_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' name="address_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}" value="{ADDRESS_TYPE.ESCAPE_HTML_ATTR}"> <input type="hidden" id='field_value_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' name="field_value_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}" value="{FIELD_VALUE.ESCAPE_HTML_ATTR}"> <input type="hidden" id='array_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}' name="array_type_{USER_DISPLAY_TYPE.ESCAPE_HTML_ATTR}" value="{ARRAY_TYPE.ESCAPE_HTML_ATTR}"> </tr> <!-- END: bottom_frame --> <!-- BEGIN: rel_custom_frame_bottom --> <tr id='lang_rel_custom1'> <td><slot>{REL_CUSTOM1_TEXT1.SANITIZE_HTML}<a id='href_rel_custom1' href=# onclick="get_single_selector('href_rel_custom1','field', '{TARGET_MODULE.ESCAPE_JS}', 'rel_email_value', 'normal_trigger');">{REL_CUSTOM1_TEXT2.SANITIZE_HTML}</a>{MOD.LBL_AND.ESCAPE_HTML} <a id='href_rel_custom1b' href=# onclick="get_single_selector('href_rel_custom1b','field', '{TARGET_MODULE.ESCAPE_JS}', 'field_value', 'alert_trigger');">{REL_CUSTOM1_TEXT3.SANITIZE_HTML}</a> <BR> {MOD.LBL_ADDRESS_TYPE.ESCAPE_HTML}<a id='href_add_lang_rel_custom1' href=# onclick="get_single_selector('href_add_lang_rel_custom1','dom_array', '{ADDRESS_TYPE_DOM.ESCAPE_JS}', 'address_type');">{ADDRESS_TYPE_TARGET.SANITIZE_HTML}</a> <input type="hidden" id ='address_type' name="address_type" value="{ADDRESS_TYPE.ESCAPE_HTML_ATTR}"> </slot></td> </tr> <tr id='lang_rel_custom2'> <td><slot>{MOD.LBL_FILTER_BY.ESCAPE_HTML}<a id='href_rel_custom2' href=# onclick="get_filter_selector('alert_filter', 'rel_custom2_exp_id', 'rel_custom2_lhs_module', 'rel_custom2_lhs_field', 'rel_custom2_rhs_value', 'rel_custom2_operator', 'rel_custom2');">{REL_CUSTOM2_TEXT.SANITIZE_HTML}</a> </slot></td> <input type="hidden" id='rel_custom2_lhs_module' name="rel_custom2_lhs_module" value="{REL_CUSTOM2_LHS_MODULE.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel_custom2_lhs_field' name="rel_custom2_lhs_field" value="{REL_CUSTOM2_LHS_FIELD.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel_custom2_rhs_value' name="rel_custom2_rhs_value" value="{REL_CUSTOM2_RHS_VALUE.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel_custom2_exp_id' name="rel_custom2_exp_id" value="{REL_CUSTOM2_EXP_ID.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel_custom2_operator' name="rel_custom2_operator" value="{REL_CUSTOM2_OPERATOR.ESCAPE_HTML_ATTR}"> <input type="hidden" id='rel_custom2_exp_type' name="rel_custom2_exp_type" value="{REL_CUSTOM2_EXP_TYPE.ESCAPE_HTML_ATTR}"> <input type="hidden" id ='address_type' name="address_type" value="{ADDRESS_TYPE.ESCAPE_HTML_ATTR}"> </tr> <!-- END: rel_custom_frame_bottom --> <!-- BEGIN: trig_custom_frame_bottom --> <tr id='lang_rel_custom1'> <td><slot>{REL_CUSTOM1_TEXT1.SANITIZE_HTML}<a id='href_rel_custom1' href=# onclick="get_single_selector('href_rel_custom1','field', '{TARGET_MODULE.ESCAPE_JS}', 'rel_email_value', 'normal_trigger');">{REL_CUSTOM1_TEXT2.SANITIZE_HTML}</a>{MOD.LBL_AND.ESCAPE_HTML} <a id='href_rel_custom1b' href=# onclick="get_single_selector('href_rel_custom1b','field', '{TARGET_MODULE.ESCAPE_JS}', 'field_value', 'alert_trigger');">{REL_CUSTOM1_TEXT3.SANITIZE_HTML}</a> <BR> {MOD.LBL_ADDRESS_TYPE.ESCAPE_HTML}<a id='href_add_lang_rel_custom1' href=# onclick="get_single_selector('href_add_lang_rel_custom1','dom_array', '{ADDRESS_TYPE_DOM.ESCAPE_JS}', 'address_type');">{ADDRESS_TYPE_TARGET.SANITIZE_HTML}</a> </slot></td> <input type="hidden" id ='address_type' name="address_type" value="{ADDRESS_TYPE.ESCAPE_HTML_ATTR}"> </tr> <!-- END: trig_custom_frame_bottom --> <tr> <td> </td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td align='right' colspan="2"> <span id='set_type_hrefs'> <a id='href_set_type_basic' href=# onclick="toggle_set_type('rel', 'Advanced');" class="tabFormAdvLink">{ADVANCED_SEARCH_PNG} {APP.LNK_ADVANCED_SEARCH.ESCAPE_HTML}</a> <a id='href_set_type_adv' href=# onclick="reset_rel_filters(); toggle_set_type('rel', 'Basic');" class="tabFormAdvLink">{BASIC_SEARCH_PNG} {APP.LNK_BASIC_SEARCH.ESCAPE_HTML}</a> </span> <input type='submit' class='button' value='{APP.LBL_SAVE_BUTTON_LABEL.ESCAPE_HTML_ATTR}' id='save' name='save' title='{APP.LBL_SAVE_BUTTON_LABEL.ESCAPE_HTML_ATTR}' onclick="return confirm_safety('{USER_TYPE.ESCAPE_JS}');"> <input title="{APP.LBL_CANCEL_BUTTON_TITLE.ESCAPE_HTML_ATTR}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY.ESCAPE_HTML_ATTR}" class="button" onclick="window.close();" type="button" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL.ESCAPE_HTML_ATTR} "> </td> </tr> <tr> <td> </td> </tr> {ADV_RELATED_BLOCK} </form> </table> <script> togglelanguage(); {REL_USER_CUSTOM_START_JSCRIPT} {SPECIAL_JAVASCRIPT} toggle_set_type('rel', '{REL_SET_TYPE}'); toggle_hrefs('{SET_DISABLED}'); </script> <!-- END: main -->