Compare commits

..

7 Commits

5 changed files with 15 additions and 10 deletions

View File

@@ -23,7 +23,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\Application\WebPage\JsonPage;
use Combodo\iTop\Application\WebPage\AjaxPage;
require_once(APPROOT.'application/utils.inc.php');
require_once(APPROOT.'core/log.class.inc.php');
@@ -110,15 +110,14 @@ function DoBackup($sTargetFile)
*/
function ReportStatus($sMessage, $bSuccess, $iErrorCode = 0, $aMoreFields = array())
{
// Do not use AjaxPage during setup phases, because it uses InterfaceDiscovery in Twig compilation
$oPage = new JsonPage();
$oPage = new AjaxPage("");
$oPage->SetContentType('application/json');
$aResult = array(
'code' => $iErrorCode,
'message' => $sMessage,
'fields' => $aMoreFields
);
$oPage->SetData($aResult);
$oPage->SetOutputDataOnly(true);
$oPage->add(json_encode($aResult));
$oPage->output();
}

View File

@@ -338,6 +338,9 @@ HTML
<value id="IMAP">
<code>IMAP</code>
</value>
<value id="WEBHOOK">
<code>WEBHOOK</code>
</value>
</values>
<sql>scope</sql>
<default_value>SMTP,IMAP</default_value>
@@ -660,6 +663,9 @@ HTML
<value id="IMAP">
<code>IMAP</code>
</value>
<value id="WEBHOOK">
<code>WEBHOOK</code>
</value>
</values>
<sql>scope</sql>
<default_value>SMTP,IMAP</default_value>

View File

@@ -31,7 +31,7 @@ $.fn.modal.Constructor.prototype.enforceFocus = function () {
var $parent = $(e.target.parentNode);
if ($modalElement[0] !== e.target && !$modalElement.has(e.target).length &&
!$parent.hasClass('ck-input')) {
e.target.focus()
$(e.target.activeElement).focus();
}
})
};

View File

@@ -383,13 +383,13 @@ class NavigationMenu extends UIBlock implements iKeyboardShortcut
}
$sPageJS = $oPage->GetJS();
$oPage->add_ready_script('$(\'[data-role="ibo-navigation-menu--silo-selection--form"] #org_id\').on(\'extkeychange\', function() { $(\'[data-role="ibo-navigation-menu--silo-selection--form"]\').submit(); } );');
$oPage->add_ready_script('$(\'[data-role="ibo-navigation-menu--silo-selection--form"] #label_org_id\').on(\'click\', function() { if ($(\'[data-role="ibo-navigation-menu--silo-selection--form"] #org_id\').val() == \'\') { $(this).val(\'\'); } } );');
$sPageReadyJS = $oPage->GetReadyJS();
$this->aSiloSelection['js'] =
<<<JS
$sPageJS
$sPageReadyJS
$('[data-role="ibo-navigation-menu--silo-selection--form"] #org_id').on('extkeychange', function() { $('[data-role="ibo-navigation-menu--silo-selection--form"]').submit(); } )
$('[data-role="ibo-navigation-menu--silo-selection--form"] #label_org_id').on('click', function() { if ($('[data-role="ibo-navigation-menu--silo-selection--form"] #org_id').val() == '') { $(this).val(''); } } );
$sAddClearButton
JS;
}

View File

@@ -919,7 +919,7 @@ class WebPage implements Page
// Check if URI is absolute ("://" do allow any protocol), otherwise warn that it's a deprecated behavior
if (false === stripos($sLinkedScriptAbsUrl, "://")) {
IssueLog::Warning("Linked script added to page via deprecated API with a non absolute URL, it may lead to it not being loaded and causing javascript errors.", null, [
IssueLog::Debug("Linked script added to page with a non absolute URL, it may lead to it not being loaded and causing javascript errors. See alternatives WebPage::LinkScriptFromXXX", null, [
"linked_script_url" => $sLinkedScriptAbsUrl,
"request_uri" => $_SERVER['REQUEST_URI'] ?? '' /* CLI */,
]);
@@ -1188,7 +1188,7 @@ JS;
// Check if URI is absolute ("://" do allow any protocol), otherwise warn that it's a deprecated behavior
if (false === stripos($sLinkedStylesheet, "://")) {
IssueLog::Warning("Linked stylesheet added to page via deprecated API with a non absolute URL, it may lead to it not being loaded and causing visual glitches.", null, [
IssueLog::Debug("Linked stylesheet added to page with a non absolute URL, it may lead to it not being loaded and causing visual glitches. See alternatives WebPage::LinkStylesheetFromXXX", null, [
"linked_stylesheet_url" => $sLinkedStylesheet,
"request_uri" => $_SERVER['REQUEST_URI'] ?? '' /* CLI */,
]);