Skip to content

Commit

Permalink
Improvement - SinergiaDA - Varios cambios (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanSTIC authored Jun 4, 2024
1 parent 9052d35 commit e2d1cfb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,7 @@ codeception.yml
.env.dev

# Ignore application concatenated files
/custom/application/Ext/*
/custom/application/Ext/*

# Ignore SDA check rebuild errors
sdaRebuildError.txt
13 changes: 0 additions & 13 deletions SticInclude/SinergiaDA.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,6 @@ public function createViews($callUpdateModel = true, $rebuildFilter = 'all')

if (isset($fieldV['link']) && !empty($fieldV['link']) && $fieldV['name'] != 'assigned_user_name') {

//*********************** */
// Es una relación 1:n normal,
if ($fieldV['module'] == $moduleName) {
// The standar relationships between the same module are directly excluded, because they cannot be represented in EDA
continue 2;
}

// Build and obtain the translated value from the other side of the relationship so it can be properly displayed in SinergiaDA
$joinModuleRelLabel = 'LBL_' . strtoupper($fieldV['link']) . '_FROM_' . strtoupper($moduleName) . '_TITLE';
$joinLabel = translate($joinModuleRelLabel, $fieldV['module']);
Expand Down Expand Up @@ -622,12 +615,6 @@ public function createViews($callUpdateModel = true, $rebuildFilter = 'all')
$edaPrecision = $fieldV['type'] == 'currency' ? 2 : 0;
$edaPrecision = $fieldV['precision'] ? $fieldV['precision'] : $edaPrecision;
break;
case 'id':
// set id as numeric to allow counts and distinct counts
$edaType = 'numeric';
$edaPrecision = 0;
$edaAggregations = 'count,count_distinct,none';
break;
case 'date':
case 'datetime':
case 'datetimecombo':
Expand Down
3 changes: 3 additions & 0 deletions SticInclude/SinergiaDARebuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ public static function rebuild($callUpdateModel = false, $rebuildFilter = 'all')
$msg .= $match . "<br>";
}

unlink('sdaRebuildError');

// Return 'ok' or the error message
if (empty($msg)) {
return 'ok';
} else {
sugar_file_put_contents('sdaRebuildError.txt', $msg);
return $msg;
}
die();
Expand Down

0 comments on commit e2d1cfb

Please sign in to comment.