本文整理汇总了PHP中ViewEdit类的典型用法代码示例。如果您正苦于以下问题:PHP ViewEdit类的具体用法?PHP ViewEdit怎么用?PHP ViewEdit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ViewEdit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testdisplay
public function testdisplay()
{
//execute the method with essential parameters set. it should return some html.
$view = new ViewEdit();
$view->module = 'Users';
$view->bean = new User();
$view->preDisplay();
$view->ev->ss = new Sugar_Smarty();
ob_start();
$view->display();
$renderedContent = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0, strlen($renderedContent));
}
示例2: display
public function display()
{
$GLOBALS['log']->info("JrMis_DepartmentsViewEdit.display");
$GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, bean_id: " . $this->bean->id);
global $app_list_strings;
$city_list = array();
// if (!empty($this->bean->id))
// {
$this->bean->custom_fields->retrieve();
$province_id = $this->bean->province_c;
$max_id = $province_id + 9999;
$GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, privince_id: " . $province_id);
$GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, max_id: " . $max_id);
foreach ($app_list_strings['jrmis_city_list'] as $id => $val) {
if ($id > $province_id && $id <= $max_id) {
$city_list[$id] = $val;
}
}
// }
// else
// {
// $city_list[''] = '请选择省份';
// }
$GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, city_list: " . print_r($city_list, TRUE));
$this->ss->assign('CITY_LIST', $city_list);
parent::display();
}
示例3: display
function display()
{
require_once 'modules/ACLRoles/ACLRole.php';
//Get the current user's role
$objACLRole = new ACLRole();
$roles = $objACLRole->getUserRoles($GLOBALS['current_user']->id);
//check if they are in the Admin or Admin Manager's role
if (in_array('Admin', $roles) || in_array('Branch Manager - Delhi', $roles)) {
$this->ev->ss->assign('ReadOnly', '');
} else {
//If not pass in a variable with the value readonly
$this->ev->ss->assign('ReadOnly', 'readonly');
}
//Call the parent display function
parent::display();
}
示例4: display
/**
* @see SugarView::display()
*/
public function display()
{
global $json;
$json = getJSONobj();
$json_config = new json_config();
if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
$javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
} else {
$this->bean->json_id = $this->bean->id;
$javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
}
$this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
if ($this->ev->isDuplicate) {
$this->bean->status = $this->bean->getDefaultStatus();
}
//if
$this->ss->assign('APPLIST', $GLOBALS['app_list_strings']);
$repeatIntervals = array();
for ($i = 1; $i <= self::MAX_REPEAT_INTERVAL; $i++) {
$repeatIntervals[$i] = $i;
}
$this->ss->assign("repeat_intervals", $repeatIntervals);
$fdow = $GLOBALS['current_user']->get_first_day_of_week();
$dow = array();
for ($i = $fdow; $i < $fdow + 7; $i++) {
$dayIndex = $i % 7;
$dow[] = array("index" => $dayIndex, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$dayIndex + 1]);
}
$this->ss->assign('dow', $dow);
$this->ss->assign('repeatData', json_encode($this->view_object_map['repeatData']));
parent::display();
}
示例5: display
public function display()
{
global $mod_strings;
if ($_REQUEST['return_module'] == 'Project') {
$project = new Project();
$project->retrieve($_REQUEST['return_id']);
//Get project resources (users & contacts)
$resources1 = $project->get_linked_beans('project_users_1', 'User');
$resources2 = $project->get_linked_beans('project_contacts_1', 'Contact');
//sort into descending order
ksort($resources1);
ksort($resources2);
echo "<script type='text/javascript'>";
echo "var users = [];";
echo "var contacts = [];";
foreach ($resources1 as $user) {
echo "var user = ['" . $user->id . "', '" . $user->name . "', 'User'];";
echo "users.push(user);";
}
foreach ($resources2 as $contact) {
echo "var user = ['" . $contact->id . "', '" . $contact->name . "', 'Contact'];";
echo "contacts.push(user);";
}
echo "</script>";
}
parent::display();
}
示例6: display
function display()
{
require_once "custom/include/metrix/loadDynamicLists.php";
//helper class to autopoluate the dropdowns
require_once 'include/utils.php';
global $current_user, $app_list_strings;
/********************************************************************************************************/
/* dynamic dd */
/********************************************************************************************************/
$list = new loadDynamicLists();
$domaine_c = $this->bean->domaine_c;
$domaine_c = str_replace('^', '', $domaine_c);
$selected = explode(',', $domaine_c);
$dynamic_dd_fileds = array("pays_text_c" => array("tblname" => "ref_pays", "listname" => "pays_text_list", "field" => "nom"), "pays_iso2_c" => array("tblname" => "ref_pays", "listname" => "pays_iso2_c_list", "field" => "code"), "id_region_a_c" => array("tblname" => "ref_region", "listname" => "id_region_a_c_list", "field" => "nom"));
////special multi enum
$dynamic_dd_fileds2 = array("domaine_c" => array("tblname" => "ref_discip", "listname" => "domaines_section_c_list", "field" => "Domaine", "field2" => "Discipline"));
foreach ($dynamic_dd_fileds2 as $k => $v) {
unset($app_list_strings[$v['listname']]);
$edit_enum = $list->populate_list2($v['tblname'], $v['field'], $v['field2'], $selected);
}
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'], $v['pay']);
}
/********************************************************************************************************/
/* Javascript */
/********************************************************************************************************/
//echo $edit_enum['list_edit'];
//if the orginisme is type_etablissement_c==faculte
echo "\r\n\r\n\t\t\t<script>\r\n\t\t\t\t\r\n\t\t\t\t\$(document).ready(function()\r\n\t\t\t\t{ render();//init\r\n\t\t\t\t\t\$('#domaine_c').html('" . $edit_enum['list_edit'] . "');\r\n\r\n\t\t\t\t\t\$( '#type_etablissement_c' ).change(function() { \r\n \r\n render();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t });\t\r\n\t\t\t\t});\r\n\r\n //custom function\r\n render = function(){\r\n\r\n \tvar remove_fields = \t['coda_name_c','coda_sname_c','prive_c','id_etat_c','date_effectif_c','date_maj_c','statut_c','commentaire2_c','code_hier_c','qualite_c','adhesion_c','sigle_c','historique','nb_etud_c','nb_ens_c','nb_cherch_c','rub_c','commentaire2_c','nb_etud_annee_obs_c','nb_ens_annee_obs_c','nb_cherch_annee_obs_c','chiffres_c'];//you can add the fields you want to hide here\r\n \r\n\r\n\t\t\t\t\t\t\$.each( remove_fields, function( key, value ) {\r\n var dd_val =\$( '#type_etablissement_c' ).val();\r\n\t\t if(dd_val=='faculte'){\r\n\t\t \t\$('#' + value ).hide();\r\n\t\t \t\$('#' + value +'_label' ).css( 'color','white' );\r\n\t\t \t\$('#date_effectif_c_date').parent().parent().hide();\r\n\t\t \t\$('#date_maj_c_date').parent().parent().hide();\r\n\t\t \t\$('#adhesion_c_date').parent().parent().hide();\r\n\t\t \t\r\n\t\t \t\r\n\t\t \t\r\n\t\t }\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\$('#' + value ).show();\r\n\t\t\t\t\t\t\t\$('#' + value +'_label' ).show();\r\n\t\t\t\t\t\t\t\$('#' + value +'_label' ).css( 'color','black' );\r\n\t\t\t\t\t\t\t\$('#date_effectif_c_date').parent().parent().show();\r\n\t\t \t\$('#date_maj_c_date').parent().parent().show();\r\n\t\t \t\$('#adhesion_c_date').parent().parent().show();\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t});\r\n }\r\n\r\n\t\t\t</script>";
$this->ev->process();
parent::display();
}
示例7: display
public function display()
{
// Disable VCR Control
$this->ev->showVCRControl = false;
// Default Team as Global
if (empty($this->bean->id) && !$this->ev->isDuplicate) {
$this->bean->team_id = 1;
$this->bean->team_set_id = 1;
}
// Load TinyMCE
require_once 'include/SugarTinyMCE.php';
$tiny = new SugarTinyMCE();
$tiny->defaultConfig['apply_source_formatting'] = true;
$tiny->defaultConfig['cleanup_on_startup'] = true;
$tiny->defaultConfig['relative_urls'] = false;
$tiny->defaultConfig['convert_urls'] = false;
$ed = $tiny->getInstance('body_html');
$this->ss->assign('tiny_script', $ed);
// Load Fields for main module
if (empty($this->bean->base_module)) {
$modulesList = PdfManagerHelper::getAvailableModules();
$this->bean->base_module = key($modulesList);
}
$fieldsForSelectedModule = PdfManagerHelper::getFields($this->bean->base_module, true);
$this->ss->assign('fieldsForSelectedModule', $fieldsForSelectedModule);
parent::display();
}
示例8: display
function display()
{
global $app_list_strings;
$json = getJSONobj();
$prob_array = $json->encode($app_list_strings['sales_probability_dom']);
$prePopProb = '';
if (empty($this->bean->id) && empty($_REQUEST['probability'])) {
$prePopProb = 'document.getElementsByName(\'sales_stage\')[0].onchange();';
}
$probability_script = <<<EOQ
\t<script>
\tprob_array = {$prob_array};
\tdocument.getElementsByName('sales_stage')[0].onchange = function() {
\t\t\tif(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]
\t\t\t&& typeof(document.getElementsByName('probability')[0]) != "undefined"
\t\t\t) {
\t\t\t\tdocument.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
\t\t\t\tSUGAR.util.callOnChangeListers(document.getElementsByName('probability')[0]);
\t\t\t}
\t\t};
\t{$prePopProb}
\t</script>
EOQ;
$this->ss->assign('PROBABILITY_SCRIPT', $probability_script);
parent::display();
}
示例9: display
function display()
{
parent::display();
?>
<script>
function update_parent_display(){
var name_elem = document.getElementById("parent_category_name");
var id_elem = document.getElementById("parent_category_id");
var btn_elem = document.getElementById("btn_parent_category_name");
var disable = document.getElementById("is_parent") && document.getElementById("is_parent").checked;
if(name_elem){
name_elem.disabled = disable;
}
if(id_elem){
id_elem.disabled = disable;
}
if(btn_elem){
btn_elem.disabled = disable;
}
if(disable){
SUGAR.clearRelateField(this.form, 'parent_category_name', 'parent_category_id');
}
}
document.getElementById("is_parent").onchange = update_parent_display;
document.getElementById("is_parent").onchange();
</script>
<?php
}
示例10: display
function display()
{
$this->displayJSInclude();
$this->setFields();
parent::display();
$this->displayJS();
}
示例11: preDisplay
public function preDisplay()
{
global $app_list_strings;
echo "<style type='text/css'>";
//readfile('modules/AOR_Reports/css/edit.css');
readfile('modules/AOR_Reports/js/jqtree/jqtree.css');
echo "</style>";
if (!is_file('cache/jsLanguage/AOR_Fields/' . $GLOBALS['current_language'] . '.js')) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createModuleStringsCache('AOR_Fields', $GLOBALS['current_language']);
}
echo '<script src="cache/jsLanguage/AOR_Fields/' . $GLOBALS['current_language'] . '.js"></script>';
if (!is_file('cache/jsLanguage/AOR_Conditions/' . $GLOBALS['current_language'] . '.js')) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createModuleStringsCache('AOR_Conditions', $GLOBALS['current_language']);
}
echo '<script src="cache/jsLanguage/AOR_Conditions/' . $GLOBALS['current_language'] . '.js"></script>';
echo '<script src="include/javascript/yui3/build/yui/yui-min.js"></script>';
echo "<script>";
echo "sort_by_values = \"" . trim(preg_replace('/\\s+/', ' ', get_select_options_with_id($app_list_strings['aor_sort_operator'], ''))) . "\";";
echo "total_values = \"" . trim(preg_replace('/\\s+/', ' ', get_select_options_with_id($app_list_strings['aor_total_options'], ''))) . "\";";
echo "format_values = \"" . trim(preg_replace('/\\s+/', ' ', get_select_options_with_id($app_list_strings['aor_format_options'], ''))) . "\";";
echo "</script>";
$fields = $this->getFieldLines();
echo "<script>var fieldLines = " . json_encode($fields) . "</script>";
$conditions = $this->getConditionLines();
echo "<script>var conditionLines = " . json_encode($conditions) . "</script>";
$charts = $this->getChartLines();
echo "<script>var chartLines = " . json_encode($charts) . ";</script>";
parent::preDisplay();
}
示例12: display
function display()
{
$this->bean->is_template = 1;
$this->ev->ss->assign("is_template", 1);
$this->ev->setModuleTitleKey('LBL_PROJECT_TEMPLATE');
parent::display();
}
示例13: preDisplay
function preDisplay()
{
if (file_exists("cache/modules/OfficeReportsVariables/EditView.tpl")) {
unlink("cache/modules/OfficeReportsVariables/EditView.tpl");
}
parent::preDisplay();
}
示例14: display
public function display()
{
global $current_user, $current_language, $sugar_flavor, $sugar_config;
if (!$current_user->is_admin) {
sugar_die(translate("LBL_MUST_BE_ADMIN"));
}
//RemoveTabSave: let dashboard pass since we are still altering it
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'RemoveTabSave') {
if (isset($_REQUEST['TabToRemove'])) {
$dashboardManager = BeanFactory::newBean("dash_DashboardManager");
$dashboardManager->temp_unencoded_pages = $dashboardManager->deletePageByKey($_REQUEST['TabToRemove'], $current_user->getPreference('pages', 'Home'));
$dashboardManager->temp_unencoded_dashlets = $current_user->getPreference('dashlets', 'Home');
$dashboardManager->setDashboardForUser($current_user);
$current_user->getPreference('pages', 'Home');
$current_user->getPreference('dashlets', 'Home');
}
} elseif (isset($this->bean->fetched_row['id'])) {
//set this dashboard for current user
$this->bean->setDashboardForUser($current_user);
} else {
//set dashboard back to clean template
$current_user->resetPreferences('Home');
}
parent::display();
//get language for dashboard
$mod_strings = return_module_language($current_language, 'Home');
//render dashboard
$lock_homepage = $sugar_config['lock_homepage'];
$sugar_config['lock_homepage'] = false;
require_once "modules/Home/index.php";
$sugar_config['lock_homepage'] = $lock_homepage;
}
示例15: display
function display()
{
if (is_admin($GLOBALS['current_user'])) {
$this->ss->assign('EDIT_REPORTS_TO', true);
}
parent::display();
}