WrenchJobListFiles
This commit is contained in:
@@ -8,4 +8,5 @@ long WrenchJobManagerList( CVars in, CVars &out );
|
|||||||
long WrenchJobManagerActiveTasksList( CVars in, CVars &out);
|
long WrenchJobManagerActiveTasksList( CVars in, CVars &out);
|
||||||
long WrenchUsersActiveTasksList(CVars in, CVars &out);
|
long WrenchUsersActiveTasksList(CVars in, CVars &out);
|
||||||
long WrenchUsersTasksReportList(CVars in, CVars &out);
|
long WrenchUsersTasksReportList(CVars in, CVars &out);
|
||||||
|
long WrenchJobListFiles(CVars in, CVars &out);
|
||||||
#endif
|
#endif
|
||||||
@@ -34,6 +34,7 @@ long WrenchJobsOfferInterestList(CVars in, CVars &out);
|
|||||||
long WrenchUserJobsInterestList(CVars in, CVars &out);
|
long WrenchUserJobsInterestList(CVars in, CVars &out);
|
||||||
long WrenchJobsGroupList(CVars in, CVars &out);
|
long WrenchJobsGroupList(CVars in, CVars &out);
|
||||||
|
|
||||||
|
|
||||||
long jobs_calls(CVars in, CVars &out) {
|
long jobs_calls(CVars in, CVars &out) {
|
||||||
logfmt(logINFO, "jobs_calls()");
|
logfmt(logINFO, "jobs_calls()");
|
||||||
out["result"] = "YES I GET TO BACK END";
|
out["result"] = "YES I GET TO BACK END";
|
||||||
@@ -49,6 +50,7 @@ long jobs_calls(CVars in, CVars &out) {
|
|||||||
break;
|
break;
|
||||||
case WRENCHBOARD_JOB_JOBFILES:
|
case WRENCHBOARD_JOB_JOBFILES:
|
||||||
logfmt(logINFO, "jobs_calls() ~~WRENCHBOARD_JOB_JOBFILES~~ action=%lu",action);
|
logfmt(logINFO, "jobs_calls() ~~WRENCHBOARD_JOB_JOBFILES~~ action=%lu",action);
|
||||||
|
return WrenchJobListFiles(in, out);
|
||||||
break;
|
break;
|
||||||
case WRENCHBOARD_JOB_OFFERS:
|
case WRENCHBOARD_JOB_OFFERS:
|
||||||
return WrenchJobManagerOffers(in, out);
|
return WrenchJobManagerOffers(in, out);
|
||||||
|
|||||||
@@ -198,7 +198,54 @@ long WrenchJobManagerOffers( CVars in, CVars &out){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long WrenchJobListFiles(CVars in, CVars &out){
|
||||||
|
logfmt(logINFO, "ENTER CALL long WrenchJobListFiles");
|
||||||
|
char vname[30];
|
||||||
|
long ret = PHP_API_BAD_PARAM;
|
||||||
|
const char * loc = getenv("REMOTE_ADDR");
|
||||||
|
const PGresult *res;
|
||||||
|
|
||||||
|
try{
|
||||||
|
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||||
|
long offset = REQ_LONG(in, "offset", 1, -1);
|
||||||
|
long limit = REQ_LONG(in, "limit", 1, -1);
|
||||||
|
|
||||||
|
out["total_record"] = "0";
|
||||||
|
|
||||||
|
|
||||||
|
res = pgsql_query("SELECT id,uid,job_uid,originalname,size FROM members_jobs_files WHERE job_uid='%s'", in["job_uid"].c_str());
|
||||||
|
|
||||||
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
|
out["total_record"] = pgsql_num_rows(res);
|
||||||
|
|
||||||
|
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
|
||||||
|
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
|
||||||
|
if (f.empty()) continue;
|
||||||
|
CVars rec;
|
||||||
|
map_to_cvars(f, rec);
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "id_%05d", i);
|
||||||
|
out[vname] = rec["id"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "file_uid_%05d", i);
|
||||||
|
out[vname] = rec["uid"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "originalname_%05d", i);
|
||||||
|
out[vname] = rec["originalname"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "size_%05d", i);
|
||||||
|
out[vname] = rec["size"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = PHP_API_OK;
|
||||||
|
out["status"] = "OK";
|
||||||
|
} catch (bad_parameter) {
|
||||||
|
logfmt(logINFO, "ERROR CALL long WrenchJobListFiles");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
long WrenchJobManagerList( CVars in, CVars &out){
|
long WrenchJobManagerList( CVars in, CVars &out){
|
||||||
logfmt(logINFO, "ENTER CALL long WrenchJobManagerList");
|
logfmt(logINFO, "ENTER CALL long WrenchJobManagerList");
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ abstract class BaseController extends Controller
|
|||||||
'accounttypes' => ['POST'],
|
'accounttypes' => ['POST'],
|
||||||
'jobmanageragree' => ['POST'],
|
'jobmanageragree' => ['POST'],
|
||||||
'jobmanagerlist' => ['POST'],
|
'jobmanagerlist' => ['POST'],
|
||||||
|
'jobmanagerfiles' => ['POST'],
|
||||||
'jobmanageroffers'=> ['POST'],
|
'jobmanageroffers'=> ['POST'],
|
||||||
'jobmanageractive'=> ['POST'],
|
'jobmanageractive'=> ['POST'],
|
||||||
'jobmanagercreatejob'=> ['POST'],
|
'jobmanagercreatejob'=> ['POST'],
|
||||||
|
|||||||
Reference in New Issue
Block a user