Merged in feature/PMCORE-1444 (pull request #7352)

PMCORE-1444

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2020-06-19 17:10:48 +00:00
committed by Julio Cesar Laura Avendaño
24 changed files with 3322 additions and 5 deletions

9
Rakefile Normal file → Executable file
View 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
@@ -463,5 +469,4 @@ end
def getLog
output = `git log -30 --pretty='[%cr] %h %d %s <%an>' --no-merges`
return output
end
end

View 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();
}
}

View File

@@ -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",
@@ -34,6 +38,7 @@
"colosa/pmui": "release/3.4.8-dev",
"colosa/michelangelofe": "release/3.4.8-dev",
"colosa/pmdynaform": "release/3.4.8-dev",
"colosa/taskscheduler": "0.1.0",
"google/apiclient": "1.1.6",
"dapphp/securimage": "^3.6",
"psr/log": "1.0.0",

15
composer.lock generated
View File

@@ -146,6 +146,21 @@
],
"time": "2020-03-10T12:38:14+00:00"
},
{
"name": "colosa/taskscheduler",
"version": "0.1.0",
"source": {
"type": "git",
"url": "git@bitbucket.org:colosa/taskscheduler.git",
"reference": "master"
},
"type": "library",
"description": "JS Library to render ProcessMaker Task Scheduler",
"homepage": "http://processmaker.com",
"keywords": [
"Vue js lib ProcessMaker Task Scheduler"
]
},
{
"name": "colosa/pmUI",
"version": "dev-release/3.4.8",

View 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()
];
});

View File

@@ -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
View 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'),

View File

@@ -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);
}
}

View 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

View 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

View 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

File diff suppressed because it is too large Load Diff

View 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
View 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

File diff suppressed because one or more lines are too long

View File

@@ -51573,3 +51573,349 @@ 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"
ID_TASK_SCHEDULER_SEND_NOTIFICATIONS
#: 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"

60
workflow/engine/data/mysql/insert.sql Normal file → Executable file
View File

@@ -56872,6 +56872,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 +57239,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 +57522,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 +57678,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 +58066,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 +58147,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 +58420,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 +58571,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 +60018,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
@@ -60677,6 +60694,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 +61001,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 +61104,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') ,
@@ -61131,6 +61185,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( '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 +61526,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 +61573,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') ,

View File

@@ -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
View 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")
);
}

View 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();
}

View File

@@ -0,0 +1,235 @@
<?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"
]
];
/**
* 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();
}
}
}

View 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';
}

View 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());
}
}
}

View 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>