Merged in release/3.7.3 (pull request #8351)

release/3.7.3
This commit is contained in:
Paula Quispe
2022-01-17 20:52:18 +00:00
142 changed files with 5095 additions and 1774 deletions

View File

@@ -283,7 +283,7 @@ def buildMafe(homeDir, targetDir, mode)
"#{homeDir}/lib/wz_jsgraphics/wz_jsgraphics.js" => "#{jsTargetDir}/wz_jsgraphics.js", "#{homeDir}/lib/wz_jsgraphics/wz_jsgraphics.js" => "#{jsTargetDir}/wz_jsgraphics.js",
"#{homeDir}/lib/jQuery/jquery-1.10.2.min.js" => "#{jsTargetDir}/jquery-1.10.2.min.js", "#{homeDir}/lib/jQuery/jquery-1.10.2.min.js" => "#{jsTargetDir}/jquery-1.10.2.min.js",
"#{homeDir}/lib/underscore/underscore-min.js" => "#{jsTargetDir}/underscore-min.js", "#{homeDir}/lib/underscore/underscore-min.js" => "#{jsTargetDir}/underscore-min.js",
"#{homeDir}/lib/jQueryUI/jquery-ui-1.10.3.custom.min.js" => "#{jsTargetDir}/jquery-ui-1.10.3.custom.min.js", "#{homeDir}/lib/jQueryUI/jquery-ui.min.js" => "#{jsTargetDir}/jquery-ui.min.js",
"#{homeDir}/lib/jQueryLayout/jquery.layout.min.js" => "#{jsTargetDir}/jquery.layout.min.js", "#{homeDir}/lib/jQueryLayout/jquery.layout.min.js" => "#{jsTargetDir}/jquery.layout.min.js",
"#{homeDir}/lib/modernizr/modernizr.js" => "#{jsTargetDir}/modernizr.js" "#{homeDir}/lib/modernizr/modernizr.js" => "#{jsTargetDir}/modernizr.js"
}) })
@@ -376,7 +376,7 @@ def getJsIncludeFiles
"workflow/public_html/lib/js/wz_jsgraphics.js", "workflow/public_html/lib/js/wz_jsgraphics.js",
"workflow/public_html/lib/js/jquery-1.10.2.min.js", "workflow/public_html/lib/js/jquery-1.10.2.min.js",
"workflow/public_html/lib/js/underscore-min.js", "workflow/public_html/lib/js/underscore-min.js",
"workflow/public_html/lib/js/jquery-ui-1.10.3.custom.min.js", "workflow/public_html/lib/js/jquery-ui.min.js",
"workflow/public_html/lib/js/jquery.layout.min.js", "workflow/public_html/lib/js/jquery.layout.min.js",
"workflow/public_html/lib/js/modernizr.js", "workflow/public_html/lib/js/modernizr.js",
"workflow/public_html/lib/js/restclient.min.js", "workflow/public_html/lib/js/restclient.min.js",

View File

@@ -99,7 +99,7 @@ $jsFiles = array (
"workflow/public_html/lib/js/wz_jsgraphics.js", "workflow/public_html/lib/js/wz_jsgraphics.js",
"workflow/public_html/lib/js/jquery-1.10.2.min.js", "workflow/public_html/lib/js/jquery-1.10.2.min.js",
"workflow/public_html/lib/js/underscore-min.js", "workflow/public_html/lib/js/underscore-min.js",
"workflow/public_html/lib/js/jquery-ui-1.10.3.custom.min.js", "workflow/public_html/lib/js/jquery-ui.min.js",
"workflow/public_html/lib/js/jquery.layout.min.js", "workflow/public_html/lib/js/jquery.layout.min.js",
"workflow/public_html/lib/js/modernizr.js", "workflow/public_html/lib/js/modernizr.js",
"workflow/public_html/lib/js/restclient.min.js", "workflow/public_html/lib/js/restclient.min.js",

View File

@@ -35,9 +35,9 @@
"laravel/framework": "5.7.*", "laravel/framework": "5.7.*",
"luracast/restler": "3.0", "luracast/restler": "3.0",
"bshaffer/oauth2-server-php": "v1.0", "bshaffer/oauth2-server-php": "v1.0",
"colosa/pmui": "release/3.7.0-dev", "colosa/pmui": "release/3.7.2-dev",
"colosa/michelangelofe": "release/3.7.0-dev", "colosa/michelangelofe": "release/3.7.2-dev",
"colosa/pmdynaform": "release/3.7.0-dev", "colosa/pmdynaform": "release/3.7.2-dev",
"colosa/taskscheduler": "release/1.0.2-dev", "colosa/taskscheduler": "release/1.0.2-dev",
"google/apiclient": "1.1.6", "google/apiclient": "1.1.6",
"dapphp/securimage": "^3.6", "dapphp/securimage": "^3.6",
@@ -64,7 +64,8 @@
"phpmyadmin/sql-parser": "^5.3", "phpmyadmin/sql-parser": "^5.3",
"aws/aws-sdk-php": "~3.0", "aws/aws-sdk-php": "~3.0",
"cretueusebiu/laravel-javascript": "^0.2.1", "cretueusebiu/laravel-javascript": "^0.2.1",
"stevenmaguire/oauth2-microsoft": "^2.2" "stevenmaguire/oauth2-microsoft": "^2.2",
"phpseclib/mcrypt_compat": "^2.0"
}, },
"require-dev": { "require-dev": {
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",

250
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0cfdbd7bd38cb8bdeebe9625a7d66455", "content-hash": "5bcf521c2f8df8459b05200fbdef3ed7",
"packages": [ "packages": [
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
@@ -2357,6 +2357,73 @@
], ],
"time": "2021-04-09T13:42:10+00:00" "time": "2021-04-09T13:42:10+00:00"
}, },
{
"name": "paragonie/constant_time_encoding",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
"shasum": ""
},
"require": {
"php": "^7|^8"
},
"require-dev": {
"phpunit/phpunit": "^6|^7|^8|^9",
"vimeo/psalm": "^1|^2|^3|^4"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
"source": "https://github.com/paragonie/constant_time_encoding"
},
"time": "2020-12-06T15:14:20+00:00"
},
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
"version": "v9.99.100", "version": "v9.99.100",
@@ -3045,6 +3112,185 @@
], ],
"time": "2021-02-05T14:33:29+00:00" "time": "2021-02-05T14:33:29+00:00"
}, },
{
"name": "phpseclib/mcrypt_compat",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/mcrypt_compat.git",
"reference": "299da4c7e7e41c8d4964e894a90ca4c96175846b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/mcrypt_compat/zipball/299da4c7e7e41c8d4964e894a90ca4c96175846b",
"reference": "299da4c7e7e41c8d4964e894a90ca4c96175846b",
"shasum": ""
},
"require": {
"php": ">=5.6.1",
"phpseclib/phpseclib": ">=3.0.12 <4.0.0"
},
"provide": {
"ext-mcrypt": "5.6.40"
},
"require-dev": {
"phpunit/phpunit": "^5.7|^6.0|^9.4"
},
"suggest": {
"ext-openssl": "Will enable faster cryptographic operations"
},
"type": "library",
"autoload": {
"files": [
"lib/mcrypt.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"homepage": "http://phpseclib.sourceforge.net"
}
],
"description": "PHP 5.x/7.x polyfill for mcrypt extension",
"keywords": [
"cryptograpy",
"encryption",
"mcrypt",
"polyfill"
],
"support": {
"email": "terrafrost@php.net",
"issues": "https://github.com/phpseclib/mcrypt_compat/issues",
"source": "https://github.com/phpseclib/mcrypt_compat"
},
"funding": [
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/mcrypt_compat",
"type": "tidelift"
}
],
"time": "2021-11-29T02:38:47+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.12",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb",
"reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb",
"shasum": ""
},
"require": {
"paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1"
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib3\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
"homepage": "http://phpseclib.sourceforge.net",
"keywords": [
"BigInteger",
"aes",
"asn.1",
"asn1",
"blowfish",
"crypto",
"cryptography",
"encryption",
"rsa",
"security",
"sftp",
"signature",
"signing",
"ssh",
"twofish",
"x.509",
"x509"
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.12"
},
"funding": [
{
"url": "https://github.com/terrafrost",
"type": "github"
},
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
"type": "tidelift"
}
],
"time": "2021-11-28T23:46:03+00:00"
},
{ {
"name": "predis/predis", "name": "predis/predis",
"version": "v1.1.1", "version": "v1.1.1",
@@ -8143,5 +8389,5 @@
"php": ">=7.1" "php": ">=7.1"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "1.1.0" "plugin-api-version": "2.0.0"
} }

View File

@@ -237,8 +237,8 @@
"dest_name": "underscore-min.js" "dest_name": "underscore-min.js"
}, },
{ {
"src": "jQueryUI/jquery-ui-1.10.3.custom.min.js", "src": "jQueryUI/jquery-ui.min.js",
"dest_name": "jquery-ui-1.10.3.custom.min.js" "dest_name": "jquery-ui.min.js"
}, },
{ {
"src": "jQueryLayout/jquery.layout.min.js", "src": "jQueryLayout/jquery.layout.min.js",
@@ -308,7 +308,7 @@
"workflow/public_html/lib/js/wz_jsgraphics.js", "workflow/public_html/lib/js/wz_jsgraphics.js",
"workflow/public_html/lib/js/jquery-1.10.2.min.js", "workflow/public_html/lib/js/jquery-1.10.2.min.js",
"workflow/public_html/lib/js/underscore-min.js", "workflow/public_html/lib/js/underscore-min.js",
"workflow/public_html/lib/js/jquery-ui-1.10.3.custom.min.js", "workflow/public_html/lib/js/jquery-u.min.js",
"workflow/public_html/lib/js/jquery.layout.min.js", "workflow/public_html/lib/js/jquery.layout.min.js",
"workflow/public_html/lib/js/modernizr.js", "workflow/public_html/lib/js/modernizr.js",
"workflow/public_html/lib/js/restclient.min.js", "workflow/public_html/lib/js/restclient.min.js",

View File

@@ -96,6 +96,18 @@ $factory->state(\ProcessMaker\Model\Application::class, 'draft', function (Faker
]; ];
}); });
$factory->state(\ProcessMaker\Model\Application::class, 'paused', function (Faker $faker) {
$user = factory(\ProcessMaker\Model\User::class)->create();
return [
'APP_NUMBER' => $faker->unique()->numberBetween(1000),
'APP_STATUS_ID' => 1,
'APP_STATUS' => 'PAUSED',
'APP_INIT_USER' => $user->USR_UID,
'APP_INIT_USER_ID' => $user->USR_ID,
];
});
$factory->state(\ProcessMaker\Model\Application::class, 'completed', function (Faker $faker) { $factory->state(\ProcessMaker\Model\Application::class, 'completed', function (Faker $faker) {
return [ return [
'APP_NUMBER' => $faker->unique()->numberBetween(1000), 'APP_NUMBER' => $faker->unique()->numberBetween(1000),

View File

@@ -64,14 +64,15 @@ $factory->state(\ProcessMaker\Model\Delegation::class, 'foreign_keys', function
$initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes'); $initDate = $faker->dateTimeInInterval($delegateDate, '+30 minutes');
$riskDate = $faker->dateTimeInInterval($initDate, '+1 day'); $riskDate = $faker->dateTimeInInterval($initDate, '+1 day');
$taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day'); $taskDueDate = $faker->dateTimeInInterval($riskDate, '+2 day');
$index = $faker->unique()->numberBetween(2000);
// Return with default values // Return with default values
return [ return [
'DELEGATION_ID' => $faker->unique()->numberBetween(5000), 'DELEGATION_ID' => $faker->unique()->numberBetween(5000),
'APP_UID' => $application->APP_UID, 'APP_UID' => $application->APP_UID,
'DEL_INDEX' => $faker->unique()->numberBetween(2000), 'DEL_INDEX' => $index,
'APP_NUMBER' => $application->APP_NUMBER, 'APP_NUMBER' => $application->APP_NUMBER,
'DEL_PREVIOUS' => 0, 'DEL_PREVIOUS' => $index - 1,
'PRO_UID' => $process->PRO_UID, 'PRO_UID' => $process->PRO_UID,
'TAS_UID' => $task->TAS_UID, 'TAS_UID' => $task->TAS_UID,
'USR_UID' => $user->USR_UID, 'USR_UID' => $user->USR_UID,

View File

@@ -12,3 +12,14 @@ $factory->define(\ProcessMaker\Model\GroupUser::class, function(Faker $faker) {
]; ];
}); });
// Create columns from a table with the foreign keys
$factory->state(\ProcessMaker\Model\GroupUser::class, 'foreign_keys', function (Faker $faker) {
// Create values in the foreign key relations
$user = factory(\ProcessMaker\Model\User::class)->create();
$group = factory(\ProcessMaker\Model\Groupwf::class)->create();
return [
'GRP_UID' => $group->GRP_UID,
'GRP_ID' => $group->GRP_ID,
'USR_UID' => $user->USR_UID,
];
});

View File

@@ -7,6 +7,7 @@ use Faker\Generator as Faker;
$factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) { $factory->define(\ProcessMaker\Model\Groupwf::class, function(Faker $faker) {
return [ return [
'GRP_UID' => G::generateUniqueID(), 'GRP_UID' => G::generateUniqueID(),
'GRP_ID' => $faker->unique()->numberBetween(2000),
'GRP_TITLE' => $faker->sentence(2), 'GRP_TITLE' => $faker->sentence(2),
'GRP_STATUS' => 'ACTIVE', 'GRP_STATUS' => 'ACTIVE',
'GRP_LDAP_DN' => '', 'GRP_LDAP_DN' => '',

View File

@@ -26,6 +26,7 @@ $factory->define(\ProcessMaker\Model\Process::class, function (Faker $faker) {
'PRO_DYNAFORMS' => serialize([]), 'PRO_DYNAFORMS' => serialize([]),
'PRO_ITEE' => 1, 'PRO_ITEE' => 1,
'PRO_ACTION_DONE' => serialize([]), 'PRO_ACTION_DONE' => serialize([]),
'PRO_SUBPROCESS' => 0,
'PRO_CATEGORY' => function () { 'PRO_CATEGORY' => function () {
return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID; return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID;
}, },
@@ -56,6 +57,7 @@ $factory->state(\ProcessMaker\Model\Process::class, 'foreign_keys', function (Fa
'PRO_DYNAFORMS' => serialize([]), 'PRO_DYNAFORMS' => serialize([]),
'PRO_ITEE' => 1, 'PRO_ITEE' => 1,
'PRO_ACTION_DONE' => serialize([]), 'PRO_ACTION_DONE' => serialize([]),
'PRO_SUBPROCESS' => 0,
'PRO_CATEGORY' => function () { 'PRO_CATEGORY' => function () {
return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID; return factory(\ProcessMaker\Model\ProcessCategory::class)->create()->CATEGORY_UID;
}, },

View File

@@ -7,6 +7,20 @@ $factory->define(\ProcessMaker\Model\ProcessUser::class, function(Faker $faker)
'PU_UID' => G::generateUniqueID(), 'PU_UID' => G::generateUniqueID(),
'PRO_UID' => G::generateUniqueID(), 'PRO_UID' => G::generateUniqueID(),
'USR_UID' => G::generateUniqueID(), 'USR_UID' => G::generateUniqueID(),
'PU_TYPE' => $faker->word 'PU_TYPE' => 'SUPERVISOR'
];
});
// Create a process with the foreign keys
$factory->state(\ProcessMaker\Model\ProcessUser::class, 'foreign_keys', function (Faker $faker) {
// Create user
$user = factory(\ProcessMaker\Model\User::class)->create();
$process = factory(\ProcessMaker\Model\Process::class)->create();
return [
'PU_UID' => G::generateUniqueID(),
'PRO_UID' => $process->PRO_UID,
'USR_UID' => $user->USR_UID,
'PU_TYPE' => 'SUPERVISOR'
]; ];
}); });

View File

@@ -17,6 +17,7 @@ $factory->define(\ProcessMaker\Model\Task::class, function(Faker $faker) {
'TAS_DURATION' => 1, 'TAS_DURATION' => 1,
'TAS_ASSIGN_TYPE' => 'BALANCED', 'TAS_ASSIGN_TYPE' => 'BALANCED',
'TAS_DEF_TITLE' => $faker->sentence(2), 'TAS_DEF_TITLE' => $faker->sentence(2),
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED', 'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE', 'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE', 'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',
@@ -47,6 +48,7 @@ $factory->state(\ProcessMaker\Model\Task::class, 'foreign_keys', function (Faker
'TAS_DURATION' => 1, 'TAS_DURATION' => 1,
'TAS_ASSIGN_TYPE' => 'BALANCED', 'TAS_ASSIGN_TYPE' => 'BALANCED',
'TAS_DEF_TITLE' => $faker->sentence(2), 'TAS_DEF_TITLE' => $faker->sentence(2),
'TAS_DEF_DESCRIPTION' => $faker->sentence(2),
'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED', 'TAS_ASSIGN_VARIABLE' => '@@SYS_NEXT_USER_TO_BE_ASSIGNED',
'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE', 'TAS_MI_INSTANCE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCE',
'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE', 'TAS_MI_COMPLETE_VARIABLE' => '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE',

View File

@@ -806,6 +806,7 @@ class Bootstrap
public static function streamCSSBigFile($filename) public static function streamCSSBigFile($filename)
{ {
header('Content-Type: text/css'); header('Content-Type: text/css');
header('X-Content-Type-Options: nosniff');
//First get Skin info //First get Skin info
$filenameParts = explode("-", $filename); $filenameParts = explode("-", $filename);
@@ -969,7 +970,7 @@ class Bootstrap
header('Content-Disposition: attachment; filename="' . $downloadFileName . '"'); header('Content-Disposition: attachment; filename="' . $downloadFileName . '"');
} }
header('Content-Type: ' . $contentType); header('Content-Type: ' . $contentType);
header('X-Content-Type-Options: nosniff');
// if userAgent (BROWSER) is MSIE we need special headers to avoid MSIE // if userAgent (BROWSER) is MSIE we need special headers to avoid MSIE
// behaivor. // behaivor.
$userAgent = strtolower($_SERVER ['HTTP_USER_AGENT']); $userAgent = strtolower($_SERVER ['HTTP_USER_AGENT']);
@@ -2788,4 +2789,15 @@ class Bootstrap
]; ];
self::registerMonolog($channel, $level, $message, $context); self::registerMonolog($channel, $level, $message, $context);
} }
/**
* Build the options for a cookie, according to the system configuration and values optionally sent to this method
*
* @param array $options
* @return array
*/
public static function buildCookieOptions(array $options = [])
{
return System::buildCookieOptions($options);
}
} }

View File

@@ -947,7 +947,7 @@ class G
public static function streamCSSBigFile($filename) public static function streamCSSBigFile($filename)
{ {
header('Content-Type: text/css'); header('Content-Type: text/css');
header('X-Content-Type-Options: nosniff');
//First get Skin info //First get Skin info
$filenameParts = explode("-", $filename); $filenameParts = explode("-", $filename);
$skinName = $filenameParts[0]; $skinName = $filenameParts[0];
@@ -1252,7 +1252,7 @@ class G
header('Content-Disposition: inline; filename="' . $downloadFileName . '"'); header('Content-Disposition: inline; filename="' . $downloadFileName . '"');
} }
header('Content-Type: ' . $contentType); header('Content-Type: ' . $contentType);
header('X-Content-Type-Options: nosniff');
//if userAgent (BROWSER) is MSIE we need special headers to avoid MSIE behaivor. //if userAgent (BROWSER) is MSIE we need special headers to avoid MSIE behaivor.
$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']); $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match("/msie/i", $userAgent)) { if (preg_match("/msie/i", $userAgent)) {

View File

@@ -105,7 +105,7 @@ export default {
DRAFT: this.$i18n.t("ID_IN_DRAFT"), DRAFT: this.$i18n.t("ID_IN_DRAFT"),
PAUSED: this.$i18n.t("ID_PAUSED"), PAUSED: this.$i18n.t("ID_PAUSED"),
UNASSIGNED: this.$i18n.t("ID_UNASSIGNED"), UNASSIGNED: this.$i18n.t("ID_UNASSIGNED"),
}, }
} }
}, },
mounted() { mounted() {
@@ -248,24 +248,35 @@ export default {
* @return {array} dataFormat * @return {array} dataFormat
*/ */
formatUser(data) { formatUser(data) {
var dataFormat = [], var dataFormat = [],
userDataFormat; userDataFormat;
userDataFormat = utils.userNameDisplayFormat({ switch (data.key_name) {
userName: data.user_tooltip.usr_firstname, case 'user_tooltip':
firstName: data.user_tooltip.usr_lastname, userDataFormat = utils.userNameDisplayFormat({
lastName: data.user_tooltip.usr_username, userName: data.user_tooltip.usr_firstname,
format: window.config.FORMATS.format || null firstName: data.user_tooltip.usr_lastname,
}); lastName: data.user_tooltip.usr_username,
dataFormat.push({ format: window.config.FORMATS.format || null
USERNAME_DISPLAY_FORMAT: userDataFormat, });
EMAIL: data.user_tooltip.usr_email, dataFormat.push({
POSITION: data.user_tooltip.usr_position, USERNAME_DISPLAY_FORMAT: userDataFormat,
AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX + EMAIL: data.user_tooltip.usr_email,
window.config.SYS_URI + POSITION: data.user_tooltip.usr_position,
`users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "", AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
UNASSIGNED: userDataFormat !== "" ? true : false window.config.SYS_URI +
}); `users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "",
return dataFormat; UNASSIGNED: userDataFormat !== "" ? true : false,
SHOW_TOOLTIP: true
});
break;
case 'dummy_task':
dataFormat = data.dummy_task.type + ': ' + data.dummy_task.name;
break;
default:
dataFormat = "";
break;
}
return dataFormat;
} }
} }
} }

View File

@@ -2,6 +2,7 @@ import axios from "axios";
import Api from "../../../../api/Api"; import Api from "../../../../api/Api";
import Services from "./Services"; import Services from "./Services";
import Defaults from "./Mocks/defaults.json"; import Defaults from "./Mocks/defaults.json";
import { RCBase64 } from '../../../../utils/utils.js'
class caseListApi extends Api { class caseListApi extends Api {
constructor(services) { constructor(services) {
// Here, it calls the parent class' constructor with lengths // Here, it calls the parent class' constructor with lengths
@@ -42,13 +43,14 @@ class caseListApi extends Api {
* @returns * @returns
*/ */
deleteCaseList(data) { deleteCaseList(data) {
var base64 = RCBase64();
return axios.delete( return axios.delete(
window.config.SYS_SERVER_API + window.config.SYS_SERVER_API +
'/api/1.0/' + '/api/1.0/' +
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/caseList/' + data.id, { '/caseList/' + data.id, {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + JSON.parse(base64.decode(window.config.SYS_CREDENTIALS)).accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
} }

View File

@@ -1,6 +1,9 @@
import _ from "lodash"; import _ from "lodash";
import axios from "axios"; import axios from "axios";
import { RCBase64 } from '../utils/utils.js'
var base64 = RCBase64();
const urlBase = "{server}/api/1.0/{workspace}{service}"; const urlBase = "{server}/api/1.0/{workspace}{service}";
var credentials = JSON.parse(base64.decode(window.config.SYS_CREDENTIALS));
class Api { class Api {
constructor(services) { constructor(services) {
this.services = services; this.services = services;
@@ -39,7 +42,6 @@ class Api {
data = options.data || {}, data = options.data || {},
keys = options.keys || {}, keys = options.keys || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
server = window.config.SYS_SERVER_API, server = window.config.SYS_SERVER_API,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
@@ -53,6 +55,7 @@ class Api {
headers: { headers: {
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
} }
@@ -63,7 +66,6 @@ class Api {
params = options.params || {}, params = options.params || {},
keys = options.keys || {}, keys = options.keys || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
@@ -76,6 +78,7 @@ class Api {
headers: { headers: {
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
} }
@@ -88,7 +91,6 @@ class Api {
keys = options.keys || {}, keys = options.keys || {},
headers = options.headers || {}, headers = options.headers || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
@@ -102,6 +104,7 @@ class Api {
headers: _.extend({ headers: _.extend({
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
}, headers) }, headers)
@@ -115,7 +118,6 @@ class Api {
keys = options.keys || {}, keys = options.keys || {},
headers = options.headers || {}, headers = options.headers || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
url = this.getUrl(_.extend(keys, credentials, { server }, { workspace }), service); url = this.getUrl(_.extend(keys, credentials, { server }, { workspace }), service);
@@ -137,7 +139,6 @@ class Api {
id = options.id || {}, id = options.id || {},
keys = options.keys || {}, keys = options.keys || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
@@ -149,6 +150,7 @@ class Api {
headers: { headers: {
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
} }
@@ -161,7 +163,6 @@ class Api {
id = options.id || {}, id = options.id || {},
keys = options.keys || {}, keys = options.keys || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
@@ -175,6 +176,7 @@ class Api {
headers: { headers: {
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
} }
@@ -191,7 +193,6 @@ class Api {
data = options.data || {}, data = options.data || {},
keys = options.keys || {}, keys = options.keys || {},
url, url,
credentials = window.config.SYS_CREDENTIALS,
workspace = window.config.SYS_WORKSPACE, workspace = window.config.SYS_WORKSPACE,
lang = window.config.SYS_LANG, lang = window.config.SYS_LANG,
server = window.config.SYS_SERVER_API; server = window.config.SYS_SERVER_API;
@@ -205,6 +206,7 @@ class Api {
headers: { headers: {
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-cache, must-revalidate",
"Authorization": `Bearer ` + credentials.accessToken, "Authorization": `Bearer ` + credentials.accessToken,
"Accept-Language": lang "Accept-Language": lang
} }

View File

@@ -1,8 +1,10 @@
import axios from "axios"; import axios from "axios";
import ApiInstance from "./Api.js"; import ApiInstance from "./Api.js";
import Services from "./Services"; import Services from "./Services";
import { RCBase64 } from '../utils/utils.js'
let Api = new ApiInstance( Services ); let Api = new ApiInstance( Services );
var base64 = RCBase64();
var credentials = JSON.parse(base64.decode(window.config.SYS_CREDENTIALS));
export let cases = { export let cases = {
myCases(data) { myCases(data) {
return Api.get({ return Api.get({
@@ -148,7 +150,7 @@ export let cases = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/' + data.APP_NUMBER + '/pending-tasks', { '/home/' + data.APP_NUMBER + '/pending-tasks', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });
@@ -355,7 +357,7 @@ export let casesHeader = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/counters', { '/home/counters', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });

View File

@@ -1,5 +1,7 @@
import axios from 'axios'; import axios from 'axios';
import { RCBase64 } from '../utils/utils.js'
var base64 = RCBase64();
var credentials = JSON.parse(base64.decode(window.config.SYS_CREDENTIALS));
export let menu = { export let menu = {
get() { get() {
return axios.get( return axios.get(
@@ -8,7 +10,7 @@ export let menu = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/menu', { '/home/menu', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });
@@ -21,7 +23,7 @@ export let menu = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/tasks/counter', { '/home/tasks/counter', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });
@@ -38,7 +40,7 @@ export let menu = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/'+ task +'/counter', { '/home/'+ task +'/counter', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });
@@ -55,7 +57,7 @@ export let menu = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/' + data.page + '/counter/caseList/' + data.id, { '/home/' + data.page + '/counter/caseList/' + data.id, {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
} }
@@ -72,7 +74,7 @@ export let menu = {
window.config.SYS_WORKSPACE + window.config.SYS_WORKSPACE +
'/home/tasks/highlight', { '/home/tasks/highlight', {
headers: { headers: {
'Authorization': 'Bearer ' + window.config.SYS_CREDENTIALS.accessToken, 'Authorization': 'Bearer ' + credentials.accessToken,
"Accept-Language": window.config.SYS_LANG "Accept-Language": window.config.SYS_LANG
} }
}); });

View File

@@ -692,7 +692,7 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style lang="scss">
.bv-example-row .row + .row { .bv-example-row .row + .row {
margin-top: 1rem; margin-top: 1rem;
} }

View File

@@ -1,81 +1,89 @@
<template> <template>
<div> <div>
<SearchPopover <SearchPopover
target="popover-target-1" target="popover-target-1"
@savePopover="onOk" @savePopover="onOk"
:title="addSearchTitle" :title="addSearchTitle"
> >
<template v-slot:body> <template v-slot:body>
<b-form-group> <b-form-group>
<b-form-radio-group <b-form-radio-group
v-model="selected" v-model="selected"
:options="criteriaItems" :options="criteriaItems"
value-field="id" value-field="id"
text-field="optionLabel" text-field="optionLabel"
name="flavour-2a" name="flavour-2a"
stacked stacked
></b-form-radio-group> ></b-form-radio-group>
<b-form-group> <b-form-group> </b-form-group>
</b-form-group> <b-form-checkbox
<b-form-checkbox id="checkbox-2"
id="checkbox-1" v-model="byProcessCategory"
v-model="byProcessName" name="checkbox-2"
name="checkbox-1" value="processCategory"
value="processName" >
> {{ $t("ID_BY_PROCESS_CATEGORY") }}
{{$t('ID_BY_PROCESS_NAME') }} </b-form-checkbox>
</b-form-checkbox> <b-form-checkbox
</b-form-group> id="checkbox-1"
</template> v-model="byProcessName"
</SearchPopover> name="checkbox-1"
value="processName"
<div class="p-1 v-flex"> >
<h5 class="v-search-title">{{ title }}</h5> {{ $t("ID_BY_PROCESS_NAME") }}
<div class="pm-in-text-icon"> </b-form-checkbox>
<i :class="icon"></i> </b-form-group>
</div>
<b-input-group class="w-75 p-1">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span
class="input-group-text bg-primary-pm text-white"
id="popover-target-1"
@click="searchClickHandler"
>
<b-icon icon="search"></b-icon
></span>
</div>
<b-form-tags input-id="tags-pills" v-model="searchTags">
<template v-slot="{ tags, tagVariant, removeTag }">
<div class="d-inline-block" style="font-size: 1rem">
<b-form-tag
v-for="tag in tags"
@remove="customRemove(removeTag, tag)"
:key="tag"
:title="tag"
:variant="tagVariant"
class="mr-1 badge badge-light"
>
<div :id="tag">
<i class="fas fa-tags"></i>
{{ tagContent(tag) }}
</div>
<component
v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)"
v-bind:tag="tag"
v-bind:filter="dataToFilter(tag)"
@updateSearchTag="updateSearchTag"
/>
</b-form-tag>
</div>
</template> </template>
</b-form-tags> </SearchPopover>
<div class="p-1 filter-field">
<h5 class="v-search-title">{{ title }}</h5>
<div class="pm-in-text-icon">
<i :class="icon"></i>
</div>
<b-input-group class="w-75 p-1">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span
class="input-group-text bg-primary-pm text-white"
id="popover-target-1"
@click="searchClickHandler"
>
<b-icon icon="search"></b-icon
></span>
</div>
<b-form-tags input-id="tags-pills" v-model="searchTags">
<template v-slot="{ tags, tagVariant, removeTag }">
<div class="d-inline-block" style="font-size: 1rem">
<b-form-tag
v-for="tag in tags"
@remove="customRemove(removeTag, tag)"
:key="tag"
:title="tag"
:variant="tagVariant"
class="mr-1 badge badge-light"
>
<div :id="tag">
<i class="fas fa-tags"></i>
{{ tagContent(tag) }}
</div>
<component
:filters="filters"
v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)"
v-bind:tag="tag"
v-bind:filter="dataToFilter(tag)"
@updateSearchTag="updateSearchTag"
/>
</b-form-tag>
</div>
</template>
</b-form-tags>
</div>
</b-input-group>
</div> </div>
</b-input-group>
</div> </div>
</div>
</template> </template>
<script> <script>
@@ -83,376 +91,469 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import CurrentUser from "./popovers/CurrentUser.vue"; import CurrentUser from "./popovers/CurrentUser.vue";
import api from "./../../api/index"; import api from "./../../api/index";
export default { export default {
name: "Cases", name: "Cases",
props: ["filters", "title", "icon" , "hiddenItems"], props: ["filters", "title", "icon", "hiddenItems"],
components: { components: {
SearchPopover, SearchPopover,
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
DateFilter, ProcessCategory,
TaskTitle, DateFilter,
CurrentUser TaskTitle,
}, CurrentUser,
data() { },
return { data() {
searchLabel: this.$i18n.t("ID_SEARCH"), return {
addSearchTitle: this.$i18n.t("ID_ADD_SEARCH_FILTER_CRITERIA"), searchLabel: this.$i18n.t("ID_SEARCH"),
searchTags: [], addSearchTitle: this.$i18n.t("ID_ADD_SEARCH_FILTER_CRITERIA"),
dataLoaded: false, searchTags: [],
filterItems: [ dataLoaded: false,
{ filterItems: [
type: "CaseNumber", {
id: "caseNumber", type: "CaseNumber",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( id: "caseNumber",
"ID_BY_CASE_NUMBER" title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
)}`, "ID_BY_CASE_NUMBER"
optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"), )}`,
detail: this.$i18n.t("ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"), optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"),
tagText: "", detail: this.$i18n.t(
tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"), "ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"
items: [ ),
{ tagText: "",
id: "filterCases", tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"),
value: "", items: [
{
id: "filterCases",
value: "",
},
],
autoShow: true,
makeTagText: function(params, data) {
return `${params.tagPrefix}: ${data[0].value}`;
}, },
],
autoShow: true,
makeTagText: function (params, data) {
return `${params.tagPrefix}: ${data[0].value}`;
}, },
}, {
{ type: "CaseTitle",
type: "CaseTitle", id: "caseTitle",
id: "caseTitle", title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( "ID_BY_CASE_THREAD_TITLE"
"ID_BY_CASE_THREAD_TITLE" )}`,
)}`, optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"),
optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"), tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"),
tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"), detail: "",
detail: "", tagText: "",
tagText: "", items: [
items: [ {
{ id: "caseTitle",
id: "caseTitle", value: "",
value: "", },
],
autoShow: true,
makeTagText: function(params, data) {
return `${this.tagPrefix} ${data[0].value}`;
}, },
],
autoShow: true,
makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].value}`;
}, },
}, {
{ type: "DateFilter",
type: "DateFilter", id: "delegationDate",
id: "delegationDate", title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_DELEGATION_DATE')}`, "ID_BY_DELEGATION_DATE"
optionLabel: this.$i18n.t('ID_BY_DELEGATION_DATE'), )}`,
detail: this.$i18n.t('ID_PLEASE_SELECT_THE_DELEGATION_DATE_TO_BE_SEARCHED'), optionLabel: this.$i18n.t("ID_BY_DELEGATION_DATE"),
tagText: "", detail: this.$i18n.t(
tagPrefix: this.$i18n.t('ID_SEARCH_BY_DELEGATION_DATE'), "ID_PLEASE_SELECT_THE_DELEGATION_DATE_TO_BE_SEARCHED"
items:[ ),
{ tagText: "",
id: "delegateFrom", tagPrefix: this.$i18n.t("ID_SEARCH_BY_DELEGATION_DATE"),
value: "", items: [
label: this.$i18n.t('ID_FROM_DELEGATION_DATE') {
id: "delegateFrom",
value: "",
label: this.$i18n.t("ID_FROM_DELEGATION_DATE"),
},
{
id: "delegateTo",
value: "",
label: this.$i18n.t("ID_TO_DELEGATION_DATE"),
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix} ${data[0].value} - ${data[1].value}`;
}, },
{
id: "delegateTo",
value: "",
label: this.$i18n.t('ID_TO_DELEGATION_DATE')
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix} ${data[0].value} - ${data[1].value}`;
}
},
{
type: "CurrentUser",
id: "bySendBy",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_SEND_BY')}`,
optionLabel: this.$i18n.t('ID_BY_SEND_BY'),
detail: this.$i18n.t('ID_PLEASE_SELECT_USER_NAME_TO_BE_SEARCHED'),
placeholder: this.$i18n.t('ID_USER_NAME'),
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_SEND_BY'),
autoShow: true,
items:[
{
id: "sendBy",
value: "",
options: [],
placeholder: this.$i18n.t('ID_USER_NAME')
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix} : ${data[0].label || ''}`;
}
},
{
type: "TaskTitle",
id: "taskTitle",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_TASK_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_TASK"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"),
autoShow: true,
items: [
{
id: "task",
value: "",
options: [],
placeholder: this.$i18n.t("ID_TASK_NAME"),
},
],
makeTagText: function (params, data) {
return `${this.tagPrefix}: ${data[0].label || ""}`;
}, },
}, {
], type: "CurrentUser",
processName: { id: "bySendBy",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_BY_SEND_BY"
)}`,
optionLabel: this.$i18n.t("ID_BY_SEND_BY"),
detail: this.$i18n.t(
"ID_PLEASE_SELECT_USER_NAME_TO_BE_SEARCHED"
),
placeholder: this.$i18n.t("ID_USER_NAME"),
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_SEND_BY"),
autoShow: true,
items: [
{
id: "sendBy",
value: "",
options: [],
placeholder: this.$i18n.t("ID_USER_NAME"),
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix} : ${data[0].label || ""}`;
},
},
{
type: "TaskTitle",
id: "taskTitle",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_TASK_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_TASK"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"),
autoShow: true,
items: [
{
id: "task",
value: "",
options: [],
placeholder: this.$i18n.t("ID_TASK_NAME"),
},
],
makeTagText: function(params, data) {
return `${this.tagPrefix}: ${data[0].label || ""}`;
},
},
],
processName: {
type: "ProcessName", type: "ProcessName",
id: "processName", id: "processName",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_NAME')}`, title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
optionLabel: this.$i18n.t('ID_BY_PROCESS_NAME'), "ID_BY_PROCESS_NAME"
)}`,
optionLabel: this.$i18n.t("ID_BY_PROCESS_NAME"),
detail: "", detail: "",
tagText: "", tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_NAME'), tagPrefix: this.$i18n.t("ID_SEARCH_BY_PROCESS_NAME"),
autoShow: true, autoShow: true,
items:[ items: [
{ {
id: "process", id: "process",
value: "", value: "",
options: [], options: [],
placeholder: this.$i18n.t('ID_PROCESS_NAME') placeholder: this.$i18n.t("ID_PROCESS_NAME"),
} },
], ],
makeTagText: function (params, data) { makeTagText: function(params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${(data[0].options &&
data[0].options.label) ||
""}`;
},
},
processCategory: {
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t(
"ID_BY_PROCESS_CATEGORY"
)}`,
optionLabel: this.$i18n.t("ID_BY_PROCESS_CATEGORY"),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t("ID_SEARCH_BY_PROCESS_CATEGORY"),
autoShow: true,
items: [
{
id: "category",
value: "",
options: [],
placeholder: "",
},
],
makeTagText: function(params, data) {
return `${params.tagPrefix}: ${data[0].label || ""}`;
},
},
selected: "",
itemModel: {},
byProcessName: "",
byProcessCategory: "",
};
},
computed: {
// a computed getter
criteriaItems: function() {
let found,
criteria = [];
if (this.hiddenItems && this.hiddenItems.length) {
this.filterItems.forEach((item) => {
found = this.hiddenItems.find((elem) => elem !== item.id);
if (found) {
criteria.push(item);
}
});
return criteria;
} else {
return this.filterItems;
}
},
},
mounted() {},
watch: {
filters: {
immediate: true,
handler(newVal, oldVal) {
this.searchTags = [];
this.selected = [];
//Prevent show popover at the first time
if (newVal.length) {
this.setFilters(newVal, oldVal);
this.searchClickHandler();
} }
}, },
selected: "", },
itemModel: {}, },
byProcessName: "" methods: {
}; /**
}, * Add filter criteria save button handler
computed: { */
// a computed getter onOk() {
criteriaItems: function () { let self = this,
let found, element,
criteria = []; initialFilters = [],
if (this.hiddenItems && this.hiddenItems.length) { item;
this.filterItems.forEach(item => { this.$root.$emit("bv::hide::popover");
found = this.hiddenItems.find( elem => elem !== item.id); element = _.find(this.filterItems, function(o) {
if (found) { return o.id === self.selected;
criteria.push(item); });
} if (element) {
}); initialFilters = this.prepareFilterItems(
return criteria; element.items,
} else { this.selected,
return this.filterItems; true
} );
}
},
mounted() {
},
watch: {
filters: {
immediate: true,
handler(newVal, oldVal) {
this.searchTags = [];
this.selected = [];
//Prevent show popover at the first time
if (newVal.length) {
this.setFilters(newVal, oldVal);
this.searchClickHandler();
} }
} //adding process name filter
} if (self.byProcessName !== "") {
}, if (element !== undefined) {
methods: { this.processName.autoShow = false;
/** } else {
* Add filter criteria save button handler this.processName.autoShow = true;
*/ }
onOk() { initialFilters = [
let self = this, ...new Set([
element, ...initialFilters,
initialFilters = [], ...this.prepareFilterItems(
item; this.processName.items,
this.$root.$emit("bv::hide::popover"); self.byProcessName,
element = _.find(this.filterItems, function (o) { true
return o.id === self.selected; ),
}); ]),
if (element) { ];
initialFilters = this.prepareFilterItems(element.items, this.selected, true);
}
//adding process name filter
if (self.byProcessName !== "") {
if (element !== undefined) {
this.processName.autoShow = false;
} else {
this.processName.autoShow = true;
} }
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; if (self.byProcessCategory !== "") {
} if (element !== undefined) {
this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); this.processCategory.autoShow = false;
}, } else {
/** this.processCategory.autoShow = true;
* Prepare the filter items }
* @param {array} items initialFilters = [
* @param {id} string ...new Set([
* @param {boolean} restore ...initialFilters,
*/ ...this.prepareFilterItems(
prepareFilterItems(items, id, restore){ this.processCategory.items,
let initialFilters = [], self.byProcessCategory,
self = this, true
filter, ),
item; ]),
_.forEach(items, function(value, key) { ];
filter = _.find(self.filters, function(o) { return o.filterVar === value.id; });
if (filter && restore) {
initialFilters.push(filter);
} else {
item = {
filterVar: value.id,
fieldId: id,
value: '',
label: "",
options: [],
autoShow: true
};
initialFilters.push(item);
} }
}); this.$emit("onUpdateFilters", {
return initialFilters; params: initialFilters,
}, refresh: false,
/** });
* Set Filters and make the tag labels },
* @param {object} filters json to manage the query /**
*/ * Prepare the filter items
setFilters(filters, oldVal) { * @param {array} items
let self = this; * @param {id} string
_.forEach(filters, function (item, key) { * @param {boolean} restore
let component = _.find(self.filterItems, function (o) { */
return o.id === item.fieldId; prepareFilterItems(items, id, restore) {
}); let initialFilters = [],
if (component) { self = this,
self.searchTags.push(component.id); filter,
self.selected = component.id; item;
self.itemModel[component.id] = component; _.forEach(items, function(value, key) {
self.itemModel[component.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : true; filter = _.find(self.filters, function(o) {
} return o.filterVar === value.id;
if(item.fieldId === "processName") { });
self.searchTags.push(self.processName.id); if (filter && restore) {
self.byProcessName = self.processName.id; initialFilters.push(filter);
self.itemModel[self.processName.id] = self.processName; } else {
self.itemModel[self.processName.id].autoShow = typeof item.autoShow !== "undefined" ? item.autoShow : self.processName.autoShow; item = {
} filterVar: value.id,
}); fieldId: id,
}, value: "",
dataToFilter(id) { label: "",
let data = []; options: [],
_.forEach(this.filters, function (item) { autoShow: true,
if (item.fieldId === id) { };
data.push(item); initialFilters.push(item);
} }
}); });
return data; return initialFilters;
}, },
/** /**
* * Set Filters and make the tag labels
*/ * @param {object} filters json to manage the query
tagContent(id) { */
if ( setFilters(filters, oldVal) {
this.itemModel[id] && let self = this;
typeof this.itemModel[id].makeTagText === "function" _.forEach(filters, function(item, key) {
) { let component = _.find(self.filterItems, function(o) {
return this.itemModel[id].makeTagText( return o.id === item.fieldId;
this.itemModel[id], });
this.dataToFilter(id) if (component) {
); self.searchTags.push(component.id);
} self.selected = component.id;
return ""; self.itemModel[component.id] = component;
}, self.itemModel[component.id].autoShow =
tagComponent(id) { typeof item.autoShow !== "undefined"
if (this.itemModel[id]) { ? item.autoShow
return this.itemModel[id].type; : true;
} }
return null; if (item.fieldId === "processName") {
}, self.searchTags.push(self.processName.id);
self.byProcessName = self.processName.id;
self.itemModel[self.processName.id] = self.processName;
self.itemModel[self.processName.id].autoShow =
typeof item.autoShow !== "undefined"
? item.autoShow
: self.processName.autoShow;
}
if (item.fieldId === "processCategory") {
self.searchTags.push(self.processCategory.id);
self.byProcessCategory = self.processCategory.id;
self.itemModel[self.processCategory.id] =
self.processCategory;
self.itemModel[self.processCategory.id].autoShow =
typeof self.processCategory.autoShow !== "undefined"
? self.processCategory.autoShow
: true;
}
});
},
dataToFilter(id) {
let data = [];
_.forEach(this.filters, function(item) {
if (item.fieldId === id) {
data.push(item);
}
});
return data;
},
/**
*
*/
tagContent(id) {
if (
this.itemModel[id] &&
typeof this.itemModel[id].makeTagText === "function"
) {
return this.itemModel[id].makeTagText(
this.itemModel[id],
this.dataToFilter(id)
);
}
return "";
},
tagComponent(id) {
if (this.itemModel[id]) {
return this.itemModel[id].type;
}
return null;
},
tagInfo(id) { tagInfo(id) {
if (this.itemModel[id]) { if (this.itemModel[id]) {
return this.itemModel[id]; return this.itemModel[id];
}
return null;
},
/**
* Remove from tag button
* @param {function} removeTag - default callback
* @param {string} tag filter identifier
*/
customRemove(removeTag, tag) {
let temp = [];
_.forEach(this.filters, function(item, key) {
if(item.fieldId !== tag) {
temp.push(item);
} }
}); return null;
if (tag === "processName") { },
this.byProcessName = ""; /**
} * Remove from tag button
this.$emit("onUpdateFilters", {params: temp, refresh: true}); * @param {function} removeTag - default callback
* @param {string} tag filter identifier
*/
customRemove(removeTag, tag) {
let temp = [];
_.forEach(this.filters, function(item, key) {
if (item.fieldId !== tag) {
temp.push(item);
}
});
if (tag === "processName") {
this.byProcessName = "";
}
if (tag === "processCategory") {
this.byProcessCategory = "";
}
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
/**
* Update the filter model this is fired from filter popaver save action
* @param {object} params - arrives the settings
* @param {string} tag filter identifier
*/
updateSearchTag(params) {
let temp = this.filters.concat(params);
temp = [...new Set([...this.filters, ...params])];
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
searchClickHandler() {
this.$root.$emit("bv::hide::popover");
},
}, },
/**
* Update the filter model this is fired from filter popaver save action
* @param {object} params - arrives the settings
* @param {string} tag filter identifier
*/
updateSearchTag(params) {
let temp = this.filters.concat(params);
temp = [...new Set([...this.filters, ...params])];
this.$emit("onUpdateFilters", { params: temp, refresh: true });
},
searchClickHandler() {
this.$root.$emit("bv::hide::popover");
},
},
}; };
</script> </script>
<style scoped> <style lang="scss">
.bv-example-row .row + .row { .bv-example-row .row + .row {
margin-top: 1rem; margin-top: 1rem;
} }
.bv-example-row-flex-cols .row { .bv-example-row-flex-cols .row {
min-height: 10rem; min-height: 10rem;
} }
.bg-primary-pm { .bg-primary-pm {
background-color: #0099dd; background-color: #0099dd;
} }
.v-flex { .filter-field {
display: flex; display: flex;
} }
.v-search-title { .v-search-title {
padding-right: 10px; padding-right: 10px;
line-height: 40px; line-height: 40px;
} }
.pm-in-text-icon { .pm-in-text-icon {
font-size: 1.40rem; font-size: 1.4rem;
padding-right: 10px; padding-right: 10px;
line-height: 40px; line-height: 40px;
} }
</style> </style>

View File

@@ -17,7 +17,7 @@
></b-form-radio-group> ></b-form-radio-group>
<b-form-group> </b-form-group> <b-form-group> </b-form-group>
<b-form-checkbox-group <b-form-checkbox-group
id="checkbox-1" id="checkbox-custom-filter"
v-model="selectedCheckbox" v-model="selectedCheckbox"
:options="getFilterColletion('checkbox')" :options="getFilterColletion('checkbox')"
value-field="id" value-field="id"
@@ -29,7 +29,7 @@
</template> </template>
</SearchPopover> </SearchPopover>
<div class="p-1 v-flex"> <div class="p-1 filter-field">
<h5 class="v-search-title">{{ title }}</h5> <h5 class="v-search-title">{{ title }}</h5>
<div class="pm-in-text-icon"> <div class="pm-in-text-icon">
<i :class="icon"></i> <i :class="icon"></i>
@@ -61,6 +61,7 @@
{{ tagContent(tag) }} {{ tagContent(tag) }}
</div> </div>
<component <component
:filters="filters"
v-bind:is="tagComponent(tag)" v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)" v-bind:info="tagInfo(tag)"
v-bind:tag="tag" v-bind:tag="tag"
@@ -82,6 +83,7 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import CurrentUser from "./popovers/CurrentUser.vue"; import CurrentUser from "./popovers/CurrentUser.vue";
@@ -97,6 +99,7 @@ export default {
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
ProcessCategory,
DateFilter, DateFilter,
TaskTitle, TaskTitle,
CurrentUser, CurrentUser,
@@ -113,11 +116,13 @@ export default {
selectedCheckbox: [], selectedCheckbox: [],
itemModel: {}, itemModel: {},
byProcessName: "", byProcessName: "",
byProcessCategory: "",
criteriaItemsRadio: [], criteriaItemsRadio: [],
criteriaItemsCheckbox: [], criteriaItemsCheckbox: [],
showProcessName: true, showProcessName: true,
}; };
}, },
mounted(){},
watch: { watch: {
filters: { filters: {
immediate: true, immediate: true,
@@ -338,7 +343,7 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style lang="scss">
.bv-example-row .row + .row { .bv-example-row .row + .row {
margin-top: 1rem; margin-top: 1rem;
} }
@@ -351,8 +356,8 @@ export default {
background-color: #0099dd; background-color: #0099dd;
} }
.v-flex { .filter-field {
display: flex; display: flex;
} }
.v-search-title { .v-search-title {
@@ -365,3 +370,9 @@ export default {
line-height: 3vw; line-height: 3vw;
} }
</style> </style>
<style>
#checkbox-custom-filter > .custom-control-inline{
display: block !important;
margin-right: 1rem;
}
</style>

View File

@@ -6,6 +6,7 @@
:title="addSearchTitle" :title="addSearchTitle"
> >
<template v-slot:body> <template v-slot:body>
<b-form-group> <b-form-group>
<b-form-radio-group <b-form-radio-group
v-model="selected" v-model="selected"
@@ -16,6 +17,14 @@
stacked stacked
></b-form-radio-group> ></b-form-radio-group>
</b-form-group> </b-form-group>
<b-form-checkbox
id="checkbox-2"
v-model="byProcessCategory"
name="checkbox-2"
value="processCategory"
>
{{$t('ID_BY_PROCESS_CATEGORY') }}
</b-form-checkbox>
<b-form-checkbox <b-form-checkbox
id="checkbox-1" id="checkbox-1"
v-model="byProcessName" v-model="byProcessName"
@@ -23,11 +32,11 @@
value="processName" value="processName"
> >
{{$t('ID_BY_PROCESS_NAME') }} {{$t('ID_BY_PROCESS_NAME') }}
</b-form-checkbox> </b-form-checkbox>
</template> </template>
</SearchPopover> </SearchPopover>
<div class="p-1 v-flex"> <div class="p-1 filter-field">
<h5 class="v-search-title">{{ title }}</h5> <h5 class="v-search-title">{{ title }}</h5>
<div class="pm-mc-text-icon"> <div class="pm-mc-text-icon">
<i :class="icon"></i> <i :class="icon"></i>
@@ -61,6 +70,7 @@
</div> </div>
<component <component
:filters="filters"
v-bind:is="tagComponent(tag)" v-bind:is="tagComponent(tag)"
v-bind:info="tagInfo(tag)" v-bind:info="tagInfo(tag)"
v-bind:tag="tag" v-bind:tag="tag"
@@ -82,6 +92,7 @@ import SearchPopover from "./popovers/SearchPopover.vue";
import CaseNumber from "./popovers/CaseNumber.vue"; import CaseNumber from "./popovers/CaseNumber.vue";
import CaseTitle from "./popovers/CaseTitle.vue"; import CaseTitle from "./popovers/CaseTitle.vue";
import ProcessName from "./popovers/ProcessName.vue"; import ProcessName from "./popovers/ProcessName.vue";
import ProcessCategory from "./popovers/ProcessCategory.vue";
import DateFilter from "./popovers/DateFilter.vue"; import DateFilter from "./popovers/DateFilter.vue";
import TaskTitle from "./popovers/TaskTitle.vue"; import TaskTitle from "./popovers/TaskTitle.vue";
import api from "./../../api/index"; import api from "./../../api/index";
@@ -94,6 +105,7 @@ export default {
CaseNumber, CaseNumber,
CaseTitle, CaseTitle,
ProcessName, ProcessName,
ProcessCategory,
DateFilter, DateFilter,
TaskTitle TaskTitle
}, },
@@ -235,9 +247,31 @@ export default {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
} }
}, },
processCategory:{
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_CATEGORY')}`,
optionLabel: this.$i18n.t('ID_BY_PROCESS_CATEGORY'),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_CATEGORY'),
autoShow: true,
items:[
{
id: "category",
value: "",
options: [],
placeholder: ""
}
],
makeTagText: function (params, data) {
return `${params.tagPrefix}: ${data[0].label || ''}`;
}
},
selected: "", selected: "",
itemModel: {}, itemModel: {},
byProcessName: "" byProcessName: "",
byProcessCategory: "",
}; };
}, },
mounted() { mounted() {
@@ -284,6 +318,15 @@ export default {
} }
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])];
} }
//adding process name filter
if (self.byProcessCategory !== "") {
if (element !== undefined) {
this.processCategory.autoShow = false;
} else {
this.processCategory.autoShow = true;
}
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processCategory.items, self.byProcessCategory, true)])];
}
this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); this.$emit("onUpdateFilters", {params: initialFilters, refresh: false});
}, },
/** /**
@@ -334,6 +377,12 @@ export default {
self.itemModel[self.processName.id] = self.processName; self.itemModel[self.processName.id] = self.processName;
self.itemModel[self.processName.id].autoShow = typeof self.processName.autoShow !== "undefined" ? self.processName.autoShow : true; self.itemModel[self.processName.id].autoShow = typeof self.processName.autoShow !== "undefined" ? self.processName.autoShow : true;
} }
if(item.fieldId === "processCategory") {
self.searchTags.push(self.processCategory.id);
self.byProcessCategory = self.processCategory.id;
self.itemModel[self.processCategory.id] = self.processCategory;
self.itemModel[self.processCategory.id].autoShow = typeof self.processCategory.autoShow !== "undefined" ? self.processCategory.autoShow : true;
}
}); });
}, },
dataToFilter(id) { dataToFilter(id) {
@@ -382,6 +431,9 @@ export default {
if (tag === "processName") { if (tag === "processName") {
this.byProcessName = ""; this.byProcessName = "";
} }
if (tag === "processCategory") {
this.byProcessCategory = "";
}
this.$emit("onUpdateFilters", {params: temp, refresh: true}); this.$emit("onUpdateFilters", {params: temp, refresh: true});
}, },
/** /**
@@ -400,7 +452,7 @@ export default {
} }
}; };
</script> </script>
<style scoped> <style lang="scss">
.bv-example-row .row + .row { .bv-example-row .row + .row {
margin-top: 1rem; margin-top: 1rem;
} }
@@ -412,7 +464,7 @@ export default {
background-color: #0099dd; background-color: #0099dd;
} }
.v-flex { .filter-field {
display: flex; display: flex;
} }

View File

@@ -38,6 +38,7 @@
import SearchPopover from "./SearchPopover.vue"; import SearchPopover from "./SearchPopover.vue";
import Multiselect from "vue-multiselect"; import Multiselect from "vue-multiselect";
import api from "./../../../api/index"; import api from "./../../../api/index";
import _ from "lodash";
export default { export default {
components: { components: {
@@ -57,11 +58,16 @@ export default {
* @param {string} query - string from the text field * @param {string} query - string from the text field
*/ */
asyncFind(query) { asyncFind(query) {
let self = this; let self = this,
cat = this.verifyCategory(),
params = { text: query };
this.isLoading = true; this.isLoading = true;
if (cat) {
params.category = cat;
}
self.processes = []; self.processes = [];
api.filters api.filters
.processList(query) .processListPaged(params)
.then((response) => { .then((response) => {
self.processes = []; self.processes = [];
_.forEach(response.data, function(elem, key) { _.forEach(response.data, function(elem, key) {
@@ -76,6 +82,13 @@ export default {
console.error(err); console.error(err);
}); });
}, },
verifyCategory() {
let cat = _.find(
this.$attrs.filters,
(o) => o.fieldId == "processCategory"
);
return cat ? cat.value : null;
},
/** /**
* Form validations review * Form validations review
*/ */

View File

@@ -1,5 +1,5 @@
<template> <template>
<div v-if="data.length" class="grouped-cell"> <div v-if="showTooltip" class="grouped-cell">
<div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex"> <div v-for="(item, index) in data" v-bind:key="item.TITLE" class="d-flex">
<div class="avatar" :id="id + index"> <div class="avatar" :id="id + index">
<b-avatar <b-avatar
@@ -36,6 +36,11 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else class="grouped-cell">
<span class="col ellipsis">
{{ data }}
</span>
</div>
</template> </template>
<script> <script>
@@ -47,6 +52,14 @@ export default {
id: "avatar-" + _.random(1000000) id: "avatar-" + _.random(1000000)
}; };
}, },
computed: {
/**
* Verify if data is an array.
*/
showTooltip() {
return typeof this.data !== 'string'
}
},
methods: { methods: {
/** /**
* Generates the mail link * Generates the mail link

View File

@@ -11,7 +11,7 @@
<i class="fas fa-square"></i> <i class="fas fa-square"></i>
</div> </div>
<b-popover <b-popover
v-if="item.DELAYED_TITLE && item.DELAYED_MSG" v-if="item.DELAYED_TITLE || item.DELAYED_MSG"
:target="statusId + index" :target="statusId + index"
triggers="hover" triggers="hover"
placement="top" placement="top"

View File

@@ -49,6 +49,9 @@
<div slot="case_status" slot-scope="props"> <div slot="case_status" slot-scope="props">
{{ props.row.APP_STATUS }} {{ props.row.APP_STATUS }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
@@ -142,6 +145,7 @@ export default {
}, },
columns: [ columns: [
"case_number", "case_number",
"process_category",
"process_name", "process_name",
"status", "status",
"thread_title", "thread_title",
@@ -157,6 +161,7 @@ export default {
filterable: false, filterable: false,
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
status: this.$i18n.t("ID_STATUS"), status: this.$i18n.t("ID_STATUS"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
@@ -296,6 +301,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.THREAD_TITLES, THREAD_TITLE: v.THREAD_TITLES,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: this.formatTasks(v.THREAD_TASKS), TASK: this.formatTasks(v.THREAD_TASKS),
USER_DATA: this.formatUser(v.THREAD_USERS), USER_DATA: this.formatUser(v.THREAD_USERS),
START_DATE: v.APP_CREATE_DATE_LABEL, START_DATE: v.APP_CREATE_DATE_LABEL,

View File

@@ -524,7 +524,8 @@ export default {
DEL_INDEX: v.DEL_INDEX, DEL_INDEX: v.DEL_INDEX,
PRO_UID: v.PRO_UID, PRO_UID: v.PRO_UID,
TAS_UID: v.TAS_UID, TAS_UID: v.TAS_UID,
UNASSIGNED: v.UNASSIGNED UNASSIGNED: v.UNASSIGNED,
USR_ID: v.USR_ID
}); });
}); });
return data; return data;
@@ -578,7 +579,7 @@ export default {
* @param {object} data * @param {object} data
*/ */
onClick(data) { onClick(data) {
if (data.row.UNASSIGNED) { if (data.row.UNASSIGNED && data.row.USR_ID === 0) {
this.claimCase(data.row); this.claimCase(data.row);
} else { } else {
this.$emit("onUpdateDataCase", { this.$emit("onUpdateDataCase", {

View File

@@ -55,10 +55,12 @@
<div slot="case_title" slot-scope="props"> <div slot="case_title" slot-scope="props">
{{ props.row.THREAD_TITLE }} {{ props.row.THREAD_TITLE }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
@@ -128,6 +130,9 @@
<span v-if="column === 'thread_title'" class="v-card-text-highlight"> <span v-if="column === 'thread_title'" class="v-card-text-highlight">
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
<span v-if="column === 'process_category'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
<span v-if="column === 'process_name'" class="v-card-text-highlight"> <span v-if="column === 'process_name'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_NAME"] }} {{ props["item"]["PROCESS_NAME"] }}
</span> </span>
@@ -182,6 +187,9 @@
<span v-if="column === 'thread_title'" class="v-card-text-highlight"> <span v-if="column === 'thread_title'" class="v-card-text-highlight">
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
<span v-if="column === 'process_category'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
<span v-if="column === 'process_name'" class="v-card-text-highlight"> <span v-if="column === 'process_name'" class="v-card-text-highlight">
{{ props["item"]["PROCESS_NAME"] }} {{ props["item"]["PROCESS_NAME"] }}
</span> </span>
@@ -317,6 +325,7 @@ export default {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
due_date: this.$i18n.t("ID_DUE_DATE"), due_date: this.$i18n.t("ID_DUE_DATE"),
@@ -328,7 +337,6 @@ export default {
icon: "fas fa-check-circle", icon: "fas fa-check-circle",
options: { options: {
filterable: false, filterable: false,
headings: {},
texts: { texts: {
count: this.$i18n.t("ID_SHOWING_FROM_RECORDS_COUNT"), count: this.$i18n.t("ID_SHOWING_FROM_RECORDS_COUNT"),
first: this.$i18n.t("ID_FIRST"), first: this.$i18n.t("ID_FIRST"),
@@ -393,7 +401,8 @@ export default {
thread_title: "caseTitle", thread_title: "caseTitle",
delegation_date: "delegationDate", delegation_date: "delegationDate",
send_by: "bySendBy", send_by: "bySendBy",
process_name: "processName" process_name: "processName",
process_category: "processCategory"
}, },
customItems:{ customItems:{
VARCHAR: { VARCHAR: {
@@ -555,6 +564,28 @@ export default {
return `${this.tagPrefix}: ${data[0].label || ""}`; return `${this.tagPrefix}: ${data[0].label || ""}`;
}, },
}, },
processCategory: {
group: "checkbox",
type: "ProcessCategory",
id: "processCategory",
title: `${this.$i18n.t('ID_FILTER')}: ${this.$i18n.t('ID_BY_PROCESS_CATEGORY')}`,
optionLabel: this.$i18n.t('ID_BY_PROCESS_CATEGORY'),
detail: "",
tagText: "",
tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_CATEGORY'),
autoShow: false,
items:[
{
id: "process",
value: "",
options: [],
placeholder: this.$i18n.t('ID_CATEGORY_PROCESS')
}
],
makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
}
},
processName: { processName: {
group: "checkbox", group: "checkbox",
type: "ProcessName", type: "ProcessName",
@@ -576,7 +607,8 @@ export default {
makeTagText: function (params, data) { makeTagText: function (params, data) {
return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`;
} }
} },
showUserTooltip: true
} }
}; };
}, },
@@ -761,7 +793,10 @@ export default {
product, product,
newItems = []; newItems = [];
that.filterItems = []; that.filterItems = [];
that.headings = {}; that.headings = {
detail: this.$i18n.t("ID_DETAIL_CASE"),
actions: "",
};
response.data.columns.forEach((item) => { response.data.columns.forEach((item) => {
if (item.enableFilter) { if (item.enableFilter) {
if (that.availableItems[that.itemMap[item.field]]) { if (that.availableItems[that.itemMap[item.field]]) {
@@ -844,6 +879,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [ TASK: [
{ {
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
@@ -884,24 +920,32 @@ export default {
formatUser(data) { formatUser(data) {
var dataFormat = [], var dataFormat = [],
userDataFormat; userDataFormat;
userDataFormat = utils.userNameDisplayFormat({ switch (data.key_name) {
userName: data.user_tooltip.usr_firstname, case 'user_tooltip':
firstName: data.user_tooltip.usr_lastname, userDataFormat = utils.userNameDisplayFormat({
lastName: data.user_tooltip.usr_username, userName: data.user_tooltip.usr_firstname,
format: window.config.FORMATS.format || null, firstName: data.user_tooltip.usr_lastname,
}); lastName: data.user_tooltip.usr_username,
dataFormat.push({ format: window.config.FORMATS.format || null
USERNAME_DISPLAY_FORMAT: userDataFormat, });
EMAIL: data.user_tooltip.usr_email, dataFormat.push({
POSITION: data.user_tooltip.usr_position, USERNAME_DISPLAY_FORMAT: userDataFormat,
AVATAR: EMAIL: data.user_tooltip.usr_email,
userDataFormat !== "" POSITION: data.user_tooltip.usr_position,
? window.config.SYS_SERVER_AJAX + AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
window.config.SYS_URI + window.config.SYS_URI +
`users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` `users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "",
: "", UNASSIGNED: userDataFormat !== "" ? true : false,
UNASSIGNED: userDataFormat !== "" ? true : false, SHOW_TOOLTIP: true
}); });
break;
case 'dummy_task':
dataFormat = data.dummy_task.type + ': ' + data.dummy_task.name;
break;
default:
dataFormat = "";
break;
}
return dataFormat; return dataFormat;
}, },
/** /**

View File

@@ -229,7 +229,20 @@ export default {
* Return the columns for table - concat with field "detail" "actions" * Return the columns for table - concat with field "detail" "actions"
*/ */
getTableColumns(columns) { getTableColumns(columns) {
return _.concat(["detail"], columns, ["actions"]); return _.concat(["detail"], this.removeDefaultColumns(columns), ["actions"]);
},
/**
* Remove the default columns, 'detail' and 'actions'
* @param {Array} columns
*/
removeDefaultColumns(columns) {
if (columns[0] === 'detail') {
columns.shift()
}
if (columns[columns.length - 1] === 'actions') {
columns.pop();
}
return columns;
}, },
/** /**
* Return options for Table * Return options for Table

View File

@@ -51,6 +51,9 @@
<div slot="thread_title" slot-scope="props"> <div slot="thread_title" slot-scope="props">
{{ props.row.THREAD_TITLE }} {{ props.row.THREAD_TITLE }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
@@ -96,6 +99,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -170,6 +181,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -295,6 +314,7 @@ export default {
detail: this.$i18n.t("ID_DETAIL_CASE"), detail: this.$i18n.t("ID_DETAIL_CASE"),
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
priority: this.$i18n.t("ID_PRIORITY"), priority: this.$i18n.t("ID_PRIORITY"),
@@ -523,6 +543,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,

View File

@@ -53,6 +53,7 @@ export default {
detail: "", detail: "",
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
current_user: this.$i18n.t("ID_CURRENT_USER"), current_user: this.$i18n.t("ID_CURRENT_USER"),

View File

@@ -46,15 +46,17 @@
<div slot="thread_title" slot-scope="props"> <div slot="thread_title" slot-scope="props">
{{ props.row.THREAD_TITLE }} {{ props.row.THREAD_TITLE }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
<div slot="send_by" slot-scope="props"> <div slot="send_by" slot-scope="props">
<CurrentUserCell :data="props.row.USER_DATA" /> <CurrentUserCell :data="props.row.USER_DATA" />
</div> </div>
<div slot="current_user" slot-scope="props"> <div slot="current_user" slot-scope="props">
{{ props.row.USERNAME_DISPLAY_FORMAT }} {{ props.row.USERNAME_DISPLAY_FORMAT }}
@@ -104,6 +106,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -149,7 +159,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueCardView> </VueCardView>
@@ -185,6 +195,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -230,7 +248,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueListView> </VueListView>
@@ -327,6 +345,7 @@ export default {
detail: this.$i18n.t("ID_DETAIL_CASE"), detail: this.$i18n.t("ID_DETAIL_CASE"),
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -383,7 +402,7 @@ export default {
buttons: {} buttons: {}
}, },
showEllipsis: false, showEllipsis: false,
dataSubtitle: null dataSubtitle: null,
}; };
}, },
created() { created() {
@@ -558,6 +577,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [ TASK: [
{ {
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
@@ -595,21 +615,32 @@ export default {
formatUser(data) { formatUser(data) {
var dataFormat = [], var dataFormat = [],
userDataFormat; userDataFormat;
userDataFormat = utils.userNameDisplayFormat({ switch (data.key_name) {
userName: data.user_tooltip.usr_firstname, case 'user_tooltip':
firstName: data.user_tooltip.usr_lastname, userDataFormat = utils.userNameDisplayFormat({
lastName: data.user_tooltip.usr_username, userName: data.user_tooltip.usr_firstname,
format: window.config.FORMATS.format || null firstName: data.user_tooltip.usr_lastname,
}); lastName: data.user_tooltip.usr_username,
dataFormat.push({ format: window.config.FORMATS.format || null
USERNAME_DISPLAY_FORMAT: userDataFormat, });
EMAIL: data.user_tooltip.usr_email, dataFormat.push({
POSITION: data.user_tooltip.usr_position, USERNAME_DISPLAY_FORMAT: userDataFormat,
AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX + EMAIL: data.user_tooltip.usr_email,
window.config.SYS_URI + POSITION: data.user_tooltip.usr_position,
`users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "", AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
UNASSIGNED: userDataFormat !== "" ? true : false window.config.SYS_URI +
}); `users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "",
UNASSIGNED: userDataFormat !== "" ? true : false,
SHOW_TOOLTIP: true
});
break;
case 'dummy_task':
dataFormat = data.dummy_task.type + ': ' + data.dummy_task.name;
break;
default:
dataFormat = "";
break;
}
return dataFormat; return dataFormat;
}, },
/** /**

View File

@@ -53,6 +53,7 @@ export default {
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -64,6 +65,7 @@ export default {
columns: [ columns: [
"case_number", "case_number",
"thread_title", "thread_title",
"process_category",
"process_name", "process_name",
"due_date", "due_date",
"delegation_date", "delegation_date",

View File

@@ -47,6 +47,9 @@
<div slot="thread_title" slot-scope="props"> <div slot="thread_title" slot-scope="props">
<ThreadTitleCell :data="props.row.THREAD_TITLE" /> <ThreadTitleCell :data="props.row.THREAD_TITLE" />
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
@@ -160,6 +163,7 @@ export default {
filterable: false, filterable: false,
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
pending_taks: this.$i18n.t("ID_PENDING_TASKS"), pending_taks: this.$i18n.t("ID_PENDING_TASKS"),
@@ -454,7 +458,9 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.THREAD_TITLES, THREAD_TITLE: v.THREAD_TITLES,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
STATUS: v.APP_STATUS, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
STATUS: this.$i18n.t("ID_CASES_STATUS_"+ v.APP_STATUS.toUpperCase()),
START_DATE: v.APP_CREATE_DATE_LABEL || "", START_DATE: v.APP_CREATE_DATE_LABEL || "",
FINISH_DATE: v.APP_FINISH_DATE_LABEL || "", FINISH_DATE: v.APP_FINISH_DATE_LABEL || "",
PENDING_TASKS: that.formantPendingTask( PENDING_TASKS: that.formantPendingTask(

View File

@@ -1,8 +1,12 @@
import _ from "lodash";
import api from "../../api/index"; import api from "../../api/index";
export default { export default {
data() { data() {
return { return {
random: 1 random: 1,
defaultColumnsDisabled: [
"process_category"
]
}; };
}, },
methods: { methods: {

View File

@@ -45,15 +45,17 @@
<div slot="thread_title" slot-scope="props"> <div slot="thread_title" slot-scope="props">
{{ props.row.THREAD_TITLE }} {{ props.row.THREAD_TITLE }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
<div slot="send_by" slot-scope="props"> <div slot="send_by" slot-scope="props">
<CurrentUserCell :data="props.row.USER_DATA" /> <CurrentUserCell :data="props.row.USER_DATA" />
</div> </div>
<div slot="current_user" slot-scope="props"> <div slot="current_user" slot-scope="props">
{{ props.row.USERNAME_DISPLAY_FORMAT }} {{ props.row.USERNAME_DISPLAY_FORMAT }}
@@ -103,6 +105,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -148,7 +158,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueCardView> </VueCardView>
@@ -184,6 +194,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -229,7 +247,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueListView> </VueListView>
@@ -327,6 +345,7 @@ export default {
detail: this.$i18n.t("ID_DETAIL_CASE"), detail: this.$i18n.t("ID_DETAIL_CASE"),
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -557,6 +576,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,
@@ -590,21 +610,32 @@ export default {
formatUser(data) { formatUser(data) {
var dataFormat = [], var dataFormat = [],
userDataFormat; userDataFormat;
userDataFormat = utils.userNameDisplayFormat({ switch (data.key_name) {
userName: data.user_tooltip.usr_firstname, case 'user_tooltip':
firstName: data.user_tooltip.usr_lastname, userDataFormat = utils.userNameDisplayFormat({
lastName: data.user_tooltip.usr_username, userName: data.user_tooltip.usr_firstname,
format: window.config.FORMATS.format || null firstName: data.user_tooltip.usr_lastname,
}); lastName: data.user_tooltip.usr_username,
dataFormat.push({ format: window.config.FORMATS.format || null
USERNAME_DISPLAY_FORMAT: userDataFormat, });
EMAIL: data.user_tooltip.usr_email, dataFormat.push({
POSITION: data.user_tooltip.usr_position, USERNAME_DISPLAY_FORMAT: userDataFormat,
AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX + EMAIL: data.user_tooltip.usr_email,
window.config.SYS_URI + POSITION: data.user_tooltip.usr_position,
`users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "", AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
UNASSIGNED: userDataFormat !== "" ? true : false window.config.SYS_URI +
}); `users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "",
UNASSIGNED: userDataFormat !== "" ? true : false,
SHOW_TOOLTIP: true
});
break;
case 'dummy_task':
dataFormat = data.dummy_task.type + ': ' + data.dummy_task.name;
break;
default:
dataFormat = "";
break;
}
return dataFormat; return dataFormat;
}, },
/** /**

View File

@@ -52,6 +52,7 @@ export default {
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -63,6 +64,7 @@ export default {
columns: [ columns: [
"case_number", "case_number",
"thread_title", "thread_title",
"process_category",
"process_name", "process_name",
"due_date", "due_date",
"delegation_date", "delegation_date",

View File

@@ -3,7 +3,7 @@
<button-fleft :data="newCase"></button-fleft> <button-fleft :data="newCase"></button-fleft>
<div class="p-1 v-flex"> <div class="p-1 v-flex">
<h4 class="v-search-title"> <h4 class="v-search-title">
Task metrics {{ $t("ID_TASK_METRICS") }}
<span class="vp-padding-r3"> <i class="fas fa-chart-pie"></i></span> <span class="vp-padding-r3"> <i class="fas fa-chart-pie"></i></span>
</h4> </h4>
</div> </div>

View File

@@ -85,7 +85,7 @@
<apexchart <apexchart
ref="LevelOneChart" ref="LevelOneChart"
:width="width" :width="width"
:options="optionsBar" :options="options"
:series="seriesBar" :series="seriesBar"
></apexchart> ></apexchart>
</div> </div>
@@ -100,10 +100,11 @@ import BreadCrumb from "../../components/utils/BreadCrumb.vue";
import ProcessPopover from "./ProcessPopover.vue"; import ProcessPopover from "./ProcessPopover.vue";
import Multiselect from "vue-multiselect"; import Multiselect from "vue-multiselect";
import eventBus from "./../EventBus/eventBus"; import eventBus from "./../EventBus/eventBus";
import mixinLocales from "./mixinsLocales";
export default { export default {
name: "VueChartLvOne", name: "VueChartLvOne",
mixins: [], mixins: [mixinLocales],
components: { components: {
Multiselect, Multiselect,
BreadCrumb, BreadCrumb,
@@ -137,7 +138,7 @@ export default {
data: [], data: [],
}, },
], ],
optionsBar: { options: {
chart: { chart: {
type: "bar", type: "bar",
id: "LevelOneChart", id: "LevelOneChart",

View File

@@ -69,7 +69,7 @@
" "
class="btn vp-btn-success btn-sm" class="btn vp-btn-success btn-sm"
> >
On Time {{ $t("ID_TASK_ON_TIME") }}
</button> </button>
<button <button
type="button" type="button"
@@ -79,7 +79,7 @@
" "
class="btn vp-btn-warning btn-sm" class="btn vp-btn-warning btn-sm"
> >
At Risk {{ $t("ID_AT_RISK") }}
</button> </button>
<button <button
type="button" type="button"
@@ -89,7 +89,7 @@
" "
class="btn vp-btn-danger btn-sm" class="btn vp-btn-danger btn-sm"
> >
Overdue {{ $t("ID_TASK_OVERDUE") }}
</button> </button>
</div> </div>
</div> </div>
@@ -112,10 +112,11 @@ import BreadCrumb from "../../components/utils/BreadCrumb.vue";
import moment from "moment"; import moment from "moment";
import ModalUnpauseCase from "../modal/ModalUnpauseCase.vue"; import ModalUnpauseCase from "../modal/ModalUnpauseCase.vue";
import ModalClaimCase from "../modal/ModalClaimCase.vue"; import ModalClaimCase from "../modal/ModalClaimCase.vue";
import mixinLocales from "./mixinsLocales";
export default { export default {
name: "VueChartLvThree", name: "VueChartLvThree",
mixins: [], mixins: [mixinLocales],
components: { components: {
Multiselect, Multiselect,
BreadCrumb, BreadCrumb,
@@ -352,33 +353,36 @@ export default {
case "OVERDUE": case "OVERDUE":
this.$refs["LevelThreeChart"].updateOptions({ this.$refs["LevelThreeChart"].updateOptions({
yaxis: { yaxis: {
min: 0, min: -10,
max: 100,
tickAmount: 7, tickAmount: 7,
}, },
title: { title: {
text: "Overdue days", text: this.$t("ID_TASK_OVERDUE_DAYS"),
}, },
}); });
break; break;
case "AT_RISK": case "AT_RISK":
this.$refs["LevelThreeChart"].updateOptions({ this.$refs["LevelThreeChart"].updateOptions({
yaxis: { yaxis: {
max: 0, max: 10,
min: -100,
tickAmount: 7, tickAmount: 7,
}, },
title: { title: {
text: "Days before being Overdue", text: this.$t("ID_TASK_DAYS_BEFORE_OVERDUE"),
}, },
}); });
break; break;
case "ON_TIME": case "ON_TIME":
this.$refs["LevelThreeChart"].updateOptions({ this.$refs["LevelThreeChart"].updateOptions({
yaxis: { yaxis: {
max: 0, max: 10,
min: -100,
tickAmount: 7, tickAmount: 7,
}, },
title: { title: {
text: "Days before being At-Risk", text: this.$t("ID_TASK_DAYS_BEFORE_AT_RISK"),
}, },
}); });
break; break;
@@ -391,25 +395,25 @@ export default {
let obj = this.dataCasesByRisk[seriesIndex]; let obj = this.dataCasesByRisk[seriesIndex];
return `<div class="apexcharts-theme-light"> return `<div class="apexcharts-theme-light">
<div class="apexcharts-tooltip-title" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"> <div class="apexcharts-tooltip-title" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;">
${"Number Case"} : ${obj["number_case"]} ${this.$t("ID_CASE_NUMBER")} : ${obj["number_case"]}
</div> </div>
<div class="apexcharts-tooltip-series-group apexcharts-active" style="order: 1; display: flex;"> <div class="apexcharts-tooltip-series-group apexcharts-active" style="order: 1; display: flex;">
<div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;"> <div class="apexcharts-tooltip-text" style="font-family: Helvetica, Arial, sans-serif; font-size: 12px;">
<div class="apexcharts-tooltip-y-group"> <div class="apexcharts-tooltip-y-group">
<span class="" style="background-color: #28a745;"></span> <span class="" style="background-color: #28a745;"></span>
<span class="apexcharts-tooltip-text-y-label">Delegated</span> : <span class="apexcharts-tooltip-text-y-value">${ <span class="apexcharts-tooltip-text-y-label">${this.$t("ID_DELEGATED")}</span> : <span class="apexcharts-tooltip-text-y-value">${
obj["delegated"] obj["delegated"]
}</span> }</span>
</div> </div>
<div class="apexcharts-tooltip-y-group"> <div class="apexcharts-tooltip-y-group">
<span class="" style="background-color: #28a745;"></span> <span class="" style="background-color: #28a745;"></span>
<span class="apexcharts-tooltip-text-y-label">At Risk</span> : <span class="apexcharts-tooltip-text-y-value">${ <span class="apexcharts-tooltip-text-y-label">${this.$t("ID_AT_RISK")}</span> : <span class="apexcharts-tooltip-text-y-value">${
obj["at_risk"] obj["at_risk"]
}</span> }</span>
</div> </div>
<div class="apexcharts-tooltip-y-group"> <div class="apexcharts-tooltip-y-group">
<span class="" style="background-color: #28a745;"></span> <span class="" style="background-color: #28a745;"></span>
<span class="apexcharts-tooltip-text-y-label">Due Date</span> : <span class="apexcharts-tooltip-text-y-value">${ <span class="apexcharts-tooltip-text-y-label">${this.$t("ID_CASESLIST_DEL_TASK_DUE_DATE")}</span> : <span class="apexcharts-tooltip-text-y-value">${
obj["due_date"] obj["due_date"]
}</span> }</span>
</div> </div>

View File

@@ -87,9 +87,10 @@ import Multiselect from "vue-multiselect";
import BreadCrumb from "../../components/utils/BreadCrumb.vue"; import BreadCrumb from "../../components/utils/BreadCrumb.vue";
import moment from "moment"; import moment from "moment";
import eventBus from "./../EventBus/eventBus"; import eventBus from "./../EventBus/eventBus";
import mixinLocales from "./mixinsLocales";
export default { export default {
name: "VueChartLvTwo", name: "VueChartLvTwo",
mixins: [], mixins: [mixinLocales],
components: { components: {
Multiselect, Multiselect,
BreadCrumb, BreadCrumb,

View File

@@ -70,7 +70,7 @@ export default {
label: that.$i18n.t("ID_INBOX"), label: that.$i18n.t("ID_INBOX"),
onClick() { onClick() {
that.$emit("updateDataLevel", { that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_INBOX"), id: "inbox",
name: that.$i18n.t("ID_INBOX"), name: that.$i18n.t("ID_INBOX"),
level: 1, level: 1,
color: "#179a6e", color: "#179a6e",
@@ -82,7 +82,7 @@ export default {
label: this.$i18n.t("ID_DRAFT"), label: this.$i18n.t("ID_DRAFT"),
onClick() { onClick() {
that.$emit("updateDataLevel", { that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_DRAFT"), id: "draft",
name: that.$i18n.t("ID_DRAFT"), name: that.$i18n.t("ID_DRAFT"),
level: 1, level: 1,
color: "#feb019", color: "#feb019",
@@ -94,7 +94,7 @@ export default {
label: this.$i18n.t("ID_PAUSED"), label: this.$i18n.t("ID_PAUSED"),
onClick() { onClick() {
that.$emit("updateDataLevel", { that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_PAUSED"), id:"paused",
name: that.$i18n.t("ID_PAUSED"), name: that.$i18n.t("ID_PAUSED"),
level: 1, level: 1,
color: "#008ffb", color: "#008ffb",
@@ -106,7 +106,7 @@ export default {
label: this.$i18n.t("ID_UNASSIGNED"), label: this.$i18n.t("ID_UNASSIGNED"),
onClick() { onClick() {
that.$emit("updateDataLevel", { that.$emit("updateDataLevel", {
id: that.$i18n.t("ID_UNASSIGNED"), id: "unassigned",
name: that.$i18n.t("ID_UNASSIGNED"), name: that.$i18n.t("ID_UNASSIGNED"),
level: 1, level: 1,
color: "#8f99a0", color: "#8f99a0",

View File

@@ -1,25 +1,28 @@
<template> <template>
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block"> <div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
<vue-chart-lv-zero v-if="level === 0" @updateDataLevel="updateDataLevel" /> <vue-chart-lv-zero
<vue-chart-lv-one v-if="level === 0"
:key="key1" @updateDataLevel="updateDataLevel"
v-if="level === 1" />
:data="levels" <vue-chart-lv-one
@updateDataLevel="updateDataLevel" :key="key1"
/> v-if="level === 1"
<vue-chart-lv-two :data="levels"
:key="key2" @updateDataLevel="updateDataLevel"
v-if="level === 2" />
:data="levels" <vue-chart-lv-two
@updateDataLevel="updateDataLevel" :key="key2"
/> v-if="level === 2"
<vue-chart-lv-three :data="levels"
:key="key3" @updateDataLevel="updateDataLevel"
v-if="level === 3" />
:data="levels" <vue-chart-lv-three
@updateDataLevel="updateDataLevel" :key="key3"
/> v-if="level === 3"
</div> :data="levels"
@updateDataLevel="updateDataLevel"
/>
</div>
</template> </template>
<script> <script>
@@ -30,97 +33,63 @@ import VueChartLvThree from "./VueChartLvThree.vue";
import _ from "lodash"; import _ from "lodash";
export default { export default {
name: "VueCharts", name: "VueCharts",
mixins: [], mixins: [],
components: { components: {
VueChartLvZero, VueChartLvZero,
VueChartLvOne, VueChartLvOne,
VueChartLvTwo, VueChartLvTwo,
VueChartLvThree, VueChartLvThree,
}, },
props: ["levels"], props: ["levels"],
data() { data() {
let that = this; let that = this;
return { return {
key1: _.random(0, 100), key1: _.random(0, 100),
key2: _.random(0, 100), key2: _.random(0, 100),
key3: _.random(0, 100), key3: _.random(0, 100),
settingsBreadCrumbs: [ settingsBreadCrumbs: [
{ {
class: "fas fa-info-circle", class: "fas fa-info-circle",
onClick() {}, onClick() {},
},
],
};
},
created() {},
mounted() {},
watch: {},
computed: {
level: function() {
return _.find(this.levels, { active: true }).level;
}, },
],
};
},
created() {},
mounted() {},
watch: {},
computed: {
level: function () {
return _.find(this.levels, { active: true }).level;
}, },
}, updated() {},
updated() {}, beforeCreate() {},
beforeCreate() {}, methods: {
methods: { /**
/** * Set data level 0
* Set data level 0 */
*/ updateDataLevel(data) {
updateDataLevel(data) { this.$emit("onChangeLevel", data);
this.$emit("onChangeLevel", data); this.updateKey(data.level);
this.updateKey(data.level); },
updateKey(level) {
switch (level) {
case 0:
break;
case 1:
this.key1++;
break;
case 2:
this.key2++;
break;
case 3:
this.key3++;
break;
}
},
}, },
updateKey(level) {
switch (level) {
case 0:
break;
case 1:
this.key1++;
break;
case 2:
this.key2++;
break;
case 3:
this.key3++;
break;
}
},
/**
* Format data for data beadcrumbs
*/
dataBreadCrumbs() {
let res = [],
that = this,
index = 0;
_.each(this.levels, (el) => {
if (index <= that.level && el.data) {
res.push({
label: el.name,
onClick() {
this.$emit("onChangeLevel", el);
},
data: el,
});
}
});
switch (this.level) {
case 0:
return {
data: res,
settings: this.settingsBreadCrumbs,
};
break;
default:
return {
data: res,
settings: this.settingsBreadCrumbs,
};
break;
}
},
},
}; };
</script> </script>
<style> <style></style>
</style>

View File

@@ -0,0 +1,78 @@
export default {
data() {
let that = this;
return {
options: {
chart: {
locales: [
{
name: "en",
options: {
months: [
this.$t("ID_MONTH_1"),
this.$t("ID_MONTH_2"),
this.$t("ID_MONTH_3"),
this.$t("ID_MONTH_4"),
this.$t("ID_MONTH_5"),
this.$t("ID_MONTH_6"),
this.$t("ID_MONTH_7"),
this.$t("ID_MONTH_8"),
this.$t("ID_MONTH_9"),
this.$t("ID_MONTH_10"),
this.$t("ID_MONTH_11"),
this.$t("ID_MONTH_12"),
],
shortMonths: [
this.$t("ID_MONTH_ABB_1"),
this.$t("ID_MONTH_ABB_2"),
this.$t("ID_MONTH_ABB_3"),
this.$t("ID_MONTH_ABB_4"),
this.$t("ID_MONTH_ABB_5"),
this.$t("ID_MONTH_ABB_6"),
this.$t("ID_MONTH_ABB_7"),
this.$t("ID_MONTH_ABB_8"),
this.$t("ID_MONTH_ABB_9"),
this.$t("ID_MONTH_ABB_10"),
this.$t("ID_MONTH_ABB_11"),
this.$t("ID_MONTH_ABB_12"),
],
days: [
this.$t("ID_WEEKDAY_0"),
this.$t("ID_WEEKDAY_1"),
this.$t("ID_WEEKDAY_2"),
this.$t("ID_WEEKDAY_3"),
this.$t("ID_WEEKDAY_4"),
this.$t("ID_WEEKDAY_5"),
this.$t("ID_WEEKDAY_6"),
],
shortDays: [
this.$t("ID_WEEKDAY_ABB_0"),
this.$t("ID_WEEKDAY_ABB_1"),
this.$t("ID_WEEKDAY_ABB_2"),
this.$t("ID_WEEKDAY_ABB_3"),
this.$t("ID_WEEKDAY_ABB_4"),
this.$t("ID_WEEKDAY_ABB_5"),
this.$t("ID_WEEKDAY_ABB_6"),
],
toolbar: {
exportToSVG: this.$t("ID_DOWNLOAD_SVG"),
exportToPNG: this.$t("ID_DOWNLOAD_PNG"),
menu: this.$t("ID_MENU"),
selection: this.$t(
"ID_PROCESSMAP_SELECTION"
),
selectionZoom: this.$t("ID_SELECTION_ZOOM"),
zoomIn: this.$t("ID_ZOOM_IN"),
zoomOut: this.$t("ID_ZOOM_OUT"),
pan: this.$t("ID_PANNING"),
reset: this.$t("ID_RESET"),
},
},
},
],
defaultLocale: "en",
},
},
};
},
};

View File

@@ -43,15 +43,17 @@
<div slot="thread_title" slot-scope="props"> <div slot="thread_title" slot-scope="props">
{{ props.row.THREAD_TITLE }} {{ props.row.THREAD_TITLE }}
</div> </div>
<div slot="process_category" slot-scope="props">
{{ props.row.PROCESS_CATEGORY }}
</div>
<div slot="process_name" slot-scope="props"> <div slot="process_name" slot-scope="props">
{{ props.row.PROCESS_NAME }} {{ props.row.PROCESS_NAME }}
</div> </div>
<div slot="task" slot-scope="props"> <div slot="task" slot-scope="props">
<TaskCell :data="props.row.TASK" /> <TaskCell :data="props.row.TASK" />
</div> </div>
<div slot="send_by" slot-scope="props"> <div slot="send_by" slot-scope="props">
<CurrentUserCell :data="props.row.USER_DATA" /> <CurrentUserCell :data="props.row.USER_DATA" />
</div> </div>
<div slot="due_date" slot-scope="props"> <div slot="due_date" slot-scope="props">
{{ props.row.DUE_DATE }} {{ props.row.DUE_DATE }}
@@ -98,6 +100,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -143,7 +153,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueCardView> </VueCardView>
@@ -179,6 +189,14 @@
{{ props["item"]["THREAD_TITLE"] }} {{ props["item"]["THREAD_TITLE"] }}
</span> </span>
</div> </div>
<div slot="process_category" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span
>
<span class="v-card-text-light"
>{{ props["item"]["PROCESS_CATEGORY"] }}
</span>
</div>
<div slot="process_name" slot-scope="props" class="v-card-text"> <div slot="process_name" slot-scope="props" class="v-card-text">
<span class="v-card-text-dark" <span class="v-card-text-dark"
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
@@ -224,7 +242,7 @@
>{{ props["headings"][props.column] }} :</span >{{ props["headings"][props.column] }} :</span
> >
<span class="v-card-text-light"> <span class="v-card-text-light">
<CurrentUserCell :data="props.item.USER_DATA" /> <CurrentUserCell :data="props.item.USER_DATA" />
</span> </span>
</div> </div>
</VueListView> </VueListView>
@@ -319,6 +337,7 @@ export default {
detail: this.$i18n.t("ID_DETAIL_CASE"), detail: this.$i18n.t("ID_DETAIL_CASE"),
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -520,6 +539,7 @@ export default {
CASE_NUMBER: v.APP_NUMBER, CASE_NUMBER: v.APP_NUMBER,
THREAD_TITLE: v.DEL_TITLE, THREAD_TITLE: v.DEL_TITLE,
PROCESS_NAME: v.PRO_TITLE, PROCESS_NAME: v.PRO_TITLE,
PROCESS_CATEGORY: v.CATEGORY,
TASK: [{ TASK: [{
TITLE: v.TAS_TITLE, TITLE: v.TAS_TITLE,
CODE_COLOR: v.TAS_COLOR, CODE_COLOR: v.TAS_COLOR,
@@ -547,21 +567,32 @@ export default {
formatUser(data) { formatUser(data) {
var dataFormat = [], var dataFormat = [],
userDataFormat; userDataFormat;
userDataFormat = utils.userNameDisplayFormat({ switch (data.key_name) {
userName: data.user_tooltip.usr_firstname, case 'user_tooltip':
firstName: data.user_tooltip.usr_lastname, userDataFormat = utils.userNameDisplayFormat({
lastName: data.user_tooltip.usr_username, userName: data.user_tooltip.usr_firstname,
format: window.config.FORMATS.format || null firstName: data.user_tooltip.usr_lastname,
}); lastName: data.user_tooltip.usr_username,
dataFormat.push({ format: window.config.FORMATS.format || null
USERNAME_DISPLAY_FORMAT: userDataFormat, });
EMAIL: data.user_tooltip.usr_email, dataFormat.push({
POSITION: data.user_tooltip.usr_position, USERNAME_DISPLAY_FORMAT: userDataFormat,
AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX + EMAIL: data.user_tooltip.usr_email,
window.config.SYS_URI + POSITION: data.user_tooltip.usr_position,
`users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "", AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
UNASSIGNED: userDataFormat !== "" ? true : false window.config.SYS_URI +
}); `users/users_ViewPhotoGrid?pUID=${data.user_tooltip.usr_id}` : "",
UNASSIGNED: userDataFormat !== "" ? true : false,
SHOW_TOOLTIP: true
});
break;
case 'dummy_task':
dataFormat = data.dummy_task.type + ': ' + data.dummy_task.name;
break;
default:
dataFormat = "";
break;
}
return dataFormat; return dataFormat;
}, },
/** /**

View File

@@ -52,6 +52,7 @@ export default {
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'), thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
process_name: this.$i18n.t("ID_PROCESS_NAME"), process_name: this.$i18n.t("ID_PROCESS_NAME"),
task: this.$i18n.t("ID_TASK"), task: this.$i18n.t("ID_TASK"),
send_by: this.$i18n.t("ID_SEND_BY"), send_by: this.$i18n.t("ID_SEND_BY"),
@@ -63,6 +64,7 @@ export default {
columns: [ columns: [
"case_number", "case_number",
"thread_title", "thread_title",
"process_category",
"process_name", "process_name",
"due_date", "due_date",
"delegation_date", "delegation_date",

View File

@@ -89,5 +89,9 @@ export default {
} }
return obj; return obj;
} }
}
export function RCBase64() {
var RCBase64 = { keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function (e) { var t, r, s, o, i, n, a, h = "", c = 0; for (e = this.utf8_encode(e); c < e.length;)t = e.charCodeAt(c++), r = e.charCodeAt(c++), s = e.charCodeAt(c++), o = t >> 2, i = (3 & t) << 4 | r >> 4, n = (15 & r) << 2 | s >> 6, a = 63 & s, isNaN(r) ? n = a = 64 : isNaN(s) && (a = 64), h = h + this.keyStr.charAt(o) + this.keyStr.charAt(i) + this.keyStr.charAt(n) + this.keyStr.charAt(a); return h }, decode: function (e) { var t, r, s, o, i, n, a, h = "", c = 0; for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); c < e.length;)o = this.keyStr.indexOf(e.charAt(c++)), i = this.keyStr.indexOf(e.charAt(c++)), n = this.keyStr.indexOf(e.charAt(c++)), a = this.keyStr.indexOf(e.charAt(c++)), t = o << 2 | i >> 4, r = (15 & i) << 4 | n >> 2, s = (3 & n) << 6 | a, h += String.fromCharCode(t), 64 !== n && (h += String.fromCharCode(r)), 64 !== a && (h += String.fromCharCode(s)); return h = this.utf8_decode(h) }, utf8_encode: function (e) { e = e.replace(/\r\n/g, "\n"); var t, r, s = ""; for (t = 0; t < e.length; t++)r = e.charCodeAt(t), 128 > r ? s += String.fromCharCode(r) : r > 127 && 2048 > r ? (s += String.fromCharCode(r >> 6 | 192), s += String.fromCharCode(63 & r | 128)) : (s += String.fromCharCode(r >> 12 | 224), s += String.fromCharCode(r >> 6 & 63 | 128), s += String.fromCharCode(63 & r | 128)); return s }, utf8_decode: function (e) { for (var t = "", r = 0, s = 0, o = 0, i = 0; r < e.length;)s = e.charCodeAt(r), 128 > s ? (t += String.fromCharCode(s), r++) : s > 191 && 224 > s ? (o = e.charCodeAt(r + 1), t += String.fromCharCode((31 & s) << 6 | 63 & o), r += 2) : (o = e.charCodeAt(r + 1), i = e.charCodeAt(r + 2), t += String.fromCharCode((15 & s) << 12 | (63 & o) << 6 | 63 & i), r += 3); return t } };
return RCBase64;
} }

View File

@@ -0,0 +1,132 @@
<?php
namespace Tests\unit\workflow\engine\classes\PmFunctions;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation;
use RBAC;
use Tests\TestCase;
/**
* Test the PMFCaseInformation() function
*
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
*/
class PMFCaseInformation extends TestCase
{
use DatabaseTransactions;
/**
* Method set up.
*/
public function setUp()
{
parent::setUp();
}
/**
* It tests the PMFCaseInformation() function with the default parameters
*
* @test
*/
public function it_should_test_this_pmfunction_default_parameters()
{
$table = factory(Application::class)->states('foreign_keys')->create();
// Force commit for propel
DB::commit();
// Call the funtion
$result = PMFCaseInformation($table->APP_UID, 0, 0);
$this->assertNotEmpty($result);
// Colums to return with the default parameters
$this->assertArrayHasKey('APP_UID', $result);
$this->assertArrayHasKey('APP_NUMBER', $result);
$this->assertArrayHasKey('APP_STATUS', $result);
$this->assertArrayHasKey('APP_STATUS_ID', $result);
$this->assertArrayHasKey('PRO_UID', $result);
$this->assertArrayHasKey('APP_INIT_USER', $result);
$this->assertArrayHasKey('APP_CUR_USER', $result);
$this->assertArrayHasKey('APP_CREATE_DATE', $result);
$this->assertArrayHasKey('APP_INIT_DATE', $result);
$this->assertArrayHasKey('APP_FINISH_DATE', $result);
$this->assertArrayHasKey('APP_UPDATE_DATE', $result);
$this->assertArrayHasKey('PRO_ID', $result);
$this->assertArrayHasKey('APP_INIT_USER_ID', $result);
// When the index = 0 those values will not return
$this->assertArrayNotHasKey('DEL_INDEX', $result);
$this->assertArrayNotHasKey('DEL_PREVIOUS', $result);
$this->assertArrayNotHasKey('DEL_TYPE', $result);
$this->assertArrayNotHasKey('DEL_PRIORITY', $result);
$this->assertArrayNotHasKey('DEL_THREAD_STATUS', $result);
$this->assertArrayNotHasKey('DEL_THREAD', $result);
$this->assertArrayNotHasKey('DEL_DELEGATE_DATE', $result);
$this->assertArrayNotHasKey('DEL_INIT_DATE', $result);
$this->assertArrayNotHasKey('DEL_TASK_DUE_DATE', $result);
$this->assertArrayNotHasKey('DEL_FINISH_DATE', $result);
// When the returnAppData = 0, false this value will not return
$this->assertArrayNotHasKey('APP_DATA', $result);
}
/**
* It tests the PMFCaseInformation() function with index parameter
*
* @test
*/
public function it_should_test_this_pmfunction_index_parameter()
{
$application = factory(Application::class)->states('todo')->create();
$table = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
]);
// Force commit for propel
DB::commit();
// Call the funtion
$result = PMFCaseInformation($table->APP_UID, $table->DEL_INDEX, 0);
$this->assertNotEmpty($result);
// When the index != 0 those values will return
$this->assertArrayHasKey('DEL_INDEX', $result);
$this->assertArrayHasKey('DEL_PREVIOUS', $result);
$this->assertArrayHasKey('DEL_TYPE', $result);
$this->assertArrayHasKey('DEL_PRIORITY', $result);
$this->assertArrayHasKey('DEL_THREAD_STATUS', $result);
$this->assertArrayHasKey('DEL_THREAD', $result);
$this->assertArrayHasKey('DEL_DELEGATE_DATE', $result);
$this->assertArrayHasKey('DEL_INIT_DATE', $result);
$this->assertArrayHasKey('DEL_TASK_DUE_DATE', $result);
$this->assertArrayHasKey('DEL_FINISH_DATE', $result);
}
/**
* It tests the PMFCaseInformation() function with returnAppData parameter
*
* @test
*/
public function it_should_test_this_pmfunction_app_data_parameter()
{
$application = factory(Application::class)->states('todo')->create();
$table = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
]);
// Force commit for propel
DB::commit();
// Call the funtion
$result = PMFCaseInformation($table->APP_UID, 0, true);
$this->assertNotEmpty($result);
// When the returnAppData = true, the case data will return
$this->assertArrayHasKey('APP_DATA', $result);
}
/**
* It tests the exception caseUid is required in the PMFCaseInformation() function
*
* @test
*/
public function it_should_test_exception_user_required()
{
$this->expectExceptionMessage('**ID_REQUIRED_FIELD**');
$result = PMFCaseInformation('', 0, 0);
}
}

View File

@@ -6,6 +6,9 @@ use Exception;
use G; use G;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\BusinessModel\Cases\AbstractCases; use ProcessMaker\BusinessModel\Cases\AbstractCases;
use ProcessMaker\BusinessModel\Cases\Draft;
use ProcessMaker\BusinessModel\Cases\Paused;
use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\Application; use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process; use ProcessMaker\Model\Process;
@@ -738,6 +741,8 @@ class AbstractCasesTest extends TestCase
$absCases = new AbstractCases(); $absCases = new AbstractCases();
$properties = []; $properties = [];
$absCases->setProperties($properties); $absCases->setProperties($properties);
$actual = $absCases->getCategoryId();
$this->assertEquals(0, $actual);
$actual = $absCases->getProcessId(); $actual = $absCases->getProcessId();
$this->assertEquals(0, $actual); $this->assertEquals(0, $actual);
$actual = $absCases->getTaskId(); $actual = $absCases->getTaskId();
@@ -784,6 +789,7 @@ class AbstractCasesTest extends TestCase
* This check the setter related all the properties * This check the setter related all the properties
* *
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProperties() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProperties()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setCategoryId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProcessId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setProcessId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setTaskId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setTaskId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setUserId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setUserId()
@@ -799,6 +805,7 @@ class AbstractCasesTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setOffset() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setOffset()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setLimit() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::setLimit()
* *
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getCategoryId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getProcessId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getProcessId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskId()
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getUserId() * @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getUserId()
@@ -820,6 +827,7 @@ class AbstractCasesTest extends TestCase
$absCases = new AbstractCases(); $absCases = new AbstractCases();
$properties = [ $properties = [
// Filters that works for all list // Filters that works for all list
'category' => rand(),
'process' => rand(), 'process' => rand(),
'task' => rand(), 'task' => rand(),
'user' => rand(), 'user' => rand(),
@@ -836,6 +844,8 @@ class AbstractCasesTest extends TestCase
]; ];
$absCases->setProperties($properties); $absCases->setProperties($properties);
// Tasks - Cases // Tasks - Cases
$actual = $absCases->getCategoryId();
$this->assertEquals($properties['category'], $actual);
$actual = $absCases->getProcessId(); $actual = $absCases->getProcessId();
$this->assertEquals($properties['process'], $actual); $this->assertEquals($properties['process'], $actual);
$actual = $absCases->getTaskId(); $actual = $absCases->getTaskId();
@@ -887,6 +897,33 @@ class AbstractCasesTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* This check the get task color
*
* @covers \ProcessMaker\BusinessModel\Cases\AbstractCases::getTaskColor()
* @test
*/
public function it_return_task_color_class()
{
$absCases = new Draft();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'DRAFT' ,'2000-01-01');
$this->assertNotEmpty($result);
$absCases = new Paused();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'PAUSED' ,'2000-01-01');
$this->assertNotEmpty($result);
$absCases = new Unassigned();
$dueDate = date('Y-m-d');
// Review on-time
$result = $absCases->getTaskColor($dueDate,'UNASSIGNED' ,'2000-01-01');
$this->assertNotEmpty($result);
}
/** /**
* This check task color according the due date * This check task color according the due date
* *
@@ -925,5 +962,31 @@ class AbstractCasesTest extends TestCase
$result = $absCases->threadInformation($thread, true, true); $result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
// APP_STATUS = DRAFT
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'DRAFT';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// APP_STATUS = COMPLETED
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'COMPLETED';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// DEL_THREAD_STATUS = PAUSED
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'TO_DO';
$thread['DEL_THREAD_STATUS'] = 'PAUSED';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
// TAS_ASSIGN_TYPE = SELF_SERVICE
foreach ($taskPending as $thread) {
$thread['APP_STATUS'] = 'TO_DO';
$thread['TAS_ASSIGN_TYPE'] = 'SELF_SERVICE';
$result = $absCases->threadInformation($thread, true, true);
$this->assertNotEmpty($result);
}
} }
} }

View File

@@ -28,6 +28,7 @@ class DraftTest extends TestCase
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
Delegation::truncate();
} }
/** /**
@@ -436,6 +437,7 @@ class DraftTest extends TestCase
* It tests the getCountersByProcesses() method with the top ten filter * It tests the getCountersByProcesses() method with the top ten filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByProcesses() * @covers \ProcessMaker\BusinessModel\Cases\Draft::getCountersByProcesses()
* @covers \ProcessMaker\Model\Delegation::scopeTopTen()
* @test * @test
*/ */
public function it_should_test_get_counters_by_processes_method_top_ten() public function it_should_test_get_counters_by_processes_method_top_ten()
@@ -788,7 +790,7 @@ class DraftTest extends TestCase
'APP_INIT_USER' => $user->USR_UID, 'APP_INIT_USER' => $user->USR_UID,
'APP_CUR_USER' => $user->USR_UID, 'APP_CUR_USER' => $user->USR_UID,
]); ]);
factory(Delegation::class)->states('foreign_keys')->create([ $del = factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN', 'DEL_THREAD_STATUS' => 'OPEN',
'DEL_INDEX' => 1, 'DEL_INDEX' => 1,
'USR_UID' => $application[0]->APP_INIT_USER, 'USR_UID' => $application[0]->APP_INIT_USER,
@@ -804,7 +806,7 @@ class DraftTest extends TestCase
$draft = new Draft(); $draft = new Draft();
$draft->setUserId($user->USR_ID); $draft->setUserId($user->USR_ID);
$draft->setUserUid($user->USR_ID); $draft->setUserUid($user->USR_ID);
$res = $draft->getCasesRisk($process->PRO_ID); $res = $draft->getCasesRisk($process->PRO_ID, $currentDate, $currentDate, 'ON_TIME', 10);
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
@@ -881,4 +883,18 @@ class DraftTest extends TestCase
$res = $draft->getCasesRisk($process->PRO_ID, null, null, 'OVERDUE'); $res = $draft->getCasesRisk($process->PRO_ID, null, null, 'OVERDUE');
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
/**
* This tests the getCounterMetrics() method
*
* @covers \ProcessMaker\BusinessModel\Cases\Draft::getCounterMetrics()
* @test
*/
public function it_should_test_get_counter_metrics()
{
$this->createDraft();
$draft = new Draft();
$result = $draft->getCounterMetrics();
$this->assertTrue($result > 0);
}
} }

View File

@@ -291,7 +291,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -344,7 +344,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -423,7 +423,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application->APP_INIT_USER); $home = new Home($application->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);
@@ -522,7 +522,7 @@ class HomeTest extends TestCase
'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]', 'CAL_COLUMNS' => '[{"field":"case_number","enableFilter":false,"set":true},{"field":"case_title","enableFilter":false,"set":true},{"field":"process_name","enableFilter":false,"set":true},{"field":"task","enableFilter":false,"set":true},{"field":"send_by","enableFilter":false,"set":true},{"field":"due_date","enableFilter":false,"set":true},{"field":"delegation_date","enableFilter":false,"set":true},{"field":"priority","enableFilter":false,"set":true},{"field":"VAR1","enableFilter":false,"set":true},{"field":"VAR2","enableFilter":false,"set":true},{"field":"VAR3","enableFilter":false,"set":false}]',
'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID 'ADD_TAB_UID' => $additionalTables->ADD_TAB_UID
]); ]);
$arguments = [$caseList->CAL_ID, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC']; $arguments = [$caseList->CAL_ID, 0, 0, 0, 0, 15, 0, '', '', 'APP_NUMBER,DESC'];
$home = new Home($application1->APP_INIT_USER); $home = new Home($application1->APP_INIT_USER);
$result = $home->getCustomDraft(...$arguments); $result = $home->getCustomDraft(...$arguments);

View File

@@ -31,6 +31,14 @@ class InboxTest extends TestCase
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
Delegation::truncate();
}
/**
* Method tearDown
*/
public function tearDown() {
parent::tearDown();
} }
/** /**
@@ -44,6 +52,7 @@ class InboxTest extends TestCase
{ {
$delegation = factory(Delegation::class)->states('foreign_keys')->create([ $delegation = factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN', 'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2, 'DEL_INDEX' => 2,
]); ]);
@@ -118,6 +127,7 @@ class InboxTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setProcessId()
* @test * @test
*/ */
public function it_filter_by_process() public function it_filter_by_process()
@@ -126,9 +136,11 @@ class InboxTest extends TestCase
$cases = $this->createInbox(); $cases = $this->createInbox();
// Create new Inbox object // Create new Inbox object
$inbox = new Inbox(); $inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID); $inbox->setUserId($cases->USR_ID);
$inbox->setProcessId($cases->PRO_ID); $inbox->setProcessId($cases->PRO_ID);
$inbox->setOrderByColumn('APP_NUMBER'); $inbox->setOrderByColumn('APP_NUMBER');
// Call to getData method
$res = $inbox->getData(); $res = $inbox->getData();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
@@ -139,6 +151,7 @@ class InboxTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setCaseNumber()
* @test * @test
*/ */
public function it_filter_by_app_number() public function it_filter_by_app_number()
@@ -147,9 +160,11 @@ class InboxTest extends TestCase
$cases = $this->createInbox(); $cases = $this->createInbox();
// Create new Inbox object // Create new Inbox object
$inbox = new Inbox(); $inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID); $inbox->setUserId($cases->USR_ID);
$inbox->setCaseNumber($cases->APP_NUMBER); $inbox->setCaseNumber($cases->APP_NUMBER);
$inbox->setOrderByColumn('APP_NUMBER'); $inbox->setOrderByColumn('APP_NUMBER');
// Call to getData method
$res = $inbox->getData(); $res = $inbox->getData();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
@@ -160,6 +175,7 @@ class InboxTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setCasesNumbers()
* @test * @test
*/ */
public function it_filter_by_specific_cases() public function it_filter_by_specific_cases()
@@ -168,9 +184,11 @@ class InboxTest extends TestCase
$cases = $this->createInbox(); $cases = $this->createInbox();
// Create new Inbox object // Create new Inbox object
$inbox = new Inbox(); $inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID); $inbox->setUserId($cases->USR_ID);
$inbox->setCasesNumbers([$cases->APP_NUMBER]); $inbox->setCasesNumbers([$cases->APP_NUMBER]);
$inbox->setOrderByColumn('APP_NUMBER'); $inbox->setOrderByColumn('APP_NUMBER');
// Call to getData method
$res = $inbox->getData(); $res = $inbox->getData();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
@@ -181,6 +199,8 @@ class InboxTest extends TestCase
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setCasesNumbers()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setRangeCasesFromTo()
* @test * @test
*/ */
public function it_filter_by_range_cases() public function it_filter_by_range_cases()
@@ -189,10 +209,13 @@ class InboxTest extends TestCase
$cases = $this->createInbox(); $cases = $this->createInbox();
// Create new Inbox object // Create new Inbox object
$inbox = new Inbox(); $inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID); $inbox->setUserId($cases->USR_ID);
$rangeOfCases = $cases->APP_NUMBER . "-" . $cases->APP_NUMBER; $rangeOfCases = $cases->APP_NUMBER . "-" . $cases->APP_NUMBER;
$inbox->setCasesNumbers([$cases->APP_NUMBER]);
$inbox->setRangeCasesFromTo([$rangeOfCases]); $inbox->setRangeCasesFromTo([$rangeOfCases]);
$inbox->setOrderByColumn('APP_NUMBER'); $inbox->setOrderByColumn('APP_NUMBER');
// Call to getData method
$res = $inbox->getData(); $res = $inbox->getData();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
@@ -212,26 +235,59 @@ class InboxTest extends TestCase
$cases = $this->createInbox(); $cases = $this->createInbox();
// Create new Inbox object // Create new Inbox object
$inbox = new Inbox(); $inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID); $inbox->setUserId($cases->USR_ID);
$inbox->setTaskId($cases->TAS_ID); $inbox->setTaskId($cases->TAS_ID);
// Call to getData method
$res = $inbox->getData(); $res = $inbox->getData();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
/**
* It tests the getData method with setDelegateFrom and setDelegateTo filter
*
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setDelegateFrom()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setDelegateTo()
* @test
*/
public function it_filter_by_delegate_from_to()
{
// Create factories related to the to_do cases
$cases = $this->createInbox();
// Create new Inbox object
$inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID);
$inbox->setDelegateFrom($cases->DEL_DELEGATE_DATE->format("Y-m-d"));
$inbox->setDelegateTo($cases->DEL_DELEGATE_DATE->format("Y-m-d"));
// Call to getData method
$res = $inbox->getData();
$this->assertEmpty($res);
}
/** /**
* It tests the getData method with case title filter * It tests the getData method with case title filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setCaseTitle()
* @test * @test
*/ */
public function it_filter_by_thread_title() public function it_filter_by_thread_title()
{ {
// Create factories related to the to_do cases // Create factories related to the to_do cases
$cases = $this->createInbox(); $delegation = factory(Delegation::class)->states('foreign_keys')->create([
$usrId = $cases->USR_ID; 'DEL_THREAD_STATUS' => 'OPEN',
$title = $cases->DEL_TITLE; 'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
'DEL_TITLE' => 'Test',
]);
$usrId = $delegation->USR_ID;
$title = 'Test';
// We need to commit the records inserted because is needed for the "fulltext" index // We need to commit the records inserted because is needed for the "fulltext" index
DB::commit(); DB::commit();
// Create new Inbox object // Create new Inbox object
@@ -245,12 +301,44 @@ class InboxTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* It tests the getData method with send by filter
*
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setSendBy()
* @test
*/
public function it_filter_send_by()
{
// Create factories related to the to_do cases
$cases = $this->createInbox();
// Create the previous thread with the same user
$delegation = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $cases->APP_NUMBER,
'APP_UID' => $cases->APP_UID,
'USR_ID' => $cases->USR_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'DEL_INDEX' => 1,
]);
// Create new Inbox object
$inbox = new Inbox();
// Apply filters
$inbox->setUserId($cases->USR_ID);
$inbox->setSendBy($cases->USR_ID);
// Call to getData method
$res = $inbox->getData();
$this->assertNotEmpty($res);
}
/** /**
* It tests the getData method using order by column * It tests the getData method using order by column
* *
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters() * @covers \ProcessMaker\BusinessModel\Cases\Inbox::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::setOrderByColumn()
* @test * @test
*/ */
public function it_order_by_column() public function it_order_by_column()
@@ -755,4 +843,18 @@ class InboxTest extends TestCase
$res = $inbox->getCasesRisk($process->PRO_ID, null, null, "OVERDUE"); $res = $inbox->getCasesRisk($process->PRO_ID, null, null, "OVERDUE");
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
/**
* It tests the getCounterMetrics method
*
* @covers \ProcessMaker\BusinessModel\Cases\Inbox::getCounterMetrics()
* @test
*/
public function it_tests_get_counter_metrics()
{
$this->createInbox();
$inbox = new Inbox();
$res = $inbox->getCounterMetrics();
$this->assertTrue($res > 0);
}
} }

View File

@@ -32,6 +32,7 @@ class PausedTest extends TestCase
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
Delegation::truncate();
} }
/** /**
@@ -201,7 +202,7 @@ class PausedTest extends TestCase
* It tests the getData method without filters * It tests the getData method without filters
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\Model\Delegation::scopePaused() * @covers \ProcessMaker\Model\Delegation::scopePaused()
* @test * @test
*/ */
@@ -225,7 +226,7 @@ class PausedTest extends TestCase
* It tests the getData method with case number filter * It tests the getData method with case number filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters() * @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test * @test
*/ */
@@ -251,7 +252,7 @@ class PausedTest extends TestCase
* It tests the getData method with case number filter * It tests the getData method with case number filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters() * @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test * @test
*/ */
@@ -277,7 +278,7 @@ class PausedTest extends TestCase
* It tests the getData method with taskId filter * It tests the getData method with taskId filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters() * @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test * @test
*/ */
@@ -303,7 +304,7 @@ class PausedTest extends TestCase
* It tests the getData method with processId filter * It tests the getData method with processId filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters() * @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test * @test
*/ */
@@ -328,7 +329,7 @@ class PausedTest extends TestCase
* It tests the getData method with case title filter * It tests the getData method with case title filter
* *
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getColumnsView() * @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters() * @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test * @test
*/ */
@@ -348,6 +349,51 @@ class PausedTest extends TestCase
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
/**
* It tests the getData method with setDelegateFrom and setDelegateTo filter
*
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @test
*/
public function it_filter_by_delegate_from_to()
{
// Create factories related to the paused cases
$cases = $this->createPaused();
// Create new Paused object
$paused = new Paused();
$paused->setUserUid($cases->USR_UID);
$paused->setUserId($cases->USR_ID);
$paused->setDelegateFrom($cases->DEL_DELEGATE_DATE->format("Y-m-d"));
$paused->setDelegateTo($cases->DEL_DELEGATE_DATE->format("Y-m-d"));
// Get data
$res = $paused->getData();
$this->assertEmpty($res);
}
/**
* It tests the getData method with send by filter
*
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getColumnsView()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::filters()
* @covers \ProcessMaker\BusinessModel\Cases\Paused::setSendBy()
* @test
*/
public function it_filter_send_by()
{
// Create factories related to the to_do cases
$cases = $this->createPaused();
// Create new Paused object
$paused = new Paused();
$paused->setUserId($cases->USR_ID);
$paused->setSendBy($cases->USR_ID);
$res = $paused->getData();
$this->assertNotEmpty($res);
}
/** /**
* It tests the getCounter() method * It tests the getCounter() method
* *
@@ -866,4 +912,19 @@ class PausedTest extends TestCase
$res = $paused->getCasesRisk($process1->PRO_ID, null, null, 'OVERDUE'); $res = $paused->getCasesRisk($process1->PRO_ID, null, null, 'OVERDUE');
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
/**
* It tests the getCounterMetrics() method
*
* @covers \ProcessMaker\BusinessModel\Cases\Paused::getCounterMetrics()
* @test
*/
public function it_tests_get_counter_metrics()
{
$this->createMultiplePaused(3);
$paused = new Paused();
$res = $paused->getCounterMetrics();
$this->assertTrue($res > 0);
}
} }

View File

@@ -34,6 +34,8 @@ class UnassignedTest extends TestCase
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
Delegation::truncate();
Groupwf::truncate();
} }
/** /**
@@ -211,6 +213,7 @@ class UnassignedTest extends TestCase
$cases = $this->createSelfServiceUserOrGroup(); $cases = $this->createSelfServiceUserOrGroup();
//Review the count self-service //Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID); $unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID); $unassigned->setUserId($cases['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -229,6 +232,7 @@ class UnassignedTest extends TestCase
$cases = $this->createSelfServiceByVariable(); $cases = $this->createSelfServiceByVariable();
//Review the count self-service //Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($cases['user']->USR_UID); $unassigned->setUserUid($cases['user']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID); $unassigned->setUserId($cases['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -247,6 +251,7 @@ class UnassignedTest extends TestCase
$cases = $this->createSelfServiceUserOrGroup(2); $cases = $this->createSelfServiceUserOrGroup(2);
//Review the count self-service //Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID); $unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID); $unassigned->setUserId($cases['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -265,6 +270,7 @@ class UnassignedTest extends TestCase
$cases = $this->createSelfServiceByVariable(2, false); $cases = $this->createSelfServiceByVariable(2, false);
//Review the count self-service //Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($cases['user']->USR_UID); $unassigned->setUserUid($cases['user']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID); $unassigned->setUserId($cases['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -284,10 +290,12 @@ class UnassignedTest extends TestCase
$casesGroup = $this->createSelfServiceUserOrGroup(2); $casesGroup = $this->createSelfServiceUserOrGroup(2);
//Review the count self-service //Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($casesUser['taskUser']->USR_UID); $unassigned->setUserUid($casesUser['taskUser']->USR_UID);
$unassigned->setUserId($casesUser['delegation']->USR_ID); $unassigned->setUserId($casesUser['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
// Apply filters
$unassigned->setUserUid($casesGroup['taskUser']->USR_UID); $unassigned->setUserUid($casesGroup['taskUser']->USR_UID);
$unassigned->setUserId($casesGroup['delegation']->USR_ID); $unassigned->setUserId($casesGroup['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -305,13 +313,15 @@ class UnassignedTest extends TestCase
{ {
$casesUser = $this->createSelfServiceByVariable(); $casesUser = $this->createSelfServiceByVariable();
$casesGroup = $this->createSelfServiceByVariable(2, false); $casesGroup = $this->createSelfServiceByVariable(2, false);
//Review the count self-service // Review the count self-service
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($casesUser['user']->USR_UID); $unassigned->setUserUid($casesUser['user']->USR_UID);
$unassigned->setUserId($casesUser['delegation']->USR_ID); $unassigned->setUserId($casesUser['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
$unassigned = new Unassigned; $unassigned = new Unassigned;
// Apply filters
$unassigned->setUserUid($casesGroup['user']->USR_UID); $unassigned->setUserUid($casesGroup['user']->USR_UID);
$unassigned->setUserId($casesGroup['delegation']->USR_ID); $unassigned->setUserId($casesGroup['delegation']->USR_ID);
$result = $unassigned->getCounter(); $result = $unassigned->getCounter();
@@ -331,9 +341,34 @@ class UnassignedTest extends TestCase
$cases = $this->createSelfServiceUserOrGroup(); $cases = $this->createSelfServiceUserOrGroup();
// Create new object // Create new object
$unassigned = new Unassigned(); $unassigned = new Unassigned();
// Set the user UID // Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID); $unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID); $unassigned->setUserId($cases['delegation']->USR_ID);
// Set OrderByColumn value
$unassigned->setOrderByColumn('APP_NUMBER');
// Call to getData method
$res = $unassigned->getData();
// This assert that the expected numbers of results are returned
$this->assertNotEmpty($res);
}
/**
* This ensures get data from self-service-user-assigned with filter setCasesNumbers
*
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::filters()
* @test
*/
public function it_filter_by_case_numbers()
{
// Create factories related to the unassigned cases
$cases = $this->createSelfServiceUserOrGroup();
// Create new object
$unassigned = new Unassigned();
// Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID);
$unassigned->setCasesNumbers([$cases['delegation']->APP_NUMBER]);
// Set OrderBYColumn value // Set OrderBYColumn value
$unassigned->setOrderByColumn('APP_NUMBER'); $unassigned->setOrderByColumn('APP_NUMBER');
// Call to getData method // Call to getData method
@@ -342,6 +377,54 @@ class UnassignedTest extends TestCase
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
/**
* This ensures get data from self-service-user-assigned with filter setRangeCasesFromTo
*
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::filters()
* @test
*/
public function it_filter_by_range_cases()
{
// Create factories related to the unassigned cases
$cases = $this->createSelfServiceUserOrGroup();
// Create new object
$unassigned = new Unassigned();
// Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID);
$rangeOfCases = $cases['delegation']->APP_NUMBER . "-" . $cases['delegation']->APP_NUMBER;
$unassigned->setRangeCasesFromTo([$rangeOfCases]);
// Call to getData method
$res = $unassigned->getData();
// This assert that the expected numbers of results are returned
$this->assertNotEmpty($res);
}
/**
* This ensures get data from self-service-user-assigned with setDelegateFrom and setDelegateTo filter
*
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getData()
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::filters()
* @test
*/
public function it_filter_by_delegate_from_to()
{
// Create factories related to the unassigned cases
$cases = $this->createSelfServiceUserOrGroup();
// Create new object
$unassigned = new Unassigned();
// Apply filters
$unassigned->setUserUid($cases['taskUser']->USR_UID);
$unassigned->setUserId($cases['delegation']->USR_ID);
$unassigned->setDelegateFrom(date('Y-m-d'));
$unassigned->setDelegateTo(date('Y-m-d'));
// Call to getData method
$res = $unassigned->getData();
// This assert that the expected numbers of results are returned
$this->assertEmpty($res);
}
/** /**
* It tests the getData method with case title filter * It tests the getData method with case title filter
* *
@@ -361,9 +444,9 @@ class UnassignedTest extends TestCase
DB::commit(); DB::commit();
// Create new Unassigned object // Create new Unassigned object
$unassigned = new Unassigned(); $unassigned = new Unassigned();
// Apply filters
$unassigned->setUserUid($usrUid); $unassigned->setUserUid($usrUid);
$unassigned->setUserId($usrId); $unassigned->setUserId($usrId);
// Set the title
$unassigned->setCaseTitle($title); $unassigned->setCaseTitle($title);
// Get the data // Get the data
$res = $unassigned->getData(); $res = $unassigned->getData();
@@ -870,4 +953,18 @@ class UnassignedTest extends TestCase
$res = $unassigned->getCasesRisk($process1->PRO_ID, null, null, 'OVERDUE'); $res = $unassigned->getCasesRisk($process1->PRO_ID, null, null, 'OVERDUE');
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
/**
* This the getCounterMetrics method
*
* @covers \ProcessMaker\BusinessModel\Cases\Unassigned::getCounterMetrics()
* @test
*/
public function it_tests_get_counter_metrics()
{
$this->createSelfServiceUserOrGroup();
$unassigned = new Unassigned;
$result = $unassigned->getCounterMetrics();
$this->assertTrue($result > 0);
}
} }

View File

@@ -13,6 +13,11 @@ use ProcessMaker\Model\Process;
use ProcessMaker\Model\Task; use ProcessMaker\Model\Task;
use Tests\TestCase; use Tests\TestCase;
/**
* Class AbeConfigurationTest
*
* @coversDefaultClass \ProcessMaker\Model\AbeConfiguration
*/
class AbeConfigurationTest extends TestCase class AbeConfigurationTest extends TestCase
{ {
/** /**

View File

@@ -0,0 +1,51 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\AbeConfiguration;
use ProcessMaker\Model\AbeRequest;
use ProcessMaker\Model\Application;
use Tests\TestCase;
/**
* Class AbeRequestTest
*
* @coversDefaultClass \ProcessMaker\Model\AbeRequest
*/
class AbeRequestTest extends TestCase
{
use DatabaseTransactions;
/**
* Test has one to APP_UID
*
* @covers \ProcessMaker\Model\AbeRequest::application()
* @test
*/
public function it_has_one_application()
{
$table = factory(AbeRequest::class)->create([
'APP_UID' => function () {
return factory(Application::class)->create()->APP_UID;
}
]);
$this->assertInstanceOf(Application::class, $table->application);
}
/**
* Test has one to ABE_UID
*
* @covers \ProcessMaker\Model\AbeRequest::abeConfiguration()
* @test
*/
public function it_has_one_abe_configuration()
{
$table = factory(AbeRequest::class)->create([
'ABE_UID' => function () {
return factory(AbeConfiguration::class)->create()->ABE_UID;
}
]);
$this->assertInstanceOf(AbeConfiguration::class, $table->abeConfiguration);
}
}

View File

@@ -6,6 +6,11 @@ use ProcessMaker\Model\AdditionalTables;
use ProcessMaker\Model\Fields; use ProcessMaker\Model\Fields;
use Tests\TestCase; use Tests\TestCase;
/**
* Class AdditionalTablesTest
*
* @coversDefaultClass \ProcessMaker\Model\AdditionalTables
*/
class AdditionalTablesTest extends TestCase class AdditionalTablesTest extends TestCase
{ {
/** /**
@@ -78,4 +83,23 @@ class AdditionalTablesTest extends TestCase
$this->assertArrayHasKey('rows', $row); $this->assertArrayHasKey('rows', $row);
} }
} }
/**
* Test update the offline property
*
* @covers \ProcessMaker\Model\AdditionalTables::updatePropertyOffline()
* @test
*/
public function it_update_property_offline()
{
$pmTable = factory(AdditionalTables::class)->create(['ADD_TAB_OFFLINE' => 0]);
$results = AdditionalTables::updatePropertyOffline([$pmTable->ADD_TAB_UID], 1);
// Check the update
$pmTableQuery = AdditionalTables::query()->select(['ADD_TAB_OFFLINE']);
$pmTableQuery->where('ADD_TAB_UID', $pmTable->ADD_TAB_UID);
$result = $pmTableQuery->get()->values()->toArray();
// Assert, the update was executed
$this->assertEquals($result[0]['ADD_TAB_OFFLINE'], 1);
}
} }

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\AppAssignSelfServiceValue;
use ProcessMaker\Model\AppAssignSelfServiceValueGroup;
use Tests\TestCase;
/**
* Class AppAssignSelfServiceValueGroupTest
*
* @coversDefaultClass \ProcessMaker\Model\AppAssignSelfServiceValueGroup
*/
class AppAssignSelfServiceValueGroupTest extends TestCase
{
use DatabaseTransactions;
/**
* Test belongs to ID
*
* @covers \ProcessMaker\Model\AppAssignSelfServiceValueGroup::appSelfService()
* @test
*/
public function it_has_a_id_defined()
{
$table = factory(AppAssignSelfServiceValueGroup::class)->create([
'ID' => function () {
return factory(AppAssignSelfServiceValue::class)->create()->ID;
}
]);
$this->assertInstanceOf(AppAssignSelfServiceValue::class, $table->appSelfService);
}
}

View File

@@ -0,0 +1,106 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\AppAssignSelfServiceValue;
use ProcessMaker\Model\AppAssignSelfServiceValueGroup;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\GroupUser;
use ProcessMaker\Model\Groupwf;
use ProcessMaker\Model\RbacUsers;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\User;
use Tests\TestCase;
/**
* Class AppAssignSelfServiceValueTest
*
* @coversDefaultClass \ProcessMaker\Model\AppAssignSelfServiceValue
*/
class AppAssignSelfServiceValueTest extends TestCase
{
use DatabaseTransactions;
/**
* Test belongs to APP_NUMBER
*
* @covers \ProcessMaker\Model\AppAssignSelfServiceValue::appNumber()
* @test
*/
public function it_belong_app_number()
{
$table = factory(AppAssignSelfServiceValue::class)->create([
'APP_NUMBER' => function () {
return factory(Delegation::class)->create()->APP_NUMBER;
}
]);
$this->assertInstanceOf(Delegation::class, $table->appNumber);
}
/**
* Test belongs to DEL_INDEX
*
* @covers \ProcessMaker\Model\AppAssignSelfServiceValue::index()
* @test
*/
public function it_belong_index()
{
$table = factory(AppAssignSelfServiceValue::class)->create([
'DEL_INDEX' => function () {
return factory(Delegation::class)->create()->DEL_INDEX;
}
]);
$this->assertInstanceOf(Delegation::class, $table->index);
}
/**
* Test belongs to TAS_ID
*
* @covers \ProcessMaker\Model\AppAssignSelfServiceValue::task()
* @test
*/
public function it_belong_task()
{
$table = factory(AppAssignSelfServiceValue::class)->create([
'TAS_ID' => function () {
return factory(Task::class)->create()->TAS_ID;
}
]);
$this->assertInstanceOf(Task::class, $table->task);
}
/**
* It tests getSelfServiceCasesByEvaluatePerUser()
*
* @covers \ProcessMaker\Model\AppAssignSelfServiceValue::getSelfServiceCasesByEvaluatePerUser()
* @test
*/
public function it_should_self_service_by_value()
{
// Assign user in a group
$rbacUser = factory(RbacUsers::class)->create();
$user = factory(User::class)->create([
'USR_UID' => $rbacUser['USR_UID']
]);
$group = factory(Groupwf::class)->create();
$table = factory(GroupUser::class)->create([
'GRP_UID' => $group['GRP_UID'],
'GRP_ID' => $group['GRP_ID'],
'USR_UID' => $user['USR_UID'],
'USR_ID' => $user['USR_ID'],
]);
// Create the selfservice
$self = factory(AppAssignSelfServiceValue::class)->create([
'GRP_UID' => $group['GRP_UID'],
]);
$table = factory(AppAssignSelfServiceValueGroup::class)->create([
'ID' => $self['ID'],
'GRP_UID' => $group['GRP_UID'],
'ASSIGNEE_ID' => $group['GRP_ID'],
'ASSIGNEE_TYPE' => 2,
]);
$result = AppAssignSelfServiceValue::getSelfServiceCasesByEvaluatePerUser($user['USR_UID']);
$this->assertNotEmpty($result);
}
}

View File

@@ -7,7 +7,7 @@ use ProcessMaker\Model\AppTimeoutAction;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class DelegationTest * Class AppTimeoutActionTest
* *
* @coversDefaultClass \ProcessMaker\Model\AppTimeoutAction * @coversDefaultClass \ProcessMaker\Model\AppTimeoutAction
*/ */

View File

@@ -0,0 +1,30 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\BpmnProject;
use Tests\TestCase;
/**
* Class BpmnProjectTest
*
* @coversDefaultClass \ProcessMaker\Model\BpmnProject
*/
class BpmnProjectTest extends TestCase
{
use DatabaseTransactions;
/**
* Test if is a BPMN process
*
* @covers \ProcessMaker\Model\BpmnProject::isBpmnProcess()
* @test
*/
public function it_is_bpmn_process()
{
$table = factory(BpmnProject::class)->create();
$result = BpmnProject::isBpmnProcess($table->PRJ_UID);
$this->assertEquals($result, 1);
}
}

View File

@@ -6,9 +6,13 @@ use ProcessMaker\Model\AdditionalTables;
use ProcessMaker\Model\CaseList; use ProcessMaker\Model\CaseList;
use Tests\TestCase; use Tests\TestCase;
/**
* Class CaseListTest
*
* @coversDefaultClass \ProcessMaker\Model\CaseList
*/
class CaseListTest extends TestCase class CaseListTest extends TestCase
{ {
/** /**
* setUp method. * setUp method.
*/ */
@@ -28,6 +32,7 @@ class CaseListTest extends TestCase
/** /**
* This tests the getColumnNameFromAlias method. * This tests the getColumnNameFromAlias method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::getColumnNameFromAlias()
* @covers \ProcessMaker\Model\CaseList::createSetting() * @covers \ProcessMaker\Model\CaseList::createSetting()
*/ */
public function it_should_test_getColumnNameFromAlias() public function it_should_test_getColumnNameFromAlias()
@@ -67,6 +72,8 @@ class CaseListTest extends TestCase
* This tests the getAliasFromColumnName method. * This tests the getAliasFromColumnName method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::createSetting() * @covers \ProcessMaker\Model\CaseList::createSetting()
* @covers \ProcessMaker\Model\CaseList::getColumnNameFromAlias()
* @covers \ProcessMaker\Model\CaseList::getAliasFromColumnName()
*/ */
public function it_should_test_getAliasFromColumnName() public function it_should_test_getAliasFromColumnName()
{ {
@@ -105,6 +112,7 @@ class CaseListTest extends TestCase
* This tests the createSetting method. * This tests the createSetting method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::createSetting() * @covers \ProcessMaker\Model\CaseList::createSetting()
* @covers \ProcessMaker\Model\CaseList::getColumnNameFromAlias()
*/ */
public function it_should_test_createSetting() public function it_should_test_createSetting()
{ {
@@ -139,6 +147,7 @@ class CaseListTest extends TestCase
* This tests the updateSetting method. * This tests the updateSetting method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::updateSetting() * @covers \ProcessMaker\Model\CaseList::updateSetting()
* @covers \ProcessMaker\Model\CaseList::createSetting()
*/ */
public function it_should_test_updateSetting() public function it_should_test_updateSetting()
{ {
@@ -181,6 +190,7 @@ class CaseListTest extends TestCase
* This tests the deleteSetting method. * This tests the deleteSetting method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::deleteSetting() * @covers \ProcessMaker\Model\CaseList::deleteSetting()
* @covers \ProcessMaker\Model\CaseList::createSetting()
*/ */
public function it_should_test_deleteSetting() public function it_should_test_deleteSetting()
{ {
@@ -217,6 +227,9 @@ class CaseListTest extends TestCase
/** /**
* This tests the getSetting method. * This tests the getSetting method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::getSetting()
* @covers \ProcessMaker\Model\CaseList::createSetting()
* @covers \ProcessMaker\Model\CaseList::getColumnNameFromAlias()
* @covers \ProcessMaker\Model\CaseList::deleteSetting() * @covers \ProcessMaker\Model\CaseList::deleteSetting()
*/ */
public function it_should_test_getSetting() public function it_should_test_getSetting()
@@ -322,6 +335,9 @@ class CaseListTest extends TestCase
/** /**
* This tests the export method. * This tests the export method.
* @test * @test
* @covers \ProcessMaker\Model\CaseList::getAliasFromColumnName()
* @covers \ProcessMaker\Model\CaseList::createSetting()
* @covers \ProcessMaker\Model\CaseList::getColumnNameFromAlias()
* @covers \ProcessMaker\Model\CaseList::export() * @covers \ProcessMaker\Model\CaseList::export()
*/ */
public function it_should_test_export() public function it_should_test_export()

View File

@@ -5,9 +5,12 @@ namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\Consolidated; use ProcessMaker\Model\Consolidated;
use ProcessMaker\Model\Delegation; use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Task;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ConsolidatedTest
*
* @coversDefaultClass \ProcessMaker\Model\Consolidated * @coversDefaultClass \ProcessMaker\Model\Consolidated
*/ */
class ConsolidatedTest extends TestCase class ConsolidatedTest extends TestCase
@@ -22,6 +25,22 @@ class ConsolidatedTest extends TestCase
parent::setUp(); parent::setUp();
} }
/**
* Test belongs to TAS_UID
*
* @covers \ProcessMaker\Model\Consolidated::task()
* @test
*/
public function it_has_a_task()
{
$table = factory(Consolidated::class)->create([
'TAS_UID' => function () {
return factory(Task::class)->create()->TAS_UID;
}
]);
$this->assertInstanceOf(Task::class, $table->task);
}
/** /**
* Create consolidated cases factories * Create consolidated cases factories
* *
@@ -42,6 +61,7 @@ class ConsolidatedTest extends TestCase
* This checks the counters is working properly in draft * This checks the counters is working properly in draft
* *
* @covers \ProcessMaker\Model\Consolidated::getCounterActive() * @covers \ProcessMaker\Model\Consolidated::getCounterActive()
* @covers \ProcessMaker\Model\Consolidated::scopeActive()
* @test * @test
*/ */
public function it_should_count_cases_consolidated() public function it_should_count_cases_consolidated()
@@ -57,7 +77,11 @@ class ConsolidatedTest extends TestCase
/** /**
* This checks the counters is working properly in consolidated * This checks the counters is working properly in consolidated
* *
* @covers \ProcessMaker\Model\Consolidated::getCounterActive() * @covers \ProcessMaker\Model\Consolidated::getConsolidated()
* @covers \ProcessMaker\Model\Consolidated::scopeJoinPendingCases()
* @covers \ProcessMaker\Model\Consolidated::scopeActive()
* @covers \ProcessMaker\Model\Consolidated::scopeJoinProcess()
* @covers \ProcessMaker\Model\Consolidated::scopeJoinTask()
* @test * @test
*/ */
public function it_should_count_cases() public function it_should_count_cases()

View File

@@ -1154,7 +1154,11 @@ class DelegationTest extends TestCase
*/ */
public function it_should_search_and_filter_by_app_title() public function it_should_search_and_filter_by_app_title()
{ {
$delegations = factory(Delegation::class, 1)->states('foreign_keys')->create(); $delegations = factory(Delegation::class, 1)->states('foreign_keys')->create([
'APP_NUMBER' => function () {
return factory(Application::class)->create()->APP_NUMBER;
}
]);
$title = $delegations->last()->DEL_TITLE; $title = $delegations->last()->DEL_TITLE;
// We need to commit the records inserted because is needed for the "fulltext" index // We need to commit the records inserted because is needed for the "fulltext" index
DB::commit(); DB::commit();
@@ -3421,7 +3425,7 @@ class DelegationTest extends TestCase
public function it_get_thread_title() public function it_get_thread_title()
{ {
$delegation = factory(Delegation::class)->states('foreign_keys')->create(); $delegation = factory(Delegation::class)->states('foreign_keys')->create();
$result = Delegation::getThreadTitle($delegation->TAS_UID, $delegation->APP_NUMBER, $delegation->DEL_INDEX, []); $result = Delegation::getThreadTitle($delegation->TAS_UID, $delegation->APP_NUMBER, $delegation->DEL_PREVIOUS, []);
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
@@ -3580,6 +3584,19 @@ class DelegationTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* This check the return cases thread title
*
* @covers \ProcessMaker\Model\Delegation::casesThreadTitle()
* @test
*/
public function it_get_cases_thread_title()
{
$delegation = factory(Delegation::class)->states('foreign_keys')->create();
$result = Delegation::casesThreadTitle($delegation->DEL_TITLE);
$this->assertNotEmpty($result);
}
/** /**
* Test the scopeParticipatedUser * Test the scopeParticipatedUser
* *
@@ -3596,4 +3613,83 @@ class DelegationTest extends TestCase
$res = $table->joinApplication()->participatedUser($table->USR_ID)->get(); $res = $table->joinApplication()->participatedUser($table->USR_ID)->get();
$this->assertCount(1, $res); $this->assertCount(1, $res);
} }
}
/**
* Test the scopeInboxMetrics
*
* @covers \ProcessMaker\Model\Delegation::scopeInboxMetrics()
* @test
*/
public function it_tests_scope_inbox_metrics()
{
$application = factory(Application::class)->states('todo')->create();
$table = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
]);
$res = $table->inboxMetrics()->get();
$this->assertCount(1, $res);
}
/**
* Test the scopeDraftMetrics
*
* @covers \ProcessMaker\Model\Delegation::scopeDraftMetrics()
* @test
*/
public function it_tests_scope_draft_metrics()
{
$application = factory(Application::class)->states('draft')->create();
$table = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
]);
$res = $table->draftMetrics()->get();
$this->assertCount(1, $res);
}
/**
* Test the scopePausedMetrics
*
* @covers \ProcessMaker\Model\Delegation::scopePausedMetrics()
* @test
*/
public function it_tests_scope_paused_metrics()
{
$application = factory(Application::class)->states('paused')->create();
$appDelay = factory(AppDelay::class)->states('paused_foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
]);
$table = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
'DEL_INDEX' => $appDelay->APP_DEL_INDEX,
]);
$res = $table->pausedMetrics()->get();
$this->assertCount(1, $res);
}
/**
* Test the scopeSelfServiceMetrics
*
* @covers \ProcessMaker\Model\Delegation::scopeSelfServiceMetrics()
* @test
*/
public function it_tests_scope_self_service_metrics()
{
$application = factory(Application::class)->states('paused')->create();
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
]);
$delegation = factory(Delegation::class)->states('foreign_keys')->create([
'APP_NUMBER' => $application->APP_NUMBER,
'APP_UID' => $application->APP_UID,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_ID' => 0,
]);
$res = $delegation->selfServiceMetrics()->get();
$this->assertCount(1, $res);
}
}

View File

@@ -47,4 +47,22 @@ class DocumentsTest extends TestCase
$this->assertNotEmpty($result); $this->assertNotEmpty($result);
} }
/**
* This test get files
*
* @test
* @covers \ProcessMaker\Model\Documents::getFiles()
* @covers \ProcessMaker\Model\Documents::scopeDocId()
*/
public function it_should_test_get_files()
{
$appNote = factory(AppNotes::class)->create();
$appDocument = factory(Documents::class)->create([
'DOC_ID' => $appNote->NOTE_ID
]);
$result = Documents::getFiles($appDocument->DOC_ID);
$this->assertNotEmpty($result);
}
} }

View File

@@ -2,14 +2,86 @@
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model; namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\Dynaform; use ProcessMaker\Model\Dynaform;
use ProcessMaker\Model\Process; use ProcessMaker\Model\Process;
use Tests\TestCase; use Tests\TestCase;
/**
* Class DynaformTest
*
* @coversDefaultClass \ProcessMaker\Model\Dynaform
*/
class DynaformTest extends TestCase class DynaformTest extends TestCase
{ {
use DatabaseTransactions;
/**
* Call the setUp parent method
*/
public function setUp()
{
parent::setUp();
}
/**
* Test belongs to PRO_UID
*
* @covers \ProcessMaker\Model\Dynaform::process()
* @test
*/
public function it_has_a_process()
{
$dynaForm = factory(Dynaform::class)->create([
'PRO_UID' => function () {
return factory(Process::class)->create()->PRO_UID;
}
]);
$this->assertInstanceOf(Process::class, $dynaForm->process);
}
/**
* Tests get form by process
*
* @covers \ProcessMaker\Model\Dynaform::getByProUid()
* @test
*/
public function it_tests_get_by_pro_uid()
{
$dynaForm = factory(Dynaform::class)->states('foreign_keys')->create();
$result = Dynaform::getByProUid($dynaForm->PRO_UID);
$this->assertNotEmpty($result);
}
/**
* Tests get form by uid
*
* @covers \ProcessMaker\Model\Dynaform::getByDynUid()
* @test
*/
public function it_tests_get_by_dyn_uid()
{
$dynaForm = factory(Dynaform::class)->states('foreign_keys')->create();
$result = Dynaform::getByDynUid($dynaForm->DYN_UID);
$this->assertNotEmpty($result);
}
/**
* Tests get form by process excluding a uid
*
* @covers \ProcessMaker\Model\Dynaform::getByProUidExceptDynUid()
* @test
*/
public function it_tests_get_by_process_exclude_dyn_uid()
{
$dynaForm = factory(Dynaform::class)->states('foreign_keys')->create();
$result = Dynaform::getByProUidExceptDynUid($dynaForm->PRO_UID, $dynaForm->DYN_UID);
$this->assertEmpty($result);
}
/** /**
* It tests the process scope in the dynaform model * It tests the process scope in the dynaform model
*
* @covers \ProcessMaker\Model\Dynaform::scopeProcess()
* @test * @test
*/ */
public function it_should_test_process_scope_in_dynaform_model() public function it_should_test_process_scope_in_dynaform_model()

View File

@@ -6,6 +6,11 @@ use ProcessMaker\Model\EmailEvent;
use ProcessMaker\Model\EmailServerModel; use ProcessMaker\Model\EmailServerModel;
use Tests\TestCase; use Tests\TestCase;
/**
* Class EmailEventTest
*
* @coversDefaultClass \ProcessMaker\Model\EmailEvent
*/
class EmailEventTest extends TestCase class EmailEventTest extends TestCase
{ {
/** /**

View File

@@ -5,6 +5,11 @@ namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use ProcessMaker\Model\EmailServerModel; use ProcessMaker\Model\EmailServerModel;
use Tests\TestCase; use Tests\TestCase;
/**
* Class EmailServerModelTest
*
* @coversDefaultClass \ProcessMaker\Model\EmailServerModel
*/
class EmailServerModelTest extends TestCase class EmailServerModelTest extends TestCase
{ {
/** /**

View File

@@ -6,6 +6,11 @@ use ProcessMaker\Model\AdditionalTables;
use ProcessMaker\Model\Fields; use ProcessMaker\Model\Fields;
use Tests\TestCase; use Tests\TestCase;
/**
* Class FieldsTest
*
* @coversDefaultClass \ProcessMaker\Model\Fields
*/
class FieldsTest extends TestCase class FieldsTest extends TestCase
{ {
/** /**

View File

@@ -10,7 +10,7 @@ use ProcessMaker\Model\User;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ProcessTest * Class GroupUserTest
* *
* @coversDefaultClass \ProcessMaker\Model\GroupUser * @coversDefaultClass \ProcessMaker\Model\GroupUser
*/ */
@@ -18,9 +18,95 @@ class GroupUserTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;
/**
* Method set up.
*/
public function setUp()
{
parent::setUp();
GroupUser::truncate();
}
/**
* Test belongs to USR_UID
*
* @covers \ProcessMaker\Model\GroupUser::user()
* @test
*/
public function it_belong_user()
{
$table = factory(GroupUser::class)->create([
'USR_UID' => function () {
return factory(User::class)->create()->USR_UID;
}
]);
$this->assertInstanceOf(User::class, $table->user);
}
/**
* Test belongs to GRP_ID
*
* @covers \ProcessMaker\Model\GroupUser::groupsWf()
* @test
*/
public function it_belong_group()
{
$table = factory(GroupUser::class)->create([
'GRP_ID' => function () {
return factory(Groupwf::class)->create()->GRP_ID;
}
]);
$this->assertInstanceOf(Groupwf::class, $table->groupsWf);
}
/**
* This test scopeUser
*
* @covers \ProcessMaker\Model\GroupUser::scopeUser()
* @test
*/
public function it_return_scope_user()
{
$table = factory(GroupUser::class)->states('foreign_keys')->create();
$this->assertNotEmpty($table->user($table->USR_UID)->get());
}
/**
* It tests the messages related assignUserToGroup() method
*
* @covers \ProcessMaker\Model\GroupUser::assignUserToGroup()
* @test
*/
public function it_should_test_message()
{
// When the user does not exist
$user = factory(User::class)->create();
$group = factory(Groupwf::class)->create();
$result = GroupUser::assignUserToGroup('', 0, '', 0);
$this->assertNotEmpty($result);
// When the group does not exist
$rbacUser = factory(RbacUsers::class)->create();
$user = factory(User::class)->create([
'USR_UID' => $rbacUser['USR_UID']
]);
$group = factory(Groupwf::class)->create();
$result = GroupUser::assignUserToGroup($user['USR_UID'], 0, '', 0);
$this->assertNotEmpty($result);
// When the user already exist in a group
$rbacUser = factory(RbacUsers::class)->create();
$user = factory(User::class)->create([
'USR_UID' => $rbacUser['USR_UID']
]);
$group = factory(Groupwf::class)->create();
GroupUser::assignUserToGroup($user['USR_UID'], $user['USR_ID'], $group['GRP_UID'], $group['GRP_ID']);
$result = GroupUser::assignUserToGroup($user['USR_UID'], $user['USR_ID'], $group['GRP_UID'], $group['GRP_ID']);
$this->assertNotEmpty($result);
}
/** /**
* It tests the assignUserToGroup() method * It tests the assignUserToGroup() method
* *
* @covers \ProcessMaker\Model\GroupUser::assignUserToGroup()
* @test * @test
*/ */
public function it_should_test_the_assign_user_to_group_method() public function it_should_test_the_assign_user_to_group_method()
@@ -46,6 +132,8 @@ class GroupUserTest extends TestCase
/** /**
* It tests the verifyUserIsInGroup() method * It tests the verifyUserIsInGroup() method
* *
* @covers \ProcessMaker\Model\GroupUser::verifyUserIsInGroup()
* @covers \ProcessMaker\Model\GroupUser::assignUserToGroup()
* @test * @test
*/ */
public function it_should_test_the_verify_user_is_in_group_method() public function it_should_test_the_verify_user_is_in_group_method()

View File

@@ -3,11 +3,12 @@
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model; namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\GroupUser;
use ProcessMaker\Model\Groupwf; use ProcessMaker\Model\Groupwf;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ProcessTest * Class GroupwfTest
* *
* @coversDefaultClass \ProcessMaker\Model\Groupwf * @coversDefaultClass \ProcessMaker\Model\Groupwf
*/ */
@@ -15,6 +16,43 @@ class GroupwfTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;
/**
* Method set up.
*/
public function setUp()
{
parent::setUp();
Groupwf::truncate();
}
/**
* Test belongs to GRP_ID
*
* @covers \ProcessMaker\Model\Groupwf::groupUsers()
* @test
*/
public function it_belong_group()
{
$table = factory(Groupwf::class)->create([
'GRP_ID' => function () {
return factory(GroupUser::class)->create()->GRP_ID;
}
]);
$this->assertInstanceOf(GroupUser::class, $table->groupUsers);
}
/**
* This test scopeActive
*
* @covers \ProcessMaker\Model\Groupwf::scopeActive()
* @test
*/
public function it_return_scope_active()
{
$table = factory(Groupwf::class)->create();
$this->assertNotEmpty($table->active()->get());
}
/** /**
* It tests the verifyGroupExists() method * It tests the verifyGroupExists() method
* *

View File

@@ -0,0 +1,60 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\InputDocument;
use ProcessMaker\Model\Process;
use Tests\TestCase;
/**
* Class InputDocumentTest
*
* @coversDefaultClass \ProcessMaker\Model\InputDocument
*/
class InputDocumentTest extends TestCase
{
use DatabaseTransactions;
/**
* Test belongs to PRO_UID
*
* @covers \ProcessMaker\Model\InputDocument::process()
* @test
*/
public function it_has_a_process_defined()
{
$table = factory(InputDocument::class)->create([
'PRO_UID' => function () {
return factory(Process::class)->create()->PRO_UID;
}
]);
$this->assertInstanceOf(Process::class, $table->process);
}
/**
* Test get input by process
*
* @covers \ProcessMaker\Model\InputDocument::getByProUid()
* @test
*/
public function it_get_by_process()
{
$table = factory(InputDocument::class)->create();
$result = InputDocument::getByProUid($table->PRO_UID);
$this->assertNotEmpty($result);
}
/**
* Test get input by uid
*
* @covers \ProcessMaker\Model\InputDocument::getByInpDocUid()
* @test
*/
public function it_get_by_uid()
{
$table = factory(InputDocument::class)->create();
$result = InputDocument::getByInpDocUid($table->INP_DOC_UID);
$this->assertNotEmpty($result);
}
}

View File

@@ -0,0 +1,60 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\OutputDocument;
use ProcessMaker\Model\Process;
use Tests\TestCase;
/**
* Class OutputDocumentTest
*
* @coversDefaultClass \ProcessMaker\Model\OutputDocument
*/
class OutputDocumentTest extends TestCase
{
use DatabaseTransactions;
/**
* Test belongs to PRO_UID
*
* @covers \ProcessMaker\Model\OutputDocument::process()
* @test
*/
public function it_has_a_process_defined()
{
$table = factory(OutputDocument::class)->create([
'PRO_UID' => function () {
return factory(Process::class)->create()->PRO_UID;
}
]);
$this->assertInstanceOf(Process::class, $table->process);
}
/**
* Test get output by process
*
* @covers \ProcessMaker\Model\OutputDocument::getByProUid()
* @test
*/
public function it_get_by_process()
{
$table = factory(OutputDocument::class)->create();
$result = OutputDocument::getByProUid($table->PRO_UID);
$this->assertNotEmpty($result);
}
/**
* Test get output by uid
*
* @covers \ProcessMaker\Model\OutputDocument::getByOutDocUid()
* @test
*/
public function it_get_by_uid()
{
$table = factory(OutputDocument::class)->create();
$result = OutputDocument::getByOutDocUid($table->OUT_DOC_UID);
$this->assertNotEmpty($result);
}
}

View File

@@ -7,7 +7,7 @@ use ProcessMaker\Model\ProcessCategory;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ProcessTest * Class ProcessCategoryTest
* *
* @coversDefaultClass \ProcessMaker\Model\ProcessCategory * @coversDefaultClass \ProcessMaker\Model\ProcessCategory
*/ */
@@ -24,9 +24,25 @@ class ProcessCategoryTest extends TestCase
ProcessCategory::query()->delete(); ProcessCategory::query()->delete();
} }
/**
* Tests get categories
*
* @covers \ProcessMaker\Model\ProcessCategory::getCategories()
* @test
*/
public function it_tests_get_categories()
{
$processCategory = factory(ProcessCategory::class)->create();
$result = ProcessCategory::getCategories();
$this->assertNotEmpty($result);
}
/** /**
* Tests the getProcessCategories method without paremeters * Tests the getProcessCategories method without paremeters
* *
* @covers \ProcessMaker\Model\ProcessCategory::getProcessCategories()
* @covers \ProcessMaker\Model\ProcessCategory::scopeCategoryName()
* @test * @test
*/ */
public function it_tests_get_process_categories_method_without_paremeters() public function it_tests_get_process_categories_method_without_paremeters()
@@ -51,6 +67,8 @@ class ProcessCategoryTest extends TestCase
/** /**
* Tests the getProcessCategories method filtered by name * Tests the getProcessCategories method filtered by name
* *
* @covers \ProcessMaker\Model\ProcessCategory::getProcessCategories()
* @covers \ProcessMaker\Model\ProcessCategory::scopeCategoryName()
* @test * @test
*/ */
public function it_tests_get_process_categories_method_filter_by_name() public function it_tests_get_process_categories_method_filter_by_name()
@@ -79,6 +97,8 @@ class ProcessCategoryTest extends TestCase
/** /**
* Tests the getProcessCategories method with start and limit parameters * Tests the getProcessCategories method with start and limit parameters
* *
* @covers \ProcessMaker\Model\ProcessCategory::getProcessCategories()
* @covers \ProcessMaker\Model\ProcessCategory::scopeCategoryName()
* @test * @test
*/ */
public function it_tests_get_process_categories_method_with_start_limit() public function it_tests_get_process_categories_method_with_start_limit()
@@ -103,6 +123,7 @@ class ProcessCategoryTest extends TestCase
/** /**
* Tests the getCategoryId method * Tests the getCategoryId method
* *
* @covers \ProcessMaker\Model\ProcessCategory::getCategoryId()
* @test * @test
*/ */
public function it_tests_get_category_id_method() public function it_tests_get_category_id_method()
@@ -112,4 +133,19 @@ class ProcessCategoryTest extends TestCase
$this->assertEquals($processCategory->CATEGORY_ID, $result); $this->assertEquals($processCategory->CATEGORY_ID, $result);
} }
/**
* Tests get category
*
* @covers \ProcessMaker\Model\ProcessCategory::getCategory()
* @covers \ProcessMaker\Model\ProcessCategory::scopeCategory()
* @test
*/
public function it_tests_get_category()
{
$processCategory = factory(ProcessCategory::class)->create();
$result = ProcessCategory::getCategory($processCategory->CATEGORY_ID);
$this->assertNotEmpty($result);
}
} }

View File

@@ -258,8 +258,10 @@ class ProcessTest extends TestCase
* It tests the process list * It tests the process list
* *
* @covers \ProcessMaker\Model\Process::getProcessesFilter() * @covers \ProcessMaker\Model\Process::getProcessesFilter()
* @covers \ProcessMaker\Model\Process::getListColumns()
* @covers \ProcessMaker\Model\Process::scopeJoinUsers()
* @covers \ProcessMaker\Model\Process::scopeJoinCategory()
* @covers \ProcessMaker\Model\Process::scopeNoStatus() * @covers \ProcessMaker\Model\Process::scopeNoStatus()
* @covers \ProcessMaker\Model\Process::scopeSubProcess()
* @test * @test
*/ */
public function it_should_test_process_without_filter() public function it_should_test_process_without_filter()
@@ -278,7 +280,11 @@ class ProcessTest extends TestCase
* It tests the process list with specific category * It tests the process list with specific category
* *
* @covers \ProcessMaker\Model\Process::getProcessesFilter() * @covers \ProcessMaker\Model\Process::getProcessesFilter()
* @covers \ProcessMaker\Model\Process::getListColumns()
* @covers \ProcessMaker\Model\Process::scopeJoinUsers()
* @covers \ProcessMaker\Model\Process::scopeJoinCategory()
* @covers \ProcessMaker\Model\Process::scopeCategory() * @covers \ProcessMaker\Model\Process::scopeCategory()
* @covers \ProcessMaker\Model\Process::scopePerUser()
* @test * @test
*/ */
public function it_should_test_process_with_category_filter() public function it_should_test_process_with_category_filter()
@@ -288,16 +294,23 @@ class ProcessTest extends TestCase
return factory(ProcessCategory::class)->create()->CATEGORY_UID; return factory(ProcessCategory::class)->create()->CATEGORY_UID;
} }
]); ]);
$result = Process::getProcessesFilter( $result = Process::getProcessesFilter($process->PRO_CATEGORY);
$process->PRO_CATEGORY // Assert with the specific category
);
$this->assertEquals($process->PRO_CATEGORY, $result[0]['PRO_CATEGORY']); $this->assertEquals($process->PRO_CATEGORY, $result[0]['PRO_CATEGORY']);
$process = factory(Process::class)->create();
$result = Process::getProcessesFilter('NONE');
// Assert when the category is empty
$this->assertEmpty($result);
} }
/** /**
* It tests the process list with specific process * It tests the process list with specific process
* *
* @covers \ProcessMaker\Model\Process::getProcessesFilter() * @covers \ProcessMaker\Model\Process::getProcessesFilter()
* @covers \ProcessMaker\Model\Process::getListColumns()
* @covers \ProcessMaker\Model\Process::scopeJoinUsers()
* @covers \ProcessMaker\Model\Process::scopeJoinCategory()
* @covers \ProcessMaker\Model\Process::scopeProcess() * @covers \ProcessMaker\Model\Process::scopeProcess()
* @test * @test
*/ */
@@ -315,6 +328,9 @@ class ProcessTest extends TestCase
* It tests the process list with specific process title * It tests the process list with specific process title
* *
* @covers \ProcessMaker\Model\Process::getProcessesFilter() * @covers \ProcessMaker\Model\Process::getProcessesFilter()
* @covers \ProcessMaker\Model\Process::getListColumns()
* @covers \ProcessMaker\Model\Process::scopeJoinUsers()
* @covers \ProcessMaker\Model\Process::scopeJoinCategory()
* @covers \ProcessMaker\Model\Process::scopeTitle() * @covers \ProcessMaker\Model\Process::scopeTitle()
* @test * @test
*/ */
@@ -329,10 +345,41 @@ class ProcessTest extends TestCase
$this->assertEquals($process->PRO_TITLE, $result[0]['PRO_TITLE']); $this->assertEquals($process->PRO_TITLE, $result[0]['PRO_TITLE']);
} }
/**
* It tests the process list with suprocess filter
*
* @covers \ProcessMaker\Model\Process::getProcessesFilter()
* @covers \ProcessMaker\Model\Process::getListColumns()
* @covers \ProcessMaker\Model\Process::scopeJoinUsers()
* @covers \ProcessMaker\Model\Process::scopeJoinCategory()
* @covers \ProcessMaker\Model\Process::scopeSubProcess()
* @test
*/
public function it_should_test_process_subprocess_filter()
{
$process = factory(Process::class)->create([
'PRO_SUBPROCESS' => 1
]);
$result = Process::getProcessesFilter(
null,
null,
null,
$process->PRO_CREATE_USER,
0,
25,
'ASC',
'PRO_CREATE_DATE',
true,
true
);
$this->assertEquals($process->PRO_CREATE_USER, $result[0]['USR_UID']);
}
/** /**
* It tests the count process * It tests the count process
* *
* @covers \ProcessMaker\Model\Process::getCounter() * @covers \ProcessMaker\Model\Process::getCounter()
* @covers \ProcessMaker\Model\Process::scopePerUser()
* @test * @test
*/ */
public function it_should_test_count_process() public function it_should_test_count_process()
@@ -346,6 +393,8 @@ class ProcessTest extends TestCase
* It test get processes for the new home view * It test get processes for the new home view
* *
* @covers \ProcessMaker\Model\Process::getProcessesForHome() * @covers \ProcessMaker\Model\Process::getProcessesForHome()
* @covers \ProcessMaker\Model\Process::scopeCategoryId()
* @covers \ProcessMaker\Model\Process::scopeStatus()
* @test * @test
*/ */
public function it_should_test_get_processes_for_home() public function it_should_test_get_processes_for_home()
@@ -356,11 +405,13 @@ class ProcessTest extends TestCase
// Create five processes (4 active, 1 inactive) // Create five processes (4 active, 1 inactive)
factory(Process::class)->create([ factory(Process::class)->create([
'PRO_TITLE' => 'My Process 1', 'PRO_TITLE' => 'My Process 1',
'PRO_CATEGORY' => $processCategory->CATEGORY_UID 'PRO_CATEGORY' => $processCategory->CATEGORY_UID,
'CATEGORY_ID' => $processCategory->CATEGORY_ID
]); ]);
factory(Process::class)->create([ factory(Process::class)->create([
'PRO_TITLE' => 'My Process 2', 'PRO_TITLE' => 'My Process 2',
'PRO_CATEGORY' => $processCategory->CATEGORY_UID 'PRO_CATEGORY' => $processCategory->CATEGORY_UID,
'CATEGORY_ID' => $processCategory->CATEGORY_ID
]); ]);
factory(Process::class)->create([ factory(Process::class)->create([
'PRO_TITLE' => 'My Process 3', 'PRO_TITLE' => 'My Process 3',
@@ -376,8 +427,21 @@ class ProcessTest extends TestCase
// Assertions // Assertions
$this->assertCount(4, Process::getProcessesForHome()); $this->assertCount(4, Process::getProcessesForHome());
$this->assertCount(3, Process::getProcessesForHome('My Process')); $this->assertCount(3, Process::getProcessesForHome('My Process'));
$this->assertCount(2, Process::getProcessesForHome(null, $processCategory->CATEGORY_UID)); $this->assertCount(2, Process::getProcessesForHome(null, $processCategory->CATEGORY_ID));
$this->assertCount(4, Process::getProcessesForHome(null, null, null, 2)); $this->assertCount(4, Process::getProcessesForHome(null, null, null, 2));
$this->assertCount(1, Process::getProcessesForHome(null, null, 2, 1)); $this->assertCount(1, Process::getProcessesForHome(null, null, 2, 1, true));
}
/**
* It tests the isActive process
*
* @covers \ProcessMaker\Model\Process::isActive()
* @test
*/
public function it_should_test_is_active()
{
$process = factory(Process::class)->create();
$total = Process::isActive($process->PRO_ID);
$this->assertEquals(1, $total);
} }
} }

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\ProcessUser;
use Tests\TestCase;
/**
* Class ProcessUserTest
*
* @coversDefaultClass \ProcessMaker\Model\ProcessUser
*/
class ProcessUserTest extends TestCase
{
use DatabaseTransactions;
/**
* Test get process of supervisor
*
* @covers \ProcessMaker\Model\ProcessUser::scopeProcessSupervisor()
* @covers \ProcessMaker\Model\ProcessUser::scopeProcessGroupSupervisor()
* @covers \ProcessMaker\Model\ProcessUser::scopeJoinProcess()
* @covers \ProcessMaker\Model\ProcessUser::getProcessesOfSupervisor()
* @test
*/
public function it_get_process_of_supervisor()
{
$table = factory(ProcessUser::class)->states('foreign_keys')->create();
$result = ProcessUser::getProcessesOfSupervisor($table->USR_UID);
$this->assertNotEmpty($result);
}
}

View File

@@ -7,7 +7,9 @@ use ProcessMaker\Model\ProcessVariables;
use Tests\TestCase; use Tests\TestCase;
/** /**
* @coversDefaultClass ProcessMaker\Model\ProcessVariables * Class ProcessVariablesTest
*
* @coversDefaultClass \ProcessMaker\Model\ProcessVariables
*/ */
class ProcessVariablesTest extends TestCase class ProcessVariablesTest extends TestCase
{ {

View File

@@ -9,7 +9,7 @@ use ProcessMaker\Model\RbacUsers;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ProcessTest * Class RbacUsersTest
* *
* @coversDefaultClass \ProcessMaker\Model\SubProcess * @coversDefaultClass \ProcessMaker\Model\SubProcess
*/ */

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use ProcessMaker\Model\Step;
use Tests\TestCase;
/**
* Class StepTest
*
* @coversDefaultClass \ProcessMaker\Model\Step
*/
class StepTest extends TestCase
{
use DatabaseTransactions;
/**
* Test get specific step
*
* @covers \ProcessMaker\Model\Step::getByProcessTaskAndStepType()
* @test
*/
public function it_get_specific_step()
{
$table = factory(Step::class)->create();
$result = Step::getByProcessTaskAndStepType(
$table->PRO_UID,
$table->TAS_UID,
$table->STEP_TYPE_OBJ,
$table->STEP_UID_OBJ
);
$this->assertNotEmpty($result);
}
}

View File

@@ -8,7 +8,7 @@ use ProcessMaker\Model\SubProcess;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class ProcessTest * Class SubProcessTest
* *
* @coversDefaultClass \ProcessMaker\Model\SubProcess * @coversDefaultClass \ProcessMaker\Model\SubProcess
*/ */

View File

@@ -20,6 +20,31 @@ class TaskTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;
/**
* It tests the get taskId
*
* @covers \ProcessMaker\Model\Task::getTask()
* @test
*/
public function it_get_task()
{
$task = factory(Task::class)->create();
$result = Task::getTask($task->TAS_ID);
$this->assertNotEmpty($result);
}
/**
* This test scopeExcludedTasks
*
* @covers \ProcessMaker\Model\Task::scopeExcludedTasks()
* @test
*/
public function it_scope_exclude_tasks()
{
$table = factory(Task::class)->create();
$this->assertNotEmpty($table->excludedTasks()->get());
}
/** /**
* This checks to make get the name of the task * This checks to make get the name of the task
* *
@@ -30,32 +55,60 @@ class TaskTest extends TestCase
{ {
// Intermediate email event // Intermediate email event
$task = factory(Task::class)->create([ $task = factory(Task::class)->create([
'TAS_TITLE' => 'INTERMEDIATE-THROW-EMAIL-EVENT' 'TAS_TITLE' => 'INTERMEDIATE-THROW-EMAIL-EVENT',
'TAS_TYPE' => 'INTERMEDIATE-THROW-EMAIL-EVENT'
]); ]);
$taskInstance = new Task(); $taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID); $title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title, G::LoadTranslation('ID_INTERMEDIATE_THROW_EMAIL_EVENT')); $this->assertEquals($title['title'], G::LoadTranslation('ID_INTERMEDIATE_THROW_EMAIL_EVENT'));
// Intermediate throw message event // Intermediate throw message event
$task = factory(Task::class)->create([ $task = factory(Task::class)->create([
'TAS_TITLE' => 'INTERMEDIATE-THROW-MESSAGE-EVENT' 'TAS_TITLE' => 'INTERMEDIATE-THROW-MESSAGE-EVENT',
'TAS_TYPE' => 'INTERMEDIATE-THROW-MESSAGE-EVENT'
]); ]);
$taskInstance = new Task(); $taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID); $title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title, G::LoadTranslation('ID_INTERMEDIATE_THROW_MESSAGE_EVENT')); $this->assertEquals($title['title'], G::LoadTranslation('ID_INTERMEDIATE_THROW_MESSAGE_EVENT'));
// Intermediate catch message event // Intermediate catch message event
$task = factory(Task::class)->create([ $task = factory(Task::class)->create([
'TAS_TITLE' => 'INTERMEDIATE-CATCH-MESSAGE-EVENT' 'TAS_TITLE' => 'INTERMEDIATE-CATCH-MESSAGE-EVENT',
'TAS_TYPE' => 'INTERMEDIATE-CATCH-MESSAGE-EVENT'
]); ]);
$taskInstance = new Task(); $taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID); $title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title, G::LoadTranslation('ID_INTERMEDIATE_CATCH_MESSAGE_EVENT')); $this->assertEquals($title['title'], G::LoadTranslation('ID_INTERMEDIATE_CATCH_MESSAGE_EVENT'));
// Intermediate timer event // Intermediate timer event
$task = factory(Task::class)->create([ $task = factory(Task::class)->create([
'TAS_TITLE' => 'INTERMEDIATE-CATCH-TIMER-EVENT' 'TAS_TITLE' => 'INTERMEDIATE-CATCH-TIMER-EVENT',
'TAS_TYPE' => 'INTERMEDIATE-CATCH-TIMER-EVENT'
]); ]);
$taskInstance = new Task(); $taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID); $title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title, G::LoadTranslation('ID_INTERMEDIATE_CATCH_TIMER_EVENT')); $this->assertEquals($title['title'], G::LoadTranslation('ID_INTERMEDIATE_CATCH_TIMER_EVENT'));
// Script task
$task = factory(Task::class)->create([
'TAS_TITLE' => 'SCRIPT-TASK',
'TAS_TYPE' => 'SCRIPT-TASK'
]);
$taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title['title'], G::LoadTranslation('ID_SCRIPT_TASK_UNTITLED'));
// Service task
$task = factory(Task::class)->create([
'TAS_TITLE' => 'SERVICE-TASK',
'TAS_TYPE' => 'SERVICE-TASK'
]);
$taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title['title'], G::LoadTranslation('ID_SERVICE_TASK_UNTITLED'));
// None
$task = factory(Task::class)->create([
'TAS_TITLE' => 'SUBPROCESS',
'TAS_TYPE' => 'SUBPROCESS'
]);
$taskInstance = new Task();
$title = $taskInstance->title($task->TAS_ID);
$this->assertEquals($title['title'], G::LoadTranslation('ID_ANONYMOUS'));
} }
/** /**
@@ -191,6 +244,8 @@ class TaskTest extends TestCase
* It test get tasks for the new home view * It test get tasks for the new home view
* *
* @covers \ProcessMaker\Model\Task::getTasksForHome() * @covers \ProcessMaker\Model\Task::getTasksForHome()
* @covers \ProcessMaker\Model\Task::scopeTitle()
* @covers \ProcessMaker\Model\Task::scopeProcess()
* @test * @test
*/ */
public function it_should_test_get_tasks_for_home_method() public function it_should_test_get_tasks_for_home_method()

View File

@@ -9,7 +9,7 @@ use ProcessMaker\Model\Triggers;
use Tests\TestCase; use Tests\TestCase;
/** /**
* Class DelegationTest * Class TriggersTest
* *
* @coversDefaultClass \ProcessMaker\Model\Triggers * @coversDefaultClass \ProcessMaker\Model\Triggers
*/ */

View File

@@ -6,9 +6,13 @@ use G;
use ProcessMaker\Model\UserConfig; use ProcessMaker\Model\UserConfig;
use Tests\TestCase; use Tests\TestCase;
/**
* Class UserConfigTest
*
* @coversDefaultClass \ProcessMaker\Model\UserConfig
*/
class UserConfigTest extends TestCase class UserConfigTest extends TestCase
{ {
/** /**
* Setup method, * Setup method,
*/ */

View File

@@ -8,6 +8,13 @@ use Luracast\Restler\Defaults;
use Luracast\Restler\HumanReadableCache; use Luracast\Restler\HumanReadableCache;
use Maveriks\Extension\Restler; use Maveriks\Extension\Restler;
use ProcessMaker\BusinessModel\Cases\Unassigned; use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\AppDelay;
use ProcessMaker\Model\Application as ApplicationModel;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process;
use ProcessMaker\Model\Task;
use ProcessMaker\Model\TaskUser;
use ProcessMaker\Model\User;
use ProcessMaker\Services\Api\Metrics; use ProcessMaker\Services\Api\Metrics;
use ReflectionClass; use ReflectionClass;
use Tests\TestCase; use Tests\TestCase;
@@ -31,6 +38,7 @@ class MetricsTest extends TestCase
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
Delegation::truncate();
} }
/** /**
* Initialize Rest API. * Initialize Rest API.
@@ -80,6 +88,8 @@ class MetricsTest extends TestCase
*/ */
public function it_tests_get_counters_list_method_empty_lists() public function it_tests_get_counters_list_method_empty_lists()
{ {
ApplicationModel::truncate();
$user = factory(\ProcessMaker\Model\User::class)->create(); $user = factory(\ProcessMaker\Model\User::class)->create();
$this->initializeRestApi($user->USR_UID); $this->initializeRestApi($user->USR_UID);
@@ -154,4 +164,560 @@ class MetricsTest extends TestCase
$res = $metrics->getCountersList(); $res = $metrics->getCountersList();
$this->assertNotEmpty($res); $this->assertNotEmpty($res);
} }
/**
* Tests the getProcessTotalCases method with inbox
*
* @test
*/
public function it_tests_get_process_total_cases_inbox()
{
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
]);
$metrics = new Metrics();
$res = $metrics->getProcessTotalCases('inbox');
$this->assertNotEmpty($res);
}
/**
* Tests the getProcessTotalCases method with draft
*
* @test
*/
public function it_tests_get_process_total_cases_draft()
{
$application = factory(ApplicationModel::class)->states('draft')->create();
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_INDEX' => 1,
'USR_UID' => $application->APP_INIT_USER,
'USR_ID' => $application->APP_INIT_USER_ID,
'APP_UID' => $application->APP_UID,
'APP_NUMBER' => $application->APP_NUMBER,
]);
$metrics = new Metrics();
$res = $metrics->getProcessTotalCases('draft');
$this->assertNotEmpty($res);
}
/**
* Tests the getProcessTotalCases method with paused
*
* @test
*/
public function it_tests_get_process_total_cases_paused()
{
$process1 = factory(Process::class)->create(
['PRO_CATEGORY' => '1']
);
$process2 = factory(Process::class)->create(
['PRO_CATEGORY' => '2']
);
$user = factory(User::class)->create();
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => '',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process1->PRO_UID,
'TAS_TYPE' => 'NORMAL'
]);
$application1 = factory(ApplicationModel::class)->create();
$application2 = factory(ApplicationModel::class)->create();
factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1
]);
$delegation1 = factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2
]);
factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1
]);
$delegation2 = factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation1->APP_NUMBER,
'APP_DEL_INDEX' => $delegation1->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation2->APP_NUMBER,
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
$metrics = new Metrics();
$res = $metrics->getProcessTotalCases('paused');
$this->assertNotEmpty($res);
}
/**
* Tests the getProcessTotalCases method with unassigned
*
* @test
*/
public function it_tests_get_process_total_cases_unassigned()
{
$user = factory(\ProcessMaker\Model\User::class)->create();
$process = factory(Process::class)->create();
$application = factory(ApplicationModel::class)->create([
'APP_STATUS_ID' => 2
]);
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process->PRO_UID,
'PRO_ID' => $process->PRO_ID,
]);
factory(TaskUser::class)->create([
'TAS_UID' => $task->TAS_UID,
'USR_UID' => $user->USR_UID,
'TU_RELATION' => 1,
'TU_TYPE' => 1
]);
factory(Delegation::class)->create([
'APP_NUMBER' => $application->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'PRO_ID' => $process->PRO_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_ID' => 0,
'DEL_DELEGATE_DATE' => date('Y-m-d H:i:s', strtotime("-1 year"))
]);
$metrics = new Metrics();
$res = $metrics->getProcessTotalCases('unassigned');
$this->assertNotEmpty($res);
}
/**
* Tests the getTotalCasesByRange method with inbox
*
* @test
*/
public function it_tests_get_total_cases_by_range_inbox()
{
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
]);
$metrics = new Metrics();
$res = $metrics->getTotalCasesByRange('inbox');
$this->assertNotEmpty($res);
}
/**
* Tests the getTotalCasesByRange method with draft
*
* @test
*/
public function it_tests_get_total_cases_by_range_draft()
{
$application = factory(ApplicationModel::class)->states('draft')->create();
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_INDEX' => 1,
'USR_UID' => $application->APP_INIT_USER,
'USR_ID' => $application->APP_INIT_USER_ID,
'APP_UID' => $application->APP_UID,
'APP_NUMBER' => $application->APP_NUMBER,
]);
$metrics = new Metrics();
$res = $metrics->getTotalCasesByRange('draft');
$this->assertNotEmpty($res);
}
/**
* Tests the getTotalCasesByRange method with paused
*
* @test
*/
public function it_tests_get_total_cases_by_range_paused()
{
$process1 = factory(Process::class)->create(
['PRO_CATEGORY' => '1']
);
$process2 = factory(Process::class)->create(
['PRO_CATEGORY' => '2']
);
$user = factory(User::class)->create();
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => '',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process1->PRO_UID,
'TAS_TYPE' => 'NORMAL'
]);
$application1 = factory(ApplicationModel::class)->create();
$application2 = factory(ApplicationModel::class)->create();
factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1
]);
$delegation1 = factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2
]);
factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1
]);
$delegation2 = factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation1->APP_NUMBER,
'APP_DEL_INDEX' => $delegation1->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation2->APP_NUMBER,
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
$metrics = new Metrics();
$res = $metrics->getTotalCasesByRange('paused');
$this->assertNotEmpty($res);
}
/**
* Tests the getTotalCasesByRange method with unassigned
*
* @test
*/
public function it_tests_get_total_cases_by_range_unassigned()
{
$user = factory(\ProcessMaker\Model\User::class)->create();
$process = factory(Process::class)->create();
$application = factory(ApplicationModel::class)->create([
'APP_STATUS_ID' => 2
]);
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process->PRO_UID,
'PRO_ID' => $process->PRO_ID,
]);
factory(TaskUser::class)->create([
'TAS_UID' => $task->TAS_UID,
'USR_UID' => $user->USR_UID,
'TU_RELATION' => 1,
'TU_TYPE' => 1
]);
factory(Delegation::class)->create([
'APP_NUMBER' => $application->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'PRO_ID' => $process->PRO_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_ID' => 0,
'DEL_DELEGATE_DATE' => date('Y-m-d H:i:s', strtotime("-1 year"))
]);
$metrics = new Metrics();
$res = $metrics->getTotalCasesByRange('unassigned');
$this->assertNotEmpty($res);
}
/**
* Tests the getCasesRiskByProcess method with inbox
*
* @test
*/
public function it_tests_get_cases_risk_by_process_inbox()
{
$process = factory(Process::class)->create();
$delegation = factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
'PRO_ID' => $process->PRO_ID,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
$metrics = new Metrics();
$res = $metrics->getCasesRiskByProcess('inbox', $delegation->PRO_ID, null, null, 'AT_RISK');
$this->assertNotEmpty($res);
}
/**
* Tests the getCasesRiskByProcess method with draft
*
* @test
*/
public function it_tests_get_cases_risk_by_process_draft()
{
$process = factory(Process::class)->create();
$application = factory(ApplicationModel::class)->states('draft')->create();
$delegation = factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_INDEX' => 1,
'USR_UID' => $application->APP_INIT_USER,
'USR_ID' => $application->APP_INIT_USER_ID,
'APP_UID' => $application->APP_UID,
'APP_NUMBER' => $application->APP_NUMBER,
'PRO_ID' => $process->PRO_ID,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
$metrics = new Metrics();
$res = $metrics->getCasesRiskByProcess('draft', $delegation->PRO_ID, null, null, 'AT_RISK');
$this->assertNotEmpty($res);
}
/**
* Tests the getCasesRiskByProcess method with paused
*
* @test
*/
public function it_tests_get_cases_risk_by_process_paused()
{
$process1 = factory(Process::class)->create(
['PRO_CATEGORY' => '1']
);
$process2 = factory(Process::class)->create(
['PRO_CATEGORY' => '2']
);
$user = factory(User::class)->create();
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => '',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process1->PRO_UID,
'TAS_TYPE' => 'NORMAL'
]);
$application1 = factory(ApplicationModel::class)->create();
$application2 = factory(ApplicationModel::class)->create();
factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
$delegation1 = factory(Delegation::class)->create([
'APP_NUMBER' => $application1->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'CLOSED',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process1->PRO_ID,
'PRO_UID' => $process1->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 0,
'DEL_INDEX' => 1,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
$delegation2 = factory(Delegation::class)->create([
'APP_NUMBER' => $application2->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_UID' => $user->USR_UID,
'USR_ID' => $user->USR_ID,
'PRO_ID' => $process2->PRO_ID,
'PRO_UID' => $process2->PRO_UID,
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation1->APP_NUMBER,
'APP_DEL_INDEX' => $delegation1->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
factory(AppDelay::class, 5)->create([
'APP_DELEGATION_USER' => $user->USR_UID,
'PRO_UID' => $process2->PRO_UID,
'APP_NUMBER' => $delegation2->APP_NUMBER,
'APP_DEL_INDEX' => $delegation2->DEL_INDEX,
'APP_DISABLE_ACTION_USER' => 0,
'APP_TYPE' => 'PAUSE'
]);
$metrics = new Metrics();
$res = $metrics->getCasesRiskByProcess('paused', $delegation1->PRO_ID, null, null, 'AT_RISK');
$this->assertNotEmpty($res);
}
/**
* Tests the getCasesRiskByProcess method with unassigned
*
* @test
*/
public function it_tests_get_cases_risk_by_process_unassigned()
{
$user = factory(\ProcessMaker\Model\User::class)->create();
$process = factory(Process::class)->create();
$application = factory(ApplicationModel::class)->create([
'APP_STATUS_ID' => 2
]);
$task = factory(Task::class)->create([
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE',
'TAS_GROUP_VARIABLE' => '',
'PRO_UID' => $process->PRO_UID,
'PRO_ID' => $process->PRO_ID,
]);
factory(TaskUser::class)->create([
'TAS_UID' => $task->TAS_UID,
'USR_UID' => $user->USR_UID,
'TU_RELATION' => 1,
'TU_TYPE' => 1
]);
$delegation = factory(Delegation::class)->create([
'APP_NUMBER' => $application->APP_NUMBER,
'TAS_ID' => $task->TAS_ID,
'PRO_ID' => $process->PRO_ID,
'DEL_THREAD_STATUS' => 'OPEN',
'USR_ID' => 0,
'DEL_DELEGATE_DATE' => date('Y-m-d H:i:s', strtotime("-1 year")),
'DEL_RISK_DATE' => date('Y-m-d H:i:s'),
'DEL_TASK_DUE_DATE' => date('Y-m-d H:i:s', strtotime("+1 hour"))
]);
unset($RBAC);
$metrics = new Metrics();
$res = $metrics->getCasesRiskByProcess('unassigned', $delegation->PRO_ID, null, null, 'AT_RISK');
$this->assertNotEmpty($res);
}
/**
* Tests the getProcessTotalCases method with exception
*
* @test
*/
public function it_tests_get_process_total_cases_exception()
{
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
]);
$metrics = new Metrics();
$this->expectExceptionMessage("Undefined variable: list");
$metrics->getProcessTotalCases(12, 123, "asda");
}
/**
* Tests the getTotalCasesByRange method with exception
*
* @test
*/
public function it_tests_get_total_cases_by_range_exception()
{
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
]);
$metrics = new Metrics();
$this->expectExceptionMessage("Undefined variable: list");
$metrics->getTotalCasesByRange(12, 123, "asda");
}
/**
* Tests the getCasesRiskByProcess method with exception
*
* @test
*/
public function it_tests_get_counters_list_exception()
{
factory(Delegation::class)->states('foreign_keys')->create([
'DEL_THREAD_STATUS' => 'OPEN',
'DEL_PREVIOUS' => 1,
'DEL_INDEX' => 2,
]);
$metrics = new Metrics();
$this->expectExceptionMessage("Undefined variable: list");
$metrics->getCasesRiskByProcess(12, 123, "asda");
}
} }

View File

@@ -3401,8 +3401,11 @@ class Cases
$lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType); $lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$usrUid = empty($_SESSION['USER_LOGGED']) ? '' : $_SESSION['USER_LOGGED'];
ChangeLog::getChangeLog() ChangeLog::getChangeLog()
->setObjectUid($stepUidObj) ->setObjectUid($stepUidObj)
->getUsrIdByUsrUid($usrUid, true)
->getTasIdByTasUid($tasUid, true)
->getExecutedAtIdByTriggerType($triggerType); ->getExecutedAtIdByTriggerType($triggerType);
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
@@ -7223,7 +7226,14 @@ class Cases
} }
} }
public function unserializeData($data) /**
* Unserialize the case data
*
* @param string $data
*
* @return array
*/
public static function unserializeData($data)
{ {
$unserializedData = @unserialize($data); $unserializedData = @unserialize($data);

View File

@@ -374,7 +374,8 @@ class WorkspaceTools
$start = microtime(true); $start = microtime(true);
Bootstrap::setConstantsRelatedWs($workspace); Bootstrap::setConstantsRelatedWs($workspace);
Propel::init(PATH_CONFIG . 'databases.php'); Propel::init(PATH_CONFIG . 'databases.php');
WebEntry::convertFromV1ToV2(); $statement = Propel::getConnection('workflow')->createStatement();
$statement->executeQuery(WebEntry::UPDATE_QUERY_V1_TO_V2);
CLI::logging("* End converting Web Entries v1.0 to v2.0 for BPMN processes...(" . (microtime(true) - $start) . " seconds)\n"); CLI::logging("* End converting Web Entries v1.0 to v2.0 for BPMN processes...(" . (microtime(true) - $start) . " seconds)\n");
CLI::logging("* Start migrating case title...\n"); CLI::logging("* Start migrating case title...\n");

View File

@@ -4,6 +4,8 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use ProcessMaker\BusinessModel\Cases as BusinessModelCases; use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
use ProcessMaker\Core\System; use ProcessMaker\Core\System;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\GroupUser; use ProcessMaker\Model\GroupUser;
use ProcessMaker\Model\Groupwf; use ProcessMaker\Model\Groupwf;
use ProcessMaker\Model\RbacRoles; use ProcessMaker\Model\RbacRoles;
@@ -2491,9 +2493,6 @@ function PMFgetLabelOption ($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTE
} }
/** /**
*
* @method
*
* Redirects a case to any step in the current task. In order for the step to * Redirects a case to any step in the current task. In order for the step to
* be executed, the specified step much exist and if it contains a condition, * be executed, the specified step much exist and if it contains a condition,
* it must evaluate to true. * it must evaluate to true.
@@ -2502,79 +2501,76 @@ function PMFgetLabelOption ($PROCESS, $DYNAFORM_UID, $FIELD_NAME, $FIELD_SELECTE
* @label PMF Redirect To Step * @label PMF Redirect To Step
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRedirectToStep.28.29 * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRedirectToStep.28.29
* *
* @param string(32) | $sApplicationUID | Case ID | The unique ID for a case, * @param string(32) | $appUid | Case ID | The unique ID for a case,
* @param int | $iDelegation | Delegation index | The delegation index of a case. * @param int | $index | Delegation index | The delegation index of a case.
* @param string(32) | $sStepType | Type of Step | The type of step, which can be "DYNAFORM", "INPUT_DOCUMENT" or "OUTPUT_DOCUMENT". * @param string(32) | $stepType | Type of Step | The type of step, which can be "DYNAFORM", "INPUT_DOCUMENT" or "OUTPUT_DOCUMENT".
* @param string(32) | $sStepUid | Step ID | The unique ID for the step. * @param string(32) | $stepUid | Step ID | The unique ID for the step.
* @return none | $none | None | None * @return none | $none | None | None
* *
*/ */
function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid) function PMFRedirectToStep($appUid, $index, $stepType, $stepUid)
{ {
// Set initial values
$index = intval($index);
$sessionCase = $_SESSION["APPLICATION"];
// Save the session variables
$g = new G(); $g = new G();
$g->sessionVarSave(); $g->sessionVarSave();
$_SESSION["APPLICATION"] = $appUid;
$iDelegation = intval($iDelegation); $_SESSION["INDEX"] = $index;
// Get the caseNumber
$_SESSION["APPLICATION"] = $sApplicationUID; $appNumber = Application::getCaseNumber($appUid);
$_SESSION["INDEX"] = $iDelegation; // Get thread information
$thread = Delegation::getThreadInfo($appNumber, $index);
require_once 'classes/model/AppDelegation.php'; // Review if exist a thread
$oCriteria = new Criteria('workflow'); if (!empty($thread)) {
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID); global $oPMScript;
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID); // Load the data
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelegation); $case = new Cases();
$oDataset = AppDelegationPeer::doSelectRS($oCriteria); // Get the step information
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $step = new Step();
$oDataset->next(); $theStep = $step->loadByType($thread['TAS_UID'], $stepType, $stepUid);
global $oPMScript; // Save data if the case fields loaded in the $oPMScript is related to the same case in execution
$aRow = $oDataset->getRow(); if ($sessionCase === $appUid && !is_null($oPMScript)) {
if ($aRow) { $fields = [];
require_once 'classes/model/Step.php'; $fields['APP_DATA'] = $oPMScript->aFields;
$oStep = new Step(); unset($fields['APP_STATUS']);
$oTheStep = $oStep->loadByType($aRow['TAS_UID'], $sStepType, $sStepUid); unset($fields['APP_PROC_STATUS']);
$bContinue = true; unset($fields['APP_PROC_CODE']);
$oCase = new Cases(); unset($fields['APP_PIN']);
$aFields = $oCase->loadCase($sApplicationUID); $case->updateCase($appUid, $fields);
if ($oTheStep->getStepCondition() != '') {
$pmScript = new PMScript();
$pmScript->setFields($aFields['APP_DATA']);
$pmScript->setScript($oTheStep->getStepCondition());
$pmScript->setExecutedOn(PMScript::CONDITION);
$bContinue = $pmScript->evaluate();
} }
if ($bContinue) { $fields = $case->loadCase($appUid);
switch ($oTheStep->getStepTypeObj()) { // Review the step condition
$continue = true;
if (!empty($theStep->getStepCondition())) {
$pmScript = new PMScript();
$pmScript->setFields($fields['APP_DATA']);
$pmScript->setScript($theStep->getStepCondition());
$pmScript->setExecutedOn(PMScript::CONDITION);
$continue = $pmScript->evaluate();
}
if ($continue) {
switch ($theStep->getStepTypeObj()) {
case 'DYNAFORM': case 'DYNAFORM':
$sAction = 'EDIT'; $action = 'EDIT';
break; break;
case 'OUTPUT_DOCUMENT': case 'OUTPUT_DOCUMENT':
$sAction = 'GENERATE'; $action = 'GENERATE';
break; break;
case 'INPUT_DOCUMENT': case 'INPUT_DOCUMENT':
$sAction = 'ATTACH'; $action = 'ATTACH';
break; break;
case 'EXTERNAL': case 'EXTERNAL':
$sAction = 'EDIT'; $action = 'EDIT';
break; break;
case 'MESSAGE': case 'MESSAGE':
$sAction = ''; $action = '';
break; break;
} }
// save data
if (!is_null($oPMScript)) {
$aFields['APP_DATA'] = $oPMScript->aFields;
unset($aFields['APP_STATUS']);
unset($aFields['APP_PROC_STATUS']);
unset($aFields['APP_PROC_CODE']);
unset($aFields['APP_PIN']);
$oCase->updateCase($sApplicationUID, $aFields);
}
$g->sessionVarRestore(); $g->sessionVarRestore();
G::header('Location: ' . 'cases_Step?TYPE=' . $stepType . '&UID=' . $stepUid . '&POSITION=' . $theStep->getStepPosition() . '&ACTION=' . $action);
G::header('Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction);
die(); die();
} }
} }
@@ -4214,6 +4210,53 @@ function PMFNewUser(
return $response; return $response;
} }
/**
*
* @method
*
* Load the case information
*
* @name PMFCaseInformation
* @label PMF Case Information
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseInformation.28.29
*
* @param string(32) | $caseUid | Case ID | The case unique identifier, that is string of 32 hexadecimal characters.
* @param int | $delIndex = 0 | Delegation index of the case | The delegation index of the case thread task to get information (optional).
* @param int | $returnAppData = 0 | Include Application Data | Set as TRUE to get all the case data (optional).
*
* @return array | $response | Response
* @throws Exception
*/
function PMFCaseInformation($caseUid, $delIndex = 0, $returnAppData = false)
{
if (empty($caseUid)) {
throw new Exception(G::LoadTranslation("ID_REQUIRED_FIELD") . " caseUid");
}
$case = new Cases();
$result = $case->loadCase($caseUid, $delIndex);
// Clean the APPLICATION's columns deprecated or without functionallity
unset($result['APP_TITLE']);
unset($result['APP_PARENT']);
unset($result['APP_PROC_STATUS']);
unset($result['APP_PROC_CODE']);
unset($result['APP_PARALLEL']);
unset($result['APP_PIN']);
unset($result['APP_DURATION']);
unset($result['APP_DELAY_DURATION']);
unset($result['APP_DRIVE_FOLDER_UID']);
unset($result['APP_ROUTING_DATA']);
// Only if this parameter is true we will to return this value
if (!$returnAppData) {
unset($result['APP_DATA']);
}
// Clean the additional columns deprecated or without functionallity
unset($result['TITLE']);
unset($result['DESCRIPTION']);
unset($result['DESCRIPTION']);
return $result;
}
//Start - Private functions //Start - Private functions

View File

@@ -198,6 +198,9 @@ class Users extends BaseUsers
if (empty($aFields['USR_DEFAULT_LANG'])) { if (empty($aFields['USR_DEFAULT_LANG'])) {
$aFields['USR_DEFAULT_LANG'] = 'en'; $aFields['USR_DEFAULT_LANG'] = 'en';
} }
//sometimes the USR_DEFAULT_LANG value is made up, it is formatted in order to find the value.
$explode = explode('-', $aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG'] = strtolower($explode[0]);
$translations = new Language(); $translations = new Language();
$translation = $translations->loadByCode($aFields['USR_DEFAULT_LANG']); $translation = $translations->loadByCode($aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG_NAME'] = $translation['LANGUAGE_NAME']; $aFields['USR_DEFAULT_LANG_NAME'] = $translation['LANGUAGE_NAME'];

View File

@@ -90,7 +90,7 @@ class Zimbra
{ {
if ($this->_username) { if ($this->_username) {
if (PHP_VERSION < 5.2) { if (PHP_VERSION < 5.2) {
setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu"); setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", "; HttpOnly");
} else { } else {
setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", false, true); setcookie("ZM_SKIN", "plymouth", time() + (60 * 60 * 24 * 30), "/", ".plymouth.edu", false, true);
} }

File diff suppressed because one or more lines are too long

View File

@@ -4403,6 +4403,12 @@ msgstr "The category name with {0}: \"{1}\" already exists."
msgid "The category with {0}: '{1}' does not exist." msgid "The category with {0}: '{1}' does not exist."
msgstr "The category with {0}: '{1}' does not exist." msgstr "The category with {0}: '{1}' does not exist."
# TRANSLATION
# LABEL/ID_CATEGORY_PROCESS
#: LABEL/ID_CATEGORY_PROCESS
msgid "Process Category"
msgstr "Process Category"
# TRANSLATION # TRANSLATION
# LABEL/ID_CATEGORY_SUCCESS_DELETE # LABEL/ID_CATEGORY_SUCCESS_DELETE
#: LABEL/ID_CATEGORY_SUCCESS_DELETE #: LABEL/ID_CATEGORY_SUCCESS_DELETE
@@ -6095,6 +6101,12 @@ msgstr "Delay Field"
msgid "Delayed" msgid "Delayed"
msgstr "Delayed" msgstr "Delayed"
# TRANSLATION
# LABEL/ID_DELEGATED
#: LABEL/ID_DELEGATED
msgid "Delegated"
msgstr "Delegated"
# TRANSLATION # TRANSLATION
# LABEL/ID_DELEGATE_DATE_FROM # LABEL/ID_DELEGATE_DATE_FROM
#: LABEL/ID_DELEGATE_DATE_FROM #: LABEL/ID_DELEGATE_DATE_FROM
@@ -7013,6 +7025,18 @@ msgstr "Down"
msgid "Download" msgid "Download"
msgstr "Download" msgstr "Download"
# TRANSLATION
# LABEL/ID_DOWNLOAD_SVG
#: LABEL/ID_DOWNLOAD_SVG
msgid "Download SVG"
msgstr "Download SVG"
# TRANSLATION
# LABEL/ID_DOWNLOAD_PNG
#: LABEL/ID_DOWNLOAD_PNG
msgid "Download PNG"
msgstr "Download PNG"
# TRANSLATION # TRANSLATION
# LABEL/ID_DOWNLOADING_FILE # LABEL/ID_DOWNLOADING_FILE
#: LABEL/ID_DOWNLOADING_FILE #: LABEL/ID_DOWNLOADING_FILE
@@ -19169,12 +19193,6 @@ msgstr "Cookie Lifetime (Seconds)"
msgid "The maximun limit of columns for a database table is 255, you already have them defined!" msgid "The maximun limit of columns for a database table is 255, you already have them defined!"
msgstr "The maximun limit of columns for a database table is 255, you already have them defined!" msgstr "The maximun limit of columns for a database table is 255, you already have them defined!"
# TRANSLATION
# LABEL/ID_MCRYPT_SUPPORT
#: LABEL/ID_MCRYPT_SUPPORT
msgid "Mcrypt Support"
msgstr "Mcrypt Support"
# TRANSLATION # TRANSLATION
# LABEL/ID_MEDIA # LABEL/ID_MEDIA
#: LABEL/ID_MEDIA #: LABEL/ID_MEDIA
@@ -19211,6 +19229,12 @@ msgstr "Memory Limit (MB)"
msgid "Memory Limit value has to be either a positive integer or -1" msgid "Memory Limit value has to be either a positive integer or -1"
msgstr "Memory Limit value has to be either a positive integer or -1" msgstr "Memory Limit value has to be either a positive integer or -1"
# TRANSLATION
# LABEL/ID_MENU
#: LABEL/ID_MENU
msgid "Menu"
msgstr "Menu"
# TRANSLATION # TRANSLATION
# LABEL/ID_MENU_COLOR # LABEL/ID_MENU_COLOR
#: LABEL/ID_MENU_COLOR #: LABEL/ID_MENU_COLOR
@@ -21299,6 +21323,12 @@ msgstr "Page"
msgid "Page Size" msgid "Page Size"
msgstr "Page Size" msgstr "Page Size"
# TRANSLATION
# LABEL/ID_PANNING
#: LABEL/ID_PANNING
msgid "Panning"
msgstr "Panning"
# TRANSLATION # TRANSLATION
# LABEL/ID_PARALLEL_TASK # LABEL/ID_PARALLEL_TASK
#: LABEL/ID_PARALLEL_TASK #: LABEL/ID_PARALLEL_TASK
@@ -24383,6 +24413,12 @@ msgstr "Screen Color Icon"
msgid "Script Task" msgid "Script Task"
msgstr "Script Task" msgstr "Script Task"
# TRANSLATION
# LABEL/ID_SCRIPT_TASK_UNTITLED
#: LABEL/ID_SCRIPT_TASK_UNTITLED
msgid "Untitled - Script Task"
msgstr "Untitled - Script Task"
# TRANSLATION # TRANSLATION
# LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED # LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
#: LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED #: LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
@@ -24581,6 +24617,12 @@ msgstr "See complete list"
msgid "Select" msgid "Select"
msgstr "Select" msgstr "Select"
# TRANSLATION
# LABEL/ID_SELECTION_ZOOM
#: LABEL/ID_SELECTION_ZOOM
msgid "Selection zoom"
msgstr "Selection zoom"
# TRANSLATION # TRANSLATION
# LABEL/ID_SELECTED # LABEL/ID_SELECTED
#: LABEL/ID_SELECTED #: LABEL/ID_SELECTED
@@ -24965,6 +25007,18 @@ msgstr "Server reported"
msgid "Service" msgid "Service"
msgstr "Service" msgstr "Service"
# TRANSLATION
# LABEL/ID_SERVICE_TASK
#: LABEL/ID_SERVICE_TASK
msgid "Service Task"
msgstr "Service Task"
# TRANSLATION
# LABEL/ID_SERVICE_TASK_UNTITLED
#: LABEL/ID_SERVICE_TASKUNTITLED
msgid "Untitled - Service Task"
msgstr "Untitled - Service Task"
# TRANSLATION # TRANSLATION
# LABEL/ID_SESSION # LABEL/ID_SESSION
#: LABEL/ID_SESSION #: LABEL/ID_SESSION
@@ -26183,6 +26237,12 @@ msgstr "Task in Progress"
msgid "Task Name" msgid "Task Name"
msgstr "Task Name" msgstr "Task Name"
# TRANSLATION
# LABEL/ID_TASK_METRICS
#: LABEL/ID_TASK_METRICS
msgid "Task metrics"
msgstr "Task metrics"
# TRANSLATION # TRANSLATION
# LABEL/ID_TASK_NOT_EXIST # LABEL/ID_TASK_NOT_EXIST
#: LABEL/ID_TASK_NOT_EXIST #: LABEL/ID_TASK_NOT_EXIST
@@ -26213,6 +26273,30 @@ msgstr "The task doesn't have any steps"
msgid "Overdue" msgid "Overdue"
msgstr "Overdue" msgstr "Overdue"
# TRANSLATION
# LABEL/ID_TASK_OVERDUE_DAYS
#: LABEL/ID_TASK_OVERDUE_DAYS
msgid "Overdue days"
msgstr "Overdue days"
# TRANSLATION
# LABEL/ID_TASK_DAYS_BEFORE_AT_RISK
#: LABEL/ID_TASK_DAYS_BEFORE_AT_RISK
msgid "Days before being At-Risk"
msgstr "Days before being At-Risk"
# TRANSLATION
# LABEL/ID_TASK_DAYS_BEFORE_OVERDUE
#: LABEL/ID_TASK_DAYS_BEFORE_OVERDUE
msgid "Days before being Overdue"
msgstr "Days before being Overdue"
# TRANSLATION
# LABEL/ID_TASK_ON_TIME
#: LABEL/ID_TASK_ON_TIME
msgid "On time"
msgstr "On time"
# TRANSLATION # TRANSLATION
# LABEL/ID_TASK_PROPERTIES_SAVE # LABEL/ID_TASK_PROPERTIES_SAVE
#: LABEL/ID_TASK_PROPERTIES_SAVE #: LABEL/ID_TASK_PROPERTIES_SAVE
@@ -29033,6 +29117,18 @@ msgstr "You uploaded an unsupported file extension, please review the permitted
msgid "Zip Code" msgid "Zip Code"
msgstr "Zip Code" msgstr "Zip Code"
# TRANSLATION
# LABEL/ID_ZOOM_IN
#: LABEL/ID_ZOOM_IN
msgid "Zoom in"
msgstr "Zoom in"
# TRANSLATION
# LABEL/ID_ZOOM_OUT
#: LABEL/ID_ZOOM_OUT
msgid "Zoom out"
msgstr "Zoom out"
# TRANSLATION # TRANSLATION
# LABEL/IMAGE_DETAIL # LABEL/IMAGE_DETAIL
#: LABEL/IMAGE_DETAIL #: LABEL/IMAGE_DETAIL
@@ -53317,4 +53413,10 @@ msgstr "Sorry, No Solid icons found!"
# LABEL/ID_SELECT_PROCESS_DRILL # LABEL/ID_SELECT_PROCESS_DRILL
#: LABEL/ID_SELECT_PROCESS_DRILL #: LABEL/ID_SELECT_PROCESS_DRILL
msgid "Select a process to have the Drilling Down Options" msgid "Select a process to have the Drilling Down Options"
msgstr "Select a process to have the Drilling Down Options" msgstr "Select a process to have the Drilling Down Options"
# TRANSLATION
# LABEL/ID_TASK_METRICS
#: LABEL/ID_TASK_METRICS
msgid "Task metrics"
msgstr "Task metrics"

View File

@@ -203,7 +203,6 @@ class InstallerModule extends Controller
$info->multibyte = new stdclass(); $info->multibyte = new stdclass();
$info->soap = new stdclass(); $info->soap = new stdclass();
$info->ldap = new stdclass(); $info->ldap = new stdclass();
$info->mcrypt = new stdclass();
$info->memory = new stdclass(); $info->memory = new stdclass();
$info->php->version = $phpVer; $info->php->version = $phpVer;
@@ -272,10 +271,6 @@ class InstallerModule extends Controller
$info->soap->version = G::LoadTranslation('ID_ENABLED'); $info->soap->version = G::LoadTranslation('ID_ENABLED');
} }
//mcrypt info
$info->mcrypt->result = extension_loaded('mcrypt');
$info->mcrypt->version = $info->mcrypt->result ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_NOT_ENABLED');
// ldap info // ldap info
$info->ldap->result = false; $info->ldap->result = false;
$info->ldap->version = G::LoadTranslation('ID_NOT_ENABLED'); $info->ldap->version = G::LoadTranslation('ID_NOT_ENABLED');

View File

@@ -393,6 +393,11 @@ class AppProxy extends HttpProxyController
'label' => G::LoadTranslation('ID_PROCESS_NAME') . ': ', 'label' => G::LoadTranslation('ID_PROCESS_NAME') . ': ',
'value' => $processInfo['PRO_TITLE'], 'value' => $processInfo['PRO_TITLE'],
], ],
$i++ => [ // Process Category
'id' => 'CATEGORY',
'label' => G::LoadTranslation('ID_CATEGORY_PROCESS') . ': ',
'value' => $processInfo['PRO_CATEGORY_LABEL'],
],
$i++ => [ // Process description $i++ => [ // Process description
'id' => 'PRO_DESCRIPTION', 'id' => 'PRO_DESCRIPTION',
'label' => G::LoadTranslation('ID_PRO_DESCRIPTION') . ': ', 'label' => G::LoadTranslation('ID_PRO_DESCRIPTION') . ': ',

View File

@@ -57548,6 +57548,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CATEGORY_NAME','en','Category Name','2014-01-15') , ( 'LABEL','ID_CATEGORY_NAME','en','Category Name','2014-01-15') ,
( 'LABEL','ID_CATEGORY_NAME_ALREADY_EXISTS','en','The category name with {0}: "{1}" already exists.','2014-06-12') , ( 'LABEL','ID_CATEGORY_NAME_ALREADY_EXISTS','en','The category name with {0}: "{1}" already exists.','2014-06-12') ,
( 'LABEL','ID_CATEGORY_NOT_EXIST','en','The category with {0}: ''{1}'' does not exist.','2014-05-29') , ( 'LABEL','ID_CATEGORY_NOT_EXIST','en','The category with {0}: ''{1}'' does not exist.','2014-05-29') ,
( 'LABEL','ID_CATEGORY_PROCESS','en','Process Category','2021-11-25') ,
( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_NEW','en','Process category has been created correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_NEW','en','Process category has been created correctly.','2014-01-15') ,
( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') ,
@@ -57843,6 +57844,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DEFINITION','en','Definition','2014-01-15') , ( 'LABEL','ID_DEFINITION','en','Definition','2014-01-15') ,
( 'LABEL','ID_DELAY_FIELD','en','Delay Field','2014-01-15') , ( 'LABEL','ID_DELAY_FIELD','en','Delay Field','2014-01-15') ,
( 'LABEL','ID_DELAYED','en','Delayed','2021-01-20') , ( 'LABEL','ID_DELAYED','en','Delayed','2021-01-20') ,
( 'LABEL','ID_DELEGATED','en','Delegated','2022-01-12') ,
( 'LABEL','ID_DELEGATE_DATE_FROM','en','Date from','2017-10-18') , ( 'LABEL','ID_DELEGATE_DATE_FROM','en','Date from','2017-10-18') ,
( 'LABEL','ID_DELEGATE_DATE_TO','en','to','2014-01-15') , ( 'LABEL','ID_DELEGATE_DATE_TO','en','to','2014-01-15') ,
( 'LABEL','ID_DELEGATE_USER','en','Delegated User','2014-01-15') , ( 'LABEL','ID_DELEGATE_USER','en','Delegated User','2014-01-15') ,
@@ -58000,6 +58002,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DONT_MODIFY_PK_VALUE','en','You can not modify the primary key value for "{0}" field.','2014-01-15') , ( 'LABEL','ID_DONT_MODIFY_PK_VALUE','en','You can not modify the primary key value for "{0}" field.','2014-01-15') ,
( 'LABEL','ID_DOWN','en','Down','2014-01-15') , ( 'LABEL','ID_DOWN','en','Down','2014-01-15') ,
( 'LABEL','ID_DOWNLOAD','en','Download','2014-01-15') , ( 'LABEL','ID_DOWNLOAD','en','Download','2014-01-15') ,
( 'LABEL','ID_DOWNLOAD_SVG','en','Download SVG','2022-01-07') ,
( 'LABEL','ID_DOWNLOAD_PNG','en','Download PNG','2022-01-07') ,
( 'LABEL','ID_DOWNLOADING_FILE','en','Downloading file','2014-01-15') , ( 'LABEL','ID_DOWNLOADING_FILE','en','Downloading file','2014-01-15') ,
( 'LABEL','ID_DOWNLOADING_UPGRADE','en','Downloading upgrade:','2014-09-18') , ( 'LABEL','ID_DOWNLOADING_UPGRADE','en','Downloading upgrade:','2014-09-18') ,
( 'LABEL','ID_DOWNLOAD_MANUALLY','en','You can download it manually here','2014-09-18') , ( 'LABEL','ID_DOWNLOAD_MANUALLY','en','You can download it manually here','2014-09-18') ,
@@ -60090,13 +60094,13 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_MAX_INDICATOR_DASHBOARD','en','Maximum number of Indicators','2015-03-31') , ( 'LABEL','ID_MAX_INDICATOR_DASHBOARD','en','Maximum number of Indicators','2015-03-31') ,
( 'LABEL','ID_MAX_LIFETIME','en','Cookie Lifetime (Seconds)','2017-02-21') , ( 'LABEL','ID_MAX_LIFETIME','en','Cookie Lifetime (Seconds)','2017-02-21') ,
( 'LABEL','ID_MAX_LIMIT_COLUMNS_FOR_DATABASE','en','The maximun limit of columns for a database table is 255, you already have them defined!','2014-01-15') , ( 'LABEL','ID_MAX_LIMIT_COLUMNS_FOR_DATABASE','en','The maximun limit of columns for a database table is 255, you already have them defined!','2014-01-15') ,
( 'LABEL','ID_MCRYPT_SUPPORT','en','Mcrypt Support','2014-10-17') ,
( 'LABEL','ID_MEDIA','en','Media','2014-01-15') , ( 'LABEL','ID_MEDIA','en','Media','2014-01-15') ,
( 'LABEL','ID_MEMBER','en','Member','2014-01-15') , ( 'LABEL','ID_MEMBER','en','Member','2014-01-15') ,
( 'LABEL','ID_MEMBERS','en','Members','2014-01-15') , ( 'LABEL','ID_MEMBERS','en','Members','2014-01-15') ,
( 'LABEL','ID_MEMBER_OF','en','MEMBER OF','2014-01-15') , ( 'LABEL','ID_MEMBER_OF','en','MEMBER OF','2014-01-15') ,
( 'LABEL','ID_MEMORY_LIMIT','en','Memory Limit (MB)','2014-01-15') , ( 'LABEL','ID_MEMORY_LIMIT','en','Memory Limit (MB)','2014-01-15') ,
( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') , ( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') ,
( 'LABEL','ID_MENU','en','Menu','2022-01-07') ,
( 'LABEL','ID_MENU_COLOR','en','Menu Color','2021-08-10') , ( 'LABEL','ID_MENU_COLOR','en','Menu Color','2021-08-10') ,
( 'LABEL','ID_MENU_NAME','en','Enterprise Manager','2014-10-17') , ( 'LABEL','ID_MENU_NAME','en','Enterprise Manager','2014-10-17') ,
( 'LABEL','ID_MESSAGE','en','Message','2014-01-15') , ( 'LABEL','ID_MESSAGE','en','Message','2014-01-15') ,
@@ -60457,6 +60461,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_OWNER_TYPE','en','Owner type','2015-05-08') , ( 'LABEL','ID_OWNER_TYPE','en','Owner type','2015-05-08') ,
( 'LABEL','ID_PAGE','en','Page','2014-01-15') , ( 'LABEL','ID_PAGE','en','Page','2014-01-15') ,
( 'LABEL','ID_PAGE_SIZE','en','Page Size','2014-01-15') , ( 'LABEL','ID_PAGE_SIZE','en','Page Size','2014-01-15') ,
( 'LABEL','ID_PANNING','en','Panning','2022-01-07') ,
( 'LABEL','ID_PARALLEL_TASK','en','Parallel Task','2014-01-15') , ( 'LABEL','ID_PARALLEL_TASK','en','Parallel Task','2014-01-15') ,
( 'LABEL','ID_PARAMETERS','en','Parameters','2014-01-15') , ( 'LABEL','ID_PARAMETERS','en','Parameters','2014-01-15') ,
( 'LABEL','ID_PARENT_DEPARTMENT_NOT_EXIST','en','Parent department doesn''t exist','2014-01-15') , ( 'LABEL','ID_PARENT_DEPARTMENT_NOT_EXIST','en','Parent department doesn''t exist','2014-01-15') ,
@@ -60988,6 +60993,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SCHEMA','en','Schema','2014-01-15') , ( 'LABEL','ID_SCHEMA','en','Schema','2014-01-15') ,
( 'LABEL','ID_SCREEN_COLOR_ICON','en','Screen Color Icon','2021-08-10') , ( 'LABEL','ID_SCREEN_COLOR_ICON','en','Screen Color Icon','2021-08-10') ,
( 'LABEL','ID_SCRIPT_TASK','en','Script Task','2015-10-19') , ( 'LABEL','ID_SCRIPT_TASK','en','Script Task','2015-10-19') ,
( 'LABEL','ID_SCRIPT_TASK_UNTITLED','en','Untitled - Script Task','2021-11-23') ,
( 'LABEL','ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED','en','The Script-Task with {0}: "{1}" already registered','2016-08-01') , ( 'LABEL','ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED','en','The Script-Task with {0}: "{1}" already registered','2016-08-01') ,
( 'LABEL','ID_SEARCH','en','Search','2014-01-15') , ( 'LABEL','ID_SEARCH','en','Search','2014-01-15') ,
( 'LABEL','ID_SEARCHING','en','Searching...','2019-05-03') , ( 'LABEL','ID_SEARCHING','en','Searching...','2019-05-03') ,
@@ -61022,6 +61028,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SEE','en','See','2014-01-15') , ( 'LABEL','ID_SEE','en','See','2014-01-15') ,
( 'LABEL','ID_SEE_FULL_LIST','en','See complete list','2016-02-29') , ( 'LABEL','ID_SEE_FULL_LIST','en','See complete list','2016-02-29') ,
( 'LABEL','ID_SELECT','en','Select','2014-01-15') , ( 'LABEL','ID_SELECT','en','Select','2014-01-15') ,
( 'LABEL','ID_SELECTION_ZOOM','en','Selection zoom','2022-01-07') ,
( 'LABEL','ID_SELECTED','en','selected','2014-01-15') , ( 'LABEL','ID_SELECTED','en','selected','2014-01-15') ,
( 'LABEL','ID_SELECTED_FIELD','en','selected field','2014-01-15') , ( 'LABEL','ID_SELECTED_FIELD','en','selected field','2014-01-15') ,
( 'LABEL','ID_SELECTED_IMAGE_DELETED','en','The selected image has been deleted.','2014-01-15') , ( 'LABEL','ID_SELECTED_IMAGE_DELETED','en','The selected image has been deleted.','2014-01-15') ,
@@ -61090,6 +61097,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SERVER_PROTOCOL','en','Server Protocol','2014-01-15') , ( 'LABEL','ID_SERVER_PROTOCOL','en','Server Protocol','2014-01-15') ,
( 'LABEL','ID_SERVER_REPORTED','en','Server reported','2014-01-15') , ( 'LABEL','ID_SERVER_REPORTED','en','Server reported','2014-01-15') ,
( 'LABEL','ID_SERVICE','en','Service','2014-01-15') , ( 'LABEL','ID_SERVICE','en','Service','2014-01-15') ,
( 'LABEL','ID_SERVICE_TASK','en','Service','2021-11-23') ,
( 'LABEL','ID_SERVICE_TASK_UNTITLED','en','Service','2021-11-23') ,
( 'LABEL','ID_SESSION','en','Session','2014-01-15') , ( 'LABEL','ID_SESSION','en','Session','2014-01-15') ,
( 'LABEL','ID_SESSION_ACTIVE','en','Session active','2014-01-15') , ( 'LABEL','ID_SESSION_ACTIVE','en','Session active','2014-01-15') ,
( 'LABEL','ID_SESSION_DIRECTORY','en','Session directory','2015-11-05') , ( 'LABEL','ID_SESSION_DIRECTORY','en','Session directory','2015-11-05') ,
@@ -61303,11 +61312,16 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_TASK_IN_PROGRESS','en','Task in Progress','2014-01-15') , ( 'LABEL','ID_TASK_IN_PROGRESS','en','Task in Progress','2014-01-15') ,
( 'LABEL','ID_TASK_NAME','en','Task Name','2020-12-16') , ( 'LABEL','ID_TASK_NAME','en','Task Name','2020-12-16') ,
( 'LABEL','ID_TASK_METRICS','en','Task metrics','2022-01-05') ,
( 'LABEL','ID_TASK_NOT_EXIST','en','The task with {0}: ''{1}'' does not exist.','2014-05-29') , ( 'LABEL','ID_TASK_NOT_EXIST','en','The task with {0}: ''{1}'' does not exist.','2014-05-29') ,
( 'LABEL','ID_TASK_NOT_FOUND','en','Task not found for id: {0}','2014-05-21') , ( 'LABEL','ID_TASK_NOT_FOUND','en','Task not found for id: {0}','2014-05-21') ,
( 'LABEL','ID_TASK_NOT_RELATED','en','[Not related to a task]','2014-01-15') , ( 'LABEL','ID_TASK_NOT_RELATED','en','[Not related to a task]','2014-01-15') ,
( 'LABEL','ID_TASK_NO_STEPS','en','The task doesn''t have any steps','2014-01-15') , ( 'LABEL','ID_TASK_NO_STEPS','en','The task doesn''t have any steps','2014-01-15') ,
( 'LABEL','ID_TASK_OVERDUE','en','Overdue','2015-06-09') , ( 'LABEL','ID_TASK_OVERDUE','en','Overdue','2015-06-09') ,
( 'LABEL','ID_TASK_OVERDUE_DAYS','en','Overdue days','2022-01-07') ,
( 'LABEL','ID_TASK_DAYS_BEFORE_AT_RISK','en','Days before being At-Risk','2022-01-07') ,
( 'LABEL','ID_TASK_DAYS_BEFORE_OVERDUE','en','Days before being Overdue','2022-01-07') ,
( 'LABEL','ID_TASK_ON_TIME','en','On time','2022-01-07') ,
( 'LABEL','ID_TASK_PROPERTIES_SAVE','en','Task properties has been saved successfully','2014-01-15') , ( 'LABEL','ID_TASK_PROPERTIES_SAVE','en','Task properties has been saved successfully','2014-01-15') ,
( 'LABEL','ID_TASK_REASSIGNMENTS','en','Task Reassignments','2020-12-07') , ( 'LABEL','ID_TASK_REASSIGNMENTS','en','Task Reassignments','2020-12-07') ,
( 'LABEL','ID_TASK_TITLE','en','Task Title','2020-12-17') , ( 'LABEL','ID_TASK_TITLE','en','Task Title','2020-12-17') ,
@@ -61831,6 +61845,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_YOU_HAVE_ERROR','en','you have an error','2014-01-15') , ( 'LABEL','ID_YOU_HAVE_ERROR','en','you have an error','2014-01-15') ,
( 'LABEL','ID_YOU_UPLOADED_AN_UNSUPPORTED_FILE_EXTENSION','en','You uploaded an unsupported file extension, please review the permitted files uploaded in the wiki of ProcessMaker for the cases notes.','2020-06-12') , ( 'LABEL','ID_YOU_UPLOADED_AN_UNSUPPORTED_FILE_EXTENSION','en','You uploaded an unsupported file extension, please review the permitted files uploaded in the wiki of ProcessMaker for the cases notes.','2020-06-12') ,
( 'LABEL','ID_ZIP_CODE','en','Zip Code','2014-01-15') , ( 'LABEL','ID_ZIP_CODE','en','Zip Code','2014-01-15') ,
( 'LABEL','ID_ZOOM_IN','en','Zoom in','2022-01-07') ,
( 'LABEL','ID_ZOOM_OUT','en','Zoom out','2022-01-07') ,
( 'LABEL','IMAGE_DETAIL','en','Image detail','2014-01-15') , ( 'LABEL','IMAGE_DETAIL','en','Image detail','2014-01-15') ,
( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE','en','The XML forms directory is not writable','2014-01-15') , ( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE','en','The XML forms directory is not writable','2014-01-15') ,
( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE2','en','Some files within XMLFORM directory are not writable, to install or update the translations the system requires that all files are writable. Contact your system administrator please.','2014-01-15') , ( 'LABEL','IMPORT_LANGUAGE_ERR_NO_WRITABLE2','en','Some files within XMLFORM directory are not writable, to install or update the translations the system requires that all files are writable. Contact your system administrator please.','2014-01-15') ,

View File

@@ -26,7 +26,7 @@ $oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields
$userCanAccess = 1; $userCanAccess = 1;
$pmDynaform = new PmDynaform(); $pmDynaform = new PmDynaform();
ScriptVariables::add('SYS_CREDENTIALS', $pmDynaform->getCredentials()); ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd()); ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost()); ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace")); ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));

View File

@@ -78,8 +78,7 @@ if (
// Get the label of previous task // Get the label of previous task
if (!empty($fieldsDelegation['TAS_ID'])) { if (!empty($fieldsDelegation['TAS_ID'])) {
$taskInstance = new ModelTask(); $fieldsCase['PREVIOUS_TASK'] = ModelTask::title($fieldsDelegation['TAS_ID'])['title'];
$fieldsCase['PREVIOUS_TASK'] = $taskInstance->title($fieldsDelegation['TAS_ID']);
} }
// To enable information (dynaforms, steps) before claim a case // To enable information (dynaforms, steps) before claim a case

View File

@@ -10,8 +10,6 @@ use ProcessMaker\Model\User;
$conf = new Configurations(); $conf = new Configurations();
$oHeadPublisher = headPublisher::getSingleton(); $oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript("cases/main", false); //Adding a javascript file .js
$oHeadPublisher->addContent("cases/main"); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"]; $keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = PMmemcached::getSingleton(config("system.workspace")); $memcache = PMmemcached::getSingleton(config("system.workspace"));
@@ -151,7 +149,7 @@ global $translation;
$pmDynaform = new PmDynaform(); $pmDynaform = new PmDynaform();
ScriptVariables::add('defaultOption', $defaultOption); ScriptVariables::add('defaultOption', $defaultOption);
ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS"); ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS");
ScriptVariables::add('SYS_CREDENTIALS', $pmDynaform->getCredentials()); ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd()); ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost()); ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace")); ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
@@ -163,4 +161,4 @@ ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
ScriptVariables::add('userConfig', array( ScriptVariables::add('userConfig', array(
"usr_uid" => $_SESSION['USER_LOGGED'] "usr_uid" => $_SESSION['USER_LOGGED']
)); ));
echo View::make('Views::home.home', compact("userCanAccess"))->render(); G::RenderPage("publish", "viena");

View File

@@ -15,8 +15,9 @@ try {
$urlLogin = (substr(SYS_SKIN, 0, 2) !== 'ux')? 'login' : '../main/login'; $urlLogin = (substr(SYS_SKIN, 0, 2) !== 'ux')? 'login' : '../main/login';
} }
$cookieOptions = Bootstrap::buildCookieOptions(['expires' => time() + (24 * 60 * 60)]);
if (!$RBAC->singleSignOn) { if (!$RBAC->singleSignOn) {
setcookie("singleSignOn", '0', time() + (24 * 60 * 60), '/'); setcookie('singleSignOn', '0', $cookieOptions);
if (!isset($_POST['form']) ) { if (!isset($_POST['form']) ) {
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error'); G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error');
G::header('Location: login'); G::header('Location: login');
@@ -181,7 +182,7 @@ try {
EnterpriseClass::enterpriseSystemUpdate($loginInfo); EnterpriseClass::enterpriseSystemUpdate($loginInfo);
initUserSession($uid, $usr); initUserSession($uid, $usr);
} else { } else {
setcookie("singleSignOn", '1', time() + (24 * 60 * 60), '/'); setcookie('singleSignOn', '1', $cookieOptions);
$uid = $RBAC->userObj->fields['USR_UID']; $uid = $RBAC->userObj->fields['USR_UID'];
$usr = $RBAC->userObj->fields['USR_USERNAME']; $usr = $RBAC->userObj->fields['USR_USERNAME'];
initUserSession($uid, $usr); initUserSession($uid, $usr);
@@ -416,7 +417,7 @@ try {
$configS = System::getSystemConfiguration('', '', config("system.workspace")); $configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true; $activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true;
if ($activeSession){ if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/'); setcookie('PM-TabPrimary', 101010010, $cookieOptions);
} }
// Update the User's last login date // Update the User's last login date

Some files were not shown because too many files have changed in this diff Show More