Exemplo n.º 1
0
            if ($newTimezone != $hTimezone) {
                $params = array('contactId' => $contactId, 'textType' => '0', 'timezone' => $newTimezone * 60);
                $resp = monitisClientApi::editContact($params, $userid);
                if ($resp["status"] == 'ok') {
                    monitisClientUi::successMessage('Contact timezone updated');
                    $hTimezone = $newTimezone;
                } else {
                    monitisClientUi::errorMessage($resp['error']);
                }
            }
            break;
    }
}
if ($userid > 0) {
    $oService = new monitisClientUi();
    $monitors = $oService->clientProductMonitors($userid);
    if ($monitors) {
        /* all user's notification rules */
        $alerts = monitisClientApi::getNotificationRules(array('monitorType' => 'external'), $userid);
        /* default notification rule - type "All" */
        $allAlert = MonitisHelper::in_array($alerts, 'monitorId', 'All');
        $rule = '';
        $allRuleid = 0;
        $allContactId = 0;
        if ($allAlert) {
            $rule = $allAlert['rule'];
            $allRuleid = $allAlert['id'];
            $allContactId = $allAlert['contactId'];
        } else {
            $rule = MONITIS_NOTIFICATION_RULE;
        }