예제 #1
0
$dashForm = new CFormTable(S_FILTER);
$dashForm->addVar('form_refresh', 1);
$dashForm->setName('dashconf');
$dashForm->setAttribute('id', 'dashform');
if (isset($_REQUEST['form_refresh'])) {
    $filterEnable = get_request('filterEnable', 0);
    $groupids = get_request('groupids', array());
    $groupids = zbx_toHash($groupids);
    $grpswitch = get_request('grpswitch', 0);
    $maintenance = get_request('maintenance', 0);
    $extAck = get_request('extAck', 0);
    $severity = get_request('trgSeverity', array());
    $severity = array_keys($severity);
} else {
    $filterEnable = CProfile::get('web.dashconf.filter.enable', 0);
    $groupids = get_favorites('web.dashconf.groups.groupids');
    $groupids = zbx_objectValues($groupids, 'value');
    $groupids = zbx_toHash($groupids);
    $grpswitch = CProfile::get('web.dashconf.groups.grpswitch', 0);
    $maintenance = CProfile::get('web.dashconf.hosts.maintenance', 1);
    $extAck = CProfile::get('web.dashconf.events.extAck', 0);
    $severity = CProfile::get('web.dashconf.triggers.severity', '0;1;2;3;4;5');
    $severity = zbx_empty($severity) ? array() : explode(';', $severity);
}
$dashForm->addVar('filterEnable', $filterEnable);
if ($filterEnable) {
    $cbFilter = new CSpan(S_ENABLED, 'green underline pointer');
    $cbFilter->setAttribute('onclick', "create_var('" . $dashForm->getName() . "', 'filterEnable', 0, true);");
} else {
    $cbFilter = new CSpan(S_DISABLED, 'red underline pointer');
    $cbFilter->setAttribute('onclick', "\$('dashform').enable(); create_var('" . $dashForm->getName() . "', 'filterEnable', 1, true);");
예제 #2
0
function infavorites($favobj, $favid, $source = null)
{
    $favorites = get_favorites($favobj);
    if (!empty($favorites)) {
        foreach ($favorites as $id => $favorite) {
            if (bccomp($favid, $favorite['value']) == 0) {
                if (is_null($source) || $favorite['source'] == $source) {
                    return true;
                }
            }
        }
    }
    return false;
}
예제 #3
0
function make_screen_submenu()
{
    $screenids = array();
    $fav_screens = get_favorites('web.favorite.screenids');
    foreach ($fav_screens as $key => $favorite) {
        $source = $favorite['source'];
        $sourceid = $favorite['value'];
        if ('slideshowid' == $source) {
            if (!($slide = get_slideshow_by_slideshowid($sourceid))) {
                continue;
            }
            $slide_added = true;
            $screenids[] = array('name' => $slide['name'], 'favobj' => 'slideshowid', 'favid' => $sourceid, 'action' => 'remove');
        } else {
            if (!($screen = get_screen_by_screenid($sourceid))) {
                continue;
            }
            $screen_added = true;
            $screenids[] = array('name' => $screen['name'], 'favobj' => 'screenid', 'favid' => $sourceid, 'action' => 'remove');
        }
    }
    if (isset($screen_added)) {
        $screenids[] = array('name' => S_REMOVE . SPACE . S_ALL_S . SPACE . S_SCREENS, 'favobj' => 'screenid', 'favid' => 0, 'action' => 'remove');
    }
    if (isset($slide_added)) {
        $screenids[] = array('name' => S_REMOVE . SPACE . S_ALL_S . SPACE . S_SLIDES, 'favobj' => 'slideshowid', 'favid' => 0, 'action' => 'remove');
    }
    return $screenids;
}
예제 #4
0
            access_deny();
        }
    }
}
$_REQUEST['go'] = get_request('go', 'none');
/*
 * Filter
 */
$options = array('groups' => array('real_hosts' => true, 'not_proxy_hosts' => true, 'editable' => true), 'hosts' => array('editable' => true), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null));
$pageFilter = new CPageFilter($options);
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = $pageFilter->hostid;
/*
 * Actions
 */
$_REQUEST['applications'] = get_request('applications', get_favorites('web.httpconf.applications'));
$_REQUEST['applications'] = zbx_objectValues($_REQUEST['applications'], 'value');
$showAllApps = null;
if (isset($_REQUEST['open'])) {
    if (!isset($_REQUEST['applicationid'])) {
        $_REQUEST['applications'] = array();
        $showAllApps = 1;
    } elseif (!uint_in_array($_REQUEST['applicationid'], $_REQUEST['applications'])) {
        array_push($_REQUEST['applications'], $_REQUEST['applicationid']);
    }
} elseif (isset($_REQUEST['close'])) {
    if (!isset($_REQUEST['applicationid'])) {
        $_REQUEST['applications'] = array();
    } elseif (($i = array_search($_REQUEST['applicationid'], $_REQUEST['applications'])) !== false) {
        unset($_REQUEST['applications'][$i]);
    }
예제 #5
0
    require_once QISHI_ROOT_PATH . 'include/page.class.php';
    $perpage = 10;
    $joinsql = " LEFT JOIN  " . table('resume') . " AS r ON  f.resume_id=r.id ";
    $wheresql = " WHERE f.company_uid='{$_SESSION['uid']}' ";
    $settr = intval($_GET['settr']);
    if ($settr > 0) {
        $settr_val = strtotime("-" . $settr . " day");
        $wheresql .= " AND f.favoritesa_ddtime>" . $settr_val;
    }
    $total_sql = "SELECT COUNT(*) AS num FROM " . table('company_favorites') . " AS f " . $wheresql;
    $total_val = $db->get_total($total_sql);
    $page = new page(array('total' => $total_val, 'perpage' => $perpage, 'getarray' => $_GET));
    $offset = ($page->nowindex - 1) * $perpage;
    $smarty->assign('title', '企业人才库 - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('act', $act);
    $smarty->assign('favorites', get_favorites($offset, $perpage, $joinsql . $wheresql));
    if ($total_val > $perpage) {
        $smarty->assign('page', $page->show(3));
    }
    $smarty->display('member_company/company_favorites.htm');
} elseif ($act == 'favorites_del') {
    $yid = !empty($_REQUEST['y_id']) ? $_REQUEST['y_id'] : showmsg("你没有选择简历!", 1);
    if ($n = del_favorites($yid, $_SESSION['uid'])) {
        showmsg("删除成功!共删除 {$n} 行", 2);
    } else {
        showmsg("失败!", 0);
    }
} elseif ($act == 'interview_list') {
    require_once QISHI_ROOT_PATH . 'include/page.class.php';
    $perpage = 10;
    $joinsql = " LEFT JOIN " . table('resume') . " as r ON i.resume_id=r.id ";
예제 #6
0
            setlocale(LC_ALL, 'uk_UA.utf8');
            break;
        case 'es':
            setlocale(LC_ALL, 'es_ES.utf8');
            break;
        default:
            setlocale(LC_ALL, 'en_US.utf8');
    }
}
if (isset($_SESSION['user'])) {
    $user = $_SESSION['user'];
}
if (isset($_SESSION['look']) && $_SESSION['look'] != 'admin') {
    $user = $_SESSION['look'];
}
get_favorites();
function get_favorites()
{
    exec(VESTA_CMD . "v-list-user-favourites " . $_SESSION['user'] . " json", $output, $return_var);
    //    $data = json_decode(implode('', $output).'}', true);
    $data = json_decode(implode('', $output), true);
    $data = array_reverse($data, true);
    $favourites = array();
    foreach ($data['Favourites'] as $key => $favourite) {
        $favourites[$key] = array();
        $items = explode(',', $favourite);
        foreach ($items as $item) {
            if ($item) {
                $favourites[$key][trim($item)] = 1;
            }
        }
예제 #7
0
function make_screen_submenu()
{
    $fav_screens = get_favorites('web.favorite.screenids');
    $screenids = array();
    foreach ($fav_screens as $key => $favorite) {
        if ('screenid' == $favorite['source']) {
            $screenids[$favorite['value']] = $favorite['value'];
        }
    }
    $options = array('screenids' => $screenids, 'output' => API_OUTPUT_EXTEND);
    $screens = CScreen::get($options);
    $screens = zbx_toHash($screens, 'screenid');
    $favScreens = array();
    foreach ($fav_screens as $key => $favorite) {
        $source = $favorite['source'];
        $sourceid = $favorite['value'];
        if ('slideshowid' == $source) {
            if (!slideshow_accessible($sourceid, PERM_READ_ONLY)) {
                continue;
            }
            if (!($slide = get_slideshow_by_slideshowid($sourceid))) {
                continue;
            }
            $slide_added = true;
            $favScreens[] = array('name' => $slide['name'], 'favobj' => 'slideshowid', 'favid' => $slide['slideshowid'], 'action' => 'remove');
        } else {
            if (!isset($screens[$sourceid])) {
                continue;
            }
            $screen = $screens[$sourceid];
            $screen_added = true;
            $favScreens[] = array('name' => $screen['name'], 'favobj' => 'screenid', 'favid' => $screen['screenid'], 'action' => 'remove');
        }
    }
    if (isset($screen_added)) {
        $favScreens[] = array('name' => S_REMOVE . SPACE . S_ALL_S . SPACE . S_SCREENS, 'favobj' => 'screenid', 'favid' => 0, 'action' => 'remove');
    }
    if (isset($slide_added)) {
        $favScreens[] = array('name' => S_REMOVE . SPACE . S_ALL_S . SPACE . S_SLIDES, 'favobj' => 'slideshowid', 'favid' => 0, 'action' => 'remove');
    }
    return $favScreens;
}
function make_screen_submenu()
{
    $favScreens = array();
    $fav_screens = get_favorites('web.favorite.screenids');
    if (!$fav_screens) {
        return $favScreens;
    }
    $screenids = array();
    foreach ($fav_screens as $favorite) {
        if ('screenid' == $favorite['source']) {
            $screenids[$favorite['value']] = $favorite['value'];
        }
    }
    $options = array('screenids' => $screenids, 'output' => array('screenid', 'name'));
    $screens = API::Screen()->get($options);
    $screens = zbx_toHash($screens, 'screenid');
    foreach ($fav_screens as $favorite) {
        $source = $favorite['source'];
        $sourceid = $favorite['value'];
        if ('slideshowid' == $source) {
            if (!slideshow_accessible($sourceid, PERM_READ_ONLY)) {
                continue;
            }
            if (!($slide = get_slideshow_by_slideshowid($sourceid))) {
                continue;
            }
            $slide_added = true;
            $favScreens[] = array('name' => $slide['name'], 'favobj' => 'slideshowid', 'favid' => $slide['slideshowid'], 'favaction' => 'remove');
        } else {
            if (!isset($screens[$sourceid])) {
                continue;
            }
            $screen = $screens[$sourceid];
            $screen_added = true;
            $favScreens[] = array('name' => $screen['name'], 'favobj' => 'screenid', 'favid' => $screen['screenid'], 'favaction' => 'remove');
        }
    }
    if (isset($screen_added)) {
        $favScreens[] = array('name' => _('Remove') . ' ' . _('All') . ' ' . _('Screens'), 'favobj' => 'screenid', 'favid' => 0, 'favaction' => 'remove');
    }
    if (isset($slide_added)) {
        $favScreens[] = array('name' => _('Remove') . ' ' . _('All') . ' ' . _('Slides'), 'favobj' => 'slideshowid', 'favid' => 0, 'favaction' => 'remove');
    }
    return $favScreens;
}