This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2022 from YetiForceCompany/master
Master
- Loading branch information
Showing
710 changed files
with
19,100 additions
and
7,948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
/* {[The file is published on the basis of YetiForce Public License that can be found in the following directory: licenses/License.html]} */ | ||
$SECURITY_CONFIG = [ | ||
// Possible to reset the password while logging in (true/false) | ||
'RESET_LOGIN_PASSWORD' => false, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Multi reference value cron | ||
* @package YetiForce.Cron | ||
* @license licenses/License.html | ||
* @author Mariusz Krzaczkowski <[email protected]> | ||
*/ | ||
include_once 'include/main/WebUI.php'; | ||
$current_user = Users::getActiveAdminUser(); | ||
|
||
$db = PearDatabase::getInstance(); | ||
$log = vglobal('log'); | ||
$log = &LoggerManager::getLogger('MultiReferenceValue'); | ||
$log->info('Cron MultiReferenceValue - Start'); | ||
|
||
$result = $db->pquery('SELECT * FROM s_yf_multireference'); | ||
while ($multireference = $db->fetch_array($result)) { | ||
$entity = CRMEntity::getInstance($multireference['source_module']); | ||
$queryGenerator = new QueryGenerator($multireference['source_module'], $current_user); | ||
$queryGenerator->setFields(['id']); | ||
$queryGenerator->addCustomWere(['column' => $entity->table_index, 'operator' => '>', 'value' => $multireference['lastid'], 'glue' => 'AND']); | ||
$query = $queryGenerator->getQuery(); | ||
$query .= ' ORDER BY ' . $entity->table_index . ' ASC'; | ||
$recordsResult = $db->query($query); | ||
|
||
$fields = Vtiger_MultiReferenceValue_UIType::getMultiReferenceValueFields($multireference['source_module'], $multireference['dest_module']); | ||
while ($id = $db->getSingleValue($recordsResult)) { | ||
foreach ($fields as $field) { | ||
$fieldModel = new Vtiger_Field_Model(); | ||
$fieldModel->initialize($field); | ||
$UITypeModel = $fieldModel->getUITypeModel(); | ||
$UITypeModel->reloadValue($multireference['source_module'], $id); | ||
} | ||
$db->update('s_yf_multireference', ['lastid' => $id], 'source_module = ? AND dest_module = ?', [$multireference['source_module'], $multireference['dest_module']]); | ||
} | ||
$db->delete('s_yf_multireference', 'source_module = ? AND dest_module = ?', [$multireference['source_module'], $multireference['dest_module']]); | ||
} | ||
|
||
$log->info('Cron MultiReferenceValue - End'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.