Skip to content

Commit

Permalink
GMP | 1. EXP. | eSigns -- update for autolfow framework && standalone…
Browse files Browse the repository at this point in the history
… eSigner for inclusion of 'Approver' type into the consideration...
  • Loading branch information
alexsav815 committed Jul 28, 2023
1 parent 773b6ec commit badb287
Show file tree
Hide file tree
Showing 7 changed files with 679 additions and 99 deletions.
21 changes: 19 additions & 2 deletions programs/us_com_project/us_com_project_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,7 @@ bool US_InitDialogueGui::isOperRev( int uID, QString autoflow_id )
QString autoflow_name ;
QString operator_list;
QString reviewers_list;
QString approvers_list;
QString eSignStatusJson;
QString eSignStatusAll;
QString createUpdateJsonLog;
Expand All @@ -2481,15 +2482,17 @@ bool US_InitDialogueGui::isOperRev( int uID, QString autoflow_id )
eSignStatusJson = db->value( 5 ).toString(); //json
eSignStatusAll = db->value( 6 ).toString(); //ENUM
createUpdateJsonLog = db->value( 7 ).toString(); //json
approvers_list = db->value( 8 ).toString(); //json array
}

//process 'reviewers_list' & 'operList' Json arrays:
QJsonDocument jsonDocRevList = QJsonDocument::fromJson( reviewers_list.toUtf8() );
QJsonDocument jsonDocOperList = QJsonDocument::fromJson( operator_list .toUtf8() );
QJsonDocument jsonDocApprList = QJsonDocument::fromJson( approvers_list .toUtf8() );

if ( !jsonDocRevList. isArray() || !jsonDocOperList. isArray() )
if ( !jsonDocRevList. isArray() || !jsonDocOperList. isArray() || !jsonDocApprList. isArray() )
{
qDebug() << "jsonDocRevList OR jsonDocOperList not a JSON Array!";
qDebug() << "jsonDocRevList OR jsonDocOperList OR jsonDocApprList not a JSON Array!";
return yesRev;
}

Expand Down Expand Up @@ -2518,6 +2521,20 @@ bool US_InitDialogueGui::isOperRev( int uID, QString autoflow_id )
return true;
}
}

QJsonArray jsonDocApprList_array = jsonDocApprList.array();
for (int i=0; i < jsonDocApprList_array.size(); ++i )
{
QString current_reviewer = jsonDocApprList_array[i].toString();
//uname = oID + ": " + olname + ", " + ofname;
int current_reviewer_id = current_reviewer. section( ".", 0, 0 ).toInt();

if ( uID == current_reviewer_id )
{
return true;
}
}


return yesRev;
}
Expand Down
Loading

0 comments on commit badb287

Please sign in to comment.