diff --git a/src/System.php b/src/System.php index 0978619..e5b58f7 100644 --- a/src/System.php +++ b/src/System.php @@ -100,6 +100,22 @@ public function repairAll($executeSql = false, $userId = '1') return $this->getMessages(); } + /** + * Rebuild relationships for sugarcrm + * @param boolean $executeSql Launch the SQL queries + * @param string $user_id User id of the admin user + * @return array Messages + */ + public function rebuildRelationship($executeSql = false, $userId = '1') + { + $this->setUpQuickRepair($userId); + include 'modules/Administration/RebuildRelationship.php'; + $repair = new \RepairAndClear(); + $repair->repairAndClearAll(array('clearAll'), array(translate('LBL_ALL_MODULES')), $executeSql, true, ''); + \LanguageManager::removeJSLanguageFiles(); + return $this->getMessages(); + } + /** * Rebuild only Extensions. * @param array $modules Rebuild only the specified modules