Merged in 322ToDev (pull request #6135)
release/3.2.2 Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
17
Rakefile
17
Rakefile
@@ -1,5 +1,5 @@
|
||||
require 'rubygems'
|
||||
|
||||
require 'json'
|
||||
desc "Default Task - Build Library"
|
||||
task :default => [:required] do
|
||||
Rake::Task['build'].execute
|
||||
@@ -53,6 +53,7 @@ task :build => [:required] do
|
||||
mafeDir = targetDir + "/mafe"
|
||||
pmdynaformDir = targetDir + "/pmdynaform"
|
||||
|
||||
generateEnviromentVariables
|
||||
prepareDirs([targetDir, pmUIDir, mafeDir, pmdynaformDir, jsTargetDir, cssTargetDir, cssImagesTargetDir, imgTargetDir, pmUIFontsDir])
|
||||
|
||||
buildPmUi(Dir.pwd + "/vendor/colosa/pmUI", targetDir, mode)
|
||||
@@ -134,6 +135,20 @@ task :build => [:required] do
|
||||
#task argv1.to_sym do ; end
|
||||
end
|
||||
|
||||
def generateEnviromentVariables()
|
||||
puts "Creating System Constants..."
|
||||
content = "var __env = __env || {};"
|
||||
file = File.read('./config/enviromentvariables.json')
|
||||
dataUser = JSON.parse(file)
|
||||
content = content + "__env.USER_GUEST = " + JSON.generate(dataUser['constants']['userguest'])
|
||||
dir = "vendor/colosa/MichelangeloFE/src/enviroment/"
|
||||
# create a directory enviroment
|
||||
FileUtils.mkdir_p(dir)
|
||||
File.open(dir +'constants.js', 'w') { |fileWrite|
|
||||
fileWrite.write content + ';'
|
||||
}
|
||||
end
|
||||
|
||||
def buildPmUi(homeDir, targetDir, mode)
|
||||
puts "\nBuilding PMUI library".green.bold
|
||||
|
||||
|
||||
12
config/enviromentvariables.json
Normal file
12
config/enviromentvariables.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Environment variables",
|
||||
"description": "Definition of system constants",
|
||||
"constants": {
|
||||
"userguest": {
|
||||
"uid": "00000000000000000000000000000002",
|
||||
"firstname": "Guest",
|
||||
"lastname": "Guest",
|
||||
"username": "guest"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
21
gulpfile.js
21
gulpfile.js
@@ -471,7 +471,26 @@ gulp.task('clean', function () {
|
||||
cleanDirectory('workflow/public_html/lib');
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean'], function (cb) {
|
||||
/**
|
||||
* This scheduled task is to be able to create the guest user constants
|
||||
*/
|
||||
gulp.task('__env', function (cb) {
|
||||
var data = require('./config/enviromentvariables.json'),
|
||||
pathEnviroment = 'vendor/colosa/MichelangeloFE/src/enviroment/',
|
||||
content = 'var __env = __env || {};';
|
||||
|
||||
gutil.log(gutil.colors.green('Creating System Constants...'));
|
||||
if (!fs.existsSync(pathEnviroment)){
|
||||
fs.mkdirSync(pathEnviroment);
|
||||
}
|
||||
fs.writeFile(
|
||||
pathEnviroment + 'constants.js',
|
||||
content + '__env.USER_GUEST = ' + JSON.stringify(data.constants.userguest) + ';',
|
||||
cb
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean', '__env'], function (cb) {
|
||||
var i, tasks = [];
|
||||
|
||||
gutil.log(gutil.colors.green('Initializing ProcessMaker building...'));
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @access public
|
||||
*/
|
||||
@@ -44,57 +45,60 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
class RbacUsers extends BaseRbacUsers
|
||||
{
|
||||
|
||||
private $userUidReserved = [RBAC::GUEST_USER_UID];
|
||||
|
||||
/**
|
||||
* Autentificacion de un usuario a traves de la clase RBAC_user
|
||||
* Authentication of a user through the class RBAC_user
|
||||
*
|
||||
* verifica que un usuario tiene derechos de iniciar una aplicacion
|
||||
* verifies that a user has permission to start an application
|
||||
*
|
||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||
* access public
|
||||
* @access public
|
||||
* Function verifyLogin
|
||||
*
|
||||
* @param string $strUser UserId (login) de usuario
|
||||
* @param string $strPass Password
|
||||
* @return
|
||||
* -1: no existe usuario
|
||||
* -2: password errado
|
||||
* -3: usuario inactivo
|
||||
* -4: usuario vencido
|
||||
* -6: role inactivo
|
||||
* n : uid de usuario
|
||||
* @param string $userName UserId (login) de usuario
|
||||
* @param string $password Password
|
||||
* @return type
|
||||
* -1: no user exists
|
||||
* -2: wrong password
|
||||
* -3: inactive user
|
||||
* -4: expired user
|
||||
* -6: role inactive
|
||||
* n : string user uid
|
||||
* @throws Exception
|
||||
*/
|
||||
public function verifyLogin($sUsername, $sPassword)
|
||||
public function verifyLogin($userName, $password)
|
||||
{
|
||||
//invalid user
|
||||
if ($sUsername == '') {
|
||||
if ($userName == '') {
|
||||
return -1;
|
||||
}
|
||||
//invalid password
|
||||
if ($sPassword == '') {
|
||||
if ($password == '') {
|
||||
return -2;
|
||||
}
|
||||
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $sUsername);
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $userName);
|
||||
/* @var $rs RbacUsers[] */
|
||||
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
|
||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$dataFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
//verify password with md5, and md5 format
|
||||
if (mb_strtoupper($sUsername, 'utf-8') === mb_strtoupper($aFields['USR_USERNAME'], 'utf-8')) {
|
||||
if( Bootstrap::verifyHashPassword($sPassword, $rs[0]->getUsrPassword()) ) {
|
||||
if ($aFields['USR_DUE_DATE'] < date('Y-m-d')) {
|
||||
if (mb_strtoupper($userName, 'utf-8') === mb_strtoupper($dataFields['USR_USERNAME'], 'utf-8')) {
|
||||
if (Bootstrap::verifyHashPassword($password, $rs[0]->getUsrPassword())) {
|
||||
if ($dataFields['USR_DUE_DATE'] < date('Y-m-d')) {
|
||||
return -4;
|
||||
}
|
||||
if ($aFields['USR_STATUS'] != 1) {
|
||||
if ($dataFields['USR_STATUS'] != 1 && $dataFields['USR_UID'] !== RBAC::GUEST_USER_UID) {
|
||||
return -3;
|
||||
}
|
||||
$role = $this->getUserRole($aFields['USR_UID']);
|
||||
$role = $this->getUserRole($dataFields['USR_UID']);
|
||||
if ($role['ROL_STATUS'] == 0) {
|
||||
return -6;
|
||||
}
|
||||
return $aFields['USR_UID'];
|
||||
|
||||
return $dataFields['USR_UID'];
|
||||
} else {
|
||||
return -2;
|
||||
}
|
||||
@@ -104,100 +108,134 @@ class RbacUsers extends BaseRbacUsers
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function verifyUser($sUsername)
|
||||
/**
|
||||
* Verify if the userName exists
|
||||
* @param string $userName
|
||||
* @return integer
|
||||
* @throws Exception
|
||||
*/
|
||||
public function verifyUser($userName)
|
||||
{
|
||||
//invalid user
|
||||
if ($sUsername == '') {
|
||||
if ($userName == '') {
|
||||
return 0;
|
||||
}
|
||||
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $sUsername);
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $userName);
|
||||
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
|
||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||
//return the row for futher check of which Autentificacion method belongs this user
|
||||
$this->fields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
;
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function getByUsername($sUsername)
|
||||
/**
|
||||
* Get user info by userName
|
||||
* @param string $userName
|
||||
* @return array $dataFields if exist
|
||||
* false if does not exist
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getByUsername($userName)
|
||||
{
|
||||
//invalid user
|
||||
if ($sUsername == '') {
|
||||
if ($userName == '') {
|
||||
return 0;
|
||||
}
|
||||
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $sUsername);
|
||||
$c->add(RbacUsersPeer::USR_USERNAME, $userName);
|
||||
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
|
||||
|
||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
$dataFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
return $dataFields;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function verifyUserId($sUserId)
|
||||
/**
|
||||
* Verify user by Uid
|
||||
* @param string $userUid
|
||||
* @return integer
|
||||
* @throws Exception
|
||||
*/
|
||||
public function verifyUserId($userUid)
|
||||
{
|
||||
//invalid user
|
||||
if ($sUserId == '') {
|
||||
if ($userUid == '') {
|
||||
return 0;
|
||||
}
|
||||
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_UID, $sUserId);
|
||||
$c->add(RbacUsersPeer::USR_UID, $userUid);
|
||||
$rs = RbacUsersPeer::doSelect($c, Propel::getDbConnection('rbac_ro'));
|
||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function load($sUsrUid)
|
||||
/**
|
||||
* Load user information by Uid
|
||||
* @param string $userUid
|
||||
* @return array $dataFields
|
||||
* @throws Exception
|
||||
*/
|
||||
public function load($userUid)
|
||||
{
|
||||
$con = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria('rbac');
|
||||
$c->add(RbacUsersPeer::USR_UID, $sUsrUid);
|
||||
$c->add(RbacUsersPeer::USR_UID, $userUid);
|
||||
$resultSet = RbacUsersPeer::doSelectRS($c, Propel::getDbConnection('rbac_ro'));
|
||||
if ($resultSet->next()) {
|
||||
$this->hydrate($resultSet);
|
||||
$aFields = $this->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
$dataFields = $this->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
return $dataFields;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function create($aData)
|
||||
/**
|
||||
* Create an user
|
||||
* @param string $infoData
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($infoData)
|
||||
{
|
||||
if (class_exists('ProcessMaker\Plugins\PluginRegistry')) {
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
@@ -209,116 +247,134 @@ class RbacUsers extends BaseRbacUsers
|
||||
}
|
||||
}
|
||||
}
|
||||
$oConnection = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
$connection = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oRBACUsers = new RbacUsers();
|
||||
$rbacUsers = new RbacUsers();
|
||||
do {
|
||||
$aData['USR_UID'] = G::generateUniqueID();
|
||||
} while ($oRBACUsers->load($aData['USR_UID']));
|
||||
$oRBACUsers->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
//if ($oRBACUsers->validate()) {
|
||||
//$oConnection->begin();
|
||||
$iResult = $oRBACUsers->save();
|
||||
//$oConnection->commit();
|
||||
return $aData['USR_UID'];
|
||||
/* }
|
||||
else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oRBACUsers->getValidationFailures();
|
||||
foreach($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be created!<br />' . $sMessage));
|
||||
} */
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
$infoData['USR_UID'] = G::generateUniqueID();
|
||||
} while ($rbacUsers->load($infoData['USR_UID']));
|
||||
$rbacUsers->fromArray($infoData, BasePeer::TYPE_FIELDNAME);
|
||||
$result = $rbacUsers->save();
|
||||
|
||||
return $infoData['USR_UID'];
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function update($aData)
|
||||
/**
|
||||
* Update an user
|
||||
* @param string $infoData
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($infoData)
|
||||
{
|
||||
if (in_array($infoData['USR_UID'], $this->userUidReserved)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($infoData['USR_UID'])));
|
||||
return false;
|
||||
}
|
||||
$oConnection = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($infoData, BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
$iResult = $this->save();
|
||||
} catch (Exception $oError) {
|
||||
$result = $this->save();
|
||||
} catch (Exception $error) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($sUserUID = '')
|
||||
/**
|
||||
* Remove an user
|
||||
* @param string $userUid
|
||||
* @return void
|
||||
*/
|
||||
public function remove($userUid = '')
|
||||
{
|
||||
$this->setUsrUid($sUserUID);
|
||||
$this->setUsrUid($userUid);
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
//Added by Qennix at Feb 14th, 2011
|
||||
//Gets an associative array with total users by authentication sources
|
||||
/**
|
||||
* Gets an associative array with total users by authentication sources
|
||||
* @return array $listAuth
|
||||
*/
|
||||
public function getAllUsersByAuthSource()
|
||||
{
|
||||
$oCriteria = new Criteria('rbac');
|
||||
$oCriteria->addSelectColumn(RbacUsersPeer::UID_AUTH_SOURCE);
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
$oCriteria->add(RbacUsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
$oCriteria->addGroupByColumn(RbacUsersPeer::UID_AUTH_SOURCE);
|
||||
$oDataset = RbacUsersPeer::doSelectRS($oCriteria, Propel::getDbConnection('rbac_ro'));
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$criteria = new Criteria('rbac');
|
||||
$criteria->addSelectColumn(RbacUsersPeer::UID_AUTH_SOURCE);
|
||||
$criteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
$criteria->add(RbacUsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
$criteria->addGroupByColumn(RbacUsersPeer::UID_AUTH_SOURCE);
|
||||
$dataset = RbacUsersPeer::doSelectRS($criteria, Propel::getDbConnection('rbac_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$aAuth = Array();
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$aAuth[$row['UID_AUTH_SOURCE']] = $row['CNT'];
|
||||
$listAuth = [];
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
$listAuth[$row['UID_AUTH_SOURCE']] = $row['CNT'];
|
||||
}
|
||||
return $aAuth;
|
||||
|
||||
return $listAuth;
|
||||
}
|
||||
|
||||
//Returns all users with auth_source
|
||||
public function getListUsersByAuthSource($auth_source)
|
||||
/**
|
||||
* Get users list related to an authentication source
|
||||
* @param string $authSource
|
||||
* @return array $listUsers, all users with auth_source
|
||||
*/
|
||||
public function getListUsersByAuthSource($authSource)
|
||||
{
|
||||
$oCriteria = new Criteria('rbac');
|
||||
$oCriteria->addSelectColumn(RbacUsersPeer::USR_UID);
|
||||
$criteria = new Criteria('rbac');
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_UID);
|
||||
|
||||
if ($auth_source == '00000000000000000000000000000000') {
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(RbacUsersPeer::UID_AUTH_SOURCE, $auth_source, Criteria::EQUAL)->addOr(
|
||||
$oCriteria->getNewCriterion(RbacUsersPeer::UID_AUTH_SOURCE, '', Criteria::EQUAL)
|
||||
));
|
||||
if ($authSource == '00000000000000000000000000000000') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(RbacUsersPeer::UID_AUTH_SOURCE, $authSource, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(RbacUsersPeer::UID_AUTH_SOURCE, '', Criteria::EQUAL)
|
||||
));
|
||||
} else {
|
||||
$oCriteria->add(RbacUsersPeer::UID_AUTH_SOURCE, $auth_source, Criteria::EQUAL);
|
||||
$criteria->add(RbacUsersPeer::UID_AUTH_SOURCE, $authSource, Criteria::EQUAL);
|
||||
}
|
||||
$oCriteria->add(RbacUsersPeer::USR_STATUS, 0, Criteria::NOT_EQUAL);
|
||||
$oDataset = RbacUsersPeer::doSelectRS($oCriteria, Propel::getDbConnection('rbac_ro'));
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$aUsers = array();
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$aUsers[] = $row['USR_UID'];
|
||||
$criteria->add(RbacUsersPeer::USR_STATUS, 0, Criteria::NOT_EQUAL);
|
||||
$dataset = RbacUsersPeer::doSelectRS($criteria, Propel::getDbConnection('rbac_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$listUsers = [];
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
$listUsers[] = $row['USR_UID'];
|
||||
}
|
||||
return $aUsers;
|
||||
|
||||
return $listUsers;
|
||||
}
|
||||
|
||||
public function getUserRole($UsrUid)
|
||||
/**
|
||||
* Get the user's role
|
||||
* @param string $userUid
|
||||
* @return array $row
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getUserRole($userUid)
|
||||
{
|
||||
$con = Propel::getConnection(UsersRolesPeer::DATABASE_NAME);
|
||||
try {
|
||||
$c = new Criteria( 'rbac' );
|
||||
$c = new Criteria('rbac');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn ( RolesPeer::ROL_UID );
|
||||
$c->addSelectColumn ( RolesPeer::ROL_CODE );
|
||||
$c->addSelectColumn ( RolesPeer::ROL_STATUS );
|
||||
$c->addJoin ( UsersRolesPeer::ROL_UID, RolesPeer::ROL_UID );
|
||||
$c->add ( UsersRolesPeer::USR_UID, $UsrUid );
|
||||
$rs = UsersRolesPeer::doSelectRs( $c , Propel::getDbConnection('rbac_ro'));
|
||||
$rs->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$c->addSelectColumn(RolesPeer::ROL_UID);
|
||||
$c->addSelectColumn(RolesPeer::ROL_CODE);
|
||||
$c->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$c->addJoin(UsersRolesPeer::ROL_UID, RolesPeer::ROL_UID);
|
||||
$c->add(UsersRolesPeer::USR_UID, $userUid);
|
||||
$rs = UsersRolesPeer::doSelectRs($c, Propel::getDbConnection('rbac_ro'));
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
return $row;
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,6 +398,7 @@ class RbacUsers extends BaseRbacUsers
|
||||
);
|
||||
$array = parent::toArray($keyType);
|
||||
unset($array[$key]);
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ class Roles extends BaseRoles {
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UPDATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_CODE, RBAC::PROCESSMAKER_GUEST, Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(SystemsPeer::SYS_CODE, $systemCode);
|
||||
$oCriteria->add(RolesPeer::ROL_CREATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UPDATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
@@ -158,7 +159,7 @@ class Roles extends BaseRoles {
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_CREATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_UPDATE_DATE);
|
||||
$oCriteria->addSelectColumn(RolesPeer::ROL_STATUS);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UID, ['', RBAC::PROCESSMAKER_GUEST_UID], Criteria::NOT_IN);
|
||||
$oCriteria->add(SystemsPeer::SYS_CODE, $systemCode);
|
||||
$oCriteria->add(RolesPeer::ROL_CREATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(RolesPeer::ROL_UPDATE_DATE, '', Criteria::NOT_EQUAL);
|
||||
@@ -572,7 +573,7 @@ class Roles extends BaseRoles {
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result->next();
|
||||
|
||||
$a = Array();
|
||||
$a = [RBAC::PM_GUEST_CASE_UID];
|
||||
while( $row = $result->getRow() ) {
|
||||
$a[] = $row['PER_UID'];
|
||||
$result->next();
|
||||
|
||||
@@ -63,13 +63,15 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000062','PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002');
|
||||
('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000066','PM_GUEST_CASE','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002');
|
||||
|
||||
INSERT INTO `RBAC_ROLES` VALUES
|
||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
||||
('00000000000000000000000000000004', '', '00000000000000000000000000000002', 'PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1),
|
||||
('00000000000000000000000000000005', '', '00000000000000000000000000000002', 'PROCESSMAKER_GUEST', '2009-02-01 12:24:36', '2009-02-01 12:24:36', 1);
|
||||
|
||||
|
||||
INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
@@ -213,8 +215,11 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000004','00000000000000000000000000000060'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000061'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000062'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000063');
|
||||
('00000000000000000000000000000004','00000000000000000000000000000063'),
|
||||
('00000000000000000000000000000005','00000000000000000000000000000066');
|
||||
|
||||
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
||||
INSERT INTO `RBAC_USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','',''),
|
||||
('00000000000000000000000000000002','guest','674ba9750749d735ec9787d606170d78','Guest','','guest@processmaker.com','2200-01-01','2009-02-01 12:24:36','2009-02-01 12:24:36',0,'MYSQL','00000000000000000000000000000000','','');
|
||||
INSERT INTO `RBAC_USERS_ROLES` VALUES ('00000000000000000000000000000001','00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000005');
|
||||
|
||||
@@ -77,28 +77,38 @@ class Groups
|
||||
/**
|
||||
* Set a user to group
|
||||
*
|
||||
* @param string $GrpUid, $UsrUid
|
||||
* @return array
|
||||
* @param string $grpUid
|
||||
* @param string $usrUid
|
||||
* @return boolean
|
||||
* @throws exception
|
||||
*/
|
||||
public function addUserToGroup($GrpUid, $UsrUid)
|
||||
public function addUserToGroup($grpUid, $usrUid)
|
||||
{
|
||||
try {
|
||||
$oGrp = GroupUserPeer::retrieveByPk($GrpUid, $UsrUid);
|
||||
if (is_object($oGrp) && get_class($oGrp) == 'GroupUser') {
|
||||
//Check the usrUid value
|
||||
if (RBAC::isGuestUserUid($usrUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($usrUid)));
|
||||
return false;
|
||||
}
|
||||
|
||||
$groupUser = GroupUserPeer::retrieveByPk($grpUid, $usrUid);
|
||||
if (is_object($groupUser) && get_class($groupUser) == 'GroupUser') {
|
||||
return true;
|
||||
} else {
|
||||
$oGrp = new GroupUser();
|
||||
$oGrp->setGrpUid($GrpUid);
|
||||
$oGrp->setUsrUid($UsrUid);
|
||||
$oGrp->Save();
|
||||
$groupUser = new GroupUser();
|
||||
$groupUser->setGrpUid($grpUid);
|
||||
$groupUser->setUsrUid($usrUid);
|
||||
$groupUser->Save();
|
||||
|
||||
$oGrpwf = new Groupwf();
|
||||
$grpName = $oGrpwf->loadByGroupUid($GrpUid);
|
||||
$groupWf = new Groupwf();
|
||||
$grpName = $groupWf->loadByGroupUid($grpUid);
|
||||
|
||||
$oUsr = new Users();
|
||||
$usrName = $oUsr->load($UsrUid);
|
||||
$users = new Users();
|
||||
$usrName = $users->load($usrUid);
|
||||
|
||||
G::auditLog("AssignUserToGroup", "Assign user ". $usrName['USR_USERNAME'] ." (".$UsrUid.") to group ".$grpName['CON_VALUE']." (".$GrpUid.") ");
|
||||
G::auditLog("AssignUserToGroup", "Assign user ". $usrName['USR_USERNAME'] ." (".$usrUid.") to group ".$grpName['CON_VALUE']." (".$grpUid.") ");
|
||||
|
||||
return true;
|
||||
}
|
||||
} catch (exception $oError) {
|
||||
throw ($oError);
|
||||
@@ -107,13 +117,14 @@ class Groups
|
||||
|
||||
/**
|
||||
* Remove a user from group
|
||||
* @param string $GrpUid, $UsrUid
|
||||
* @param string $grpUid
|
||||
* @param string $usrUid
|
||||
* @return array
|
||||
*/
|
||||
public function removeUserOfGroup($GrpUid, $UsrUid)
|
||||
public function removeUserOfGroup($grpUid, $usrUid)
|
||||
{
|
||||
$gu = new GroupUser();
|
||||
$gu->remove($GrpUid, $UsrUid);
|
||||
$gu->remove($grpUid, $usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,7 +72,7 @@ class WsBase
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
|
||||
$res = $RBAC->userCanAccess("PM_LOGIN");
|
||||
|
||||
if ($res != 1) {
|
||||
if ($res != 1 && $uid !== RBAC::GUEST_USER_UID) {
|
||||
$wsResponse = new WsResponse(2, G::loadTranslation('ID_USER_HAVENT_RIGHTS_SYSTEM'));
|
||||
throw (new Exception(serialize($wsResponse)));
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class WsBase
|
||||
public function processList()
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = [];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
|
||||
$oDataset = ProcessPeer::doSelectRS($oCriteria);
|
||||
@@ -142,7 +142,7 @@ class WsBase
|
||||
public function roleList()
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
$RBAC = & RBAC::getSingleton();
|
||||
$RBAC->initRBAC();
|
||||
@@ -195,7 +195,7 @@ class WsBase
|
||||
}
|
||||
$rs = GroupwfPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result = array();
|
||||
$result = [];
|
||||
while ($rs->next()) {
|
||||
$rows = $rs->getRow();
|
||||
$result[] = array('guid' => $rows['GRP_UID'], 'name' => $rows['GRP_TITLE']);
|
||||
@@ -216,7 +216,7 @@ class WsBase
|
||||
public function departmentList()
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = [];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(DepartmentPeer::DEP_STATUS, 'ACTIVE');
|
||||
$oDataset = DepartmentPeer::doSelectRS($oCriteria);
|
||||
@@ -283,9 +283,9 @@ class WsBase
|
||||
|
||||
if ($solrEnabled == 1) {
|
||||
try {
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$delegationIndexes = array();
|
||||
$delegationIndexes = [];
|
||||
$columsToInclude = array("APP_UID");
|
||||
$solrSearchText = null;
|
||||
|
||||
@@ -323,7 +323,7 @@ class WsBase
|
||||
$solrQueryResult = $searchIndex->getDataTablePaginatedList($solrRequestData);
|
||||
|
||||
//Get the missing data from database
|
||||
$arrayApplicationUid = array();
|
||||
$arrayApplicationUid = [];
|
||||
|
||||
foreach ($solrQueryResult->aaData as $i => $data) {
|
||||
$arrayApplicationUid[] = $data["APP_UID"];
|
||||
@@ -333,7 +333,7 @@ class WsBase
|
||||
|
||||
foreach ($solrQueryResult->aaData as $i => $data) {
|
||||
//Initialize array
|
||||
$delIndexes = array(); //Store all the delegation indexes
|
||||
$delIndexes = []; //Store all the delegation indexes
|
||||
//Complete empty values
|
||||
$applicationUid = $data["APP_UID"]; //APP_UID
|
||||
//Get all the indexes returned by Solr as columns
|
||||
@@ -357,7 +357,7 @@ class WsBase
|
||||
|
||||
//Get records
|
||||
foreach ($delIndexes as $delIndex) {
|
||||
$aRow = array();
|
||||
$aRow = [];
|
||||
|
||||
//Copy result values to new row from Solr server
|
||||
$aRow["APP_UID"] = $data["APP_UID"];
|
||||
@@ -394,7 +394,7 @@ class WsBase
|
||||
|
||||
return $arrayData;
|
||||
} catch (InvalidIndexSearchTextException $e) {
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$arrayData[] = array(
|
||||
"guid" => $e->getMessage(),
|
||||
@@ -407,7 +407,7 @@ class WsBase
|
||||
return $arrayData;
|
||||
}
|
||||
} else {
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
@@ -452,7 +452,7 @@ class WsBase
|
||||
return $arrayData;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$arrayData[] = array(
|
||||
"guid" => $e->getMessage(),
|
||||
@@ -475,7 +475,7 @@ class WsBase
|
||||
public function unassignedCaseList($userId)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = [];
|
||||
$oAppCache = new AppCacheView();
|
||||
$Criteria = $oAppCache->getUnassignedListCriteria($userId);
|
||||
$oDataset = AppCacheViewPeer::doSelectRS($Criteria);
|
||||
@@ -504,30 +504,34 @@ class WsBase
|
||||
}
|
||||
|
||||
/**
|
||||
* get all groups
|
||||
* Get all users
|
||||
*
|
||||
* @param none
|
||||
* @return $result will return an object
|
||||
* @return array $result, will return an array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userList()
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, 'ACTIVE');
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$result = [];
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(UsersPeer::USR_STATUS, 'ACTIVE');
|
||||
$criteria->add(UsersPeer::USR_UID, [RBAC::GUEST_USER_UID], Criteria::NOT_IN);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$result[] = array('guid' => $aRow['USR_UID'], 'name' => $aRow['USR_USERNAME']);
|
||||
$oDataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$result[] = ['guid' => $row['USR_UID'], 'name' => $row['USR_USERNAME']];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
$result[] = array('guid' => $e->getMessage(), 'name' => $e->getMessage()
|
||||
);
|
||||
$result[] = [
|
||||
'guid' => $e->getMessage(),
|
||||
'name' => $e->getMessage()
|
||||
];
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -542,7 +546,7 @@ class WsBase
|
||||
public function triggerList()
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$result = [];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(TriggersPeer::TRI_UID);
|
||||
$oCriteria->addSelectColumn(TriggersPeer::PRO_UID);
|
||||
@@ -583,12 +587,12 @@ class WsBase
|
||||
$sTaskUID = '';
|
||||
$oCriteria = $oCase->getAllUploadedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
global $_DBArray;
|
||||
|
||||
foreach ($_DBArray['inputDocuments'] as $key => $row) {
|
||||
if (isset($row['DOC_VERSION'])) {
|
||||
$docrow = array();
|
||||
$docrow = [];
|
||||
$docrow['guid'] = $row['APP_DOC_UID'];
|
||||
$docrow['filename'] = $row['APP_DOC_FILENAME'];
|
||||
$docrow['docId'] = $row['DOC_UID'];
|
||||
@@ -630,7 +634,7 @@ class WsBase
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($aRow['INP_DOC_TITLE'] == null) {
|
||||
@@ -641,7 +645,7 @@ class WsBase
|
||||
$aRow['INP_DOC_DESCRIPTION'] = $inputDocumentObj['INP_DOC_DESCRIPTION'];
|
||||
}
|
||||
|
||||
$docrow = array();
|
||||
$docrow = [];
|
||||
$docrow['guid'] = $aRow['INP_DOC_UID'];
|
||||
$docrow['name'] = $aRow['INP_DOC_TITLE'];
|
||||
$docrow['description'] = $aRow['INP_DOC_DESCRIPTION'];
|
||||
@@ -674,12 +678,12 @@ class WsBase
|
||||
$sTaskUID = '';
|
||||
$oCriteria = $oCase->getAllGeneratedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
global $_DBArray;
|
||||
|
||||
foreach ($_DBArray['outputDocuments'] as $key => $row) {
|
||||
if (isset($row['DOC_VERSION'])) {
|
||||
$docrow = array();
|
||||
$docrow = [];
|
||||
$docrow['guid'] = $row['APP_DOC_UID'];
|
||||
$docrow['filename'] = $row['DOWNLOAD_FILE'];
|
||||
|
||||
@@ -736,7 +740,7 @@ class WsBase
|
||||
$oGroup = new Groups();
|
||||
$aGroups = $oGroup->getActiveGroupsForAnUser($userId);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$oCriteria->addSelectColumn(TaskPeer::PRO_UID);
|
||||
@@ -787,13 +791,13 @@ class WsBase
|
||||
* @return $result will return an object
|
||||
*/
|
||||
public function sendMessage(
|
||||
$caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null, $showMessage = true, $delIndex = 0, $config = array(), $gmail = 0
|
||||
$caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null, $showMessage = true, $delIndex = 0, $config = [], $gmail = 0
|
||||
) {
|
||||
try {
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!empty($config)) {
|
||||
$arrayConfigAux = array();
|
||||
$arrayConfigAux = [];
|
||||
|
||||
if (is_array($config)) {
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==")) {
|
||||
@@ -962,7 +966,7 @@ class WsBase
|
||||
|
||||
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$aIndexsPaused = array();
|
||||
$aIndexsPaused = [];
|
||||
while ($oDataset->next()) {
|
||||
$data = $oDataset->getRow();
|
||||
$aIndexsPaused[] = $data['APP_DEL_INDEX'];
|
||||
@@ -993,7 +997,7 @@ class WsBase
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$aCurrentUsers = array();
|
||||
$aCurrentUsers = [];
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$aAppDel = $oDataset->getRow();
|
||||
@@ -1114,7 +1118,7 @@ class WsBase
|
||||
$strRole = $role;
|
||||
|
||||
if ($RBAC->verifyByCode($role) == 0) {
|
||||
$data = array();
|
||||
$data = [];
|
||||
$data["ROLE"] = $role;
|
||||
|
||||
$result = new WsCreateUserResponse(6, G::loadTranslation("ID_INVALID_ROLE", SYS_LANG, $data), null);
|
||||
@@ -1130,7 +1134,7 @@ class WsBase
|
||||
}
|
||||
|
||||
if ($RBAC->verifyUser($userName) == 1) {
|
||||
$data = array();
|
||||
$data = [];
|
||||
$data["USER_ID"] = $userName;
|
||||
|
||||
$result = new WsCreateUserResponse(7, G::loadTranslation("ID_USERNAME_ALREADY_EXISTS", SYS_LANG, $data), null);
|
||||
@@ -1139,7 +1143,7 @@ class WsBase
|
||||
}
|
||||
|
||||
//Set fields
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$arrayData["USR_USERNAME"] = $userName;
|
||||
$arrayData["USR_PASSWORD"] = Bootstrap::hashPassword($password);
|
||||
@@ -1175,7 +1179,7 @@ class WsBase
|
||||
$user->create($arrayData);
|
||||
|
||||
//Response
|
||||
$data = array();
|
||||
$data = [];
|
||||
$data["FIRSTNAME"] = $firstName;
|
||||
$data["LASTNAME"] = $lastName;
|
||||
$data["USER_ID"] = $userName;
|
||||
@@ -1265,7 +1269,7 @@ class WsBase
|
||||
$strRole = $role;
|
||||
|
||||
if ($RBAC->verifyByCode($role) == 0) {
|
||||
$data = array();
|
||||
$data = [];
|
||||
$data["ROLE"] = $role;
|
||||
|
||||
$result = new WsResponse(6, G::LoadTranslation("ID_INVALID_ROLE", SYS_LANG, $data));
|
||||
@@ -1288,7 +1292,7 @@ class WsBase
|
||||
$rs = UsersPeer::doSelectRS($criteria);
|
||||
|
||||
if ($rs->next()) {
|
||||
$data = array();
|
||||
$data = [];
|
||||
$data["USER_ID"] = $userName;
|
||||
|
||||
$result = new WsResponse(7, G::LoadTranslation("ID_USERNAME_ALREADY_EXISTS", SYS_LANG, $data));
|
||||
@@ -1297,7 +1301,7 @@ class WsBase
|
||||
}
|
||||
|
||||
//Set fields
|
||||
$arrayData = array();
|
||||
$arrayData = [];
|
||||
|
||||
$arrayData["USR_UID"] = $userUid;
|
||||
$arrayData["USR_USERNAME"] = $userName;
|
||||
@@ -1695,7 +1699,7 @@ class WsBase
|
||||
|
||||
$caseFields = $oCase->loadCase($caseId);
|
||||
$oldFields = $caseFields['APP_DATA'];
|
||||
$resFields = array();
|
||||
$resFields = [];
|
||||
|
||||
foreach ($variables as $key => $val) {
|
||||
$a .= $val->name . ', ';
|
||||
@@ -1763,7 +1767,7 @@ class WsBase
|
||||
$caseFields = $oCase->loadCase($caseId);
|
||||
|
||||
$oldFields = $caseFields['APP_DATA'];
|
||||
$resFields = array();
|
||||
$resFields = [];
|
||||
|
||||
foreach ($oldFields as $key => $val) {
|
||||
$node = new stdClass();
|
||||
@@ -1805,7 +1809,7 @@ class WsBase
|
||||
$_SESSION["TASK"] = $taskId;
|
||||
$_SESSION["USER_LOGGED"] = $userId;
|
||||
|
||||
$Fields = array();
|
||||
$Fields = [];
|
||||
|
||||
if (is_array($variables) && count($variables) > 0) {
|
||||
$Fields = $variables;
|
||||
@@ -2117,7 +2121,7 @@ class WsBase
|
||||
* @param bool $bExecuteTriggersBeforeAssignment
|
||||
* @return $result will return an object
|
||||
*/
|
||||
public function derivateCase($userId, $caseId, $delIndex, $bExecuteTriggersBeforeAssignment = false, $tasks = array())
|
||||
public function derivateCase($userId, $caseId, $delIndex, $bExecuteTriggersBeforeAssignment = false, $tasks = [])
|
||||
{
|
||||
$g = new G();
|
||||
|
||||
@@ -2131,7 +2135,7 @@ class WsBase
|
||||
//Define variables
|
||||
$sStatus = 'TO_DO';
|
||||
$varResponse = '';
|
||||
$previousAppData = array();
|
||||
$previousAppData = [];
|
||||
|
||||
if ($delIndex == '') {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -2177,7 +2181,7 @@ class WsBase
|
||||
}
|
||||
}
|
||||
|
||||
$aData = array();
|
||||
$aData = [];
|
||||
$aData['APP_UID'] = $caseId;
|
||||
$aData['DEL_INDEX'] = $delIndex;
|
||||
$aData['USER_UID'] = $userId;
|
||||
@@ -2233,7 +2237,7 @@ class WsBase
|
||||
|
||||
foreach ($derive as $key => $val) {
|
||||
//Routed to the next task, if end process then not exist user
|
||||
$nodeNext = array();
|
||||
$nodeNext = [];
|
||||
$usrasgdUid = null;
|
||||
$usrasgdUserName = null;
|
||||
|
||||
@@ -2344,7 +2348,7 @@ class WsBase
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$aCurrentUsers = array();
|
||||
$aCurrentUsers = [];
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$aAppDel = $oDataset->getRow();
|
||||
@@ -2481,7 +2485,7 @@ class WsBase
|
||||
}
|
||||
|
||||
//executeTrigger
|
||||
$aTriggers = array();
|
||||
$aTriggers = [];
|
||||
$c = new Criteria();
|
||||
$c->add(TriggersPeer::TRI_UID, $triggerIndex);
|
||||
$rs = TriggersPeer::doSelectRS($c);
|
||||
@@ -2543,7 +2547,7 @@ class WsBase
|
||||
*/
|
||||
public function taskCase($caseId)
|
||||
{
|
||||
$result = array();
|
||||
$result = [];
|
||||
try {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
@@ -2586,7 +2590,7 @@ class WsBase
|
||||
try {
|
||||
$oCase = new Cases();
|
||||
$rows = $oCase->getStartCases($userId);
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
foreach ($rows as $key => $val) {
|
||||
if ($key != 0) {
|
||||
@@ -2671,7 +2675,7 @@ class WsBase
|
||||
* ****************( 3 )*****************
|
||||
*/
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$aConditions = array();
|
||||
$aConditions = [];
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $caseId);
|
||||
$oCriteria->add(AppDelegationPeer::USR_UID, $userIdSource);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $delIndex);
|
||||
@@ -2802,10 +2806,10 @@ class WsBase
|
||||
try {
|
||||
$result = new WsGetCaseNotesResponse(0, G::loadTranslation('ID_SUCCESS'), Cases::getCaseNotes($applicationID, 'array', $userUid));
|
||||
|
||||
$var = array();
|
||||
$var = [];
|
||||
|
||||
foreach ($result->notes as $key => $value) {
|
||||
$var2 = array();
|
||||
$var2 = [];
|
||||
|
||||
foreach ($value as $keys => $values) {
|
||||
$field = strtolower($keys);
|
||||
|
||||
@@ -1,33 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* TaskUser.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseTaskUser.php';
|
||||
//require_once 'classes/model/Content.php';
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'GROUP_USER' table.
|
||||
*
|
||||
@@ -39,42 +10,59 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
use ProcessMaker\BusinessModel\WebEntry;
|
||||
class TaskUser extends BaseTaskUser
|
||||
{
|
||||
|
||||
/**
|
||||
* Create the application document registry
|
||||
* Create the new record in the table TaskUser
|
||||
*
|
||||
* @param array $aData
|
||||
* @param array $requestData
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function create ($aData)
|
||||
public function create ($requestData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( TaskUserPeer::DATABASE_NAME );
|
||||
$connection = Propel::getConnection(TaskUserPeer::DATABASE_NAME);
|
||||
try {
|
||||
$taskUser = TaskUserPeer::retrieveByPK( $aData['TAS_UID'], $aData['USR_UID'], $aData['TU_TYPE'], $aData['TU_RELATION'] );
|
||||
|
||||
if (is_object( $taskUser )) {
|
||||
return - 1;
|
||||
$bmWebEntry = new WebEntry;
|
||||
//Check the usrUid value
|
||||
if (RBAC::isGuestUserUid($requestData['USR_UID']) && !$bmWebEntry->isTaskAWebEntry($requestData['TAS_UID'])) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($requestData['USR_UID'])));
|
||||
return false;
|
||||
}
|
||||
$oTaskUser = new TaskUser();
|
||||
$oTaskUser->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oTaskUser->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oTaskUser->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
|
||||
$taskUser = TaskUserPeer::retrieveByPK(
|
||||
$requestData['TAS_UID'],
|
||||
$requestData['USR_UID'],
|
||||
$requestData['TU_TYPE'],
|
||||
$requestData['TU_RELATION']
|
||||
);
|
||||
|
||||
if (is_object($taskUser)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
$taskUser = new TaskUser();
|
||||
$taskUser->fromArray($requestData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($taskUser->validate()) {
|
||||
$connection->begin();
|
||||
$result = $taskUser->save();
|
||||
$connection->commit();
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oTaskUser->getValidationFailures();
|
||||
$message = '';
|
||||
$aValidationFailures = $taskUser->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
$message .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
|
||||
throw (new Exception('The registry cannot be created!<br />' . $message));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
$connection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,10 +281,20 @@ class Users extends BaseUsers
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all information about the user
|
||||
* @param string $userUid
|
||||
* @return array $arrayData
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getAllInformation ($userUid)
|
||||
{
|
||||
if (! isset( $userUid ) || $userUid == "") {
|
||||
throw (new Exception( "$userUid is empty." ));
|
||||
if (!isset($userUid) || empty($userUid)) {
|
||||
throw (new Exception('$userUid is empty.'));
|
||||
}
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUid)));
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
INSERT INTO USERS (USR_UID,USR_USERNAME,USR_PASSWORD,USR_FIRSTNAME,USR_LASTNAME,USR_EMAIL,USR_DUE_DATE,USR_CREATE_DATE,USR_UPDATE_DATE,USR_STATUS,USR_COUNTRY,USR_CITY,USR_LOCATION,USR_ADDRESS,USR_PHONE,USR_FAX,USR_CELLULAR,USR_ZIP_CODE,DEP_UID,USR_POSITION,USR_RESUME,USR_BIRTHDAY,USR_ROLE,USR_REPORTS_TO,USR_REPLACED_BY ) VALUES
|
||||
('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator',' ', 'admin@processmaker.com','2020-01-01','1999-11-30 00:00:00','2008-05-23 18:36:19','ACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Administrator', '','1999-02-25','PROCESSMAKER_ADMIN','','');
|
||||
('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator',' ', 'admin@processmaker.com','2020-01-01','1999-11-30 00:00:00','2008-05-23 18:36:19','ACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Administrator', '','1999-02-25','PROCESSMAKER_ADMIN','',''),
|
||||
('00000000000000000000000000000002','guest','674ba9750749d735ec9787d606170d78','Guest',' ', 'guest@processmaker.com','2200-01-01','2009-02-01 12:24:36','2009-02-01 12:24:36','INACTIVE', 'US','FL','MMK','','', '1-305-402-0282','1-305-675-1400','','','Guest', '','2009-02-01','PROCESSMAKER_GUEST','','');
|
||||
|
||||
INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
|
||||
('ROL_NAME','','00000000000000000000000000000002','en','System Administrator'),
|
||||
|
||||
@@ -64,6 +64,7 @@ if ($actionAjax == "userValues") {
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_ID);
|
||||
break;
|
||||
}
|
||||
$cUsers->add(UsersPeer::USR_UID, [RBAC::GUEST_USER_UID], Criteria::NOT_IN);
|
||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
|
||||
@@ -1,38 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* main.php Cases List main processor
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions( 'PM_CASES' );
|
||||
$RBAC->requirePermissions('PM_CASES/strict');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
|
||||
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
|
||||
$_POST['qs'] = isset($_SERVER['QUERY_STRING'])
|
||||
&& $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_Load');
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
@@ -252,7 +252,8 @@ switch ($_POST['action']) {
|
||||
$subQuery = "SELECT " . GroupUserPeer::USR_UID .
|
||||
" FROM " . GroupUserPeer::TABLE_NAME .
|
||||
" WHERE " . GroupUserPeer::GRP_UID . " = '" .
|
||||
$inputFilter->quoteSmart($_REQUEST['gUID'], Propel::getConnection("workflow")) . "'";
|
||||
$inputFilter->quoteSmart($_REQUEST['gUID'], Propel::getConnection("workflow")) . "'\n" .
|
||||
"UNION SELECT '" . RBAC::GUEST_USER_UID . "'";
|
||||
|
||||
$aUsers = Array ();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
|
||||
@@ -293,7 +293,7 @@ try {
|
||||
|
||||
// Assign the uid of user to userloggedobj
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
|
||||
$res = $RBAC->userCanAccess('PM_LOGIN');
|
||||
$res = $RBAC->userCanAccess('PM_LOGIN/strict');
|
||||
if ($res != 1 ) {
|
||||
if ($res == -2) {
|
||||
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
|
||||
|
||||
@@ -981,14 +981,7 @@ function ifPermission($sessionId, $permission)
|
||||
|
||||
$oRBAC = RBAC::getSingleton();
|
||||
$oRBAC->loadUserRolePermission($oRBAC->sSystem, $user['USR_UID']);
|
||||
$aPermissions = $oRBAC->aUserInfo[$oRBAC->sSystem]['PERMISSIONS'];
|
||||
$sw = 0;
|
||||
|
||||
foreach ($aPermissions as $aPermission) {
|
||||
if ($aPermission['PER_CODE'] == $permission) {
|
||||
$sw = 1;
|
||||
}
|
||||
}
|
||||
$sw = $oRBAC->userCanAccess($permission) === 1 ? 1 : 0;
|
||||
|
||||
return $sw;
|
||||
}
|
||||
|
||||
@@ -8,33 +8,33 @@ global $RBAC;
|
||||
G::LoadClass('pmFunctions');
|
||||
try {
|
||||
if (empty($_REQUEST['we_uid'])) {
|
||||
throw new \Exception('Missing required field "we_uid"');
|
||||
throw new Exception('Missing required field "we_uid"');
|
||||
}
|
||||
|
||||
$weUid = $_REQUEST['we_uid'];
|
||||
|
||||
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
|
||||
$webEntry = WebEntryPeer::retrieveByPK($weUid);
|
||||
if (empty($webEntry)) {
|
||||
throw new \Exception('Undefined WebEntry');
|
||||
throw new Exception('Undefined WebEntry');
|
||||
}
|
||||
|
||||
$userUid = $webEntry->getUsrUid();
|
||||
$userInfo = PMFInformationUser($userUid);
|
||||
$userInfo = UsersPeer::retrieveByPK($userUid);
|
||||
if (empty($userInfo)) {
|
||||
throw new \Exception('WebEntry User not found');
|
||||
throw new Exception('WebEntry User not found');
|
||||
}
|
||||
|
||||
initUserSession($userUid, $userInfo['username']);
|
||||
initUserSession($userUid, $userInfo->getUsrUsername());
|
||||
|
||||
$result = [
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo['username'],
|
||||
'firstName' => $userInfo['firstname'],
|
||||
'lastName' => $userInfo['lastname'],
|
||||
'mail' => $userInfo['mail'],
|
||||
'user_logged' => $userUid,
|
||||
'userName' => $userInfo->getUsrUsername(),
|
||||
'firstName' => $userInfo->getUsrFirstName(),
|
||||
'lastName' => $userInfo->getUsrLastName(),
|
||||
'mail' => $userInfo->getUsrEmail(),
|
||||
'image' => '../users/users_ViewPhoto?t='.microtime(true),
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$result = [
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* dashboard.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions('PM_DASHBOARD');
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if (!$licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
}
|
||||
|
||||
@@ -33,10 +11,10 @@ $G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'DASHBOARD+';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'strategicDashboard/load' );
|
||||
$G_PUBLISH->AddContent('view', 'strategicDashboard/load');
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
G::RenderPage( 'publish' );
|
||||
G::RenderPage('publish');
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
|
||||
//Check guest user
|
||||
if (isset($_GET['USR_UID']) && RBAC::isGuestUserUid($_GET['USR_UID'])) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($_GET['USR_UID'])));
|
||||
return;
|
||||
}
|
||||
|
||||
//calculating the max upload file size;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
|
||||
@@ -95,6 +95,11 @@ try {
|
||||
$total = $webEntry->getWebEntryRelatedToUser($userUid);
|
||||
}
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
$total++;
|
||||
}
|
||||
|
||||
$response = '{success: true, candelete: ';
|
||||
$response .= ($total > 0) ? 'false' : 'true';
|
||||
$response .= ', hashistory: ';
|
||||
|
||||
@@ -43,20 +43,25 @@ class Catalog
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Catalog
|
||||
* Update Catalog.
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group update
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @return array Return data of the new Group update
|
||||
*
|
||||
* @access private
|
||||
* @deprecated since 3.2.2
|
||||
*/
|
||||
public function update($cat_uid, $cat_type, $arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->update($cat_uid, $cat_type, $arrayData);
|
||||
$arrayData['CAT_UID'] = $cat_uid;
|
||||
$arrayData['CAT_TYPE'] = !isset($arrayData['CAT_TYPE'])
|
||||
? $cat_type
|
||||
: $arrayData['CAT_TYPE'];
|
||||
$response = $catalog->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \UsersPeer;
|
||||
use \DepartmentPeer;
|
||||
use BasePeer;
|
||||
use Configurations;
|
||||
use Criteria;
|
||||
use Department as DepartmentModel;
|
||||
use DepartmentPeer;
|
||||
use Exception;
|
||||
use ProcessMaker\BusinessModel\Validator;
|
||||
use Propel;
|
||||
use RBAC;
|
||||
use ResultSet;
|
||||
use Users;
|
||||
use UsersPeer;
|
||||
use G;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Department
|
||||
{
|
||||
/**
|
||||
@@ -16,27 +22,26 @@ class Department
|
||||
*
|
||||
* @param string $departmentTitle Title
|
||||
* @param string $departmentUidExclude Unique id of Department to exclude
|
||||
*
|
||||
* return bool Return true if exists the title of a Department, false otherwise
|
||||
* @return bool Return true if exists the title of a Department, false otherwise
|
||||
*/
|
||||
public function existsTitle($departmentTitle, $departmentUidExclude = "")
|
||||
{
|
||||
try {
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\DepartmentPeer::DEP_UID);
|
||||
$criteria->addSelectColumn(\DepartmentPeer::DEP_TITLE);
|
||||
$criteria->addSelectColumn(DepartmentPeer::DEP_UID);
|
||||
$criteria->addSelectColumn(DepartmentPeer::DEP_TITLE);
|
||||
|
||||
if ($departmentUidExclude != "") {
|
||||
$criteria->add(\DepartmentPeer::DEP_UID, $departmentUidExclude, \Criteria::NOT_EQUAL);
|
||||
$criteria->add(DepartmentPeer::DEP_UID, $departmentUidExclude, Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
$criteria->add(\DepartmentPeer::DEP_TITLE, $departmentTitle, \Criteria::EQUAL);
|
||||
$criteria->add(DepartmentPeer::DEP_TITLE, $departmentTitle, Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \DepartmentPeer::doSelectRS($criteria);
|
||||
$rsCriteria = DepartmentPeer::doSelectRS($criteria);
|
||||
|
||||
return ($rsCriteria->next())? true : false;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -46,18 +51,17 @@ class Department
|
||||
*
|
||||
* @param string $departmentUid
|
||||
* @param string $userUid
|
||||
*
|
||||
* return void Throw exception user not exists
|
||||
* @return void Throw exception user not exists
|
||||
*/
|
||||
private function throwExceptionUserNotExistsInDepartment($departmentUid, $userUid)
|
||||
{
|
||||
try {
|
||||
$user = \UsersPeer::retrieveByPK($userUid);
|
||||
$user = UsersPeer::retrieveByPK($userUid);
|
||||
|
||||
if (is_null($user) || $user->getDepUid() != $departmentUid) {
|
||||
throw new \Exception(\G::LoadTranslation('ID_USER_NOT_EXIST_DEPARTMENT', [$userUid]));
|
||||
throw new Exception(G::LoadTranslation('ID_USER_NOT_EXIST_DEPARTMENT', [$userUid]));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -68,16 +72,15 @@ class Department
|
||||
* @param string $departmentTitle Title
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
* @param string $departmentUidExclude Unique id of Department to exclude
|
||||
*
|
||||
* return void Throw exception if exists the title of a Department
|
||||
* @return void Throw exception if exists the title of a Department
|
||||
*/
|
||||
public function throwExceptionIfExistsTitle($departmentTitle, $fieldNameForException, $departmentUidExclude = "")
|
||||
{
|
||||
try {
|
||||
if ($this->existsTitle($departmentTitle, $departmentUidExclude)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_DEPARTMENT_TITLE_ALREADY_EXISTS", array($fieldNameForException, $departmentTitle)));
|
||||
throw new Exception(G::LoadTranslation("ID_DEPARTMENT_TITLE_ALREADY_EXISTS", array($fieldNameForException, $departmentTitle)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +92,6 @@ class Department
|
||||
* @param array $arrayVariableNameForException Variable name for exception
|
||||
* @param bool $throwException Flag to throw the exception if the main parameters are invalid or do not exist
|
||||
* (TRUE: throw the exception; FALSE: returns FALSE)
|
||||
*
|
||||
* @return array Returns an array with Department record, ThrowTheException/FALSE otherwise
|
||||
*/
|
||||
public function getDepartmentRecordByPk(
|
||||
@@ -98,11 +100,11 @@ class Department
|
||||
$throwException = true
|
||||
) {
|
||||
try {
|
||||
$obj = \DepartmentPeer::retrieveByPK($departmentUid);
|
||||
$obj = DepartmentPeer::retrieveByPK($departmentUid);
|
||||
|
||||
if (is_null($obj)) {
|
||||
if ($throwException) {
|
||||
throw new \Exception(\G::LoadTranslation(
|
||||
throw new Exception(G::LoadTranslation(
|
||||
'ID_DEPARTMENT_NOT_EXIST', [$arrayVariableNameForException['$departmentUid'], $departmentUid]
|
||||
));
|
||||
} else {
|
||||
@@ -111,8 +113,8 @@ class Department
|
||||
}
|
||||
|
||||
//Return
|
||||
return $obj->toArray(\BasePeer::TYPE_FIELDNAME);
|
||||
} catch (\Exception $e) {
|
||||
return $obj->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -121,14 +123,11 @@ class Department
|
||||
* Get list for Departments
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDepartments()
|
||||
{
|
||||
$oDepartment = new \Department();
|
||||
$oDepartment = new DepartmentModel();
|
||||
$aDepts = $oDepartment->getDepartments('');
|
||||
foreach ($aDepts as &$depData) {
|
||||
$depData['DEP_CHILDREN'] = $this->getChildren($depData);
|
||||
@@ -142,15 +141,14 @@ class Department
|
||||
*
|
||||
* @param string $departmentUid Unique id of Department
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the User assigned to Department
|
||||
*/
|
||||
public function assignUser($departmentUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
||||
$process = new Process();
|
||||
$validator = new Validator();
|
||||
|
||||
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||
@@ -172,14 +170,14 @@ class Department
|
||||
);
|
||||
|
||||
//Verify data
|
||||
$departmentUid = \ProcessMaker\BusinessModel\Validator::depUid($departmentUid);
|
||||
$departmentUid = Validator::depUid($departmentUid);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $arrayUserFieldDefinition, $arrayUserFieldNameForException, true);
|
||||
|
||||
$process->throwExceptionIfNotExistsUser($arrayData["USR_UID"], $arrayUserFieldNameForException["userUid"]);
|
||||
|
||||
//Assign User
|
||||
$department = new \Department();
|
||||
$department = new DepartmentModel();
|
||||
|
||||
$department->load($departmentUid);
|
||||
|
||||
@@ -192,7 +190,7 @@ class Department
|
||||
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
|
||||
|
||||
return $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -201,9 +199,6 @@ class Department
|
||||
* Post Unassign User
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unassignUser($dep_uid, $usr_uid)
|
||||
@@ -213,7 +208,7 @@ class Department
|
||||
|
||||
$this->throwExceptionUserNotExistsInDepartment($dep_uid, $usr_uid);
|
||||
|
||||
$dep = new \Department();
|
||||
$dep = new DepartmentModel();
|
||||
$dep->load( $dep_uid );
|
||||
$manager = $dep->getDepManager();
|
||||
$dep->removeUserFromDepartment( $dep_uid, $usr_uid );
|
||||
@@ -229,7 +224,6 @@ class Department
|
||||
* Get custom record
|
||||
*
|
||||
* @param array $record Record
|
||||
*
|
||||
* @return array Return an array with custom record
|
||||
*/
|
||||
private function __getUserCustomRecordFromRecord(array $record)
|
||||
@@ -248,7 +242,7 @@ class Department
|
||||
}
|
||||
|
||||
return $recordc;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +260,6 @@ class Department
|
||||
* @param bool $flagRecord Flag that set the "getting" of record
|
||||
* @param bool $throwException Flag to throw the exception (This only if the parameters are invalid)
|
||||
* (TRUE: throw the exception; FALSE: returns FALSE)
|
||||
*
|
||||
* @return array Return an array with all Users of a Department, ThrowTheException/FALSE otherwise
|
||||
*/
|
||||
public function getUsers(
|
||||
@@ -288,14 +281,14 @@ class Department
|
||||
//Verify data and Set variables
|
||||
$flagFilter = !is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']);
|
||||
|
||||
$result = \ProcessMaker\BusinessModel\Validator::validatePagerDataByPagerDefinition(
|
||||
$result = Validator::validatePagerDataByPagerDefinition(
|
||||
['$start' => $start, '$limit' => $limit],
|
||||
['$start' => '$start', '$limit' => '$limit']
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
if ($throwException) {
|
||||
throw new \Exception($result);
|
||||
throw new Exception($result);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -336,22 +329,23 @@ class Department
|
||||
}
|
||||
|
||||
//Query
|
||||
$criteria = new \Criteria('workflow');
|
||||
$criteria = new Criteria('workflow');
|
||||
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_STATUS);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_STATUS);
|
||||
|
||||
$criteria->add(\UsersPeer::USR_STATUS, 'CLOSED', \Criteria::NOT_EQUAL);
|
||||
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
|
||||
switch ($option) {
|
||||
case 'ASSIGNED':
|
||||
$criteria->add(\UsersPeer::DEP_UID, $departmentUid, \Criteria::EQUAL);
|
||||
$criteria->add(UsersPeer::DEP_UID, $departmentUid, Criteria::EQUAL);
|
||||
break;
|
||||
case 'AVAILABLE':
|
||||
$criteria->add(\UsersPeer::DEP_UID, '', \Criteria::EQUAL);
|
||||
$criteria->add(UsersPeer::DEP_UID, '', Criteria::EQUAL);
|
||||
$criteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -367,24 +361,24 @@ class Department
|
||||
];
|
||||
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(\UsersPeer::USR_USERNAME, $search, \Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, $search, \Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(\UsersPeer::USR_LASTNAME, $search, \Criteria::LIKE)))
|
||||
$criteria->getNewCriterion(UsersPeer::USR_USERNAME, $search, Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, $search, Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(UsersPeer::USR_LASTNAME, $search, Criteria::LIKE)))
|
||||
);
|
||||
}
|
||||
|
||||
//Number records total
|
||||
$numRecTotal = \UsersPeer::doCount($criteria);
|
||||
$numRecTotal = UsersPeer::doCount($criteria);
|
||||
|
||||
//Query
|
||||
$conf = new \Configurations();
|
||||
$sortFieldDefault = \UsersPeer::TABLE_NAME . '.' . $conf->userNameFormatGetFirstFieldByUsersTable();
|
||||
$conf = new Configurations();
|
||||
$sortFieldDefault = UsersPeer::TABLE_NAME . '.' . $conf->userNameFormatGetFirstFieldByUsersTable();
|
||||
|
||||
if (!is_null($sortField) && trim($sortField) != '') {
|
||||
$sortField = strtoupper($sortField);
|
||||
|
||||
if (in_array(\UsersPeer::TABLE_NAME . '.' . $sortField, $criteria->getSelectColumns())) {
|
||||
$sortField = \UsersPeer::TABLE_NAME . '.' . $sortField;
|
||||
if (in_array(UsersPeer::TABLE_NAME . '.' . $sortField, $criteria->getSelectColumns())) {
|
||||
$sortField = UsersPeer::TABLE_NAME . '.' . $sortField;
|
||||
} else {
|
||||
$sortField = $sortFieldDefault;
|
||||
}
|
||||
@@ -406,8 +400,8 @@ class Department
|
||||
$criteria->setLimit((int)($limit));
|
||||
}
|
||||
|
||||
$rsCriteria = \UsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria = UsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$record = $rsCriteria->getRow();
|
||||
@@ -431,7 +425,7 @@ class Department
|
||||
$filterName => ($flagFilter)? $arrayFilterData['filter'] : '',
|
||||
'data' => $arrayUser
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -440,9 +434,6 @@ class Department
|
||||
* Put Set Manager User
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setManagerUser($dep_uid, $usr_uid)
|
||||
@@ -450,23 +441,23 @@ class Department
|
||||
$dep_uid = Validator::depUid($dep_uid);
|
||||
$usr_uid = Validator::usrUid($usr_uid);
|
||||
|
||||
$oCriteria = new \Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( DepartmentPeer::DEP_UID );
|
||||
$oCriteria->add( DepartmentPeer::DEP_MANAGER, $usr_uid, \Criteria::EQUAL );
|
||||
$oCriteria->add( DepartmentPeer::DEP_MANAGER, $usr_uid, Criteria::EQUAL );
|
||||
|
||||
$oDataset = DepartmentPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
if ($oDataset->next()) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_DEPARTMENT_MANAGER_EXIST", array('usr_uid',$usr_uid))));
|
||||
throw (new Exception(G::LoadTranslation("ID_DEPARTMENT_MANAGER_EXIST", array('usr_uid',$usr_uid))));
|
||||
}
|
||||
|
||||
$editDepartment['DEP_UID'] = $dep_uid;
|
||||
$editDepartment['DEP_MANAGER'] = $usr_uid;
|
||||
$oDept = new \Department();
|
||||
$oDept = new DepartmentModel();
|
||||
$oDept->update( $editDepartment );
|
||||
$oDept->updateDepartmentManager( $dep_uid );
|
||||
|
||||
$oDept = new \Department();
|
||||
$oDept = new DepartmentModel();
|
||||
$oDept->Load($dep_uid);
|
||||
$oDept->addUserToDepartment($dep_uid, $usr_uid, ($oDept->getDepManager() == "")? true : false, false);
|
||||
$oDept->updateDepartmentManager($dep_uid);
|
||||
@@ -474,22 +465,19 @@ class Department
|
||||
|
||||
/**
|
||||
* Get list for Departments
|
||||
*
|
||||
* @var string $dep_uid. Uid for Department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDepartment($dep_uid)
|
||||
{
|
||||
$dep_uid = Validator::depUid($dep_uid);
|
||||
$criteria = new \Criteria( 'workflow' );
|
||||
$criteria->add( DepartmentPeer::DEP_UID, $dep_uid, \Criteria::EQUAL );
|
||||
$con = \Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->add( DepartmentPeer::DEP_UID, $dep_uid, Criteria::EQUAL );
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$objects = DepartmentPeer::doSelect( $criteria, $con );
|
||||
$oUsers = new \Users();
|
||||
$oUsers = new Users();
|
||||
|
||||
$node = array ();
|
||||
foreach ($objects as $oDepartment) {
|
||||
@@ -513,14 +501,14 @@ class Department
|
||||
$node['DEP_MANAGER_LASTNAME'] = '';
|
||||
}
|
||||
|
||||
$criteria = new \Criteria();
|
||||
$criteria->add(UsersPeer::DEP_UID, $dep_uid, \Criteria::EQUAL );
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(UsersPeer::DEP_UID, $dep_uid, Criteria::EQUAL );
|
||||
$node['DEP_MEMBERS'] = UsersPeer::doCount($criteria);
|
||||
|
||||
$criteriaCount = new \Criteria( 'workflow' );
|
||||
$criteriaCount = new Criteria( 'workflow' );
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn( 'COUNT(*)' );
|
||||
$criteriaCount->add( DepartmentPeer::DEP_PARENT, $oDepartment->getDepUid(), \Criteria::EQUAL );
|
||||
$criteriaCount->add( DepartmentPeer::DEP_PARENT, $oDepartment->getDepUid(), Criteria::EQUAL );
|
||||
$rs = DepartmentPeer::doSelectRS( $criteriaCount );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
@@ -532,13 +520,10 @@ class Department
|
||||
|
||||
/**
|
||||
* Save Department
|
||||
*
|
||||
* @var string $dep_data. Data for Process
|
||||
* @var string $create. Flag for create or update
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveDepartment($dep_data, $create = true)
|
||||
@@ -553,7 +538,7 @@ class Department
|
||||
unset($dep_data["DEP_UID"]);
|
||||
}
|
||||
|
||||
$oDepartment = new \Department();
|
||||
$oDepartment = new DepartmentModel();
|
||||
if (isset($dep_data['DEP_UID']) && $dep_data['DEP_UID'] != '') {
|
||||
Validator::depUid($dep_data['DEP_UID']);
|
||||
}
|
||||
@@ -580,7 +565,7 @@ class Department
|
||||
if (isset($dep_data['DEP_TITLE'])) {
|
||||
$this->throwExceptionIfExistsTitle($dep_data["DEP_TITLE"], strtolower("DEP_TITLE"));
|
||||
} else {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_FIELD_REQUIRED", array('dep_title'))));
|
||||
throw (new Exception(G::LoadTranslation("ID_FIELD_REQUIRED", array('dep_title'))));
|
||||
}
|
||||
|
||||
$dep_uid = $oDepartment->create($dep_data);
|
||||
@@ -594,41 +579,35 @@ class Department
|
||||
* @var string $dep_uid. Uid for department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteDepartment($dep_uid)
|
||||
{
|
||||
$dep_uid = Validator::depUid($dep_uid);
|
||||
$oDepartment = new \Department();
|
||||
$oDepartment = new DepartmentModel();
|
||||
$countUsers = $oDepartment->cantUsersInDepartment($dep_uid);
|
||||
if ($countUsers != 0) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CANT_DELETE_DEPARTMENT_HAS_USERS")));
|
||||
throw (new Exception(G::LoadTranslation("ID_CANT_DELETE_DEPARTMENT_HAS_USERS")));
|
||||
}
|
||||
$dep_data = $this->getDepartment($dep_uid);
|
||||
if ($dep_data['has_children'] != 0) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_CANT_DELETE_DEPARTMENT_HAS_CHILDREN")));
|
||||
throw (new Exception(G::LoadTranslation("ID_CANT_DELETE_DEPARTMENT_HAS_CHILDREN")));
|
||||
}
|
||||
$oDepartment->remove($dep_uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for Children for department
|
||||
*
|
||||
* @var array $dataDep. Data for child department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getChildren ($dataDep)
|
||||
{
|
||||
$children = array();
|
||||
if ((int)$dataDep['HAS_CHILDREN'] > 0) {
|
||||
$oDepartment = new \Department();
|
||||
$oDepartment = new DepartmentModel();
|
||||
$aDepts = $oDepartment->getDepartments($dataDep['DEP_UID']);
|
||||
foreach ($aDepts as &$depData) {
|
||||
$depData['DEP_CHILDREN'] = $this->getChildren($depData);
|
||||
@@ -639,4 +618,3 @@ class Department
|
||||
return $children;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel\Role;
|
||||
|
||||
use Configurations;
|
||||
use Criteria;
|
||||
use Exception;
|
||||
use G;
|
||||
use ProcessMaker\BusinessModel\Process;
|
||||
use ProcessMaker\BusinessModel\Role;
|
||||
use ProcessMaker\BusinessModel\Validator;
|
||||
use RBAC;
|
||||
use RbacUsersPeer;
|
||||
use ResultSet;
|
||||
use Roles;
|
||||
use UsersRolesPeer;
|
||||
|
||||
class User
|
||||
{
|
||||
private $arrayFieldDefinition = array(
|
||||
@@ -19,7 +32,7 @@ class User
|
||||
/**
|
||||
* Constructor of the class
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -27,7 +40,7 @@ class User
|
||||
foreach ($this->arrayFieldDefinition as $key => $value) {
|
||||
$this->arrayFieldNameForException[$value["fieldNameAux"]] = $key;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -36,8 +49,7 @@ class User
|
||||
* Set the format of the fields name (uppercase, lowercase)
|
||||
*
|
||||
* @param bool $flag Value that set the format
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
*/
|
||||
public function setFormatFieldNameInUppercase($flag)
|
||||
{
|
||||
@@ -45,7 +57,7 @@ class User
|
||||
$this->formatFieldNameInUppercase = $flag;
|
||||
|
||||
$this->setArrayFieldNameForException($this->arrayFieldNameForException);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -54,8 +66,7 @@ class User
|
||||
* Set exception messages for fields
|
||||
*
|
||||
* @param array $arrayData Data with the fields
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
*/
|
||||
public function setArrayFieldNameForException(array $arrayData)
|
||||
{
|
||||
@@ -63,7 +74,7 @@ class User
|
||||
foreach ($arrayData as $key => $value) {
|
||||
$this->arrayFieldNameForException[$key] = $this->getFieldNameByFormatFieldName($value);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -72,14 +83,13 @@ class User
|
||||
* Get the name of the field according to the format
|
||||
*
|
||||
* @param string $fieldName Field name
|
||||
*
|
||||
* return string Return the field name according the format
|
||||
* @return string Return the field name according the format
|
||||
*/
|
||||
public function getFieldNameByFormatFieldName($fieldName)
|
||||
{
|
||||
try {
|
||||
return ($this->formatFieldNameInUppercase)? strtoupper($fieldName) : strtolower($fieldName);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -90,18 +100,17 @@ class User
|
||||
* @param string $roleUid Unique id of Role
|
||||
* @param string $userUid Unique id of User
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
*
|
||||
* return void Throw exception if it's assigned the User to Role
|
||||
* @return void Throw exception if it's assigned the User to Role
|
||||
*/
|
||||
public function throwExceptionIfItsAssignedUserToRole($roleUid, $userUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$obj = \UsersRolesPeer::retrieveByPK($userUid, $roleUid);
|
||||
$obj = UsersRolesPeer::retrieveByPK($userUid, $roleUid);
|
||||
|
||||
if (!is_null($obj)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ROLE_USER_IS_ALREADY_ASSIGNED", array($fieldNameForException, $userUid)));
|
||||
throw new Exception(G::LoadTranslation("ID_ROLE_USER_IS_ALREADY_ASSIGNED", array($fieldNameForException, $userUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -112,18 +121,17 @@ class User
|
||||
* @param string $roleUid Unique id of Role
|
||||
* @param string $userUid Unique id of User
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
*
|
||||
* return void Throw exception if not it's assigned the User to Role
|
||||
* @return void Throw exception if not it's assigned the User to Role
|
||||
*/
|
||||
public function throwExceptionIfNotItsAssignedUserToRole($roleUid, $userUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$obj = \UsersRolesPeer::retrieveByPK($userUid, $roleUid);
|
||||
$obj = UsersRolesPeer::retrieveByPK($userUid, $roleUid);
|
||||
|
||||
if (is_null($obj)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ROLE_USER_IS_NOT_ASSIGNED", array($fieldNameForException, $userUid)));
|
||||
throw new Exception(G::LoadTranslation("ID_ROLE_USER_IS_NOT_ASSIGNED", array($fieldNameForException, $userUid)));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -133,15 +141,14 @@ class User
|
||||
*
|
||||
* @param string $roleUid Unique id of Role
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the User assigned to Role
|
||||
* @return array Return data of the User assigned to Role
|
||||
*/
|
||||
public function create($roleUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
||||
$process = new Process();
|
||||
$validator = new Validator();
|
||||
|
||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||
|
||||
@@ -151,7 +158,7 @@ class User
|
||||
unset($arrayData["ROL_UID"]);
|
||||
|
||||
//Verify data
|
||||
$role = new \ProcessMaker\BusinessModel\Role();
|
||||
$role = new Role();
|
||||
|
||||
$role->throwExceptionIfNotExistsRole($roleUid, $this->arrayFieldNameForException["roleUid"]);
|
||||
|
||||
@@ -162,11 +169,11 @@ class User
|
||||
$this->throwExceptionIfItsAssignedUserToRole($roleUid, $arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
if ($arrayData["USR_UID"] == "00000000000000000000000000000001") {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ADMINISTRATOR_ROLE_CANT_CHANGED"));
|
||||
throw new Exception(G::LoadTranslation("ID_ADMINISTRATOR_ROLE_CANT_CHANGED"));
|
||||
}
|
||||
|
||||
//Create
|
||||
$role = new \Roles();
|
||||
$role = new Roles();
|
||||
|
||||
$arrayData = array_merge(array("ROL_UID" => $roleUid), $arrayData);
|
||||
|
||||
@@ -178,7 +185,7 @@ class User
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -188,15 +195,14 @@ class User
|
||||
*
|
||||
* @param string $roleUid Unique id of Role
|
||||
* @param string $userUid Unique id of User
|
||||
*
|
||||
* return void
|
||||
* @return void
|
||||
*/
|
||||
public function delete($roleUid, $userUid)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$role = new \ProcessMaker\BusinessModel\Role();
|
||||
$process = new Process();
|
||||
$role = new Role();
|
||||
|
||||
$role->throwExceptionIfNotExistsRole($roleUid, $this->arrayFieldNameForException["roleUid"]);
|
||||
|
||||
@@ -205,14 +211,14 @@ class User
|
||||
$this->throwExceptionIfNotItsAssignedUserToRole($roleUid, $userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
if ($userUid == "00000000000000000000000000000001") {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ADMINISTRATOR_ROLE_CANT_CHANGED"));
|
||||
throw new Exception(G::LoadTranslation("ID_ADMINISTRATOR_ROLE_CANT_CHANGED"));
|
||||
}
|
||||
|
||||
//Delete
|
||||
$role = new \Roles();
|
||||
$role = new Roles();
|
||||
|
||||
$role->deleteUserRole($roleUid, $userUid);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -221,8 +227,7 @@ class User
|
||||
* Get data of a User from a record
|
||||
*
|
||||
* @param array $record Record
|
||||
*
|
||||
* return array Return an array with data User
|
||||
* @return array Return an array with data User
|
||||
*/
|
||||
public function getUserDataFromRecord(array $record)
|
||||
{
|
||||
@@ -234,7 +239,7 @@ class User
|
||||
$this->getFieldNameByFormatFieldName("USR_LASTNAME") => $record["USR_LASTNAME"] . "",
|
||||
$this->getFieldNameByFormatFieldName("USR_STATUS") => ($record["USR_STATUS"] . "" == "1")? "ACTIVE" : "INACTIVE"
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -249,8 +254,7 @@ class User
|
||||
* @param string $sortDir Direction of sorting (ASC, DESC)
|
||||
* @param int $start Start
|
||||
* @param int $limit Limit
|
||||
*
|
||||
* return array Return an array with all Users of a Role
|
||||
* @return array Return an array with all Users of a Role
|
||||
*/
|
||||
public function getUsers($roleUid, $option, array $arrayFilterData = null, $sortField = null, $sortDir = null, $start = null, $limit = null)
|
||||
{
|
||||
@@ -262,8 +266,8 @@ class User
|
||||
//Verify data and Set variables
|
||||
$flagFilter = !is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData['filter']);
|
||||
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$role = new \ProcessMaker\BusinessModel\Role();
|
||||
$process = new Process();
|
||||
$role = new Role();
|
||||
|
||||
$role->throwExceptionIfNotExistsRole($roleUid, $this->arrayFieldNameForException["roleUid"]);
|
||||
|
||||
@@ -303,24 +307,25 @@ class User
|
||||
}
|
||||
|
||||
//Query
|
||||
$criteria = new \Criteria('rbac');
|
||||
$criteria = new Criteria('rbac');
|
||||
|
||||
$criteria->addSelectColumn(\RbacUsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(\RbacUsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(\RbacUsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(\RbacUsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(\RbacUsersPeer::USR_STATUS);
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_STATUS);
|
||||
|
||||
$criteria->addJoin(\RbacUsersPeer::USR_UID, \UsersRolesPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$criteria->addJoin(RbacUsersPeer::USR_UID, UsersRolesPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
|
||||
$criteria->add(\RbacUsersPeer::USR_USERNAME, '', \Criteria::NOT_EQUAL);
|
||||
$criteria->add(RbacUsersPeer::USR_USERNAME, '', Criteria::NOT_EQUAL);
|
||||
|
||||
switch ($option) {
|
||||
case "USERS":
|
||||
$criteria->add(\UsersRolesPeer::ROL_UID, $roleUid, \Criteria::EQUAL);
|
||||
$criteria->add(UsersRolesPeer::ROL_UID, $roleUid, Criteria::EQUAL);
|
||||
break;
|
||||
case "AVAILABLE-USERS":
|
||||
$criteria->add(\UsersRolesPeer::ROL_UID, $roleUid, \Criteria::NOT_EQUAL);
|
||||
$criteria->add(UsersRolesPeer::ROL_UID, $roleUid, Criteria::NOT_EQUAL);
|
||||
$criteria->add(RbacUsersPeer::USR_UID, [RBAC::GUEST_USER_UID], Criteria::NOT_IN);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -336,24 +341,24 @@ class User
|
||||
];
|
||||
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(\RbacUsersPeer::USR_USERNAME, $search, \Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(\RbacUsersPeer::USR_FIRSTNAME, $search, \Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(\RbacUsersPeer::USR_LASTNAME, $search, \Criteria::LIKE)))
|
||||
$criteria->getNewCriterion(RbacUsersPeer::USR_USERNAME, $search, Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(RbacUsersPeer::USR_FIRSTNAME, $search, Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(RbacUsersPeer::USR_LASTNAME, $search, Criteria::LIKE)))
|
||||
);
|
||||
}
|
||||
|
||||
//Number records total
|
||||
$numRecTotal = \RbacUsersPeer::doCount($criteria);
|
||||
$numRecTotal = RbacUsersPeer::doCount($criteria);
|
||||
|
||||
//Query
|
||||
$conf = new \Configurations();
|
||||
$sortFieldDefault = \RbacUsersPeer::TABLE_NAME . '.' . $conf->userNameFormatGetFirstFieldByUsersTable();
|
||||
$conf = new Configurations();
|
||||
$sortFieldDefault = RbacUsersPeer::TABLE_NAME . '.' . $conf->userNameFormatGetFirstFieldByUsersTable();
|
||||
|
||||
if (!is_null($sortField) && trim($sortField) != '') {
|
||||
$sortField = strtoupper($sortField);
|
||||
|
||||
if (in_array(\RbacUsersPeer::TABLE_NAME . '.' . $sortField, $criteria->getSelectColumns())) {
|
||||
$sortField = \RbacUsersPeer::TABLE_NAME . '.' . $sortField;
|
||||
if (in_array(RbacUsersPeer::TABLE_NAME . '.' . $sortField, $criteria->getSelectColumns())) {
|
||||
$sortField = RbacUsersPeer::TABLE_NAME . '.' . $sortField;
|
||||
} else {
|
||||
$sortField = $sortFieldDefault;
|
||||
}
|
||||
@@ -375,8 +380,8 @@ class User
|
||||
$criteria->setLimit((int)($limit));
|
||||
}
|
||||
|
||||
$rsCriteria = \RbacUsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria = RbacUsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
@@ -392,7 +397,7 @@ class User
|
||||
$filterName => ($flagFilter)? $arrayFilterData['filter'] : '',
|
||||
'data' => $arrayUser
|
||||
];
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +110,8 @@ class User
|
||||
'PREF_DEFAULT_CASES_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
|
||||
);
|
||||
|
||||
private $guestUser = RBAC::GUEST_USER_UID;
|
||||
|
||||
/**
|
||||
* Constructor of the class
|
||||
*/
|
||||
@@ -124,6 +126,16 @@ class User
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the guest user defined
|
||||
*
|
||||
* @return string guestUser, uid related to this user
|
||||
*/
|
||||
public function getGuestUser()
|
||||
{
|
||||
return $this->guestUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -640,6 +652,10 @@ class User
|
||||
{
|
||||
try {
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($userUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUid)));
|
||||
}
|
||||
|
||||
//Verify data
|
||||
$validator = new Validator();
|
||||
@@ -1078,6 +1094,12 @@ class User
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
|
||||
//check user guest
|
||||
if (RBAC::isGuestUserUid($usrUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_MSG_CANNOT_DELETE_USER", array($USR_UID)));
|
||||
}
|
||||
|
||||
if ($total > 0) {
|
||||
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_BE_DELETED", array($USR_UID)));
|
||||
} else {
|
||||
@@ -1182,6 +1204,9 @@ class User
|
||||
//Query
|
||||
$criteria = $this->getUserCriteria();
|
||||
|
||||
//Remove the guest user
|
||||
$criteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($flagCondition && !empty($arrayWhere['condition'])) {
|
||||
foreach ($arrayWhere['condition'] as $value) {
|
||||
$criteria->add($value[0], $value[1], $value[2]);
|
||||
@@ -1556,6 +1581,9 @@ class User
|
||||
}
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
|
||||
//Remove the guest user
|
||||
$oCriteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($authSource != '') {
|
||||
$totalRows = sizeof($aUsers);
|
||||
} else {
|
||||
@@ -1583,6 +1611,10 @@ class User
|
||||
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
||||
$sep = "'";
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
|
||||
//Remove the guest user
|
||||
$oCriteria->add(UsersPeer::USR_UID, RBAC::GUEST_USER_UID, Criteria::NOT_EQUAL);
|
||||
|
||||
if ($filter != '') {
|
||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)
|
||||
->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)
|
||||
|
||||
@@ -9,6 +9,23 @@ use WebEntryPeer;
|
||||
use Exception;
|
||||
use G;
|
||||
use BpmnFlowPeer;
|
||||
use ProcessMaker\BusinessModel\Process as BusinessModelProcess;
|
||||
use ProcessMaker\BusinessModel\Validator as BusinessModelValidator;
|
||||
use ProcessMaker\Project\Workflow;
|
||||
use WebEntryEvent as ModelWebEntryEvent;
|
||||
use ProcessMaker\Util\Common;
|
||||
use Task as ModelTask;
|
||||
use Propel;
|
||||
use BasePeer;
|
||||
use Content;
|
||||
use Tasks;
|
||||
use Step;
|
||||
use TaskPeer;
|
||||
use StepPeer;
|
||||
use ResultSet;
|
||||
use TaskUser;
|
||||
use TaskUserPeer;
|
||||
|
||||
|
||||
class WebEntryEvent
|
||||
{
|
||||
@@ -358,13 +375,7 @@ class WebEntryEvent
|
||||
|
||||
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
||||
|
||||
//Verify data - Field definition
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
//Dependent fields:
|
||||
if (!isset($arrayData['WE_AUTHENTICATION']) || $arrayData['WE_AUTHENTICATION']
|
||||
== 'ANONYMOUS') {
|
||||
$this->arrayFieldDefinition['USR_UID']['required'] = true;
|
||||
}
|
||||
//Define the required dependent fields:
|
||||
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE']
|
||||
== 'SINGLE') {
|
||||
$this->arrayFieldDefinition['DYN_UID']['required'] = true;
|
||||
@@ -391,6 +402,7 @@ class WebEntryEvent
|
||||
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages;
|
||||
}
|
||||
|
||||
$process = new BusinessModelProcess();
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition,
|
||||
$this->arrayFieldNameForException, $flagInsert);
|
||||
|
||||
@@ -513,11 +525,11 @@ class WebEntryEvent
|
||||
$arrayEventData = $bpmn->getEvent($eventUid);
|
||||
|
||||
//Task
|
||||
$task = new \Task();
|
||||
$task = new ModelTask();
|
||||
|
||||
$tasUid = static::getTaskUidFromEvnUid($eventUid);
|
||||
|
||||
if (\TaskPeer::retrieveByPK($tasUid)) {
|
||||
if (TaskPeer::retrieveByPK($tasUid)) {
|
||||
$this->webEntryEventWebEntryTaskUid = $tasUid;
|
||||
} else {
|
||||
$this->webEntryEventWebEntryTaskUid = $task->create(
|
||||
@@ -535,7 +547,7 @@ class WebEntryEvent
|
||||
|
||||
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE'] === 'SINGLE') {
|
||||
//Task - Step
|
||||
$step = new \Step();
|
||||
$step = new Step();
|
||||
|
||||
$stepUid = $step->create(array(
|
||||
"PRO_UID" => $projectUid,
|
||||
@@ -553,13 +565,13 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
//Task - User
|
||||
$task = new \Tasks();
|
||||
$task = new Tasks();
|
||||
if (!(isset($arrayData['WE_AUTHENTICATION']) && $arrayData['WE_AUTHENTICATION'] === 'LOGIN_REQUIRED')) {
|
||||
$task->assignUser($this->webEntryEventWebEntryTaskUid, $userUid, 1);
|
||||
}
|
||||
|
||||
//Route
|
||||
$workflow = \ProcessMaker\Project\Workflow::load($projectUid);
|
||||
$workflow = Workflow::load($projectUid);
|
||||
|
||||
$result = $workflow->addRoute($this->webEntryEventWebEntryTaskUid, $activityUid, "SEQUENTIAL");
|
||||
|
||||
@@ -622,10 +634,10 @@ class WebEntryEvent
|
||||
{
|
||||
try {
|
||||
if ($webEntryTaskUid != "") {
|
||||
$obj = \TaskPeer::retrieveByPK($webEntryTaskUid);
|
||||
$obj = TaskPeer::retrieveByPK($webEntryTaskUid);
|
||||
|
||||
if (!is_null($obj)) {
|
||||
$task = new \Tasks();
|
||||
$task = new Tasks();
|
||||
|
||||
$task->deleteTask($webEntryTaskUid);
|
||||
}
|
||||
@@ -657,8 +669,8 @@ class WebEntryEvent
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
||||
$process = new BusinessModelProcess();
|
||||
$validator = new BusinessModelValidator();
|
||||
|
||||
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||
@@ -693,17 +705,19 @@ class WebEntryEvent
|
||||
$arrayData["WEE_TITLE"] = null;
|
||||
}
|
||||
|
||||
//Verify data
|
||||
//Verify data related to the process
|
||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||
|
||||
//Define if the webEntry need to use the guest user
|
||||
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
|
||||
$weAuthentication = isset($arrayData["WE_AUTHENTICATION"]) ? $arrayData["WE_AUTHENTICATION"] : '';
|
||||
$arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid);
|
||||
//Verify data with the required fields
|
||||
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
|
||||
|
||||
//Create
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
|
||||
$this->webEntryEventWebEntryUid = "";
|
||||
$this->webEntryEventWebEntryTaskUid = "";
|
||||
|
||||
//Create the connection
|
||||
$cnn = Propel::getConnection("workflow");
|
||||
try {
|
||||
//WebEntry
|
||||
$this->createWebEntry(
|
||||
@@ -719,11 +733,11 @@ class WebEntryEvent
|
||||
);
|
||||
|
||||
//WebEntry-Event
|
||||
$webEntryEvent = new \WebEntryEvent();
|
||||
$webEntryEvent = new ModelWebEntryEvent();
|
||||
|
||||
$webEntryEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
$webEntryEvent->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$webEntryEventUid = \ProcessMaker\Util\Common::generateUID();
|
||||
$webEntryEventUid = Common::generateUID();
|
||||
|
||||
$webEntryEvent->setWeeUid($webEntryEventUid);
|
||||
$webEntryEvent->setPrjUid($projectUid);
|
||||
@@ -739,13 +753,13 @@ class WebEntryEvent
|
||||
|
||||
//Set WEE_TITLE
|
||||
if (isset($arrayData["WEE_TITLE"])) {
|
||||
$result = \Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||
$result = Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||
$arrayData["WEE_TITLE"]);
|
||||
}
|
||||
|
||||
//Set WEE_DESCRIPTION
|
||||
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
||||
$result = \Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||
$result = Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||
$arrayData["WEE_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
@@ -782,12 +796,12 @@ class WebEntryEvent
|
||||
* @return array Return data of the WebEntry-Event updated
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($webEntryEventUid, $userUidUpdater, array $arrayData)
|
||||
public function update($webEntryEventUid, $userUidUpdater, array $arrayData, $updateUser = true)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$validator = new \ProcessMaker\BusinessModel\Validator();
|
||||
$process = new BusinessModelProcess();
|
||||
$validator = new BusinessModelValidator();
|
||||
|
||||
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
|
||||
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
|
||||
@@ -806,14 +820,20 @@ class WebEntryEvent
|
||||
|
||||
$arrayFinalData = array_merge($arrayWebEntryEventData, $arrayData);
|
||||
|
||||
//Verify data
|
||||
//Verify data related to the process
|
||||
$this->throwExceptionIfNotExistsWebEntryEvent($webEntryEventUid,
|
||||
$this->arrayFieldNameForException["webEntryEventUid"]);
|
||||
|
||||
//Define if the webEntry need to use the guest user
|
||||
$weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : '';
|
||||
$weAuthentication = isset($arrayData["WE_AUTHENTICATION"]) ? $arrayData["WE_AUTHENTICATION"] : '';
|
||||
if ($updateUser) {
|
||||
$arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid);
|
||||
}
|
||||
//Verify data with the required fields
|
||||
$this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData);
|
||||
|
||||
//Update
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
$cnn = Propel::getConnection("workflow");
|
||||
|
||||
$this->webEntryEventWebEntryUid = "";
|
||||
$this->webEntryEventWebEntryTaskUid = "";
|
||||
@@ -821,20 +841,20 @@ class WebEntryEvent
|
||||
try {
|
||||
//WebEntry
|
||||
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
|
||||
$task = new \Tasks();
|
||||
$task = new Tasks();
|
||||
|
||||
//Task - Step for WE_TYPE=SINGLE
|
||||
$weType = !empty($arrayData["WE_TYPE"]) ? $arrayData["WE_TYPE"] : $arrayWebEntryEventData["WE_TYPE"];
|
||||
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] !== $arrayWebEntryEventData["DYN_UID"] && $weType === 'SINGLE') {
|
||||
//Delete
|
||||
$step = new \Step();
|
||||
$step = new Step();
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||
$criteria->add(StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||
|
||||
$rsCriteria = \StepPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria = StepPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
@@ -843,7 +863,7 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
//Add
|
||||
$step = new \Step();
|
||||
$step = new Step();
|
||||
|
||||
$stepUid = $step->create(array(
|
||||
"PRO_UID" => $arrayWebEntryEventData["PRJ_UID"],
|
||||
@@ -859,16 +879,21 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
//Task - User
|
||||
if (!empty($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
|
||||
$proUser = new ProjectUser();
|
||||
$newUser = !empty($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : "";
|
||||
$oldUser = $arrayWebEntryEventData["USR_UID"];
|
||||
$isAssigned = $proUser->userIsAssignedToTask($newUser, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||
$shouldUpdate = !empty($newUser) && ($newUser !== $oldUser || !$isAssigned);
|
||||
if ($shouldUpdate) {
|
||||
//Unassign
|
||||
$taskUser = new \TaskUser();
|
||||
$taskUser = new TaskUser();
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||
$criteria->add(TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
|
||||
|
||||
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria = TaskUserPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
@@ -878,8 +903,11 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
//Assign
|
||||
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"],
|
||||
1);
|
||||
$result = $task->assignUser(
|
||||
$arrayWebEntryEventData["WEE_WE_TAS_UID"],
|
||||
$arrayData["USR_UID"],
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
//Route
|
||||
@@ -892,7 +920,7 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
//Add
|
||||
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
|
||||
$workflow = Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
|
||||
|
||||
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"],
|
||||
"SEQUENTIAL");
|
||||
@@ -925,15 +953,18 @@ class WebEntryEvent
|
||||
}
|
||||
|
||||
if (count($arrayDataAux) > 0) {
|
||||
$arrayDataAux = $this->webEntry->update($arrayWebEntryEventData["WEE_WE_UID"], $userUidUpdater,
|
||||
$arrayDataAux);
|
||||
$arrayDataAux = $this->webEntry->update(
|
||||
$arrayWebEntryEventData["WEE_WE_UID"],
|
||||
$userUidUpdater,
|
||||
$arrayDataAux
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//WebEntry-Event
|
||||
$webEntryEvent = WebEntryEventPeer::retrieveByPK($webEntryEventUid);
|
||||
|
||||
$webEntryEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
$webEntryEvent->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
if ($webEntryEvent->validate()) {
|
||||
$cnn->begin();
|
||||
@@ -944,13 +975,13 @@ class WebEntryEvent
|
||||
|
||||
//Set WEE_TITLE
|
||||
if (isset($arrayData["WEE_TITLE"])) {
|
||||
$result = \Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||
$result = Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG,
|
||||
$arrayData["WEE_TITLE"]);
|
||||
}
|
||||
|
||||
//Set WEE_DESCRIPTION
|
||||
if (isset($arrayData["WEE_DESCRIPTION"])) {
|
||||
$result = \Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||
$result = Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG,
|
||||
$arrayData["WEE_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
@@ -1123,7 +1154,7 @@ class WebEntryEvent
|
||||
$arrayWebEntryEvent = array();
|
||||
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$process = new BusinessModelProcess();
|
||||
|
||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||
|
||||
@@ -1133,7 +1164,7 @@ class WebEntryEvent
|
||||
$criteria->add(WebEntryEventPeer::PRJ_UID, $projectUid, Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
@@ -1174,7 +1205,7 @@ class WebEntryEvent
|
||||
}
|
||||
$criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', Criteria::EQUAL);
|
||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$result[] = $this->getWebEntryEventDataFromRecord($row);
|
||||
@@ -1208,7 +1239,7 @@ class WebEntryEvent
|
||||
$criteria->add(WebEntryEventPeer::WEE_UID, $webEntryEventUid, Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsCriteria->next();
|
||||
|
||||
@@ -1235,7 +1266,7 @@ class WebEntryEvent
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$process = new BusinessModelProcess();
|
||||
|
||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||
|
||||
@@ -1251,7 +1282,7 @@ class WebEntryEvent
|
||||
$criteria->add(WebEntryEventPeer::EVN_UID, $eventUid, Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = WebEntryEventPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsCriteria->next();
|
||||
|
||||
@@ -1361,4 +1392,22 @@ class WebEntryEvent
|
||||
return $url . "/" . $weData;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function return the uid of user related to the webEntry
|
||||
* @param string $authentication, can be ANONYMOUS, LOGIN_REQUIRED
|
||||
* @param string $usrUid
|
||||
* @return string
|
||||
*/
|
||||
public function getWebEntryUser($authentication = 'ANONYMOUS', $usrUid = '')
|
||||
{
|
||||
//The webEntry old does not have type of authentication defined
|
||||
//The webEntry2.0 can be has values ANONYMOUS or LOGIN_REQUIRED
|
||||
if ($authentication === 'ANONYMOUS' || empty($authentication)) {
|
||||
$user = new User();
|
||||
return $user->getGuestUser();
|
||||
} else {
|
||||
return $usrUid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class PluginRegistry
|
||||
public static function newInstance()
|
||||
{
|
||||
self::$instance = new PluginRegistry();
|
||||
if (! is_object(self::$instance) || get_class(self::$instance) != "ProcessMaker\Plugins\PluginRegistry") {
|
||||
if (!is_object(self::$instance) || get_class(self::$instance) != "ProcessMaker\Plugins\PluginRegistry") {
|
||||
throw new Exception("Can't load main PluginRegistry object.");
|
||||
}
|
||||
return self::$instance;
|
||||
@@ -121,10 +121,10 @@ class PluginRegistry
|
||||
$plugin->sDescription,
|
||||
$plugin->sSetupPage,
|
||||
$plugin->iVersion,
|
||||
isset($plugin->sCompanyLogo) ? $plugin->sCompanyLogo: '',
|
||||
isset($plugin->aWorkspaces) ? $plugin->aWorkspaces: [],
|
||||
isset($plugin->enable) ? $plugin->enable: false,
|
||||
isset($plugin->bPrivate) ? $plugin->bPrivate: false
|
||||
isset($plugin->sCompanyLogo) ? $plugin->sCompanyLogo : '',
|
||||
isset($plugin->aWorkspaces) ? $plugin->aWorkspaces : [],
|
||||
isset($plugin->enable) ? $plugin->enable : false,
|
||||
isset($plugin->bPrivate) ? $plugin->bPrivate : false
|
||||
);
|
||||
$this->_aPluginDetails[$Namespace] = $detail;
|
||||
}
|
||||
@@ -203,6 +203,7 @@ class PluginRegistry
|
||||
}
|
||||
Cache::pull(config("system.workspace") . __CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plugin details, by filename
|
||||
* @param string $Filename
|
||||
@@ -475,7 +476,7 @@ class PluginRegistry
|
||||
if (isset($this->_aPluginDetails[$Namespace])) {
|
||||
/** @var PluginDetail $detail */
|
||||
$detail = $this->_aPluginDetails[$Namespace];
|
||||
$className= $detail->getClassName();
|
||||
$className = $detail->getClassName();
|
||||
/** @var enterprisePlugin $oPlugin */
|
||||
$oPlugin = new $className($detail->getNamespace(), $detail->getFile());
|
||||
$oPlugin->setup();
|
||||
@@ -856,13 +857,13 @@ class PluginRegistry
|
||||
require_once($classFile);
|
||||
$sClassNameA = substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 0, 1) .
|
||||
str_replace(
|
||||
['Plugin','plugin'],
|
||||
['Plugin', 'plugin'],
|
||||
'Class',
|
||||
substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 1)
|
||||
);
|
||||
$sClassNameB = substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 0, 1) .
|
||||
str_replace(
|
||||
['Plugin','plugin'],
|
||||
['Plugin', 'plugin'],
|
||||
'class',
|
||||
substr($this->_aPluginDetails[$trigger->getNamespace()]->getClassName(), 1)
|
||||
);
|
||||
@@ -890,7 +891,7 @@ class PluginRegistry
|
||||
public function existsTrigger($TriggerId)
|
||||
{
|
||||
$found = false;
|
||||
/** @var TriggerDetail $trigger */
|
||||
/** @var TriggerDetail $trigger */
|
||||
foreach ($this->_aTriggers as $trigger) {
|
||||
if ($trigger->equalTriggerId($TriggerId)) {
|
||||
//review all folders registered for this namespace
|
||||
@@ -1124,7 +1125,8 @@ class PluginRegistry
|
||||
$ActionSave,
|
||||
$ActionExecute,
|
||||
$ActionGetFields
|
||||
) {
|
||||
)
|
||||
{
|
||||
$found = false;
|
||||
/** @var CaseSchedulerPlugin $caseScheduler */
|
||||
foreach ($this->_aCaseSchedulerPlugin as $caseScheduler) {
|
||||
@@ -1244,15 +1246,18 @@ class PluginRegistry
|
||||
*/
|
||||
public function registerExtendsRestService($Namespace, $ClassName)
|
||||
{
|
||||
$baseSrcPluginPath = PATH_PLUGINS . $Namespace . PATH_SEP . "src";
|
||||
$apiPath = PATH_SEP . "Services" . PATH_SEP . "Ext" . PATH_SEP;
|
||||
$baseSrcPluginPath = PATH_PLUGINS . $Namespace . PATH_SEP . 'src';
|
||||
$apiPath = PATH_SEP . 'Services' . PATH_SEP . 'Ext' . PATH_SEP;
|
||||
$classFile = $baseSrcPluginPath . $apiPath . 'Ext' . $ClassName . '.php';
|
||||
if (file_exists($classFile)) {
|
||||
$this->_restExtendServices[$Namespace][$ClassName] = array(
|
||||
"filePath" => $classFile,
|
||||
"classParent" => $ClassName,
|
||||
"classExtend" => 'Ext' . $ClassName
|
||||
);
|
||||
if (empty($this->_restExtendServices[$Namespace])) {
|
||||
$this->_restExtendServices[$Namespace] = new stdClass();
|
||||
}
|
||||
$this->_restExtendServices[$Namespace]->{$ClassName} = [
|
||||
'filePath' => $classFile,
|
||||
'classParent' => $ClassName,
|
||||
'classExtend' => 'Ext' . $ClassName
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1263,10 +1268,10 @@ class PluginRegistry
|
||||
*/
|
||||
public function getExtendsRestService($ClassName)
|
||||
{
|
||||
$responseRestExtendService = array();
|
||||
$responseRestExtendService = [];
|
||||
foreach ($this->_restExtendServices as $Namespace => $restExtendService) {
|
||||
if (isset($restExtendService[$ClassName])) {
|
||||
$responseRestExtendService = $restExtendService[$ClassName];
|
||||
if (isset($restExtendService->{$ClassName})) {
|
||||
$responseRestExtendService = $restExtendService->{$ClassName};
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1281,10 +1286,10 @@ class PluginRegistry
|
||||
*/
|
||||
public function disableExtendsRestService($Namespace, $ClassName = '')
|
||||
{
|
||||
if (isset($this->_restExtendServices[$Namespace][$ClassName]) && !empty($ClassName)) {
|
||||
unset($this->_restExtendServices[$Namespace][$ClassName]);
|
||||
} elseif (empty($ClassName)) {
|
||||
if (empty($ClassName)) {
|
||||
unset($this->_restExtendServices[$Namespace]);
|
||||
} elseif (isset($this->_restExtendServices[$Namespace]->{$ClassName})) {
|
||||
unset($this->_restExtendServices[$Namespace]->{$ClassName});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2086,7 +2086,8 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$arrayResult = $webEntryEvent->update(
|
||||
$arrayWebEntryEventData['WEE_UID'],
|
||||
$bpmnProject->getPrjAuthor(),
|
||||
(!is_null($arrayData))? $arrayData : $arrayWebEntryEventData
|
||||
(!is_null($arrayData))? $arrayData : $arrayWebEntryEventData,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,14 @@ class ActionsByEmail extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update template.
|
||||
*
|
||||
* @url PUT /updateTemplate
|
||||
*
|
||||
* @param type $params
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function updateTemplate($params)
|
||||
{
|
||||
@@ -81,8 +87,16 @@ class ActionsByEmail extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update configuration.
|
||||
*
|
||||
* @url PUT /saveConfiguration
|
||||
*
|
||||
* @param type $params
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function saveConfiguration($params)
|
||||
{
|
||||
|
||||
@@ -80,13 +80,17 @@ class Calendar extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_CALENDAR}
|
||||
* Update calendar.
|
||||
*
|
||||
* @url PUT /:cal_uid
|
||||
*
|
||||
* @param string $cal_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_CALENDAR}
|
||||
*/
|
||||
public function doPut($cal_uid, $request_data)
|
||||
{
|
||||
|
||||
@@ -764,12 +764,21 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a new case and assign the logged-in user to work on the initial task
|
||||
* in the case. Note that the logged-in user must be in the pool of assigned
|
||||
* users for the initial task.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
*
|
||||
* @param string $pro_uid {@from body} {@min 32}{@max 32}
|
||||
* @param string $tas_uid {@from body} {@min 32}{@max 32}
|
||||
* @param array $variables {@from body}
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostCase($pro_uid, $tas_uid, $variables = null)
|
||||
{
|
||||
@@ -784,13 +793,26 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new case. It is similar to POST /cases, but it impersonates the
|
||||
* session variables, so it is more robust than POST /cases. Note that the
|
||||
* specified user to work on the case must be assigned to the pool of users
|
||||
* for the initial task. Also note that the new case's status will be set to
|
||||
* "DRAFT", not "TO_DO". If wishing to change the new case's status to "TO_DO",
|
||||
* then create the following trigger in the process and use
|
||||
* PUT /cases/{app_uid}/execute-trigger/{tri_uid} to execute it.
|
||||
*
|
||||
* @url POST /impersonate
|
||||
*
|
||||
*
|
||||
* @param string $pro_uid {@from body} {@min 32}{@max 32}
|
||||
* @param string $usr_uid {@from body} {@min 32}{@max 32}
|
||||
* @param string $tas_uid {@from body} {@min 32}{@max 32}
|
||||
* @param array $variables {@from body}
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables = null)
|
||||
{
|
||||
@@ -804,12 +826,19 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update case reassignment.
|
||||
*
|
||||
* @url PUT /:app_uid/reassign-case
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param string $usr_uid_source {@from body} {@min 32}{@max 32}
|
||||
* @param string $usr_uid_target {@from body} {@min 32}{@max 32}
|
||||
* @param string $del_index {@from body}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_REASSIGNCASE,PM_REASSIGNCASE_SUPERVISOR}
|
||||
*/
|
||||
public function doPutReassignCase($app_uid, $usr_uid_source, $usr_uid_target, $del_index = null)
|
||||
{
|
||||
@@ -823,11 +852,17 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Route Case
|
||||
* Route Case.
|
||||
*
|
||||
* @url PUT /:app_uid/route-case
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param string $del_index {@from body}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutRouteCase($app_uid, $del_index = null)
|
||||
{
|
||||
@@ -843,12 +878,14 @@ class Cases extends Api
|
||||
/**
|
||||
* Cancel Case
|
||||
*
|
||||
* @url PUT /:cas_uid/cancel
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @throws RestException
|
||||
*
|
||||
* @url PUT /:cas_uid/cancel
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CANCELCASE}
|
||||
*/
|
||||
public function doPutCancelCase($cas_uid)
|
||||
{
|
||||
@@ -864,11 +901,15 @@ class Cases extends Api
|
||||
/**
|
||||
* Pause Case
|
||||
*
|
||||
* @url PUT /:cas_uid/pause
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @param string $unpaused_date {@from body}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url PUT /:cas_uid/pause
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutPauseCase($cas_uid, $unpaused_date = null)
|
||||
{
|
||||
@@ -888,10 +929,14 @@ class Cases extends Api
|
||||
/**
|
||||
* Unpause Case
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url PUT /:cas_uid/unpause
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutUnpauseCase($cas_uid)
|
||||
{
|
||||
@@ -905,13 +950,17 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpause Case
|
||||
* Execute trigger in a case.
|
||||
*
|
||||
* @url PUT /:cas_uid/execute-trigger/:tri_uid
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @param string $tri_uid {@min 1}{@max 32}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url PUT /:cas_uid/execute-trigger/:tri_uid
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutExecuteTriggerCase($cas_uid, $tri_uid)
|
||||
{
|
||||
@@ -926,11 +975,14 @@ class Cases extends Api
|
||||
|
||||
/**
|
||||
* Delete Case
|
||||
* @url DELETE /:cas_uid
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url DELETE /:cas_uid
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*/
|
||||
public function doDeleteCase($cas_uid)
|
||||
{
|
||||
@@ -973,13 +1025,17 @@ class Cases extends Api
|
||||
/**
|
||||
* Put Case Variables
|
||||
*
|
||||
* @url PUT /:app_uid/variable
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $dyn_uid {@from path}
|
||||
* @param int $del_index {@from path}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url PUT /:app_uid/variable
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '', $del_index = 0)
|
||||
{
|
||||
@@ -1089,14 +1145,21 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Put Case Variables
|
||||
* Create a new case note for a given case. Note that only users who are
|
||||
* currently assigned to work on the case or have Process Permissions to
|
||||
* access case notes may create a case note.
|
||||
*
|
||||
* @url POST /:app_uid/note
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $note_content {@min 1}{@max 500}
|
||||
* @param int $send_mail {@choice 1,0}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url POST /:app_uid/note
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostCaseNote($app_uid, $note_content, $send_mail = 0)
|
||||
{
|
||||
@@ -1132,13 +1195,17 @@ class Cases extends Api
|
||||
/**
|
||||
* Execute triggers
|
||||
*
|
||||
* @url PUT /:app_uid/execute-triggers
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param int $del_index {@from body}
|
||||
* @param string $obj_type {@from body}
|
||||
* @param string $obj_uid {@from body}
|
||||
* @throws Exception
|
||||
*
|
||||
* @url PUT /:app_uid/execute-triggers
|
||||
* @throws RestException
|
||||
*
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
* @access protected
|
||||
*/
|
||||
public function doPutExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid)
|
||||
{
|
||||
@@ -1224,11 +1291,16 @@ class Cases extends Api
|
||||
|
||||
/**
|
||||
* Mark a task process as a bookmark
|
||||
*
|
||||
* @url POST /bookmark/:tas_uid
|
||||
*
|
||||
* @param string $tas_uid {@min 32}{@max 32}
|
||||
* @throws Exception
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostBookmarkStartCase($tas_uid)
|
||||
{
|
||||
|
||||
@@ -56,8 +56,6 @@ class InputDocument extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
* @class AccessControl {@className \ProcessMaker\Services\Api\Cases}
|
||||
* @url GET /:app_uid/input-document/:app_doc_uid/file
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
@@ -77,6 +75,8 @@ class InputDocument extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:app_uid/:del_index/input-document/:app_doc_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@min 1}
|
||||
@@ -96,12 +96,23 @@ class InputDocument extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a new Input Document file to a specified case. Note that the
|
||||
* logged-in user must either be currently assigned to work on the case or a
|
||||
* Process Supervisor with permissions to access the Input Document; otherwise,
|
||||
* this endpoint returns an HTTP status code of 302.
|
||||
*
|
||||
* @url POST /:app_uid/input-document
|
||||
*
|
||||
*
|
||||
* @param string $app_uid { @min 32}{@max 32}
|
||||
* @param string $tas_uid {@min 32}{@max 32}
|
||||
* @param string $app_doc_comment
|
||||
* @param string $inp_doc_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid)
|
||||
{
|
||||
|
||||
@@ -117,6 +117,8 @@ class OutputDocument extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:app_uid/output-document/:app_doc_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param string $app_doc_uid {@min 32}{@max 32}
|
||||
@@ -133,11 +135,26 @@ class OutputDocument extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a specified Output Document for a given case, meaning that a PDF,
|
||||
* a DOC or both files (depending on options selected in the definition of the
|
||||
* Output Document) will be created, inserting any variables in the template.
|
||||
* If the Output Document already exists, then it will be regenerated.
|
||||
* If versioning is enabled, then the regenerated files will be given a new
|
||||
* version number and document index number, but if versioning is NOT enabled,
|
||||
* then the existing files will be overwritten with the same version number
|
||||
* and document index number.
|
||||
*
|
||||
* @url POST /:app_uid/:del_index/output-document/:out_doc_uid
|
||||
*
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@min 1}
|
||||
* @param string $out_doc_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @return object
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostOutputDocument($app_uid, $del_index, $out_doc_uid)
|
||||
{
|
||||
|
||||
@@ -78,14 +78,21 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a variable in a case, meaning the variable is instantiated in the case.
|
||||
*
|
||||
* @url POST /:app_uid/:del_index/variable/:var_name
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@min 1}
|
||||
* @param string $var_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostVariable($app_uid, $del_index, $var_name, array $request_data)
|
||||
{
|
||||
@@ -99,14 +106,20 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update variable.
|
||||
*
|
||||
* @url PUT /:app_uid/:del_index/variable/:var_name
|
||||
* @status 204
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@min 1}
|
||||
* @param string $var_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 204
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutVariable($app_uid, $del_index, $var_name, array $request_data)
|
||||
{
|
||||
@@ -119,6 +132,8 @@ class Variable extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:app_uid/:del_index/variable/:var_name
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@min 1}
|
||||
|
||||
@@ -38,14 +38,19 @@ class Catalog extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
* @deprecated The method has been deprecated.
|
||||
*/
|
||||
public function doPost($request_data)
|
||||
{
|
||||
@@ -62,14 +67,18 @@ class Catalog extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update catalog.
|
||||
*
|
||||
* @url PUT /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPut($cat_uid, $cat_type, $request_data)
|
||||
{
|
||||
@@ -81,25 +90,5 @@ class Catalog extends Api
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDelete($cat_uid, $cat_type)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
|
||||
$arrayData = $catalog->delete($cat_uid, $cat_type);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,16 +108,18 @@ class Consolidated extends Api
|
||||
/**
|
||||
* Get Cases Consolidated
|
||||
*
|
||||
* @url PUT /cases/:tas_uid/:dyn_uid/:pro_uid
|
||||
*
|
||||
* @param string $tas_uid {@min 1} {@max 32}
|
||||
* @param string $dyn_uid {@min 1} {@max 32}
|
||||
* @param string $pro_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /cases/:tas_uid/:dyn_uid/:pro_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutCasesConsolidated($tas_uid, $dyn_uid, $pro_uid, $request_data)
|
||||
{
|
||||
@@ -133,18 +135,20 @@ class Consolidated extends Api
|
||||
/**
|
||||
* Post Derivate
|
||||
*
|
||||
* @url POST /derivate/:app_uid/:app_number/:del_index/:field_grid/:field_grid_val
|
||||
* @url POST /derivate/:app_uid/:app_number/:del_index/:field_grid/
|
||||
*
|
||||
* @param string $app_uid {@min 1} {@max 32}
|
||||
* @param string $app_number
|
||||
* @param int $del_index
|
||||
* @param string $field_grid
|
||||
* @param string $field_grid_val
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /derivate/:app_uid/:app_number/:del_index/:field_grid/:field_grid_val
|
||||
* @url POST /derivate/:app_uid/:app_number/:del_index/:field_grid/
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostDerivate($app_uid, $app_number, $del_index, $field_grid, $field_grid_val = '')
|
||||
{
|
||||
|
||||
@@ -220,12 +220,18 @@ class Dashboard extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create dashboard.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return integer
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPostDashboard($request_data)
|
||||
{
|
||||
@@ -242,11 +248,15 @@ class Dashboard extends Api
|
||||
/**
|
||||
* Put dashboards configuration
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
*
|
||||
* @url PUT
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return string
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPutDashboard($request_data)
|
||||
{
|
||||
@@ -262,6 +272,8 @@ class Dashboard extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
*
|
||||
@@ -279,12 +291,18 @@ class Dashboard extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
*
|
||||
* Create owner
|
||||
*
|
||||
* @url POST /owner
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return object
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPostOwner($request_data)
|
||||
{
|
||||
@@ -300,6 +318,8 @@ class Dashboard extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid/owner/:owner_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
* @param string $owner_uid {@min 32}{@max 32}
|
||||
@@ -317,12 +337,18 @@ class Dashboard extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
*
|
||||
* Create indicator.
|
||||
*
|
||||
* @url POST /indicator
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return string
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPostIndicator($request_data)
|
||||
{
|
||||
@@ -341,8 +367,11 @@ class Dashboard extends Api
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @url PUT /indicator
|
||||
* @return string
|
||||
* @throws RestException
|
||||
*
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
* @access protected
|
||||
*/
|
||||
public function doPutIndicator($request_data)
|
||||
{
|
||||
@@ -358,6 +387,8 @@ class Dashboard extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /indicator/:ind_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*
|
||||
* @param string $ind_uid {@min 32}{@max 32}
|
||||
*
|
||||
@@ -376,10 +407,15 @@ class Dashboard extends Api
|
||||
/**
|
||||
* Post dashboards configuration by userUid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @url POST /config/
|
||||
*
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return integer
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPostDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
@@ -416,10 +452,15 @@ class Dashboard extends Api
|
||||
/**
|
||||
* Put dashboards configuration by usr_uid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @url PUT /config
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_DASHBOARD}
|
||||
*/
|
||||
public function doPutDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
|
||||
@@ -102,13 +102,21 @@ class Department extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a user to a specified department in version 3.0 and later. If the
|
||||
* user is already a member of another department, the user will be transfered
|
||||
* to the specified department.
|
||||
*
|
||||
* @url POST /:dep_uid/assign-user
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $dep_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPostAssignUser($dep_uid, array $request_data)
|
||||
{
|
||||
@@ -123,6 +131,8 @@ class Department extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:dep_uid/unassign-user/:usr_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*
|
||||
* @param string $dep_uid {@min 1}{@max 32}
|
||||
* @param string $usr_uid {@min 1}{@max 32}
|
||||
@@ -141,13 +151,18 @@ class Department extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update manager user
|
||||
*
|
||||
* @url PUT /:dep_uid/set-manager/:usr_uid
|
||||
*
|
||||
* @param string $dep_uid {@min 1}{@max 32}
|
||||
* @param string $usr_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPutSetManager($dep_uid, $usr_uid)
|
||||
{
|
||||
@@ -180,15 +195,19 @@ class Department extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new department.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
* @param string $dep_title {@from body} {@min 1}
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPost($request_data, $dep_title)
|
||||
{
|
||||
@@ -202,11 +221,17 @@ class Department extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update department.
|
||||
*
|
||||
* @url PUT /:dep_uid
|
||||
*
|
||||
* @param string $dep_uid {@min 1}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPut($dep_uid, $request_data)
|
||||
{
|
||||
@@ -221,6 +246,8 @@ class Department extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:dep_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*
|
||||
* @param string $dep_uid {@min 1}{@max 32}
|
||||
*
|
||||
|
||||
@@ -85,9 +85,17 @@ class EmailServer extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Test connection.
|
||||
*
|
||||
* @url POST /test-connection
|
||||
*
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_EMAIL}
|
||||
*/
|
||||
public function doPostTestConnection(array $request_data)
|
||||
{
|
||||
@@ -103,11 +111,18 @@ class EmailServer extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create email server.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_EMAIL}
|
||||
*/
|
||||
public function doPost(array $request_data)
|
||||
{
|
||||
@@ -123,12 +138,18 @@ class EmailServer extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update email server.
|
||||
*
|
||||
* @url PUT /:mess_uid
|
||||
* @status 200
|
||||
*
|
||||
* @param string $mess_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 200
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_EMAIL}
|
||||
*/
|
||||
public function doPut($mess_uid, array $request_data)
|
||||
{
|
||||
@@ -141,6 +162,8 @@ class EmailServer extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:mess_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_EMAIL}
|
||||
*
|
||||
* @param string $mess_uid {@min 32}{@max 32}
|
||||
*
|
||||
|
||||
@@ -12,9 +12,17 @@ use \Luracast\Restler\RestException;
|
||||
class File extends Api
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Upload file.
|
||||
*
|
||||
* @url POST /upload
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostFilesUpload($request_data)
|
||||
{
|
||||
|
||||
@@ -73,11 +73,18 @@ class Group extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new group.
|
||||
*
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPost($request_data)
|
||||
{
|
||||
@@ -96,10 +103,17 @@ class Group extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update group.
|
||||
*
|
||||
* @url PUT /:grp_uid
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPut($grp_uid, $request_data)
|
||||
{
|
||||
@@ -115,6 +129,8 @@ class Group extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:grp_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
*/
|
||||
|
||||
@@ -12,12 +12,19 @@ use \Luracast\Restler\RestException;
|
||||
class User extends Api
|
||||
{
|
||||
/**
|
||||
* Assign a user to a specified group.
|
||||
*
|
||||
* @url POST /:grp_uid/user
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPostUser($grp_uid, $request_data)
|
||||
{
|
||||
@@ -32,11 +39,18 @@ class User extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a group of users to a specified group or groups.
|
||||
*
|
||||
* @url POST /batch-users
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPostBatchUsers($request_data)
|
||||
{
|
||||
@@ -63,6 +77,8 @@ class User extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:grp_uid/user/:usr_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*
|
||||
* @param string $grp_uid {@min 32}{@max 32}
|
||||
* @param string $usr_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -796,24 +796,24 @@ class Light extends Api
|
||||
/**
|
||||
* Delete case
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url DELETE /case/:app_uid/delete
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doDeleteCases($app_uid)
|
||||
{
|
||||
try {
|
||||
$oCase = new ClassesCases();
|
||||
$oCase->removeCase($app_uid);
|
||||
$usr_uid = $this->getUserId();
|
||||
$cases = new BusinessModelCases();
|
||||
$cases->deleteCase($app_uid, $usr_uid);
|
||||
$result = array(
|
||||
"message" => G::LoadTranslation("ID_COMMAND_EXECUTED_SUCCESSFULLY")
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -967,15 +967,19 @@ class Light extends Api
|
||||
/**
|
||||
* Execute Trigger case
|
||||
*
|
||||
* @url POST /process/:prj_uid/task/:act_uid/case/:cas_uid/step/:step_uid/execute-trigger/:type
|
||||
*
|
||||
* @param string $prj_uid {@min 1}{@max 32}
|
||||
* @param string $act_uid {@min 1}{@max 32}
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @param string $step_uid {@min 32}{@max 32}
|
||||
* @param string $type {@choice before,after}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /process/:prj_uid/task/:act_uid/case/:cas_uid/step/:step_uid/execute-trigger/:type
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutExecuteTriggerCase($prj_uid, $act_uid, $cas_uid, $step_uid, $type)
|
||||
{
|
||||
@@ -1133,10 +1137,21 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a new case and assign the logged-in user to work on the initial task
|
||||
* in the case. Note that the logged-in user must be in the pool of assigned
|
||||
* users of the initial task. Also note that the new case's status will be
|
||||
* set to "DRAFT", not "TO_DO".
|
||||
*
|
||||
* @url POST /process/:pro_uid/task/:task_uid/start-case
|
||||
*
|
||||
*
|
||||
* @param string $pro_uid {@min 32}{@max 32}
|
||||
* @param string $task_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function postStartCase($pro_uid, $task_uid)
|
||||
{
|
||||
@@ -1175,11 +1190,18 @@ class Light extends Api
|
||||
|
||||
/**
|
||||
* Route Case
|
||||
*
|
||||
* @url PUT /cases/:app_uid/route-case
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index {@from body}
|
||||
* @param array $tasks {@from body}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutRouteCase($app_uid, $del_index = null, $tasks = array())
|
||||
{
|
||||
@@ -1228,11 +1250,20 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a Google Maps .jpg image file for a case. This image can be found
|
||||
* in the Documents section under the Home tab.
|
||||
*
|
||||
* @url POST /case/:app_uid/upload/location
|
||||
*
|
||||
*
|
||||
* @param string $app_uid { @min 32}{@max 32}
|
||||
* @param float $latitude {@min -90}{@max 90}
|
||||
* @param float $longitude {@min -180}{@max 180}
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function postInputDocumentLocation($app_uid, $latitude, $longitude)
|
||||
{
|
||||
@@ -1270,9 +1301,17 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a base64 string of a file.
|
||||
*
|
||||
* @url POST /case/:app_uid/download64
|
||||
*
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function postDownloadFile($app_uid, $request_data)
|
||||
{
|
||||
@@ -1368,11 +1407,26 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new case file record(s) in a specified case. These case files can
|
||||
* be attached files (used by File controls), Input Document files, or Output Document
|
||||
* files in version 1.0.1.8 and later. In version 1.0.1.7 and earlier, the case
|
||||
* files can only be attached files. (Note that case files are known as AppDocuments
|
||||
* in ProcessMaker). This endpoint adds new record(s) to the APP_DOCUMENT table
|
||||
* and stores their file name(s) in the CONTENT table in the database. It returns
|
||||
* the generated case file ID and version number for each file. This information
|
||||
* can then be used to call the POST /light/case/{app_uid}/upload/{app_doc_uid}
|
||||
* endpoint to upload each file.
|
||||
*
|
||||
* @url POST /case/:app_uid/upload
|
||||
*
|
||||
*
|
||||
* @param $access
|
||||
* @param $refresh
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function uidUploadFiles($app_uid, $request_data)
|
||||
{
|
||||
@@ -1388,11 +1442,26 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new case file record(s) in a specified case. These case files can
|
||||
* be attached files (used by File controls), Input Document files, or Output Document
|
||||
* files in version 1.0.1.8 and later. In version 1.0.1.7 and earlier, the case
|
||||
* files can only be attached files. (Note that case files are known as AppDocuments
|
||||
* in ProcessMaker). This endpoint adds new record(s) to the APP_DOCUMENT table
|
||||
* and stores their file name(s) in the CONTENT table in the database. It returns
|
||||
* the generated case file ID and version number for each file. This information
|
||||
* can then be used to call the POST /light/case/{app_uid}/upload/{app_doc_uid}
|
||||
* endpoint to upload each file.
|
||||
*
|
||||
* @url POST /case/:app_uid/upload/:app_doc_uid
|
||||
*
|
||||
*
|
||||
* @param $access
|
||||
* @param $refresh
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function documentUploadFiles($app_uid, $app_doc_uid, $request_data)
|
||||
{
|
||||
@@ -1408,10 +1477,17 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign the user logged-in to an unassigned case.
|
||||
*
|
||||
* @url POST /case/:app_uid/claim
|
||||
*
|
||||
*
|
||||
* @param $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function claimCaseUser($app_uid)
|
||||
{
|
||||
@@ -1498,15 +1574,21 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Case Notes
|
||||
* Creates a new case note for a given case. Note that only users who are
|
||||
* currently assigned to work on the case or have Process Permissions to access
|
||||
* case notes may create a case note.
|
||||
*
|
||||
* @url POST /case/:app_uid/note
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $noteContent {@min 1}{@max 500}
|
||||
* @param int $sendMail {@choice 1,0}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /case/:app_uid/note
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPostCaseNote($app_uid, $noteContent, $sendMail = 0)
|
||||
{
|
||||
@@ -1591,13 +1673,18 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @return stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* Reassign a case.
|
||||
*
|
||||
* @url POST /reassign/:app_uid/user/:to_usr_uid
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $to_usr_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /reassign/:app_uid/user/:to_usr_uid
|
||||
*
|
||||
* @return stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_REASSIGNCASE, PM_REASSIGNCASE_SUPERVISOR}
|
||||
*/
|
||||
public function reassignCase($app_uid, $to_usr_uid)
|
||||
{
|
||||
@@ -1615,12 +1702,15 @@ class Light extends Api
|
||||
/**
|
||||
* Paused Case
|
||||
*
|
||||
* @url POST /cases/:app_uid/pause
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @return stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /cases/:app_uid/pause
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function pauseCase($app_uid, $request_data)
|
||||
{
|
||||
@@ -1639,12 +1729,15 @@ class Light extends Api
|
||||
/**
|
||||
* Unpaused Case
|
||||
*
|
||||
* @return stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /cases/:app_uid/unpause
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function unpauseCase($app_uid)
|
||||
{
|
||||
@@ -1662,13 +1755,19 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel Case
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
* Cancels a case assigned to the user logged-in. The case's status is changed
|
||||
* to "CANCELLED" and it is no longer possible to open or change the case,
|
||||
* but all the case data will remain in the database.
|
||||
*
|
||||
* @url POST /cases/:app_uid/cancel
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutCancelCase($app_uid)
|
||||
{
|
||||
@@ -1715,8 +1814,7 @@ class Light extends Api
|
||||
|
||||
/**
|
||||
* Put Case Variables
|
||||
* @access protected
|
||||
* @class AccessControl {@className \ProcessMaker\Services\Api\Cases}
|
||||
*
|
||||
* @url PUT /:app_uid/variable
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
@@ -1724,8 +1822,10 @@ class Light extends Api
|
||||
* @param string $dyn_uid {@from path}
|
||||
* @param int $del_index {@from path}
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '', $del_index = 0)
|
||||
{
|
||||
@@ -1837,10 +1937,23 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next step
|
||||
* This endpoint executes the following three actions:
|
||||
* 1. Executes a trigger before a step: First, it executes any trigger assigned
|
||||
* before the indicated step.
|
||||
* 2. Get the Next Step: It obtains the details about the next step of the case.
|
||||
* 3. Get Variables: Finally, it returns any variable stored or changed by
|
||||
* actions 1 and 2.
|
||||
*
|
||||
* @url POST /get-next-step/:app_uid
|
||||
*
|
||||
* @param string $app_uid
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doGetStep($app_uid, $request_data)
|
||||
{
|
||||
@@ -1934,11 +2047,18 @@ class Light extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* This function checks if the application uids sent are in the draft list for the specified user
|
||||
* This function checks if the application uids sent are in the draft list for
|
||||
* the specified user.
|
||||
*
|
||||
* @url POST /draft/check
|
||||
*
|
||||
* @param array $requestData
|
||||
*
|
||||
* @return array $response
|
||||
* @throws Exception
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_CASES}
|
||||
*/
|
||||
public function doGetDraftCheck($requestData)
|
||||
{
|
||||
|
||||
@@ -36,15 +36,15 @@ class NotificationDevice extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Create register device with userUid
|
||||
* Update device language.
|
||||
*
|
||||
* @url PUT /notification/:dev_uid
|
||||
*
|
||||
* @param string $dev_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Ronald Quenta <ronald.quenta@processmaker.com>
|
||||
* @return array
|
||||
*
|
||||
* @url PUT /notification/:dev_uid
|
||||
* @throws RestException
|
||||
*/
|
||||
public function updateDeviceLanguage($dev_uid, $request_data)
|
||||
{
|
||||
@@ -78,14 +78,14 @@ class NotificationDevice extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /notification/:dev_uid
|
||||
* This actions is executed in the logout action
|
||||
*
|
||||
* Delete record device with dev_uid and usr_uid
|
||||
*
|
||||
* @param string $dev_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Ronald Quenta <ronald.quenta@processmaker.com>
|
||||
* @return array
|
||||
*
|
||||
* @url DELETE /notification/:dev_uid
|
||||
*/
|
||||
public function deleteDevice($dev_uid)
|
||||
{
|
||||
|
||||
@@ -137,17 +137,18 @@ class Pmtable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update pm-table.
|
||||
*
|
||||
* @url PUT /:pmt_uid
|
||||
*
|
||||
* @param string $pmt_uid {@min 1} {@max 32}
|
||||
*
|
||||
* @param array $request_data
|
||||
* @return void
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return void
|
||||
* @throw RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
|
||||
* @url PUT /:pmt_uid
|
||||
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
|
||||
*/
|
||||
public function doPutPmTable(
|
||||
$pmt_uid,
|
||||
@@ -163,17 +164,18 @@ class Pmtable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update pm-table data.
|
||||
*
|
||||
* @url PUT /:pmt_uid/data
|
||||
*
|
||||
* @param string $pmt_uid {@min 1} {@max 32}
|
||||
*
|
||||
* @param array $request_data
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
|
||||
* @url PUT /:pmt_uid/data
|
||||
* @class AccessControl {@permission PM_SETUP_PM_TABLES}
|
||||
*/
|
||||
public function doPutPmTableData(
|
||||
$pmt_uid,
|
||||
|
||||
@@ -63,6 +63,17 @@ class Process extends Api
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create process
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
defined('SYS_LANG') || define("SYS_LANG", $request_data["lang"]);
|
||||
@@ -78,6 +89,18 @@ class Process extends Api
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a process by UID.
|
||||
*
|
||||
* @param string $processUid
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function put($processUid, $request_data = null)
|
||||
{
|
||||
$response = array();
|
||||
|
||||
@@ -90,13 +90,17 @@ class ProcessCategory extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_PROCESS_CATEGORIES}
|
||||
* Update category.
|
||||
*
|
||||
* @url PUT /category/:cat_uid
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP_PROCESS_CATEGORIES}
|
||||
*/
|
||||
public function doPutCategory($cat_uid, array $request_data)
|
||||
{
|
||||
|
||||
@@ -101,17 +101,21 @@ class Activity extends Api
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an activity.
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/:act_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $act_uid {@min 32} {@max 32}
|
||||
* @param ActivityPropertiesStructure $properties {@from body}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
* @return array
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/:act_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProjectActivity($prj_uid, $act_uid, ActivityPropertiesStructure $properties, $request_data = array())
|
||||
{
|
||||
@@ -217,9 +221,18 @@ class Activity extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Get activity validate self service.
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/validate-active-cases
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return \StdClass
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doGetActivityValidateSelfService($prj_uid, $request_data = array())
|
||||
{
|
||||
|
||||
@@ -92,14 +92,21 @@ class Assignee extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an user or group to a task.
|
||||
*
|
||||
* @url POST /:prjUid/activity/:actUid/assignee
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $actUid {@min 32} {@max 32}
|
||||
* @param string $aas_uid {@min 32} {@max 32}
|
||||
* @param string $aas_type {@choice user,group}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityAssignee($prjUid, $actUid, $aas_uid, $aas_type)
|
||||
{
|
||||
@@ -112,6 +119,8 @@ class Assignee extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/activity/:actUid/assignee/:aasUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $actUid {@min 32} {@max 32}
|
||||
@@ -191,14 +200,21 @@ class Assignee extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an user or group to a task (Ad-hoc assignment).
|
||||
*
|
||||
* @url POST /:prjUid/activity/:actUid/adhoc-assignee
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $actUid {@min 32} {@max 32}
|
||||
* @param string $ada_uid {@min 32} {@max 32}
|
||||
* @param string $ada_type {@choice user,group}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type)
|
||||
{
|
||||
@@ -211,6 +227,8 @@ class Assignee extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/activity/:actUid/adhoc-assignee/:adaUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $actUid {@min 32} {@max 32}
|
||||
|
||||
@@ -34,8 +34,11 @@ class Step extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a step to a task.
|
||||
*
|
||||
* @url POST /:prj_uid/activity/:act_uid/step
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $act_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
@@ -44,8 +47,12 @@ class Step extends Api
|
||||
* @param string $step_condition {@from body}
|
||||
* @param int $step_position {@from body}{@min 1}
|
||||
* @param string $step_mode {@from body}{@choice EDIT,VIEW}{@required true}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityStep(
|
||||
$act_uid,
|
||||
@@ -73,6 +80,8 @@ class Step extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update step.
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/:act_uid/step/:step_uid
|
||||
*
|
||||
* @param string $step_uid {@min 32}{@max 32}
|
||||
@@ -84,6 +93,11 @@ class Step extends Api
|
||||
* @param string $step_condition {@from body}
|
||||
* @param int $step_position {@from body}{@min 1}
|
||||
* @param string $step_mode {@from body}{@choice EDIT,VIEW}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutActivityStep(
|
||||
$step_uid,
|
||||
@@ -109,6 +123,8 @@ class Step extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/activity/:act_uid/step/:step_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $step_uid {@min 32}{@max 32}
|
||||
* @param string $act_uid {@min 32}{@max 32}
|
||||
@@ -218,8 +234,11 @@ class Step extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Steps for a Task.
|
||||
*
|
||||
* @url POST /:prj_uid/activity/:act_uid/step/all
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $act_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
@@ -228,8 +247,12 @@ class Step extends Api
|
||||
* @param string $step_condition {@from body}
|
||||
* @param int $step_position {@from body}{@min 1}
|
||||
* @param string $step_mode {@from body}{@choice EDIT,VIEW}{@required true}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityStepAll(
|
||||
$act_uid,
|
||||
|
||||
@@ -34,14 +34,21 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a trigger to a step.
|
||||
*
|
||||
* @url POST /:prj_uid/activity/:act_uid/step/:step_uid/trigger
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $step_uid
|
||||
* @param string $act_uid
|
||||
* @param string $prj_uid
|
||||
* @param StepTriggerPostStructure $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityStepTrigger($step_uid, $act_uid, $prj_uid, StepTriggerPostStructure $request_data = null)
|
||||
{
|
||||
@@ -57,6 +64,8 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update activity step trigger.
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/:act_uid/step/:step_uid/trigger/:tri_uid
|
||||
*
|
||||
* @param string $tri_uid
|
||||
@@ -64,6 +73,11 @@ class Trigger extends Api
|
||||
* @param string $act_uid
|
||||
* @param string $prj_uid
|
||||
* @param StepTriggerPutStructure $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutActivityStepTrigger($tri_uid, $step_uid, $act_uid, $prj_uid, StepTriggerPutStructure $request_data = null)
|
||||
{
|
||||
@@ -80,6 +94,8 @@ class Trigger extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/activity/:act_uid/step/:step_uid/trigger/:tri_uid/:type
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $tri_uid
|
||||
* @param string $step_uid
|
||||
@@ -122,13 +138,20 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a trigger to the "Assignment" or "Routing" step section of an activity.
|
||||
*
|
||||
* @url POST /:prj_uid/activity/:act_uid/step/trigger
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $act_uid
|
||||
* @param string $prj_uid
|
||||
* @param StepAssignTaskTriggerPostStructure $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostActivityStepAssignTaskTrigger($act_uid, $prj_uid, StepAssignTaskTriggerPostStructure $request_data = null)
|
||||
{
|
||||
@@ -144,12 +167,19 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update activity step assign task trigger.
|
||||
*
|
||||
* @url PUT /:prj_uid/activity/:act_uid/step/trigger/:tri_uid
|
||||
*
|
||||
* @param string $tri_uid
|
||||
* @param string $act_uid
|
||||
* @param string $prj_uid
|
||||
* @param StepAssignTaskTriggerPutStructure $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutActivityStepAssignTaskTrigger($tri_uid, $act_uid, $prj_uid, StepAssignTaskTriggerPutStructure $request_data = null)
|
||||
{
|
||||
@@ -166,6 +196,8 @@ class Trigger extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/activity/:act_uid/step/trigger/:tri_uid/:type
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $tri_uid
|
||||
* @param string $act_uid
|
||||
|
||||
@@ -51,12 +51,19 @@ class CaseScheduler extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Case Scheduler.
|
||||
*
|
||||
* @url POST /:prjUid/case-scheduler
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param CaseSchedulerStructure $request_data
|
||||
*
|
||||
* @url POST /:prjUid/case-scheduler
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProjectCaseScheduler($prjUid, CaseSchedulerStructure $request_data = null)
|
||||
{
|
||||
@@ -75,12 +82,19 @@ class CaseScheduler extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project case scheduler.
|
||||
*
|
||||
* @url PUT /:prjUid/case-scheduler/:schUid
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $schUid {@min 32} {@max 32}
|
||||
* @param CaseSchedulerStructure $request_data
|
||||
* @param CaseSchedulerStructure $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProjectCaseScheduler($prjUid, $schUid, CaseSchedulerStructure $request_data)
|
||||
{
|
||||
@@ -100,6 +114,9 @@ class CaseScheduler extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/case-scheduler/:schUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $schUid {@min 32} {@max 32}
|
||||
*
|
||||
|
||||
@@ -30,6 +30,8 @@ class CaseTracker extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update case tracker.
|
||||
*
|
||||
* @url PUT /:prj_uid/case-tracker/property
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
@@ -37,6 +39,11 @@ class CaseTracker extends Api
|
||||
* @param string $map_type {@from body}{@choice NONE,PROCESSMAP,STAGES}
|
||||
* @param int $routing_history {@from body}{@choice 0,1}
|
||||
* @param int $message_history {@from body}{@choice 0,1}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutCaseTracker(
|
||||
$prj_uid,
|
||||
|
||||
@@ -31,16 +31,23 @@ class CaseTrackerObject extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an object (Dynaform, Input Document, Output Document) to a case tracker.
|
||||
*
|
||||
* @url POST /:prj_uid/case-tracker/object
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $cto_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT}{@required true}
|
||||
* @param string $cto_uid_obj {@from body}{@min 32}{@max 32}{@required true}
|
||||
* @param string $cto_condition {@from body}
|
||||
* @param int $cto_position {@from body}{@min 1}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostCaseTrackerObject(
|
||||
$prj_uid,
|
||||
@@ -64,6 +71,8 @@ class CaseTrackerObject extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update case tracker object.
|
||||
*
|
||||
* @url PUT /:prj_uid/case-tracker/object/:cto_uid
|
||||
*
|
||||
* @param string $cto_uid {@min 32}{@max 32}
|
||||
@@ -73,6 +82,11 @@ class CaseTrackerObject extends Api
|
||||
* @param string $cto_uid_obj {@from body}{@min 32}{@max 32}
|
||||
* @param string $cto_condition {@from body}
|
||||
* @param int $cto_position {@from body}{@min 1}
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutCaseTrackerObject(
|
||||
$cto_uid,
|
||||
@@ -94,6 +108,8 @@ class CaseTrackerObject extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/case-tracker/object/:cto_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $cto_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -55,9 +55,12 @@ class DataBaseConnection extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a database connection with the provided settings.
|
||||
*
|
||||
* @url POST /:prj_uid/database-connection/test
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $dbs_type {@from body} {@required true}
|
||||
* @param string $dbs_server {@from body} {@required false}
|
||||
* @param string $dbs_database_name {@from body} {@required false}
|
||||
@@ -65,12 +68,12 @@ class DataBaseConnection extends Api
|
||||
* @param string $dbs_encode {@from body} {@required true}
|
||||
* @param string $dbs_password {@from body}
|
||||
* @param string $dbs_description {@from body}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /:prj_uid/database-connection/test
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostTestDataBaseConnection(
|
||||
$prj_uid,
|
||||
@@ -94,9 +97,13 @@ class DataBaseConnection extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new database connection.
|
||||
*
|
||||
* @url POST /:prj_uid/database-connection
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $dbs_type {@from body} {@required true}
|
||||
* @param string $dbs_server {@from body} {@required false}
|
||||
* @param string $dbs_database_name {@from body} {@required false}
|
||||
@@ -104,13 +111,12 @@ class DataBaseConnection extends Api
|
||||
* @param string $dbs_encode {@from body} {@required true}
|
||||
* @param string $dbs_password {@from body}
|
||||
* @param string $dbs_description {@from body}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /:prj_uid/database-connection
|
||||
* @status 201
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostDataBaseConnection(
|
||||
$prj_uid,
|
||||
@@ -133,10 +139,13 @@ class DataBaseConnection extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update database connection.
|
||||
*
|
||||
* @url PUT /:prj_uid/database-connection/:dbs_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $dbs_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $dbs_type {@from body} {@required true}
|
||||
* @param string $dbs_server {@from body} {@required true}
|
||||
* @param string $dbs_database_name {@from body} {@required true}
|
||||
@@ -144,12 +153,12 @@ class DataBaseConnection extends Api
|
||||
* @param string $dbs_encode {@from body} {@required true}
|
||||
* @param string $dbs_password {@from body}
|
||||
* @param string $dbs_description {@from body}
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /:prj_uid/database-connection/:dbs_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_SETUP}
|
||||
*/
|
||||
public function doPutDataBaseConnection(
|
||||
$prj_uid,
|
||||
@@ -173,14 +182,13 @@ class DataBaseConnection extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/database-connection/:dbs_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $dbs_uid {@min 1} {@max 32}
|
||||
* @return void
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url DELETE /:prj_uid/database-connection/:dbs_uid
|
||||
*/
|
||||
public function doDeleteDataBaseConnection($prj_uid, $dbs_uid)
|
||||
{
|
||||
|
||||
@@ -38,12 +38,19 @@ class DynaForm extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dynaform.
|
||||
*
|
||||
* @url POST /:prj_uid/dynaform
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostDynaForm($prj_uid, $request_data)
|
||||
{
|
||||
@@ -63,11 +70,18 @@ class DynaForm extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update dynaform.
|
||||
*
|
||||
* @url PUT /:prj_uid/dynaform/:dyn_uid
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutDynaForm($dyn_uid, $prj_uid, $request_data)
|
||||
{
|
||||
@@ -83,6 +97,8 @@ class DynaForm extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/dynaform/:dyn_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
@@ -137,10 +153,18 @@ class DynaForm extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload language for a Dynaform.
|
||||
*
|
||||
* @url POST /:prj_uid/dynaform/:dyn_uid/upload-language
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostDynaFormLanguage($dyn_uid, $prj_uid)
|
||||
{
|
||||
@@ -154,10 +178,19 @@ class DynaForm extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete language from a Dynaform.
|
||||
*
|
||||
* @url POST /:prj_uid/dynaform/:dyn_uid/delete-language/:lang
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $lang
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doDeleteDynaFormLanguage($dyn_uid, $prj_uid, $lang)
|
||||
{
|
||||
@@ -188,11 +221,19 @@ class DynaForm extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Dynaform's history.
|
||||
*
|
||||
* @url POST /:prj_uid/dynaform/:dyn_uid/history
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doGetDynaFormHistory($dyn_uid, $prj_uid, $request_data)
|
||||
{
|
||||
|
||||
@@ -64,9 +64,18 @@ class EmailEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Data for email event.
|
||||
*
|
||||
* @url POST /:prj_uid/email-event
|
||||
*
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostEmailEvent($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -79,11 +88,18 @@ class EmailEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update email event.
|
||||
*
|
||||
* @url PUT /:prj_uid/email-event/:email_event_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $email_event_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutEmailEvent($prj_uid, $email_event_uid, array $request_data)
|
||||
{
|
||||
@@ -96,6 +112,8 @@ class EmailEvent extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/email-event/:email_event_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $email_event_uid {@min 32}{@max 32}
|
||||
@@ -111,6 +129,8 @@ class EmailEvent extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/email-event/by-event/:act_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $act_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -139,6 +139,10 @@ class Event extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update event.
|
||||
*
|
||||
* @url PUT /:prj_uid/event/:evn_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $evn_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
@@ -156,13 +160,11 @@ class Event extends Api
|
||||
* @param string $evn_tas_uid_to {@from body}
|
||||
* @param string $evn_conditions {@from body}
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @url PUT /:prj_uid/event/:evn_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutEvent (
|
||||
$prj_uid,
|
||||
@@ -201,17 +203,13 @@ class Event extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/event/:evn_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $evn_uid {@min 1} {@max 32}
|
||||
* @return void
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @url DELETE /:prj_uid/event/:evn_uid
|
||||
*/
|
||||
public function doDeleteEvent($prj_uid, $evn_uid)
|
||||
{
|
||||
|
||||
@@ -37,11 +37,19 @@ class FilesManager extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file in the File Manager.
|
||||
*
|
||||
* @url POST /:prj_uid/file-manager
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param ProcessFilesManagerStructurePost $request_data
|
||||
* @param string $prf_content
|
||||
*
|
||||
* @url POST /:prj_uid/file-manager
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProcessFilesManager($prj_uid, ProcessFilesManagerStructurePost $request_data, $prf_content=null)
|
||||
{
|
||||
@@ -61,10 +69,18 @@ class FilesManager extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a document to the File Manager.
|
||||
*
|
||||
* @url POST /:prj_uid/file-manager/:prf_uid/upload
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $prf_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @url POST /:prj_uid/file-manager/:prf_uid/upload
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProcessFilesManagerUpload($prj_uid, $prf_uid)
|
||||
{
|
||||
@@ -80,11 +96,19 @@ class FilesManager extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update process files manager
|
||||
*
|
||||
* @url PUT /:prj_uid/file-manager/:prf_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param ProcessFilesManagerStructure $request_data
|
||||
* @param string $prf_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @url PUT /:prj_uid/file-manager/:prf_uid
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProcessFilesManager($prj_uid, ProcessFilesManagerStructure $request_data, $prf_uid)
|
||||
{
|
||||
@@ -103,10 +127,12 @@ class FilesManager extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/file-manager/:prf_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $prf_uid {@min 32} {@max 32}
|
||||
*
|
||||
* @url DELETE /:prj_uid/file-manager/:prf_uid
|
||||
*/
|
||||
public function doDeleteProcessFilesManager($prj_uid, $prf_uid)
|
||||
{
|
||||
@@ -137,10 +163,12 @@ class FilesManager extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/file-manager/folder
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $path
|
||||
*
|
||||
* @url DELETE /:prj_uid/file-manager/folder
|
||||
*/
|
||||
public function doDeleteFolderProcessFilesManager($prj_uid, $path)
|
||||
{
|
||||
|
||||
@@ -33,12 +33,19 @@ class InputDocument extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Input Document in a project.
|
||||
*
|
||||
* @url POST /:prj_uid/input-document
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostInputDocument($prj_uid, $request_data)
|
||||
{
|
||||
@@ -58,11 +65,18 @@ class InputDocument extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update input document.
|
||||
*
|
||||
* @url PUT /:prj_uid/input-document/:inp_doc_uid
|
||||
*
|
||||
* @param string $inp_doc_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutInputDocument($inp_doc_uid, $prj_uid, $request_data)
|
||||
{
|
||||
@@ -79,6 +93,8 @@ class InputDocument extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/input-document/:inp_doc_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $inp_doc_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -80,12 +80,19 @@ class MessageEventDefinition extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message event definition.
|
||||
*
|
||||
* @url POST /:prj_uid/message-event-definition
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostMessageEventDefinition($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -101,11 +108,18 @@ class MessageEventDefinition extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update message event definition.
|
||||
*
|
||||
* @url PUT /:prj_uid/message-event-definition/:msged_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msged_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutMessageEventDefinition($prj_uid, $msged_uid, array $request_data)
|
||||
{
|
||||
@@ -118,6 +132,8 @@ class MessageEventDefinition extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/message-event-definition/:msged_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msged_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -65,12 +65,19 @@ class MessageType extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create message type
|
||||
*
|
||||
* @url POST /:prj_uid/message-type
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostMessageType($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -86,11 +93,18 @@ class MessageType extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update message type.
|
||||
*
|
||||
* @url PUT /:prj_uid/message-type/:msgt_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msgt_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutMessageType($prj_uid, $msgt_uid, array $request_data)
|
||||
{
|
||||
@@ -103,6 +117,8 @@ class MessageType extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/message-type/:msgt_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msgt_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -67,13 +67,20 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Return data of the new Message created.
|
||||
*
|
||||
* @url POST /:prj_uid/message-type/:msgt_uid/variable
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msgt_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostMessageTypeVariable($prj_uid, $msgt_uid, array $request_data)
|
||||
{
|
||||
@@ -89,12 +96,19 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update message type variable.
|
||||
*
|
||||
* @url PUT /:prj_uid/message-type/:msgt_uid/variable/:msgtv_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msgt_uid {@min 32}{@max 32}
|
||||
* @param string $msgtv_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutMessageTypeVariable($prj_uid, $msgt_uid, $msgtv_uid, array $request_data)
|
||||
{
|
||||
@@ -106,7 +120,9 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/message-type/:msgt_uid/variable/:msgtv_uid
|
||||
* @url DELETE /:prj_uid/user/message-type/:msgt_uid/variable/:msgtv_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $msgt_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -51,12 +51,19 @@ class OutputDocuments extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new output document for a project.
|
||||
*
|
||||
* @url POST /:prjUid/output-document
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param OutputDocumentStructure $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProjectOutputDocument($prjUid, OutputDocumentStructure $request_data = null)
|
||||
{
|
||||
@@ -74,12 +81,18 @@ class OutputDocuments extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project output document.
|
||||
*
|
||||
* @url PUT /:prjUid/output-document/:outputDocumentUid
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $outputDocumentUid {@min 32} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProjectOutputDocument($prjUid, $outputDocumentUid, $request_data)
|
||||
{
|
||||
@@ -95,6 +108,9 @@ class OutputDocuments extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/output-document/:outputDocumentUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $outputDocumentUid {@min 32} {@max 32}
|
||||
*
|
||||
|
||||
@@ -59,16 +59,16 @@ class ProcessPermissions extends Api
|
||||
|
||||
/**
|
||||
* Creates a new Process Permission for a project.
|
||||
*
|
||||
*
|
||||
* @url POST /:prj_uid/process-permission/
|
||||
* @status 201
|
||||
*
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
@@ -93,10 +93,13 @@ class ProcessPermissions extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update process permisson.
|
||||
*
|
||||
* @url PUT /:prj_uid/process-permission/:ob_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $ob_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $usr_uid {@from body} {@min 1} {@max 32}
|
||||
* @param string $op_user_relation {@from body} {@choice 1,2}
|
||||
* @param string $op_case_status {@from body} {@choice ALL,DRAFT,TO_DO,PAUSED,COMPLETED}
|
||||
@@ -109,12 +112,11 @@ class ProcessPermissions extends Api
|
||||
* @param string $inputs {@from body}
|
||||
* @param string $outputs {@from body}
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @url PUT /:prj_uid/process-permission/:ob_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProcessPermission(
|
||||
$prj_uid,
|
||||
@@ -143,15 +145,14 @@ class ProcessPermissions extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/process-permission/:ob_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $ob_uid {@min 1} {@max 32}
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @url DELETE /:prj_uid/process-permission/:ob_uid
|
||||
*/
|
||||
public function doDeleteProcessPermission($prj_uid, $ob_uid)
|
||||
{
|
||||
|
||||
@@ -234,13 +234,20 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a user or group as a process supervisor.
|
||||
*
|
||||
* @url POST /:prjUid/process-supervisor
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $usr_uid {@min 32} {@max 32}
|
||||
* @param string $pu_type {@choice SUPERVISOR,GROUP_SUPERVISOR}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProcessSupervisor($prjUid, $usr_uid, $pu_type)
|
||||
{
|
||||
@@ -257,13 +264,20 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a Dynaform to a Process Supervisor.
|
||||
*
|
||||
* @url POST /:prjUid/process-supervisor/dynaform
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $dyn_uid {@min 32} {@max 32}
|
||||
* @param int $pud_position
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position = null)
|
||||
{
|
||||
@@ -280,13 +294,20 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an input document to a Process Supervisor.
|
||||
*
|
||||
* @url POST /:prjUid/process-supervisor/input-document
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $inp_doc_uid {@min 32} {@max 32}
|
||||
* @param int $pui_position
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position = null)
|
||||
{
|
||||
@@ -304,6 +325,8 @@ class ProcessSupervisors extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/:puUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $puUid {@min 32} {@max 32}
|
||||
@@ -322,6 +345,8 @@ class ProcessSupervisors extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/dynaform/:pudUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $pudUid {@min 32} {@max 32}
|
||||
@@ -340,6 +365,8 @@ class ProcessSupervisors extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/input-document/:puiUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $puiUid {@min 32} {@max 32}
|
||||
@@ -357,13 +384,19 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update process supervisor dynaform.
|
||||
*
|
||||
* @url PUT /:prjUid/process-supervisor/dynaform/:pud_uid
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $pud_uid {@min 32} {@max 32}
|
||||
* @param int $pud_position
|
||||
*
|
||||
* @status 201
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position = null)
|
||||
{
|
||||
@@ -380,13 +413,20 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update process supervisor input document.
|
||||
*
|
||||
* @url PUT /:prjUid/process-supervisor/input-document/:pui_uid
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $pui_uid {@min 32} {@max 32}
|
||||
* @param int $pui_position
|
||||
*
|
||||
* @status 201
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position = null)
|
||||
{
|
||||
|
||||
@@ -70,11 +70,19 @@ class ProjectUsers extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user that can start a task.
|
||||
*
|
||||
* @url POST /:prj_uid/ws/user/can-start-task
|
||||
*
|
||||
* @param string $prj_uid {@min 32} {@max 32}
|
||||
* @param string $act_uid {@min 32} {@max 32}
|
||||
* @param wsUserCanStartTaskStructure $request_data
|
||||
*
|
||||
* @url POST /:prj_uid/ws/user/can-start-task
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostProjectWsUserCanStartTask($prj_uid, $act_uid = null, wsUserCanStartTaskStructure $request_data = null)
|
||||
{
|
||||
|
||||
@@ -95,21 +95,24 @@ class ReportTable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Report Table.
|
||||
*
|
||||
* @url POST /:prj_uid/report-table
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $rep_tab_name {@from body}
|
||||
* @param string $rep_tab_dsc {@from body}
|
||||
* @param string $rep_tab_connection {@from body}
|
||||
* @param string $rep_tab_type {@from body} {@choice NORMAL,GRID}
|
||||
* @param string $rep_tab_grid {@from body}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /:prj_uid/report-table
|
||||
* @status 201
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostReportTable(
|
||||
$prj_uid,
|
||||
@@ -133,17 +136,20 @@ class ReportTable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update report table.
|
||||
*
|
||||
* @url PUT /:prj_uid/report-table/:rep_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $rep_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @param string $rep_tab_dsc {@from body}
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /:prj_uid/report-table/:rep_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutReportTable(
|
||||
$prj_uid,
|
||||
@@ -161,14 +167,14 @@ class ReportTable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/report-table/:rep_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $rep_uid {@min 1} {@max 32}
|
||||
* @return void
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url DELETE /:prj_uid/report-table/:rep_uid
|
||||
*/
|
||||
public function doDeleteReportTable($prj_uid, $rep_uid)
|
||||
{
|
||||
|
||||
@@ -80,12 +80,19 @@ class ScriptTask extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create script task for a project.
|
||||
*
|
||||
* @url POST /:prj_uid/script-task
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostScriptTask($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -101,11 +108,18 @@ class ScriptTask extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update script task.
|
||||
*
|
||||
* @url PUT /:prj_uid/script-task/:scrtas_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $scrtas_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutScriptTask($prj_uid, $scrtas_uid, array $request_data)
|
||||
{
|
||||
@@ -118,6 +132,8 @@ class ScriptTask extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/script-task/:scrtas_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $scrtas_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -43,16 +43,19 @@ class Subprocess extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update subprocess.
|
||||
*
|
||||
* @url PUT /:prj_uid/subprocess/:tas_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 1} {@max 32}
|
||||
* @param string $tas_uid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @url PUT /:prj_uid/subprocess/:tas_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutSubprocess($prj_uid, $tas_uid, $request_data)
|
||||
{
|
||||
|
||||
@@ -86,12 +86,19 @@ class TimerEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create timer event for a project.
|
||||
*
|
||||
* @url POST /:prj_uid/timer-event
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostTimerEvent($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -109,11 +116,18 @@ class TimerEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update timer event.
|
||||
*
|
||||
* @url PUT /:prj_uid/timer-event/:tmrevn_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $tmrevn_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutTimerEvent($prj_uid, $tmrevn_uid, array $request_data)
|
||||
{
|
||||
@@ -128,6 +142,8 @@ class TimerEvent extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/timer-event/:tmrevn_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $tmrevn_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -55,6 +55,11 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new trigger in a project.
|
||||
*
|
||||
* @url POST /:projectUid/trigger
|
||||
* @status 201
|
||||
*
|
||||
* @param string $projectUid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $tri_title {@from body} {@min 1}
|
||||
@@ -62,13 +67,12 @@ class Trigger extends Api
|
||||
* @param string $tri_type {@from body}
|
||||
* @param string $tri_webbot {@from body}
|
||||
* @param string $tri_param {@from body}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /:projectUid/trigger
|
||||
* @status 201
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostTrigger($projectUid, $request_data, $tri_title, $tri_description = '', $tri_type = 'SCRIPT', $tri_webbot = '', $tri_param = '')
|
||||
{
|
||||
@@ -82,6 +86,10 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update trigger.
|
||||
*
|
||||
* @url PUT /:projectUid/trigger/:triggerUid
|
||||
*
|
||||
* @param string $projectUid {@min 1} {@max 32}
|
||||
* @param string $triggerUid {@min 1} {@max 32}
|
||||
* @param array $request_data
|
||||
@@ -90,12 +98,12 @@ class Trigger extends Api
|
||||
* @param string $tri_type {@from body}
|
||||
* @param string $tri_webbot {@from body}
|
||||
* @param string $tri_param {@from body}
|
||||
*
|
||||
* @return void
|
||||
* @throws RestException
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /:projectUid/trigger/:triggerUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutTrigger($projectUid, $triggerUid, $request_data, $tri_title = '', $tri_description = '', $tri_type = 'SCRIPT', $tri_webbot = '', $tri_param = '')
|
||||
{
|
||||
@@ -109,14 +117,14 @@ class Trigger extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:projectUid/trigger/:triggerUid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $projectUid {@min 1} {@max 32}
|
||||
* @param string $triggerUid {@min 1} {@max 32}
|
||||
* @return void
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url DELETE /:projectUid/trigger/:triggerUid
|
||||
*/
|
||||
public function doDeleteTrigger($projectUid, $triggerUid)
|
||||
{
|
||||
|
||||
@@ -66,14 +66,21 @@ class TriggerWizard extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Trigger for a Process
|
||||
*
|
||||
* @url POST /:prj_uid/trigger-wizard/:lib_name/:fn_name
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $lib_name
|
||||
* @param string $fn_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostTriggerWizard($prj_uid, $lib_name, $fn_name, $request_data)
|
||||
{
|
||||
@@ -93,6 +100,8 @@ class TriggerWizard extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update trigger wizard.
|
||||
*
|
||||
* @url PUT /:prj_uid/trigger-wizard/:lib_name/:fn_name/:tri_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
@@ -100,6 +109,11 @@ class TriggerWizard extends Api
|
||||
* @param string $fn_name
|
||||
* @param string $tri_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutTriggerWizard($prj_uid, $lib_name, $fn_name, $tri_uid, $request_data)
|
||||
{
|
||||
|
||||
@@ -48,12 +48,19 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a process variable.
|
||||
*
|
||||
* @url POST /:prj_uid/process-variable
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostVariable($prj_uid, $request_data)
|
||||
{
|
||||
@@ -72,11 +79,18 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update variable.
|
||||
*
|
||||
* @url PUT /:prj_uid/process-variable/:var_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $var_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutVariable($prj_uid, $var_uid, array $request_data)
|
||||
{
|
||||
@@ -93,6 +107,8 @@ class Variable extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/process-variable/:var_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $var_uid {@min 32}{@max 32}
|
||||
@@ -109,11 +125,21 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes an SQL query of a dependent field, such as a dropdown box, checkgroup
|
||||
* or radiogroup, that uses an SQL query with one or more dynamic variables
|
||||
* to populate its list of options.
|
||||
*
|
||||
* @url POST /:prj_uid/process-variable/:var_name/execute-query
|
||||
*
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $var_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY, PM_CASES}
|
||||
*/
|
||||
public function doPostVariableExecuteSql($prj_uid, $var_name = '', $request_data = array())
|
||||
{
|
||||
@@ -131,11 +157,21 @@ class Variable extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the options in a suggest box, dropdown box, checkgroup or radiogroup,
|
||||
* which uses an SQL query to populate its list of options (or uses a datasource
|
||||
* which is "array variable" in version 3.0.1.8 or later).
|
||||
*
|
||||
* @url POST /:prj_uid/process-variable/:var_name/execute-query-suggest
|
||||
*
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $var_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY, PM_CASES}
|
||||
*/
|
||||
public function doPostVariableExecuteSqlSuggest($prj_uid, $var_name, $request_data)
|
||||
{
|
||||
|
||||
@@ -71,12 +71,19 @@ class WebEntry extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Web Entry using the method "PHP pages with Web Services".
|
||||
*
|
||||
* @url POST /:prj_uid/web-entry
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostWebEntry($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -93,11 +100,18 @@ class WebEntry extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update web-entry.
|
||||
*
|
||||
* @url PUT /:prj_uid/web-entry/:we_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $we_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutWebEntry($prj_uid, $we_uid, array $request_data)
|
||||
{
|
||||
@@ -111,6 +125,8 @@ class WebEntry extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/web-entry/:we_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $we_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -88,13 +88,19 @@ class WebEntryEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Create web entry event for a project.
|
||||
*
|
||||
* @url POST /:prj_uid/web-entry-event
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @status 201
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPostWebEntryEvent($prj_uid, array $request_data)
|
||||
{
|
||||
@@ -110,12 +116,19 @@ class WebEntryEvent extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Update web-entry event.
|
||||
*
|
||||
* @url PUT /:prj_uid/web-entry-event/:wee_uid
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param string $wee_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*/
|
||||
public function doPutWebEntryEvent($prj_uid, $wee_uid, array $request_data)
|
||||
{
|
||||
@@ -129,6 +142,7 @@ class WebEntryEvent extends Api
|
||||
|
||||
/**
|
||||
* @url DELETE /:prj_uid/web-entry-event/:wee_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_FACTORY}
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -99,12 +99,17 @@ class Role extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
* Update a role.
|
||||
*
|
||||
* @url PUT /:rol_uid
|
||||
*
|
||||
* @param string $rol_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPut($rol_uid, array $request_data)
|
||||
{
|
||||
|
||||
@@ -72,9 +72,9 @@ class User extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:rol_uid/user/:usr_uid
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
* @url DELETE /:rol_uid/user/:usr_uid
|
||||
*
|
||||
* @param string $rol_uid {@min 32}{@max 32}
|
||||
* @param string $usr_uid {@min 32}{@max 32}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
class Test2 extends Api
|
||||
{
|
||||
|
||||
public function hello2()
|
||||
{
|
||||
return 'Hello #2';
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /getHello
|
||||
*/
|
||||
public function helloworld($param = '')
|
||||
{
|
||||
return 'Greetings, from a overridden url ' . $param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /sample/other/large/:name
|
||||
*/
|
||||
public function sampleOther($name)
|
||||
{
|
||||
return 'Name: ' . $name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
class Test3 extends Api
|
||||
{
|
||||
|
||||
public function hello3()
|
||||
{
|
||||
return 'Hello #3';
|
||||
}
|
||||
|
||||
/**
|
||||
* @status 201
|
||||
*/
|
||||
public function post2()
|
||||
{
|
||||
return array('success' => true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,12 +83,17 @@ class User extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
* Update a user.
|
||||
*
|
||||
* @url PUT /:usr_uid
|
||||
*
|
||||
* @param string $usr_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @throws RestException
|
||||
*
|
||||
* @access protected
|
||||
* @class AccessControl {@permission PM_USERS}
|
||||
*/
|
||||
public function doPutUser($usr_uid, $request_data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user