Exemplo n.º 1
0
 function getCounters()
 {
     $this->wrap(self::STATUS_OK, getAllCounters());
 }
Exemplo n.º 2
0
 function getAllCounters()
 {
     $last_article_id = (int) $_REQUEST["last_article_id"];
     $reply = array();
     if ($seq) {
         $reply['seq'] = $seq;
     }
     if ($last_article_id != getLastArticleId($this->link)) {
         $omode = $_REQUEST["omode"];
         if ($omode != "T") {
             $reply['counters'] = getAllCounters($this->link, $omode);
         } else {
             $reply['counters'] = getGlobalCounters($this->link);
         }
     }
     $reply['runtime-info'] = make_runtime_info($this->link);
     print json_encode($reply);
 }
Exemplo n.º 3
0
<?php

$action = isset($_GET['action']) ? G::sanitizeInput($_GET['action']) : 'default';
G::LoadClass('case');
G::LoadClass('configuration');
$userId = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '00000000000000000000000000000000';
switch ($action) {
    case 'getAllCounters':
        getAllCounters();
        break;
    case 'getProcess':
        getProcess();
        break;
    default:
        //this is the starting call
        getLoadTreeMenuData();
        break;
}
function getLoadTreeMenuData()
{
    header("content-type: text/xml");
    global $G_TMP_MENU;
    $oMenu = new Menu();
    $oMenu->load('cases');
    $oCases = new Cases();
    $aTypes = array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed', 'selfservice');
    //'to_revise',
    //'to_reassign'
    $aTypesID = array('CASES_INBOX' => 'to_do', 'CASES_DRAFT' => 'draft', 'CASES_CANCELLED' => 'cancelled', 'CASES_SENT' => 'sent', 'CASES_PAUSED' => 'paused', 'CASES_COMPLETED' => 'completed', 'CASES_SELFSERVICE' => 'selfservice');
    //'CASES_TO_REVISE'=>'to_revise',
    //'CASES_TO_REASSIGN'=>'to_reassign'
Exemplo n.º 4
0
 function getCounters()
 {
     /* flct (flc is the default) FIXME: document */
     $output_mode = db_escape_string($_REQUEST["output_mode"]);
     print $this->wrap(self::STATUS_OK, getAllCounters($this->link, $output_mode));
 }
Exemplo n.º 5
0
         }
         print "</articles>";
     }
     if ($_REQUEST["debug"]) {
         $timing_info = print_checkpoint("20", $timing_info);
     }
     //			if (get_pref($link, "SYNC_COUNTERS") ||
     //					time() - $_SESSION["get_all_counters_stamp"] > $viewfeed_ctr_interval) {
     //				print "<counters>";
     //				getAllCounters($link, $omode, $feed);
     //				print "</counters>";
     //			}
     if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop || time() - $_SESSION["viewfeed:counters_stamp"] > 5) {
         if (!$offset) {
             print "<counters>";
             getAllCounters($link, $omode, $feed);
             print "</counters>";
             $_SESSION["viewfeed:counters_stamp"] = time();
         }
     }
     if ($_REQUEST["debug"]) {
         $timing_info = print_checkpoint("30", $timing_info);
     }
     print_runtime_info($link);
     print "</reply>";
     break;
     // viewfeed
 // viewfeed
 case "pref-feeds":
     module_pref_feeds($link);
     break;
Exemplo n.º 6
0
 function getAllCounters()
 {
     $last_article_id = (int) $_REQUEST["last_article_id"];
     $reply = array();
     if (!empty($_REQUEST['seq'])) {
         $reply['seq'] = (int) $_REQUEST['seq'];
     }
     if ($last_article_id != getLastArticleId()) {
         $reply['counters'] = getAllCounters();
     }
     $reply['runtime-info'] = make_runtime_info();
     print json_encode($reply);
 }
Exemplo n.º 7
0
 function getCounters()
 {
     print $this->wrap(self::STATUS_OK, getAllCounters($this->link));
 }
Exemplo n.º 8
0
     break;
 case "getUnread":
     $feed_id = db_escape_string($_REQUEST["feed_id"]);
     $is_cat = db_escape_string($_REQUEST["is_cat"]);
     if ($feed_id) {
         print api_wrap_reply(API_STATUS_OK, $seq, array("unread" => getFeedUnread($link, $feed_id, $is_cat)));
     } else {
         print api_wrap_reply(API_STATUS_OK, $seq, array("unread" => getGlobalUnread($link)));
     }
     break;
     /* Method added for ttrss-reader for Android */
 /* Method added for ttrss-reader for Android */
 case "getCounters":
     /* flct (flc is the default) FIXME: document */
     $output_mode = db_escape_string($_REQUEST["output_mode"]);
     print api_wrap_reply(API_STATUS_OK, $seq, getAllCounters($link, $output_mode));
     break;
 case "getFeeds":
     $cat_id = db_escape_string($_REQUEST["cat_id"]);
     $unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
     $limit = (int) db_escape_string($_REQUEST["limit"]);
     $offset = (int) db_escape_string($_REQUEST["offset"]);
     $feeds = api_get_feeds($link, $cat_id, $unread_only, $limit, $offset);
     print api_wrap_reply(API_STATUS_OK, $seq, $feeds);
     break;
 case "getCategories":
     $unread_only = (bool) db_escape_string($_REQUEST["unread_only"]);
     $result = db_query($link, "SELECT\n\t\t\t\t\tid, title FROM ttrss_feed_categories\n\t\t\t\tWHERE owner_uid = " . $_SESSION["uid"]);
     $cats = array();
     while ($line = db_fetch_assoc($result)) {
         $unread = getFeedUnread($link, $line["id"], true);