Skip to content

Commit

Permalink
feat(Import) Import_Launch_EventsAndWorkflows global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Jun 7, 2020
1 parent 1430c55 commit 36f0fee
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions build/changeSets/DefineGlobalVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public function applyChange() {
'Import_Full_CSV',
'Import_Batch_Limit',
'Import_Scheduled_Limit',
'Import_Launch_EventsAndWorkflows',
'Export_Field_Separator_Symbol',
'Export_RelatedField_GetValueFrom',
'Export_RelatedField_NameForSearch',
Expand Down
1 change: 0 additions & 1 deletion cron/modules/Import/ScheduledImport.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

global $VTIGER_BULK_SAVE_MODE;
$previousBulkSaveMode = isset($VTIGER_BULK_SAVE_MODE) ? $VTIGER_BULK_SAVE_MODE : false;
$VTIGER_BULK_SAVE_MODE = true;

require_once 'modules/Import/controllers/Import_Data_Controller.php';
Import_Data_Controller::runScheduledImport();
Expand Down
7 changes: 7 additions & 0 deletions modules/GlobalVariable/language/en_us.gvdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@
'values' => '',
'definition' => 'Threshold import record limit for immediate import. If record count is more than this, then the import is scheduled through cron job. Default value is 1000',
),
'Import_Launch_EventsAndWorkflows' => array(
'status' => 'Implemented',
'valuetype' => 'String',
'category' => 'Application',
'values' => 'yes | no',
'definition' => 'Launch events and workflows when importing records. Default value is no',
),
'Export_Field_Separator_Symbol' => array(
'status' => 'Implemented',
'valuetype' => 'character',
Expand Down
7 changes: 7 additions & 0 deletions modules/GlobalVariable/language/es_es.gvdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,13 @@
'values' => '',
'definition' => 'Límite de registros que se pueden importar en línea. Si el número de registros a importar es mayor a este número, entonces la importación se realizará de manera desatendida por la tarea de programación correspondiente. El valor predeterminado es 1000',
),
'Import_Launch_EventsAndWorkflows' => array(
'status' => 'Implementada',
'valuetype' => 'Texto',
'category' => 'Aplicación',
'values' => 'yes | no',
'definition' => 'Ejecutar eventos y flujos de trabajo al importar registros. El valor por defecto es no',
),
'Export_Field_Separator_Symbol' => array(
'status' => 'Implementada',
'valuetype' => 'carácter',
Expand Down
7 changes: 7 additions & 0 deletions modules/GlobalVariable/language/fr_fr.gvdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@
'values' => '',
'definition' => 'Seuil limite du nombre d\'enregistrements à importer d\'un coup. Si le nombre d\'enregistrements est supéieur à ce seuil alors l\'importation est programmée sous forme de cron job. La valeur par défaut est (1000) enregistrements',
),
'Import_Launch_EventsAndWorkflows' => array(
'status' => 'Implemented',
'valuetype' => 'String',
'category' => 'Application',
'values' => 'yes | no',
'definition' => 'Launch events and workflows when importing records. Default value is no',
),
'Export_Field_Separator_Symbol' => array(
'status' => 'Implemented',
'valuetype' => 'character',
Expand Down
2 changes: 2 additions & 0 deletions modules/Import/controllers/Import_Data_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ public function getImportStatusCount() {
}

public static function runScheduledImport() {
global $VTIGER_BULK_SAVE_MODE;
require_once 'modules/Emails/mail.php';
require_once 'modules/Emails/Emails.php';
global $current_user,$coreBOS_app_name;
Expand All @@ -604,6 +605,7 @@ public static function runScheduledImport() {
foreach ($scheduledImports as $importDataController) {
$current_user = $importDataController->user;
$importDataController->batchImport = false;
$VTIGER_BULK_SAVE_MODE = (GlobalVariable::getVariable('Import_Launch_EventsAndWorkflows', 'no', $importDataController->module)=='no'); //true;

if (!$importDataController->initializeImport()) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion modules/Import/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
global $current_user, $VTIGER_BULK_SAVE_MODE;

$previousBulkSaveMode = isset($VTIGER_BULK_SAVE_MODE) ? $VTIGER_BULK_SAVE_MODE : false;
$VTIGER_BULK_SAVE_MODE = true;
$VTIGER_BULK_SAVE_MODE = (GlobalVariable::getVariable('Import_Launch_EventsAndWorkflows', 'no', $_REQUEST['module'])=='no'); //true;
$requestObject = new Import_API_Request($_REQUEST);
Import_Index_Controller::process($requestObject, $current_user);
$VTIGER_BULK_SAVE_MODE = $previousBulkSaveMode;
Expand Down
2 changes: 1 addition & 1 deletion modules/cbMap/processmap/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ private function doImportDirect($csvfile) {
private function doImportcoreBOS($arguments) {
global $current_user, $VTIGER_BULK_SAVE_MODE, $adb;
$previousBulkSaveMode = isset($VTIGER_BULK_SAVE_MODE) ? $VTIGER_BULK_SAVE_MODE : false;
$VTIGER_BULK_SAVE_MODE = true;
require_once 'modules/Import/api/Request.php';
include_once 'modules/Import/controllers/Import_Controller.php';
$rs = $adb->pquery('select module,field_mapping,defaultvalues from vtiger_import_maps where id=?', array($this->mapping['mapid']));
$VTIGER_BULK_SAVE_MODE = (GlobalVariable::getVariable('Import_Launch_EventsAndWorkflows', 'no', $rs->fields['module'])=='no'); //true;
$requestArray = array(
'module' => $rs->fields['module'],
'action' => 'Import',
Expand Down

0 comments on commit 36f0fee

Please sign in to comment.