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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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