Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Added minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rskrzypczak committed Oct 31, 2023
1 parent 5207498 commit ba16ed0
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
<div class="listViewActionsDi row my-2">
<div class="col-lg-4 btn-toolbar d-flex justify-content-between justify-content-lg-start">
<button class="btn btn-success addButton" {if stripos($MODULE_MODEL->getCreateViewUrl(), 'javascript:')===0} onclick="{substr($MODULE_MODEL->getCreateViewUrl()):strlen('javascript:')};"
<button class="btn btn-success addButton" {if stripos($MODULE_MODEL->getCreateViewUrl(), 'javascript:')===0} onclick="{substr($MODULE_MODEL->getCreateViewUrl(), strlen('javascript:'))};"
{else} onclick='window.location.href = "{$MODULE_MODEL->getCreateViewUrl()|escape}"'
{/if}>
<i class="fas fa-plus"></i>&nbsp;
Expand Down
11 changes: 1 addition & 10 deletions layouts/basic/modules/Settings/Workflows/Tasks/VTEmailTask.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<select id="smtp_{\App\Layout::getUniqueId()}" name="smtp" class="select2 form-control "
data-placeholder="{\App\Language::translate('LBL_SELECT_OPTIONS',$QUALIFIED_MODULE)}">
<option value="">{\App\Language::translate('LBL_DEFAULT')}</option>
{foreach from=App\Mail::getSmtpServers(true) item=ITEM key=ID}
{foreach from=App\Mail::getAll() item=ITEM key=ID}
<option value="{$ID}" {if isset($TASK_OBJECT->smtp) && $TASK_OBJECT->smtp == $ID}selected{/if}>{\App\Purifier::encodeHtml($ITEM['name'])}
{if !empty($ITEM['host'])} ({\App\Purifier::encodeHtml($ITEM['host'])}){/if}
</option>
Expand All @@ -28,15 +28,6 @@
</div>
</span>
</div>
<div class="form-row pb-3">
<span class="col-md-7 form-row">
<span class="col-md-3 col-form-label">{\App\Language::translate('LBL_ATTACH_DOCS_FROM', $QUALIFIED_MODULE)}</span>
<div class="col-md-9">
{include file=\App\Layout::getTemplatePath('Tasks/AttatchDocumentsFrom.tpl', $QUALIFIED_MODULE)}
</div>
</span>

</div>
<div class="form-row pb-3">
<span class="col-md-7 form-row">
<span class="col-md-3 col-form-label"></span>
Expand Down
2 changes: 1 addition & 1 deletion layouts/basic/modules/Settings/YetiForce/ProductModal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="col-sm-11 col-md-9">
<div class="d-flex flex-column h-100">
<h5 class="h3">
{App\Purifier::encodeHtml($PRODUCT->getLabel())}
{$PRODUCT->getLabel()}
</h5>
<div>{$PRODUCT->getDescription()}</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion modules/Accounts/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getAccountHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance('Accounts');
$recordModel->setId($accountId);
$hierarchy['entries'][$accountId][0]['data'] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$accountId][0]['data'] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/Announcements/models/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ public function getUsers($showAll = true)
*/
public function getMarkInfo($record, $userId)
{
return (new App\Db\Query())->from('u_#__announcement_mark')->where(['announcementid' => $record, 'userid' => $userId])->one();
return (new App\Db\Query())->from('u_#__announcement_mark')->where(['announcementid' => $record, 'userid' => $userId])->one() ?: [];
}
}
2 changes: 1 addition & 1 deletion modules/Competition/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance('Competition');
$recordModel->setId($competitionId);
$hierarchy['entries'][$competitionId][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] .
$hierarchy['entries'][$competitionId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] .
'</a>';
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/Contacts/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance($this->getModuleName());
$recordModel->setId($competitionId);
$hierarchy['entries'][$competitionId][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] .
$hierarchy['entries'][$competitionId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] .
'</a>';
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/HelpDesk/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function getHierarchyDetails(): array
preg_match('/<a(.*)>(.*)<\\/a>/i', $info[0], $name);
$recordModel = Vtiger_Record_Model::getCleanInstance('HelpDesk');
$recordModel->setId($id);
$hierarchy['entries'][$id][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/IStorages/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance('IStorages');
$recordModel->setId($storageId);
$hierarchy['entries'][$storageId][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$storageId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/MultiCompany/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance('MultiCompany');
$recordModel->setId($id);
$hierarchy['entries'][$id][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/OSSEmployees/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getEmployeeHierarchy()
}
$recordModel = Vtiger_Record_Model::getCleanInstance('OSSEmployees');
$recordModel->setId($employeeId);
$hierarchy['entries'][$employeeId][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $label . '</a>';
$hierarchy['entries'][$employeeId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $label . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/Partners/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getHierarchy(): array

$recordModel = Vtiger_Record_Model::getCleanInstance($this->getModuleName());
$recordModel->setId($id);
$hierarchy['entries'][$id][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/Project/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getHierarchy(): array
preg_match('/<a(.*)>(.*)<\\/a>/i', $info[0], $name);
$recordModel = Vtiger_Record_Model::getCleanInstance('Project');
$recordModel->setId($id);
$hierarchy['entries'][$id][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
2 changes: 1 addition & 1 deletion modules/SSalesProcesses/models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getHierarchy()

$recordModel = Vtiger_Record_Model::getCleanInstance('SSalesProcesses');
$recordModel->setId($storageId);
$hierarchy['entries'][$storageId][0] = $dashes[0] . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
$hierarchy['entries'][$storageId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
}
}
return $hierarchy;
Expand Down
9 changes: 7 additions & 2 deletions public_html/layouts/resources/Fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,12 +921,17 @@ window.App.Fields = {
validate(element) {
let status = true,
params;
if (element.data('purifyMode')) {
const form = element.closest('form');
if (
element.data('purifyMode') ||
!form.find('[name="module"]').length ||
form.find('[name="parent"]').val() === 'Settings'
) {
params = {
module: 'Users',
action: 'Fields',
mode: 'validateByMode',
purifyMode: element.data('purifyMode'),
purifyMode: element.data('purifyMode') || 'Html',
value: element.val()
};
} else {
Expand Down

0 comments on commit ba16ed0

Please sign in to comment.