public function testget_summary_text() { $aclRole = new ACLRole(); //test with name attribute set and verify it returns expected value. //it works only if name attribute is preset, throws exception otherwise $aclRole->name = 'test role'; $name = $aclRole->get_summary_text(); $this->assertEquals('test role', $name); }
unset($categories2[$v]); } } if (!empty($names)) { $tdwidth = 100 / sizeof($names); } $sugar_smarty->assign('ROLE', $role->toArray()); //xye customization begin $sugar_smarty->assign("CHECKED", $role->enablesoftphone ? "checked" : ""); //xye customization end $sugar_smarty->assign('CATEGORIES', $categories); $sugar_smarty->assign('CATEGORIES2', $categories2); $sugar_smarty->assign('TDWIDTH', $tdwidth); $sugar_smarty->assign('ACTION_NAMES', $names); $return = array('module' => 'ACLRoles', 'action' => 'DetailView', 'record' => $role->id); $sugar_smarty->assign('RETURN', $return); $params = array(); $params[] = "<a href='index.php?module=ACLRoles&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; $params[] = $role->get_summary_text(); echo getClassicModuleTitle("ACLRoles", $params, true); //$sugar_smarty->assign('TITLE', $title); $hide_hide_supanels = true; //xye customization begin echo $sugar_smarty->fetch('custom/modules/ACLRoles/DetailView.tpl'); //xye customization end //for subpanels the variable must be named focus; $focus =& $role; $_REQUEST['module'] = 'ACLRoles'; require_once 'include/SubPanel/SubPanelTiles.php'; $subpanel = new SubPanelTiles($role, 'ACLRoles'); echo $subpanel->display();
$tdwidth = 10; if (isset($_REQUEST['return_module'])) { $return['module'] = $_REQUEST['return_module']; if (isset($_REQUEST['return_id'])) { $return['record'] = $_REQUEST['return_id']; } if (isset($_REQUEST['return_record'])) { $return['record'] = $_REQUEST['return_record']; } if (isset($_REQUEST['return_action'])) { $return['action'] = $_REQUEST['return_action']; } if (!empty($return['record'])) { $return['action'] = 'DetailView'; } } $sugar_smarty->assign('RETURN', $return); $names = ACLAction::setupCategoriesMatrix($categories); $sugar_smarty->assign('CATEGORIES', $categories); $sugar_smarty->assign('TDWIDTH', $tdwidth); $sugar_smarty->assign('ACTION_NAMES', $names); $params = array(); $params[] = "<a href='index.php?module=ACLRoles&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; if (empty($role->id)) { $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']; } else { $params[] = "<a href='index.php?module=ACLRoles&action=DetailView&record={$role->id}'>" . $role->get_summary_text() . "</a>"; $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; } echo getClassicModuleTitle("ACLRoles", $params, true); echo $sugar_smarty->fetch('modules/ACLRoles/EditView.tpl');