Merge branch 'develop' of https://bitbucket.org/colosa/processmaker into feature/PMCORE-1444

This commit is contained in:
Henry Jordan
2020-06-15 17:41:52 +00:00
99 changed files with 5762 additions and 1462 deletions

View File

@@ -1,27 +1,4 @@
<?php
/**
* databases.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.
*
*/
if (defined('PATH_DB') && !empty(config("system.workspace"))) {
@@ -29,7 +6,32 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
throw new Exception("Could not find db.php in current workspace " . config("system.workspace"));
}
require_once(PATH_DB . config("system.workspace") . '/db.php');
//These constants must not exist, they will be created by "db.php".
$constants = [
'DB_ADAPTER',
'DB_HOST',
'DB_NAME',
'DB_USER',
'DB_PASS',
'DB_RBAC_HOST',
'DB_RBAC_NAME',
'DB_RBAC_USER',
'DB_RBAC_PASS' ,
'DB_REPORT_HOST',
'DB_REPORT_NAME',
'DB_REPORT_USER',
'DB_REPORT_PASS',
];
$load = true;
foreach ($constants as $value) {
if (defined($value)) {
$load = false;
break;
}
}
if ($load === true) {
require_once(PATH_DB . config("system.workspace") . '/db.php');
}
//to do: enable for other databases
$dbType = DB_ADAPTER;
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . urlencode(DB_PASS) . '@' . DB_HOST . '/' . DB_NAME;
@@ -42,15 +44,12 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
switch (DB_ADAPTER) {
case 'mysql':
$dsn .= '?encoding=utf8';
$dsnRbac .= '?encoding=utf8';
$dsn .= '?encoding=utf8';
$dsnRbac .= '?encoding=utf8';
$dsnReport .= '?encoding=utf8';
break;
case 'mssql':
case 'sqlsrv':
//$dsn .= '?sendStringAsUnicode=false';
//$dsnRbac .= '?sendStringAsUnicode=false';
//$dsnReport .= '?sendStringAsUnicode=false';
break;
default:
break;
@@ -64,7 +63,7 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
$pro ['datasources']['rp']['connection'] = $dsnReport;
$pro ['datasources']['rp']['adapter'] = DB_ADAPTER;
$dbHost = explode(':', DB_HOST);
config(['database.connections.workflow.host' => $dbHost[0]]);
config(['database.connections.workflow.database' => DB_NAME]);
@@ -76,6 +75,6 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
}
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
$pro ['datasources']['dbarray']['adapter'] = 'dbarray';
$pro ['datasources']['dbarray']['adapter'] = 'dbarray';
return $pro;

View File

@@ -230,6 +230,7 @@
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
<column name="DOC_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="DOC_ID" type="INTEGER" required="false" default="0"/>
<column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="APP_DOC_TYPE" type="VARCHAR" size="32" required="true" default=""/>
<column name="APP_DOC_CREATE_DATE" type="TIMESTAMP" required="true"/>
@@ -284,7 +285,7 @@
<rule name="required" message="User UID is required."/>
</validator>
<validator column="APP_DOC_TYPE">
<rule name="validValues" value="INPUT|OUTPUT|ATTACHED" message="Please select a valid document type."/>
<rule name="validValues" value="INPUT|OUTPUT|ATTACHED|CASE_NOTE" message="Please select a valid document type."/>
<rule name="required" message="Application Document Type is required."/>
</validator>
<validator column="APP_DOC_CREATE_DATE">
@@ -3287,7 +3288,7 @@
<unique-column name="CATEGORY_ID"/>
</unique>
</table>
<table name="APP_NOTES">
<table name="APP_NOTES" idMethod="native">
<vendor type="mysql">
<parameter name="Name" value="APP_NOTES"/>
<parameter name="Engine" value="InnoDB"/>
@@ -3308,6 +3309,7 @@
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Application Notes"/>
</vendor>
<column name="NOTE_ID" type="INTEGER" required="true" autoIncrement="true" unique="true"/>
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/>
<column name="NOTE_DATE" type="TIMESTAMP" required="true"/>
@@ -3318,6 +3320,9 @@
<column name="NOTE_AFFECTED_OBJ1" type="VARCHAR" size="32" default=""/>
<column name="NOTE_AFFECTED_OBJ2" type="VARCHAR" size="32" required="true" default=""/>
<column name="NOTE_RECIPIENTS" type="LONGVARCHAR"/>
<unique name="NOTE_ID">
<unique-column name="NOTE_ID"/>
</unique>
<index name="indexAppNotesDate">
<index-column name="APP_UID"/>
<index-column name="NOTE_DATE"/>