Merged in bugfix/HOR-4547 (pull request #6464)

HOR-4547

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2018-05-11 20:26:34 +00:00
committed by Julio Cesar Laura Avendaño
20 changed files with 59 additions and 33 deletions

View File

@@ -2832,7 +2832,7 @@ class G
* @param string $array_i
* @return array
*/
public function array_merge_2(&$array, &$array_i)
public static function array_merge_2(&$array, &$array_i)
{
foreach ($array_i as $k => $v) {
if (is_array($v)) {

View File

@@ -56,8 +56,11 @@ class XmlFormFieldWYSIWYGEditor extends XmlFormField
* @return string
*
*/
public function render($value, $owner = null)
public function render($value = null, $owner = null)
{
if ($value === null) {
$value = '';
}
$value = ($value == '') ? '<br/>' : $value;
$html = "<textArea class='tmceEditor' id='form[" . $this->name . "]' name='form[" . $this->name . "]' >" . htmlentities($value,
ENT_QUOTES, 'UTF-8') . "</textarea>";

View File

@@ -384,8 +384,11 @@ class XmlFormField
* @param string values
* @return string
*/
public function renderGrid($values = array(), $owner = null, $onlyValue = false, $therow = -1)
public function renderGrid($values = null, $owner = null, $onlyValue = false, $therow = -1)
{
if ($values === null) {
$values = [];
}
$result = [];
$r = 1;
foreach ($values as $v) {

View File

@@ -44,7 +44,7 @@ abstract class ProjectComponent {
* @param object The reference to the current project
* @access public
*/
function setProject($project) {
function setProject(Project $project) {
$this->project = $project;
}

View File

@@ -134,7 +134,7 @@ class Mapper extends DataType {
*
* You must not set any other attribute if you make it a reference.
*/
function setRefid($r) {
function setRefid(Reference $r) {
if ($this->type !== null || $this->from !== null || $this->to !== null) {
throw DataType::tooManyAttributes();
}

View File

@@ -18,7 +18,7 @@ class Configurations // extends Configuration
*
* @return void
*/
public function Configurations()
public function __construct()
{
$this->Configuration = new Configuration();
}

View File

@@ -1740,22 +1740,33 @@ class Derivation
return $aGrp;
}
function checkReplacedByUser ($user)
/**
* Review the replaced by configuration
*
* @param string $user
*
* @return string
* @throws Exception
*/
function checkReplacedByUser($user)
{
if (is_string( $user )) {
$userInstance = UsersPeer::retrieveByPK( $user );
if (is_string($user)) {
$userInstance = UsersPeer::retrieveByPK($user);
} else {
$userInstance = $user;
}
if (! is_object( $userInstance )) {
throw new Exception( "The user with the UID '$user' doesn't exist." );
if (!is_object($userInstance)) {
if (!is_string($user)) {
$user = gettype($user);
}
throw new Exception("The user with the UID '" . $user . "' doesn't exist.");
}
if ($userInstance->getUsrStatus() == 'ACTIVE') {
return $userInstance->getUsrUid();
} else {
$userReplace = trim( $userInstance->getUsrReplacedBy() );
$userReplace = trim($userInstance->getUsrReplacedBy());
if ($userReplace != '') {
return $this->checkReplacedByUser( UsersPeer::retrieveByPK( $userReplace ) );
return $this->checkReplacedByUser(UsersPeer::retrieveByPK($userReplace));
} else {
return '';
}

View File

@@ -2003,7 +2003,7 @@ class ProcessMap
$oDataset = InputDocumentPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$inputDocArray = "";
$inputDocArray = [];
$inputDocArray[] = array('INP_DOC_UID' => 'char', 'PRO_UID' => 'char', 'INP_DOC_TITLE' => 'char', 'INP_DOC_DESCRIPTION' => 'char' );
while ($aRow = $oDataset->getRow()) {
if (($aRow['INP_DOC_TITLE'] == null) || ($aRow['INP_DOC_TITLE'] == "")) {
@@ -2071,11 +2071,11 @@ class ProcessMap
$oDataset = TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$triggersArray = "";
$triggersArray = [];
$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char');
while ($aRow = $oDataset->getRow()) {
if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) {
// There is no transaltion for this Trigger name, try to get/regenerate the label
// There is no translation for this Trigger name, try to get/regenerate the label
$triggerO = new Triggers();
$triggerObj = $triggerO->load($aRow['TRI_UID']);
$aRow['TRI_TITLE'] = $triggerObj['TRI_TITLE'];

View File

@@ -261,7 +261,8 @@ class PropelTable
$totalWidth = 0;
foreach ($this->fields as $r => $rval) {
if ($this->style[$r]['showInTable'] != '0') {
$totalWidth += $this->style[$r]['colWidth'];
$colWidth = empty($this->style[$r]['colWidth']) ? 0 : $this->style[$r]['colWidth'];
$totalWidth += $colWidth;
}
}
$this->totalWidth = $totalWidth;
@@ -327,7 +328,8 @@ class PropelTable
$this->tpl->assign("width", $this->style[$r]['colWidth']);
}
if (isset($this->style[$r]['colWidth'])) {
$this->tpl->assign("widthPercent", ($this->style[$r]['colWidth'] * 100 / $this->totalWidth) . "%");
$colWidth = empty($this->style[$r]['colWidth']) ? 1 : $this->style[$r]['colWidth'];
$this->tpl->assign("widthPercent", ($colWidth * 100 / $this->totalWidth) . "%");
//Hook for special skin with RTL languajes
}
if (defined('SYS_LANG_DIRECTION') && SYS_LANG_DIRECTION == 'R') {

View File

@@ -75,7 +75,7 @@ class XmlFormFieldTextPm extends XmlFormFieldSimpleText
* @param eter string owner
* @return string
*/
public function renderGrid($values = array(), $owner)
public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null)
{
$result = array();
$r = 1;

View File

@@ -23,7 +23,7 @@ class XmlFormFieldTextareaPm extends XmlFormField
* @param eter string owner
* @return string
*/
public function render($value = null, $owner)
public function render($value = null, $owner = null)
{
if ($this->showVars == 1) {
$this->process = G::replaceDataField($this->process, $owner->values);
@@ -53,8 +53,11 @@ class XmlFormFieldTextareaPm extends XmlFormField
* @param eter string owner
* @return string
*/
public function renderGrid($owner, $values = null)
public function renderGrid($owner = null, $values = null, $onlyValue = false, $therow = -1)
{
if ($values === null) {
$values = [];
}
$result = array();
$r = 1;
foreach ($values as $v) {

View File

@@ -10,7 +10,7 @@ class AppAssignSelfServiceValue extends BaseAppAssignSelfServiceValue
*
* return void
*/
public function create($applicationUid, $delIndex, array $arrayData, $dataVariable)
public function create($applicationUid, $delIndex, array $arrayData, $dataVariable = [])
{
try {
$cnn = Propel::getConnection(AppAssignSelfServiceValuePeer::DATABASE_NAME);

View File

@@ -571,7 +571,8 @@ class Language extends BaseLanguage
$buildhash = file_get_contents($buildhash);
$michelangeloFE = PATH_HTML . "lib/js";
$pathFileMafe = array_pop(glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE));
$array = glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE);
$pathFileMafe = array_pop($array);
if (file_exists($pathFileMafe) && is_readable($pathFileMafe)) {
$labels = self::readLabelsDirectory($pathFileMafe, true);
}

View File

@@ -798,7 +798,7 @@ class InstallerModule extends Controller
// CREATE databases wf_workflow
DB::connection(self::CONNECTION_TEST_INSTALL)
->statement("CREATE DATABASE IF NOT EXISTS $wf");
->statement("CREATE DATABASE IF NOT EXISTS $wf DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
self::setNewConnection(self::CONNECTION_INSTALL, $db_hostname, $db_username, $db_password, $wf, $db_port);
@@ -926,7 +926,7 @@ class InstallerModule extends Controller
->update([
'USR_USERNAME' => $adminUsername,
'USR_LASTNAME' => $adminUsername,
'USR_PASSWORD' => Bootstrap::hashPassword($adminPassword, Bootstrap::hashBcrypt)
'USR_PASSWORD' => G::encryptHash($adminPassword)
]);
DB::connection(self::CONNECTION_INSTALL)
@@ -935,7 +935,7 @@ class InstallerModule extends Controller
->update([
'USR_USERNAME' => $adminUsername,
'USR_LASTNAME' => $adminUsername,
'USR_PASSWORD' => Bootstrap::hashPassword($adminPassword, Bootstrap::hashBcrypt)
'USR_PASSWORD' => G::encryptHash($adminPassword)
]);
// Write the paths_installed.php file (contains all the information configured so far)
if (!file_exists(FILE_PATHS_INSTALLED)) {

View File

@@ -450,7 +450,7 @@ function custom_ldap_explode_dn($dn)
unset($result["count"]);
foreach ($result as $key => $value) {
$result[$key] = addcslashes(preg_replace("/\\\([0-9A-Fa-f]{2})/", function ($m) {
$result[$key] = addcslashes(preg_replace_callback("/\\\([0-9A-Fa-f]{2})/", function ($m) {
return chr(hexdec($m[1]));
}, $value), '<>,"');
}

View File

@@ -160,7 +160,8 @@ switch ($_POST['action']) {
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
$groupUid = $inputFilter->quoteSmart($_REQUEST['gUID'], Propel::getConnection("workflow")->getResource());
$connection = Propel::getConnection("workflow")->getResource();
$groupUid = $inputFilter->quoteSmart($_REQUEST['gUID'], $connection);
$groupUsers = new GroupUser();
$type = $_POST['action'] === 'assignedMembers' ? 'USERS' : 'AVAILABLE-USERS';

View File

@@ -2,7 +2,7 @@
class AdditionalTablesConsolidated extends AdditionalTables
{
public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid)
public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection = 'workflow')
{
try {
$aTypes = array('VARCHAR' => 'string',

View File

@@ -388,8 +388,9 @@ if ($action == "uploadFileNewProcess") {
$allowedExtensions = array ($processFileType
);
$allowedExtensions = array ('pm');
if (! in_array( end( explode( ".", $_FILES['PROCESS_FILENAME']['name'] ) ), $allowedExtensions )) {
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
$explode = explode(".", $_FILES['PROCESS_FILENAME']['name']);
if (!in_array(end($explode), $allowedExtensions)) {
throw new Exception(G::LoadTranslation("ID_FILE_UPLOAD_INCORRECT_EXTENSION"));
}
}

View File

@@ -35,6 +35,7 @@ try {
$oStepTrigger = new StepTrigger();
$oStepTrigger->removeTrigger( $_POST['TRI_UID'] );
$result = new stdClass();
$result->success = true;
$result->msg = G::LoadTranslation( 'ID_TRIGGERS_REMOVED' );

View File

@@ -513,7 +513,7 @@ class Installer
->where('USR_UID', '00000000000000000000000000000001')
->update([
'USR_USERNAME' => $this->options['admin']['username'],
'USR_PASSWORD' => Bootstrap::hashPassword($this->options['admin']['password'], Bootstrap::hashBcrypt)
'USR_PASSWORD' => G::encryptHash($this->options['admin']['password'])
]);
DB::connection(self::CONNECTION_INSTALL)
@@ -521,7 +521,7 @@ class Installer
->where('USR_UID', '00000000000000000000000000000001')
->update([
'USR_USERNAME' => $this->options['admin']['username'],
'USR_PASSWORD' => Bootstrap::hashPassword($this->options['admin']['password'], Bootstrap::hashBcrypt)
'USR_PASSWORD' => G::encryptHash($this->options['admin']['password'])
]);
}