Fixes made according to the current code review status.

This commit is contained in:
Gustavo Adolfo Cruz Laura
2016-03-23 23:28:40 -04:00
parent 79e5f46ae9
commit 8e1a15b7dd
23 changed files with 28 additions and 140 deletions

View File

@@ -1904,7 +1904,7 @@ class Processes
foreach ($aInput as $key => $row) {
$oInput = new InputDocument();
if ($oInput->InputExists( $row['INP_DOC_UID'] )) {
$oInput->update( $row );
$oInput->update($row);
} else {
$oInput->create($row);
}
@@ -2019,7 +2019,6 @@ class Processes
{
foreach ($aOutput as $key => $row) {
$oOutput = new OutputDocument();
//unset ($row['TAS_UID']);
if (!$oOutput->OutputExists( $row['OUT_DOC_UID'] )) {
$oOutput->update( $row );
} else {
@@ -2725,8 +2724,8 @@ class Processes
public function createObjectPermissionRows ($aPermission)
{
try {
$oPermission = new ObjectPermission();
foreach ($aPermission as $key => $row) {
$oPermission = new ObjectPermission();
if ($oPermission->Exists( $row['OP_UID'] )) {
$oPermission->remove( $row['OP_UID'] );
}
@@ -2744,8 +2743,8 @@ class Processes
public function updateObjectPermissionRows ($aPermission)
{
try {
$oPermission = new ObjectPermission();
foreach ($aPermission as $key => $row) {
$oPermission = new ObjectPermission();
if ($oPermission->Exists( $row['OP_UID'] )) {
$oPermission->update( $row['OP_UID'] );
} else {
@@ -2809,9 +2808,8 @@ class Processes
*/
public function updateDynaformRows ($aDynaform)
{
$oDynaform = new Dynaform();
foreach ($aDynaform as $key => $row) {
$oDynaform = new Dynaform();
//unset ($row['TAS_UID']);
if (!$oDynaform->exists( $row['DYN_UID'] )) {
$res = $oDynaform->update( $row );
} else {
@@ -2923,8 +2921,8 @@ class Processes
*/
public function updateTriggerRows($aTrigger)
{
$oTrigger = new Triggers();
foreach ($aTrigger as $key => $row) {
$oTrigger = new Triggers();
if ($oTrigger->TriggerExists($row['TRI_UID'])) {
$oTrigger->update($row);
} else {
@@ -3593,8 +3591,8 @@ class Processes
public function updateDBConnectionsRows ($aConnections)
{
try {
$oConnection = new DbSource();
foreach ($aConnections as $sKey => $aRow) {
$oConnection = new DbSource();
if ($oConnection->Exists( $aRow['DBS_UID'], $aRow['PRO_UID'] )) {
$oConnection->update( $aRow );
} else {
@@ -3658,7 +3656,7 @@ class Processes
$oRep->create( $aRow );
}
}
#@!neyek
#@!neyekj
/**

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:25 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,9 +1,4 @@
<?php
/**
*
*
*
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/22/16
* Time: 10:06 AM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -30,12 +30,12 @@ class ExportObjects
*/
public function objectList($objectsEnable = '')
{
$grid = [];
try {
$aObjectsEnable = explode('|', $objectsEnable);
foreach ($this->objectsList as $key => $val) {
$key++;
$grid[] = array(
'OBJECT_ID' => $key,
'OBJECT_ID' => $key+1,
'OBJECT_NAME' => $val,
'OBJECT_ACTION' => 1,
'OBJECT_ENABLE' => in_array(strtoupper(str_replace(' ', '',$val)), $aObjectsEnable)

View File

@@ -1,9 +1,4 @@
<?php
/**
*
*
*
*/
namespace ProcessMaker\BusinessModel\Migrator;
use ProcessMaker\Util;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:21 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;
@@ -60,7 +54,7 @@ class FilesMigrator implements Importable, Exportable
}
file_put_contents($filename, $file["file_content"]);
chmod($filename, 0775);
@chmod($filename, 0775);
}
}
}

View File

@@ -1,7 +1,4 @@
<?php
/**
* ProcessMaker.
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/22/16
* Time: 10:06 AM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:31 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/18/16
* Time: 10:34 AM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/18/16
* Time: 10:36 AM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:30 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/18/16
* Time: 3:13 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;
@@ -23,7 +17,7 @@ class PMXPublisher
$outputFile = $this->truncateName($filename);
file_put_contents($outputFile, $data);
chmod($outputFile, 0755);
@chmod($outputFile, 0755);
return basename($outputFile);
}

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:39 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/18/16
* Time: 10:28 AM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:36 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:38 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:38 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:28 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;
@@ -58,7 +52,7 @@ class TemplatesMigrator implements Importable, Exportable
}
file_put_contents($filename, $file["file_content"]);
chmod($filename, 0775);
@chmod($filename, 0775);
}
}
}

View File

@@ -1,10 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: gustav
* Date: 3/17/16
* Time: 4:29 PM
*/
namespace ProcessMaker\BusinessModel\Migrator;

View File

@@ -248,7 +248,6 @@ abstract class Importer
$this->importData = $this->load();
//$this->validateImportData();
}
public function setData($key, $value)

View File

@@ -48,6 +48,7 @@ Ext.apply(Ext.form.VTypes, {
});
Ext.onReady(function(){
var i;
setExtStateManagerSetProvider('gridProcessMain');
Ext.QuickTips.init();
@@ -213,7 +214,7 @@ Ext.onReady(function(){
arrayMenuNewOption.push(mnuNewProject);
}
for (var i = 0; i <= arrayMenuNewOptionPlugin.length - 1; i++) {
for (i = 0; i <= arrayMenuNewOptionPlugin.length - 1; i++) {
try {
if (typeof(arrayMenuNewOptionPlugin[i].handler) != "undefined") {
eval("arrayMenuNewOptionPlugin[i].handler = " + arrayMenuNewOptionPlugin[i].handler + ";");
@@ -535,7 +536,7 @@ Ext.onReady(function(){
}
];
for (var i = 0; i <= arrayContextMenuOptionPlugin.length - 1; i++) {
for (i = 0; i <= arrayContextMenuOptionPlugin.length - 1; i++) {
try {
if (typeof(arrayContextMenuOptionPlugin[i].handler) != "undefined") {
eval("arrayContextMenuOptionPlugin[i].handler = " + arrayContextMenuOptionPlugin[i].handler + ";");
@@ -764,6 +765,7 @@ editNewProcess = function(){
deleteProcess = function(){
var rows = processesGrid.getSelectionModel().getSelections();
var i;
if( rows.length > 0 ) {
isValid = true;
errLog = Array();
@@ -1000,8 +1002,8 @@ function exportImportProcessObjects(typeAction)
storeActionField = new Ext.data.ArrayStore({
fields: ['value', 'text'],
data: [
[1, 'Add to Existing'],
[2, 'Replace All']
[1, _('ID_UPDATE')],
[2, _('ID_OVERWRITE')]
]
});
checkBoxSelMod = new Ext.grid.CheckboxSelectionModel();
@@ -1054,7 +1056,7 @@ function exportImportProcessObjects(typeAction)
return storeActionField.getAt(recordIndex).get('text');
}
},
{header: 'Name', dataIndex: 'OBJECT_ENABLE', hidden: true},
{header: 'Name', dataIndex: 'OBJECT_ENABLE', hidden: true}
]
}),
store: storeGrid,
@@ -1068,13 +1070,8 @@ function exportImportProcessObjects(typeAction)
grid.store.on('load', function(store, records, options){
grid.getSelectionModel().selectAll();
store.each(function(row, j){
if(inArray(row.get('OBJECT_ID'),importProcessGlobal.objectGranularImport)) {
//grid.getSelectionModel().selectRow(j, true);
} else {
/*disable row*/
if(!inArray(row.get('OBJECT_ID'),importProcessGlobal.objectGranularImport)) {
store.remove(row);
/* store.rejectChanges(row);
row.cancelEdit();*/
}
});
});
@@ -1100,6 +1097,7 @@ function exportImportProcessObjects(typeAction)
text : buttonLabel,
handler : function() {
var selectedObjects = gridProcessObjects.getSelectionModel().getSelections();
var i;
if(selectedObjects.length < 1) {
Ext.Msg.show({
title: _("ID_INFORMATION"),
@@ -1148,8 +1146,9 @@ function exportImportProcessObjects(typeAction)
}
function inArray(needle, haystack) {
var i;
var length = haystack.length;
for(var i = 0; i < length; i++) {
for(i = 0; i < length; i++) {
if(haystack[i] == needle) return true;
}
return false;
@@ -1395,9 +1394,10 @@ importProcessExistGroup = function()
affectedGroupsList = function()
{
var i;
var arrayGroups = affectedGroups.split(", ");
var tableGroups = "<table width='100%' border='0' cellpadding='5'>"
for(var i = 0; i < arrayGroups.length; i++) {
for(i = 0; i < arrayGroups.length; i++) {
tableGroups += "<tr><td>"+arrayGroups[i]+"</td></tr>";
}
tableGroups += "</table>";
@@ -1833,7 +1833,7 @@ importProcess = function()
importProcessGlobal.groupBeforeAccion = resp_.groupBeforeAccion;
importProcessExistGroup();
}
} else if (resp_.ExistProcessInDatabase == "1") {
} else if (resp_.ExistProcessInDatabase === "1") {
importProcessGlobal.proFileName = resp_.proFileName;
importProcessExistProcess();
}
@@ -1995,7 +1995,7 @@ importProcessBpmnSubmit = function () {
function activeDeactive(){
var rows = processesGrid.getSelectionModel().getSelections();
var i;
if( rows.length > 0 ) {
var ids = '';
for(i=0; i<rows.length; i++) {
@@ -2033,7 +2033,7 @@ function activeDeactive(){
function enableDisableDebug()
{
var rows = processesGrid.getSelectionModel().getSelections();
var i;
if( rows.length > 0 ) {
var ids = '';
for(i=0; i<rows.length; i++)