/** * returns an array of EmailTemplates that the user has access to for the compose email screen * @return array */ function getEmailTemplatesArray() { global $app_strings; if (ACLController::checkAccess('EmailTemplates', 'list', true) && ACLController::checkAccess('EmailTemplates', 'view', true)) { $et = new EmailTemplate(); $etResult = $et->db->query($et->create_new_list_query('', "(type IS NULL OR type='' OR type='email')", array(), array(), '')); $email_templates_arr = array('' => $app_strings['LBL_NONE']); while ($etA = $et->db->fetchByAssoc($etResult)) { $email_templates_arr[$etA['id']] = $etA['name']; } } else { $email_templates_arr = array('' => $app_strings['LBL_NONE']); } return $email_templates_arr; }
/////////////////////////////////////////////////////////////////////////////// //// DOCUMENTS $popup_request_data = array('call_back_function' => 'document_set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'related_doc_id', 'document_name' => 'related_document_name')); $json = getJSONobj(); $xtpl->assign('encoded_document_popup_request_data', $json->encode($popup_request_data)); //// END DOCUMENTS /////////////////////////////////////////////////////////////////////////////// $parse_open = true; if ($parse_open) { $xtpl->parse('main.open_source_1'); } /////////////////////////////////////////////////////////////////////////////// //// EMAIL TEMPLATES if (ACLController::checkAccess('EmailTemplates', 'list', true) && ACLController::checkAccess('EmailTemplates', 'view', true)) { $et = new EmailTemplate(); $etResult = $focus->db->query($et->create_new_list_query('', '', array(), array(), '')); $email_templates_arr[] = ''; while ($etA = $focus->db->fetchByAssoc($etResult)) { $email_templates_arr[$etA['id']] = $etA['name']; } } else { $email_templates_arr = array('' => $app_strings['LBL_NONE']); } $xtpl->assign('EMAIL_TEMPLATE_OPTIONS', get_select_options_with_id($email_templates_arr, '')); //// END EMAIL TEMPLATES /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////// //// TEXT EDITOR // cascade from User to Sys Default $editor = $focus->getUserEditorPreference(); if ($editor != 'plain') {