Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-2039
This commit is contained in:
@@ -586,7 +586,9 @@ class InputFilter
|
|||||||
break;
|
break;
|
||||||
case 'path':
|
case 'path':
|
||||||
if(!file_exists($value)) {
|
if(!file_exists($value)) {
|
||||||
$value = '';
|
if(!is_dir($value)) {
|
||||||
|
$value = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'nosql':
|
case 'nosql':
|
||||||
@@ -624,7 +626,9 @@ class InputFilter
|
|||||||
break;
|
break;
|
||||||
case 'path':
|
case 'path':
|
||||||
if(!file_exists($value)) {
|
if(!file_exists($value)) {
|
||||||
throw new Exception('not a valid path');
|
if(!is_dir($value)) {
|
||||||
|
throw new Exception('not a valid path');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'nosql':
|
case 'nosql':
|
||||||
|
|||||||
3
gulliver/thirdparty/phing/Phing.php
vendored
3
gulliver/thirdparty/phing/Phing.php
vendored
@@ -856,7 +856,8 @@ class Phing {
|
|||||||
if (self::getMsgOutputLevel() === PROJECT_MSG_DEBUG) {
|
if (self::getMsgOutputLevel() === PROJECT_MSG_DEBUG) {
|
||||||
print("Phing::import() prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts) . "\n");
|
print("Phing::import() prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts) . "\n");
|
||||||
}
|
}
|
||||||
if (is_dir(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)))) {
|
$firstPath = explode(":", implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
||||||
|
if (is_dir($firstPath[0])) {
|
||||||
ini_set('include_path', implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
ini_set('include_path', implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
gulliver/thirdparty/propel/Propel.php
vendored
2
gulliver/thirdparty/propel/Propel.php
vendored
@@ -601,7 +601,7 @@ class Propel {
|
|||||||
$lastQuery = "";
|
$lastQuery = "";
|
||||||
|
|
||||||
foreach (self::$connectionMap as $cnn) {
|
foreach (self::$connectionMap as $cnn) {
|
||||||
if (!($cnn instanceof DBArrayConnection)) {
|
if (get_class($cnn) != "DBArrayConnection") {
|
||||||
if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
|
if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
|
||||||
$cnn->close();
|
$cnn->close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2133,7 +2133,7 @@ function PMFCreateUser ($userId, $password, $firstname, $lastname, $email, $role
|
|||||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFUpdateUser.28.29
|
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFUpdateUser.28.29
|
||||||
*
|
*
|
||||||
* @param string(32) | $userUid | User UID | The user UID.
|
* @param string(32) | $userUid | User UID | The user UID.
|
||||||
* @param string(32) | $userName | User ID | The username for the user.
|
* @param string(32) | $userName | Username | The username for the user.
|
||||||
* @param string(32) | $firstName=null | Firstname of the user | Optional parameter. The first name of the user, which can be up to 50 characters long.
|
* @param string(32) | $firstName=null | Firstname of the user | Optional parameter. The first name of the user, which can be up to 50 characters long.
|
||||||
* @param string(32) | $lastName=null | Lastname of the user | Optional parameter. The last name of the user, which can be up to 50 characters long.
|
* @param string(32) | $lastName=null | Lastname of the user | Optional parameter. The last name of the user, which can be up to 50 characters long.
|
||||||
* @param string(32) | $email=null | Email the user | Optional parameter. The email of the user, which can be up to 100 characters long.
|
* @param string(32) | $email=null | Email the user | Optional parameter. The email of the user, which can be up to 100 characters long.
|
||||||
|
|||||||
@@ -113,6 +113,13 @@ class workspaceTools
|
|||||||
|
|
||||||
CLI::logging("> Updating Files Manager...\n\n");
|
CLI::logging("> Updating Files Manager...\n\n");
|
||||||
$this->upgradeFilesManager($workSpace);
|
$this->upgradeFilesManager($workSpace);
|
||||||
|
|
||||||
|
$start = microtime(true);
|
||||||
|
CLI::logging("> Migrate new lists...\n");
|
||||||
|
$this->migrateList($workSpace);
|
||||||
|
$stop = microtime(true);
|
||||||
|
$final = $stop - $start;
|
||||||
|
CLI::logging("<*> Migrate new lists Process took $final seconds.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -634,7 +641,7 @@ class workspaceTools
|
|||||||
$oStatement_sleep->executeQuery();
|
$oStatement_sleep->executeQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_query = "SELECT * FROM information_schema.processlist WHERE user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
|
$sql_query = "SELECT * FROM information_schema.processlist WHERE user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() and time > 0 ORDER BY id;";
|
||||||
$stmt_query = $connection->createStatement();
|
$stmt_query = $connection->createStatement();
|
||||||
$rs_query = $stmt_query->executeQuery( $sql_query, ResultSet::FETCHMODE_ASSOC );
|
$rs_query = $stmt_query->executeQuery( $sql_query, ResultSet::FETCHMODE_ASSOC );
|
||||||
|
|
||||||
@@ -1853,6 +1860,9 @@ class workspaceTools
|
|||||||
*/
|
*/
|
||||||
public function migrateList ($workSpace)
|
public function migrateList ($workSpace)
|
||||||
{
|
{
|
||||||
|
if ($this->listFirstExecution('check')) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
$this->initPropel(true);
|
$this->initPropel(true);
|
||||||
$appCache = new AppCacheView();
|
$appCache = new AppCacheView();
|
||||||
G::LoadClass("case");
|
G::LoadClass("case");
|
||||||
@@ -2034,13 +2044,15 @@ class workspaceTools
|
|||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'insert':
|
case 'insert':
|
||||||
$conf = new Configuration();
|
$conf = new Configuration();
|
||||||
$data["CFG_UID"] ='MIGRATED_LIST';
|
if (!($conf->exists('MIGRATED_LIST', 'list', 'list', 'list', 'list'))) {
|
||||||
$data["OBJ_UID"] ='list';
|
$data["CFG_UID"] ='MIGRATED_LIST';
|
||||||
$data["CFG_VALUE"]='true';
|
$data["OBJ_UID"] ='list';
|
||||||
$data["PRO_UID"] ='list';
|
$data["CFG_VALUE"]='true';
|
||||||
$data["USR_UID"] ='list';
|
$data["PRO_UID"] ='list';
|
||||||
$data["APP_UID"] ='list';
|
$data["USR_UID"] ='list';
|
||||||
$conf->create($data);
|
$data["APP_UID"] ='list';
|
||||||
|
$conf->create($data);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case 'check':
|
case 'check':
|
||||||
|
|||||||
@@ -1654,18 +1654,23 @@ class AppCacheView extends BaseAppCacheView
|
|||||||
public function getTotalCasesByAllUsers()
|
public function getTotalCasesByAllUsers()
|
||||||
{
|
{
|
||||||
$oCriteria = new Criteria("workflow");
|
$oCriteria = new Criteria("workflow");
|
||||||
|
|
||||||
$oCriteria->addSelectColumn(AppCacheViewPeer::USR_UID);
|
$oCriteria->addSelectColumn(AppCacheViewPeer::USR_UID);
|
||||||
$oCriteria->addAsColumn("CNT", "COUNT(DISTINCT(APP_UID))");
|
$oCriteria->addAsColumn("CNT", "COUNT(DISTINCT(APP_CACHE_VIEW.APP_UID))");
|
||||||
|
|
||||||
|
$oCriteria->addJoin(AppCacheViewPeer::DEL_INDEX , AppDelayPeer::APP_DEL_INDEX, Criteria::LEFT_JOIN);
|
||||||
|
|
||||||
|
$oCriteria->add(
|
||||||
|
$oCriteria->getNewCriterion(AppDelayPeer::APP_TYPE, NULL, Criteria::ISNULL)->addOr(
|
||||||
|
$oCriteria->getNewCriterion(AppDelayPeer::APP_TYPE, 'REASSIGN', Criteria::NOT_EQUAL))
|
||||||
|
);
|
||||||
|
|
||||||
$oCriteria->addGroupByColumn(AppCacheViewPeer::USR_UID);
|
$oCriteria->addGroupByColumn(AppCacheViewPeer::USR_UID);
|
||||||
$dat = AppCacheViewPeer::doSelectRS($oCriteria);
|
$dat = AppCacheViewPeer::doSelectRS($oCriteria);
|
||||||
$dat->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$dat->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
$aRows = array();
|
$aRows = array();
|
||||||
|
|
||||||
while ($dat->next()) {
|
while ($dat->next()) {
|
||||||
$row = $dat->getRow();
|
$row = $dat->getRow();
|
||||||
|
|
||||||
$aRows[$row["USR_UID"]] = $row["CNT"];
|
$aRows[$row["USR_UID"]] = $row["CNT"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -666,11 +666,11 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
$this->Update( $Fields );
|
$this->Update( $Fields );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateNextRun ($sOption, $sValue = '', $sActualTime = '', $sDaysPerformTask = '', $sWeeks = '', $sStartDay = '', $sMonths = '', $currentDate = '')
|
public function updateNextRun($sOption, $sValue = "", $sActualTime = "", $sDaysPerformTask = "", $sWeeks = "", $sStartDay = "", $sMonths = "", $currentDate = "", $flagNextRun = true)
|
||||||
{
|
{
|
||||||
$nActualDate = $currentDate . " " . $sActualTime;
|
$nActualDate = $currentDate . " " . $sActualTime;
|
||||||
$dEstimatedDate = '';
|
$dEstimatedDate = '';
|
||||||
$sWeeks = trim($sWeeks, "|");
|
$sWeeks = trim($sWeeks, " |");
|
||||||
|
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case '1':
|
case '1':
|
||||||
@@ -694,48 +694,47 @@ class CaseScheduler extends BaseCaseScheduler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
if (strlen( $sWeeks ) > 0) {
|
if ($sWeeks != "") {
|
||||||
//die($sActualTime);
|
|
||||||
$nDayOfTheWeek = (int)(date("w", strtotime($sActualTime)));
|
|
||||||
//$nDayOfTheWeek = 1;
|
|
||||||
$aWeeks = explode( '|', $sWeeks );
|
|
||||||
$nFirstDay = (int)($aWeeks[0]) - 1;
|
|
||||||
$aDaysWeek = array ('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
|
$aDaysWeek = array ('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
|
||||||
$nDayOfTheWeek = ($nDayOfTheWeek == 0) ? 7 : $nDayOfTheWeek;
|
|
||||||
$day = 0;
|
|
||||||
$nSW = 0;
|
|
||||||
$flagIsTheSameDay = false;
|
|
||||||
|
|
||||||
foreach ($aWeeks as $value) {
|
$nDayOfTheWeek = (int)(date("w", strtotime($sActualTime)));
|
||||||
if ($nDayOfTheWeek <= (int)($value)) {
|
$nDayOfTheWeek = ($nDayOfTheWeek == 0)? 7 : $nDayOfTheWeek;
|
||||||
$day = (int)($value) - 1;
|
|
||||||
$nSW = 1;
|
$arrayWeekdays = explode("|", $sWeeks);
|
||||||
$flagIsTheSameDay = $nDayOfTheWeek == (int)($value);
|
$firstDay = (int)($arrayWeekdays[0]);
|
||||||
break;
|
|
||||||
|
$flagFound = $nDayOfTheWeek < $firstDay || in_array($nDayOfTheWeek, $arrayWeekdays);
|
||||||
|
|
||||||
|
if ($flagFound) {
|
||||||
|
$typeStatement = "this";
|
||||||
|
$indexDay = (in_array($nDayOfTheWeek, $arrayWeekdays))? $nDayOfTheWeek : $firstDay;
|
||||||
|
|
||||||
|
if ($flagNextRun) {
|
||||||
|
$index = array_search($nDayOfTheWeek, $arrayWeekdays);
|
||||||
|
|
||||||
|
if ($index !== false && isset($arrayWeekdays[$index + 1])) {
|
||||||
|
$indexDay = $arrayWeekdays[$index + 1];
|
||||||
|
} else {
|
||||||
|
$typeStatement = "next";
|
||||||
|
$indexDay = $firstDay;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($nSW == 1) {
|
$indexDay--;
|
||||||
$dEstimatedDate = date("Y-m-d", strtotime("$nActualDate " . (($flagIsTheSameDay)? "this" : "next") . " " . $aDaysWeek[$day])) . " " . date("H:i:s", strtotime($sActualTime));
|
|
||||||
|
$dEstimatedDate = date("Y-m-d", strtotime($nActualDate . " " . $typeStatement . " " . $aDaysWeek[$indexDay])) . " " . date("H:i:s", strtotime($sActualTime));
|
||||||
} else {
|
} else {
|
||||||
$nEveryDays = $sDaysPerformTask;
|
$nEveryDays = $sDaysPerformTask;
|
||||||
// $nEveryDays = '1';
|
|
||||||
if ($nFirstDay >= $nDayOfTheWeek || $nEveryDays == 1) {
|
$typeStatement = ($firstDay >= $nDayOfTheWeek || $nEveryDays == 1)? "next" : "last";
|
||||||
$sTypeOperation = "next";
|
$indexDay = $firstDay - 1;
|
||||||
} else {
|
|
||||||
$sTypeOperation = "last";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($nEveryDays == 1) {
|
if ($nEveryDays == 1) {
|
||||||
//echo "**** $nActualDate *" . $sTypeOperation . "* *" . $aDaysWeek[$nFirstDay] . '*****' . date('H:i:s', strtotime($sActualTime)). "**";
|
$dEstimatedDate = date("Y-m-d", strtotime($nActualDate . " " . $typeStatement . " " . $aDaysWeek[$indexDay])) . " " . date("H:i:s", strtotime($sActualTime));
|
||||||
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nActualDate " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
|
||||||
//echo "(date)*".$dEstimatedDate."*";
|
|
||||||
//die("01");
|
|
||||||
} else {
|
} else {
|
||||||
$nEveryDays = 1;
|
$nEveryDays = 1;
|
||||||
//$nActualDate = date('Y-m-d').' '.$sActualTime;
|
|
||||||
$nDataTmp = date( 'Y-m-d', strtotime( "$nActualDate + " . $nEveryDays . " Week" ) );
|
$nDataTmp = date( 'Y-m-d', strtotime( "$nActualDate + " . $nEveryDays . " Week" ) );
|
||||||
$dEstimatedDate = date( 'Y-m-d', strtotime( "$nDataTmp " . $sTypeOperation . " " . $aDaysWeek[$nFirstDay] ) ) . ' ' . date( 'H:i:s', strtotime( $sActualTime ) );
|
$dEstimatedDate = date("Y-m-d", strtotime($nDataTmp . " " . $typeStatement . " " . $aDaysWeek[$indexDay])) . " " . date("H:i:s", strtotime($sActualTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ class Content extends BaseContent
|
|||||||
$workSpace = new workspaceTools( $workSpace );
|
$workSpace = new workspaceTools( $workSpace );
|
||||||
$workSpace->getDBInfo();
|
$workSpace->getDBInfo();
|
||||||
|
|
||||||
$link = mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass) or die( "Could not connect" );
|
$link = @mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass) or die( "Could not connect" );
|
||||||
|
|
||||||
mysql_select_db( $workSpace->dbName, $link );
|
mysql_select_db( $workSpace->dbName, $link );
|
||||||
mysql_query( "SET NAMES 'utf8';" );
|
mysql_query( "SET NAMES 'utf8';" );
|
||||||
|
|||||||
@@ -150,8 +150,15 @@ class InputDocument extends BaseInputDocument
|
|||||||
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
||||||
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
||||||
}
|
}
|
||||||
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
$inputDocMaxFileSize = "";
|
||||||
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
if(!empty($aData['INP_DOC_MAX_FILESIZE'])){
|
||||||
|
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
||||||
|
$inputDocMaxFileSize = ", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
||||||
|
}
|
||||||
|
if(!empty($aData['INP_DOC_MAX_FILESIZE'])){
|
||||||
|
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'];
|
||||||
|
}
|
||||||
|
$description .= $inputDocMaxFileSize;
|
||||||
G::auditLog("CreateInputDocument", $description);
|
G::auditLog("CreateInputDocument", $description);
|
||||||
|
|
||||||
return $aData['INP_DOC_UID'];
|
return $aData['INP_DOC_UID'];
|
||||||
@@ -217,8 +224,15 @@ class InputDocument extends BaseInputDocument
|
|||||||
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
|
||||||
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
|
||||||
}
|
}
|
||||||
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
$inputDocMaxFileSize = "";
|
||||||
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
if(!empty($aData['INP_DOC_MAX_FILESIZE'])){
|
||||||
|
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
|
||||||
|
$inputDocMaxFileSize = ", Maximum Input Document file size: ".$inputDocMaxFileSize;
|
||||||
|
}
|
||||||
|
if(!empty($aData['INP_DOC_MAX_FILESIZE'])){
|
||||||
|
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'];
|
||||||
|
}
|
||||||
|
$description .= $inputDocMaxFileSize;
|
||||||
G::auditLog("UpdateInputDocument", $description);
|
G::auditLog("UpdateInputDocument", $description);
|
||||||
|
|
||||||
return $iResult;
|
return $iResult;
|
||||||
|
|||||||
@@ -178,7 +178,12 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
||||||
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
||||||
}
|
}
|
||||||
$description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR'].", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
|
||||||
|
$description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR'];
|
||||||
|
}
|
||||||
|
if(!empty($aData['OUT_DOC_GENERATE'])){
|
||||||
|
$description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
||||||
|
}
|
||||||
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
|
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
|
||||||
$pdfSecurity = 'Disabled';
|
$pdfSecurity = 'Disabled';
|
||||||
}else{
|
}else{
|
||||||
@@ -194,12 +199,14 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
if(!empty($aData['OUT_DOC_TAGS'])){
|
if(!empty($aData['OUT_DOC_TAGS'])){
|
||||||
$description .= ", Tags: ".$aData['OUT_DOC_TAGS'];
|
$description .= ", Tags: ".$aData['OUT_DOC_TAGS'];
|
||||||
}
|
}
|
||||||
if($aData['OUT_DOC_OPEN_TYPE']==0){
|
if(!empty($aData['OUT_DOC_OPEN_TYPE'])){
|
||||||
$genLink = 'Open the file';
|
if($aData['OUT_DOC_OPEN_TYPE']==0){
|
||||||
}else{
|
$genLink = 'Open the file';
|
||||||
$genLink = 'Download the file';
|
}else{
|
||||||
|
$genLink = 'Download the file';
|
||||||
|
}
|
||||||
|
$description .= ", By clicking on the generated file link: ".$genLink;
|
||||||
}
|
}
|
||||||
$description .= ", By clicking on the generated file link: ".$genLink;
|
|
||||||
G::auditLog("CreateOutputDocument", $description);
|
G::auditLog("CreateOutputDocument", $description);
|
||||||
|
|
||||||
return $aData['OUT_DOC_UID'];
|
return $aData['OUT_DOC_UID'];
|
||||||
@@ -261,7 +268,12 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
if(!empty($aData['OUT_DOC_DESCRIPTION'])){
|
||||||
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
$description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION'];
|
||||||
}
|
}
|
||||||
$description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR'].", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
|
||||||
|
$description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR'];
|
||||||
|
}
|
||||||
|
if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){
|
||||||
|
$description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE'];
|
||||||
|
}
|
||||||
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
|
if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){
|
||||||
$pdfSecurity = 'Disabled';
|
$pdfSecurity = 'Disabled';
|
||||||
}else{
|
}else{
|
||||||
@@ -277,12 +289,14 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
if(!empty($aData['OUT_DOC_TAGS'])){
|
if(!empty($aData['OUT_DOC_TAGS'])){
|
||||||
$description .= ", Tags: ".$aData['OUT_DOC_TAGS'];
|
$description .= ", Tags: ".$aData['OUT_DOC_TAGS'];
|
||||||
}
|
}
|
||||||
if($aData['OUT_DOC_OPEN_TYPE']==0){
|
if(!empty($aData['OUT_DOC_OPEN_TYPE'])){
|
||||||
$genLink = 'Open the file';
|
if($aData['OUT_DOC_OPEN_TYPE']==0){
|
||||||
}else{
|
$genLink = 'Open the file';
|
||||||
$genLink = 'Download the file';
|
}else{
|
||||||
|
$genLink = 'Download the file';
|
||||||
|
}
|
||||||
|
$description .= ", By clicking on the generated file link: ".$genLink;
|
||||||
}
|
}
|
||||||
$description .= ", By clicking on the generated file link: ".$genLink;
|
|
||||||
if (isset($aData['OUT_DOC_TEMPLATE'])) {
|
if (isset($aData['OUT_DOC_TEMPLATE'])) {
|
||||||
$description .= ", [EDIT TEMPLATE]";
|
$description .= ", [EDIT TEMPLATE]";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class webEntryProxy extends HttpProxyController
|
|||||||
file_put_contents( $fileName, $template->getOutputContent() );
|
file_put_contents( $fileName, $template->getOutputContent() );
|
||||||
//creating the third file, only if this wsClient.php file doesn't exists.
|
//creating the third file, only if this wsClient.php file doesn't exists.
|
||||||
$fileName = $pathProcess . 'wsClient.php';
|
$fileName = $pathProcess . 'wsClient.php';
|
||||||
$pluginTpl = PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . 'ws' . PATH_SEP . 'wsClient.php';
|
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
|
||||||
|
|
||||||
if (file_exists( $fileName )) {
|
if (file_exists( $fileName )) {
|
||||||
if (filesize( $fileName ) != filesize( $pluginTpl )) {
|
if (filesize( $fileName ) != filesize( $pluginTpl )) {
|
||||||
|
|||||||
20
workflow/engine/methods/cases/CaseSchedulerCreateUpdate.php
Normal file
20
workflow/engine/methods/cases/CaseSchedulerCreateUpdate.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
try {
|
||||||
|
if (!$_POST || count($_POST) == 0) {
|
||||||
|
throw new Exception("The information sent is empty.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$prossesUid = trim($_POST["form"]["PRO_UID"]);
|
||||||
|
$caseSchedulerUid = trim($_POST["form"]["SCH_UID"]);
|
||||||
|
|
||||||
|
$caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
|
||||||
|
|
||||||
|
$caseScheduler->createUpdate($caseSchedulerUid, $prossesUid, $_SESSION["USER_LOGGED"], $_POST["form"], (isset($_POST["pluginFields"]))? $_POST["pluginFields"] : array());
|
||||||
|
|
||||||
|
G::header("Location: cases_Scheduler_List?PRO_UID=" . $prossesUid);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update' );
|
$G_PUBLISH->AddContent("xmlform", "xmlform", "cases" . PATH_SEP . "cases_Scheduler_Edit.xml", "", $aFields, "CaseSchedulerCreateUpdate");
|
||||||
|
|
||||||
G::RenderPage( 'publishBlank', 'blank' );
|
G::RenderPage( 'publishBlank', 'blank' );
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ try {
|
|||||||
$aFields['SCH_LIST'] .= htmlspecialchars($item['SCH_NAME'], ENT_QUOTES) . '^';
|
$aFields['SCH_LIST'] .= htmlspecialchars($item['SCH_NAME'], ENT_QUOTES) . '^';
|
||||||
}
|
}
|
||||||
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save' );
|
$G_PUBLISH->AddContent("xmlform", "xmlform", "cases" . PATH_SEP . "cases_Scheduler_New.xml", "", $aFields, "CaseSchedulerCreateUpdate");
|
||||||
G::RenderPage( 'publishBlank', 'blank' );
|
G::RenderPage( 'publishBlank', 'blank' );
|
||||||
|
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
|
|||||||
@@ -1,265 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* cases_Scheduler_Save.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2010 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
/*
|
|
||||||
global $RBAC;
|
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
|
||||||
{
|
|
||||||
case -2:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
|
||||||
$oCaseScheduler = new CaseScheduler();
|
|
||||||
|
|
||||||
if (empty( $_POST )) {
|
|
||||||
die( 'The information sended is empty!' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$aData['SCH_UID'] = G::generateUniqueID();
|
|
||||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
|
||||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
|
||||||
$aData['SCH_DEL_USER_PASS'] = Bootstrap::hashPassword($_POST['form']['SCH_USER_PASSWORD']);
|
|
||||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
|
||||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
|
||||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
|
||||||
|
|
||||||
$aData['SCH_STATE'] = 'ACTIVE';
|
|
||||||
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
|
||||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
|
||||||
|
|
||||||
$sOption = $_POST['form']['SCH_OPTION'];
|
|
||||||
$aData['SCH_OPTION'] = $sOption;
|
|
||||||
|
|
||||||
if ($_POST['form']['SCH_START_DATE'] != '') {
|
|
||||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
|
||||||
} else {
|
|
||||||
$sDateTmp = date( 'Y-m-d' );
|
|
||||||
}
|
|
||||||
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
|
|
||||||
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
|
||||||
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
|
||||||
|
|
||||||
$nActualTime = $_POST['form']['SCH_START_TIME']; // time();
|
|
||||||
// $nActualDate = date("Y-m-d H:i:s", $nActualTime);
|
|
||||||
|
|
||||||
|
|
||||||
$sValue = '';
|
|
||||||
$sDaysPerformTask = '';
|
|
||||||
$sWeeks = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sStartDay = '';
|
|
||||||
$nSW = 0;
|
|
||||||
$aData['SCH_START_DAY'] = '';
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = '';
|
|
||||||
$aData['SCH_REPEAT_UNTIL'] = '';
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
|
||||||
switch ($sOption) {
|
|
||||||
case '1': // Option 1
|
|
||||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
|
||||||
switch ($sValue) {
|
|
||||||
case '1':
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
$aData['SCH_OPTION'] = '2';
|
|
||||||
$aData['SCH_EVERY_DAYS'] = '1';
|
|
||||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
|
||||||
break;
|
|
||||||
case '3': // Every [n] Days
|
|
||||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '2': // If the option is zero, set by default 1
|
|
||||||
if (empty( $_POST['form']['SCH_EVERY_DAYS'] )) {
|
|
||||||
$nEveryDays = 1;
|
|
||||||
} else {
|
|
||||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
|
||||||
}
|
|
||||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
|
||||||
$sWeeks = '';
|
|
||||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
|
|
||||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
|
||||||
foreach ($aWeekDays as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
|
|
||||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
|
||||||
foreach ($aWeekDays2 as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
|
||||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
|
||||||
break;
|
|
||||||
case '3':
|
|
||||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
|
||||||
if ($nStartDay == 1) {
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
|
||||||
} else {
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$sMonths = '';
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS'] )) {
|
|
||||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
|
||||||
foreach ($aMonths as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
|
|
||||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
|
||||||
foreach ($aMonths2 as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
|
|
||||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
|
||||||
foreach ($aMonths3 as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$aData['SCH_MONTHS'] = $sMonths;
|
|
||||||
$sStartDay = $aData['SCH_START_DAY'];
|
|
||||||
$sValue = $nStartDay;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
|
|
||||||
if ($sStartDay == '') {
|
|
||||||
$sStartDay = date( 'Y-m-d' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$dCurrentMonth = (int)(date("m"));
|
|
||||||
$dCurrentDay = (int)(date("d"));
|
|
||||||
$aStartDay = explode( "|", $aData['SCH_START_DAY'] );
|
|
||||||
if ($sOption == '3' && $aStartDay[0] == '1') {
|
|
||||||
$monthsArray = explode( "|", $sMonths );
|
|
||||||
foreach ($monthsArray as $row) {
|
|
||||||
if ((int)($row) == $dCurrentMonth && $dCurrentDay <= (int)($aStartDay[1])) {
|
|
||||||
$startTime = $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($sOption == '4') {
|
|
||||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
|
||||||
}
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
|
||||||
if ($sOption == 5) {
|
|
||||||
$aData['SCH_START_TIME'] = time();
|
|
||||||
$aData['SCH_START_DATE'] = $aData['SCH_START_TIME'];
|
|
||||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
|
||||||
$date = $aData['SCH_START_TIME'];
|
|
||||||
$date += $nextRun;
|
|
||||||
$date = date( "Y-m-d H:i", $date );
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
|
|
||||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
|
|
||||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
|
||||||
if ($nOptEvery == 2) {
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
|
||||||
} else {
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
|
||||||
$aData['CASE_SH_PLUGIN_UID'] = $_POST['form']['CASE_SH_PLUGIN_UID'];
|
|
||||||
}
|
|
||||||
//$aData['SCH_END_DATE'] = "2020-12-30";
|
|
||||||
$oCaseScheduler->create( $aData );
|
|
||||||
$sch_uid = $oCaseScheduler->getSchUid();
|
|
||||||
|
|
||||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
|
||||||
$params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
|
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
|
||||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
|
||||||
|
|
||||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
|
||||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
|
||||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
|
||||||
//Save the form
|
|
||||||
$oData = $_POST['pluginFields'];
|
|
||||||
$oData['SCH_UID'] = $aData['SCH_UID'];
|
|
||||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// //Added by Qennix
|
|
||||||
// //Update Start Time Event in BPMN
|
|
||||||
//
|
|
||||||
// echo $_POST['form']['TAS_UID']."<<----";
|
|
||||||
// if (isset($_POST['form']['TAS_UID'])){
|
|
||||||
// require_once 'classes/model/Event.php';
|
|
||||||
// require_once 'classes/model/Task.php';
|
|
||||||
// echo $_POST['form']['TAS_UID']."<<----";
|
|
||||||
//
|
|
||||||
// $oTask = new Task();
|
|
||||||
// $oTask->load($_POST['form']['TAS_UID']);
|
|
||||||
// $evn_uid = $oTask->getStartingEvent();
|
|
||||||
// $event = new Event();
|
|
||||||
// $editEvent = array();
|
|
||||||
// $editEvent['EVN_UID'] = $evn_uid;
|
|
||||||
// $editEvent['EVN_ACTION'] = $sch_uid;
|
|
||||||
// $event->update($editEvent);
|
|
||||||
// //End Adding
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
|
|
||||||
|
|
||||||
} catch (Exception $oException) {
|
|
||||||
die( $oException->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,290 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* cases_Scheduler_Save.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2010 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
/*
|
|
||||||
global $RBAC;
|
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
|
||||||
{
|
|
||||||
case -2:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
|
||||||
|
|
||||||
if (empty( $_POST )) {
|
|
||||||
die( 'The information sended is empty!' );
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($_POST["form"] as $key => $value) {
|
|
||||||
$_POST["form"][$key] = trim($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$aData = array();
|
|
||||||
$aData['SCH_UID'] = $_POST['form']['SCH_UID'];
|
|
||||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
|
||||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
|
||||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
|
||||||
|
|
||||||
$oCaseScheduler = new CaseScheduler();
|
|
||||||
$oCaseScheduler->Load( $aData['SCH_UID'] );
|
|
||||||
|
|
||||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
|
||||||
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM') {
|
|
||||||
$aData['SCH_DEL_USER_PASS'] = Bootstrap::hashPassword($_POST['form']['SCH_USER_PASSWORD']);
|
|
||||||
}
|
|
||||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
|
||||||
|
|
||||||
// $aData['SCH_TIME_NEXT_RUN'] = time();
|
|
||||||
//$aData['SCH_LAST_RUN_TIME'] = time();
|
|
||||||
// $aData['SCH_STATE'] = 'ACTIVE';
|
|
||||||
// $aData['SCH_LAST_STATE'] = 'ACTIVE';
|
|
||||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
|
||||||
|
|
||||||
$sOption = $_POST['form']['SCH_OPTION'];
|
|
||||||
$aData['SCH_OPTION'] = $sOption;
|
|
||||||
|
|
||||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
|
||||||
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
|
|
||||||
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
|
||||||
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
|
||||||
$previousStartTime = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
|
|
||||||
$previousStartDate = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
|
|
||||||
|
|
||||||
$sValue = '';
|
|
||||||
$sDaysPerformTask = '';
|
|
||||||
$sWeeks = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sStartDay = '';
|
|
||||||
$nSW = 0;
|
|
||||||
|
|
||||||
switch ($sOption) {
|
|
||||||
case '1':
|
|
||||||
// Option 1
|
|
||||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
|
||||||
switch ($sValue) {
|
|
||||||
case '1':
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
$aData['SCH_OPTION'] = '2';
|
|
||||||
$aData['SCH_EVERY_DAYS'] = '1';
|
|
||||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
|
||||||
break;
|
|
||||||
case '3': // Every [n] Days
|
|
||||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
// If the option is zero, set by default 1
|
|
||||||
if (empty( $_POST['form']['SCH_EVERY_DAYS'] )) {
|
|
||||||
$nEveryDays = 1;
|
|
||||||
} else {
|
|
||||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
|
||||||
}
|
|
||||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
|
||||||
$sWeeks = '';
|
|
||||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
|
|
||||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
|
||||||
foreach ($aWeekDays as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
|
|
||||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
|
||||||
foreach ($aWeekDays2 as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
|
||||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
|
||||||
break;
|
|
||||||
case '3':
|
|
||||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
|
||||||
if ($nStartDay == 1) {
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
|
||||||
} else {
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$sMonths = '';
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS'] )) {
|
|
||||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
|
||||||
foreach ($aMonths as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
|
|
||||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
|
||||||
foreach ($aMonths2 as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
|
|
||||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
|
||||||
foreach ($aMonths3 as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$aData['SCH_MONTHS'] = $sMonths;
|
|
||||||
$sStartDay = $aData['SCH_START_DAY'];
|
|
||||||
$sValue = $nStartDay;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
|
|
||||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
|
||||||
}
|
|
||||||
// if the start date has changed then recalculate the next run time
|
|
||||||
if ($_POST['form']['SCH_START_DATE'] == $_POST['form']['PREV_SCH_START_DATE']) {
|
|
||||||
$recalculateDate = false;
|
|
||||||
} else {
|
|
||||||
$recalculateDate = true;
|
|
||||||
}
|
|
||||||
if (date( 'H:i:s', strtotime( $_POST['form']['SCH_START_TIME'] ) ) == date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) )) {
|
|
||||||
$recalculateTime = false;
|
|
||||||
} else {
|
|
||||||
$recalculateTime = true;
|
|
||||||
}
|
|
||||||
// if the start date has changed then recalculate the next run time
|
|
||||||
|
|
||||||
|
|
||||||
// var_dump($recalculateTime);
|
|
||||||
// die();
|
|
||||||
$nActualTime = $_POST['form']['SCH_START_TIME'];
|
|
||||||
if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
|
|
||||||
if ($sStartDay == '') {
|
|
||||||
$sStartDay = date( 'Y-m-d' );
|
|
||||||
}
|
|
||||||
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
|
|
||||||
$dCurrentDay = date( "d" );
|
|
||||||
$dCurrentMonth = date( "m" );
|
|
||||||
$aStartDay = explode( "|", $aData['SCH_START_DAY'] );
|
|
||||||
if ($sOption == '3' && $aStartDay[0] == '1') {
|
|
||||||
$monthsArray = explode( "|", $sMonths );
|
|
||||||
foreach ($monthsArray as $row) {
|
|
||||||
if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
|
|
||||||
$startTime = $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
if ($recalculateDate) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
|
||||||
} elseif ($recalculateTime) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
if ($recalculateDate) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
|
||||||
} elseif ($recalculateTime) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($recalculateDate) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
|
||||||
} elseif ($recalculateTime) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
|
||||||
// die;
|
|
||||||
} else {
|
|
||||||
if ($sOption == '4') {
|
|
||||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
|
||||||
}
|
|
||||||
if ($recalculateDate) {
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
|
||||||
} elseif ($recalculateTime) {
|
|
||||||
|
|
||||||
// $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
|
|
||||||
// $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE'];
|
|
||||||
// $Fields['SCH_STATE'] = 'PROCESSED';
|
|
||||||
// $this->Update($Fields);
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
|
||||||
}
|
|
||||||
// var_dump($recalculateTime);
|
|
||||||
// var_dump($aData['SCH_TIME_NEXT_RUN']);
|
|
||||||
// die;
|
|
||||||
if ($sOption == '5') {
|
|
||||||
$date = $oCaseScheduler->getSchLastRunTime();
|
|
||||||
if ($date == null) {
|
|
||||||
$date = $oCaseScheduler->getSchStartTime();
|
|
||||||
}
|
|
||||||
$date = strtotime( $date );
|
|
||||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
|
||||||
$date += $nextRun;
|
|
||||||
$date = date( "Y-m-d H:i", $date );
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
|
|
||||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
|
||||||
if ($nOptEvery == 2) {
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
|
||||||
} else {
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// var_dump ($aData['SCH_TIME_NEXT_RUN']);
|
|
||||||
// die;
|
|
||||||
$oCaseScheduler->Update( $aData );
|
|
||||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
|
||||||
$params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
|
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
|
||||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
|
||||||
|
|
||||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
|
||||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
|
||||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
|
||||||
//Save the form
|
|
||||||
$oData = $_POST['pluginFields'];
|
|
||||||
$oData['SCH_UID'] = $aData['SCH_UID'];
|
|
||||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
|
|
||||||
|
|
||||||
} catch (Exception $oException) {
|
|
||||||
die( $oException->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -32,11 +32,7 @@ try {
|
|||||||
throw (new Exception( G::LoadTranslation('ID_TASK') . "'" . $TaskFields['TAS_TITLE'] . "'" . G::LoadTranslation('ID_NOT_HAVE_USERS')));
|
throw (new Exception( G::LoadTranslation('ID_TASK') . "'" . $TaskFields['TAS_TITLE'] . "'" . G::LoadTranslation('ID_NOT_HAVE_USERS')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G::is_https())
|
$http = (G::is_https())? "https://" : "http://";
|
||||||
$http = 'https://';
|
|
||||||
else
|
|
||||||
$http = 'http://';
|
|
||||||
|
|
||||||
$sContent = '';
|
$sContent = '';
|
||||||
|
|
||||||
$infoProcess = new Process();
|
$infoProcess = new Process();
|
||||||
@@ -94,7 +90,7 @@ try {
|
|||||||
file_put_contents( $fileName, $template->getOutputContent() );
|
file_put_contents( $fileName, $template->getOutputContent() );
|
||||||
//creating the third file, only if this wsClient.php file doesn't exist.
|
//creating the third file, only if this wsClient.php file doesn't exist.
|
||||||
$fileName = $pathProcess . 'wsClient.php';
|
$fileName = $pathProcess . 'wsClient.php';
|
||||||
$pluginTpl = file_exists(PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . 'ws' . PATH_SEP . 'wsClient.php') ? PATH_CORE . 'test' . PATH_SEP . 'unit' . PATH_SEP . 'ws' . PATH_SEP . 'wsClient.php' : PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'wsClient.php';
|
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
|
||||||
if (file_exists( $fileName )) {
|
if (file_exists( $fileName )) {
|
||||||
if (filesize( $fileName ) != filesize( $pluginTpl )) {
|
if (filesize( $fileName ) != filesize( $pluginTpl )) {
|
||||||
@copy( $fileName, $pathProcess . 'wsClient.php.bck' );
|
@copy( $fileName, $pathProcess . 'wsClient.php.bck' );
|
||||||
|
|||||||
@@ -787,6 +787,11 @@ form.formDefault .content,
|
|||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
border: #dddddd 1px solid;
|
border: #dddddd 1px solid;
|
||||||
}
|
}
|
||||||
|
@media screen\0 {
|
||||||
|
form.formDefault .content, .pagedTableDefault {
|
||||||
|
width:450px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.pagedTableDefault {
|
.pagedTableDefault {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|||||||
@@ -825,5 +825,360 @@ class CaseScheduler
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create/Update CaseScheduler
|
||||||
|
*
|
||||||
|
* @param string $caseSchedulerUid Unique id of CaseScheduler
|
||||||
|
* @param string $projectUid Unique id of Project
|
||||||
|
* @param string $userUidCreatorUpdater Unique id of creator/updater User
|
||||||
|
* @param array $arrayData Data
|
||||||
|
* @param array $arrayDataPlugin Data plugin
|
||||||
|
*
|
||||||
|
* return void
|
||||||
|
*/
|
||||||
|
public function createUpdate($caseSchedulerUid, $projectUid, $userUidCreatorUpdater, array $arrayData, array $arrayDataPlugin = array())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
//Set variables
|
||||||
|
$flagInsert = ($caseSchedulerUid == "")? true : false;
|
||||||
|
$option = ($flagInsert)? "INS" : "UPD";
|
||||||
|
|
||||||
|
//Set data
|
||||||
|
if ($flagInsert) {
|
||||||
|
$caseSchedulerUid = \ProcessMaker\Util\Common::generateUID();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($arrayData as $key => $value) {
|
||||||
|
if (is_array($value)) {
|
||||||
|
foreach ($value as $key2 => $value2) {
|
||||||
|
$arrayData[$key][$key2] = trim($value2);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$arrayData[$key] = trim($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData = array();
|
||||||
|
$arrayCaseSchedulerData["SCH_UID"] = $caseSchedulerUid;
|
||||||
|
$arrayCaseSchedulerData["SCH_NAME"] = $arrayData["SCH_NAME"];
|
||||||
|
$arrayCaseSchedulerData["PRO_UID"] = $projectUid;
|
||||||
|
$arrayCaseSchedulerData["TAS_UID"] = $arrayData["TAS_UID"];
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData["SCH_DEL_USER_UID"] = $arrayData["SCH_USER_UID"];
|
||||||
|
$arrayCaseSchedulerData["SCH_DEL_USER_NAME"] = $arrayData["SCH_USER_NAME"];
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData["SCH_STATE"] = "ACTIVE";
|
||||||
|
$arrayCaseSchedulerData["SCH_LAST_STATE"] = "CREATED";
|
||||||
|
|
||||||
|
$sDateTmp = ($arrayData["SCH_START_DATE"] != "")? $arrayData["SCH_START_DATE"] : date("Y-m-d");
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
if ($arrayData["SCH_USER_PASSWORD"] != "DefaultPM") {
|
||||||
|
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sDateTmp = $arrayData["SCH_START_DATE"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$caseSchedulerOption = (int)($arrayData["SCH_OPTION"]);
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData["USR_UID"] = $userUidCreatorUpdater;
|
||||||
|
$arrayCaseSchedulerData["SCH_OPTION"] = $caseSchedulerOption;
|
||||||
|
$arrayCaseSchedulerData["SCH_START_TIME"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
|
||||||
|
$arrayCaseSchedulerData["SCH_START_DATE"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
|
||||||
|
|
||||||
|
$sValue = "";
|
||||||
|
$sDaysPerformTask = "";
|
||||||
|
$sWeeks = "";
|
||||||
|
$sMonths = "";
|
||||||
|
$sStartDay = "";
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
$arrayCaseSchedulerData["SCH_START_DAY"] = "";
|
||||||
|
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = "";
|
||||||
|
$arrayCaseSchedulerData["SCH_REPEAT_UNTIL"] = "";
|
||||||
|
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = "";
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($caseSchedulerOption) {
|
||||||
|
case 1:
|
||||||
|
//Option 1
|
||||||
|
$sValue = $arrayData["SCH_DAYS_PERFORM_TASK"];
|
||||||
|
|
||||||
|
switch ($sValue) {
|
||||||
|
case "1":
|
||||||
|
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = $arrayData["SCH_DAYS_PERFORM_TASK"] . "|1";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
$arrayCaseSchedulerData["SCH_OPTION"] = "2";
|
||||||
|
$arrayCaseSchedulerData["SCH_EVERY_DAYS"] = "1";
|
||||||
|
$arrayCaseSchedulerData["SCH_WEEK_DAYS"] = "1|2|3|4|5|";
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
//Every [n] Days
|
||||||
|
$sDaysPerformTask = $arrayData["SCH_DAYS_PERFORM_TASK_OPT_3"];
|
||||||
|
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = $arrayData["SCH_DAYS_PERFORM_TASK"] . "|" . $arrayData["SCH_DAYS_PERFORM_TASK_OPT_3"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
//If the option is zero, set by default 1
|
||||||
|
$arrayCaseSchedulerData["SCH_EVERY_DAYS"] = (empty($arrayData["SCH_EVERY_DAYS"]))? 1 : $arrayData["SCH_EVERY_DAYS"];
|
||||||
|
|
||||||
|
$sWeeks = "";
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_WEEK_DAYS"])) {
|
||||||
|
$aWeekDays = $arrayData["SCH_WEEK_DAYS"];
|
||||||
|
|
||||||
|
foreach ($aWeekDays as $value) {
|
||||||
|
$sWeeks = $sWeeks . $value . "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_WEEK_DAYS_2"])) {
|
||||||
|
$aWeekDays2 = $arrayData["SCH_WEEK_DAYS_2"];
|
||||||
|
|
||||||
|
foreach ($aWeekDays2 as $value) {
|
||||||
|
$sWeeks = $sWeeks . $value . "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sStartTime = $arrayData["SCH_START_TIME"];
|
||||||
|
$arrayCaseSchedulerData["SCH_WEEK_DAYS"] = $sWeeks;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$nStartDay = $arrayData["SCH_START_DAY"];
|
||||||
|
|
||||||
|
if ($nStartDay == 1) {
|
||||||
|
$arrayCaseSchedulerData["SCH_START_DAY"] = $nStartDay . "|" . $arrayData["SCH_START_DAY_OPT_1"];
|
||||||
|
} else {
|
||||||
|
$arrayCaseSchedulerData["SCH_START_DAY"] = $nStartDay . "|" . $arrayData["SCH_START_DAY_OPT_2_WEEKS"] . "|" . $arrayData["SCH_START_DAY_OPT_2_DAYS_WEEK"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$sMonths = "";
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_MONTHS"])) {
|
||||||
|
$aMonths = $arrayData["SCH_MONTHS"];
|
||||||
|
|
||||||
|
foreach ($aMonths as $value) {
|
||||||
|
$sMonths = $sMonths . $value . "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_MONTHS_2"])) {
|
||||||
|
$aMonths2 = $arrayData["SCH_MONTHS_2"];
|
||||||
|
|
||||||
|
foreach ($aMonths2 as $value) {
|
||||||
|
$sMonths = $sMonths . $value . "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_MONTHS_3"])) {
|
||||||
|
$aMonths3 = $arrayData["SCH_MONTHS_3"];
|
||||||
|
|
||||||
|
foreach ($aMonths3 as $value) {
|
||||||
|
$sMonths = $sMonths . $value . "|";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData["SCH_MONTHS"] = $sMonths;
|
||||||
|
$sStartDay = $arrayCaseSchedulerData["SCH_START_DAY"];
|
||||||
|
$sValue = $nStartDay;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$caseScheduler = new \CaseScheduler();
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
$arrayDataAux = $caseScheduler->load($caseSchedulerUid);
|
||||||
|
|
||||||
|
if ($arrayData["SCH_END_DATE"] != "") {
|
||||||
|
$arrayCaseSchedulerData["SCH_END_DATE"] = $arrayData["SCH_END_DATE"];
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the start date has changed then recalculate the next run time
|
||||||
|
$recalculateDate = ($arrayData["SCH_START_DATE"] == $arrayData["PREV_SCH_START_DATE"])? false : true;
|
||||||
|
$recalculateTime = (date("H:i:s", strtotime($arrayData["SCH_START_TIME"])) == date("H:i:s", strtotime($arrayData["PREV_SCH_START_TIME"])))? false : true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$nActualTime = $arrayData["SCH_START_TIME"];
|
||||||
|
|
||||||
|
if ($caseSchedulerOption != 1 && $caseSchedulerOption != 4 && $caseSchedulerOption != 5) {
|
||||||
|
if ($sStartDay == "") {
|
||||||
|
$sStartDay = date("Y-m-d");
|
||||||
|
}
|
||||||
|
|
||||||
|
$dCurrentDay = (int)(date("d"));
|
||||||
|
$dCurrentMonth = (int)(date("m"));
|
||||||
|
|
||||||
|
$aStartDay = explode("|", $arrayCaseSchedulerData["SCH_START_DAY"]);
|
||||||
|
|
||||||
|
if ($caseSchedulerOption == 3 && $aStartDay[0] == "1") {
|
||||||
|
$monthsArray = explode("|", $sMonths);
|
||||||
|
|
||||||
|
foreach ($monthsArray as $row) {
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
if ((int)($row) == $dCurrentMonth && $dCurrentDay <= (int)($aStartDay[1])) {
|
||||||
|
$startTime = $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = date("Y") . "-" . $row . "-" . $aStartDay[1] . " " . $startTime;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->updateNextRun($caseSchedulerOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
|
||||||
|
$startTime = $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
|
||||||
|
if ($recalculateDate) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = date("Y") . "-" . $row . "-" . $aStartDay[1] . " " . $startTime;
|
||||||
|
} else {
|
||||||
|
if ($recalculateTime) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->getSchTimeNextRun("Y-m-d") . " " . $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if ($recalculateDate) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->updateNextRun($caseSchedulerOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp, false);
|
||||||
|
} else {
|
||||||
|
if ($recalculateTime) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->getSchTimeNextRun("Y-m-d") . " " . $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->updateNextRun($caseSchedulerOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp, false);
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
if ($recalculateDate) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->updateNextRun($caseSchedulerOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp, false);
|
||||||
|
} else {
|
||||||
|
if ($recalculateTime) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->getSchTimeNextRun("Y-m-d") . " " . $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($caseSchedulerOption == 4) {
|
||||||
|
$arrayCaseSchedulerData["SCH_END_DATE"] = $arrayCaseSchedulerData["SCH_START_TIME"];
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $arrayCaseSchedulerData["SCH_START_TIME"];
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
if ($recalculateDate) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $arrayCaseSchedulerData["SCH_START_TIME"];
|
||||||
|
} else {
|
||||||
|
if ($recalculateTime) {
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = $caseScheduler->getSchTimeNextRun("Y-m-d") . " " . $arrayData["SCH_START_TIME"] . ":00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($caseSchedulerOption == 5) {
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
$arrayCaseSchedulerData["SCH_START_TIME"] = time();
|
||||||
|
$arrayCaseSchedulerData["SCH_START_DATE"] = $arrayCaseSchedulerData["SCH_START_TIME"];
|
||||||
|
|
||||||
|
$date = $arrayCaseSchedulerData["SCH_START_TIME"];
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
$date = $caseScheduler->getSchLastRunTime();
|
||||||
|
|
||||||
|
if (is_null($date)) {
|
||||||
|
$date = $caseScheduler->getSchStartTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
$date = strtotime($date);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = $arrayData["SCH_REPEAT_EVERY"];
|
||||||
|
$arrayCaseSchedulerData["SCH_TIME_NEXT_RUN"] = date("Y-m-d H:i", $date + (((int)($arrayData["SCH_REPEAT_EVERY"])) * 60 * 60));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
if ($arrayData["SCH_END_DATE"] != "") {
|
||||||
|
$arrayCaseSchedulerData["SCH_END_DATE"] = $arrayData["SCH_END_DATE"];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($arrayData["SCH_REPEAT_TASK_CHK"])) {
|
||||||
|
if ($arrayData["SCH_REPEAT_EVERY_OPT"] . "" == "2") {
|
||||||
|
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = ((int)($arrayData["SCH_REPEAT_EVERY"])) * 60;
|
||||||
|
} else {
|
||||||
|
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = (int)($arrayData["SCH_REPEAT_EVERY"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create/Update
|
||||||
|
switch ($option) {
|
||||||
|
case "INS":
|
||||||
|
if (isset($arrayData["CASE_SH_PLUGIN_UID"]) && $arrayData["CASE_SH_PLUGIN_UID"] != "") {
|
||||||
|
$arrayCaseSchedulerData["CASE_SH_PLUGIN_UID"] = $arrayData["CASE_SH_PLUGIN_UID"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$caseScheduler->create($arrayCaseSchedulerData);
|
||||||
|
break;
|
||||||
|
case "UPD":
|
||||||
|
$caseScheduler->update($arrayCaseSchedulerData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Plugin
|
||||||
|
if (isset($arrayData["CASE_SH_PLUGIN_UID"]) && $arrayData["CASE_SH_PLUGIN_UID"] != "") {
|
||||||
|
$oPluginRegistry = &\PMPluginRegistry::getSingleton();
|
||||||
|
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||||
|
|
||||||
|
$params = explode("--", $arrayData["CASE_SH_PLUGIN_UID"]);
|
||||||
|
|
||||||
|
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||||
|
if ($caseSchedulerPluginDetail->sNamespace == $params[0] && $caseSchedulerPluginDetail->sActionId == $params[1]) {
|
||||||
|
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($caseSchedulerSelected) && is_object($caseSchedulerSelected)) {
|
||||||
|
//Save the form
|
||||||
|
$arrayDataPlugin["SCH_UID"] = $arrayCaseSchedulerData["SCH_UID"];
|
||||||
|
$oPluginRegistry->executeMethod($caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $arrayDataPlugin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,8 @@ class FilesManager
|
|||||||
$oProcessFiles->setPrfCreateDate($sDate);
|
$oProcessFiles->setPrfCreateDate($sDate);
|
||||||
$oProcessFiles->save();
|
$oProcessFiles->save();
|
||||||
$fp = fopen($sDirectory, 'w');
|
$fp = fopen($sDirectory, 'w');
|
||||||
$content = $aData['prf_content'];
|
$content = stripslashes($aData['prf_content']);
|
||||||
|
$content = str_replace("@amp@", "&", $content);
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
@@ -372,7 +373,8 @@ class FilesManager
|
|||||||
$oProcessFiles->setPrfUpdateDate($sDate);
|
$oProcessFiles->setPrfUpdateDate($sDate);
|
||||||
$oProcessFiles->save();
|
$oProcessFiles->save();
|
||||||
$fp = fopen($path, 'w');
|
$fp = fopen($path, 'w');
|
||||||
$content = $aData['prf_content'];
|
$content = stripslashes($aData['prf_content']);
|
||||||
|
$content = str_replace("@amp@", "&", $content);
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
|
|||||||
@@ -333,6 +333,8 @@ class OutputDocument
|
|||||||
$oOutputDocument->setOutDocFilename($outputDocumentData['OUT_DOC_FILENAME']);
|
$oOutputDocument->setOutDocFilename($outputDocumentData['OUT_DOC_FILENAME']);
|
||||||
}
|
}
|
||||||
if (isset($outputDocumentData['OUT_DOC_TEMPLATE'])) {
|
if (isset($outputDocumentData['OUT_DOC_TEMPLATE'])) {
|
||||||
|
$outputDocumentData['OUT_DOC_TEMPLATE'] = stripslashes($outputDocumentData['OUT_DOC_TEMPLATE']);
|
||||||
|
$outputDocumentData['OUT_DOC_TEMPLATE'] = str_replace("@amp@", "&", $outputDocumentData['OUT_DOC_TEMPLATE']);
|
||||||
$oOutputDocument->setOutDocTemplate($outputDocumentData['OUT_DOC_TEMPLATE']);
|
$oOutputDocument->setOutDocTemplate($outputDocumentData['OUT_DOC_TEMPLATE']);
|
||||||
}
|
}
|
||||||
$oOutputDocument->save();
|
$oOutputDocument->save();
|
||||||
|
|||||||
@@ -384,18 +384,20 @@ class Task
|
|||||||
|
|
||||||
$result = $task->update($arrayProperty);
|
$result = $task->update($arrayProperty);
|
||||||
if (!empty($arrayProperty['CONSOLIDATE_DATA'])) {
|
if (!empty($arrayProperty['CONSOLIDATE_DATA'])) {
|
||||||
G::LoadClass("consolidatedCases");
|
if (isset($arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'])) {
|
||||||
$consolidated = new \ConsolidatedCases();
|
G::LoadClass("consolidatedCases");
|
||||||
$dataConso = array(
|
$consolidated = new \ConsolidatedCases();
|
||||||
'con_status' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_enable'],
|
$dataConso = array(
|
||||||
'tas_uid' => $arrayProperty['TAS_UID'],
|
'con_status' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_enable'],
|
||||||
'dyn_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'],
|
'tas_uid' => $arrayProperty['TAS_UID'],
|
||||||
'pro_uid' => $arrayProperty['PRO_UID'],
|
'dyn_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'],
|
||||||
'rep_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_report_table'],
|
'pro_uid' => $arrayProperty['PRO_UID'],
|
||||||
'table_name' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_table'],
|
'rep_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_report_table'],
|
||||||
'title' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_title']
|
'table_name' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_table'],
|
||||||
);
|
'title' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_title']
|
||||||
$consolidated->saveConsolidated($dataConso);
|
);
|
||||||
|
$consolidated->saveConsolidated($dataConso);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$arrayResult["status"] = "OK";
|
$arrayResult["status"] = "OK";
|
||||||
|
|
||||||
|
|||||||
@@ -396,14 +396,13 @@ class WebEntry
|
|||||||
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
|
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
|
||||||
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
|
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
|
||||||
|
|
||||||
|
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
|
||||||
$fileContent .= "G::LoadClass('pmDynaform');\n";
|
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
|
||||||
$fileContent .= "\$a = new pmDynaform(array('CURRENT_DYNAFORM'=>'" . $arrayWebEntryData["DYN_UID"] . "'));\n";
|
$fileContent .= "if (\$a->isResponsive()) {";
|
||||||
$fileContent .= "if(\$a->isResponsive()){";
|
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");";
|
||||||
$fileContent .= "\$a->printWebEntry('".$fileName."Post.php');";
|
$fileContent .= "} else {";
|
||||||
$fileContent .= "}else {";
|
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
|
||||||
$fileContent .= "\$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . "/" . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
|
$fileContent .= " G::RenderPage(\"publish\", \"blank\");";
|
||||||
$fileContent .= "G::RenderPage(\"publish\", \"blank\");";
|
|
||||||
$fileContent .= "}";
|
$fileContent .= "}";
|
||||||
|
|
||||||
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
|
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
|
||||||
@@ -442,7 +441,7 @@ class WebEntry
|
|||||||
|
|
||||||
//Creating the third file, only if this wsClient.php file doesn't exist.
|
//Creating the third file, only if this wsClient.php file doesn't exist.
|
||||||
$fileName = $pathDataPublicProcess . PATH_SEP . "wsClient.php";
|
$fileName = $pathDataPublicProcess . PATH_SEP . "wsClient.php";
|
||||||
$pluginTpl = PATH_TEST . "unit" . PATH_SEP . "ws" . PATH_SEP . "wsClient.php";
|
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
|
||||||
|
|
||||||
if (file_exists($fileName)) {
|
if (file_exists($fileName)) {
|
||||||
if (filesize($fileName) != filesize($pluginTpl)) {
|
if (filesize($fileName) != filesize($pluginTpl)) {
|
||||||
|
|||||||
@@ -119,14 +119,16 @@ class Activity extends Api
|
|||||||
$task = new \ProcessMaker\BusinessModel\Task();
|
$task = new \ProcessMaker\BusinessModel\Task();
|
||||||
$properties = $task->updateProperties($prj_uid, $act_uid, $request_data);
|
$properties = $task->updateProperties($prj_uid, $act_uid, $request_data);
|
||||||
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
if (\PMLicensedFeatures
|
if (\PMLicensedFeatures
|
||||||
::getSingleton()
|
::getSingleton()
|
||||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||||
$actionsByEmailService = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
if (isset($request_data['properties']['_features'])) {
|
||||||
$actionsByEmailService->saveConfiguration($request_data['properties']['_features']);
|
$actionsByEmailService = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
||||||
|
$actionsByEmailService->saveConfiguration($request_data['properties']['_features']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -642,9 +642,8 @@ ImportPMTableCSV = function(){
|
|||||||
waitTitle : " ",
|
waitTitle : " ",
|
||||||
success : function(o, resp){
|
success : function(o, resp){
|
||||||
w.close();
|
w.close();
|
||||||
infoGrid.store.reload();
|
|
||||||
|
|
||||||
PMExt.notify('IMPORT RESULT', resp.result.message);
|
PMExt.notify('IMPORT RESULT', resp.result.message);
|
||||||
|
setTimeout(function(){location.reload();},1500);
|
||||||
},
|
},
|
||||||
failure: function(o, resp){
|
failure: function(o, resp){
|
||||||
w.close();
|
w.close();
|
||||||
|
|||||||
@@ -9,11 +9,9 @@
|
|||||||
<PROPERTIES_INF type="subtitle" enablehtml="1">
|
<PROPERTIES_INF type="subtitle" enablehtml="1">
|
||||||
<en><![CDATA[Enter the username and password of the user who will be assigned to the initial task in the case.]]></en>
|
<en><![CDATA[Enter the username and password of the user who will be assigned to the initial task in the case.]]></en>
|
||||||
</PROPERTIES_INF>
|
</PROPERTIES_INF>
|
||||||
<SCH_UID type="hidden"><![CDATA[ SELECT count( * )+1 AS UID FROM CASE_SCHEDULER ]]><en/></SCH_UID>
|
<SCH_UID type="hidden" />
|
||||||
<SCH_LIST type="hidden">
|
<SCH_LIST type="hidden" />
|
||||||
</SCH_LIST>
|
<PHP_CURRENT_DATE type="hidden" />
|
||||||
<PHP_CURRENT_DATE type="hidden">
|
|
||||||
</PHP_CURRENT_DATE>
|
|
||||||
<SCH_USER_NAME type="text" maxlength="100" validate="Any" required="1" readonly="0" size="40" mode="edit">
|
<SCH_USER_NAME type="text" maxlength="100" validate="Any" required="1" readonly="0" size="40" mode="edit">
|
||||||
<en><![CDATA[User Name]]></en>
|
<en><![CDATA[User Name]]></en>
|
||||||
</SCH_USER_NAME>
|
</SCH_USER_NAME>
|
||||||
|
|||||||
@@ -318,7 +318,8 @@
|
|||||||
if ( defined('SYS_TEMP') && SYS_TEMP != '') {
|
if ( defined('SYS_TEMP') && SYS_TEMP != '') {
|
||||||
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
|
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
|
||||||
if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) {
|
if ( file_exists( PATH_DB . SYS_TEMP . '/db.php' ) ) {
|
||||||
require_once( PATH_DB . SYS_TEMP . '/db.php' );
|
$pathFile = $filter->validateInput(PATH_DB . SYS_TEMP . '/db.php','path');
|
||||||
|
require_once( $pathFile );
|
||||||
define ( 'SYS_SYS' , SYS_TEMP );
|
define ( 'SYS_SYS' , SYS_TEMP );
|
||||||
|
|
||||||
// defining constant for workspace shared directory
|
// defining constant for workspace shared directory
|
||||||
@@ -348,7 +349,8 @@
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
if (substr(SYS_SKIN, 0, 2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
if (substr(SYS_SKIN, 0, 2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
||||||
require_once PATH_CONTROLLERS . 'main.php';
|
$pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
|
||||||
|
require_once $pathFile;
|
||||||
$controllerClass = 'Main';
|
$controllerClass = 'Main';
|
||||||
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
||||||
//if the method exists
|
//if the method exists
|
||||||
@@ -552,7 +554,8 @@
|
|||||||
|
|
||||||
//erik: verify if it is a Controller Class or httpProxyController Class
|
//erik: verify if it is a Controller Class or httpProxyController Class
|
||||||
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
|
if (is_file(PATH_CONTROLLERS . SYS_COLLECTION . '.php')) {
|
||||||
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php';
|
$pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
|
||||||
|
require_once $pathFile;
|
||||||
$controllerClass = SYS_COLLECTION;
|
$controllerClass = SYS_COLLECTION;
|
||||||
//if the method name is empty set default to index method
|
//if the method name is empty set default to index method
|
||||||
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
|
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
|
||||||
|
|||||||
@@ -340,6 +340,9 @@ Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class");
|
|||||||
//Loading the autoloader libraries feature
|
//Loading the autoloader libraries feature
|
||||||
Bootstrap::registerSystemClasses();
|
Bootstrap::registerSystemClasses();
|
||||||
|
|
||||||
|
//Load filter class
|
||||||
|
G::LoadSystem('inputfilter');
|
||||||
|
$filter = new InputFilter();
|
||||||
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
|
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
|
||||||
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
|
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
|
||||||
|
|
||||||
@@ -373,10 +376,6 @@ $virtualURITable['/skins/(*)'] = PATH_HTML . 'skins/'; //ugly
|
|||||||
$virtualURITable['/images/(*)'] = PATH_HTML . 'images/'; //ugly
|
$virtualURITable['/images/(*)'] = PATH_HTML . 'images/'; //ugly
|
||||||
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}/'] = 'errorFile';
|
$virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}/'] = 'errorFile';
|
||||||
|
|
||||||
//Load filter class
|
|
||||||
G::LoadSystem('inputfilter');
|
|
||||||
$filter = new InputFilter();
|
|
||||||
|
|
||||||
// Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page
|
// Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page
|
||||||
if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath )) {
|
if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath )) {
|
||||||
// review if the file requested belongs to public_html plugin
|
// review if the file requested belongs to public_html plugin
|
||||||
@@ -489,8 +488,9 @@ if (defined( 'PATH_DATA' ) && file_exists( PATH_DATA )) {
|
|||||||
Bootstrap::LoadClass( 'serverConfiguration' );
|
Bootstrap::LoadClass( 'serverConfiguration' );
|
||||||
$oServerConf = & serverConf::getSingleton();
|
$oServerConf = & serverConf::getSingleton();
|
||||||
}
|
}
|
||||||
|
$pathFile = PATH_THIRDPARTY . '/pear/PEAR.php';
|
||||||
require_once PATH_THIRDPARTY . '/pear/PEAR.php';
|
$pathFile = $filter->validateInput($pathFile,'path');
|
||||||
|
require_once $pathFile;
|
||||||
|
|
||||||
//Bootstrap::LoadSystem( 'pmException' );
|
//Bootstrap::LoadSystem( 'pmException' );
|
||||||
|
|
||||||
@@ -504,7 +504,9 @@ if (! defined( 'PATH_DATA' ) || ! file_exists( PATH_DATA )) {
|
|||||||
define( 'PATH_DATA', PATH_C );
|
define( 'PATH_DATA', PATH_C );
|
||||||
//NewRelic Snippet - By JHL
|
//NewRelic Snippet - By JHL
|
||||||
transactionLog(PATH_CONTROLLERS.'installer.php');
|
transactionLog(PATH_CONTROLLERS.'installer.php');
|
||||||
require_once (PATH_CONTROLLERS . 'installer.php');
|
$pathFile = PATH_CONTROLLERS . 'installer.php';
|
||||||
|
$pathFile = $filter->validateInput($pathFile,'path');
|
||||||
|
require_once ($pathFile);
|
||||||
$controller = 'Installer';
|
$controller = 'Installer';
|
||||||
|
|
||||||
// if the method name is empty set default to index method
|
// if the method name is empty set default to index method
|
||||||
@@ -548,8 +550,10 @@ if ($oServerConf->isWSDisabled( SYS_TEMP )) {
|
|||||||
// if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
|
// if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
|
||||||
if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
|
if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
|
||||||
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
|
//this is the default, the workspace db.php file is in /shared/workflow/sites/SYS_SYS
|
||||||
if (file_exists( PATH_DB . SYS_TEMP . '/db.php' )) {
|
$pathFile = PATH_DB . SYS_TEMP . '/db.php';
|
||||||
require_once (PATH_DB . SYS_TEMP . '/db.php');
|
$pathFile = $filter->validateInput($pathFile,'path');
|
||||||
|
if (file_exists( $pathFile )) {
|
||||||
|
require_once ($pathFile);
|
||||||
define( 'SYS_SYS', SYS_TEMP );
|
define( 'SYS_SYS', SYS_TEMP );
|
||||||
|
|
||||||
// defining constant for workspace shared directory
|
// defining constant for workspace shared directory
|
||||||
@@ -575,11 +579,14 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
|
|||||||
die();
|
die();
|
||||||
} else {
|
} else {
|
||||||
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
|
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
|
||||||
require_once (PATH_METHODS . "login/dbInfo.php");
|
$pathFile = PATH_METHODS . "login/dbInfo.php";
|
||||||
|
$pathFile = $filter->validateInput($pathFile,'path');
|
||||||
|
require_once ($pathFile);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (substr( SYS_SKIN, 0, 2 ) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
if (substr( SYS_SKIN, 0, 2 ) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
||||||
require_once PATH_CONTROLLERS . 'main.php';
|
$pathFile = $filter->validateInput(PATH_CONTROLLERS . 'main.php','path');
|
||||||
|
require_once $pathFile;
|
||||||
$controllerClass = 'Main';
|
$controllerClass = 'Main';
|
||||||
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
||||||
//if the method exists
|
//if the method exists
|
||||||
@@ -590,7 +597,8 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') {
|
|||||||
$controller->call( $controllerAction );
|
$controller->call( $controllerAction );
|
||||||
}
|
}
|
||||||
} else { // classic sysLogin interface
|
} else { // classic sysLogin interface
|
||||||
require_once (PATH_METHODS . "login/sysLogin.php");
|
$pathFile = $filter->validateInput(PATH_METHODS . "login/sysLogin.php",'path');
|
||||||
|
require_once ($pathFile);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -684,13 +692,15 @@ ob_start();
|
|||||||
|
|
||||||
// Rebuild the base Workflow translations if not exists
|
// Rebuild the base Workflow translations if not exists
|
||||||
if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) {
|
if (! is_file( PATH_LANGUAGECONT . 'translation.en' )) {
|
||||||
require_once ("classes/model/Translation.php");
|
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
|
||||||
|
require_once ($pathFile);
|
||||||
$fields = Translation::generateFileTranslation( 'en' );
|
$fields = Translation::generateFileTranslation( 'en' );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Verify if the language set into url is defined in translations env.
|
// TODO: Verify if the language set into url is defined in translations env.
|
||||||
if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) {
|
if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG )) {
|
||||||
require_once ("classes/model/Translation.php");
|
$pathFile = $filter->validateInput("classes/model/Translation.php",'path');
|
||||||
|
require_once ($pathFile);
|
||||||
$fields = Translation::generateFileTranslation( SYS_LANG );
|
$fields = Translation::generateFileTranslation( SYS_LANG );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -760,7 +770,8 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') {
|
|||||||
//erik: verify if it is a Controller Class or httpProxyController Class
|
//erik: verify if it is a Controller Class or httpProxyController Class
|
||||||
if (is_file( PATH_CONTROLLERS . SYS_COLLECTION . '.php' )) {
|
if (is_file( PATH_CONTROLLERS . SYS_COLLECTION . '.php' )) {
|
||||||
Bootstrap::LoadSystem( 'controller' );
|
Bootstrap::LoadSystem( 'controller' );
|
||||||
require_once PATH_CONTROLLERS . SYS_COLLECTION . '.php';
|
$pathFile = $filter->validateInput(PATH_CONTROLLERS . SYS_COLLECTION . '.php','path');
|
||||||
|
require_once $pathFile;
|
||||||
$controllerClass = SYS_COLLECTION;
|
$controllerClass = SYS_COLLECTION;
|
||||||
//if the method name is empty set default to index method
|
//if the method name is empty set default to index method
|
||||||
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
|
$controllerAction = SYS_TARGET != '' ? SYS_TARGET : 'index';
|
||||||
@@ -913,7 +924,8 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
|
|||||||
Bootstrap::LoadClass( 'sessions' );
|
Bootstrap::LoadClass( 'sessions' );
|
||||||
$oSessions = new Sessions();
|
$oSessions = new Sessions();
|
||||||
if ($aSession = $oSessions->verifySession( $_GET['sid'] )) {
|
if ($aSession = $oSessions->verifySession( $_GET['sid'] )) {
|
||||||
require_once 'classes/model/Users.php';
|
$pathFile = $filter->validateInput('classes/model/Users.php','path');
|
||||||
|
require_once $pathFile;
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
$aUser = $oUser->load( $aSession['USR_UID'] );
|
$aUser = $oUser->load( $aSession['USR_UID'] );
|
||||||
$_SESSION['USER_LOGGED'] = $aUser['USR_UID'];
|
$_SESSION['USER_LOGGED'] = $aUser['USR_UID'];
|
||||||
|
|||||||
Reference in New Issue
Block a user