Ejemplo n.º 1
0
function searchTicketsFormSubmit($searchFormValue, $numRows, $limit, $id = '', $type = '')
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $searchType = array();
    $customerid = $searchFormValue['customerid'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索内容 数组
    $searchField = $searchFormValue['searchField'];
    //搜索条件 数组
    $searchType = $searchFormValue['searchType'];
    //搜索方式 数组
    $divName = "formCurTickets";
    $html = Table::Top($locate->Translate("My Tickets"), "formCurTickets");
    $accountid = Customer::getAccountid();
    /*if($type == "delete"){
    		$res = Customer::deleteRecord($id,'account');
    		if ($res){
    			$html = Customer::createRecordsGrid($customerid,$searchFormValue['numRows'], $searchFormValue['limit'],$searchField, $searchContent, $searchField, $divName, "");
    			$objResponse = new xajaxResponse();
    			$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec")); 
    		}else{
    			$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete")); 
    		}
    	}else{*/
    $html .= astercrm::createTikcetGrid($accountid, 'agent_tickets', $numRows, $limit, $searchField, $searchContent, $searchField[count($searchField) - 1], $divName, "", $searchType);
    //}
    $html .= Table::Footer();
    $objResponse->addAssign($divName, "innerHTML", $html);
    return $objResponse->getXML();
}
Ejemplo n.º 2
0
function updateCurTicket($f)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    if (trim($f['ticketcategoryid']) == 0 || trim($f['ticketid']) == 0 || trim($f['customerid']) == 0) {
        $objResponse->addAlert($locate->Translate("obligatory_fields"));
        return $objResponse->getXML();
    }
    $validParentTicket = true;
    if ($f['parent_id'] != '') {
        if (!preg_match('/^[\\d]*$/', $f['parent_id'])) {
            $objResponse->addAlert($locate->Translate("Parent TicketDetail ID must be integer"));
            return $objResponse->getXML();
        }
        //验证写入的parent_id 是否存在
        $validParentTicket = Customer::validParentTicketId($f['parent_id']);
    }
    $oriResult = Customer::getOriResult($f['id']);
    $respOk = Customer::updateCurTicket($f);
    $accountid = Customer::getAccountid();
    if ($respOk) {
        if (!$validParentTicket) {
            $objResponse->addAlert($locate->Translate("Update Success,but Parent TicketDetail ID is not exists"));
        }
        $new_assign = '';
        if ($f['assignto'] != 0) {
            $new_assign = Customer::getAssignToName($f['assignto']);
        }
        $ori_assign = '';
        if ($oriResult['assignto'] != 0) {
            $ori_assign = Customer::getAssignToName($oriResult['assignto']);
        }
        // track the ticket_op_logs
        if ($oriResult['status'] != $f['status']) {
            Customer::ticketOpLogs('update', 'status', $oriResult['status'], $f['status'], $new_assign, $f['groupid']);
        }
        if ($oriResult['assignto'] != $f['assignto']) {
            Customer::ticketOpLogs('update', 'assignto', $ori_assign, $new_assign, $new_assign, $f['groupid']);
        }
        $html = Table::Top($locate->Translate("My Tickets"), "formCurTickets");
        $html .= astercrm::createTikcetGrid($accountid, 'agent_tickets', 0, ROWSXPAGE, '', '', '', 'formCurTickets');
        $html .= Table::Footer();
        $objResponse->addAssign("formCurTickets", "innerHTML", $html);
        $objResponse->addAssign("formCurTickets", "style.visibility", "visible");
        $objResponse->addAssign("formCurTickets", "innerHTML", $html);
        $objResponse->addAssign("formTicketDetailDiv", "style.visibility", "hidden");
        $objResponse->addAssign("formTicketDetailDiv", "innerHTML");
    } else {
        $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_update"));
    }
    return $objResponse->getXML();
}
Ejemplo n.º 3
0
function AllTicketOfMy($cid = '', $Ctype, $start = 0, $limit = 5, $filter = null, $content = null, $order = null, $divName = "formMyTickets", $ordering = "", $stype = null)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $ticketHtml = Table::Top($locate->Translate("Customer Tickets"), "formMyTickets");
    $ticketHtml .= astercrm::createTikcetGrid($cid, $Ctype, $start, $limit, $filter, $content, $order, $divName, $ordering, $stype);
    $ticketHtml .= Table::Footer();
    $objResponse->addAssign("formMyTickets", "style.visibility", "visible");
    $objResponse->addAssign("formMyTickets", "innerHTML", $ticketHtml);
    return $objResponse->getXML();
}