function actionEntry() { header("cache-control: public"); $session = $this->getSession(); $useridS = $session->get('userid_sess'); $roleS = $session->get('role_sess'); $storeid = $session->get('storeid_sess'); $page = $this->get('page', 1); $limit = 50; $MUser = $this->LoadApiModelMedical('user'); // exit; $exArr = array('page' => $page, 'limit' => $limit, 'fields' => '*'); $whArr = array('storeid' => $storeid); //处理过滤条件 // $this->_set_query_where($whArr); $this->assign_query_where($whArr, "role,or:(username%.email%.mobile):username"); //end 处理过滤条件 $exArr['order'] = 'id desc'; $exArr['join_wx'] = true; $dataArr = $MUser->getUsers(null, $whArr, $exArr); $userArr = $dataArr['data']; $total = $dataArr['total']; $privilegesArr = $this->getPrivileges(); $departmentArr = $this->getDepartment(); $tree = new CTree(); $departmentArr = $tree->treeToDimensions($departmentArr); $dutyArr = $this->getDuty(); $pager = CPager::APager($page, $total, $limit); $this->assign('userArr', $userArr); $this->assign('total', $total); $this->assign('pager', $pager); $message = $session->flushMessage(); $this->assign('message', $message); $this->assign('privilegesArr', $privilegesArr); $this->assign('departmentArr', $departmentArr); $this->assign('dutyArr', $dutyArr); $this->assign('current', 'list'); $this->getize(); $this->display('user'); }
/** * Returns a column object for the given row and field. Add additional service tree related formatting. * * @param $rowId * @param $colName * * @return CCol */ protected function makeCol($rowId, $colName) { $class = null; if ($colName == 'status' && zbx_is_int($this->tree[$rowId][$colName]) && $this->tree[$rowId]['id'] > 0) { $status = $this->tree[$rowId][$colName]; // do not show the severity for information and unclassified triggers if (in_array($status, array(TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_NOT_CLASSIFIED))) { $this->tree[$rowId][$colName] = new CSpan(_('OK'), 'green'); } else { $this->tree[$rowId][$colName] = getSeverityCaption($status); $class = getSeverityStyle($status); } } $col = parent::makeCol($rowId, $colName); $col->addClass($class); return $col; }
// +++ Create node tree +++ $combo_check_all = new CCheckbox('check_all_nodes', null, "javascript : check_all('node_form', this.checked);"); $node_tree = array(); $node_tree[0] = array('id' => 0, 'caption' => S_ALL_S, 'combo_select_node' => $combo_check_all, 'parentid' => 0); //root foreach ($available_nodes as $num => $node) { $checked = uint_in_array($node['nodeid'], $ZBX_VIEWED_NODES['nodeids']); $combo_select_node = new CCheckbox('selected_nodes[' . $node['nodeid'] . ']', $checked, null, $node['nodeid']); // If not exist parent for node, link it to root (0) if (!isset($available_nodes[$node['masterid']])) { $node['masterid'] = 0; } $node_tree[$node['nodeid']] = array('id' => $node['nodeid'], 'caption' => $node['name'], 'combo_select_node' => $combo_select_node, 'parentid' => $node['masterid']); } $node_tree_captions = array('caption' => bold(S_NODE), 'combo_select_node' => SPACE); $node_tree = new CTree('nodes', $node_tree, $node_tree_captions); // --- --- $div_node_tree = new CDiv(); $div_node_tree->additem($node_tree->getHTML()); $div_node_tree->additem(new CButton('select_nodes', S_SELECT, "javascript: " . " hidePopupDiv('select_iframe');" . " \$('div_node_tree').setStyle({display:'none'});")); $div_node_tree->setAttribute('id', 'div_node_tree'); $div_node_tree->addStyle('display: none'); if (!is_null($combo_node_list)) { $node_form->addItem(array(new CSpan(S_CURRENT_NODE, 'textcolorstyles'), $combo_node_list)); } $node_form->addItem($button_show_tree); $node_form->addItem($div_node_tree); unset($combo_node_list); } } // 1st level menu
if (isset($row['serviceupid'])) { $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0); } if (isset($row['servicedownid'])) { $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']); } } $treeServ = array(); createServiceTree($services, $treeServ); //return into $treeServ parametr //permission issue $treeServ = del_empty_nodes($treeServ); //---- if (isset($_REQUEST['msg']) && !empty($_REQUEST['msg'])) { show_messages(true, $_REQUEST['msg']); } //show_table_header(S_IT_SERVICES_BIG); $tree = new CTree('service_conf_tree', $treeServ, array('caption' => bold(S_SERVICE), 'algorithm' => bold(S_STATUS_CALCULATION), 'description' => bold(S_TRIGGER))); if ($tree) { $serv_wdgt = new CWidget(); $serv_wdgt->addHeader(S_IT_SERVICES_BIG, SPACE); $serv_wdgt->addItem($tree->getHTML()); $serv_wdgt->show(); } else { error(S_CANT_FORMAT_TREE); } $tr_ov_menu[] = array('test1', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader'))); $tr_ov_menu[] = array('test2', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader'))); $jsmenu = new CPUMenu($tr_ov_menu, 170); $jsmenu->InsertJavaScript(); include_once "include/page_footer.php";
if (isset($services[$row['serviceid']])) { $services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row); } else { $services[$row['serviceid']] = $row; } if (isset($row['serviceupid'])) { $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0); } if (isset($row['servicedownid'])) { $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']); } } $treeServ = array(); createShowServiceTree($services, $treeServ); //return into $treeServ parametr //permission issue $treeServ = del_empty_nodes($treeServ); $tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH))); if ($tree) { $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); $tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1)); $tab->Show(); unset($tab); } else { error('Can not format Tree. Check logik structure in service links'); } } include_once "include/page_footer.php";
} else { $services[$row['serviceid']] = $row; } if (isset($row['serviceupid'])) { $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0); } if (isset($row['servicedownid'])) { $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']); } } $treeServ = array(); createShowServiceTree($services, $treeServ); //return into $treeServ parametr //permission issue $treeServ = del_empty_nodes($treeServ); $tree = new CTree('service_status_tree', $treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold('SLA (' . $periods[$period_start] . ')'), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH))); if ($tree) { // creates form for choosing a preset interval $r_form = new CForm(); $r_form->setClass('nowrap'); $r_form->setMethod('get'); $r_form->setAttribute('name', 'period_choice'); $r_form->addVar('fullscreen', $_REQUEST['fullscreen']); $period_combo = new CComboBox('period_start', $period_start, 'javascript: submit();'); foreach ($periods as $key => $val) { $period_combo->AddItem($key, $val); } $r_form->AddItem(array(S_PERIOD, $period_combo)); $url = '?period_start=' . $period_start . '&fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->setAttribute('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);