Merged in MT-115 (pull request #4074)

MT-115
This commit is contained in:
Julio Cesar Laura Avendaño
2016-04-08 18:42:32 -04:00
7 changed files with 92 additions and 27 deletions

View File

@@ -282,6 +282,41 @@ class PMLicensedFeatures
"type" => "features",
"url" => "",
"version" => ""
),
15 => array(
"description" => "This Feature will allow to store all input, output and attached documents generated
in your processes in Google Drive.",
"enabled" => false,
"id" => "pmGoogleDrive",
"latest_version" => "",
"log" => null,
"name" => "pmGoogleDrive",
"nick" => "pmGoogleDrive",
"progress" => 0,
"publisher" => "Colosa",
"release_type" => "localRegistry",
"status" => "ready",
"store" => "00000000000000000000000000010015",
"type" => "features",
"url" => "",
"version" => ""
),
16 => array(
"description" => "Selective Import Export.",
"enabled" => false,
"id" => "selectiveImportExport",
"latest_version" => "",
"log" => null,
"name" => "selectiveImportExport",
"nick" => "selectiveImportExport",
"progress" => 0,
"publisher" => "Colosa",
"release_type" => "localRegistry",
"status" => "ready",
"store" => "00000000000000000000000000010016",
"type" => "features",
"url" => "",
"version" => ""
)
);

View File

@@ -61470,4 +61470,6 @@ INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADD
('SSO with an LDAP provider.','windowsSSO','windowsSSO','windowsSSO','Colosa','localRegistry','ready','00000000000000000000000000010011','features','','','0'),
('Integration with Gmail','pmGmail','pmGmail','pmGmail','Colosa','localRegistry','ready','00000000000000000000000000010012','features','','','0'),
('User-based Language Management.','userBasedLanguage','userBasedLanguage','userBasedLanguage','Colosa','localRegistry','ready','00000000000000000000000000010013','features','','','0'),
('User-based Time Zone Management.','userBasedTimeZone','userBasedTimeZone','userBasedTimeZone','Colosa','localRegistry','ready','00000000000000000000000000010014','features','','','0');
('User-based Time Zone Management.','userBasedTimeZone','userBasedTimeZone','userBasedTimeZone','Colosa','localRegistry','ready','00000000000000000000000000010014','features','','','0'),
('This Feature will allow to store all input, output and attached documents generated in your processes in Google Drive.','pmGoogleDrive','pmGoogleDrive','pmGoogleDrive','Colosa','localRegistry','ready','00000000000000000000000000010015','features','','','0'),
('Selective Import Export.','selectiveImportExport','selectiveImportExport','selectiveImportExport','Colosa','localRegistry','ready','00000000000000000000000000010016','features','','','0');

View File

@@ -104,5 +104,14 @@ if(sizeof($callBackFile)) {
}
$oHeadPublisher->assign("importProcessCallbackFile", $file);
$isGranularFeature = false;
/*----------------------------------********---------------------------------*/
$licensedFeatures = & PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=')) {
$isGranularFeature = true;
}
/*----------------------------------********---------------------------------*/
$oHeadPublisher->assign("isGranularFeature", $isGranularFeature);
G::RenderPage( 'publish', 'extJs' );

View File

@@ -31,20 +31,25 @@ class GranularExporter
public function export($objectList)
{
try {
$exportObject = new ExportObjects();
$objectList = $exportObject->mapObjectList($objectList);
$this->beforeExport($objectList);
foreach ($objectList as $data) {
$migrator = $this->factory->create($data);
$migratorData = $migrator->export($this->prjuid);
$this->mergeData($migratorData);
if (\PMLicensedFeatures::getSingleton()->verifyfeature
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
) {
$exportObject = new ExportObjects();
$objectList = $exportObject->mapObjectList($objectList);
$this->beforeExport($objectList);
foreach ($objectList as $data) {
$migrator = $this->factory->create($data);
$migratorData = $migrator->export($this->prjuid);
$this->mergeData($migratorData);
}
return $this->publish();
} else {
$exception = new ExportException();
$exception->setNameException(\G::LoadTranslation('ID_NO_LICENSE_SELECTIVEIMPORTEXPORT_ENABLED'));
throw($exception);
}
return $this->publish();
} catch (ExportException $e) {
return array(
'success' => false,
'message' => $e->getMessage()
);
} catch (\Exception $e) {
throw $e;
}
}

View File

@@ -161,26 +161,39 @@ class GranularImporter
public function import($objectList)
{
try {
$objectList = $this->reorderImportOrder($objectList);
foreach ($objectList as $data) {
$objClass = $this->factory->create($data['name']);
if (is_object($objClass)) {
$dataImport = $data['data'][$data['name']];
$replace = ($data['value'] == 'replace') ? true : false;
$migratorData = $objClass->import($dataImport, $replace);
if (\PMLicensedFeatures::getSingleton()->verifyfeature
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
) {
$objectList = $this->reorderImportOrder($objectList);
foreach ($objectList as $data) {
$objClass = $this->factory->create($data['name']);
if (is_object($objClass)) {
$dataImport = $data['data'][$data['name']];
$replace = ($data['value'] == 'replace') ? true : false;
$migratorData = $objClass->import($dataImport, $replace);
}
}
} else {
$exception = new ImportException();
$exception->setNameException(\G::LoadTranslation('ID_NO_LICENSE_SELECTIVEIMPORTEXPORT_ENABLED'));
throw($exception);
}
} catch (\Exception $e) {
$exception = new ImportException('Please review your current process definition
if (get_class($e) === 'ProcessMaker\BusinessModel\Migrator\ImportException') {
throw $e;
} else {
$exception = new ImportException('Please review your current process definition
for missing elements, it\'s recommended that a new process should be exported
with all the elements.');
throw $exception;
throw $exception;
}
}
}
/**
* @param $objectList
* @param bool $generateUid
* @param $option
* @return bool
* @throws \Exception
*/

View File

@@ -66,7 +66,8 @@ class System extends Api
$enabledFeatures = array();
/*----------------------------------********---------------------------------*/
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=',
'oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=');
'oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=',
'jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=');
foreach ($keys as $key) {
if (\PMLicensedFeatures
::getSingleton()

View File

@@ -251,7 +251,7 @@ Ext.onReady(function(){
//Code export - exportGranular (handle)
var exportProcessOption;
/*----------------------------------********---------------------------------*/
if (true) {
if (isGranularFeature) {
exportProcessOption = {
xtype: "tbsplit",
id: "export",
@@ -532,7 +532,7 @@ Ext.onReady(function(){
//code export - exportGranular (handler)
var menuExportOption;
/*----------------------------------********---------------------------------*/
if (true) {
if (isGranularFeature) {
menuExportOption = {
text: _("ID_EXPORT"),
icon: "/images/export.png",