PMC-1199
This commit is contained in:
@@ -26,7 +26,7 @@ class Archive
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public function archive($name)
|
||||
public function __construct($name)
|
||||
{
|
||||
$this->options = array('basedir' => ".", 'name' => $name, 'prepend' => "", 'inmemory' => 0, 'overwrite' => 0, 'recurse' => 1, 'storepaths' => 1, 'followlinks' => 0, 'level' => 3, 'method' => 1, 'sfx' => "", 'type' => "", 'comment' => ""
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ class BzipFile extends TarFile
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function BzipFile($name)
|
||||
public function __construct($name)
|
||||
{
|
||||
$this->tar_file($name);
|
||||
$this->options['type'] = "bzip";
|
||||
|
||||
@@ -30,7 +30,7 @@ class DynaformEditorAjax extends DynaformEditor implements IDynaformEditorAjax
|
||||
*/
|
||||
public function _run($post)
|
||||
{
|
||||
WebResource::WebResource($_SERVER['REQUEST_URI'], $post);
|
||||
WebResource::__construct($_SERVER['REQUEST_URI'], $post);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -694,7 +694,7 @@ class LdapAdvanced
|
||||
$ldapcnn = $this->ldapcnn;
|
||||
|
||||
//Get Users
|
||||
$limit = $this->__getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$limit = $this->getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$flagError = false;
|
||||
|
||||
if (!isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["AUTH_SOURCE_USERS_FILTER"])) {
|
||||
@@ -801,7 +801,7 @@ class LdapAdvanced
|
||||
*
|
||||
* @return array Return array data
|
||||
*/
|
||||
private function __ldapGroupSynchronizeMembers($ldapcnn, array $arrayAuthSourceData, $groupUid, array $arrayGroupLdap, $memberAttribute, array $arrayData = [])
|
||||
private function ldapGroupSynchronizeMembers($ldapcnn, array $arrayAuthSourceData, $groupUid, array $arrayGroupLdap, $memberAttribute, array $arrayData = [])
|
||||
{
|
||||
try {
|
||||
unset($arrayData['countMembers']);
|
||||
@@ -946,7 +946,7 @@ class LdapAdvanced
|
||||
}
|
||||
}
|
||||
|
||||
$arrayData = $this->__ldapGroupSynchronizeMembers(
|
||||
$arrayData = $this->ldapGroupSynchronizeMembers(
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$arrayGroupData['GRP_UID'],
|
||||
@@ -984,7 +984,7 @@ class LdapAdvanced
|
||||
}
|
||||
}
|
||||
|
||||
$arrayData = $this->__ldapGroupSynchronizeMembers(
|
||||
$arrayData = $this->ldapGroupSynchronizeMembers(
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$arrayGroupData['GRP_UID'],
|
||||
@@ -1107,7 +1107,7 @@ class LdapAdvanced
|
||||
$user = new User();
|
||||
$arrayUserData = $user->getUserRecordByPk($usrUid, [], false);
|
||||
|
||||
$result = $this->__ldapUserUpdateByDnAndData(
|
||||
$result = $this->ldapUserUpdateByDnAndData(
|
||||
$this->ldapcnn,
|
||||
$arrayAuthSource,
|
||||
$userDn,
|
||||
@@ -1625,7 +1625,7 @@ class LdapAdvanced
|
||||
$ldapcnn = $this->ldapcnn;
|
||||
|
||||
//Get Departments
|
||||
$limit = $this->__getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$limit = $this->getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$flagError = false;
|
||||
|
||||
$filter = '(' . $this->arrayObjectClassFilter['department'] . ')';
|
||||
@@ -2251,7 +2251,7 @@ class LdapAdvanced
|
||||
$ldapcnn = $this->ldapcnn;
|
||||
|
||||
//Get Groups
|
||||
$limit = $this->__getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$limit = $this->getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$flagError = false;
|
||||
|
||||
$filter = '(' . $this->arrayObjectClassFilter['group'] . ')';
|
||||
@@ -2677,7 +2677,7 @@ class LdapAdvanced
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function __ldapUserUpdateByDnAndData($ldapcnn, array $arrayAuthSourceData, $userDn, array $arrayUser)
|
||||
private function ldapUserUpdateByDnAndData($ldapcnn, array $arrayAuthSourceData, $userDn, array $arrayUser)
|
||||
{
|
||||
try {
|
||||
//Set variables
|
||||
@@ -2799,7 +2799,7 @@ class LdapAdvanced
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function __ldapUsersUpdateData($ldapcnn, array $arrayAuthSourceData, $filterUsers, array $arrayUserUid, array $arrayData)
|
||||
private function ldapUsersUpdateData($ldapcnn, array $arrayAuthSourceData, $filterUsers, array $arrayUserUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
$totalUser = $arrayData['totalUser'];
|
||||
@@ -2835,7 +2835,7 @@ class LdapAdvanced
|
||||
$entry = ldap_first_entry($ldapcnn, $searchResult);
|
||||
|
||||
do {
|
||||
if ($this->__ldapUserUpdateByDnAndData(
|
||||
if ($this->ldapUserUpdateByDnAndData(
|
||||
$ldapcnn,
|
||||
$arrayAuthSourceData,
|
||||
ldap_get_dn($ldapcnn, $entry),
|
||||
@@ -2887,7 +2887,7 @@ class LdapAdvanced
|
||||
$ldapcnn = $this->ldapcnn;
|
||||
|
||||
//Update Users
|
||||
$limit = $this->__getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$limit = $this->getPageSizeLimitByData($arrayAuthenticationSourceData);
|
||||
$count = 0;
|
||||
|
||||
$uidUserIdentifier = (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["AUTH_SOURCE_IDENTIFIER_FOR_USER"])) ? $arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["AUTH_SOURCE_IDENTIFIER_FOR_USER"] : "uid";
|
||||
@@ -2904,7 +2904,7 @@ class LdapAdvanced
|
||||
$arrayUserUid[] = $arrayUserData["USR_UID"];
|
||||
|
||||
if ($count == $limit) {
|
||||
list($totalUser, $countUser) = $this->__ldapUsersUpdateData(
|
||||
list($totalUser, $countUser) = $this->ldapUsersUpdateData(
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$filterUsers,
|
||||
@@ -2920,7 +2920,7 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
list($totalUser, $countUser) = $this->__ldapUsersUpdateData(
|
||||
list($totalUser, $countUser) = $this->ldapUsersUpdateData(
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$filterUsers,
|
||||
@@ -2940,7 +2940,7 @@ class LdapAdvanced
|
||||
*
|
||||
* @return int Returns the page size limit for a search result
|
||||
*/
|
||||
private function __getPageSizeLimitByData(array $arrayAuthSourceData)
|
||||
private function getPageSizeLimitByData(array $arrayAuthSourceData)
|
||||
{
|
||||
if (isset($arrayAuthSourceData['AUTH_SOURCE_DATA']['LDAP_PAGE_SIZE_LIMIT'])) {
|
||||
return $arrayAuthSourceData['AUTH_SOURCE_DATA']['LDAP_PAGE_SIZE_LIMIT'];
|
||||
|
||||
@@ -252,29 +252,20 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
//todo
|
||||
if (extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = @sqlsrv_connect($server, $opt);
|
||||
case 'sqlsrv':
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = @sqlsrv_connect($server, $opt);
|
||||
|
||||
if ($link) {
|
||||
$stat->status = 'SUCCESS';
|
||||
@@ -397,32 +388,21 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
if (extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = $db = @sqlsrv_connect($server, $opt);
|
||||
case 'sqlsrv':
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = $db = @sqlsrv_connect($server, $opt);
|
||||
if ($link) {
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
$db = @mssql_select_db($this->db_sourcename, $link);
|
||||
}
|
||||
if ($db) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
|
||||
30
workflow/engine/classes/PmPluginCompatibility.php
Normal file
30
workflow/engine/classes/PmPluginCompatibility.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class PmPluginCompatibility
|
||||
*
|
||||
* This class was created in order to keep the compatibility of the plugins that uses the method "PMPlugin"
|
||||
*/
|
||||
class PmPluginCompatibility
|
||||
{
|
||||
// The name of these properties should be equal that the properties in class "PMPlugin"
|
||||
public $sNamespace;
|
||||
public $sClassName;
|
||||
public $sPluginFolder = '';
|
||||
public $sFilename = null;
|
||||
|
||||
/**
|
||||
* Method similar to PMPlugin::__construct, this method was created in order to keep the compatibility for the plugins,
|
||||
* the plugins uses something similar to: parent::PMPlugin($namespace, $filename);
|
||||
*
|
||||
* @param string $namespace
|
||||
* @param string $filename
|
||||
*/
|
||||
public function PMPlugin($namespace, $filename = null)
|
||||
{
|
||||
$this->sNamespace = $namespace;
|
||||
$this->sClassName = $namespace . 'Plugin';
|
||||
$this->sPluginFolder = $namespace;
|
||||
$this->sFilename = $filename;
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,13 @@
|
||||
*/
|
||||
class ReplacementLogo
|
||||
{
|
||||
|
||||
//var $dir='';
|
||||
/**
|
||||
* This function is the constructor of the ReplacementLogo class
|
||||
* param
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function replacementLogo ()
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -595,304 +595,182 @@ class ReportTables
|
||||
$oDataset = ReportTablePeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aVars = array();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRow['REP_TAB_NAME'] = $this->sPrefix . $aRow['REP_TAB_NAME'];
|
||||
$PropelDatabase = $this->chooseDB($aRow['REP_TAB_CONNECTION']);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$con->getResource();
|
||||
$stmt = $con->createStatement();
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
$sqlExists = "SELECT * FROM `" . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsExists = $stmt->executeQuery($sqlExists, ResultSet::FETCHMODE_ASSOC);
|
||||
$rsExists->next();
|
||||
$aRow2 = $rsExists->getRow();
|
||||
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
$sqlExists = "SELECT * FROM `" . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsExists = $stmt->executeQuery($sqlExists, ResultSet::FETCHMODE_ASSOC);
|
||||
$rsExists->next();
|
||||
$aRow2 = $rsExists->getRow();
|
||||
|
||||
if (is_array($aRow2)) {
|
||||
$sQuery = 'UPDATE `' . $aRow['REP_TAB_NAME'] . '` SET ';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
|
||||
if (is_array($aRow2)) {
|
||||
$sQuery = 'UPDATE `' . $aRow['REP_TAB_NAME'] . '` SET ';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
|
||||
|
||||
if (!$isBpmn && !isset($aFields[$aField['sFieldName']])) {
|
||||
foreach ($aFields as $row) {
|
||||
if (is_array($row) && isset($row[count($row)])) {
|
||||
$aFields = $row[count($row)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
if (!isset($aFields[$aField['sFieldName'] . '_label'])) {
|
||||
$aFields[$aField['sFieldName'] . '_label'] = '';
|
||||
}
|
||||
if (is_array($aFields[$aField['sFieldName']])) {
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
} else {
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']])) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . '\',';
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= $value . ",";
|
||||
break;
|
||||
if (!$isBpmn && !isset($aFields[$aField['sFieldName']])) {
|
||||
foreach ($aFields as $row) {
|
||||
if (is_array($row) && isset($row[count($row)])) {
|
||||
$aFields = $row[count($row)];
|
||||
}
|
||||
}
|
||||
$sQuery = substr($sQuery, 0, -1);
|
||||
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
}
|
||||
|
||||
//Only we will to executeQuery if we have additional field
|
||||
if (count($aTableFields) > 0) {
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isset($aFields[$aField['sFieldName'] . '_label'])) {
|
||||
$aFields[$aField['sFieldName'] . '_label'] = '';
|
||||
}
|
||||
if (is_array($aFields[$aField['sFieldName']])) {
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
} else {
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']])) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . '\',';
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= $value . ",";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery = substr($sQuery, 0, -1);
|
||||
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
|
||||
//Only we will to executeQuery if we have additional field
|
||||
if (count($aTableFields) > 0) {
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= "," . $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//remove old rows from database
|
||||
$sqlDelete = 'DELETE FROM `' . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsDelete = $stmt->executeQuery($sqlDelete);
|
||||
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
if (is_array($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber;
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber . ',' . $iRow;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
if ($mysqlDate != '') {
|
||||
$mysqlDate = str_replace('/', '-', $mysqlDate);
|
||||
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
|
||||
}
|
||||
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
|
||||
$sQuery .= "," . $value;
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//remove old rows from database
|
||||
$sqlDelete = 'DELETE FROM `' . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
$rsDelete = $stmt->executeQuery($sqlDelete);
|
||||
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
if (is_array($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',`' . $aField['sFieldName'] . '`';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber . ',' . $iRow;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/**
|
||||
* For SQLServer code
|
||||
*/
|
||||
case 'mssql':
|
||||
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
|
||||
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
|
||||
$oDataset2 = mssql_query("SELECT * FROM [" . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'");
|
||||
if ($aRow2 = mssql_fetch_row($oDataset2)) {
|
||||
$sQuery = 'UPDATE [' . $aRow['REP_TAB_NAME'] . '] SET ';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= '[' . $aField['sFieldName'] . '] = ';
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "',";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "',";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery = substr($sQuery, 0, -1);
|
||||
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
|
||||
} else {
|
||||
$sQuery = 'INSERT INTO [' . $aRow['REP_TAB_NAME'] . '] (';
|
||||
$sQuery .= '[APP_UID],[APP_NUMBER]';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
}
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
//Verify use in mssql
|
||||
mysqli_query(
|
||||
$con->getResource(),
|
||||
'DELETE FROM [' . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'"
|
||||
);
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
$sQuery = 'INSERT INTO [' . $aRow['REP_TAB_NAME'] . '] (';
|
||||
$sQuery .= '[APP_UID],[APP_NUMBER],[ROW]';
|
||||
foreach ($aTableFields as $aField) {
|
||||
$sQuery .= ',[' . $aField['sFieldName'] . ']';
|
||||
}
|
||||
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int)$iApplicationNumber . ',' . $iRow;
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$sQuery .= ')';
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ class TarFile extends Archive
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function TarFile($name)
|
||||
public function __construct($name)
|
||||
{
|
||||
$this->archive($name);
|
||||
parent::__construct($name);
|
||||
$this->options['type'] = "tar";
|
||||
}
|
||||
|
||||
|
||||
@@ -2085,8 +2085,14 @@ class WorkspaceTools
|
||||
CLI::logging("+> Restoring database {$db->name} to $dbName\n");
|
||||
$versionBackupEngine = (isset($metadata->backupEngineVersion)) ? $metadata->backupEngineVersion : 1;
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql", $aParameters, $versionBackupEngine, $connection);
|
||||
$workspace->createDBUser($dbUser, ($workspace->dbGrantUserPassword != '' ? $workspace->dbGrantUserPassword : $db->pass), "localhost", $dbName, $connection);
|
||||
$workspace->createDBUser($dbUser, ($workspace->dbGrantUserPassword != '' ? $workspace->dbGrantUserPassword : $db->pass), "%", $dbName, $connection);
|
||||
// Define the password
|
||||
if (empty($workspace->dbGrantUserPassword)) {
|
||||
$bdPassword = $db->pass;
|
||||
} else {
|
||||
$bdPassword = $workspace->dbGrantUserPassword;
|
||||
}
|
||||
$workspace->createDBUser($dbUser, $bdPassword, "localhost", $dbName, $connection);
|
||||
$workspace->createDBUser($dbUser, $bdPassword, "%", $dbName, $connection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\JobsManager;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Util\WsMessageResponse;
|
||||
|
||||
class WsBase
|
||||
@@ -477,54 +478,48 @@ class WsBase
|
||||
return $arrayData;
|
||||
}
|
||||
} else {
|
||||
$arrayData = [];
|
||||
$data = [];
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
$selectedColumns = [
|
||||
'APP_DELEGATION.APP_UID',
|
||||
'APP_DELEGATION.DEL_INDEX',
|
||||
'APP_DELEGATION.APP_NUMBER',
|
||||
'APPLICATION.APP_STATUS',
|
||||
'APPLICATION.APP_TITLE',
|
||||
'APP_DELEGATION.PRO_UID'
|
||||
];
|
||||
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_UID);
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX);
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::PRO_UID);
|
||||
$query = Delegation::query()->select($selectedColumns);
|
||||
$query->join('APPLICATION', function ($join) {
|
||||
$join->on('APP_DELEGATION.APP_NUMBER', '=', 'APPLICATION.APP_NUMBER');
|
||||
});
|
||||
$query->join('APP_THREAD', function ($join) {
|
||||
$join->on('APP_THREAD.APP_UID', '=', 'APP_DELEGATION.APP_UID');
|
||||
});
|
||||
$query->where('APP_DELEGATION.USR_UID', $userUid);
|
||||
$query->whereNested(function ($query) {
|
||||
$query->where('APPLICATION.APP_STATUS', 'TO_DO');
|
||||
$query->orWhere('APPLICATION.APP_STATUS', 'DRAFT');
|
||||
});
|
||||
$query->whereNull('APP_DELEGATION.DEL_FINISH_DATE');
|
||||
$query->where('APP_DELEGATION.DEL_THREAD_STATUS', 'OPEN');
|
||||
$query->where('APP_THREAD.APP_THREAD_STATUS', 'OPEN');
|
||||
$query->orderBy('APP_DELEGATION.APP_NUMBER', 'DESC');
|
||||
|
||||
$criteria->add(AppCacheViewPeer::USR_UID, $userUid);
|
||||
$result = $query->get();
|
||||
$data2 = $result->values()->toArray();
|
||||
$aux = [];
|
||||
|
||||
$criteria->add(
|
||||
//ToDo - getToDo()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL)
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN")
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")
|
||||
)
|
||||
)->addOr(
|
||||
//Draft - getDraft()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN")
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")
|
||||
)
|
||||
);
|
||||
|
||||
$criteria->addDescendingOrderByColumn(AppCacheViewPeer::APP_NUMBER);
|
||||
|
||||
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$arrayData[] = array(
|
||||
"guid" => $row["APP_UID"],
|
||||
"name" => $row["APP_NUMBER"],
|
||||
"status" => $row["APP_STATUS"],
|
||||
"delIndex" => $row["DEL_INDEX"],
|
||||
"processId" => $row["PRO_UID"]
|
||||
);
|
||||
foreach ($data2 as $value) {
|
||||
$aux['guid'] = $value['APP_UID'];
|
||||
$aux['name'] = $value['APP_TITLE'];
|
||||
$aux['status'] = $value['APP_STATUS'];
|
||||
$aux['delIndex'] = $value['DEL_INDEX'];
|
||||
$aux['processId'] = $value['PRO_UID'];
|
||||
array_push($data, $aux);
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
return $data;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$arrayData = [];
|
||||
|
||||
@@ -13,7 +13,7 @@ class XMLConnection
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
public function XMLConnection($file)
|
||||
public function __construct($file)
|
||||
{
|
||||
$this->xmldoc = new Xml_Document();
|
||||
$this->xmldoc->parseXmlFile($file);
|
||||
|
||||
@@ -14,9 +14,10 @@ class XMLResult
|
||||
* XMLResult
|
||||
*
|
||||
* @param array $result
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function XMLResult ($result = array())
|
||||
public function __construct($result = [])
|
||||
{
|
||||
$this->result = $result;
|
||||
$this->cursor = 0;
|
||||
|
||||
@@ -21,9 +21,10 @@ class XmlFormFieldToolBar extends XmlFormField
|
||||
* @param string $lang
|
||||
* @param string $home
|
||||
* @param string $owner
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function XmlFormFieldToolBar($xmlNode, $lang = 'en', $home = '', $owner = ' ')
|
||||
public function __construct($xmlNode, $lang = 'en', $home = '', $owner = ' ')
|
||||
{
|
||||
parent::__construct($xmlNode, $lang, $home, $owner);
|
||||
$this->home = $home;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
*/
|
||||
class ZipFile extends Archive
|
||||
{
|
||||
public function ZipFile($name)
|
||||
public function __construct($name)
|
||||
{
|
||||
$this->archive($name);
|
||||
parent::__construct($name);
|
||||
$this->options['type'] = "zip";
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
/**
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class PMPlugin
|
||||
class PMPlugin extends PmPluginCompatibility
|
||||
{
|
||||
public $sNamespace;
|
||||
public $sClassName;
|
||||
@@ -22,7 +22,7 @@ class PMPlugin
|
||||
* @param string $sFilename
|
||||
* @return void
|
||||
*/
|
||||
public function PMPlugin($sNamespace, $sFilename = null)
|
||||
public function __construct($sNamespace, $sFilename = null)
|
||||
{
|
||||
$this->sNamespace = $sNamespace;
|
||||
$this->sClassName = $sNamespace . 'Plugin';
|
||||
|
||||
@@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseAppTimeoutActionExecuted.php';
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'APP_TIMEOUT_ACTION_EXECUTED' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
@@ -14,17 +14,18 @@ require_once 'classes/model/om/BaseAppTimeoutActionExecuted.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class AppTimeoutActionExecuted extends BaseAppTimeoutActionExecuted {
|
||||
|
||||
public function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( AppTimeoutActionExecutedPeer::DATABASE_NAME );
|
||||
class AppTimeoutActionExecuted extends BaseAppTimeoutActionExecuted
|
||||
{
|
||||
|
||||
public function create($aData)
|
||||
{
|
||||
$con = Propel::getConnection(AppTimeoutActionExecutedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -33,6 +34,6 @@ class AppTimeoutActionExecuted extends BaseAppTimeoutActionExecuted {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // AppTimeoutActionExecuted
|
||||
|
||||
@@ -956,52 +956,6 @@ class Process extends BaseProcess
|
||||
}
|
||||
}
|
||||
|
||||
public function refreshUserAllCountersByProcessesGroupUid($proUidArray)
|
||||
{
|
||||
$aTypes = array(
|
||||
'to_do',
|
||||
'draft',
|
||||
'cancelled',
|
||||
'sent',
|
||||
'paused',
|
||||
'completed',
|
||||
'selfservice'
|
||||
);
|
||||
$usersArray = array();
|
||||
$users = new Users();
|
||||
$oCase = new Cases();
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$oCriteria->setDistinct();
|
||||
$oCriteria->add(AppDelegationPeer::PRO_UID, $proUidArray, Criteria::IN);
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oRuleSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oRuleSet->next()) {
|
||||
$row = $oRuleSet->getRow();
|
||||
if (isset($row['USR_UID']) && $row['USR_UID'] != '') {
|
||||
$usersArray[$row['USR_UID']] = $row['USR_UID'];
|
||||
}
|
||||
$oCase->deleteDelegation($row['APP_UID']);
|
||||
}
|
||||
|
||||
foreach ($usersArray as $value) {
|
||||
$oAppCache = new AppCacheView();
|
||||
$aCount = $oAppCache->getAllCounters($aTypes, $value);
|
||||
$newData = array(
|
||||
'USR_UID' => $value,
|
||||
'USR_TOTAL_INBOX' => $aCount['to_do'],
|
||||
'USR_TOTAL_DRAFT' => $aCount['draft'],
|
||||
'USR_TOTAL_CANCELLED' => $aCount['cancelled'],
|
||||
'USR_TOTAL_PARTICIPATED' => $aCount['sent'],
|
||||
'USR_TOTAL_PAUSED' => $aCount['paused'],
|
||||
'USR_TOTAL_COMPLETED' => $aCount['completed'],
|
||||
'USR_TOTAL_UNASSIGNED' => $aCount['selfservice']
|
||||
);
|
||||
$users->update($newData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a process object by PRO_ID
|
||||
*
|
||||
|
||||
@@ -31727,42 +31727,6 @@ msgstr "Reassigned to"
|
||||
msgid "BACK"
|
||||
msgstr "BACK"
|
||||
|
||||
# cases/cases_ReassignBy.xml?title
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: subtitle - title
|
||||
msgid "<center>Reassignment of Cases</center>"
|
||||
msgstr "<center>Reassignment of Cases</center>"
|
||||
|
||||
# cases/cases_ReassignBy.xml?REASSIGN_BY
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: radiogroup - REASSIGN_BY
|
||||
msgid "Reassign By"
|
||||
msgstr "Reassign By"
|
||||
|
||||
# cases/cases_ReassignBy.xml?REASSIGN_BY-1
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: radiogroup - REASSIGN_BY - 1
|
||||
msgid "[cases/cases_ReassignBy.xml?REASSIGN_BY-1]"
|
||||
msgstr "Case"
|
||||
|
||||
# cases/cases_ReassignBy.xml?REASSIGN_BY-2
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: radiogroup - REASSIGN_BY - 2
|
||||
msgid "[cases/cases_ReassignBy.xml?REASSIGN_BY-2]"
|
||||
msgstr "User"
|
||||
|
||||
# cases/cases_ReassignBy.xml?REASSIGN_USER
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: dropdown - REASSIGN_USER
|
||||
msgid "[cases/cases_ReassignBy.xml?REASSIGN_USER] "
|
||||
msgstr ""
|
||||
|
||||
# cases/cases_ReassignBy.xml?REASSIGN_USER-
|
||||
# cases/cases_ReassignBy.xml
|
||||
#: dropdown - REASSIGN_USER -
|
||||
msgid "[cases/cases_ReassignBy.xml?REASSIGN_USER-]"
|
||||
msgstr "- Select -"
|
||||
|
||||
# cases/cases_ReassignShowInfo.xml?TITLE
|
||||
# cases/cases_ReassignShowInfo.xml
|
||||
#: subtitle - TITLE
|
||||
@@ -38487,60 +38451,6 @@ msgstr "Content"
|
||||
msgid "[messages/messages_Edit.xml?ACCEPT] Save"
|
||||
msgstr "Save"
|
||||
|
||||
# messages/messages_List.xml?fMESS_TITLE
|
||||
# messages/messages_List.xml
|
||||
#: text - fMESS_TITLE
|
||||
msgid "[messages/messages_List.xml?fMESS_TITLE] Output document"
|
||||
msgstr "Output document"
|
||||
|
||||
# messages/messages_List.xml?MESS_TYPE
|
||||
# messages/messages_List.xml
|
||||
#: dropdown - MESS_TYPE
|
||||
msgid "[messages/messages_List.xml?MESS_TYPE] Type"
|
||||
msgstr "Type"
|
||||
|
||||
# messages/messages_List.xml?MESS_TYPE-HTML
|
||||
# messages/messages_List.xml
|
||||
#: dropdown - MESS_TYPE - HTML
|
||||
msgid "[messages/messages_List.xml?MESS_TYPE-HTML]"
|
||||
msgstr "HTML"
|
||||
|
||||
# messages/messages_List.xml?MESS_TYPE-TEXT
|
||||
# messages/messages_List.xml
|
||||
#: dropdown - MESS_TYPE - TEXT
|
||||
msgid "[messages/messages_List.xml?MESS_TYPE-TEXT]"
|
||||
msgstr "Plain text"
|
||||
|
||||
# messages/messages_List.xml?MESS_TYPE-SMS
|
||||
# messages/messages_List.xml
|
||||
#: dropdown - MESS_TYPE - SMS
|
||||
msgid "[messages/messages_List.xml?MESS_TYPE-SMS]"
|
||||
msgstr "SMS"
|
||||
|
||||
# messages/messages_List.xml?fMESS_DESCRIPTION
|
||||
# messages/messages_List.xml
|
||||
#: textarea - fMESS_DESCRIPTION
|
||||
msgid "[messages/messages_List.xml?fMESS_DESCRIPTION] Content"
|
||||
msgstr "Content"
|
||||
|
||||
# messages/messages_List.xml?EDIT
|
||||
# messages/messages_List.xml
|
||||
#: link - EDIT
|
||||
msgid "[messages/messages_List.xml?EDIT] "
|
||||
msgstr ""
|
||||
|
||||
# messages/messages_List.xml?DELETE
|
||||
# messages/messages_List.xml
|
||||
#: link - DELETE
|
||||
msgid "[messages/messages_List.xml?DELETE] "
|
||||
msgstr ""
|
||||
|
||||
# messages/messages_List.xml?SEARCH
|
||||
# messages/messages_List.xml
|
||||
#: button - SEARCH
|
||||
msgid "[messages/messages_List.xml?SEARCH] Apply Filter"
|
||||
msgstr "Apply Filter"
|
||||
|
||||
# messages/messages_Options.xml?MNU_ADD
|
||||
# messages/messages_Options.xml
|
||||
#: link - MNU_ADD
|
||||
@@ -38643,42 +38553,6 @@ msgstr "Save"
|
||||
msgid "[outputdocs/outputdocs_Edit.xml?BTN_CANCEL] Cancel"
|
||||
msgstr "Cancel"
|
||||
|
||||
# outputdocs/outputdocs_List.xml?OUT_DOC_TITLE
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: text - OUT_DOC_TITLE
|
||||
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_TITLE] Output document"
|
||||
msgstr "Output document"
|
||||
|
||||
# outputdocs/outputdocs_List.xml?OUT_DOC_FILENAME
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: text - OUT_DOC_FILENAME
|
||||
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_FILENAME] Filename"
|
||||
msgstr "Filename"
|
||||
|
||||
# outputdocs/outputdocs_List.xml?OUT_DOC_DESCRIPTION
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: textarea - OUT_DOC_DESCRIPTION
|
||||
msgid "[outputdocs/outputdocs_List.xml?OUT_DOC_DESCRIPTION] Description"
|
||||
msgstr "Description"
|
||||
|
||||
# outputdocs/outputdocs_List.xml?EDIT
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: link - EDIT
|
||||
msgid "[outputdocs/outputdocs_List.xml?EDIT] "
|
||||
msgstr ""
|
||||
|
||||
# outputdocs/outputdocs_List.xml?DELETE
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: link - DELETE
|
||||
msgid "[outputdocs/outputdocs_List.xml?DELETE] "
|
||||
msgstr ""
|
||||
|
||||
# outputdocs/outputdocs_List.xml?SEARCH
|
||||
# outputdocs/outputdocs_List.xml
|
||||
#: button - SEARCH
|
||||
msgid "[outputdocs/outputdocs_List.xml?SEARCH] Apply Filter"
|
||||
msgstr "Apply Filter"
|
||||
|
||||
# outputdocs/outputdocs_New.xml?TITLE
|
||||
# outputdocs/outputdocs_New.xml
|
||||
#: title - TITLE
|
||||
@@ -48531,60 +48405,6 @@ msgstr "Save"
|
||||
msgid "[users/users_EditRT.xml?BTN_CANCEL] Cancel"
|
||||
msgstr "Cancel"
|
||||
|
||||
# users/users_List.xml?USR_COMPLETENAME
|
||||
# users/users_List.xml
|
||||
#: text - USR_COMPLETENAME
|
||||
msgid "[users/users_List.xml?USR_COMPLETENAME] Full Name"
|
||||
msgstr "Full Name"
|
||||
|
||||
# users/users_List.xml?USR_USERNAME
|
||||
# users/users_List.xml
|
||||
#: text - USR_USERNAME
|
||||
msgid "[users/users_List.xml?USR_USERNAME] Username"
|
||||
msgstr "Username"
|
||||
|
||||
# users/users_List.xml?USR_EMAIL
|
||||
# users/users_List.xml
|
||||
#: text - USR_EMAIL
|
||||
msgid "E-Mail"
|
||||
msgstr "E-Mail"
|
||||
|
||||
# users/users_List.xml?USR_ROLE
|
||||
# users/users_List.xml
|
||||
#: text - USR_ROLE
|
||||
msgid "[users/users_List.xml?USR_ROLE] Role"
|
||||
msgstr "Role"
|
||||
|
||||
# users/users_List.xml?USR_DUE_DATE
|
||||
# users/users_List.xml
|
||||
#: text - USR_DUE_DATE
|
||||
msgid "[users/users_List.xml?USR_DUE_DATE] Due Date"
|
||||
msgstr "Due Date"
|
||||
|
||||
# users/users_List.xml?USR_EDIT
|
||||
# users/users_List.xml
|
||||
#: link - USR_EDIT
|
||||
msgid "[users/users_List.xml?USR_EDIT] "
|
||||
msgstr ""
|
||||
|
||||
# users/users_List.xml?USR_GROUP
|
||||
# users/users_List.xml
|
||||
#: link - USR_GROUP
|
||||
msgid "[users/users_List.xml?USR_GROUP] "
|
||||
msgstr ""
|
||||
|
||||
# users/users_List.xml?USR_AUTH
|
||||
# users/users_List.xml
|
||||
#: link - USR_AUTH
|
||||
msgid "[users/users_List.xml?USR_AUTH] "
|
||||
msgstr ""
|
||||
|
||||
# users/users_List.xml?USR_DELETE
|
||||
# users/users_List.xml
|
||||
#: link - USR_DELETE
|
||||
msgid "[users/users_List.xml?USR_DELETE] "
|
||||
msgstr ""
|
||||
|
||||
# users/users_New.xml?TITLE1
|
||||
# users/users_New.xml
|
||||
#: title - TITLE1
|
||||
@@ -48801,12 +48621,6 @@ msgstr "Cancel"
|
||||
msgid "[users/users_NewOptions.xml?MNU] Back to list"
|
||||
msgstr "Back to list"
|
||||
|
||||
# users/users_Options.xml?MNU_ADD
|
||||
# users/users_Options.xml
|
||||
#: link - MNU_ADD
|
||||
msgid "[users/users_Options.xml?MNU_ADD] New"
|
||||
msgstr "New"
|
||||
|
||||
# users/users_ReassignCases.xml?PROCESS
|
||||
# users/users_ReassignCases.xml
|
||||
#: text - PROCESS
|
||||
|
||||
@@ -5,7 +5,6 @@ use ProcessMaker\Core\System;
|
||||
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
global $translation;
|
||||
|
||||
@@ -117,7 +116,7 @@ class InstallerModule extends Controller
|
||||
$this->setJSVar('DB_ADAPTER', DB_ADAPTER);
|
||||
$aux = explode(':', DB_HOST);
|
||||
$this->setJSVar('DB_HOST', $aux[0]);
|
||||
$this->setJSVar('DB_PORT', isset($aux[1]) ? $aux[1] : (DB_ADAPTER == 'mssql' ? '1433' : '3306'));
|
||||
$this->setJSVar('DB_PORT', isset($aux[1]) ? $aux[1] : '3306');
|
||||
$this->setJSVar('DB_NAME', 'workflow');
|
||||
$this->setJSVar('DB_USER', '');
|
||||
$this->setJSVar('DB_PASS', '');
|
||||
@@ -196,7 +195,6 @@ class InstallerModule extends Controller
|
||||
$info = new stdclass();
|
||||
$info->php = new stdclass();
|
||||
$info->mysql = new stdclass();
|
||||
$info->mssql = new stdclass();
|
||||
$info->openssl = new stdclass();
|
||||
$info->curl = new stdclass();
|
||||
$info->dom = new stdclass();
|
||||
@@ -222,14 +220,6 @@ class InstallerModule extends Controller
|
||||
$info->mysql->result = $mysqlNum >= 5.0;
|
||||
}
|
||||
|
||||
// MSSQL info and verification
|
||||
$info->mssql->result = false;
|
||||
$info->mssql->version = G::LoadTranslation('ID_NOT_ENABLED');
|
||||
if (function_exists('mssql_query')) {
|
||||
$info->mssql->result = true;
|
||||
$info->mssql->version = G::LoadTranslation('ID_ENABLED');
|
||||
}
|
||||
|
||||
// OpenSSL info
|
||||
$info->openssl->result = false;
|
||||
$info->openssl->version = G::LoadTranslation('ID_NOT_ENABLED');
|
||||
@@ -436,15 +426,7 @@ class InstallerModule extends Controller
|
||||
$this->setResponseType('json');
|
||||
$info = new StdClass();
|
||||
try {
|
||||
switch ($_REQUEST['db_engine']) {
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
$info = $this->testMySQLConnection();
|
||||
break;
|
||||
case 'mssql':
|
||||
$info = $this->testMSSQLConnection();
|
||||
break;
|
||||
}
|
||||
$info = $this->testMySQLConnection();
|
||||
} catch (Exception $e) {
|
||||
$info->result = false;
|
||||
$info->message = G::LoadTranslation('DBCONNECTIONS_MSGA');
|
||||
@@ -495,7 +477,7 @@ class InstallerModule extends Controller
|
||||
|
||||
/**
|
||||
* function to create a workspace
|
||||
* in fact this function is calling appropriate functions for mysql and mssql
|
||||
* in fact this function is calling appropriate functions for mysql
|
||||
* need permission PM_SETUP_ADVANCE for this action
|
||||
* @return stdClass information create a workspace.
|
||||
*/
|
||||
@@ -510,14 +492,7 @@ class InstallerModule extends Controller
|
||||
$this->setResponseType('json');
|
||||
$info = new StdClass();
|
||||
try {
|
||||
switch ($_REQUEST['db_engine']) {
|
||||
case 'mysql':
|
||||
$info = $this->createMySQLWorkspace();
|
||||
break;
|
||||
case 'mssql':
|
||||
$info = $this->createMSSQLWorkspace();
|
||||
break;
|
||||
}
|
||||
$info = $this->createMySQLWorkspace();
|
||||
} catch (Exception $e) {
|
||||
$info->result = false;
|
||||
$info->message = G::LoadTranslation('DBCONNECTIONS_MSGA');
|
||||
@@ -564,30 +539,6 @@ class InstallerModule extends Controller
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a query to MSSQL and log the query
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
public function mssqlQuery($sql)
|
||||
{
|
||||
$filter = new InputFilter();
|
||||
$sql = $filter->preventSqlInjection($sql, array());
|
||||
$this->installLog($sql);
|
||||
$query = @mssql_query($sql, $this->link);
|
||||
if (!$query) {
|
||||
$errorMessage = mssql_get_last_message();
|
||||
$this->installLog(G::LoadTranslation('ID_MYSQL_ERROR', SYS_LANG, array($errorMessage)));
|
||||
throw (new Exception($errorMessage));
|
||||
return false;
|
||||
}
|
||||
@mssql_free_result($query);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* query_sql_file send many statements to server
|
||||
*
|
||||
@@ -651,38 +602,6 @@ class InstallerModule extends Controller
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* query_sql_file send many statements to server
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $connection
|
||||
* @return array $report
|
||||
*/
|
||||
public function mssqlFileQuery($file)
|
||||
{
|
||||
if (!is_file($file)) {
|
||||
throw (new Exception(G::LoadTranslation('ID_SQL_FILE_INVALID', SYS_LANG, array($file))));
|
||||
return $false;
|
||||
}
|
||||
$this->installLog(G::LoadTranslation('ID_PROCESING', SYS_LANG, array($file)));
|
||||
$startTime = microtime(true);
|
||||
$content = file_get_contents($file);
|
||||
$queries = explode(';', $content);
|
||||
|
||||
foreach ($queries as $sql) {
|
||||
$query = @mssql_query($sql, $this->link);
|
||||
if (!$query) {
|
||||
$errorMessage = mssql_get_last_message();
|
||||
$this->installLog(G::LoadTranslation('ID_MYSQL_ERROR', SYS_LANG, array($errorMessage . G::LoadTranslation('ID_QUERY') . ": " . $sql)));
|
||||
throw (new Exception($errorMessage));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$endTime = microtime(true);
|
||||
$this->installLog(G::LoadTranslation('ID_FILE_PROCESSED', SYS_LANG, array(basename($file), $endTime - $startTime)));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* set Grant Privileges for MySQL
|
||||
*
|
||||
@@ -710,46 +629,6 @@ class InstallerModule extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set Grant Privileges for SQLServer
|
||||
*
|
||||
* @param string $psUser
|
||||
* @param string $psPassword
|
||||
* @param string $psDatabase
|
||||
* @return void
|
||||
*/
|
||||
public function setGrantPrivilegesMSSQL($psUser, $psPassword, $psDatabase)
|
||||
{
|
||||
$query = sprintf("IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'%s') DROP LOGIN [%s]", $psUser, $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("CREATE LOGIN [%s] WITH PASSWORD=N'%s', DEFAULT_DATABASE=[%s], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF ", $psUser, $psPassword, $psDatabase);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("USE %s;", $psDatabase);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'%s') DROP USER [%s]", $psUser, $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("CREATE USER %s FOR LOGIN %s;", $psUser, $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("sp_addrolemember 'db_owner', '%s' ", $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("sp_addrolemember 'db_ddladmin', '%s' ", $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("sp_addrolemember 'db_accessadmin', '%s' ", $psUser);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("use master ");
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a workspace in a MySQL database
|
||||
*
|
||||
@@ -1055,190 +934,6 @@ class InstallerModule extends Controller
|
||||
return $info;
|
||||
}
|
||||
|
||||
public function createMSSQLWorkspace()
|
||||
{
|
||||
$filter = new InputFilter();
|
||||
ini_set('max_execution_time', '0');
|
||||
|
||||
$info = new stdClass();
|
||||
$info->result = false;
|
||||
$info->message = '';
|
||||
|
||||
$db_hostname = trim($_REQUEST['db_hostname']);
|
||||
$db_hostname = $filter->validateInput($db_hostname);
|
||||
$db_port = trim($_REQUEST['db_port']);
|
||||
$db_port = $filter->validateInput($db_port);
|
||||
$db_username = trim($_REQUEST['db_username']);
|
||||
$db_username = $filter->validateInput($db_username);
|
||||
$db_password = urlencode(trim($_REQUEST['db_password']));
|
||||
$db_password = urldecode($filter->validateInput($db_password));
|
||||
$wf = trim($_REQUEST['wfDatabase']);
|
||||
$rb = trim($_REQUEST['wfDatabase']);
|
||||
$rp = trim($_REQUEST['wfDatabase']);
|
||||
$workspace = trim($_REQUEST['workspace']);
|
||||
$pathConfig = trim($_REQUEST['pathConfig']);
|
||||
$pathLanguages = trim($_REQUEST['pathLanguages']);
|
||||
$pathPlugins = trim($_REQUEST['pathPlugins']);
|
||||
$pathShared = trim($_REQUEST['pathShared']);
|
||||
$pathXmlforms = trim($_REQUEST['pathXmlforms']);
|
||||
$adminPassword = trim($_REQUEST['adminPassword']);
|
||||
$adminUsername = trim($_REQUEST['adminUsername']);
|
||||
$deleteDB = ($_REQUEST['deleteDB'] == 'true');
|
||||
|
||||
if (substr($pathShared, -1) != '/') {
|
||||
$pathShared .= '/';
|
||||
}
|
||||
|
||||
$this->installLog('-------------------------------------------');
|
||||
$this->installLog(G::LoadTranslation('ID_CREATING_WORKSPACE', SYS_LANG, array($workspace)));
|
||||
|
||||
try {
|
||||
$db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
$this->link = @mssql_connect($db_host, $db_username, $db_password);
|
||||
$this->installLog(G::LoadTranslation('ID_CONNECT_TO_SERVER', SYS_LANG, array($db_hostname, $db_port, $db_username)));
|
||||
|
||||
$this->mssqlQuery('USE [master]');
|
||||
|
||||
// DROP databases wf_workflow, rb_workflow and rp_workflow
|
||||
if ($deleteDB) {
|
||||
$q = sprintf("IF EXISTS (SELECT name FROM sys.databases WHERE name='%s' ) DROP DATABASE %s", $wf, $wf);
|
||||
$this->mssqlQuery($q);
|
||||
}
|
||||
|
||||
// CREATE databases wf_workflow, rb_workflow and rp_workflow
|
||||
$q = sprintf("IF NOT EXISTS (SELECT * FROM sys.databases WHERE name='%s' ) CREATE DATABASE %s", $wf, $wf);
|
||||
$this->mssqlQuery($q);
|
||||
|
||||
//CREATE users and GRANT Privileges
|
||||
$wfPass = G::generate_password(15);
|
||||
$this->setGrantPrivilegesMSSQL($wf, $wfPass, $wf);
|
||||
|
||||
//Generate the db.php file and folders
|
||||
$path_site = $pathShared . "/sites/" . $workspace . "/";
|
||||
$db_file = $path_site . "db.php";
|
||||
mkdir($path_site, 0777, true);
|
||||
@mkdir($path_site . "files/", 0777, true);
|
||||
@mkdir($path_site . "mailTemplates/", 0777, true);
|
||||
@mkdir($path_site . "public/", 0777, true);
|
||||
@mkdir($path_site . "reports/", 0777, true);
|
||||
@mkdir($path_site . "xmlForms", 0777, true);
|
||||
|
||||
$dbText = "<?php\n";
|
||||
$dbText .= sprintf("// Processmaker configuration\n");
|
||||
$dbText .= sprintf(" define ('DB_ADAPTER', '%s' );\n", 'mssql');
|
||||
$dbText .= sprintf(" define ('DB_HOST', '%s' );\n", $db_host);
|
||||
$dbText .= sprintf(" define ('DB_NAME', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_USER', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_PASS', '%s' );\n", $wfPass);
|
||||
$dbText .= sprintf(" define ('DB_RBAC_HOST', '%s' );\n", $db_host);
|
||||
$dbText .= sprintf(" define ('DB_RBAC_NAME', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_RBAC_USER', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_RBAC_PASS', '%s' );\n", $wfPass);
|
||||
$dbText .= sprintf(" define ('DB_REPORT_HOST', '%s' );\n", $db_host);
|
||||
$dbText .= sprintf(" define ('DB_REPORT_NAME', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_REPORT_USER', '%s' );\n", $wf);
|
||||
$dbText .= sprintf(" define ('DB_REPORT_PASS', '%s' );\n", $wfPass);
|
||||
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
||||
$dbText .= "\n";
|
||||
$dbText .= " define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG'] : 'false')) . ");\n";
|
||||
if ($this->systemName != '') {
|
||||
$dbText .= " define ('SYSTEM_NAME', '" . $this->systemName . "');\n";
|
||||
}
|
||||
}
|
||||
|
||||
$this->installLog(G::LoadTranslation('ID_CREATING', SYS_LANG, array($db_file)));
|
||||
file_put_contents($db_file, $dbText);
|
||||
|
||||
// Generate the databases.php file
|
||||
$databases_file = $path_site . 'databases.php';
|
||||
$dbData = sprintf("\$dbAdapter = '%s';\n", 'mssql');
|
||||
$dbData .= sprintf("\$dbHost = '%s';\n", $db_host);
|
||||
$dbData .= sprintf("\$dbName = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbUser = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbPass = '%s';\n", $wfPass);
|
||||
$dbData .= sprintf("\$dbRbacHost = '%s';\n", $db_host);
|
||||
$dbData .= sprintf("\$dbRbacName = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbRbacUser = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbRbacPass = '%s';\n", $wfPass);
|
||||
$dbData .= sprintf("\$dbReportHost = '%s';\n", $db_host);
|
||||
$dbData .= sprintf("\$dbReportName = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbReportUser = '%s';\n", $wf);
|
||||
$dbData .= sprintf("\$dbReportPass = '%s';\n", $wfPass);
|
||||
$databasesText = str_replace('{dbData}', $dbData, @file_get_contents(PATH_HOME . 'engine/templates/installer/databases.tpl'));
|
||||
|
||||
$this->installLog(G::LoadTranslation('ID_CREATING', SYS_LANG, array($databases_file)));
|
||||
file_put_contents($databases_file, $databasesText);
|
||||
|
||||
//execute scripts to create and populates databases
|
||||
$query = sprintf("USE %s;", $wf);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$this->mssqlFileQuery(PATH_RBAC_HOME . 'engine/data/mssql/schema.sql');
|
||||
$this->mssqlFileQuery(PATH_RBAC_HOME . 'engine/data/mssql/insert.sql');
|
||||
|
||||
$query = sprintf("USE %s;", $wf);
|
||||
$this->mssqlQuery($query);
|
||||
$this->mssqlFileQuery(PATH_HOME . 'engine/data/mssql/schema.sql');
|
||||
$this->mssqlFileQuery(PATH_HOME . 'engine/data/mssql/insert.sql');
|
||||
|
||||
// Create the triggers
|
||||
if (file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql') && file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql') && file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql') && file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql') && file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql')) {
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql'));
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql'));
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql'));
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql'));
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . "engine/methods/setup/setupSchemas/triggerSubApplicationInsert.sql"));
|
||||
$this->mssqlQuery(@file_get_contents(PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql'));
|
||||
$this->mssqlQuery("INSERT INTO CONFIGURATION (
|
||||
CFG_UID,
|
||||
CFG_VALUE
|
||||
)
|
||||
VALUES (
|
||||
'APP_CACHE_VIEW_ENGINE',
|
||||
'" . addslashes(serialize(array('LANG' => 'en', 'STATUS' => 'active'
|
||||
))) . "'
|
||||
)");
|
||||
|
||||
$this->mssqlQuery("INSERT INTO EMAIL_SERVER(MESS_UID, MESS_ENGINE) VALUES('" . Common::generateUID() . "','MAIL')");
|
||||
}
|
||||
|
||||
//change admin user
|
||||
$query = sprintf("USE %s;", $wf);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("UPDATE USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, G::encryptHash($adminPassword));
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("USE %s;", $wf);
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
$query = sprintf("UPDATE RBAC_USERS SET USR_USERNAME = '%s', USR_PASSWORD = '%s' WHERE USR_UID = '00000000000000000000000000000001' ", $adminUsername, G::encryptHash($adminPassword));
|
||||
$this->mssqlQuery($query);
|
||||
|
||||
// Write the paths_installed.php file (contains all the information configured so far)
|
||||
if (!file_exists(FILE_PATHS_INSTALLED)) {
|
||||
$sh = G::encryptOld(filemtime(PATH_GULLIVER . '/class.g.php'));
|
||||
$h = G::encrypt($db_hostname . $sh . $db_username . $sh . $db_password . '1', $sh);
|
||||
$dbText = "<?php\n";
|
||||
$dbText .= sprintf(" define ('PATH_DATA', '%s' );\n", $pathShared);
|
||||
$dbText .= sprintf(" define ('PATH_C', '%s' );\n", $pathShared . 'compiled/');
|
||||
$dbText .= sprintf(" define ('HASH_INSTALLATION', '%s' );\n", $h);
|
||||
$dbText .= sprintf(" define ('SYSTEM_HASH', '%s' );\n", $sh);
|
||||
$this->installLog(G::LoadTranslation('ID_CREATING', SYS_LANG, array(FILE_PATHS_INSTALLED)));
|
||||
file_put_contents(FILE_PATHS_INSTALLED, $dbText);
|
||||
}
|
||||
$this->installLog(G::LoadTranslation('ID_INSTALL_SUCESS'));
|
||||
$info->result = true;
|
||||
$info->message = G::LoadTranslation('ID_INSTALL_SUCESS');
|
||||
$info->url = '/sys' . $_REQUEST['workspace'] . '/en/neoclassic/login/login';
|
||||
$info->messageFinish = G::LoadTranslation('ID_PROCESSMAKER_SUCCESS_INSTALLED', SYS_LANG, array($workspace));
|
||||
} catch (Exception $e) {
|
||||
$info->result = false;
|
||||
$info->message = $e->getMessage();
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
public function getSystemName($siteShared)
|
||||
{
|
||||
$systemName = '';
|
||||
@@ -1270,15 +965,6 @@ class InstallerModule extends Controller
|
||||
$engine->label = 'MySQL';
|
||||
$engines[] = $engine;
|
||||
}
|
||||
/**
|
||||
* DISABLED TEMPORARELY
|
||||
* if (function_exists('mssql_query')) {
|
||||
* $engine = new stdclass();
|
||||
* $engine->id = 'mssql';
|
||||
* $engine->label = 'Microsoft SQL Server';
|
||||
* $engines[] = $engine;
|
||||
* }
|
||||
*/
|
||||
return $engines;
|
||||
}
|
||||
|
||||
@@ -1304,14 +990,6 @@ class InstallerModule extends Controller
|
||||
|
||||
$info->wfDatabaseExists = count($response) > 0;
|
||||
break;
|
||||
case 'mssql':
|
||||
$link = @mssql_connect($db_hostname, $db_username, $db_password);
|
||||
$wfDatabase = $filter->validateInput($_REQUEST['wfDatabase'], 'nosql');
|
||||
$query = "select * from sys.databases where name = '%s' ";
|
||||
$query = $filter->preventSqlInjection($query, array($wfDatabase));
|
||||
$dataSet = @mssql_query($query, $link);
|
||||
$info->wfDatabaseExists = (@mssql_num_rows($dataSet) > 0);
|
||||
break;
|
||||
case 'sqlsrv':
|
||||
$arguments = array("UID" => $db_username, "PWD" => $db_password);
|
||||
$link = @sqlsrv_connect($db_hostname, $arguments);
|
||||
@@ -1378,89 +1056,6 @@ class InstallerModule extends Controller
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function test a SQL Server connection
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
private function testMSSQLConnection()
|
||||
{
|
||||
$filter = new InputFilter();
|
||||
$info = new stdClass();
|
||||
$info->result = false;
|
||||
$info->message = '';
|
||||
|
||||
if (!function_exists("mssql_connect")) {
|
||||
$info->message = G::LoadTranslation('ID_PHP_MSSQL_NOT_INSTALLED');
|
||||
return $info;
|
||||
}
|
||||
$dataRequest = $_REQUEST;
|
||||
$db_hostname = $filter->validateInput($dataRequest['db_hostname']);
|
||||
$db_port = $filter->validateInput($dataRequest['db_port']);
|
||||
$db_username = $filter->validateInput($dataRequest['db_username']);
|
||||
$db_password = urlencode($dataRequest['db_password']);
|
||||
$db_password = urldecode($filter->validateInput($db_password));
|
||||
|
||||
$fp = @fsockopen($db_hostname, $db_port, $errno, $errstr, 30);
|
||||
if (!$fp) {
|
||||
$info->message .= G::LoadTranslation('ID_CONNECTION_ERROR', SYS_LANG, array("$errstr ($errno)"));
|
||||
return $info;
|
||||
}
|
||||
\Illuminate\Support\Facades\DB::connection();
|
||||
|
||||
$db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
|
||||
$link = @mssql_connect($db_host, $db_username, $db_password);
|
||||
if (!$link) {
|
||||
$info->message .= G::LoadTranslation('ID_MYSQL_CREDENTIALS_WRONG');
|
||||
return $info;
|
||||
}
|
||||
|
||||
//checking if user has the dbcreator role
|
||||
$hasDbCreator = false;
|
||||
$hasSecurityAdmin = false;
|
||||
$hasSysAdmin = false;
|
||||
|
||||
$res = @mssql_query("EXEC sp_helpsrvrolemember 'dbcreator' ", $link);
|
||||
$row = mssql_fetch_array($res);
|
||||
while (is_array($row)) {
|
||||
if ($row['MemberName'] == $db_username) {
|
||||
$hasDbCreator = true;
|
||||
}
|
||||
$row = mssql_fetch_array($res);
|
||||
}
|
||||
mssql_free_result($res);
|
||||
|
||||
$res = @mssql_query("EXEC sp_helpsrvrolemember 'sysadmin' ", $link);
|
||||
$row = mssql_fetch_array($res);
|
||||
while (is_array($row)) {
|
||||
if ($row['MemberName'] == $db_username) {
|
||||
$hasSysAdmin = true;
|
||||
}
|
||||
$row = mssql_fetch_array($res);
|
||||
}
|
||||
mssql_free_result($res);
|
||||
|
||||
$res = @mssql_query("EXEC sp_helpsrvrolemember 'SecurityAdmin' ", $link);
|
||||
$row = mssql_fetch_array($res);
|
||||
while (is_array($row)) {
|
||||
if ($row['MemberName'] == $db_username) {
|
||||
$hasSecurityAdmin = true;
|
||||
}
|
||||
$row = mssql_fetch_array($res);
|
||||
}
|
||||
mssql_free_result($res);
|
||||
|
||||
if (!($hasSysAdmin || ($hasSecurityAdmin && $hasDbCreator))) {
|
||||
$info->message .= G::LoadTranslation('ID_CONNECTION_ERROR_SECURITYADMIN', SYS_LANG, array($db_username));
|
||||
return $info;
|
||||
}
|
||||
|
||||
$info->message .= G::LoadTranslation('ID_MSSQL_SUCCESS_CONNECT');
|
||||
$info->result = true;
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function define the partner behaviour when the PARTNER_FLAG is defined
|
||||
* Execute to change of skin
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
|
||||
class authSourceProxy extends HttpProxyController
|
||||
{
|
||||
|
||||
function testingOption ($params)
|
||||
{
|
||||
/*global $RBAC;
|
||||
$fields = array('AUTH_SOURCE_PROVIDER' => $params->optionAuthS);
|
||||
$G_PUBLISH = new Publisher();
|
||||
$data=array();
|
||||
$aCommonFields = array('AUTH_SOURCE_UID',
|
||||
'AUTH_SOURCE_NAME',
|
||||
'AUTH_SOURCE_PROVIDER',
|
||||
'AUTH_SOURCE_SERVER_NAME',
|
||||
'AUTH_SOURCE_PORT',
|
||||
'AUTH_SOURCE_ENABLED_TLS',
|
||||
'AUTH_ANONYMOUS',
|
||||
'AUTH_SOURCE_SEARCH_USER',
|
||||
'AUTH_SOURCE_PASSWORD',
|
||||
'AUTH_SOURCE_VERSION',
|
||||
'AUTH_SOURCE_BASE_DN',
|
||||
'AUTH_SOURCE_OBJECT_CLASSES',
|
||||
'AUTH_SOURCE_ATTRIBUTES');
|
||||
$aFields = $aData = array();
|
||||
|
||||
unset($params->PHPSESSID);
|
||||
foreach ($params as $sField => $sValue) {
|
||||
if (in_array($sField, $aCommonFields)) {
|
||||
$aFields[$sField] = (($sField=='AUTH_SOURCE_ENABLED_TLS' || $sField=='AUTH_ANONYMOUS'))? ($sValue=='yes')?1:0 :$sValue;
|
||||
}
|
||||
else {
|
||||
$aData[$sField] = $sValue;
|
||||
}
|
||||
}
|
||||
$aFields['AUTH_SOURCE_DATA'] = $aData;
|
||||
if (isset($aFields['AUTH_SOURCE_UID']) && $aFields['AUTH_SOURCE_UID'] != '') {
|
||||
$RBAC->updateAuthSource($aFields);
|
||||
}
|
||||
else {
|
||||
$aAuth = $RBAC->createAuthSource($aFields);
|
||||
}*/
|
||||
//G::pr($aAuth);die;
|
||||
$data['success'] = true;
|
||||
$data['optionAuthS'] = $params->optionAuthS;
|
||||
//$data['sUID'] = $aAuth;
|
||||
return $data;
|
||||
}
|
||||
|
||||
function saveAuthSources ($params)
|
||||
{
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
$aCommonFields = array ('AUTH_SOURCE_UID','AUTH_SOURCE_NAME','AUTH_SOURCE_PROVIDER','AUTH_SOURCE_SERVER_NAME','AUTH_SOURCE_PORT','AUTH_SOURCE_ENABLED_TLS','AUTH_ANONYMOUS','AUTH_SOURCE_SEARCH_USER','AUTH_SOURCE_PASSWORD','AUTH_SOURCE_VERSION','AUTH_SOURCE_BASE_DN','AUTH_SOURCE_OBJECT_CLASSES','AUTH_SOURCE_ATTRIBUTES');
|
||||
|
||||
$aFields = $aData = array ();
|
||||
|
||||
unset( $params->PHPSESSID );
|
||||
foreach ($params as $sField => $sValue) {
|
||||
if (in_array( $sField, $aCommonFields )) {
|
||||
$aFields[$sField] = (($sField == 'AUTH_SOURCE_ENABLED_TLS' || $sField == 'AUTH_ANONYMOUS')) ? ($sValue == 'yes') ? 1 : 0 : $sValue;
|
||||
} else {
|
||||
$aData[$sField] = $sValue;
|
||||
}
|
||||
}
|
||||
$aFields['AUTH_SOURCE_DATA'] = $aData;
|
||||
if ($aFields['AUTH_SOURCE_UID'] == '') {
|
||||
$RBAC->createAuthSource( $aFields );
|
||||
} else {
|
||||
$RBAC->updateAuthSource( $aFields );
|
||||
}
|
||||
$data = array ();
|
||||
$data['success'] = true;
|
||||
return $data;
|
||||
} //end saveAuthSoruces function
|
||||
} //end authSourceProxy class
|
||||
|
||||
@@ -325,7 +325,6 @@ class Home extends Controller
|
||||
// settings vars and rendering
|
||||
$this->setVar('statusValues', $this->getStatusArray($httpData->t, $this->userUid));
|
||||
$this->setVar('categoryValues', $this->getCategoryArray());
|
||||
$this->setVar('allUsersValues', $this->getAllUsersArray('search'));
|
||||
$this->setVar('categoryTitle', G::LoadTranslation("ID_CATEGORY"));
|
||||
$this->setVar('processTitle', G::LoadTranslation("ID_PROCESS"));
|
||||
$this->setVar('statusTitle', G::LoadTranslation("ID_STATUS"));
|
||||
@@ -683,34 +682,6 @@ class Home extends Controller
|
||||
return $category;
|
||||
}
|
||||
|
||||
public function getAllUsersArray($action)
|
||||
{
|
||||
global $oAppCache;
|
||||
$users = array();
|
||||
$users[] = array("CURRENT_USER",G::LoadTranslation("ID_CURRENT_USER"));
|
||||
$users[] = array("",G::LoadTranslation("ID_ALL_USERS"));
|
||||
|
||||
if ($action == 'to_reassign') {
|
||||
//now get users, just for the Search action
|
||||
$cUsers = $oAppCache->getToReassignListCriteria(null);
|
||||
$cUsers->addSelectColumn(AppCacheViewPeer::USR_UID);
|
||||
|
||||
if (g::MySQLSintaxis()) {
|
||||
$cUsers->addGroupByColumn(AppCacheViewPeer::USR_UID);
|
||||
}
|
||||
|
||||
$cUsers->addAscendingOrderByColumn(AppCacheViewPeer::APP_CURRENT_USER);
|
||||
$oDataset = AppCacheViewPeer::doSelectRS($cUsers);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
public function getStatusArray($action, $userUid)
|
||||
{
|
||||
$status = array();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
# Sqlfile -> Database map
|
||||
schema.sql=workflow
|
||||
@@ -1,140 +0,0 @@
|
||||
/**
|
||||
* Reassign ByUser routines
|
||||
* Author Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
|
||||
var reassignPanel;
|
||||
|
||||
function toReassignPanel(){
|
||||
if( checks_selected_ids.length == 0 ){
|
||||
new leimnud.module.app.alert().make({label: G_STRINGS.ID_REASSIGN_BYUSER});
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*oPanel = new leimnud.module.panel();
|
||||
oPanel.options = {
|
||||
size : { w:1000, h:600 },
|
||||
position: { x:0,y:0,center:true },
|
||||
title : G_STRINGS.ID_MSG_RESSIGN_BYUSER_PANEL,
|
||||
statusBar: false,
|
||||
control : {resize:false,roll:false,drag:true},
|
||||
fx : { modal:true, opacity:true, blinkToFront:false, fadeIn:false, drag:true}
|
||||
};
|
||||
oPanel.events = {
|
||||
remove: function() {
|
||||
delete(oPanel);
|
||||
//resetChecks();
|
||||
//window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
|
||||
}.extend(this)
|
||||
};*/
|
||||
//oPanel.make();
|
||||
//oPanel.loader.show();
|
||||
|
||||
var USER_SELETED = getField('REASSIGN_USER').value;
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'cases_Ajax',
|
||||
args: 'action=reassignByUserList&APP_UIDS='+checks_selected_ids+'&FROM_USR_ID='+USER_SELETED
|
||||
});
|
||||
oRPC.callback = function(rpc) {
|
||||
//oPanel.loader.hide();
|
||||
//var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
//oPanel.addContent(rpc.xmlhttp.responseText);
|
||||
//scs.evalScript();
|
||||
document.getElementById("publisherContent[0]").style.display = 'none';
|
||||
document.getElementById("publisherContent[1]").style.display = 'none';
|
||||
document.getElementById("publisherContent[10]").style.display = 'block';
|
||||
document.getElementById("publisherContent[10]").innerHTML = rpc.xmlhttp.responseText;
|
||||
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
|
||||
//reassignPanel = oPanel;
|
||||
}
|
||||
|
||||
function toReassign(){
|
||||
var selects = document.getElementsByName('form[USERS]');
|
||||
var USER_SELETED = getField('REASSIGN_USER').value;
|
||||
var items = '';
|
||||
for(i=0; i<selects.length; i++){
|
||||
if( selects[i].value != "0" ){
|
||||
if( items != '') items += ',';
|
||||
id = selects[i].id;
|
||||
id = id.trim();
|
||||
items += selects[i].id.substring(5, selects[i].id.length-1) +'|'+ selects[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
if( items.trim() == '' ){
|
||||
new leimnud.module.app.alert().make({label: G_STRINGS.ID_REASSIGN_BYUSER});
|
||||
return 0;
|
||||
}
|
||||
|
||||
new leimnud.module.app.confirm().make({
|
||||
label:G_STRINGS.ID_REASSIGN_BYUSER_CONFIRM,
|
||||
action:function(){
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'cases_Ajax',
|
||||
args: 'action=reassignByUser&items='+items+'&USR_UID='+USER_SELETED
|
||||
});
|
||||
//reassignPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
//reassignPanel.loader.hide();
|
||||
//reassignPanel.clearContent();
|
||||
/*reassignPanel.events = {
|
||||
remove: function() {
|
||||
delete(oPanel);
|
||||
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
|
||||
}.extend(this)
|
||||
};*/
|
||||
var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
//reassignPanel.addContent(rpc.xmlhttp.responseText);
|
||||
document.getElementById("publisherContent[10]").innerHTML = rpc.xmlhttp.responseText;
|
||||
scs.evalScript();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
|
||||
}.extend(this)
|
||||
});
|
||||
}
|
||||
|
||||
function cancelReassign(){
|
||||
document.getElementById("publisherContent[0]").style.display = 'block';
|
||||
document.getElementById("publisherContent[1]").style.display = 'block';
|
||||
document.getElementById("publisherContent[10]").style.display = 'none';
|
||||
document.getElementById("publisherContent[10]").innerHTML = '';
|
||||
}
|
||||
|
||||
function resetChecks(){
|
||||
checks_selected_ids.length = 0;
|
||||
}
|
||||
|
||||
|
||||
function WindowSize() {
|
||||
var wSize = [0, 0];
|
||||
if (typeof window.innerWidth != 'undefined')
|
||||
{
|
||||
wSize = [
|
||||
window.innerWidth,
|
||||
window.innerHeight
|
||||
];
|
||||
}
|
||||
else if (typeof document.documentElement != 'undefined'
|
||||
&& typeof document.documentElement.clientWidth !=
|
||||
'undefined' && document.documentElement.clientWidth != 0)
|
||||
{
|
||||
wSize = [
|
||||
document.documentElement.clientWidth,
|
||||
document.documentElement.clientHeight
|
||||
];
|
||||
}
|
||||
else {
|
||||
wSize = [
|
||||
document.getElementsByTagName('body')[0].clientWidth,
|
||||
document.getElementsByTagName('body')[0].clientHeight
|
||||
];
|
||||
}
|
||||
return wSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -438,6 +438,7 @@ class Ajax
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistory', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistory'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
$oHeadPublisher->assign('FORMATS', $conf->getFormats());
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
|
||||
@@ -116,8 +116,7 @@ if ($action == 'selfservice') {
|
||||
}
|
||||
|
||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
$oAppCache = new AppCacheView();
|
||||
$oAppCache->confCasesList = $confCasesList;
|
||||
|
||||
$solrEnabled = 0;
|
||||
if ($action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" ||
|
||||
$action == "unassigned" || $action == "search") {
|
||||
|
||||
@@ -888,42 +888,6 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser2', 'cases/cases_ToReassignByUserList2', $oCriteria);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
|
||||
case 'reassignByUser':
|
||||
|
||||
$oCases = new Cases();
|
||||
$aCases = array();
|
||||
|
||||
if (isset($_POST['items']) && trim($_POST['items']) != '') {
|
||||
$sItems = $_POST['items'];
|
||||
$aItems = explode(',', $sItems);
|
||||
$FROM_USR_UID = $_POST['USR_UID'];
|
||||
|
||||
foreach ($aItems as $item) {
|
||||
list($APP_UID, $USR_UID) = explode('|', $item);
|
||||
$aCase = $oCases->loadCaseInCurrentDelegation($APP_UID, true);
|
||||
$oCase->reassignCase($aCase['APP_UID'], $aCase['DEL_INDEX'], $FROM_USR_UID, $USR_UID);
|
||||
array_push($aCases, $aCase);
|
||||
}
|
||||
//G::pr($aCases);
|
||||
|
||||
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$sText = '';
|
||||
foreach ($aCases as $aCase) {
|
||||
$aCaseUpdated = $oCases->loadCaseInCurrentDelegation($aCase['APP_UID'], true);
|
||||
$aUser = $oUser->load($aCaseUpdated['USR_UID']);
|
||||
$sText .= $aCaseUpdated['APP_PRO_TITLE'] . ' - ' . ' Case: ' . $aCaseUpdated['APP_NUMBER'] . '# (' . $aCaseUpdated['APP_TAS_TITLE'] . ') <b> => Reassigned to => </b> <font color="blue">' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' [' . $aUser['USR_USERNAME'] . ']' . '</font><br />';
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $sText;
|
||||
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage);
|
||||
G::RenderPage('publish', 'raw');
|
||||
}
|
||||
break;
|
||||
case "uploadInputDocument":
|
||||
//krumo($_POST);
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_ReassignByUser.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reassign ByUser routines
|
||||
* Author Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
|
||||
try {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (! isset($_GET['REASSIGN_USER'])) {
|
||||
$_GET['REASSIGN_USER'] = '';
|
||||
}
|
||||
$_GET['REASSIGN_BY'] = 2;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
//////////////////
|
||||
///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'//////
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, '', Criteria::NOT_EQUAL);
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
///////////////////////
|
||||
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
|
||||
|
||||
$defaultOption = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
|
||||
$aUserInfo = array();
|
||||
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char'
|
||||
);
|
||||
while ($oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
$infoUser = G::getFormatUserList($defaultOption, $aRow1);
|
||||
$aUserInfo[] = array('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['aUserInfo'] = $aUserInfo;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
//////////////////
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET);
|
||||
|
||||
$sUserToReassign = trim($_GET['REASSIGN_USER']);
|
||||
|
||||
if ($_GET['REASSIGN_USER'] != '') {
|
||||
$oTasks = new Tasks();
|
||||
$oGroups = new Groups();
|
||||
$oUser = new Users();
|
||||
|
||||
$oAppCache = new AppCacheView();
|
||||
|
||||
$oCriteriaToDo = $oAppCache->getToDoListCriteria($sUserToReassign);
|
||||
$oCriteriaDraft = $oAppCache->getDraftListCriteria($sUserToReassign);
|
||||
|
||||
$aCasesList = array();
|
||||
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($oDataset->next()) {
|
||||
array_push($aCasesList, $oDataset->getRow());
|
||||
}
|
||||
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($oDataset->next()) {
|
||||
array_push($aCasesList, $oDataset->getRow());
|
||||
}
|
||||
|
||||
$filedNames = array("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER"
|
||||
);
|
||||
|
||||
$aCasesList = array_merge(array($filedNames
|
||||
), $aCasesList);
|
||||
|
||||
// G::pr($aCasesList); die;
|
||||
|
||||
|
||||
require_once('classes/class.xmlfield_InputPM.php');
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reassign_byuser'] = $aCasesList;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reassign_byuser');
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/cases/reassignByUser.js');
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, array('FROM_USR_UID' => $sUserToReassign
|
||||
));
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'blank');
|
||||
} catch (Exception $oException) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($oException, $token);
|
||||
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)));
|
||||
die;
|
||||
}
|
||||
?>
|
||||
<div id="publisherContent[10]" style="display: none"></div>
|
||||
|
||||
<?php
|
||||
@@ -1,49 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* cases_Resume.php
|
||||
*
|
||||
* Shows a brief information about the case
|
||||
*
|
||||
* @link https://wiki.processmaker.com/3.2/Cases/Cases#Participated
|
||||
*/
|
||||
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
use ProcessMaker\BusinessModel\Task as BusinessModelTask;
|
||||
use ProcessMaker\Util\DateTime;
|
||||
|
||||
/* Permissions */
|
||||
/** Permissions */
|
||||
switch ($RBAC->userCanAccess('PM_CASES')) {
|
||||
case - 2:
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Menues */
|
||||
/** Menu's */
|
||||
$_SESSION['bNoShowSteps'] = true;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
|
||||
/* Prepare page before to show */
|
||||
$oCase = new Cases();
|
||||
//Check the authorization
|
||||
$objCase = new \ProcessMaker\BusinessModel\Cases();
|
||||
$aUserCanAccess = $objCase->userAuthorization(
|
||||
/** Prepare page before to show */
|
||||
// Check the authorization
|
||||
$objCase = new BmCases();
|
||||
$userCanAccess = $objCase->userAuthorization(
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$_SESSION['PROCESS'],
|
||||
$_GET['APP_UID'],
|
||||
array('PM_ALLCASES'),
|
||||
array('SUMMARY_FORM' => 'VIEW')
|
||||
['PM_ALLCASES'],
|
||||
['SUMMARY_FORM' => 'VIEW']
|
||||
);
|
||||
|
||||
$cases = new Cases();
|
||||
if (isset($_SESSION['ACTION']) && ($_SESSION['ACTION'] == 'jump')) {
|
||||
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['ACTION']);
|
||||
$Fields = $cases->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['ACTION']);
|
||||
$process = new Process();
|
||||
$processData = $process->load($Fields['PRO_UID']);
|
||||
if (isset($processData['PRO_DYNAFORMS']['PROCESS']) && $processData['PRO_DYNAFORMS']['PROCESS'] != '' &&
|
||||
$aUserCanAccess['objectPermissions']['SUMMARY_FORM']
|
||||
$userCanAccess['objectPermissions']['SUMMARY_FORM']
|
||||
) {
|
||||
$_REQUEST['APP_UID'] = $Fields['APP_UID'];
|
||||
$_REQUEST['DEL_INDEX'] = $Fields['DEL_INDEX'];
|
||||
@@ -52,35 +59,30 @@ if (isset($_SESSION['ACTION']) && ($_SESSION['ACTION'] == 'jump')) {
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
$Fields = $cases->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
}
|
||||
|
||||
if (!$aUserCanAccess['participated'] && !$aUserCanAccess['supervisor'] && !$aUserCanAccess['rolesPermissions']['PM_ALLCASES'] && !$aUserCanAccess['objectPermissions']['SUMMARY_FORM']) {
|
||||
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||
if (
|
||||
!$userCanAccess['participated'] &&
|
||||
!$userCanAccess['supervisor'] &&
|
||||
!$userCanAccess['rolesPermissions']['PM_ALLCASES'] &&
|
||||
!$userCanAccess['objectPermissions']['SUMMARY_FORM']
|
||||
) {
|
||||
$message = [];
|
||||
$message['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $message);
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
die();
|
||||
}
|
||||
if (isset($aRow['APP_TYPE'])) {
|
||||
switch ($aRow['APP_TYPE']) {
|
||||
case 'PAUSE':
|
||||
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_PAUSED')));
|
||||
break;
|
||||
case 'CANCEL':
|
||||
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_CANCELLED')));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$actions = 'false';
|
||||
if (isset($_GET['action']) && $_GET['action'] == 'paused') {
|
||||
$actions = 'true';
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
/** Render page */
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addScriptCode("
|
||||
if (typeof parent != 'undefined') {
|
||||
if (parent.showCaseNavigatorPanel) {
|
||||
@@ -103,11 +105,11 @@ $oHeadPublisher->addScriptCode('
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load($Fields['PRO_UID']);
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
$processFields = $objProc->load($Fields['PRO_UID']);
|
||||
$Fields['PRO_TITLE'] = $processFields['PRO_TITLE'];
|
||||
|
||||
$objTask = new Task();
|
||||
if (!isset($Fields['TAS_UID']) || $Fields['TAS_UID'] == '') {
|
||||
if (!isset($Fields['TAS_UID']) || empty($Fields['TAS_UID'])) {
|
||||
$Fields['TAS_UID'] = $Fields['APP_DATA']['TASK'];
|
||||
}
|
||||
|
||||
@@ -118,12 +120,12 @@ $tasksInParallel = array_filter($tasksInParallel, function ($value) {
|
||||
$nTasksInParallel = count($tasksInParallel);
|
||||
|
||||
if ($nTasksInParallel > 1) {
|
||||
$aTask = $objTask->load($tasksInParallel[$nTasksInParallel - 1]);
|
||||
$taskInfo = $objTask->load($tasksInParallel[$nTasksInParallel - 1]);
|
||||
} else {
|
||||
$aTask = $objTask->load($Fields['TAS_UID']);
|
||||
$taskInfo = $objTask->load($Fields['TAS_UID']);
|
||||
}
|
||||
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
$Fields['TAS_TITLE'] = $taskInfo['TAS_TITLE'];
|
||||
$Fields = DateTime::convertUtcToTimeZone($Fields);
|
||||
|
||||
$objUser = new Users();
|
||||
@@ -153,9 +155,9 @@ if ($Fields['APP_STATUS'] != 'COMPLETED') {
|
||||
}
|
||||
}
|
||||
$FieldsPar['DEL_DELEGATE_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_DELEGATE_DATE']);
|
||||
$FieldsPar['DEL_INIT_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_INIT_DATE']);
|
||||
$FieldsPar['DEL_INIT_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_INIT_DATE']);
|
||||
$FieldsPar['DEL_TASK_DUE_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_TASK_DUE_DATE']);
|
||||
$FieldsPar['DEL_FINISH_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_FINISH_DATE']);
|
||||
$FieldsPar['DEL_FINISH_DATE'] = DateTime::convertUtcToTimeZone($row['DEL_FINISH_DATE']);
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Resume_Current_Task.xml', '', $FieldsPar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_UsersReassign.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 {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
|
||||
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;
|
||||
}
|
||||
$oCase = new Cases();
|
||||
$aCases = array ();
|
||||
$aUsers = array ();
|
||||
if (isset( $_POST['USERS'] ) && is_array( $_POST['USERS'] )) {
|
||||
foreach ($_POST['USERS'] as $sKey => $sUser) {
|
||||
if ($sUser != '') {
|
||||
$oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
|
||||
$aCases[] = $_POST['APPLICATIONS'][$sKey];
|
||||
$aUsers[] = $sUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
$oCase = new Cases();
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$sText = '';
|
||||
foreach ($aCases as $sKey => $sCase) {
|
||||
$aCase = $oCase->loadCase( $sCase );
|
||||
$aUser = $oUser->load( $aUsers[$sKey] );
|
||||
$sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
|
||||
}
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $sText;
|
||||
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage );
|
||||
G::RenderPage( 'publish' );
|
||||
} catch (Exception $oException) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($oException, $token);
|
||||
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
|
||||
die;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ switch ($request) {
|
||||
$e[] = $o->getNode( $element );
|
||||
}
|
||||
|
||||
$o->__cloneEmpty();
|
||||
$o->cloneEmpty();
|
||||
|
||||
foreach ($e as $e1) {
|
||||
$o->setNode( $e1 );
|
||||
|
||||
@@ -15,7 +15,7 @@ set_include_path(PATH_PM_ENTERPRISE . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
class enterprisePlugin extends PMPlugin
|
||||
{
|
||||
public function enterprisePlugin($sNamespace, $sFilename = null)
|
||||
public function __construct($sNamespace, $sFilename = null)
|
||||
{
|
||||
$pathPluginTrunk = PATH_CORE . "enterprise";
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* messages_List.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 (($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 = 'MESSAGES';
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
|
||||
//Hardcode: UID of the library by default
|
||||
$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" );
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$uid = $_SERVER['QUERY_STRING'];
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aFields = $oOutputDocument->load( $uid );
|
||||
$type = $aFields['OUT_DOC_TYPE'];
|
||||
|
||||
if ($type == 'JRXML') {
|
||||
$extension = 'jrxml';
|
||||
}
|
||||
if ($type == 'ACROFORM') {
|
||||
$extension = 'pdf';
|
||||
}
|
||||
|
||||
$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 );
|
||||
|
||||
@@ -86,31 +86,6 @@ try {
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
die();
|
||||
break;
|
||||
case 'JRXML':
|
||||
break;
|
||||
case 'ACROFORM':
|
||||
$type = $aFields['OUT_DOC_TYPE'];
|
||||
if ($type == 'JRXML') {
|
||||
$extension = 'jrxml';
|
||||
}
|
||||
if ($type == 'ACROFORM') {
|
||||
$extension = 'pdf';
|
||||
}
|
||||
|
||||
// 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;
|
||||
$filename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension;
|
||||
if (file_exists( $filename )) {
|
||||
$aFields['FILENAME'] = $downFileName;
|
||||
} else {
|
||||
$aFields['FILENAME'] = '';
|
||||
}
|
||||
|
||||
$aFields['FILELINK'] = '../outputdocs/downloadFile?' . $aFields['OUT_DOC_UID'];
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocsUploadFile', '', $aFields, '../outputdocs/uploadFile' );
|
||||
$G_PUBLISH->AddContent( 'view', 'outputdocs/editJrxml' );
|
||||
break;
|
||||
}
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
} catch (Exception $oException) {
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* outputdocs_List.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 (($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';
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$Fields = array ('SYS_LANG' => SYS_LANG);
|
||||
|
||||
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'outputdocs/outputdocs_List', '', $Fields, 'outputdocs_Save' );
|
||||
|
||||
G::RenderPage( "publish" );
|
||||
|
||||
@@ -1,25 +1,31 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_DELETE_PROCESS_CASES', 'PM_FACTORY' );
|
||||
$resp = new StdClass();
|
||||
try {
|
||||
$uids = explode(',', $_POST['PRO_UIDS']);
|
||||
$oProcess = new Process();
|
||||
foreach ($uids as $uid) {
|
||||
$oProcess->deleteProcessCases($uid);
|
||||
}
|
||||
$oProcess->refreshUserAllCountersByProcessesGroupUid($uids);
|
||||
|
||||
$resp->status = true;
|
||||
$resp->msg = G::LoadTranslation('ID_ALL_RECORDS_DELETED_SUCESSFULLY');
|
||||
|
||||
echo G::json_encode($resp);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$resp->status = false;
|
||||
$resp->msg = $e->getMessage();
|
||||
$resp->trace = $e->getTraceAsString();
|
||||
echo G::json_encode($resp);
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* processes_DeleteCases.php
|
||||
*
|
||||
* Deleting all Cases of a Process
|
||||
*
|
||||
* @link https://wiki.processmaker.com/3.2/Processes#Deleting_all_Cases_of_a_Process
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions('PM_DELETE_PROCESS_CASES', 'PM_FACTORY');
|
||||
$resp = new stdClass();
|
||||
try {
|
||||
$uids = explode(',', $_POST['PRO_UIDS']);
|
||||
$process = new Process();
|
||||
foreach ($uids as $uid) {
|
||||
$process->deleteProcessCases($uid);
|
||||
}
|
||||
|
||||
$resp->status = true;
|
||||
$resp->msg = G::LoadTranslation('ID_ALL_RECORDS_DELETED_SUCESSFULLY');
|
||||
|
||||
echo G::json_encode($resp);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$resp->status = false;
|
||||
$resp->msg = $e->getMessage();
|
||||
$resp->trace = $e->getTraceAsString();
|
||||
echo G::json_encode($resp);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ require_once ("CURLMessage.php");
|
||||
class FormatedMessage extends CURLMessage
|
||||
{
|
||||
|
||||
public function FormatedMessage ()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class JsonMessage extends FormatedMessage
|
||||
/**
|
||||
* Call the parent Curl initialization and set the type of the message
|
||||
*/
|
||||
public function JsonMessage ()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->type = "json";
|
||||
|
||||
@@ -22,7 +22,7 @@ class RestMessage extends SimpleMessage
|
||||
/**
|
||||
* Call the parent Curl initialization and set the type of the message
|
||||
*/
|
||||
public function RestMessage ()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->type = "rest";
|
||||
|
||||
@@ -19,7 +19,7 @@ require_once ("CURLMessage.php");
|
||||
class SimpleMessage extends CURLMessage
|
||||
{
|
||||
|
||||
public function SimpleMessage ()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class XmlMessage extends FormatedMessage
|
||||
/**
|
||||
* Call the parent Curl initialization and set the type of the message
|
||||
*/
|
||||
public function XmlMessage ()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->type = "xml";
|
||||
|
||||
@@ -36,7 +36,6 @@ switch ($option) {
|
||||
|
||||
$oHeadPublisher->assign("SYSINFO_PHP", "\"" . $systemInfo->php->version . "\", " . (($systemInfo->php->result)? 1 : 0));
|
||||
$oHeadPublisher->assign("SYSINFO_MYSQL", "\"" . $systemInfo->mysql->version . "\", " . (($systemInfo->mysql->result)? 1 : 0));
|
||||
$oHeadPublisher->assign("SYSINFO_MSSQL", "\"" . $systemInfo->mssql->version . "\", " . (($systemInfo->mssql->result)? 1 : 0));
|
||||
$oHeadPublisher->assign("SYSINFO_CURL", "\"" . $systemInfo->curl->version . "\", " . (($systemInfo->curl->result)? 1 : 0));
|
||||
$oHeadPublisher->assign("SYSINFO_OPENSSL", "\"" . $systemInfo->openssl->version . "\", " . (($systemInfo->openssl->result)? 1 : 0));
|
||||
$oHeadPublisher->assign("SYSINFO_DOMXML", "\"" . $systemInfo->dom->version . "\", " . (($systemInfo->dom->result)? 1 : 0));
|
||||
|
||||
@@ -76,20 +76,20 @@ try {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var pb=leimnud.dom.capture("tag.body 0");
|
||||
Sm=new stagesmap();
|
||||
Sm.options = {
|
||||
target : "sm_target",
|
||||
dataServer: "../tracker/tracker_Ajax",
|
||||
uid : "' . $_POST['PRO_UID'] . '",
|
||||
lang : "' . SYS_LANG . '",
|
||||
theme : "processmaker",
|
||||
size : {w:"780",h:"540"},
|
||||
images_dir: "/jscore/processmap/core/images/",
|
||||
rw : true,
|
||||
hideMenu : false
|
||||
};
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var pb=leimnud.dom.capture("tag.body 0");
|
||||
Sm=new stagesmap();
|
||||
Sm.options = {
|
||||
target : "sm_target",
|
||||
dataServer: "../tracker/tracker_Ajax",
|
||||
uid : "' . $_POST['PRO_UID'] . '",
|
||||
lang : "' . SYS_LANG . '",
|
||||
theme : "processmaker",
|
||||
size : {w:"780",h:"540"},
|
||||
images_dir: "/jscore/processmap/core/images/",
|
||||
rw : true,
|
||||
hideMenu : false
|
||||
};
|
||||
Sm.make();');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
@@ -197,13 +197,13 @@ try {
|
||||
break;
|
||||
case 'load':
|
||||
$oConnection = Propel::getConnection('workflow');
|
||||
$oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` (
|
||||
`STG_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ( `STG_UID` )
|
||||
$oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` (
|
||||
`STG_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
|
||||
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ( `STG_UID` )
|
||||
);");
|
||||
$oStatement->executeQuery();
|
||||
/**
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
<?php
|
||||
if (isset( $_POST['form'] ))
|
||||
<?php
|
||||
if (isset( $_POST['form'] ))
|
||||
$sValue = $_POST['form']; //For old processmap
|
||||
else
|
||||
$sValue = $_POST;
|
||||
|
||||
unset( $sValue['SAVE'] );
|
||||
if (! isset( $sValue['CT_DERIVATION_HISTORY'] )) {
|
||||
$sValue['CT_DERIVATION_HISTORY'] = 0;
|
||||
}
|
||||
if (! isset( $sValue['CT_MESSAGE_HISTORY'] )) {
|
||||
$sValue['CT_MESSAGE_HISTORY'] = 0;
|
||||
}
|
||||
require_once 'classes/model/CaseTracker.php';
|
||||
$oCaseTracker = new CaseTracker();
|
||||
$oCaseTracker->update( $sValue );
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($sValue['PRO_UID']);
|
||||
|
||||
if($sValue['CT_DERIVATION_HISTORY'] == 1) {
|
||||
$type[] = "Routing History";
|
||||
}
|
||||
if($sValue['CT_MESSAGE_HISTORY'] == 1) {
|
||||
$type[] = "Messages History";
|
||||
}
|
||||
G::auditLog('CaseTrackers','Save Case Tracker Properties ('.$sValue['CT_MAP_TYPE'].' - '.implode(', ',$type).') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
else
|
||||
$sValue = $_POST;
|
||||
|
||||
unset( $sValue['SAVE'] );
|
||||
if (! isset( $sValue['CT_DERIVATION_HISTORY'] )) {
|
||||
$sValue['CT_DERIVATION_HISTORY'] = 0;
|
||||
}
|
||||
if (! isset( $sValue['CT_MESSAGE_HISTORY'] )) {
|
||||
$sValue['CT_MESSAGE_HISTORY'] = 0;
|
||||
}
|
||||
require_once 'classes/model/CaseTracker.php';
|
||||
$oCaseTracker = new CaseTracker();
|
||||
$oCaseTracker->update( $sValue );
|
||||
|
||||
$infoProcess = new Process();
|
||||
$resultProcess = $infoProcess->load($sValue['PRO_UID']);
|
||||
|
||||
if($sValue['CT_DERIVATION_HISTORY'] == 1) {
|
||||
$type[] = "Routing History";
|
||||
}
|
||||
if($sValue['CT_MESSAGE_HISTORY'] == 1) {
|
||||
$type[] = "Messages History";
|
||||
}
|
||||
G::auditLog('CaseTrackers','Save Case Tracker Properties ('.$sValue['CT_MAP_TYPE'].' - '.implode(', ',$type).') in Process "'.$resultProcess['PRO_TITLE'].'"');
|
||||
|
||||
@@ -1,82 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* tracker_ShowDocument.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.
|
||||
*/
|
||||
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
<?php
|
||||
/**
|
||||
* tracker_ShowDocument.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.
|
||||
*/
|
||||
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
if (! isset( $_GET['v'] )) { //Load last version of the document
|
||||
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
|
||||
} else {
|
||||
$docVersion = $_GET['v'];
|
||||
}
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = $info['extension'];
|
||||
|
||||
if (isset( $_GET['b'] )) {
|
||||
if ($_GET['b'] == '0') {
|
||||
$bDownload = false;
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
|
||||
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
|
||||
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
}
|
||||
|
||||
if (! $sw_file_exists) {
|
||||
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'failure';
|
||||
$res['message'] = $error_message;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'success';
|
||||
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
|
||||
}
|
||||
}
|
||||
|
||||
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
|
||||
} else {
|
||||
$docVersion = $_GET['v'];
|
||||
}
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = $info['extension'];
|
||||
|
||||
if (isset( $_GET['b'] )) {
|
||||
if ($_GET['b'] == '0') {
|
||||
$bDownload = false;
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
|
||||
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
|
||||
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/' . $sAppDocUid . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
}
|
||||
|
||||
if (! $sw_file_exists) {
|
||||
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'failure';
|
||||
$res['message'] = $error_message;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'success';
|
||||
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_ShowOutputDocument.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.
|
||||
*/
|
||||
<?php
|
||||
/**
|
||||
* cases_ShowOutputDocument.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.
|
||||
*/
|
||||
/*
|
||||
* Created on 13-02-2008
|
||||
*
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
if (! isset( $_GET['ext'] )) {
|
||||
$ext = $info['extension'];
|
||||
} else {
|
||||
if ($_GET['ext'] != '') {
|
||||
$ext = $_GET['ext'];
|
||||
} else {
|
||||
$ext = $info['extension'];
|
||||
}
|
||||
}
|
||||
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
|
||||
|
||||
*/
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
if (! isset( $_GET['ext'] )) {
|
||||
$ext = $info['extension'];
|
||||
} else {
|
||||
if ($_GET['ext'] != '') {
|
||||
$ext = $_GET['ext'];
|
||||
} else {
|
||||
$ext = $info['extension'];
|
||||
}
|
||||
}
|
||||
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
|
||||
|
||||
if (! $ver) //This code is in the case the outputdocument won't be versioned
|
||||
$ver = '_1';
|
||||
|
||||
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
|
||||
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
|
||||
$realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
} elseif (file_exists( $realPath2 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath2;
|
||||
}
|
||||
if (! $sw_file_exists) {
|
||||
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'failure';
|
||||
$res['message'] = $error_message;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'success';
|
||||
$res['message'] = $info['basename'] . $ver . '.' . $ext;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
|
||||
}
|
||||
}
|
||||
//G::streamFile ( $realPath, true);
|
||||
|
||||
$ver = '_1';
|
||||
|
||||
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
|
||||
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
|
||||
$realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
} elseif (file_exists( $realPath2 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath2;
|
||||
}
|
||||
if (! $sw_file_exists) {
|
||||
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'failure';
|
||||
$res['message'] = $error_message;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'success';
|
||||
$res['message'] = $info['basename'] . $ver . '.' . $ext;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
|
||||
}
|
||||
}
|
||||
//G::streamFile ( $realPath, true);
|
||||
|
||||
@@ -11,6 +11,7 @@ use AppDelegationPeer;
|
||||
use AppDocument;
|
||||
use AppDocumentPeer;
|
||||
use AppHistoryPeer;
|
||||
use Application;
|
||||
use ApplicationPeer;
|
||||
use Applications;
|
||||
use AppNotesPeer;
|
||||
@@ -45,7 +46,6 @@ use ProcessMaker\Services\OAuth2\Server;
|
||||
use ProcessMaker\Util\DateTime as UtilDateTime;
|
||||
use ProcessMaker\Validation\ExceptionRestApi;
|
||||
use ProcessMaker\Validation\Validator as FileValidator;
|
||||
|
||||
use ProcessPeer;
|
||||
use ProcessUser;
|
||||
use ProcessUserPeer;
|
||||
@@ -3317,6 +3317,7 @@ class Cases
|
||||
* @param array $objectPermissions, the permissions that we need to review
|
||||
* @param boolean $objectSupervisor, if we need to get all the objects supervisor
|
||||
* @param string $tasUid
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function userAuthorization(
|
||||
@@ -3330,23 +3331,21 @@ class Cases
|
||||
) {
|
||||
$arrayAccess = [];
|
||||
|
||||
//User has participated
|
||||
$participated = new ListParticipatedLast();
|
||||
$listParticipated = $participated->loadList($usrUid, [], null, $appUid);
|
||||
$arrayAccess['participated'] = (count($listParticipated) == 0) ? false : true;
|
||||
// User has participated
|
||||
$arrayAccess['participated'] = Delegation::participation($appUid, $usrUid);
|
||||
|
||||
//User is supervisor
|
||||
// User is supervisor
|
||||
$supervisor = new BmProcessSupervisor();
|
||||
$isSupervisor = $supervisor->isUserProcessSupervisor($proUid, $usrUid);
|
||||
$arrayAccess['supervisor'] = ($isSupervisor) ? true : false;
|
||||
|
||||
//If the user is supervisor we will to return the object assigned
|
||||
// If the user is supervisor we will to return the object assigned
|
||||
if ($isSupervisor && $objectSupervisor) {
|
||||
$ps = new BmProcessSupervisor();
|
||||
$arrayAccess['objectSupervisor'] = $ps->getObjectSupervisor($proUid);
|
||||
}
|
||||
|
||||
//Roles Permissions
|
||||
// Roles Permissions
|
||||
if (count($rolesPermissions) > 0) {
|
||||
global $RBAC;
|
||||
foreach ($rolesPermissions as $value) {
|
||||
@@ -3354,7 +3353,7 @@ class Cases
|
||||
}
|
||||
}
|
||||
|
||||
//Object Permissions
|
||||
// Object Permissions
|
||||
if (count($objectPermissions) > 0) {
|
||||
$case = new ClassesCases();
|
||||
foreach ($objectPermissions as $key => $value) {
|
||||
|
||||
12
workflow/engine/src/ProcessMaker/Model/AppThread.php
Normal file
12
workflow/engine/src/ProcessMaker/Model/AppThread.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AppThread extends Model
|
||||
{
|
||||
protected $table = 'APP_THREAD';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
@@ -563,4 +563,22 @@ class Delegation extends Model
|
||||
|
||||
return $arrayOpenThreads;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if the user has participation in the case
|
||||
*
|
||||
* @param string $appUid, Case key
|
||||
* @param string $userUid, User key
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function participation($appUid, $userUid)
|
||||
{
|
||||
$query = Delegation::query()->select();
|
||||
$query->where('APP_UID', $appUid);
|
||||
$query->where('USR_UID', $userUid);
|
||||
$query->limit(1);
|
||||
|
||||
return ($query->count() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
12
workflow/engine/src/ProcessMaker/Model/RbacRoles.php
Normal file
12
workflow/engine/src/ProcessMaker/Model/RbacRoles.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RbacRoles extends Model
|
||||
{
|
||||
protected $table = 'RBAC_ROLES';
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
12
workflow/engine/src/ProcessMaker/Model/RbacUsers.php
Normal file
12
workflow/engine/src/ProcessMaker/Model/RbacUsers.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RbacUsers extends Model
|
||||
{
|
||||
protected $table = 'RBAC_USERS';
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
12
workflow/engine/src/ProcessMaker/Model/RbacUsersRoles.php
Normal file
12
workflow/engine/src/ProcessMaker/Model/RbacUsersRoles.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RbacUsersRoles extends Model
|
||||
{
|
||||
protected $table = 'RBAC_USERS_ROLES';
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
15
workflow/engine/src/ProcessMaker/Model/WebEntry.php
Normal file
15
workflow/engine/src/ProcessMaker/Model/WebEntry.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class WebEntry extends Model
|
||||
{
|
||||
// Set our table name
|
||||
protected $table = 'WEB_ENTRY';
|
||||
protected $primaryKey = 'WE_UID';
|
||||
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
));
|
||||
}
|
||||
|
||||
$taskData = self::__updateServiceTask($activityBefore, $activityCurrent, $taskData);
|
||||
$taskData = self::updateServiceTask($activityBefore, $activityCurrent, $taskData);
|
||||
|
||||
if ($activityCurrent->getActLoopType() == "PARALLEL") {
|
||||
$task = \TaskPeer::retrieveByPK($actUid);
|
||||
@@ -326,7 +326,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
* @param $taskData
|
||||
* @return mixed
|
||||
*/
|
||||
public static function __updateServiceTask($activityBefore, $activityCurrent, $taskData)
|
||||
public static function updateServiceTask($activityBefore, $activityCurrent, $taskData)
|
||||
{
|
||||
$registry = PluginRegistry::loadSingleton();
|
||||
if ($activityBefore->getActTaskType() != "SERVICETASK" && $activityCurrent->getActTaskType() == "SERVICETASK") {
|
||||
@@ -439,7 +439,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$this->updateEventStartObjects($data["FLO_ELEMENT_ORIGIN"], $data["FLO_ELEMENT_DEST"]);
|
||||
|
||||
//WebEntry-Event - Update
|
||||
$this->__updateWebEntryEventByEvent($data['FLO_ELEMENT_ORIGIN'], ['ACT_UID' => $data['FLO_ELEMENT_DEST']]);
|
||||
$this->updateWebEntryEventByEvent($data['FLO_ELEMENT_ORIGIN'], ['ACT_UID' => $data['FLO_ELEMENT_DEST']]);
|
||||
break;
|
||||
case "bpmnEvent":
|
||||
$messageEventRelationUid = $this->createMessageEventRelationByBpmnFlow(\BpmnFlowPeer::retrieveByPK($floUid));
|
||||
@@ -489,7 +489,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$this->updateEventStartObjects($flowCurrent->getFloElementOrigin(), $flowCurrent->getFloElementDest());
|
||||
|
||||
//WebEntry-Event - Update
|
||||
$this->__updateWebEntryEventByEvent($flowCurrent->getFloElementOrigin(), ['ACT_UID' => $flowCurrent->getFloElementDest()]);
|
||||
$this->updateWebEntryEventByEvent($flowCurrent->getFloElementOrigin(), ['ACT_UID' => $flowCurrent->getFloElementDest()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
//WebEntry-Event - Update
|
||||
if (is_null($bpmnFlow)) {
|
||||
$this->__updateWebEntryEventByEvent($flow->getFloElementOrigin(), ['WEE_STATUS' => 'DISABLED']);
|
||||
$this->updateWebEntryEventByEvent($flow->getFloElementOrigin(), ['WEE_STATUS' => 'DISABLED']);
|
||||
}
|
||||
} elseif ($flow->getFloElementOriginType() == "bpmnActivity" &&
|
||||
$flow->getFloElementDestType() == "bpmnEvent") {
|
||||
@@ -633,7 +633,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
// TODO Complete for other routes, activity->activity, activity->gateway and viceversa
|
||||
}
|
||||
|
||||
private function __updateEventActivityDefinition(\BpmnEvent $bpmnEvent, $flagStartTask)
|
||||
private function updateEventActivityDefinition(\BpmnEvent $bpmnEvent, $flagStartTask)
|
||||
{
|
||||
try {
|
||||
if ($bpmnEvent->getEvnType() == "START") {
|
||||
@@ -655,7 +655,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
if (!is_null(\BpmnActivityPeer::retrieveByPK($arrayFlowData['FLO_ELEMENT_DEST']))) {
|
||||
$this->wp->setStartTask($arrayFlowData['FLO_ELEMENT_DEST'], $flagStartTask);
|
||||
|
||||
$this->__updateWebEntryEventByEvent($bpmnEvent->getEvnUid());
|
||||
$this->updateWebEntryEventByEvent($bpmnEvent->getEvnUid());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -758,7 +758,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
if ((isset($arrayEventData["EVN_TYPE"]) && $arrayEventData["EVN_TYPE"] != $bpmnEvent->getEvnType()) ||
|
||||
(isset($arrayEventData["EVN_MARKER"]) && $arrayEventData["EVN_MARKER"] != $bpmnEvent->getEvnMarker())
|
||||
) {
|
||||
$this->__updateEventActivityDefinition($bpmnEvent, false);
|
||||
$this->updateEventActivityDefinition($bpmnEvent, false);
|
||||
$this->removeEventDefinition($bpmnEvent);
|
||||
}
|
||||
|
||||
@@ -773,7 +773,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
try {
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($eventUid);
|
||||
|
||||
$this->__updateEventActivityDefinition($bpmnEvent, false);
|
||||
$this->updateEventActivityDefinition($bpmnEvent, false);
|
||||
$this->removeEventDefinition($bpmnEvent);
|
||||
|
||||
parent::removeEvent($eventUid);
|
||||
@@ -794,7 +794,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
private function __createTaskByElement($elementUid, $elementType, $key, $eventName = '')
|
||||
private function createTaskByElement($elementUid, $elementType, $key, $eventName = '')
|
||||
{
|
||||
try {
|
||||
$taskTitle = $taskType = $this->arrayTaskAttribute[$key]["type"];
|
||||
@@ -940,7 +940,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
break;
|
||||
case "bpmnGateway":
|
||||
//Gateway ----> Gateway
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$arrayFlowData['FLO_ELEMENT_DEST'],
|
||||
'bpmnGateway',
|
||||
'gateway-to-gateway'
|
||||
@@ -963,7 +963,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$event->getEvnMarker(): EMPTY or MESSAGETHROW
|
||||
switch ($event->getEvnMarker()) {
|
||||
case "MESSAGETHROW":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-message-event"
|
||||
@@ -973,7 +973,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$result = $this->wp->addRoute($taskUid, -1, "SEQUENTIAL");
|
||||
break;
|
||||
case "EMAIL":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-email-event"
|
||||
@@ -1026,7 +1026,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
"EMAIL" => "intermediate-throw-email-event"
|
||||
);
|
||||
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$eventUid,
|
||||
"bpmnEvent",
|
||||
$arrayKey[$arrayEventData["EVN_MARKER"]],
|
||||
@@ -1080,7 +1080,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$event->getEvnMarker(): EMPTY or MESSAGETHROW
|
||||
switch ($event->getEvnMarker()) {
|
||||
case "MESSAGETHROW":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-message-event"
|
||||
@@ -1090,7 +1090,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$result = $this->wp->addRoute($taskUid, -1, "SEQUENTIAL");
|
||||
break;
|
||||
case "EMAIL":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-email-event"
|
||||
@@ -1173,7 +1173,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$event->getEvnMarker(): EMPTY or MESSAGETHROW
|
||||
switch ($event->getEvnMarker()) {
|
||||
case "MESSAGETHROW":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-message-event"
|
||||
@@ -1183,7 +1183,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$result = $this->wp->addRoute($taskUid, -1, "SEQUENTIAL");
|
||||
break;
|
||||
case "EMAIL":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event->getEvnUid(),
|
||||
"bpmnEvent",
|
||||
"end-email-event"
|
||||
@@ -1218,7 +1218,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
case "START":
|
||||
switch ($event["EVN_MARKER"]) {
|
||||
case "MESSAGECATCH":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event["EVN_UID"],
|
||||
"bpmnEvent",
|
||||
"start-message-event"
|
||||
@@ -1229,7 +1229,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$this->mapBpmnEventToWorkflowRoutes($taskUid, $event["EVN_UID"]);
|
||||
break;
|
||||
case "TIMER":
|
||||
$taskUid = $this->__createTaskByElement(
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$event["EVN_UID"],
|
||||
"bpmnEvent",
|
||||
"start-timer-event"
|
||||
@@ -1240,7 +1240,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$this->mapBpmnEventToWorkflowRoutes($taskUid, $event["EVN_UID"]);
|
||||
break;
|
||||
case "EMPTY":
|
||||
$this->__updateEventActivityDefinition(\BpmnEventPeer::retrieveByPK($event['EVN_UID']), true);
|
||||
$this->updateEventActivityDefinition(\BpmnEventPeer::retrieveByPK($event['EVN_UID']), true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -2048,7 +2048,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//Map Bpmn-Flows to Workflow-Routes
|
||||
$bwp->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$bwp->__gatewayToGatewayDeleteCorruptedRecords(); //Delete corrupted records in task and element_task_relation tables
|
||||
$bwp->gatewayToGatewayDeleteCorruptedRecords(); //Delete corrupted records in task and element_task_relation tables
|
||||
|
||||
//Return
|
||||
return $result;
|
||||
@@ -2071,7 +2071,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$this->wp->setDisabled($value);
|
||||
}
|
||||
|
||||
private function __updateWebEntryEventByEvent($eventUid, array $arrayData = null)
|
||||
private function updateWebEntryEventByEvent($eventUid, array $arrayData = null)
|
||||
{
|
||||
try {
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($eventUid);
|
||||
@@ -2145,7 +2145,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
return $diagram;
|
||||
}
|
||||
|
||||
private function __gatewayToGatewayDeleteCorruptedRecords()
|
||||
private function gatewayToGatewayDeleteCorruptedRecords()
|
||||
{
|
||||
//Delete corrupted records in task and element_task_relation tables
|
||||
|
||||
|
||||
@@ -1594,7 +1594,7 @@ class Bpmn extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
private function __getElementsBetweenElementOriginAndElementDest(
|
||||
private function getElementsBetweenElementOriginAndElementDestPriv(
|
||||
$elementOriginUid,
|
||||
$elementOriginType,
|
||||
$elementDestUid,
|
||||
@@ -1632,7 +1632,7 @@ class Bpmn extends Handler
|
||||
foreach ($arrayFlow as $value) {
|
||||
$arrayFlowData = $value->toArray();
|
||||
|
||||
$arrayEvent = $this->__getElementsBetweenElementOriginAndElementDest(
|
||||
$arrayEvent = $this->getElementsBetweenElementOriginAndElementDestPriv(
|
||||
$arrayFlowData["FLO_ELEMENT_DEST"],
|
||||
$arrayFlowData["FLO_ELEMENT_DEST_TYPE"],
|
||||
$elementDestUid,
|
||||
@@ -1668,7 +1668,7 @@ class Bpmn extends Handler
|
||||
$this->arrayElementOriginChecked = [];
|
||||
|
||||
//Return
|
||||
return call_user_func_array([$this, "__getElementsBetweenElementOriginAndElementDest"], array_merge(func_get_args(), [0]));
|
||||
return call_user_func_array([$this, "getElementsBetweenElementOriginAndElementDestPriv"], array_merge(func_get_args(), [0]));
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
|
||||
|
||||
@@ -212,14 +212,21 @@
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
startDateRender = function(v){
|
||||
var dateString = "-";
|
||||
if(v != "-" && v != null){
|
||||
dateString = _DF(v,"m/d/Y H:i:s");
|
||||
}
|
||||
/**
|
||||
* This applies the date format from the global configuration.
|
||||
* @param {String} value
|
||||
* @return {String}
|
||||
*/
|
||||
startDateRender = function (value) {
|
||||
var dateString,
|
||||
date;
|
||||
dateString = "-";
|
||||
if (value !== "-" && value !== null) {
|
||||
date = convertDate(value);
|
||||
dateString = date.dateFormat(FORMATS.casesListDateFormat);
|
||||
}
|
||||
return dateString;
|
||||
}
|
||||
}
|
||||
|
||||
actionRenderingTranslation = function(v){
|
||||
var actionTranslate = "";
|
||||
|
||||
@@ -545,23 +545,6 @@ Ext.onReady ( function() {
|
||||
return String.format("<a href='#' onclick='unpauseCaseFunction(\"{0}\",\"{1}\")'>" + _('ID_UNPAUSE') + "</a>", r.data['APP_UID'], r.data['DEL_INDEX'] );
|
||||
}
|
||||
|
||||
function convertDate ( value ) {
|
||||
myDate = new Date( 1900,0,1,0,0,0);
|
||||
try{
|
||||
if(!Ext.isDate( value )){
|
||||
var myArray = value.split(' ');
|
||||
var myArrayDate = myArray[0].split('-');
|
||||
if ( myArray.length > 1 )
|
||||
var myArrayHour = myArray[1].split(':');
|
||||
else
|
||||
var myArrayHour = new Array('0','0','0');
|
||||
var myDate = new Date( myArrayDate[0], myArrayDate[1]-1, myArrayDate[2], myArrayHour[0], myArrayHour[1], myArrayHour[2] );
|
||||
}
|
||||
}
|
||||
catch(e){};
|
||||
|
||||
return myDate;
|
||||
}
|
||||
function showDate (value,p,r) {
|
||||
var myDate = convertDate( value );
|
||||
return String.format("{0}", myDate.dateFormat( FORMATS.casesListDateFormat ));
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<form name="frmReassign" id="frmReassign" method="POST" action="cases_UsersReassign">
|
||||
<div class="borderForm" style="width:; padding-left:0; padding-right:0; border-width:1;">
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="pagedTableDefault" style="height:100%;" >
|
||||
<table width="95%" align="center" cellpadding="2" cellspacing="0" border="0" class="pagedTable">
|
||||
<tr>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="5%" class="pagedTableHeader">{ID_NUMBER}</td>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="25%" class="pagedTableHeader">{ID_CASE}</td>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="20%" class="pagedTableHeader">{ID_TASK}</td>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="20%" class="pagedTableHeader">{ID_PROCESS}</td>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="5%" class="pagedTableHeader">{ID_STATUS}</td>
|
||||
<td class="pagedTableHeader"><img src="/js/maborak/core/images/separatorTable.gif" style=""/></td><td width="25%" class="pagedTableHeader">{ID_REASSIGN_TO}</td>
|
||||
</tr>
|
||||
<!-- START BLOCK : cases -->
|
||||
<tr class="Row2" onmouseout="setRowClass(this, 'Row2');" onmouseover="setRowClass(this, 'RowPointer');">
|
||||
<td /><td>{APP_NUMBER}</td>
|
||||
<td /><td>{APP_TITLE}</td>
|
||||
<td /><td>{APP_TAS_TITLE}</td>
|
||||
<td /><td>{APP_PRO_TITLE}</td>
|
||||
<td /><td>{ID_STATUS}</td>
|
||||
<td /><td>
|
||||
<input type="hidden" name="APPLICATIONS[]" id="APPLICATIONS[]" value="{APP_UID}" />
|
||||
<input type="hidden" name="INDEXES[]" id="INDEXES[]" value="{DEL_INDEX}" />
|
||||
<select name="USERS[]" id="USERS[]"><option value=""> - {ID_NO_REASSIGN} - </option>
|
||||
<!-- START BLOCK : users -->
|
||||
<option value="{USR_UID}">{USR_FULLNAME}</option>
|
||||
<!-- END BLOCK : users -->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END BLOCK : cases -->
|
||||
<tr height="50">
|
||||
<td colspan="12" align="center">
|
||||
<input type="hidden" name="USR_UID" id="USR_UID" value="{USR_UID}" />
|
||||
<input type="submit" name="btnReassign" id="btnReassign" value="{ID_REASSIGN}" class="module_app_button___gray" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</form>
|
||||
@@ -27,37 +27,37 @@
|
||||
*/
|
||||
if (!((isset($_SESSION['USER_LOGGED']))&&(!(isset($_GET['sid']))))||!isset($_SESSION['Current_Dynafom'])) {
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode("
|
||||
window.parent.location.href = '../processes/mainInit';
|
||||
$oHeadPublisher->addScriptCode("
|
||||
window.parent.location.href = '../processes/mainInit';
|
||||
");
|
||||
G::RenderPage('publish');
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<link type="text/css" href="/js/jquery/css/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
|
||||
<link type="text/css" href="/skin/<?php echo SYS_SKIN;?>/style.css" rel="stylesheet" />
|
||||
<style> body{ background-color: #fff; }</style>
|
||||
<script type="text/javascript" src="/js/jquery/jquery-1.3.2.min.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery/jquery-ui-1.7.2.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/jscore/dynaforms/dynaforms_fieldsHandler.js"></script>
|
||||
</head>
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<link type="text/css" href="/js/jquery/css/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
|
||||
<link type="text/css" href="/skin/<?php echo SYS_SKIN;?>/style.css" rel="stylesheet" />
|
||||
<style> body{ background-color: #fff; }</style>
|
||||
<script type="text/javascript" src="/js/jquery/jquery-1.3.2.min.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery/jquery-ui-1.7.2.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/jscore/dynaforms/dynaforms_fieldsHandler.js"></script>
|
||||
</head>
|
||||
<?php
|
||||
$content = file_get_contents(PATH_DYNAFORM.$_SESSION['Current_Dynafom']['Parameters']['FILE'].".xml");
|
||||
$oXxml = G::xmlParser($content);
|
||||
|
||||
if (!isset($oXxml->result['dynaForm']['__CONTENT__'])) {
|
||||
?>
|
||||
<br/>
|
||||
<div class="ui-widget-header ui-corner-all" style="height:17px" align="center">
|
||||
<?php echo G::loadTranslation('ID_NO_FIELD_FOUND')?>
|
||||
</div>
|
||||
<script>
|
||||
parent.document.getElementById('light').style.display='none';
|
||||
parent.document.getElementById('fade').style.display='none';
|
||||
</script>
|
||||
?>
|
||||
<br/>
|
||||
<div class="ui-widget-header ui-corner-all" style="height:17px" align="center">
|
||||
<?php echo G::loadTranslation('ID_NO_FIELD_FOUND')?>
|
||||
</div>
|
||||
<script>
|
||||
parent.document.getElementById('light').style.display='none';
|
||||
parent.document.getElementById('fade').style.display='none';
|
||||
</script>
|
||||
<?php
|
||||
die();
|
||||
}
|
||||
@@ -73,58 +73,58 @@
|
||||
$hidden_fields = G::decrypt($boot_strap['__ATTRIBUTES__']['meta'], 'dynafieldsHandler');
|
||||
//echo $hidden_fields;
|
||||
$hidden_fields_list = explode(',', $hidden_fields);
|
||||
unset($elements[$node_name]); ?>
|
||||
<script>
|
||||
parent.jsMeta = "<?php echo $boot_strap['__ATTRIBUTES__']['meta'] ?>";
|
||||
</script>
|
||||
unset($elements[$node_name]); ?>
|
||||
<script>
|
||||
parent.jsMeta = "<?php echo $boot_strap['__ATTRIBUTES__']['meta'] ?>";
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<body>
|
||||
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="fieldshandler_item">
|
||||
<tr>
|
||||
<td width="15%" valign="top" align="left">
|
||||
<a href='#' onclick="return false;" onmouseout="parent.hideTooltip()" onmouseover="parent.showTooltip(event,document.getElementById('help').innerHTML);return false;">
|
||||
<image src="/images/help4.gif" width="16" height="16" border="0"/>
|
||||
</a>
|
||||
</td>
|
||||
<td valign="top" width="990px"><center>
|
||||
|
||||
<div style="width:100%">
|
||||
<div class="ui-widget-header ui-corner-all" style="height:17px">
|
||||
<table border="0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<td width="7%"><div style="font-size:9px; color:#fff;" align="left"> <b><?php echo G::loadTranslation('ID_VISIBLE')?></b></div></td>
|
||||
<td width="15%"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_TYPE')?></div></td>
|
||||
<td width="28%"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_NAME')?></div></td>
|
||||
<td width="6"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_LABEL')?></div></td>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dynafields">
|
||||
<ul id="sortable" style="margin:0; padding:0;">
|
||||
?>
|
||||
<body>
|
||||
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="fieldshandler_item">
|
||||
<tr>
|
||||
<td width="15%" valign="top" align="left">
|
||||
<a href='#' onclick="return false;" onmouseout="parent.hideTooltip()" onmouseover="parent.showTooltip(event,document.getElementById('help').innerHTML);return false;">
|
||||
<image src="/images/help4.gif" width="16" height="16" border="0"/>
|
||||
</a>
|
||||
</td>
|
||||
<td valign="top" width="990px"><center>
|
||||
|
||||
<div style="width:100%">
|
||||
<div class="ui-widget-header ui-corner-all" style="height:17px">
|
||||
<table border="0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<td width="7%"><div style="font-size:9px; color:#fff;" align="left"> <b><?php echo G::loadTranslation('ID_VISIBLE')?></b></div></td>
|
||||
<td width="15%"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_TYPE')?></div></td>
|
||||
<td width="28%"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_NAME')?></div></td>
|
||||
<td width="6"><div style="font-size:12px;color:#fff; font-weight:bold" align="left"> <?php echo G::loadTranslation('ID_LABEL')?></div></td>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dynafields">
|
||||
<ul id="sortable" style="margin:0; padding:0;">
|
||||
<?php foreach ($elements as $node_name=>$node) {
|
||||
if (isset($hidden_fields_list)) {
|
||||
$checked = !(in_array($node_name, $hidden_fields_list))? 'checked="checked"': '';
|
||||
} else {
|
||||
$checked = 'checked="checked"';
|
||||
} ?>
|
||||
<li style="list-style:none;" id="<?php echo $node_name?>" class="ui-state-default" onmouseover="setClass(this, 'ui-state-hover')" onmouseout="setClass(this, 'ui-state-default')">
|
||||
<table class="dynalist" border="0" width="100%" cellpadding="0" cellspacing="0" id="fieldshandler_items_table">
|
||||
<tr>
|
||||
<td width="7%">
|
||||
} ?>
|
||||
<li style="list-style:none;" id="<?php echo $node_name?>" class="ui-state-default" onmouseover="setClass(this, 'ui-state-hover')" onmouseout="setClass(this, 'ui-state-default')">
|
||||
<table class="dynalist" border="0" width="100%" cellpadding="0" cellspacing="0" id="fieldshandler_items_table">
|
||||
<tr>
|
||||
<td width="7%">
|
||||
<?php if ($node['__ATTRIBUTES__']['type'] != 'javascript' && $dynaformType != 'grid') {
|
||||
?>
|
||||
<input id="chk@<?php echo $node_name?>" type="checkbox" onclick="parent.jsMeta = fieldsHandlerSaveHidden();" <?php echo $checked?> />
|
||||
?>
|
||||
<input id="chk@<?php echo $node_name?>" type="checkbox" onclick="parent.jsMeta = fieldsHandlerSaveHidden();" <?php echo $checked?> />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
</td>
|
||||
<td width="15%" >
|
||||
} ?>
|
||||
</td>
|
||||
<td width="15%" >
|
||||
<?php $type = $node['__ATTRIBUTES__']['type'];
|
||||
switch ($type) {
|
||||
case 'yesno': $type = 'yes_no'; break;
|
||||
@@ -132,23 +132,23 @@
|
||||
case 'checkgroup': $type = 'check_group'; break;
|
||||
case 'radiogroup': $type = 'radio_group'; break;
|
||||
case 'file': $type = 'upload_files'; break;
|
||||
} ?>
|
||||
} ?>
|
||||
<?php if (is_file(PATH_HTML.'images'.PATH_SEP.'dynamicForm'.PATH_SEP."$type.gif")) {
|
||||
?>
|
||||
<img src="/images/dynamicForm/<?php echo $type?>.gif"/>
|
||||
?>
|
||||
<img src="/images/dynamicForm/<?php echo $type?>.gif"/>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<img src="/images/unknown_icon.gif" border="0" width="20" height="16"/>
|
||||
?>
|
||||
<img src="/images/unknown_icon.gif" border="0" width="20" height="16"/>
|
||||
<?php
|
||||
} ?>
|
||||
<span style="font-size:10px;"> <?php echo "({$node['__ATTRIBUTES__']['type']})"; ?></span>
|
||||
</td>
|
||||
|
||||
<td width="28%" style="font-size:12px;">
|
||||
<?php echo "$node_name"; ?>
|
||||
</td>
|
||||
<td><p style="font-size:12px; color:#1C3166; font-weight:bold">
|
||||
} ?>
|
||||
<span style="font-size:10px;"> <?php echo "({$node['__ATTRIBUTES__']['type']})"; ?></span>
|
||||
</td>
|
||||
|
||||
<td width="28%" style="font-size:12px;">
|
||||
<?php echo "$node_name"; ?>
|
||||
</td>
|
||||
<td><p style="font-size:12px; color:#1C3166; font-weight:bold">
|
||||
<?php if (isset($node["__CONTENT__"][SYS_LANG]["__VALUE__"]) && $node["__CONTENT__"][SYS_LANG]["__VALUE__"] != "") {
|
||||
if (strlen($node['__CONTENT__'][SYS_LANG]['__VALUE__']) > 30) {
|
||||
$label = substr(trim(strip_tags(G::stripCDATA($node['__CONTENT__'][SYS_LANG]['__VALUE__']))), 0, 30) . '...';
|
||||
@@ -158,98 +158,97 @@
|
||||
print($label);
|
||||
} else {
|
||||
print(" ");
|
||||
} ?></p>
|
||||
</td>
|
||||
<td width="40px" class="options" align="right">
|
||||
} ?></p>
|
||||
</td>
|
||||
<td width="40px" class="options" align="right">
|
||||
<?php if (in_array($node['__ATTRIBUTES__']['type'], $_POST['fieldsList'])) {
|
||||
?>
|
||||
<!-- <div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>-->
|
||||
<div class="jq-checkpointSubhead" style="display:block">
|
||||
<a title="<?php echo G::loadTranslation('ID_EDIT_FIELD')?>" href="#" onclick="__ActionEdit('<?php echo $node_name?>'); return false;"><img src="/images/e_Edit.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
</div>
|
||||
?>
|
||||
<!-- <div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>-->
|
||||
<div class="jq-checkpointSubhead" style="display:block">
|
||||
<a title="<?php echo G::loadTranslation('ID_EDIT_FIELD')?>" href="#" onclick="__ActionEdit('<?php echo $node_name?>'); return false;"><img src="/images/e_Edit.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>
|
||||
<div class="jq-checkpointSubhead" style="display:none">
|
||||
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
</div>
|
||||
?>
|
||||
<div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>
|
||||
<div class="jq-checkpointSubhead" style="display:none">
|
||||
<a title="<?php echo G::loadTranslation('ID_REMOVE_FIELD')?>" href="#" onclick="__ActionDelete('<?php echo $node_name?>', '<?php echo $node['__ATTRIBUTES__']['type']; ?>');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
<?php
|
||||
}?>
|
||||
</ul>
|
||||
</div>
|
||||
</center>
|
||||
<br/><br/>
|
||||
</td>
|
||||
<td valign="top" align="right" width="300" style="text-align:right">
|
||||
<div id="help" style="display:none">
|
||||
<h3 class="ui-widget-header ui-corner-all">Processmaker - DynaFields Handler</h3>
|
||||
<b><?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP1');?></b><br/><br/>
|
||||
<li> <?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP2');?><br/>
|
||||
<li> <?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP3');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
<script language="javascript">
|
||||
var lastUidFHSelected;
|
||||
var lastFTypeFHSelected;
|
||||
function __ActionEdit(uid){
|
||||
lastUidFHSelected = uid;
|
||||
if (!parent.sessionPersits()) {
|
||||
parent.showPrompt('__ActionEdit');
|
||||
return;
|
||||
}
|
||||
var client_window = parent.getClientWindowSize();
|
||||
h = client_window.height;
|
||||
h1 = (h / 100) * 92;
|
||||
window.parent.popupWindow('', "fields_Edit?A=<?php echo $_SESSION['Current_Dynafom']['Parameters']['URL']?>&XMLNODE_NAME="+ uid , 600, h1);
|
||||
|
||||
}
|
||||
|
||||
function __ActionDelete(uid, ftype){
|
||||
lastUidFHSelected = uid;
|
||||
lastFTypeFHSelected = ftype;
|
||||
if (!parent.sessionPersits()) {
|
||||
parent.showPrompt('__ActionDelete');
|
||||
return;
|
||||
}
|
||||
new window.parent.leimnud.module.app.confirm().make({
|
||||
label: '<?php echo G::LoadTranslation('ID_FIELD_HANDLER_ACTION_DELETE');?>' + ' ' + ftype + "?",
|
||||
action:function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "fields_Delete",
|
||||
data: 'A=<?php echo $_SESSION['Current_Dynafom']['Parameters']['URL']?>&XMLNODE_NAME='+uid,
|
||||
success: function(httpResponse){
|
||||
window.parent.dynaformEditor.refreshFieldsList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
parent_divs = parent.document.getElementsByTagName('div');
|
||||
for(i=0; i<parent_divs.length; i++){
|
||||
if(parent_divs[i].className == 'panel_containerWindow___processmaker'){
|
||||
content_div = parent_divs[i];
|
||||
}
|
||||
}
|
||||
h = content_div.style.height.split('px');
|
||||
window.parent.document.getElementById('dynaframe').height = (h[0]-120);
|
||||
|
||||
parent.document.getElementById('light').style.display='none';
|
||||
parent.document.getElementById('fade').style.display='none';
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
}?>
|
||||
</ul>
|
||||
</div>
|
||||
</center>
|
||||
<br/><br/>
|
||||
</td>
|
||||
<td valign="top" align="right" width="300" style="text-align:right">
|
||||
<div id="help" style="display:none">
|
||||
<h3 class="ui-widget-header ui-corner-all">Processmaker - DynaFields Handler</h3>
|
||||
<b><?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP1');?></b><br/><br/>
|
||||
<li> <?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP2');?><br/>
|
||||
<li> <?php echo G::LoadTranslation('ID_FIELD_HANDLER_HELP3');?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
<script language="javascript">
|
||||
var lastUidFHSelected;
|
||||
var lastFTypeFHSelected;
|
||||
function __ActionEdit(uid){
|
||||
lastUidFHSelected = uid;
|
||||
if (!parent.sessionPersits()) {
|
||||
parent.showPrompt('__ActionEdit');
|
||||
return;
|
||||
}
|
||||
var client_window = parent.getClientWindowSize();
|
||||
h = client_window.height;
|
||||
h1 = (h / 100) * 92;
|
||||
window.parent.popupWindow('', "fields_Edit?A=<?php echo $_SESSION['Current_Dynafom']['Parameters']['URL']?>&XMLNODE_NAME="+ uid , 600, h1);
|
||||
|
||||
}
|
||||
|
||||
function __ActionDelete(uid, ftype){
|
||||
lastUidFHSelected = uid;
|
||||
lastFTypeFHSelected = ftype;
|
||||
if (!parent.sessionPersits()) {
|
||||
parent.showPrompt('__ActionDelete');
|
||||
return;
|
||||
}
|
||||
new window.parent.leimnud.module.app.confirm().make({
|
||||
label: '<?php echo G::LoadTranslation('ID_FIELD_HANDLER_ACTION_DELETE');?>' + ' ' + ftype + "?",
|
||||
action:function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "fields_Delete",
|
||||
data: 'A=<?php echo $_SESSION['Current_Dynafom']['Parameters']['URL']?>&XMLNODE_NAME='+uid,
|
||||
success: function(httpResponse){
|
||||
window.parent.dynaformEditor.refreshFieldsList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
parent_divs = parent.document.getElementsByTagName('div');
|
||||
for(i=0; i<parent_divs.length; i++){
|
||||
if(parent_divs[i].className == 'panel_containerWindow___processmaker'){
|
||||
content_div = parent_divs[i];
|
||||
}
|
||||
}
|
||||
h = content_div.style.height.split('px');
|
||||
window.parent.document.getElementById('dynaframe').height = (h[0]-120);
|
||||
|
||||
parent.document.getElementById('light').style.display='none';
|
||||
parent.document.getElementById('fade').style.display='none';
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -61,7 +61,6 @@ Ext.onReady(function () {
|
||||
var response = Ext.util.JSON.decode(response.responseText);
|
||||
Ext.getCmp('php').setValue(getFieldOutput(response.php.version, response.php.result));
|
||||
Ext.getCmp('mysql').setValue(getFieldOutput(response.mysql.version, response.mysql.result));
|
||||
//Ext.getCmp('mssql').setValue (getFieldOutput(response.mssql.version, response.mssql.result));
|
||||
Ext.getCmp('curl').setValue(getFieldOutput(response.curl.version, response.curl.result));
|
||||
Ext.getCmp('openssl').setValue(getFieldOutput(response.openssl.version, response.openssl.result));
|
||||
Ext.getCmp('dom').setValue(getFieldOutput(response.dom.version, response.dom.result));
|
||||
@@ -72,7 +71,7 @@ Ext.onReady(function () {
|
||||
Ext.getCmp('ldap').setValue(getFieldOutput(response.ldap.version, response.ldap.result));
|
||||
Ext.getCmp('memory').setValue(getFieldOutput(response.memory.version, response.memory.result));
|
||||
|
||||
dbReq = response.mysql.result || response.mssql.result;
|
||||
dbReq = response.mysql.result;
|
||||
phpReq = response.php.result && response.curl.result && response.dom.result && response.gd.result && response.multibyte.result && response.soap.result && response.memory.result && response.mcrypt.result;
|
||||
wizard.onClientValidation(0, dbReq && phpReq);
|
||||
wizard.showLoadMask(false);
|
||||
|
||||
@@ -29,7 +29,6 @@ systemInfo.application = {
|
||||
case "SYS":
|
||||
Ext.getCmp("php").setValue(fieldFormatValue(dataResponse.php.version, dataResponse.php.result));
|
||||
Ext.getCmp("mysql").setValue(fieldFormatValue(dataResponse.mysql.version, dataResponse.mysql.result));
|
||||
//Ext.getCmp("mssql").setValue(fieldFormatValue(dataResponse.mssql.version, dataResponse.mssql.result));
|
||||
Ext.getCmp("curl").setValue(fieldFormatValue(dataResponse.curl.version, dataResponse.curl.result));
|
||||
Ext.getCmp("openssl").setValue(fieldFormatValue(dataResponse.openssl.version, dataResponse.openssl.result));
|
||||
Ext.getCmp("dom").setValue(fieldFormatValue(dataResponse.dom.version, dataResponse.dom.result));
|
||||
@@ -100,14 +99,6 @@ systemInfo.application = {
|
||||
fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MYSQL"),
|
||||
value: eval("fieldFormatValue(" + SYSINFO_MYSQL + ");")
|
||||
},
|
||||
/*
|
||||
{
|
||||
xtype: "displayfield",
|
||||
id: "mssql",
|
||||
fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MSSQL"),
|
||||
value: eval("fieldFormatValue(" + SYSINFO_MSSQL + ");")
|
||||
},
|
||||
*/
|
||||
{
|
||||
xtype: "displayfield",
|
||||
id: "curl",
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm type="xmlform" name="cases_ReassignBy.xml" width="600" enabletemplate="1" mode="edit">
|
||||
<title type="subtitle" enableHTML="1">
|
||||
<en><![CDATA[<center>Reassignment of Cases</center>]]></en>
|
||||
</title>
|
||||
<REASSIGN_BY type="radiogroup" required="0" defaultvalue="1" mode="edit">
|
||||
<en><![CDATA[Reassign By]]><option name="1"><![CDATA[Case]]></option><option name="2"><![CDATA[User]]></option></en>
|
||||
</REASSIGN_BY>
|
||||
<REASSIGN_USER type="dropdown" required="0" readonly="0" mode="edit" sqlconnection="dbarray"><![CDATA[
|
||||
SELECT * FROM aUserInfo
|
||||
]]><en><![CDATA[]]><option name=""><![CDATA[- Select -]]></option></en></REASSIGN_USER>
|
||||
<JS type="javascript"><![CDATA[
|
||||
|
||||
var bFlag = false;
|
||||
var client = getBrowserClient();
|
||||
|
||||
var dynaformOnload = function() {
|
||||
if (!bFlag) {
|
||||
if( client.browser == 'msie'){
|
||||
document.getElementById('form[REASSIGN_BY][1]').onclick= function() {
|
||||
if (this.checked) {
|
||||
if (window.location.href.indexOf('cases_List?l=to_reassign') == -1) {
|
||||
window.location = 'cases_List?l=to_reassign';
|
||||
}
|
||||
}
|
||||
};
|
||||
document.getElementById('form[REASSIGN_BY][2]').onclick= function() {
|
||||
if (document.getElementById('form[REASSIGN_BY][2]').checked) {
|
||||
if (window.location.href.indexOf('cases_ReassignByUser') == -1) {
|
||||
window.location = 'cases_ReassignByUser';
|
||||
}
|
||||
}
|
||||
};
|
||||
leimnud.event.add(getField('REASSIGN_USER'), 'change', function() {
|
||||
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + getField('REASSIGN_USER').value;
|
||||
});
|
||||
} else { //for other firefox, safari, etc..
|
||||
leimnud.event.add(getField('REASSIGN_BY][1'), 'click', function() {
|
||||
if (this.checked) {
|
||||
if (window.location.href.indexOf('cases_List?l=to_reassign') == -1) {
|
||||
window.location = 'cases_List?l=to_reassign';
|
||||
}
|
||||
}
|
||||
});
|
||||
leimnud.event.add(getField('REASSIGN_BY][2'), 'click', function() {
|
||||
if (this.checked) {
|
||||
if (window.location.href.indexOf('cases_ReassignByUser') == -1) {
|
||||
window.location = 'cases_ReassignByUser';
|
||||
}
|
||||
}
|
||||
});
|
||||
leimnud.event.add(getField('REASSIGN_USER'), 'change', function() {
|
||||
window.location = 'cases_ReassignByUser?REASSIGN_USER=' + this.value;
|
||||
});
|
||||
}
|
||||
bFlag = true;
|
||||
}
|
||||
};
|
||||
|
||||
if (getField('REASSIGN_BY][2').checked){
|
||||
//showRowById('REASSIGN_USER');
|
||||
document.getElementById('form[REASSIGN_USER]').style.display = 'block';
|
||||
} else {
|
||||
//hideRowById('REASSIGN_USER');
|
||||
document.getElementById('form[REASSIGN_USER]').style.display = 'none';
|
||||
}
|
||||
|
||||
]]></JS>
|
||||
</dynaForm>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="dynaforms_List" type="filterform" sql="SELECT *, T.CON_VALUE AS fMESS_TITLE, D.CON_VALUE AS fMESS_DESCRIPTION FROM MESSAGE LEFT JOIN CONTENT as T ON (T.CON_ID=MESS_UID AND T.CON_CATEGORY='MESS_TITLE') LEFT JOIN CONTENT AS D ON (D.CON_ID=MESS_UID AND D.CON_CATEGORY='MESS_DESCRIPTION') WHERE PRO_UID=@@PRO_UID" sqlConnection="" menu="messages/messages_Options" filterForm="messages/messages_List" searchBy="T.CON_VALUE | D.CON_VALUE" width="100%">
|
||||
<MESS_UID type="hidden" showInTable="0"/>
|
||||
<fMESS_TITLE type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
||||
<en><![CDATA[Output document]]></en>
|
||||
</fMESS_TITLE>
|
||||
<MESS_TYPE type="dropdown" colWidth="120" titleAlign="left" align="left" dataCompareField="TYPE" dataCompareType="=">
|
||||
<en><![CDATA[Type]]><option name="HTML"><![CDATA[HTML]]></option><option name="TEXT"><![CDATA[Plain text]]></option><option name="SMS"><![CDATA[SMS]]></option></en>
|
||||
</MESS_TYPE>
|
||||
<fMESS_DESCRIPTION type="textarea" rows="3" cols="32" colWidth="200" titleAlign="left" align="left" dataCompareField="D.CON_VALUE" dataCompareType="contains">
|
||||
<en><![CDATA[Content]]></en>
|
||||
</fMESS_DESCRIPTION>
|
||||
<EDIT type="link" colWidth="40" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="messagesEdit(@QMESS_UID);return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</EDIT>
|
||||
<DELETE type="link" colWidth="40" value="@G::LoadTranslation(ID_DELETE)" link="#" onclick="if (confirm('@G::LoadTranslation(ID_MSG_CONFIRM_DELETE_MESSAGE)')) messagesDelete(@QMESS_UID);return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</DELETE>
|
||||
<SEARCH type="button" onclick="pagedTableFilter( this.form );" showInTable="0">
|
||||
<en><![CDATA[Apply Filter]]></en>
|
||||
</SEARCH>
|
||||
<PAGED_TABLE_ID type="private" showInTable="0"/>
|
||||
<JSFILTER type="javascript" replaceTags="1" showInTable="0">
|
||||
function pagedTableFilter( form ) {
|
||||
@#PAGED_TABLE_ID.doFilter( form );
|
||||
}
|
||||
</JSFILTER>
|
||||
</dynaForm>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="dynaforms_List" type="filterform" sql="SELECT *, T.CON_VALUE AS OUT_DOC_TITLE, D.CON_VALUE AS OUT_DOC_DESCRIPTION FROM OUTPUT_DOCUMENT LEFT JOIN CONTENT as T ON (T.CON_ID=OUT_DOC_UID AND T.CON_CATEGORY='OUT_DOC_TITLE') LEFT JOIN CONTENT AS D ON (D.CON_ID=OUT_DOC_UID AND D.CON_CATEGORY='OUT_DOC_DESCRIPTION')" sqlConnection="" menu="outputdocs/outputdocs_Options" filterForm="outputdocs/outputdocs_List" width="100%">
|
||||
<OUT_DOC_UID type="hidden" showInTable="0"/>
|
||||
<OUT_DOC_TITLE type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="T.CON_VALUE" dataCompareType="contains">
|
||||
<en><![CDATA[Output document]]></en>
|
||||
</OUT_DOC_TITLE>
|
||||
<OUT_DOC_FILENAME type="text" colWidth="200" titleAlign="left" align="left" dataCompareField="OUT_DOC_FILENAME" dataCompareType="contains">
|
||||
<en><![CDATA[Filename]]></en>
|
||||
</OUT_DOC_FILENAME>
|
||||
<OUT_DOC_DESCRIPTION type="textarea" rows="3" cols="32" colWidth="200" titleAlign="left" align="left" dataCompareField="D.CON_VALUE" dataCompareType="contains">
|
||||
<en><![CDATA[Description]]></en>
|
||||
</OUT_DOC_DESCRIPTION>
|
||||
<EDIT type="link" colWidth="40" value="@G::LoadTranslation(ID_EDIT)" link="#" onclick="outputdocsEdit(@QOUT_DOC_UID);return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</EDIT>
|
||||
<DELETE type="link" colWidth="40" value="@G::LoadTranslation(ID_DELETE)" link="#" onclick="if (confirm('@G::LoadTranslation(ID_MSG_CONFIRM_DELETE_OUTDOC)')) outputdocsDelete(@QOUT_DOC_UID);return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</DELETE>
|
||||
<SEARCH type="button" onclick="pagedTableFilter( this.form );" showInTable="0">
|
||||
<en><![CDATA[Apply Filter]]></en>
|
||||
</SEARCH>
|
||||
<PAGED_TABLE_ID type="private" showInTable="0"/>
|
||||
<JSFILTER type="javascript" replaceTags="1" showInTable="0">
|
||||
function pagedTableFilter( form ) {
|
||||
@#PAGED_TABLE_ID.doFilter( form );
|
||||
}
|
||||
</JSFILTER>
|
||||
</dynaForm>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm type="pagetable" menu="users/users_Options" searchBy="USR_USERNAME | USR_LASTNAME | USR_FIRSTNAME | USR_EMAIL">
|
||||
<USR_UID type="private" showInTable="0"/>
|
||||
<USR_COMPLETENAME type="text" titlealign="left" align="left" colWidth="200">
|
||||
<en><![CDATA[Full Name]]></en>
|
||||
</USR_COMPLETENAME>
|
||||
<USR_USERNAME type="text" titlealign="left" align="left" colWidth="120">
|
||||
<en><![CDATA[Username]]></en>
|
||||
</USR_USERNAME>
|
||||
<USR_EMAIL type="text" titlealign="left" align="left" colWidth="190">
|
||||
<en><![CDATA[E-Mail]]></en>
|
||||
</USR_EMAIL>
|
||||
<USR_ROLE type="text" titlealign="left" align="left" colWidth="180">
|
||||
<en><![CDATA[Role]]></en>
|
||||
</USR_ROLE>
|
||||
<USR_DUE_DATE type="text" titlealign="left" align="left" colWidth="65">
|
||||
<en><![CDATA[Due Date]]></en>
|
||||
</USR_DUE_DATE>
|
||||
<USR_EDIT type="link" colWidth="50" value="@#USR_EDIT" link="users_Edit?USR_UID=@#USR_UID">
|
||||
<en><![CDATA[]]></en>
|
||||
</USR_EDIT>
|
||||
<USR_GROUP type="link" colWidth="25" value="@G::LoadTranslation(ID_VIEW_USER_GROUP)" link="#" onclick="viewUserGroups('@#USR_UID');return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</USR_GROUP>
|
||||
<USR_AUTH type="link" colWidth="25" value="@#USR_AUTH" link="users_AuthSource?USR_UID=@#USR_UID">
|
||||
<en><![CDATA[]]></en>
|
||||
</USR_AUTH>
|
||||
<!--USR_REASSIGN type="link" colWidth="100" value="@#USR_REASSIGN" link="#" onclick="reassignCases2('@#USR_UID');return false;">
|
||||
<en/>
|
||||
</USR_REASSIGN-->
|
||||
<USR_DELETE type="link" colWidth="25" value="@#USR_DELETE" link="#" onclick="deleteUser('@#USR_UID');return false;">
|
||||
<en><![CDATA[]]></en>
|
||||
</USR_DELETE>
|
||||
</dynaForm>
|
||||
@@ -1,200 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm type="xmlmenu">
|
||||
<MNU_ADD type="link" value="" link="#" onclick="window.location = 'users_New';return false;" colAlign="left" colWidth="35">
|
||||
<en><![CDATA[New]]></en>
|
||||
</MNU_ADD>
|
||||
<PAGED_TABLE_ID type="private"/>
|
||||
<PAGED_TABLE_FAST_SEARCH type="FastSearch" label="@G::LoadTranslation(ID_SEARCH)"/>
|
||||
<SEARCH_FILTER_FORM type="private"/>
|
||||
<CONFIRM type="private"/>
|
||||
<JS type="javascript"><![CDATA[
|
||||
var simpleUserDelete = function(sUser) {
|
||||
new leimnud.module.app.confirm().make({
|
||||
label:'@#CONFIRM',
|
||||
action:function() {
|
||||
window.location = 'users_Delete?USR_UID=' + sUser;
|
||||
}.extend(this)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var panel;
|
||||
var gUSER_UID;
|
||||
var deleteUser=function(sUser){
|
||||
if (sUser == '00000000000000000000000000000001')
|
||||
{
|
||||
new leimnud.module.app.alert().make({
|
||||
label: "@G::LoadTranslation(ID_CANNOT_DELETE_ADMIN_USER)"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
gUSER_UID = sUser;
|
||||
panel =new leimnud.module.panel();
|
||||
panel.options={
|
||||
size :{w:450,h:250},
|
||||
position:{x:50,y:50,center:true},
|
||||
statusBarButtons:[
|
||||
{value:'@G::LoadTranslation(ID_DELETE)'},
|
||||
{value: G_STRINGS.CANCEL}
|
||||
],
|
||||
title :G_STRINGS.ID_PROSESSESCASE,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
panel.elements.statusBarButtons[0].onmouseup=function(){
|
||||
var todoCount = parseInt(getField('TO_DO').value);
|
||||
var draftCount = parseInt(getField('DRAFT').value);
|
||||
var cancelledCount = parseInt(getField('CANCELLED').value);
|
||||
var completedCount = parseInt(getField('COMPLETED').value);
|
||||
|
||||
if(todoCount== 0 && draftCount==0){
|
||||
if(cancelledCount== 0 && completedCount==0){
|
||||
location.href = "users_Delete?USR_UID="+gUSER_UID;
|
||||
} else {
|
||||
new leimnud.module.app.confirm().make({
|
||||
label:G_STRINGS.USERS_DELETE_WITH_HISTORY,
|
||||
width:350,
|
||||
height:130,
|
||||
action:function(){
|
||||
location.href = "users_Delete?USR_UID="+gUSER_UID;
|
||||
}.extend(this)
|
||||
});
|
||||
}
|
||||
} else {
|
||||
new leimnud.module.app.confirm().make({
|
||||
label:G_STRINGS.USERS_REASSIGN,
|
||||
width:350,
|
||||
height:135,
|
||||
action:function(){
|
||||
/*location.href = "../cases/cases_ReassignByUser";*/
|
||||
userReassing(gUSER_UID);
|
||||
}.extend(this)
|
||||
});
|
||||
}
|
||||
};
|
||||
panel.elements.statusBarButtons[1].onmouseup=panel.remove;
|
||||
panel.loader.show();
|
||||
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:"users_DeleteAssign.php",
|
||||
method:"GET",
|
||||
args:"USR_UID=" + sUser
|
||||
});
|
||||
r.callback=function(rpc)
|
||||
{
|
||||
panel.loader.hide();
|
||||
panel.addContent(rpc.xmlhttp.responseText);
|
||||
};
|
||||
r.make();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function viewUserGroups(sUserUID){
|
||||
popupWindow('' , 'users_Groups?sUserUID='+sUserUID , 400 , 330 );
|
||||
/*refreshTree();*/
|
||||
};
|
||||
|
||||
function showUserGroups(sUserUID){
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../users/users_Ajax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'function=showUserGroups'+ '&sUserUID=' + sUserUID
|
||||
});
|
||||
oRPC.make();
|
||||
currentPopupWindow.clearContent();
|
||||
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
|
||||
};
|
||||
|
||||
function deleteGroup(sGroup, sUser){
|
||||
|
||||
new leimnud.module.app.confirm().make({
|
||||
label:G_STRINGS.ID_MSG_CONFIRM_REMOVE_USERGROUP,
|
||||
action:function(){
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../users/users_Ajax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'function=deleteGroup&GRP_UID=' + sGroup + '&USR_UID=' + sUser
|
||||
});
|
||||
oRPC.make();
|
||||
currentPopupWindow.clearContent();
|
||||
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
|
||||
}.extend(this)
|
||||
});
|
||||
};
|
||||
|
||||
function showUserGroupInterface(sUserUID){
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../users/users_Ajax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'function=showUserGroupInterface'+ '&sUserUID=' + sUserUID
|
||||
});
|
||||
oRPC.make();
|
||||
currentPopupWindow.clearContent();
|
||||
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
|
||||
//currentPopupWindow.remove();
|
||||
};
|
||||
|
||||
function saveUserGroup(sGroup, sUser){
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../users/users_Ajax',
|
||||
async : false,
|
||||
method: 'POST',
|
||||
args : 'function=assignUserToGroup&GRP_UID=' + sGroup + '&USR_UID=' + sUser
|
||||
});
|
||||
oRPC.make();
|
||||
currentPopupWindow.clearContent();
|
||||
currentPopupWindow.addContent(oRPC.xmlhttp.responseText);
|
||||
setTimeout('showUserGroups(\''+sUser+'\')',1500);
|
||||
}
|
||||
|
||||
var reassignCases = function(sUser) {
|
||||
window.location = 'users_ReassignCases?sUser=' + sUser;
|
||||
};
|
||||
|
||||
var reassignCases2 = function(USR_UID) {
|
||||
popupWindow('' , 'users_ReassignCases?USR_UID=' + USR_UID + '&iStep=1' , 500, 350);
|
||||
};
|
||||
|
||||
function userReassing(USR_UID){
|
||||
var panel =new leimnud.module.panel();
|
||||
var width = 1000;
|
||||
var height= 700;
|
||||
|
||||
panel.options={
|
||||
size :{w:width, h:height},
|
||||
position:{x:50,y:50,center:true},
|
||||
statusBarButtons:[{value: G_STRINGS.CANCEL}],
|
||||
title :G_STRINGS.ID_REASSIGNMENT,
|
||||
control :{close:true,resize:false},fx:{modal:true},
|
||||
statusBar:false,
|
||||
fx :{shadow:true,modal:true}
|
||||
};
|
||||
panel.make();
|
||||
|
||||
ifrm = document.createElement("iframe");
|
||||
ifrm.setAttribute("name", "userReassing");
|
||||
ifrm.setAttribute("id","userReassing");
|
||||
ifrm.setAttribute("src", "../cases/cases_ReassignByUser?REASSIGN_USER="+USR_UID);
|
||||
|
||||
ifrm.style.width = "100%";
|
||||
ifrm.style.height = "99%";
|
||||
ifrm.style.border = "0";
|
||||
panel.addContent(ifrm);
|
||||
|
||||
panel.elements.statusBarButtons[0].onmouseup=function(){
|
||||
panel.remove();
|
||||
};
|
||||
}
|
||||
|
||||
]]></JS>
|
||||
</dynaForm>
|
||||
Reference in New Issue
Block a user