Task Status

This commit is contained in:
CHIEFSOFT\ameye
2023-06-10 19:22:50 -04:00
parent 21da8a5c21
commit c80015fc0b
3 changed files with 85 additions and 0 deletions
+3
View File
@@ -138,6 +138,9 @@ $routes->post('/en/wrench/api/v1/uploads', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/marketmessage', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/marketinterest', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/activejobstatus', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/activetaskstatus', 'WrenchApi::apigate');
//$routes->post('/en/wrench/api/v1/blogdata', 'WrenchBlog::apigate');
//$routes->post('/en/wrench/api/v1/blogitem', 'WrenchBlog::apigate');
+41
View File
@@ -104,12 +104,18 @@ class WrenchApi extends BaseController
'uploads'=> ['POST'],
'marketmessage'=> ['POST'],
'marketinterest'=> ['POST'],
'activejobstatus'=> ['POST'],
'activetaskstatus'=> ['POST'],
];
return $endpoints;
}
private function prepareEndPointData($endpoint, $in, &$call_backend=true,&$local_out=[]){
switch ($endpoint) {
case 'activejobstatus':
case 'activetaskstatus':
$in = $this->processJobStatus($in);
break;
case 'marketmessage':
$in["action"] = WRENCHBOARD_JOB_SEND_QUESTION;
break;
@@ -526,6 +532,41 @@ class WrenchApi extends BaseController
}
private function processJobStatus($data) {
/*$data['member_id'] = $_SESSION['member_id']; // = $ret->email;
$data['proc'] = $this->input->get('proc');
$data['job_id'] = $this->input->get('jobID');
$data['job_contract'] = $this->input->get('job_contract');
$data['extension']
*/
$data['job_action'] = 0;
switch ($data['proc']) {
case 'NOTIFY_COMPLETE': // notify completed
$data['job_action'] = CONTRACT_NOTIFY_COMPLETE;
break;
case 'REQUEST_CANCEL': // request cancel
$data['job_action'] = CONTRACT_REQUEST_CANCEL;
break;
case 'ACCEPT_COMPLETE':
$data['job_action'] = CONTRACT_ACCEPT_COMPLETE;
break;
case 'REJECT_COMPLETE':
$data['job_action'] = CONTRACT_REJECT_COMPLETE;
break;
case 'EXTEND_TIMELINE':
$data['job_action'] = CONTRACT_EXTEND_TIMELINE;
break;
case 'CANCEL_CONTRACT':
$data['job_action'] = CONTRACT_CANCEL_CONTRACT;
break;
}
$data['action'] = WRENCHBOARD_CONTRACT_STATUS;
return $data;
}
private function getSiteConfigurations($config_item){
$wrenchboard = new \App\Models\BackendModel();
return $wrenchboard->cfgReadChar($config_item);
+41
View File
@@ -84,6 +84,8 @@ $endpoints = array(
'uploads'=> array('POST'),
'marketmessage'=> array('POST'),
'marketinterest'=> array('POST'),
'activejobstatus'=> array('POST'),
'activetaskstatus'=> array('POST'),
);
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
@@ -175,6 +177,10 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") {
}
$in["loc"] = $_SERVER["REMOTE_ADDR"];
switch ($endpoint) {
case 'activejobstatus':
case 'activetaskstatus':
$in = processJobStatus($in);
break;
case 'marketmessage':
$in["action"] = WRENCHBOARD_JOB_SEND_QUESTION;
break;
@@ -492,6 +498,41 @@ function getSiteConfigurations($wrenchboard,$config_item){
return $wrenchboard->cfgReadChar($config_item);
}
function processJobStatus($data) {
/*$data['member_id'] = $_SESSION['member_id']; // = $ret->email;
$data['proc'] = $this->input->get('proc');
$data['job_id'] = $this->input->get('jobID');
$data['job_contract'] = $this->input->get('job_contract');
$data['extension']
*/
$data['job_action'] = 0;
switch ($data['proc']) {
case 'NOTIFY_COMPLETE': // notify completed
$data['job_action'] = CONTRACT_NOTIFY_COMPLETE;
break;
case 'REQUEST_CANCEL': // request cancel
$data['job_action'] = CONTRACT_REQUEST_CANCEL;
break;
case 'ACCEPT_COMPLETE':
$data['job_action'] = CONTRACT_ACCEPT_COMPLETE;
break;
case 'REJECT_COMPLETE':
$data['job_action'] = CONTRACT_REJECT_COMPLETE;
break;
case 'EXTEND_TIMELINE':
$data['job_action'] = CONTRACT_EXTEND_TIMELINE;
break;
case 'CANCEL_CONTRACT':
$data['job_action'] = CONTRACT_CANCEL_CONTRACT;
break;
}
$data['action'] = WRENCHBOARD_CONTRACT_STATUS;
return $data;
}
// system.primary_uploads
header("HTTP/1.1 200 OK");