Merged colosa/processmaker into master

This commit is contained in:
Marco Antonio Nina Mena
2014-08-28 13:50:31 -04:00
9 changed files with 180 additions and 47 deletions

View File

@@ -42,20 +42,20 @@ Feature: Input Documents Main Tests
Examples:
| test_description | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags |
| Create with virtual with versioning | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with virtual without versioning | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT |
| Create with real with versioning | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 | My InputDocument3 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with vreal with versioning | 14414793652a5d718b65590036026581 | 4 | My InputDocument4 | My InputDocument4 DESCRIPTION | VREAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with virtual, copy and versioning | 14414793652a5d718b65590036026581 | 5 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COPY | PRIVATE | 1 | | INPUT |
| Create with virtual, original and without versioning | 14414793652a5d718b65590036026581 | 6 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT |
| Create with virtual, versioning and destination path | 14414793652a5d718b65590036026581 | 7 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my/path | INPUT |
| Create with virtual, without versioning and destination path | 14414793652a5d718b65590036026581 | 8 | My InputDocument8 | My InputDocument8 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT |
| Create with real, without versioning and destination path | 14414793652a5d718b65590036026581 | 9 | My InputDocument9 | My InputDocument9 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT |
| Create with special characters in inp doc title | 14414793652a5d718b65590036026581 | 10 | My InputDocument10 !@#$%^&*€¤½¼‘¾¡²¤³| My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with special characters in inp doc description | 14414793652a5d718b65590036026581 | 11 | My InputDocument11 | My InputDocument11 !@#$%^&*€¤½¼‘¾¡²¤³| REAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with special characters in inp doc destination path | 14414793652a5d718b65590036026581 | 12 | My InputDocument12 | My InputDocument12 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my#@$#%/path324@$@@ | INPUT |
| Create with special characters in inp doc tags | 14414793652a5d718b65590036026581 | 13 | My InputDocument13 | My InputDocument13 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPU455 @##$$³¤¤ |
| test_description | project | inp_doc_number | inp_doc_title | inp_doc_description | inp_doc_form_needed | inp_doc_original | inp_doc_published | inp_doc_versioning | inp_doc_destination_path | inp_doc_tags |
| Create with virtual with versioning | 14414793652a5d718b65590036026581 | 1 | My InputDocument1 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with virtual without versioning | 14414793652a5d718b65590036026581 | 2 | My InputDocument2 | My InputDocument2 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT |
| Create with real with versioning | 14414793652a5d718b65590036026581 | 3 | My InputDocument3 | My InputDocument3 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with vreal with versioning | 14414793652a5d718b65590036026581 | 4 | My InputDocument4 | My InputDocument4 DESCRIPTION | VREAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with virtual, copy and versioning | 14414793652a5d718b65590036026581 | 5 | My InputDocument5 | My InputDocument5 DESCRIPTION | VIRTUAL | COPY | PRIVATE | 1 | | INPUT |
| Create with virtual, original and without versioning | 14414793652a5d718b65590036026581 | 6 | My InputDocument6 | My InputDocument6 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | | INPUT |
| Create with virtual, versioning and destination path | 14414793652a5d718b65590036026581 | 7 | My InputDocument7 | My InputDocument7 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my/path | INPUT |
| Create with virtual, without versioning and destination path | 14414793652a5d718b65590036026581 | 8 | My InputDocument8 | My InputDocument8 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT |
| Create with real, without versioning and destination path | 14414793652a5d718b65590036026581 | 9 | My InputDocument9 | My InputDocument9 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 0 | /my/path | INPUT |
| Create with special characters in inp doc title | 14414793652a5d718b65590036026581 | 10 | My InputDocument10 !@#$%^&*€¤½¼‘¾¡²¤³| My InputDocument10 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with special characters in inp doc description | 14414793652a5d718b65590036026581 | 11 | My InputDocument11 | My InputDocument11 !@#$%^&*€¤½¼‘¾¡²¤³| REAL | ORIGINAL | PRIVATE | 1 | | INPUT |
| Create with special characters in inp doc destination path | 14414793652a5d718b65590036026581 | 12 | My InputDocument12 | My InputDocument12 DESCRIPTION | VIRTUAL | ORIGINAL | PRIVATE | 1 | /my#@$#%/path324@$@@ | INPUT |
| Create with special characters in inp doc tags | 14414793652a5d718b65590036026581 | 13 | My InputDocument13 | My InputDocument13 DESCRIPTION | REAL | ORIGINAL | PRIVATE | 1 | | INPU455 @##$$³¤¤ |
Scenario: Create new Input Documents with same name

View File

@@ -166,4 +166,17 @@ Scenario Outline: Delete a Project activity created previously in this script
Examples:
| pro_uid_number |
| 1 |
| 1 |
#Negative test, to import an invalid project
Scenario: Generate BPMN with wrong project
Given POST this data:
"""
{
"pro_uid": "22872259050000000000db7020830606"
}
"""
And I request "project/generate-bpmn"
Then the response status code should be 400
And the response status message should have the following text "exist"

View File

@@ -31,7 +31,7 @@ include_once 'adapter/DBAdapter.php';
*
* @author Hans Lellelid <hans@xmpl.rg> (Propel)
* @author Daniel Rall <dlr@finemaltcoding.com> (Torque)
* @author Magn<67>s <20><>r Torfason <magnus@handtolvur.is> (Torque)
* @author Magn<67>s <20><>r Torfason <magnus@handtolvur.is> (Torque)
* @author Jason van Zyl <jvanzyl@apache.org> (Torque)
* @author Rafal Krzewski <Rafal.Krzewski@e-point.pl> (Torque)
* @author Martin Poeschl <mpoeschl@marmot.at> (Torque)
@@ -603,4 +603,27 @@ class Propel {
}
}
/**
* @param $name string The connection name
* @return Connection A database connection
* @throws PropelException
*/
public static function getDbConnection($name)
{
if (! empty(self::$configuration['datasources'][$name]['connection'])) {
return self::getConnection($name);
}
// the connection names always should be have a underscore like: workflow_ro, rbac_rw
// on fallback, we will try found a connection named: "workflow" if "workflow_ro" does not exist.
// the name without the "_ro" part.
$defaultDbName = substr($name, 0, strrpos($name, '_'));
if (! empty(self::$configuration['datasources'][$defaultDbName]['connection'])) {
return self::getConnection($defaultDbName);
}
throw new PropelException('Error, database connection named "'.$name.'" is not defined for Propel.');
}
}

View File

@@ -350,6 +350,7 @@ class Ajax
print G::json_encode( $response );
die();
}
G::LoadClass('tasks');
$task = new Task();
if ($_SESSION['TASK'] == '-1') {
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];

View File

@@ -50,7 +50,11 @@ try {
$respView = $case->getAllObjectsFrom( $applicationFields['PRO_UID'], $_REQUEST['APP_UID'], $applicationFields['TAS_UID'], $_SESSION['USER_LOGGED'], 'VIEW' );
if ($respView['SUMMARY_FORM'] == 0) {
throw new Exception( G::LoadTranslation( 'ID_SUMMARY_FORM_NO_PERMISSIONS' ) );
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_SUMMARY_FORM_NO_PERMISSIONS' )) );
G::RenderPage( 'publish', 'blank' );
die();
}
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
@@ -81,3 +85,13 @@ try {
die();
}
?>
<script type="text/javascript">
leimnud.event.add(window,"load",function(){
if (parent.document.getElementById('buttonOpenDynaform') != null) {
parent.document.getElementById('buttonOpenDynaform').setAttribute('class', 'x-btn x-btn-noicon')
parent.document.getElementById('buttonOpenDynaform').style = "width: auto;";
}
});
</script>
<?php

View File

@@ -1638,10 +1638,10 @@ class Process
if ($bSystemVars) {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'), 'sUid' => '');
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
}
//we're adding the ping variable to the system list
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'), 'sUid' => '');
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
}
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript");

View File

@@ -126,9 +126,7 @@ class Variable
//Update
$cnn = \Propel::getConnection("workflow");
try {
$variable = \ProcessVariablesPeer::retrieveByPK($variableUid);
$variable->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
if ($variable->validate()) {
$cnn->begin();
@@ -351,10 +349,10 @@ class Variable
if (isset($aData["VAR_FIELD_TYPE"])) {
Validator::isString($aData['VAR_FIELD_TYPE'], '$var_field_type');
Validator::isNotEmpty($aData['VAR_FIELD_TYPE'], '$var_field_type');
if ($aData["VAR_FIELD_TYPE"] != 'string' && $aData["VAR_FIELD_TYPE"] != 'integer' && $aData["VAR_FIELD_TYPE"] != 'boolean' && $aData["VAR_FIELD_TYPE"] != 'float' &&
/*if ($aData["VAR_FIELD_TYPE"] != 'string' && $aData["VAR_FIELD_TYPE"] != 'integer' && $aData["VAR_FIELD_TYPE"] != 'boolean' && $aData["VAR_FIELD_TYPE"] != 'float' &&
$aData["VAR_FIELD_TYPE"] != 'datetime' && $aData["VAR_FIELD_TYPE"] != 'date_of_birth' && $aData["VAR_FIELD_TYPE"] != 'date') {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('$var_field_type')));
}
}*/
}
if (isset($aData["VAR_FIELD_SIZE"])) {
Validator::isInteger($aData["VAR_FIELD_SIZE"], '$var_field_size');
@@ -564,20 +562,21 @@ class Variable
$contentDecode = json_decode($row["DYN_CONTENT"], true);
$content = $contentDecode['items'][0]['items'];
if (is_array($content)) {
foreach ($content as $key => $value) {
if (isset($value[0]["variable"])) {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $value[0]["variable"], \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
foreach ($content as $key => $value) {
if (isset($value[0]["variable"])) {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $value[0]["variable"], \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
if ($rsCriteria->getRow()) {
throw new \Exception(\G::LoadTranslation("ID_VARIABLE_IN_USE", array($variableUid, $row["DYN_UID"])));
if ($rsCriteria->getRow()) {
throw new \Exception(\G::LoadTranslation("ID_VARIABLE_IN_USE", array($variableUid, $row["DYN_UID"])));
}
}
}
}

View File

@@ -497,15 +497,97 @@ var openSummaryWindow = function(appUid, delIndex, action)
});
var tabs = new Array();
var isMovil = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
other: function() {
return navigator.userAgent.match(/Mobile/i);
},
any: function() {
return isMovil.Android() || isMovil.BlackBerry() || isMovil.iOS() || isMovil.Opera() || isMovil.Windows() || isMovil.other();
}
};
tabs.push(sumaryInfPanel);
if (response.dynUid != '') {
tabs.push({title: Ext.util.Format.capitalize(_('ID_MORE_INFORMATION')), bodyCfg: {
tag: 'iframe',
id: 'summaryIFrame',
src: '../cases/summary?APP_UID=' + appUid + '&DEL_INDEX=' + delIndex + '&DYN_UID=' + response.dynUid,
style: {border: '0px none', height: '300px'},
onload: ''
}});
if (isMovil.any()) {
var src = '../cases/summary?APP_UID=' + appUid + '&DEL_INDEX=' + delIndex + '&DYN_UID=' + response.dynUid;
var windowOpen = function() {
window.open(src,'_blank');
};
var openDynaform = new Ext.Action({
text: _('ID_OPEN_DYNAFORM_TAB'),
id: 'buttonOpenDynaform',
handler: windowOpen
});
var fieldsAS = new Ext.form.FieldSet({
bodyStyle:'align:center',
items: [
{
xtype:'button',
id: 'buttonOpenDynaform',
name: 'buttonOpenDynaform',
hidden: true,
text: _('ID_OPEN_DYNAFORM_TAB'),
handler:function() {
window.open(src,'_blank');
}
},
{
html:'<iframe src="'+ src +'" width="100%" height="350" frameBorder="0"></iframe>'
}
]
});
var panel = new Ext.FormPanel({
labelAlign:'center',
autoScroll: true,
fileUpload: true,
width:'100%',
height: '50px',
bodyStyle:'padding:10px',
waitMsgTarget : true,
frame: true,
defaults: {
anchor: '100%',
allowBlank: false,
resizable: true,
msgTarget: 'side',
align:'center'
},
items:[
fieldsAS
]
});
tabs.push({
title: Ext.util.Format.capitalize(_('ID_MORE_INFORMATION')),
layout: 'fit',
items: [panel]
});
} else {
tabs.push({title: Ext.util.Format.capitalize(_('ID_MORE_INFORMATION')), bodyCfg: {
tag: 'iframe',
id: 'summaryIFrame',
src: '../cases/summary?APP_UID=' + appUid + '&DEL_INDEX=' + delIndex + '&DYN_UID=' + response.dynUid,
style: {border: '0px none', height: '300px', overflow: 'auto'},
onload: ''
}});
}
}
tabs.push({title: Ext.util.Format.capitalize(_('ID_UPLOADED_DOCUMENTS')), bodyCfg: {
tag: 'iframe',

View File

@@ -84,7 +84,7 @@ Ext.onReady(function(){
contextMenu = new Ext.menu.Menu({
items : [ editButton, deleteButton ]
});
searchText = new Ext.form.TextField ({
id: 'searchTxt',
ctCls:'pm_search_text_field',
@@ -398,7 +398,7 @@ Ext.onReady(function(){
];
}
else
tbar = [genDataReportButton,
tbar = [genDataReportButton,
'->',
appUidSearch,
searchText,
@@ -473,7 +473,8 @@ onMessageContextMenu = function (grid, rowIndex, e) {
//Do Search Function
DoSearch = function(){
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load({params: {start : 0 , limit : pageSize , appUid : appUidSearch.getValue() }});
infoGrid.store.setBaseParam('appUid', appUidSearch.getValue() );
infoGrid.store.load()
};
//Load Grid By Default
@@ -482,7 +483,7 @@ GridByDefault = function(){
appUidSearch.reset();
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load();
};
};
//Capitalize String Function
capitalize = function(s){