Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Wendy Nestor
2014-07-01 23:19:59 -04:00
11 changed files with 138 additions and 21 deletions

View File

@@ -44,6 +44,7 @@ task :build => [:required] do
pmUIDir = targetDir + "/pmUI"
mafeDir = targetDir + "/mafe"
pmdynaformDir = targetDir + "/pmdynaform"
prepareDirs([pmUIDir, mafeDir, pmdynaformDir, jsTargetDir, cssTargetDir, cssImagesTargetDir, imgTargetDir, pmUIFontsDir])
@@ -53,6 +54,7 @@ task :build => [:required] do
pmuiHash = getHash(Dir.pwd + "/vendor/colosa/pmUI")
mafeHash = getHash(Dir.pwd + "/vendor/colosa/MichelangeloFE")
pmdynaformHash = getHash(Dir.pwd + "/vendor/colosa/pmDynaform")
hashVendors = pmuiHash+"-"+mafeHash
## Building minified JS Files
@@ -94,7 +96,9 @@ task :build => [:required] do
:pmui_ver => getVersion(Dir.pwd + "/vendor/colosa/pmUI"),
:pmui_hash => pmuiHash,
:mafe_ver => getVersion(Dir.pwd + "/vendor/colosa/MichelangeloFE"),
:mafe_hash => mafeHash
:mafe_hash => mafeHash,
:pmdynaform_ver => getVersion(Dir.pwd + "/vendor/colosa/pmDynaform"),
:pmdynaform_hash => pmdynaformHash
}
File.open(targetDir+"/versions", 'w+') do |writeFile|
writeFile.write versions.to_json
@@ -207,7 +211,11 @@ def getVersion(path)
version = `rake version`
end
return /([0-9\.]{5}+)/.match(version)
if version.lines.count > 1
version = /([0-9\.]{5}+)/.match(version)
end
return version.strip
end

View File

@@ -23,6 +23,7 @@ define('PATH_HOME', $pathhome);
define('PATH_TRUNK', $pathTrunk);
define('PATH_OUTTRUNK', $pathOutTrunk);
require_once PATH_TRUNK . "framework/src/Maveriks/Util/ClassLoader.php";
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.system.php';

View File

@@ -39,6 +39,7 @@ if (!defined('PATH_HOME')) {
define('PATH_OUTTRUNK', $pathOutTrunk);
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
require_once PATH_TRUNK . "framework/src/Maveriks/Util/ClassLoader.php";
G::LoadThirdParty('pear/json','class.json');
G::LoadThirdParty('smarty/libs','Smarty.class');

View File

@@ -1495,5 +1495,15 @@ class PMPluginRegistry
{
$this->_restServiceEnabled[$sNamespace] = $enable;
}
/**
* Return all cron files registered
*
* @return array
*/
public function getCronFiles()
{
return $this->_aCronFiles;
}
}

View File

@@ -735,8 +735,9 @@ class Main extends Controller
$versions = json_decode(file_get_contents(PATH_HTML . "lib/versions"), true);
$pmuiVer = $versions["pmui_ver"];
$mafeVer = $versions["mafe_ver"];
$pmdynaformVer = $versions["pmdynaform_ver"];
} else {
$pmuiVer = $mafeVer = "(unknown)";
$pmuiVer = $mafeVer = $pmdynaformVer = "(unknown)";
}
$sysSection = G::loadTranslation('ID_SYSTEM_INFO' );
@@ -751,6 +752,7 @@ class Main extends Controller
$properties[] = array ($systemName. ' Ver.', System::getVersion() . $ee, $pmSection);
$properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection);
$properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection);
$properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection);
if (file_exists(PATH_DATA. 'log/upgrades.log')) {
$properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), '<a href="#" onclick="showUpgradedLogs(); return false;">' . G::LoadTranslation( 'ID_UPGRADE_VIEW_LOG') . '</a>' ,$pmSection);

View File

@@ -205,6 +205,7 @@ CREATE TABLE `DYNAFORM`
`DYN_TYPE` VARCHAR(20) default 'xmlform' NOT NULL,
`DYN_FILENAME` VARCHAR(100) default '' NOT NULL,
`DYN_CONTENT` MEDIUMTEXT,
`DYN_VERSION` INTEGER,
PRIMARY KEY (`DYN_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Forms required';
#-----------------------------------------------------------------------------

View File

@@ -283,8 +283,10 @@ class CaseScheduler
if (!preg_match($patternDate, $caseSchedulerData['SCH_START_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_START_DATE"));
}
if (!preg_match($patternDate, $caseSchedulerData['SCH_END_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_END_DATE"));
if (!isset($caseSchedulerData['SCH_END_DATE'])) {
if (!preg_match($patternDate, $caseSchedulerData['SCH_END_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_END_DATE"));
}
}
if ($caseSchedulerData['SCH_START_DATE'] == "") {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('sch_start_date')));
@@ -568,8 +570,10 @@ class CaseScheduler
if (!preg_match($patternDate, $caseSchedulerData['SCH_START_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_START_DATE"));
}
if (!preg_match($patternDate, $caseSchedulerData['SCH_END_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_END_DATE"));
if (isset($caseSchedulerData['SCH_END_DATE'])) {
if (!preg_match($patternDate, $caseSchedulerData['SCH_END_DATE'])) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_SCH_END_DATE"));
}
}
if ($caseSchedulerData['SCH_START_DATE'] == "") {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('sch_start_date')));

View File

@@ -10,7 +10,7 @@ class DynaForm
"DYN_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "dynaFormDescription"),
"DYN_TYPE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("xmlform", "grid"), "fieldNameAux" => "dynaFormType"),
"DYN_CONTENT" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "dynaFormContent"),
"DYN_VERSION" => array("type" => "int", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "dynaFormVersion")
"DYN_VERSION" => array("type" => "int", "required" => false, "empty" => true, "defaultValues" => array(1 ,2), "fieldNameAux" => "dynaFormVersion")
);
private $formatFieldNameInUppercase = true;
@@ -365,10 +365,6 @@ class DynaForm
//Create
$dynaForm = new \Dynaform();
if (isset($arrayData["DYN_VERSION"])) {
$arrayData["DYN_VERSION"] = 1;
}
$arrayData["PRO_UID"] = $processUid;
$dynaFormUid = $dynaForm->create($arrayData);

View File

@@ -363,6 +363,7 @@ class OutputDocument
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "ObjectPermission.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php");
$this->throwExceptionIfItsAssignedInOtherObjects($sOutputDocumentUID, "outputDocumentUid");
\G::LoadClass( 'processMap' );
$oOutputDocument = new \OutputDocument();
$fields = $oOutputDocument->load( $sOutputDocumentUID );
@@ -443,5 +444,87 @@ class OutputDocument
throw $e;
}
}
/**
* Verify if the OutputDocument it's assigned in other objects
*
* @param string $outputDocumentUid Unique id of OutputDocument
*
* return array Return array (true if it's assigned or false otherwise and data)
*/
public function itsAssignedInOtherObjects($outputDocumentUid)
{
try {
$flagAssigned = false;
$arrayData = array();
//Step
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepPeer::STEP_UID);
$criteria->add(\StepPeer::STEP_TYPE_OBJ, "OUTPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_UID_OBJ, $outputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_STEPS");
}
//StepSupervisor
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$criteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, "OUTPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $outputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepSupervisorPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_CASES_MENU_ADMIN");
}
//ObjectPermission
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ObjectPermissionPeer::OP_UID);
$criteria->add(\ObjectPermissionPeer::OP_OBJ_TYPE, "OUTPUT", \Criteria::EQUAL);
$criteria->add(\ObjectPermissionPeer::OP_OBJ_UID, $outputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \ObjectPermissionPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$flagAssigned = true;
$arrayData[] = \G::LoadTranslation("ID_PROCESS_PERMISSIONS");
}
//Return
return array($flagAssigned, $arrayData);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Verify if the OutputDocument it's assigned in other objects
*
* @param string $outputDocumentUid Unique id of OutputDocument
* @param string $fieldNameForException Field name for the exception
*
* return void Throw exception if the OutputDocument it's assigned in other objects
*/
public function throwExceptionIfItsAssignedInOtherObjects($outputDocumentUid, $fieldNameForException)
{
try {
list($flagAssigned, $arrayData) = $this->itsAssignedInOtherObjects($outputDocumentUid);
if ($flagAssigned) {
throw new \Exception(\G::LoadTranslation("ID_OUTPUT_DOCUMENT_ITS_ASSIGNED", array($fieldNameForException, $outputDocumentUid, implode(", ", $arrayData))));
}
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -299,15 +299,23 @@ class Variable
try {
if (isset($aData["VAR_NAME"])) {
Validator::isString($aData['VAR_NAME'], '$var_name');
} else {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_name' )));
}
if (isset($aData["VAR_FIELD_TYPE"])) {
Validator::isString($aData['VAR_FIELD_TYPE'], '$var_field_type');
} else {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_field_type' )));
}
if (isset($aData["VAR_FIELD_SIZE"])) {
Validator::isInteger($aData["VAR_FIELD_SIZE"], '$var_field_size');
} else {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_field_size' )));
}
if (isset($aData["VAR_LABEL"])) {
Validator::isString($aData['VAR_LABEL'], '$var_label');
} else {
throw new \Exception(\G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_label' )));
}
if (isset($aData["VAR_DBCONNECTION"])) {
Validator::isString($aData['VAR_DBCONNECTION'], '$var_dbconnection');
@@ -316,7 +324,10 @@ class Variable
Validator::isString($aData['VAR_SQL'], '$var_sql');
}
if (isset($aData["VAR_NULL"])) {
Validator::isInteger($aData['VAR_NULL'], '$var_null');
Validator::isInteger($aData['VAR_NULL'], '$var_null');
if ($aData["VAR_NULL"] != 0 || $aData["VAR_NULL"] !=1 ) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_ONLY_ACCEPTS_VALUES", array('$var_null','0, 1' )));
}
}
if (isset($aData["VAR_DEFAULT"])) {
Validator::isString($aData['VAR_DEFAULT'], '$var_default');

View File

@@ -227,14 +227,6 @@ Ext.onReady(function(){
text: _('ID_NEW'),
iconCls: 'button_menu_ext ss_sprite ss_add',
menu: [
{
text: "New Project",
iconCls: 'silk-add',
icon: '',
handler: function () {
newProcess({type:"classicProject"});
}
},
{
text: "New BPMN Project",
iconCls: 'silk-add',
@@ -242,6 +234,14 @@ Ext.onReady(function(){
handler: function () {
newProcess({type:"bpmnProject"});
}
},
{
text: "New Project",
iconCls: 'silk-add',
icon: '',
handler: function () {
newProcess({type:"classicProject"});
}
}
],
listeners: {