Exemplo n.º 1
0
<?php

//ini_set('display_errors',1);
$case = new cases();
$global_tasks = new GlobalTask();
$sql = $case->search_query(array('case_id' => $options['case_id']));
$array = $this->db->fetch_assoc($this->db->query($sql));
$array['tasks'] = array();
$tasks = $global_tasks->search_flow_chart_tasks(array('module' => 'cases', 'module_id' => $options['case_id']));
foreach ($tasks as $n => $v) {
    //$v['name'] = $v['subject'];
    $v['task_type'] = 'global_task';
    $v['task_id'] = $v['chart_assign_id'];
    $v['access'] = $global_tasks->check_permitions($v);
    $v['options'] = $global_tasks->get_flowchart_options($v['flow_chart_id']);
    $array['tasks'][] = $v;
}
$array['activity'] = $this->get_activity_log_by_module('cases', $options['case_id']);
$array['followers'] = $this->follow->get_followers_by_module('cases', $options['case_id']);
if (array_key_exists($_SESSION['user_id'], $array['followers'])) {
    $array['following'] = true;
} else {
    $array['following'] = false;
}
$time = new TimeTracker();
$time->setModuleName('cases');
$time->setModuleID($options['case_id']);
$array['time'] = array();
$array['time']['entries'] = $time->getTimeEntries();
$array['time']['open'] = $time->getOpenEntryId($array['time']['entries']);
Exemplo n.º 2
0
$contacts = new contacts();
//$sql = $case->search_query( array('case_id' => $options['case_id'] ) );
$sql = "SELECT * FROM contacts WHERE contact_id = '" . $options['contact_id'] . "'";
$array = $this->db->fetch_assoc($this->db->query($sql));
$array['tasks'] = array();
$tasks = $global_tasks->search_flow_chart_tasks(array('module' => 'contacts', 'module_id' => $options['contact_id']));
foreach ($tasks as $n => $v) {
    //$v['name'] = $v['subject'];
    $v['task_type'] = 'global_task';
    $v['task_id'] = $v['chart_assign_id'];
    $v['access'] = $global_tasks->check_permitions($v);
    $v['options'] = $global_tasks->get_flowchart_options($v['flow_chart_id']);
    $array['tasks'][] = $v;
}
$array['activity'] = $this->get_activity_log_by_module('contacts', $options['contact_id']);
$array['followers'] = $this->follow->get_followers_by_module('contacts', $options['contact_id']);
$array['phone'] = $contacts->get_contact_phone($options['contact_id']);
$array['email'] = $contacts->get_contact_email($options['contact_id']);
$array['address'] = $contacts->get_contact_address($options['contact_id']);
$array['im'] = $contacts->get_contact_im($options['contact_id']);
if (array_key_exists($_SESSION['user_id'], $array['followers'])) {
    $array['following'] = true;
} else {
    $array['following'] = false;
}
$sql = $case->search_query(array('module_name' => 'contacts', 'module_id' => $options['contact_id']));
$result = $this->db->query($sql);
$array['cases'] = array();
while ($row = $this->db->fetch_assoc($result)) {
    $array['cases'][] = $row;
}
Exemplo n.º 3
0
<?php

$case = new cases();
$search = array();
//I did it this way to allow alias's
$avalible_keys = array('case_id' => 'case_id', 'group_id' => 'group_id', 'module_name' => 'module_name', 'subject' => 'subject', 'OrderNumber' => 'OrderNumber', 'module_id' => 'module_id', 'contact_module_id' => 'contact_module_id', 'contact_module_name' => 'contact_module_name', 'TicketNumber' => 'TicketNumber', 'Title' => 'Title', 'CreatedOn_min' => 'CreatedOn_min', 'CreatedOn_max' => 'CreatedOn_max', 'CaseType' => 'CaseType', 'Priority' => 'Priority', 'Owner' => 'Owner', 'owner' => 'Owner', 'Status' => 'Status', 'status' => 'Status', 'CaseOrigin' => 'CaseOrigin', 'client_name' => 'client_name', 'client_id' => 'client_id', 'no_account' => 'no_account', 'search' => 'search');
foreach ($options as $n => $v) {
    if (array_key_exists($n, $avalible_keys)) {
        $search[$avalible_keys[$n]] = $v;
    }
    switch ($n) {
        case 'self':
            if ($v == 'true') {
                $search['Owner'] = $_SESSION['user_id'];
            }
            break;
    }
}
$sql = $case->search_query($search);
$result = $this->db->query($sql);
while ($row = $this->db->fetch_assoc($result)) {
    $array[] = $row;
}
//$array=array('sql' => $sql);