public function display() { global $sugar_config, $current_user, $app_list_strings; $aop_portal_enabled = !empty($sugar_config['aop']['enable_portal']) && !empty($sugar_config['aop']['enable_aop']); $this->ss->assign("AOP_PORTAL_ENABLED", $aop_portal_enabled); require_once 'modules/AOS_PDF_Templates/formLetter.php'; formLetter::DVPopupHtml('Contacts'); require_once "custom/include/metrix/loadDynamicLists.php"; //helper class to autopoluate the dropdowns require_once 'include/utils.php'; /********************************************************************************************************/ /* dynamic dd */ /********************************************************************************************************/ //TODO $dynamic_dd_fileds = array("country_c" => array("tblname" => "ref_pays", "listname" => "country_list", "field" => "nom")); $list = new loadDynamicLists(); foreach ($dynamic_dd_fileds as $k => $v) { unset($app_list_strings[$v['listname']]); $app_list_strings[$v['listname']] = $list->populate_list($v['tblname'], $v['field']); } //if the current user is not admin then hide the values of certain fields and make them non inline-editable if ($current_user->is_admin != 1) { echo "\n\t\t\t<script>\n\t\t\t\t\$('html').hide();\n\t\t\t\t\$(document).ready(\n\t\t\t\tfunction()\n\t\t\t\t{\n\n\t\t\t\tvar remove_fields = \t['email1','phone_mobile','jjwg_maps_address_c','primary_address_postalcode','primary_address_state','primary_address_city','alt_address_city','primary_address_country','phone_work','phone_fax','description'];//you can add the fields you want to hide here\n\n\n\t\t\t\t\$.each( remove_fields, function( key, value ) {\n\n\n\t\t\t\t\$('td[field= ' + value + ']').html( '' );\n\n\t\t\t\t\$('td[field=' + value + ']').removeAttr('field');\n\t\t\t\t});\n\n\t\t\t\t\$('html').show(250);\n\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t</script>"; //if the field modified_c is not 0 then the user cannot see this record until an Admin user sets it back to 0 if ($this->bean->modified_c != 0) { echo "\n\t\t\t<script>\t\t\t\t\n\t\t\t\t\$(document).ready(\n\t\t\t\t\tfunction()\n\t\t\t\t\t{\n\t\t\t\t\t\$('#pagecontent').html('<div class=\\'alert alert-danger\\' role=\\'alert\\'>Vos modifications sont en attente de validation</div>');\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t</script>"; } } if ($current_user->is_admin == 1 && $this->bean->modified_c == 1) { //function to uncheck the modified checkbox in order to give access to this Contact to non Admin users echo "\n\t\t\t<script>\t\t\t\t\n\t\t\t\t\$(document).ready(\n\t\t\t\t\tfunction()\n\t\t\t\t\t{\n\t\t\t\t\t\$('.subnav').prepend('<li><a href=\\'#\\' onclick=\\'uncheckBox();\\'>Valider</a></li>');\n\t\t\t\t\t}\n\t\t\t\t);\n\n var uncheckBox = function(){\n \n\t\t\t\t\t\$.ajax({\n\t\t\t\t\turl: 'index.php?module=Contacts&action=untag&m=Contact&record=" . $this->bean->id . "',\n\t\t\t\t\tdata: {\n\t\t\t\t\tformat: 'text'\n\t\t\t\t\t},\n\n\t\t\t\t\tdataType: 'text',\n\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\$('#pagecontent').prepend('<div class=\\'alert alert-success\\' role=\\'alert\\'>You have successfully untagged this record.</div>');\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET'\n\t\t\t\t\t});\n\n }\n \n\n\t\t\t</script>"; } parent::display(); }
public function display() { global $sugar_config; $aop_portal_enabled = !empty($sugar_config['aop']['enable_portal']) && !empty($sugar_config['aop']['enable_aop']); $this->ss->assign("AOP_PORTAL_ENABLED", $aop_portal_enabled); require_once 'modules/AOS_PDF_Templates/formLetter.php'; formLetter::DVPopupHtml('Contacts'); parent::display(); }