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(); }
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)); }
/** * @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(); }
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(); }
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(); }
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(); }
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(); }
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 }
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(); }
function display() { $this->displayJSInclude(); $this->setFields(); parent::display(); $this->displayJS(); }
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(); }
function display() { $this->bean->is_template = 1; $this->ev->ss->assign("is_template", 1); $this->ev->setModuleTitleKey('LBL_PROJECT_TEMPLATE'); parent::display(); }
function preDisplay() { if (file_exists("cache/modules/OfficeReportsVariables/EditView.tpl")) { unlink("cache/modules/OfficeReportsVariables/EditView.tpl"); } parent::preDisplay(); }
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; }
function display() { if (is_admin($GLOBALS['current_user'])) { $this->ss->assign('EDIT_REPORTS_TO', true); } parent::display(); }
function display() { $admin = Administration::getSettings(); if (isset($admin->settings['portal_on']) && $admin->settings['portal_on']) { $this->ev->ss->assign("PORTAL_ENABLED", true); } parent::display(); }
function display() { $this->populateCurrency(); $this->populateQuoteTemplates(); $this->populateLineItems(); parent::display(); $this->displayJS(); }
public function process() { if (isset($this->errors['company_logo'])) { $this->configurator->errors['company_logo'] = $this->errors['company_logo']; unset($this->errors['company_logo']); } return parent::process(); }
/** * @see SugarView::display() */ public function display() { if ($this->ev->isDuplicate) { $this->bean->status = $this->bean->getDefaultStatus(); } //if parent::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")); } parent::display(); }
function display() { global $mod_strings; parent::display(); $javascript = <<<EOQ EOQ; echo $javascript; }
function display() { $this->bean->is_template = 0; if (!empty($this->ev->ss)) { $this->ev->ss->assign("is_template", 0); } parent::display(); }
/** * @see SugarView::display() */ public function display() { if ($this->ev->isDuplicate) { $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS']; } //if parent::display(); }
public function getMetaDataFile() { parent::getMetaDataFile(); global $current_user; if ($this->bean->realty_status == 'realtor' && $current_user->id != $this->bean->assigned_user_id) { //$getMetaDataFile = 'custom/modules/Realty/metadata/editviewdefsTypeRealtor.php'; $getMetaDataFile = 'custom/modules/Realty/metadata/editviewdefs.php'; } else { $getMetaDataFile = 'custom/modules/Realty/metadata/editviewdefs.php'; } return $getMetaDataFile; }
function display() { if (isset($this->bean->id)) { $this->ss->assign("FILE_OR_HIDDEN", "hidden"); if (empty($_REQUEST['isDuplicate']) || $_REQUEST['isDuplicate'] == 'false') { $this->ss->assign("DISABLED", "disabled"); } } else { $this->ss->assign("FILE_OR_HIDDEN", "file"); } parent::display(); }
function display() { if (is_admin($GLOBALS['current_user'])) { $json = getJSONobj(); require_once 'include/QuickSearchDefaults.php'; $qsd = new QuickSearchDefaults(); $sqs_objects = array('EditView_reports_to_name' => $qsd->getQSUser()); $sqs_objects['EditView_reports_to_name']['populate_list'] = array('reports_to_name', 'reports_to_id'); $quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>'; $this->ss->assign('REPORTS_TO_JS', $quicksearch_js); $this->ss->assign('EDIT_REPORTS_TO', true); } parent::display(); }
function display() { global $mod_strings, $app_strings, $app_list_strings, $sugar_config, $beanFiles; $this->ss->assign("MOD", $mod_strings); $this->ss->assign("APP_LIST", $app_list_strings); // Init default name $this->bean->name = '[TILK] '; // IF THE TILK IS CREATED FROM AN CONTACT if (isset($_REQUEST['CreateFromContact']) && $_REQUEST['CreateFromContact'] == 'true') { // CREATE DEFAULT TILK LINK WITH CONTACT require_once $beanFiles['Contact']; $link_contact = new Contact(); $link_contact->retrieve($_REQUEST['return_id']); $this->bean->contacts_id = $link_contact->id; $this->bean->contacts_name = $link_contact->name; $this->bean->contact_email = $link_contact->emailAddress->getPrimaryAddress($link_contact); $this->bean->name = '[TILK] ' . $link_contact->name; //$this->bean->id = $this->bean->save(); $_REQUEST['record'] = $this->bean->id; // TILKEE API - CREATE PROJECT AND SYNCH IT } // IF THE TILK IS CREATED FROM AN LEAD if (isset($_REQUEST['CreateFromLead']) && $_REQUEST['CreateFromLead'] == 'true') { // CREATE DEFAULT TILK LINK WITH LEAD require_once $beanFiles['Lead']; $link_lead = new Lead(); $link_lead->retrieve($_REQUEST['return_id']); $this->bean->leads_name = $link_lead->name; $this->bean->leads_id = $link_lead->id; $this->bean->contact_email = $link_lead->emailAddress->getPrimaryAddress($link_lead); $this->bean->name = '[TILK] ' . $link_lead->name; //$this->bean->id = $this->bean->save(); $_REQUEST['record'] = $this->bean->id; // TILKEE API - CREATE PROJECT AND SYNCH IT } // IF THE TILK IS CREATED FROM AN PROJECT if (isset($_REQUEST['CreateFromProject']) && $_REQUEST['CreateFromProject'] == 'true') { // CREATE DEFAULT TILK LINK WITH PROJECT require_once $beanFiles['TILKEE_PROJECTS']; $link_tilkee_project = new TILKEE_PROJECTS(); $link_tilkee_project->retrieve($_REQUEST['return_id']); $this->bean->tilkee_projects_name = $link_tilkee_project->name; $this->bean->tilkee_projects_id = $link_tilkee_project->id; //$this->bean->id = $this->bean->save(); $_REQUEST['record'] = $this->bean->id; // TILKEE API - CREATE PROJECT AND SYNCH IT } parent::display(); }
public function getMetaDataFile() { $userType = 'Regular'; if ($this->fieldHelper->usertype == 'GROUP') { $userType = 'Group'; } if ($userType != 'Regular') { $oldType = $this->type; $this->type = $oldType . 'group'; } $metadataFile = parent::getMetaDataFile(); if ($userType != 'Regular') { $this->type = $oldType; } return $metadataFile; }
function zd_TicketsViewEdit() { parent::ViewEdit(); if ($_REQUEST['return_module'] && $_REQUEST['return_id']) { $this->requesters = array(); switch ($_REQUEST['return_module']) { case 'Accounts': $this->referrer = new Account(); $this->referrer->retrieve($_REQUEST['return_id']); $count = 0; foreach ($this->referrer->get_contacts() as $contact) { $this->requesters[$contact->email1] = $contact->name; } break; case 'Leads': $this->referrer = new Lead(); $this->referrer->retrieve($_REQUEST['return_id']); $this->requesters = array($this->referrer->email1 => $this->referrer->name); break; case 'Contacts': $this->referrer = new Contact(); $this->referrer->retrieve($_REQUEST['return_id']); $this->requesters = array($this->referrer->email1 => $this->referrer->name); break; case 'Opportunities': $this->referrer = new Opportunity(); $this->referrer->retrieve($_REQUEST['return_id']); $this->referrer->load_relationship('contacts'); $query_array = $this->referrer->contacts->getQuery(true); $query_array['select'] = "SELECT contacts.id, contacts.first_name, contacts.last_name, contacts.title, contacts.phone_work, opportunities_contacts.contact_role as opportunity_role, opportunities_contacts.id as opportunity_rel_id "; $query = ''; foreach ($query_array as $qstring) { $query .= ' ' . $qstring; } $temp = array('id', 'first_name', 'last_name', 'title', 'phone_work', 'opportunity_role', 'opportunity_rel_id'); $contacts = $this->referrer->build_related_list2($query, new Contact(), $temp); foreach ($contacts as $contact) { $contact->retrieve(); $this->requesters[$contact->email1] = $contact->name; } break; } if (sizeof($this->requesters) == 0) { $this->requesters = array($this->referrer->email1 => $this->referrer->name); } } }
/** * @see SugarView::display() */ public function display() { global $beanFiles; require_once $beanFiles['ProjectTask']; $focus = BeanFactory::getBean('ProjectTask'); if (isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } $this->ss->assign('resource', $focus->getResourceName()); if (isset($_REQUEST['fromGrid']) && $_REQUEST['fromGrid'] == '1') { $this->ss->assign('project_id', $focus->project_id); $this->ss->assign('FROM_GRID', true); } else { $this->ss->assign('FROM_GRID', false); } parent::display(); }