Merge remote branch 'upstream/master'
Conflicts: workflow/engine/methods/services/xpdl.php
This commit is contained in:
19
build.xml
19
build.xml
@@ -1,11 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<project name="name-of-project" default="build-simple">
|
<project name="name-of-project" default="build-phpcs">
|
||||||
<target name="build"
|
<target name="build"
|
||||||
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,phpcb"/>
|
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,phpcb"/>
|
||||||
|
|
||||||
<target name="build-simple"
|
<target name="build-simple"
|
||||||
depends="prepare,phpunit,phpcs-ci,phploc"/>
|
depends="prepare,phpunit,phpcs-ci,phploc,lint"/>
|
||||||
|
|
||||||
|
<target name="build-phpcs"
|
||||||
|
depends="prepare,phpcs-ci,phploc,phpunit"/>
|
||||||
|
|
||||||
<target name="build-parallel"
|
<target name="build-parallel"
|
||||||
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
|
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
|
||||||
@@ -98,6 +101,18 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
|
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
|
||||||
|
<exec executable="phpcs" output="/dev/null">
|
||||||
|
<arg value="--report=checkstyle" />
|
||||||
|
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
|
||||||
|
<arg value="--standard=PSR2" />
|
||||||
|
<arg path="${basedir}/gulliver/system" />
|
||||||
|
<arg path="${basedir}/workflow/engine/methods" />
|
||||||
|
<arg path="${basedir}/workflow/engine/classes" />
|
||||||
|
<arg path="${basedir}/workflow/engine/controllers" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="phpcs-ci-old" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
|
||||||
<exec executable="phpcs" output="/dev/null">
|
<exec executable="phpcs" output="/dev/null">
|
||||||
<arg value="--report=checkstyle" />
|
<arg value="--report=checkstyle" />
|
||||||
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
|
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
|
||||||
|
|||||||
@@ -681,17 +681,20 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Set focus the first element in the grid
|
||||||
|
for (var i = 0; i < this.aFields.length; i++) {
|
||||||
|
var fieldName = 'form[' + sGridName + '][' + currentRow + '][' + this.aFields[i].sFieldName + ']';
|
||||||
|
if (this.aFields[i].sType != 'file' && this.aFields[i].sType != 'hidden' && document.getElementById(fieldName).focus) {
|
||||||
|
document.getElementById(fieldName).focus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Fires OnAddRow Event
|
//Fires OnAddRow Event
|
||||||
if (this.onaddrow) {
|
if (this.onaddrow) {
|
||||||
this.onaddrow(currentRow);
|
this.onaddrow(currentRow);
|
||||||
}
|
}
|
||||||
var newInputs = oNewRow.getElementsByTagName('input');
|
|
||||||
for (var i = 0; i < newInputs.length; i++) {
|
|
||||||
if (typeof(newInputs[i]) != 'undefined' && newInputs[i].type != 'hidden') {
|
|
||||||
newInputs[i].focus();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.deleteGridRow = function (sRow, bWithoutConfirm)
|
this.deleteGridRow = function (sRow, bWithoutConfirm)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller Class
|
* Controller Class
|
||||||
* Implementing MVC Pattern
|
* Implementing MVC Pattern
|
||||||
|
*
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
* @access private
|
* @access private
|
||||||
@@ -9,30 +11,36 @@
|
|||||||
class Controller
|
class Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var boolean debug switch for general purpose
|
* @var boolean debug switch for general purpose
|
||||||
*/
|
*/
|
||||||
public $debug = null;
|
public $debug = null;
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var array - private array to store proxy data
|
* @var array - private array to store proxy data
|
||||||
*/
|
*/
|
||||||
private $__data__ = array();
|
private $__data__ = array ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var object - private object to store the http request data
|
* @var object - private object to store the http request data
|
||||||
*/
|
*/
|
||||||
private $__request__;
|
private $__request__;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var object - headPublisher object to handle the output
|
* @var object - headPublisher object to handle the output
|
||||||
*/
|
*/
|
||||||
private $headPublisher = null;
|
private $headPublisher = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var string - response type var. possibles values: json|plain
|
* @var string - response type var. possibles values: json|plain
|
||||||
*/
|
*/
|
||||||
private $responseType = '';
|
private $responseType = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @var string - layout to pass skinEngine
|
* @var string - layout to pass skinEngine
|
||||||
*/
|
*/
|
||||||
private $layout = '';
|
private $layout = '';
|
||||||
@@ -43,7 +51,7 @@ class Controller
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @param string $value
|
* @param string $value
|
||||||
*/
|
*/
|
||||||
public function __set($name, $value)
|
public function __set ($name, $value)
|
||||||
{
|
{
|
||||||
$this->__data__[$name] = $value;
|
$this->__data__[$name] = $value;
|
||||||
}
|
}
|
||||||
@@ -54,215 +62,235 @@ class Controller
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @return string or NULL if the internal var doesn't exist
|
* @return string or NULL if the internal var doesn't exist
|
||||||
*/
|
*/
|
||||||
public function __get($name)
|
public function __get ($name)
|
||||||
{
|
{
|
||||||
if (array_key_exists($name, $this->__data__)) {
|
if (array_key_exists( $name, $this->__data__ )) {
|
||||||
return $this->__data__[$name];
|
return $this->__data__[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
$trace = debug_backtrace();
|
$trace = debug_backtrace();
|
||||||
trigger_error(
|
trigger_error( 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_NOTICE );
|
||||||
'Undefined property via __get(): ' . $name .
|
|
||||||
' in ' . $trace[0]['file'] .
|
|
||||||
' on line ' . $trace[0]['line'],
|
|
||||||
E_USER_NOTICE);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Magic isset method
|
* Magic isset method
|
||||||
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function __isset($name)
|
public function __isset ($name)
|
||||||
{
|
{
|
||||||
return isset($this->__data__[$name]);
|
return isset( $this->__data__[$name] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Magic unset method
|
* Magic unset method
|
||||||
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function __unset($name)
|
public function __unset ($name)
|
||||||
{
|
{
|
||||||
unset($this->__data__[$name]);
|
unset( $this->__data__[$name] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Response type method
|
* Set Response type method
|
||||||
|
*
|
||||||
* @param string $type contains : json|plain
|
* @param string $type contains : json|plain
|
||||||
*/
|
*/
|
||||||
public function setResponseType($type)
|
public function setResponseType ($type)
|
||||||
{
|
{
|
||||||
$this->responseType = $type;
|
$this->responseType = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call to execute a internal proxy method and handle its exceptions
|
* call to execute a internal proxy method and handle its exceptions
|
||||||
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*/
|
*/
|
||||||
public function call($name)
|
public function call ($name)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$result = $this->$name($this->__request__);
|
$result = $this->$name( $this->__request__ );
|
||||||
if ($this->responseType == 'json') {
|
if ($this->responseType == 'json') {
|
||||||
print G::json_encode($result);
|
print G::json_encode( $result );
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if ($this->responseType != 'json') {
|
if ($this->responseType != 'json') {
|
||||||
$result->exception->class = get_class($e);
|
$result->exception->class = get_class( $e );
|
||||||
$result->exception->code = $e->getCode();
|
$result->exception->code = $e->getCode();
|
||||||
|
|
||||||
$template = new TemplatePower(PATH_TEMPLATE . 'controller.exception.tpl');
|
$template = new TemplatePower( PATH_TEMPLATE . 'controller.exception.tpl' );
|
||||||
$template->prepare();
|
$template->prepare();
|
||||||
$template->assign('controller', (function_exists('get_called_class') ? get_called_class() : 'Controller'));
|
$template->assign( 'controller', (function_exists( 'get_called_class' ) ? get_called_class() : 'Controller') );
|
||||||
$template->assign('message', $e->getMessage());
|
$template->assign( 'message', $e->getMessage() );
|
||||||
$template->assign('file', $e->getFile());
|
$template->assign( 'file', $e->getFile() );
|
||||||
$template->assign('line', $e->getLine());
|
$template->assign( 'line', $e->getLine() );
|
||||||
$template->assign('trace', $e->getTraceAsString());
|
$template->assign( 'trace', $e->getTraceAsString() );
|
||||||
|
|
||||||
echo $template->getOutputContent();
|
echo $template->getOutputContent();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$result->success = false;
|
$result->success = false;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
switch(get_class($e)) {
|
switch (get_class( $e )) {
|
||||||
case 'Exception': $error = "SYSTEM ERROR"; break;
|
case 'Exception':
|
||||||
case 'PMException': $error = "PROCESSMAKER ERROR"; break;
|
$error = "SYSTEM ERROR";
|
||||||
case 'PropelException': $error = "DATABASE ERROR"; break;
|
break;
|
||||||
case 'UserException': $error = "USER ERROR"; break;
|
case 'PMException':
|
||||||
|
$error = "PROCESSMAKER ERROR";
|
||||||
|
break;
|
||||||
|
case 'PropelException':
|
||||||
|
$error = "DATABASE ERROR";
|
||||||
|
break;
|
||||||
|
case 'UserException':
|
||||||
|
$error = "USER ERROR";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$result->error = $error;
|
$result->error = $error;
|
||||||
|
|
||||||
$result->exception->class = get_class($e);
|
$result->exception->class = get_class( $e );
|
||||||
$result->exception->code = $e->getCode();
|
$result->exception->code = $e->getCode();
|
||||||
print G::json_encode($result);
|
print G::json_encode( $result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the http request data
|
* Set the http request data
|
||||||
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*/
|
*/
|
||||||
public function setHttpRequestData($data)
|
public function setHttpRequestData ($data)
|
||||||
{
|
{
|
||||||
if (!is_object($this->__request__)) {
|
if (! is_object( $this->__request__ )) {
|
||||||
$this->__request__ = new stdclass();
|
$this->__request__ = new stdclass();
|
||||||
}
|
}
|
||||||
if( is_array($data) ) {
|
if (is_array( $data )) {
|
||||||
while( $var = each($data) )
|
while ($var = each( $data )) {
|
||||||
$this->__request__->$var['key'] = $var['value'];
|
$this->__request__->$var['key'] = $var['value'];
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
$this->__request__ = $data;
|
$this->__request__ = $data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get debug var. method
|
* Get debug var.
|
||||||
|
* method
|
||||||
|
*
|
||||||
* @param boolan $val boolean value for debug var.
|
* @param boolan $val boolean value for debug var.
|
||||||
*/
|
*/
|
||||||
public function setDebug($val)
|
public function setDebug ($val)
|
||||||
{
|
{
|
||||||
$this->debug = $val;
|
$this->debug = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get debug var. method
|
* Get debug var.
|
||||||
|
* method
|
||||||
*/
|
*/
|
||||||
public function getDebug()
|
public function getDebug ()
|
||||||
{
|
{
|
||||||
if ($this->debug === null) {
|
if ($this->debug === null) {
|
||||||
$this->debug = defined('DEBUG') && DEBUG ? true : false;
|
$this->debug = defined( 'DEBUG' ) && DEBUG ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->debug;
|
return $this->debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*** HeadPublisher Functions Binding ***/
|
* * HeadPublisher Functions Binding **
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include a particular extjs library or extension to the main output
|
* Include a particular extjs library or extension to the main output
|
||||||
|
*
|
||||||
* @param string $srcFile path of a extjs library or extension
|
* @param string $srcFile path of a extjs library or extension
|
||||||
* @param boolean $debug debug flag to indicate if the js output will be minifield or not
|
* @param boolean $debug debug flag to indicate if the js output will be minifield or not
|
||||||
* $debug: true -> the js content will be not minified (readable)
|
* $debug: true -> the js content will be not minified (readable)
|
||||||
* false -> the js content will be minified
|
* false -> the js content will be minified
|
||||||
*/
|
*/
|
||||||
public function includeExtJSLib($srcFile, $debug=false)
|
public function includeExtJSLib ($srcFile, $debug = false)
|
||||||
{
|
{
|
||||||
$this->getHeadPublisher()->usingExtJs($srcFile, ($debug ? $debug : $this->getDebug()));
|
$this->getHeadPublisher()->usingExtJs( $srcFile, ($debug ? $debug : $this->getDebug()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include a javascript file that is using extjs framework to the main output
|
* Include a javascript file that is using extjs framework to the main output
|
||||||
|
*
|
||||||
* @param string $srcFile path of javascrit file to include
|
* @param string $srcFile path of javascrit file to include
|
||||||
* @param boolean $debug debug flag to indicate if the js output will be minifield or not
|
* @param boolean $debug debug flag to indicate if the js output will be minifield or not
|
||||||
* $debug: true -> the js content will be not minified (readable)
|
* $debug: true -> the js content will be not minified (readable)
|
||||||
* false -> the js content will be minified
|
* false -> the js content will be minified
|
||||||
*/
|
*/
|
||||||
public function includeExtJS($srcFile, $debug=false)
|
public function includeExtJS ($srcFile, $debug = false)
|
||||||
{
|
{
|
||||||
$this->getHeadPublisher()->addExtJsScript($srcFile, ($debug ? $debug : $this->getDebug()));
|
$this->getHeadPublisher()->addExtJsScript( $srcFile, ($debug ? $debug : $this->getDebug()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include a Html file to the main output
|
* Include a Html file to the main output
|
||||||
|
*
|
||||||
* @param string $file path of html file to include to the main output
|
* @param string $file path of html file to include to the main output
|
||||||
*/
|
*/
|
||||||
public function setView($file)
|
public function setView ($file)
|
||||||
{
|
{
|
||||||
$this->getHeadPublisher()->addContent($file);
|
$this->getHeadPublisher()->addContent( $file );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set variables to be accesible by javascripts
|
* Set variables to be accesible by javascripts
|
||||||
|
*
|
||||||
* @param string $name contains var. name
|
* @param string $name contains var. name
|
||||||
* @param string $value conatins var. value
|
* @param string $value conatins var. value
|
||||||
*/
|
*/
|
||||||
public function setJSVar($name, $value)
|
public function setJSVar ($name, $value)
|
||||||
{
|
{
|
||||||
$this->getHeadPublisher()->assign($name, $value);
|
$this->getHeadPublisher()->assign( $name, $value );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set variables to be accesible by the extjs layout template
|
* Set variables to be accesible by the extjs layout template
|
||||||
|
*
|
||||||
* @param string $name contains var. name
|
* @param string $name contains var. name
|
||||||
* @param string $value conatins var. value
|
* @param string $value conatins var. value
|
||||||
*/
|
*/
|
||||||
public function setVar($name, $value)
|
public function setVar ($name, $value)
|
||||||
{
|
{
|
||||||
$this->getHeadPublisher()->assignVar($name, $value);
|
$this->getHeadPublisher()->assignVar( $name, $value );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method to get the local getHeadPublisher object
|
* method to get the local getHeadPublisher object
|
||||||
*/
|
*/
|
||||||
public function getHeadPublisher()
|
public function getHeadPublisher ()
|
||||||
{
|
{
|
||||||
if (!is_object($this->headPublisher)) {
|
if (! is_object( $this->headPublisher )) {
|
||||||
$this->headPublisher = headPublisher::getSingleton();
|
$this->headPublisher = headPublisher::getSingleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->headPublisher;
|
return $this->headPublisher;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLayout($layout)
|
public function setLayout ($layout)
|
||||||
{
|
{
|
||||||
$this->layout = $layout;
|
$this->layout = $layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render($type='mvc')
|
public function render ($type = 'mvc')
|
||||||
{
|
{
|
||||||
G::RenderPage('publish', $type, null, $this->layout);
|
G::RenderPage( 'publish', $type, null, $this->layout );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function header($header)
|
public function header ($header)
|
||||||
{
|
{
|
||||||
G::header($header);
|
G::header( $header );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function redirect($url)
|
public function redirect ($url)
|
||||||
{
|
{
|
||||||
G::header("Location: $url");
|
G::header( "Location: $url" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.database_base.php
|
* class.database_base.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -26,20 +28,29 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* interface iDatabase
|
* interface iDatabase
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface iDatabase {
|
interface iDatabase
|
||||||
public function generateDropTableSQL($sTable);
|
{
|
||||||
public function generateCreateTableSQL($sTable, $aColumns);
|
|
||||||
public function generateDropColumnSQL($sTable, $sColumn);
|
public function generateDropTableSQL ($sTable);
|
||||||
public function generateAddColumnSQL($sTable, $sColumn, $aParameters);
|
|
||||||
public function generateChangeColumnSQL($sTable, $sColumn, $aParameters);
|
public function generateCreateTableSQL ($sTable, $aColumns);
|
||||||
public function close();
|
|
||||||
|
public function generateDropColumnSQL ($sTable, $sColumn);
|
||||||
|
|
||||||
|
public function generateAddColumnSQL ($sTable, $sColumn, $aParameters);
|
||||||
|
|
||||||
|
public function generateChangeColumnSQL ($sTable, $sColumn, $aParameters);
|
||||||
|
|
||||||
|
public function close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class database_base
|
* class database_base
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
@@ -56,6 +67,7 @@ class database_base implements iDatabase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function __construct
|
* Function __construct
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sType
|
* @param string $sType
|
||||||
* @param string $sServer
|
* @param string $sServer
|
||||||
@@ -65,7 +77,7 @@ class database_base implements iDatabase
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME)
|
public function __construct ($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME)
|
||||||
{
|
{
|
||||||
$this->sType = $sType;
|
$this->sType = $sType;
|
||||||
$this->sServer = $sServer;
|
$this->sServer = $sServer;
|
||||||
@@ -78,11 +90,12 @@ class database_base implements iDatabase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sTable
|
* @param string $sTable
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function generateDropTableSQL($sTable)
|
public function generateDropTableSQL ($sTable)
|
||||||
{
|
{
|
||||||
$sSQL = 'DROP TABLE IF EXISTS ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
$sSQL = 'DROP TABLE IF EXISTS ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
@@ -90,66 +103,73 @@ class database_base implements iDatabase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sTable
|
* @param string $sTable
|
||||||
* @param string $sColumn
|
* @param string $sColumn
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function generateCreateTableSQL($sTable, $aColumns)
|
public function generateCreateTableSQL ($sTable, $aColumns)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sTable
|
* @param string $sTable
|
||||||
* @param string $sColumn
|
* @param string $sColumn
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function generateDropColumnSQL($sTable, $sColumn)
|
public function generateDropColumnSQL ($sTable, $sColumn)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sTable
|
* @param string $sTable
|
||||||
* @param string $sColumn
|
* @param string $sColumn
|
||||||
* @param string $aParameters
|
* @param string $aParameters
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function generateAddColumnSQL($sTable, $sColumn, $aParameters)
|
public function generateAddColumnSQL ($sTable, $sColumn, $aParameters)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sTable
|
* @param string $sTable
|
||||||
* @param string $sColumn
|
* @param string $sColumn
|
||||||
* @param string $aParameters
|
* @param string $aParameters
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function generateChangeColumnSQL($sTable, $sColumn, $aParameters)
|
public function generateChangeColumnSQL ($sTable, $sColumn, $aParameters)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function generateDropTableSQL
|
* Function generateDropTableSQL
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sQuery
|
* @param string $sQuery
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function executeQuery($sQuery)
|
public function executeQuery ($sQuery)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function close
|
* Function close
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* class.database_mssql.php
|
* class.database_mssql.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -25,50 +26,52 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*/
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
G::LoadSystem('database_base');
|
G::LoadSystem( 'database_base' );
|
||||||
|
|
||||||
class database extends database_base {
|
|
||||||
|
|
||||||
|
class database extends database_base
|
||||||
|
{
|
||||||
public $iFetchType = MSSQL_ASSOC;
|
public $iFetchType = MSSQL_ASSOC;
|
||||||
|
|
||||||
public function __construct($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME) {
|
public function __construct ($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME)
|
||||||
|
{
|
||||||
$this->sType = $sType;
|
$this->sType = $sType;
|
||||||
$this->sServer = $sServer;
|
$this->sServer = $sServer;
|
||||||
$this->sUser = $sUser;
|
$this->sUser = $sUser;
|
||||||
$this->sPass = $sPass;
|
$this->sPass = $sPass;
|
||||||
$this->sDataBase = $sDataBase;
|
$this->sDataBase = $sDataBase;
|
||||||
$this->oConnection = @mssql_connect($sServer, $sUser, $sPass) || null;
|
$this->oConnection = @mssql_connect( $sServer, $sUser, $sPass ) || null;
|
||||||
$this->sQuoteCharacter = ' ';
|
$this->sQuoteCharacter = ' ';
|
||||||
$this->nullString = 'NULL';
|
$this->nullString = 'NULL';
|
||||||
$this->sQuoteCharacterBegin = '[';
|
$this->sQuoteCharacterBegin = '[';
|
||||||
$this->sQuoteCharacterEnd = ']';
|
$this->sQuoteCharacterEnd = ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function generateCreateTableSQL ($sTable, $aColumns)
|
||||||
|
{
|
||||||
public function generateCreateTableSQL($sTable, $aColumns) {
|
|
||||||
$sKeys = '';
|
$sKeys = '';
|
||||||
$sSQL = 'CREATE TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . '(';
|
$sSQL = 'CREATE TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . '(';
|
||||||
|
|
||||||
foreach ($aColumns as $sColumnName => $aParameters) {
|
foreach ($aColumns as $sColumnName => $aParameters) {
|
||||||
if ($sColumnName != 'INDEXES') {
|
if ($sColumnName != 'INDEXES') {
|
||||||
|
|
||||||
if ( $sColumnName != '' && isset($aParameters['Type']) && $aParameters['Type'] != '' ){
|
if ($sColumnName != '' && isset( $aParameters['Type'] ) && $aParameters['Type'] != '') {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ' ' . $aParameters['Type'];
|
$sSQL .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ' ' . $aParameters['Type'];
|
||||||
|
|
||||||
if ( isset($aParameters['Null']) && $aParameters['Null'] == 'YES') {
|
if (isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= ' NULL';
|
$sSQL .= ' NULL';
|
||||||
} else {
|
} else {
|
||||||
$sSQL .= ' NOT NULL';
|
$sSQL .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
if ( isset($aParameters['Key']) && $aParameters['Key'] == 'PRI') {
|
if (isset( $aParameters['Key'] ) && $aParameters['Key'] == 'PRI') {
|
||||||
$sKeys .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ',';
|
$sKeys .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($aParameters['Default']) && $aParameters['Default'] != '' ) {
|
if (isset( $aParameters['Default'] ) && $aParameters['Default'] != '') {
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,54 +79,57 @@ class database extends database_base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -1);
|
$sSQL = substr( $sSQL, 0, - 1 );
|
||||||
if ($sKeys != '') {
|
if ($sKeys != '') {
|
||||||
$sSQL .= ',PRIMARY KEY(' . substr($sKeys, 0, -1) . ')';
|
$sSQL .= ',PRIMARY KEY(' . substr( $sKeys, 0, - 1 ) . ')';
|
||||||
}
|
}
|
||||||
$sSQL .= ')' . $this->sEndLine;
|
$sSQL .= ')' . $this->sEndLine;
|
||||||
|
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDropTableSQL($sTable) {
|
public function generateDropTableSQL ($sTable)
|
||||||
|
{
|
||||||
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDropColumnSQL($sTable, $sColumn) {
|
public function generateDropColumnSQL ($sTable, $sColumn)
|
||||||
|
{
|
||||||
// SQL Server first should remove the restriction before the Elimination of the field
|
// SQL Server first should remove the restriction before the Elimination of the field
|
||||||
$oConstraint = $this->dropFieldConstraint($sTable, $sColumn);
|
$oConstraint = $this->dropFieldConstraint( $sTable, $sColumn );
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
' DROP COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . $this->sEndLine;
|
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateAddColumnSQL($sTable, $sColumn, $aParameters) {
|
public function generateAddColumnSQL ($sTable, $sColumn, $aParameters)
|
||||||
if ( isset($aParameters['Type']) && isset($aParameters['Null']) ) {
|
{
|
||||||
|
if (isset( $aParameters['Type'] ) && isset( $aParameters['Null'] )) {
|
||||||
$sDefault = "";
|
$sDefault = "";
|
||||||
$sType = $aParameters['Type'];
|
$sType = $aParameters['Type'];
|
||||||
$sDataType = $aParameters['Type'];
|
$sDataType = $aParameters['Type'];
|
||||||
if(! in_array($sDataType, array("TEXT", "DATE") )) {
|
if (! in_array( $sDataType, array ("TEXT","DATE"
|
||||||
$sType = substr($sType, 0, strpos($sType,'('));
|
) )) {
|
||||||
|
$sType = substr( $sType, 0, strpos( $sType, '(' ) );
|
||||||
}
|
}
|
||||||
switch($sType) {
|
switch ($sType) {
|
||||||
case 'VARCHAR' :
|
case 'VARCHAR':
|
||||||
case 'TEXT' : $sDefault = " DEFAULT '' ";
|
case 'TEXT':
|
||||||
|
$sDefault = " DEFAULT '' ";
|
||||||
break;
|
break;
|
||||||
case 'DATE' : $sDataType = " CHAR(19) ";
|
case 'DATE':
|
||||||
|
$sDataType = " CHAR(19) ";
|
||||||
$sDefault = " DEFAULT '0000-00-00' "; // The date data type to use char (19)
|
$sDefault = " DEFAULT '0000-00-00' "; // The date data type to use char (19)
|
||||||
break;
|
break;
|
||||||
case 'INT' :
|
case 'INT':
|
||||||
case 'FLOAT' : $sDataType = $sType;
|
case 'FLOAT':
|
||||||
|
$sDataType = $sType;
|
||||||
$sDefault = " DEFAULT 0 ";
|
$sDefault = " DEFAULT 0 ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$sSQL = "ALTER TABLE " . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sSQL = "ALTER TABLE " . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " ADD " . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . " " . $aParameters['Type'];
|
||||||
" ADD " . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter .
|
|
||||||
" " . $aParameters['Type'];
|
|
||||||
if ($aParameters['Null'] == 'YES') {
|
if ($aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= " NULL";
|
$sSQL .= " NULL";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sSQL .= " NOT NULL " . $sDefault;
|
$sSQL .= " NOT NULL " . $sDefault;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -132,18 +138,16 @@ class database extends database_base {
|
|||||||
$sKeys .= 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sKeys .= 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
||||||
' ADD PRIMARY KEY (' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ')' . $this->sEndLine;
|
' ADD PRIMARY KEY (' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ')' . $this->sEndLine;
|
||||||
}*/
|
}*/
|
||||||
if (isset($aParameters['AI'])) {
|
if (isset( $aParameters['AI'] )) {
|
||||||
if ($aParameters['AI'] == 1) {
|
if ($aParameters['AI'] == 1) {
|
||||||
$sSQL .= ' AUTO_INCREMENT';
|
$sSQL .= ' AUTO_INCREMENT';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($aParameters['Default'] != '') {
|
if ($aParameters['Default'] != '') {
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
if (isset( $aParameters['Default'] ) && $aParameters['Default'] != '') {
|
||||||
if (isset($aParameters['Default']) && $aParameters['Default'] != '') {
|
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,18 +155,16 @@ class database extends database_base {
|
|||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateChangeColumnSQL($sTable, $sColumn, $aParameters, $sColumnNewName = '') {
|
public function generateChangeColumnSQL ($sTable, $sColumn, $aParameters, $sColumnNewName = '')
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
{
|
||||||
' CHANGE COLUMN ' . $this->sQuoteCharacter . ($sColumnNewName != '' ? $sColumnNewName : $sColumn) . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' CHANGE COLUMN ' . $this->sQuoteCharacter . ($sColumnNewName != '' ? $sColumnNewName : $sColumn) . $this->sQuoteCharacter . ' ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter;
|
||||||
' ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter;
|
if (isset( $aParameters['Type'] )) {
|
||||||
if (isset($aParameters['Type'])) {
|
|
||||||
$sSQL .= ' ' . $aParameters['Type'];
|
$sSQL .= ' ' . $aParameters['Type'];
|
||||||
}
|
}
|
||||||
if (isset($aParameters['Null'])) {
|
if (isset( $aParameters['Null'] )) {
|
||||||
if ($aParameters['Null'] == 'YES') {
|
if ($aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= ' NULL';
|
$sSQL .= ' NULL';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sSQL .= ' NOT NULL';
|
$sSQL .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,15 +181,14 @@ class database extends database_base {
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//else {
|
//else {
|
||||||
if (isset($aParameters['Default'])) {
|
if (isset( $aParameters['Default'] )) {
|
||||||
if ( trim($aParameters['Default'] == '') && $aParameters['Type'] == 'datetime' ) {
|
if (trim( $aParameters['Default'] == '' ) && $aParameters['Type'] == 'datetime') {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
if (!isset($aParameters['Default']) && isset($aParameters['Null']) && $aParameters['Null'] == 'YES') {
|
if (! isset( $aParameters['Default'] ) && isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= " DEFAULT NULL ";
|
$sSQL .= " DEFAULT NULL ";
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
@@ -195,36 +196,31 @@ class database extends database_base {
|
|||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateGetPrimaryKeysSQL($sTable) {
|
public function generateGetPrimaryKeysSQL ($sTable)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' WHERE Seq_in_index = 1' . $this->sEndLine;
|
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' WHERE Seq_in_index = 1' . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get primary key
|
* Get primary key
|
||||||
* @parameter string $sTable
|
*
|
||||||
|
* @param eter string $sTable
|
||||||
* @return string $sPrimaryKey
|
* @return string $sPrimaryKey
|
||||||
*/
|
*/
|
||||||
public function getPrimaryKey($sTable)
|
public function getPrimaryKey ($sTable)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sSQL = " SELECT c.COLUMN_NAME " .
|
$sSQL = " SELECT c.COLUMN_NAME " . " FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk , " . " INFORMATION_SCHEMA.KEY_COLUMN_USAGE c " . " WHERE pk.TABLE_NAME = '" . trim( $sTable ) . "' " . " AND CONSTRAINT_TYPE = 'PRIMARY KEY' " . " AND c.TABLE_NAME = pk.TABLE_NAME " . " AND c.CONSTRAINT_NAME = pk.CONSTRAINT_NAME ";
|
||||||
" FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk , " .
|
$oPrimaryKey = $this->executeQuery( $sSQL );
|
||||||
" INFORMATION_SCHEMA.KEY_COLUMN_USAGE c " .
|
$aPrimaryKey = mssql_fetch_array( $oPrimaryKey );
|
||||||
" WHERE pk.TABLE_NAME = '" . trim($sTable) . "' " .
|
mssql_free_result( $oPrimaryKey );
|
||||||
" AND CONSTRAINT_TYPE = 'PRIMARY KEY' " .
|
|
||||||
" AND c.TABLE_NAME = pk.TABLE_NAME " .
|
|
||||||
" AND c.CONSTRAINT_NAME = pk.CONSTRAINT_NAME ";
|
|
||||||
$oPrimaryKey = $this->executeQuery($sSQL);
|
|
||||||
$aPrimaryKey = mssql_fetch_array($oPrimaryKey);
|
|
||||||
mssql_free_result($oPrimaryKey);
|
|
||||||
return $aPrimaryKey[0];
|
return $aPrimaryKey[0];
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
throw $oException;
|
throw $oException;
|
||||||
@@ -233,100 +229,95 @@ class database extends database_base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Field Constraint
|
* Get Field Constraint
|
||||||
* @parameter string $sTable
|
*
|
||||||
* @parameter string $sField
|
* @param eter string $sTable
|
||||||
|
* @param eter string $sField
|
||||||
* @return string $sFieldConstraint
|
* @return string $sFieldConstraint
|
||||||
*/
|
*/
|
||||||
public function getFieldConstraint($sTable, $sField)
|
public function getFieldConstraint ($sTable, $sField)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sSQL = " select a.name " .
|
$sSQL = " select a.name " . " from sysobjects a " . " inner join syscolumns b on a.id = b.cdefault " . " where a.xtype = 'D' " . " and a.parent_obj = (select id from sysobjects where xtype = 'U' and name = '" . trim( $sTable ) . "') " . " and b.name = '" . trim( $sField ) . "' ";
|
||||||
" from sysobjects a " .
|
|
||||||
" inner join syscolumns b on a.id = b.cdefault " .
|
|
||||||
" where a.xtype = 'D' " .
|
|
||||||
" and a.parent_obj = (select id from sysobjects where xtype = 'U' and name = '" . trim($sTable) . "') " .
|
|
||||||
" and b.name = '" . trim($sField) . "' ";
|
|
||||||
|
|
||||||
$oFieldConstraint = $this->executeQuery($sSQL);
|
$oFieldConstraint = $this->executeQuery( $sSQL );
|
||||||
$aFieldConstraint = mssql_fetch_array($oFieldConstraint);
|
$aFieldConstraint = mssql_fetch_array( $oFieldConstraint );
|
||||||
mssql_free_result($oFieldConstraint);
|
mssql_free_result( $oFieldConstraint );
|
||||||
return $aFieldConstraint[0];
|
return $aFieldConstraint[0];
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop Field Constraint
|
* drop Field Constraint
|
||||||
* @parameter string $sTable
|
*
|
||||||
* @parameter string $sField
|
* @param eter string $sTable
|
||||||
|
* @param eter string $sField
|
||||||
* @return object $oFieldConstraint
|
* @return object $oFieldConstraint
|
||||||
*/
|
*/
|
||||||
public function dropFieldConstraint($sTable, $sField)
|
public function dropFieldConstraint ($sTable, $sField)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sConstraint = $this->getFieldConstraint($sTable, $sField);
|
$sConstraint = $this->getFieldConstraint( $sTable, $sField );
|
||||||
$sSQL = "ALTER TABLE " . $sTable . " DROP CONSTRAINT " . $sConstraint . $this->sEndLine ;
|
$sSQL = "ALTER TABLE " . $sTable . " DROP CONSTRAINT " . $sConstraint . $this->sEndLine;
|
||||||
$oFieldConstraint = $this->executeQuery($sSQL);
|
$oFieldConstraint = $this->executeQuery( $sSQL );
|
||||||
return $oFieldConstraint;
|
return $oFieldConstraint;
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function generateDropPrimaryKeysSQL ($sTable)
|
||||||
public function generateDropPrimaryKeysSQL($sTable) {
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
$sPrimayKey = $this->getPrimaryKey($sTable);
|
$sPrimayKey = $this->getPrimaryKey( $sTable );
|
||||||
|
|
||||||
return ' ALTER TABLE ' . $sTable . ' DROP CONSTRAINT ' . $sPrimayKey . $this->sEndLine;
|
return ' ALTER TABLE ' . $sTable . ' DROP CONSTRAINT ' . $sPrimayKey . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateAddPrimaryKeysSQL($sTable, $aPrimaryKeys) {
|
public function generateAddPrimaryKeysSQL ($sTable, $aPrimaryKeys)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' ADD PRIMARY KEY (';
|
||||||
' ADD PRIMARY KEY (';
|
|
||||||
foreach ($aPrimaryKeys as $sKey) {
|
foreach ($aPrimaryKeys as $sKey) {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ',';
|
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ',';
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -1) . ')' . $this->sEndLine;
|
$sSQL = substr( $sSQL, 0, - 1 ) . ')' . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDropKeySQL($sTable, $sIndexName) {
|
public function generateDropKeySQL ($sTable, $sIndexName)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
if ($sIndexName == '') {
|
if ($sIndexName == '') {
|
||||||
throw new Exception('The column name cannot be empty!');
|
throw new Exception( 'The column name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP INDEX ' . $this->sQuoteCharacter . $sIndexName . $this->sQuoteCharacter . $this->sEndLine;
|
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP INDEX ' . $this->sQuoteCharacter . $sIndexName . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateAddKeysSQL($sTable, $indexName, $aKeys) {
|
public function generateAddKeysSQL ($sTable, $indexName, $aKeys)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$indexType = 'INDEX';
|
$indexType = 'INDEX';
|
||||||
if ( $indexName == 'primaryKey' || $indexName == 'PRIMARY' ) {
|
if ($indexName == 'primaryKey' || $indexName == 'PRIMARY') {
|
||||||
$indexType = 'PRIMARY';
|
$indexType = 'PRIMARY';
|
||||||
$indexName = 'KEY';
|
$indexName = 'KEY';
|
||||||
}
|
}
|
||||||
@@ -334,201 +325,212 @@ class database extends database_base {
|
|||||||
foreach ($aKeys as $sKey) {
|
foreach ($aKeys as $sKey) {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ', ';
|
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ', ';
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -2);
|
$sSQL = substr( $sSQL, 0, - 2 );
|
||||||
$sSQL .= ')' . $this->sEndLine;
|
$sSQL .= ')' . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateShowTablesSQL() {
|
public function generateShowTablesSQL ()
|
||||||
|
{
|
||||||
return 'SHOW TABLES' . $this->sEndLine;
|
return 'SHOW TABLES' . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateShowTablesLikeSQL($sTable) {
|
public function generateShowTablesLikeSQL ($sTable)
|
||||||
|
{
|
||||||
return "SHOW TABLES LIKE '" . $sTable . "'" . $this->sEndLine;
|
return "SHOW TABLES LIKE '" . $sTable . "'" . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDescTableSQL($sTable) {
|
public function generateDescTableSQL ($sTable)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'DESC ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
return 'DESC ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateTableIndexSQL($sTable) {
|
public function generateTableIndexSQL ($sTable)
|
||||||
|
{
|
||||||
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " " . $this->sEndLine;
|
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " " . $this->sEndLine;
|
||||||
//return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " WHERE Key_name <> 'PRIMARY'" . $this->sEndLine;
|
//return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " WHERE Key_name <> 'PRIMARY'" . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isConnected() {
|
public function isConnected ()
|
||||||
if ( !$this->oConnection )
|
{
|
||||||
|
if (! $this->oConnection)
|
||||||
return false;
|
return false;
|
||||||
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logQuery($sQuery ) {
|
public function logQuery ($sQuery)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$found = false;
|
$found = false;
|
||||||
if ( substr($sQuery,0, 6) == 'SELECT' ) $found = true;
|
if (substr( $sQuery, 0, 6 ) == 'SELECT')
|
||||||
if ( substr($sQuery,0, 4) == 'SHOW' ) $found = true;
|
$found = true;
|
||||||
if ( substr($sQuery,0, 4) == 'DESC' ) $found = true;
|
if (substr( $sQuery, 0, 4 ) == 'SHOW')
|
||||||
if ( substr($sQuery,0, 4) == 'USE ' ) $found = true;
|
$found = true;
|
||||||
if ( ! $found ) {
|
if (substr( $sQuery, 0, 4 ) == 'DESC')
|
||||||
|
$found = true;
|
||||||
|
if (substr( $sQuery, 0, 4 ) == 'USE ')
|
||||||
|
$found = true;
|
||||||
|
if (! $found) {
|
||||||
$logFile = PATH_DATA . 'log' . PATH_SEP . 'query.log';
|
$logFile = PATH_DATA . 'log' . PATH_SEP . 'query.log';
|
||||||
$fp = fopen ( $logFile, 'a+' );
|
$fp = fopen( $logFile, 'a+' );
|
||||||
fwrite ( $fp, date("Y-m-d H:i:s") . " " . $this->sDataBase . " " . $sQuery . "\n" );
|
fwrite( $fp, date( "Y-m-d H:i:s" ) . " " . $this->sDataBase . " " . $sQuery . "\n" );
|
||||||
fclose ( $fp );
|
fclose( $fp );
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function executeQuery($sQuery) {
|
public function executeQuery ($sQuery)
|
||||||
$this->logQuery( $sQuery);
|
{
|
||||||
|
$this->logQuery( $sQuery );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->oConnection) {
|
if ($this->oConnection) {
|
||||||
@mssql_select_db($this->sDataBase);
|
@mssql_select_db( $this->sDataBase );
|
||||||
|
|
||||||
return @mssql_query($sQuery);
|
return @mssql_query( $sQuery );
|
||||||
|
} else {
|
||||||
|
throw new Exception( 'invalid connection to database ' . $this->sDataBase );
|
||||||
}
|
}
|
||||||
else {
|
} catch (Exception $oException) {
|
||||||
throw new Exception('invalid connection to database ' . $this->sDataBase );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $oException) {
|
|
||||||
$this->logQuery( $oException->getMessage() );
|
$this->logQuery( $oException->getMessage() );
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countResults($oDataset) {
|
public function countResults ($oDataset)
|
||||||
return @mssql_num_rows($oDataset);
|
{
|
||||||
|
return @mssql_num_rows( $oDataset );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRegistry($oDataset) {
|
public function getRegistry ($oDataset)
|
||||||
return @mssql_fetch_array($oDataset, $this->iFetchType);
|
{
|
||||||
|
return @mssql_fetch_array( $oDataset, $this->iFetchType );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function close() {
|
public function close ()
|
||||||
@mssql_close($this->oConnection);
|
{
|
||||||
|
@mssql_close( $this->oConnection );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateInsertSQL($table, $data) {
|
public function generateInsertSQL ($table, $data)
|
||||||
$fields = array();
|
{
|
||||||
$values = array();
|
$fields = array ();
|
||||||
|
$values = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
$fields[] = $field['field'];
|
$fields[] = $field['field'];
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$values[] = "'" . addslashes($field['value']) . "'";
|
$values[] = "'" . addslashes( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$values[] = addslashes($field['value']);
|
$values[] = addslashes( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fields = array_map(array($this, 'putQuotes'), $fields);
|
$fields = array_map( array ($this,'putQuotes'
|
||||||
$sql = sprintf("INSERT INTO %s (%s) VALUES (%s)", $this->putQuotes($table), implode(', ', $fields), implode(', ', $values));
|
), $fields );
|
||||||
|
$sql = sprintf( "INSERT INTO %s (%s) VALUES (%s)", $this->putQuotes( $table ), implode( ', ', $fields ), implode( ', ', $values ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateUpdateSQL($table, $keys, $data) {
|
public function generateUpdateSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$fields[] = $this->putQuotes($field['field']) . " = '" . addslashes($field['value']) . "'";
|
$fields[] = $this->putQuotes( $field['field'] ) . " = '" . addslashes( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$fields[] = $this->putQuotes($field['field']) . " = " . addslashes($field['value']);
|
$fields[] = $this->putQuotes( $field['field'] ) . " = " . addslashes( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
$where[] = $fields[count($fields) - 1];
|
$where[] = $fields[count( $fields ) - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("UPDATE %s SET %s WHERE %s", $this->putQuotes($table), implode(', ', $fields), implode(', ', $where));
|
$sql = sprintf( "UPDATE %s SET %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $fields ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDeleteSQL($table, $keys, $data) {
|
public function generateDeleteSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$where[] = $this->putQuotes($field['field']) . " = '" . addslashes($field['value']) . "'";
|
$where[] = $this->putQuotes( $field['field'] ) . " = '" . addslashes( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$where[] = $this->putQuotes($field['field']) . " = " . addslashes($field['value']);
|
$where[] = $this->putQuotes( $field['field'] ) . " = " . addslashes( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("DELETE FROM %s WHERE %s", $this->putQuotes($table), implode(', ', $where));
|
$sql = sprintf( "DELETE FROM %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateSelectSQL($table, $keys, $data) {
|
public function generateSelectSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$where[] = $this->putQuotes($field['field']) . " = '" . mysql_real_escape_string($field['value']) . "'";
|
$where[] = $this->putQuotes( $field['field'] ) . " = '" . mysql_real_escape_string( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$where[] = $this->putQuotes($field['field']) . " = " . mysql_real_escape_string($field['value']);
|
$where[] = $this->putQuotes( $field['field'] ) . " = " . mysql_real_escape_string( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("SELECT * FROM %s WHERE %s", $this->putQuotes($table), implode(', ', $where));
|
$sql = sprintf( "SELECT * FROM %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function putQuotes($element) {
|
private function putQuotes ($element)
|
||||||
|
{
|
||||||
return $this->sQuoteCharacterBegin . $element . $this->sQuoteCharacterEnd;
|
return $this->sQuoteCharacterBegin . $element . $this->sQuoteCharacterEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,10 +549,10 @@ class database extends database_base {
|
|||||||
$nums = func_num_args();
|
$nums = func_num_args();
|
||||||
$vars = func_get_args();
|
$vars = func_get_args();
|
||||||
$sConcat = "";
|
$sConcat = "";
|
||||||
for($i = 0;$i < $nums; $i++) {
|
for ($i = 0; $i < $nums; $i ++) {
|
||||||
if(isset($vars[$i])) {
|
if (isset( $vars[$i] )) {
|
||||||
$sConcat .= $vars[$i];
|
$sConcat .= $vars[$i];
|
||||||
if(($i+1) < $nums)
|
if (($i + 1) < $nums)
|
||||||
$sConcat .= " + ";
|
$sConcat .= " + ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -620,8 +622,7 @@ class database extends database_base {
|
|||||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||||
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
||||||
|
|
||||||
$sql = "SELECT " . $sqlConcat . ", " .
|
$sql = "SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -649,8 +650,7 @@ class database extends database_base {
|
|||||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||||
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
||||||
|
|
||||||
$sql = " SELECT " . $sqlConcat . ", " .
|
$sql = " SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -658,7 +658,7 @@ class database extends database_base {
|
|||||||
FROM APPLICATION AS A
|
FROM APPLICATION AS A
|
||||||
LEFT JOIN APP_DELEGATION AS AD ON(A.APP_UID = AD.APP_UID AND AD.DEL_INDEX=1)
|
LEFT JOIN APP_DELEGATION AS AD ON(A.APP_UID = AD.APP_UID AND AD.DEL_INDEX=1)
|
||||||
LEFT JOIN USERS AS U ON(U.USR_UID = A.APP_INIT_USER)
|
LEFT JOIN USERS AS U ON(U.USR_UID = A.APP_INIT_USER)
|
||||||
".$var."
|
" . $var . "
|
||||||
GROUP BY " . $sqlGroupBy;
|
GROUP BY " . $sqlGroupBy;
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
@@ -679,8 +679,7 @@ class database extends database_base {
|
|||||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||||
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
||||||
|
|
||||||
$sql = " SELECT " . $sqlConcat . ", " .
|
$sql = " SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -709,8 +708,7 @@ class database extends database_base {
|
|||||||
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
$sqlConcat = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME AS [USER] ";
|
||||||
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
$sqlGroupBy = " U.USR_LASTNAME + ' ' + USR_FIRSTNAME ";
|
||||||
|
|
||||||
$sql = "SELECT " . $sqlConcat . ", " .
|
$sql = "SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -718,7 +716,7 @@ class database extends database_base {
|
|||||||
FROM APP_DELEGATION AS AD
|
FROM APP_DELEGATION AS AD
|
||||||
LEFT JOIN PROCESS AS P ON (P.PRO_UID = AD.PRO_UID)
|
LEFT JOIN PROCESS AS P ON (P.PRO_UID = AD.PRO_UID)
|
||||||
LEFT JOIN USERS AS U ON(U.USR_UID = AD.USR_UID)
|
LEFT JOIN USERS AS U ON(U.USR_UID = AD.USR_UID)
|
||||||
".$var."
|
" . $var . "
|
||||||
GROUP BY " . $sqlGroupBy;
|
GROUP BY " . $sqlGroupBy;
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
@@ -731,34 +729,31 @@ class database extends database_base {
|
|||||||
function getServerVersion($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
function getServerVersion($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(strlen(trim($dbIP))<=0)
|
if (strlen( trim( $dbIP ) ) <= 0)
|
||||||
$dbIP = DB_HOST;
|
$dbIP = DB_HOST;
|
||||||
if($link = @mssql_connect($dbIP, $dbUser, $dbPasswd)){
|
if ($link = @mssql_connect( $dbIP, $dbUser, $dbPasswd )) {
|
||||||
@mssql_select_db( DB_NAME, $link );
|
@mssql_select_db( DB_NAME, $link );
|
||||||
$oResult = @mssql_query("select substring(@@version, 21, 6) + ' (' + CAST(SERVERPROPERTY ('productlevel') as varchar(10)) + ') ' + CAST(SERVERPROPERTY('productversion') AS VARCHAR(15)) + ' ' + CAST(SERVERPROPERTY ('edition') AS VARCHAR(25)) as version; ", $link);
|
$oResult = @mssql_query( "select substring(@@version, 21, 6) + ' (' + CAST(SERVERPROPERTY ('productlevel') as varchar(10)) + ') ' + CAST(SERVERPROPERTY('productversion') AS VARCHAR(15)) + ' ' + CAST(SERVERPROPERTY ('edition') AS VARCHAR(25)) as version; ", $link );
|
||||||
$aResult = @mssql_fetch_array($oResult);
|
$aResult = @mssql_fetch_array( $oResult );
|
||||||
@mssql_free_result($oResult);
|
@mssql_free_result( $oResult );
|
||||||
$v = $aResult[0];
|
$v = $aResult[0];
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(@mssql_error($link));
|
throw new Exception( @mssql_error( $link ) );
|
||||||
}
|
}
|
||||||
return (isset($v))?$v:'none';
|
return (isset( $v )) ? $v : 'none';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* query functions for class class.net.php
|
* query functions for class class.net.php
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getDropTable($sTableName)
|
function getDropTable($sTableName)
|
||||||
{
|
{
|
||||||
$sql = "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='" . $sTableName . "' AND xtype='U') " .
|
$sql = "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='" . $sTableName . "' AND xtype='U') " . "DROP TABLE ['" . $sTableName . "']";
|
||||||
"DROP TABLE ['" . $sTableName . "']";
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getTableDescription($sTableName)
|
function getTableDescription($sTableName)
|
||||||
{
|
{
|
||||||
$sql = " select column_name as Field,
|
$sql = " select column_name as Field,
|
||||||
@@ -777,8 +772,7 @@ class database extends database_base {
|
|||||||
when 'No' then 'NO' else 'YES' END) AS AsNull,
|
when 'No' then 'NO' else 'YES' END) AS AsNull,
|
||||||
COLUMN_DEFAULT as [Default]
|
COLUMN_DEFAULT as [Default]
|
||||||
FROM information_schema.columns
|
FROM information_schema.columns
|
||||||
WHERE table_name = '" . trim($sTableName) . "'" .
|
WHERE table_name = '" . trim( $sTableName ) . "'" . " Order by Ordinal_Position asc ";
|
||||||
" Order by Ordinal_Position asc ";
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,9 +795,9 @@ class database extends database_base {
|
|||||||
function reportTableExist()
|
function reportTableExist()
|
||||||
{
|
{
|
||||||
$bExists = true;
|
$bExists = true;
|
||||||
$oConnection = mssql_connect(DB_HOST, DB_USER, DB_PASS);
|
$oConnection = mssql_connect( DB_HOST, DB_USER, DB_PASS );
|
||||||
mssql_select_db(DB_NAME);
|
mssql_select_db( DB_NAME );
|
||||||
$oDataset = mssql_query('SELECT COUNT(*) FROM REPORT_TABLE') || ($bExists = false);
|
$oDataset = mssql_query( 'SELECT COUNT(*) FROM REPORT_TABLE' ) || ($bExists = false);
|
||||||
|
|
||||||
return $bExists;
|
return $bExists;
|
||||||
}
|
}
|
||||||
@@ -820,13 +814,14 @@ class database extends database_base {
|
|||||||
/**
|
/**
|
||||||
* Determining the existence of a table
|
* Determining the existence of a table
|
||||||
*/
|
*/
|
||||||
function tableExists ($table, $db) {
|
function tableExists($table, $db)
|
||||||
|
{
|
||||||
$sql = "SELECT * FROM sysobjects WHERE name='" . $table . "' AND type='u'";
|
$sql = "SELECT * FROM sysobjects WHERE name='" . $table . "' AND type='u'";
|
||||||
$bExists = true;
|
$bExists = true;
|
||||||
$oConnection = mssql_connect(DB_HOST, DB_USER, DB_PASS);
|
$oConnection = mssql_connect( DB_HOST, DB_USER, DB_PASS );
|
||||||
mssql_select_db(DB_NAME);
|
mssql_select_db( DB_NAME );
|
||||||
$oDataset = mssql_query($sql) || ($bExists = false);
|
$oDataset = mssql_query( $sql ) || ($bExists = false);
|
||||||
return $bExists;
|
return $bExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* class.database_mysql.php
|
* class.database_mysql.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -25,60 +26,67 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*/
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
G::LoadSystem('database_base');
|
G::LoadSystem( 'database_base' );
|
||||||
|
|
||||||
class database extends database_base {
|
class database extends database_base
|
||||||
|
{
|
||||||
|
|
||||||
public $iFetchType = MYSQL_ASSOC;
|
public $iFetchType = MYSQL_ASSOC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class database constructor
|
* class database constructor
|
||||||
|
*
|
||||||
* @param $sType adapter type
|
* @param $sType adapter type
|
||||||
* @param $sServer server
|
* @param $sServer server
|
||||||
* @param $sUser db user
|
* @param $sUser db user
|
||||||
* @param $sPass db user password
|
* @param $sPass db user password
|
||||||
* @param $sDataBase Database name
|
* @param $sDataBase Database name
|
||||||
*/
|
*/
|
||||||
public function __construct($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME) {
|
public function __construct ($sType = DB_ADAPTER, $sServer = DB_HOST, $sUser = DB_USER, $sPass = DB_PASS, $sDataBase = DB_NAME)
|
||||||
|
{
|
||||||
$this->sType = $sType;
|
$this->sType = $sType;
|
||||||
$this->sServer = $sServer;
|
$this->sServer = $sServer;
|
||||||
$this->sUser = $sUser;
|
$this->sUser = $sUser;
|
||||||
$this->sPass = $sPass;
|
$this->sPass = $sPass;
|
||||||
$this->sDataBase = $sDataBase;
|
$this->sDataBase = $sDataBase;
|
||||||
$this->oConnection = @mysql_connect($sServer, $sUser, $sPass) || null;
|
$this->oConnection = @mysql_connect( $sServer, $sUser, $sPass ) || null;
|
||||||
$this->sQuoteCharacter = '`';
|
$this->sQuoteCharacter = '`';
|
||||||
$this->nullString = 'null';
|
$this->nullString = 'null';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate the sql sentence to create a table
|
* generate the sql sentence to create a table
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $aColumns array of columns
|
* @param $aColumns array of columns
|
||||||
* @return $sSql the sql sentence
|
* @return $sSql the sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateCreateTableSQL($sTable, $aColumns) {
|
public function generateCreateTableSQL ($sTable, $aColumns)
|
||||||
|
{
|
||||||
$sKeys = '';
|
$sKeys = '';
|
||||||
$sSQL = 'CREATE TABLE IF NOT EXISTS ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . '(';
|
$sSQL = 'CREATE TABLE IF NOT EXISTS ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . '(';
|
||||||
|
|
||||||
foreach ($aColumns as $sColumnName => $aParameters) {
|
foreach ($aColumns as $sColumnName => $aParameters) {
|
||||||
if ($sColumnName != 'INDEXES') {
|
if ($sColumnName != 'INDEXES') {
|
||||||
|
|
||||||
if ( $sColumnName != '' && isset($aParameters['Type']) && $aParameters['Type'] != '' ){
|
if ($sColumnName != '' && isset( $aParameters['Type'] ) && $aParameters['Type'] != '') {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ' ' . $aParameters['Type'];
|
$sSQL .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ' ' . $aParameters['Type'];
|
||||||
|
|
||||||
if ( isset($aParameters['Null']) && $aParameters['Null'] == 'YES') {
|
if (isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= ' NULL';
|
$sSQL .= ' NULL';
|
||||||
} else {
|
} else {
|
||||||
$sSQL .= ' NOT NULL';
|
$sSQL .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
if ( isset($aParameters['Key']) && $aParameters['Key'] == 'PRI') {
|
if (isset( $aParameters['Key'] ) && $aParameters['Key'] == 'PRI') {
|
||||||
$sKeys .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ',';
|
$sKeys .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($aParameters['Default']) && $aParameters['Default'] != '' ) {
|
if (isset( $aParameters['Default'] ) && $aParameters['Default'] != '') {
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,9 +94,9 @@ class database extends database_base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -1);
|
$sSQL = substr( $sSQL, 0, - 1 );
|
||||||
if ($sKeys != '') {
|
if ($sKeys != '') {
|
||||||
$sSQL .= ',PRIMARY KEY(' . substr($sKeys, 0, -1) . ')';
|
$sSQL .= ',PRIMARY KEY(' . substr( $sKeys, 0, - 1 ) . ')';
|
||||||
}
|
}
|
||||||
$sSQL .= ')' . $this->sEndLine;
|
$sSQL .= ')' . $this->sEndLine;
|
||||||
|
|
||||||
@@ -97,41 +105,43 @@ class database extends database_base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a drop table sentence
|
* generate a drop table sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @return sql sentence string
|
* @return sql sentence string
|
||||||
*/
|
*/
|
||||||
public function generateDropTableSQL($sTable) {
|
public function generateDropTableSQL ($sTable)
|
||||||
|
{
|
||||||
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
return 'DROP TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate drop column sentence
|
* generate drop column sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $sColumn column name
|
* @param $sColumn column name
|
||||||
* @return $sSql sql sentence
|
* @return $sSql sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateDropColumnSQL($sTable, $sColumn) {
|
public function generateDropColumnSQL ($sTable, $sColumn)
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
{
|
||||||
' DROP COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . $this->sEndLine;
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate an add column sentence
|
* generate an add column sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $sColumn column name
|
* @param $sColumn column name
|
||||||
* @param $aParameters parameters of field like typo or if it can be null
|
* @param $aParameters parameters of field like typo or if it can be null
|
||||||
* @return $sSql sql sentence
|
* @return $sSql sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateAddColumnSQL($sTable, $sColumn, $aParameters) {
|
public function generateAddColumnSQL ($sTable, $sColumn, $aParameters)
|
||||||
if ( isset($aParameters['Type']) && isset($aParameters['Null']) ) {
|
{
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
if (isset( $aParameters['Type'] ) && isset( $aParameters['Null'] )) {
|
||||||
' ADD COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' ADD COLUMN ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ' ' . $aParameters['Type'];
|
||||||
' ' . $aParameters['Type'];
|
|
||||||
if ($aParameters['Null'] == 'YES') {
|
if ($aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= ' NULL';
|
$sSQL .= ' NULL';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sSQL .= ' NOT NULL';
|
$sSQL .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,18 +149,16 @@ class database extends database_base {
|
|||||||
$sKeys .= 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sKeys .= 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
||||||
' ADD PRIMARY KEY (' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ')' . $this->sEndLine;
|
' ADD PRIMARY KEY (' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ')' . $this->sEndLine;
|
||||||
}*/
|
}*/
|
||||||
if (isset($aParameters['AI'])) {
|
if (isset( $aParameters['AI'] )) {
|
||||||
if ($aParameters['AI'] == 1) {
|
if ($aParameters['AI'] == 1) {
|
||||||
$sSQL .= ' AUTO_INCREMENT';
|
$sSQL .= ' AUTO_INCREMENT';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($aParameters['Default'] != '') {
|
if ($aParameters['Default'] != '') {
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
if (isset( $aParameters['Default'] )) {
|
||||||
if (isset($aParameters['Default'])) {
|
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,24 +168,23 @@ class database extends database_base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a change column sentence
|
* generate a change column sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $sColumn column name
|
* @param $sColumn column name
|
||||||
* @param $aParameters parameters of field like typo or if it can be null
|
* @param $aParameters parameters of field like typo or if it can be null
|
||||||
* @param $sColumnNewName column new name
|
* @param $sColumnNewName column new name
|
||||||
* @return $sSql sql sentence
|
* @return $sSql sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateChangeColumnSQL($sTable, $sColumn, $aParameters, $sColumnNewName = '') {
|
public function generateChangeColumnSQL ($sTable, $sColumn, $aParameters, $sColumnNewName = '')
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
{
|
||||||
' CHANGE COLUMN ' . $this->sQuoteCharacter . ($sColumnNewName != '' ? $sColumnNewName : $sColumn) . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' CHANGE COLUMN ' . $this->sQuoteCharacter . ($sColumnNewName != '' ? $sColumnNewName : $sColumn) . $this->sQuoteCharacter . ' ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter;
|
||||||
' ' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter;
|
if (isset( $aParameters['Type'] )) {
|
||||||
if (isset($aParameters['Type'])) {
|
|
||||||
$sSQL .= ' ' . $aParameters['Type'];
|
$sSQL .= ' ' . $aParameters['Type'];
|
||||||
}
|
}
|
||||||
if (isset($aParameters['Null'])) {
|
if (isset( $aParameters['Null'] )) {
|
||||||
if ($aParameters['Null'] == 'YES') {
|
if ($aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= ' NULL';
|
$sSQL .= ' NULL';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sSQL .= ' NOT NULL';
|
$sSQL .= ' NOT NULL';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,15 +201,14 @@ class database extends database_base {
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//else {
|
//else {
|
||||||
if (isset($aParameters['Default'])) {
|
if (isset( $aParameters['Default'] )) {
|
||||||
if ( trim($aParameters['Default']) == '' && $aParameters['Type'] == 'datetime' ) {
|
if (trim( $aParameters['Default'] ) == '' && $aParameters['Type'] == 'datetime') {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
$sSQL .= " DEFAULT '" . $aParameters['Default'] . "'";
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
if (!isset($aParameters['Default']) && isset($aParameters['Null']) && $aParameters['Null'] == 'YES') {
|
if (! isset( $aParameters['Default'] ) && isset( $aParameters['Null'] ) && $aParameters['Null'] == 'YES') {
|
||||||
$sSQL .= " DEFAULT NULL ";
|
$sSQL .= " DEFAULT NULL ";
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
@@ -212,95 +218,100 @@ class database extends database_base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate and get the primary key in a sentence
|
* Generate and get the primary key in a sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @return $sSql sql sentence
|
* @return $sSql sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateGetPrimaryKeysSQL($sTable) {
|
public function generateGetPrimaryKeysSQL ($sTable)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' WHERE Seq_in_index = 1' . $this->sEndLine;
|
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' WHERE Seq_in_index = 1' . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to drop the primary key
|
* generate a sentence to drop the primary key
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateDropPrimaryKeysSQL($sTable) {
|
public function generateDropPrimaryKeysSQL ($sTable)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP PRIMARY KEY' . $this->sEndLine;
|
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP PRIMARY KEY' . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to add multiple primary keys
|
* generate a sentence to add multiple primary keys
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $aPrimaryKeys array of primary keys
|
* @param $aPrimaryKeys array of primary keys
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateAddPrimaryKeysSQL($sTable, $aPrimaryKeys) {
|
public function generateAddPrimaryKeysSQL ($sTable, $aPrimaryKeys)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' ADD PRIMARY KEY (';
|
||||||
' ADD PRIMARY KEY (';
|
|
||||||
foreach ($aPrimaryKeys as $sKey) {
|
foreach ($aPrimaryKeys as $sKey) {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ',';
|
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ',';
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -1) . ')' . $this->sEndLine;
|
$sSQL = substr( $sSQL, 0, - 1 ) . ')' . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to drop an index
|
* generate a sentence to drop an index
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $sIndexName index name
|
* @param $sIndexName index name
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateDropKeySQL($sTable, $sIndexName) {
|
public function generateDropKeySQL ($sTable, $sIndexName)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
if ($sIndexName == '') {
|
if ($sIndexName == '') {
|
||||||
throw new Exception('The column name cannot be empty!');
|
throw new Exception( 'The column name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP INDEX ' . $this->sQuoteCharacter . $sIndexName . $this->sQuoteCharacter . $this->sEndLine;
|
return 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP INDEX ' . $this->sQuoteCharacter . $sIndexName . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to add indexes or primary keys
|
* generate a sentence to add indexes or primary keys
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @param $indexName index name
|
* @param $indexName index name
|
||||||
* @param $aKeys array of keys
|
* @param $aKeys array of keys
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function generateAddKeysSQL($sTable, $indexName, $aKeys) {
|
public function generateAddKeysSQL ($sTable, $indexName, $aKeys)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$indexType = 'INDEX';
|
$indexType = 'INDEX';
|
||||||
if ( $indexName == 'primaryKey' || $indexName == 'PRIMARY' ) {
|
if ($indexName == 'primaryKey' || $indexName == 'PRIMARY') {
|
||||||
$indexType = 'PRIMARY';
|
$indexType = 'PRIMARY';
|
||||||
$indexName = 'KEY';
|
$indexName = 'KEY';
|
||||||
}
|
}
|
||||||
@@ -308,116 +319,129 @@ class database extends database_base {
|
|||||||
foreach ($aKeys as $sKey) {
|
foreach ($aKeys as $sKey) {
|
||||||
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ', ';
|
$sSQL .= $this->sQuoteCharacter . $sKey . $this->sQuoteCharacter . ', ';
|
||||||
}
|
}
|
||||||
$sSQL = substr($sSQL, 0, -2);
|
$sSQL = substr( $sSQL, 0, - 2 );
|
||||||
$sSQL .= ')' . $this->sEndLine;
|
$sSQL .= ')' . $this->sEndLine;
|
||||||
return $sSQL;
|
return $sSQL;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to show the tables
|
* generate a sentence to show the tables
|
||||||
|
*
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateShowTablesSQL() {
|
public function generateShowTablesSQL ()
|
||||||
|
{
|
||||||
return 'SHOW TABLES' . $this->sEndLine;
|
return 'SHOW TABLES' . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to show the tables with a like sentence
|
* generate a sentence to show the tables with a like sentence
|
||||||
|
*
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateShowTablesLikeSQL($sTable) {
|
public function generateShowTablesLikeSQL ($sTable)
|
||||||
|
{
|
||||||
return "SHOW TABLES LIKE '" . $sTable . "'" . $this->sEndLine;
|
return "SHOW TABLES LIKE '" . $sTable . "'" . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to show the tables with a like sentence
|
* generate a sentence to show the tables with a like sentence
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateDescTableSQL($sTable) {
|
public function generateDescTableSQL ($sTable)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if ($sTable == '') {
|
if ($sTable == '') {
|
||||||
throw new Exception('The table name cannot be empty!');
|
throw new Exception( 'The table name cannot be empty!' );
|
||||||
}
|
}
|
||||||
return 'DESC ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
return 'DESC ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . $this->sEndLine;
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to show some table indexes
|
* generate a sentence to show some table indexes
|
||||||
|
*
|
||||||
* @param $sTable table name
|
* @param $sTable table name
|
||||||
* @return sql sentence
|
* @return sql sentence
|
||||||
*/
|
*/
|
||||||
public function generateTableIndexSQL($sTable) {
|
public function generateTableIndexSQL ($sTable)
|
||||||
|
{
|
||||||
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " " . $this->sEndLine;
|
return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " " . $this->sEndLine;
|
||||||
//return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " WHERE Key_name <> 'PRIMARY'" . $this->sEndLine;
|
//return 'SHOW INDEX FROM ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . " WHERE Key_name <> 'PRIMARY'" . $this->sEndLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute a sentence to check if there is connection
|
* execute a sentence to check if there is connection
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function isConnected() {
|
public function isConnected ()
|
||||||
if ( !$this->oConnection )
|
{
|
||||||
|
if (! $this->oConnection)
|
||||||
return false;
|
return false;
|
||||||
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
return $this->executeQuery( 'USE ' . $this->sDataBase );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate a sentence to show the tables with a like sentence
|
* generate a sentence to show the tables with a like sentence
|
||||||
|
*
|
||||||
* @param $sQuery sql query string
|
* @param $sQuery sql query string
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function logQuery($sQuery ) {
|
public function logQuery ($sQuery)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$found = false;
|
$found = false;
|
||||||
if ( substr($sQuery,0, 6) == 'SELECT' ) $found = true;
|
if (substr( $sQuery, 0, 6 ) == 'SELECT')
|
||||||
if ( substr($sQuery,0, 4) == 'SHOW' ) $found = true;
|
$found = true;
|
||||||
if ( substr($sQuery,0, 4) == 'DESC' ) $found = true;
|
if (substr( $sQuery, 0, 4 ) == 'SHOW')
|
||||||
if ( substr($sQuery,0, 4) == 'USE ' ) $found = true;
|
$found = true;
|
||||||
if ( ! $found ) {
|
if (substr( $sQuery, 0, 4 ) == 'DESC')
|
||||||
|
$found = true;
|
||||||
|
if (substr( $sQuery, 0, 4 ) == 'USE ')
|
||||||
|
$found = true;
|
||||||
|
if (! $found) {
|
||||||
$logDir = PATH_DATA . 'log';
|
$logDir = PATH_DATA . 'log';
|
||||||
if (!file_exists($logDir))
|
if (! file_exists( $logDir ))
|
||||||
if (!mkdir($logDir))
|
if (! mkdir( $logDir ))
|
||||||
return;
|
return;
|
||||||
$logFile = "$logDir/query.log";
|
$logFile = "$logDir/query.log";
|
||||||
$fp = fopen ( $logFile, 'a+' );
|
$fp = fopen( $logFile, 'a+' );
|
||||||
if ($fp !== false) {
|
if ($fp !== false) {
|
||||||
fwrite ( $fp, date("Y-m-d H:i:s") . " " . $this->sDataBase . " " . $sQuery . "\n" );
|
fwrite( $fp, date( "Y-m-d H:i:s" ) . " " . $this->sDataBase . " " . $sQuery . "\n" );
|
||||||
fclose ( $fp );
|
fclose( $fp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute a sql query
|
* execute a sql query
|
||||||
|
*
|
||||||
* @param $sQuery table name
|
* @param $sQuery table name
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function executeQuery($sQuery) {
|
public function executeQuery ($sQuery)
|
||||||
$this->logQuery( $sQuery);
|
{
|
||||||
|
$this->logQuery( $sQuery );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->oConnection) {
|
if ($this->oConnection) {
|
||||||
@mysql_select_db($this->sDataBase);
|
@mysql_select_db( $this->sDataBase );
|
||||||
|
|
||||||
return @mysql_query($sQuery);
|
return @mysql_query( $sQuery );
|
||||||
|
} else {
|
||||||
|
throw new Exception( 'invalid connection to database ' . $this->sDataBase );
|
||||||
}
|
}
|
||||||
else {
|
} catch (Exception $oException) {
|
||||||
throw new Exception('invalid connection to database ' . $this->sDataBase );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $oException) {
|
|
||||||
$this->logQuery( $oException->getMessage() );
|
$this->logQuery( $oException->getMessage() );
|
||||||
throw $oException;
|
throw $oException;
|
||||||
}
|
}
|
||||||
@@ -425,136 +449,144 @@ class database extends database_base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* count the rows of a dataset
|
* count the rows of a dataset
|
||||||
|
*
|
||||||
* @param $oDataset
|
* @param $oDataset
|
||||||
* @return the number of rows
|
* @return the number of rows
|
||||||
*/
|
*/
|
||||||
public function countResults($oDataset) {
|
public function countResults ($oDataset)
|
||||||
return @mysql_num_rows($oDataset);
|
{
|
||||||
|
return @mysql_num_rows( $oDataset );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count an array of the registry from a dataset
|
* count an array of the registry from a dataset
|
||||||
|
*
|
||||||
* @param $oDataset
|
* @param $oDataset
|
||||||
* @return the registry
|
* @return the registry
|
||||||
*/
|
*/
|
||||||
public function getRegistry($oDataset) {
|
public function getRegistry ($oDataset)
|
||||||
return @mysql_fetch_array($oDataset, $this->iFetchType);
|
{
|
||||||
|
return @mysql_fetch_array( $oDataset, $this->iFetchType );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* close the current connection
|
* close the current connection
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function close() {
|
public function close ()
|
||||||
@mysql_close($this->oConnection);
|
{
|
||||||
|
@mysql_close( $this->oConnection );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateInsertSQL($table, $data) {
|
public function generateInsertSQL ($table, $data)
|
||||||
$fields = array();
|
{
|
||||||
$values = array();
|
$fields = array ();
|
||||||
|
$values = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
$fields[] = $field['field'];
|
$fields[] = $field['field'];
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$values[] = "'" . mysql_real_escape_string($field['value']) . "'";
|
$values[] = "'" . mysql_real_escape_string( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$values[] = mysql_real_escape_string($field['value']);
|
$values[] = mysql_real_escape_string( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fields = array_map(array($this, 'putQuotes'), $fields);
|
$fields = array_map( array ($this,'putQuotes'
|
||||||
$sql = sprintf("INSERT INTO %s (%s) VALUES (%s)", $this->putQuotes($table), implode(', ', $fields), implode(', ', $values));
|
), $fields );
|
||||||
|
$sql = sprintf( "INSERT INTO %s (%s) VALUES (%s)", $this->putQuotes( $table ), implode( ', ', $fields ), implode( ', ', $values ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateUpdateSQL($table, $keys, $data) {
|
public function generateUpdateSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$fields[] = $this->putQuotes($field['field']) . " = '" . mysql_real_escape_string($field['value']) . "'";
|
$fields[] = $this->putQuotes( $field['field'] ) . " = '" . mysql_real_escape_string( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$fields[] = $this->putQuotes($field['field']) . " = " . mysql_real_escape_string($field['value']);
|
$fields[] = $this->putQuotes( $field['field'] ) . " = " . mysql_real_escape_string( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
$where[] = $fields[count($fields) - 1];
|
$where[] = $fields[count( $fields ) - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("UPDATE %s SET %s WHERE %s", $this->putQuotes($table), implode(', ', $fields), implode(', ', $where));
|
$sql = sprintf( "UPDATE %s SET %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $fields ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateDeleteSQL($table, $keys, $data) {
|
public function generateDeleteSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$where[] = $this->putQuotes($field['field']) . " = '" . mysql_real_escape_string($field['value']) . "'";
|
$where[] = $this->putQuotes( $field['field'] ) . " = '" . mysql_real_escape_string( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$where[] = $this->putQuotes($field['field']) . " = " . mysql_real_escape_string($field['value']);
|
$where[] = $this->putQuotes( $field['field'] ) . " = " . mysql_real_escape_string( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("DELETE FROM %s WHERE %s", $this->putQuotes($table), implode(', ', $where));
|
$sql = sprintf( "DELETE FROM %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateSelectSQL($table, $keys, $data) {
|
public function generateSelectSQL ($table, $keys, $data)
|
||||||
$fields = array();
|
{
|
||||||
$where = array();
|
$fields = array ();
|
||||||
|
$where = array ();
|
||||||
foreach ($data as $field) {
|
foreach ($data as $field) {
|
||||||
if (in_array($field['field'], $keys)) {
|
if (in_array( $field['field'], $keys )) {
|
||||||
if (!is_null($field['value'])) {
|
if (! is_null( $field['value'] )) {
|
||||||
switch ($field['type']) {
|
switch ($field['type']) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'date':
|
case 'date':
|
||||||
$where[] = $this->putQuotes($field['field']) . " = '" . mysql_real_escape_string($field['value']) . "'";
|
$where[] = $this->putQuotes( $field['field'] ) . " = '" . mysql_real_escape_string( $field['value'] ) . "'";
|
||||||
break;
|
break;
|
||||||
case 'int':
|
case 'int':
|
||||||
default:
|
default:
|
||||||
$where[] = $this->putQuotes($field['field']) . " = " . mysql_real_escape_string($field['value']);
|
$where[] = $this->putQuotes( $field['field'] ) . " = " . mysql_real_escape_string( $field['value'] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$values[] = $this->nullString;
|
$values[] = $this->nullString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = sprintf("SELECT * FROM %s WHERE %s", $this->putQuotes($table), implode(', ', $where));
|
$sql = sprintf( "SELECT * FROM %s WHERE %s", $this->putQuotes( $table ), implode( ', ', $where ) );
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function putQuotes($element) {
|
private function putQuotes ($element)
|
||||||
|
{
|
||||||
return $this->sQuoteCharacter . $element . $this->sQuoteCharacter;
|
return $this->sQuoteCharacter . $element . $this->sQuoteCharacter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -568,16 +600,16 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sConcat
|
* @return string $sConcat
|
||||||
*/
|
*/
|
||||||
function concatString()
|
function concatString ()
|
||||||
{
|
{
|
||||||
$nums = func_num_args();
|
$nums = func_num_args();
|
||||||
$vars = func_get_args();
|
$vars = func_get_args();
|
||||||
|
|
||||||
$sConcat = " CONCAT(";
|
$sConcat = " CONCAT(";
|
||||||
for($i = 0;$i < $nums; $i++) {
|
for ($i = 0; $i < $nums; $i ++) {
|
||||||
if(isset($vars[$i])) {
|
if (isset( $vars[$i] )) {
|
||||||
$sConcat .= $vars[$i];
|
$sConcat .= $vars[$i];
|
||||||
if(($i+1) < $nums)
|
if (($i + 1) < $nums)
|
||||||
$sConcat .= ", ";
|
$sConcat .= ", ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -600,7 +632,7 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sCompare
|
* @return string $sCompare
|
||||||
*/
|
*/
|
||||||
function getCaseWhen($compareValue, $trueResult, $falseResult)
|
function getCaseWhen ($compareValue, $trueResult, $falseResult)
|
||||||
{
|
{
|
||||||
$sCompare = "IF(" . $compareValue . ", " . $trueResult . ", " . $falseResult . ") ";
|
$sCompare = "IF(" . $compareValue . ", " . $trueResult . ", " . $falseResult . ") ";
|
||||||
return $sCompare;
|
return $sCompare;
|
||||||
@@ -615,7 +647,7 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sql
|
* @return string $sql
|
||||||
*/
|
*/
|
||||||
function createTableObjectPermission()
|
function createTableObjectPermission ()
|
||||||
{
|
{
|
||||||
$sql = "CREATE TABLE IF NOT EXISTS `OBJECT_PERMISSION` (
|
$sql = "CREATE TABLE IF NOT EXISTS `OBJECT_PERMISSION` (
|
||||||
`OP_UID` varchar(32) NOT NULL,
|
`OP_UID` varchar(32) NOT NULL,
|
||||||
@@ -645,14 +677,13 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sql
|
* @return string $sql
|
||||||
*/
|
*/
|
||||||
function getSelectReport4()
|
function getSelectReport4 ()
|
||||||
{
|
{
|
||||||
|
|
||||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||||
$sqlGroupBy = " USER ";
|
$sqlGroupBy = " USER ";
|
||||||
|
|
||||||
$sql = "SELECT " . $sqlConcat . ", " .
|
$sql = "SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -675,13 +706,12 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sql
|
* @return string $sql
|
||||||
*/
|
*/
|
||||||
function getSelectReport4Filter($var)
|
function getSelectReport4Filter ($var)
|
||||||
{
|
{
|
||||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||||
$sqlGroupBy = " USER ";
|
$sqlGroupBy = " USER ";
|
||||||
|
|
||||||
$sql = " SELECT " . $sqlConcat . ", " .
|
$sql = " SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -689,7 +719,7 @@ class database extends database_base {
|
|||||||
FROM APPLICATION AS A
|
FROM APPLICATION AS A
|
||||||
LEFT JOIN APP_DELEGATION AS AD ON(A.APP_UID = AD.APP_UID AND AD.DEL_INDEX=1)
|
LEFT JOIN APP_DELEGATION AS AD ON(A.APP_UID = AD.APP_UID AND AD.DEL_INDEX=1)
|
||||||
LEFT JOIN USERS AS U ON(U.USR_UID = A.APP_INIT_USER)
|
LEFT JOIN USERS AS U ON(U.USR_UID = A.APP_INIT_USER)
|
||||||
".$var."
|
" . $var . "
|
||||||
GROUP BY " . $sqlGroupBy;
|
GROUP BY " . $sqlGroupBy;
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
@@ -704,13 +734,12 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sql
|
* @return string $sql
|
||||||
*/
|
*/
|
||||||
function getSelectReport5()
|
function getSelectReport5 ()
|
||||||
{
|
{
|
||||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||||
$sqlGroupBy = " USER ";
|
$sqlGroupBy = " USER ";
|
||||||
|
|
||||||
$sql = " SELECT " . $sqlConcat . ", " .
|
$sql = " SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -733,14 +762,13 @@ class database extends database_base {
|
|||||||
*
|
*
|
||||||
* @return string $sql
|
* @return string $sql
|
||||||
*/
|
*/
|
||||||
function getSelectReport5Filter($var)
|
function getSelectReport5Filter ($var)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
$sqlConcat = " CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER ";
|
||||||
$sqlGroupBy = " USER ";
|
$sqlGroupBy = " USER ";
|
||||||
|
|
||||||
$sql = "SELECT " . $sqlConcat . ", " .
|
$sql = "SELECT " . $sqlConcat . ", " . " COUNT(*) AS CANTCASES,
|
||||||
" COUNT(*) AS CANTCASES,
|
|
||||||
MIN(AD.DEL_DURATION) AS MIN,
|
MIN(AD.DEL_DURATION) AS MIN,
|
||||||
MAX(AD.DEL_DURATION) AS MAX,
|
MAX(AD.DEL_DURATION) AS MAX,
|
||||||
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
SUM(AD.DEL_DURATION) AS TOTALDUR,
|
||||||
@@ -748,7 +776,7 @@ class database extends database_base {
|
|||||||
FROM APP_DELEGATION AS AD
|
FROM APP_DELEGATION AS AD
|
||||||
LEFT JOIN PROCESS AS P ON (P.PRO_UID = AD.PRO_UID)
|
LEFT JOIN PROCESS AS P ON (P.PRO_UID = AD.PRO_UID)
|
||||||
LEFT JOIN USERS AS U ON(U.USR_UID = AD.USR_UID)
|
LEFT JOIN USERS AS U ON(U.USR_UID = AD.USR_UID)
|
||||||
".$var."
|
" . $var . "
|
||||||
GROUP BY " . $sqlGroupBy;
|
GROUP BY " . $sqlGroupBy;
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
@@ -758,43 +786,41 @@ class database extends database_base {
|
|||||||
* query functions for class class.net.php
|
* query functions for class class.net.php
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getServerVersion($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
function getServerVersion ($driver, $dbIP, $dbPort, $dbUser, $dbPasswd, $dbSourcename)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($link = @mysql_connect($dbIP, $dbUser, $dbPasswd)){
|
if ($link = @mysql_connect( $dbIP, $dbUser, $dbPasswd )) {
|
||||||
$v = @mysql_get_server_info();
|
$v = @mysql_get_server_info();
|
||||||
} else {
|
} else {
|
||||||
throw new Exception(@mysql_error($link));
|
throw new Exception( @mysql_error( $link ) );
|
||||||
}
|
}
|
||||||
return (isset($v))?$v:'none';
|
return (isset( $v )) ? $v : 'none';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* query functions for class class.net.php, class.reportTables.php
|
* query functions for class class.net.php, class.reportTables.php
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getDropTable($sTableName)
|
function getDropTable ($sTableName)
|
||||||
{
|
{
|
||||||
$sql = 'DROP TABLE IF EXISTS `' . $sTableName . '`';
|
$sql = 'DROP TABLE IF EXISTS `' . $sTableName . '`';
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTableDescription ($sTableName)
|
||||||
function getTableDescription($sTableName)
|
|
||||||
{
|
{
|
||||||
$sql = "DESC ".$sTableName;
|
$sql = "DESC " . $sTableName;
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFieldNull()
|
function getFieldNull ()
|
||||||
{
|
{
|
||||||
$fieldName = "Null";
|
$fieldName = "Null";
|
||||||
return $fieldName;
|
return $fieldName;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValidate($validate)
|
function getValidate ($validate)
|
||||||
{
|
{
|
||||||
$oValidate = $validate;
|
$oValidate = $validate;
|
||||||
return $oValidate;
|
return $oValidate;
|
||||||
@@ -804,12 +830,12 @@ class database extends database_base {
|
|||||||
* Determines whether a table exists
|
* Determines whether a table exists
|
||||||
* It is part of class.reportTables.php
|
* It is part of class.reportTables.php
|
||||||
*/
|
*/
|
||||||
function reportTableExist()
|
function reportTableExist ()
|
||||||
{
|
{
|
||||||
$bExists = true;
|
$bExists = true;
|
||||||
$oConnection = mysql_connect(DB_HOST, DB_USER, DB_PASS);
|
$oConnection = mysql_connect( DB_HOST, DB_USER, DB_PASS );
|
||||||
mysql_select_db(DB_NAME);
|
mysql_select_db( DB_NAME );
|
||||||
$oDataset = mysql_query('SELECT COUNT(*) FROM REPORT_TABLE') || ($bExists = false);
|
$oDataset = mysql_query( 'SELECT COUNT(*) FROM REPORT_TABLE' ) || ($bExists = false);
|
||||||
|
|
||||||
return $bExists;
|
return $bExists;
|
||||||
}
|
}
|
||||||
@@ -817,38 +843,39 @@ class database extends database_base {
|
|||||||
/**
|
/**
|
||||||
* It is part of class.pagedTable.php
|
* It is part of class.pagedTable.php
|
||||||
*/
|
*/
|
||||||
function getLimitRenderTable($nCurrentPage, $nRowsPerPage)
|
function getLimitRenderTable ($nCurrentPage, $nRowsPerPage)
|
||||||
{
|
{
|
||||||
$sql = ' LIMIT '.(($nCurrentPage-1)*$nRowsPerPage).', '.$nRowsPerPage;
|
$sql = ' LIMIT ' . (($nCurrentPage - 1) * $nRowsPerPage) . ', ' . $nRowsPerPage;
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determining the existence of a table
|
* Determining the existence of a table
|
||||||
*/
|
*/
|
||||||
function tableExists($tableName, $database)
|
function tableExists ($tableName, $database)
|
||||||
{
|
{
|
||||||
@mysql_select_db($database);
|
@mysql_select_db( $database );
|
||||||
$tables = array();
|
$tables = array ();
|
||||||
$tablesResult = mysql_query("SHOW TABLES FROM $database;");
|
$tablesResult = mysql_query( "SHOW TABLES FROM $database;" );
|
||||||
while ($row = @mysql_fetch_row($tablesResult)) $tables[] = $row[0];
|
while ($row = @mysql_fetch_row( $tablesResult ))
|
||||||
if(in_array($tableName, $tables)) {
|
$tables[] = $row[0];
|
||||||
|
if (in_array( $tableName, $tables )) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determining the existence of a table (Depricated)
|
* Determining the existence of a table (Depricated)
|
||||||
*/
|
*/
|
||||||
// function tableExists ($table, $db) {
|
// function tableExists ($table, $db) {
|
||||||
// $tables = mysql_list_tables ($db);
|
// $tables = mysql_list_tables ($db);
|
||||||
// while (list ($temp) = @mysql_fetch_array ($tables)) {
|
// while (list ($temp) = @mysql_fetch_array ($tables)) {
|
||||||
// if ($temp == $table) {
|
// if ($temp == $table) {
|
||||||
// return TRUE;
|
// return TRUE;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* class.dbconnection.php
|
* class.dbconnection.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -25,20 +26,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*/
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
require_once ("DB.php");
|
require_once ("DB.php");
|
||||||
|
|
||||||
define ( 'DB_ERROR_NO_SHOW_AND_CONTINUE', 0);
|
define( 'DB_ERROR_NO_SHOW_AND_CONTINUE', 0 );
|
||||||
define ( 'DB_ERROR_SHOW_AND_STOP', 1);
|
define( 'DB_ERROR_SHOW_AND_STOP', 1 );
|
||||||
define ( 'DB_ERROR_SHOW_AND_CONTINUE', 2);
|
define( 'DB_ERROR_SHOW_AND_CONTINUE', 2 );
|
||||||
define ( 'DB_ERROR_SHOWALL_AND_STOP', 3);
|
define( 'DB_ERROR_SHOWALL_AND_STOP', 3 );
|
||||||
define ( 'DB_ERROR_SHOWALL_AND_CONTINUE', 4);
|
define( 'DB_ERROR_SHOWALL_AND_CONTINUE', 4 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DBConnection class definition
|
* DBConnection class definition
|
||||||
* It is useful to stablish a connection
|
* It is useful to stablish a connection
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @copyright (C) 2002 by Colosa Development Team.
|
* @copyright (C) 2002 by Colosa Development Team.
|
||||||
@@ -50,30 +54,33 @@ class DBConnection
|
|||||||
var $errorLevel;
|
var $errorLevel;
|
||||||
var $type;
|
var $type;
|
||||||
|
|
||||||
/*****************************************************************
|
/**
|
||||||
/* Error types:
|
* ***************************************************************
|
||||||
/* -1 Fatal error ( clase no instanced )
|
* /* Error types:
|
||||||
/* -2 Syntax error ( session missing, query malformed, etc )
|
* /* -1 Fatal error ( clase no instanced )
|
||||||
/* -3 warning ( when the engine build a dangerous query, i.e delete without where clause )
|
* /* -2 Syntax error ( session missing, query malformed, etc )
|
||||||
/*
|
* /* -3 warning ( when the engine build a dangerous query, i.e delete without where clause )
|
||||||
/* Error level:
|
* /*
|
||||||
/* 0 don't display any error information and continue.
|
* /* Error level:
|
||||||
/* 1 display small box with error information and die.
|
* /* 0 don't display any error information and continue.
|
||||||
/* 2 display small box with error information and continue
|
* /* 1 display small box with error information and die.
|
||||||
/* 3 display complete error information and die.
|
* /* 2 display small box with error information and continue
|
||||||
/* 4 display complete error information and continue.
|
* /* 3 display complete error information and die.
|
||||||
/*
|
* /* 4 display complete error information and continue.
|
||||||
/* Error Structure
|
* /*
|
||||||
/* int error code
|
* /* Error Structure
|
||||||
/* string error message
|
* /* int error code
|
||||||
/* string error detailed message
|
* /* string error message
|
||||||
/*
|
* /* string error detailed message
|
||||||
/* In all cases, the error will be saved in the apache log file
|
* /*
|
||||||
/*
|
* /* In all cases, the error will be saved in the apache log file
|
||||||
/* */
|
* /*
|
||||||
|
* /*
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts DB connection with default values
|
* Starts DB connection with default values
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @param const $strServer Host Name
|
* @param const $strServer Host Name
|
||||||
@@ -86,193 +93,203 @@ class DBConnection
|
|||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function DBConnection( $strServer = DB_HOST, $strUser = DB_USER, $strPwd = DB_PASS, $strDB = DB_NAME , $type = DB_ADAPTER, $strPort = 0, $errorLevel = 2 )
|
function DBConnection ($strServer = DB_HOST, $strUser = DB_USER, $strPwd = DB_PASS, $strDB = DB_NAME, $type = DB_ADAPTER, $strPort = 0, $errorLevel = 2)
|
||||||
{
|
{
|
||||||
$this->errorLevel = $errorLevel;
|
$this->errorLevel = $errorLevel;
|
||||||
if ($type == null ) $type = 'mysql';
|
if ($type == null)
|
||||||
|
$type = 'mysql';
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
//print "<hr>$type $strServer, $strUser, $strPwd, $strDB <hr>";
|
//print "<hr>$type $strServer, $strUser, $strPwd, $strDB <hr>";
|
||||||
if ( $type == "mysql" )
|
if ($type == "mysql")
|
||||||
$dsn = "mysql://$strUser:$strPwd@$strServer/$strDB";
|
$dsn = "mysql://$strUser:$strPwd@$strServer/$strDB";
|
||||||
if ( $type == "pgsql" ) {
|
if ($type == "pgsql") {
|
||||||
//$dsn = "pgsql://postgres@$strServer/$strDB";
|
//$dsn = "pgsql://postgres@$strServer/$strDB";
|
||||||
$prt = ( $strPort == 0 || $strPort == 5432 ? '' : ":$strPort" );
|
$prt = ($strPort == 0 || $strPort == 5432 ? '' : ":$strPort");
|
||||||
$dsn = "pgsql://$strUser:$strPwd@$strServer$prt/$strDB";
|
$dsn = "pgsql://$strUser:$strPwd@$strServer$prt/$strDB";
|
||||||
}
|
}
|
||||||
if ( $type == "odbc" )
|
if ($type == "odbc")
|
||||||
$dsn = "odbc://$strUser:$strPwd@$strServer/$strDB";
|
$dsn = "odbc://$strUser:$strPwd@$strServer/$strDB";
|
||||||
if ( $type == "mssql" ) {
|
if ($type == "mssql") {
|
||||||
$strServer = substr($strServer, 0, strpos($strServer,':'));
|
$strServer = substr( $strServer, 0, strpos( $strServer, ':' ) );
|
||||||
$prt = ( $strPort == 0 || $strPort == 1433 ? '' : ":$strPort" );
|
$prt = ($strPort == 0 || $strPort == 1433 ? '' : ":$strPort");
|
||||||
$dsn = "mssql://$strUser:$strPwd@$strServer$prt/$strDB";
|
$dsn = "mssql://$strUser:$strPwd@$strServer$prt/$strDB";
|
||||||
///--) $dsn = "mssql://$strUser:$strPwd@$strServer/$strDB";
|
///--) $dsn = "mssql://$strUser:$strPwd@$strServer/$strDB";
|
||||||
}
|
}
|
||||||
if ( $type == "oracle" ) {
|
if ($type == "oracle") {
|
||||||
$dsn = "oci8://$strUser:$strPwd@$strServer/$strDB";
|
$dsn = "oci8://$strUser:$strPwd@$strServer/$strDB";
|
||||||
}
|
}
|
||||||
$this->db_error = NULL;
|
$this->db_error = null;
|
||||||
if ( $type === 'myxml' ) {
|
if ($type === 'myxml') {
|
||||||
$this->db = XMLDB::connect ( $strServer );
|
$this->db = XMLDB::connect( $strServer );
|
||||||
} else {
|
} else {
|
||||||
$this->db = DB::connect ( $dsn );
|
$this->db = DB::connect( $dsn );
|
||||||
}
|
}
|
||||||
if ( DB::isError ($this->db) ) {
|
if (DB::isError( $this->db )) {
|
||||||
$this->db_error = $this->db;
|
$this->db_error = $this->db;
|
||||||
$this->db = NULL;
|
$this->db = null;
|
||||||
$this->logError( $this->db_error );
|
$this->logError( $this->db_error );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close Connection and Generate Log Message
|
* Close Connection and Generate Log Message
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Reset()
|
function Reset ()
|
||||||
{
|
{
|
||||||
if ( $this->db ){
|
if ($this->db) {
|
||||||
$this->db->disconnect();
|
$this->db->disconnect();
|
||||||
}
|
}
|
||||||
$this->db = NULL;
|
$this->db = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnect from Data base
|
* Disconnect from Data base
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Free()
|
function Free ()
|
||||||
{
|
{
|
||||||
$this->Reset();
|
$this->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close Connection
|
* Close Connection
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Close()
|
function Close ()
|
||||||
{
|
{
|
||||||
$this->Reset();
|
$this->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* log Errors
|
* log Errors
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @param db_error $obj
|
* @param db_error $obj
|
||||||
* @param string $errorLevel
|
* @param string $errorLevel
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function logError( $obj, $errorLevel = NULL )
|
function logError ($obj, $errorLevel = NULL)
|
||||||
{
|
{
|
||||||
global $_SESSION;
|
global $_SESSION;
|
||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
if ( is_null( $errorLevel ) )
|
if (is_null( $errorLevel ))
|
||||||
if ( isset ( $this->errorLevel) )
|
if (isset( $this->errorLevel )) {
|
||||||
$errorLevel = $this->errorLevel;
|
$errorLevel = $this->errorLevel;
|
||||||
else
|
} else {
|
||||||
$errorLevel = DB_ERROR_SHOWALL_AND_STOP; //for fatal errors the default is 3, show detailed and die.
|
$errorLevel = DB_ERROR_SHOWALL_AND_STOP; //for fatal errors the default is 3, show detailed and die.
|
||||||
if ($errorLevel == DB_ERROR_SHOW_AND_STOP || $errorLevel == DB_ERROR_SHOW_AND_CONTINUE ||
|
}
|
||||||
$errorLevel == DB_ERROR_SHOWALL_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_CONTINUE ) {
|
|
||||||
|
if ($errorLevel == DB_ERROR_SHOW_AND_STOP || $errorLevel == DB_ERROR_SHOW_AND_CONTINUE || $errorLevel == DB_ERROR_SHOWALL_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_CONTINUE) {
|
||||||
print "<table border=1 style='font-family:Arial' cellspacing=1 cellpadding = 0 width=400 class= 'tableError' >";
|
print "<table border=1 style='font-family:Arial' cellspacing=1 cellpadding = 0 width=400 class= 'tableError' >";
|
||||||
print "<tr><td><b>" . $obj->code . ' '. $obj->message . "</b></td></tr>";
|
print "<tr><td><b>" . $obj->code . ' ' . $obj->message . "</b></td></tr>";
|
||||||
if ($errorLevel == DB_ERROR_SHOWALL_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_CONTINUE ) {
|
if ($errorLevel == DB_ERROR_SHOWALL_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_CONTINUE) {
|
||||||
print "<tr><td>" . $obj->userinfo . "</td></tr>";
|
print "<tr><td>" . $obj->userinfo . "</td></tr>";
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
if (defined('DB_ERROR_BACKTRACE') && DB_ERROR_BACKTRACE) {
|
if (defined( 'DB_ERROR_BACKTRACE' ) && DB_ERROR_BACKTRACE) {
|
||||||
print "<table border = 1 width=400 class= 'sendMsgRojo'><tr><td><textarea rows='12' cols='180' style='width:100%;font-family:courier;white-space:pre-line;overflow:auto;border:none;'>";
|
print "<table border = 1 width=400 class= 'sendMsgRojo'><tr><td><textarea rows='12' cols='180' style='width:100%;font-family:courier;white-space:pre-line;overflow:auto;border:none;'>";
|
||||||
print((htmlentities(DBConnection::traceError())));
|
print ((htmlentities( DBConnection::traceError() ))) ;
|
||||||
print "</textarea></td></tr></table>";
|
print "</textarea></td></tr></table>";
|
||||||
}
|
}
|
||||||
//G::setErrorHandler ( );
|
//G::setErrorHandler ( );
|
||||||
G::customErrorLog ('DB_Error', $obj->code . ' '. $obj->message .'-' . $obj->userinfo, '', '');
|
G::customErrorLog( 'DB_Error', $obj->code . ' ' . $obj->message . '-' . $obj->userinfo, '', '' );
|
||||||
if ($errorLevel == DB_ERROR_SHOW_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_STOP ) {
|
if ($errorLevel == DB_ERROR_SHOW_AND_STOP || $errorLevel == DB_ERROR_SHOWALL_AND_STOP) {
|
||||||
die; //stop
|
die(); //stop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the trace of the current execution (debug_backtrace).
|
* Get the trace of the current execution (debug_backtrace).
|
||||||
|
*
|
||||||
* @author David Callizaya
|
* @author David Callizaya
|
||||||
* @param string $tts
|
* @param string $tts
|
||||||
* @param string $limit
|
* @param string $limit
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function traceError( $tts=2 , $limit=-1 )
|
function traceError ($tts = 2, $limit = -1)
|
||||||
{
|
{
|
||||||
$trace = debug_backtrace();
|
$trace = debug_backtrace();
|
||||||
$out='';
|
$out = '';
|
||||||
foreach($trace as $step) {
|
foreach ($trace as $step) {
|
||||||
if ($tts>0) {
|
if ($tts > 0) {
|
||||||
$tts--;
|
$tts --;
|
||||||
} else {
|
} else {
|
||||||
$out .= '['.basename($step['file']).': '.$step['line'].'] : ' . $step['function'] .'(' .
|
$out .= '[' . basename( $step['file'] ) . ': ' . $step['line'] . '] : ' . $step['function'] . '(' . DBConnection::printArgs( $step['args'] ) . ")\n";
|
||||||
DBConnection::printArgs($step['args']). ")\n";
|
$limit --;
|
||||||
$limit--;
|
if ($limit === 0) {
|
||||||
if ($limit===0)
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print the arguments of a function
|
* Print the arguments of a function
|
||||||
|
*
|
||||||
* @author David Callizaya
|
* @author David Callizaya
|
||||||
* @param string $args
|
* @param string $args
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printArgs( $args )
|
function printArgs ($args)
|
||||||
{
|
{
|
||||||
$out = '';
|
$out = '';
|
||||||
if (is_array($args)){
|
if (is_array( $args )) {
|
||||||
foreach($args as $arg) {
|
foreach ($args as $arg) {
|
||||||
if ($out!=='')
|
if ($out !== '') {
|
||||||
$out .= ' ,';
|
$out .= ' ,';
|
||||||
if (is_string($arg))
|
}
|
||||||
$out .= "'".($arg)."'";
|
if (is_string( $arg )) {
|
||||||
elseif (is_array($arg) )
|
$out .= "'" . ($arg) . "'";
|
||||||
$out .= print_r ( $arg ,1 );
|
} elseif (is_array( $arg )) {
|
||||||
elseif (is_object($arg))
|
$out .= print_r( $arg, 1 );
|
||||||
$out .= get_class($arg);// print_r ( $arg ,1 );
|
} elseif (is_object( $arg )) {
|
||||||
elseif (!isset($arg))
|
$out .= get_class( $arg ); // print_r ( $arg ,1 );
|
||||||
|
} elseif (! isset( $arg )) {
|
||||||
$out .= 'NULL';
|
$out .= 'NULL';
|
||||||
else
|
} else {
|
||||||
$out .= sprintf ( "%s" ,$arg );
|
$out .= sprintf( "%s", $arg );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!isset($args))
|
if (! isset( $args )) {
|
||||||
$out = 'NULL';
|
$out = 'NULL';
|
||||||
else
|
} else {
|
||||||
$out = print_r($args,1);
|
$out = print_r( $args, 1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets last autoincrement value inserted
|
* Gets last autoincrement value inserted
|
||||||
|
*
|
||||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function GetLastID()
|
function GetLastID ()
|
||||||
{
|
{
|
||||||
if ( PEAR_DATABASE == "mysql" ){
|
if (PEAR_DATABASE == "mysql") {
|
||||||
return mysql_insert_id();
|
return mysql_insert_id();
|
||||||
}
|
} else {
|
||||||
else {
|
$dberror = PEAR::raiseError( null, DB_ERROR_FEATURE_NOT_AVAILABLE, null, 'null', "getLastID with " . PEAR_DATABASE . ' database.', 'G_Error', true );
|
||||||
$dberror = PEAR::raiseError(null, DB_ERROR_FEATURE_NOT_AVAILABLE, null, 'null',
|
|
||||||
"getLastID with " . PEAR_DATABASE . ' database.',
|
|
||||||
'G_Error', true);
|
|
||||||
DBconnection::logError( $dberror, DB_ERROR_SHOWALL_AND_STOP ); //this error will stop the execution, until we add this feature!!
|
DBconnection::logError( $dberror, DB_ERROR_SHOWALL_AND_STOP ); //this error will stop the execution, until we add this feature!!
|
||||||
return $dberror;
|
return $dberror;
|
||||||
}
|
}
|
||||||
return mysql_insert_id();
|
return mysql_insert_id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3008
gulliver/system/class.g.php
Executable file → Normal file
3008
gulliver/system/class.g.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
397
gulliver/system/class.headPublisher.php
Executable file → Normal file
397
gulliver/system/class.headPublisher.php
Executable file → Normal file
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.headPublisher.php
|
* class.headPublisher.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -25,12 +27,14 @@
|
|||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Class headPublisher
|
* Class headPublisher
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
class headPublisher {
|
class headPublisher
|
||||||
private static $instance = NULL;
|
{
|
||||||
|
private static $instance = null;
|
||||||
var $maborakFiles = array ();
|
var $maborakFiles = array ();
|
||||||
var $maborakLoaderFiles = array ();
|
var $maborakLoaderFiles = array ();
|
||||||
var $scriptFiles = array ();
|
var $scriptFiles = array ();
|
||||||
@@ -79,139 +83,163 @@ class headPublisher {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function headPublisher
|
* Function headPublisher
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct ()
|
||||||
$this->addScriptFile ( "/js/maborak/core/maborak.js" );
|
{
|
||||||
|
$this->addScriptFile( "/js/maborak/core/maborak.js" );
|
||||||
}
|
}
|
||||||
|
|
||||||
function &getSingleton() {
|
function &getSingleton ()
|
||||||
if (self::$instance == NULL) {
|
{
|
||||||
self::$instance = new headPublisher ( );
|
if (self::$instance == null) {
|
||||||
|
self::$instance = new headPublisher();
|
||||||
}
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function setTitle
|
* Function setTitle
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string url
|
* @param eter string url
|
||||||
* @parameter string LoadType
|
* @param eter string LoadType
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function setTitle($title) {
|
function setTitle ($title)
|
||||||
|
{
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addMaborakFile
|
* Function addMaborakFile
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string filename
|
* @param eter string filename
|
||||||
* @parameter string loader; false -> maborak files, true maborak.loader
|
* @param eter string loader; false -> maborak files, true maborak.loader
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function addMaborakFile($filename, $loader = false) {
|
function addMaborakFile ($filename, $loader = false)
|
||||||
if ($loader)
|
{
|
||||||
$this->maborakLoaderFiles [] = $filename;
|
if ($loader) {
|
||||||
else
|
$this->maborakLoaderFiles[] = $filename;
|
||||||
$this->maborakFiles [] = $filename;
|
} else {
|
||||||
|
$this->maborakFiles[] = $filename;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addScriptFile
|
* Function addScriptFile
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string url
|
* @param eter string url
|
||||||
* @parameter string LoadType
|
* @param eter string LoadType
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function addScriptFile($url, $LoadType = 1) {
|
function addScriptFile ($url, $LoadType = 1)
|
||||||
if ($LoadType == 1)
|
{
|
||||||
$this->scriptFiles [$url] = $url;
|
if ($LoadType == 1) {
|
||||||
if ($LoadType == 2)
|
$this->scriptFiles[$url] = $url;
|
||||||
$this->leimnudLoad [$url] = $url;
|
}
|
||||||
|
if ($LoadType == 2) {
|
||||||
|
$this->leimnudLoad[$url] = $url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addInstanceModule
|
* Function addInstanceModule
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string instance
|
* @param eter string instance
|
||||||
* @parameter string module
|
* @param eter string module
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function addInstanceModule($instance, $module) {
|
function addInstanceModule ($instance, $module)
|
||||||
|
{
|
||||||
$this->headerScript .= "leimnud.Package.Load('" . $module . "',{Instance:" . $instance . ",Type:'module'});\n";
|
$this->headerScript .= "leimnud.Package.Load('" . $module . "',{Instance:" . $instance . ",Type:'module'});\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addClassModule
|
* Function addClassModule
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string class
|
* @param eter string class
|
||||||
* @parameter string module
|
* @param eter string module
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function addClassModule($class, $module) {
|
function addClassModule ($class, $module)
|
||||||
|
{
|
||||||
$this->headerScript .= "leimnud.Package.Load('" . $module . "',{Class:" . $class . ",Type:'module'});\n";
|
$this->headerScript .= "leimnud.Package.Load('" . $module . "',{Class:" . $class . ",Type:'module'});\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addScriptCode
|
* Function addScriptCode
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @parameter string script
|
* @param eter string script
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function addScriptCode($script) {
|
function addScriptCode ($script)
|
||||||
|
{
|
||||||
$this->headerScript .= $script;
|
$this->headerScript .= $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function printHeader
|
* Function printHeader
|
||||||
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printHeader() {
|
function printHeader ()
|
||||||
|
{
|
||||||
$jslabel = 'labels/en.js';
|
$jslabel = 'labels/en.js';
|
||||||
if (defined ( 'SYS_LANG' )) {
|
if (defined( 'SYS_LANG' )) {
|
||||||
$jslabel = 'labels' . PATH_SEP . SYS_LANG . '.js';
|
$jslabel = 'labels' . PATH_SEP . SYS_LANG . '.js';
|
||||||
if (! file_exists ( PATH_CORE . 'js' . PATH_SEP . $jslabel ))
|
if (! file_exists( PATH_CORE . 'js' . PATH_SEP . $jslabel )) {
|
||||||
$jslabel = 'labels/en.js';
|
$jslabel = 'labels/en.js';
|
||||||
}
|
}
|
||||||
if (file_exists ( PATH_CORE . 'js' . PATH_SEP . $jslabel )) {
|
|
||||||
$this->addScriptFile ( '/jscore/' . $jslabel, 1 );
|
|
||||||
}
|
}
|
||||||
if ($this->disableHeaderScripts)
|
if (file_exists( PATH_CORE . 'js' . PATH_SEP . $jslabel )) {
|
||||||
|
$this->addScriptFile( '/jscore/' . $jslabel, 1 );
|
||||||
|
}
|
||||||
|
if ($this->disableHeaderScripts) {
|
||||||
return '';
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
// available js-calendar languages array
|
// available js-calendar languages array
|
||||||
$availableJsCalendarLang = array('ca', 'cn', 'cz', 'de', 'en', 'es', 'fr', 'it', 'jp', 'nl', 'pl', 'pt', 'ro', 'ru', 'sv');
|
$availableJsCalendarLang = array ('ca','cn','cz','de','en','es','fr','it','jp','nl','pl','pt','ro','ru','sv');
|
||||||
|
|
||||||
// get the system language without locale
|
// get the system language without locale
|
||||||
$sysLang = explode('-', SYS_LANG);
|
$sysLang = explode( '-', SYS_LANG );
|
||||||
$sysLang = $sysLang[0];
|
$sysLang = $sysLang[0];
|
||||||
|
|
||||||
// verify if the requested lang by the system is supported by js-calendar library, if not set english by default
|
// verify if the requested lang by the system is supported by js-calendar library, if not set english by default
|
||||||
$sysLang = in_array($sysLang, $availableJsCalendarLang) ? $sysLang : 'en';
|
$sysLang = in_array( $sysLang, $availableJsCalendarLang ) ? $sysLang : 'en';
|
||||||
|
|
||||||
$this->addScriptFile ( "/js/widgets/js-calendar/unicode-letter.js" );
|
$this->addScriptFile( "/js/widgets/js-calendar/unicode-letter.js" );
|
||||||
$this->addScriptFile ( "/js/widgets/js-calendar/lang/".$sysLang.".js" );
|
$this->addScriptFile( "/js/widgets/js-calendar/lang/" . $sysLang . ".js" );
|
||||||
|
|
||||||
$head = '';
|
$head = '';
|
||||||
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
|
$head .= '<TITLE>' . $this->title . "</TITLE>\n";
|
||||||
foreach ( $this->scriptFiles as $file )
|
foreach ($this->scriptFiles as $file) {
|
||||||
$head .= "<script type='text/javascript' src='" . $file . "'></script>\n";
|
$head .= "<script type='text/javascript' src='" . $file . "'></script>\n";
|
||||||
|
}
|
||||||
$head .= "<script type='text/javascript'>\n";
|
$head .= "<script type='text/javascript'>\n";
|
||||||
$head .= $this->leimnudInitString;
|
$head .= $this->leimnudInitString;
|
||||||
foreach ( $this->leimnudLoad as $file )
|
foreach ($this->leimnudLoad as $file) {
|
||||||
$head .= " leimnud.Package.Load(false, {Type: 'file', Path: '" . $file . "', Absolute : true});\n";
|
$head .= " leimnud.Package.Load(false, {Type: 'file', Path: '" . $file . "', Absolute : true});\n";
|
||||||
|
}
|
||||||
$head .= $this->headerScript;
|
$head .= $this->headerScript;
|
||||||
$head .= "</script>\n";
|
$head .= "</script>\n";
|
||||||
return $head;
|
return $head;
|
||||||
@@ -228,24 +256,27 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printRawHeader() {
|
function printRawHeader ()
|
||||||
|
{
|
||||||
$jslabel = '/jscore/labels/en.js';
|
$jslabel = '/jscore/labels/en.js';
|
||||||
if (defined ( 'SYS_LANG' )) {
|
if (defined( 'SYS_LANG' )) {
|
||||||
$jslabel1 = 'labels' . PATH_SEP . SYS_LANG . '.js';
|
$jslabel1 = 'labels' . PATH_SEP . SYS_LANG . '.js';
|
||||||
if (! file_exists ( PATH_CORE . 'js' . PATH_SEP . $jslabel1 ))
|
if (! file_exists( PATH_CORE . 'js' . PATH_SEP . $jslabel1 )) {
|
||||||
$jslabel = '/jscore/labels/en.js';
|
$jslabel = '/jscore/labels/en.js';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$head = '';
|
$head = '';
|
||||||
//$head .= "<script language='javascript'>\n";
|
//$head .= "<script language='javascript'>\n";
|
||||||
foreach ( $this->scriptFiles as $file ) {
|
foreach ($this->scriptFiles as $file) {
|
||||||
if (($file != "/js/maborak/core/maborak.js") && ($file != $jslabel)) {
|
if (($file != "/js/maborak/core/maborak.js") && ($file != $jslabel)) {
|
||||||
$head .= " eval(ajax_function('" . $file . "','',''));\n";
|
$head .= " eval(ajax_function('" . $file . "','',''));\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ( $this->leimnudLoad as $file )
|
foreach ($this->leimnudLoad as $file) {
|
||||||
$head .= " eval(ajax_function('" . $file . "','',''));\n";
|
$head .= " eval(ajax_function('" . $file . "','',''));\n";
|
||||||
|
}
|
||||||
//Adapts the add events on load to simple javascript sentences.
|
//Adapts the add events on load to simple javascript sentences.
|
||||||
$this->headerScript = preg_replace ( '/\s*leimnud.event.add\s*\(\s*window\s*,\s*(?:\'|")load(?:\'|")\s*,\s*function\(\)\{(.+)\}\s*\)\s*;?/', '$1', $this->headerScript );
|
$this->headerScript = preg_replace( '/\s*leimnud.event.add\s*\(\s*window\s*,\s*(?:\'|")load(?:\'|")\s*,\s*function\(\)\{(.+)\}\s*\)\s*;?/', '$1', $this->headerScript );
|
||||||
$head .= $this->headerScript;
|
$head .= $this->headerScript;
|
||||||
//$head .= "</script>\n";
|
//$head .= "</script>\n";
|
||||||
return $head;
|
return $head;
|
||||||
@@ -259,7 +290,8 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function clearScripts() {
|
function clearScripts ()
|
||||||
|
{
|
||||||
$this->scriptFiles = array ();
|
$this->scriptFiles = array ();
|
||||||
$this->leimnudLoad = array ();
|
$this->leimnudLoad = array ();
|
||||||
$this->leimnudInitString = '';
|
$this->leimnudInitString = '';
|
||||||
@@ -277,13 +309,14 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function includeExtJs() {
|
function includeExtJs ()
|
||||||
$this->clearScripts ();
|
{
|
||||||
|
$this->clearScripts();
|
||||||
$head = '';
|
$head = '';
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/ext-base.js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/ext-base.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/ext-all.js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/ext-all.js'></script>\n";
|
||||||
$aux = explode('-', strtolower(SYS_LANG));
|
$aux = explode( '-', strtolower( SYS_LANG ) );
|
||||||
if (($aux[0] != 'en') && file_exists(PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'ext' . PATH_SEP . 'locale' . PATH_SEP . 'ext-lang-' . $aux[0] . '.js')) {
|
if (($aux[0] != 'en') && file_exists( PATH_GULLIVER_HOME . 'js' . PATH_SEP . 'ext' . PATH_SEP . 'locale' . PATH_SEP . 'ext-lang-' . $aux[0] . '.js' )) {
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/locale/ext-lang-" . $aux[0] . ".js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/locale/ext-lang-" . $aux[0] . ".js'></script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,29 +324,28 @@ class headPublisher {
|
|||||||
$head .= $this->getExtJsLibraries();
|
$head .= $this->getExtJsLibraries();
|
||||||
|
|
||||||
// $head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
// $head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/translation.".SYS_LANG.".js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/translation." . SYS_LANG . ".js'></script>\n";
|
||||||
|
|
||||||
if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') {
|
if (! isset( $this->extJsSkin ) || $this->extJsSkin == '') {
|
||||||
$this->extJsSkin = 'xtheme-gray';
|
$this->extJsSkin = 'xtheme-gray';
|
||||||
//$this->extJsSkin = 'gtheme';
|
//$this->extJsSkin = 'gtheme';
|
||||||
}
|
}
|
||||||
|
|
||||||
//$head .= $this->getExtJsStylesheets();
|
//$head .= $this->getExtJsStylesheets();
|
||||||
$head .= $this->getExtJsScripts();
|
$head .= $this->getExtJsScripts();
|
||||||
$head .= $this->getExtJsVariablesScript();
|
$head .= $this->getExtJsVariablesScript();
|
||||||
|
$oServerConf = & serverConf::getSingleton();
|
||||||
$oServerConf =& serverConf::getSingleton();
|
if ($oServerConf->isRtl( SYS_LANG )) {
|
||||||
if ($oServerConf->isRtl(SYS_LANG)) {
|
|
||||||
$head .= " <script type='text/javascript' src='/js/ext/extjs_rtl.js'></script>\n";
|
$head .= " <script type='text/javascript' src='/js/ext/extjs_rtl.js'></script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtJsStylesheets($skinName){
|
function getExtJsStylesheets ($skinName)
|
||||||
|
{
|
||||||
$script = " <link rel='stylesheet' type='text/css' href='/css/$skinName.css' />\n";
|
$script = " <link rel='stylesheet' type='text/css' href='/css/$skinName.css' />\n";
|
||||||
$script .= " <script type='text/javascript' src='/js/ext/translation.".SYS_LANG.".js'></script>\n";
|
$script .= " <script type='text/javascript' src='/js/ext/translation." . SYS_LANG . ".js'></script>\n";
|
||||||
/*
|
/*
|
||||||
$script .= " <link rel='stylesheet' type='text/css' href='/skins/ext/ext-all-notheme.css' />\n";
|
$script .= " <link rel='stylesheet' type='text/css' href='/skins/ext/ext-all-notheme.css' />\n";
|
||||||
$script .= " <link rel='stylesheet' type='text/css' href='/skins/ext/" . $this->extJsSkin.".css' />\n";
|
$script .= " <link rel='stylesheet' type='text/css' href='/skins/ext/" . $this->extJsSkin.".css' />\n";
|
||||||
|
|
||||||
@@ -326,43 +358,43 @@ class headPublisher {
|
|||||||
//new interactive css decorator
|
//new interactive css decorator
|
||||||
$script .= " <link rel='stylesheet' type='text/css' href='/gulliver/loader?t=extjs-cssExtended&s=".$this->extJsSkin."' />\n";
|
$script .= " <link rel='stylesheet' type='text/css' href='/gulliver/loader?t=extjs-cssExtended&s=".$this->extJsSkin."' />\n";
|
||||||
$script .= " <link rel='stylesheet' type='text/css' href='/images/icons_silk/sprite.css' />\n";
|
$script .= " <link rel='stylesheet' type='text/css' href='/images/icons_silk/sprite.css' />\n";
|
||||||
*/
|
*/
|
||||||
// Load external/plugin css
|
// Load external/plugin css
|
||||||
// NOTE is necesary to move this to decorator server
|
// NOTE is necesary to move this to decorator server
|
||||||
if(class_exists('PMPluginRegistry')){
|
if (class_exists( 'PMPluginRegistry' )) {
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton ();
|
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||||
$registeredCss=$oPluginRegistry->getRegisteredCss();
|
$registeredCss = $oPluginRegistry->getRegisteredCss();
|
||||||
foreach($registeredCss as $cssFile){
|
foreach ($registeredCss as $cssFile) {
|
||||||
$script .= " <link rel='stylesheet' type='text/css' href='" . $cssFile->sCssFile . ".css' />\n";
|
$script .= " <link rel='stylesheet' type='text/css' href='" . $cssFile->sCssFile . ".css' />\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $script;
|
return $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtJsScripts(){
|
function getExtJsScripts ()
|
||||||
|
{
|
||||||
$script = '';
|
$script = '';
|
||||||
if (isset ( $this->extJsScript ) && is_array ( $this->extJsScript )) {
|
if (isset( $this->extJsScript ) && is_array( $this->extJsScript )) {
|
||||||
foreach ( $this->extJsScript as $key => $file ) {
|
foreach ($this->extJsScript as $key => $file) {
|
||||||
$script .= " <script type='text/javascript' src='" . $file . ".js'></script>\n";
|
$script .= " <script type='text/javascript' src='" . $file . ".js'></script>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $script;
|
return $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtJsVariablesScript(){
|
function getExtJsVariablesScript ()
|
||||||
|
{
|
||||||
$script = '';
|
$script = '';
|
||||||
|
if (count( $this->extVariable ) > 0) {
|
||||||
if (count ( $this->extVariable ) > 0) {
|
|
||||||
$script = "<script language='javascript'>\n";
|
$script = "<script language='javascript'>\n";
|
||||||
foreach ( $this->extVariable as $key => $val ) {
|
foreach ($this->extVariable as $key => $val) {
|
||||||
$name = $val ['name'];
|
$name = $val['name'];
|
||||||
$value = $val ['value'];
|
$value = $val['value'];
|
||||||
$variablesValues = G::json_encode($value);
|
$variablesValues = G::json_encode( $value );
|
||||||
$variablesValues = $this->stripCodeQuotes($variablesValues);
|
$variablesValues = $this->stripCodeQuotes( $variablesValues );
|
||||||
// var_dump($variablesValues);
|
// var_dump($variablesValues);
|
||||||
// echo "<br>";
|
// echo "<br>";
|
||||||
$script .= " var $name = ".$variablesValues.";\n";
|
$script .= " var $name = " . $variablesValues . ";\n";
|
||||||
/*
|
/*
|
||||||
if ($val ['type'] == 'number')
|
if ($val ['type'] == 'number')
|
||||||
$script .= " var $name = $value;\n";
|
$script .= " var $name = $value;\n";
|
||||||
@@ -372,15 +404,14 @@ class headPublisher {
|
|||||||
}
|
}
|
||||||
$script .= "</script>\n";
|
$script .= "</script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $script;
|
return $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getExtJsLibraries()
|
function getExtJsLibraries ()
|
||||||
{
|
{
|
||||||
$script = '';
|
$script = '';
|
||||||
if (isset ( $this->extJsLibrary ) && is_array ( $this->extJsLibrary )) {
|
if (isset( $this->extJsLibrary ) && is_array( $this->extJsLibrary )) {
|
||||||
foreach ( $this->extJsLibrary as $file ) {
|
foreach ($this->extJsLibrary as $file) {
|
||||||
$script .= " <script type='text/javascript' src='/js/ext/" . $file . ".js'></script>\n";
|
$script .= " <script type='text/javascript' src='/js/ext/" . $file . ".js'></script>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,11 +426,12 @@ class headPublisher {
|
|||||||
* @param (String) http js path library
|
* @param (String) http js path library
|
||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
function usingExtJs($library) {
|
function usingExtJs ($library)
|
||||||
if (! is_string ( $library )) {
|
{
|
||||||
throw new Exception ( 'headPublisher::usingExt->ERROR - the parameter should be a js path string' );
|
if (! is_string( $library )) {
|
||||||
|
throw new Exception( 'headPublisher::usingExt->ERROR - the parameter should be a js path string' );
|
||||||
}
|
}
|
||||||
array_push ( $this->extJsLibrary, $library );
|
array_push( $this->extJsLibrary, $library );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -412,13 +444,15 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function setExtSkin($skin) {
|
function setExtSkin ($skin)
|
||||||
|
{
|
||||||
$this->extJsSkin = $skin;
|
$this->extJsSkin = $skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addExtJsScript
|
* Function addExtJsScript
|
||||||
* adding a javascript file .js
|
* adding a javascript file .
|
||||||
|
* js
|
||||||
* add a js file in the extension Javascript Array,
|
* add a js file in the extension Javascript Array,
|
||||||
* later, when we use the includeExtJs function, all the files in this array will be included in the output
|
* later, when we use the includeExtJs function, all the files in this array will be included in the output
|
||||||
* if the second argument is true, the file will not be minified, this is useful for debug purposes.
|
* if the second argument is true, the file will not be minified, this is useful for debug purposes.
|
||||||
@@ -431,109 +465,107 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function addExtJsScript($filename, $debug = false, $isExternal=false) {
|
function addExtJsScript ($filename, $debug = false, $isExternal = false)
|
||||||
|
{
|
||||||
$sPath = PATH_TPL;
|
$sPath = PATH_TPL;
|
||||||
//if the template file doesn't exists, then try with the plugins folders
|
//if the template file doesn't exists, then try with the plugins folders
|
||||||
|
|
||||||
|
|
||||||
if (! is_file ( $sPath . $filename . ".js" )) {
|
if (! is_file( $sPath . $filename . ".js" )) {
|
||||||
$aux = explode ( PATH_SEP, $filename );
|
$aux = explode( PATH_SEP, $filename );
|
||||||
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
|
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
|
||||||
if (count ( $aux ) == 2 && defined ( 'G_PLUGIN_CLASS' )) {
|
if (count( $aux ) == 2 && defined( 'G_PLUGIN_CLASS' )) {
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton ();
|
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||||
if ($oPluginRegistry->isRegisteredFolder ( $aux [0] )) {
|
if ($oPluginRegistry->isRegisteredFolder( $aux[0] )) {
|
||||||
$sPath = PATH_PLUGINS;
|
$sPath = PATH_PLUGINS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isExternal)
|
if (! $isExternal) {
|
||||||
$jsFilename = $sPath . $filename . '.js';
|
$jsFilename = $sPath . $filename . '.js';
|
||||||
else
|
} else {
|
||||||
$jsFilename = $filename . '.js';
|
$jsFilename = $filename . '.js';
|
||||||
|
}
|
||||||
|
|
||||||
if (! file_exists ( $jsFilename )) {
|
if (! file_exists( $jsFilename )) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mtime = filemtime ( $jsFilename );
|
$mtime = filemtime( $jsFilename );
|
||||||
G::mk_dir ( PATH_C . 'ExtJs' );
|
G::mk_dir( PATH_C . 'ExtJs' );
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
$cacheName = str_replace ( '/', '_', $filename );
|
$cacheName = str_replace( '/', '_', $filename );
|
||||||
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $cacheName . '.js';
|
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $cacheName . '.js';
|
||||||
file_put_contents ( $cacheFilename, file_get_contents ( $jsFilename ) );
|
file_put_contents( $cacheFilename, file_get_contents( $jsFilename ) );
|
||||||
}
|
} else {
|
||||||
else {
|
$cacheName = md5( $mtime . $jsFilename );
|
||||||
$cacheName = md5 ( $mtime . $jsFilename );
|
|
||||||
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $cacheName . '.js';
|
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $cacheName . '.js';
|
||||||
|
|
||||||
if (! file_exists ( $cacheFilename )) {
|
if (! file_exists( $cacheFilename )) {
|
||||||
require_once (PATH_THIRDPARTY . 'jsmin/jsmin.php');
|
require_once (PATH_THIRDPARTY . 'jsmin/jsmin.php');
|
||||||
$content = JSMin::minify ( file_get_contents ( $jsFilename ) );
|
$content = JSMin::minify( file_get_contents( $jsFilename ) );
|
||||||
file_put_contents ( $cacheFilename, $content );
|
file_put_contents( $cacheFilename, $content );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->extJsScript[] = '/extjs/' . $cacheName;
|
||||||
$this->extJsScript [] = '/extjs/' . $cacheName;
|
|
||||||
|
|
||||||
//hook for registered javascripts from plugins
|
//hook for registered javascripts from plugins
|
||||||
if ( class_exists( 'PMPluginRegistry' ) ) {
|
if (class_exists( 'PMPluginRegistry' )) {
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||||
$pluginJavascripts = $oPluginRegistry->getRegisteredJavascriptBy($filename);
|
$pluginJavascripts = $oPluginRegistry->getRegisteredJavascriptBy( $filename );
|
||||||
|
} else {
|
||||||
|
$pluginJavascripts = array ();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$pluginJavascripts = array();
|
|
||||||
|
|
||||||
if (count($pluginJavascripts) > 0) {
|
if (count( $pluginJavascripts ) > 0) {
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
foreach ($pluginJavascripts as $pluginJsFile) {
|
foreach ($pluginJavascripts as $pluginJsFile) {
|
||||||
$jsPluginCacheName = '';
|
$jsPluginCacheName = '';
|
||||||
if (substr($pluginJsFile, -3) != '.js') {
|
if (substr( $pluginJsFile, - 3 ) != '.js') {
|
||||||
$pluginJsFile .= '.js';
|
$pluginJsFile .= '.js';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(PATH_PLUGINS . $pluginJsFile)) {
|
if (file_exists( PATH_PLUGINS . $pluginJsFile )) {
|
||||||
$jsPluginCacheName = str_replace ( '/', '_', str_replace('.js', '', $pluginJsFile) );
|
$jsPluginCacheName = str_replace( '/', '_', str_replace( '.js', '', $pluginJsFile ) );
|
||||||
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $jsPluginCacheName.".js";
|
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $jsPluginCacheName . ".js";
|
||||||
file_put_contents ( $cacheFilename, file_get_contents ( PATH_PLUGINS . $pluginJsFile ) );
|
file_put_contents( $cacheFilename, file_get_contents( PATH_PLUGINS . $pluginJsFile ) );
|
||||||
}
|
}
|
||||||
if ($jsPluginCacheName != '') {
|
if ($jsPluginCacheName != '') {
|
||||||
$this->extJsScript [] = '/extjs/' . $jsPluginCacheName;
|
$this->extJsScript[] = '/extjs/' . $jsPluginCacheName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
foreach ($pluginJavascripts as $pluginJsFile) {
|
foreach ($pluginJavascripts as $pluginJsFile) {
|
||||||
$jsPluginCacheName = '';
|
$jsPluginCacheName = '';
|
||||||
if (substr($pluginJsFile, -3) !== '.js') {
|
if (substr( $pluginJsFile, - 3 ) !== '.js') {
|
||||||
$pluginJsFile .= '.js';
|
$pluginJsFile .= '.js';
|
||||||
}
|
}
|
||||||
if (file_exists(PATH_PLUGINS . $pluginJsFile)) {
|
if (file_exists( PATH_PLUGINS . $pluginJsFile )) {
|
||||||
$mtime = filemtime ( PATH_PLUGINS . $pluginJsFile );
|
$mtime = filemtime( PATH_PLUGINS . $pluginJsFile );
|
||||||
$jsPluginCacheName = md5 ( $mtime . $pluginJsFile );
|
$jsPluginCacheName = md5( $mtime . $pluginJsFile );
|
||||||
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $jsPluginCacheName . '.js';
|
$cacheFilename = PATH_C . 'ExtJs' . PATH_SEP . $jsPluginCacheName . '.js';
|
||||||
|
|
||||||
if (! file_exists ( $cacheFilename )) {
|
if (! file_exists( $cacheFilename )) {
|
||||||
require_once (PATH_THIRDPARTY . 'jsmin/jsmin.php');
|
require_once (PATH_THIRDPARTY . 'jsmin/jsmin.php');
|
||||||
$content = JSMin::minify ( file_get_contents ( PATH_PLUGINS . $pluginJsFile ) );
|
$content = JSMin::minify( file_get_contents( PATH_PLUGINS . $pluginJsFile ) );
|
||||||
file_put_contents ( $cacheFilename, $content );
|
file_put_contents( $cacheFilename, $content );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($jsPluginCacheName != '') {
|
if ($jsPluginCacheName != '') {
|
||||||
$this->extJsScript [] = '/extjs/' . $jsPluginCacheName;
|
$this->extJsScript[] = '/extjs/' . $jsPluginCacheName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//end hook for registered javascripts from plugins
|
//end hook for registered javascripts from plugins
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function AddContent
|
* Function AddContent
|
||||||
* adding a html file .html.
|
* adding a html file .
|
||||||
|
* html.
|
||||||
* the main idea for this function, is to be a replacement to homonymous function in Publisher class.
|
* the main idea for this function, is to be a replacement to homonymous function in Publisher class.
|
||||||
* with this function you are adding Content to the output, the class HeadPublisher will maintain a list of
|
* with this function you are adding Content to the output, the class HeadPublisher will maintain a list of
|
||||||
* files to render in the body of the output page
|
* files to render in the body of the output page
|
||||||
@@ -542,11 +574,13 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function AddContent($templateHtml) {
|
function AddContent ($templateHtml)
|
||||||
$this->extJsContent [] = $templateHtml;
|
{
|
||||||
|
$this->extJsContent[] = $templateHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContent() {
|
function getContent ()
|
||||||
|
{
|
||||||
return $this->extJsContent;
|
return $this->extJsContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,15 +593,18 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function Assign($variable, $value) {
|
function Assign ($variable, $value)
|
||||||
$this->extVariable [] = array ('name' => $variable, 'value' => $value, 'type' => 'string' );
|
{
|
||||||
|
$this->extVariable[] = array ('name' => $variable,'value' => $value,'type' => 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssignVar($name, $value) {
|
function AssignVar ($name, $value)
|
||||||
$this->vars [$name] = $value;
|
{
|
||||||
|
$this->vars[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVars() {
|
function getVars ()
|
||||||
|
{
|
||||||
return $this->vars;
|
return $this->vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -580,9 +617,11 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function AssignNumber($variable, $value) {
|
function AssignNumber ($variable, $value)
|
||||||
$this->extVariable [] = array ('name' => $variable, 'value' => $value, 'type' => 'number' );
|
{
|
||||||
|
$this->extVariable[] = array ('name' => $variable,'value' => $value,'type' => 'number');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function renderExtJs
|
* Function renderExtJs
|
||||||
* this function returns the content rendered using ExtJs
|
* this function returns the content rendered using ExtJs
|
||||||
@@ -592,52 +631,54 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function renderExtJs() {
|
function renderExtJs ()
|
||||||
|
{
|
||||||
$body = '';
|
$body = '';
|
||||||
if (isset ( $this->extJsContent ) && is_array ( $this->extJsContent )) {
|
if (isset( $this->extJsContent ) && is_array( $this->extJsContent )) {
|
||||||
foreach ( $this->extJsContent as $key => $file ) {
|
foreach ($this->extJsContent as $key => $file) {
|
||||||
$sPath = PATH_TPL;
|
$sPath = PATH_TPL;
|
||||||
//if the template file doesn't exists, then try with the plugins folders
|
//if the template file doesn't exists, then try with the plugins folders
|
||||||
if (! is_file ( $sPath . $file . ".html" )) {
|
if (! is_file( $sPath . $file . ".html" )) {
|
||||||
$aux = explode ( PATH_SEP, $file );
|
$aux = explode( PATH_SEP, $file );
|
||||||
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
|
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
|
||||||
if (count ( $aux ) == 2 && defined ( 'G_PLUGIN_CLASS' )) {
|
if (count( $aux ) == 2 && defined( 'G_PLUGIN_CLASS' )) {
|
||||||
$oPluginRegistry = & PMPluginRegistry::getSingleton ();
|
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||||
if ($oPluginRegistry->isRegisteredFolder ( $aux [0] )) {
|
if ($oPluginRegistry->isRegisteredFolder( $aux[0] )) {
|
||||||
$sPath = PATH_PLUGINS;
|
$sPath = PATH_PLUGINS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = new TemplatePower ( $sPath . $file . '.html' );
|
$template = new TemplatePower( $sPath . $file . '.html' );
|
||||||
$template->prepare ();
|
$template->prepare();
|
||||||
|
|
||||||
foreach ($this->getVars() as $k => $v) {
|
foreach ($this->getVars() as $k => $v) {
|
||||||
$template->assign($k, $v);
|
$template->assign( $k, $v );
|
||||||
}
|
}
|
||||||
|
|
||||||
$body .= $template->getOutputContent ();
|
$body .= $template->getOutputContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stripCodeQuotes($sJson){
|
function stripCodeQuotes ($sJson)
|
||||||
$fields = array( "editor", "renderer" );
|
{
|
||||||
|
$fields = array ("editor","renderer");
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$pattern = '/"('.$field.')":"[a-zA-Z.()]*"/';
|
$pattern = '/"(' . $field . ')":"[a-zA-Z.()]*"/';
|
||||||
// echo $pattern."<br>";
|
// echo $pattern."<br>";
|
||||||
preg_match ($pattern,$sJson,$matches);
|
preg_match( $pattern, $sJson, $matches );
|
||||||
// var_dump ($matches);
|
// var_dump ($matches);
|
||||||
// echo "<br>";
|
// echo "<br>";
|
||||||
if (!empty($matches)){
|
if (! empty( $matches )) {
|
||||||
$rendererMatch = $matches[0];
|
$rendererMatch = $matches[0];
|
||||||
$replaceBy = explode(":", $matches[0]);
|
$replaceBy = explode( ":", $matches[0] );
|
||||||
$replaceBy[1] = str_replace('"','',$replaceBy[1]);
|
$replaceBy[1] = str_replace( '"', '', $replaceBy[1] );
|
||||||
$tmpString = implode(":",$replaceBy);
|
$tmpString = implode( ":", $replaceBy );
|
||||||
$sJson = str_replace($rendererMatch, $tmpString, $sJson);
|
$sJson = str_replace( $rendererMatch, $tmpString, $sJson );
|
||||||
// var_dump ($sJson);
|
// var_dump ($sJson);
|
||||||
// echo "<br>";
|
// echo "<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sJson;
|
return $sJson;
|
||||||
@@ -652,7 +693,9 @@ class headPublisher {
|
|||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function disableHeaderScripts(){
|
function disableHeaderScripts ()
|
||||||
|
{
|
||||||
$this->disableHeaderScripts = true;
|
$this->disableHeaderScripts = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
193
gulliver/system/class.soapNtlm.php
Executable file → Normal file
193
gulliver/system/class.soapNtlm.php
Executable file → Normal file
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* class.soapNtlm.php
|
* class.soapNtlm.php
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
@@ -30,10 +31,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @package gulliver.system
|
* @package gulliver.system
|
||||||
*/
|
*/
|
||||||
class soapNtlm {
|
class soapNtlm
|
||||||
|
{
|
||||||
private $path;
|
private $path;
|
||||||
private $mode;
|
private $mode;
|
||||||
private $options;
|
private $options;
|
||||||
@@ -41,12 +43,12 @@ class soapNtlm {
|
|||||||
private $buffer;
|
private $buffer;
|
||||||
private $pos;
|
private $pos;
|
||||||
|
|
||||||
public function getuser()
|
public function getuser ()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getpassword()
|
public function getpassword ()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -60,27 +62,25 @@ class soapNtlm {
|
|||||||
* @param unknown_type $opened_path
|
* @param unknown_type $opened_path
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
public function stream_open($path, $mode, $options, $opened_path) {
|
public function stream_open ($path, $mode, $options, $opened_path)
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_open] $path , mode=$mode <br>";
|
//echo "[NTLMStream::stream_open] $path , mode=$mode <br>";
|
||||||
//G::pr($options);
|
//G::pr($options);
|
||||||
|
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
$this->options = $options;
|
$this->options = $options;
|
||||||
$this->opened_path = $opened_path;
|
$this->opened_path = $opened_path;
|
||||||
|
$this->createBuffer( $this->path );
|
||||||
$this->createBuffer($this->path);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the stream
|
* Close the stream
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function stream_close() {
|
public function stream_close ()
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_close] <br>";
|
//echo "[NTLMStream::stream_close] <br>";
|
||||||
curl_close($this->ch);
|
curl_close( $this->ch );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,16 +89,14 @@ class soapNtlm {
|
|||||||
* @param int $count number of bytes to read
|
* @param int $count number of bytes to read
|
||||||
* @return content from pos to count
|
* @return content from pos to count
|
||||||
*/
|
*/
|
||||||
public function stream_read($count) {
|
public function stream_read ($count)
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_read] $count <br>";
|
//echo "[NTLMStream::stream_read] $count <br>";
|
||||||
if (strlen($this->buffer) == 0) {
|
if (strlen( $this->buffer ) == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$read = substr( $this->buffer, $this->pos, $count );
|
||||||
$read = substr($this->buffer, $this->pos, $count);
|
|
||||||
|
|
||||||
$this->pos += $count;
|
$this->pos += $count;
|
||||||
|
|
||||||
return $read;
|
return $read;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +106,10 @@ class soapNtlm {
|
|||||||
* @param int $count number of bytes to read
|
* @param int $count number of bytes to read
|
||||||
* @return content from pos to count
|
* @return content from pos to count
|
||||||
*/
|
*/
|
||||||
public function stream_write($data) {
|
public function stream_write ($data)
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_write] <br>";
|
//echo "[NTLMStream::stream_write] <br>";
|
||||||
if (strlen($this->buffer) == 0) {
|
if (strlen( $this->buffer ) == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -120,21 +119,23 @@ class soapNtlm {
|
|||||||
*
|
*
|
||||||
* @return true if eof else false
|
* @return true if eof else false
|
||||||
*/
|
*/
|
||||||
public function stream_eof() {
|
public function stream_eof ()
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_eof] ";
|
//echo "[NTLMStream::stream_eof] ";
|
||||||
if ($this->pos > strlen($this->buffer)) {
|
if ($this->pos > strlen( $this->buffer )) {
|
||||||
//echo "true <br>";
|
//echo "true <br>";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo "false <br>";
|
//echo "false <br>";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return int the position of the current read pointer
|
* @return int the position of the current read pointer
|
||||||
*/
|
*/
|
||||||
public function stream_tell() {
|
public function stream_tell ()
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_tell] <br>";
|
//echo "[NTLMStream::stream_tell] <br>";
|
||||||
return $this->pos;
|
return $this->pos;
|
||||||
}
|
}
|
||||||
@@ -142,7 +143,8 @@ class soapNtlm {
|
|||||||
/**
|
/**
|
||||||
* Flush stream data
|
* Flush stream data
|
||||||
*/
|
*/
|
||||||
public function stream_flush() {
|
public function stream_flush ()
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_flush] <br>";
|
//echo "[NTLMStream::stream_flush] <br>";
|
||||||
$this->buffer = null;
|
$this->buffer = null;
|
||||||
$this->pos = null;
|
$this->pos = null;
|
||||||
@@ -153,14 +155,11 @@ class soapNtlm {
|
|||||||
*
|
*
|
||||||
* @return array stat information
|
* @return array stat information
|
||||||
*/
|
*/
|
||||||
public function stream_stat() {
|
public function stream_stat ()
|
||||||
|
{
|
||||||
//echo "[NTLMStream::stream_stat] <br>";
|
//echo "[NTLMStream::stream_stat] <br>";
|
||||||
|
$this->createBuffer( $this->path );
|
||||||
$this->createBuffer($this->path);
|
$stat = array ('size' => strlen( $this->buffer ));
|
||||||
$stat = array(
|
|
||||||
'size' => strlen($this->buffer),
|
|
||||||
);
|
|
||||||
|
|
||||||
return $stat;
|
return $stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,14 +168,12 @@ class soapNtlm {
|
|||||||
*
|
*
|
||||||
* @return array stat information
|
* @return array stat information
|
||||||
*/
|
*/
|
||||||
public function url_stat($path, $flags) {
|
public function url_stat ($path, $flags)
|
||||||
|
{
|
||||||
//G::pr($this->options);
|
//G::pr($this->options);
|
||||||
//echo "[NTLMStream::url_stat] -> $path <br>";
|
//echo "[NTLMStream::url_stat] -> $path <br>";
|
||||||
$this->createBuffer($path);
|
$this->createBuffer( $path );
|
||||||
$stat = array(
|
$stat = array ('size' => strlen( $this->buffer ));
|
||||||
'size' => strlen($this->buffer),
|
|
||||||
);
|
|
||||||
|
|
||||||
return $stat;
|
return $stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,124 +182,118 @@ class soapNtlm {
|
|||||||
*
|
*
|
||||||
* @param unknown_type $path
|
* @param unknown_type $path
|
||||||
*/
|
*/
|
||||||
private function createBuffer($path) {
|
private function createBuffer ($path)
|
||||||
|
{
|
||||||
if ($this->buffer) {
|
if ($this->buffer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo "[NTLMStream::createBuffer] create buffer from : $path <br>";
|
//echo "[NTLMStream::createBuffer] create buffer from : $path <br>";
|
||||||
$this->ch = curl_init($path);
|
$this->ch = curl_init( $path );
|
||||||
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt( $this->ch, CURLOPT_RETURNTRANSFER, true );
|
||||||
curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
curl_setopt( $this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
|
||||||
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
|
curl_setopt( $this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM );
|
||||||
//curl_setopt($this->ch, CURLOPT_USERPWD, $this->options['auth']); // Hugo's code
|
//curl_setopt($this->ch, CURLOPT_USERPWD, $this->options['auth']); // Hugo's code
|
||||||
curl_setopt($this->ch, CURLOPT_USERPWD, $this->getuser().':'.$this->getpassword());// Ankit's code
|
curl_setopt( $this->ch, CURLOPT_USERPWD, $this->getuser() . ':' . $this->getpassword() ); // Ankit's code
|
||||||
|
|
||||||
//Apply proxy settings
|
//Apply proxy settings
|
||||||
if (class_exists('System')) {
|
if (class_exists( 'System' )) {
|
||||||
$sysConf = System::getSystemConfiguration();
|
$sysConf = System::getSystemConfiguration();
|
||||||
if ($sysConf['proxy_host'] != '') {
|
if ($sysConf['proxy_host'] != '') {
|
||||||
curl_setopt($this->ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
curl_setopt( $this->ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : '') );
|
||||||
if ($sysConf['proxy_port'] != '') {
|
if ($sysConf['proxy_port'] != '') {
|
||||||
curl_setopt($this->ch, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
curl_setopt( $this->ch, CURLOPT_PROXYPORT, $sysConf['proxy_port'] );
|
||||||
}
|
}
|
||||||
if ($sysConf['proxy_user'] != '') {
|
if ($sysConf['proxy_user'] != '') {
|
||||||
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
curl_setopt( $this->ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
|
||||||
}
|
}
|
||||||
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Expect:'));
|
curl_setopt( $this->ch, CURLOPT_HTTPHEADER, array ('Expect:') );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo $this->buffer = curl_exec( $this->ch );
|
||||||
echo $this->buffer = curl_exec($this->ch);
|
|
||||||
|
|
||||||
//echo "[NTLMStream::createBuffer] buffer size : " . strlen($this->buffer) . "bytes<br>";
|
//echo "[NTLMStream::createBuffer] buffer size : " . strlen($this->buffer) . "bytes<br>";
|
||||||
$this->pos = 0;
|
$this->pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class NTLMSoapClient extends SoapClient {
|
class NTLMSoapClient extends SoapClient
|
||||||
|
{
|
||||||
|
function __doRequest ($request, $location, $action, $version)
|
||||||
function __doRequest($request, $location, $action, $version) {
|
{
|
||||||
$headers = array(
|
$headers = array ('Method: POST','Connection: Keep-Alive','User-Agent: PHP-SOAP-CURL','Content-Type: text/xml; charset=utf-8','SOAPAction: "' . $action . '"');
|
||||||
'Method: POST',
|
|
||||||
'Connection: Keep-Alive',
|
|
||||||
'User-Agent: PHP-SOAP-CURL',
|
|
||||||
'Content-Type: text/xml; charset=utf-8',
|
|
||||||
'SOAPAction: "' . $action . '"',
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->__last_request_headers = $headers;
|
$this->__last_request_headers = $headers;
|
||||||
$ch = curl_init($location);
|
$ch = curl_init( $location );
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt( $ch, CURLOPT_POST, true );
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
|
curl_setopt( $ch, CURLOPT_POSTFIELDS, $request );
|
||||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
curl_setopt( $ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
|
||||||
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
|
curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM );
|
||||||
//curl_setopt($ch, CURLOPT_USERPWD, $this->options['auth']); //Hugo's Code
|
//curl_setopt($ch, CURLOPT_USERPWD, $this->options['auth']); //Hugo's Code
|
||||||
curl_setopt($ch, CURLOPT_USERPWD, $this->user.':'.$this->password); //Ankit's Code
|
curl_setopt( $ch, CURLOPT_USERPWD, $this->user . ':' . $this->password ); //Ankit's Code
|
||||||
|
|
||||||
//Apply proxy settings
|
//Apply proxy settings
|
||||||
if (class_exists('System')) {
|
if (class_exists( 'System' )) {
|
||||||
$sysConf = System::getSystemConfiguration();
|
$sysConf = System::getSystemConfiguration();
|
||||||
if ($sysConf['proxy_host'] != '') {
|
if ($sysConf['proxy_host'] != '') {
|
||||||
curl_setopt($ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
|
curl_setopt( $ch, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : '') );
|
||||||
if ($sysConf['proxy_port'] != '') {
|
if ($sysConf['proxy_port'] != '') {
|
||||||
curl_setopt($ch, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
|
curl_setopt( $ch, CURLOPT_PROXYPORT, $sysConf['proxy_port'] );
|
||||||
}
|
}
|
||||||
if ($sysConf['proxy_user'] != '') {
|
if ($sysConf['proxy_user'] != '') {
|
||||||
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
|
curl_setopt( $ch, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : '') );
|
||||||
}
|
}
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
|
curl_setopt( $ch, CURLOPT_HTTPHEADER, array ('Expect:'
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$response = curl_exec( $ch );
|
||||||
$response = curl_exec($ch);
|
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
function __getLastRequestHeaders() {
|
function __getLastRequestHeaders ()
|
||||||
return implode("\n", $this->__last_request_headers) . "\n";
|
{
|
||||||
|
return implode( "\n", $this->__last_request_headers ) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PMServiceNTLMSoapClient extends NTLMSoapClient {
|
class PMServiceNTLMSoapClient extends NTLMSoapClient
|
||||||
|
{
|
||||||
protected $user;
|
protected $user;
|
||||||
protected $password;
|
protected $password;
|
||||||
|
|
||||||
function setAuthClient($auth){
|
function setAuthClient ($auth)
|
||||||
$authInfo=explode(":",$auth);
|
{
|
||||||
$this->user=$authInfo[0];
|
$authInfo = explode( ":", $auth );
|
||||||
$this->password=$authInfo[1];
|
$this->user = $authInfo[0];
|
||||||
|
$this->password = $authInfo[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PMServiceProviderNTLMStream extends soapNtlm {
|
class PMServiceProviderNTLMStream extends soapNtlm
|
||||||
|
{
|
||||||
protected static $user ;
|
protected static $user;
|
||||||
protected static $password;
|
protected static $password;
|
||||||
|
|
||||||
|
public function getuser ()
|
||||||
public function getuser()
|
|
||||||
{
|
{
|
||||||
return self::$user;
|
return self::$user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getpassword()
|
public function getpassword ()
|
||||||
{
|
{
|
||||||
return self::$password;
|
return self::$password;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function setAuthStream($auth){
|
static function setAuthStream ($auth)
|
||||||
$authInfo=explode(":",$auth);
|
{
|
||||||
self::$user=$authInfo[0];
|
$authInfo = explode( ":", $auth );
|
||||||
self::$password=$authInfo[1];
|
self::$user = $authInfo[0];
|
||||||
|
self::$password = $authInfo[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
794
gulliver/system/class.table.php
Executable file → Normal file
794
gulliver/system/class.table.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -3101,7 +3101,7 @@ class XmlForm_Field_RadioGroup extends XmlForm_Field {
|
|||||||
if( isset($this->linkType) && ($this->linkType == 1 || $this->linkType == "1") ){
|
if( isset($this->linkType) && ($this->linkType == 1 || $this->linkType == "1") ){
|
||||||
$html .= '<input id="form['.$this->name.']['.$optionName.']" name="form['.$this->name.']" type="radio" value="'.$optionName.'" '.(($optionName==$value) ? ' checked' : '') . '><a href="#" onclick="executeEvent(\'form['.$this->name.']['.$optionName.']\', \'click\'); return false;">' . $option . '</a></input>';
|
$html .= '<input id="form['.$this->name.']['.$optionName.']" name="form['.$this->name.']" type="radio" value="'.$optionName.'" '.(($optionName==$value) ? ' checked' : '') . '><a href="#" onclick="executeEvent(\'form['.$this->name.']['.$optionName.']\', \'click\'); return false;">' . $option . '</a></input>';
|
||||||
} else {
|
} else {
|
||||||
$html .= '<input id="form['.$this->name.']['.$optionName.']" name="form['.$this->name.']" type="radio" value="'.$optionName.'" '.(($optionName==$value) ? ' checked' : '') . '>' . $option . '</input>';
|
$html .= '<input id="form['.$this->name.']['.$optionName.']" name="form['.$this->name.']" type="radio" value="'.$optionName.'" '.(($optionName==$value) ? ' checked' : '') . '><label for="form[' . $this->name . '][' . $optionName . ']">' . $option . '</label></input>';
|
||||||
}
|
}
|
||||||
if(++$i==count($this->options)){
|
if(++$i==count($this->options)){
|
||||||
$html .= ' '.$this->renderHint();
|
$html .= ' '.$this->renderHint();
|
||||||
@@ -3117,7 +3117,7 @@ class XmlForm_Field_RadioGroup extends XmlForm_Field {
|
|||||||
} elseif ($this->mode === 'view') {
|
} elseif ($this->mode === 'view') {
|
||||||
$html = '';
|
$html = '';
|
||||||
foreach ( $this->options as $optionName => $option ) {
|
foreach ( $this->options as $optionName => $option ) {
|
||||||
$html .= '<input class="module_app_input___gray" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . ']" type=\'radio\' value="' . $optionName . '" ' . (($optionName == $value) ? 'checked' : '') . ' disabled><span class="FormCheck">' . $option . '</span></input><br>';
|
$html .= '<input class="module_app_input___gray" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . ']" type=\'radio\' value="' . $optionName . '" ' . (($optionName == $value) ? 'checked' : '') . ' disabled><span class="FormCheck"><label for="form[' . $this->name . '][' . $optionName . ']">' . $option . '</label></span></input><br>';
|
||||||
if($optionName == $value)
|
if($optionName == $value)
|
||||||
$html .= '<input type="hidden" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . ']" value="' . (($optionName == $value) ? $optionName : '') . '">';
|
$html .= '<input type="hidden" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . ']" value="' . (($optionName == $value) ? $optionName : '') . '">';
|
||||||
}
|
}
|
||||||
@@ -3198,7 +3198,7 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field
|
|||||||
$i=0;
|
$i=0;
|
||||||
$html = '';
|
$html = '';
|
||||||
foreach ( $this->options as $optionName => $option ) {
|
foreach ( $this->options as $optionName => $option ) {
|
||||||
$html .= '<input id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" type=\'checkbox\' value="' . $optionName . '"' . (in_array ( $optionName, $value ) ? 'checked' : '') . '><span class="FormCheck">' . $option . '</span></input>';
|
$html .= '<input id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" type=\'checkbox\' value="' . $optionName . '"' . (in_array ( $optionName, $value ) ? 'checked' : '') . '><span class="FormCheck"><label for="form[' . $this->name . '][' . $optionName . ']">' . $option . '</label></span></input>';
|
||||||
if(++$i==count($this->options)){
|
if(++$i==count($this->options)){
|
||||||
$html .= ' '.$this->renderHint();
|
$html .= ' '.$this->renderHint();
|
||||||
}
|
}
|
||||||
@@ -3208,7 +3208,7 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field
|
|||||||
} elseif ($this->mode === 'view') {
|
} elseif ($this->mode === 'view') {
|
||||||
$html = '';
|
$html = '';
|
||||||
foreach ( $this->options as $optionName => $option ) {
|
foreach ( $this->options as $optionName => $option ) {
|
||||||
$html .= '<input class="FormCheck" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" type=\'checkbox\' value="' . $optionName . '"' . (in_array ( $optionName, $value ) ? 'checked' : '') . ' disabled><span class="FormCheck">' . $option . '</span></input><br>';
|
$html .= '<input class="FormCheck" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" type=\'checkbox\' value="' . $optionName . '"' . (in_array ( $optionName, $value ) ? 'checked' : '') . ' disabled><span class="FormCheck"><label for="form[' . $this->name . '][' . $optionName . ']">' . $option . '</label></span></input><br>';
|
||||||
$html .= '<input type="hidden" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" value="'.((in_array ( $optionName, $value )) ? $optionName : '').'">';
|
$html .= '<input type="hidden" id="form[' . $this->name . '][' . $optionName . ']" name="form[' . $this->name . '][]" value="'.((in_array ( $optionName, $value )) ? $optionName : '').'">';
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
@@ -4789,18 +4789,7 @@ class xmlformTemplate extends Smarty
|
|||||||
$value = (isset ( $form->values [$k] )) ? $form->values [$k] : NULL;
|
$value = (isset ( $form->values [$k] )) ? $form->values [$k] : NULL;
|
||||||
$result [$k] = G::replaceDataField ( $form->fields [$k]->label, $form->values );
|
$result [$k] = G::replaceDataField ( $form->fields [$k]->label, $form->values );
|
||||||
if ($form->type == 'xmlform') {
|
if ($form->type == 'xmlform') {
|
||||||
if ($v->type == 'checkgroup' || $v->type == 'radiogroup') {
|
if ($v->type != 'checkgroup' && $v->type != 'radiogroup') {
|
||||||
$firstValueOptions = '';
|
|
||||||
foreach ($v->options as $indexOption => $valueOptions) {
|
|
||||||
$firstValueOptions = $indexOption;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ($firstValueOptions != '') {
|
|
||||||
$result[$k] = '<label for="form[' . $k . '][' . $firstValueOptions . ']">' . $result[$k] . '</label>';
|
|
||||||
} else {
|
|
||||||
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
|
$result[$k] = '<label for="form[' . $k . ']">' . $result[$k] . '</label>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,13 @@
|
|||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
processIsolation="false"
|
processIsolation="false"
|
||||||
stopOnFailure="false"
|
stopOnFailure="true"
|
||||||
syntaxCheck="false"
|
syntaxCheck="true"
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="automated">
|
<testsuite name="automated">
|
||||||
<directory>./tests/automated/</directory>
|
<directory>./tests/automated/</directory>
|
||||||
<directory>./tests/unit/backend/services/</directory>
|
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<!--
|
<!--
|
||||||
<testsuite name="unit">
|
<testsuite name="unit">
|
||||||
@@ -48,10 +47,6 @@
|
|||||||
</php>
|
</php>
|
||||||
|
|
||||||
<logging>
|
<logging>
|
||||||
<log type="coverage-html" target="build/coverage" title="ERC"
|
|
||||||
charset="UTF-8" yui="true" highlight="true"
|
|
||||||
lowUpperBound="10" highLowerBound="20"/>
|
|
||||||
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
|
||||||
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
|
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
|
||||||
</logging>
|
</logging>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@@ -1,860 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
|
|
||||||
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
|
|
||||||
require_once PATH_TRUNK . 'workflow/engine/classes/class.xpdl.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:31.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class classXpdlTest extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var Xpdl
|
|
||||||
*/
|
|
||||||
protected $object;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets up the fixture, for example, opens a network connection.
|
|
||||||
* This method is called before a test is executed.
|
|
||||||
*/
|
|
||||||
protected function setUp()
|
|
||||||
{
|
|
||||||
$this->object = new Xpdl();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tears down the fixture, for example, closes a network connection.
|
|
||||||
* This method is called after a test is executed.
|
|
||||||
*/
|
|
||||||
protected function tearDown()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the default method to test, if the class still having
|
|
||||||
* the same number of methods.
|
|
||||||
*/
|
|
||||||
public function testNumberOfMethodsInThisClass()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods('Xpdl'); $this->assertTrue( count($methods) == 185);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createProcessFromDataXpdl
|
|
||||||
* @todo Implement testcreateProcessFromDataXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateProcessFromDataXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createProcessFromDataXpdl', $methods ), 'exists method createProcessFromDataXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createProcessFromDataXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'oData');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::updateProcessFromDataXpdl
|
|
||||||
* @todo Implement testupdateProcessFromDataXpdl().
|
|
||||||
*/
|
|
||||||
public function testupdateProcessFromDataXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('updateProcessFromDataXpdl', $methods ), 'exists method updateProcessFromDataXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'updateProcessFromDataXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'oData');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createProcessFromDataPmxml
|
|
||||||
* @todo Implement testcreateProcessFromDataPmxml().
|
|
||||||
*/
|
|
||||||
public function testcreateProcessFromDataPmxml()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createProcessFromDataPmxml', $methods ), 'exists method createProcessFromDataPmxml' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createProcessFromDataPmxml');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'oData');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcessFromDataXpdl
|
|
||||||
* @todo Implement testcreateSubProcessFromDataXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcessFromDataXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcessFromDataXpdl', $methods ), 'exists method createSubProcessFromDataXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcessFromDataXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'oData');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::verifyTasks
|
|
||||||
* @todo Implement testverifyTasks().
|
|
||||||
*/
|
|
||||||
public function testverifyTasks()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('verifyTasks', $methods ), 'exists method verifyTasks' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'verifyTasks');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'sProUid');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'fieldsTasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createRouteRowsXpdl
|
|
||||||
* @todo Implement testcreateRouteRowsXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateRouteRowsXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createRouteRowsXpdl', $methods ), 'exists method createRouteRowsXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createRouteRowsXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'sProUid');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'routes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'fieldsTasks');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcessRowsXpdl
|
|
||||||
* @todo Implement testcreateSubProcessRowsXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcessRowsXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcessRowsXpdl', $methods ), 'exists method createSubProcessRowsXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcessRowsXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'sProUid');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'SubProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::findIdTask
|
|
||||||
* @todo Implement testfindIdTask().
|
|
||||||
*/
|
|
||||||
public function testfindIdTask()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('findIdTask', $methods ), 'exists method findIdTask' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'findIdTask');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'idTask');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'routes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::xmdlProcess
|
|
||||||
* @todo Implement testxmdlProcess().
|
|
||||||
*/
|
|
||||||
public function testxmdlProcess()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('xmdlProcess', $methods ), 'exists method xmdlProcess' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'xmdlProcess');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'sProUid');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == true);
|
|
||||||
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createPool
|
|
||||||
* @todo Implement testcreatePool().
|
|
||||||
*/
|
|
||||||
public function testcreatePool()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createPool', $methods ), 'exists method createPool' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createPool');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'process');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'coordinateMaximumX');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'coordinateMaximumY');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createArtifacts
|
|
||||||
* @todo Implement testcreateArtifacts().
|
|
||||||
*/
|
|
||||||
public function testcreateArtifacts()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createArtifacts', $methods ), 'exists method createArtifacts' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createArtifacts');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'lanes');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'id');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcessesXpdl
|
|
||||||
* @todo Implement testcreateSubProcessesXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcessesXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcessesXpdl', $methods ), 'exists method createSubProcessesXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcessesXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'subProcess');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createActivitiesXpdl
|
|
||||||
* @todo Implement testcreateActivitiesXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateActivitiesXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createActivitiesXpdl', $methods ), 'exists method createActivitiesXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createActivitiesXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'events');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'scheduler');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createTransitionsXpdl
|
|
||||||
* @todo Implement testcreateTransitionsXpdl().
|
|
||||||
*/
|
|
||||||
public function testcreateTransitionsXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createTransitionsXpdl', $methods ), 'exists method createTransitionsXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createTransitionsXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'routes');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'taskHidden');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::getProcessDataXpdl
|
|
||||||
* @todo Implement testgetProcessDataXpdl().
|
|
||||||
*/
|
|
||||||
public function testgetProcessDataXpdl()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('getProcessDataXpdl', $methods ), 'exists method getProcessDataXpdl' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'getProcessDataXpdl');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'pmFilename');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::sortArray
|
|
||||||
* @todo Implement testsortArray().
|
|
||||||
*/
|
|
||||||
public function testsortArray()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('sortArray', $methods ), 'exists method sortArray' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'sortArray');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::verifyRoutes
|
|
||||||
* @todo Implement testverifyRoutes().
|
|
||||||
*/
|
|
||||||
public function testverifyRoutes()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('verifyRoutes', $methods ), 'exists method verifyRoutes' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'verifyRoutes');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'routeTransitions');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'endArray');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'taskHidden');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createProcess
|
|
||||||
* @todo Implement testcreateProcess().
|
|
||||||
*/
|
|
||||||
public function testcreateProcess()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createProcess', $methods ), 'exists method createProcess' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createProcess');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcesses
|
|
||||||
* @todo Implement testcreateSubProcesses().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcesses()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcesses', $methods ), 'exists method createSubProcesses' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcesses');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'arrayLanes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createTask
|
|
||||||
* @todo Implement testcreateTask().
|
|
||||||
*/
|
|
||||||
public function testcreateTask()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createTask', $methods ), 'exists method createTask' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createTask');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createDataTask
|
|
||||||
* @todo Implement testcreateDataTask().
|
|
||||||
*/
|
|
||||||
public function testcreateDataTask()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createDataTask', $methods ), 'exists method createDataTask' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createDataTask');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createRoute
|
|
||||||
* @todo Implement testcreateRoute().
|
|
||||||
*/
|
|
||||||
public function testcreateRoute()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createRoute', $methods ), 'exists method createRoute' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createRoute');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcess
|
|
||||||
* @todo Implement testcreateSubProcess().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcess()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcess', $methods ), 'exists method createSubProcess' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcess');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createGateways
|
|
||||||
* @todo Implement testcreateGateways().
|
|
||||||
*/
|
|
||||||
public function testcreateGateways()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createGateways', $methods ), 'exists method createGateways' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createGateways');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'routeTransitions');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'endArray');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'dataRoutes');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[3]->getName() == 'numberRoutes');
|
|
||||||
$this->assertTrue( $params[3]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[3]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[4]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[4]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[4]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[5]->getName() == 'taskHidden');
|
|
||||||
$this->assertTrue( $params[5]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[5]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createLanesPM
|
|
||||||
* @todo Implement testcreateLanesPM().
|
|
||||||
*/
|
|
||||||
public function testcreateLanesPM()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createLanesPM', $methods ), 'exists method createLanesPM' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createLanesPM');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createLanes
|
|
||||||
* @todo Implement testcreateLanes().
|
|
||||||
*/
|
|
||||||
public function testcreateLanes()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createLanes', $methods ), 'exists method createLanes' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createLanes');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'lanes');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createLanesNewPM
|
|
||||||
* @todo Implement testcreateLanesNewPM().
|
|
||||||
*/
|
|
||||||
public function testcreateLanesNewPM()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createLanesNewPM', $methods ), 'exists method createLanesNewPM' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createLanesNewPM');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createActivities
|
|
||||||
* @todo Implement testcreateActivities().
|
|
||||||
*/
|
|
||||||
public function testcreateActivities()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createActivities', $methods ), 'exists method createActivities' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createActivities');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'activitySet');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createEventMessages
|
|
||||||
* @todo Implement testcreateEventMessages().
|
|
||||||
*/
|
|
||||||
public function testcreateEventMessages()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createEventMessages', $methods ), 'exists method createEventMessages' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createEventMessages');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createScheduler
|
|
||||||
* @todo Implement testcreateScheduler().
|
|
||||||
*/
|
|
||||||
public function testcreateScheduler()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createScheduler', $methods ), 'exists method createScheduler' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createScheduler');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::calculateTimeScheduler
|
|
||||||
* @todo Implement testcalculateTimeScheduler().
|
|
||||||
*/
|
|
||||||
public function testcalculateTimeScheduler()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('calculateTimeScheduler', $methods ), 'exists method calculateTimeScheduler' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'calculateTimeScheduler');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'time');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createArrayScheduler
|
|
||||||
* @todo Implement testcreateArrayScheduler().
|
|
||||||
*/
|
|
||||||
public function testcreateArrayScheduler()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createArrayScheduler', $methods ), 'exists method createArrayScheduler' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createArrayScheduler');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'fields');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createTransitions
|
|
||||||
* @todo Implement testcreateTransitions().
|
|
||||||
*/
|
|
||||||
public function testcreateTransitions()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createTransitions', $methods ), 'exists method createTransitions' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createTransitions');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'dataTasks');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'arrayRoutes');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[3]->getName() == 'endArray');
|
|
||||||
$this->assertTrue( $params[3]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[3]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[4]->getName() == 'startArray');
|
|
||||||
$this->assertTrue( $params[4]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[4]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[5]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[5]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[5]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[6]->getName() == 'schedulerArray');
|
|
||||||
$this->assertTrue( $params[6]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[6]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[7]->getName() == 'messages');
|
|
||||||
$this->assertTrue( $params[7]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[7]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createActivity
|
|
||||||
* @todo Implement testcreateActivity().
|
|
||||||
*/
|
|
||||||
public function testcreateActivity()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createActivity', $methods ), 'exists method createActivity' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createActivity');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createExtended
|
|
||||||
* @todo Implement testcreateExtended().
|
|
||||||
*/
|
|
||||||
public function testcreateExtended()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createExtended', $methods ), 'exists method createExtended' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createExtended');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::findCoordinates
|
|
||||||
* @todo Implement testfindCoordinates().
|
|
||||||
*/
|
|
||||||
public function testfindCoordinates()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('findCoordinates', $methods ), 'exists method findCoordinates' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'findCoordinates');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'contentNode');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::findCoordinatesTransition
|
|
||||||
* @todo Implement testfindCoordinatesTransition().
|
|
||||||
*/
|
|
||||||
public function testfindCoordinatesTransition()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('findCoordinatesTransition', $methods ), 'exists method findCoordinatesTransition' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'findCoordinatesTransition');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'idRoute');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'aRoutes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createArrayRoutes
|
|
||||||
* @todo Implement testcreateArrayRoutes().
|
|
||||||
*/
|
|
||||||
public function testcreateArrayRoutes()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createArrayRoutes', $methods ), 'exists method createArrayRoutes' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createArrayRoutes');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'dataTasks');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'arrayRoutes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'aEvents');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[3]->getName() == 'aGateways');
|
|
||||||
$this->assertTrue( $params[3]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[3]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[4]->getName() == 'aEnd');
|
|
||||||
$this->assertTrue( $params[4]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[4]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[5]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[5]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[5]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::convertArrayEnd
|
|
||||||
* @todo Implement testconvertArrayEnd().
|
|
||||||
*/
|
|
||||||
public function testconvertArrayEnd()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('convertArrayEnd', $methods ), 'exists method convertArrayEnd' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'convertArrayEnd');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'aEvents');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'idProcess');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createTransitionsPM
|
|
||||||
* @todo Implement testcreateTransitionsPM().
|
|
||||||
*/
|
|
||||||
public function testcreateTransitionsPM()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createTransitionsPM', $methods ), 'exists method createTransitionsPM' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createTransitionsPM');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'tasks');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[1]->getName() == 'routes');
|
|
||||||
$this->assertTrue( $params[1]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[1]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[2]->getName() == 'events');
|
|
||||||
$this->assertTrue( $params[2]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[2]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[3]->getName() == 'countEvents');
|
|
||||||
$this->assertTrue( $params[3]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[3]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[4]->getName() == 'arrayRoutes');
|
|
||||||
$this->assertTrue( $params[4]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[4]->isOptional () == false);
|
|
||||||
$this->assertTrue( $params[5]->getName() == 'countRoutes');
|
|
||||||
$this->assertTrue( $params[5]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[5]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::super_unique
|
|
||||||
* @todo Implement testsuper_unique().
|
|
||||||
*/
|
|
||||||
public function testsuper_unique()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('super_unique', $methods ), 'exists method super_unique' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'super_unique');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createProcessPM
|
|
||||||
* @todo Implement testcreateProcessPM().
|
|
||||||
*/
|
|
||||||
public function testcreateProcessPM()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createProcessPM', $methods ), 'exists method createProcessPM' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createProcessPM');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::createSubProcessesPM
|
|
||||||
* @todo Implement testcreateSubProcessesPM().
|
|
||||||
*/
|
|
||||||
public function testcreateSubProcessesPM()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('createSubProcessesPM', $methods ), 'exists method createSubProcessesPM' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'createSubProcessesPM');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Xpdl::saveWebEntry
|
|
||||||
* @todo Implement testsaveWebEntry().
|
|
||||||
*/
|
|
||||||
public function testsaveWebEntry()
|
|
||||||
{
|
|
||||||
$methods = get_class_methods($this->object);
|
|
||||||
$this->assertTrue( in_array('saveWebEntry', $methods ), 'exists method saveWebEntry' );
|
|
||||||
$r = new ReflectionMethod('Xpdl', 'saveWebEntry');
|
|
||||||
$params = $r->getParameters();
|
|
||||||
$this->assertTrue( $params[0]->getName() == 'array');
|
|
||||||
$this->assertTrue( $params[0]->isArray() == false);
|
|
||||||
$this->assertTrue( $params[0]->isOptional () == false);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -220,6 +220,8 @@ class processMap
|
|||||||
if ($aRow3) {
|
if ($aRow3) {
|
||||||
$aRow2['FINISH'] = '';
|
$aRow2['FINISH'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) {
|
if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) {
|
||||||
$oTask->color = '#FF0000';
|
$oTask->color = '#FF0000';
|
||||||
} else {
|
} else {
|
||||||
@@ -234,6 +236,21 @@ class processMap
|
|||||||
$oTask->color = "#939598";
|
$oTask->color = "#939598";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (empty($aRow2["FINISH"]) && $aRow1["TAS_UID"] == $sTask) {
|
||||||
|
$oTask->color = "#FF0000"; //Red
|
||||||
|
} else {
|
||||||
|
if (!empty($aRow2["FINISH"])) {
|
||||||
|
$oTask->color = "#006633"; //Green
|
||||||
|
} else {
|
||||||
|
if ($aRow2["CANT"] == 0 || $oTask->derivation->type != 5) {
|
||||||
|
$oTask->color = "#939598"; //Gray
|
||||||
|
} else {
|
||||||
|
//$oTask->color = "#FF9900"; //Yellow
|
||||||
|
$oTask->color = "#FF0000"; //Red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($bView && ($sApplicationUID != '') && ($iDelegation > 0) && ($sTask != '')) {
|
if ($bView && ($sApplicationUID != '') && ($iDelegation > 0) && ($sTask != '')) {
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
@@ -257,6 +274,8 @@ class processMap
|
|||||||
if ($aRow3) {
|
if ($aRow3) {
|
||||||
$aRow2['FINISH'] = '';
|
$aRow2['FINISH'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) {
|
if (($aRow2['FINISH'] == null) && ($aRow1['TAS_UID'] == $sTask)) {
|
||||||
$oTask->color = '#FF0000';
|
$oTask->color = '#FF0000';
|
||||||
} else {
|
} else {
|
||||||
@@ -270,6 +289,20 @@ class processMap
|
|||||||
$oTask->color = '#939598';
|
$oTask->color = '#939598';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (empty($aRow2["FINISH"]) && $aRow1["TAS_UID"] == $sTask) {
|
||||||
|
$oTask->color = "#FF0000"; //Red
|
||||||
|
} else {
|
||||||
|
if (!empty($aRow2["FINISH"])) {
|
||||||
|
$oTask->color = "#006633"; //Green
|
||||||
|
} else {
|
||||||
|
if ($aRow2["CANT"] == 0 || $oTask->derivation->type != 5) {
|
||||||
|
$oTask->color = "#939598"; //Gray
|
||||||
|
} else {
|
||||||
|
$oTask->color = "#FF9900"; //Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -203,7 +203,7 @@ if($limit != 0){
|
|||||||
return $folderArray;
|
return $folderArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL, $limit=0, $start=0, $user='') {
|
function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL, $limit=0, $start=0, $user='', $onlyActive=false) {
|
||||||
require_once ("classes/model/AppDocument.php");
|
require_once ("classes/model/AppDocument.php");
|
||||||
require_once ("classes/model/InputDocument.php");
|
require_once ("classes/model/InputDocument.php");
|
||||||
require_once ("classes/model/OutputDocument.php");
|
require_once ("classes/model/OutputDocument.php");
|
||||||
@@ -253,6 +253,9 @@ if($limit != 0){
|
|||||||
}
|
}
|
||||||
$oCriteria->add ( AppDocumentPeer::APP_UID, $data, CRITERIA::IN );
|
$oCriteria->add ( AppDocumentPeer::APP_UID, $data, CRITERIA::IN );
|
||||||
}
|
}
|
||||||
|
if ($onlyActive){
|
||||||
|
$oCriteria->add(AppDocumentPeer::APP_DOC_STATUS, 'ACTIVE');
|
||||||
|
}
|
||||||
|
|
||||||
$oCase->verifyTable ();
|
$oCase->verifyTable ();
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* AppSpool.php
|
|
||||||
* @package workflow.engine.classes.model
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'classes/model/om/BaseAppSpool.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Skeleton subclass for representing a row from the 'APP_SPOOL' table.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* You should add additional methods to this class to meet the
|
|
||||||
* application requirements. This class will only be generated as
|
|
||||||
* long as it does not already exist in the output directory.
|
|
||||||
*
|
|
||||||
* @package workflow.engine.classes.model
|
|
||||||
*/
|
|
||||||
class AppSpool extends BaseAppSpool {
|
|
||||||
|
|
||||||
} // AppSpool
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* AppSpoolPeer.php
|
|
||||||
* @package workflow.engine.classes.model
|
|
||||||
*/
|
|
||||||
|
|
||||||
// include base peer class
|
|
||||||
require_once 'classes/model/om/BaseAppSpoolPeer.php';
|
|
||||||
|
|
||||||
// include object class
|
|
||||||
include_once 'classes/model/AppSpool.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Skeleton subclass for performing query and update operations on the 'APP_SPOOL' table.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* You should add additional methods to this class to meet the
|
|
||||||
* application requirements. This class will only be generated as
|
|
||||||
* long as it does not already exist in the output directory.
|
|
||||||
*
|
|
||||||
* @package workflow.engine.classes.model
|
|
||||||
*/
|
|
||||||
class AppSpoolPeer extends BaseAppSpoolPeer {
|
|
||||||
|
|
||||||
} // AppSpoolPeer
|
|
||||||
@@ -454,11 +454,11 @@ class Process extends BaseProcess {
|
|||||||
$this->setProAssignment ( $aData['PRO_ASSIGNMENT'] );
|
$this->setProAssignment ( $aData['PRO_ASSIGNMENT'] );
|
||||||
$this->setProShowMap ( $aData['PRO_SHOW_MAP'] );
|
$this->setProShowMap ( $aData['PRO_SHOW_MAP'] );
|
||||||
$this->setProShowMessage ( $aData['PRO_SHOW_MESSAGE'] );
|
$this->setProShowMessage ( $aData['PRO_SHOW_MESSAGE'] );
|
||||||
$this->setProSubprocess ( $aData['PRO_SUBPROCESS'] );
|
$this->setProSubprocess ( isset($aData['PRO_SUBPROCESS']) ? $aData['PRO_SUBPROCESS'] : '' );
|
||||||
$this->setProTriDeleted ( $aData['PRO_TRI_DELETED'] );
|
$this->setProTriDeleted ( isset($aData['PRO_TRI_DELETED']) ? $aData['PRO_TRI_DELETED'] : '' );
|
||||||
$this->setProTriCanceled ( $aData['PRO_TRI_CANCELED'] );
|
$this->setProTriCanceled ( isset($aData['PRO_TRI_CANCELED']) ? $aData['PRO_TRI_CANCELED'] : '' );
|
||||||
$this->setProTriPaused ( $aData['PRO_TRI_PAUSED'] );
|
$this->setProTriPaused ( isset($aData['PRO_TRI_PAUSED']) ? $aData['PRO_TRI_PAUSED'] : '' );
|
||||||
$this->setProTriReassigned( $aData['PRO_TRI_REASSIGNED'] );
|
$this->setProTriReassigned( isset($aData['PRO_TRI_REASSIGNED']) ? $aData['PRO_TRI_REASSIGNED'] : '' );
|
||||||
$this->setProShowDelegate ( $aData['PRO_SHOW_DELEGATE'] );
|
$this->setProShowDelegate ( $aData['PRO_SHOW_DELEGATE'] );
|
||||||
$this->setProShowDynaform ( $aData['PRO_SHOW_DYNAFORM'] );
|
$this->setProShowDynaform ( $aData['PRO_SHOW_DYNAFORM'] );
|
||||||
|
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require_once 'propel/map/MapBuilder.php';
|
|
||||||
include_once 'creole/CreoleTypes.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class adds structure of 'APP_SPOOL' table to 'workflow' DatabaseMap object.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
|
||||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
|
||||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
|
||||||
* (i.e. if it's a text column type).
|
|
||||||
*
|
|
||||||
* @package classes.model.map
|
|
||||||
*/
|
|
||||||
class AppSpoolMapBuilder {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The (dot-path) name of this class
|
|
||||||
*/
|
|
||||||
const CLASS_NAME = 'classes.model.map.AppSpoolMapBuilder';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The database map.
|
|
||||||
*/
|
|
||||||
private $dbMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tells us if this DatabaseMapBuilder is built so that we
|
|
||||||
* don't have to re-build it every time.
|
|
||||||
*
|
|
||||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
|
||||||
*/
|
|
||||||
public function isBuilt()
|
|
||||||
{
|
|
||||||
return ($this->dbMap !== null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the databasemap this map builder built.
|
|
||||||
*
|
|
||||||
* @return the databasemap
|
|
||||||
*/
|
|
||||||
public function getDatabaseMap()
|
|
||||||
{
|
|
||||||
return $this->dbMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The doBuild() method builds the DatabaseMap
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @throws PropelException
|
|
||||||
*/
|
|
||||||
public function doBuild()
|
|
||||||
{
|
|
||||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
|
||||||
|
|
||||||
$tMap = $this->dbMap->addTable('APP_SPOOL');
|
|
||||||
$tMap->setPhpName('AppSpool');
|
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
|
||||||
|
|
||||||
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::SMALLINT, true, 6);
|
|
||||||
|
|
||||||
$tMap->addColumn('SENDER', 'Sender', 'string', CreoleTypes::VARCHAR, true, 96);
|
|
||||||
|
|
||||||
$tMap->addColumn('FILE', 'File', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
|
||||||
|
|
||||||
$tMap->addColumn('NOW', 'Now', 'string', CreoleTypes::VARCHAR, true, 16);
|
|
||||||
|
|
||||||
$tMap->addColumn('STATUS', 'Status', 'string', CreoleTypes::VARCHAR, true, 16);
|
|
||||||
|
|
||||||
} // doBuild()
|
|
||||||
|
|
||||||
} // AppSpoolMapBuilder
|
|
||||||
@@ -1,717 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* BaseAppSpool.php
|
|
||||||
* @package workflow.classes.model.om
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'propel/om/BaseObject.php';
|
|
||||||
require_once 'propel/om/Persistent.php';
|
|
||||||
|
|
||||||
include_once 'propel/util/Criteria.php';
|
|
||||||
include_once 'classes/model/AppSpoolPeer.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class that represents a row from the 'APP_SPOOL' table.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @package workflow.classes.model.om
|
|
||||||
*/
|
|
||||||
abstract class BaseAppSpool extends BaseObject implements Persistent {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Peer class.
|
|
||||||
* Instance provides a convenient way of calling static methods on a class
|
|
||||||
* that calling code may not be able to identify.
|
|
||||||
* @var AppSpoolPeer
|
|
||||||
*/
|
|
||||||
protected static $peer;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the id field.
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $id;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the sender field.
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $sender;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the file field.
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $file;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the now field.
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $now;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the status field.
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Flag to prevent endless save loop, if this object is referenced
|
|
||||||
* by another object which falls in this transaction.
|
|
||||||
* @var boolean
|
|
||||||
*/
|
|
||||||
protected $alreadyInSave = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Flag to prevent endless validation loop, if this object is referenced
|
|
||||||
* by another object which falls in this transaction.
|
|
||||||
* @var boolean
|
|
||||||
*/
|
|
||||||
protected $alreadyInValidation = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [id] column value.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getId()
|
|
||||||
{
|
|
||||||
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [sender] column value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getSender()
|
|
||||||
{
|
|
||||||
|
|
||||||
return $this->sender;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [file] column value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getFile()
|
|
||||||
{
|
|
||||||
|
|
||||||
return $this->file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [now] column value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getNow()
|
|
||||||
{
|
|
||||||
|
|
||||||
return $this->now;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [status] column value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getStatus()
|
|
||||||
{
|
|
||||||
|
|
||||||
return $this->status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [id] column.
|
|
||||||
*
|
|
||||||
* @param int $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setId($v)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Since the native PHP type for this column is integer,
|
|
||||||
// we will cast the input value to an int (if it is not).
|
|
||||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
|
||||||
$v = (int) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->id !== $v) {
|
|
||||||
$this->id = $v;
|
|
||||||
$this->modifiedColumns[] = AppSpoolPeer::ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // setId()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [sender] column.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setSender($v)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Since the native PHP type for this column is string,
|
|
||||||
// we will cast the input to a string (if it is not).
|
|
||||||
if ($v !== null && !is_string($v)) {
|
|
||||||
$v = (string) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->sender !== $v) {
|
|
||||||
$this->sender = $v;
|
|
||||||
$this->modifiedColumns[] = AppSpoolPeer::SENDER;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // setSender()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [file] column.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setFile($v)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Since the native PHP type for this column is string,
|
|
||||||
// we will cast the input to a string (if it is not).
|
|
||||||
if ($v !== null && !is_string($v)) {
|
|
||||||
$v = (string) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->file !== $v) {
|
|
||||||
$this->file = $v;
|
|
||||||
$this->modifiedColumns[] = AppSpoolPeer::FILE;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // setFile()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [now] column.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setNow($v)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Since the native PHP type for this column is string,
|
|
||||||
// we will cast the input to a string (if it is not).
|
|
||||||
if ($v !== null && !is_string($v)) {
|
|
||||||
$v = (string) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->now !== $v) {
|
|
||||||
$this->now = $v;
|
|
||||||
$this->modifiedColumns[] = AppSpoolPeer::NOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // setNow()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [status] column.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setStatus($v)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Since the native PHP type for this column is string,
|
|
||||||
// we will cast the input to a string (if it is not).
|
|
||||||
if ($v !== null && !is_string($v)) {
|
|
||||||
$v = (string) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->status !== $v) {
|
|
||||||
$this->status = $v;
|
|
||||||
$this->modifiedColumns[] = AppSpoolPeer::STATUS;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // setStatus()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hydrates (populates) the object variables with values from the database resultset.
|
|
||||||
*
|
|
||||||
* An offset (1-based "start column") is specified so that objects can be hydrated
|
|
||||||
* with a subset of the columns in the resultset rows. This is needed, for example,
|
|
||||||
* for results of JOIN queries where the resultset row includes columns from two or
|
|
||||||
* more tables.
|
|
||||||
*
|
|
||||||
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
|
|
||||||
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
|
|
||||||
* @return int next starting column
|
|
||||||
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
|
|
||||||
*/
|
|
||||||
public function hydrate(ResultSet $rs, $startcol = 1)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
$this->id = $rs->getInt($startcol + 0);
|
|
||||||
|
|
||||||
$this->sender = $rs->getString($startcol + 1);
|
|
||||||
|
|
||||||
$this->file = $rs->getString($startcol + 2);
|
|
||||||
|
|
||||||
$this->now = $rs->getString($startcol + 3);
|
|
||||||
|
|
||||||
$this->status = $rs->getString($startcol + 4);
|
|
||||||
|
|
||||||
$this->resetModified();
|
|
||||||
|
|
||||||
$this->setNew(false);
|
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
|
||||||
return $startcol + 5; // 5 = AppSpoolPeer::NUM_COLUMNS - AppSpoolPeer::NUM_LAZY_LOAD_COLUMNS).
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
throw new PropelException("Error populating AppSpool object", $e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes this object from datastore and sets delete attribute.
|
|
||||||
*
|
|
||||||
* @param Connection $con
|
|
||||||
* @return void
|
|
||||||
* @throws PropelException
|
|
||||||
* @see BaseObject::setDeleted()
|
|
||||||
* @see BaseObject::isDeleted()
|
|
||||||
*/
|
|
||||||
public function delete($con = null)
|
|
||||||
{
|
|
||||||
if ($this->isDeleted()) {
|
|
||||||
throw new PropelException("This object has already been deleted.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$con->begin();
|
|
||||||
AppSpoolPeer::doDelete($this, $con);
|
|
||||||
$this->setDeleted(true);
|
|
||||||
$con->commit();
|
|
||||||
} catch (PropelException $e) {
|
|
||||||
$con->rollback();
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stores the object in the database. If the object is new,
|
|
||||||
* it inserts it; otherwise an update is performed. This method
|
|
||||||
* wraps the doSave() worker method in a transaction.
|
|
||||||
*
|
|
||||||
* @param Connection $con
|
|
||||||
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
|
||||||
* @throws PropelException
|
|
||||||
* @see doSave()
|
|
||||||
*/
|
|
||||||
public function save($con = null)
|
|
||||||
{
|
|
||||||
if ($this->isDeleted()) {
|
|
||||||
throw new PropelException("You cannot save an object that has been deleted.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$con->begin();
|
|
||||||
$affectedRows = $this->doSave($con);
|
|
||||||
$con->commit();
|
|
||||||
return $affectedRows;
|
|
||||||
} catch (PropelException $e) {
|
|
||||||
$con->rollback();
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stores the object in the database.
|
|
||||||
*
|
|
||||||
* If the object is new, it inserts it; otherwise an update is performed.
|
|
||||||
* All related objects are also updated in this method.
|
|
||||||
*
|
|
||||||
* @param Connection $con
|
|
||||||
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
|
||||||
* @throws PropelException
|
|
||||||
* @see save()
|
|
||||||
*/
|
|
||||||
protected function doSave($con)
|
|
||||||
{
|
|
||||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
|
||||||
if (!$this->alreadyInSave) {
|
|
||||||
$this->alreadyInSave = true;
|
|
||||||
|
|
||||||
|
|
||||||
// If this object has been modified, then save it to the database.
|
|
||||||
if ($this->isModified()) {
|
|
||||||
if ($this->isNew()) {
|
|
||||||
$pk = AppSpoolPeer::doInsert($this, $con);
|
|
||||||
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
|
|
||||||
// should always be true here (even though technically
|
|
||||||
// BasePeer::doInsert() can insert multiple rows).
|
|
||||||
|
|
||||||
$this->setNew(false);
|
|
||||||
} else {
|
|
||||||
$affectedRows += AppSpoolPeer::doUpdate($this, $con);
|
|
||||||
}
|
|
||||||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->alreadyInSave = false;
|
|
||||||
}
|
|
||||||
return $affectedRows;
|
|
||||||
} // doSave()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of ValidationFailed objects.
|
|
||||||
* @var array ValidationFailed[]
|
|
||||||
*/
|
|
||||||
protected $validationFailures = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets any ValidationFailed objects that resulted from last call to validate().
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return array ValidationFailed[]
|
|
||||||
* @see validate()
|
|
||||||
*/
|
|
||||||
public function getValidationFailures()
|
|
||||||
{
|
|
||||||
return $this->validationFailures;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validates the objects modified field values and all objects related to this table.
|
|
||||||
*
|
|
||||||
* If $columns is either a column name or an array of column names
|
|
||||||
* only those columns are validated.
|
|
||||||
*
|
|
||||||
* @param mixed $columns Column name or an array of column names.
|
|
||||||
* @return boolean Whether all columns pass validation.
|
|
||||||
* @see doValidate()
|
|
||||||
* @see getValidationFailures()
|
|
||||||
*/
|
|
||||||
public function validate($columns = null)
|
|
||||||
{
|
|
||||||
$res = $this->doValidate($columns);
|
|
||||||
if ($res === true) {
|
|
||||||
$this->validationFailures = array();
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
$this->validationFailures = $res;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function performs the validation work for complex object models.
|
|
||||||
*
|
|
||||||
* In addition to checking the current object, all related objects will
|
|
||||||
* also be validated. If all pass then <code>true</code> is returned; otherwise
|
|
||||||
* an aggreagated array of ValidationFailed objects will be returned.
|
|
||||||
*
|
|
||||||
* @param array $columns Array of column names to validate.
|
|
||||||
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
|
|
||||||
*/
|
|
||||||
protected function doValidate($columns = null)
|
|
||||||
{
|
|
||||||
if (!$this->alreadyInValidation) {
|
|
||||||
$this->alreadyInValidation = true;
|
|
||||||
$retval = null;
|
|
||||||
|
|
||||||
$failureMap = array();
|
|
||||||
|
|
||||||
|
|
||||||
if (($retval = AppSpoolPeer::doValidate($this, $columns)) !== true) {
|
|
||||||
$failureMap = array_merge($failureMap, $retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->alreadyInValidation = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (!empty($failureMap) ? $failureMap : true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves a field from the object by name passed in as a string.
|
|
||||||
*
|
|
||||||
* @param string $name name
|
|
||||||
* @param string $type The type of fieldname the $name is of:
|
|
||||||
* one of the class type constants TYPE_PHPNAME,
|
|
||||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
|
||||||
* @return mixed Value of field.
|
|
||||||
*/
|
|
||||||
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
|
|
||||||
{
|
|
||||||
$pos = AppSpoolPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
|
||||||
return $this->getByPosition($pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves a field from the object by Position as specified in the xml schema.
|
|
||||||
* Zero-based.
|
|
||||||
*
|
|
||||||
* @param int $pos position in xml schema
|
|
||||||
* @return mixed Value of field at $pos
|
|
||||||
*/
|
|
||||||
public function getByPosition($pos)
|
|
||||||
{
|
|
||||||
switch($pos) {
|
|
||||||
case 0:
|
|
||||||
return $this->getId();
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
return $this->getSender();
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
return $this->getFile();
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
return $this->getNow();
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
return $this->getStatus();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
break;
|
|
||||||
} // switch()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exports the object as an array.
|
|
||||||
*
|
|
||||||
* You can specify the key type of the array by passing one of the class
|
|
||||||
* type constants.
|
|
||||||
*
|
|
||||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
|
||||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
|
||||||
* @return an associative array containing the field names (as keys) and field values
|
|
||||||
*/
|
|
||||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
|
||||||
{
|
|
||||||
$keys = AppSpoolPeer::getFieldNames($keyType);
|
|
||||||
$result = array(
|
|
||||||
$keys[0] => $this->getId(),
|
|
||||||
$keys[1] => $this->getSender(),
|
|
||||||
$keys[2] => $this->getFile(),
|
|
||||||
$keys[3] => $this->getNow(),
|
|
||||||
$keys[4] => $this->getStatus(),
|
|
||||||
);
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a field from the object by name passed in as a string.
|
|
||||||
*
|
|
||||||
* @param string $name peer name
|
|
||||||
* @param mixed $value field value
|
|
||||||
* @param string $type The type of fieldname the $name is of:
|
|
||||||
* one of the class type constants TYPE_PHPNAME,
|
|
||||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
|
|
||||||
{
|
|
||||||
$pos = AppSpoolPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
|
||||||
return $this->setByPosition($pos, $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets a field from the object by Position as specified in the xml schema.
|
|
||||||
* Zero-based.
|
|
||||||
*
|
|
||||||
* @param int $pos position in xml schema
|
|
||||||
* @param mixed $value field value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setByPosition($pos, $value)
|
|
||||||
{
|
|
||||||
switch($pos) {
|
|
||||||
case 0:
|
|
||||||
$this->setId($value);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$this->setSender($value);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$this->setFile($value);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$this->setNow($value);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$this->setStatus($value);
|
|
||||||
break;
|
|
||||||
} // switch()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Populates the object using an array.
|
|
||||||
*
|
|
||||||
* This is particularly useful when populating an object from one of the
|
|
||||||
* request arrays (e.g. $_POST). This method goes through the column
|
|
||||||
* names, checking to see whether a matching key exists in populated
|
|
||||||
* array. If so the setByName() method is called for that column.
|
|
||||||
*
|
|
||||||
* You can specify the key type of the array by additionally passing one
|
|
||||||
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
|
|
||||||
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
|
|
||||||
*
|
|
||||||
* @param array $arr An array to populate the object from.
|
|
||||||
* @param string $keyType The type of keys the array uses.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
|
|
||||||
{
|
|
||||||
$keys = AppSpoolPeer::getFieldNames($keyType);
|
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
|
||||||
if (array_key_exists($keys[1], $arr)) $this->setSender($arr[$keys[1]]);
|
|
||||||
if (array_key_exists($keys[2], $arr)) $this->setFile($arr[$keys[2]]);
|
|
||||||
if (array_key_exists($keys[3], $arr)) $this->setNow($arr[$keys[3]]);
|
|
||||||
if (array_key_exists($keys[4], $arr)) $this->setStatus($arr[$keys[4]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build a Criteria object containing the values of all modified columns in this object.
|
|
||||||
*
|
|
||||||
* @return Criteria The Criteria object containing all modified values.
|
|
||||||
*/
|
|
||||||
public function buildCriteria()
|
|
||||||
{
|
|
||||||
$criteria = new Criteria(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
|
|
||||||
if ($this->isColumnModified(AppSpoolPeer::ID)) $criteria->add(AppSpoolPeer::ID, $this->id);
|
|
||||||
if ($this->isColumnModified(AppSpoolPeer::SENDER)) $criteria->add(AppSpoolPeer::SENDER, $this->sender);
|
|
||||||
if ($this->isColumnModified(AppSpoolPeer::FILE)) $criteria->add(AppSpoolPeer::FILE, $this->file);
|
|
||||||
if ($this->isColumnModified(AppSpoolPeer::NOW)) $criteria->add(AppSpoolPeer::NOW, $this->now);
|
|
||||||
if ($this->isColumnModified(AppSpoolPeer::STATUS)) $criteria->add(AppSpoolPeer::STATUS, $this->status);
|
|
||||||
|
|
||||||
return $criteria;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds a Criteria object containing the primary key for this object.
|
|
||||||
*
|
|
||||||
* Unlike buildCriteria() this method includes the primary key values regardless
|
|
||||||
* of whether or not they have been modified.
|
|
||||||
*
|
|
||||||
* @return Criteria The Criteria object containing value(s) for primary key(s).
|
|
||||||
*/
|
|
||||||
public function buildPkeyCriteria()
|
|
||||||
{
|
|
||||||
$criteria = new Criteria(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
|
|
||||||
$criteria->add(AppSpoolPeer::ID, $this->id);
|
|
||||||
|
|
||||||
return $criteria;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the primary key for this object (row).
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getPrimaryKey()
|
|
||||||
{
|
|
||||||
return $this->getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generic method to set the primary key (id column).
|
|
||||||
*
|
|
||||||
* @param int $key Primary key.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setPrimaryKey($key)
|
|
||||||
{
|
|
||||||
$this->setId($key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets contents of passed object to values from current object.
|
|
||||||
*
|
|
||||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
|
||||||
* objects.
|
|
||||||
*
|
|
||||||
* @param object $copyObj An object of AppSpool (or compatible) type.
|
|
||||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
|
||||||
* @throws PropelException
|
|
||||||
*/
|
|
||||||
public function copyInto($copyObj, $deepCopy = false)
|
|
||||||
{
|
|
||||||
|
|
||||||
$copyObj->setSender($this->sender);
|
|
||||||
|
|
||||||
$copyObj->setFile($this->file);
|
|
||||||
|
|
||||||
$copyObj->setNow($this->now);
|
|
||||||
|
|
||||||
$copyObj->setStatus($this->status);
|
|
||||||
|
|
||||||
|
|
||||||
$copyObj->setNew(true);
|
|
||||||
|
|
||||||
$copyObj->setId(NULL); // this is a pkey column, so set to default value
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Makes a copy of this object that will be inserted as a new row in table when saved.
|
|
||||||
* It creates a new object filling in the simple attributes, but skipping any primary
|
|
||||||
* keys that are defined for the table.
|
|
||||||
*
|
|
||||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
|
||||||
* objects.
|
|
||||||
*
|
|
||||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
|
||||||
* @return AppSpool Clone of current object.
|
|
||||||
* @throws PropelException
|
|
||||||
*/
|
|
||||||
public function copy($deepCopy = false)
|
|
||||||
{
|
|
||||||
// we use get_class(), because this might be a subclass
|
|
||||||
$clazz = get_class($this);
|
|
||||||
$copyObj = new $clazz();
|
|
||||||
$this->copyInto($copyObj, $deepCopy);
|
|
||||||
return $copyObj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a peer instance associated with this om.
|
|
||||||
*
|
|
||||||
* Since Peer classes are not to have any instance attributes, this method returns the
|
|
||||||
* same instance for all member of this class. The method could therefore
|
|
||||||
* be static, but this would prevent one from overriding the behavior.
|
|
||||||
*
|
|
||||||
* @return AppSpoolPeer
|
|
||||||
*/
|
|
||||||
public function getPeer()
|
|
||||||
{
|
|
||||||
if (self::$peer === null) {
|
|
||||||
self::$peer = new AppSpoolPeer();
|
|
||||||
}
|
|
||||||
return self::$peer;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // BaseAppSpool
|
|
||||||
@@ -1,589 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* BaseAppSpoolPeer.php
|
|
||||||
* @package workflow.classes.model.om
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'propel/util/BasePeer.php';
|
|
||||||
// The object class -- needed for instanceof checks in this class.
|
|
||||||
// actual class may be a subclass -- as returned by AppSpoolPeer::getOMClass()
|
|
||||||
include_once 'classes/model/AppSpool.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base static class for performing query and update operations on the 'APP_SPOOL' table.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @package workflow.classes.model.om
|
|
||||||
*/
|
|
||||||
abstract class BaseAppSpoolPeer {
|
|
||||||
|
|
||||||
/** the default database name for this class */
|
|
||||||
const DATABASE_NAME = 'workflow';
|
|
||||||
|
|
||||||
/** the table name for this class */
|
|
||||||
const TABLE_NAME = 'APP_SPOOL';
|
|
||||||
|
|
||||||
/** A class that can be returned by this peer. */
|
|
||||||
const CLASS_DEFAULT = 'classes.model.AppSpool';
|
|
||||||
|
|
||||||
/** The total number of columns. */
|
|
||||||
const NUM_COLUMNS = 5;
|
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/** the column name for the ID field */
|
|
||||||
const ID = 'APP_SPOOL.ID';
|
|
||||||
|
|
||||||
/** the column name for the SENDER field */
|
|
||||||
const SENDER = 'APP_SPOOL.SENDER';
|
|
||||||
|
|
||||||
/** the column name for the FILE field */
|
|
||||||
const FILE = 'APP_SPOOL.FILE';
|
|
||||||
|
|
||||||
/** the column name for the NOW field */
|
|
||||||
const NOW = 'APP_SPOOL.NOW';
|
|
||||||
|
|
||||||
/** the column name for the STATUS field */
|
|
||||||
const STATUS = 'APP_SPOOL.STATUS';
|
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
|
||||||
private static $phpNameMap = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* holds an array of fieldnames
|
|
||||||
*
|
|
||||||
* first dimension keys are the type constants
|
|
||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
|
||||||
*/
|
|
||||||
private static $fieldNames = array (
|
|
||||||
BasePeer::TYPE_PHPNAME => array ('Id', 'Sender', 'File', 'Now', 'Status', ),
|
|
||||||
BasePeer::TYPE_COLNAME => array (AppSpoolPeer::ID, AppSpoolPeer::SENDER, AppSpoolPeer::FILE, AppSpoolPeer::NOW, AppSpoolPeer::STATUS, ),
|
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id', 'sender', 'file', 'now', 'status', ),
|
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* holds an array of keys for quick access to the fieldnames array
|
|
||||||
*
|
|
||||||
* first dimension keys are the type constants
|
|
||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
|
||||||
*/
|
|
||||||
private static $fieldKeys = array (
|
|
||||||
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Sender' => 1, 'File' => 2, 'Now' => 3, 'Status' => 4, ),
|
|
||||||
BasePeer::TYPE_COLNAME => array (AppSpoolPeer::ID => 0, AppSpoolPeer::SENDER => 1, AppSpoolPeer::FILE => 2, AppSpoolPeer::NOW => 3, AppSpoolPeer::STATUS => 4, ),
|
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'sender' => 1, 'file' => 2, 'now' => 3, 'status' => 4, ),
|
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return MapBuilder the map builder for this peer
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function getMapBuilder()
|
|
||||||
{
|
|
||||||
include_once 'classes/model/map/AppSpoolMapBuilder.php';
|
|
||||||
return BasePeer::getMapBuilder('classes.model.map.AppSpoolMapBuilder');
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Gets a map (hash) of PHP names to DB column names.
|
|
||||||
*
|
|
||||||
* @return array The PHP to DB name map for this peer
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
|
||||||
*/
|
|
||||||
public static function getPhpNameMap()
|
|
||||||
{
|
|
||||||
if (self::$phpNameMap === null) {
|
|
||||||
$map = AppSpoolPeer::getTableMap();
|
|
||||||
$columns = $map->getColumns();
|
|
||||||
$nameMap = array();
|
|
||||||
foreach ($columns as $column) {
|
|
||||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
|
||||||
}
|
|
||||||
self::$phpNameMap = $nameMap;
|
|
||||||
}
|
|
||||||
return self::$phpNameMap;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Translates a fieldname to another type
|
|
||||||
*
|
|
||||||
* @param string $name field name
|
|
||||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
|
||||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
|
||||||
* @param string $toType One of the class type constants
|
|
||||||
* @return string translated name of the field.
|
|
||||||
*/
|
|
||||||
static public function translateFieldName($name, $fromType, $toType)
|
|
||||||
{
|
|
||||||
$toNames = self::getFieldNames($toType);
|
|
||||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
|
||||||
if ($key === null) {
|
|
||||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
|
||||||
}
|
|
||||||
return $toNames[$key];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of of field names.
|
|
||||||
*
|
|
||||||
* @param string $type The type of fieldnames to return:
|
|
||||||
* One of the class type constants TYPE_PHPNAME,
|
|
||||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
|
||||||
* @return array A list of field names
|
|
||||||
*/
|
|
||||||
|
|
||||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
|
||||||
{
|
|
||||||
if (!array_key_exists($type, self::$fieldNames)) {
|
|
||||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
|
||||||
}
|
|
||||||
return self::$fieldNames[$type];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convenience method which changes table.column to alias.column.
|
|
||||||
*
|
|
||||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
|
||||||
* <code>
|
|
||||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
|
||||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
|
||||||
* </code>
|
|
||||||
* @param string $alias The alias for the current table.
|
|
||||||
* @param string $column The column name for current table. (i.e. AppSpoolPeer::COLUMN_NAME).
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function alias($alias, $column)
|
|
||||||
{
|
|
||||||
return str_replace(AppSpoolPeer::TABLE_NAME.'.', $alias.'.', $column);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add all the columns needed to create a new object.
|
|
||||||
*
|
|
||||||
* Note: any columns that were marked with lazyLoad="true" in the
|
|
||||||
* XML schema will not be added to the select list and only loaded
|
|
||||||
* on demand.
|
|
||||||
*
|
|
||||||
* @param criteria object containing the columns to add.
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function addSelectColumns(Criteria $criteria)
|
|
||||||
{
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::ID);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::SENDER);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::FILE);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::NOW);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::STATUS);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const COUNT = 'COUNT(APP_SPOOL.ID)';
|
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT APP_SPOOL.ID)';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the number of rows matching criteria.
|
|
||||||
*
|
|
||||||
* @param Criteria $criteria
|
|
||||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
|
||||||
* @param Connection $con
|
|
||||||
* @return int Number of matching rows.
|
|
||||||
*/
|
|
||||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
|
||||||
{
|
|
||||||
// we're going to modify criteria, so copy it first
|
|
||||||
$criteria = clone $criteria;
|
|
||||||
|
|
||||||
// clear out anything that might confuse the ORDER BY clause
|
|
||||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
|
||||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::COUNT_DISTINCT);
|
|
||||||
} else {
|
|
||||||
$criteria->addSelectColumn(AppSpoolPeer::COUNT);
|
|
||||||
}
|
|
||||||
|
|
||||||
// just in case we're grouping: add those columns to the select statement
|
|
||||||
foreach($criteria->getGroupByColumns() as $column)
|
|
||||||
{
|
|
||||||
$criteria->addSelectColumn($column);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rs = AppSpoolPeer::doSelectRS($criteria, $con);
|
|
||||||
if ($rs->next()) {
|
|
||||||
return $rs->getInt(1);
|
|
||||||
} else {
|
|
||||||
// no rows returned; we infer that means 0 matches.
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Method to select one object from the DB.
|
|
||||||
*
|
|
||||||
* @param Criteria $criteria object used to create the SELECT statement.
|
|
||||||
* @param Connection $con
|
|
||||||
* @return AppSpool
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
|
||||||
{
|
|
||||||
$critcopy = clone $criteria;
|
|
||||||
$critcopy->setLimit(1);
|
|
||||||
$objects = AppSpoolPeer::doSelect($critcopy, $con);
|
|
||||||
if ($objects) {
|
|
||||||
return $objects[0];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Method to do selects.
|
|
||||||
*
|
|
||||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
|
||||||
* @param Connection $con
|
|
||||||
* @return array Array of selected Objects
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function doSelect(Criteria $criteria, $con = null)
|
|
||||||
{
|
|
||||||
return AppSpoolPeer::populateObjects(AppSpoolPeer::doSelectRS($criteria, $con));
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Prepares the Criteria object and uses the parent doSelect()
|
|
||||||
* method to get a ResultSet.
|
|
||||||
*
|
|
||||||
* Use this method directly if you want to just get the resultset
|
|
||||||
* (instead of an array of objects).
|
|
||||||
*
|
|
||||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
|
||||||
* @param Connection $con the connection to use
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
|
||||||
* @see BasePeer::doSelect()
|
|
||||||
*/
|
|
||||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$criteria->getSelectColumns()) {
|
|
||||||
$criteria = clone $criteria;
|
|
||||||
AppSpoolPeer::addSelectColumns($criteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the correct dbName
|
|
||||||
$criteria->setDbName(self::DATABASE_NAME);
|
|
||||||
|
|
||||||
// BasePeer returns a Creole ResultSet, set to return
|
|
||||||
// rows indexed numerically.
|
|
||||||
return BasePeer::doSelect($criteria, $con);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The returned array will contain objects of the default type or
|
|
||||||
* objects that inherit from the default.
|
|
||||||
*
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function populateObjects(ResultSet $rs)
|
|
||||||
{
|
|
||||||
$results = array();
|
|
||||||
|
|
||||||
// set the class once to avoid overhead in the loop
|
|
||||||
$cls = AppSpoolPeer::getOMClass();
|
|
||||||
$cls = Propel::import($cls);
|
|
||||||
// populate the object(s)
|
|
||||||
while($rs->next()) {
|
|
||||||
|
|
||||||
$obj = new $cls();
|
|
||||||
$obj->hydrate($rs);
|
|
||||||
$results[] = $obj;
|
|
||||||
|
|
||||||
}
|
|
||||||
return $results;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the TableMap related to this peer.
|
|
||||||
* This method is not needed for general use but a specific application could have a need.
|
|
||||||
* @return TableMap
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function getTableMap()
|
|
||||||
{
|
|
||||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The class that the Peer will make instances of.
|
|
||||||
*
|
|
||||||
* This uses a dot-path notation which is tranalted into a path
|
|
||||||
* relative to a location on the PHP include_path.
|
|
||||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
|
||||||
*
|
|
||||||
* @return string path.to.ClassName
|
|
||||||
*/
|
|
||||||
public static function getOMClass()
|
|
||||||
{
|
|
||||||
return AppSpoolPeer::CLASS_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method perform an INSERT on the database, given a AppSpool or Criteria object.
|
|
||||||
*
|
|
||||||
* @param mixed $values Criteria or AppSpool object containing data that is used to create the INSERT statement.
|
|
||||||
* @param Connection $con the connection to use
|
|
||||||
* @return mixed The new primary key.
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function doInsert($values, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values instanceof Criteria) {
|
|
||||||
$criteria = clone $values; // rename for clarity
|
|
||||||
} else {
|
|
||||||
$criteria = $values->buildCriteria(); // build Criteria from AppSpool object
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Set the correct dbName
|
|
||||||
$criteria->setDbName(self::DATABASE_NAME);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// use transaction because $criteria could contain info
|
|
||||||
// for more than one table (I guess, conceivably)
|
|
||||||
$con->begin();
|
|
||||||
$pk = BasePeer::doInsert($criteria, $con);
|
|
||||||
$con->commit();
|
|
||||||
} catch(PropelException $e) {
|
|
||||||
$con->rollback();
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $pk;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method perform an UPDATE on the database, given a AppSpool or Criteria object.
|
|
||||||
*
|
|
||||||
* @param mixed $values Criteria or AppSpool object containing data that is used to create the UPDATE statement.
|
|
||||||
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
|
|
||||||
* @return int The number of affected rows (if supported by underlying database driver).
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function doUpdate($values, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
|
||||||
|
|
||||||
if ($values instanceof Criteria) {
|
|
||||||
$criteria = clone $values; // rename for clarity
|
|
||||||
|
|
||||||
$comparison = $criteria->getComparison(AppSpoolPeer::ID);
|
|
||||||
$selectCriteria->add(AppSpoolPeer::ID, $criteria->remove(AppSpoolPeer::ID), $comparison);
|
|
||||||
|
|
||||||
} else { // $values is AppSpool object
|
|
||||||
$criteria = $values->buildCriteria(); // gets full criteria
|
|
||||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the correct dbName
|
|
||||||
$criteria->setDbName(self::DATABASE_NAME);
|
|
||||||
|
|
||||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to DELETE all rows from the APP_SPOOL table.
|
|
||||||
*
|
|
||||||
* @return int The number of affected rows (if supported by underlying database driver).
|
|
||||||
*/
|
|
||||||
public static function doDeleteAll($con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
|
||||||
try {
|
|
||||||
// use transaction because $criteria could contain info
|
|
||||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
|
||||||
$con->begin();
|
|
||||||
$affectedRows += BasePeer::doDeleteAll(AppSpoolPeer::TABLE_NAME, $con);
|
|
||||||
$con->commit();
|
|
||||||
return $affectedRows;
|
|
||||||
} catch (PropelException $e) {
|
|
||||||
$con->rollback();
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method perform a DELETE on the database, given a AppSpool or Criteria object OR a primary key value.
|
|
||||||
*
|
|
||||||
* @param mixed $values Criteria or AppSpool object or primary key or array of primary keys
|
|
||||||
* which is used to create the DELETE statement
|
|
||||||
* @param Connection $con the connection to use
|
|
||||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
|
||||||
* if supported by native driver or if emulated using Propel.
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function doDelete($values, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values instanceof Criteria) {
|
|
||||||
$criteria = clone $values; // rename for clarity
|
|
||||||
} elseif ($values instanceof AppSpool) {
|
|
||||||
|
|
||||||
$criteria = $values->buildPkeyCriteria();
|
|
||||||
} else {
|
|
||||||
// it must be the primary key
|
|
||||||
$criteria = new Criteria(self::DATABASE_NAME);
|
|
||||||
$criteria->add(AppSpoolPeer::ID, (array) $values, Criteria::IN);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the correct dbName
|
|
||||||
$criteria->setDbName(self::DATABASE_NAME);
|
|
||||||
|
|
||||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
|
||||||
|
|
||||||
try {
|
|
||||||
// use transaction because $criteria could contain info
|
|
||||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
|
||||||
$con->begin();
|
|
||||||
|
|
||||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
|
||||||
$con->commit();
|
|
||||||
return $affectedRows;
|
|
||||||
} catch (PropelException $e) {
|
|
||||||
$con->rollback();
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validates all modified columns of given AppSpool object.
|
|
||||||
* If parameter $columns is either a single column name or an array of column names
|
|
||||||
* than only those columns are validated.
|
|
||||||
*
|
|
||||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
|
||||||
*
|
|
||||||
* @param AppSpool $obj The object to validate.
|
|
||||||
* @param mixed $cols Column name or array of column names.
|
|
||||||
*
|
|
||||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
|
||||||
*/
|
|
||||||
public static function doValidate(AppSpool $obj, $cols = null)
|
|
||||||
{
|
|
||||||
$columns = array();
|
|
||||||
|
|
||||||
if ($cols) {
|
|
||||||
$dbMap = Propel::getDatabaseMap(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
$tableMap = $dbMap->getTable(AppSpoolPeer::TABLE_NAME);
|
|
||||||
|
|
||||||
if (! is_array($cols)) {
|
|
||||||
$cols = array($cols);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($cols as $colName) {
|
|
||||||
if ($tableMap->containsColumn($colName)) {
|
|
||||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
|
||||||
$columns[$colName] = $obj->$get();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return BasePeer::doValidate(AppSpoolPeer::DATABASE_NAME, AppSpoolPeer::TABLE_NAME, $columns);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a single object by pkey.
|
|
||||||
*
|
|
||||||
* @param mixed $pk the primary key.
|
|
||||||
* @param Connection $con the connection to use
|
|
||||||
* @return AppSpool
|
|
||||||
*/
|
|
||||||
public static function retrieveByPK($pk, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
$criteria = new Criteria(AppSpoolPeer::DATABASE_NAME);
|
|
||||||
|
|
||||||
$criteria->add(AppSpoolPeer::ID, $pk);
|
|
||||||
|
|
||||||
|
|
||||||
$v = AppSpoolPeer::doSelect($criteria, $con);
|
|
||||||
|
|
||||||
return !empty($v) > 0 ? $v[0] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve multiple objects by pkey.
|
|
||||||
*
|
|
||||||
* @param array $pks List of primary keys
|
|
||||||
* @param Connection $con the connection to use
|
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
|
||||||
* rethrown wrapped into a PropelException.
|
|
||||||
*/
|
|
||||||
public static function retrieveByPKs($pks, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
$objs = null;
|
|
||||||
if (empty($pks)) {
|
|
||||||
$objs = array();
|
|
||||||
} else {
|
|
||||||
$criteria = new Criteria();
|
|
||||||
$criteria->add(AppSpoolPeer::ID, $pks, Criteria::IN);
|
|
||||||
$objs = AppSpoolPeer::doSelect($criteria, $con);
|
|
||||||
}
|
|
||||||
return $objs;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // BaseAppSpoolPeer
|
|
||||||
|
|
||||||
// static code to register the map builder for this Peer with the main Propel class
|
|
||||||
if (Propel::isInit()) {
|
|
||||||
// the MapBuilder classes register themselves with Propel during initialization
|
|
||||||
// so we need to load them here.
|
|
||||||
try {
|
|
||||||
BaseAppSpoolPeer::getMapBuilder();
|
|
||||||
} catch (Exception $e) {
|
|
||||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// even if Propel is not yet initialized, the map builder class can be registered
|
|
||||||
// now and then it will be loaded when Propel initializes.
|
|
||||||
require_once 'classes/model/map/AppSpoolMapBuilder.php';
|
|
||||||
Propel::registerMapBuilder('classes.model.map.AppSpoolMapBuilder');
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* BPMN Designer v1.1
|
|
||||||
* @date Feb 2th, 2011
|
|
||||||
* @author Erik A. O. <erik@colosa.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
class BpmnDesigner extends Controller
|
|
||||||
{
|
|
||||||
function index($httpData)
|
|
||||||
{
|
|
||||||
if( ! isset($httpData->id) )
|
|
||||||
throw new Exception('The Process ID was not set!');
|
|
||||||
|
|
||||||
require_once 'classes/model/Process.php';
|
|
||||||
$process = ProcessPeer::retrieveByPK($httpData->id);
|
|
||||||
|
|
||||||
if( get_class($process) != 'Process' ) {
|
|
||||||
throw new Exception("The Process with UID: {$httpData->id} doesn't exist!");
|
|
||||||
}
|
|
||||||
|
|
||||||
$_SESSION['PROCESS'] = $httpData->id;
|
|
||||||
$_SESSION['PROCESSMAP'] = 'BPMN';
|
|
||||||
|
|
||||||
$this->includeExtJS('bpmn/MyWorkflow',true );
|
|
||||||
$this->includeExtJS('bpmn/pmosExt', true );
|
|
||||||
$this->includeExtJS('bpmn/TaskContext', true );
|
|
||||||
|
|
||||||
$this->includeExtJS('bpmn/designerComponents', true );
|
|
||||||
$this->includeExtJS('bpmn/designer', true );
|
|
||||||
|
|
||||||
$this->includeExtJS('bpmn/Annotation',true );
|
|
||||||
$this->includeExtJS('bpmn/bpmnShapes', true);
|
|
||||||
$this->includeExtJS('bpmn/EventEmptyStart');
|
|
||||||
$this->includeExtJS('bpmn/EventMessageStart');
|
|
||||||
$this->includeExtJS('bpmn/EventTimerStart');
|
|
||||||
$this->includeExtJS('bpmn/EventEmptyInter');
|
|
||||||
$this->includeExtJS('bpmn/EventMessageRecInter');
|
|
||||||
$this->includeExtJS('bpmn/EventMessageSendInter');
|
|
||||||
$this->includeExtJS('bpmn/EventTimerInter');
|
|
||||||
$this->includeExtJS('bpmn/EventEmptyEnd');
|
|
||||||
$this->includeExtJS('bpmn/EventMessageEnd');
|
|
||||||
$this->includeExtJS('bpmn/GatewayInclusive' );
|
|
||||||
$this->includeExtJS('bpmn/GatewayExclusiveData');
|
|
||||||
$this->includeExtJS('bpmn/GatewayParallel' );
|
|
||||||
$this->includeExtJS('bpmn/GridPanel');
|
|
||||||
$this->includeExtJS('bpmn/SubProcess' );
|
|
||||||
$this->includeExtJS('bpmn/ProcessOptions',true);
|
|
||||||
$this->includeExtJS('bpmn/ProcessMapContext', true );
|
|
||||||
|
|
||||||
$this->includeExtJS('bpmn/ProcessOptions', true);
|
|
||||||
|
|
||||||
$this->setJSVar('pro_uid', $httpData->id);
|
|
||||||
$this->setJSVar('pro_title', $process->getProTitle());
|
|
||||||
|
|
||||||
$this->setView('bpmn/designer');
|
|
||||||
|
|
||||||
G::RenderPage('publish', 'extJs');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* BpmnProxy Controller
|
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
class BpmnProxy extends HttpProxyController
|
|
||||||
{
|
|
||||||
function openProcess($httpData)
|
|
||||||
{
|
|
||||||
G::LoadClass('xpdl');
|
|
||||||
$processUID = $httpData->PRO_UID;
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
$fields = $oProcess->serializeProcess($processUID);
|
|
||||||
$oData = unserialize($fields);
|
|
||||||
$arrayTasks = array();
|
|
||||||
$countTasks = 0;
|
|
||||||
$countSubProcess= 0;
|
|
||||||
$arrayEvents = array();
|
|
||||||
$arraySubProcess= array();
|
|
||||||
$count = 0;
|
|
||||||
$countRoutes = 0;
|
|
||||||
$arrayRoutes = array();
|
|
||||||
$process = array();
|
|
||||||
$process = $oProcess->createProcessPM($oData->process);
|
|
||||||
foreach($oData->tasks as $id => $value) {
|
|
||||||
if($value['TAS_TYPE'] == 'SUBPROCESS'){
|
|
||||||
$arraySubProcess[$countSubProcess]['0'] = $value['TAS_UID'];
|
|
||||||
$arraySubProcess[$countSubProcess]['1'] = $value['TAS_TITLE'];
|
|
||||||
$arraySubProcess[$countSubProcess]['2'] = $value['TAS_POSX'];
|
|
||||||
$arraySubProcess[$countSubProcess]['3'] = $value['TAS_POSY'];
|
|
||||||
$countSubProcess = $countSubProcess + 1;
|
|
||||||
} else {
|
|
||||||
$arrayTasks[$countTasks]['0'] = $value['TAS_UID'];
|
|
||||||
$arrayTasks[$countTasks]['1'] = $value['TAS_TITLE'];
|
|
||||||
$arrayTasks[$countTasks]['2'] = $value['TAS_POSX'];
|
|
||||||
$arrayTasks[$countTasks]['3'] = $value['TAS_POSY'];
|
|
||||||
$arrayTasks[$countTasks]['4'] = $value['TAS_WIDTH'];
|
|
||||||
$arrayTasks[$countTasks]['5'] = $value['TAS_HEIGHT'];
|
|
||||||
$arrayTasks[$countTasks]['6'] = $value['TAS_BOUNDARY'];
|
|
||||||
if($value['TAS_START'] == 'TRUE') {
|
|
||||||
$arrayEvents[$count]['0'] = G::generateUniqueID();
|
|
||||||
if($value['TAS_EVN_UID'] == '') {
|
|
||||||
$arrayEvents[$count]['1'] = 'bpmnEventEmptyStart';
|
|
||||||
} else {
|
|
||||||
foreach($oData->event as $eventid => $val){
|
|
||||||
if($val['EVN_UID'] == $value['TAS_EVN_UID']) {
|
|
||||||
$arrayEvents[$count]['0'] = $val['EVN_UID'];
|
|
||||||
$arrayEvents[$count]['1'] = $val['EVN_TYPE'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$arrayEvents[$count]['2'] = $value['TAS_POSX']+68;
|
|
||||||
$arrayEvents[$count]['3'] = $value['TAS_POSY']-50;
|
|
||||||
$arrayEvents[$count]['4'] = $value['TAS_UID'];
|
|
||||||
$arrayRoutes[$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$arrayRoutes[$countRoutes]['1']= $arrayEvents[$count]['0'];
|
|
||||||
$arrayRoutes[$countRoutes]['2']= $value['TAS_UID'];
|
|
||||||
$arrayRoutes[$countRoutes]['3']= '1';
|
|
||||||
$arrayRoutes[$countRoutes]['4']= '2';
|
|
||||||
$count = $count+ 1;
|
|
||||||
$countRoutes = $countRoutes+ 1;
|
|
||||||
}
|
|
||||||
$countTasks = $countTasks + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$lanes = $oProcess->createLanesNewPM($oData->lanes);
|
|
||||||
$fields = $oProcess->createTransitionsPM($oData->tasks,$oData->routes,$arrayEvents,$count,$arrayRoutes,$countRoutes);
|
|
||||||
|
|
||||||
//Get Standalone Events and routes
|
|
||||||
$countEvent = count($fields['EVENTS']);
|
|
||||||
$countRoutes = count($fields['TRANSITION']);
|
|
||||||
foreach($oData->event as $id => $value) {
|
|
||||||
if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && $value['EVN_TAS_UID_TO'] != ''){ //Check for Intermediate Events
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTaskFrom = $value['EVN_TAS_UID_FROM'];
|
|
||||||
$idTaskTo = $value['EVN_TAS_UID_TO'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $idTaskFrom;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '1';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '2';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $idTaskTo;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '2';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '1';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_TO'] != '' && ! preg_match("/Start/", $value['EVN_TYPE'])){
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTask = $value['EVN_TAS_UID_TO'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $idTask;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '2';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '1';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && ! preg_match("/End/", $value['EVN_TYPE'])){ //Check for Intermediate Events
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTask = $value['EVN_TAS_UID_FROM'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $idTask;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '1';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '2';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] == '' && $value['EVN_TAS_UID_TO'] == ''){
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get all the standalone Gateway
|
|
||||||
$countGateway = count($fields['GATEWAYS']);
|
|
||||||
$countTransitions = count($fields['TRANSITION']);
|
|
||||||
|
|
||||||
foreach($oData->gateways as $id => $value) {
|
|
||||||
if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] != '' && $value['GAT_TYPE'] != ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['TAS_UID'];
|
|
||||||
$countGateway+=1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countTransitions += 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '2';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '1';
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
//creating gateway and route from gateway to task i.e if target task is not NULL
|
|
||||||
else if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] == ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '2';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '1';
|
|
||||||
$countGateway+=1;
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
//creating gateway and route from task to gateway i.e if source task is not NULL
|
|
||||||
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] != ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countGateway+=1;
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] == ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$countGateway += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Create Annotation route
|
|
||||||
foreach($oData->lanes as $id => $value)
|
|
||||||
{
|
|
||||||
if($value['SWI_NEXT_UID'] != '') {
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['SWI_NEXT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['SWI_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//$subProcess = $oProcess->createSubProcessesPM($oData->subProcess);
|
|
||||||
$arrayEvents = $fields['EVENTS'];
|
|
||||||
$arrayGateways = $fields['GATEWAYS'];
|
|
||||||
$arrayRoutes = $fields['TRANSITION'];
|
|
||||||
|
|
||||||
$data['tasks'] = $arrayTasks;
|
|
||||||
$data['subprocess'] = $arraySubProcess;
|
|
||||||
$data['routes'] = $arrayRoutes;
|
|
||||||
$data['events'] = $arrayEvents;
|
|
||||||
$data['gateways'] = $arrayGateways;
|
|
||||||
$data['process'] = $process;
|
|
||||||
$data['annotations'] = $lanes;
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -820,9 +820,9 @@ class Installer extends Controller
|
|||||||
G::loadClass('system');
|
G::loadClass('system');
|
||||||
$envFile = PATH_CONFIG . 'env.ini';
|
$envFile = PATH_CONFIG . 'env.ini';
|
||||||
|
|
||||||
//writting for new installtions to use the new skin 'uxmind' with new Front End ExtJs Based
|
//writting for new installtions to use the classic skin
|
||||||
$updatedConf['default_skin'] = 'uxmodern';
|
$updatedConf['default_skin'] = 'classic';
|
||||||
$info->uri = '/sys' . $_REQUEST['workspace'] . '/en/uxmodern/main/login';
|
$info->uri = '/sys' . $_REQUEST['workspace'] . '/en/classic/login/login';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
G::update_php_ini($envFile, $updatedConf);
|
G::update_php_ini($envFile, $updatedConf);
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function expandNode()
|
|||||||
global $RBAC;
|
global $RBAC;
|
||||||
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1)? '' : $_SESSION['USER_LOGGED'];
|
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1)? '' : $_SESSION['USER_LOGGED'];
|
||||||
$folderContentObj = $oPMFolder->getFolderContent ($_POST ['node'] != 'root' ?
|
$folderContentObj = $oPMFolder->getFolderContent ($_POST ['node'] != 'root' ?
|
||||||
$_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder, array(), null, null, $limit, $start, $user);
|
$_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder, array(), null, null, $limit, $start, $user, true);
|
||||||
$folderContent=$folderContentObj['documents'];
|
$folderContent=$folderContentObj['documents'];
|
||||||
$totalDocuments=$folderContentObj['totalDocumentsCount'];
|
$totalDocuments=$folderContentObj['totalDocumentsCount'];
|
||||||
$totalItems+=count($folderContent);
|
$totalItems+=count($folderContent);
|
||||||
|
|||||||
@@ -1,301 +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!');
|
|
||||||
}
|
|
||||||
|
|
||||||
if(empty($_POST['SCH_UID']))
|
|
||||||
$aData['SCH_UID'] = G::generateUniqueID();
|
|
||||||
else
|
|
||||||
$aData['SCH_UID'] = $_POST['SCH_UID'];
|
|
||||||
|
|
||||||
$aData['SCH_NAME'] = $_POST['SCH_NAME'];
|
|
||||||
$aData['SCH_DEL_USER_NAME'] = $_POST['SCH_DEL_USER_NAME'];
|
|
||||||
$aData['SCH_DEL_USER_PASS'] = md5($_POST['SCH_USER_PASSWORD']);
|
|
||||||
$aData['SCH_DEL_USER_UID'] = $_POST['SCH_DEL_USER_UID'];
|
|
||||||
$aData['PRO_UID'] = $_POST['PRO_UID'];
|
|
||||||
$aData['TAS_UID'] = $_POST['TAS_UID'];
|
|
||||||
|
|
||||||
$aData['SCH_STATE'] = 'ACTIVE';
|
|
||||||
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
|
||||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
|
||||||
|
|
||||||
$sOption = $_POST['SCH_OPTION'];
|
|
||||||
if($sOption == 'Daily')
|
|
||||||
{
|
|
||||||
$aData['SCH_OPTION'] = '1';
|
|
||||||
$sOption = '1';
|
|
||||||
}
|
|
||||||
else if($sOption == 'Weekly')
|
|
||||||
{
|
|
||||||
$aData['SCH_OPTION'] = '2';
|
|
||||||
$sOption = '2';
|
|
||||||
}
|
|
||||||
else if($sOption == 'Monthly')
|
|
||||||
{
|
|
||||||
$aData['SCH_OPTION'] = '3';
|
|
||||||
$sOption = '3';
|
|
||||||
}
|
|
||||||
else if($sOption == 'One time only')
|
|
||||||
{
|
|
||||||
$aData['SCH_OPTION'] = '4';
|
|
||||||
$sOption = '4';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_POST['SCH_START_DATE']!=''){
|
|
||||||
$sDateTmp = $_POST['SCH_START_DATE'];
|
|
||||||
} else {
|
|
||||||
$sDateTmp = date('Y-m-d');
|
|
||||||
}
|
|
||||||
$sTimeTmp = $_POST['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['SCH_START_TIME']; // time();
|
|
||||||
// $nActualDate = date("Y-m-d H:i:s", $nActualTime);
|
|
||||||
|
|
||||||
$sValue = '';
|
|
||||||
$sDaysPerformTask = '';
|
|
||||||
$sWeeks = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sMonths = '';
|
|
||||||
$sStartDay = '';
|
|
||||||
$nSW = 0;
|
|
||||||
|
|
||||||
switch($sOption){
|
|
||||||
case '1' : // Option 1
|
|
||||||
$sValue = $_POST['SCH_DAYS_PERFORM_TASK'];
|
|
||||||
switch($sValue){
|
|
||||||
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['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['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '2' : // If the option is zero, set by default 1
|
|
||||||
if(empty($_POST['SCH_EVERY_DAYS']))
|
|
||||||
$nEveryDays = 1;
|
|
||||||
else
|
|
||||||
$nEveryDays = $_POST['SCH_EVERY_DAYS'];
|
|
||||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
|
||||||
$sWeeks = '';
|
|
||||||
if(!empty($_POST['SCH_WEEK_DAYS'])){
|
|
||||||
$aWeekDays = explode(',',$_POST['SCH_WEEK_DAYS']);
|
|
||||||
foreach($aWeekDays as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*if(!empty($_POST['SCH_WEEK_DAYS_2'])){
|
|
||||||
$aWeekDays2 = $_POST['SCH_WEEK_DAYS_2'];
|
|
||||||
foreach($aWeekDays2 as $value) {
|
|
||||||
$sWeeks = $sWeeks . $value . '|';
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
$sStartTime = $_POST['SCH_START_TIME'];
|
|
||||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case '3' :
|
|
||||||
$nStartDay = $_POST['SCH_START_DAY'];
|
|
||||||
if($nStartDay == 'Day of Month')
|
|
||||||
$nStartDay = 1;
|
|
||||||
else if($nStartDay == 'The Day')
|
|
||||||
$nStartDay = 2;
|
|
||||||
|
|
||||||
$sStartDayOpt2Week = $_POST['SCH_START_DAY_OPT_2_WEEKS'];
|
|
||||||
switch($sStartDayOpt2Week){
|
|
||||||
case 'First':
|
|
||||||
$sStartDayOpt2Week = 1;
|
|
||||||
break;
|
|
||||||
case 'Second':
|
|
||||||
$sStartDayOpt2Week = 2;
|
|
||||||
break;
|
|
||||||
case 'Third':
|
|
||||||
$sStartDayOpt2Week = 3;
|
|
||||||
break;
|
|
||||||
case 'Fourth':
|
|
||||||
$sStartDayOpt2Week = 4;
|
|
||||||
break;
|
|
||||||
case 'Last':
|
|
||||||
$sStartDayOpt2Week = 5;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$sStartDayOpt2DayWeek = $_POST['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
|
||||||
|
|
||||||
switch($sStartDayOpt2DayWeek){
|
|
||||||
case 'Monday':
|
|
||||||
$sStartDayOpt2DayWeek = 1;
|
|
||||||
break;
|
|
||||||
case 'Tuesday':
|
|
||||||
$sStartDayOpt2DayWeek = 2;
|
|
||||||
break;
|
|
||||||
case 'Wednesday':
|
|
||||||
$sStartDayOpt2DayWeek = 3;
|
|
||||||
break;
|
|
||||||
case 'Thursday':
|
|
||||||
$sStartDayOpt2DayWeek = 4;
|
|
||||||
break;
|
|
||||||
case 'Friday':
|
|
||||||
$sStartDayOpt2DayWeek = 5;
|
|
||||||
break;
|
|
||||||
case 'Saturday':
|
|
||||||
$sStartDayOpt2DayWeek = 6;
|
|
||||||
break;
|
|
||||||
case 'Sunday':
|
|
||||||
$sStartDayOpt2DayWeek = 7;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($nStartDay == 1){
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['SCH_START_DAY_OPT_1'];
|
|
||||||
} else {
|
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $sStartDayOpt2Week . '|' . $sStartDayOpt2DayWeek;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sMonths = '';
|
|
||||||
if(!empty($_POST['SCH_MONTHS'])){
|
|
||||||
//$aMonths = $_POST['SCH_MONTHS'];
|
|
||||||
$aMonths = explode(',',$_POST['SCH_MONTHS']);
|
|
||||||
foreach($aMonths as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|' ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*if(!empty($_POST['SCH_MONTHS_2'])){
|
|
||||||
$aMonths2 = $_POST['SCH_MONTHS_2'];
|
|
||||||
foreach($aMonths2 as $value) {
|
|
||||||
$sMonths = $sMonths . $value . '|' ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!empty($_POST['SCH_MONTHS_3'])){
|
|
||||||
$aMonths3 = $_POST['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')) {
|
|
||||||
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['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);
|
|
||||||
}
|
|
||||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
|
||||||
// die;
|
|
||||||
} else {
|
|
||||||
if ($sOption=='4'){
|
|
||||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
|
||||||
}
|
|
||||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(trim($_POST['SCH_END_DATE'])!=''){
|
|
||||||
$aData['SCH_END_DATE'] = $_POST['SCH_END_DATE'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!empty($_POST['SCH_REPEAT_TASK_CHK'])){
|
|
||||||
$nOptEvery = $_POST['SCH_REPEAT_EVERY_OPT'];
|
|
||||||
if($nOptEvery ==2)
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['SCH_REPEAT_EVERY'] * 60;
|
|
||||||
else
|
|
||||||
$aData['SCH_REPEAT_EVERY'] = $_POST['SCH_REPEAT_EVERY'];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//$aData['SCH_END_DATE'] = "2020-12-30";
|
|
||||||
if(empty($_POST['SCH_UID']))
|
|
||||||
$oCaseScheduler->create($aData);
|
|
||||||
else
|
|
||||||
$oCaseScheduler->update($aData);
|
|
||||||
|
|
||||||
//Save Scheduler_uid in the Event Table for Start Timer.
|
|
||||||
$oData['EVN_UID']= $_POST['EVN_UID'];
|
|
||||||
$oData['EVN_ACTION']= $aData['SCH_UID'];
|
|
||||||
require_once "classes/model/Event.php";
|
|
||||||
$oEvent = new Event();
|
|
||||||
$oEvent->update($oData);
|
|
||||||
echo "{success: true}";
|
|
||||||
//G::header('location: cases_Scheduler_List');
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception $oException) {
|
|
||||||
die($oException->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,249 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* events_EditAction.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
global $RBAC;
|
|
||||||
global $_DBArray;
|
|
||||||
|
|
||||||
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
if ( isset ($_SESSION['EVN_UID']) ) {
|
|
||||||
$evnUid = $_SESSION['EVN_UID'];
|
|
||||||
unset ( $_SESSION['EVN_UID'] );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$evnUid = $_GET['EVN_UID'];
|
|
||||||
|
|
||||||
require_once 'classes/model/Event.php';
|
|
||||||
require_once 'classes/model/Triggers.php';
|
|
||||||
$oEvent = new Event();
|
|
||||||
$oTrigger = new Triggers();
|
|
||||||
$aFields = $oEvent->load( $evnUid );
|
|
||||||
$parameters = unserialize ( $oEvent->getEvnActionParameters() );
|
|
||||||
//g::pr($parameters); die;
|
|
||||||
$aTrigger = $oTrigger->load($aFields['TRI_UID']);
|
|
||||||
|
|
||||||
$hash = md5 ( $oTrigger->getTriWebbot() );
|
|
||||||
//var_dump($hash,$parameters->hash);die;
|
|
||||||
//if the hash is different, the script was edited , so we will show the trigger editor.
|
|
||||||
if ( ( isset($parameters->hash) && $hash <> $parameters->hash ) || $aFields['EVN_ACTION'] == 'EXECUTE_TRIGGER' || $aFields['EVN_ACTION'] == 'EXECUTE_CONDITIONAL_TRIGGER' ) {
|
|
||||||
$oTriggerParams = unserialize($aTrigger['TRI_PARAM']);
|
|
||||||
// check again a hash, this time to check the trigger itself integrity
|
|
||||||
if ($oTriggerParams['hash']!=$hash){
|
|
||||||
// if has changed edit manually
|
|
||||||
G::LoadClass('xmlfield_InputPM');
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'triggers/triggersNarrowEdit', '', $aTrigger, '../events/triggersSave');
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
die;
|
|
||||||
} else {
|
|
||||||
// if not launch the wizard view.
|
|
||||||
$triUid = $aFields['TRI_UID'];
|
|
||||||
$_GET = $oTriggerParams['params'];
|
|
||||||
$_GET['TRI_UID'] = $triUid;
|
|
||||||
require_once(PATH_METHODS.'triggers/triggers_EditWizard.php');
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$aFields['EVN_MESSAGE_SUBJECT'] = (isset($parameters->SUBJECT) ? $parameters->SUBJECT : '');
|
|
||||||
|
|
||||||
if(isset($parameters->TO)){
|
|
||||||
$paramTO[] = Array('id'=>'char', 'name'=>'char');
|
|
||||||
|
|
||||||
//echo '<pre>';print_r($parameters->TO);
|
|
||||||
foreach($parameters->TO as $item){
|
|
||||||
$row = explode('|', $item);
|
|
||||||
switch($row[0]){
|
|
||||||
case 'usr':
|
|
||||||
require_once('classes/model/Users.php');
|
|
||||||
$user = new Users();
|
|
||||||
|
|
||||||
if($row[1] == '-1'){
|
|
||||||
$value = '(Current Task User)';
|
|
||||||
} else {
|
|
||||||
$rec = $user->load($row[1]);
|
|
||||||
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'grp':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$group = new Groups();
|
|
||||||
$rec = $group->load($row[1]);
|
|
||||||
|
|
||||||
$value = strip_tags($rec->getGrpTitle());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'ext':
|
|
||||||
$value = htmlentities($row[1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'dyn':
|
|
||||||
$value = htmlentities('@#'.$row[1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
echo '->'.$row[0];
|
|
||||||
}
|
|
||||||
$paramTO[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$paramTO[] = Array('id'=>'char', 'name'=>'char');
|
|
||||||
$paramTO[] = Array('id'=>'usr|-1', 'name'=>'(Current Task User)');
|
|
||||||
}
|
|
||||||
$_DBArray['eventomsgto'] = $paramTO;
|
|
||||||
|
|
||||||
if(isset($parameters->CC)){
|
|
||||||
$paramCC[] = Array('id'=>'char', 'name'=>'char');
|
|
||||||
foreach($parameters->CC as $item){
|
|
||||||
$row = explode('|', $item);
|
|
||||||
switch($row[0]){
|
|
||||||
case 'usr':
|
|
||||||
require_once('classes/model/Users.php');
|
|
||||||
$user = new Users();
|
|
||||||
|
|
||||||
if($row[1] == '-1'){
|
|
||||||
$value = '(Current Task User)';
|
|
||||||
} else {
|
|
||||||
$rec = $user->load($row[1]);
|
|
||||||
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'grp':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$group = new Groups();
|
|
||||||
$rec = $group->load($row[1]);
|
|
||||||
|
|
||||||
$value = strip_tags($rec->getGrpTitle());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'ext':
|
|
||||||
$value = htmlentities($row[1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'dyn':
|
|
||||||
$value = htmlentities('@#'.$row[1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$paramCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_DBArray['eventomsgcc'] = $paramCC;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$_DBArray['eventomsgcc'] = Array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($parameters->BCC)){
|
|
||||||
$paramBCC[] = Array('id'=>'char', 'name'=>'char');
|
|
||||||
foreach($parameters->BCC as $item){
|
|
||||||
$row = explode('|', $item);
|
|
||||||
switch($row[0]){
|
|
||||||
case 'usr':
|
|
||||||
require_once('classes/model/Users.php');
|
|
||||||
$user = new Users();
|
|
||||||
|
|
||||||
if($row[1] == '-1'){
|
|
||||||
$value = '(Current Task User)';
|
|
||||||
} else {
|
|
||||||
$rec = $user->load($row[1]);
|
|
||||||
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'grp':
|
|
||||||
G::LoadClass('groups');
|
|
||||||
$group = new Groups();
|
|
||||||
$rec = $group->load($row[1]);
|
|
||||||
|
|
||||||
$value = strip_tags($rec->getGrpTitle());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'ext':
|
|
||||||
$value = htmlentities($row[1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'dyn':
|
|
||||||
$value = htmlentities('@#'.$row[1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$paramBCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_DBArray['eventomsgbcc'] = $paramBCC;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$_DBArray['eventomsgbcc'] = Array();
|
|
||||||
}
|
|
||||||
$aFields['EVN_MESSAGE_TO_TO'] = $paramTO;
|
|
||||||
$aFields['EVN_MESSAGE_TO_CC'] = (isset($parameters->CC) ? $paramCC : '');
|
|
||||||
$aFields['EVN_MESSAGE_TO_BCC'] = (isset($parameters->BCC) ? $paramBCC : '');
|
|
||||||
$aFields['EVN_MESSAGE_TEMPLATE'] = (isset($parameters->TEMPLATE) ? $parameters->TEMPLATE : '');
|
|
||||||
|
|
||||||
|
|
||||||
$aTemplates = array();
|
|
||||||
$aTemplates[] = array('TEMPLATE1' => 'char',
|
|
||||||
'TEMPLATE2' => 'char');
|
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $aFields['PRO_UID'] . PATH_SEP;
|
|
||||||
G::verifyPath($sDirectory, true);
|
|
||||||
if (!file_exists($sDirectory . 'alert_message.html')) {
|
|
||||||
@copy(PATH_TPL . 'mails' . PATH_SEP . 'alert_message.html', $sDirectory . 'alert_message.html');
|
|
||||||
}
|
|
||||||
$oDirectory = dir($sDirectory);
|
|
||||||
while ($sObject = $oDirectory->read()) {
|
|
||||||
if (($sObject !== '.') && ($sObject !== '..') && ($sObject !== 'alert_message.html')) {
|
|
||||||
$aTemplates[] = array('TEMPLATE1' => $sObject,
|
|
||||||
'TEMPLATE2' => $sObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$_DBArray['templates'] = $aTemplates;
|
|
||||||
|
|
||||||
$aTriggers[] = array('TRI_UID' => 'char',
|
|
||||||
'TRI_TITLE' => 'char');
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new ProcessMap();
|
|
||||||
$oDataset = TriggersPeer::doSelectRS($oProcessMap->getTriggersCriteria($aFields['PRO_UID']));
|
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$oDataset->next();
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
|
||||||
$aTriggers[] = array('TRI_UID' => $aRow['TRI_UID'],
|
|
||||||
'TRI_TITLE' => $aRow['TRI_TITLE']);
|
|
||||||
$oDataset->next();
|
|
||||||
}
|
|
||||||
$_DBArray['triggers'] = $aTriggers;
|
|
||||||
|
|
||||||
$_SESSION['_DBArray'] = $_DBArray;
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
|
|
||||||
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
|
|
||||||
function replaceQuotes($aData){
|
|
||||||
return str_replace('"', '"e;', $aData);
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* cases_Events_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 {
|
|
||||||
$oJSON = new Services_JSON();
|
|
||||||
if ( isset ($_POST['sData']) ) {
|
|
||||||
$oData = $oJSON->decode($_POST['sData']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Convert Object into Array
|
|
||||||
foreach($oData as $key=>$value)
|
|
||||||
{
|
|
||||||
$aData[$key] = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once 'classes/model/Event.php';
|
|
||||||
|
|
||||||
$oEvent = new Event();
|
|
||||||
if (!isset($aData['EVN_UID']) && $aData['EVN_UID'] == '' ) {
|
|
||||||
$sEventUid = $oEvent->create($aData);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$sEventUid = $oEvent->update($aData);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$_SESSION['EVN_UID'] = $sEventUid;
|
|
||||||
echo "{success: true,data:'.$sEventUid.'}";
|
|
||||||
//G::header('location: cases_Scheduler_List');
|
|
||||||
}
|
|
||||||
catch (Exception $oException) {
|
|
||||||
die($oException->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['tid'] ) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtStepsCriteria($_GET['tid']); //Getting all assigned steps on a task
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
$steps = array();
|
|
||||||
|
|
||||||
//@@stepsChildren is an array that stores before and after triggers tree data for a step
|
|
||||||
$stepsChildren = array();
|
|
||||||
$assignChildren = array();
|
|
||||||
|
|
||||||
//@@assignTaskChildren is an array that stores Before Assignment,Before Derivation and After Derivation triggers tree data for assigned task
|
|
||||||
$assignTaskChildren = array();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Creating steps array for populating tree depending on count of assigned steps to a task
|
|
||||||
for($i=0;$i<count($rows);$i++)
|
|
||||||
{
|
|
||||||
//Getting beforeTriggersCount for a step
|
|
||||||
$beforeTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeTriggersCount = StepTriggerPeer::doCount($beforeTriggers);
|
|
||||||
|
|
||||||
//Getting afterTriggersCount for a step
|
|
||||||
$afterTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'AFTER');
|
|
||||||
$afterTriggersCount = StepTriggerPeer::doCount($afterTriggers);
|
|
||||||
|
|
||||||
$iTotal = $beforeTriggersCount + $afterTriggersCount;
|
|
||||||
|
|
||||||
//Tree level 3 nodes i.e. final nodes (Leaf Nodes)
|
|
||||||
$beforeTriggerChildren[0] = array(
|
|
||||||
'text' => 'Assign / Show Before Triggers',
|
|
||||||
'id' => $rows[$i]['STEP_UID'].'|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$afterTriggerChildren[0] = array(
|
|
||||||
'text' => 'Assign / Show After Triggers',
|
|
||||||
'id' => $rows[$i]['STEP_UID'].'|AFTER',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
//Tree level 2 nodes i.e. Before and After Triggers for level 1 nodes
|
|
||||||
$stepsChildren[0] = array(
|
|
||||||
'text' => 'Before - Triggers ('.$beforeTriggersCount.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'].'-BEFORE',
|
|
||||||
'children' => $beforeTriggerChildren
|
|
||||||
);
|
|
||||||
$stepsChildren[1] = array(
|
|
||||||
'text' => 'After - Triggers ('.$afterTriggersCount.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'].'-AFTER',
|
|
||||||
'children' => $afterTriggerChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
//Tree level 1 nodes (Main steps)
|
|
||||||
$steps[] = array(
|
|
||||||
'text' => $rows[$i]['STEP_TITLE'].' - Triggers ('.$iTotal.')',
|
|
||||||
//'id' => 'ssaas',
|
|
||||||
'children' => $stepsChildren
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Creating tree for Assign Task Step
|
|
||||||
$beforeAssignmentChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-1|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$beforeDerivationChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-2|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$afterDerivationChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-2|AFTER',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
//Getting counts for Before Assignment,Before Derivation and After Derivation triggers for a step
|
|
||||||
$beforeAssignmentTriggers = $oProcessMap->getStepTriggersCriteria('-1', $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeAssignmentTriggersCount = StepTriggerPeer::doCount($beforeAssignmentTriggers);
|
|
||||||
|
|
||||||
$beforeDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeDerivationTriggersCount = StepTriggerPeer::doCount($beforeDerivationTriggers);
|
|
||||||
|
|
||||||
$afterDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'AFTER');
|
|
||||||
$afterDerivationTriggersCount = StepTriggerPeer::doCount($afterDerivationTriggers);
|
|
||||||
|
|
||||||
$iTotal = $beforeAssignmentTriggersCount + $beforeDerivationTriggersCount + $afterDerivationTriggersCount;
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'Before Assignment - Triggers ('.$beforeAssignmentTriggersCount.')',
|
|
||||||
'children' => $beforeAssignmentChildren
|
|
||||||
);
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'Before Derivation - Triggers ('.$beforeDerivationTriggersCount.')',
|
|
||||||
'children' => $beforeDerivationChildren
|
|
||||||
);
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'After Derivation - Triggers ('.$afterDerivationTriggersCount.')',
|
|
||||||
'children' => $afterDerivationChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
//Adding last value in an array for "Assign Task"
|
|
||||||
$steps[] = array(
|
|
||||||
'text' => '[ Assign Task ] - Triggers ('.$iTotal.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'],
|
|
||||||
'children' => $assignTaskChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
/* $nodes = "[{
|
|
||||||
text: 'Step 1 - Triggers (0)',
|
|
||||||
cls: 'blank',
|
|
||||||
iconCls: 'blank',
|
|
||||||
children: [{
|
|
||||||
text: 'Before - Triggers (0)',
|
|
||||||
cls: 'blank',
|
|
||||||
iconCls: 'blank',
|
|
||||||
children: [{
|
|
||||||
text: 'Assign Before Trigger',
|
|
||||||
leaf: true,
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
text: 'After - Triggers (0)',
|
|
||||||
leaf: true,
|
|
||||||
cls: 'blank',
|
|
||||||
iconCls: 'blank',
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
text: 'Step 2 - Triggers (0)',
|
|
||||||
|
|
||||||
children: [{
|
|
||||||
text: 'Before - Triggers (0)',
|
|
||||||
leaf: true,
|
|
||||||
|
|
||||||
},{
|
|
||||||
text: 'After - Triggers (0)',
|
|
||||||
leaf: true,
|
|
||||||
|
|
||||||
}]
|
|
||||||
},{
|
|
||||||
text: 'Assign Task - Triggers(0)',
|
|
||||||
|
|
||||||
children: [{
|
|
||||||
text: 'Before Assigment - Triggers(0)',
|
|
||||||
leaf: true,
|
|
||||||
|
|
||||||
},{
|
|
||||||
text: 'Before Derivation - Triggers(0)',
|
|
||||||
leaf: true,
|
|
||||||
|
|
||||||
},{
|
|
||||||
text: 'After Derivation - Triggers(0)',
|
|
||||||
leaf: true,
|
|
||||||
|
|
||||||
}]
|
|
||||||
}]";*/
|
|
||||||
//echo $nodes;
|
|
||||||
echo G::json_encode($steps);
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
$start = isset($_POST['start'])? $_POST['start']: 0;
|
|
||||||
$limit = isset($_POST['limit'])? $_POST['limit']: '';
|
|
||||||
if ( isset($_GET['tid'] ) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtStepsCriteria($start, $limit, $_GET['tid']); //Getting all assigned steps on a task
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
$steps = array();
|
|
||||||
|
|
||||||
//@@stepsChildren is an array that stores before and after triggers tree data for a step
|
|
||||||
$stepsChildren = array();
|
|
||||||
$assignChildren = array();
|
|
||||||
|
|
||||||
//@@assignTaskChildren is an array that stores Before Assignment,Before Derivation and After Derivation triggers tree data for assigned task
|
|
||||||
$assignTaskChildren = array();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Creating steps array for populating tree depending on count of assigned steps to a task
|
|
||||||
for($i=0;$i<count($rows);$i++)
|
|
||||||
{
|
|
||||||
//Getting beforeTriggersCount for a step
|
|
||||||
$beforeTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeTriggersCount = StepTriggerPeer::doCount($beforeTriggers);
|
|
||||||
|
|
||||||
//Getting afterTriggersCount for a step
|
|
||||||
$afterTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'AFTER');
|
|
||||||
$afterTriggersCount = StepTriggerPeer::doCount($afterTriggers);
|
|
||||||
|
|
||||||
$iTotal = $beforeTriggersCount + $afterTriggersCount;
|
|
||||||
|
|
||||||
//Tree level 3 nodes i.e. final nodes (Leaf Nodes)
|
|
||||||
$beforeTriggerChildren[0] = array(
|
|
||||||
'text' => 'Assign / Show Before Triggers',
|
|
||||||
'id' => $rows[$i]['STEP_UID'].'|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$afterTriggerChildren[0] = array(
|
|
||||||
'text' => 'Assign / Show After Triggers',
|
|
||||||
'id' => $rows[$i]['STEP_UID'].'|AFTER',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
//Tree level 2 nodes i.e. Before and After Triggers for level 1 nodes
|
|
||||||
$stepsChildren[0] = array(
|
|
||||||
'text' => 'Before - Triggers ('.$beforeTriggersCount.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'].'-BEFORE',
|
|
||||||
'children' => $beforeTriggerChildren
|
|
||||||
);
|
|
||||||
$stepsChildren[1] = array(
|
|
||||||
'text' => 'After - Triggers ('.$afterTriggersCount.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'].'-AFTER',
|
|
||||||
'children' => $afterTriggerChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
//Tree level 1 nodes (Main steps)
|
|
||||||
$steps[] = array(
|
|
||||||
'text' => $rows[$i]['STEP_TITLE'].' - Triggers ('.$iTotal.')',
|
|
||||||
//'id' => 'ssaas',
|
|
||||||
'children' => $stepsChildren
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Creating tree for Assign Task Step
|
|
||||||
$beforeAssignmentChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-1|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$beforeDerivationChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-2|BEFORE',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
$afterDerivationChildren[] = array(
|
|
||||||
'text' => 'Assign / Show Triggers',
|
|
||||||
'id' => '-2|AFTER',
|
|
||||||
'leaf' => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
//Getting counts for Before Assignment,Before Derivation and After Derivation triggers for a step
|
|
||||||
$beforeAssignmentTriggers = $oProcessMap->getStepTriggersCriteria('-1', $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeAssignmentTriggersCount = StepTriggerPeer::doCount($beforeAssignmentTriggers);
|
|
||||||
|
|
||||||
$beforeDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'BEFORE');
|
|
||||||
$beforeDerivationTriggersCount = StepTriggerPeer::doCount($beforeDerivationTriggers);
|
|
||||||
|
|
||||||
$afterDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'AFTER');
|
|
||||||
$afterDerivationTriggersCount = StepTriggerPeer::doCount($afterDerivationTriggers);
|
|
||||||
|
|
||||||
$iTotal = $beforeAssignmentTriggersCount + $beforeDerivationTriggersCount + $afterDerivationTriggersCount;
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'Before Assignment - Triggers ('.$beforeAssignmentTriggersCount.')',
|
|
||||||
'children' => $beforeAssignmentChildren
|
|
||||||
);
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'Before Derivation - Triggers ('.$beforeDerivationTriggersCount.')',
|
|
||||||
'children' => $beforeDerivationChildren
|
|
||||||
);
|
|
||||||
$assignTaskChildren[] = array(
|
|
||||||
'text' => 'After Derivation - Triggers ('.$afterDerivationTriggersCount.')',
|
|
||||||
'children' => $afterDerivationChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
//Adding last value in an array for "Assign Task"
|
|
||||||
$steps[] = array(
|
|
||||||
'text' => '[ Assign Task ] - Triggers ('.$iTotal.')',
|
|
||||||
//'id' => $rows[$i]['STEP_UID'],
|
|
||||||
'children' => $assignTaskChildren
|
|
||||||
);
|
|
||||||
|
|
||||||
echo G::json_encode($steps);
|
|
||||||
@@ -1,272 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* openProcess.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
G::LoadClass('xpdl');
|
|
||||||
$processUID = $_REQUEST['PRO_UID'];
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
$fields = $oProcess->serializeProcess($processUID);
|
|
||||||
$oData = unserialize($fields);
|
|
||||||
$arrayTasks = array();
|
|
||||||
$countTasks = 0;
|
|
||||||
$countSubProcess= 0;
|
|
||||||
$arrayEvents = array();
|
|
||||||
$arraySubProcess= array();
|
|
||||||
$count = 0;
|
|
||||||
$countRoutes = 0;
|
|
||||||
$arrayRoutes = array();
|
|
||||||
$process = array();
|
|
||||||
$process = $oProcess->createProcessPM($oData->process);
|
|
||||||
foreach($oData->tasks as $id => $value)
|
|
||||||
{
|
|
||||||
if($value['TAS_TYPE'] == 'SUBPROCESS'){
|
|
||||||
$arraySubProcess[$countSubProcess]['0'] = $value['TAS_UID'];
|
|
||||||
$arraySubProcess[$countSubProcess]['1'] = $value['TAS_TITLE'];
|
|
||||||
$arraySubProcess[$countSubProcess]['2'] = $value['TAS_POSX'];
|
|
||||||
$arraySubProcess[$countSubProcess]['3'] = $value['TAS_POSY'];
|
|
||||||
$countSubProcess = $countSubProcess + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$arrayTasks[$countTasks]['0'] = $value['TAS_UID'];
|
|
||||||
$arrayTasks[$countTasks]['1'] = $value['TAS_TITLE'];
|
|
||||||
$arrayTasks[$countTasks]['2'] = $value['TAS_POSX'];
|
|
||||||
$arrayTasks[$countTasks]['3'] = $value['TAS_POSY'];
|
|
||||||
$arrayTasks[$countTasks]['4'] = $value['TAS_WIDTH'];
|
|
||||||
$arrayTasks[$countTasks]['5'] = $value['TAS_HEIGHT'];
|
|
||||||
$arrayTasks[$countTasks]['6'] = $value['TAS_BOUNDARY'];
|
|
||||||
if($value['TAS_START'] == 'TRUE'){
|
|
||||||
$arrayEvents[$count]['0'] = G::generateUniqueID();
|
|
||||||
if($value['TAS_EVN_UID'] == '')
|
|
||||||
{
|
|
||||||
$arrayEvents[$count]['1'] = 'bpmnEventEmptyStart';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach($oData->event as $eventid => $val){
|
|
||||||
if($val['EVN_UID'] == $value['TAS_EVN_UID'])
|
|
||||||
{
|
|
||||||
$arrayEvents[$count]['0'] = $val['EVN_UID'];
|
|
||||||
$arrayEvents[$count]['1'] = $val['EVN_TYPE'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$arrayEvents[$count]['2'] = $value['TAS_POSX']+68;
|
|
||||||
$arrayEvents[$count]['3'] = $value['TAS_POSY']-50;
|
|
||||||
$arrayEvents[$count]['4'] = $value['TAS_UID'];
|
|
||||||
$arrayRoutes[$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$arrayRoutes[$countRoutes]['1']= $arrayEvents[$count]['0'];
|
|
||||||
$arrayRoutes[$countRoutes]['2']= $value['TAS_UID'];
|
|
||||||
$arrayRoutes[$countRoutes]['3']= '1';
|
|
||||||
$arrayRoutes[$countRoutes]['4']= '2';
|
|
||||||
$count = $count+ 1;
|
|
||||||
$countRoutes = $countRoutes+ 1;
|
|
||||||
}
|
|
||||||
$countTasks = $countTasks + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$lanes = $oProcess->createLanesNewPM($oData->lanes);
|
|
||||||
$fields = $oProcess->createTransitionsPM($oData->tasks,$oData->routes,$arrayEvents,$count,$arrayRoutes,$countRoutes);
|
|
||||||
|
|
||||||
|
|
||||||
//Get Standalone Events and routes
|
|
||||||
$countEvent = count($fields['EVENTS']);
|
|
||||||
$countRoutes = count($fields['TRANSITION']);
|
|
||||||
foreach($oData->event as $id => $value)
|
|
||||||
{
|
|
||||||
if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && $value['EVN_TAS_UID_TO'] != ''){ //Check for Intermediate Events
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTaskFrom = $value['EVN_TAS_UID_FROM'];
|
|
||||||
$idTaskTo = $value['EVN_TAS_UID_TO'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $idTaskFrom;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '1';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '2';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $idTaskTo;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '2';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '1';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_TO'] != '' && ! preg_match("/Start/", $value['EVN_TYPE'])){
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTask = $value['EVN_TAS_UID_TO'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $idTask;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '2';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '1';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && ! preg_match("/End/", $value['EVN_TYPE'])){ //Check for Intermediate Events
|
|
||||||
$evn_uid = $value['EVN_UID'];
|
|
||||||
$idTask = $value['EVN_TAS_UID_FROM'];
|
|
||||||
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countRoutes]['1']= $idTask;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
|
|
||||||
$fields['TRANSITION'][$countRoutes]['3']= '1';
|
|
||||||
$fields['TRANSITION'][$countRoutes]['4']= '2';
|
|
||||||
$countRoutes = $countRoutes + 1;
|
|
||||||
}
|
|
||||||
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] == '' && $value['EVN_TAS_UID_TO'] == ''){
|
|
||||||
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
|
|
||||||
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
|
|
||||||
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
|
|
||||||
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
|
|
||||||
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
|
|
||||||
$countEvent = $countEvent + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get all the standalone Gateway
|
|
||||||
$countGateway = count($fields['GATEWAYS']);
|
|
||||||
$countTransitions = count($fields['TRANSITION']);
|
|
||||||
|
|
||||||
foreach($oData->gateways as $id => $value)
|
|
||||||
{
|
|
||||||
if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] != '' && $value['GAT_TYPE'] != ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['TAS_UID'];
|
|
||||||
$countGateway+=1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countTransitions += 1;
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '2';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '1';
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
//creating gateway and route from gateway to task i.e if target task is not NULL
|
|
||||||
else if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] == ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '2';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '1';
|
|
||||||
$countGateway+=1;
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
//creating gateway and route from task to gateway i.e if source task is not NULL
|
|
||||||
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] != ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
|
|
||||||
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countGateway+=1;
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] == ''){
|
|
||||||
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
|
|
||||||
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
|
|
||||||
$countGateway += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Create Annotation route
|
|
||||||
foreach($oData->lanes as $id => $value)
|
|
||||||
{
|
|
||||||
if($value['SWI_NEXT_UID'] != '') {
|
|
||||||
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
|
|
||||||
$fields['TRANSITION'][$countTransitions]['1'] = $value['SWI_NEXT_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['2'] = $value['SWI_UID'];
|
|
||||||
$fields['TRANSITION'][$countTransitions]['3'] = '1';
|
|
||||||
$fields['TRANSITION'][$countTransitions]['4'] = '2';
|
|
||||||
$countTransitions += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//$subProcess = $oProcess->createSubProcessesPM($oData->subProcess);
|
|
||||||
$arrayEvents = $fields['EVENTS'];
|
|
||||||
$arrayGateways = $fields['GATEWAYS'];
|
|
||||||
$arrayRoutes = $fields['TRANSITION'];
|
|
||||||
$result['TASKS'] = $arrayTasks;
|
|
||||||
$result['ROUTES'] = $arrayRoutes;
|
|
||||||
$result['EVENTS'] = $arrayEvents;
|
|
||||||
$result['GATEWAYS'] = $arrayGateways;
|
|
||||||
$aTasks = G::json_encode($arrayTasks);
|
|
||||||
$aSubProcess = G::json_encode($arraySubProcess);
|
|
||||||
$aRoutes = G::json_encode($arrayRoutes);
|
|
||||||
$aEvents = G::json_encode($arrayEvents);
|
|
||||||
$aGateways = G::json_encode($arrayGateways);
|
|
||||||
$aProcess = G::json_encode($process);
|
|
||||||
$aLanes = G::json_encode($lanes);
|
|
||||||
echo "tasks:$aTasks|gateways:$aGateways|events:$aEvents|annotations:$aLanes|process:$aProcess|subprocess:$aSubProcess|routes:$aRoutes";
|
|
||||||
?>
|
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* patterns_Ajax.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
G::LoadInclude('ajax');
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oJSON = new Services_JSON();
|
|
||||||
if(isset($_POST['mode']) && $_POST['mode'] != '')
|
|
||||||
{
|
|
||||||
$aData = $_POST;
|
|
||||||
$aData['TASK'] = $oJSON->decode($_POST['TASK']);
|
|
||||||
$aData['ROU_NEXT_TASK'] = $oJSON->decode($_POST['ROU_NEXT_TASK']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Saving Gateway details into Gateway table
|
|
||||||
if($aData['ROU_TYPE'] != 'SEQUENTIAL')
|
|
||||||
{
|
|
||||||
$oProcessMap = new processMap();
|
|
||||||
//$sGatewayUID = $oProcessMap->saveNewGateway($aData['PROCESS'], $aData['TASK'][0], $aData['ROU_NEXT_TASK'][0]);
|
|
||||||
require_once 'classes/model/Gateway.php';
|
|
||||||
$oGateway = new Gateway ( );
|
|
||||||
|
|
||||||
$aGatewayFields = array();
|
|
||||||
$aGatewayFields['GAT_UID'] = $aData['GAT_UID'];
|
|
||||||
$aGatewayFields['TAS_UID'] = $aData['TASK'][0];
|
|
||||||
$aGatewayFields['GAT_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
|
|
||||||
$aGatewayFields['GAT_TYPE'] = '';
|
|
||||||
$oGateway->update($aGatewayFields);
|
|
||||||
//$sGatewayUID = $oProcessMap->saveNewGateway($aData['PROCESS'], $aData['TASK'][0], $aData['ROU_NEXT_TASK'][0]);
|
|
||||||
//echo $sGatewayUID.'|';
|
|
||||||
}
|
|
||||||
//else
|
|
||||||
// echo $aData['ROU_EVN_UID'].'|'; //sending route_event_uid in response
|
|
||||||
|
|
||||||
G::LoadClass('tasks');
|
|
||||||
$oTasks = new Tasks();
|
|
||||||
$rou_id = 0;
|
|
||||||
$aFields['GAT_UID'] = $aData['GAT_UID'];
|
|
||||||
switch ($aData['action']) {
|
|
||||||
case 'savePattern':
|
|
||||||
foreach ($aData['TASK'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$oTasks->deleteAllRoutesOfTask($aData['PROCESS'], $aRow);
|
|
||||||
}
|
|
||||||
require_once 'classes/model/Route.php';
|
|
||||||
require_once 'classes/model/Event.php';
|
|
||||||
$oEvent = new Event ( );
|
|
||||||
$oRoute = new Route();
|
|
||||||
switch ($aData['ROU_TYPE']) {
|
|
||||||
case 'SEQUENTIAL':
|
|
||||||
case 'SEC-JOIN':
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aData['TASK'][0];
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
if(isset($aData['ROU_EVN_UID']) && $aData['ROU_EVN_UID'] != ''){
|
|
||||||
$aFields['ROU_EVN_UID'] = $aData['ROU_EVN_UID'];
|
|
||||||
$aDataEvent = array();
|
|
||||||
$aDataEvent['EVN_UID'] = $aData['ROU_EVN_UID'];
|
|
||||||
$aDataEvent['EVN_TAS_UID_FROM'] = $aData['TASK'][0];
|
|
||||||
$aDataEvent['EVN_RELATED_TO'] = 'MULTIPLE';
|
|
||||||
$oEvent->update($aDataEvent);
|
|
||||||
}
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
|
|
||||||
$rou_id = $oRoute->create($aFields);
|
|
||||||
break;
|
|
||||||
case 'SELECT':
|
|
||||||
foreach ($aData['GRID_SELECT_TYPE'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aData['TASK'];
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aRow;
|
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
|
|
||||||
$rou_id = $oRoute->create($aFields);
|
|
||||||
unset($aFields);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'EVALUATE':
|
|
||||||
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aData['TASK'][0];
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aRow;
|
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
|
||||||
$aFields['GAT_UID'] = $aData['GAT_UID'];
|
|
||||||
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
|
|
||||||
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
|
||||||
$rou_id = $oRoute->create($aFields);
|
|
||||||
unset($aFields);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'PARALLEL':
|
|
||||||
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aData['TASK'][0];
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aRow;
|
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
$aFields['GAT_UID'] = $aData['GAT_UID'];;
|
|
||||||
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT']= $aData['PORT_NUMBER_OP'];
|
|
||||||
|
|
||||||
$rou_id = $oRoute->create($aFields);
|
|
||||||
unset($aFields);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'PARALLEL-BY-EVALUATION':
|
|
||||||
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aData['TASK'][0];
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aRow;
|
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
$aFields['GAT_UID'] = $aData['GAT_UID'];;
|
|
||||||
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT']= $aData['PORT_NUMBER_OP'];
|
|
||||||
$rou_id = $oRoute->create($aFields);
|
|
||||||
unset($aFields);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route
|
|
||||||
foreach ($aData['TASK'] as $iKey => $aRow)
|
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
|
||||||
$aFields['TAS_UID'] = $aRow;
|
|
||||||
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
|
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
|
||||||
$aFields['GAT_UID'] = $aData['GAT_UID'];;
|
|
||||||
|
|
||||||
if(isset($aData['PORT_NUMBER_IP']))
|
|
||||||
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
|
|
||||||
if(isset($aData['PORT_NUMBER_OP']))
|
|
||||||
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
|
|
||||||
$routeData = $oTasks->getRouteByType($aData['PROCESS'], $aData['ROU_NEXT_TASK'][0], $aData['ROU_TYPE']);
|
|
||||||
foreach($routeData as $route)
|
|
||||||
{
|
|
||||||
$sFields['ROU_UID'] = $route['ROU_UID'];
|
|
||||||
$rou_id = $oRoute->update($sFields);
|
|
||||||
}
|
|
||||||
$rou_id =$oRoute->create($aFields);
|
|
||||||
unset($aFields);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
echo $rou_id;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,398 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* processes_Ajax.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
G::LoadInclude('ajax');
|
|
||||||
$oJSON = new Services_JSON();
|
|
||||||
if ( isset ($_REQUEST['data']) ) {
|
|
||||||
$oData = $oJSON->decode(stripslashes($_REQUEST['data']));
|
|
||||||
$sOutput = '';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!isset($_POST['form'])) {
|
|
||||||
$aData = urldecode_values($_POST);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$aData = urldecode_values($_POST['form']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
require_once 'classes/model/Task.php';
|
|
||||||
require_once 'classes/model/Event.php';
|
|
||||||
$oEvent = new Event();
|
|
||||||
$oTask = new Task();
|
|
||||||
if ( isset ($_REQUEST['action']) ) {
|
|
||||||
switch($_REQUEST['action'])
|
|
||||||
{
|
|
||||||
case 'load':
|
|
||||||
$sOutput = $oProcessMap->load($oData->uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'addTask':
|
|
||||||
$sOutput = $oProcessMap->addTask($oData->uid, $oData->position->x, $oData->position->y,$oData->cordinate->x,$oData->cordinate->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveTaskPosition':
|
|
||||||
$sOutput = $oProcessMap->saveTaskPosition($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveEventPosition':
|
|
||||||
$sOutput = $oProcessMap->saveEventPosition($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveGatewayPosition':
|
|
||||||
$sOutput = $oProcessMap->saveGatewayPosition($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
//echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveTaskCordinates':
|
|
||||||
$sOutput = $oProcessMap->saveTaskCordinates($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveAnnotationCordinates':
|
|
||||||
$sOutput = $oProcessMap->saveAnnotationCordinates($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'deleteTask':
|
|
||||||
$sOutput = $oProcessMap->deleteTask($oData->tas_uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'addGateway':
|
|
||||||
$sOutput = $oProcessMap->addGateway($oData);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'deleteGateway':
|
|
||||||
$sOutput = $oProcessMap->deleteGateway($oData->pro_uid, $oData->gat_uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'updateTaskName':
|
|
||||||
$aTask['TAS_UID'] = $oData->uid;
|
|
||||||
$aTask['TAS_TITLE'] = $oData->label;
|
|
||||||
$oTask->update($aTask);
|
|
||||||
break;
|
|
||||||
case 'updateTask':
|
|
||||||
$aTask['TAS_UID'] = $oData->uid;
|
|
||||||
$aTask['TAS_BOUNDARY'] = $oData->boundary;
|
|
||||||
$oTask->update($aTask);
|
|
||||||
$sOutput = $oJSON->encode($oData);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'addSubProcess':
|
|
||||||
$sOutput = $oProcessMap->addSubProcess($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'deleteSubProcess':
|
|
||||||
$sOutput = $oProcessMap->deleteSubProcess($oData->pro_uid, $oData->tas_uid);
|
|
||||||
break;
|
|
||||||
case 'addText':
|
|
||||||
$sOutput = $oProcessMap->addText($oData->uid, $oData->label, $oData->position->x, $oData->position->y,$oData->task_uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'updateText':
|
|
||||||
$sOutput = $oProcessMap->updateText($oData->uid, $oData->label, $oData->next_uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveTextPosition':
|
|
||||||
$sOutput = $oProcessMap->saveTextPosition($oData->uid, $oData->position->x, $oData->position->y);
|
|
||||||
break;
|
|
||||||
case 'deleteText':
|
|
||||||
$sOutput = $oProcessMap->deleteText($oData->uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'getProcesses':
|
|
||||||
$sOutput = $oProcessMap->getAllProcesses();
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'dynaforms':
|
|
||||||
$sOutput = $oProcessMap->getDynaformList($oData->uid);
|
|
||||||
$sOutput = $oJSON->encode($sOutput);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'webEntry_validate':
|
|
||||||
include(PATH_METHODS . 'processes/processes_webEntryValidate.php');
|
|
||||||
break;
|
|
||||||
case 'webEntry_generate':
|
|
||||||
include(PATH_METHODS . 'processes/processes_webEntryGenerate.php');
|
|
||||||
break;
|
|
||||||
case 'webEntry':
|
|
||||||
$sOutput = $oProcessMap->listNewWebEntry($oData->uid,$oData->evn_uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'loadTask':
|
|
||||||
$oOutput = $oTask->load($oData->uid);
|
|
||||||
$sOutput = $oJSON->encode($oOutput);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'assignProcessUser':
|
|
||||||
$oProcessMap->assignProcessUser($oData->PRO_UID, $oData->USR_UID);
|
|
||||||
break;
|
|
||||||
case 'removeProcessUser':
|
|
||||||
$oProcessMap->removeProcessUser($oData->PU_UID);
|
|
||||||
break;
|
|
||||||
case 'saveInterMessageEvent':
|
|
||||||
$aData['TAS_UID'] = $oData->uid;
|
|
||||||
$aData['TAS_SEND_LAST_EMAIL'] = strtoupper($oData->tas_send);
|
|
||||||
$aData['TAS_DEF_MESSAGE'] = $oData->data;
|
|
||||||
if(isset($aData['TAS_SEND_LAST_EMAIL']) && $aData['TAS_SEND_LAST_EMAIL'] == 'FALSE'){
|
|
||||||
$aData['TAS_DEF_MESSAGE'] = '';
|
|
||||||
}else{
|
|
||||||
$aData['TAS_DEF_MESSAGE'] = str_replace('@amp@', '&', $aData['TAS_DEF_MESSAGE']);
|
|
||||||
}
|
|
||||||
$sOutput = $oTask->update($aData);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'editObjectPermission':
|
|
||||||
// we also need the process uid variable for the function.
|
|
||||||
$oProcessMap->editObjectPermission($oData->op_uid,$oData->pro_uid);
|
|
||||||
break;
|
|
||||||
case 'triggersList':
|
|
||||||
$sOutput = $oProcessMap->getTriggers($oData->pro_uid);
|
|
||||||
$sOutput = $oJSON->encode($sOutput);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'loadCategory':
|
|
||||||
$sOutput = $oProcessMap->loadProcessCategory();
|
|
||||||
$sOutput = $oJSON->encode($sOutput);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'saveProcess':
|
|
||||||
$aData['PRO_UID'] = $oData->PRO_UID;
|
|
||||||
$aData['PRO_CALENDAR'] = $oData->PRO_CALENDAR;
|
|
||||||
$aData['PRO_CATEGORY'] = $oData->PRO_CATEGORY;
|
|
||||||
$aData['PRO_DEBUG'] = $oData->PRO_DEBUG;
|
|
||||||
$aData['PRO_DESCRIPTION'] = $oData->PRO_DESCRIPTION;
|
|
||||||
$aData['PRO_TITLE'] = $oData->PRO_TITLE;
|
|
||||||
$sOutput = $oProcessMap->updateProcess($aData);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'saveStartEvent':
|
|
||||||
$aData['TAS_UID'] = $oData->tas_uid;
|
|
||||||
$aData['TAS_START'] = $oData->tas_start;
|
|
||||||
$aData['TAS_EVN_UID'] = '';
|
|
||||||
$oTask->update($aData);
|
|
||||||
break;
|
|
||||||
case 'deleteStartEvent':
|
|
||||||
$aData['TAS_UID'] = $oData->tas_uid;
|
|
||||||
$aData['TAS_START'] = $oData->tas_start;
|
|
||||||
$aData['TAS_EVN_UID'] = '';
|
|
||||||
$oTask->update($aData);
|
|
||||||
if(isset($oData->evn_uid))
|
|
||||||
$oEvent->remove($oData->evn_uid);
|
|
||||||
break;
|
|
||||||
case 'updateEvent':
|
|
||||||
$aData['EVN_UID'] = $oData->evn_uid;
|
|
||||||
$aData['EVN_TYPE'] = $oData->evn_type;
|
|
||||||
$oEvent = EventPeer::retrieveByPK($aData['EVN_UID']);
|
|
||||||
if (!is_null($oEvent))
|
|
||||||
$oEvent->update($aData);
|
|
||||||
break;
|
|
||||||
case 'saveEvents':
|
|
||||||
$sOutput = $oProcessMap->saveExtEvents($oData);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'addEvent':
|
|
||||||
$sOutput = $oProcessMap->saveExtddEvents($oData);
|
|
||||||
echo $sOutput;
|
|
||||||
/*
|
|
||||||
$aData['PRO_UID'] = $oData->uid;
|
|
||||||
$aData['EVN_TYPE'] = $oData->tas_type;
|
|
||||||
$aData['EVN_STATUS'] = 'ACTIVE';
|
|
||||||
$aData['EVN_WHEN'] = '1';
|
|
||||||
$aData['EVN_ACTION'] = '';
|
|
||||||
if(preg_match("/Inter/", $oData->tas_type)){
|
|
||||||
$aData['EVN_RELATED_TO'] = 'MULTIPLE';
|
|
||||||
$aData['EVN_TAS_UID_FROM'] = $oData->tas_from;
|
|
||||||
$aData['EVN_TAS_UID_TO'] = $oData->tas_to;
|
|
||||||
$sOutput = $oEvent->create($aData);
|
|
||||||
echo $sOutput;
|
|
||||||
}
|
|
||||||
//Code for Start Events only
|
|
||||||
if(preg_match("/Start/", $oData->tas_type)){
|
|
||||||
$oEvn_uid='';
|
|
||||||
$aData['EVN_RELATED_TO'] = 'SINGLE';
|
|
||||||
$aData['TAS_UID'] = $oData->tas_uid;
|
|
||||||
$oTaskData = $oTask->load($aData['TAS_UID']);
|
|
||||||
if($oTaskData['TAS_EVN_UID'] == ''){
|
|
||||||
$oEvn_uid = $oEvent->create($aData);
|
|
||||||
}else{
|
|
||||||
$aData['EVN_UID'] = $oTaskData['TAS_EVN_UID'];
|
|
||||||
$oEvn_uid = $aData['EVN_UID'];
|
|
||||||
$oEvent->update($aData);
|
|
||||||
}
|
|
||||||
$aTask['TAS_UID'] = $oData->tas_uid;
|
|
||||||
$aTask['TAS_EVN_UID'] = $oEvn_uid;
|
|
||||||
$aTask['TAS_START'] = 'TRUE';
|
|
||||||
$oTask->update($aTask);
|
|
||||||
}*/
|
|
||||||
break;
|
|
||||||
case 'deleteRoute':
|
|
||||||
require_once 'classes/model/Route.php';
|
|
||||||
$oRoute = new Route();
|
|
||||||
$sOutput = $oRoute->remove($oData->uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'deleteEvent':
|
|
||||||
$sOutput = $oEvent->remove($oData->uid);
|
|
||||||
echo $sOutput;
|
|
||||||
break;
|
|
||||||
case 'assign':
|
|
||||||
G::LoadClass('tasks');
|
|
||||||
$oTasks = new Tasks();
|
|
||||||
switch ($oData->TU_RELATION) {
|
|
||||||
case 1:
|
|
||||||
echo $oTasks->assignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
echo $oTasks->assignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'ofToAssign':
|
|
||||||
G::LoadClass('tasks');
|
|
||||||
$oTasks = new Tasks();
|
|
||||||
switch ($oData->TU_RELATION) {
|
|
||||||
case 1:
|
|
||||||
echo $oTasks->ofToAssignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
echo $oTasks->ofToAssignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'saveSubprocessDetails':
|
|
||||||
//$aTask=$oTask->load($_POST['form']['TASKS']);
|
|
||||||
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
|
|
||||||
$out = array();
|
|
||||||
$in = array();
|
|
||||||
|
|
||||||
if(isset($_POST['VAR_OUT']) && $_POST['VAR_OUT'] != ''){
|
|
||||||
$varOut = explode('|',$_POST['VAR_OUT']);
|
|
||||||
$aVarOut1 = G::json_decode($varOut[0]);
|
|
||||||
$aVarOut2 = G::json_decode($varOut[1]);
|
|
||||||
for($i=1; $i<=count($aVarOut1); $i++){
|
|
||||||
$out[$aVarOut1[$i-1]]= $aVarOut2[$i-1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(isset($_POST['VAR_IN']) && $_POST['VAR_IN'] != ''){
|
|
||||||
$varIn = explode('|',$_POST['VAR_IN']);
|
|
||||||
$aVarIn1 = G::json_decode($varIn[0]);
|
|
||||||
$aVarIn2 = G::json_decode($varIn[1]);
|
|
||||||
for($i=1; $i<=count($aVarIn1); $i++){
|
|
||||||
$in[$aVarIn1[$i-1]]= $aVarIn2[$i-1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($_POST['VAR_IN'] == '')
|
|
||||||
$in[$_POST['VAR_IN']] = '';
|
|
||||||
|
|
||||||
//Getting first Tasks of selected process
|
|
||||||
$aNewCase = $oProcessMap->subProcess_TaskIni($_POST['PRO_UID']);
|
|
||||||
$i = 0;
|
|
||||||
foreach ($aNewCase as $aRow) {
|
|
||||||
if ($i > 0 && $aRow['pro_uid'] == $_POST['sProcessUID']) {
|
|
||||||
$sTASKS = $aRow['uid'];
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
//$aTask=($_POST['TASKS']!=0)?$oTask->load($_POST['TASKS']):0;
|
|
||||||
$aTask=($sTASKS!=0)?$oTask->load($sTASKS):0;
|
|
||||||
//$aTask['PRO_UID']=0;
|
|
||||||
|
|
||||||
if ( isset ( $_POST['SP_SYNCHRONOUS']) && $_POST['SP_SYNCHRONOUS'] == '' ) {
|
|
||||||
$_POST['SP_SYNCHRONOUS'] = '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !isset ( $_POST['SP_SYNCHRONOUS']) ) {
|
|
||||||
$_POST['SP_SYNCHRONOUS'] = '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once 'classes/model/SubProcess.php';
|
|
||||||
$oOP = new SubProcess();
|
|
||||||
$aData = array('SP_UID' => $_POST['SP_UID'],//G::generateUniqueID(),
|
|
||||||
'PRO_UID' => $aTask['PRO_UID'],
|
|
||||||
'TAS_UID' => $sTASKS,
|
|
||||||
'PRO_PARENT' => $_POST['PRO_PARENT'],
|
|
||||||
'TAS_PARENT' => $_POST['TAS_PARENT'],
|
|
||||||
'SP_TYPE' => 'SIMPLE',
|
|
||||||
'SP_SYNCHRONOUS' => $_POST['SP_SYNCHRONOUS'],
|
|
||||||
'SP_SYNCHRONOUS_TYPE' => 'ALL',
|
|
||||||
'SP_SYNCHRONOUS_WAIT' => 0,
|
|
||||||
'SP_VARIABLES_OUT' => serialize($out),
|
|
||||||
'SP_VARIABLES_IN' => serialize($in),
|
|
||||||
'SP_GRID_IN' => '');
|
|
||||||
|
|
||||||
$oOP->update($aData);
|
|
||||||
require_once 'classes/model/Content.php';
|
|
||||||
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
|
|
||||||
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
|
|
||||||
$cont = Content::addContent( 'TAS_TITLE', '', $_POST['TAS_PARENT'], $lang, $_POST['SPROCESS_NAME'] );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'subprocessProperties':
|
|
||||||
require_once 'classes/model/Content.php';
|
|
||||||
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
|
|
||||||
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
|
|
||||||
$cont = Content::addContent( 'TAS_TITLE', '', $_POST['TAS_PARENT'], $lang, $_POST['SPROCESS_NAME'] );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'deleteTriggers':
|
|
||||||
try{
|
|
||||||
require_once('classes/model/Triggers.php');
|
|
||||||
require_once('classes/model/StepTrigger.php');
|
|
||||||
$TRI_UIDS = explode(',', $_POST['TRI_UID']);
|
|
||||||
foreach($TRI_UIDS as $i=>$TRI_UID) {
|
|
||||||
$oTrigger = new Triggers();
|
|
||||||
$triggerObj=$oTrigger->load($TRI_UID);
|
|
||||||
$oTrigger->remove($TRI_UID);
|
|
||||||
|
|
||||||
$oStepTrigger = new StepTrigger();
|
|
||||||
$oStepTrigger->removeTrigger($TRI_UID);
|
|
||||||
}
|
|
||||||
$result->success = true;
|
|
||||||
$result->message = G::LoadTranslation('ID_TRIGGERS_REMOVED');
|
|
||||||
}
|
|
||||||
catch (Exception $e) {
|
|
||||||
$result->success = false;
|
|
||||||
$result->message = $e->getMessage();
|
|
||||||
}
|
|
||||||
print G::json_encode($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getOutputDocsTemplates':
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
|
||||||
$ooutputDocument = new OutputDocument();
|
|
||||||
if (isset($_GET['OUT_DOC_UID'])) {
|
|
||||||
$rows = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
Copyright (c) 2010, Andrew Rymarczyk
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and minified, compiled or otherwise obfuscated
|
|
||||||
form, with or without modification, are permitted provided that the following
|
|
||||||
conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in minified, compiled or otherwise obfuscated form must
|
|
||||||
reproduce the above copyright notice, this list of conditions and the
|
|
||||||
following disclaimer in the documentation and/or other materials
|
|
||||||
provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//$save_path = PATH_DATA_MAILTEMPLATES . '4601910684c597eab4810e6037370402' . PATH_SEP ;
|
|
||||||
$save_path = $_SERVER['DOCUMENT_ROOT'].'/uploads/';
|
|
||||||
$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format)
|
|
||||||
//$extension_whitelist = array('csv', 'gif', 'png','tif'); // Allowed file extensions
|
|
||||||
$MAX_FILENAME_LENGTH = 260;
|
|
||||||
|
|
||||||
$max_file_size_in_bytes = 2147483647; // 2GB in bytes
|
|
||||||
$upload_name = 'Filedata';
|
|
||||||
|
|
||||||
/*
|
|
||||||
This is an upload script for SWFUpload that attempts to properly handle uploaded files
|
|
||||||
in a secure way.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
SWFUpload doesn't send a MIME-TYPE. In my opinion this is ok since MIME-TYPE is no better than
|
|
||||||
file extension and is probably worse because it can vary from OS to OS and browser to browser (for the same file).
|
|
||||||
The best thing to do is content sniff the file but this can be resource intensive, is difficult, and can still be fooled or inaccurate.
|
|
||||||
Accepting uploads can never be 100% secure.
|
|
||||||
|
|
||||||
You can't guarantee that SWFUpload is really the source of the upload. A malicious user
|
|
||||||
will probably be uploading from a tool that sends invalid or false metadata about the file.
|
|
||||||
The script should properly handle this.
|
|
||||||
|
|
||||||
The script should not over-write existing files.
|
|
||||||
|
|
||||||
The script should strip away invalid characters from the file name or reject the file.
|
|
||||||
|
|
||||||
The script should not allow files to be saved that could then be executed on the webserver (such as .php files).
|
|
||||||
To keep things simple we will use an extension whitelist for allowed file extensions. Which files should be allowed
|
|
||||||
depends on your server configuration. The extension white-list is _not_ tied your SWFUpload file_types setting
|
|
||||||
|
|
||||||
For better security uploaded files should be stored outside the webserver's document root. Downloaded files
|
|
||||||
should be accessed via a download script that proxies from the file system to the webserver. This prevents
|
|
||||||
users from executing malicious uploaded files. It also gives the developer control over the outgoing mime-type,
|
|
||||||
access restrictions, etc. This, however, is outside the scope of this script.
|
|
||||||
|
|
||||||
SWFUpload sends each file as a separate POST rather than several files in a single post. This is a better
|
|
||||||
method in my opinions since it better handles file size limits, e.g., if post_max_size is 100 MB and I post two 60 MB files then
|
|
||||||
the post would fail (2x60MB = 120MB). In SWFupload each 60 MB is posted as separate post and we stay within the limits. This
|
|
||||||
also simplifies the upload script since we only have to handle a single file.
|
|
||||||
|
|
||||||
The script should properly handle situations where the post was too large or the posted file is larger than
|
|
||||||
our defined max. These values are not tied to your SWFUpload file_size_limit setting.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Check post_max_size (http://us3.php.net/manual/en/features.file-upload.php#73762)
|
|
||||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
|
||||||
$unit = strtoupper(substr($POST_MAX_SIZE, -1));
|
|
||||||
$multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
|
|
||||||
|
|
||||||
if ((int)$_SERVER['CONTENT_LENGTH'] > $multiplier*(int)$POST_MAX_SIZE && $POST_MAX_SIZE) {
|
|
||||||
//header("HTTP/1.1 500 Internal Server Error"); // This will trigger an uploadError event in SWFUpload
|
|
||||||
//echo "POST exceeded maximum allowed size.";
|
|
||||||
HandleError('POST exceeded maximum allowed size.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other variables
|
|
||||||
$file_name = '';
|
|
||||||
$file_extension = '';
|
|
||||||
$uploadErrors = array(
|
|
||||||
0=>'There is no error, the file uploaded with success',
|
|
||||||
1=>'The uploaded file exceeds the upload_max_filesize directive in php.ini',
|
|
||||||
2=>'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
|
||||||
3=>'The uploaded file was only partially uploaded',
|
|
||||||
4=>'No file was uploaded',
|
|
||||||
6=>'Missing a temporary folder'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Validate the upload
|
|
||||||
if (!isset($_FILES[$upload_name])) {
|
|
||||||
HandleError('No upload found in \$_FILES for ' . $upload_name);
|
|
||||||
} else if (isset($_FILES[$upload_name]["error"]) && $_FILES[$upload_name]["error"] != 0) {
|
|
||||||
HandleError($uploadErrors[$_FILES[$upload_name]["error"]]);
|
|
||||||
} else if (!isset($_FILES[$upload_name]["tmp_name"]) || !@is_uploaded_file($_FILES[$upload_name]["tmp_name"])) {
|
|
||||||
HandleError('Upload failed is_uploaded_file test.');
|
|
||||||
} else if (!isset($_FILES[$upload_name]['name'])) {
|
|
||||||
HandleError('File has no name.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate the file size (Warning: the largest files supported by this code is 2GB)
|
|
||||||
$file_size = @filesize($_FILES[$upload_name]["tmp_name"]);
|
|
||||||
if (!$file_size || $file_size > $max_file_size_in_bytes) {
|
|
||||||
HandleError('File exceeds the maximum allowed size');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($file_size <= 0) {
|
|
||||||
HandleError('File size outside allowed lower bound');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate file name (for our purposes we'll just remove invalid characters)
|
|
||||||
$file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", basename($_FILES[$upload_name]['name']));
|
|
||||||
if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
|
|
||||||
HandleError('Invalid file name');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate that we won't over-write an existing file
|
|
||||||
if (file_exists($save_path . $file_name)) {
|
|
||||||
HandleError('A file with this name already exists');
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Validate file extension
|
|
||||||
$path_info = pathinfo($_FILES[$upload_name]['name']);
|
|
||||||
$file_extension = $path_info["extension"];
|
|
||||||
$is_valid_extension = false;
|
|
||||||
foreach ($extension_whitelist as $extension) {
|
|
||||||
if (strcasecmp($file_extension, $extension) == 0) {
|
|
||||||
$is_valid_extension = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!$is_valid_extension) {
|
|
||||||
HandleError("Invalid file extension");
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// Validate file contents (extension and mime-type can't be trusted)
|
|
||||||
/*
|
|
||||||
Validating the file contents is OS and web server configuration dependant. Also, it may not be reliable.
|
|
||||||
See the comments on this page: http://us2.php.net/fileinfo
|
|
||||||
|
|
||||||
Also see http://72.14.253.104/search?q=cache:3YGZfcnKDrYJ:www.scanit.be/uploads/php-file-upload.pdf+php+file+command&hl=en&ct=clnk&cd=8&gl=us&client=firefox-a
|
|
||||||
which describes how a PHP script can be embedded within a GIF image file.
|
|
||||||
|
|
||||||
Therefore, no sample code will be provided here. Research the issue, decide how much security is
|
|
||||||
needed, and implement a solution that meets the needs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Process the file
|
|
||||||
/*
|
|
||||||
At this point we are ready to process the valid file. This sample code shows how to save the file. Other tasks
|
|
||||||
could be done such as creating an entry in a database or generating a thumbnail.
|
|
||||||
|
|
||||||
Depending on your server OS and needs you may need to set the Security Permissions on the file after it has
|
|
||||||
been saved.
|
|
||||||
*/
|
|
||||||
if (!@move_uploaded_file($_FILES[$upload_name]["tmp_name"], $save_path.$file_name)) {
|
|
||||||
HandleError("File could not be saved.");
|
|
||||||
}
|
|
||||||
|
|
||||||
die('{"success":true}');
|
|
||||||
|
|
||||||
/* Handles the error output. This error message will be sent to the uploadSuccess event handler. The event handler
|
|
||||||
will have to check for any error messages and react as needed. */
|
|
||||||
function HandleError($message) {
|
|
||||||
die('{success:false,error:'.G::json_encode($message).'}');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['eid'] ) )
|
|
||||||
{
|
|
||||||
//Getting available Steps Criteria that have been not selected for a particular task
|
|
||||||
require_once "classes/model/Event.php";
|
|
||||||
$oEvent = new Event();
|
|
||||||
$oData = $oEvent->load($_GET['eid']);
|
|
||||||
$sch_uid = $oData['EVN_ACTION'];
|
|
||||||
|
|
||||||
if($sch_uid != '')
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->caseNewSchedulerList($sch_uid);
|
|
||||||
if($rows['SCH_OPTION'] == '3')
|
|
||||||
{
|
|
||||||
$sch_start_day = explode('|',$rows['SCH_START_DAY']);
|
|
||||||
$count = count($sch_start_day);
|
|
||||||
switch($count){
|
|
||||||
case 1:
|
|
||||||
$rows['SCH_START_DAY'] = $sch_start_day[0];
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$rows['SCH_START_DAY'] = $sch_start_day[0];
|
|
||||||
$rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1];
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$rows['SCH_START_DAY'] = $sch_start_day[0];
|
|
||||||
$rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1];
|
|
||||||
$rows['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $sch_start_day[2];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if($rows['SCH_START_DATE'] != '')
|
|
||||||
{
|
|
||||||
$sch_str_dt = explode(' ',$rows['SCH_START_DATE']);
|
|
||||||
$rows['SCH_START_DATE'] = $sch_str_dt[0];
|
|
||||||
}
|
|
||||||
if($rows['SCH_END_DATE'] != '')
|
|
||||||
{
|
|
||||||
$sch_str_dt = explode(' ',$rows['SCH_END_DATE']);
|
|
||||||
$rows['SCH_END_DATE'] = $sch_str_dt[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$result = G::json_encode( $rows ) ;
|
|
||||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$result = '{failure:true}'; // unescape the slashes
|
|
||||||
}
|
|
||||||
echo $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
if (isset($_GET['pid'] ))
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtCaseTrackerObjectsCriteria($_GET['pid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['tid'] ))
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getAvailableExtCaseTrackerObjects($_GET['tid']);
|
|
||||||
}
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode($result);
|
|
||||||
?>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
if ( isset($_GET['pid']) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtCriteriaDBSList($_GET['pid']);
|
|
||||||
}
|
|
||||||
if(isset($_GET['tid']))
|
|
||||||
{
|
|
||||||
require_once 'classes/model/DbSource.php';
|
|
||||||
$o = new DbSource();
|
|
||||||
$rows = $o->load($_GET['tid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['pid'] ) )
|
|
||||||
{
|
|
||||||
//Getting Dynaform List
|
|
||||||
$rows = $oProcessMap->getExtDynaformsList($_GET['pid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
else if(isset($_GET['tabId'])){
|
|
||||||
$oAdditionalTables = new AdditionalTables();
|
|
||||||
$aData = $oAdditionalTables->load($_GET['tabId'], true);
|
|
||||||
$addTabName = $aData['ADD_TAB_NAME'];
|
|
||||||
|
|
||||||
foreach ($aData['FIELDS'] as $iRow => $aRow) {
|
|
||||||
if ($aRow['FLD_KEY'] == 1) {
|
|
||||||
$rows[] = $aRow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Getting Additional PM tables list created by user for combobox
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Getting Dynaform List
|
|
||||||
$rows = $oProcessMap->getExtAdditionalTablesList();
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['startInterId'] ) )
|
|
||||||
{
|
|
||||||
//Getting available Steps Criteria that have been not selected for a particular task
|
|
||||||
require_once "classes/model/Event.php";
|
|
||||||
$oEvent = new Event();
|
|
||||||
$aRows = $oEvent->load($_GET['startInterId']);
|
|
||||||
//$sch_uid = $oData['EVN_ACTION'];
|
|
||||||
$result = G::json_encode( $aRows );
|
|
||||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
|
||||||
/*else
|
|
||||||
{
|
|
||||||
$result = '{failure:true}'; // unescape the slashes
|
|
||||||
}*/
|
|
||||||
echo $result;
|
|
||||||
}
|
|
||||||
//print G::json_encode( $result ) ;
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,454 +0,0 @@
|
|||||||
<?php
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
//$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE
|
|
||||||
if(isset($_GET['stepid'])){
|
|
||||||
$aStepTypeId = explode('|',$_GET['stepid']);
|
|
||||||
$_SESSION['stepUID'] = $_GET['stepid'];
|
|
||||||
//$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE');
|
|
||||||
$sStep = $aStepTypeId[0];
|
|
||||||
$sType = $aStepTypeId[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
//$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE
|
|
||||||
if(isset($_GET['stepid'])){
|
|
||||||
$aStepTypeId = explode('|',$_GET['stepid']);
|
|
||||||
$_SESSION['stepUID'] = $_GET['stepid'];
|
|
||||||
//$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE');
|
|
||||||
$sStep = $aStepTypeId[0];
|
|
||||||
$sType = $aStepTypeId[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
$start = isset($_POST['start'])? $_POST['start']: 0;
|
|
||||||
$limit = isset($_POST['limit'])? $_POST['limit']: '';
|
|
||||||
|
|
||||||
switch( $_GET['action'] ) {
|
|
||||||
case 'getDynaformList' :
|
|
||||||
$result = $oProcessMap->getExtDynaformsList($start, $limit, $_GET['pid']);
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getPMTableDynaform':
|
|
||||||
$oAdditionalTables = new AdditionalTables();
|
|
||||||
$aData = $oAdditionalTables->load($_GET['tabId'], true);
|
|
||||||
$addTabName = $aData['ADD_TAB_NAME'];
|
|
||||||
foreach ($aData['FIELDS'] as $iRow => $aRow)
|
|
||||||
{
|
|
||||||
if ($aRow['FLD_KEY'] == 1)
|
|
||||||
{
|
|
||||||
$rows[] = $aRow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAdditionalTables':
|
|
||||||
$rows = $oProcessMap->getExtAdditionalTablesList();
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getInputDocumentList':
|
|
||||||
$rows = $oProcessMap->getExtInputDocumentsCriteria($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllInputDocumentCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editInputDocument':
|
|
||||||
require_once 'classes/model/InputDocument.php';
|
|
||||||
$oInputDocument = new InputDocument();
|
|
||||||
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getOutputDocument':
|
|
||||||
$rows = $oProcessMap->getExtOutputDocumentsCriteria($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllOutputDocumentCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editObjectPermission':
|
|
||||||
$rows = $oProcessMap->editExtObjectPermission($_GET['pid'],$_GET['op_uid']);
|
|
||||||
//array_shift($rows);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editOutputDocument':
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
|
||||||
$oOutputDocument = new OutputDocument();
|
|
||||||
$rows = $oOutputDocument->load($_GET['tid']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getReportTables':
|
|
||||||
$rows = $oProcessMap->getExtReportTables($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllReportTableCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editReportTables':
|
|
||||||
require_once 'classes/model/ReportTable.php';
|
|
||||||
$oReportTable = new ReportTable();
|
|
||||||
$rows = $oReportTable->load($_GET['REP_TAB_UID'],$_GET['pid']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getReportTableType':
|
|
||||||
if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
|
|
||||||
{
|
|
||||||
$aTheFields = array();
|
|
||||||
$aTheFields = getDynaformsVars($_GET['pid'], false);
|
|
||||||
foreach ($aTheFields as $aField)
|
|
||||||
{
|
|
||||||
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
|
|
||||||
'FIELD_NAME' => $aField['sName']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (isset($_GET['pid']) && $_GET['type'] == 'GRID')
|
|
||||||
{
|
|
||||||
$aTheFields = array();
|
|
||||||
$aTheFields = getGridsVars($_GET['pid']);
|
|
||||||
foreach ($aTheFields as $aField)
|
|
||||||
{
|
|
||||||
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
|
|
||||||
'FIELD_NAME' => $aField['sName']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getDatabaseConnectionList':
|
|
||||||
$rows = $oProcessMap->getExtCriteriaDBSList($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllDbSourceCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editDatabaseConnection':
|
|
||||||
require_once 'classes/model/DbSource.php';
|
|
||||||
$o = new DbSource();
|
|
||||||
$rows = $o->load($_GET['dbs_uid'],$_GET['pid']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'process_Supervisors':
|
|
||||||
$rows = $oProcessMap->listExtProcessesSupervisors($start, $limit, $_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllProcessSupervisorsCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'availableProcessesSupervisors':
|
|
||||||
$rows = $oProcessMap->listExtNoProcessesUser($_GET['pid']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'supervisorDynaforms':
|
|
||||||
$rows = $oProcessMap->getExtSupervisorDynaformsList($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllSupervisorDynaformsCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
case 'availableSupervisorDynaforms':
|
|
||||||
$rows = $oProcessMap->getExtAvailableSupervisorDynaformsList($_GET['pid']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
case 'supervisorInputDoc':
|
|
||||||
$rows = $oProcessMap->getExtSupervisorInputsList($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllSupervisorInputsCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
case 'availableSupervisorInputDoc':
|
|
||||||
$rows = $oProcessMap->getExtAvailableSupervisorInputsList($_GET['pid']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAssignedCaseTrackerObjects':
|
|
||||||
$rows = $oProcessMap->getExtCaseTrackerObjectsCriteria($start, $limit, $_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllCaseTrackerObjectCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAvailableCaseTrackerObjects':
|
|
||||||
$rows = $oProcessMap->getAvailableExtCaseTrackerObjects($_GET['pid']);
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAvailableSteps':
|
|
||||||
$rows = $oProcessMap->getExtAvailableBBCriteria($_GET['pid'], $_GET['tid']);
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAssignedSteps':
|
|
||||||
$rows = $oProcessMap->getExtStepsCriteria($start, $limit,$_GET['tid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllStepCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAssignedUsersList':
|
|
||||||
$rows = $oProcessMap->usersExtList($start, $limit, $_GET['pid'], $_GET['tid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllTaskUserCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAvailableUsersList':
|
|
||||||
$rows = $oProcessMap->getAvailableExtUsersCriteria($_GET['tid']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAvailableStepTriggers':
|
|
||||||
$aStepTypeId = explode('|',$_SESSION['stepUID']);
|
|
||||||
$sStep = $aStepTypeId[0];
|
|
||||||
$sType = $aStepTypeId[1];
|
|
||||||
//Getting available Steps Criteria that have been not selected for a particular task
|
|
||||||
$rows = $oProcessMap->getExtAvailableStepTriggersCriteria($_GET['pid'], $sStep, $_GET['tid'], $sType);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getAssignedStepTriggers':
|
|
||||||
$rows = $oProcessMap->getExtStepTriggersCriteria($start, $limit, $sStep, $_GET['tid'], $sType);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllStepTriggerCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'availableUsers':
|
|
||||||
$rows = $oProcessMap->getExtAvailableUsersList($_GET['tid']);
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'assignedUsers':
|
|
||||||
$rows = $oProcessMap->getExtusersadhoc($start, $limit,$_GET['pid'], $_GET['tid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllTaskUserCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getTaskPropertiesList':
|
|
||||||
require_once 'classes/model/Task.php';
|
|
||||||
$oTask = new Task();
|
|
||||||
$rows = $oTask->load($_GET['tid']);
|
|
||||||
while (list($key, $value) = each($rows)) {
|
|
||||||
if ($value == 'TRUE')
|
|
||||||
$rows[$key] = true;
|
|
||||||
else if($value == 'FALSE')
|
|
||||||
$rows[$key] = false;
|
|
||||||
|
|
||||||
if($key == 'TAS_TYPE_DAY' && $value == '1')
|
|
||||||
$rows[$key] = 'Work Days';
|
|
||||||
else if($key == 'TAS_TYPE_DAY' && $value == '2')
|
|
||||||
$rows[$key] = 'Calendar Days';
|
|
||||||
|
|
||||||
if($key == 'TAS_TYPE' && $value == 'NORMAL')
|
|
||||||
$rows[$key] = false;
|
|
||||||
else if($key == 'TAS_TYPE' && $value == 'ADHOC')
|
|
||||||
$rows[$key] = true;
|
|
||||||
}
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getSubProcessProperties':
|
|
||||||
if($_GET['type'] == 2) //Loading sub process details
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'','0');
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
print $result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'',$_GET['type']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'getObjectPermission':
|
|
||||||
$rows = $oProcessMap->getExtObjectsPermissions($start, $limit,$_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllObjectPermissionCount();
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getObjectPermissionType':
|
|
||||||
$rows = $oProcessMap->newExtObjectPermission($_GET['pid'],$_GET['objectType']);
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'process_Edit':
|
|
||||||
$rows = $oProcessMap->editProcessNew($_GET['pid']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getTriggersList':
|
|
||||||
$rows = $oProcessMap->getExtTriggersList($start, $limit, $_GET['pid']);
|
|
||||||
$result['totalCount'] = $oProcessMap->getAllTriggersCount();
|
|
||||||
array_shift($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'editTriggers':
|
|
||||||
require_once('classes/model/Triggers.php');
|
|
||||||
|
|
||||||
if (isset($_GET['TRI_UID']))
|
|
||||||
{
|
|
||||||
$oTrigger = new Triggers();
|
|
||||||
$rows = $oTrigger->load($_GET['TRI_UID']);
|
|
||||||
}
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getCaseTracker':
|
|
||||||
//$rows = $oProcessMap->caseTracker($_GET['pid']);
|
|
||||||
$oCaseTracker = new CaseTracker ( );
|
|
||||||
$rows = $oCaseTracker->load($_GET['pid']);
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'getVariables':
|
|
||||||
$aFields = getDynaformsVars($_GET['pid']);
|
|
||||||
if(isset ($_GET['type']))
|
|
||||||
|
|
||||||
$aType = $_GET['type'];
|
|
||||||
|
|
||||||
else $aType='';
|
|
||||||
|
|
||||||
$rows[0] = Array (
|
|
||||||
'fieldname' => 'char',
|
|
||||||
'variable' => 'char',
|
|
||||||
'type' => 'type',
|
|
||||||
'label' => 'char'
|
|
||||||
);
|
|
||||||
foreach ( $aFields as $aField ) {
|
|
||||||
switch ($aType){
|
|
||||||
case "system":
|
|
||||||
if($aField['sType']=="system"){
|
|
||||||
$rows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "process":
|
|
||||||
if($aField['sType']!="system"){
|
|
||||||
$rows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$rows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
array_shift($rows);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode($result);
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//$result['data'] = $rows;
|
|
||||||
//print G::json_encode( $result ) ;
|
|
||||||
/*$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;*/
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['pid'] ) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtInputDocumentsCriteria($_GET['pid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['INP_DOC_UID'])) {
|
|
||||||
require_once 'classes/model/InputDocument.php';
|
|
||||||
$oInputDocument = new InputDocument();
|
|
||||||
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
|
|
||||||
}
|
|
||||||
// $result['totalCount'] = count($rows);
|
|
||||||
// $result['data'] = $rows;
|
|
||||||
// print G::json_encode( $result) ;
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
if ( isset($_GET['pid'] ) && !isset($_GET ['action']))
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtObjectsPermissions($_GET['pid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset($_GET['pid'] )&& isset($_GET['action']) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->newExtObjectPermission($_GET['pid'],$_GET['action']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode($result);
|
|
||||||
?>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['pid'] ) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getExtOutputDocumentsCriteria($_GET['pid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// $rows = $oProcessMap->getExtInputDocumentsCriteria($_GET['pid']);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (isset($_GET['tid']))
|
|
||||||
{
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
|
||||||
$oOutputDocument = new OutputDocument();
|
|
||||||
$rows = $oOutputDocument->load($_GET['tid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
|
|
||||||
/* $result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result) ;*/
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
$processUID = $_GET['pid'];
|
|
||||||
$action = $_GET['action'];
|
|
||||||
|
|
||||||
switch($action)
|
|
||||||
{
|
|
||||||
case 'process_User':
|
|
||||||
$rows = $oProcessMap->listExtProcessesUser($processUID);
|
|
||||||
break;
|
|
||||||
case 'availableProcessesUser':
|
|
||||||
$rows = $oProcessMap->listExtNoProcessesUser($processUID);
|
|
||||||
break;
|
|
||||||
case 'supervisorDynaforms':
|
|
||||||
$rows = $oProcessMap->getExtSupervisorDynaformsList($processUID);
|
|
||||||
break;
|
|
||||||
case 'availableSupervisorDynaforms':
|
|
||||||
$rows = $oProcessMap->getExtAvailableSupervisorDynaformsList($processUID);
|
|
||||||
break;
|
|
||||||
case 'supervisorInputDoc':
|
|
||||||
$rows = $oProcessMap->getExtSupervisorInputsList($processUID);
|
|
||||||
break;
|
|
||||||
case 'availableSupervisorInputDoc':
|
|
||||||
$rows = $oProcessMap->getExtAvailableSupervisorInputsList($processUID);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* processes_Export.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
G::LoadThirdParty('pear/json','class.json');
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
if ( isset($_GET['pro_uid']))
|
|
||||||
$sProUid = $_GET['pro_uid'];
|
|
||||||
else
|
|
||||||
throw ( new Exception ( 'the process uid is not defined!.' ) );
|
|
||||||
|
|
||||||
/* Includes */
|
|
||||||
G::LoadClass('processes');
|
|
||||||
$oProcess = new Processes();
|
|
||||||
$proFields = $oProcess->serializeProcess( $sProUid );
|
|
||||||
$Fields = $oProcess->saveSerializedProcess ( $proFields );
|
|
||||||
|
|
||||||
if (G::is_https ())
|
|
||||||
$http = 'https://';
|
|
||||||
else
|
|
||||||
$http = 'http://';
|
|
||||||
|
|
||||||
$Fields['FILENAME_LINK'] = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/processes/' . $Fields['FILENAME_LINK'];
|
|
||||||
|
|
||||||
$result = G::json_encode( $Fields );
|
|
||||||
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
|
|
||||||
echo $result;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ){
|
|
||||||
$G_PUBLISH = new Publisher;
|
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
|
||||||
G::RenderPage('publish', 'raw' );
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
if(isset($_GET['pid']) && !isset($_GET['type'])){
|
|
||||||
$rows = $oProcessMap->getExtReportTables($_GET['pid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
|
|
||||||
{
|
|
||||||
$aTheFields = array();
|
|
||||||
$aTheFields = getDynaformsVars($_GET['pid'], false);
|
|
||||||
foreach ($aTheFields as $aField) {
|
|
||||||
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
|
|
||||||
'FIELD_NAME' => $aField['sName']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(isset($_GET['pid']) && $_GET['type'] == 'GRID'){
|
|
||||||
$aTheFields = array();
|
|
||||||
$aTheFields = getGridsVars($_GET['pid']);
|
|
||||||
foreach ($aTheFields as $aField) {
|
|
||||||
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
|
|
||||||
'FIELD_NAME' => $aField['sName']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(isset($_GET['tid']))
|
|
||||||
{
|
|
||||||
require_once 'classes/model/ReportTable.php';
|
|
||||||
$o = new ReportTable();
|
|
||||||
$rows = $o->load($_GET['tid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
//$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE
|
|
||||||
if(isset($_GET['stepid']))
|
|
||||||
{
|
|
||||||
$aStepTypeId = explode('|',$_GET['stepid']);
|
|
||||||
$_SESSION['stepUID'] = $_GET['stepid'];
|
|
||||||
//$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE');
|
|
||||||
$sStep = $aStepTypeId[0];
|
|
||||||
$sType = $aStepTypeId[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET['pid'] ) && isset($_SESSION['stepUID']))
|
|
||||||
{
|
|
||||||
$aStepTypeId = explode('|',$_SESSION['stepUID']);
|
|
||||||
$sStep = $aStepTypeId[0];
|
|
||||||
$sType = $aStepTypeId[1];
|
|
||||||
//Getting available Steps Criteria that have been not selected for a particular task
|
|
||||||
$rows = $oProcessMap->getExtAvailableStepTriggersCriteria($_GET['pid'], $sStep, $_GET['tid'], $sType);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Getting all Steps Criteria that have been selected for a particular task
|
|
||||||
$rows = $oProcessMap->getExtStepTriggersCriteria($sStep, $_GET['tid'], $sType);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
|
|
||||||
|
|
||||||
//array_shift($rows);
|
|
||||||
if($_GET['type'] == 2) //Loading sub process details
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'','0');
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
print $result;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'',$_GET['type']);
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
require_once 'classes/model/Task.php';
|
|
||||||
$oTask = new Task();
|
|
||||||
$rows = $oTask->load($_GET['tid']);
|
|
||||||
|
|
||||||
while (list($key, $value) = each($rows)) {
|
|
||||||
|
|
||||||
if ($value == 'TRUE')
|
|
||||||
$rows[$key] = true;
|
|
||||||
else if($value == 'FALSE')
|
|
||||||
$rows[$key] = false;
|
|
||||||
|
|
||||||
if($key == 'TAS_TYPE_DAY' && $value == '1')
|
|
||||||
$rows[$key] = 'Work Days';
|
|
||||||
else if($key == 'TAS_TYPE_DAY' && $value == '2')
|
|
||||||
$rows[$key] = 'Calendar Days';
|
|
||||||
|
|
||||||
if($key == 'TAS_ASSIGN_TYPE')
|
|
||||||
{
|
|
||||||
switch($value)
|
|
||||||
{
|
|
||||||
case 'SELF_SERVICE':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
break;
|
|
||||||
case 'REPORT_TO':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
break;
|
|
||||||
case 'BALANCED':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
break;
|
|
||||||
case 'MANUAL':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
break;
|
|
||||||
case 'EVALUATE':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
$rows['hideEvaluateField'] = 'false';
|
|
||||||
break;
|
|
||||||
case 'STATIC_MI':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
$rows['hidePartialJoinField'] = 'false';
|
|
||||||
break;
|
|
||||||
case 'CANCEL_MI':
|
|
||||||
$rows[$value] = 'true';
|
|
||||||
$rows['hidePartialJoinField'] = 'false';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpData = G::json_encode( $rows ) ;
|
|
||||||
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
|
|
||||||
|
|
||||||
$result = $tmpData;
|
|
||||||
echo $result;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['pid'] ) )
|
|
||||||
{
|
|
||||||
//Getting available Steps Criteria that have been not selected for a particular task
|
|
||||||
$rows = $oProcessMap->getExtAvailableBBCriteria($_GET['pid'], $_GET['tid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Getting all Steps Criteria that have been selected for a particular task
|
|
||||||
$rows = $oProcessMap->getExtStepsCriteria($_GET['tid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
try
|
|
||||||
{
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
if ( isset($_GET['pid'] ) )
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->usersExtList($_GET['pid'], $_GET['tid']);
|
|
||||||
array_shift($rows);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$rows = $oProcessMap->getAvailableExtUsersCriteria($_GET['tid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['totalCount'] = count($rows);
|
|
||||||
$result['data'] = $rows;
|
|
||||||
print G::json_encode( $result ) ;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( Exception $e ) {
|
|
||||||
print G::json_encode ( $e->getMessage() );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
<?php
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
G::LoadClass('XmlForm_Field');
|
|
||||||
//$oXMLfield = new XmlForm_Field_TextPM(new DBConnection);
|
|
||||||
$aFields = getDynaformsVars($_GET['pid']);
|
|
||||||
if(isset ($_GET['type']))
|
|
||||||
|
|
||||||
$aType = $_GET['type'];
|
|
||||||
|
|
||||||
else $aType='';
|
|
||||||
|
|
||||||
$aRows[0] = Array (
|
|
||||||
'fieldname' => 'char',
|
|
||||||
'variable' => 'char',
|
|
||||||
'type' => 'type',
|
|
||||||
'label' => 'char'
|
|
||||||
);
|
|
||||||
foreach ( $aFields as $aField ) {
|
|
||||||
switch ($aType){
|
|
||||||
case "system":
|
|
||||||
if($aField['sType']=="system"){
|
|
||||||
$aRows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "process":
|
|
||||||
if($aField['sType']!="system"){
|
|
||||||
$aRows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$aRows[] = Array (
|
|
||||||
'fieldname' => $_GET['sFieldName'],
|
|
||||||
'variable' => $_GET['sSymbol'] . $aField['sName'],
|
|
||||||
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
|
|
||||||
'type' => $aField['sType'],
|
|
||||||
'label' => $aField['sLabel']
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
array_shift($aRows);
|
|
||||||
$result['totalCount'] = count($aRows);
|
|
||||||
$result['data'] = $aRows;
|
|
||||||
print G::json_encode($result);
|
|
||||||
?>
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* saveProcess.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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{
|
|
||||||
G::LoadClass('xpdl');
|
|
||||||
G::LoadClass('processMap');
|
|
||||||
G::LoadClass('tasks');
|
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
$oTask = new Task();
|
|
||||||
if(isset($_POST['PRO_UID'])){
|
|
||||||
$idProcess = $_POST['PRO_UID'];
|
|
||||||
if($oProcess->processExists ($idProcess)){
|
|
||||||
$process['ID'] = $idProcess;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$result = array();
|
|
||||||
$result['status_code'] = $idProcess;
|
|
||||||
$result['message'] = "the process does not exist";
|
|
||||||
$result['timestamp'] = date('Y-m-d H:i:s');
|
|
||||||
echo G::json_encode($result);
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$result = array();
|
|
||||||
$result['status_code'] = 1;
|
|
||||||
$result['message'] = "you don't send the process uid";
|
|
||||||
$result['timestamp'] = date('Y-m-d H:i:s');
|
|
||||||
echo G::json_encode($result);
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
$aTasks = G::json_decode ( $_POST['tasks'] );
|
|
||||||
$aRoutes = G::json_decode ( $_POST['routes'] );
|
|
||||||
$aEvents = G::json_decode ( $_POST['events'] );
|
|
||||||
$aGateways = G::json_decode ( $_POST['gateways'] );
|
|
||||||
$aAnnotations = G::json_decode ( $_POST['annotations'] );
|
|
||||||
$aSubprocess = G::json_decode ( $_POST['subprocess'] );
|
|
||||||
$fields = $oProcess->serializeProcess($idProcess);
|
|
||||||
$oData = unserialize($fields);
|
|
||||||
$aRoutes = $oProcess->super_unique($aRoutes);
|
|
||||||
$sOutput = '';
|
|
||||||
$subProcesses = array();
|
|
||||||
foreach($aTasks as $endBase => $valueEnd){
|
|
||||||
$tasks['ID_TASK'] = $valueEnd['0'];
|
|
||||||
$tasks['START'] = '';
|
|
||||||
foreach($aEvents as $id => $value){
|
|
||||||
if($value['1'] == 'bpmnEventEmptyStart' or $value['1'] == 'bpmnEventMessageStart' or $value['1'] == 'bpmnEventTimerStart' ){
|
|
||||||
foreach($aRoutes as $endR => $valueR){
|
|
||||||
if($tasks['ID_TASK'] == $valueR['2'] and $valueR['1'] == $value['0'] ){
|
|
||||||
$tasks['START'] = 'TRUE';
|
|
||||||
unset($aEvents[$id]);
|
|
||||||
unset($aRoutes[$endR]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( $tasks['START'] == ''){
|
|
||||||
$tasks['START'] = 'FALSE';
|
|
||||||
}
|
|
||||||
$tasks['TAS_TITLE'] = $valueEnd['1'];
|
|
||||||
$tasks['X'] = $valueEnd['2'];
|
|
||||||
$tasks['Y'] = $valueEnd['3'];
|
|
||||||
$tasks['TAS_TYPE'] = $valueEnd['6'];
|
|
||||||
$tasks['ID_PROCESS'] = $idProcess;
|
|
||||||
//$tasks['TASK_TYPE'] = 'NORMAL';
|
|
||||||
$tasks['DESCRIPTION']= '';
|
|
||||||
$oData->tasks[]= $oProcess->createDataTask($tasks);
|
|
||||||
}
|
|
||||||
$endArray = array();
|
|
||||||
$endArray = $oProcess->convertArrayEnd($aEvents,$idProcess);
|
|
||||||
$oData->lanes = $oProcess->createLanesPM($aAnnotations,$idProcess);
|
|
||||||
$transitions = $oProcess->createArrayRoutes($oData->tasks,$aRoutes,$aEvents,$aGateways,$aEvents,$idProcess);
|
|
||||||
$oData->routes = $transitions['ROUTES'];
|
|
||||||
$routeTransitions = $transitions['TRANSITIONS'];
|
|
||||||
$numberRoutes = $transitions['NUMBER'];
|
|
||||||
$oData->tasks = $transitions['TASKS'];
|
|
||||||
$taskHidden = $transitions['HIDDEN'];
|
|
||||||
foreach($aSubprocess as $key => $value){
|
|
||||||
//print_R($value['0']);
|
|
||||||
//$sOutput = $oTask->remove($value['0']);
|
|
||||||
$sOutput = $oProcessMap->addSubProcess($idProcess,$value['2'],$value['3']);
|
|
||||||
/*$subProcess[$key]['ID_PROCESS'] = $idProcess;
|
|
||||||
$subProcess[$key]['TAS_TITLE'] = $idProcess;
|
|
||||||
$subProcess[$key]['ID_TASK'] = $value['0'];
|
|
||||||
$subProcess[$key]['TAS_UID'] = $value['0'];
|
|
||||||
$subProcess[$key]['TASK_PARENT'] = '';
|
|
||||||
$subProcess[$key]['PROCESS_PARENT'] = '';
|
|
||||||
$subProcess[$key]['TASK_TYPE'] = 'SUBPROCESS';
|
|
||||||
$subProcess[$key]['DESCRIPTION'] = '';
|
|
||||||
$subProcess[$key]['X'] = $value['2'];
|
|
||||||
$subProcess[$key]['Y'] = $value['3'];
|
|
||||||
|
|
||||||
print_R($subProcess[$key]);
|
|
||||||
$subProcesses[] = $oProcess->createSubProcess($subProcess);
|
|
||||||
$oData->tasks[] = $oProcess->createTask($subProcess[$key]);*/
|
|
||||||
}
|
|
||||||
$numberTransitions = sizeof($routeTransitions);
|
|
||||||
if($numberTransitions > 0){
|
|
||||||
$routesArray = $oProcess->createGateways($routeTransitions,$endArray,$oData->routes,$numberRoutes,$idProcess,$taskHidden);
|
|
||||||
$oData->routes = $routesArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oProcess->updateProcessFromDataXpdl($oData,$oData->tasks);
|
|
||||||
|
|
||||||
$result->success = true;
|
|
||||||
$result->msg = G::LoadTranslation('ID_PROCESS_SAVE_SUCCESS');
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$result->success = false;
|
|
||||||
$result->msg = $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
print G::json_encode($result);
|
|
||||||
@@ -76,6 +76,16 @@ if (isset($_GET["id"]) && isset($_GET["id"])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oServerConf =& serverConf::getSingleton();
|
||||||
|
if ($oServerConf->isRtl(SYS_LANG)) {
|
||||||
|
$regionTreePanel = 'east';
|
||||||
|
$regionDebug = 'west';
|
||||||
|
} else {
|
||||||
|
$regionTreePanel = 'west';
|
||||||
|
$regionDebug = 'east';
|
||||||
|
}
|
||||||
|
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel);
|
||||||
|
$oHeadPublisher->assign('regionDebug', $regionDebug);
|
||||||
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
|
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
|
||||||
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption)? $confDefaultOption : "PM_USERS"); //User menu permissions
|
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption)? $confDefaultOption : "PM_USERS"); //User menu permissions
|
||||||
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
|
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
|
||||||
|
|||||||
@@ -24,37 +24,40 @@ require_once 'classes/model/UsersProperties.php';
|
|||||||
$oUserProperty = new UsersProperties();
|
$oUserProperty = new UsersProperties();
|
||||||
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
|
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
|
||||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||||
|
|
||||||
if (!is_array($aHistory)) {
|
if (!is_array($aHistory)) {
|
||||||
$aHistory = array();
|
$aHistory = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||||
define('PPP_PASSWORD_HISTORY', 0);
|
define('PPP_PASSWORD_HISTORY', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PPP_PASSWORD_HISTORY > 0) {
|
if (PPP_PASSWORD_HISTORY > 0) {
|
||||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||||
array_shift($aHistory);
|
array_shift($aHistory);
|
||||||
}
|
}
|
||||||
$aHistory[] = $_POST['form']['USR_PASSWORD'];
|
$aHistory[] = $_POST['form']['USR_PASSWORD'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
|
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
|
||||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||||
$oUserProperty->update($aUserProperty);
|
$oUserProperty->update($aUserProperty);
|
||||||
if ( class_exists('redirectDetail')) {
|
|
||||||
//falta validar...
|
|
||||||
if(isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']))
|
|
||||||
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
|
||||||
|
|
||||||
|
if (class_exists('redirectDetail')) {
|
||||||
|
//falta validar...
|
||||||
|
if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) {
|
||||||
|
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
||||||
|
}
|
||||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
//$oPluginRegistry->showArrays();
|
//$oPluginRegistry->showArrays();
|
||||||
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
||||||
if(isset($aRedirectLogin))
|
if (isset($aRedirectLogin)) {
|
||||||
{ if(is_array($aRedirectLogin))
|
if (is_array($aRedirectLogin)) {
|
||||||
{
|
foreach ($aRedirectLogin as $key => $detail) {
|
||||||
foreach ( $aRedirectLogin as $key=>$detail ) {
|
if (isset($detail->sPathMethod)) {
|
||||||
if(isset($detail->sPathMethod))
|
if ($detail->sRoleCode == $userRole) {
|
||||||
{
|
|
||||||
if ( $detail->sRoleCode == $userRole ) {
|
|
||||||
G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod );
|
G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod );
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
@@ -65,22 +68,18 @@ if ( class_exists('redirectDetail')) {
|
|||||||
}
|
}
|
||||||
//end plugin
|
//end plugin
|
||||||
|
|
||||||
|
if (isset($frm['USER_LANG'])) {
|
||||||
if (isset($frm['USER_LANG'])) {
|
|
||||||
if ($frm['USER_LANG'] != '') {
|
if ($frm['USER_LANG'] != '') {
|
||||||
$lang = $frm['USER_LANG'];
|
$lang = $frm['USER_LANG'];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (defined('SYS_LANG')) {
|
if (defined('SYS_LANG')) {
|
||||||
$lang = SYS_LANG;
|
$lang = SYS_LANG;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$lang = 'en';
|
$lang = 'en';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
||||||
G::header('Location: ' . $sLocation);
|
G::header('Location: ' . $sLocation);
|
||||||
die;
|
die;
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -24,14 +24,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function lookup( $target ) {
|
function lookup ($target)
|
||||||
|
{
|
||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = $target . ' => ';
|
$msg = $target . ' => ';
|
||||||
//if (eregi ( '[a-zA-Z]', $target ))
|
//if (eregi ( '[a-zA-Z]', $target ))
|
||||||
if (preg_match( '[a-zA-Z]', $target )) //Made compatible to PHP 5.3
|
if (preg_match( '[a-zA-Z]', $target )) {
|
||||||
|
//Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname ( $target );
|
$ntarget = gethostbyname ( $target );
|
||||||
else
|
} else {
|
||||||
$ntarget = gethostbyaddr ( $target );
|
$ntarget = gethostbyaddr ( $target );
|
||||||
|
}
|
||||||
$msg .= $ntarget;
|
$msg .= $ntarget;
|
||||||
return ($msg);
|
return ($msg);
|
||||||
}
|
}
|
||||||
@@ -40,12 +43,10 @@ G::LoadClass("system");
|
|||||||
|
|
||||||
if (getenv ( 'HTTP_CLIENT_IP' )) {
|
if (getenv ( 'HTTP_CLIENT_IP' )) {
|
||||||
$ip = getenv ( 'HTTP_CLIENT_IP' );
|
$ip = getenv ( 'HTTP_CLIENT_IP' );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (getenv ( 'HTTP_X_FORWARDED_FOR' )) {
|
if (getenv ( 'HTTP_X_FORWARDED_FOR' )) {
|
||||||
$ip = getenv ( 'HTTP_X_FORWARDED_FOR' );
|
$ip = getenv ( 'HTTP_X_FORWARDED_FOR' );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$ip = getenv ( 'REMOTE_ADDR' );
|
$ip = getenv ( 'REMOTE_ADDR' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,21 +65,17 @@ if (defined ( "DB_HOST" )) {
|
|||||||
G::LoadClass ( 'dbConnections' );
|
G::LoadClass ( 'dbConnections' );
|
||||||
$dbNetView = new NET ( DB_HOST );
|
$dbNetView = new NET ( DB_HOST );
|
||||||
$dbNetView->loginDbServer ( DB_USER, DB_PASS );
|
$dbNetView->loginDbServer ( DB_USER, DB_PASS );
|
||||||
|
|
||||||
$dbConns = new dbConnections ( '' );
|
$dbConns = new dbConnections ( '' );
|
||||||
$availdb = '';
|
$availdb = '';
|
||||||
foreach ( $dbConns->getDbServicesAvailables () as $key => $val ) {
|
foreach ($dbConns->getDbServicesAvailables () as $key => $val) {
|
||||||
if ($availdb != '')
|
if ($availdb != '') {
|
||||||
$availdb .= ', ';
|
$availdb .= ', ';
|
||||||
|
}
|
||||||
$availdb .= $val ['name'];
|
$availdb .= $val ['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER );
|
$sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER );
|
||||||
|
} catch (Exception $oException) {
|
||||||
}
|
|
||||||
catch ( Exception $oException ) {
|
|
||||||
$sMySQLVersion = '?????';
|
$sMySQLVersion = '?????';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,17 +86,16 @@ if (defined ( "DB_HOST" )) {
|
|||||||
$Fields ['DATABASE_SERVER'] = DB_HOST;
|
$Fields ['DATABASE_SERVER'] = DB_HOST;
|
||||||
$Fields ['DATABASE_NAME'] = DB_NAME;
|
$Fields ['DATABASE_NAME'] = DB_NAME;
|
||||||
$Fields ['AVAILABLE_DB'] = $availdb;
|
$Fields ['AVAILABLE_DB'] = $availdb;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$Fields ['DATABASE'] = "Not defined";
|
$Fields ['DATABASE'] = "Not defined";
|
||||||
$Fields ['DATABASE_SERVER'] = "Not defined";
|
$Fields ['DATABASE_SERVER'] = "Not defined";
|
||||||
$Fields ['DATABASE_NAME'] = "Not defined";
|
$Fields ['DATABASE_NAME'] = "Not defined";
|
||||||
$Fields ['AVAILABLE_DB'] = "Not defined";
|
$Fields ['AVAILABLE_DB'] = "Not defined";
|
||||||
}
|
}
|
||||||
$eeT="";
|
$eeT="";
|
||||||
if(class_exists('pmLicenseManager')){
|
if (class_exists('pmLicenseManager')) {
|
||||||
$eeT=" - Enterprise Edition";
|
$eeT=" - Enterprise Edition";
|
||||||
}
|
}
|
||||||
$Fields ['PHP'] = phpversion ();
|
$Fields ['PHP'] = phpversion ();
|
||||||
$Fields ['FLUID'] = System::getVersion() . $eeT;
|
$Fields ['FLUID'] = System::getVersion() . $eeT;
|
||||||
$Fields ['IP'] = lookup ( $ip );
|
$Fields ['IP'] = lookup ( $ip );
|
||||||
@@ -113,8 +109,9 @@ $Fields ['SERVER_ADDR'] = getenv ( 'SERVER_ADDR' );
|
|||||||
$Fields ['HTTP_USER_AGENT'] = getenv ( 'HTTP_USER_AGENT' );
|
$Fields ['HTTP_USER_AGENT'] = getenv ( 'HTTP_USER_AGENT' );
|
||||||
$Fields ['TIME_ZONE'] = (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown";
|
$Fields ['TIME_ZONE'] = (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown";
|
||||||
|
|
||||||
if (! defined ( 'SKIP_RENDER_SYSTEM_INFORMATION' )) {
|
if (!defined( 'SKIP_RENDER_SYSTEM_INFORMATION')) {
|
||||||
$G_PUBLISH = new Publisher ( );
|
$G_PUBLISH = new Publisher ( );
|
||||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' );
|
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' );
|
||||||
G::RenderPage ( 'publish', 'raw' );
|
G::RenderPage ( 'publish', 'raw' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$G_PUBLISH = new Publisher ();
|
$G_PUBLISH = new Publisher ();
|
||||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php');
|
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php');
|
||||||
G::RenderPage ( "publish" );
|
G::RenderPage ( "publish" );
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$newFile = str_replace ( 'index.php', 'login.php' , __FILE__ ) ;
|
$newFile = str_replace ( 'index.php', 'login.php' , __FILE__ );
|
||||||
return $newFile;
|
return $newFile;
|
||||||
|
|
||||||
|
|
||||||
@@ -23,14 +23,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
|
|
||||||
G::LoadInclude ( 'ajax' );
|
G::LoadInclude ( 'ajax' );
|
||||||
if (isset ( $_POST ['form'] )) {
|
if (isset ( $_POST ['form'] )) {
|
||||||
$_POST = $_POST ['form'];
|
$_POST = $_POST ['form'];
|
||||||
}
|
}
|
||||||
$_POST ['function'] = get_ajax_value ( 'function' );
|
$_POST ['function'] = get_ajax_value ( 'function' );
|
||||||
switch ($_POST ['function']) {
|
switch ($_POST ['function']) {
|
||||||
case 'getStarted_save' :
|
case 'getStarted_save':
|
||||||
require_once 'classes/model/Configuration.php';
|
require_once 'classes/model/Configuration.php';
|
||||||
$aData ['CFG_UID'] = 'getStarted';
|
$aData ['CFG_UID'] = 'getStarted';
|
||||||
$aData ['OBJ_UID'] = '';
|
$aData ['OBJ_UID'] = '';
|
||||||
@@ -38,13 +37,11 @@ try {
|
|||||||
$aData ['PRO_UID'] = '';
|
$aData ['PRO_UID'] = '';
|
||||||
$aData ['USR_UID'] = '';
|
$aData ['USR_UID'] = '';
|
||||||
$aData ['APP_UID'] = '';
|
$aData ['APP_UID'] = '';
|
||||||
|
|
||||||
$oConfig = new Configuration ( );
|
$oConfig = new Configuration ( );
|
||||||
|
|
||||||
$oConfig->create ( $aData );
|
$oConfig->create ( $aData );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} catch ( Exception $oException ) {
|
||||||
catch ( Exception $oException ) {
|
|
||||||
die ( $oException->getMessage () );
|
die ( $oException->getMessage () );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ $G_SUB_MENU = "empty";
|
|||||||
$referer = $_SERVER ['HTTP_REFERER'];
|
$referer = $_SERVER ['HTTP_REFERER'];
|
||||||
$dbc = new DBConnection ( );
|
$dbc = new DBConnection ( );
|
||||||
$G_PUBLISH = new Publisher ( );
|
$G_PUBLISH = new Publisher ( );
|
||||||
$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", NULL );
|
$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", null );
|
||||||
|
|
||||||
G::RenderPage ( "publish" );
|
G::RenderPage ( "publish" );
|
||||||
?>
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $user = new Users();
|
|||||||
|
|
||||||
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
||||||
|
|
||||||
if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
||||||
$aSetup = getEmailConfiguration();
|
$aSetup = getEmailConfiguration();
|
||||||
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
||||||
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
||||||
@@ -23,10 +23,10 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
|
|
||||||
$aData['USR_UID'] = $userData['USR_UID'];
|
$aData['USR_UID'] = $userData['USR_UID'];
|
||||||
$aData['USR_PASSWORD'] = md5($newPass);
|
$aData['USR_PASSWORD'] = md5($newPass);
|
||||||
/* **Save after sending the mail
|
/* **Save after sending the mail
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($aData);
|
||||||
$user->update($aData);
|
$user->update($aData);
|
||||||
*/
|
*/
|
||||||
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
|
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
|
||||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
||||||
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
||||||
@@ -77,6 +77,7 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
$passwd = implode('', $auxPass);
|
$passwd = implode('', $auxPass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oSpool->config['MESS_PASSWORD'] = $passwd;
|
$oSpool->config['MESS_PASSWORD'] = $passwd;
|
||||||
|
|
||||||
$oSpool->create(array(
|
$oSpool->create(array(
|
||||||
@@ -97,55 +98,21 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
));
|
));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$oSpool->sendMail();
|
$oSpool->sendMail();
|
||||||
|
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($aData);
|
||||||
$user->update($aData);
|
$user->update($aData);
|
||||||
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info");
|
G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info");
|
||||||
}
|
} catch (phpmailerException $e) {
|
||||||
catch (phpmailerException $e) {
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string');
|
G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string');
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
|
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
$msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
||||||
G::SendTemporalMessage ($msg, "warning", 'string');
|
G::SendTemporalMessage ($msg, "warning", 'string');
|
||||||
G::header('location: forgotPassword');
|
G::header('location: forgotPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! isset ( $_POST ))
|
if (! isset ( $_POST )) {
|
||||||
G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' );
|
G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' );
|
||||||
|
}
|
||||||
if (isset ( $_SESSION ['sysLogin'] ))
|
if (isset ( $_SESSION ['sysLogin'] )) {
|
||||||
$_POST ['form'] = $_SESSION ['sysLogin'];
|
$_POST ['form'] = $_SESSION ['sysLogin'];
|
||||||
|
}
|
||||||
require_once ('authentication.php');
|
require_once ('authentication.php');
|
||||||
|
|
||||||
|
|||||||
@@ -20,21 +20,20 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
G::LoadClass( 'message' );
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
$dbc = new DBConnection();
|
||||||
|
$ses = new DBSession( $dbc );
|
||||||
|
|
||||||
G::LoadClass('message');
|
$messages = new Message( $dbc );
|
||||||
|
|
||||||
$dbc = new DBConnection();
|
if (! isset( $_POST['MESS_UID'] )) {
|
||||||
$ses = new DBSession($dbc);
|
return;
|
||||||
|
}
|
||||||
|
$messages->Delete( $_POST['MESS_UID'] );
|
||||||
|
|
||||||
$messages = new Message( $dbc );
|
|
||||||
|
|
||||||
if (!isset($_POST['MESS_UID'])) return;
|
|
||||||
|
|
||||||
$messages->Delete( $_POST['MESS_UID'] );
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -20,24 +20,24 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
G::LoadClass( 'message' );
|
||||||
|
|
||||||
G::LoadClass('message');
|
$dbc = new DBConnection();
|
||||||
|
$ses = new DBSession( $dbc );
|
||||||
|
|
||||||
$dbc = new DBConnection();
|
$messages = new Message( $dbc );
|
||||||
$ses = new DBSession($dbc);
|
$messages->Fields['MESS_UID'] = (isset( $_GET['MESS_UID'] )) ? urldecode( $_GET['MESS_UID'] ) : '0';
|
||||||
|
$messages->Load( $messages->Fields['MESS_UID'] );
|
||||||
|
$messages->Fields['PRO_UID'] = isset( $messages->Fields['PRO_UID'] ) ? $messages->Fields['PRO_UID'] : $_GET['PRO_UID'];
|
||||||
|
|
||||||
$messages = new Message( $dbc );
|
$G_PUBLISH = new Publisher();
|
||||||
$messages->Fields['MESS_UID']=(isset($_GET['MESS_UID'])) ? urldecode($_GET['MESS_UID']):'0';
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'messages/messages_Edit', '', $messages->Fields, SYS_URI . 'messages/messages_Save' );
|
||||||
$messages->Load( $messages->Fields['MESS_UID'] );
|
|
||||||
$messages->Fields['PRO_UID'] = isset($messages->Fields['PRO_UID'])?$messages->Fields['PRO_UID']:$_GET['PRO_UID'];
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
G::RenderPage( "publish", "raw" );
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'messages/messages_Edit', '', $messages->Fields , SYS_URI . 'messages/messages_Save');
|
|
||||||
|
|
||||||
G::RenderPage( "publish" , "raw" );
|
|
||||||
?>
|
|
||||||
@@ -20,28 +20,26 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
$G_MAIN_MENU = 'processmaker';
|
||||||
|
$G_SUB_MENU = 'processes';
|
||||||
|
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||||
|
$G_ID_SUB_MENU_SELECTED = 'MESSAGES';
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$dbc = new DBConnection();
|
||||||
$G_SUB_MENU = 'processes';
|
$ses = new DBSession( $dbc );
|
||||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
|
||||||
$G_ID_SUB_MENU_SELECTED = 'MESSAGES';
|
|
||||||
|
|
||||||
$dbc = new DBConnection();
|
//Hardcode: UID of the library by default
|
||||||
$ses = new DBSession($dbc);
|
$PRO_UID = '746B734DC23311';
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
|
$Fields = array ('SYS_LANG' => SYS_LANG,'PRO_UID' => $PRO_UID);
|
||||||
|
|
||||||
//Hardcode: UID of the library by default
|
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'messages/messages_List', '', $Fields, 'messages_Save' );
|
||||||
$PRO_UID='746B734DC23311';
|
|
||||||
$G_PUBLISH = new Publisher;
|
|
||||||
$Fields=array( 'SYS_LANG' => SYS_LANG,
|
|
||||||
'PRO_UID' => $PRO_UID );
|
|
||||||
|
|
||||||
$G_PUBLISH->AddContent('pagedtable', 'paged-table', 'messages/messages_List', '', $Fields , 'messages_Save');
|
G::RenderPage( "publish" );
|
||||||
|
|
||||||
G::RenderPage( "publish" );
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -20,20 +20,21 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
G::LoadClass( 'message' );
|
||||||
|
|
||||||
G::LoadClass('message');
|
$dbc = new DBConnection();
|
||||||
|
$ses = new DBSession( $dbc );
|
||||||
|
|
||||||
$dbc = new DBConnection();
|
$messages = new Message( $dbc );
|
||||||
$ses = new DBSession($dbc);
|
|
||||||
|
|
||||||
$messages = new Message( $dbc );
|
if ($_POST['form']['MESS_UID'] === '') {
|
||||||
|
unset( $_POST['form']['MESS_UID'] );
|
||||||
|
}
|
||||||
|
$messages->Save( $_POST['form'] );
|
||||||
|
|
||||||
if ($_POST['form']['MESS_UID']==='') unset($_POST['form']['MESS_UID']);
|
|
||||||
$messages->Save( $_POST['form'] );
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,17 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$uid = $_SERVER['QUERY_STRING'];
|
$uid = $_SERVER['QUERY_STRING'];
|
||||||
$oOutputDocument = new OutputDocument();
|
$oOutputDocument = new OutputDocument();
|
||||||
$aFields = $oOutputDocument->load($uid);
|
$aFields = $oOutputDocument->load( $uid );
|
||||||
$type = $aFields['OUT_DOC_TYPE'];
|
$type = $aFields['OUT_DOC_TYPE'];
|
||||||
|
|
||||||
if ( $type == 'JRXML') $extension = 'jrxml';
|
if ($type == 'JRXML') {
|
||||||
if ( $type == 'ACROFORM') $extension = 'pdf';
|
$extension = 'jrxml';
|
||||||
|
}
|
||||||
|
if ($type == 'ACROFORM') {
|
||||||
|
$extension = 'pdf';
|
||||||
|
}
|
||||||
|
|
||||||
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension ;
|
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
|
||||||
|
|
||||||
|
$bDownload = true;
|
||||||
|
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||||
|
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||||
|
|
||||||
|
$downFileName = preg_replace( '/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||||
|
G::streamFile( $fileJrxml, $bDownload, $downFileName );
|
||||||
|
|
||||||
$bDownload = true;
|
|
||||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
|
||||||
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
|
||||||
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
|
||||||
G::streamFile ( $fileJrxml, $bDownload, $downFileName );
|
|
||||||
|
|||||||
@@ -1,76 +1,71 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$action = isset($POST['action'])? $POST['action']: isset($_GET['action'])? $_GET['action']: '';
|
$action = isset( $POST['action'] ) ? $POST['action'] : isset( $_GET['action'] ) ? $_GET['action'] : '';
|
||||||
|
|
||||||
// Function call from ajax_function for calling to lookForNameOutput.
|
// Function call from ajax_function for calling to lookForNameOutput.
|
||||||
if($action=='') {
|
if ($action == '') {
|
||||||
$action = isset($_POST['function'])?$_POST['function']:'';
|
$action = isset( $_POST['function'] ) ? $_POST['function'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($action){
|
switch ($action) {
|
||||||
case 'setTemplateFile':
|
case 'setTemplateFile':
|
||||||
//print_r($_FILES);
|
//print_r($_FILES);
|
||||||
$_SESSION['outpudocs_tmpFile'] = PATH_DATA . $_FILES['templateFile']['name'];
|
$_SESSION['outpudocs_tmpFile'] = PATH_DATA . $_FILES['templateFile']['name'];
|
||||||
// file_put_contents($_FILES['templateFile']['name'], file_get_contents($_FILES['templateFile']['tmp_name']));
|
// file_put_contents($_FILES['templateFile']['name'], file_get_contents($_FILES['templateFile']['tmp_name']));
|
||||||
copy($_FILES['templateFile']['tmp_name'], $_SESSION['outpudocs_tmpFile']);
|
copy( $_FILES['templateFile']['tmp_name'], $_SESSION['outpudocs_tmpFile'] );
|
||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
|
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->msg = 'success - saved '. $_SESSION['outpudocs_tmpFile'];
|
$result->msg = 'success - saved ' . $_SESSION['outpudocs_tmpFile'];
|
||||||
echo G::json_encode($result);
|
echo G::json_encode( $result );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'getTemplateFile':
|
case 'getTemplateFile':
|
||||||
$aExtensions = array ( "exe", "com", "dll", "ocx", "fon", "ttf", "doc", "xls", "mdb", "rtf", "bin",
|
$aExtensions = array ("exe","com","dll","ocx","fon","ttf","doc","xls","mdb","rtf","bin","jpeg","jpg","jif","jfif","gif","tif","tiff","png","bmp","pdf","aac","mp3","mp3pro","vorbis","realaudio","vqf","wma","aiff","flac","wav","midi","mka","ogg","jpeg","ilbm","tar","zip","rar","arj","gzip","bzip2","afio","kgb","gz","asf","avi","mov","iff","ogg","ogm","mkv","3gp"
|
||||||
"jpeg", "jpg", "jif", "jfif", "gif", "tif", "tiff", "png", "bmp", "pdf",
|
|
||||||
"aac", "mp3", "mp3pro", "vorbis", "realaudio", "vqf", "wma",
|
|
||||||
"aiff", "flac", "wav", "midi", "mka", "ogg", "jpeg", "ilbm",
|
|
||||||
"tar", "zip", "rar", "arj", "gzip", "bzip2", "afio", "kgb", "gz",
|
|
||||||
"asf", "avi", "mov", "iff", "ogg", "ogm", "mkv", "3gp",
|
|
||||||
);
|
);
|
||||||
$sFileName = strtolower($_SESSION['outpudocs_tmpFile']);
|
$sFileName = strtolower( $_SESSION['outpudocs_tmpFile'] );
|
||||||
$strRev = strrev($sFileName);
|
$strRev = strrev( $sFileName );
|
||||||
$searchPos = strpos($strRev, '.');
|
$searchPos = strpos( $strRev, '.' );
|
||||||
$pos = (strlen($sFileName) - 1) - $searchPos;
|
$pos = (strlen( $sFileName ) - 1) - $searchPos;
|
||||||
$sExtension = substr($sFileName, $pos+1, strlen($sFileName));
|
$sExtension = substr( $sFileName, $pos + 1, strlen( $sFileName ) );
|
||||||
if(! in_array($sExtension, $aExtensions))
|
if (! in_array( $sExtension, $aExtensions ))
|
||||||
echo $content = file_get_contents($_SESSION['outpudocs_tmpFile']);
|
echo $content = file_get_contents( $_SESSION['outpudocs_tmpFile'] );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'loadTemplateContent':
|
case 'loadTemplateContent':
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$ooutputDocument = new OutputDocument();
|
$ooutputDocument = new OutputDocument();
|
||||||
if (isset($_POST['OUT_DOC_UID'])) {
|
if (isset( $_POST['OUT_DOC_UID'] )) {
|
||||||
$aFields = $ooutputDocument->load($_POST['OUT_DOC_UID']);
|
$aFields = $ooutputDocument->load( $_POST['OUT_DOC_UID'] );
|
||||||
|
|
||||||
echo $aFields['OUT_DOC_TEMPLATE'];
|
echo $aFields['OUT_DOC_TEMPLATE'];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'lookForNameOutput':
|
case 'lookForNameOutput':
|
||||||
require_once('classes/model/Content.php');
|
require_once ('classes/model/Content.php');
|
||||||
require_once ( "classes/model/OutputDocument.php" );
|
require_once ("classes/model/OutputDocument.php");
|
||||||
|
|
||||||
$snameInput = urldecode($_POST['NAMEOUTPUT']);
|
$snameInput = urldecode( $_POST['NAMEOUTPUT'] );
|
||||||
$sPRO_UID = urldecode($_POST['proUid']);
|
$sPRO_UID = urldecode( $_POST['proUid'] );
|
||||||
|
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_UID);
|
$oCriteria->addSelectColumn( OutputDocumentPeer::OUT_DOC_UID );
|
||||||
$oCriteria->add(OutputDocumentPeer::PRO_UID, $sPRO_UID);
|
$oCriteria->add( OutputDocumentPeer::PRO_UID, $sPRO_UID );
|
||||||
$oDataset = OutputDocumentPeer::doSelectRS($oCriteria);
|
$oDataset = OutputDocumentPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$flag = true;
|
$flag = true;
|
||||||
while ($oDataset->next() && $flag) {
|
while ($oDataset->next() && $flag) {
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
$oCriteria1 = new Criteria('workflow');
|
$oCriteria1 = new Criteria( 'workflow' );
|
||||||
$oCriteria1->addSelectColumn('COUNT(*) AS OUTPUTS');
|
$oCriteria1->addSelectColumn( 'COUNT(*) AS OUTPUTS' );
|
||||||
$oCriteria1->add(ContentPeer::CON_CATEGORY, 'OUT_DOC_TITLE');
|
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'OUT_DOC_TITLE' );
|
||||||
$oCriteria1->add(ContentPeer::CON_ID, $aRow['OUT_DOC_UID']);
|
$oCriteria1->add( ContentPeer::CON_ID, $aRow['OUT_DOC_UID'] );
|
||||||
$oCriteria1->add(ContentPeer::CON_VALUE, $snameInput);
|
$oCriteria1->add( ContentPeer::CON_VALUE, $snameInput );
|
||||||
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
|
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$oDataset1 = ContentPeer::doSelectRS($oCriteria1);
|
$oDataset1 = ContentPeer::doSelectRS( $oCriteria1 );
|
||||||
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$oDataset1->next();
|
$oDataset1->next();
|
||||||
$aRow1 = $oDataset1->getRow();
|
$aRow1 = $oDataset1->getRow();
|
||||||
|
|
||||||
|
|||||||
@@ -20,48 +20,41 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||||
case -2:
|
case - 2:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
case -1:
|
case - 1:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
require_once 'classes/model/ObjectPermission.php';
|
require_once 'classes/model/ObjectPermission.php';
|
||||||
require_once 'classes/model/Step.php';
|
require_once 'classes/model/Step.php';
|
||||||
G::LoadClass( 'processMap' );
|
G::LoadClass( 'processMap' );
|
||||||
|
|
||||||
$oOutputDocument = new OutputDocument();
|
$oOutputDocument = new OutputDocument();
|
||||||
$fields = $oOutputDocument->load($_POST['OUT_DOC_UID']);
|
$fields = $oOutputDocument->load( $_POST['OUT_DOC_UID'] );
|
||||||
$oOutputDocument->remove($_POST['OUT_DOC_UID']);
|
$oOutputDocument->remove( $_POST['OUT_DOC_UID'] );
|
||||||
|
|
||||||
$oStep = new Step();
|
$oStep = new Step();
|
||||||
$oStep->removeStep('OUTPUT_DOCUMENT', $_POST['OUT_DOC_UID']);
|
$oStep->removeStep( 'OUTPUT_DOCUMENT', $_POST['OUT_DOC_UID'] );
|
||||||
|
|
||||||
$oOP = new ObjectPermission();
|
$oOP = new ObjectPermission();
|
||||||
$oOP->removeByObject('OUTPUT', $_POST['OUT_DOC_UID']);
|
$oOP->removeByObject( 'OUTPUT', $_POST['OUT_DOC_UID'] );
|
||||||
|
|
||||||
//refresh dbarray with the last change in outputDocument
|
//refresh dbarray with the last change in outputDocument
|
||||||
$oMap = new processMap();
|
$oMap = new processMap();
|
||||||
$oCriteria = $oMap->getOutputDocumentsCriteria($fields['PRO_UID'] );
|
$oCriteria = $oMap->getOutputDocumentsCriteria( $fields['PRO_UID'] );
|
||||||
|
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->msg = G::LoadTranslation('ID_OUTPUTDOCUMENT_REMOVED');
|
$result->msg = G::LoadTranslation( 'ID_OUTPUTDOCUMENT_REMOVED' );
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$result->success = false;
|
$result->success = false;
|
||||||
$result->msg = $e->getMessage();
|
$result->msg = $e->getMessage();
|
||||||
//die($oException->getMessage());
|
//die($oException->getMessage());
|
||||||
}
|
}
|
||||||
print G::json_encode($result);
|
print G::json_encode( $result );
|
||||||
?>
|
|
||||||
|
|||||||
@@ -20,86 +20,84 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||||
case -2:
|
case - 2:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
case -1:
|
case - 1:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$ooutputDocument = new OutputDocument();
|
$ooutputDocument = new OutputDocument();
|
||||||
if (isset($_GET['OUT_DOC_UID'])) {
|
if (isset( $_GET['OUT_DOC_UID'] )) {
|
||||||
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
$aFields = $ooutputDocument->load( $_GET['OUT_DOC_UID'] );
|
||||||
}
|
} else {
|
||||||
else {
|
$aFields = array ();
|
||||||
$aFields = array();
|
|
||||||
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$ooutputDocument = new OutputDocument();
|
$ooutputDocument = new OutputDocument();
|
||||||
if (isset($_GET['OUT_DOC_UID'])) {
|
if (isset( $_GET['OUT_DOC_UID'] )) {
|
||||||
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
$aFields = $ooutputDocument->load( $_GET['OUT_DOC_UID'] );
|
||||||
}
|
} else {
|
||||||
else {
|
$aFields = array ();
|
||||||
$aFields = array();
|
|
||||||
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = isset ( $aFields['OUT_DOC_TYPE']) ? $aFields['OUT_DOC_TYPE'] : 'HTML';
|
$type = isset( $aFields['OUT_DOC_TYPE'] ) ? $aFields['OUT_DOC_TYPE'] : 'HTML';
|
||||||
|
|
||||||
G::LoadClass('xmlfield_InputPM');
|
G::LoadClass( 'xmlfield_InputPM' );
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
|
|
||||||
switch ( $type ) {
|
switch ($type) {
|
||||||
case 'HTML' :
|
case 'HTML':
|
||||||
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aFields , '../outputdocs/outputdocs_Save');
|
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aFields , '../outputdocs/outputdocs_Save');
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
$oHeadPublisher->assign('OUT_DOC_UID', $_GET['OUT_DOC_UID']);
|
$oHeadPublisher->assign( 'OUT_DOC_UID', $_GET['OUT_DOC_UID'] );
|
||||||
$translations = G::getTranslations(Array(
|
$translations = G::getTranslations( Array ('ID_FILE','ID_OUT_PUT_DOC_UPLOAD_TITLE','ID_UPLOADING_FILE','ID_UPLOAD','ID_CANCEL','ID_SAVE','ID_LOAD_FROM_FILE','ID_SELECT_TEMPLATE_FILE','ID_ALERT_MESSAGE','ID_INVALID_FILE') );
|
||||||
'ID_FILE', 'ID_OUT_PUT_DOC_UPLOAD_TITLE', 'ID_UPLOADING_FILE', 'ID_UPLOAD', 'ID_CANCEL',
|
// $oHeadPublisher->assign('TRANSLATIONS', $translations);
|
||||||
'ID_SAVE', 'ID_LOAD_FROM_FILE', 'ID_SELECT_TEMPLATE_FILE', 'ID_ALERT_MESSAGE', 'ID_INVALID_FILE'
|
$oHeadPublisher->addExtJsScript( 'outputdocs/htmlEditor', false ); //adding a javascript file .js
|
||||||
));
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
// $oHeadPublisher->assign('TRANSLATIONS', $translations);
|
die();
|
||||||
$oHeadPublisher->addExtJsScript('outputdocs/htmlEditor', false ); //adding a javascript file .js
|
|
||||||
G::RenderPage('publish', 'extJs');
|
|
||||||
die;
|
|
||||||
break;
|
break;
|
||||||
|
case 'JRXML':
|
||||||
case 'JRXML' :
|
break;
|
||||||
case 'ACROFORM' :
|
case 'ACROFORM':
|
||||||
$type = $aFields['OUT_DOC_TYPE'];
|
$type = $aFields['OUT_DOC_TYPE'];
|
||||||
if ( $type == 'JRXML') $extension = 'jrxml';
|
if ($type == 'JRXML') {
|
||||||
if ( $type == 'ACROFORM') $extension = 'pdf';
|
$extension = 'jrxml';
|
||||||
|
}
|
||||||
|
if ($type == 'ACROFORM') {
|
||||||
|
$extension = 'pdf';
|
||||||
|
}
|
||||||
|
|
||||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||||
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||||
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
$downFileName = preg_replace( '/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||||
$filename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension ;
|
$filename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
|
||||||
if ( file_exists ( $filename) )
|
if (file_exists( $filename )) {
|
||||||
$aFields['FILENAME'] = $downFileName;
|
$aFields['FILENAME'] = $downFileName;
|
||||||
else
|
} else {
|
||||||
$aFields['FILENAME'] = '';
|
$aFields['FILENAME'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$aFields['FILELINK'] = '../outputdocs/downloadFile?' . $aFields['OUT_DOC_UID'];
|
$aFields['FILELINK'] = '../outputdocs/downloadFile?' . $aFields['OUT_DOC_UID'];
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocsUploadFile', '', $aFields , '../outputdocs/uploadFile');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocsUploadFile', '', $aFields, '../outputdocs/uploadFile' );
|
||||||
$G_PUBLISH->AddContent('view', 'outputdocs/editJrxml' );
|
$G_PUBLISH->AddContent( 'view', 'outputdocs/editJrxml' );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage( 'publish', 'raw' );
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
die( $oException->getMessage() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception $oException) {
|
|
||||||
die($oException->getMessage());
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,26 +20,23 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
|
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
||||||
|
$G_MAIN_MENU = 'processmaker';
|
||||||
|
$G_SUB_MENU = 'processes';
|
||||||
|
$G_ID_MENU_SELECTED = 'PROCESSES';
|
||||||
|
$G_ID_SUB_MENU_SELECTED = 'OUTPUTDOCS';
|
||||||
|
|
||||||
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
|
$dbc = new DBConnection();
|
||||||
|
$ses = new DBSession( $dbc );
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_PUBLISH = new Publisher();
|
||||||
$G_SUB_MENU = 'processes';
|
$Fields = array ('SYS_LANG' => SYS_LANG);
|
||||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
|
||||||
$G_ID_SUB_MENU_SELECTED = 'OUTPUTDOCS';
|
|
||||||
|
|
||||||
$dbc = new DBConnection();
|
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'outputdocs/outputdocs_List', '', $Fields, 'outputdocs_Save' );
|
||||||
$ses = new DBSession($dbc);
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
G::RenderPage( "publish" );
|
||||||
$Fields=array( 'SYS_LANG' => SYS_LANG,
|
|
||||||
);
|
|
||||||
|
|
||||||
$G_PUBLISH->AddContent('pagedtable', 'paged-table', 'outputdocs/outputdocs_List', '', $Fields , 'outputdocs_Save');
|
|
||||||
|
|
||||||
G::RenderPage( "publish" );
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -20,66 +20,58 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||||
case -2:
|
case - 2:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
case -1:
|
case - 1:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$ooutputDocument = new OutputDocument();
|
$ooutputDocument = new OutputDocument();
|
||||||
if (isset($_GET['OUT_DOC_UID'])) {
|
if (isset( $_GET['OUT_DOC_UID'] )) {
|
||||||
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
$aFields = $ooutputDocument->load( $_GET['OUT_DOC_UID'] );
|
||||||
}
|
} else {
|
||||||
else {
|
$aFields = array ();
|
||||||
$aFields = array();
|
|
||||||
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
||||||
}
|
}
|
||||||
$aFields['OUT_DOC_TYPE'] = 'HTML';
|
$aFields['OUT_DOC_TYPE'] = 'HTML';
|
||||||
|
|
||||||
|
|
||||||
$enabledJavaBridge = false;
|
$enabledJavaBridge = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporally Disabled, because we are not using JRXML output doc type by now
|
* Temporally Disabled, because we are not using JRXML output doc type by now
|
||||||
G::LoadClass ('javaBridgePM');
|
* G::LoadClass ('javaBridgePM');
|
||||||
if ( class_exists ( 'javaBridgePM' ) ) {
|
* if ( class_exists ( 'javaBridgePM' ) ) {
|
||||||
$JBPM = new JavaBridgePM();
|
* $JBPM = new JavaBridgePM();
|
||||||
try {
|
* try {
|
||||||
$JBPM->checkJavaExtension();
|
* $JBPM->checkJavaExtension();
|
||||||
$util = new Java("com.processmaker.util.pmutils");
|
* $util = new Java("com.processmaker.util.pmutils");
|
||||||
$enabledJavaBridge = true;
|
* $enabledJavaBridge = true;
|
||||||
} catch ( Exception $e ) {
|
* } catch ( Exception $e ) {
|
||||||
|
*
|
||||||
}
|
* }
|
||||||
//$util->setInputPath( JAVATEST_PATH );
|
* //$util->setInputPath( JAVATEST_PATH );
|
||||||
//$util->setOutputPath( JAVATEST_PATH );
|
* //$util->setOutputPath( JAVATEST_PATH );
|
||||||
}
|
* }
|
||||||
*/
|
*/
|
||||||
|
G::LoadClass( 'xmlfield_InputPM' );
|
||||||
|
|
||||||
G::LoadClass('xmlfield_InputPM');
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
if ( ! $enabledJavaBridge ) {
|
if (! $enabledJavaBridge) {
|
||||||
$xmlform = 'outputdocs/outputdocs_Properties';
|
$xmlform = 'outputdocs/outputdocs_Properties';
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', $xmlform, '', $aFields , '../outputdocs/outputdocs_Save');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $aFields, '../outputdocs/outputdocs_Save' );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$xmlform = 'outputdocs/outputdocs_New';
|
$xmlform = 'outputdocs/outputdocs_New';
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', $xmlform, '', $aFields , '../outputdocs/outputdocs_Save');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $aFields, '../outputdocs/outputdocs_Save' );
|
||||||
}
|
}
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage( 'publish', 'raw' );
|
||||||
}
|
} catch (Exception $oException) {
|
||||||
catch (Exception $oException) {
|
die( $oException->getMessage() );
|
||||||
die($oException->getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,55 +21,48 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||||
case -2:
|
case - 2:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
case -1:
|
case - 1:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
$ooutputDocument = new OutputDocument();
|
$ooutputDocument = new OutputDocument();
|
||||||
if (isset($_GET['OUT_DOC_UID'])) {
|
if (isset( $_GET['OUT_DOC_UID'] )) {
|
||||||
$aFields = $ooutputDocument->load($_GET['OUT_DOC_UID']);
|
$aFields = $ooutputDocument->load( $_GET['OUT_DOC_UID'] );
|
||||||
} else {
|
} else {
|
||||||
$aFields = array();
|
$aFields = array ();
|
||||||
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
||||||
}
|
}
|
||||||
|
$type = isset( $aFields['OUT_DOC_TYPE'] ) ? $aFields['OUT_DOC_TYPE'] : 'HTML';
|
||||||
$type = isset($aFields['OUT_DOC_TYPE']) ? $aFields['OUT_DOC_TYPE'] : 'HTML';
|
$aFields['OUT_DOC_TAGS'] = isset( $aFields['OUT_DOC_TAGS'] ) ? $aFields['OUT_DOC_TAGS'] : 'OUTPUT';
|
||||||
|
$aFields['OUT_DOC_VERSIONING'] = strval( $aFields['OUT_DOC_VERSIONING'] );
|
||||||
$aFields['OUT_DOC_TAGS'] = isset($aFields['OUT_DOC_TAGS']) ? $aFields['OUT_DOC_TAGS'] : 'OUTPUT';
|
$aFields['OUT_DOC_LANDSCAPE'] = strval( $aFields['OUT_DOC_LANDSCAPE'] );
|
||||||
$aFields['OUT_DOC_VERSIONING'] = strval($aFields['OUT_DOC_VERSIONING']);
|
if (isset( $aFields['OUT_DOC_PDF_SECURITY_ENABLED'] )) {
|
||||||
$aFields['OUT_DOC_LANDSCAPE'] = strval($aFields['OUT_DOC_LANDSCAPE']);
|
$aFields['OUT_DOC_PDF_SECURITY_ENABLED'] = strval( $aFields['OUT_DOC_PDF_SECURITY_ENABLED'] );
|
||||||
if(isset($aFields['OUT_DOC_PDF_SECURITY_ENABLED'])){
|
|
||||||
$aFields['OUT_DOC_PDF_SECURITY_ENABLED'] = strval($aFields['OUT_DOC_PDF_SECURITY_ENABLED']);
|
|
||||||
}
|
}
|
||||||
|
if (isset( $aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] ) && $aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] != "") {
|
||||||
|
$aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::decrypt( $aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], $_GET['OUT_DOC_UID'] );
|
||||||
if (isset($aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']) && $aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] != "") {
|
$aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::decrypt( $aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $_GET['OUT_DOC_UID'] );
|
||||||
$aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::decrypt($aFields['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], $_GET['OUT_DOC_UID']);
|
|
||||||
$aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::decrypt($aFields['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $_GET['OUT_DOC_UID']);
|
|
||||||
}
|
}
|
||||||
|
G::LoadClass( 'xmlfield_InputPM' );
|
||||||
G::LoadClass('xmlfield_InputPM');
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'HTML' :
|
case 'HTML':
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save' );
|
||||||
break;
|
break;
|
||||||
case 'JRXML' :
|
case 'JRXML':
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save' );
|
||||||
/*
|
/*
|
||||||
// $G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocsDynaformList', '', $aFields , '../outputdocs/outputdocs_Save');
|
// $G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocsDynaformList', '', $aFields , '../outputdocs/outputdocs_Save');
|
||||||
require_once 'classes/model/Process.php';
|
require_once 'classes/model/Process.php';
|
||||||
@@ -81,11 +74,12 @@ try {
|
|||||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/dynaforms_ShortList', $oProcessMap->getDynaformsCriteria($sProcessUID), $aFields);
|
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/dynaforms_ShortList', $oProcessMap->getDynaformsCriteria($sProcessUID), $aFields);
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case 'ACROFORM' :
|
case 'ACROFORM':
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save');
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Properties', '', $aFields, '../outputdocs/outputdocs_Save' );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage( 'publish', 'raw' );
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
die($oException->getMessage());
|
die( $oException->getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,71 +21,71 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
|
||||||
case -2:
|
case - 2:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
case -1:
|
case - 1:
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
G::header('location: ../login/login');
|
G::header( 'location: ../login/login' );
|
||||||
die;
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//default:
|
//default:
|
||||||
|
|
||||||
|
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
G::LoadClass('processMap');
|
G::LoadClass( 'processMap' );
|
||||||
|
|
||||||
$oOutputDocument = new OutputDocument();
|
$oOutputDocument = new OutputDocument();
|
||||||
|
|
||||||
|
if (isset( $_POST['form'] ))
|
||||||
if (isset($_POST['form']))
|
|
||||||
$aData = $_POST['form']; //For old process map form
|
$aData = $_POST['form']; //For old process map form
|
||||||
else
|
else
|
||||||
$aData = $_POST; //For Extjs (Since we are not using form in ExtJS)
|
$aData = $_POST; //For Extjs (Since we are not using form in ExtJS)
|
||||||
|
|
||||||
|
|
||||||
if(isset($aData['OUT_DOC_TITLE']) && $aData['OUT_DOC_TITLE']!=''){
|
if (isset( $aData['OUT_DOC_TITLE'] ) && $aData['OUT_DOC_TITLE'] != '') {
|
||||||
$oForm = new Form('outputdocs/outputdocs_Properties', PATH_XMLFORM);
|
$oForm = new Form( 'outputdocs/outputdocs_Properties', PATH_XMLFORM );
|
||||||
$aData = $oForm->validatePost();
|
$aData = $oForm->validatePost();
|
||||||
if(isset($aData['OUT_DOC_PDF_SECURITY_ENABLED'])&&$aData['OUT_DOC_PDF_SECURITY_ENABLED']=="0"){
|
if (isset( $aData['OUT_DOC_PDF_SECURITY_ENABLED'] ) && $aData['OUT_DOC_PDF_SECURITY_ENABLED'] == "0") {
|
||||||
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] ="";
|
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = "";
|
||||||
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] ="";
|
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = "";
|
||||||
$aData['OUT_DOC_PDF_SECURITY_PERMISSIONS'] ="";
|
$aData['OUT_DOC_PDF_SECURITY_PERMISSIONS'] = "";
|
||||||
}
|
}
|
||||||
if(isset($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'])&&$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']!=""){
|
if (isset( $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] ) && $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] != "") {
|
||||||
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::encrypt($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'],$aData['OUT_DOC_UID']);
|
$aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::encrypt( $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], $aData['OUT_DOC_UID'] );
|
||||||
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::encrypt($aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'],$aData['OUT_DOC_UID']);
|
$aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::encrypt( $aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $aData['OUT_DOC_UID'] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($aData['OUT_DOC_UID'] == '') {
|
if ($aData['OUT_DOC_UID'] == '') {
|
||||||
|
|
||||||
if ((isset($aData['OUT_DOC_TYPE'])) && ( $aData['OUT_DOC_TYPE'] == 'JRXML' )) {
|
if ((isset( $aData['OUT_DOC_TYPE'] )) && ($aData['OUT_DOC_TYPE'] == 'JRXML')) {
|
||||||
$dynaformUid = $aData['DYN_UID'];
|
$dynaformUid = $aData['DYN_UID'];
|
||||||
$outDocUid = $oOutputDocument->create($aData);
|
$outDocUid = $oOutputDocument->create( $aData );
|
||||||
G::LoadClass('javaBridgePM');
|
G::LoadClass( 'javaBridgePM' );
|
||||||
$jbpm = new JavaBridgePM ();
|
$jbpm = new JavaBridgePM();
|
||||||
print $jbpm->generateJrxmlFromDynaform($outDocUid, $dynaformUid, 'classic');
|
print $jbpm->generateJrxmlFromDynaform( $outDocUid, $dynaformUid, 'classic' );
|
||||||
} else {
|
} else {
|
||||||
$outDocUid = $oOutputDocument->create($aData);
|
$outDocUid = $oOutputDocument->create( $aData );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$oOutputDocument->update($aData);
|
$oOutputDocument->update( $aData );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($aData['PRO_UID'])) {
|
if (isset( $aData['PRO_UID'] )) {
|
||||||
//refresh dbarray with the last change in outputDocument
|
//refresh dbarray with the last change in outputDocument
|
||||||
$oMap = new processMap();
|
$oMap = new processMap();
|
||||||
$oCriteria = $oMap->getOutputDocumentsCriteria($aData['PRO_UID']);
|
$oCriteria = $oMap->getOutputDocumentsCriteria( $aData['PRO_UID'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $oException) {
|
||||||
die($oException->getMessage());
|
die( $oException->getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,31 +2,32 @@
|
|||||||
try {
|
try {
|
||||||
require_once 'classes/model/OutputDocument.php';
|
require_once 'classes/model/OutputDocument.php';
|
||||||
|
|
||||||
if (empty($_FILES['form']) || $_FILES['form']['name']['OUT_DOC_FILE'] == '')
|
if (empty( $_FILES['form'] ) || $_FILES['form']['name']['OUT_DOC_FILE'] == '') {
|
||||||
throw ( new Exception ( 'you must upload a file.' ) );
|
throw (new Exception( 'you must upload a file.' ));
|
||||||
|
}
|
||||||
$uid = $_POST['form']['OUT_DOC_UID'];
|
$uid = $_POST['form']['OUT_DOC_UID'];
|
||||||
$oOutputDocument = new OutputDocument();
|
$oOutputDocument = new OutputDocument();
|
||||||
$aFields = $oOutputDocument->load($uid);
|
$aFields = $oOutputDocument->load( $uid );
|
||||||
$type = $aFields['OUT_DOC_TYPE'];
|
$type = $aFields['OUT_DOC_TYPE'];
|
||||||
|
|
||||||
$aExtension = explode ('.', strtolower(basename( $_FILES['form']['name']['OUT_DOC_FILE'] )));
|
$aExtension = explode( '.', strtolower( basename( $_FILES['form']['name']['OUT_DOC_FILE'] ) ) );
|
||||||
$extension = $aExtension[ count($aExtension) -1 ];
|
$extension = $aExtension[count( $aExtension ) - 1];
|
||||||
if ( $extension != 'jrxml' && $type == 'JRXML')
|
if ($extension != 'jrxml' && $type == 'JRXML') {
|
||||||
throw ( new Exception ( "'$extension' is not a valid extension, you must upload a .jrxml file." ) );
|
throw (new Exception( "'$extension' is not a valid extension, you must upload a .jrxml file." ));
|
||||||
|
}
|
||||||
if ( $extension != 'pdf' && $type == 'ACROFORM')
|
|
||||||
throw ( new Exception ( "'$extension' is not a valid extension, you must upload a .pdf file." ) );
|
|
||||||
|
|
||||||
|
if ($extension != 'pdf' && $type == 'ACROFORM') {
|
||||||
|
throw (new Exception( "'$extension' is not a valid extension, you must upload a .pdf file." ));
|
||||||
|
}
|
||||||
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
|
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
|
||||||
if (!empty($_FILES['form'])) {
|
if (! empty( $_FILES['form'] )) {
|
||||||
if ($_FILES['form']['error']['OUT_DOC_FILE'] == 0) {
|
if ($_FILES['form']['error']['OUT_DOC_FILE'] == 0) {
|
||||||
G::uploadFile($_FILES['form']['tmp_name']['OUT_DOC_FILE'], dirname($fileJrxml), basename($fileJrxml) );
|
G::uploadFile( $_FILES['form']['tmp_name']['OUT_DOC_FILE'], dirname( $fileJrxml ), basename( $fileJrxml ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "<font face='Arial' size='2' >File uploaded.</font>";
|
print "<font face='Arial' size='2' >File uploaded.</font>";
|
||||||
|
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e ) {
|
|
||||||
print "<font face='Arial' size='2' color='red' >Error: " . $e->getMessage() . "</font>";
|
print "<font face='Arial' size='2' color='red' >Error: " . $e->getMessage() . "</font>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,23 +20,23 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
G::LoadInclude('ajax');
|
G::LoadInclude( 'ajax' );
|
||||||
$oJSON = new Services_JSON();
|
$oJSON = new Services_JSON();
|
||||||
if(isset($_POST['mode']) && $_POST['mode'] != '')
|
if (isset( $_POST['mode'] ) && $_POST['mode'] != '') {
|
||||||
$aData = $_POST;
|
$aData = $_POST;
|
||||||
else
|
} else {
|
||||||
$aData = $_POST['form'];
|
$aData = $_POST['form'];
|
||||||
|
}
|
||||||
|
|
||||||
G::LoadClass('tasks');
|
G::LoadClass( 'tasks' );
|
||||||
$oTasks = new Tasks();
|
$oTasks = new Tasks();
|
||||||
$rou_id = 0;
|
$rou_id = 0;
|
||||||
switch ($aData['action']) {
|
switch ($aData['action']) {
|
||||||
case 'savePattern':
|
case 'savePattern':
|
||||||
//if ($aData['ROU_TYPE'] != $aData['ROU_TYPE_OLD'])
|
//if ($aData['ROU_TYPE'] != $aData['ROU_TYPE_OLD'])
|
||||||
//{
|
//{
|
||||||
$oTasks->deleteAllRoutesOfTask($aData['PROCESS'], $aData['TASK']);
|
$oTasks->deleteAllRoutesOfTask( $aData['PROCESS'], $aData['TASK'] );
|
||||||
//}
|
//}
|
||||||
require_once 'classes/model/Route.php';
|
require_once 'classes/model/Route.php';
|
||||||
$oRoute = new Route();
|
$oRoute = new Route();
|
||||||
@@ -52,11 +52,10 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'];
|
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'];
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
//$aFields['ROU_TO_LAST_USER'] = $aData['ROU_TO_LAST_USER'];
|
//$aFields['ROU_TO_LAST_USER'] = $aData['ROU_TO_LAST_USER'];
|
||||||
$rou_id = $oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
break;
|
break;
|
||||||
case 'SELECT':
|
case 'SELECT':
|
||||||
foreach ($aData['GRID_SELECT_TYPE'] as $iKey => $aRow)
|
foreach ($aData['GRID_SELECT_TYPE'] as $iKey => $aRow) {
|
||||||
{
|
|
||||||
/*if ($aRow['ROU_UID'] != '')
|
/*if ($aRow['ROU_UID'] != '')
|
||||||
{
|
{
|
||||||
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
||||||
@@ -68,13 +67,12 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||||
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
||||||
$rou_id = $oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
unset($aFields);
|
unset( $aFields );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'EVALUATE':
|
case 'EVALUATE':
|
||||||
foreach ($aData['GRID_EVALUATE_TYPE'] as $iKey => $aRow)
|
foreach ($aData['GRID_EVALUATE_TYPE'] as $iKey => $aRow) {
|
||||||
{
|
|
||||||
/*if ($aRow['ROU_UID'] != '')
|
/*if ($aRow['ROU_UID'] != '')
|
||||||
{
|
{
|
||||||
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
||||||
@@ -86,13 +84,12 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||||
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
|
||||||
$rou_id = $oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
unset($aFields);
|
unset( $aFields );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'PARALLEL':
|
case 'PARALLEL':
|
||||||
foreach ($aData['GRID_PARALLEL_TYPE'] as $iKey => $aRow)
|
foreach ($aData['GRID_PARALLEL_TYPE'] as $iKey => $aRow) {
|
||||||
{
|
|
||||||
/*if ($aRow['ROU_UID'] != '')
|
/*if ($aRow['ROU_UID'] != '')
|
||||||
{
|
{
|
||||||
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
||||||
@@ -102,13 +99,12 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
||||||
$aFields['ROU_CASE'] = $iKey;
|
$aFields['ROU_CASE'] = $iKey;
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
$rou_id = $oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
unset($aFields);
|
unset( $aFields );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'PARALLEL-BY-EVALUATION':
|
case 'PARALLEL-BY-EVALUATION':
|
||||||
foreach ($aData['GRID_PARALLEL_EVALUATION_TYPE'] as $iKey => $aRow)
|
foreach ($aData['GRID_PARALLEL_EVALUATION_TYPE'] as $iKey => $aRow) {
|
||||||
{
|
|
||||||
/*if ($aRow['ROU_UID'] != '')
|
/*if ($aRow['ROU_UID'] != '')
|
||||||
{
|
{
|
||||||
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
$aFields['ROU_UID'] = $aRow['ROU_UID'];
|
||||||
@@ -120,16 +116,14 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_CASE'] = $iKey;
|
$aFields['ROU_CASE'] = $iKey;
|
||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||||
if(isset($aRow['ROU_OPTIONAL']) && trim($aRow['ROU_OPTIONAL'])!=''
|
if (isset( $aRow['ROU_OPTIONAL'] ) && trim( $aRow['ROU_OPTIONAL'] ) != '' && ($aRow['ROU_OPTIONAL'] === 'TRUE' || $aRow['ROU_OPTIONAL'] === 'FALSE'))
|
||||||
&& ($aRow['ROU_OPTIONAL']==='TRUE' || $aRow['ROU_OPTIONAL']==='FALSE'))
|
|
||||||
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||||
$rou_id = $oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
unset($aFields);
|
unset( $aFields );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route
|
case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route
|
||||||
foreach ($aData['GRID_DISCRIMINATOR_TYPE'] as $iKey => $aRow)
|
foreach ($aData['GRID_DISCRIMINATOR_TYPE'] as $iKey => $aRow) {
|
||||||
{
|
|
||||||
$aFields['PRO_UID'] = $aData['PROCESS'];
|
$aFields['PRO_UID'] = $aData['PROCESS'];
|
||||||
$aFields['TAS_UID'] = $aData['TASK'];
|
$aFields['TAS_UID'] = $aData['TASK'];
|
||||||
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
$aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK'];
|
||||||
@@ -137,16 +131,15 @@ switch ($aData['action']) {
|
|||||||
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
|
||||||
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||||
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
$aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||||
$routeData = $oTasks->getRouteByType($aData['PROCESS'], $aRow['ROU_NEXT_TASK'], $aData['ROU_TYPE']);
|
$routeData = $oTasks->getRouteByType( $aData['PROCESS'], $aRow['ROU_NEXT_TASK'], $aData['ROU_TYPE'] );
|
||||||
foreach($routeData as $route)
|
foreach ($routeData as $route) {
|
||||||
{
|
|
||||||
$sFields['ROU_UID'] = $route['ROU_UID'];
|
$sFields['ROU_UID'] = $route['ROU_UID'];
|
||||||
$sFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
$sFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
|
||||||
$sFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
$sFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
|
||||||
$rou_id = $oRoute->update($sFields);
|
$rou_id = $oRoute->update( $sFields );
|
||||||
}
|
}
|
||||||
$rou_id =$oRoute->create($aFields);
|
$rou_id = $oRoute->create( $aFields );
|
||||||
unset($aFields);
|
unset( $aFields );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,28 +20,27 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (isset( $_POST['function'] )) {
|
||||||
|
|
||||||
if(isset($_POST['function'])) {
|
switch ($_POST['function']) {
|
||||||
|
|
||||||
switch($_POST['function']) {
|
|
||||||
|
|
||||||
case 'checkCategoryName':
|
case 'checkCategoryName':
|
||||||
|
|
||||||
$CategoryName = $_POST['CategoryName'];
|
$CategoryName = $_POST['CategoryName'];
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
$processCategory = new ProcessCategory();
|
$processCategory = new ProcessCategory();
|
||||||
$aProcessCategory = $processCategory->loadByCategoryName($CategoryName);
|
$aProcessCategory = $processCategory->loadByCategoryName( $CategoryName );
|
||||||
if( is_array($aProcessCategory)) {
|
if (is_array( $aProcessCategory )) {
|
||||||
return print '1';
|
return print '1';
|
||||||
} else {
|
} else {
|
||||||
return print '0';
|
return print '0';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: echo 'default';
|
default:
|
||||||
|
echo 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
//G::header('location: ../login/login');
|
//G::header('location: ../login/login');
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
//to do: improve the way to pass two or more parameters in the paged-table ( link )
|
||||||
|
|
||||||
$aux = explode ( '|', $_GET['id'] );
|
|
||||||
$index=0;
|
|
||||||
$CategoryUid = str_replace ( '"', '', $aux[$index++] );
|
|
||||||
|
|
||||||
|
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
$aux = explode( '|', $_GET['id'] );
|
||||||
//if exists the row in the database propel will update it, otherwise will insert.
|
$index = 0;
|
||||||
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
$CategoryUid = str_replace( '"', '', $aux[$index ++] );
|
||||||
|
|
||||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'ProcessCategory' ) ) {
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
|
//if exists the row in the database propel will update it, otherwise will insert.
|
||||||
|
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
||||||
|
|
||||||
|
if ((is_object( $tr ) && get_class( $tr ) == 'ProcessCategory')) {
|
||||||
$fields['CATEGORY_UID'] = $tr->getCategoryUid();
|
$fields['CATEGORY_UID'] = $tr->getCategoryUid();
|
||||||
$fields['LABEL_CATEGORY_UID'] = $tr->getCategoryUid();
|
$fields['LABEL_CATEGORY_UID'] = $tr->getCategoryUid();
|
||||||
$fields['CATEGORY_PARENT'] = $tr->getCategoryParent();
|
$fields['CATEGORY_PARENT'] = $tr->getCategoryParent();
|
||||||
@@ -25,17 +25,15 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVAN
|
|||||||
$fields['LABEL_CATEGORY_NAME'] = $tr->getCategoryName();
|
$fields['LABEL_CATEGORY_NAME'] = $tr->getCategoryName();
|
||||||
$fields['CATEGORY_ICON'] = $tr->getCategoryIcon();
|
$fields['CATEGORY_ICON'] = $tr->getCategoryIcon();
|
||||||
$fields['LABEL_CATEGORY_ICON'] = $tr->getCategoryIcon();
|
$fields['LABEL_CATEGORY_ICON'] = $tr->getCategoryIcon();
|
||||||
}
|
} else
|
||||||
else
|
$fields = array ();
|
||||||
$fields = array();
|
|
||||||
|
|
||||||
$G_MAIN_MENU = 'workflow';
|
$G_MAIN_MENU = 'workflow';
|
||||||
$G_SUB_MENU = 'processCategory';
|
$G_SUB_MENU = 'processCategory';
|
||||||
$G_ID_MENU_SELECTED = '';
|
$G_ID_MENU_SELECTED = '';
|
||||||
$G_ID_SUB_MENU_SELECTED = '';
|
$G_ID_SUB_MENU_SELECTED = '';
|
||||||
|
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processCategory/processCategoryDelete', '', $fields, 'processCategoryDeleteExec' );
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryDelete', '', $fields, 'processCategoryDeleteExec' );
|
G::RenderPage( 'publishBlank', 'blank' );
|
||||||
G::RenderPage('publishBlank', 'blank');
|
|
||||||
?>
|
?>
|
||||||
@@ -1,46 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
//G::header('location: ../login/login');
|
//G::header('location: ../login/login');
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$form = $_POST['form'];
|
$form = $_POST['form'];
|
||||||
$CategoryUid = $form['CATEGORY_UID'];
|
$CategoryUid = $form['CATEGORY_UID'];
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
|
|
||||||
require_once 'classes/model/Process.php';
|
require_once 'classes/model/Process.php';
|
||||||
|
|
||||||
//we'are looking for data into process with this CategoryUid
|
//we'are looking for data into process with this CategoryUid
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->add(ProcessPeer::PRO_CATEGORY, $CategoryUid);
|
$oCriteria->add( ProcessPeer::PRO_CATEGORY, $CategoryUid );
|
||||||
$oDataset = ProcessPeer::doSelectRS($oCriteria);
|
$oDataset = ProcessPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
while ($oDataset->next()) {
|
while ($oDataset->next()) {
|
||||||
$aDataProcess = $oDataset->getRow();
|
$aDataProcess = $oDataset->getRow();
|
||||||
$oCriteria1 = new Criteria('workflow');
|
$oCriteria1 = new Criteria( 'workflow' );
|
||||||
$oCriteria1->add(ProcessPeer::PRO_CATEGORY, '');
|
$oCriteria1->add( ProcessPeer::PRO_CATEGORY, '' );
|
||||||
$oCriteria2 = new Criteria('workflow');
|
$oCriteria2 = new Criteria( 'workflow' );
|
||||||
$oCriteria2->add(ProcessPeer::PRO_UID, $aDataProcess['PRO_UID']);
|
$oCriteria2->add( ProcessPeer::PRO_UID, $aDataProcess['PRO_UID'] );
|
||||||
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
|
BasePeer::doUpdate( $oCriteria2, $oCriteria1, Propel::getConnection( 'workflow' ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if exists the row in the database propel will update it, otherwise will insert.
|
//if exists the row in the database propel will update it, otherwise will insert.
|
||||||
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
||||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'ProcessCategory' ) ) {
|
if ((is_object( $tr ) && get_class( $tr ) == 'ProcessCategory')) {
|
||||||
$tr->delete();
|
$tr->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
G::Header('location: processCategoryList');
|
G::Header( 'location: processCategoryList' );
|
||||||
|
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e ) {
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH = new Publisher;
|
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
$aMessage['MESSAGE'] = $e->getMessage();
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||||
G::RenderPage( 'publish', 'blank' );
|
G::RenderPage( 'publish', 'blank' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
//G::header('location: ../login/login');
|
//G::header('location: ../login/login');
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
|
$aux = explode( '|', isset( $_GET['id'] ) ? $_GET['id'] : '' );
|
||||||
$CategoryUid = str_replace ( '"', '', $aux[0] );
|
$CategoryUid = str_replace( '"', '', $aux[0] );
|
||||||
|
|
||||||
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
|
//if exists the row in the database propel will update it, otherwise will insert.
|
||||||
|
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
||||||
|
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
if ((is_object( $tr ) && get_class( $tr ) == 'ProcessCategory')) {
|
||||||
//if exists the row in the database propel will update it, otherwise will insert.
|
|
||||||
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
|
||||||
|
|
||||||
if ( ( is_object ( $tr ) && get_class ($tr) == 'ProcessCategory' ) ) {
|
|
||||||
$fields['CATEGORY_UID'] = $tr->getCategoryUid();
|
$fields['CATEGORY_UID'] = $tr->getCategoryUid();
|
||||||
$fields['CATEGORY_PARENT'] = $tr->getCategoryParent();
|
$fields['CATEGORY_PARENT'] = $tr->getCategoryParent();
|
||||||
$fields['CATEGORY_NAME'] = $tr->getCategoryName();
|
$fields['CATEGORY_NAME'] = $tr->getCategoryName();
|
||||||
$fields['CATEGORY_ICON'] = $tr->getCategoryIcon();
|
$fields['CATEGORY_ICON'] = $tr->getCategoryIcon();
|
||||||
}
|
} else
|
||||||
else
|
$fields = array ();
|
||||||
$fields = array();
|
|
||||||
|
|
||||||
$G_MAIN_MENU = 'workflow';
|
$G_MAIN_MENU = 'workflow';
|
||||||
$G_SUB_MENU = 'processCategory';
|
$G_SUB_MENU = 'processCategory';
|
||||||
$G_ID_MENU_SELECTED = '';
|
$G_ID_MENU_SELECTED = '';
|
||||||
$G_ID_SUB_MENU_SELECTED = '';
|
$G_ID_SUB_MENU_SELECTED = '';
|
||||||
|
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processCategory/processCategoryEdit', '', $fields, 'processCategorySave' );
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryEdit', '', $fields, 'processCategorySave' );
|
G::RenderPage( 'publishBlank', 'blank' );
|
||||||
G::RenderPage('publishBlank', 'blank');
|
|
||||||
?>
|
?>
|
||||||
@@ -20,28 +20,27 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
G::SendTemporalMessage('krlos', 'error', 'labels');
|
G::SendTemporalMessage( 'krlos', 'error', 'labels' );
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
G::LoadClass('configuration');
|
G::LoadClass( 'configuration' );
|
||||||
$c = new Configurations();
|
$c = new Configurations();
|
||||||
$configPage = $c->getConfiguration('processCategoryList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
$configPage = $c->getConfiguration( 'processCategoryList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||||
|
|
||||||
$G_MAIN_MENU = 'workflow';
|
$G_MAIN_MENU = 'workflow';
|
||||||
$G_SUB_MENU = 'processCategory';
|
$G_SUB_MENU = 'processCategory';
|
||||||
$G_ID_MENU_SELECTED = '';
|
$G_ID_MENU_SELECTED = '';
|
||||||
$G_ID_SUB_MENU_SELECTED = '';
|
$G_ID_SUB_MENU_SELECTED = '';
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher();
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addExtJsScript('processCategory/processCategoryList', false); //adding a javascript file .js
|
$oHeadPublisher->addExtJsScript( 'processCategory/processCategoryList', false ); //adding a javascript file .js
|
||||||
$oHeadPublisher->addContent('processCategory/processCategoryList'); //adding a html file .html.
|
$oHeadPublisher->addContent( 'processCategory/processCategoryList' ); //adding a html file .html.
|
||||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||||
$oHeadPublisher->assign('CONFIG', $Config);
|
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
@@ -1,27 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1){
|
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
//G::header('location: ../login/login');
|
//G::header('location: ../login/login');
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
|
|
||||||
|
$fields['CATEGORY_UID'] = G::GenerateUniqueID();
|
||||||
|
;
|
||||||
|
|
||||||
$fields['CATEGORY_UID'] = G::GenerateUniqueID();;
|
$fields['CATEGORY_PARENT'] = '';
|
||||||
|
$fields['CATEGORY_NAME'] = '';
|
||||||
|
$fields['CATEGORY_ICON'] = '';
|
||||||
|
|
||||||
$fields['CATEGORY_PARENT'] = '';
|
$G_MAIN_MENU = 'workflow';
|
||||||
$fields['CATEGORY_NAME'] = '';
|
$G_SUB_MENU = 'processCategory';
|
||||||
$fields['CATEGORY_ICON'] = '';
|
$G_ID_MENU_SELECTED = '';
|
||||||
|
$G_ID_SUB_MENU_SELECTED = '';
|
||||||
|
|
||||||
$G_MAIN_MENU = 'workflow';
|
$G_PUBLISH = new Publisher();
|
||||||
$G_SUB_MENU = 'processCategory';
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processCategory/processCategoryNew', '', $fields, 'processCategorySave' );
|
||||||
$G_ID_MENU_SELECTED = '';
|
G::RenderPage( 'publishBlank', 'blank' );
|
||||||
$G_ID_SUB_MENU_SELECTED = '';
|
|
||||||
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryNew', '', $fields, 'processCategorySave' );
|
|
||||||
G::RenderPage('publishBlank', 'blank');
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
try {
|
try {
|
||||||
$form = $_POST['form'];
|
$form = $_POST['form'];
|
||||||
$CategoryUid = $form['CATEGORY_UID'];
|
$CategoryUid = $form['CATEGORY_UID'];
|
||||||
$CategoryParent = $form['CATEGORY_PARENT'];
|
$CategoryParent = $form['CATEGORY_PARENT'];
|
||||||
$CategoryName = $form['CATEGORY_NAME'];
|
$CategoryName = $form['CATEGORY_NAME'];
|
||||||
$CategoryIcon = $form['CATEGORY_ICON'];
|
$CategoryIcon = $form['CATEGORY_ICON'];
|
||||||
|
|
||||||
|
require_once ("classes/model/ProcessCategory.php");
|
||||||
require_once ( "classes/model/ProcessCategory.php" );
|
|
||||||
|
|
||||||
//if exists the row in the database propel will update it, otherwise will insert.
|
//if exists the row in the database propel will update it, otherwise will insert.
|
||||||
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
$tr = ProcessCategoryPeer::retrieveByPK( $CategoryUid );
|
||||||
$processCategory = new ProcessCategory();
|
$processCategory = new ProcessCategory();
|
||||||
$aProcessCategory = $processCategory->loadByCategoryName($CategoryName);
|
$aProcessCategory = $processCategory->loadByCategoryName( $CategoryName );
|
||||||
if(! is_array($aProcessCategory)) {
|
if (! is_array( $aProcessCategory )) {
|
||||||
|
|
||||||
if ( ! ( is_object ( $tr ) && get_class ($tr) == 'ProcessCategory' ) ) {
|
if (! (is_object( $tr ) && get_class( $tr ) == 'ProcessCategory')) {
|
||||||
$tr = new ProcessCategory();
|
$tr = new ProcessCategory();
|
||||||
}
|
}
|
||||||
$tr->setCategoryUid( $CategoryUid );
|
$tr->setCategoryUid( $CategoryUid );
|
||||||
@@ -23,37 +22,37 @@
|
|||||||
$tr->setCategoryName( $CategoryName );
|
$tr->setCategoryName( $CategoryName );
|
||||||
$tr->setCategoryIcon( $CategoryIcon );
|
$tr->setCategoryIcon( $CategoryIcon );
|
||||||
|
|
||||||
if ($tr->validate() ) {
|
if ($tr->validate()) {
|
||||||
// we save it, since we get no validation errors, or do whatever else you like.
|
// we save it, since we get no validation errors, or do whatever else you like.
|
||||||
$res = $tr->save();
|
$res = $tr->save();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Something went wrong. We can now get the validationFailures and handle them.
|
// Something went wrong. We can now get the validationFailures and handle them.
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$validationFailuresArray = $tr->getValidationFailures();
|
$validationFailuresArray = $tr->getValidationFailures();
|
||||||
foreach($validationFailuresArray as $objValidationFailure) {
|
foreach ($validationFailuresArray as $objValidationFailure) {
|
||||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||||
}
|
}
|
||||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||||
}
|
}
|
||||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
||||||
|
|
||||||
|
|
||||||
//to do: uniform coderror structures for all classes
|
//to do: uniform coderror structures for all classes
|
||||||
|
|
||||||
|
|
||||||
//if ( $res['codError'] < 0 ) {
|
//if ( $res['codError'] < 0 ) {
|
||||||
// G::SendMessageText ( $res['message'] , 'error' );
|
// G::SendMessageText ( $res['message'] , 'error' );
|
||||||
//}
|
//}
|
||||||
G::Header('location: processCategoryList');
|
G::Header( 'location: processCategoryList' );
|
||||||
} else {
|
} else {
|
||||||
// G::SendTemporalMessage("El registro ya existe", "warning", 'labels');
|
// G::SendTemporalMessage("El registro ya existe", "warning", 'labels');
|
||||||
G::Header('location: processCategoryList');
|
G::Header( 'location: processCategoryList' );
|
||||||
die;
|
die();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch ( Exception $e ) {
|
} catch (Exception $e) {
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher();
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
$aMessage['MESSAGE'] = $e->getMessage();
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||||
G::RenderPage( 'publish', 'blank' );
|
G::RenderPage( 'publish', 'blank' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,124 +20,123 @@
|
|||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(isset($_REQUEST['action'])) {
|
if (isset( $_REQUEST['action'] )) {
|
||||||
switch($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case 'processCategoryList':
|
case 'processCategoryList':
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
require_once 'classes/model/Process.php';
|
require_once 'classes/model/Process.php';
|
||||||
G::LoadClass('configuration');
|
G::LoadClass( 'configuration' );
|
||||||
$co = new Configurations();
|
$co = new Configurations();
|
||||||
$config = $co->getConfiguration('processCategoryList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
$config = $co->getConfiguration( 'processCategoryList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
|
||||||
|
|
||||||
$start = isset($_POST['start']) ? $_POST['start'] : 0;
|
$start = isset( $_POST['start'] ) ? $_POST['start'] : 0;
|
||||||
$limit = isset($_POST['limit']) ? $_POST['limit'] : $limit_size;
|
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : $limit_size;
|
||||||
$filter = isset($_REQUEST['textFilter'])? $_REQUEST['textFilter'] : '';
|
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
|
||||||
|
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_UID,'',Criteria::NOT_EQUAL);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_UID, '', Criteria::NOT_EQUAL );
|
||||||
if ($filter != ''){
|
if ($filter != '') {
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME,'%'.$filter.'%',Criteria::LIKE);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_NAME, '%' . $filter . '%', Criteria::LIKE );
|
||||||
}
|
}
|
||||||
$oDat = ProcessCategoryPeer::doSelectRS($oCriteria);
|
$oDat = ProcessCategoryPeer::doSelectRS( $oCriteria );
|
||||||
$oDat->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDat->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$oDat->next();
|
$oDat->next();
|
||||||
$row = $oDat->getRow();
|
$row = $oDat->getRow();
|
||||||
$total_categories = $row['CNT'];
|
$total_categories = $row['CNT'];
|
||||||
|
|
||||||
$oCriteria->clear();
|
$oCriteria->clear();
|
||||||
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
|
$oCriteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
|
||||||
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
|
$oCriteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME );
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_UID,'',Criteria::NOT_EQUAL);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_UID, '', Criteria::NOT_EQUAL );
|
||||||
if ($filter != ''){
|
if ($filter != '') {
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME,'%'.$filter.'%',Criteria::LIKE);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_NAME, '%' . $filter . '%', Criteria::LIKE );
|
||||||
}
|
}
|
||||||
$oCriteria->setLimit($limit);
|
$oCriteria->setLimit( $limit );
|
||||||
$oCriteria->setOffset($start);
|
$oCriteria->setOffset( $start );
|
||||||
$oDataset = ProcessCategoryPeer::doSelectRS($oCriteria);
|
$oDataset = ProcessCategoryPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
|
||||||
$proc = new Process();
|
$proc = new Process();
|
||||||
$aProcess = $proc->getAllProcessesByCategory();
|
$aProcess = $proc->getAllProcessesByCategory();
|
||||||
|
|
||||||
$aCat = array();
|
$aCat = array ();
|
||||||
while ($oDataset->next()){
|
while ($oDataset->next()) {
|
||||||
$aCat[] = $oDataset->getRow();
|
$aCat[] = $oDataset->getRow();
|
||||||
$index = sizeof($aCat)-1;
|
$index = sizeof( $aCat ) - 1;
|
||||||
$aCat[$index]['TOTAL_PROCESSES'] = isset($aProcess[$aCat[$index]['CATEGORY_UID']]) ? $aProcess[$aCat[$index]['CATEGORY_UID']] : 0;
|
$aCat[$index]['TOTAL_PROCESSES'] = isset( $aProcess[$aCat[$index]['CATEGORY_UID']] ) ? $aProcess[$aCat[$index]['CATEGORY_UID']] : 0;
|
||||||
}
|
}
|
||||||
echo '{categories: '.G::json_encode($aCat).', total_categories: '.$total_categories.'}';
|
echo '{categories: ' . G::json_encode( $aCat ) . ', total_categories: ' . $total_categories . '}';
|
||||||
break;
|
break;
|
||||||
case 'updatePageSize':
|
case 'updatePageSize':
|
||||||
G::LoadClass('configuration');
|
G::LoadClass( 'configuration' );
|
||||||
$c = new Configurations();
|
$c = new Configurations();
|
||||||
$arr['pageSize'] = $_REQUEST['size'];
|
$arr['pageSize'] = $_REQUEST['size'];
|
||||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
|
||||||
$config = Array();
|
$config = Array ();
|
||||||
$config[] = $arr;
|
$config[] = $arr;
|
||||||
$c->aConfig = $config;
|
$c->aConfig = $config;
|
||||||
$c->saveConfig('processCategoryList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
$c->saveConfig( 'processCategoryList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
break;
|
break;
|
||||||
case 'checkCategoryName':
|
case 'checkCategoryName':
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
$catName = $_REQUEST['cat_name'];
|
$catName = $_REQUEST['cat_name'];
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
|
$oCriteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME );
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME, $catName);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_NAME, $catName );
|
||||||
$oDataset = ProcessCategoryPeer::doSelectRS($oCriteria);
|
$oDataset = ProcessCategoryPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$row = $oDataset->getRow();
|
$row = $oDataset->getRow();
|
||||||
$response = isset($row['CATEGORY_NAME'])? 'false' : 'true' ;
|
$response = isset( $row['CATEGORY_NAME'] ) ? 'false' : 'true';
|
||||||
echo $response;
|
echo $response;
|
||||||
break;
|
break;
|
||||||
case 'saveNewCategory':
|
case 'saveNewCategory':
|
||||||
try{
|
try {
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
$catName = trim($_REQUEST['category']);
|
$catName = trim( $_REQUEST['category'] );
|
||||||
$pcat = new ProcessCategory();
|
$pcat = new ProcessCategory();
|
||||||
$pcat->setNew(true);
|
$pcat->setNew( true );
|
||||||
$pcat->setCategoryUid(G::GenerateUniqueID());
|
$pcat->setCategoryUid( G::GenerateUniqueID() );
|
||||||
$pcat->setCategoryName($catName);
|
$pcat->setCategoryName( $catName );
|
||||||
$pcat->save();
|
$pcat->save();
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
}catch(Exception $ex){
|
} catch (Exception $ex) {
|
||||||
echo '{success: false, error: '.$ex->getMessage().'}';
|
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'checkEditCategoryName':
|
case 'checkEditCategoryName':
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
$catUID = $_REQUEST['cat_uid'];
|
$catUID = $_REQUEST['cat_uid'];
|
||||||
$catName = $_REQUEST['cat_name'];
|
$catName = $_REQUEST['cat_name'];
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
|
$oCriteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME );
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME, $catName);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_NAME, $catName );
|
||||||
$oCriteria->add(ProcessCategoryPeer::CATEGORY_UID,$catUID,Criteria::NOT_EQUAL);
|
$oCriteria->add( ProcessCategoryPeer::CATEGORY_UID, $catUID, Criteria::NOT_EQUAL );
|
||||||
$oDataset = ProcessCategoryPeer::doSelectRS($oCriteria);
|
$oDataset = ProcessCategoryPeer::doSelectRS( $oCriteria );
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$row = $oDataset->getRow();
|
$row = $oDataset->getRow();
|
||||||
$response = isset($row['CATEGORY_NAME'])? 'false' : 'true' ;
|
$response = isset( $row['CATEGORY_NAME'] ) ? 'false' : 'true';
|
||||||
echo $response;
|
echo $response;
|
||||||
break;
|
break;
|
||||||
case 'updateCategory':
|
case 'updateCategory':
|
||||||
try{
|
try {
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
$catUID = $_REQUEST['cat_uid'];
|
$catUID = $_REQUEST['cat_uid'];
|
||||||
$catName = trim($_REQUEST['category']);
|
$catName = trim( $_REQUEST['category'] );
|
||||||
$pcat = new ProcessCategory();
|
$pcat = new ProcessCategory();
|
||||||
$pcat->setNew(false);
|
$pcat->setNew( false );
|
||||||
$pcat->setCategoryUid($catUID);
|
$pcat->setCategoryUid( $catUID );
|
||||||
$pcat->setCategoryName($catName);
|
$pcat->setCategoryName( $catName );
|
||||||
$pcat->save();
|
$pcat->save();
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
}catch(Exception $ex){
|
} catch (Exception $ex) {
|
||||||
echo '{success: false, error: '.$ex->getMessage().'}';
|
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'canDeleteCategory':
|
case 'canDeleteCategory':
|
||||||
@@ -145,21 +144,22 @@ if(isset($_REQUEST['action'])) {
|
|||||||
$proc = new Process();
|
$proc = new Process();
|
||||||
$aProcess = $proc->getAllProcessesByCategory();
|
$aProcess = $proc->getAllProcessesByCategory();
|
||||||
$catUID = $_REQUEST['CAT_UID'];
|
$catUID = $_REQUEST['CAT_UID'];
|
||||||
$response = isset($aProcess[$catUID])? 'false' : 'true';
|
$response = isset( $aProcess[$catUID] ) ? 'false' : 'true';
|
||||||
echo $response;
|
echo $response;
|
||||||
break;
|
break;
|
||||||
case 'deleteCategory':
|
case 'deleteCategory':
|
||||||
try{
|
try {
|
||||||
require_once 'classes/model/ProcessCategory.php';
|
require_once 'classes/model/ProcessCategory.php';
|
||||||
$catUID = $_REQUEST['cat_uid'];
|
$catUID = $_REQUEST['cat_uid'];
|
||||||
$cat = new ProcessCategory();
|
$cat = new ProcessCategory();
|
||||||
$cat->setCategoryUid($catUID);
|
$cat->setCategoryUid( $catUID );
|
||||||
$cat->delete();
|
$cat->delete();
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
}catch(Exception $ex){
|
} catch (Exception $ex) {
|
||||||
echo '{success: false, error: '.$ex->getMessage().'}';
|
echo '{success: false, error: ' . $ex->getMessage() . '}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: echo 'default';
|
default:
|
||||||
|
echo 'default';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* processes_DownloadFile.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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.
|
|
||||||
*/
|
|
||||||
//add more security, and catch any error or exception
|
|
||||||
|
|
||||||
|
|
||||||
$sFileName = $_GET['p'] . '.xpdl';
|
|
||||||
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
|
|
||||||
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
|
||||||
|
|
||||||
if (file_exists( $file )) {
|
|
||||||
rename( $file, $filex );
|
|
||||||
}
|
|
||||||
|
|
||||||
$realPath = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
|
|
||||||
G::streamFile( $realPath, true );
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* processes_ImportFileExisting.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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 {
|
|
||||||
//load the variables
|
|
||||||
G::LoadClass( 'xpdl' );
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
|
|
||||||
if (! isset( $_POST['form']['IMPORT_OPTION'] )) {
|
|
||||||
throw (new Exception( 'Please select an option before to continue' ));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! isset( $_POST['form']['GROUP_IMPORT_OPTION'] )) {
|
|
||||||
$action = "none";
|
|
||||||
} else {
|
|
||||||
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$option = $_POST['form']['IMPORT_OPTION'];
|
|
||||||
$filename = $_POST['form']['PRO_FILENAME'];
|
|
||||||
$ObjUid = $_POST['form']['OBJ_UID'];
|
|
||||||
|
|
||||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
|
||||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
|
||||||
$Fields['PRO_FILENAME'] = $filename;
|
|
||||||
$sProUid = $oData->process['PRO_UID'];
|
|
||||||
|
|
||||||
$oData->process['PRO_UID_OLD'] = $sProUid;
|
|
||||||
if (! isset( $oData->tasks ))
|
|
||||||
$oData->tasks = array ();
|
|
||||||
$tasks = $oData->tasks;
|
|
||||||
// code added by gustavo cruz gustavo-at-colosa-dot-com
|
|
||||||
// evaluate actions or import options
|
|
||||||
switch ($action) {
|
|
||||||
case "none":
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
case "rename":
|
|
||||||
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
case "merge":
|
|
||||||
$oBaseGroup = $oData->groupwfs;
|
|
||||||
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
|
|
||||||
$oData->groupwfs = $oNewGroup;
|
|
||||||
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there are duplicated groups render the group importing options
|
|
||||||
if ($groupsDuplicated > 0) {
|
|
||||||
$Fields['PRO_FILENAME'] = $filename;
|
|
||||||
$Fields['PRO_PATH'] = $path;
|
|
||||||
$Fields['IMPORT_OPTION'] = $option;
|
|
||||||
$Fields['OBJ_UID'] = $ObjUid;
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
|
||||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
|
|
||||||
G::RenderPage( 'publish', "blank" );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
//end added code
|
|
||||||
|
|
||||||
|
|
||||||
//Update the current Process, overwriting all tasks and steps
|
|
||||||
if ($option == 1) {
|
|
||||||
$oProcess->updateProcessFromData( $oData, $path . $filename );
|
|
||||||
if (file_exists( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid )) {
|
|
||||||
$oDirectory = dir( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid );
|
|
||||||
while ($sObjectName = $oDirectory->read()) {
|
|
||||||
if (($sObjectName != '.') && ($sObjectName != '..')) {
|
|
||||||
unlink( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDirectory->close();
|
|
||||||
}
|
|
||||||
$sNewProUid = $sProUid;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Disable current Process and create a new version of the Process
|
|
||||||
if ($option == 2) {
|
|
||||||
$oProcess->disablePreviousProcesses( $sProUid );
|
|
||||||
$sNewProUid = $oProcess->getUnusedProcessGUID();
|
|
||||||
$oProcess->setProcessGuid( $oData, $sNewProUid );
|
|
||||||
$oProcess->setProcessParent( $oData, $sProUid );
|
|
||||||
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
|
|
||||||
$oProcess->renewAll( $oData );
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
}
|
|
||||||
|
|
||||||
//Create a completely new Process without change the current Process
|
|
||||||
if ($option == 3) {
|
|
||||||
//krumo ($oData); die;
|
|
||||||
$sNewProUid = $oProcess->getUnusedProcessGUID();
|
|
||||||
$oProcess->setProcessGuid( $oData, $sNewProUid );
|
|
||||||
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
|
|
||||||
$oProcess->renewAll( $oData );
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
}
|
|
||||||
G::header( 'Location: processes_Map?PRO_UID=' . $sNewProUid );
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
|
||||||
G::RenderPage( 'publish', "blank" );
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* processes_ImportFile.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 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 {
|
|
||||||
//load the variables
|
|
||||||
G::LoadClass( 'xpdl' );
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
if (isset( $_POST['form']['PRO_FILENAME'] )) {
|
|
||||||
$path = $_POST['form']['PRO_PATH'];
|
|
||||||
$filename = $_POST['form']['PRO_FILENAME'];
|
|
||||||
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
|
|
||||||
} else {
|
|
||||||
//save the file, if it's not saved
|
|
||||||
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
|
|
||||||
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
|
|
||||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
|
||||||
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
|
|
||||||
$action = "none";
|
|
||||||
G::uploadFile( $tempName, $path, $filename );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
|
||||||
$Fields['PRO_FILENAME'] = $filename;
|
|
||||||
$Fields['IMPORT_OPTION'] = 2;
|
|
||||||
$sProUid = $oData->process['PRO_UID'];
|
|
||||||
|
|
||||||
$oData->process['PRO_UID_OLD'] = $sProUid;
|
|
||||||
|
|
||||||
if ($oProcess->processExists( $sProUid )) {
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
|
||||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl' );
|
|
||||||
G::RenderPage( 'publish', "blank" );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
// code added by gustavo cruz gustavo-at-colosa-dot-com
|
|
||||||
// evaluate actions or import options
|
|
||||||
switch ($action) {
|
|
||||||
case "none":
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
case "rename":
|
|
||||||
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
case "merge":
|
|
||||||
|
|
||||||
$oBaseGroup = $oData->groupwfs;
|
|
||||||
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
|
|
||||||
$oData->groupwfs = $oNewGroup;
|
|
||||||
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there are duplicated groups render the group importing options
|
|
||||||
if ($groupsDuplicated > 0) {
|
|
||||||
$Fields['PRO_FILENAME'] = $filename;
|
|
||||||
$Fields['PRO_PATH'] = $path;
|
|
||||||
$Fields['IMPORT_OPTION'] = 2;
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
|
||||||
$G_ID_MENU_SELECTED = 'PROCESSES';
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
|
|
||||||
G::RenderPage( 'publish', "blank" );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
// end added code
|
|
||||||
if (! isset( $oData->tasks ))
|
|
||||||
$oData->tasks = array ();
|
|
||||||
$tasks = $oData->tasks;
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
G::header( 'Location: processes_Map?PRO_UID=' . $sProUid );
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
|
||||||
G::RenderPage( 'publish', "blank" );
|
|
||||||
}
|
|
||||||
@@ -61,7 +61,7 @@ $result->catchMessage = "";
|
|||||||
|
|
||||||
if ($action == "uploadFileNewProcess") {
|
if ($action == "uploadFileNewProcess") {
|
||||||
try {
|
try {
|
||||||
//type of file, bpmn, xpdl, or pm
|
//type of file: only pm
|
||||||
$processFileType = $_REQUEST["processFileType"];
|
$processFileType = $_REQUEST["processFileType"];
|
||||||
$oProcess = new stdClass();
|
$oProcess = new stdClass();
|
||||||
$oData = new stdClass();
|
$oData = new stdClass();
|
||||||
@@ -71,13 +71,12 @@ if ($action == "uploadFileNewProcess") {
|
|||||||
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
|
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
|
||||||
$allowedExtensions = array ($processFileType
|
$allowedExtensions = array ($processFileType
|
||||||
);
|
);
|
||||||
$allowedExtensions = array ('xpdl','bpmn','pm'
|
$allowedExtensions = array ('pm');
|
||||||
);
|
|
||||||
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
|
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
|
||||||
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
|
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($processFileType != "pm" && $processFileType != "xpdl" && $processFileType != "bpmn") {
|
if ($processFileType != "pm") {
|
||||||
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
|
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,11 +85,6 @@ if ($action == "uploadFileNewProcess") {
|
|||||||
$oProcess = new Processes();
|
$oProcess = new Processes();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($processFileType == "xpdl") {
|
|
||||||
G::LoadClass( 'xpdl' );
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
}
|
|
||||||
|
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->ExistProcessInDatabase = ""; //"" -Default
|
$result->ExistProcessInDatabase = ""; //"" -Default
|
||||||
//0 -Dont exist process
|
//0 -Dont exist process
|
||||||
@@ -122,11 +116,9 @@ if ($action == "uploadFileNewProcess") {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
//if file is a .pm or .xpdl file continues normally the importing
|
//if file is a .pm file continues normally the importing
|
||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
$oData = $oProcess->getProcessData( $path . $filename );
|
$oData = $oProcess->getProcessData( $path . $filename );
|
||||||
} else {
|
|
||||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reservedWordsSqlValidate( $oData );
|
reservedWordsSqlValidate( $oData );
|
||||||
@@ -169,11 +161,6 @@ if ($action == "uploadFileNewProcess") {
|
|||||||
if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) {
|
if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) {
|
||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||||
} else {
|
|
||||||
if (! isset( $oData->tasks ))
|
|
||||||
$oData->tasks = array ();
|
|
||||||
$tasks = $oData->tasks;
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +189,7 @@ if ($action == "uploadFileNewProcessExist") {
|
|||||||
$sNewProUid = "";
|
$sNewProUid = "";
|
||||||
|
|
||||||
$oProcess = new stdClass();
|
$oProcess = new stdClass();
|
||||||
if ($processFileType != "pm" && $processFileType != "xpdl") {
|
if ($processFileType != "pm") {
|
||||||
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
|
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,17 +197,12 @@ if ($action == "uploadFileNewProcessExist") {
|
|||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
G::LoadClass( 'processes' );
|
G::LoadClass( 'processes' );
|
||||||
$oProcess = new Processes();
|
$oProcess = new Processes();
|
||||||
} else {
|
|
||||||
G::LoadClass( 'xpdl' );
|
|
||||||
$oProcess = new Xpdl();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||||
|
|
||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
$oData = $oProcess->getProcessData( $path . $filename );
|
$oData = $oProcess->getProcessData( $path . $filename );
|
||||||
} else {
|
|
||||||
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reservedWordsSqlValidate( $oData );
|
reservedWordsSqlValidate( $oData );
|
||||||
@@ -274,12 +256,6 @@ if ($action == "uploadFileNewProcessExist") {
|
|||||||
|
|
||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||||
} else {
|
|
||||||
if (! isset( $oData->tasks )) {
|
|
||||||
$oData->tasks = array ();
|
|
||||||
}
|
|
||||||
$tasks = $oData->tasks;
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,12 +269,6 @@ if ($action == "uploadFileNewProcessExist") {
|
|||||||
|
|
||||||
if ($processFileType == "pm") {
|
if ($processFileType == "pm") {
|
||||||
$oProcess->createProcessFromData( $oData, $path . $filename );
|
$oProcess->createProcessFromData( $oData, $path . $filename );
|
||||||
} else {
|
|
||||||
if (! isset( $oData->tasks )) {
|
|
||||||
$oData->tasks = array ();
|
|
||||||
}
|
|
||||||
$tasks = $oData->tasks;
|
|
||||||
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,201 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
function addNodox ($obj, $padre, $indice, $contenido = '', $atributos = '')
|
|
||||||
{
|
|
||||||
if (is_object( $padre )) {
|
|
||||||
if ($contenido == '') {
|
|
||||||
$nodo = $obj->createElement( $indice );
|
|
||||||
} else {
|
|
||||||
$nodo = $obj->createElement( $indice, $contenido );
|
|
||||||
}
|
|
||||||
$padre->appendChild( $nodo );
|
|
||||||
} else {
|
|
||||||
if ($contenido == '') {
|
|
||||||
$nodo = $obj->createElement( $indice );
|
|
||||||
} else {
|
|
||||||
$nodo = $obj->createElement( $indice, $contenido );
|
|
||||||
}
|
|
||||||
|
|
||||||
$obj->appendChild( $nodo );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array( $atributos )) {
|
|
||||||
foreach ($atributos as $key => $value) {
|
|
||||||
$atributo = $obj->createAttribute( $key );
|
|
||||||
$nodo->appendChild( $atributo );
|
|
||||||
|
|
||||||
$texto = $obj->createTextNode( $value );
|
|
||||||
$atributo->appendChild( $texto );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $nodo;
|
|
||||||
}
|
|
||||||
|
|
||||||
function derivationRules ($aRoute, $doc, $nodo_derivationrule)
|
|
||||||
{
|
|
||||||
$tam = count( $aRoute );
|
|
||||||
$c = 0;
|
|
||||||
switch ($aRoute[$c]['ROU_TYPE']) {
|
|
||||||
case 'SEQUENTIAL':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Sequential', '', '' );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_routeType, 'NextTask', '', '' );
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'EVALUATE':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Evaluations', '', '' );
|
|
||||||
while ($c < $tam) {
|
|
||||||
$nodo_evaluation = addNodox( $doc, $nodo_routeType, 'Evaluation', '', array ('Condition' => $aRoute[$c]['ROU_CONDITION']
|
|
||||||
) );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_evaluation, 'NextTask', '', '' );
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
$c ++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'SELECT':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'Selections', '', '' );
|
|
||||||
while ($c < $tam) {
|
|
||||||
$nodo_selection = addNodox( $doc, $nodo_routeType, 'Selection', '', array ('Description' => $aRoute[$c]['ROU_CONDITION']
|
|
||||||
) );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_selection, 'NextTask', '', '' );
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
$c ++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'PARALLEL':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'ParallelForks', '', '' );
|
|
||||||
while ($c < $tam) {
|
|
||||||
$nodo_parallelfork = addNodox( $doc, $nodo_routeType, 'ParallelFork', '', '' );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_parallelfork, 'NextTask', '', '' );
|
|
||||||
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
$c ++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'PARALLEL-BY-EVALUATION':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'ParallelForksByEvaluation', '', '' );
|
|
||||||
while ($c < $tam) {
|
|
||||||
$nodo_evaluation = addNodox( $doc, $nodo_routeType, 'Evaluation', '', array ('Condition' => $aRoute[$c]['ROU_CONDITION']
|
|
||||||
) );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_evaluation, 'NextTask', '', '' );
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
$c ++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'SEC-JOIN':
|
|
||||||
$nodo_routeType = addNodox( $doc, $nodo_derivationrule, 'ParallelJoin', '', '' );
|
|
||||||
$nodo_nexttask = addNodox( $doc, $nodo_routeType, 'NextTask', '', '' );
|
|
||||||
if ($aRoute[$c]['ROU_NEXT_TASK'] != - 1) {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'TaskRef', '', array ('TaskId' => 'ID' . $aRoute[$c]['ROU_NEXT_TASK']
|
|
||||||
) );
|
|
||||||
} else {
|
|
||||||
$nodo_taskref = addNodox( $doc, $nodo_nexttask, 'End', '', '' );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* **-_--__---___----___---__--_-***
|
|
||||||
*/
|
|
||||||
|
|
||||||
G::LoadClass( 'tasks' );
|
|
||||||
require_once 'classes/model/Process.php';
|
|
||||||
|
|
||||||
$doc = new DOMDocument( '1.0', 'UTF-8' );
|
|
||||||
$nodo_padre = addNodox( $doc, '', 'Processes', '', array ('xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance','xsi:noNamespaceSchemaLocation' => 'ColosaSchema.xsd'
|
|
||||||
) );
|
|
||||||
|
|
||||||
$aProcesses = array ();
|
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
|
||||||
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
|
|
||||||
//$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
|
|
||||||
//$oCriteria->add(ProcessPeer::PRO_UID, '946679494980c3d0ba0814088444708');
|
|
||||||
$oDataset = ProcessPeer::doSelectRS( $oCriteria );
|
|
||||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
|
||||||
$oDataset->next();
|
|
||||||
$oProcess = new Process();
|
|
||||||
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
|
||||||
$aProcess = $oProcess->load( $aRow['PRO_UID'] );
|
|
||||||
$nodo_process = addNodox( $doc, $nodo_padre, 'Process', '', array ('Title' => $aProcess['PRO_TITLE'],'Description' => $aProcess['PRO_DESCRIPTION']
|
|
||||||
) );
|
|
||||||
$nodo_tasks = addNodox( $doc, $nodo_process, 'Tasks', '', '' );
|
|
||||||
|
|
||||||
$oTask = new Tasks();
|
|
||||||
$aTasks = $oTask->getAllTasks( $aProcess['PRO_UID'] );
|
|
||||||
foreach ($aTasks as $key => $value) {
|
|
||||||
//print_r($value); echo "<br>";
|
|
||||||
$aRoute = $oTask->getRoute( $aProcess['PRO_UID'], $value['TAS_UID'] );
|
|
||||||
//print_r($aRoute[0]['ROU_UID']); echo "<hr>";
|
|
||||||
/*foreach($aRoute as $k => $v)
|
|
||||||
echo $k."-->".$v."<br>";
|
|
||||||
*/
|
|
||||||
if ($value['TAS_TYPE'] == 'NORMAL') {
|
|
||||||
$ini = ($value['TAS_START'] == 'TRUE') ? 'true' : 'false';
|
|
||||||
|
|
||||||
$nodo_task = addNodox( $doc, $nodo_tasks, 'Task', '', array ('Title' => $value['TAS_TITLE'],'Description' => $value['TAS_DESCRIPTION'],'Id' => 'ID' . $value['TAS_UID'],'StartingTask' => $ini
|
|
||||||
) );
|
|
||||||
$nodo_coordinates = addNodox( $doc, $nodo_task, 'Coordinates', '', array ('XCoordinate' => $value['TAS_POSX'],'YCoordinate' => $value['TAS_POSY']
|
|
||||||
) );
|
|
||||||
$nodo_derivationrule = addNodox( $doc, $nodo_task, 'DerivationRule', '', '' );
|
|
||||||
|
|
||||||
derivationRules( $aRoute, $doc, $nodo_derivationrule );
|
|
||||||
|
|
||||||
$nodo_assignmentrules = addNodox( $doc, $nodo_task, 'AssignmentRules', '', '' );
|
|
||||||
$nodo_cyclicalassignment = addNodox( $doc, $nodo_assignmentrules, 'CyclicalAssignment', '', '' );
|
|
||||||
$nodo_timingcontrol = addNodox( $doc, $nodo_task, 'TimingControl', '', array ('TaskDuration' => $value['TAS_DURATION']
|
|
||||||
) );
|
|
||||||
$nodo_permissions = addNodox( $doc, $nodo_task, 'Permissions', '', '' );
|
|
||||||
$nodo_caselabels = addNodox( $doc, $nodo_task, 'CaseLabels', '', '' );
|
|
||||||
$nodo_notifications = addNodox( $doc, $nodo_task, 'Notifications', '', '' );
|
|
||||||
} else {
|
|
||||||
require_once ("classes/model/SubProcess.php");
|
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
|
||||||
$oCriteria->add( SubProcessPeer::PRO_PARENT, $value['PRO_UID'] );
|
|
||||||
$oCriteria->add( SubProcessPeer::TAS_PARENT, $value['TAS_UID'] );
|
|
||||||
$oDataset = SubProcessPeer::doSelectRS( $oCriteria );
|
|
||||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
|
||||||
$oDataset->next();
|
|
||||||
$aRow = $oDataset->getRow();
|
|
||||||
$nodo_task = addNodox( $doc, $nodo_tasks, 'SubProcess', '', array ('Title' => $value['TAS_TITLE'],'Description' => $value['TAS_DESCRIPTION'],'Id' => 'ID' . $value['TAS_UID'],'ProcessRef' => $aRow['PRO_UID']
|
|
||||||
) );
|
|
||||||
$nodo_coordinates = addNodox( $doc, $nodo_task, 'Coordinates', '', array ('XCoordinate' => $value['TAS_POSX'],'YCoordinate' => $value['TAS_POSY']
|
|
||||||
) );
|
|
||||||
$nodo_derivationrule = addNodox( $doc, $nodo_task, 'DerivationRule', '', '' );
|
|
||||||
|
|
||||||
derivationRules( $aRoute, $doc, $nodo_derivationrule );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDataset->next();
|
|
||||||
}
|
|
||||||
//die;
|
|
||||||
$doc->preserveWhiteSpace = false;
|
|
||||||
$doc->formatOutput = true;
|
|
||||||
$doc->save( PATH_METHODS . 'services/test_xpdl.xml' );
|
|
||||||
echo "xml for xpdl creado!!!<br>";
|
|
||||||
|
|
||||||
@@ -17,6 +17,7 @@ ul#pm_menu {
|
|||||||
padding: 0 0 0 13px;
|
padding: 0 0 0 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul#pm_menu li { float: right;}
|
||||||
|
|
||||||
a.options-tool {
|
a.options-tool {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
|
|||||||
@@ -236,7 +236,10 @@ class SkinEngine
|
|||||||
if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
|
if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
|
||||||
$templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP .'extJsInitLoad.html';
|
$templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP .'extJsInitLoad.html';
|
||||||
}
|
}
|
||||||
//Skin uxs - simplefied
|
//Skin uxs - simplified
|
||||||
|
if (!isset($_SESSION['user_experience'])) {
|
||||||
|
$_SESSION['user_experience'] = 'NORMAL';
|
||||||
|
}
|
||||||
if ($_SESSION['user_experience'] != 'NORMAL') {
|
if ($_SESSION['user_experience'] != 'NORMAL') {
|
||||||
$templateFile = (is_dir(PATH_CUSTOM_SKINS . 'uxs')) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
|
$templateFile = (is_dir(PATH_CUSTOM_SKINS . 'uxs')) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,321 +0,0 @@
|
|||||||
ArrowLine=function(){
|
|
||||||
this.lineColor=new Color(0,0,0);
|
|
||||||
this.stroke=1;
|
|
||||||
this.canvas=null;
|
|
||||||
this.workflow=null;
|
|
||||||
this.html=null;
|
|
||||||
this.graphics=null;
|
|
||||||
//this.id=UUID.create();
|
|
||||||
this.startX=30;
|
|
||||||
this.startY=30;
|
|
||||||
this.endX=100;
|
|
||||||
this.endY=100;
|
|
||||||
this.zOrder=Line.ZOrderBaseIndex;
|
|
||||||
this.setSelectable(true);
|
|
||||||
this.setDeleteable(true);
|
|
||||||
this.arrowWidth=8;
|
|
||||||
this.arrowLength=20;
|
|
||||||
this.lineWidth=2;
|
|
||||||
};
|
|
||||||
|
|
||||||
ArrowLine.prototype=new Line();
|
|
||||||
ArrowLine.prototype.type="ArrowLine";
|
|
||||||
ArrowLine.prototype.paint=function(){
|
|
||||||
if(this.graphics===null){
|
|
||||||
this.graphics=new jsGraphics(this.id);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.graphics.clear();
|
|
||||||
}
|
|
||||||
//this.graphics.setStroke(this.stroke);
|
|
||||||
this.graphics.setStroke( Stroke.DOTTED );
|
|
||||||
this.graphics.setColor(this.lineColor.getHTMLStyle());
|
|
||||||
|
|
||||||
var endY=this.getLength();
|
|
||||||
var _3e2a=[0 ,0 ,endY ];
|
|
||||||
var _3e2b=[-this.lineWidth,+this.lineWidth,-(this.lineWidth)];
|
|
||||||
var _3e2c=this.getAngle()*Math.PI/180;
|
|
||||||
var rotX=[];
|
|
||||||
var rotY=[];
|
|
||||||
for(var i=0;i<_3e2a.length;i++){
|
|
||||||
rotX[i]=this.startX+_3e2a[i]*Math.cos(_3e2c)-_3e2b[i]*Math.sin(_3e2c);
|
|
||||||
rotY[i]=this.startY+_3e2a[i]*Math.sin(_3e2c)+_3e2b[i]*Math.cos(_3e2c);
|
|
||||||
}
|
|
||||||
this.graphics.drawPolyLine(rotX,rotY);
|
|
||||||
this.graphics.paint();
|
|
||||||
};
|
|
||||||
|
|
||||||
DottedConnection=function(){
|
|
||||||
ArrowLine.call(this);
|
|
||||||
this.sourcePort=null;
|
|
||||||
this.targetPort=null;
|
|
||||||
this.lineSegments=[];
|
|
||||||
this.setColor(new Color(0,0,115));
|
|
||||||
this.setLineWidth(1);
|
|
||||||
};
|
|
||||||
DottedConnection.prototype=new ArrowLine();
|
|
||||||
DottedConnection.prototype.type="DottedConnection";
|
|
||||||
DottedConnection.prototype.disconnect=function(){
|
|
||||||
if(this.sourcePort!==null){
|
|
||||||
this.sourcePort.detachMoveListener(this);
|
|
||||||
}
|
|
||||||
if(this.targetPort!==null){
|
|
||||||
this.targetPort.detachMoveListener(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.reconnect=function(){
|
|
||||||
if(this.sourcePort!==null){
|
|
||||||
this.sourcePort.attachMoveListener(this);
|
|
||||||
}
|
|
||||||
if(this.targetPort!==null){
|
|
||||||
this.targetPort.attachMoveListener(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.isConnector=function(){
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.isResizeable=function(){
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.setSource=function(port){
|
|
||||||
if(this.sourcePort!==null){
|
|
||||||
this.sourcePort.detachMoveListener(this);
|
|
||||||
}
|
|
||||||
this.sourcePort=port;
|
|
||||||
if(this.sourcePort===null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.sourcePort.attachMoveListener(this);
|
|
||||||
this.setStartPoint(port.getAbsoluteX(),port.getAbsoluteY());
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.getSource=function(){
|
|
||||||
return this.sourcePort;
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.setTarget=function(port){
|
|
||||||
if(this.targetPort!==null){
|
|
||||||
this.targetPort.detachMoveListener(this);
|
|
||||||
}
|
|
||||||
this.targetPort=port;
|
|
||||||
if(this.targetPort===null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.targetPort.attachMoveListener(this);
|
|
||||||
this.setEndPoint(port.getAbsoluteX(),port.getAbsoluteY());
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.getTarget=function(){
|
|
||||||
return this.targetPort;
|
|
||||||
};
|
|
||||||
DottedConnection.prototype.onOtherFigureMoved=function(_3824){
|
|
||||||
if(_3824==this.sourcePort){
|
|
||||||
this.setStartPoint(this.sourcePort.getAbsoluteX(),this.sourcePort.getAbsoluteY());
|
|
||||||
}else{
|
|
||||||
this.setEndPoint(this.targetPort.getAbsoluteX(),this.targetPort.getAbsoluteY());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bpmnAnnotation = function (oWorkflow) {
|
|
||||||
VectorFigure.call(this);
|
|
||||||
//Getting width and height from DB
|
|
||||||
if(typeof oWorkflow.anno_width != 'undefined' && typeof oWorkflow.anno_height != 'undefined'){
|
|
||||||
this.width = oWorkflow.anno_width;
|
|
||||||
this.height = oWorkflow.anno_height;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.width = 110;
|
|
||||||
this.height = 50;
|
|
||||||
}
|
|
||||||
this.setAnnotationName(oWorkflow.annotationName); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnAnnotation.prototype = new VectorFigure;
|
|
||||||
bpmnAnnotation.prototype.type = "bpmnAnnotation";
|
|
||||||
bpmnAnnotation.prototype.setAnnotationName = function (name) {
|
|
||||||
if(typeof name != 'undefined')
|
|
||||||
this.annotationName = name;
|
|
||||||
else
|
|
||||||
this.annotationName = 'Annotation 1';
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnAnnotation.prototype.coord_converter = function (bound_width, bound_height, text_length) {
|
|
||||||
//bound_width = this.workflow.currentSelection.width;
|
|
||||||
//bound_height = this.workflow.currentSelection.height;
|
|
||||||
input_width = text_length * 6
|
|
||||||
input_height = 10
|
|
||||||
|
|
||||||
temp_width = bound_width - input_width;
|
|
||||||
temp_width /= 2;
|
|
||||||
temp_x = temp_width;
|
|
||||||
|
|
||||||
temp_height = bound_height - 10;
|
|
||||||
temp_height /= 2;
|
|
||||||
temp_y = temp_height;
|
|
||||||
|
|
||||||
var temp_coord = new Object();
|
|
||||||
temp_coord.temp_x = temp_x;
|
|
||||||
temp_coord.temp_y = temp_y;
|
|
||||||
return temp_coord;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bpmnAnnotation.prototype.paint = function () {
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
|
|
||||||
if(typeof workflow.zoomfactor == 'undefined')
|
|
||||||
workflow.zoomfactor = 1;
|
|
||||||
|
|
||||||
//Set the Task Limitation
|
|
||||||
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
|
|
||||||
{
|
|
||||||
this.originalWidth = 110;
|
|
||||||
this.originalHeight = 50;
|
|
||||||
this.orgXPos = this.getX();
|
|
||||||
this.orgYPos = this.getY();
|
|
||||||
this.orgFontSize =this.fontSize;
|
|
||||||
}
|
|
||||||
var zoomRate = workflow.zoomfactor;
|
|
||||||
|
|
||||||
this.width = this.originalWidth * workflow.zoomfactor;
|
|
||||||
this.height = this.originalHeight * workflow.zoomfactor;
|
|
||||||
|
|
||||||
//this.graphics.setColor("#ffffff");
|
|
||||||
this.graphics.setColor("#f8f8f8");
|
|
||||||
this.graphics.fillRect(0,0, this.getWidth(), this.getHeight());
|
|
||||||
this.graphics.setStroke(1.5);
|
|
||||||
this.graphics.setColor("#202020");
|
|
||||||
this.graphics.drawLine(this.getWidth()/4,0,0,0);
|
|
||||||
this.graphics.drawLine(0,0,0,this.getHeight());
|
|
||||||
this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight());
|
|
||||||
this.graphics.setStroke(1);
|
|
||||||
this.graphics.paint();
|
|
||||||
|
|
||||||
/* New object is created to implement changing of Text functionality
|
|
||||||
*/
|
|
||||||
this.bpmnText = new jsGraphics(this.id) ;
|
|
||||||
this.padleft = 0.05*this.getWidth();
|
|
||||||
this.padtop = 0.13*this.getHeight() -1;
|
|
||||||
this.rectwidth = this.getWidth() - this.padleft;
|
|
||||||
this.rectheight = this.getHeight() - 2 * this.padtop;
|
|
||||||
|
|
||||||
//Setting text size to zoom font size if Zoomed
|
|
||||||
this.fontSize = 11;
|
|
||||||
var fontSize = zoomRate * this.fontSize;
|
|
||||||
this.bpmnText.setFont('verdana', + fontSize+'px', Font.PLAIN);
|
|
||||||
|
|
||||||
this.bpmnText.drawStringAnno(this.annotationName,0,this.padtop,this.rectwidth,this.rectheight,'left');
|
|
||||||
this.bpmnText.paint();
|
|
||||||
|
|
||||||
if( this.input1!=null ){
|
|
||||||
this.input1.setPosition(0,this.height/2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
jsGraphics.prototype.drawStringAnno = function(txt, x, y, width,height, halign)
|
|
||||||
{
|
|
||||||
this.htm += '<div style="position:absolute;overflow:hidden;'+
|
|
||||||
'left:' + x + 'px;'+
|
|
||||||
'top:' + y + 'px;'+
|
|
||||||
'width:'+width +'px;'+
|
|
||||||
'height:'+height +'px;'+
|
|
||||||
'text-align:'+halign+';'+
|
|
||||||
'font-family:' + this.ftFam + ';'+
|
|
||||||
'font-size:' + this.ftSz + ';'+ 'padding-left:6px;'+
|
|
||||||
'color:' + this.color + ';' + this.ftSty + '">'+
|
|
||||||
txt +
|
|
||||||
'<\/div>';
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnAnnotation.prototype.setWorkflow=function(_40c5){
|
|
||||||
VectorFigure.prototype.setWorkflow.call(this,_40c5);
|
|
||||||
if(_40c5!=null){
|
|
||||||
this.input1=new InputPort();
|
|
||||||
this.input1.setWorkflow(_40c5);
|
|
||||||
this.input1.setName('input1');
|
|
||||||
this.input1.setZOrder(-1);
|
|
||||||
this.input1.setBackgroundColor(new Color(255, 255, 255));
|
|
||||||
this.input1.setColor(new Color(255, 255, 255));
|
|
||||||
//this.addPort(this.input1,0,this.height/2);
|
|
||||||
this.addPort(this.input1,-this.getWidth()/2,-this.getHeight()/4);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnAnnotationDialog = function (_2e5e) {
|
|
||||||
this.figure = _2e5e;
|
|
||||||
var title = 'Annotation';
|
|
||||||
Dialog.call(this, title);
|
|
||||||
this.setDimension(400, 150); //Set the width and height of the Dialog box
|
|
||||||
}
|
|
||||||
|
|
||||||
bpmnAnnotationDialog.prototype = new Dialog();
|
|
||||||
bpmnAnnotationDialog.prototype.createHTMLElement = function () {
|
|
||||||
var item = Dialog.prototype.createHTMLElement.call(this);
|
|
||||||
var inputDiv = document.createElement("form");
|
|
||||||
inputDiv.style.position = "absolute";
|
|
||||||
inputDiv.style.left = "10px";
|
|
||||||
inputDiv.style.top = "30px";
|
|
||||||
inputDiv.style.width = "375px";
|
|
||||||
inputDiv.style.font = "normal 10px verdana";
|
|
||||||
item.appendChild(inputDiv);
|
|
||||||
this.label = document.createTextNode("Annotation Name");
|
|
||||||
inputDiv.appendChild(this.label);
|
|
||||||
this.input = document.createElement("textarea");
|
|
||||||
this.input.style.border = "1px solid gray";
|
|
||||||
this.input.style.font = "normal 10px verdana";
|
|
||||||
//this.input.type = "text";
|
|
||||||
this.input.maxLength = "500";
|
|
||||||
this.input.cols = "50";
|
|
||||||
this.input.rows = "3";
|
|
||||||
var value = bpmnTask.prototype.trim(this.figure.workflow.currentSelection.annotationName);
|
|
||||||
if (value) this.input.value = value;
|
|
||||||
else this.input.value = "";
|
|
||||||
this.input.style.width = "100%";
|
|
||||||
inputDiv.appendChild(this.input);
|
|
||||||
this.input.focus();
|
|
||||||
return item;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*Double Click Event for opening the dialog Box*/
|
|
||||||
bpmnAnnotation.prototype.onDoubleClick = function () {
|
|
||||||
var _409d = new bpmnAnnotationDialog(this);
|
|
||||||
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
|
|
||||||
* The string is first cleared and new string is painted.<br><br>
|
|
||||||
**/
|
|
||||||
bpmnAnnotationDialog.prototype.onOk = function () {
|
|
||||||
this.figure.bpmnText.clear();
|
|
||||||
|
|
||||||
len = Math.ceil(this.input.value.length/16);
|
|
||||||
if(this.input.value.length < 19)
|
|
||||||
{
|
|
||||||
len = 1.5;
|
|
||||||
if(this.input.value.length > 9)
|
|
||||||
this.figure.rectWidth = this.input.value.length*8;
|
|
||||||
else
|
|
||||||
this.figure.rectWidth = 48;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
this.figure.rectWidth = 150;
|
|
||||||
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
|
|
||||||
this.figure.bpmnText.drawStringAnno(this.input.value,20,20,this.figure.rectWidth,'left');
|
|
||||||
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
|
|
||||||
this.figure.bpmnText.paint();
|
|
||||||
this.figure.annotationName = this.input.value; //Set Updated Text value
|
|
||||||
|
|
||||||
//Updating Annotation Text Async into the DB
|
|
||||||
this.figure.actiontype = 'updateText';
|
|
||||||
this.workflow.saveShape(this.figure);
|
|
||||||
|
|
||||||
if(this.figure.rectWidth<80)
|
|
||||||
tempW = 110;
|
|
||||||
else
|
|
||||||
tempW = this.figure.rectWidth+35;
|
|
||||||
this.workflow.currentSelection.setDimension(tempW, len*13+40);
|
|
||||||
|
|
||||||
this.workflow.removeFigure(this);
|
|
||||||
};
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
bpmnDataobject = function (_30ab) {
|
|
||||||
VectorFigure.call(this);
|
|
||||||
this.setDimension(50, 80);
|
|
||||||
this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnDataobject.prototype = new VectorFigure;
|
|
||||||
bpmnDataobject.prototype.type = "bpmnDataobject";
|
|
||||||
bpmnDataobject.prototype.setTaskName = function (name) {
|
|
||||||
this.taskName = 'Data Object ' + name;
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnDataobject.prototype.paint = function () {
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
var x = new Array(0, this.getWidth()-10, this.getWidth(), this.getWidth()-10, this.getWidth()-10, this.getWidth(), this.getWidth(), 0);
|
|
||||||
var y = new Array(0, 0, 10, 10, 0, 10, this.getHeight(), this.getHeight());
|
|
||||||
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
this.graphics.setColor("#c0c0c0");
|
|
||||||
this.graphics.fillPolygon(x, y);
|
|
||||||
|
|
||||||
for (var i = 0; i < x.length; i++) {
|
|
||||||
x[i] = x[i] - 3;
|
|
||||||
y[i] = y[i] - 3;
|
|
||||||
}
|
|
||||||
this.graphics.setColor("#ffffff");
|
|
||||||
this.graphics.fillPolygon(x, y);
|
|
||||||
this.graphics.setColor("#ff0f0f");
|
|
||||||
this.graphics.drawPolygon(x, y);
|
|
||||||
this.graphics.paint();
|
|
||||||
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
|
|
||||||
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
bpmnEventBoundaryInter=function(){
|
|
||||||
VectorFigure.call(this);
|
|
||||||
//Setting width and height values as per the zoom ratio
|
|
||||||
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
|
|
||||||
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
|
|
||||||
else
|
|
||||||
this.setDimension(30,30);
|
|
||||||
this.stroke = 2;
|
|
||||||
};
|
|
||||||
bpmnEventBoundaryInter.prototype=new VectorFigure;
|
|
||||||
bpmnEventBoundaryInter.prototype.type="bpmnEventBoundaryTimerInter";
|
|
||||||
bpmnEventBoundaryInter.prototype.paint=function(){
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
var x_cir1=0;
|
|
||||||
var y_cir1=0;
|
|
||||||
|
|
||||||
this.graphics.setColor("#c0c0c0");
|
|
||||||
this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight());
|
|
||||||
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
this.graphics.setColor( "#f9faf2" );
|
|
||||||
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
|
|
||||||
var x_cir2=3;
|
|
||||||
var y_cir2=3;
|
|
||||||
this.graphics.setColor( "#f9faf2" );
|
|
||||||
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
|
|
||||||
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
|
|
||||||
this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/1.6,this.getHeight()/2); //horizontal line
|
|
||||||
this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/2.2,this.getHeight()/3.7); //vertical line
|
|
||||||
|
|
||||||
this.graphics.drawLine(24,8,20,11); //10th min line
|
|
||||||
this.graphics.drawLine(22,15,25,15); //15th min line
|
|
||||||
this.graphics.drawLine(24,22,19,20); //25th min line
|
|
||||||
this.graphics.drawLine(15,22,15,25); //30th min line
|
|
||||||
this.graphics.drawLine(8,22,12,19); //40th min line
|
|
||||||
this.graphics.drawLine(5,15,8,15); //45th min line
|
|
||||||
this.graphics.drawLine(8,8,11,11); //50th min line
|
|
||||||
this.graphics.drawLine(15,5,15,8); //60th min line
|
|
||||||
|
|
||||||
this.graphics.paint();
|
|
||||||
|
|
||||||
/*Code Added to Dynamically shift Ports on resizing of shapes
|
|
||||||
**/
|
|
||||||
if(this.input1!=null){
|
|
||||||
this.input1.setPosition(0,this.height/2);
|
|
||||||
}
|
|
||||||
if(this.output1!=null){
|
|
||||||
this.output1.setPosition(this.width/2,this.height);
|
|
||||||
}
|
|
||||||
if(this.input2!=null){
|
|
||||||
this.input2.setPosition(this.width/2,0);
|
|
||||||
}
|
|
||||||
if(this.output2!=null){
|
|
||||||
this.output2.setPosition(this.width,this.height/2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventBoundaryInter.prototype.setWorkflow=function(_40c5){
|
|
||||||
VectorFigure.prototype.setWorkflow.call(this,_40c5);
|
|
||||||
if(_40c5!=null){
|
|
||||||
var eventPortName = ['input2','output2'];
|
|
||||||
var eventPortType = ['InputPort','OutputPort'];
|
|
||||||
var eventPositionX= [this.width/2,this.width/2];
|
|
||||||
var eventPositionY= [0,this.height];
|
|
||||||
|
|
||||||
for(var i=0; i< eventPortName.length ; i++){
|
|
||||||
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
|
|
||||||
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
|
|
||||||
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
|
|
||||||
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
|
|
||||||
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
|
|
||||||
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
|
|
||||||
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventBoundaryInter.prototype.getContextMenu=function(){
|
|
||||||
if(this.id != null){
|
|
||||||
this.workflow.handleContextMenu(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
bpmnEventCancelEnd=function(){
|
|
||||||
VectorFigure.call(this);
|
|
||||||
//Setting width and height values as per the zoom ratio
|
|
||||||
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
|
|
||||||
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
|
|
||||||
else
|
|
||||||
this.setDimension(30,30);
|
|
||||||
this.stroke=3;
|
|
||||||
};
|
|
||||||
bpmnEventCancelEnd.prototype=new VectorFigure;
|
|
||||||
bpmnEventCancelEnd.prototype.type="bpmnEventCancelEnd";
|
|
||||||
bpmnEventCancelEnd.prototype.paint=function(){
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
//Set the Task Limitation
|
|
||||||
if (this.getWidth() < 30 || this.getHeight() < 30) {
|
|
||||||
this.setDimension(30, 30);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
var x_cir = 0;
|
|
||||||
var y_cir = 0;
|
|
||||||
|
|
||||||
this.graphics.setColor("#c0c0c0");
|
|
||||||
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setColor("#f7f1e5");
|
|
||||||
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setColor("#c46508");
|
|
||||||
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setStroke(2);
|
|
||||||
//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11);
|
|
||||||
//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29);
|
|
||||||
var x=new Array(this.getWidth()/2.8,this.getWidth()/1.95,this.getWidth()/1.45,this.getWidth()/1.25,this.getWidth()/1.55,this.getWidth()/1.21,this.getWidth()/1.4,this.getWidth()/1.95,this.getWidth()/2.8,this.getWidth()/4.1,this.getWidth()/2.5,this.getWidth()/4.1);
|
|
||||||
var y=new Array(this.getHeight()/1.28,this.getHeight()/1.66,this.getHeight()/1.36,this.getHeight()/1.55,this.getHeight()/2.04,this.getHeight()/3.21,this.getHeight()/5.6,this.getHeight()/2.81,this.getHeight()/5.6,this.getHeight()/3.21,this.getHeight()/2.04,this.getHeight()/1.55);
|
|
||||||
this.graphics.setColor("#c46508");
|
|
||||||
this.graphics.fillPolygon(x,y);
|
|
||||||
this.graphics.setColor("#c46508");
|
|
||||||
//this.graphics.drawPolygon(x,y);
|
|
||||||
this.graphics.paint();
|
|
||||||
|
|
||||||
/*Code Added to Dynamically shift Ports on resizing of shapes
|
|
||||||
**/
|
|
||||||
if(this.input1!=null){
|
|
||||||
this.input1.setPosition(0,this.height/2);
|
|
||||||
}
|
|
||||||
if(this.output1!=null){
|
|
||||||
this.output1.setPosition(this.width/2,this.height);
|
|
||||||
}
|
|
||||||
if(this.input2!=null){
|
|
||||||
this.input2.setPosition(this.width/2,0);
|
|
||||||
}
|
|
||||||
if(this.output2!=null){
|
|
||||||
this.output2.setPosition(this.width,this.height/2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventCancelEnd.prototype.setWorkflow=function(_40c5){
|
|
||||||
VectorFigure.prototype.setWorkflow.call(this,_40c5);
|
|
||||||
if(_40c5!=null){
|
|
||||||
var eventPortName = ['input1','input2'];
|
|
||||||
var eventPortType = ['InputPort','InputPort'];
|
|
||||||
var eventPositionX= [this.width/2,0];
|
|
||||||
var eventPositionY= [0,this.height/2];
|
|
||||||
|
|
||||||
for(var i=0; i< eventPortName.length ; i++){
|
|
||||||
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
|
|
||||||
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
|
|
||||||
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
|
|
||||||
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
|
|
||||||
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
|
|
||||||
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
|
|
||||||
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventCancelEnd.prototype.getContextMenu=function(){
|
|
||||||
if(this.id != null){
|
|
||||||
this.workflow.handleContextMenu(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
bpmnEventCancelInter=function(){
|
|
||||||
VectorFigure.call(this);
|
|
||||||
this.stroke=1;
|
|
||||||
};
|
|
||||||
bpmnEventCancelInter.prototype=new VectorFigure;
|
|
||||||
bpmnEventCancelInter.prototype.type="bpmnEventCancelInter";
|
|
||||||
bpmnEventCancelInter.prototype.paint=function(){
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
|
|
||||||
if(typeof workflow.zoomfactor == 'undefined')
|
|
||||||
workflow.zoomfactor = 1;
|
|
||||||
//Set the Task Limitation
|
|
||||||
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
|
|
||||||
{
|
|
||||||
this.originalWidth = 30;
|
|
||||||
this.originalHeight = 30;
|
|
||||||
this.orgXPos = this.getX();
|
|
||||||
this.orgYPos = this.getY();
|
|
||||||
this.orgFontSize =this.fontSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.width = this.originalWidth * workflow.zoomfactor;
|
|
||||||
this.height = this.originalHeight * workflow.zoomfactor;
|
|
||||||
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
var x_cir = 0;
|
|
||||||
var y_cir = 0;
|
|
||||||
this.graphics.setColor("#000000");
|
|
||||||
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
var x_cir2=5;
|
|
||||||
var y_cir2=5;
|
|
||||||
this.graphics.setColor("#000000");
|
|
||||||
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
|
|
||||||
//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11);
|
|
||||||
//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29);
|
|
||||||
var cw = this.getWidth();
|
|
||||||
var ch = this.getHeight();
|
|
||||||
var x=new Array(cw*0.35,cw*0.51,cw*0.68,cw*0.8,cw*0.64,cw*0.82,cw*0.71,cw*0.51,cw*0.35,cw*0.24,cw*0.4,cw*0.24);
|
|
||||||
var y=new Array(ch*0.78,ch*0.6,ch*0.73,ch*0.64,ch*0.49,ch*0.31,ch*0.17,ch*0.35,ch*0.17,ch*0.31,ch*0.49,ch*0.64);
|
|
||||||
//var x=new Array(cw/2.8,cw/1.95,cw/1.45,cw/1.25,cw/1.55,cw/1.21,cw/1.4,cw/1.95,cw/2.8,cw/4.1,cw/2.5,cw/4.1);
|
|
||||||
//var y=new Array(ch/1.28,ch/1.66,ch/1.36,ch/1.55,ch/2.04,ch/3.21,ch/5.6,ch/2.81,ch/5.6,ch/3.21,ch/2.04,ch/1.55);
|
|
||||||
this.graphics.setColor("#ffffff");
|
|
||||||
this.graphics.fillPolygon(x,y);
|
|
||||||
this.graphics.setColor("#000000");
|
|
||||||
this.graphics.drawPolygon(x,y);
|
|
||||||
this.graphics.paint();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
bpmnEventCompEnd=function(){
|
|
||||||
VectorFigure.call(this);
|
|
||||||
//Setting width and height values as per the zoom ratio
|
|
||||||
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
|
|
||||||
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
|
|
||||||
else
|
|
||||||
this.setDimension(30,30);
|
|
||||||
this.stroke=3
|
|
||||||
};
|
|
||||||
bpmnEventCompEnd.prototype=new VectorFigure;
|
|
||||||
bpmnEventCompEnd.prototype.type="bpmnEventCompEnd";
|
|
||||||
bpmnEventCompEnd.prototype.paint=function(){
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
var x_cir = 0;
|
|
||||||
var y_cir = 0;
|
|
||||||
|
|
||||||
this.graphics.setColor("#c0c0c0");
|
|
||||||
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setColor("#f7f1e5");
|
|
||||||
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
this.graphics.setColor("#c46508");
|
|
||||||
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
//var x_arrow=new Array(6,19,19,32,32,19,19);
|
|
||||||
//var y_arrow=new Array(22,33,22,33,11,22,11);
|
|
||||||
var x_arrow=new Array(this.getWidth()/7,this.getWidth()/2.36,this.getWidth()/2.36,this.getWidth()/1.4,this.getWidth()/1.42,this.getWidth()/2.36,this.getWidth()/2.36);
|
|
||||||
var y_arrow=new Array(this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/4,this.getHeight()/2,this.getHeight()/4);
|
|
||||||
this.graphics.setColor( "#c46508" );
|
|
||||||
this.graphics.fillPolygon(x_arrow,y_arrow);
|
|
||||||
this.graphics.setColor("#c46508");
|
|
||||||
//this.graphics.drawPolygon(x_arrow,y_arrow);
|
|
||||||
this.graphics.paint();/*Code Added to Dynamically shift Ports on resizing of shapes
|
|
||||||
**/
|
|
||||||
if(this.input1!=null){
|
|
||||||
this.input1.setPosition(0,this.height/2);
|
|
||||||
}
|
|
||||||
if(this.output1!=null){
|
|
||||||
this.output1.setPosition(this.width/2,this.height);
|
|
||||||
}
|
|
||||||
if(this.input2!=null){
|
|
||||||
this.input2.setPosition(this.width/2,0);
|
|
||||||
}
|
|
||||||
if(this.output2!=null){
|
|
||||||
this.output2.setPosition(this.width,this.height/2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventCompEnd.prototype.setWorkflow=function(_40c5){
|
|
||||||
VectorFigure.prototype.setWorkflow.call(this,_40c5);
|
|
||||||
if(_40c5!=null){
|
|
||||||
var eventPortName = ['input1','input2'];
|
|
||||||
var eventPortType = ['InputPort','InputPort'];
|
|
||||||
var eventPositionX= [this.width/2,0];
|
|
||||||
var eventPositionY= [0,this.height/2];
|
|
||||||
|
|
||||||
for(var i=0; i< eventPortName.length ; i++){
|
|
||||||
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
|
|
||||||
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
|
|
||||||
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
|
|
||||||
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
|
|
||||||
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
|
|
||||||
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
|
|
||||||
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bpmnEventCompEnd.prototype.getContextMenu=function(){
|
|
||||||
if(this.id != null){
|
|
||||||
this.workflow.handleContextMenu(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
bpmnEventCompInter=function(){
|
|
||||||
VectorFigure.call(this);
|
|
||||||
this.stroke=1
|
|
||||||
};
|
|
||||||
bpmnEventCompInter.prototype=new VectorFigure;
|
|
||||||
bpmnEventCompInter.prototype.type="bpmnEventCompInter";
|
|
||||||
bpmnEventCompInter.prototype.paint=function(){
|
|
||||||
VectorFigure.prototype.paint.call(this);
|
|
||||||
|
|
||||||
if(typeof workflow.zoomfactor == 'undefined')
|
|
||||||
workflow.zoomfactor = 1;
|
|
||||||
//Set the Task Limitation
|
|
||||||
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
|
|
||||||
{
|
|
||||||
this.originalWidth = 30;
|
|
||||||
this.originalHeight = 30;
|
|
||||||
this.orgXPos = this.getX();
|
|
||||||
this.orgYPos = this.getY();
|
|
||||||
this.orgFontSize =this.fontSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.width = this.originalWidth * workflow.zoomfactor;
|
|
||||||
this.height = this.originalHeight * workflow.zoomfactor;
|
|
||||||
|
|
||||||
this.graphics.setStroke(this.stroke);
|
|
||||||
var x_cir =0;
|
|
||||||
var y_cir =0;
|
|
||||||
|
|
||||||
this.graphics.setColor("#c0c0c0");
|
|
||||||
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
|
|
||||||
|
|
||||||
this.graphics.setColor("#f9faf2")
|
|
||||||
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight())
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
|
|
||||||
|
|
||||||
var x_cir2=3;
|
|
||||||
var y_cir2=3;
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
|
|
||||||
//var x_arrow=new Array(6,19,19,32,32,19,19);
|
|
||||||
//var y_arrow=new Array(22,33,22,33,11,22,11);
|
|
||||||
var cw = this.getWidth();
|
|
||||||
var ch = this.getHeight();
|
|
||||||
var x_arrow=new Array(cw*0.13,cw*0.42,cw*0.42,cw*0.71,cw*0.7,cw*0.42,cw*0.42);
|
|
||||||
var y_arrow=new Array(ch*0.5,ch*0.73,ch*0.5,ch*0.73,ch*0.25,ch*0.5,ch*0.25);
|
|
||||||
//var x_arrow=new Array(cw/7.5,cw/2.36,cw/2.36,cw/1.4,cw/1.42,cw/2.36,cw/2.36);
|
|
||||||
//var y_arrow=new Array(ch/2,ch/1.36,ch/2,ch/1.36,ch/4,ch/2,ch/4);
|
|
||||||
this.graphics.setColor( "#adae5e" );
|
|
||||||
this.graphics.fillPolygon(x_arrow,y_arrow);
|
|
||||||
this.graphics.setColor("#adae5e");
|
|
||||||
this.graphics.drawPolygon(x_arrow,y_arrow);
|
|
||||||
this.graphics.paint();
|
|
||||||
|
|
||||||
/*Code Added to Dynamically shift Ports on resizing of shapes
|
|
||||||
**/
|
|
||||||
if(this.input1!=null){
|
|
||||||
this.input1.setPosition(0,this.height/2);
|
|
||||||
}
|
|
||||||
if(this.output1!=null){
|
|
||||||
this.output1.setPosition(this.width/2,this.height);
|
|
||||||
}
|
|
||||||
if(this.input2!=null){
|
|
||||||
this.input2.setPosition(this.width/2,0);
|
|
||||||
}
|
|
||||||
if(this.output2!=null){
|
|
||||||
this.output2.setPosition(this.width,this.height/2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventCompInter.prototype.setWorkflow=function(_40c5){
|
|
||||||
VectorFigure.prototype.setWorkflow.call(this,_40c5);
|
|
||||||
if(_40c5!=null){
|
|
||||||
|
|
||||||
var eventPortName = ['input1','input2','output1','output2'];
|
|
||||||
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
|
|
||||||
var eventPositionX= [0,this.width/2,this.width,this.width/2];
|
|
||||||
var eventPositionY= [this.height/2,0,this.height/2,this.height];
|
|
||||||
|
|
||||||
for(var i=0; i< eventPortName.length ; i++){
|
|
||||||
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
|
|
||||||
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
|
|
||||||
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
|
|
||||||
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
|
|
||||||
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
|
|
||||||
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
|
|
||||||
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
this.output1=new OutputPort();
|
|
||||||
this.output1.setWorkflow(_40c5);
|
|
||||||
this.output1.setName("output1");
|
|
||||||
this.output1.setBackgroundColor(new Color(115, 115, 245));
|
|
||||||
this.addPort(this.output1,this.width/2,this.height);
|
|
||||||
|
|
||||||
this.output2=new OutputPort();
|
|
||||||
this.output2.setWorkflow(_40c5);
|
|
||||||
this.output2.setName("output2");
|
|
||||||
this.output2.setBackgroundColor(new Color(115, 115, 245));
|
|
||||||
this.addPort(this.output2,this.width,this.height/2);
|
|
||||||
|
|
||||||
this.input1=new InputPort();
|
|
||||||
this.input1.setWorkflow(_40c5);
|
|
||||||
this.input1.setName("input1");
|
|
||||||
this.input1.setBackgroundColor(new Color(245,115,115));
|
|
||||||
this.addPort(this.input1,0,this.height/2);
|
|
||||||
|
|
||||||
this.input2=new InputPort();
|
|
||||||
this.input2.setWorkflow(_40c5);
|
|
||||||
this.input2.setName("input2");
|
|
||||||
this.input2.setBackgroundColor(new Color(245,115,115));
|
|
||||||
this.addPort(this.input2,this.width/2,0);*/
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bpmnEventCompInter.prototype.getContextMenu=function(){
|
|
||||||
if(this.id != null){
|
|
||||||
this.workflow.handleContextMenu(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user