BUG 5120 Change text to clarify the purpose of user for the Case Scheduler SOLVED
- Fix some issues in the logic of the validation - Change some validations
This commit is contained in:
@@ -83,7 +83,7 @@ class Cases
|
|||||||
* @param string $sUIDUser
|
* @param string $sUIDUser
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function canStartCase($sUIDUser = '')
|
public function canStartCase($sUIDUser = '', $processUid = '')
|
||||||
{
|
{
|
||||||
$c = new Criteria();
|
$c = new Criteria();
|
||||||
$c->clearSelectColumns();
|
$c->clearSelectColumns();
|
||||||
@@ -93,6 +93,9 @@ class Cases
|
|||||||
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
||||||
$c->add(TaskPeer::TAS_START, 'TRUE');
|
$c->add(TaskPeer::TAS_START, 'TRUE');
|
||||||
$c->add(TaskUserPeer::USR_UID, $sUIDUser);
|
$c->add(TaskUserPeer::USR_UID, $sUIDUser);
|
||||||
|
if ($processUid != '') {
|
||||||
|
$c->add(TaskPeer::PRO_UID, $processUid);
|
||||||
|
}
|
||||||
|
|
||||||
$rs = TaskPeer::doSelectRS($c);
|
$rs = TaskPeer::doSelectRS($c);
|
||||||
$rs->next();
|
$rs->next();
|
||||||
@@ -115,6 +118,9 @@ class Cases
|
|||||||
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
||||||
$c->add(TaskPeer::TAS_START, 'TRUE');
|
$c->add(TaskPeer::TAS_START, 'TRUE');
|
||||||
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
|
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
|
||||||
|
if ($processUid != '') {
|
||||||
|
$c->add(TaskPeer::PRO_UID, $processUid);
|
||||||
|
}
|
||||||
|
|
||||||
$rs = TaskPeer::doSelectRS($c);
|
$rs = TaskPeer::doSelectRS($c);
|
||||||
$rs->next();
|
$rs->next();
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ class wsBase
|
|||||||
$uid = $RBAC->VerifyLogin($userid , $password);
|
$uid = $RBAC->VerifyLogin($userid , $password);
|
||||||
|
|
||||||
switch ($uid) {
|
switch ($uid) {
|
||||||
|
case '':
|
||||||
case -1: //The user doesn't exist
|
case -1: //The user doesn't exist
|
||||||
$wsResponse = new wsResponse(3, G::loadTranslation('ID_USER_NOT_REGISTERED'));
|
$wsResponse = new wsResponse(3, G::loadTranslation('ID_USER_NOT_REGISTERED'));
|
||||||
break;
|
break;
|
||||||
@@ -116,7 +117,7 @@ class wsBase
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($uid < 0 ) {
|
if ($uid < 0 || $uid == '') {
|
||||||
throw (new Exception(serialize($wsResponse)));
|
throw (new Exception(serialize($wsResponse)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,29 +45,27 @@ $endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG .
|
|||||||
$user = $sWS_USER;
|
$user = $sWS_USER;
|
||||||
$pass = $sWS_PASS;
|
$pass = $sWS_PASS;
|
||||||
|
|
||||||
$params = array ('userid' => $user, 'password' => $pass );
|
$params = array('userid' => $user, 'password' => $pass);
|
||||||
$result = $client->__SoapCall ( 'login', array ($params ) );
|
$result = $client->__SoapCall('login', array($params));
|
||||||
|
|
||||||
|
if ($result->status_code == 0) {
|
||||||
|
if (!class_exists('Users')) {
|
||||||
|
require ("classes/model/UsersPeer.php");
|
||||||
|
}
|
||||||
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->addSelectColumn('USR_UID');
|
||||||
|
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
|
||||||
|
$resultSet = UsersPeer::doSelectRS($oCriteria);
|
||||||
|
$resultSet->next();
|
||||||
|
$user_id = $resultSet->getRow();
|
||||||
|
$result->message = $user_id[0];
|
||||||
|
|
||||||
|
G::LoadClass('case');
|
||||||
|
$caseInstance = new Cases();
|
||||||
|
if (!$caseInstance->canStartCase($result->message, $_REQUEST['PRO_UID'])) {
|
||||||
|
$result->status_code = -1000;
|
||||||
|
$result->message = G::LoadTranslation('ID_USER_CASES_NOT_START');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$fields ['status_code'] = $result->status_code;
|
die(G::json_encode($result));
|
||||||
$fields ['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
|
|
||||||
$fields ['version'] = $result->version;
|
|
||||||
$fields ['time_stamp'] = $result->timestamp;
|
|
||||||
$messageCode = $result->message;
|
|
||||||
if($result->status_code == 0){
|
|
||||||
if(!class_exists('Users')) {
|
|
||||||
require ("classes/model/UsersPeer.php");
|
|
||||||
}
|
|
||||||
|
|
||||||
$oCriteria = new Criteria('workflow');
|
|
||||||
$oCriteria->addSelectColumn('USR_UID');
|
|
||||||
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
|
|
||||||
$resultSet = UsersPeer::doSelectRS($oCriteria);
|
|
||||||
$resultSet->next();
|
|
||||||
$user_id = $resultSet->getRow();
|
|
||||||
|
|
||||||
$messageCode = $user_id[0];
|
|
||||||
}
|
|
||||||
echo ($messageCode);
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<en>General Information</en>
|
<en>General Information</en>
|
||||||
</GENERAL_INF>
|
</GENERAL_INF>
|
||||||
<PROPERTIES_INF type="subtitle" enablehtml="1">
|
<PROPERTIES_INF type="subtitle" enablehtml="1">
|
||||||
<en>Enter the username and password for the user who will be assigned to the initial task in the case(s).</en>
|
<en>Enter the username and password of the user who will be assigned to the initial task in the case.</en>
|
||||||
</PROPERTIES_INF>
|
</PROPERTIES_INF>
|
||||||
<SCH_UID type="hidden" >
|
<SCH_UID type="hidden" >
|
||||||
<en></en>
|
<en></en>
|
||||||
@@ -356,7 +356,7 @@ function hideAll() {
|
|||||||
contractSubtitle('SELECT_2');
|
contractSubtitle('SELECT_2');
|
||||||
contractSubtitle('SELECT_3');
|
contractSubtitle('SELECT_3');
|
||||||
contractSubtitle('SELECT_EVERY');
|
contractSubtitle('SELECT_EVERY');
|
||||||
|
|
||||||
//contractSubtitle('ADVANCED_4');
|
//contractSubtitle('ADVANCED_4');
|
||||||
document.getElementById('startTime').style.display='none';
|
document.getElementById('startTime').style.display='none';
|
||||||
document.getElementById('everyTime').style.display='none';
|
document.getElementById('everyTime').style.display='none';
|
||||||
@@ -420,7 +420,7 @@ function showSelection(opt) {
|
|||||||
expandSubtitle('SELECT_1');
|
expandSubtitle('SELECT_1');
|
||||||
contractSubtitle('SELECT_2');
|
contractSubtitle('SELECT_2');
|
||||||
contractSubtitle('SELECT_3');
|
contractSubtitle('SELECT_3');
|
||||||
|
|
||||||
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
||||||
document.getElementById('endDateTable').style.display='';
|
document.getElementById('endDateTable').style.display='';
|
||||||
document.getElementById('startTime').style.display='';
|
document.getElementById('startTime').style.display='';
|
||||||
@@ -432,7 +432,7 @@ function showSelection(opt) {
|
|||||||
expandSubtitle('SELECT_2');
|
expandSubtitle('SELECT_2');
|
||||||
contractSubtitle('SELECT_3');
|
contractSubtitle('SELECT_3');
|
||||||
hideRow('SCH_EVERY_DAYS');
|
hideRow('SCH_EVERY_DAYS');
|
||||||
|
|
||||||
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
||||||
document.getElementById('endDateTable').style.display='';
|
document.getElementById('endDateTable').style.display='';
|
||||||
document.getElementById('startTime').style.display='';
|
document.getElementById('startTime').style.display='';
|
||||||
@@ -457,7 +457,7 @@ function showSelection(opt) {
|
|||||||
getField('SCH_START_DAY_OPT_2_DAYS_WEEK').disabled=false;
|
getField('SCH_START_DAY_OPT_2_DAYS_WEEK').disabled=false;
|
||||||
getField('SCH_START_DAY_OPT_2_DAYS_WEEK').style.display="";
|
getField('SCH_START_DAY_OPT_2_DAYS_WEEK').style.display="";
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
||||||
document.getElementById('endDateTable').style.display='';
|
document.getElementById('endDateTable').style.display='';
|
||||||
document.getElementById('startTime').style.display='';
|
document.getElementById('startTime').style.display='';
|
||||||
@@ -467,7 +467,7 @@ function showSelection(opt) {
|
|||||||
contractSubtitle('SELECT_1');
|
contractSubtitle('SELECT_1');
|
||||||
contractSubtitle('SELECT_2');
|
contractSubtitle('SELECT_2');
|
||||||
contractSubtitle('SELECT_3');
|
contractSubtitle('SELECT_3');
|
||||||
|
|
||||||
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
document.getElementById('form[SELECT_EVERY]').style.display='none';
|
||||||
document.getElementById('endDateTable').style.display='';
|
document.getElementById('endDateTable').style.display='';
|
||||||
document.getElementById('startTime').style.display='';
|
document.getElementById('startTime').style.display='';
|
||||||
@@ -478,7 +478,7 @@ function showSelection(opt) {
|
|||||||
contractSubtitle('SELECT_2');
|
contractSubtitle('SELECT_2');
|
||||||
contractSubtitle('SELECT_3');
|
contractSubtitle('SELECT_3');
|
||||||
enable(getField('SCH_REPEAT_EVERY'));
|
enable(getField('SCH_REPEAT_EVERY'));
|
||||||
|
|
||||||
document.getElementById('form[SELECT_TIME_DAY]').style.display='none';
|
document.getElementById('form[SELECT_TIME_DAY]').style.display='none';
|
||||||
document.getElementById('endDateTable').style.display='none';
|
document.getElementById('endDateTable').style.display='none';
|
||||||
document.getElementById('startTime').style.display='none';
|
document.getElementById('startTime').style.display='none';
|
||||||
@@ -647,22 +647,25 @@ leimnud.event.add(getField('SCH_REPEAT_UNTIL'), 'change', function() {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function case_userSchedulerValidate(username, password) {
|
function case_userSchedulerValidate(username, password) {
|
||||||
//G.alert(username);
|
|
||||||
//G.alert(password);
|
|
||||||
var user_uid;
|
var user_uid;
|
||||||
|
|
||||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../cases/cases_SchedulerValidateUser',
|
url : '../cases/cases_SchedulerValidateUser',
|
||||||
async : true,
|
async : true,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
args : "USERNAME="+username+"&PASSWORD="+password
|
args : "USERNAME="+username+"&PASSWORD="+password+"&PRO_UID="+$_GET('PRO_UID')
|
||||||
});
|
});
|
||||||
|
|
||||||
oRPC.callback = function(rpc){
|
oRPC.callback = function(rpc){
|
||||||
//msgBox(rpc.xmlhttp.responseText,"alert");
|
sresponse = rpc.xmlhttp.responseText.parseJSON();
|
||||||
getField('SCH_USER_UID').value = rpc.xmlhttp.responseText;
|
|
||||||
user_uid = rpc.xmlhttp.responseText;
|
if (sresponse.status_code != 0) {
|
||||||
//alert(user_uid);
|
msgBox(sresponse.message, "alert");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getField('SCH_USER_UID').value = sresponse.message;
|
||||||
|
user_uid = sresponse.message;
|
||||||
|
|
||||||
var oRPCProcess = new leimnud.module.rpc.xmlhttp({
|
var oRPCProcess = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../cases/cases_SchedulerGetProcesses',
|
url : '../cases/cases_SchedulerGetProcesses',
|
||||||
@@ -684,15 +687,7 @@ function case_userSchedulerValidate(username, password) {
|
|||||||
|
|
||||||
oRPCProcess.make();
|
oRPCProcess.make();
|
||||||
|
|
||||||
/* if(rpc.xmlhttp.responseText>=1){
|
|
||||||
//getField('SEARCH').disabled = false;
|
|
||||||
msgBox("User successfully logged","alert");
|
|
||||||
getField('SCH_USR_UID').value = rpc.xmlhttp.responseText;
|
|
||||||
} else {
|
|
||||||
//getField('SEARCH').disabled = true;
|
|
||||||
msgBox(rpc.xmlhttp.responseText,"alert");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}.extend(this);
|
}.extend(this);
|
||||||
oRPC.make();
|
oRPC.make();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user