Merged colosa/processmaker into master

This commit is contained in:
Richard Yujra
2014-12-16 16:33:56 -04:00
59 changed files with 7610 additions and 1170 deletions

View File

@@ -243,6 +243,7 @@ def buildMafe(homeDir, targetDir, mode)
"#{homeDir}/lib/jQueryLayout/jquery.layout.min.js" => "#{jsTargetDir}/jquery.layout.min.js",
"#{homeDir}/lib/modernizr/modernizr.js" => "#{jsTargetDir}/modernizr.js"
})
system "cp -rf #{homeDir}/src/formDesigner/img/* #{mafeDir}/../img"
puts "\nMichelangelo FE Build Finished\n".magenta
end

View File

@@ -8,9 +8,9 @@ default:
client_secret: 179ad45c6ce2cb97cf1029e212046e81
#uploadFilesFolder: /opt/uploadfiles
#cd5cff9b2e3ebabf49e276e47e977fab5988c00e
login_url: http://processmaker-ip-or-domaint/sys[workspace]/en/neoclassic/login/login
login_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/login/login
authentication_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/login/authentication.php
oauth_app_url: http://processmaker-ip-or-domaint/sys[workspace]/en/neoclassic/oauth2/clientSetupAjax
oauth_app_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/oauth2/clientSetupAjax
oauth_authorization_url: http://processmaker-ip-or-domain/[workspace]/oauth2/authorize
user_name: <your-admin-username>
user_password: <your-admin-password>

View File

@@ -17,9 +17,9 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
"""
Examples:
| Description | application_number | application_name | application_description | application_website | application_redirectUri |
| Create token normal | 1 | Demo3 | Demo3 desc | http://www.demowendy3.com | www.demowendy3.com/auth |
| Create token normal | 2 | Demo4 | Demo4 desc | http://www.demowendy4.com | http://www.processmaker.com |
| Description | application_number | application_name | application_description | application_website | application_redirectUri |
| Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant |
| Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant |
#Endpoint para verificar el correcto funcionamiento del token generado en este script

View File

@@ -110,7 +110,7 @@ Scenario: Create a new case scheduler with same name
And the response status message should have the following text "Duplicate"
Scenario Outline: Get the case schedulers list when there are exactly 16 case schedulers in each process
Scenario Outline: Get the case schedulers list when there are exactly 16 after 17 case schedulers in each process
Given I request "project/<project>/case-schedulers"
Then the response status code should be 200
And the response charset is "UTF-8"

View File

@@ -5,11 +5,12 @@ Feature: DataBase Connections Main Tests Mysql
and workspace with the project 87648819953a85c0abc01d3080475981 ("testExecutionOfDerivationScreen") already loaded
there are zero Database Connections in the processes.
# MySQL is tagged like 1
Background:
Given that I have a valid access_token
# GET /api/1.0/{workspace}/project/<project-id>/database-connections
# GET /api/1.0/{workspace}/project/<project-id>/database-connections
# Get list DataBase| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description | Connections
Scenario Outline: Get the DataBase Connections List when there are exactly zero DataBase Connections
Given I request "project/<project>/database-connections"
@@ -19,8 +20,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record |
| 106912358530c9b14ac15d3001790900 | 0 |
| 1265557095225ff5c688f46031700471 | 0 |
| 74737540052e1641ab88249082085472 | 0 |
| 87648819953a85c0abc01d3080475981 | 0 |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection/test
@@ -48,8 +49,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -79,8 +80,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -94,8 +95,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 | 1 |
| 1265557095225ff5c688f46031700471 | 1 | 2 |
| 74737540052e1641ab88249082085472 | 1 | 1 |
| 87648819953a85c0abc01d3080475981 | 1 | 2 |
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -124,8 +125,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -149,8 +150,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# DELETE /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -165,8 +166,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 |
| 1265557095225ff5c688f46031700471 | 2 |
| 74737540052e1641ab88249082085472 | 1 |
| 87648819953a85c0abc01d3080475981 | 2 |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -180,5 +181,5 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 0 | 1 |
| 1265557095225ff5c688f46031700471 | 0 | 2 |
| 74737540052e1641ab88249082085472 | 0 | 1 |
| 87648819953a85c0abc01d3080475981 | 0 | 2 |

View File

@@ -5,6 +5,7 @@ Feature: DataBase Connections Main Tests SQL Server
and workspace with the project 87648819953a85c0abc01d3080475981 ("testExecutionOfDerivationScreen") already loaded
there are zero Database Connections in the processes.
# Microsoft SQL Server is tagged like 2
Background:
Given that I have a valid access_token
@@ -19,8 +20,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record |
| 106912358530c9b14ac15d3001790900 | 0 |
| 1265557095225ff5c688f46031700471 | 0 |
| 74737540052e1641ab88249082085472 | 0 |
| 87648819953a85c0abc01d3080475981 | 0 |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection/test
@@ -48,8 +49,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -79,8 +80,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -94,8 +95,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 | 1 |
| 1265557095225ff5c688f46031700471 | 1 | 2 |
| 74737540052e1641ab88249082085472 | 1 | 1 |
| 87648819953a85c0abc01d3080475981 | 1 | 2 |
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -124,8 +125,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -149,8 +150,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# DELETE /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -165,8 +166,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 |
| 1265557095225ff5c688f46031700471 | 2 |
| 74737540052e1641ab88249082085472 | 1 |
| 87648819953a85c0abc01d3080475981 | 2 |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -180,5 +181,5 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 0 | 1 |
| 1265557095225ff5c688f46031700471 | 0 | 2 |
| 74737540052e1641ab88249082085472 | 0 | 1 |
| 87648819953a85c0abc01d3080475981 | 0 | 2 |

View File

@@ -47,9 +47,9 @@ Feature: DataBase Connections Negative Tests
"""
And I request "project/74737540052e1641ab88249082085472/database-connection"
Then the response status code should be 400
And the response status message should have the following text "port"
And the response status message should have the following text "Error"
Examples:
| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | 33O6 | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | 33o6 | <mys_db_encode> | <mys_db_description> |

View File

@@ -1725,7 +1725,7 @@ class RestContext extends BehatContext
/**
* @Given /^that "([^"]*)" property in object "([^"]*)" equals "([^"]*)"$/
*/
public function thatPropertyInObjectEquals($propertyName, $propertyParent, $value)
public function thatPropertyInObjectEquals($propertyName, $propertyParent, $propertyValue)
{
$data = $this->_data;
if (empty($data)) {
@@ -1893,13 +1893,12 @@ class RestContext extends BehatContext
*/
public function databaseConnectionWithIdIsActive($dbConnectionId)
{
if (file_exists("session.data")) {
if (file_exists("session.data")) {
$sessionData = json_decode(file_get_contents("session.data"));
} else {
$sessionData = new StdClass();
}
$sessionData = new StdClass();
if(!$sessionData->dbconnectionStatus->$dbConnectionId){
throw new PendingException("Skip inactive dbconnection: $dbConnectionId");
}

File diff suppressed because it is too large Load Diff

View File

@@ -738,53 +738,53 @@ class XmlForm_Field
$aValues = explode( '|', $oOwner->fields[$this->pmconnection]->keys );
$i = 0;
if($aData == "" || count($aData['FIELDS']) < 1){
$message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUND' );
$message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUND' );
G::SendMessageText( $message, "WARNING" );
$sValue = "";
} else {
foreach ($aData['FIELDS'] as $aField) {
if ($aField['FLD_KEY'] == '1') {
// note added by gustavo cruz gustavo[at]colosa[dot]com
// this additional [if] checks if a case variable has been set
// in the keys attribute, so it can be parsed and replaced for
// their respective value.
if (preg_match( "/@#/", $aValues[$i] )) {
// check if a case are running in order to prevent that preview is
// erroneous rendered.
if (isset( $_SESSION['APPLICATION'] )) {
G::LoadClass( 'case' );
$oApp = new Cases();
if ($oApp->loadCase( $_SESSION['APPLICATION'] ) != null) {
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$formVariable = substr( $aValues[$i], 2 );
if (isset( $aFields['APP_DATA'][$formVariable] )) {
$formVariableValue = $aFields['APP_DATA'][$formVariable];
$aKeys[$aField['FLD_NAME']] = (isset( $formVariableValue ) ? G::replaceDataField( $formVariableValue, $oOwner->values ) : '');
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = (isset( $aValues[$i] ) ? G::replaceDataField( $aValues[$i], $oOwner->values ) : '');
}
$i ++;
}
foreach ($aData['FIELDS'] as $aField) {
if ($aField['FLD_KEY'] == '1') {
// note added by gustavo cruz gustavo[at]colosa[dot]com
// this additional [if] checks if a case variable has been set
// in the keys attribute, so it can be parsed and replaced for
// their respective value.
if (preg_match( "/@#/", $aValues[$i] )) {
// check if a case are running in order to prevent that preview is
// erroneous rendered.
if (isset( $_SESSION['APPLICATION'] )) {
G::LoadClass( 'case' );
$oApp = new Cases();
if ($oApp->loadCase( $_SESSION['APPLICATION'] ) != null) {
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$formVariable = substr( $aValues[$i], 2 );
if (isset( $aFields['APP_DATA'][$formVariable] )) {
$formVariableValue = $aFields['APP_DATA'][$formVariable];
$aKeys[$aField['FLD_NAME']] = (isset( $formVariableValue ) ? G::replaceDataField( $formVariableValue, $oOwner->values ) : '');
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = '';
}
} else {
$aKeys[$aField['FLD_NAME']] = (isset( $aValues[$i] ) ? G::replaceDataField( $aValues[$i], $oOwner->values ) : '');
}
$i ++;
}
}
try {
$aData = $oAdditionalTables->getDataTable( $oOwner->fields[$this->pmconnection]->pmtable, $aKeys );
} catch (Exception $oError) {
$aData = array ();
}
if (isset( $aData[$this->pmfield] )) {
$sValue = $aData[$this->pmfield];
try {
$aData = $oAdditionalTables->getDataTable( $oOwner->fields[$this->pmconnection]->pmtable, $aKeys );
} catch (Exception $oError) {
$aData = array ();
}
if (isset( $aData[$this->pmfield] )) {
$sValue = $aData[$this->pmfield];
}
}
}
}
}
@@ -4493,17 +4493,50 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
{
$part1 = $sign * substr( $date, 0, strlen( $date ) - 1 );
$part2 = substr( $date, strlen( $date ) - 1 );
$year = (int)(date("Y"));
$month = (int)(date("m"));
$day = (int)(date("d"));
$osIsLinux = strtoupper(substr(PHP_OS, 0, 3)) != "WIN";
$checkYear = false;
switch ($part2) {
case 'd':
$res = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + $part1, date( 'Y' ) ) );
case "y":
$year = $year + $part1;
$res = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
$checkYear = true;
break;
case 'm':
$res = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ) + $part1, date( 'd' ), date( 'Y' ) ) );
case "m":
$month = $month + $part1;
$res = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
if ($month > 12) {
$year = $year + (int)($month / 12);
$checkYear = true;
}
break;
case 'y':
$res = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + $part1 ) );
case "d":
$res = date("Y-m-d", mktime(0, 0, 0, $month, $day + $part1, $year));
$dayAux = ($month * 31) - (31 - $day) + $part1;
if ($dayAux > 365) {
$year = $year + (int)($dayAux / 365);
$checkYear = true;
}
break;
}
if (!$osIsLinux && $checkYear && !preg_match("/^$year\-\d{2}\-\d{2}$/", $res)) {
$res = preg_replace("/^\d{4}(\-\d{2}\-\d{2})$/", "$year$1", $res);
}
return $res;
}

View File

@@ -149,7 +149,7 @@ abstract class FileSystem {
* by the given abstract pathname, or zero if it does not exist or some
* other I/O error occurs.
*/
function getBooleanAttributes($f) {
function getBooleanAttributes(&$f = null) {
throw new Exception("SYSTEM ERROR method getBooleanAttributes() not implemented by fs driver");
}

View File

@@ -191,7 +191,7 @@ class UnixFileSystem extends FileSystem {
/* -- most of the following is mapped to the php natives wrapped by FileSystem */
/* -- Attribute accessors -- */
function getBooleanAttributes(&$f) {
function getBooleanAttributes(&$f = null) {
//$rv = getBooleanAttributes0($f);
$name = $f->getName();
$hidden = (strlen($name) > 0) && ($name{0} == '.');

View File

@@ -311,6 +311,41 @@ function database_upgrade($command, $args) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
}
}
//There records in table "EMAIL_SERVER"
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(EmailServerPeer::MESS_UID);
$criteria->setOffset(0);
$criteria->setLimit(1);
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
//Insert the first record
$emailConfiguration = System::getEmailConfiguration();
if (count($emailConfiguration) > 0) {
$arrayData = array();
$arrayData["MESS_ENGINE"] = $emailConfiguration["MESS_ENGINE"];
$arrayData["MESS_SERVER"] = $emailConfiguration["MESS_SERVER"];
$arrayData["MESS_PORT"] = (int)($emailConfiguration["MESS_PORT"]);
$arrayData["MESS_RAUTH"] = (int)($emailConfiguration["MESS_RAUTH"]);
$arrayData["MESS_ACCOUNT"] = $emailConfiguration["MESS_ACCOUNT"];
$arrayData["MESS_PASSWORD"] = $emailConfiguration["MESS_PASSWORD"];
$arrayData["MESS_FROM_MAIL"] = $emailConfiguration["MESS_FROM_MAIL"];
$arrayData["MESS_FROM_NAME"] = $emailConfiguration["MESS_FROM_NAME"];
$arrayData["SMTPSECURE"] = $emailConfiguration["SMTPSecure"];
$arrayData["MESS_TRY_SEND_INMEDIATLY"] = (int)($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"]);
$arrayData["MAIL_TO"] = $emailConfiguration["MAIL_TO"];
$arrayData["MESS_DEFAULT"] = (isset($emailConfiguration["MESS_ENABLED"]) && $emailConfiguration["MESS_ENABLED"] . "" == "1")? 1 : 0;
$emailSever = new ProcessMaker\BusinessModel\EmailServer();
$emailSever->create($arrayData);
}
}
}
function delete_app_from_table($con, $tableName, $appUid, $col="APP_UID") {

View File

@@ -986,11 +986,13 @@ class Cases
unset($Fields['APP_DESCRIPTION']);
}
if (isset($Fields["APP_STATUS"]) && $Fields["APP_STATUS"] == "COMPLETED") {
$Fields['USR_UID'] = $Fields['CURRENT_USER_UID'];
$listCompleted = new ListCompleted();
$listCompleted->create($Fields);
$listMyInbox = new ListMyInbox();
$listMyInbox->refresh($Fields);
if (isset($Fields['CURRENT_USER_UID'])) {
$Fields['USR_UID'] = $Fields['CURRENT_USER_UID'];
$listCompleted = new ListCompleted();
$listCompleted->create($Fields);
$listMyInbox = new ListMyInbox();
$listMyInbox->refresh($Fields);
}
}
$oApp->update($Fields);

View File

@@ -154,8 +154,9 @@ class dbConnections
$result = DbSourcePeer::doSelectRS( $c );
$result->next();
$row = $result->getRow();
while ($row = $result->getRow()) {
if (trim( $pProUid ) == trim( $row[1] )) {
if ((trim( $pProUid ) == trim( $row[1] )) && ($row[2] == 'mysql')) {
$connections[] = Array ('DBS_UID' => $row[0],'DBS_NAME' => '[' . $row[3] . '] ' . $row[2] . ': ' . $row[4]
);
}

File diff suppressed because it is too large Load Diff

View File

@@ -68,7 +68,8 @@ class PMLicensedFeatures
if (!class_exists("pmLicenseManager")) {
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
}
$licenseManager = pmLicenseManager::getSingleton();
$licenseManager = pmLicenseManager::getSingleton(false);
$_SESSION['__sw__'] = true;
$padl = new padl();

View File

@@ -821,17 +821,17 @@ function getEmailConfiguration ()
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFSendMessage.28.29
*
* @param string(32) | $caseId | UID for case | The UID (unique identification) for a case, which is a string of 32 hexadecimal characters to identify the case.
* @param string(32) | $sFrom | Email address | The email address of the person who sends out the email.
* @param string(100) | $sTo | Email receptor | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma.
* @param string(100) | $sCc = '' | Email address for copies | The email address(es) of people who will receive carbon copies of the email.
* @param string(100) | $sBcc = ''| Email address for copies hidden | The email address(es) of people who will receive blind carbon copies of the email.
* @param string(32) | $sFrom | Sender | The email address of the person who sends out the email.
* @param string(100) | $sTo | Recipient | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma.
* @param string(100) | $sCc = '' | Carbon copy recipient | The email address(es) of people who will receive carbon copies of the email.
* @param string(100) | $sBcc = ''| Carbon copy recipient | The email address(es) of people who will receive blind carbon copies of the email.
* @param string(50) | $sSubject | Subject of the email | The subject (title) of the email.
* @param string(50) | $sTemplate | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email.
* @param array | $aFields = array() | An optional associative array | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values.
* @param array | $aFields = array() | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values.
* @param array | $aAttachment = array() | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email.
* @param boolean | $showMessage = true | Show message | Optional parameter.
* @param boolean | $showMessage = true | Show message | Optional parameter. Set to TRUE to show the message in the case's message history.
* @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case.
* @param array | $config = array() | Alternative Email Settings | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure).
* @param array | $config = array() | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure).
* @return int | | result | Result of sending email
*
*/

View File

@@ -10,7 +10,7 @@ class pmLicenseManager
private static $instance = null;
public function __construct()
public function __construct($flagActivatePlugins = true)
{
G::LoadClass('serverConfiguration');
$oServerConf = &serverConf::getSingleton();
@@ -109,13 +109,15 @@ class pmLicenseManager
$oServerConf->setProperty ( 'LICENSE_INFO', $licInfoA );
}
$this->activateFeatures ();
if ($flagActivatePlugins) {
$this->activateFeatures();
}
}
public static function getSingleton()
public static function getSingleton($flagActivatePlugins = true)
{
if (self::$instance == null) {
self::$instance = new pmLicenseManager();
self::$instance = new pmLicenseManager($flagActivatePlugins);
}
return self::$instance;
}

View File

@@ -40,6 +40,7 @@ class PmTable
private $schemaFile = '';
private $tableName;
private $columns;
private $primaryKey= array();
private $baseDir = '';
private $targetDir = '';
private $configDir = '';
@@ -182,7 +183,7 @@ class PmTable
* Build the pmTable with all dependencies
*/
public function build ()
{
{
$this->prepare();
$this->preparePropelIniFile();
$this->buildSchema();
@@ -400,7 +401,7 @@ class PmTable
* Save the xml schema for propel
*/
public function saveSchema ()
{
{
$this->dom->save( $this->configDir . $this->schemaFilename );
}
@@ -671,8 +672,29 @@ class PmTable
$sql = "SELECT * FROM $tableBackup";
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
// array the primary keys
foreach($this->columns as $value) {
if ($value->field_key == 1) {
$this->primaryKey[] = $value->field_name;
}
}
$flagPrimaryKey = 1;
while ($rs->next()) {
$row = $rs->getRow();
if ($flagPrimaryKey) {
// verify row has all primary keys
$keys = 0;
foreach ($row as $colName => $value) {
if (in_array($colName,$this->primaryKey)){
$keys++;
}
}
if ($keys != count($this->primaryKey)) {
return $stmt->executeQuery(str_replace($table, $tableBackup, $queryStack["drop"]));
}
$flagPrimaryKey = 0;
}
$oTable = new $tableFileName();
$oTable->fromArray($row, BasePeer::TYPE_FIELDNAME);

View File

@@ -968,11 +968,41 @@ class System
public function getEmailConfiguration ()
{
G::LoadClass( 'configuration' );
$conf = new Configurations();
$config = $conf->load( 'Emails' );
$emailServer = new ProcessMaker\BusinessModel\EmailServer();
return $config;
$arrayEmailServerDefault = $emailServer->getEmailServerDefault();
if (count($arrayEmailServerDefault) > 0) {
$arrayDataEmailServerConfig = array(
"MESS_ENGINE" => $arrayEmailServerDefault["MESS_ENGINE"],
"MESS_SERVER" => $arrayEmailServerDefault["MESS_SERVER"],
"MESS_PORT" => (int)($arrayEmailServerDefault["MESS_PORT"]),
"MESS_RAUTH" => (int)($arrayEmailServerDefault["MESS_RAUTH"]),
"MESS_ACCOUNT" => $arrayEmailServerDefault["MESS_ACCOUNT"],
"MESS_PASSWORD" => $arrayEmailServerDefault["MESS_PASSWORD"],
"MESS_FROM_MAIL" => $arrayEmailServerDefault["MESS_FROM_MAIL"],
"MESS_FROM_NAME" => $arrayEmailServerDefault["MESS_FROM_NAME"],
"SMTPSecure" => $arrayEmailServerDefault["SMTPSECURE"],
"MESS_TRY_SEND_INMEDIATLY" => (int)($arrayEmailServerDefault["MESS_TRY_SEND_INMEDIATLY"]),
"MAIL_TO" => $arrayEmailServerDefault["MAIL_TO"],
"MESS_DEFAULT" => (int)($arrayEmailServerDefault["MESS_DEFAULT"]),
"MESS_ENABLED" => 1,
"MESS_BACKGROUND" => "",
"MESS_PASSWORD_HIDDEN" => "",
"MESS_EXECUTE_EVERY" => "",
"MESS_SEND_MAX" => ""
);
//Return
return $arrayDataEmailServerConfig;
} else {
G::LoadClass("configuration");
$conf = new Configurations();
$config = $conf->load("Emails");
return $config;
}
}
public function getSkingList ()

View File

@@ -517,13 +517,14 @@ class Dynaform extends BaseDynaform
return $G_FORM->fields;
}
public function verifyExistingName ($sName, $sProUid)
public function verifyExistingName ($sName, $sProUid, $sDynUid)
{
$sNameDyanform = urldecode( $sName );
$sProUid = urldecode( $sProUid );
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( DynaformPeer::DYN_UID );
$oCriteria->add( DynaformPeer::PRO_UID, $sProUid );
$oCriteria->add( DynaformPeer::DYN_UID, $sDynUid );
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$flag = true;
@@ -532,14 +533,16 @@ class Dynaform extends BaseDynaform
$oCriteria1 = new Criteria( 'workflow' );
$oCriteria1->addSelectColumn( 'COUNT(*) AS DYNAFORMS' );
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'DYN_TITLE' );
$oCriteria1->add( ContentPeer::CON_ID, $aRow['DYN_UID'] );
$oCriteria1->add( ContentPeer::CON_ID, $sDynUid, Criteria::NOT_EQUAL);
$oCriteria1->add( ContentPeer::CON_VALUE, $sNameDyanform );
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG );
$oCriteria1->add( DynaformPeer::PRO_UID, $sProUid);
$oCriteria1->addJoin( ContentPeer::CON_ID, DynaformPeer::DYN_UID, Criteria::INNER_JOIN );
$oDataset1 = ContentPeer::doSelectRS( $oCriteria1 );
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset1->next();
$aRow1 = $oDataset1->getRow();
if ($aRow1['DYNAFORMS']) {
if ($aRow1['DYNAFORMS'] == 1) {
$flag = false;
break;
}

View File

@@ -0,0 +1,5 @@
<?php
class EmailServer extends BaseEmailServer
{
}

View File

@@ -0,0 +1,5 @@
<?php
class EmailServerPeer extends BaseEmailServerPeer
{
}

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseMessage.php';
/**
* Skeleton subclass for representing a row from the 'MESSAGE' 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 classes.model
*/
class Message extends BaseMessage {
} // Message

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseMessageDetail.php';
/**
* Skeleton subclass for representing a row from the 'MESSAGE_DETAIL' 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 classes.model
*/
class MessageDetail extends BaseMessageDetail {
} // MessageDetail

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseMessageDetailPeer.php';
// include object class
include_once 'classes/model/MessageDetail.php';
/**
* Skeleton subclass for performing query and update operations on the 'MESSAGE_DETAIL' 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 classes.model
*/
class MessageDetailPeer extends BaseMessageDetailPeer {
} // MessageDetailPeer

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseMessagePeer.php';
// include object class
include_once 'classes/model/Message.php';
/**
* Skeleton subclass for performing query and update operations on the 'MESSAGE' 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 classes.model
*/
class MessagePeer extends BaseMessagePeer {
} // MessagePeer

View File

@@ -0,0 +1,96 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'EMAIL_SERVER' 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 workflow.classes.model.map
*/
class EmailServerMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.EmailServerMapBuilder';
/**
* 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('EMAIL_SERVER');
$tMap->setPhpName('EmailServer');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('MESS_UID', 'MessUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MESS_ENGINE', 'MessEngine', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_SERVER', 'MessServer', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_PORT', 'MessPort', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('MESS_RAUTH', 'MessRauth', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('MESS_ACCOUNT', 'MessAccount', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_PASSWORD', 'MessPassword', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_FROM_MAIL', 'MessFromMail', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_FROM_NAME', 'MessFromName', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('SMTPSECURE', 'Smtpsecure', 'string', CreoleTypes::VARCHAR, true, 3);
$tMap->addColumn('MESS_TRY_SEND_INMEDIATLY', 'MessTrySendInmediatly', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('MAIL_TO', 'MailTo', 'string', CreoleTypes::VARCHAR, true, 256);
$tMap->addColumn('MESS_DEFAULT', 'MessDefault', 'int', CreoleTypes::INTEGER, true, null);
} // doBuild()
} // EmailServerMapBuilder

View File

@@ -0,0 +1,78 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'MESSAGE_DETAIL' 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 workflow.classes.model.map
*/
class MessageDetailMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.MessageDetailMapBuilder';
/**
* 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('MESSAGE_DETAIL');
$tMap->setPhpName('MessageDetail');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('MD_UID', 'MdUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MES_UID', 'MesUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MD_TYPE', 'MdType', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('MD_NAME', 'MdName', 'string', CreoleTypes::VARCHAR, false, 255);
} // doBuild()
} // MessageDetailMapBuilder

Some files were not shown because too many files have changed in this diff Show More