mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-14 07:54:10 +01:00
Compare commits
2 Commits
issue/auto
...
3.2.0-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
330e8f48da | ||
|
|
2147ae9105 |
@@ -23,7 +23,7 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
use Combodo\iTop\Application\WebPage\AjaxPage;
|
||||
use Combodo\iTop\Application\WebPage\JsonPage;
|
||||
|
||||
require_once(APPROOT.'application/utils.inc.php');
|
||||
require_once(APPROOT.'core/log.class.inc.php');
|
||||
@@ -110,14 +110,15 @@ function DoBackup($sTargetFile)
|
||||
*/
|
||||
function ReportStatus($sMessage, $bSuccess, $iErrorCode = 0, $aMoreFields = array())
|
||||
{
|
||||
$oPage = new AjaxPage("");
|
||||
$oPage->SetContentType('application/json');
|
||||
// Do not use AjaxPage during setup phases, because it uses InterfaceDiscovery in Twig compilation
|
||||
$oPage = new JsonPage();
|
||||
$aResult = array(
|
||||
'code' => $iErrorCode,
|
||||
'message' => $sMessage,
|
||||
'fields' => $aMoreFields
|
||||
);
|
||||
$oPage->add(json_encode($aResult));
|
||||
$oPage->SetData($aResult);
|
||||
$oPage->SetOutputDataOnly(true);
|
||||
$oPage->output();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user