MT-85: The same validation has been added to the keep uid process.

This commit is contained in:
Gustavo Adolfo Cruz Laura
2016-04-02 10:57:56 -04:00
parent 2783d0498f
commit f20b3dd48a
2 changed files with 61 additions and 35 deletions

View File

@@ -182,16 +182,13 @@ class GranularImporter
* @return bool
* @throws \Exception
*/
public function validateImportData($objectList, $generateUid = false)
public function validateImportData($objectList)
{
try {
if ($generateUid) {
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
$exception = new ImportException();
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
throw($exception);
}
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
$exception = new ImportException();
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
throw($exception);
}
return true;
} catch (\Exception $e) {

View File

@@ -8,6 +8,9 @@ var processesGrid,
winDesigner,
newTypeProcess,
affectedGroups,
exportButton,
exportMenu,
exportComponent,
processObjectsArray;
/**
@@ -23,6 +26,56 @@ importProcessGlobal.isGranularImport = false;
importProcessGlobal.objectGranularImport;
importProcessGlobal.objectsToImport = [];
exportButton = {
id: "export",
disabled: true,
text: _("ID_EXPORT"),
iconCls: "silk-add",
icon: "/images/export.png",
handler: function () {
exportProcess();
}
};
/*----------------------------------********---------------------------------*/
/**Begin enterprise export component**/
exportMenu = {
xtype: "tbsplit",
id: "export",
disabled: true,
text: _("ID_EXPORT"),
iconCls: "silk-add",
icon: "/images/export.png",
menu: [
{
text: _("ID_NORMAL_EXPORT"),
iconCls: "silk-add",
icon: "",
handler: function ()
{
exportProcess();
}
}, {
text: _("ID_GRANULAR_EXPORT"),
iconCls: "silk-add",
icon: "",
handler: function ()
{
exportImportProcessObjects('export');
}
}
]
};
/**End enterprise export component**/
/*----------------------------------********---------------------------------*/
exportComponent = exportButton;
/*----------------------------------********---------------------------------*/
/**Begin enterprise component assignment**/
exportComponent = exportMenu;
/**End enterprise component assignment**/
/*----------------------------------********---------------------------------*/
new Ext.KeyMap(document, {
key: Ext.EventObject.F5,
fn: function(keycode, e) {
@@ -355,33 +408,9 @@ Ext.onReady(function(){
handler:deleteProcess
},{
xtype: 'tbseparator'
},{
xtype: "tbsplit",
id: "export",
disabled: true,
text: _("ID_EXPORT"),
iconCls: "silk-add",
icon: "/images/export.png",
menu: [
{
text: _("ID_NORMAL_EXPORT"),
iconCls: "silk-add",
icon: "",
handler: function ()
{
exportProcess();
}
}, {
text: _("ID_GRANULAR_EXPORT"),
iconCls: "silk-add",
icon: "",
handler: function ()
{
exportImportProcessObjects('export');
}
}
]
},{
},
exportComponent
,{
text: _('ID_IMPORT'),
iconCls: 'silk-add',
icon: '/images/import.gif',