Example #1
0
 public function delete($id)
 {
     $status = Response::STATUS_NOT_FOUND;
     $data = array();
     if ($this->getCallRequest($id) && fn_delete_call_request($id)) {
         $status = Response::STATUS_NO_CONTENT;
     }
     return array('status' => $status, 'data' => $data);
 }
Example #2
0
        if (!empty($_REQUEST['call_requests'])) {
            foreach ($_REQUEST['call_requests'] as $request_id => $request) {
                fn_update_call_request($request, $request_id);
            }
        }
    }
    if ($mode == 'm_delete') {
        if (!empty($_REQUEST['request_ids'])) {
            foreach ($_REQUEST['request_ids'] as $request_id) {
                fn_delete_call_request($request_id);
            }
        }
    }
    if ($mode == 'delete') {
        if ($_REQUEST['request_id']) {
            fn_delete_call_request($_REQUEST['request_id']);
        }
    }
    if ($mode == 'update_status') {
        if (!empty($_REQUEST['id']) && !empty($_REQUEST['status'])) {
            db_query("UPDATE ?:call_requests SET status = ?s WHERE request_id = ?i", $_REQUEST['status'], $_REQUEST['id']);
            fn_set_notification('N', __('notice'), __('status_changed'));
        }
        if (empty($_REQUEST['return_url'])) {
            exit;
        } else {
            return array(CONTROLLER_STATUS_REDIRECT, $_REQUEST['return_url']);
        }
    }
    return array(CONTROLLER_STATUS_OK, 'call_requests.manage');
}