task messsage
This commit is contained in:
@@ -321,7 +321,7 @@ long WrenchContractMessageList( CVars in, CVars &out )
|
||||
|
||||
res = pgsql_query(" SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS msg_date,"
|
||||
" m.firstname AS msg_firstname,jc.id as msg_id,jc.message AS msg,"
|
||||
" jc.msg_type, jc.message "
|
||||
" jc.msg_type, jc.message,jc.member_id AS sender_id "
|
||||
" FROM jobs_contract_message jc "
|
||||
" LEFT JOIN members m ON m.id=jc.member_id "
|
||||
" WHERE jc.contract='%s' ORDER by jc.id DESC", in["contract"].c_str());
|
||||
@@ -353,6 +353,13 @@ long WrenchContractMessageList( CVars in, CVars &out )
|
||||
snprintf(vname, sizeof (vname), "message_%05d", i);
|
||||
out[vname] = rec["message"];
|
||||
|
||||
snprintf(vname, sizeof (vname), "who_%05d", i);
|
||||
if( sender_id == member_id){
|
||||
out[vname] = "SENDER";
|
||||
}
|
||||
else{
|
||||
out[vname] = "RECIPIENT";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,6 +299,7 @@ class ResultFormatter extends Model
|
||||
"msg_firstname" => $out["msg_firstname_${key}"],
|
||||
"msg_id" => $out["msg_id_${key}"],
|
||||
"msg_type" => $out["msg_type_${key}"],
|
||||
"who" => $out["who_${key}"],
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user