Merged in release/3.5.0 (pull request #7389)
Release/3.5.0 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
7
Rakefile
Normal file → Executable file
7
Rakefile
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
require 'rubygems'
|
||||
require 'json'
|
||||
|
||||
desc "Default Task - Build Library"
|
||||
task :default => [:required] do
|
||||
Rake::Task['build'].execute
|
||||
@@ -67,6 +68,11 @@ task :build => [:required] do
|
||||
mafeHash = getHash(Dir.pwd + "/vendor/colosa/MichelangeloFE")
|
||||
pmdynaformHash = getHash(Dir.pwd + "/vendor/colosa/pmDynaform")
|
||||
|
||||
puts "Building file: Task Scheduler".cyan
|
||||
system "npm run build --prefix #{Dir.pwd}/vendor/colosa/taskscheduler"
|
||||
system "cp -Rf #{Dir.pwd}/vendor/colosa/taskscheduler/taskscheduler #{targetDir}/taskscheduler"
|
||||
system "cp #{Dir.pwd}/vendor/colosa/taskscheduler/public/index.html #{targetDir}/taskscheduler"
|
||||
|
||||
hashVendors = pmuiHash+"-"+mafeHash
|
||||
## Building minified JS Files
|
||||
puts "Building file: " + "/js/mafe-#{hashVendors}.js".cyan
|
||||
@@ -464,4 +470,3 @@ def getLog
|
||||
output = `git log -30 --pretty='[%cr] %h %d %s <%an>' --no-merges`
|
||||
return output
|
||||
end
|
||||
|
||||
|
||||
99
app/Console/Commands/ScheduleRunCommand.php
Executable file
99
app/Console/Commands/ScheduleRunCommand.php
Executable file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Console\Scheduling\ScheduleRunCommand as BaseCommand;
|
||||
use Maveriks\WebApplication;
|
||||
use ProcessMaker\Model\TaskScheduler;
|
||||
|
||||
class ScheduleRunCommand extends BaseCommand
|
||||
{
|
||||
|
||||
use AddParametersTrait;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(\Illuminate\Console\Scheduling\Schedule $schedule)
|
||||
{
|
||||
$this->startedAt = Carbon::now();
|
||||
$this->signature = "schedule:run";
|
||||
$this->signature .= "
|
||||
{--workspace=workflow : Workspace to use.}
|
||||
{--user=apache : Operating system's user who executes the crons.}
|
||||
{--processmakerPath=./ : ProcessMaker path.}
|
||||
";
|
||||
$this->description .= ' (ProcessMaker has extended this command)';
|
||||
parent::__construct($schedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$that = $this;
|
||||
$workspace = $this->option('workspace');
|
||||
$user = $this->option('user');
|
||||
if (!empty($workspace)) {
|
||||
$webApplication = new WebApplication();
|
||||
$webApplication->setRootDir($this->option('processmakerPath'));
|
||||
$webApplication->loadEnvironment($workspace, false);
|
||||
}
|
||||
TaskScheduler::all()->each(function ($p) use ($that, $user) {
|
||||
if ($p->enable == 1) {
|
||||
$starting = isset($p->startingTime) ? $p->startingTime : "0:00";
|
||||
$ending = isset($p->startingTime) ? $p->endingTime : "23:59";
|
||||
|
||||
$timezone = isset($p->timezone) && $p->timezone != "" ? $p->timezone : date_default_timezone_get();
|
||||
$body = str_replace(" -c"," " . $user . " -c", $p->body);
|
||||
$that->schedule->exec($body)->cron($p->expression)->between($starting, $ending)->timezone($timezone)->when(function () use ($p) {
|
||||
$now = Carbon::now();
|
||||
$result = false;
|
||||
$datework = Carbon::createFromFormat('Y-m-d H:i:s', $p->last_update);
|
||||
if (isset($p->everyOn)) {
|
||||
switch ($p->interval) {
|
||||
case "day":
|
||||
$interval = $now->diffInDays($datework);
|
||||
$result = ($interval !== 0 && ($interval % intval($p->everyOn)) == 0);
|
||||
break;
|
||||
case "week":
|
||||
$diff = $now->diffInDays($datework);
|
||||
if ($diff % (intval($p->everyOn) * 7) < 7 && $diff % (intval($p->everyOn) * 7) >= 0) {
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
break;
|
||||
case "month":
|
||||
$interval = $now->diffInMonths($datework);
|
||||
if ($interval % intval($p->everyOn) == 0) {
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
break;
|
||||
case "year":
|
||||
$interval = $now->diffInYears($datework);
|
||||
if ($interval % intval($p->everyOn) == 0) {
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
});
|
||||
parent::handle();
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,10 @@
|
||||
{
|
||||
"type": "git",
|
||||
"url": "git@bitbucket.org:colosa/pmui.git"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"url": "git@bitbucket.org:colosa/taskscheduler.git"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
@@ -31,9 +35,10 @@
|
||||
"laravel/framework": "5.7.*",
|
||||
"luracast/restler": "^3.0",
|
||||
"bshaffer/oauth2-server-php": "v1.0",
|
||||
"colosa/pmui": "release/3.4.8-dev",
|
||||
"colosa/michelangelofe": "release/3.4.8-dev",
|
||||
"colosa/pmdynaform": "release/3.4.8-dev",
|
||||
"colosa/pmui": "release/3.5.0-dev",
|
||||
"colosa/michelangelofe": "release/3.5.0-dev",
|
||||
"colosa/pmdynaform": "release/3.5.0-dev",
|
||||
"colosa/taskscheduler": "release/1.0.0-dev",
|
||||
"google/apiclient": "1.1.6",
|
||||
"dapphp/securimage": "^3.6",
|
||||
"psr/log": "1.0.0",
|
||||
@@ -54,7 +59,8 @@
|
||||
"league/oauth2-client": "^2.4",
|
||||
"league/oauth2-google": "^3.0",
|
||||
"tecnickcom/tcpdf": "6.3.*",
|
||||
"fzaninotto/faker": "^1.7"
|
||||
"fzaninotto/faker": "^1.7",
|
||||
"predis/predis": "1.1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
|
||||
722
composer.lock
generated
722
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@ return [
|
||||
Laravel\Tinker\TinkerServiceProvider::class,
|
||||
Illuminate\Notifications\NotificationServiceProvider::class,
|
||||
Illuminate\Bus\BusServiceProvider::class,
|
||||
Illuminate\Redis\RedisServiceProvider::class,
|
||||
],
|
||||
|
||||
'aliases' => [
|
||||
|
||||
@@ -76,6 +76,12 @@ return [
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
'cache' => [
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', 6379),
|
||||
'database' => env('REDIS_CACHE_DB', 1),
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
27
database/factories/TaskSchedulerFactory.php
Normal file
27
database/factories/TaskSchedulerFactory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Model factory for a task scheduler
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\TaskScheduler::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => G::generateUniqueID(),
|
||||
'title' => $faker->title,
|
||||
'startingTime' => $faker->dateTime(),
|
||||
'endingTime' => $faker->dateTime(),
|
||||
'everyOn' => "",
|
||||
'interval' => "",
|
||||
'description' => "",
|
||||
'expression' => "",
|
||||
'body' => "",
|
||||
'type' => "",
|
||||
'category' => "emails_notifications", //emails_notifications, case_actions, plugins, processmaker_sync
|
||||
'system' => "",
|
||||
'timezone' => "",
|
||||
'enable' => "",
|
||||
'creation_date' => $faker->dateTime(),
|
||||
'last_update' => $faker->dateTime()
|
||||
];
|
||||
});
|
||||
@@ -615,6 +615,11 @@ class RBAC
|
||||
'PER_UID' => '00000000000000000000000000000068',
|
||||
'PER_CODE' => 'PM_FOLDERS_OWNER',
|
||||
'PER_NAME' => 'View Your Folders'
|
||||
],
|
||||
[
|
||||
'PER_UID' => '00000000000000000000000000000069',
|
||||
'PER_CODE' => 'PM_TASK_SCHEDULER_ADMIN',
|
||||
'PER_NAME' => 'View Task Scheduler'
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
4
rbac/engine/data/mysql/insert.sql
Normal file → Executable file
4
rbac/engine/data/mysql/insert.sql
Normal file → Executable file
@@ -68,6 +68,9 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000067','PM_SETUP_LOG_FILES','2018-02-06 00:00:00','2018-02-06 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000068','PM_FOLDERS_OWNER','2020-01-29 00:00:00','2020-01-29 00:00:00',1,'00000000000000000000000000000002');
|
||||
|
||||
INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000069','PM_TASK_SCHEDULER_ADMIN','2020-01-29 00:00:00','2020-01-29 00:00:00',1,'00000000000000000000000000000002');
|
||||
|
||||
INSERT INTO `RBAC_ROLES` VALUES
|
||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
@@ -144,6 +147,7 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000002','00000000000000000000000000000065'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000067'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000068'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000069'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000001'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000005'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000040'),
|
||||
|
||||
444
tests/resources/dynaform2.json
Normal file
444
tests/resources/dynaform2.json
Normal file
@@ -0,0 +1,444 @@
|
||||
{
|
||||
"name": "f1",
|
||||
"description": "",
|
||||
"items": [
|
||||
{
|
||||
"type": "form",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"id": "8463235965ee964cd21d5d5065152425",
|
||||
"name": "f1",
|
||||
"description": "",
|
||||
"mode": "edit",
|
||||
"script": "",
|
||||
"language": "en",
|
||||
"externalLibs": "",
|
||||
"printable": false,
|
||||
"items": [
|
||||
[
|
||||
{
|
||||
"type": "title",
|
||||
"id": "title0000000001",
|
||||
"label": "Variables reference on grids",
|
||||
"ariaLabel": "",
|
||||
"colSpan": 12
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "stateDropdown",
|
||||
"var_uid": "6433597845eea6b2ad10097077910842",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "stateDropdown",
|
||||
"name": "stateDropdown",
|
||||
"label": "State Dropdown",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IC_UID, IC_NAME FROM ISO_COUNTRY",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"var_name": "stateDropdown",
|
||||
"colSpan": 12
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "countryDropdown",
|
||||
"var_uid": "8461594435ee964da8652b7084948416",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "countryDropdown",
|
||||
"name": "countryDropdown",
|
||||
"label": "Country Dropdown",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IC_UID, IC_NAME FROM ISO_COUNTRY",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"var_name": "countryDropdown",
|
||||
"colSpan": 4
|
||||
},
|
||||
{
|
||||
"type": "grid",
|
||||
"variable": "gridVar003",
|
||||
"var_uid": "6174086855ee964da934c06026331273",
|
||||
"dataType": "grid",
|
||||
"protectedValue": false,
|
||||
"id": "gridVar003",
|
||||
"name": "gridVar003",
|
||||
"label": "GRID1",
|
||||
"hint": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"columns": [
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "stateDropdown",
|
||||
"name": "stateDropdown",
|
||||
"label": "State use form",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION \nWHERE IC_UID = @?countryDropdown ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "State use form",
|
||||
"var_name": "gridVar003",
|
||||
"gridName": "gridVar003"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "countryGrid",
|
||||
"name": "countryGrid",
|
||||
"label": "country",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IC_UID, IC_NAME FROM ISO_COUNTRY",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "country"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "dropdown0000000003",
|
||||
"name": "dropdown0000000003",
|
||||
"label": "Country Grid",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION \nWHERE IC_UID = @@countryGrid ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "Country Grid"
|
||||
}
|
||||
],
|
||||
"data": [],
|
||||
"mode": "parent",
|
||||
"layout": "responsive",
|
||||
"pageSize": "0",
|
||||
"addRow": true,
|
||||
"deleteRow": true,
|
||||
"title": "GRID1",
|
||||
"colSpan": 8
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "label",
|
||||
"id": "label0000000002",
|
||||
"label": "En este segundo dropdown la variable \"stateDropdown\" tiene el mismo ID que en el primer grid. Cuando tienen el mismo ID el segundo dropdown no carga sus opciones\n",
|
||||
"ariaLabel": "",
|
||||
"colSpan": 12
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "countryDropdown1",
|
||||
"var_uid": "3870420235ee964da9d9205006775679",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "countryDropdown1",
|
||||
"name": "countryDropdown1",
|
||||
"label": "Country Dropdown 1",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IC_UID, IC_NAME FROM ISO_COUNTRY",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"var_name": "countryDropdown1",
|
||||
"colSpan": 4
|
||||
},
|
||||
{
|
||||
"type": "grid",
|
||||
"variable": "gridVar004",
|
||||
"var_uid": "5972116805ee964daa950e7067922526",
|
||||
"dataType": "grid",
|
||||
"protectedValue": false,
|
||||
"id": "gridVar004",
|
||||
"name": "gridVar004",
|
||||
"label": "GRID2",
|
||||
"hint": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"columns": [
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "stateDropdown",
|
||||
"name": "stateDropdown",
|
||||
"label": "State use form",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION \nWHERE IC_UID = @@countryDropdown1 ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "State use form",
|
||||
"var_name": "gridVar004"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "countryGrid",
|
||||
"name": "countryGrid",
|
||||
"label": "country",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IC_UID, IC_NAME FROM ISO_COUNTRY",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "country"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "dropdown0000000004",
|
||||
"name": "dropdown0000000004",
|
||||
"label": "Country Grid",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION \nWHERE IC_UID = @@countryGrid ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "Country Grid"
|
||||
}
|
||||
],
|
||||
"data": [],
|
||||
"mode": "parent",
|
||||
"layout": "responsive",
|
||||
"pageSize": "0",
|
||||
"addRow": true,
|
||||
"deleteRow": true,
|
||||
"title": "GRID2",
|
||||
"colSpan": 8
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "submit",
|
||||
"id": "submit0000000001",
|
||||
"name": "submit0000000001",
|
||||
"label": "submit_1",
|
||||
"tabIndex": "",
|
||||
"ariaLabel": "",
|
||||
"colSpan": 12
|
||||
}
|
||||
]
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"var_uid": "6433597845eea6b2ad10097077910842",
|
||||
"prj_uid": "3973270015ee964bd20e167047282910",
|
||||
"var_name": "stateDropdown",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
},
|
||||
{
|
||||
"var_uid": "8461594435ee964da8652b7084948416",
|
||||
"prj_uid": "3973270015ee964bd20e167047282910",
|
||||
"var_name": "countryDropdown",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": [],
|
||||
"inp_doc_uid": "",
|
||||
"var_uid_old": "4356061615edff028cae968013552938",
|
||||
"var_name_old": "countryDropdown",
|
||||
"prj_uid_old": "4922885715edfecb76f0024086363079"
|
||||
},
|
||||
{
|
||||
"var_uid": "6174086855ee964da934c06026331273",
|
||||
"prj_uid": "3973270015ee964bd20e167047282910",
|
||||
"var_name": "gridVar003",
|
||||
"var_field_type": "grid",
|
||||
"var_field_size": 10,
|
||||
"var_label": "grid",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": [],
|
||||
"inp_doc_uid": "",
|
||||
"var_uid_old": "4763913505ee04a4acfac28032288647",
|
||||
"var_name_old": "gridVar003",
|
||||
"prj_uid_old": "4922885715edfecb76f0024086363079"
|
||||
},
|
||||
{
|
||||
"var_uid": "3870420235ee964da9d9205006775679",
|
||||
"prj_uid": "3973270015ee964bd20e167047282910",
|
||||
"var_name": "countryDropdown1",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": [],
|
||||
"inp_doc_uid": "",
|
||||
"var_uid_old": "5743244195ee04b6c466484086183124",
|
||||
"var_name_old": "countryDropdown1",
|
||||
"prj_uid_old": "4922885715edfecb76f0024086363079"
|
||||
},
|
||||
{
|
||||
"var_uid": "5972116805ee964daa950e7067922526",
|
||||
"prj_uid": "3973270015ee964bd20e167047282910",
|
||||
"var_name": "gridVar004",
|
||||
"var_field_type": "grid",
|
||||
"var_field_size": 10,
|
||||
"var_label": "grid",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": [],
|
||||
"inp_doc_uid": "",
|
||||
"var_uid_old": "8181709185ee04b0c2f8502096315574",
|
||||
"var_name_old": "gridVar004",
|
||||
"prj_uid_old": "4922885715edfecb76f0024086363079"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
553
tests/resources/dynaform3.json
Normal file
553
tests/resources/dynaform3.json
Normal file
@@ -0,0 +1,553 @@
|
||||
{
|
||||
"name": "ABE-1",
|
||||
"description": "",
|
||||
"items": [{
|
||||
"type": "form",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"id": "1343723465efa2f79704dc4074804880",
|
||||
"name": "ABE-1",
|
||||
"description": "",
|
||||
"mode": "edit",
|
||||
"script": "",
|
||||
"language": "en",
|
||||
"externalLibs": "",
|
||||
"printable": false,
|
||||
"items": [[{
|
||||
"type": "dropdown",
|
||||
"variable": "option",
|
||||
"var_uid": "4882127935efa3853e6ef65004825919",
|
||||
"dataType": "string",
|
||||
"protectedValue": true,
|
||||
"id": "option",
|
||||
"name": "option",
|
||||
"label": "Option",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [{
|
||||
"value": "1",
|
||||
"label": "Ok"
|
||||
}, {
|
||||
"value": "2",
|
||||
"label": "Wrong"
|
||||
}],
|
||||
"var_name": "option",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "text",
|
||||
"variable": "textVar001",
|
||||
"var_uid": "8024926815efa2f918c24d9048946760",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "textVar001",
|
||||
"name": "textVar001",
|
||||
"label": "Text Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"textTransform": "none",
|
||||
"validate": "",
|
||||
"validateMessage": "",
|
||||
"maxLength": 1000,
|
||||
"formula": "",
|
||||
"mode": "parent",
|
||||
"operation": "",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"var_name": "textVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "textarea",
|
||||
"variable": "textareaVar001",
|
||||
"var_uid": "3801812565efa2f938ffb27097904674",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "textareaVar001",
|
||||
"name": "textareaVar001",
|
||||
"label": "Textarea Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"validate": "",
|
||||
"validateMessage": "",
|
||||
"mode": "parent",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"rows": "5",
|
||||
"var_name": "textareaVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "dropdown",
|
||||
"variable": "dropdownVar001",
|
||||
"var_uid": "4874759895efa2f95d73918073729404",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "dropdownVar001",
|
||||
"name": "dropdownVar001",
|
||||
"label": "Dropdown Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION\nWHERE IC_UID = @@COUNTRIES ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"var_name": "dropdownVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "submit",
|
||||
"id": "submit0000000001",
|
||||
"name": "submit0000000001",
|
||||
"label": "submit_1",
|
||||
"tabIndex": "",
|
||||
"ariaLabel": "",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "checkbox",
|
||||
"variable": "checkboxVar001",
|
||||
"var_uid": "9875983355efa33fc428854020429594",
|
||||
"dataType": "boolean",
|
||||
"protectedValue": false,
|
||||
"id": "checkboxVar001",
|
||||
"name": "checkboxVar001",
|
||||
"label": "Checkbox Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"ariaLabelVisible": true,
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"options": [{
|
||||
"value": "1",
|
||||
"label": "true"
|
||||
}, {
|
||||
"value": "0",
|
||||
"label": "false"
|
||||
}],
|
||||
"var_name": "checkboxVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "checkgroup",
|
||||
"variable": "checkgroupVar001",
|
||||
"var_uid": "7653533805efa34036b7696022819944",
|
||||
"dataType": "array",
|
||||
"protectedValue": false,
|
||||
"id": "checkgroupVar001",
|
||||
"name": "checkgroupVar001",
|
||||
"label": "Checkgroup Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"ariaLabelVisible": true,
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"var_name": "checkgroupVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "yesno",
|
||||
"variable": "radioVar001",
|
||||
"var_uid": "5993816415efa340a234248023937839",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "radioVar001",
|
||||
"name": "radioVar001",
|
||||
"label": "Radio Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"ariaLabelVisible": true,
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [{
|
||||
"value": "1",
|
||||
"label": "true"
|
||||
}, {
|
||||
"value": "0",
|
||||
"label": "false"
|
||||
}],
|
||||
"var_name": "radioVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "datetime",
|
||||
"variable": "datetimeVar001",
|
||||
"var_uid": "3905353965efa341314e278010404418",
|
||||
"dataType": "datetime",
|
||||
"protectedValue": false,
|
||||
"id": "datetimeVar001",
|
||||
"name": "datetimeVar001",
|
||||
"label": "Datetime Var 001",
|
||||
"tabIndex": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"format": "YYYY-MM-DD",
|
||||
"dayViewHeaderFormat": "MMMM YYYY",
|
||||
"extraFormats": false,
|
||||
"stepping": 1,
|
||||
"minDate": "",
|
||||
"maxDate": "",
|
||||
"useCurrent": "false",
|
||||
"collapse": true,
|
||||
"locale": "",
|
||||
"defaultDate": "",
|
||||
"disabledDates": false,
|
||||
"enabledDates": false,
|
||||
"icons": {
|
||||
"time": "glyphicon glyphicon-time",
|
||||
"date": "glyphicon glyphicon-calendar",
|
||||
"up": "glyphicon glyphicon-chevron-up",
|
||||
"down": "glyphicon glyphicon-chevron-down",
|
||||
"previous": "glyphicon glyphicon-chevron-left",
|
||||
"next": "glyphicon glyphicon-chevron-right",
|
||||
"today": "glyphicon glyphicon-screenshot",
|
||||
"clear": "glyphicon glyphicon-trash"
|
||||
},
|
||||
"useStrict": false,
|
||||
"sideBySide": false,
|
||||
"daysOfWeekDisabled": false,
|
||||
"calendarWeeks": false,
|
||||
"viewMode": "days",
|
||||
"toolbarPlacement": "default",
|
||||
"showTodayButton": false,
|
||||
"showClear": "false",
|
||||
"widgetPositioning": {
|
||||
"horizontal": "auto",
|
||||
"vertical": "auto"
|
||||
},
|
||||
"widgetParent": null,
|
||||
"keepOpen": false,
|
||||
"var_name": "datetimeVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "suggest",
|
||||
"variable": "suggestVar001",
|
||||
"var_uid": "3411734965efa341a7fbf93067272299",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "suggestVar001",
|
||||
"name": "suggestVar001",
|
||||
"label": "Suggest Var 001",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"delay": 0,
|
||||
"resultsLimit": 10,
|
||||
"forceSelection": false,
|
||||
"var_name": "suggestVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "hidden",
|
||||
"variable": "hiddenVar001",
|
||||
"var_uid": "8671702965efa343d2cd636026494394",
|
||||
"dataType": "string",
|
||||
"protectedValue": false,
|
||||
"id": "hiddenVar001",
|
||||
"name": "hiddenVar001",
|
||||
"defaultValue": "",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"var_name": "hiddenVar001",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "grid",
|
||||
"variable": "gridVar001",
|
||||
"var_uid": "5728723745efa3449d8e314091553134",
|
||||
"dataType": "grid",
|
||||
"protectedValue": false,
|
||||
"id": "gridVar001",
|
||||
"name": "gridVar001",
|
||||
"label": "grid_1",
|
||||
"hint": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"columns": [{
|
||||
"type": "suggest",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "suggest0000000002",
|
||||
"name": "suggest0000000002",
|
||||
"label": "suggest_2",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [],
|
||||
"delay": 0,
|
||||
"resultsLimit": 10,
|
||||
"forceSelection": false,
|
||||
"columnWidth": "10",
|
||||
"width": 100,
|
||||
"title": "suggest_2",
|
||||
"var_name": "gridVar001"
|
||||
}],
|
||||
"data": [],
|
||||
"mode": "parent",
|
||||
"layout": "responsive",
|
||||
"pageSize": "0",
|
||||
"addRow": true,
|
||||
"deleteRow": true,
|
||||
"title": "grid_1",
|
||||
"colSpan": 12
|
||||
}], [{
|
||||
"type": "textarea",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "textarea0000000002",
|
||||
"name": "textarea0000000002",
|
||||
"label": "textarea_2",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "",
|
||||
"placeholder": "",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"validate": "",
|
||||
"validateMessage": "",
|
||||
"mode": "parent",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "",
|
||||
"memoryCache": false,
|
||||
"rows": "5",
|
||||
"colSpan": 12
|
||||
}]],
|
||||
"variables": [{
|
||||
"var_uid": "4882127935efa3853e6ef65004825919",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "option",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "8024926815efa2f918c24d9048946760",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "textVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "3801812565efa2f938ffb27097904674",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "textareaVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "4874759895efa2f95d73918073729404",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "dropdownVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "9875983355efa33fc428854020429594",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "checkboxVar001",
|
||||
"var_field_type": "boolean",
|
||||
"var_field_size": 10,
|
||||
"var_label": "boolean",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[{\"value\":\"1\",\"label\":\"true\"},{\"value\":\"0\",\"label\":\"false\"}]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "7653533805efa34036b7696022819944",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "checkgroupVar001",
|
||||
"var_field_type": "array",
|
||||
"var_field_size": 10,
|
||||
"var_label": "array",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "5993816415efa340a234248023937839",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "radioVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "3905353965efa341314e278010404418",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "datetimeVar001",
|
||||
"var_field_type": "datetime",
|
||||
"var_field_size": 10,
|
||||
"var_label": "datetime",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "3411734965efa341a7fbf93067272299",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "suggestVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "8671702965efa343d2cd636026494394",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "hiddenVar001",
|
||||
"var_field_type": "string",
|
||||
"var_field_size": 10,
|
||||
"var_label": "string",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}, {
|
||||
"var_uid": "5728723745efa3449d8e314091553134",
|
||||
"prj_uid": "4599678715ef9e601cb8413049734226",
|
||||
"var_name": "gridVar001",
|
||||
"var_field_type": "grid",
|
||||
"var_field_size": 10,
|
||||
"var_label": "grid",
|
||||
"var_dbconnection": "workflow",
|
||||
"var_dbconnection_label": "PM Database",
|
||||
"var_sql": "",
|
||||
"var_null": 0,
|
||||
"var_default": "",
|
||||
"var_accepted_values": "[]",
|
||||
"inp_doc_uid": ""
|
||||
}]
|
||||
}]
|
||||
}
|
||||
34
tests/resources/fieldDynaform.json
Normal file
34
tests/resources/fieldDynaform.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"type": "dropdown",
|
||||
"variable": "",
|
||||
"var_uid": "",
|
||||
"dataType": "",
|
||||
"protectedValue": false,
|
||||
"id": "stateDropdown",
|
||||
"name": "stateDropdown",
|
||||
"label": "State use form",
|
||||
"tabIndex": "",
|
||||
"defaultValue": "BO",
|
||||
"placeholder": "BO",
|
||||
"hint": "",
|
||||
"ariaLabel": "",
|
||||
"required": false,
|
||||
"requiredFieldErrorMessage": "",
|
||||
"mode": "parent",
|
||||
"datasource": "database",
|
||||
"dbConnection": "workflow",
|
||||
"dbConnectionLabel": "PM Database",
|
||||
"sql": "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION \nWHERE IC_UID = @?countryDropdown ORDER BY IS_NAME",
|
||||
"memoryCache": false,
|
||||
"dataVariable": "",
|
||||
"options": [
|
||||
{
|
||||
"value": "val1",
|
||||
"label": "val1"
|
||||
}
|
||||
],
|
||||
"columnWidth": "25",
|
||||
"width": 100,
|
||||
"title": "State use form",
|
||||
"var_name": "gridVar003"
|
||||
}
|
||||
@@ -37,7 +37,8 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
}
|
||||
$path = $path . PATH_SEP . 'pmdynaform.html';
|
||||
if (!file_exists($path)) {
|
||||
file_put_contents($path, '');
|
||||
$template = file_get_contents(PATH_TPL . 'cases/pmdynaform.html');
|
||||
file_put_contents($path, $template);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_with_exception()
|
||||
public function it_should_test_sendActionsByEmail_method_with_exception()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -85,7 +86,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_if_abe_configuration_is_undefined()
|
||||
public function it_should_test_sendActionsByEmail_method_if_abe_configuration_is_undefined()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -127,7 +128,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_with_exception_if_task_property_is_undefined()
|
||||
public function it_should_test_sendActionsByEmail_method_with_exception_if_task_property_is_undefined()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -183,7 +184,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_with_exception_if_email_to_is_empty()
|
||||
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_to_is_empty()
|
||||
{
|
||||
$user = factory(User::class)->create([
|
||||
'USR_EMAIL' => ''
|
||||
@@ -242,7 +243,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_with_exception_if_email_type_is_empty()
|
||||
public function it_should_test_sendActionsByEmail_method_with_exception_if_email_type_is_empty()
|
||||
{
|
||||
$user = factory(User::class)->create();
|
||||
|
||||
@@ -298,7 +299,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_custom()
|
||||
public function it_should_test_sendActionsByEmail_method_custom()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -357,7 +358,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_response()
|
||||
public function it_should_test_sendActionsByEmail_method_response()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -413,11 +414,11 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verifies if the sendActionsByEmail method supports the 'FIELD' setting.
|
||||
* This test verifies if the sendActionsByEmail method supports the 'LINK' setting.
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_link()
|
||||
public function it_should_test_sendActionsByEmail_method_link()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -477,7 +478,7 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::sendActionsByEmail
|
||||
*/
|
||||
public function it_should_test_send_actions_by_email_field()
|
||||
public function it_should_test_sendActionsByEmail_method_field()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
@@ -487,7 +488,8 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform2.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
@@ -531,4 +533,218 @@ class ActionsByEmailCoreClassTest extends TestCase
|
||||
|
||||
$this->assertArrayHasKey('ABE_REQ_UID', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verifies if the getFieldTemplate method supports the 'dropdown' control.
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::getFieldTemplate
|
||||
*/
|
||||
public function it_should_test_getFieldTemplate_method_dropdown_control()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
'ABE_EMAIL_SERVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_TYPE' => 'LINK',
|
||||
'ABE_CUSTOM_GRID' => serialize([]),
|
||||
'ABE_EMAIL_SERVER_RECEIVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_ACTION_FIELD' => '@@option'
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $delegation->DEL_INDEX,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'PREVIOUS_USR_UID' => $user->USR_UID
|
||||
];
|
||||
$data = (object) $data;
|
||||
|
||||
$_SERVER["REQUEST_URI"] = '';
|
||||
|
||||
$this->actionsByEmailCoreClass = new ActionsByEmailCoreClass();
|
||||
$this->actionsByEmailCoreClass->setUser($user->USR_UID);
|
||||
$this->actionsByEmailCoreClass->setIndex($delegation->DEL_INDEX);
|
||||
$this->actionsByEmailCoreClass->sendActionsByEmail($data, $abeConfiguration);
|
||||
|
||||
$reflection = new ReflectionClass($this->actionsByEmailCoreClass);
|
||||
$reflectionMethod = $reflection->getMethod('getFieldTemplate');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verifies if the getFieldTemplate method supports the 'checkbox' control.
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::getFieldTemplate
|
||||
*/
|
||||
public function it_should_test_getFieldTemplate_method_checkbox_control()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
'ABE_EMAIL_SERVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_TYPE' => 'LINK',
|
||||
'ABE_CUSTOM_GRID' => serialize([]),
|
||||
'ABE_EMAIL_SERVER_RECEIVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_ACTION_FIELD' => '@@checkboxVar001'
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $delegation->DEL_INDEX,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'PREVIOUS_USR_UID' => $user->USR_UID
|
||||
];
|
||||
$data = (object) $data;
|
||||
|
||||
$_SERVER["REQUEST_URI"] = '';
|
||||
|
||||
$this->actionsByEmailCoreClass = new ActionsByEmailCoreClass();
|
||||
$this->actionsByEmailCoreClass->setUser($user->USR_UID);
|
||||
$this->actionsByEmailCoreClass->setIndex($delegation->DEL_INDEX);
|
||||
$this->actionsByEmailCoreClass->sendActionsByEmail($data, $abeConfiguration);
|
||||
|
||||
$reflection = new ReflectionClass($this->actionsByEmailCoreClass);
|
||||
$reflectionMethod = $reflection->getMethod('getFieldTemplate');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verifies if the getFieldTemplate method supports the 'yesno' control.
|
||||
* The 'yesno' control is obsolete and not used in pmdynaform.
|
||||
* @test
|
||||
* @covers \ActionsByEmailCoreClass::getFieldTemplate
|
||||
*/
|
||||
public function it_should_test_getFieldTemplate_method_yesno_control()
|
||||
{
|
||||
$user = User::where('USR_UID', '=', '00000000000000000000000000000001')
|
||||
->get()
|
||||
->first();
|
||||
$process = factory(Process::class)->create();
|
||||
$task = factory(Task::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'DYN_CONTENT' => file_get_contents(PATH_TRUNK . "/tests/resources/dynaform3.json")
|
||||
]);
|
||||
$emailServer = factory(ProcessMaker\Model\EmailServerModel::class)->create();
|
||||
$abeConfiguration = factory(AbeConfiguration::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'DYN_UID' => $dynaform->DYN_UID,
|
||||
'ABE_EMAIL_SERVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_TYPE' => 'LINK',
|
||||
'ABE_CUSTOM_GRID' => serialize([]),
|
||||
'ABE_EMAIL_SERVER_RECEIVER_UID' => $emailServer->MESS_UID,
|
||||
'ABE_ACTION_FIELD' => '@@radioVar001'
|
||||
]);
|
||||
$abeConfiguration = $abeConfiguration->toArray();
|
||||
|
||||
$application = factory(Application::class)->create([
|
||||
'PRO_UID' => $process->PRO_UID
|
||||
]);
|
||||
|
||||
$delegation = factory(Delegation::class)->create([
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'PRO_UID' => $process->PRO_UID,
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'USR_UID' => $user->USR_UID
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'TAS_UID' => $task->TAS_UID,
|
||||
'APP_UID' => $application->APP_UID,
|
||||
'DEL_INDEX' => $delegation->DEL_INDEX,
|
||||
'USR_UID' => $user->USR_UID,
|
||||
'PREVIOUS_USR_UID' => $user->USR_UID
|
||||
];
|
||||
$data = (object) $data;
|
||||
|
||||
$_SERVER["REQUEST_URI"] = '';
|
||||
|
||||
$this->actionsByEmailCoreClass = new ActionsByEmailCoreClass();
|
||||
$this->actionsByEmailCoreClass->setUser($user->USR_UID);
|
||||
$this->actionsByEmailCoreClass->setIndex($delegation->DEL_INDEX);
|
||||
$this->actionsByEmailCoreClass->sendActionsByEmail($data, $abeConfiguration);
|
||||
|
||||
$reflection = new ReflectionClass($this->actionsByEmailCoreClass);
|
||||
$reflectionMethod = $reflection->getMethod('getFieldTemplate');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
|
||||
$result = $reflectionMethod->invokeArgs($this->actionsByEmailCoreClass, []);
|
||||
|
||||
$this->assertContains('jsondata', $result);
|
||||
$this->assertContains('httpServerHostname', $result);
|
||||
$this->assertContains('pm_run_outside_main_app', $result);
|
||||
$this->assertContains('pathRTLCss', $result);
|
||||
$this->assertContains('fieldsRequired', $result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,15 +13,13 @@ use Tests\TestCase;
|
||||
*/
|
||||
class PmDynaformTest extends TestCase
|
||||
{
|
||||
|
||||
use DatabaseTransactions;
|
||||
|
||||
/**
|
||||
* Constructor of the class.
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
public function __construct($name = null, array $data = [], $dataName = '')
|
||||
protected function setUp()
|
||||
{
|
||||
parent::__construct($name, $data, $dataName);
|
||||
parent::setUp();
|
||||
$_SERVER["REQUEST_URI"] = "";
|
||||
if (!defined("DB_ADAPTER")) {
|
||||
define("DB_ADAPTER", "mysql");
|
||||
@@ -38,15 +36,7 @@ class PmDynaformTest extends TestCase
|
||||
if (!defined("DB_PASS")) {
|
||||
define("DB_PASS", env('DB_PASSWORD'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Dynaform::truncate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1042,6 +1032,156 @@ class PmDynaformTest extends TestCase
|
||||
$reflectionMethod->invokeArgs($dynaform, [&$a]);
|
||||
$this->assertInstanceOf('ReflectionMethod', $reflectionMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method getValuesDependentFields.
|
||||
* @test
|
||||
* @covers PmDynaform::jsonr()
|
||||
* @covers PmDynaform::getValuesDependentFields()
|
||||
*/
|
||||
public function it_should_test_get_values_dependent_fields()
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/dynaform2.json";
|
||||
$data = file_get_contents($pathData);
|
||||
$json = json_decode($data);
|
||||
|
||||
$pathData2 = PATH_TRUNK . "/tests/resources/fieldDynaform.json";
|
||||
$data2 = file_get_contents($pathData2);
|
||||
$json2 = json_decode($data2);
|
||||
|
||||
$dynaform = new PmDynaform();
|
||||
$dynaform->record = [
|
||||
'DYN_CONTENT' => $data
|
||||
];
|
||||
$dynaform->fields = [
|
||||
'APP_DATA' => [
|
||||
'stateDropdown' => 'stateDropdown'
|
||||
]
|
||||
];
|
||||
$reflection = new ReflectionClass($dynaform);
|
||||
$reflectionMethod = $reflection->getMethod('getValuesDependentFields');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
$result = $reflectionMethod->invokeArgs($dynaform, [&$json2]);
|
||||
|
||||
$this->assertArrayHasKey('countryDropdown', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method searchField.
|
||||
* @test
|
||||
* @covers PmDynaform::jsonr()
|
||||
* @covers PmDynaform::searchField()
|
||||
*/
|
||||
public function it_should_test_search_field()
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/dynaform2.json";
|
||||
$data = file_get_contents($pathData);
|
||||
$json = json_decode($data);
|
||||
|
||||
$pathData2 = PATH_TRUNK . "/tests/resources/fieldDynaform.json";
|
||||
$data2 = file_get_contents($pathData2);
|
||||
$json2 = json_decode($data2);
|
||||
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'DYN_CONTENT' => $data
|
||||
]);
|
||||
factory(Dynaform::class)->create([
|
||||
'DYN_CONTENT' => $data,
|
||||
'PRO_UID' => $dynaform->PRO_UID
|
||||
]);
|
||||
|
||||
$dynUid = $dynaform->DYN_UID;
|
||||
$fieldId = 'stateDropdown';
|
||||
$proUid = '';
|
||||
$and = [];
|
||||
|
||||
$dynaform = new PmDynaform();
|
||||
$result = $dynaform->searchField($dynUid, $fieldId, $proUid, $and);
|
||||
|
||||
$this->assertObjectHasAttribute('id', $result);
|
||||
$this->assertEquals($result->id, 'stateDropdown');
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method replaceDataField.
|
||||
* @test
|
||||
* @covers PmDynaform::jsonr()
|
||||
* @covers PmDynaform::replaceDataField()
|
||||
*/
|
||||
public function it_should_test_replace_data_field()
|
||||
{
|
||||
$sql = "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION WHERE IC_UID = '@?countryDropdown' ORDER BY IS_NAME";
|
||||
$data = [
|
||||
'countryDropdown' => 'BO'
|
||||
];
|
||||
$dynaform = new PmDynaform();
|
||||
$reflection = new ReflectionClass($dynaform);
|
||||
$reflectionMethod = $reflection->getMethod('replaceDataField');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
$result = $reflectionMethod->invokeArgs($dynaform, [&$sql, $data]);
|
||||
|
||||
$expected = "SELECT IS_UID, IS_NAME FROM ISO_SUBDIVISION WHERE IC_UID = 'BO' ORDER BY IS_NAME";
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method completeAdditionalHelpInformationOnControls.
|
||||
* @test
|
||||
* @covers PmDynaform::jsonr()
|
||||
* @covers PmDynaform::completeAdditionalHelpInformationOnControls()
|
||||
*/
|
||||
public function it_should_test_complete_additional_help_information_on_controls()
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/dynaform2.json";
|
||||
$data = file_get_contents($pathData);
|
||||
$json = json_decode($data);
|
||||
|
||||
$dynaform = new PmDynaform();
|
||||
$reflection = new ReflectionClass($dynaform);
|
||||
$reflectionMethod = $reflection->getMethod('completeAdditionalHelpInformationOnControls');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
$reflectionMethod->invokeArgs($dynaform, [&$json]);
|
||||
$this->assertInstanceOf('ReflectionMethod', $reflectionMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method jsonsf.
|
||||
* @test
|
||||
* @covers PmDynaform::jsonr()
|
||||
* @covers PmDynaform::jsonsf()
|
||||
*/
|
||||
public function it_should_test_jsonsf()
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/dynaform2.json";
|
||||
$data = file_get_contents($pathData);
|
||||
$json = json_decode($data);
|
||||
|
||||
$pathData2 = PATH_TRUNK . "/tests/resources/fieldDynaform.json";
|
||||
$data2 = file_get_contents($pathData2);
|
||||
$json2 = json_decode($data2);
|
||||
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'DYN_CONTENT' => $data
|
||||
]);
|
||||
factory(Dynaform::class)->create([
|
||||
'DYN_CONTENT' => $data,
|
||||
'PRO_UID' => $dynaform->PRO_UID
|
||||
]);
|
||||
|
||||
$id = 'stateDropdown';
|
||||
$for = 'id';
|
||||
$and = ['gridName' => 'gridVar003'];
|
||||
|
||||
$dynaform = new PmDynaform();
|
||||
$reflection = new ReflectionClass($dynaform);
|
||||
|
||||
$reflectionMethod = $reflection->getMethod('jsonsf');
|
||||
$reflectionMethod->setAccessible(true);
|
||||
$result = $reflectionMethod->invokeArgs($dynaform, [&$json, $id, $for, $and]);
|
||||
|
||||
$this->assertObjectHasAttribute('id', $result);
|
||||
$this->assertEquals($result->id, 'stateDropdown');
|
||||
}
|
||||
}
|
||||
|
||||
// Dummy function used for the coverture
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use ProcessMaker\BusinessModel\Lists;
|
||||
use ProcessMaker\Model\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Lists Tests
|
||||
*/
|
||||
class ListsTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* It tests the construct of the Lists class
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Lists
|
||||
* @test
|
||||
*/
|
||||
public function it_should_test_the_lists_construct()
|
||||
{
|
||||
$user = factory(User::class)->create();
|
||||
|
||||
$list = new Lists();
|
||||
$res = $list->getList('inbox', ['userId' => $user->USR_UID]);
|
||||
|
||||
$this->assertEmpty($res['data']);
|
||||
$this->assertEquals(0, $res['totalCount']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use ProcessMaker\BusinessModel\TaskSchedulerBM;
|
||||
use ProcessMaker\Model\TaskScheduler;
|
||||
use Tests\TestCase;
|
||||
|
||||
class TaskSchedulerBMTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test getSchedule method
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\TaskSchedulerBM::getSchedule
|
||||
* @test
|
||||
*/
|
||||
public function it_should_test_get_schedule_method()
|
||||
{
|
||||
TaskScheduler::truncate();
|
||||
$obj = new TaskSchedulerBM();
|
||||
|
||||
$res = $obj->getSchedule('emails_notifications');
|
||||
$this->assertNotEmpty($res);
|
||||
|
||||
factory(TaskScheduler::class)->create();
|
||||
|
||||
$res = $obj->getSchedule('emails_notifications');
|
||||
$this->assertNotEmpty(1, $res);
|
||||
|
||||
$res = $obj->getSchedule('case_actions');
|
||||
$this->assertEmpty(0, $res);
|
||||
|
||||
$res = $obj->getSchedule('plugins');
|
||||
$this->assertEmpty(0, $res);
|
||||
|
||||
$res = $obj->getSchedule('processmaker_sync');
|
||||
$this->assertEmpty(0, $res);
|
||||
|
||||
$res = $obj->getSchedule(null);
|
||||
$this->assertNotEmpty(1, $res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test saveSchedule method
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\TaskSchedulerBM::saveSchedule
|
||||
* @test
|
||||
*/
|
||||
public function it_should_test_save_schedule_method()
|
||||
{
|
||||
$obj = new TaskSchedulerBM();
|
||||
|
||||
$scheduler = factory(TaskScheduler::class)->create();
|
||||
|
||||
$request_data = [
|
||||
"id" => $scheduler->id,
|
||||
"title" => "ProcessMaker Events",
|
||||
"enable" => "1",
|
||||
"service" => "events",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => "0:00",
|
||||
"endingTime" => "23:59",
|
||||
"expression" => "* * * * *",
|
||||
"description" => "Unpauses any case whose pause time has expired",
|
||||
"timezone" => "",
|
||||
"everyOn" => "",
|
||||
'interval' => "",
|
||||
'body' => "",
|
||||
'type' => "",
|
||||
'system' => "",
|
||||
'creation_date' => date(''),
|
||||
'last_update' => date('')
|
||||
];
|
||||
|
||||
$res = $obj->saveSchedule($request_data);
|
||||
$this->assertEquals($scheduler->id , $res->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test generateInitialData method
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\TaskSchedulerBM::generateInitialData
|
||||
* @test
|
||||
*/
|
||||
public function it_should_test_generate_initial_data_method()
|
||||
{
|
||||
TaskScheduler::truncate();
|
||||
$r = TaskScheduler::all()->toArray();
|
||||
$this->assertEmpty($r);
|
||||
|
||||
$obj = new TaskSchedulerBM();
|
||||
$obj->generateInitialData();
|
||||
|
||||
$r = TaskScheduler::all()->toArray();
|
||||
$this->assertNotEmpty($r);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use Exception;
|
||||
use G;
|
||||
use ProcessMaker\BusinessModel\Variable;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\Dynaform;
|
||||
use ProcessMaker\Model\Process;
|
||||
use ProcessMaker\Model\ProcessVariables;
|
||||
use Tests\TestCase;
|
||||
@@ -12,6 +16,7 @@ use Tests\TestCase;
|
||||
*/
|
||||
class VariableTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test it create variables related to the process
|
||||
*
|
||||
@@ -23,10 +28,9 @@ class VariableTest extends TestCase
|
||||
$process = factory(Process::class)->create();
|
||||
|
||||
factory(ProcessVariables::class)->create([
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]
|
||||
);
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]);
|
||||
$properties = [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'VAR_NAME' => 'var_test',
|
||||
@@ -69,10 +73,9 @@ class VariableTest extends TestCase
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
factory(ProcessVariables::class)->create([
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]
|
||||
);
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]);
|
||||
$properties = [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'VAR_NAME' => '',
|
||||
@@ -101,10 +104,9 @@ class VariableTest extends TestCase
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
factory(ProcessVariables::class)->create([
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]
|
||||
);
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]);
|
||||
$properties = [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'VAR_NAME' => 'var_test',
|
||||
@@ -133,10 +135,9 @@ class VariableTest extends TestCase
|
||||
{
|
||||
$process = factory(Process::class)->create();
|
||||
factory(ProcessVariables::class)->create([
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]
|
||||
);
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]);
|
||||
$properties = [
|
||||
'VAR_UID' => G::generateUniqueID(),
|
||||
'VAR_NAME' => 'var_test',
|
||||
@@ -166,10 +167,9 @@ class VariableTest extends TestCase
|
||||
$process = factory(Process::class)->create();
|
||||
|
||||
factory(ProcessVariables::class)->create([
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]
|
||||
);
|
||||
'PRJ_UID' => $process->PRO_UID,
|
||||
'PRO_ID' => $process->PRO_ID,
|
||||
]);
|
||||
$variable = new Variable();
|
||||
$res = $variable->getVariables($process->PRO_UID);
|
||||
$this->assertNotEmpty($res);
|
||||
@@ -227,4 +227,49 @@ class VariableTest extends TestCase
|
||||
$res = $variable->getVariablesByType($process->PRO_UID, 2, null, null, 'other');
|
||||
$this->assertEmpty($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method executeSqlControl.
|
||||
* @test
|
||||
* @covers \ProcessMaker\BusinessModel\Variable::executeSqlControl()
|
||||
*/
|
||||
public function it_should_test_execute_sql_control()
|
||||
{
|
||||
$pathData = PATH_TRUNK . "/tests/resources/dynaform2.json";
|
||||
$data = file_get_contents($pathData);
|
||||
$json = json_decode($data);
|
||||
|
||||
$dynaform = factory(Dynaform::class)->create([
|
||||
'DYN_CONTENT' => $data
|
||||
]);
|
||||
$application = factory(Application::class)->create();
|
||||
|
||||
$proUid = '';
|
||||
$params = [
|
||||
'app_uid' => $application->APP_UID,
|
||||
'countryDropdown1' => 'BO',
|
||||
'dyn_uid' => $dynaform->DYN_UID,
|
||||
'field_id' => 'stateDropdown',
|
||||
'grid_name' => 'gridVar004',
|
||||
];
|
||||
$_SERVER["REQUEST_URI"] = '';
|
||||
$variable = new Variable();
|
||||
$result = $variable->executeSqlControl($proUid, $params);
|
||||
|
||||
$this->assertNotEmpty($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This verify method executeSqlControl try exception.
|
||||
* @test
|
||||
* @covers \ProcessMaker\BusinessModel\Variable::executeSqlControl()
|
||||
*/
|
||||
public function it_should_test_execute_sql_control_with_exception()
|
||||
{
|
||||
//assert
|
||||
$this->expectException(Exception::class);
|
||||
|
||||
$variable = new Variable();
|
||||
$result = $variable->executeSqlControl(null, []);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,15 +396,19 @@ class CasesTraitTest extends TestCase
|
||||
];
|
||||
|
||||
$cases = new Cases();
|
||||
$cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
|
||||
$result = $cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
|
||||
|
||||
//asserts
|
||||
$this->assertEquals($aber, $result['ABE_REQ_UID']);
|
||||
$this->assertArrayHasKey('ABE_RES_STATUS', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test verifies if the ABE form has been completed.
|
||||
* This test verifies if the ABE form has not been completed and hope for an exception.
|
||||
* @test
|
||||
* @covers Cases::routeCaseActionByEmail
|
||||
*/
|
||||
public function it_should_verify_if_abe_has_completed()
|
||||
public function it_should_verify_if_abe_has_not_completed()
|
||||
{
|
||||
$delegation1 = factory(Delegation::class)->state('closed')->create();
|
||||
$abeRequest = factory(AbeRequest::class)->create();
|
||||
@@ -420,6 +424,7 @@ class CasesTraitTest extends TestCase
|
||||
$remoteAddr = '127.0.0.1';
|
||||
$files = [];
|
||||
|
||||
//assert exception
|
||||
$this->expectException(\Exception::class);
|
||||
$cases = new Cases();
|
||||
$cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
|
||||
@@ -446,6 +451,7 @@ class CasesTraitTest extends TestCase
|
||||
$remoteAddr = '127.0.0.1';
|
||||
$files = [];
|
||||
|
||||
//assert exception
|
||||
$this->expectException(\Exception::class);
|
||||
$cases = new Cases();
|
||||
$cases->routeCaseActionByEmail($appUid, $delIndex, $aber, $dynUid, $forms, $remoteAddr, $files);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\unit\workflow\engine\src\ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use ProcessMaker\Model\Application;
|
||||
use ProcessMaker\Model\AppNotes;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AppNotesTest
|
||||
*
|
||||
* @coversDefaultClass \ProcessMaker\Model\AppNotes
|
||||
*/
|
||||
class AppNotesTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
/**
|
||||
* Review get cases notes related to the case
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
public function it_test_get_case_notes()
|
||||
{
|
||||
$appNotes = factory(AppNotes::class)->states('foreign_keys')->create();
|
||||
$notes = new AppNotes();
|
||||
$res = $notes->getNotes($appNotes->APP_UID);
|
||||
$this->assertNotEmpty($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Review get total cases notes by cases
|
||||
*
|
||||
* @test
|
||||
*/
|
||||
public function it_test_get_total_case_notes()
|
||||
{
|
||||
$application = factory(Application::class)->create();
|
||||
$appNotes = factory(AppNotes::class, 10)->states('foreign_keys')->create([
|
||||
'APP_UID' => $application->APP_UID
|
||||
]);
|
||||
$notes = new AppNotes();
|
||||
$total = $notes->getTotal($application->APP_UID);
|
||||
$this->assertEquals(10, $total);
|
||||
}
|
||||
}
|
||||
@@ -882,7 +882,7 @@ class ActionsByEmailCoreClass extends PMPlugin
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new PmDynaform($dynUid);
|
||||
$obj = new PmDynaform(["CURRENT_DYNAFORM" => $dynUid]);
|
||||
$this->addItemAbeProperties(['CURRENT_DYNAFORM' => $dynUid]);
|
||||
$file = $obj->printPmDynaformAbe($this->getTaskAbeProperties());
|
||||
$html = $file;
|
||||
|
||||
@@ -22,6 +22,7 @@ class PmDynaform
|
||||
private $lastQueryError = null;
|
||||
private $propertiesToExclude = [];
|
||||
private $sysSys = null;
|
||||
private $fieldsAppData;
|
||||
public $credentials = null;
|
||||
public $displayMode = null;
|
||||
public $fields = null;
|
||||
@@ -91,6 +92,7 @@ class PmDynaform
|
||||
if (is_array($this->fields) && !isset($this->fields["APP_UID"])) {
|
||||
$this->fields["APP_UID"] = null;
|
||||
}
|
||||
$this->fieldsAppData = isset($this->fields["APP_DATA"]) ? $this->fields["APP_DATA"] : [];
|
||||
|
||||
//todo: compatibility checkbox
|
||||
if ($this->record !== null && isset($this->record["DYN_CONTENT"]) && $this->record["DYN_CONTENT"] !== "") {
|
||||
@@ -338,7 +340,7 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql = G::replaceDataField($json->sql, $dtFields, 'mysql', false);
|
||||
$sql = $this->replaceDataField($json->sql, $dtFields);
|
||||
if ($value === "suggest") {
|
||||
$sql = $this->prepareSuggestSql($sql, $json);
|
||||
}
|
||||
@@ -686,6 +688,8 @@ class PmDynaform
|
||||
$json->dataGridEnvironment = "onDataGridEnvironment";
|
||||
if (isset($this->fields["APP_DATA"])) {
|
||||
$dataGridEnvironment = $this->fields["APP_DATA"];
|
||||
//Grids only access the global variables of 'ProcessMaker', other variables are removed.
|
||||
$this->fields["APP_DATA"] = Cases::getGlobalVariables($this->fields["APP_DATA"]);
|
||||
//restore AppData with dataVariable definition, only for columns control
|
||||
foreach ($columnsDataVariable as $dge) {
|
||||
if (isset($dataGridEnvironment[$dge])) {
|
||||
@@ -833,7 +837,12 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
|
||||
private function getValuesDependentFields($json)
|
||||
/**
|
||||
* Get the values of the dependent references.
|
||||
* @param object $json
|
||||
* @return array
|
||||
*/
|
||||
private function getValuesDependentFields($json): array
|
||||
{
|
||||
if (!isset($this->record["DYN_CONTENT"])) {
|
||||
return array();
|
||||
@@ -848,7 +857,7 @@ class PmDynaform
|
||||
}
|
||||
if (isset($json->dbConnection) && isset($json->sql)) {
|
||||
$result = array();
|
||||
preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
preg_match_all('/\@(?:([\@\%\#\=\?\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$variables = isset($result[2]) ? $result[2] : array();
|
||||
foreach ($variables as $key => $value) {
|
||||
//Prevents an infinite cycle. If the name of the variable is used within its own dependent.
|
||||
@@ -863,7 +872,7 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
if ($json->dbConnection !== "" && $json->dbConnection !== "none" && $json->sql !== "") {
|
||||
$sql = G::replaceDataField($json->sql, $data, 'mysql', false);
|
||||
$sql = $this->replaceDataField($json->sql, $data);
|
||||
$dt = $this->getCacheQueryData($json->dbConnection, $sql, $json->type);
|
||||
$row = isset($dt[0]) ? $dt[0] : [];
|
||||
$index = $json->variable === "" ? $json->id : $json->variable;
|
||||
@@ -1780,12 +1789,11 @@ class PmDynaform
|
||||
* @param string $dynUid
|
||||
* @param string $fieldId
|
||||
* @param string $proUid
|
||||
*
|
||||
* @param array $and
|
||||
* @return object
|
||||
*
|
||||
* @see \ProcessMaker\BusinessModel\Variable::executeSqlControl()
|
||||
*/
|
||||
public function searchField($dynUid, $fieldId, $proUid = null)
|
||||
*/
|
||||
public function searchField($dynUid, $fieldId, $proUid = null, array $and = [])
|
||||
{
|
||||
//get pro_uid if empty
|
||||
if (empty($proUid)) {
|
||||
@@ -1828,8 +1836,8 @@ class PmDynaform
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->jsonsf($json, $fieldId);
|
||||
$this->completeAdditionalHelpInformationOnControls($json);
|
||||
return $this->jsonsf($json, $fieldId, "id", $and);
|
||||
}
|
||||
|
||||
public function searchFieldByName($dyn_uid, $name)
|
||||
@@ -1846,19 +1854,92 @@ class PmDynaform
|
||||
return $this->jsonsf($json, $name, "name");
|
||||
}
|
||||
|
||||
private function jsonsf(&$json, $id, $for = "id")
|
||||
/**
|
||||
* Replace data field with custom variables.
|
||||
* @param string $sql
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
private function replaceDataField(string $sql, array $data): string
|
||||
{
|
||||
$textParse = '';
|
||||
$dbEngine = 'mysql';
|
||||
$start = 0;
|
||||
|
||||
$prefix = '\?';
|
||||
$pattern = '/\@(?:([' . $prefix . 'Qq\!])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+|\-\>([a-zA-Z\_]\w*))?/';
|
||||
$result = preg_match_all($pattern, $sql, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
for ($r = 0; $result !== false && $r < $result; $r++) {
|
||||
$dataGlobal = array_merge($this->fieldsAppData, $data);
|
||||
if (!isset($dataGlobal[$match[2][$r][0]])) {
|
||||
$dataGlobal[$match[2][$r][0]] = '';
|
||||
}
|
||||
if (!is_array($dataGlobal[$match[2][$r][0]])) {
|
||||
$textParse = $textParse . substr($sql, $start, $match[0][$r][1] - $start);
|
||||
$start = $match[0][$r][1] + strlen($match[0][$r][0]);
|
||||
if (($match[1][$r][0] == '?') && (isset($dataGlobal[$match[2][$r][0]]))) {
|
||||
$textParse = $textParse . $dataGlobal[$match[2][$r][0]];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
$textParse = $textParse . substr($sql, $start);
|
||||
|
||||
$sqlResult = G::replaceDataField($textParse, $data, $dbEngine, false);
|
||||
return $sqlResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* complete additional help information on controls.
|
||||
* @param object $json
|
||||
*/
|
||||
private function completeAdditionalHelpInformationOnControls(&$json)
|
||||
{
|
||||
foreach ($json as $key => $value) {
|
||||
$sw1 = is_array($value);
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$val = $this->jsonsf($value, $id, $for);
|
||||
$this->completeAdditionalHelpInformationOnControls($value);
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === "type" && ($value === "grid")) {
|
||||
foreach ($json->columns as $column) {
|
||||
$column->gridName = $json->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an element within an object that represents the dynaform. Search is
|
||||
* done by 'id', 'property' and additional filters.
|
||||
* @param object $json
|
||||
* @param string $id
|
||||
* @param string $for
|
||||
* @param array $and
|
||||
* @return mixed
|
||||
*/
|
||||
private function jsonsf(&$json, string $id, string $for = "id", array $and = [])
|
||||
{
|
||||
foreach ($json as $key => $value) {
|
||||
$sw1 = is_array($value);
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$val = $this->jsonsf($value, $id, $for, $and);
|
||||
if ($val !== null) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === $for && $id === $value) {
|
||||
$filter = empty($and);
|
||||
foreach ($and as $keyAnd => $valueAnd) {
|
||||
$filter = isset($json->{$keyAnd}) && $json->{$keyAnd} === $valueAnd;
|
||||
if ($filter === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($key === $for && $id === $value && $filter) {
|
||||
return $json;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,12 +468,13 @@ function evaluateFunction($aGrid, $sExpresion)
|
||||
* stantard deviation, variance, percentile, count, count distinct
|
||||
*
|
||||
* @name PMFTotalCalculation
|
||||
* @label PMFTotalCalculation Function
|
||||
* @label PMF TotalCalculation
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFTotalCalculation.28.29
|
||||
* @param array | $grid | Grid | The input grid.
|
||||
* @param array | $grid | Grid | The input grid
|
||||
* @param string (32) | $field | Name of field | The name of the field.
|
||||
* @param string (32) | $function | Operation.
|
||||
* @return int|float|array | $result | Result | Result according of the function
|
||||
* @param string (32) | $function | Operation | More information about the type of calculations can be found in https://wiki.processmaker.com/3.2/ProcessMaker_Functions
|
||||
*
|
||||
* @return mixed | $result | Result | Result according of the operation
|
||||
*
|
||||
*/
|
||||
function PMFTotalCalculation($grid, $field, $function)
|
||||
@@ -3019,13 +3020,13 @@ function PMFUnpauseCase ($caseUid, $delIndex, $userUid)
|
||||
* @param string(32) | $taskUid | ID of the task | The unique ID of the task.
|
||||
* @param string(32) | $userUid | ID user | The unique ID of the user who will add note case.
|
||||
* @param string | $note | Note of the case | Note of the case.
|
||||
* @param int | $sendMail = 1 | Send mail | Optional parameter. If set to 1, will send an email to all participants in the case.
|
||||
* @param int | $sendMail = 0 | Send mail | Optional parameter. If set to 1, will send an email to all participants in the case.
|
||||
* @param array | $files | Array of files | An array of files (full paths) to be attached to the case notes.
|
||||
*
|
||||
* @return int | $result | Result of the add a case note | Returns 1 if the note has been added to the case.; otherwise, returns 0 if an error occurred.
|
||||
*
|
||||
*/
|
||||
function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail = 1, $files = [])
|
||||
function PMFAddCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail = 0, $files = [])
|
||||
{
|
||||
$ws = new WsBase();
|
||||
$result = $ws->addCaseNote($caseUid, $processUid, $taskUid, $userUid, $note, $sendMail, $files);
|
||||
|
||||
19
workflow/engine/classes/model/Scheduler.php
Executable file
19
workflow/engine/classes/model/Scheduler.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseScheduler.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'SCHEDULER' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class Scheduler extends BaseScheduler {
|
||||
|
||||
} // Scheduler
|
||||
23
workflow/engine/classes/model/SchedulerPeer.php
Executable file
23
workflow/engine/classes/model/SchedulerPeer.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseSchedulerPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/Scheduler.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'SCHEDULER' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class SchedulerPeer extends BaseSchedulerPeer {
|
||||
|
||||
} // SchedulerPeer
|
||||
102
workflow/engine/classes/model/map/SchedulerMapBuilder.php
Executable file
102
workflow/engine/classes/model/map/SchedulerMapBuilder.php
Executable file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'SCHEDULER' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class SchedulerMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.SchedulerMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('SCHEDULER');
|
||||
$tMap->setPhpName('Scheduler');
|
||||
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addPrimaryKey('ID', 'Id', 'string', CreoleTypes::BIGINT, true, 20);
|
||||
|
||||
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('STARTINGTIME', 'Startingtime', 'string', CreoleTypes::VARCHAR, false, 100);
|
||||
|
||||
$tMap->addColumn('ENDINGTIME', 'Endingtime', 'string', CreoleTypes::VARCHAR, false, 100);
|
||||
|
||||
$tMap->addColumn('EVERYON', 'Everyon', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('INTERVAL', 'Interval', 'string', CreoleTypes::VARCHAR, false, 10);
|
||||
|
||||
$tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('EXPRESSION', 'Expression', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('BODY', 'Body', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('TYPE', 'Type', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('CATEGORY', 'Category', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('SYSTEM', 'System', 'int', CreoleTypes::TINYINT, false, 3);
|
||||
|
||||
$tMap->addColumn('TIMEZONE', 'Timezone', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||
|
||||
$tMap->addColumn('ENABLE', 'Enable', 'int', CreoleTypes::TINYINT, false, 3);
|
||||
|
||||
$tMap->addColumn('CREATION_DATE', 'CreationDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('LAST_UPDATE', 'LastUpdate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // SchedulerMapBuilder
|
||||
1438
workflow/engine/classes/model/om/BaseScheduler.php
Normal file
1438
workflow/engine/classes/model/om/BaseScheduler.php
Normal file
File diff suppressed because it is too large
Load Diff
644
workflow/engine/classes/model/om/BaseSchedulerPeer.php
Normal file
644
workflow/engine/classes/model/om/BaseSchedulerPeer.php
Normal file
@@ -0,0 +1,644 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by SchedulerPeer::getOMClass()
|
||||
include_once 'classes/model/Scheduler.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'SCHEDULER' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseSchedulerPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'SCHEDULER';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.Scheduler';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 16;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the ID field */
|
||||
const ID = 'SCHEDULER.ID';
|
||||
|
||||
/** the column name for the TITLE field */
|
||||
const TITLE = 'SCHEDULER.TITLE';
|
||||
|
||||
/** the column name for the STARTINGTIME field */
|
||||
const STARTINGTIME = 'SCHEDULER.STARTINGTIME';
|
||||
|
||||
/** the column name for the ENDINGTIME field */
|
||||
const ENDINGTIME = 'SCHEDULER.ENDINGTIME';
|
||||
|
||||
/** the column name for the EVERYON field */
|
||||
const EVERYON = 'SCHEDULER.EVERYON';
|
||||
|
||||
/** the column name for the INTERVAL field */
|
||||
const INTERVAL = 'SCHEDULER.INTERVAL';
|
||||
|
||||
/** the column name for the DESCRIPTION field */
|
||||
const DESCRIPTION = 'SCHEDULER.DESCRIPTION';
|
||||
|
||||
/** the column name for the EXPRESSION field */
|
||||
const EXPRESSION = 'SCHEDULER.EXPRESSION';
|
||||
|
||||
/** the column name for the BODY field */
|
||||
const BODY = 'SCHEDULER.BODY';
|
||||
|
||||
/** the column name for the TYPE field */
|
||||
const TYPE = 'SCHEDULER.TYPE';
|
||||
|
||||
/** the column name for the CATEGORY field */
|
||||
const CATEGORY = 'SCHEDULER.CATEGORY';
|
||||
|
||||
/** the column name for the SYSTEM field */
|
||||
const SYSTEM = 'SCHEDULER.SYSTEM';
|
||||
|
||||
/** the column name for the TIMEZONE field */
|
||||
const TIMEZONE = 'SCHEDULER.TIMEZONE';
|
||||
|
||||
/** the column name for the ENABLE field */
|
||||
const ENABLE = 'SCHEDULER.ENABLE';
|
||||
|
||||
/** the column name for the CREATION_DATE field */
|
||||
const CREATION_DATE = 'SCHEDULER.CREATION_DATE';
|
||||
|
||||
/** the column name for the LAST_UPDATE field */
|
||||
const LAST_UPDATE = 'SCHEDULER.LAST_UPDATE';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('Id', 'Title', 'Startingtime', 'Endingtime', 'Everyon', 'Interval', 'Description', 'Expression', 'Body', 'Type', 'Category', 'System', 'Timezone', 'Enable', 'CreationDate', 'LastUpdate', ),
|
||||
BasePeer::TYPE_COLNAME => array (SchedulerPeer::ID, SchedulerPeer::TITLE, SchedulerPeer::STARTINGTIME, SchedulerPeer::ENDINGTIME, SchedulerPeer::EVERYON, SchedulerPeer::INTERVAL, SchedulerPeer::DESCRIPTION, SchedulerPeer::EXPRESSION, SchedulerPeer::BODY, SchedulerPeer::TYPE, SchedulerPeer::CATEGORY, SchedulerPeer::SYSTEM, SchedulerPeer::TIMEZONE, SchedulerPeer::ENABLE, SchedulerPeer::CREATION_DATE, SchedulerPeer::LAST_UPDATE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'title', 'startingTime', 'endingTime', 'everyOn', 'interval', 'description', 'expression', 'body', 'type', 'category', 'system', 'timezone', 'enable', 'creation_date', 'last_update', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Title' => 1, 'Startingtime' => 2, 'Endingtime' => 3, 'Everyon' => 4, 'Interval' => 5, 'Description' => 6, 'Expression' => 7, 'Body' => 8, 'Type' => 9, 'Category' => 10, 'System' => 11, 'Timezone' => 12, 'Enable' => 13, 'CreationDate' => 14, 'LastUpdate' => 15, ),
|
||||
BasePeer::TYPE_COLNAME => array (SchedulerPeer::ID => 0, SchedulerPeer::TITLE => 1, SchedulerPeer::STARTINGTIME => 2, SchedulerPeer::ENDINGTIME => 3, SchedulerPeer::EVERYON => 4, SchedulerPeer::INTERVAL => 5, SchedulerPeer::DESCRIPTION => 6, SchedulerPeer::EXPRESSION => 7, SchedulerPeer::BODY => 8, SchedulerPeer::TYPE => 9, SchedulerPeer::CATEGORY => 10, SchedulerPeer::SYSTEM => 11, SchedulerPeer::TIMEZONE => 12, SchedulerPeer::ENABLE => 13, SchedulerPeer::CREATION_DATE => 14, SchedulerPeer::LAST_UPDATE => 15, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'title' => 1, 'startingTime' => 2, 'endingTime' => 3, 'everyOn' => 4, 'interval' => 5, 'description' => 6, 'expression' => 7, 'body' => 8, 'type' => 9, 'category' => 10, 'system' => 11, 'timezone' => 12, 'enable' => 13, 'creation_date' => 14, 'last_update' => 15, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/SchedulerMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.SchedulerMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = SchedulerPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. SchedulerPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(SchedulerPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::ID);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::TITLE);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::STARTINGTIME);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::ENDINGTIME);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::EVERYON);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::INTERVAL);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::DESCRIPTION);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::EXPRESSION);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::BODY);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::TYPE);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::CATEGORY);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::SYSTEM);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::TIMEZONE);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::ENABLE);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::CREATION_DATE);
|
||||
|
||||
$criteria->addSelectColumn(SchedulerPeer::LAST_UPDATE);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(SCHEDULER.ID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT SCHEDULER.ID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(SchedulerPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(SchedulerPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = SchedulerPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return Scheduler
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = SchedulerPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return SchedulerPeer::populateObjects(SchedulerPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
SchedulerPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = SchedulerPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return SchedulerPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a Scheduler or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Scheduler object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Scheduler object
|
||||
}
|
||||
|
||||
//$criteria->remove(SchedulerPeer::ID); // remove pkey col since this table uses auto-increment
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a Scheduler or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Scheduler object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(SchedulerPeer::ID);
|
||||
$selectCriteria->add(SchedulerPeer::ID, $criteria->remove(SchedulerPeer::ID), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the SCHEDULER table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(SchedulerPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a Scheduler or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Scheduler object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(SchedulerPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof Scheduler) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(SchedulerPeer::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given Scheduler object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param Scheduler $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(Scheduler $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(SchedulerPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(SchedulerPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(SchedulerPeer::DATABASE_NAME, SchedulerPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* @return Scheduler
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(SchedulerPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(SchedulerPeer::ID, $pk);
|
||||
|
||||
|
||||
$v = SchedulerPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(SchedulerPeer::ID, $pks, Criteria::IN);
|
||||
$objs = SchedulerPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseSchedulerPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/SchedulerMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.SchedulerMapBuilder');
|
||||
}
|
||||
|
||||
22
workflow/engine/config/schema.xml
Normal file → Executable file
22
workflow/engine/config/schema.xml
Normal file → Executable file
@@ -6030,4 +6030,26 @@
|
||||
<column name="exception" type="LONGVARCHAR" required="true"/>
|
||||
<column name="failed_at" type="TIMESTAMP" required="true"/>
|
||||
</table>
|
||||
<table name="SCHEDULER" idMethod="native">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Engine" value="InnoDB"/>
|
||||
<parameter name="Collation" value="utf8"/>
|
||||
</vendor>
|
||||
<column name="id" type="BIGINT" size="20" required="true" autoIncrement="true" primaryKey="true"/>
|
||||
<column name="title" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="startingTime" type="VARCHAR" size="100" required="false"/>
|
||||
<column name="endingTime" type="VARCHAR" size="100" required="false"/>
|
||||
<column name="everyOn" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="interval" type="VARCHAR" size="10" required="false"/>
|
||||
<column name="description" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="expression" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="body" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="type" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="category" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="system" type="TINYINT" size="3" required="false"/>
|
||||
<column name="timezone" type="VARCHAR" size="255" required="false"/>
|
||||
<column name="enable" type="TINYINT" size="3" required="false"/>
|
||||
<column name="creation_date" type="TIMESTAMP" required="false"/>
|
||||
<column name="last_update" type="TIMESTAMP" required="false"/>
|
||||
</table>
|
||||
</database>
|
||||
|
||||
4
workflow/engine/content/languages/translation.en
Normal file → Executable file
4
workflow/engine/content/languages/translation.en
Normal file → Executable file
File diff suppressed because one or more lines are too long
363
workflow/engine/content/translations/english/processmaker.en.po
Normal file → Executable file
363
workflow/engine/content/translations/english/processmaker.en.po
Normal file → Executable file
@@ -21716,8 +21716,8 @@ msgstr "LDAP is optional"
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_MEMORYLIMIT
|
||||
#: LABEL/ID_PROCESSMAKER_REQUIREMENTS_MEMORYLIMIT
|
||||
msgid "Memory Limit >= 80MB"
|
||||
msgstr "Memory Limit >= 80MB"
|
||||
msgid "Memory Limit >= 256MB"
|
||||
msgstr "Memory Limit >= 256MB"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_MSSQL
|
||||
@@ -25409,6 +25409,18 @@ msgstr "Error: Thread status does not exist for the application {0}."
|
||||
msgid "Thu"
|
||||
msgstr "Thu"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TIMER_EVENT
|
||||
#: LABEL/ID_TIMER_EVENT
|
||||
msgid "Timer event"
|
||||
msgstr "Timer event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TIMER_EVENT_DESC
|
||||
#: LABEL/ID_TIMER_EVENT_DESC
|
||||
msgid "Executes timer start and intermediate timer events"
|
||||
msgstr "Executes timer start and intermediate timer events"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TIMER_EVENT_ALREADY_REGISTERED
|
||||
#: LABEL/ID_TIMER_EVENT_ALREADY_REGISTERED
|
||||
@@ -51573,3 +51585,350 @@ msgstr "Cancel"
|
||||
msgid "[dynaforms/fields/yesno.xml?PME_ACCEPT] Save"
|
||||
msgstr "Save"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER
|
||||
#: LABEL/ID_TASK_SCHEDULER
|
||||
msgid "Task Scheduler"
|
||||
msgstr "Task Scheduler"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CASE_ACTIONS
|
||||
#: LABEL/ID_TASK_SCHEDULER_CASE_ACTIONS
|
||||
msgid "Case actions"
|
||||
msgstr "Case actions"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PLUGINS
|
||||
#: LABEL/ID_TASK_SCHEDULER_PLUGINS
|
||||
msgid "Plugins"
|
||||
msgstr "Plugins"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_SYNC
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_SYNC
|
||||
msgid "ProcessMaker sync"
|
||||
msgstr "ProcessMaker sync"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_EMAILS_NOTIFICATIONS
|
||||
#: LABEL/ID_TASK_SCHEDULER_EMAILS_NOTIFICATIONS
|
||||
msgid "Emails and notifications"
|
||||
msgstr "Emails and notifications"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_ACTION_EMAIL
|
||||
#: LABEL/ID_TASK_SCHEDULER_ACTION_EMAIL
|
||||
msgid "Action by Email Response"
|
||||
msgstr "Action by Email Response"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_ACTION_EMAIL_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_ACTION_EMAIL_DESC
|
||||
msgid "Action by email response account email revision"
|
||||
msgstr "Action by email response account email revision"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_SEND_NOT
|
||||
#: LABEL/ID_TASK_SCHEDULER_SEND_NOT
|
||||
msgid "Send notifications"
|
||||
msgstr "Send notifications"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_SEND_NOT_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_SEND_NOT_DESC
|
||||
msgid "ProcessMaker mobile notifications"
|
||||
msgstr "ProcessMaker mobile notifications"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_LDAP
|
||||
#: LABEL/ID_TASK_SCHEDULER_LDAP
|
||||
msgid "ProcessMaker LDAP cron"
|
||||
msgstr "ProcessMaker LDAP cron"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_LDAP_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_LDAP_DESC
|
||||
msgid "Synchronize advance LDAP attributes from their settings"
|
||||
msgstr "Synchronize advance LDAP attributes from their settings"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CLEAN_SELF
|
||||
#: LABEL/ID_TASK_SCHEDULER_CLEAN_SELF
|
||||
msgid "Clean self service tables"
|
||||
msgstr "Clean self service tables"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CLEAN_SELF_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_CLEAN_SELF_DESC
|
||||
msgid "Clean unused records for Self-Service Value-Based feature. It is a maintenance command"
|
||||
msgstr "Clean unused records for Self-Service Value-Based feature. It is a maintenance command"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_MESSAGE_EVENTS
|
||||
#: LABEL/ID_TASK_SCHEDULER_MESSAGE_EVENTS
|
||||
msgid "Message events"
|
||||
msgstr "Message events"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_MESSAGE_EVENTS_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_MESSAGE_EVENTS_DESC
|
||||
msgid "Intermediate and end email event"
|
||||
msgstr "Intermediate and end email event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_UNASSIGNED
|
||||
#: LABEL/ID_TASK_SCHEDULER_UNASSIGNED
|
||||
msgid "Unassigned case"
|
||||
msgstr "Unassigned case"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_UNASSIGNED_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_UNASSIGNED_DESC
|
||||
msgid "Run the trigger for self-service cases that have a configured timeout setting"
|
||||
msgstr "Run the trigger for self-service cases that have a configured timeout setting"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CALCULATE_ELAPSED
|
||||
#: LABEL/ID_TASK_SCHEDULER_CALCULATE_ELAPSED
|
||||
msgid "Calculated the elapsed time"
|
||||
msgstr "Calculated the elapsed time"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CALCULATE_ELAPSED_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_CALCULATE_ELAPSED_DESC
|
||||
msgid "Calculates the elapsed time according to the configured calendar of all open tasks in active cases"
|
||||
msgstr "Calculates the elapsed time according to the configured calendar of all open tasks in active cases"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_PLUGINS
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_PLUGINS
|
||||
msgid "ProcessMaker plugins"
|
||||
msgstr "ProcessMaker plugins"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_PLUGINS_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_PLUGINS_DESC
|
||||
msgid "Custom plugins execution"
|
||||
msgstr "Custom plugins execution"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CASE_EMAILS
|
||||
#: LABEL/ID_TASK_SCHEDULER_CASE_EMAILS
|
||||
msgid "Case Emails"
|
||||
msgstr "Case Emails"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CASE_EMAILS_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_CASE_EMAILS_DESC
|
||||
msgid "Task, triggers, and actions by email notifications"
|
||||
msgstr "Task, triggers, and actions by email notifications"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_UNPAUSE
|
||||
#: LABEL/ID_TASK_SCHEDULER_UNPAUSE
|
||||
msgid "Unpause cases"
|
||||
msgstr "Unpause cases"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_UNPAUSE_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_UNPAUSE_DESC
|
||||
msgid "Unpauses any case whose pause time has expired"
|
||||
msgstr "Unpauses any case whose pause time has expired"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_SCHEDULER
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_SCHEDULER
|
||||
msgid "Unpauses any case whose pause time has expired"
|
||||
msgstr "Unpauses any case whose pause time has expired"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_EVENTS
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_EVENTS
|
||||
msgid "ProcessMaker events"
|
||||
msgstr "ProcessMaker events"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_PM_SCHEDULER
|
||||
#: LABEL/ID_TASK_SCHEDULER_PM_SCHEDULER
|
||||
msgid "ProcessMaker scheduler"
|
||||
msgstr "ProcessMaker scheduler"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_YEARS
|
||||
#: LABEL/ID_YEARS
|
||||
msgid "Years"
|
||||
msgstr "Years"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MONTHS
|
||||
#: LABEL/ID_MONTHS
|
||||
msgid "Months"
|
||||
msgstr "Months"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_SEND_NOTIFICATIONS
|
||||
#: LABEL/ID_TASK_SCHEDULER_SEND_NOTIFICATIONS
|
||||
msgid "Actions by email response account email revision"
|
||||
msgstr "Actions by email response account email revision"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_WEEK
|
||||
#: LABEL/ID_WEEK
|
||||
msgid "Week"
|
||||
msgstr "Week"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_WEEKS
|
||||
#: LABEL/ID_WEEKS
|
||||
msgid "Weeks"
|
||||
msgstr "Weeks"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_MINUTE
|
||||
#: LABEL/ID_EVERY_MINUTE
|
||||
msgid "Every minute"
|
||||
msgstr "Every minute"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_FIVE_MINUTES
|
||||
#: LABEL/ID_EVERY_FIVE_MINUTES
|
||||
msgid "Every five minutes"
|
||||
msgstr "Every five minutes"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_TEN_MINUTES
|
||||
#: LABEL/ID_EVERY_TEN_MINUTES
|
||||
msgid "Every ten minutes"
|
||||
msgstr "Every ten minutes"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_FIFTEEN_MINUTES
|
||||
#: LABEL/ID_EVERY_FIFTEEN_MINUTES
|
||||
msgid "Every fifteen minutes"
|
||||
msgstr "Every fifteen minutes"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_THIRTY_MINUTES
|
||||
#: LABEL/ID_EVERY_THIRTY_MINUTES
|
||||
msgid "Every thirty minutes"
|
||||
msgstr "Every thirty minutes"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_HOURLY
|
||||
#: LABEL/ID_HOURLY
|
||||
msgid "Hourly"
|
||||
msgstr "Hourly"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_HOURLY_AT
|
||||
#: LABEL/ID_HOURLY_AT
|
||||
msgid "Hourly at"
|
||||
msgstr "Hourly at"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_AT_TILL
|
||||
#: LABEL/ID_AT_TILL
|
||||
msgid "at ${0} Till ${1}"
|
||||
msgstr "at ${0} Till ${1}"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TIME_IN
|
||||
#: LABEL/ID_TIME_IN
|
||||
msgid "time in ${0}"
|
||||
msgstr "time in ${0}"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY
|
||||
#: LABEL/ID_EVERY
|
||||
msgid "every ${0} ${1}"
|
||||
msgstr "every ${0} ${1}"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_REPORTING
|
||||
#: LABEL/ID_TASK_SCHEDULER_REPORTING
|
||||
msgid "Reporting"
|
||||
msgstr "Reporting"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EVERY_HOUR
|
||||
#: LABEL/ID_EVERY_HOUR
|
||||
msgid "Every hour"
|
||||
msgstr "Every hour"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_REPORT_USERS
|
||||
#: LABEL/ID_TASK_SCHEDULER_REPORT_USERS
|
||||
msgid "KPI Report by user"
|
||||
msgstr "KPI Report by user"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_REPORT_USERS_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_REPORT_USERS_DESC
|
||||
msgid "Recalculate KPI's information by user"
|
||||
msgstr "Recalculate KPI's information by user"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_REPORT_PROCESS
|
||||
#: LABEL/ID_TASK_SCHEDULER_REPORT_PROCESS
|
||||
msgid "KPI Report by process"
|
||||
msgstr "KPI Report by process"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_REPORT_PROCESS_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_REPORT_PROCESS_DESC
|
||||
msgid "Recalculate KPI's information by process"
|
||||
msgstr "Recalculate KPI's information by process"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CALCULATE_APP
|
||||
#: LABEL/ID_TASK_SCHEDULER_CALCULATE_APP
|
||||
msgid "KPI Calculate app"
|
||||
msgstr "KPI Calculate app"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_TASK_SCHEDULER_CALCULATE_APP_DESC
|
||||
#: LABEL/ID_TASK_SCHEDULER_CALCULATE_APP_DESC
|
||||
msgid "Recalculate main KPI board information"
|
||||
msgstr "Recalculate main KPI board information"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CUSTOM_SCHEDULE_SETTINGS
|
||||
#: LABEL/ID_CUSTOM_SCHEDULE_SETTINGS
|
||||
msgid "Custom schedule settings"
|
||||
msgstr "Custom schedule settings"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CHOOSE_TIME
|
||||
#: LABEL/ID_CHOOSE_TIME
|
||||
msgid "Choose a time"
|
||||
msgstr "Choose a time"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_STARTING_TIME
|
||||
#: LABEL/ID_STARTING_TIME
|
||||
msgid "Starting time"
|
||||
msgstr "Starting time"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_ENDING_TIME
|
||||
#: LABEL/ID_ENDING_TIME
|
||||
msgid "Ending time"
|
||||
msgstr "Ending time"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REPEAT_EVERY
|
||||
#: LABEL/ID_REPEAT_EVERY
|
||||
msgid "Repeat every"
|
||||
msgstr "Repeat every"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REPEAT_ON
|
||||
#: LABEL/ID_REPEAT_ON
|
||||
msgid "Repeat on"
|
||||
msgstr "Repeat on"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CUSTOM_SETTINGS
|
||||
#: LABEL/ID_CUSTOM_SETTINGS
|
||||
msgid "Custom settings"
|
||||
msgstr "Custom settings"
|
||||
@@ -117,6 +117,7 @@ class AppProxy extends HttpProxyController
|
||||
|
||||
// Get the notes
|
||||
$appNote = new Notes();
|
||||
$total = $appNote->getTotal($appUid);
|
||||
$response = $appNote->getNotes($appUid, $httpData->start, $httpData->limit);
|
||||
$response = AppNotes::applyHtmlentitiesInNotes($response);
|
||||
|
||||
@@ -128,6 +129,8 @@ class AppProxy extends HttpProxyController
|
||||
$response['notes'][$iterator]['attachments'] = $documents->getFiles($value['NOTE_ID']);
|
||||
$iterator++;
|
||||
}
|
||||
// Get the total of cases notes by case
|
||||
$response['totalCount'] = $total;
|
||||
|
||||
require_once("classes/model/Application.php");
|
||||
$application = new Application();
|
||||
|
||||
67
workflow/engine/data/mysql/insert.sql
Normal file → Executable file
67
workflow/engine/data/mysql/insert.sql
Normal file → Executable file
@@ -72,7 +72,8 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
|
||||
('PER_NAME','','00000000000000000000000000000064','en','Reassign case supervisor'),
|
||||
('PER_NAME','','00000000000000000000000000000065','en','Setup Custom Cases List'),
|
||||
('PER_NAME','','00000000000000000000000000000067','en','Log Files'),
|
||||
('PER_NAME','','00000000000000000000000000000068','en','View Your Folders');
|
||||
('PER_NAME','','00000000000000000000000000000068','en','View Your Folders'),
|
||||
('PER_NAME','','00000000000000000000000000000069','en','View Task Scheduler');
|
||||
|
||||
INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES
|
||||
('aa','','Afar','','L','0','0','GREGORIAN'),
|
||||
@@ -56872,6 +56873,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'JAVASCRIPT','ID_EMPTY_NODENAME','en','The field name contains spaces or it''s empty!','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_ENABLE_WORKSPACE_CONFIRM','en','Do you want enable the selected workspace?','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_END_OF_PROCESS','en','End of process','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_ENDING_TIME','en','End of process','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_EVENTS','en','Events','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_EVENT_CONDITIONAL','en','Conditional Event','2014-01-15') ,
|
||||
( 'JAVASCRIPT','ID_EVENT_MESSAGE','en','Message Event','2014-01-15') ;
|
||||
@@ -57238,6 +57240,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_ATTRIBUTES','en','Attributes','2014-01-15') ,
|
||||
( 'LABEL','ID_ATTRIBUTE_HAS_INVALID_ELEMENT_KEY','en','The attribute {0}, has an invalid element (incorrect keys).','2014-05-20') ,
|
||||
( 'LABEL','ID_AT_RISK','en','At Risk','2014-01-15') ,
|
||||
( 'LABEL','ID_AT_TILL','en','at ${0} Till ${1}','2014-01-15') ,
|
||||
( 'LABEL','ID_AUDITLOG_DISPLAY','en','Audit Log','2014-09-19') ,
|
||||
( 'LABEL','ID_AUDIT_LOG_ACTIONS','en','Audit Log Actions','2014-09-30') ,
|
||||
( 'LABEL','ID_AUDIT_LOG_DETAILS_1','en','When this option is enabled, all changes made in the Admin tab are registered in a log.','2017-02-21') ,
|
||||
@@ -57520,6 +57523,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_CHECK_WORKSPACE_CONFIGURATION','en','Check Workspace Configuration','2014-01-15') ,
|
||||
( 'LABEL','ID_CHOOSE_OPTION','en','Choose an option','2014-01-15') ,
|
||||
( 'LABEL','ID_CHOOSE_PROVIDER','en','Please select provider','2014-08-27') ,
|
||||
( 'LABEL','ID_CHOOSE_TIME','en','Choose a time','2014-08-27') ,
|
||||
( 'LABEL','ID_CLAIM','en','Claim','2014-01-15') ,
|
||||
( 'LABEL','ID_CLASSIC_EDITOR','en','Classic Editor','2014-01-15') ,
|
||||
( 'LABEL','ID_CLASS_ALREADY_EXISTS','en','Class already exists','2014-01-15') ,
|
||||
@@ -57675,6 +57679,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_CUSTOM_CASES_LISTS','en','Custom Case List','2017-02-21') ,
|
||||
( 'LABEL','ID_CUSTOM_TRIGGER','en','Custom Trigger','2014-01-15') ,
|
||||
( 'LABEL','ID_CUSTOM_TRIGGER_DESCRIPTION','en','Custom Trigger','2014-01-15') ,
|
||||
( 'LABEL','ID_CUSTOM_SCHEDULE_SETTINGS','en','Custom schedule settings','2014-01-15') ,
|
||||
( 'LABEL','ID_CUSTOM_SETTINGS','en','Custom settings','2014-01-15') ,
|
||||
( 'LABEL','ID_CYCLIC_ASSIGNMENT','en','Cyclic Assignment','2014-01-15') ,
|
||||
( 'LABEL','ID_DASHBOARD','en','Dashboards','2015-03-09') ,
|
||||
( 'LABEL','ID_DASHBOARD_BTNCOLUMNS1','en','One Column','2014-01-15') ,
|
||||
@@ -58061,6 +58067,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_ENABLE_VIRTUAL_KEYBOARD','en','Enable Virtual Keyboard (Only uxmodern skin)','2014-01-15') ,
|
||||
( 'LABEL','ID_ENABLE_WORKSPACE','en','Enable Workspace','2014-01-15') ,
|
||||
( 'LABEL','ID_ENCODE','en','Encode','2014-01-15') ,
|
||||
( 'LABEL','ID_ENDING_TIME','en','Ending time','2014-01-15') ,
|
||||
( 'LABEL','ID_END_DATE','en','End Date','2014-01-15') ,
|
||||
( 'LABEL','ID_END_DATE_GREATER','en','End date should be greater than Start date','2015-02-19') ,
|
||||
( 'LABEL','ID_END_DATE_MDY','en','End Date ("m/d/Y")','2014-01-15') ,
|
||||
@@ -58141,6 +58148,13 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_EVENT_NOT_IS_TIMER_EVENT','en','The event with {0}: "{1}" not is "Timer event".','2015-06-26') ,
|
||||
( 'LABEL','ID_EVENT_REMOVE_SELECTED','en','Remove selected','2014-02-12') ,
|
||||
( 'LABEL','ID_EVENT_TIMER','en','Event Timer','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY','en','every ${0} ${1}','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_MINUTE','en','Every minute','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_FIVE_MINUTES','en','Every five minutes','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_HOUR','en','Every hour','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_TEN_MINUTES','en','Every ten minutes','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_FIFTEEN_MINUTES','en','Every fifteen minutes','2014-01-15') ,
|
||||
( 'LABEL','ID_EVERY_THIRTY_MINUTES','en','Every thirty minutes','2014-01-15') ,
|
||||
( 'LABEL','ID_EXCEPTION','en','Exception','2014-01-15') ,
|
||||
( 'LABEL','ID_EXCEPTION_LOG_INTERFAZ','en','An internal error occurred #{0}. Please contact your system administrator for more information.','2016-07-27') ,
|
||||
( 'LABEL','ID_EXECUTED','en','executed','2014-01-15') ,
|
||||
@@ -58407,6 +58421,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_HOST_NAME_LABEL','en','Host Name','2014-01-15') ,
|
||||
( 'LABEL','ID_HOST_UNREACHABLE','en','Destination Host Unreachable','2015-09-18') ,
|
||||
( 'LABEL','ID_HOUR','en','Hour','2014-01-15') ,
|
||||
( 'LABEL','ID_HOURLY','en','Hourly','2014-01-15') ,
|
||||
( 'LABEL','ID_HOURLY_AT','en','Hourly at','2014-01-15') ,
|
||||
( 'LABEL','ID_HOURS','en','Hours','2014-01-15') ,
|
||||
( 'LABEL','ID_HOUR_HOURS','en','Hour(s)','2014-10-30') ,
|
||||
( 'LABEL','ID_HTML','en','HTML','2014-01-15') ,
|
||||
@@ -58556,6 +58572,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_INVALID_SCH_START_TIME','en','Invalid value specified for sch_start_time. Expecting time in HH:MM format (The time can not be greater than 23:59)','2014-10-21') ,
|
||||
( 'LABEL','ID_INVALID_START','en','Invalid value specified for start','2014-05-22') ,
|
||||
( 'LABEL','ID_INVALID_START_HOURS','en','The following start hours rows are invalid:','2014-01-15') ,
|
||||
( 'LABEL','ID_INVALID_STARTING_TIME','en','Starting time','2014-01-15') ,
|
||||
( 'LABEL','ID_INVALID_TRIGGER','en','Invalid trigger ''{TRIGGER_INDEX}''','2014-01-15') ,
|
||||
( 'LABEL','ID_INVALID_VALUE','en','Invalid value for "{0}".','2014-05-20') ,
|
||||
( 'LABEL','ID_INVALID_VALUE_ARRAY','en','Invalid value for ''{0}''. It must be an array.','2014-10-21') ,
|
||||
@@ -60002,6 +60019,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_MON','en','Mon','2014-01-15') ,
|
||||
( 'LABEL','ID_MONITORED_FOLDER','en','Monitored Folder','2014-01-15') ,
|
||||
( 'LABEL','ID_MONTH','en','Month','2015-03-09') ,
|
||||
( 'LABEL','ID_MONTHS','en','Months','2015-03-09') ,
|
||||
( 'LABEL','ID_MONTH_1','en','January','2014-01-15') ;
|
||||
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
|
||||
|
||||
@@ -60494,7 +60512,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_GD','en','GD Support','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_LDAP','en','LDAP Support (*)','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_LDAP_OPTIONAL','en','LDAP is optional','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_MEMORYLIMIT','en','Memory Limit >= 80MB','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_MEMORYLIMIT','en','Memory Limit >= 256MB','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_MSSQL','en','MSSQL Support (*)','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_MULTIBYTESTRING','en','Multibyte Strings Support','2014-01-15') ,
|
||||
( 'LABEL','ID_PROCESSMAKER_REQUIREMENTS_MYSQL','en','MySQL Support','2014-01-15') ,
|
||||
@@ -60677,6 +60695,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_RENAME','en','Rename','2014-01-15') ,
|
||||
( 'LABEL','ID_RENEW','en','Renew','2014-09-18') ,
|
||||
( 'LABEL','ID_REOPEN','en','re-open','2014-01-15') ,
|
||||
( 'LABEL','ID_REPEAT_EVERY','en','Repeat every','2014-01-15') ,
|
||||
( 'LABEL','ID_REPEAT_ON','en','Repeat on','2014-01-15') ,
|
||||
( 'LABEL','ID_REPLACED_BY','en','Replaced by','2014-01-15') ,
|
||||
( 'LABEL','ID_REPLACED_LOGO','en','The logo was replaced','2014-01-15') ,
|
||||
( 'LABEL','ID_REPLACE_ALL','en','Replace all','2016-03-30') ,
|
||||
@@ -60982,6 +61002,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_STARTED_SUCCESSFULLY','en','Started successfully','2014-01-15') ,
|
||||
( 'LABEL','ID_STARTING_LOG_FILE','en','Starting log file','2014-01-15') ,
|
||||
( 'LABEL','ID_STARTING_NEW_CASE','en','Starting new case','2014-01-15') ,
|
||||
( 'LABEL','ID_STARTING_TIME','en','Starting time','2014-01-15') ,
|
||||
( 'LABEL','ID_START_A_NEW_CASE_FOR','en','Start a new case for:','2014-01-15') ,
|
||||
( 'LABEL','ID_START_CASE','en','New','2014-01-15') ,
|
||||
( 'LABEL','ID_START_DATE','en','Start Date','2014-01-15') ,
|
||||
@@ -61084,7 +61105,41 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_TASK_PROPERTIES_SAVE','en','Task properties has been saved successfully','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_TRANSFER','en','Task Transfer Date','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_WAS_ASSIGNED_TO_USER','en','Manual assignment shouldn''t be used with sub-processes.<br>The task "{0}" from case {1} was assigned to user <b>{2}</b> ( {3} {4} )','2015-02-24') ,
|
||||
( 'LABEL','ID_TAS_DURATION_REQUIRE','en','Duration task required','2014-01-15') ,
|
||||
( 'LABEL','ID_TAS_DURATION_REQUIRE','en','Duration task required','2014-0f-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER','en','Task Scheduler','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_ACTION_EMAIL','en','Action by Email Response','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_ACTION_EMAIL_DESC','en','Action by email response account email revision','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CALCULATE_APP','en','KPI Calculate app','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CALCULATE_APP_DESC','en','Recalculate main KPI board information','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CALCULATE_ELAPSED','en','Calculated the elapsed time','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CALCULATE_ELAPSED_DESC','en','Calculates the elapsed time according to the configured calendar of all open tasks in active cases','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CASE_ACTIONS','en','Case actions','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CASE_EMAILS','en','Case emails','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CASE_EMAILS_DESC','en','Task, triggers, and actions by email notifications','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CLEAN_SELF','en','Clean self service tables','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_CLEAN_SELF_DESC','en','Clean unused records for Self-Service Value-Based feature. It is a maintenance command','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_MESSAGE_EVENTS','en','Message events','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_MESSAGE_EVENTS_DESC','en','Intermediate and end email event','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_LDAP','en','ProcessMaker LDAP cron','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_LDAP_DESC','en','Synchronize advance LDAP attributes from their settings','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PLUGINS','en','Plugins','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PM_PLUGINS','en','ProcessMaker plugins','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PM_PLUGINS_DESC','en','Custom plugins execution','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PM_SYNC','en','ProcessMaker sync','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PM_EVENTS','en','ProcessMaker events','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_PM_SCHEDULER','en','ProcessMaker scheduler','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_REPORT_USERS','en','KPI Report by user','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_REPORT_USERS_DESC','en',"Recalculate KPI's information by user",'2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_REPORTING','en','Reporting','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_REPORT_PROCESS','en','KPI Report by process','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_REPORT_PROCESS_DESC','en',"Recalculate KPI's information by process",'2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_SEND_NOT','en','Send notifications','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_SEND_NOT_DESC','en','ProcessMaker mobile notifications','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_UNASSIGNED','en','Unassigned case','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_UNASSIGNED_DESC','en','Run the trigger for self-service cases that have a configured timeout setting','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_UNPAUSE','en','Unpause cases','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_UNPAUSE_DESC','en','Unpauses any case whose pause time has expired','2014-01-15') ,
|
||||
( 'LABEL','ID_TASK_SCHEDULER_EMAILS_NOTIFICATIONS','en','Emails and notifications','2014-01-15') ,
|
||||
( 'LABEL','ID_TAS_EDIT','en','Tasks (Edit mode)','2014-01-15') ,
|
||||
( 'LABEL','ID_TAS_UID_PARAMETER_IS_EMPTY','en','The TAS_UID parameter is empty.','2016-04-08') ,
|
||||
( 'LABEL','ID_TAS_VIEW','en','Tasks (View mode)','2014-01-15') ,
|
||||
@@ -61126,11 +61181,14 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_THREAD_INDEX','en','Thread Index','2014-01-15') ,
|
||||
( 'LABEL','ID_THREAD_STATUS_DOES_NOT_EXIST_FOR_THE_APPLICATION','en','Error: Thread status does not exist for the application {0}.','2016-06-15') ,
|
||||
( 'LABEL','ID_THU','en','Thu','2014-01-15') ,
|
||||
( 'LABEL','ID_TIMER_EVENT','en','Timer event','2015-06-26') ,
|
||||
( 'LABEL','ID_TIMER_EVENT_DESC','en','Executes timer start and intermediate timer events','2015-06-26') ,
|
||||
( 'LABEL','ID_TIMER_EVENT_ALREADY_REGISTERED','en','The Timer-Event with {0}: "{1}" already registered.','2015-06-26') ,
|
||||
( 'LABEL','ID_TIMER_EVENT_DOES_NOT_EXIST','en','The Timer-Event with {0}: "{1}" does not exist.','2015-06-26') ,
|
||||
( 'LABEL','ID_TIMER_EVENT_DOES_NOT_IS_REGISTERED','en','The Timer-Event with {0}: "{1}" does not is registered.','2015-06-26') ,
|
||||
( 'LABEL','ID_TIME_EXIST_IN_LIST','en','The day and time exist in the list','2014-01-15') ,
|
||||
( 'LABEL','ID_TIME_HOURS','en','Time (Hours)','2015-03-30') ,
|
||||
( 'LABEL','ID_TIME_IN','en','time in ${0}','2015-03-30') ,
|
||||
( 'LABEL','ID_TIME_LABEL','en','Time','2014-01-15') ,
|
||||
( 'LABEL','ID_TIME_NEXT_RUN','en','Time Next Run','2014-01-15') ,
|
||||
( 'LABEL','ID_TIME_REQUIRED','en','Time is required','2014-01-15') ,
|
||||
@@ -61471,6 +61529,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_WEB_SERVICES','en','Web Services Test','2014-01-15') ,
|
||||
( 'LABEL','ID_WEB_SERVICE_PASSWORD','en','Web Service Password','2014-01-15') ,
|
||||
( 'LABEL','ID_WEB_SERVICE_USER','en','Web Service User','2014-01-15') ,
|
||||
( 'LABEL','ID_WEEK','en','Week','2014-01-15') ,
|
||||
( 'LABEL','ID_WEEKS','en','Weeks','2014-01-15') ,
|
||||
( 'LABEL','ID_WEEKDAY_0','en','Sunday','2014-01-15') ,
|
||||
( 'LABEL','ID_WEEKDAY_1','en','Monday','2014-01-15') ,
|
||||
( 'LABEL','ID_WEEKDAY_2','en','Tuesday','2014-01-15') ,
|
||||
@@ -61516,6 +61576,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_XPDL_FILENAME','en','Download XPDL File:','2014-01-15') ,
|
||||
( 'LABEL','ID_XPDL_IMPORT','en','Import XPDL','2014-01-15') ,
|
||||
( 'LABEL','ID_YEAR','en','Year','2015-03-30') ,
|
||||
( 'LABEL','ID_YEARS','en','Years','2015-03-30') ,
|
||||
( 'LABEL','ID_YELLOW_ENDS_IN','en','Yellow Ends In','2014-01-15') ,
|
||||
( 'LABEL','ID_YELLOW_STARTS_IN','en','Yellow Starts In','2014-01-15') ,
|
||||
( 'LABEL','ID_YES','en','Yes','2014-01-15') ,
|
||||
|
||||
@@ -3328,5 +3328,32 @@ CREATE TABLE `JOBS_FAILED`
|
||||
`failed_at` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
|
||||
#-----------------------------------------------------------------------------
|
||||
#-- SCHEDULER
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `SCHEDULER`;
|
||||
|
||||
|
||||
CREATE TABLE `SCHEDULER`
|
||||
(
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||
`title` VARCHAR(255),
|
||||
`startingTime` VARCHAR(100),
|
||||
`endingTime` VARCHAR(100),
|
||||
`everyOn` VARCHAR(255),
|
||||
`interval` VARCHAR(10),
|
||||
`description` VARCHAR(255),
|
||||
`expression` VARCHAR(255),
|
||||
`body` VARCHAR(255),
|
||||
`type` VARCHAR(255),
|
||||
`category` VARCHAR(255),
|
||||
`system` TINYINT(3),
|
||||
`timezone` VARCHAR(255),
|
||||
`enable` TINYINT(3),
|
||||
`creation_date` DATETIME,
|
||||
`last_update` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
28
workflow/engine/menus/setup.php
Normal file → Executable file
28
workflow/engine/menus/setup.php
Normal file → Executable file
@@ -295,3 +295,31 @@ if ((string)($status) !== 'enabled' &&
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if ($RBAC->userCanAccess('PM_TASK_SCHEDULER_ADMIN') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ID_MENU_CASE_ACTIONS', '../scheduler/index?category=case_actions',
|
||||
G::LoadTranslation("ID_TASK_SCHEDULER_CASE_ACTIONS"),
|
||||
'', '', G::LoadTranslation("ID_TASK_SCHEDULER")
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ID_MENU_EMAILS_NOTIFICATIONS', '../scheduler/index?category=emails_notifications',
|
||||
G::LoadTranslation("ID_TASK_SCHEDULER_EMAILS_NOTIFICATIONS"),
|
||||
'', '', G::LoadTranslation("ID_TASK_SCHEDULER")
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ID_MENU_PLUGINS', '../scheduler/index?category=plugins',
|
||||
G::LoadTranslation("ID_TASK_SCHEDULER_PLUGINS"),
|
||||
'', '', G::LoadTranslation("ID_TASK_SCHEDULER")
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ID_MENU_PM_SYNC', '../scheduler/index?category=processmaker_sync',
|
||||
G::LoadTranslation("ID_TASK_SCHEDULER_PM_SYNC"),
|
||||
'', '', G::LoadTranslation("ID_TASK_SCHEDULER")
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ID_MENU_REPORTING', '../scheduler/index?category=reporting',
|
||||
G::LoadTranslation("ID_TASK_SCHEDULER_REPORTING"),
|
||||
'', '', G::LoadTranslation("ID_TASK_SCHEDULER")
|
||||
);
|
||||
}
|
||||
35
workflow/engine/methods/scheduler/index.php
Executable file
35
workflow/engine/methods/scheduler/index.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
try {
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$headPublisher = headPublisher::getSingleton();
|
||||
$category = (isset($_GET["category"]))? $_GET["category"] : null;
|
||||
/* Render page */
|
||||
|
||||
$pmDynaform = new PmDynaform([]);
|
||||
if (!empty($_SESSION['USER_LOGGED'])) {
|
||||
$arrayTimeZoneId = DateTimeZone::listIdentifiers();
|
||||
$fields["timezoneArray"] = G::json_encode($arrayTimeZoneId);
|
||||
}
|
||||
|
||||
$fields["server"] = System::getHttpServerHostnameRequestsFrontEnd();
|
||||
$fields["credentials"] = G::json_encode($pmDynaform->getCredentials());
|
||||
$fields["category"] = $category;
|
||||
$fields["lang"] = SYS_LANG;
|
||||
$fields["workspace"] = config("system.workspace");
|
||||
if (!empty(G::browserCacheFilesGetUid())) {
|
||||
$fields["translation"] = "/js/ext/translation." . SYS_LANG . "." . G::browserCacheFilesGetUid() . ".js";
|
||||
} else {
|
||||
$fields["translation"] = "/js/ext/translation." . SYS_LANG . ".js";
|
||||
}
|
||||
$G_PUBLISH->addContent('smarty' , 'scheduler/index.html' , '', '' , $fields); //Adding a HTML file .html
|
||||
$G_PUBLISH->addContent('smarty' , PATH_HOME . 'public_html/lib/taskscheduler/index.html'); //Adding a HTML file .html
|
||||
G::RenderPage("publish" , "raw");
|
||||
} catch (Exception $e) {
|
||||
$message = [];
|
||||
$message['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $message);
|
||||
G::RenderPage('publish', 'blank');
|
||||
die();
|
||||
}
|
||||
@@ -1178,9 +1178,7 @@ class DynaForm
|
||||
}
|
||||
foreach ($oldColumns as $oldColumn) {
|
||||
if (strtolower(AdditionalTables::getPHPName($column->id)) === strtolower(AdditionalTables::getPHPName($oldColumn->id))) {
|
||||
if (strtolower(AdditionalTables::getPHPName($column->var_name)) === strtolower(AdditionalTables::getPHPName($oldColumn->var_name))) {
|
||||
$identicals[] = "'" . $column->id . "' - '" . $oldColumn->id . "'";
|
||||
}
|
||||
$identicals[] = "'" . $column->id . "' - '" . $oldColumn->id . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,8 @@ class Lists
|
||||
];
|
||||
|
||||
// If the feature for highlight the home folders is disabled, add self-service list to the map
|
||||
if (!HIGHLIGHT_HOME_FOLDER_ENABLE) {
|
||||
$flag = defined('HIGHLIGHT_HOME_FOLDER_ENABLE') ? HIGHLIGHT_HOME_FOLDER_ENABLE : 0;
|
||||
if (!$flag) {
|
||||
$this->mapList['ListSelfService'] = 'CASES_SELFSERVICE';
|
||||
}
|
||||
|
||||
|
||||
248
workflow/engine/src/ProcessMaker/BusinessModel/TaskSchedulerBM.php
Executable file
248
workflow/engine/src/ProcessMaker/BusinessModel/TaskSchedulerBM.php
Executable file
@@ -0,0 +1,248 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\TaskScheduler;
|
||||
|
||||
class TaskSchedulerBM
|
||||
{
|
||||
public static $services = [
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_UNPAUSE",
|
||||
"enable" => "0",
|
||||
"service" => "unpause",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_UNPAUSE_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_CALCULATE_ELAPSED",
|
||||
"enable" => "0",
|
||||
"service" => "calculate",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => "0:00",
|
||||
"endingTime" => "0:30",
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => 'ID_TASK_SCHEDULER_CALCULATE_ELAPSED_DESC'
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_UNASSIGNED",
|
||||
"enable" => "0",
|
||||
"service" => "unassigned-case",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => 'ID_TASK_SCHEDULER_UNASSIGNED_DESC'
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_CLEAN_SELF",
|
||||
"enable" => "0",
|
||||
"service" => "clean-self-service-tables",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => "0:00",
|
||||
"endingTime" => "0:30",
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => 'ID_TASK_SCHEDULER_CLEAN_SELF_DESC'
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_CASE_EMAILS",
|
||||
"enable" => "1",
|
||||
"service" => "emails",
|
||||
"category" => "emails_notifications",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/5 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_CASE_EMAILS_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_ACTION_EMAIL",
|
||||
"enable" => "1",
|
||||
"service" => "",
|
||||
"category" => "emails_notifications",
|
||||
"file" => "workflow/engine/bin/actionsByEmailEmailResponse.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/5 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_ACTION_EMAIL_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_MESSAGE_EVENTS",
|
||||
"enable" => "1",
|
||||
"service" => "",
|
||||
"category" => "emails_notifications",
|
||||
"file" => "workflow/engine/bin/messageeventcron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/5 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_MESSAGE_EVENTS_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_SEND_NOT",
|
||||
"enable" => "1",
|
||||
"service" => "",
|
||||
"category" => "emails_notifications",
|
||||
"file" => "workflow/engine/bin/sendnotificationscron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/5 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_SEND_NOT_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_REPORT_USERS",
|
||||
"enable" => "0",
|
||||
"service" => "report_by_user",
|
||||
"category" => "reporting",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/10 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_REPORT_USERS_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_REPORT_PROCESS",
|
||||
"enable" => "0",
|
||||
"service" => "report_by_process",
|
||||
"category" => "reporting",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"category" => "reporting",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/10 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_CALCULATE_APP_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_LDAP",
|
||||
"enable" => "0",
|
||||
"service" => "",
|
||||
"category" => "processmaker_sync",
|
||||
"file" => "workflow/engine/bin/ldapcron.php",
|
||||
"startingTime" => "0:00",
|
||||
"endingTime" => "0:30",
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_LDAP"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TASK_SCHEDULER_PM_PLUGINS",
|
||||
"enable" => "0",
|
||||
"service" => "plugins",
|
||||
"category" => "plugins",
|
||||
"file" => "workflow/engine/bin/cron.php",
|
||||
"startingTime" => "0:00",
|
||||
"endingTime" => "0:30",
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "0 */1 * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TASK_SCHEDULER_PM_PLUGINS_DESC"
|
||||
],
|
||||
[
|
||||
"title" => "ID_TIMER_EVENT",
|
||||
"enable" => "1",
|
||||
"service" => "",
|
||||
"category" => "case_actions",
|
||||
"file" => "workflow/engine/bin/timereventcron.php",
|
||||
"startingTime" => null,
|
||||
"endingTime" => null,
|
||||
"everyOn" => "1",
|
||||
"interval" => "week",
|
||||
"expression" => "*/1 * * * 0,1,2,3,4,5,6",
|
||||
"description" => "ID_TIMER_EVENT_DESC"
|
||||
]
|
||||
];
|
||||
/**
|
||||
* Return the records in Schedule Table by category
|
||||
*/
|
||||
public static function getSchedule($category)
|
||||
{
|
||||
$tasks = TaskScheduler::all();
|
||||
$count = $tasks->count();
|
||||
if ($count == 0) {
|
||||
TaskSchedulerBM::generateInitialData();
|
||||
$tasks = TaskScheduler::all();
|
||||
}
|
||||
if (is_null($category)) {
|
||||
return $tasks;
|
||||
} else {
|
||||
return TaskScheduler::where('category', $category)->get();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Save the record Schedule in Schedule Table
|
||||
*/
|
||||
public static function saveSchedule(array $request)
|
||||
{
|
||||
$task = TaskScheduler::find($request['id']);
|
||||
if (isset($request['enable'])) {
|
||||
$task->enable = $request['enable'];
|
||||
}
|
||||
|
||||
if (isset($request['expression'])) {
|
||||
$task->expression = $request['expression'];
|
||||
$task->startingTime = $request['startingTime'];
|
||||
$task->endingTime = $request['endingTime'];
|
||||
$task->timezone = $request['timezone'];
|
||||
$task->everyOn = $request['everyOn'];
|
||||
$task->interval = $request['interval'];
|
||||
}
|
||||
$task->save();
|
||||
return $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial data for Schedule Table, with default values
|
||||
*/
|
||||
public static function generateInitialData()
|
||||
{
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
$toSave = [];
|
||||
|
||||
foreach (TaskSchedulerBM::$services as $service) {
|
||||
$task = new TaskScheduler;
|
||||
$task->title = $service["title"];
|
||||
$task->category = $service["category"];
|
||||
$task->description = $service["description"];
|
||||
$task->startingTime = $service["startingTime"];
|
||||
$task->endingTime = $service["endingTime"];
|
||||
$task->body = 'su -s /bin/sh -c "php ' . PATH_TRUNK . $service["file"] . " " . $service["service"] . ' +w' . config("system.workspace") . ' +force"';
|
||||
$task->expression = $service["expression"];
|
||||
$task->type = "shell";
|
||||
$task->system = 1;
|
||||
$task->enable = $service["enable"];
|
||||
$task->everyOn = $service["everyOn"];
|
||||
$task->interval = $service["interval"];
|
||||
$task->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,6 +151,8 @@ class Variable
|
||||
if (isset($arrayData["VAR_FIELD_TYPE"])) {
|
||||
$arrayData["VAR_FIELD_TYPE"] = $this->validateVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
||||
$variable->setVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
||||
$fielTypeId = self::$varTypesValues[$arrayData["VAR_FIELD_TYPE"]];
|
||||
$variable->setVarFieldTypeId($fielTypeId);
|
||||
}
|
||||
if (isset($arrayData["VAR_FIELD_SIZE"])) {
|
||||
$variable->setVarFieldSize($arrayData["VAR_FIELD_SIZE"]);
|
||||
@@ -763,7 +765,9 @@ class Variable
|
||||
$start = isset($params["start"]) ? $params["start"] : 0;
|
||||
$limit = isset($params["limit"]) ? $params["limit"] : 10;
|
||||
$appUid = empty($params["app_uid"]) ? null : $params["app_uid"];
|
||||
$delIndex = (int)isset($params["del_index"]) ? $params["del_index"] : 0;
|
||||
$delIndex = (int) isset($params["del_index"]) ? $params["del_index"] : 0;
|
||||
$gridName = isset($params['grid_name']) ? $params['grid_name'] : null;
|
||||
|
||||
unset($params["dyn_uid"]);
|
||||
unset($params["field_id"]);
|
||||
unset($params["app_uid"]);
|
||||
@@ -772,6 +776,7 @@ class Variable
|
||||
unset($params["query"]);
|
||||
unset($params["start"]);
|
||||
unset($params["limit"]);
|
||||
unset($params["grid_name"]);
|
||||
|
||||
//Get appData and system variables
|
||||
$paramsAndGlobal = $params;
|
||||
@@ -796,7 +801,11 @@ class Variable
|
||||
//Get control from dynaform.
|
||||
//The parameters: queryFilter, queryStart, queryLimit, are only necessary
|
||||
//for the suggest control, the rest of the controls are ignored.
|
||||
$field = $pmDynaform->searchField($dynUid, $fieldId, $proUid);
|
||||
$parameters = [$dynUid, $fieldId, $proUid];
|
||||
if (!empty($gridName)) {
|
||||
$parameters[] = ['gridName' => $gridName];
|
||||
}
|
||||
$field = $pmDynaform->searchField(...$parameters);
|
||||
$field->queryField = true;
|
||||
$field->queryInputData = $params;
|
||||
$field->queryFilter = $filter;
|
||||
|
||||
@@ -185,9 +185,13 @@ class JobsManager
|
||||
public function dispatch($name, $callback)
|
||||
{
|
||||
$environment = $this->getDataSnapshot();
|
||||
|
||||
$instance = $name::dispatch(function() use ($callback, $environment) {
|
||||
global $RBAC;
|
||||
$referrerRBAC = $RBAC;
|
||||
$instance = $name::dispatch(function() use ($callback, $environment, $referrerRBAC) {
|
||||
try {
|
||||
global $RBAC;
|
||||
$RBAC = $referrerRBAC;
|
||||
|
||||
$this->recoverDataSnapshot($environment);
|
||||
$callback($environment);
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -98,9 +98,22 @@ class AppNotes extends Model
|
||||
$notes['notes'][] = $row;
|
||||
});
|
||||
|
||||
// Add the total of rows to return
|
||||
$notes['totalCount'] = $limit;
|
||||
|
||||
return $notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the total notes by case
|
||||
*
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getTotal(string $appUid)
|
||||
{
|
||||
$query = AppNotes::query()->select(['NOTE_ID']);
|
||||
$query->appUid($appUid);
|
||||
$total = $query->get()->count();
|
||||
|
||||
return $total;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ class SubApplication extends Model
|
||||
'SA_INIT_DATE' => '',
|
||||
'SA_FINISH_DATE' => ''
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
@@ -49,4 +50,5 @@ class SubApplication extends Model
|
||||
'SA_INIT_DATE',
|
||||
'SA_FINISH_DATE'
|
||||
];
|
||||
|
||||
}
|
||||
19
workflow/engine/src/ProcessMaker/Model/TaskScheduler.php
Executable file
19
workflow/engine/src/ProcessMaker/Model/TaskScheduler.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use \Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TaskScheduler
|
||||
* @package ProcessMaker\Model
|
||||
*
|
||||
* Represents a dynaform object in the system.
|
||||
*/
|
||||
class TaskScheduler extends Model
|
||||
{
|
||||
protected $table = 'SCHEDULER';
|
||||
public $timestamps = true;
|
||||
const CREATED_AT = 'creation_date';
|
||||
const UPDATED_AT = 'last_update';
|
||||
}
|
||||
51
workflow/engine/src/ProcessMaker/Services/Api/Scheduler.php
Executable file
51
workflow/engine/src/ProcessMaker/Services/Api/Scheduler.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use Exception;
|
||||
use Luracast\Restler\RestException;
|
||||
use ProcessMaker\BusinessModel\TaskSchedulerBM;
|
||||
use ProcessMaker\Services\Api;
|
||||
|
||||
/**
|
||||
* TaskScheduler Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Scheduler extends Api
|
||||
{
|
||||
/**
|
||||
* Returns the records of SchedulerTask by category
|
||||
* @url GET
|
||||
*
|
||||
* @param string $category
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*/
|
||||
public function doGet($category = null) {
|
||||
try {
|
||||
return TaskSchedulerBM::getSchedule($category);
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Receive the options sent from Scheduler UI
|
||||
* @url POST
|
||||
* @status 200
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
*/
|
||||
public function doPost(array $request) {
|
||||
try {
|
||||
return TaskSchedulerBM::saveSchedule($request);
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
|
||||
xtype: "checkbox",
|
||||
id: "chkSendMail",
|
||||
name: "chkSendMail",
|
||||
checked: true,
|
||||
checked: false,
|
||||
boxLabel: _("ID_CASE_NOTES_LABEL_SEND")
|
||||
},
|
||||
'->',
|
||||
@@ -421,7 +421,7 @@ function newNoteHandler()
|
||||
Ext.getCmp('caseNoteText').reset();
|
||||
uploadFields = caseNotesForm.findByType('fileuploadfield');
|
||||
// clean the first upload field
|
||||
uploadFields[0].setRawValue(null);
|
||||
uploadFields[0].reset();
|
||||
for (i = 1; i < uploadFields.length; i += 1) {
|
||||
caseNotesForm.remove(uploadFields[i]);
|
||||
}
|
||||
|
||||
12
workflow/engine/templates/scheduler/index.html
Normal file
12
workflow/engine/templates/scheduler/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
<script type="text/javascript" src="{$translation}"></script>
|
||||
<script type="text/javascript">
|
||||
var server = "{$server}";
|
||||
var credentials = {$credentials};
|
||||
var category = "{$category}";
|
||||
var lang = "{$lang}";
|
||||
var workspace = "{$workspace}";
|
||||
var timezoneArray = {$timezoneArray};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user