session_start();
include_once '../../../../../wp-config.php';
include_once '../../functions.php';
$type = isset($_POST['object_type']) ? trim($_POST['object_type']) : "";
$object_id = isset($_POST['object_id']) ? trim($_POST['object_id']) : "";
$parent_obj_type = isset($_POST['parent_obj_type']) ? trim($_POST['parent_obj_type']) : "";
$view = isset($_POST['view']) ? trim($_POST['view']) : "";
$pageNum = isset($_POST['PageNum']) ? trim($_POST['PageNum']) : 1;
$page_size = isset($_POST['length']) ? trim($_POST['length']) : 1;
$field = isset($_POST['field']) ? trim($_POST['field']) : "Name";
$sort_type = isset($_POST['sort_type']) ? trim($_POST['sort_type']) : "";
$alpha_type = isset($_POST['alpha_type']) ? trim($_POST['alpha_type']) : "";
list($access_token, $instance_url) = get_connection_sales();
/** Integrate the salesforce **/
list($access_token, $instance_url) = get_connection_sales();
global $login_time_url;
$url = $instance_url . $login_time_url;
$object_array = array("method" => "getObjectDetails", "Type" => $type);
if ($pageNum !== "") {
    $object_array['PageNo'] = $pageNum;
    $object_array['PageSize'] = $page_size;
}
if ($field != "" && $sort_type != "") {
    $object_array['FldName'] = $field;
    $object_array['Srt'] = strtoupper($sort_type);
}
if ($alpha_type != "") {
    $object_array['chr'] = strtolower($alpha_type);
}
global $user_ID;
Exemple #2
0
/**
 * Get the tabs list
 * @name get_tabs_from_sale
 * @global string $tab_url
 * @return array
 */
function get_tabs_from_sales()
{
    global $tab_url;
    list($access_token, $instance_url) = get_connection_sales();
    $url = $instance_url . $tab_url;
    $json_response = connects_salesforce($url, array(), FALSE, $access_token, "get");
    $response = json_decode($json_response);
    $response = (array) json_decode($response);
    return $response;
}