Merged colosa/processmaker into master
This commit is contained in:
@@ -463,10 +463,17 @@ class G
|
||||
* @return void
|
||||
*/
|
||||
public static function LoadSystem ($strClass)
|
||||
{ require_once (PATH_GULLIVER . 'class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
{
|
||||
$path = PATH_GULLIVER . 'class.' . $strClass . '.php';
|
||||
$path = $filter->validateInput($path, 'path');
|
||||
if(file_exists(PATH_GULLIVER . 'class.inputfilter.php')) {
|
||||
require_once (PATH_GULLIVER . 'class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$path = $filter->validateInput($path, 'path');
|
||||
} else {
|
||||
if(!file_exists($path)) {
|
||||
$path = '';
|
||||
}
|
||||
}
|
||||
require_once ($path);
|
||||
}
|
||||
|
||||
@@ -2656,6 +2663,7 @@ class G
|
||||
$path = $filter->validateInput($path, "path");
|
||||
|
||||
move_uploaded_file( $file, $path . "/" . $nameToSave );
|
||||
$nameToSave = $filter->validateInput($nameToSave, "path");
|
||||
@chmod( $path . "/" . $nameToSave, $permission );
|
||||
umask( $oldumask );
|
||||
|
||||
|
||||
@@ -634,15 +634,29 @@
|
||||
$dir = dirname($path)."/";
|
||||
$base = basename($path);
|
||||
|
||||
if (!class_exists('G')) {
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.g.php');
|
||||
}
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
|
||||
foreach($options["props"] as $key => $prop) {
|
||||
if ($prop["ns"] == "DAV:") {
|
||||
$options["props"][$key]['status'] = "403 Forbidden";
|
||||
} else {
|
||||
if (isset($prop["val"])) {
|
||||
$query = "REPLACE INTO properties SET path = '$options[path]', name = '$prop[name]', ns= '$prop[ns]', value = '$prop[val]'";
|
||||
$query = "REPLACE INTO properties SET path = '%s', name = '%s', ns= '%s', value = '%s'";
|
||||
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns'],$prop['val']));
|
||||
error_log($query);
|
||||
} else {
|
||||
$query = "DELETE FROM properties WHERE path = '$options[path]' AND name = '$prop[name]' AND ns = '$prop[ns]'";
|
||||
$query = "DELETE FROM properties WHERE path = '%s' AND name = '%s' AND ns = '%s'";
|
||||
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns']));
|
||||
}
|
||||
mysql_query($query);
|
||||
}
|
||||
|
||||
2
gulliver/thirdparty/phpmailer/class.smtp.php
vendored
2
gulliver/thirdparty/phpmailer/class.smtp.php
vendored
@@ -305,7 +305,7 @@ class SMTP {
|
||||
break;
|
||||
case 'LOGIN':
|
||||
// Start authentication
|
||||
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||
@fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
@@ -949,6 +949,10 @@ class Cases
|
||||
public function updateCase($sAppUid, $Fields = array())
|
||||
{
|
||||
try {
|
||||
$oApplication = new Application;
|
||||
if (!$oApplication->exists($sAppUid)) {
|
||||
return false;
|
||||
}
|
||||
$aApplicationFields = $Fields['APP_DATA'];
|
||||
$Fields['APP_UID'] = $sAppUid;
|
||||
$Fields['APP_UPDATE_DATE'] = 'now';
|
||||
@@ -6740,7 +6744,7 @@ class Cases
|
||||
$rows[] = $rs->getRow();
|
||||
}
|
||||
|
||||
if ($PRO_UID != null) {
|
||||
if ($PRO_UID != null) {
|
||||
//Add supervisor
|
||||
// Users
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -6760,8 +6764,10 @@ class Cases
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$flagSupervisors = false;
|
||||
|
||||
if ($oDataset->next()) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
if ($oDataset->next()) {
|
||||
if (!in_array($USR_UID,$row)) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
}
|
||||
$flagSupervisors = true;
|
||||
}
|
||||
|
||||
@@ -6789,10 +6795,13 @@ class Cases
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($oDataset->next()) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
if (!in_array($USR_UID,$row)) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
@@ -6898,7 +6907,7 @@ class Cases
|
||||
unset($aFields['APP_STATUS']);
|
||||
unset($aFields['APP_PROC_STATUS']);
|
||||
unset($aFields['APP_PROC_CODE']);
|
||||
unset($aFields['APP_PIN']);
|
||||
unset($aFields['APP_PIN']);
|
||||
$this->updateCase($aFields['APP_UID'], $aFields);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2097,7 +2097,7 @@ function PMFAssignUserToGroup ($userId, $groupId)
|
||||
* @label PMF Create User
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCreateUser.28.29
|
||||
*
|
||||
* @param string(32) | $userId | User ID | The username for the new user.
|
||||
* @param string(32) | $userId | User Name | The username for the new user.
|
||||
* @param string(32) | $password | Password of the new user | The password of the new user, which can be up to 32 characters long.
|
||||
* @param string(32) | $firstname | Firstname of the new user | The first name of the user, which can be up to 50 characters long.
|
||||
* @param string(32) | $lastname | Lastname of the new user | The last name of the user, which can be up to 50 characters long.
|
||||
@@ -2865,8 +2865,9 @@ function PMFRemoveMask ($field, $separator = '.', $currency = '')
|
||||
$field = str_replace($thousandSeparator, "", $field);
|
||||
$field = str_replace($decimalSeparator, ".", $field);
|
||||
$field = str_replace($currency, "", $field);
|
||||
$field = floatval(trim($field));
|
||||
|
||||
if(strpos($decimalSeparator, $field) !== false){
|
||||
$field = (float)(trim($field));
|
||||
}
|
||||
return $field;
|
||||
}
|
||||
|
||||
@@ -2881,17 +2882,17 @@ function PMFRemoveMask ($field, $separator = '.', $currency = '')
|
||||
* @return int | $result | Result of send variables | Returns 1 if the variables were sent successfully to the case; otherwise, returns 0 if an error occurred.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function PMFSaveCurrentData ()
|
||||
{
|
||||
global $oPMScript;
|
||||
$result = 0;
|
||||
|
||||
|
||||
if (isset($_SESSION['APPLICATION']) && isset($oPMScript->aFields)) {
|
||||
G::LoadClass( 'wsBase' );
|
||||
$ws = new wsBase();
|
||||
$result = $ws->sendVariables( $_SESSION['APPLICATION'], $oPMScript->aFields );
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -969,6 +969,18 @@ class Processes
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($oData->taskExtraProperties)) {
|
||||
foreach ($oData->taskExtraProperties as $key => $value) {
|
||||
$record = $value;
|
||||
|
||||
if (isset($map[$record["OBJ_UID"]])) {
|
||||
$newUid = $map[$record["OBJ_UID"]];
|
||||
|
||||
$oData->taskExtraProperties[$key]["OBJ_UID"] = $newUid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($oData->webEntry)) {
|
||||
foreach ($oData->webEntry as $key => $value) {
|
||||
$record = $value;
|
||||
@@ -3739,9 +3751,25 @@ class Processes
|
||||
}
|
||||
}
|
||||
|
||||
// for public files
|
||||
//For public files
|
||||
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
|
||||
|
||||
//Get WebEntry file names
|
||||
$arrayWebEntryFile = array();
|
||||
|
||||
if (is_dir($PUBLIC_ROOT_PATH)) {
|
||||
if ($dirh = opendir($PUBLIC_ROOT_PATH)) {
|
||||
while (($file = readdir($dirh)) !== false) {
|
||||
if (preg_match("/^(.+)Post\.php$/", $file, $arrayMatch)) {
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . ".php";
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . "Post.php";
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dirh);
|
||||
}
|
||||
}
|
||||
|
||||
//if this process have any mailfile
|
||||
if (is_dir( $PUBLIC_ROOT_PATH )) {
|
||||
//get mail files list from this directory
|
||||
@@ -3749,6 +3777,10 @@ class Processes
|
||||
foreach ($file_list as $filename) {
|
||||
// verify if this filename is a valid file, because it could be . or .. on *nix systems
|
||||
if ($filename != '.' && $filename != '..') {
|
||||
if (in_array($filename, $arrayWebEntryFile)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (@is_readable( $PUBLIC_ROOT_PATH . PATH_SEP . $filename )) {
|
||||
$sFileName = $PUBLIC_ROOT_PATH . PATH_SEP . $filename;
|
||||
if (file_exists( $sFileName )) {
|
||||
@@ -4094,7 +4126,6 @@ class Processes
|
||||
$fsData = intval( fread( $fp, 9 ) ); //reading the size of $oData
|
||||
$contents = fread( $fp, $fsData ); //reading string $oData
|
||||
|
||||
|
||||
$path = PATH_DYNAFORM . $oData->process['PRO_UID'] . PATH_SEP;
|
||||
if (! is_dir( $path )) {
|
||||
G::verifyPath( $path, true );
|
||||
@@ -4180,6 +4211,28 @@ class Processes
|
||||
}
|
||||
|
||||
if (trim( $sIdentifier ) == 'PUBLIC') {
|
||||
//Get WebEntry file names
|
||||
$arrayWebEntryFile = array();
|
||||
|
||||
$fh = fopen($pmFilename, "rb");
|
||||
$contents = fread($fh, intval(fread($fh, 9))); //Reading string $oData
|
||||
|
||||
while (!feof($fh)) {
|
||||
$fsFileName = intval(fread($fh, 9)); //Reading the size of $filename
|
||||
|
||||
if ($fsFileName > 0) {
|
||||
$sFileName = fread($fh, $fsFileName); //Reading filename string
|
||||
|
||||
if (preg_match("/^(.+)Post\.php$/", $sFileName, $arrayMatch)) {
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . ".php";
|
||||
$arrayWebEntryFile[] = $arrayMatch[1] . "Post.php";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
//Public files
|
||||
$sIdentifier = 1;
|
||||
while (! feof( $fp ) && is_numeric( $sIdentifier )) {
|
||||
$sIdentifier = fread( $fp, 9 ); //reading the size of $filename
|
||||
@@ -4192,6 +4245,11 @@ class Processes
|
||||
if ($fsContent > 0) {
|
||||
$fileContent = fread( $fp, $fsContent ); //reading string $XmlContent
|
||||
$newFileName = $pathPublic . $sFileName;
|
||||
|
||||
if (in_array($sFileName, $arrayWebEntryFile)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bytesSaved = @file_put_contents( $newFileName, $fileContent );
|
||||
if ($bytesSaved != $fsContent) {
|
||||
throw (new Exception( 'Error writing Public file in directory : ' . $pathPublic ));
|
||||
@@ -4204,7 +4262,6 @@ class Processes
|
||||
fclose( $fp );
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -391,12 +391,23 @@ class Tasks
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ObjectPermissionPeer::OP_TASK_SOURCE, $sTaskUID);
|
||||
ObjectPermissionPeer::doDelete($oCriteria);
|
||||
|
||||
//Delete Cases Schedulers
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->add(CaseSchedulerPeer::TAS_UID, $sTaskUID, Criteria::EQUAL);
|
||||
|
||||
$result = CaseSchedulerPeer::doDelete($criteria);
|
||||
|
||||
//Delete Configuration
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->add(ConfigurationPeer::OBJ_UID, $sTaskUID, Criteria::EQUAL);
|
||||
|
||||
$result = ConfigurationPeer::doDelete($criteria);
|
||||
|
||||
//Delete task
|
||||
$oTask->remove($sTaskUID);
|
||||
//Delete cases schedulers added by krlos
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(CaseSchedulerPeer::TAS_UID, $sTaskUID);
|
||||
CaseSchedulerPeer::doDelete($oCriteria);
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
@@ -855,4 +866,4 @@ class Tasks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -902,16 +902,21 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
|
||||
$dir = dirname($path) . "/";
|
||||
$base = basename($path);
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
|
||||
foreach ($options["props"] as $key => $prop) {
|
||||
if ($prop["ns"] == "DAV:") {
|
||||
$options["props"][$key]['status'] = "403 Forbidden";
|
||||
} else {
|
||||
if (isset($prop["val"])) {
|
||||
$query = "REPLACE INTO properties SET path = '$options[path]', name = '$prop[name]', ns= '$prop[ns]', value = '$prop[val]'";
|
||||
$query = "REPLACE INTO properties SET path = '%s', name = '%s', ns= '%s', value = '%s'";
|
||||
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns'],$prop['val']));
|
||||
error_log($query);
|
||||
} else {
|
||||
$query = "DELETE FROM properties WHERE path = '$options[path]' AND name = '$prop[name]' AND ns = '$prop[ns]'";
|
||||
$query = "DELETE FROM properties WHERE path = '%s' AND name = '%s' AND ns = '%s'";
|
||||
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns']));
|
||||
}
|
||||
mysql_query($query);
|
||||
}
|
||||
|
||||
@@ -1610,12 +1610,14 @@ class workspaceTools
|
||||
|
||||
$workspace->checkMafeRequirements($workspaceName, $lang);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Updating cache view...\n");
|
||||
$workspace->upgradeCacheView(true, false, $lang);
|
||||
CLI::logging("> Updating List tables...\n");
|
||||
$workspace->migrateList($workspace->name);
|
||||
$stop = microtime(true);
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
|
||||
CLI::logging("<*> Updating List Process took $final seconds.\n");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
mysql_close($link);
|
||||
}
|
||||
@@ -1881,6 +1883,7 @@ class workspaceTools
|
||||
}
|
||||
$this->initPropel(true);
|
||||
$appCache = new AppCacheView();
|
||||
$users = new Users();
|
||||
G::LoadClass("case");
|
||||
$case = new Cases();
|
||||
|
||||
@@ -1921,12 +1924,28 @@ class workspaceTools
|
||||
$rsCriteria = AppCacheViewPeer::doSelectRS($inbCriteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$criteriaUser = new Criteria();
|
||||
$criteriaUser->addSelectColumn( UsersPeer::USR_UID );
|
||||
$criteriaUser->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$criteriaUser->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$criteriaUser->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
//Insert new data LIST_INBOX
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$isSelfService = ($row['USR_UID'] == '') ? true : false;
|
||||
if($row["DEL_THREAD_STATUS"] == 'OPEN'){
|
||||
//Update information about the previous_user
|
||||
$row["DEL_PREVIOUS_USR_UID"] = $row["PREVIOUS_USR_UID"];
|
||||
$criteriaUser->add( UsersPeer::USR_UID, $row["PREVIOUS_USR_UID"] );
|
||||
$datasetU = UsersPeer::doSelectRS($criteriaUser);
|
||||
$datasetU->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$datasetU->next();
|
||||
$arrayUsers = $datasetU->getRow();
|
||||
$row["DEL_PREVIOUS_USR_USERNAME"] = $arrayUsers["USR_USERNAME"];
|
||||
$row["DEL_PREVIOUS_USR_FIRSTNAME"]= $arrayUsers["USR_FIRSTNAME"];
|
||||
$row["DEL_PREVIOUS_USR_LASTNAME"] = $arrayUsers["USR_LASTNAME"];
|
||||
//Update the due date
|
||||
$row["DEL_DUE_DATE"] = $row["DEL_TASK_DUE_DATE"];
|
||||
$listInbox = new ListInbox();
|
||||
$listInbox->remove($row["APP_UID"],$row["DEL_INDEX"]);
|
||||
$listInbox->setDeleted(false);
|
||||
|
||||
@@ -56,6 +56,11 @@ class Application extends BaseApplication
|
||||
*/
|
||||
public function getAppTitle()
|
||||
{
|
||||
$oApplication = new Application;
|
||||
if (!$oApplication->exists($this->getAppUid())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->getAppUid() == '') {
|
||||
throw (new Exception( "Error in getAppTitle, the APP_UID can't be blank"));
|
||||
}
|
||||
@@ -311,7 +316,9 @@ class Application extends BaseApplication
|
||||
|
||||
try {
|
||||
$oApplication = ApplicationPeer::retrieveByPk( $AppUid );
|
||||
|
||||
if (!$oApplication) {
|
||||
return false;
|
||||
}
|
||||
if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) {
|
||||
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
@@ -574,19 +581,19 @@ class Application extends BaseApplication
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
public function calculateAppDuration ($cron = 0)
|
||||
{
|
||||
try {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
|
||||
$calendar = new calendar();
|
||||
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->clearSelectColumns();
|
||||
public function calculateAppDuration ($cron = 0)
|
||||
{
|
||||
try {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
|
||||
$calendar = new calendar();
|
||||
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( ApplicationPeer::APP_UID );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_STATUS );
|
||||
@@ -602,80 +609,80 @@ class Application extends BaseApplication
|
||||
$c->addSelectColumn( ProcessPeer::PRO_TIME );
|
||||
$c->addSelectColumn( ProcessPeer::PRO_TIMEUNIT );
|
||||
|
||||
$c->addJoin( ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN );
|
||||
|
||||
$rs = ApplicationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$i = 0;
|
||||
|
||||
$now = strtotime( 'now' );
|
||||
while (is_array( $row )) {
|
||||
$appNumber = $row['APP_NUMBER'];
|
||||
$appStatus = $row['APP_STATUS'];
|
||||
$appInitUser = $row['APP_INIT_USER'];
|
||||
$appCurUser = $row['APP_CUR_USER'];
|
||||
$appCreateDate = $row['APP_CREATE_DATE'];
|
||||
$appInitDate = $row['APP_INIT_DATE'];
|
||||
$appFinishDate = $row['APP_FINISH_DATE'];
|
||||
$c->addJoin( ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN );
|
||||
|
||||
$rs = ApplicationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$i = 0;
|
||||
|
||||
$now = strtotime( 'now' );
|
||||
while (is_array( $row )) {
|
||||
$appNumber = $row['APP_NUMBER'];
|
||||
$appStatus = $row['APP_STATUS'];
|
||||
$appInitUser = $row['APP_INIT_USER'];
|
||||
$appCurUser = $row['APP_CUR_USER'];
|
||||
$appCreateDate = $row['APP_CREATE_DATE'];
|
||||
$appInitDate = $row['APP_INIT_DATE'];
|
||||
$appFinishDate = $row['APP_FINISH_DATE'];
|
||||
$appUpdateDate = $row['APP_UPDATE_DATE'];
|
||||
$appDuration = $row['APP_DURATION'];
|
||||
$proTime = $row['PRO_TIME'];
|
||||
$proTimeUnit = $row['PRO_TIMEUNIT'];
|
||||
$proUid = $row['PRO_UID'];
|
||||
|
||||
//get the object,
|
||||
$oApp = ApplicationPeer::retrieveByPk( $row['APP_UID'] );
|
||||
|
||||
//getting the calendar
|
||||
$calendar->getCalendar(null, $proUid);
|
||||
$proUid = $row['PRO_UID'];
|
||||
|
||||
//get the object,
|
||||
$oApp = ApplicationPeer::retrieveByPk( $row['APP_UID'] );
|
||||
|
||||
//getting the calendar
|
||||
$calendar->getCalendar(null, $proUid);
|
||||
$calData = $calendar->getCalendarData();
|
||||
|
||||
/*if(G::toUpper($proTimeUnit) != 'DAYS'){ //if it is not in days must be in mins.
|
||||
$proTime = $proTime / (24 * 60 * 60); //converting to Days
|
||||
}*/
|
||||
|
||||
$proDueDate = $calendar->dashCalculateDate($row['APP_INIT_DATE'], $proTime, $proTimeUnit, $calData); //date when the process has to finish
|
||||
|
||||
$proDueDate = $calendar->dashCalculateDate($row['APP_INIT_DATE'], $proTime, $proTimeUnit, $calData); //date when the process has to finish
|
||||
|
||||
if($appFinishDate == null){//When the process didnt finish yet.
|
||||
//Duration
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, date("Y-m-d H:i:s"), $calData );
|
||||
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, date("Y-m-d H:i:s"), $calData );
|
||||
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns segs.
|
||||
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns segs.
|
||||
$oApp->setAppDuration( $appDuration );
|
||||
|
||||
//Delay Duration
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, date("Y-m-d H:i:s"), $calData );//it returns in mins
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, date("Y-m-d H:i:s"), $calData );//it returns in mins
|
||||
$delayDuration = $delayDuration / (24 * 60 * 60); //Days
|
||||
$oApp->setAppDelayDuration( $delayDuration );
|
||||
} else {
|
||||
//Duration
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, $appFinishDate, $calData );
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns mins.
|
||||
//Duration
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, $appFinishDate, $calData );
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns mins.
|
||||
$oApp->setAppDuration( $appDuration );
|
||||
|
||||
//Delay Duration
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, $appFinishDate, $calData );
|
||||
|
||||
//Delay Duration
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, $appFinishDate, $calData );
|
||||
$delayDuration = $delayDuration / (24 * 60 * 60); //Days
|
||||
$oApp->setAppDelayDuration( $delayDuration );
|
||||
}
|
||||
|
||||
//and finally save the record
|
||||
$RES = $oApp->save();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
error_log( $oError->getMessage() );
|
||||
}
|
||||
|
||||
//and finally save the record
|
||||
$RES = $oApp->save();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
error_log( $oError->getMessage() );
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
@@ -1,28 +1,42 @@
|
||||
<?php
|
||||
class Configuration extends BaseConfiguration
|
||||
{
|
||||
public function create($aData)
|
||||
public function create(array $arrayData)
|
||||
{
|
||||
$con = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||
$cnn = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setCfgUid($aData['CFG_UID']);
|
||||
$this->setObjUid($aData['OBJ_UID']);
|
||||
$this->setCfgValue(isset($aData['CFG_VALUE'])?$aData['CFG_VALUE']:'');
|
||||
$this->setProUid($aData['PRO_UID']);
|
||||
$this->setUsrUid($aData['USR_UID']);
|
||||
$this->setAppUid($aData['APP_UID']);
|
||||
if ($this->validate()) {
|
||||
$result=$this->save();
|
||||
$con->commit();
|
||||
$configuration = new Configuration();
|
||||
|
||||
$configuration->setCfgUid($arrayData["CFG_UID"]);
|
||||
$configuration->setObjUid($arrayData["OBJ_UID"]);
|
||||
$configuration->setCfgValue((isset($arrayData["CFG_VALUE"]))? $arrayData["CFG_VALUE"] : "");
|
||||
$configuration->setProUid($arrayData["PRO_UID"]);
|
||||
$configuration->setUsrUid($arrayData["USR_UID"]);
|
||||
$configuration->setAppUid($arrayData["APP_UID"]);
|
||||
|
||||
if ($configuration->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
$result = $configuration->save();
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
//Return
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
||||
$msg = "";
|
||||
|
||||
foreach ($configuration->getValidationFailures() as $validationFailure) {
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . (($msg != "")? "\n" . $msg : ""));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -315,6 +315,10 @@ class Installer extends Controller
|
||||
$info->success = false;
|
||||
}
|
||||
}
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$pathShared = $filter->validateInput($_REQUEST['pathShared'], 'path');
|
||||
|
||||
if ($info->pathShared->result) {
|
||||
$aux = pathinfo( $_REQUEST['pathLogFile'] );
|
||||
@@ -322,7 +326,7 @@ class Installer extends Controller
|
||||
if (is_dir( $aux['dirname'] )) {
|
||||
if (! file_exists( $_REQUEST['pathLogFile'] )) {
|
||||
@file_put_contents( $_REQUEST['pathLogFile'], '' );
|
||||
@chmod($_REQUEST['pathShared'], 0770);
|
||||
@chmod($pathShared , 0770);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,7 +392,11 @@ class Installer extends Controller
|
||||
return $false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$logFile = $filter->validateInput($logFile, 'path');
|
||||
|
||||
$fpt = fopen( $logFile, 'a' );
|
||||
fwrite( $fpt, sprintf( "%s %s\n", date( 'Y:m:d H:i:s' ), trim( $text ) ) );
|
||||
fclose( $fpt );
|
||||
|
||||
@@ -2661,9 +2661,10 @@ processmap.prototype={
|
||||
uid:false
|
||||
};
|
||||
this.data.build.text(index);
|
||||
text = text.replace(/"/g, '\\"');
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=addText&data="+{uid:this.options.uid,label:text,position:{x:pos.x,y:pos.y}}.toJSONString()
|
||||
args:"action=addText&data="+{uid:this.options.uid,label:encodeURIComponent(text),position:{x:pos.x,y:pos.y}}.toJSONString()
|
||||
});
|
||||
r.callback=function(rpc,index){
|
||||
var rs = rpc.xmlhttp.responseText.parseJSON();
|
||||
|
||||
@@ -52,6 +52,7 @@ function array_sort ($array, $on, $order = SORT_ASC, $query = '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $new_array;
|
||||
}
|
||||
// $APP_UIDS = explode(',', $_POST['APP_UID']);
|
||||
|
||||
@@ -38,7 +38,7 @@ try {
|
||||
break;
|
||||
} */
|
||||
//$oJSON = new Services_JSON();
|
||||
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$_GET = $filter->xssFilterHard($_GET);
|
||||
@@ -307,7 +307,7 @@ try {
|
||||
G::auditLog('DeleteLines','Delete all lines in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
break;
|
||||
case 'addText':
|
||||
$sOutput = $oProcessMap->addText($oData->uid, $oData->label, $oData->position->x, $oData->position->y);
|
||||
$sOutput = $oProcessMap->addText($oData->uid, html_entity_decode(html_entity_decode($oData->label)), $oData->position->x, $oData->position->y);
|
||||
$sOutputAux = G::json_decode($sOutput);
|
||||
$sOutputAux = (array)$sOutputAux;
|
||||
G::auditLog('AddText','Add new text ('.$sOutputAux['uid'].') in process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
@@ -66,5 +66,44 @@ if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_DynaDocs', $oProcessMap->getCaseTrackerObjectsCriteria( $_SESSION['PROCESS'] ), array ('VIEW' => G::LoadTranslation( 'ID_VIEW' )
|
||||
) );
|
||||
|
||||
G::RenderPage( 'publish' );
|
||||
$bpmn = new ProcessMaker\Project\Bpmn();
|
||||
$flagIsBpmn = ($bpmn->exists($_SESSION["PROCESS"]))? true : false;
|
||||
|
||||
if ($flagIsBpmn) {
|
||||
$urlTrackerProcessMap = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APPLICATION"] . "&tracker_designer=1";
|
||||
|
||||
$_SESSION["TRACKER_JAVASCRIPT"] = "
|
||||
<script type=\"text/javascript\">
|
||||
var winTracker;
|
||||
|
||||
if ((navigator.userAgent.indexOf(\"MSIE\") != -1) || (navigator.userAgent.indexOf(\"Trident\") != -1)) {
|
||||
var li1 = document.getElementById(\"MAP\");
|
||||
var a1 = li1.getElementsByTagName(\"a\");
|
||||
a1[0].onclick = function () {
|
||||
winTracker = window.open(\"$urlTrackerProcessMap\", \"winTracker\");
|
||||
li1.className = \"SelectedMenu\";
|
||||
li2.className = \"mainMenu\";
|
||||
li3.className = \"mainMenu\";
|
||||
li4.className = \"mainMenu\";
|
||||
document.getElementById(\"trackerContainer\").innerHTML = \"\";
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var li2 = document.getElementById(\"DYNADOC\");
|
||||
var a2= li2.getElementsByTagName(\"a\");
|
||||
a2[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li3 = document.getElementById(\"HISTORY\");
|
||||
var a3 = li3.getElementsByTagName(\"a\");
|
||||
a3[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li4 = document.getElementById(\"MESSAGES\");
|
||||
var a4 = li4.getElementsByTagName(\"a\");
|
||||
a4[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
}
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
G::RenderPage("publish");
|
||||
|
||||
@@ -62,5 +62,45 @@ if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_TransferHistory', Cases::getTransferHistoryCriteria( $_SESSION['APPLICATION'] ), array () );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$bpmn = new ProcessMaker\Project\Bpmn();
|
||||
$flagIsBpmn = ($bpmn->exists($_SESSION["PROCESS"]))? true : false;
|
||||
|
||||
if ($flagIsBpmn) {
|
||||
$urlTrackerProcessMap = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APPLICATION"] . "&tracker_designer=1";
|
||||
|
||||
$_SESSION["TRACKER_JAVASCRIPT"] = "
|
||||
<script type=\"text/javascript\">
|
||||
var winTracker;
|
||||
|
||||
if ((navigator.userAgent.indexOf(\"MSIE\") != -1) || (navigator.userAgent.indexOf(\"Trident\") != -1)) {
|
||||
var li1 = document.getElementById(\"MAP\");
|
||||
var a1 = li1.getElementsByTagName(\"a\");
|
||||
a1[0].onclick = function () {
|
||||
winTracker = window.open(\"$urlTrackerProcessMap\", \"winTracker\");
|
||||
li1.className = \"SelectedMenu\";
|
||||
li2.className = \"mainMenu\";
|
||||
li3.className = \"mainMenu\";
|
||||
li4.className = \"mainMenu\";
|
||||
document.getElementById(\"trackerContainer\").innerHTML = \"\";
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var li2 = document.getElementById(\"DYNADOC\");
|
||||
var a2= li2.getElementsByTagName(\"a\");
|
||||
a2[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li3 = document.getElementById(\"HISTORY\");
|
||||
var a3 = li3.getElementsByTagName(\"a\");
|
||||
a3[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li4 = document.getElementById(\"MESSAGES\");
|
||||
var a4 = li4.getElementsByTagName(\"a\");
|
||||
a4[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
}
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
G::RenderPage("publish");
|
||||
|
||||
@@ -64,5 +64,45 @@ if ($noShowTitle == 0) {
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_Messages', Cases::getHistoryMessagesTracker( $_SESSION['APPLICATION'] ), array ('VIEW' => G::LoadTranslation( 'ID_VIEW' )
|
||||
) );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$bpmn = new ProcessMaker\Project\Bpmn();
|
||||
$flagIsBpmn = ($bpmn->exists($_SESSION["PROCESS"]))? true : false;
|
||||
|
||||
if ($flagIsBpmn) {
|
||||
$urlTrackerProcessMap = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APPLICATION"] . "&tracker_designer=1";
|
||||
|
||||
$_SESSION["TRACKER_JAVASCRIPT"] = "
|
||||
<script type=\"text/javascript\">
|
||||
var winTracker;
|
||||
|
||||
if ((navigator.userAgent.indexOf(\"MSIE\") != -1) || (navigator.userAgent.indexOf(\"Trident\") != -1)) {
|
||||
var li1 = document.getElementById(\"MAP\");
|
||||
var a1 = li1.getElementsByTagName(\"a\");
|
||||
a1[0].onclick = function () {
|
||||
winTracker = window.open(\"$urlTrackerProcessMap\", \"winTracker\");
|
||||
li1.className = \"SelectedMenu\";
|
||||
li2.className = \"mainMenu\";
|
||||
li3.className = \"mainMenu\";
|
||||
li4.className = \"mainMenu\";
|
||||
document.getElementById(\"trackerContainer\").innerHTML = \"\";
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var li2 = document.getElementById(\"DYNADOC\");
|
||||
var a2= li2.getElementsByTagName(\"a\");
|
||||
a2[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li3 = document.getElementById(\"HISTORY\");
|
||||
var a3 = li3.getElementsByTagName(\"a\");
|
||||
a3[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li4 = document.getElementById(\"MESSAGES\");
|
||||
var a4 = li4.getElementsByTagName(\"a\");
|
||||
a4[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
}
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
G::RenderPage("publish");
|
||||
|
||||
@@ -59,7 +59,7 @@ while ($ds->next()) {
|
||||
$row = $ds->getRow();
|
||||
$bpmnProjects[] = $row['PRJ_UID'];
|
||||
}
|
||||
|
||||
|
||||
switch (($aCaseTracker['CT_MAP_TYPE'])) {
|
||||
case 'NONE':
|
||||
//Nothing
|
||||
@@ -71,11 +71,48 @@ switch (($aCaseTracker['CT_MAP_TYPE'])) {
|
||||
$aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
if (in_array($aFields['PRO_UID'], $bpmnProjects)) {
|
||||
//bpmb
|
||||
$_SESSION["APP_UID"] = $aFields["APP_UID"];
|
||||
$_SESSION["APPLICATION"] = $aFields["APP_UID"];
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'tracker/viewMap' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
$urlTrackerProcessMap = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APPLICATION"] . "&tracker_designer=1";
|
||||
|
||||
$_SESSION["TRACKER_JAVASCRIPT"] = "
|
||||
<script type=\"text/javascript\">
|
||||
var winTracker;
|
||||
|
||||
if ((navigator.userAgent.indexOf(\"MSIE\") != -1) || (navigator.userAgent.indexOf(\"Trident\") != -1)) {
|
||||
var li1 = document.getElementById(\"MAP\");
|
||||
var a1 = li1.getElementsByTagName(\"a\");
|
||||
a1[0].onclick = function () {
|
||||
winTracker = window.open(\"$urlTrackerProcessMap\", \"winTracker\");
|
||||
li1.className = \"SelectedMenu\";
|
||||
li2.className = \"mainMenu\";
|
||||
li3.className = \"mainMenu\";
|
||||
li4.className = \"mainMenu\";
|
||||
document.getElementById(\"trackerContainer\").innerHTML = \"\";
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var li2 = document.getElementById(\"DYNADOC\");
|
||||
var a2= li2.getElementsByTagName(\"a\");
|
||||
a2[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li3 = document.getElementById(\"HISTORY\");
|
||||
var a3 = li3.getElementsByTagName(\"a\");
|
||||
a3[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
|
||||
var li4 = document.getElementById(\"MESSAGES\");
|
||||
var a4 = li4.getElementsByTagName(\"a\");
|
||||
a4[0].onclick = function () { if (winTracker) { winTracker.close(); } };
|
||||
}
|
||||
</script>
|
||||
";
|
||||
|
||||
G::RenderPage("publish");
|
||||
//note: url processmap "../designer?prj_uid=$_SESSION['PROCESS']&prj_readonly=true&app_uid=$_SESSION['APP_UID']"
|
||||
|
||||
break;
|
||||
}
|
||||
if (isset( $aFields['TITLE'] )) {
|
||||
@@ -246,9 +283,8 @@ switch (($aCaseTracker['CT_MAP_TYPE'])) {
|
||||
}.extend(this);
|
||||
|
||||
rpcRequest.make();
|
||||
|
||||
|
||||
});' );
|
||||
G::RenderPage( 'publish' );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ foreach ($aInfoFunction as $k => $v) {
|
||||
}
|
||||
if ($aDataTriggers[$sOptionTrigger] != '') {
|
||||
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@"))) {
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@")) || ($aDataTriggers['PMFUNTION_NAME'] == 'evaluateFunction' && $k == 0 && strstr($aDataTriggers[$sOptionTrigger], "@="))) {
|
||||
$option = trim($aDataTriggers[$sOptionTrigger]);
|
||||
} else {
|
||||
|
||||
@@ -81,7 +81,7 @@ foreach ($aInfoFunction as $k => $v) {
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "'.array.'")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "'.array.'")) ? trim($aDataTriggers[$sOptionTrigger]) : '"' . trim($aDataTriggers[$sOptionTrigger]) . '"';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ foreach ($aInfoFunction as $k => $v) {
|
||||
}
|
||||
if ($aDataTriggers[$sOptionTrigger] != '') {
|
||||
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@"))) {
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@")) || ($aDataTriggers['PMFUNTION_NAME'] == 'evaluateFunction' && $k == 0 && strstr($aDataTriggers[$sOptionTrigger], "@="))) {
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
} else {
|
||||
|
||||
@@ -84,7 +84,7 @@ foreach ($aInfoFunction as $k => $v) {
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : '"' . trim($aDataTriggers[$sOptionTrigger]) . '"';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,10 +58,16 @@
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td width="100%" align="center">
|
||||
<td {php} if (isset($_SESSION["TRACKER_JAVASCRIPT"])) { echo "id=\"trackerContainer\""; } {/php} width="100%" align="center">
|
||||
{php}
|
||||
global $G_TEMPLATE;
|
||||
if ($G_TEMPLATE != '') G::LoadTemplate($G_TEMPLATE);
|
||||
|
||||
if (isset($_SESSION["TRACKER_JAVASCRIPT"])) {
|
||||
echo $_SESSION["TRACKER_JAVASCRIPT"];
|
||||
|
||||
unset($_SESSION["TRACKER_JAVASCRIPT"]);
|
||||
}
|
||||
{/php}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -59,10 +59,16 @@
|
||||
<td>
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0" >
|
||||
<tr>
|
||||
<td width="100%" align="center">
|
||||
<td {php} if (isset($_SESSION["TRACKER_JAVASCRIPT"])) { echo "id=\"trackerContainer\""; } {/php} width="100%" align="center">
|
||||
{php}
|
||||
global $G_TEMPLATE;
|
||||
if ($G_TEMPLATE != '') G::LoadTemplate($G_TEMPLATE);
|
||||
|
||||
if (isset($_SESSION["TRACKER_JAVASCRIPT"])) {
|
||||
echo $_SESSION["TRACKER_JAVASCRIPT"];
|
||||
|
||||
unset($_SESSION["TRACKER_JAVASCRIPT"]);
|
||||
}
|
||||
{/php}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1005,9 +1005,7 @@ class CaseScheduler
|
||||
case "UPD":
|
||||
$arrayDataAux = $caseScheduler->load($caseSchedulerUid);
|
||||
|
||||
if ($arrayData["SCH_END_DATE"] != "") {
|
||||
$arrayCaseSchedulerData["SCH_END_DATE"] = $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;
|
||||
|
||||
@@ -259,8 +259,7 @@ abstract class Importer
|
||||
public function removeProject()
|
||||
{
|
||||
$project = \ProcessMaker\Project\Adapter\BpmnWorkflow::load($this->metadata["uid"]);
|
||||
$force = true;
|
||||
$project->remove($force);
|
||||
$project->remove(true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1038,10 +1038,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($force = false)
|
||||
public function remove($flagForceRemoveProject = false, $flagRemoveCases = true)
|
||||
{
|
||||
parent::remove($force);
|
||||
$this->wp->remove();
|
||||
parent::remove($flagForceRemoveProject);
|
||||
$this->wp->remove($flagRemoveCases);
|
||||
}
|
||||
|
||||
public static function createFromStruct(array $projectData, $generateUid = true)
|
||||
|
||||
@@ -106,11 +106,11 @@ class Workflow extends Handler
|
||||
$process->update($data);
|
||||
}
|
||||
|
||||
public function remove()
|
||||
public function remove($flagRemoveCases = true)
|
||||
{
|
||||
try {
|
||||
self::log("Remove Process with uid: {$this->proUid}");
|
||||
$this->deleteProcess($this->proUid);
|
||||
$this->deleteProcess($this->proUid, $flagRemoveCases);
|
||||
self::log("Remove Process Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
@@ -559,7 +559,7 @@ class Workflow extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteProcess($sProcessUID)
|
||||
public function deleteProcess($sProcessUID, $flagRemoveCases = true)
|
||||
{
|
||||
try {
|
||||
//G::LoadClass('case');
|
||||
@@ -580,17 +580,24 @@ class Workflow extends Handler
|
||||
$oReportTable = new \ReportTables();
|
||||
$oCaseTracker = new \CaseTracker();
|
||||
$oCaseTrackerObject = new \CaseTrackerObject();
|
||||
//Delete the applications of process
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->add(\ApplicationPeer::PRO_UID, $sProcessUID);
|
||||
$oDataset = \ApplicationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$oCase = new \Cases();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oCase->removeCase($aRow['APP_UID']);
|
||||
$oDataset->next();
|
||||
//Delete the applications of process
|
||||
if ($flagRemoveCases) {
|
||||
$case = new \Cases();
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\ApplicationPeer::APP_UID);
|
||||
$criteria->add(\ApplicationPeer::PRO_UID, $sProcessUID, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$result = $case->removeCase($row["APP_UID"]);
|
||||
}
|
||||
}
|
||||
|
||||
//Delete the tasks of process
|
||||
|
||||
@@ -115,7 +115,7 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
|
||||
'<td class="x-cnotes-label"><img border="0" src="../users/users_ViewPhotoGrid?pUID={USR_UID}" width="40" height="40"/></td>' +
|
||||
'<td class="x-cnotes-name">'+
|
||||
'<p class="user-from">{user}</p>'+
|
||||
'<p style="width: 260px; overflow-x:auto; height: 40px;", class="x-editable x-message">{NOTE_CONTENT}</p> '+
|
||||
'<p style="width: 370px; overflow-x:auto; height: 80px;", class="x-editable x-message">{NOTE_CONTENT}</p> '+
|
||||
'<p class="x-editable"><small>'+_('ID_POSTED_AT')+'<i> {NOTE_DATE}</i></small></p>'+
|
||||
'</td>' +
|
||||
'</tr>' +
|
||||
@@ -173,13 +173,13 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
|
||||
caseNotesWindow = new Ext.Window({
|
||||
title: _('ID_CASES_NOTES'), //Title of the Window
|
||||
id: 'caseNotesWindowPanel', //ID of the Window Panel
|
||||
width: 380, //Width of the Window
|
||||
width: 480, //Width of the Window
|
||||
resizable: true, //Resize of the Window, if false - it cannot be resized
|
||||
closable: true, //Hide close button of the Window
|
||||
modal: modalSw, //When modal:true it make the window modal and mask everything behind it when displayed
|
||||
//iconCls: 'ICON_CASES_NOTES',
|
||||
autoCreate: true,
|
||||
height:400,
|
||||
height:450,
|
||||
shadow:true,
|
||||
minWidth:380,
|
||||
minHeight:200,
|
||||
@@ -207,12 +207,12 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
|
||||
xtype : 'textarea',
|
||||
id : 'caseNoteText',
|
||||
name : 'caseNoteText',
|
||||
width : 330,
|
||||
width : 440,
|
||||
grow : true,
|
||||
height : 40,
|
||||
growMin: 40,
|
||||
height : 100,
|
||||
growMin: 100,
|
||||
growMax: 80,
|
||||
maxLengthText : 500,
|
||||
maxLengthText : 1500,
|
||||
allowBlank :false,
|
||||
selectOnFocus :true,
|
||||
enableKeyEvents: true,
|
||||
@@ -238,7 +238,7 @@ function openCaseNotesWindow(appUid1, delIndex, modalSw, appTitle, proUid, taskU
|
||||
boxLabel: _("ID_CASE_NOTES_LABEL_SEND")
|
||||
},
|
||||
'->',
|
||||
'<span id="countChar">500</span>',
|
||||
'<span id="countChar">1500</span>',
|
||||
' ',
|
||||
{
|
||||
id: 'sendBtn',
|
||||
@@ -306,10 +306,10 @@ function updateTextCtr(body, event) {
|
||||
ctr = document.getElementById('countChar').innerHTML;
|
||||
|
||||
text = Ext.getCmp('caseNoteText').getValue();
|
||||
maxLength = 500;
|
||||
maxLength = 1500;
|
||||
|
||||
if (text.length > maxLength) {
|
||||
Ext.getCmp('caseNoteText').setValue(Ext.getCmp('caseNoteText').getValue().substr(0,500));
|
||||
Ext.getCmp('caseNoteText').setValue(Ext.getCmp('caseNoteText').getValue().substr(0,1500));
|
||||
}
|
||||
else {
|
||||
document.getElementById('countChar').innerHTML = maxLength - text.length;
|
||||
@@ -347,7 +347,7 @@ function newNoteHandler()
|
||||
document.getElementById('countChar').style.display = 'block';
|
||||
Ext.getCmp('caseNoteText').focus();
|
||||
Ext.getCmp('caseNoteText').reset();
|
||||
document.getElementById('countChar').innerHTML = '500';
|
||||
document.getElementById('countChar').innerHTML = '1500';
|
||||
caseNotesWindow.doLayout();
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,10 @@ CloseWindow = function(){
|
||||
SaveNewCategory = function(){
|
||||
catName = newForm.getForm().findField('category').getValue();
|
||||
catName = catName.trim();
|
||||
if (catName == '') return;
|
||||
if (catName == '') {
|
||||
Ext.Msg.alert(_('ID_WARNING'), _("ID_FIELD_REQUIRED", _("ID_CATEGORY_NAME")));
|
||||
return;
|
||||
}
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url: 'processCategory_Ajax',
|
||||
@@ -425,7 +428,8 @@ EditCategory = function(){
|
||||
title: _('ID_EDIT_CATEGORY'),
|
||||
items: [editForm],
|
||||
id: 'w',
|
||||
modal: true
|
||||
modal: true,
|
||||
closeAction: "hide"
|
||||
});
|
||||
w.show();
|
||||
}
|
||||
|
||||
@@ -535,11 +535,12 @@ EditRole = function(){
|
||||
editForm.getForm().findField('name').setValue(rowSelected.data.ROL_NAME);
|
||||
editForm.getForm().findField('status').setValue(rowSelected.data.ROL_STATUS);
|
||||
w = new Ext.Window({
|
||||
closeAction: "hide",
|
||||
autoHeight: true,
|
||||
id: 'w',
|
||||
modal: true,
|
||||
width: 420,
|
||||
title: _('ID_EDIT_ROLE_TITLE'),
|
||||
title: _("ID_EDIT_ROLE_TITLE"),
|
||||
items: [editForm]
|
||||
});
|
||||
w.show();
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<td>
|
||||
<a target="_blank" href="http://www.processmaker.com"><img src="/images/get_started.png" border="0" width="163" height="438"></a>
|
||||
</td>
|
||||
<td class="cell2" valign="top">
|
||||
<td class="cell2" valign="top" align="left">
|
||||
<p><b><span class="cLow">Welcome to ProcessMaker</span></b></p><br/>
|
||||
<p style="text-align: justify;"><span class="cLow-min">This new version features a new process designer based upon the Business Process Management Notation 2 standard. It offers a new form designer with flexible layouts for desktops, tablets and cellphones and a new REST API to remotely access ProcessMaker.</span></p>
|
||||
<p style="text-align: justify;"><span class="cLow-min">To get started, log in using the following credentials. You can change them later:</span></p>
|
||||
|
||||
@@ -1,44 +1,12 @@
|
||||
<?php
|
||||
$url = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APP_UID"] . "&tracker_designer=1";
|
||||
$urlTrackerProcessMap = "../designer?prj_uid=" . $_SESSION["PROCESS"] . "&prj_readonly=true&app_uid=" . $_SESSION["APPLICATION"] . "&tracker_designer=1";
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var winTracker;
|
||||
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
var li1 = document.getElementById("MAP");
|
||||
var a1 = li1.getElementsByTagName("a");
|
||||
a1[0].href = "javascript:;";
|
||||
a1[0].onclick = function () { winTracker = window.open("<?php echo $url; ?>", "winTracker"); return false; };
|
||||
|
||||
var li2 = document.getElementById("DYNADOC");
|
||||
var a2= li2.getElementsByTagName("a");
|
||||
a2[0].onclick = function ()
|
||||
{
|
||||
if (winTracker) {
|
||||
winTracker.close();
|
||||
}
|
||||
};
|
||||
|
||||
var li3 = document.getElementById("HISTORY");
|
||||
var a3 = li3.getElementsByTagName("a");
|
||||
a3[0].onclick = function ()
|
||||
{
|
||||
if (winTracker) {
|
||||
winTracker.close();
|
||||
}
|
||||
};
|
||||
|
||||
var li4 = document.getElementById("MESSAGES");
|
||||
var a4 = li4.getElementsByTagName("a");
|
||||
a4[0].onclick = function ()
|
||||
{
|
||||
if (winTracker) {
|
||||
winTracker.close();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
document.write("<iframe name=\"casesFrame\" id=\"casesFrame\" src=\"<?php echo $url; ?>\" width=\"99%\" height=\"768\" frameborder=\"0\">");
|
||||
if (!(navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
document.write("<iframe name=\"casesFrame\" id=\"casesFrame\" src=\"<?php echo $urlTrackerProcessMap; ?>\" width=\"99%\" height=\"768\" frameborder=\"0\">");
|
||||
document.write("<p>Your browser does not support iframes.</p>");
|
||||
document.write("</iframe>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user