diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 1de1c5c9e..c00c9ccf8 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -1315,14 +1315,15 @@ abstract class DBObject implements iDisplay * @throws \CoreException * @throws \DictExceptionMissingString */ - public static function MakeHyperLink($sObjClass, $sObjKey, $sHtmlLabel = '', $sUrlMakerClass = null, $bWithNavigationContext = true, $bArchived = false, $bObsolete = false, $bIgnorePreview = false) + public static function MakeHyperLink($sObjClass, $sObjKey, $sHtmlLabel = '', $sUrlMakerClass = null, $bWithNavigationContext = true, $bArchived = false, $bObsolete = false, $bIgnorePreview = false, $sFilter = null) { - if ($sObjKey <= 0) return ''.Dict::S('UI:UndefinedObject').''; // Objects built in memory have negative IDs + if ($sObjKey <= 0) { + return ''.Dict::S('UI:UndefinedObject').''; + } // Objects built in memory have negative IDs // Safety net // - if (empty($sHtmlLabel)) - { + if (empty($sHtmlLabel)) { // If the object if not issued from a query but constructed programmatically // the label may be empty. In this case run a query to get the object's friendly name $sObjOql = 'SELECT '.$sObjClass.' WHERE id='.$sObjKey; @@ -1367,9 +1368,7 @@ abstract class DBObject implements iDisplay if ($sFA == '') { $sIcon = ''; - } - else - { + } else { if ($bClickable) { $sIcon = ""; } else { @@ -1377,19 +1376,20 @@ abstract class DBObject implements iDisplay } } - if ($bClickable && (strlen($sUrl) > 0)) - { + if ($bClickable && (strlen($sUrl) > 0)) { + if ($sFilter != null) { + $sUrl = $sUrl.'&filter='.$sFilter; + } $sHLink = "$sIcon$sHtmlLabel"; - } - else - { + } else { $sHLink = $sIcon.$sHtmlLabel; } $sPreview = ''; - if(SummaryCardService::IsAllowedForClass($sObjClass) && $bIgnorePreview === false){ - $sPreview = SummaryCardService::GetHyperlinkMarkup($sObjClass, $sObjKey); + if (SummaryCardService::IsAllowedForClass($sObjClass) && $bIgnorePreview === false) { + $sPreview = SummaryCardService::GetHyperlinkMarkup($sObjClass, $sObjKey); } $sRet = "$sHLink"; + return $sRet; } @@ -1408,15 +1408,15 @@ abstract class DBObject implements iDisplay * @throws CoreException * @throws DictExceptionMissingString */ - public function GetHyperlink($sUrlMakerClass = null, $bWithNavigationContext = true, $sLabel = null, $bIgnorePreview = false) + public function GetHyperlink($sUrlMakerClass = null, $bWithNavigationContext = true, $sLabel = null, $bIgnorePreview = false, $sFilter = null) { - if($sLabel === null) - { - $sLabel = $this->GetName(); - } + if ($sLabel === null) { + $sLabel = $this->GetName(); + } $bArchived = $this->IsArchived(); $bObsolete = $this->IsObsolete(); - return self::MakeHyperLink(get_class($this), $this->GetKey(), $sLabel, $sUrlMakerClass, $bWithNavigationContext, $bArchived, $bObsolete, $bIgnorePreview); + + return self::MakeHyperLink(get_class($this), $this->GetKey(), $sLabel, $sUrlMakerClass, $bWithNavigationContext, $bArchived, $bObsolete, $bIgnorePreview, $sFilter); } /** diff --git a/css/backoffice/components/_all.scss b/css/backoffice/components/_all.scss index efb91bdb1..451963e0b 100644 --- a/css/backoffice/components/_all.scss +++ b/css/backoffice/components/_all.scss @@ -32,4 +32,5 @@ @import "search-form"; @import "field-badge"; @import "file-select"; -@import "medallion-icon"; \ No newline at end of file +@import "medallion-icon"; +@import "navigation"; \ No newline at end of file diff --git a/css/backoffice/components/_navigation.scss b/css/backoffice/components/_navigation.scss new file mode 100644 index 000000000..5da86a844 --- /dev/null +++ b/css/backoffice/components/_navigation.scss @@ -0,0 +1,29 @@ +/* + * @copyright Copyright (C) 2010-2021 Combodo SARL + * @license http://opensource.org/licenses/AGPL-3.0 + */ + +.ibo-navigation { + position: relative; + + .ibo-navigation-form { + display: flex; + position: absolute; + z-index: 3; + left: 50%; + transform: translate(-50%, 0); + + .ibo-form-navigation--total { + text-align: center; + margin-left: 10px; + margin-right: 10px; + } + + .ibo-form-navigation--nav { + margin-left: 5px; + margin-right: 10px; + padding-top: 3px; + } + } + +} \ No newline at end of file diff --git a/lib/autoload.php b/lib/autoload.php index 460e67535..f1eeef5ab 100644 --- a/lib/autoload.php +++ b/lib/autoload.php @@ -2,6 +2,11 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + exit(1); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f::getLoader(); diff --git a/lib/composer/ClassLoader.php b/lib/composer/ClassLoader.php index 0cd6055d1..afef3fa2a 100644 --- a/lib/composer/ClassLoader.php +++ b/lib/composer/ClassLoader.php @@ -149,7 +149,7 @@ class ClassLoader /** * @return string[] Array of classname => path - * @psalm-var array + * @psalm-return array */ public function getClassMap() { diff --git a/lib/composer/autoload_classmap.php b/lib/composer/autoload_classmap.php index b85485524..70c450fc0 100644 --- a/lib/composer/autoload_classmap.php +++ b/lib/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -266,6 +266,8 @@ return array( 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\tInputLabel' => $baseDir . '/sources/Application/UI/Base/Component/Input/tInputLabel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\MedallionIcon\\MedallionIcon' => $baseDir . '/sources/Application/UI/Base/Component/MedallionIcon/MedallionIcon.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Modal\\DoNotShowAgainOptionBlock' => $baseDir . '/sources/Application/UI/Base/Component/Modal/DoNotShowAgainOptionBlock.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Navigation\\Navigation' => $baseDir . '/sources/Application/UI/Base/Component/Navigation/Navigation.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Navigation\\NavigationUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/Navigation/NavigationUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\Panel' => $baseDir . '/sources/Application/UI/Base/Component/Panel/Panel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/Panel/PanelUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Pill\\Pill' => $baseDir . '/sources/Application/UI/Base/Component/Pill/Pill.php', @@ -449,7 +451,6 @@ return array( 'Combodo\\iTop\\Service\\Events\\EventServiceLog' => $baseDir . '/sources/Service/Events/EventServiceLog.php', 'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => $baseDir . '/sources/Service/Events/iEventServiceSetup.php', 'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => $baseDir . '/sources/Service/Links/LinkSetDataTransformer.php', - 'Combodo\\iTop\\Service\\Links\\LinkSetHelper' => $baseDir . '/sources/Service/Links/LinkSetHelper.php', 'Combodo\\iTop\\Service\\Links\\LinkSetModel' => $baseDir . '/sources/Service/Links/LinkSetModel.php', 'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => $baseDir . '/sources/Service/Links/LinkSetRepository.php', 'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => $baseDir . '/sources/Service/Links/LinksBulkDataPostProcessor.php', @@ -1702,17 +1703,6 @@ return array( 'Symfony\\Bundle\\TwigBundle\\DependencyInjection\\TwigExtension' => $vendorDir . '/symfony/twig-bundle/DependencyInjection/TwigExtension.php', 'Symfony\\Bundle\\TwigBundle\\TemplateIterator' => $vendorDir . '/symfony/twig-bundle/TemplateIterator.php', 'Symfony\\Bundle\\TwigBundle\\TwigBundle' => $vendorDir . '/symfony/twig-bundle/TwigBundle.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionPanelController' => $vendorDir . '/symfony/web-profiler-bundle/Controller/ExceptionPanelController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ProfilerController' => $vendorDir . '/symfony/web-profiler-bundle/Controller/ProfilerController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\RouterController' => $vendorDir . '/symfony/web-profiler-bundle/Controller/RouterController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Csp\\ContentSecurityPolicyHandler' => $vendorDir . '/symfony/web-profiler-bundle/Csp/ContentSecurityPolicyHandler.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Csp\\NonceGenerator' => $vendorDir . '/symfony/web-profiler-bundle/Csp/NonceGenerator.php', - 'Symfony\\Bundle\\WebProfilerBundle\\DependencyInjection\\Configuration' => $vendorDir . '/symfony/web-profiler-bundle/DependencyInjection/Configuration.php', - 'Symfony\\Bundle\\WebProfilerBundle\\DependencyInjection\\WebProfilerExtension' => $vendorDir . '/symfony/web-profiler-bundle/DependencyInjection/WebProfilerExtension.php', - 'Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener' => $vendorDir . '/symfony/web-profiler-bundle/EventListener/WebDebugToolbarListener.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Profiler\\TemplateManager' => $vendorDir . '/symfony/web-profiler-bundle/Profiler/TemplateManager.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension' => $vendorDir . '/symfony/web-profiler-bundle/Twig/WebProfilerExtension.php', - 'Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle' => $vendorDir . '/symfony/web-profiler-bundle/WebProfilerBundle.php', 'Symfony\\Component\\Cache\\Adapter\\AbstractAdapter' => $vendorDir . '/symfony/cache/Adapter/AbstractAdapter.php', 'Symfony\\Component\\Cache\\Adapter\\AbstractTagAwareAdapter' => $vendorDir . '/symfony/cache/Adapter/AbstractTagAwareAdapter.php', 'Symfony\\Component\\Cache\\Adapter\\AdapterInterface' => $vendorDir . '/symfony/cache/Adapter/AdapterInterface.php', @@ -2532,10 +2522,6 @@ return array( 'Symfony\\Component\\Routing\\RouteCompilerInterface' => $vendorDir . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => $vendorDir . '/symfony/routing/Router.php', 'Symfony\\Component\\Routing\\RouterInterface' => $vendorDir . '/symfony/routing/RouterInterface.php', - 'Symfony\\Component\\Stopwatch\\Section' => $vendorDir . '/symfony/stopwatch/Section.php', - 'Symfony\\Component\\Stopwatch\\Stopwatch' => $vendorDir . '/symfony/stopwatch/Stopwatch.php', - 'Symfony\\Component\\Stopwatch\\StopwatchEvent' => $vendorDir . '/symfony/stopwatch/StopwatchEvent.php', - 'Symfony\\Component\\Stopwatch\\StopwatchPeriod' => $vendorDir . '/symfony/stopwatch/StopwatchPeriod.php', 'Symfony\\Component\\String\\AbstractString' => $vendorDir . '/symfony/string/AbstractString.php', 'Symfony\\Component\\String\\AbstractUnicodeString' => $vendorDir . '/symfony/string/AbstractUnicodeString.php', 'Symfony\\Component\\String\\ByteString' => $vendorDir . '/symfony/string/ByteString.php', diff --git a/lib/composer/autoload_files.php b/lib/composer/autoload_files.php index 9ca87aae9..e49dcf9a3 100644 --- a/lib/composer/autoload_files.php +++ b/lib/composer/autoload_files.php @@ -2,24 +2,24 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'c9d07b32a2e02bc0fc582d4f0c1b56cc' => $vendorDir . '/laminas/laminas-servicemanager/src/autoload.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + 'c9d07b32a2e02bc0fc582d4f0c1b56cc' => $vendorDir . '/laminas/laminas-servicemanager/src/autoload.php', + '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', ); diff --git a/lib/composer/autoload_namespaces.php b/lib/composer/autoload_namespaces.php index 1db5bf646..6629b7e09 100644 --- a/lib/composer/autoload_namespaces.php +++ b/lib/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/lib/composer/autoload_psr4.php b/lib/composer/autoload_psr4.php index eb2c95ace..127f9968d 100644 --- a/lib/composer/autoload_psr4.php +++ b/lib/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -26,7 +26,6 @@ return array( 'Symfony\\Component\\VarExporter\\' => array($vendorDir . '/symfony/var-exporter'), 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), - 'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'), 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), @@ -40,7 +39,6 @@ return array( 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'), 'Symfony\\Component\\Cache\\' => array($vendorDir . '/symfony/cache'), - 'Symfony\\Bundle\\WebProfilerBundle\\' => array($vendorDir . '/symfony/web-profiler-bundle'), 'Symfony\\Bundle\\TwigBundle\\' => array($vendorDir . '/symfony/twig-bundle'), 'Symfony\\Bundle\\FrameworkBundle\\' => array($vendorDir . '/symfony/framework-bundle'), 'Symfony\\Bridge\\Twig\\' => array($vendorDir . '/symfony/twig-bridge'), diff --git a/lib/composer/autoload_real.php b/lib/composer/autoload_real.php index cc554d8d1..f3b314bd7 100644 --- a/lib/composer/autoload_real.php +++ b/lib/composer/autoload_real.php @@ -25,33 +25,21 @@ class ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; $includePaths[] = get_include_path(); set_include_path(implode(PATH_SEPARATOR, $includePaths)); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::getInitializer($loader)); - } else { - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::getInitializer($loader)); $loader->setClassMapAuthoritative(true); + $loader->setApcuPrefix('jfuEJXXFngXWlQd9yQyh8'); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file); } @@ -60,11 +48,16 @@ class ComposerAutoloaderInit7f81b4a2a468a061c306af5e447a9a9f } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire7f81b4a2a468a061c306af5e447a9a9f($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/lib/composer/autoload_static.php b/lib/composer/autoload_static.php index c10b2e716..5438ed46a 100644 --- a/lib/composer/autoload_static.php +++ b/lib/composer/autoload_static.php @@ -7,22 +7,22 @@ namespace Composer\Autoload; class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f { public static $files = array ( - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - 'c9d07b32a2e02bc0fc582d4f0c1b56cc' => __DIR__ . '/..' . '/laminas/laminas-servicemanager/src/autoload.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + 'c9d07b32a2e02bc0fc582d4f0c1b56cc' => __DIR__ . '/..' . '/laminas/laminas-servicemanager/src/autoload.php', + '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', ); public static $prefixLengthsPsr4 = array ( @@ -54,7 +54,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Symfony\\Component\\VarExporter\\' => 30, 'Symfony\\Component\\VarDumper\\' => 28, 'Symfony\\Component\\String\\' => 25, - 'Symfony\\Component\\Stopwatch\\' => 28, 'Symfony\\Component\\Routing\\' => 26, 'Symfony\\Component\\HttpKernel\\' => 29, 'Symfony\\Component\\HttpFoundation\\' => 33, @@ -68,7 +67,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Symfony\\Component\\Console\\' => 26, 'Symfony\\Component\\Config\\' => 25, 'Symfony\\Component\\Cache\\' => 24, - 'Symfony\\Bundle\\WebProfilerBundle\\' => 33, 'Symfony\\Bundle\\TwigBundle\\' => 26, 'Symfony\\Bundle\\FrameworkBundle\\' => 31, 'Symfony\\Bridge\\Twig\\' => 20, @@ -189,10 +187,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f array ( 0 => __DIR__ . '/..' . '/symfony/string', ), - 'Symfony\\Component\\Stopwatch\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/stopwatch', - ), 'Symfony\\Component\\Routing\\' => array ( 0 => __DIR__ . '/..' . '/symfony/routing', @@ -245,10 +239,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f array ( 0 => __DIR__ . '/..' . '/symfony/cache', ), - 'Symfony\\Bundle\\WebProfilerBundle\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/web-profiler-bundle', - ), 'Symfony\\Bundle\\TwigBundle\\' => array ( 0 => __DIR__ . '/..' . '/symfony/twig-bundle', @@ -631,6 +621,8 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\tInputLabel' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Input/tInputLabel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\MedallionIcon\\MedallionIcon' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/MedallionIcon/MedallionIcon.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Modal\\DoNotShowAgainOptionBlock' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Modal/DoNotShowAgainOptionBlock.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Navigation\\Navigation' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Navigation/Navigation.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Navigation\\NavigationUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Navigation/NavigationUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\Panel' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Panel/Panel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Panel/PanelUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Pill\\Pill' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Pill/Pill.php', @@ -814,7 +806,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Combodo\\iTop\\Service\\Events\\EventServiceLog' => __DIR__ . '/../..' . '/sources/Service/Events/EventServiceLog.php', 'Combodo\\iTop\\Service\\Events\\iEventServiceSetup' => __DIR__ . '/../..' . '/sources/Service/Events/iEventServiceSetup.php', 'Combodo\\iTop\\Service\\Links\\LinkSetDataTransformer' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetDataTransformer.php', - 'Combodo\\iTop\\Service\\Links\\LinkSetHelper' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetHelper.php', 'Combodo\\iTop\\Service\\Links\\LinkSetModel' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetModel.php', 'Combodo\\iTop\\Service\\Links\\LinkSetRepository' => __DIR__ . '/../..' . '/sources/Service/Links/LinkSetRepository.php', 'Combodo\\iTop\\Service\\Links\\LinksBulkDataPostProcessor' => __DIR__ . '/../..' . '/sources/Service/Links/LinksBulkDataPostProcessor.php', @@ -2067,17 +2058,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Symfony\\Bundle\\TwigBundle\\DependencyInjection\\TwigExtension' => __DIR__ . '/..' . '/symfony/twig-bundle/DependencyInjection/TwigExtension.php', 'Symfony\\Bundle\\TwigBundle\\TemplateIterator' => __DIR__ . '/..' . '/symfony/twig-bundle/TemplateIterator.php', 'Symfony\\Bundle\\TwigBundle\\TwigBundle' => __DIR__ . '/..' . '/symfony/twig-bundle/TwigBundle.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ExceptionPanelController' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Controller/ExceptionPanelController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\ProfilerController' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Controller/ProfilerController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Controller\\RouterController' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Controller/RouterController.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Csp\\ContentSecurityPolicyHandler' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Csp/ContentSecurityPolicyHandler.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Csp\\NonceGenerator' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Csp/NonceGenerator.php', - 'Symfony\\Bundle\\WebProfilerBundle\\DependencyInjection\\Configuration' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/DependencyInjection/Configuration.php', - 'Symfony\\Bundle\\WebProfilerBundle\\DependencyInjection\\WebProfilerExtension' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/DependencyInjection/WebProfilerExtension.php', - 'Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/EventListener/WebDebugToolbarListener.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Profiler\\TemplateManager' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Profiler/TemplateManager.php', - 'Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/Twig/WebProfilerExtension.php', - 'Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle' => __DIR__ . '/..' . '/symfony/web-profiler-bundle/WebProfilerBundle.php', 'Symfony\\Component\\Cache\\Adapter\\AbstractAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/AbstractAdapter.php', 'Symfony\\Component\\Cache\\Adapter\\AbstractTagAwareAdapter' => __DIR__ . '/..' . '/symfony/cache/Adapter/AbstractTagAwareAdapter.php', 'Symfony\\Component\\Cache\\Adapter\\AdapterInterface' => __DIR__ . '/..' . '/symfony/cache/Adapter/AdapterInterface.php', @@ -2897,10 +2877,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Symfony\\Component\\Routing\\RouteCompilerInterface' => __DIR__ . '/..' . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => __DIR__ . '/..' . '/symfony/routing/Router.php', 'Symfony\\Component\\Routing\\RouterInterface' => __DIR__ . '/..' . '/symfony/routing/RouterInterface.php', - 'Symfony\\Component\\Stopwatch\\Section' => __DIR__ . '/..' . '/symfony/stopwatch/Section.php', - 'Symfony\\Component\\Stopwatch\\Stopwatch' => __DIR__ . '/..' . '/symfony/stopwatch/Stopwatch.php', - 'Symfony\\Component\\Stopwatch\\StopwatchEvent' => __DIR__ . '/..' . '/symfony/stopwatch/StopwatchEvent.php', - 'Symfony\\Component\\Stopwatch\\StopwatchPeriod' => __DIR__ . '/..' . '/symfony/stopwatch/StopwatchPeriod.php', 'Symfony\\Component\\String\\AbstractString' => __DIR__ . '/..' . '/symfony/string/AbstractString.php', 'Symfony\\Component\\String\\AbstractUnicodeString' => __DIR__ . '/..' . '/symfony/string/AbstractUnicodeString.php', 'Symfony\\Component\\String\\ByteString' => __DIR__ . '/..' . '/symfony/string/ByteString.php', diff --git a/lib/composer/include_paths.php b/lib/composer/include_paths.php index d4fb96718..af33c1491 100644 --- a/lib/composer/include_paths.php +++ b/lib/composer/include_paths.php @@ -2,7 +2,7 @@ // include_paths.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/pages/UI.php b/pages/UI.php index bde6df71f..bd2d99089 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -435,9 +435,17 @@ try throw new SecurityException('User not allowed to view this object', array('class' => $sClass, 'id' => $id)); } + //N°1386 - Advanced Search: Navigation in list - Browse this list + $sFilter = utils::ReadParam('filter', null, false, 'raw'); + $sList = utils::ReadPostedParam('listNavigation', null, false, 'string'); + $aList = []; + if ($sList != null) { + $aList = json_decode($sList); + } + $sClassLabel = MetaModel::GetName($sClass); $oP->set_title(Dict::Format('UI:DetailsPageTitle', $oObj->GetRawName(), $sClassLabel)); // Set title will take care of the encoding - $oP->SetContentLayout(PageContentFactory::MakeForObjectDetails($oObj, $oP->IsPrintableVersion() ? cmdbAbstractObject::ENUM_DISPLAY_MODE_PRINT : cmdbAbstractObject::ENUM_DISPLAY_MODE_VIEW)); + $oP->SetContentLayout(PageContentFactory::MakeForObjectDetails($oObj, $oP->IsPrintableVersion() ? cmdbAbstractObject::ENUM_DISPLAY_MODE_PRINT : cmdbAbstractObject::ENUM_DISPLAY_MODE_VIEW, $sFilter, $aList)); $oObj->DisplayDetails($oP); } } diff --git a/sources/Application/UI/Base/Component/Navigation/Navigation.php b/sources/Application/UI/Base/Component/Navigation/Navigation.php new file mode 100644 index 000000000..670b11573 --- /dev/null +++ b/sources/Application/UI/Base/Component/Navigation/Navigation.php @@ -0,0 +1,166 @@ +iCount = count($aList); + if ( $this->iCount == 0) { + return new UIContentBlock(); + } + $this->sClass = $sClass; + $this->aList = $aList; + $this->sFilter = $sFilter; + $this->iIdx = $iIdx; + if ($this->iIdx>0) { + $this->iIdFirst = $aList[0]; + $this->iIdPrev = $aList[$iIdx - 1]; + } + if ($this->iIdx < $this->iCount -1) { + $this->iIdNext = $aList[$iIdx + 1]; + $this->iIdLast = $aList[$this->iCount - 1]; + } + } + + /** + * @return int + */ + public function GetIdx(): int + { + return $this->iIdx+1; + } + + /** + * @return int + */ + public function GetCount(): int + { + return $this->iCount; + } + + private function GetUrlFromId($iId) + { + $sUrl = iTopStandardURLMaker::MakeObjectURL($this->sClass, $iId).'&filter='.urlencode($this->sFilter); + return $sUrl; + } + /** + * @return int|mixed + */ + public function GetUrlFirst() + { + return $this->GetUrlFromId( $this->iIdFirst); + } + + /** + * @return int|mixed + */ + public function GetUrlPrev() + { + return $this->GetUrlFromId( $this->iIdPrev); + } + + /** + * @return int|mixed + */ + public function GetUrlNext() + { + return $this->GetUrlFromId( $this->iIdNext); + } + + /** + * @return int|mixed + */ + public function GetUrlLast() + { + return $this->GetUrlFromId( $this->iIdLast); + } + + /** + * @return string + */ + public function GetList(): string + { + return json_encode($this->aList); + } + + public function GetUrlSearch(){ + $sAbsoluteUrl = utils::GetAbsoluteUrlAppRoot(); + return "{$sAbsoluteUrl}pages/UI.php?operation=search&filter=".urlencode(urlencode('["'.$this->sFilter.'",[],[]]')); + } + + /** + * @return bool + */ + public function HasPrec(): bool + { + return $this->iIdx > 0; + } + /** + * @return bool + */ + public function HasNext(): bool + { + return $this->iIdx+1 < $this->iCount; + } + +} diff --git a/sources/Application/UI/Base/Component/Navigation/NavigationUIBlockFactory.php b/sources/Application/UI/Base/Component/Navigation/NavigationUIBlockFactory.php new file mode 100644 index 000000000..6acb2881e --- /dev/null +++ b/sources/Application/UI/Base/Component/Navigation/NavigationUIBlockFactory.php @@ -0,0 +1,69 @@ +/test/VisualTest/Backoffice/RenderAllUiBlocks.php#title-panels to see live examples + */ +class NavigationUIBlockFactory extends AbstractUIBlockFactory +{ + /** @inheritDoc */ + public const TWIG_TAG_NAME = 'UINavigation'; + /** @inheritDoc */ + public const UI_BLOCK_CLASS_NAME = Navigation::class; + + /** + * Make a basis Panel component + * + * @api + * @param string $sTitle + * @param string|null $sSubTitle + * + * @return \Combodo\iTop\Application\UI\Base\Component\Panel\Panel + */ + public static function MakeStandard( $oObject, string $sFilter, array $aList = []) + { + \IssueLog::Error('MakeStandard'.count($aList)); + if ($sFilter != null && count($aList) === 0) { + $oFilter = DBObjectSearch::FromOQL($sFilter); + $oSet = new DBObjectSet($oFilter); + $aList = $oSet->GetColumnAsArray('id', false); + } + if(count($aList) === 0) { + return null; + } + + $iIdx = array_search($oObject->GetKey(), $aList); + $oNavigationBlock = new Navigation(get_class($oObject), $iIdx, $aList, $sFilter); + + return $oNavigationBlock; + } + +} \ No newline at end of file diff --git a/sources/Application/UI/Base/Layout/PageContent/PageContentFactory.php b/sources/Application/UI/Base/Layout/PageContent/PageContentFactory.php index bf9709a98..dccb17f5f 100644 --- a/sources/Application/UI/Base/Layout/PageContent/PageContentFactory.php +++ b/sources/Application/UI/Base/Layout/PageContent/PageContentFactory.php @@ -21,6 +21,7 @@ namespace Combodo\iTop\Application\UI\Base\Layout\PageContent; use cmdbAbstractObject; +use Combodo\iTop\Application\UI\Base\Component\Navigation\NavigationUIBlockFactory; use Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\ActivityPanelFactory; use Combodo\iTop\Application\UI\Base\Layout\Object\ObjectFactory; use DBObject; @@ -56,14 +57,17 @@ class PageContentFactory * @return \Combodo\iTop\Application\UI\Base\Layout\PageContent\PageContentWithSideContent * @throws \CoreException */ - public static function MakeForObjectDetails(DBObject $oObject, string $sMode = cmdbAbstractObject::DEFAULT_DISPLAY_MODE) + public static function MakeForObjectDetails(DBObject $oObject, string $sMode = cmdbAbstractObject::DEFAULT_DISPLAY_MODE, $sFilter = null, $aList = []) { $oLayout = new PageContentWithSideContent(); - // Add object details layout - // TODO 3.0.0 see N°3518 - //$oObjectDetails = ObjectFactory::MakeDetails($oObject, $sMode); - //$oLayout->AddMainBlock($oObjectDetails); + + if ($sFilter != null) { + $oNavigationBlock = NavigationUIBlockFactory::MakeStandard($oObject, $sFilter, $aList); + if ($oNavigationBlock != null) { + $oLayout->AddSubBlock($oNavigationBlock); + } + } // Add object activity layout $oActivityPanel = ActivityPanelFactory::MakeForObjectDetails($oObject, $sMode); diff --git a/sources/Controller/AjaxRenderController.php b/sources/Controller/AjaxRenderController.php index 1744cee63..fa7a7566d 100644 --- a/sources/Controller/AjaxRenderController.php +++ b/sources/Controller/AjaxRenderController.php @@ -80,7 +80,7 @@ class AjaxRenderController if (isset($aObject[$sAlias]) && !is_null($aObject[$sAlias])) { $aObj[$sAlias."/_key_"] = $aObject[$sAlias]->GetKey(); $aObj[$sAlias."/_key_/raw"] = $aObject[$sAlias]->GetKey(); - $aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink(); + $aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink(null, true, null, false, $oSet->GetFilter()->ToOQL(true)); $aObj[$sAlias."/friendlyname"] = $aObject[$sAlias]->Get('friendlyname'); // N°5943 Protection against $aColumnsLoad having less class aliases than $aClassAliases, this is in case the method's consumer isn't passing data correctly diff --git a/templates/base/components/navigation/layout.html.twig b/templates/base/components/navigation/layout.html.twig new file mode 100644 index 000000000..e40b4f3a9 --- /dev/null +++ b/templates/base/components/navigation/layout.html.twig @@ -0,0 +1,24 @@ +{# @copyright Copyright (C) 2010-2021 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} +
+ {% block iboNavigation %} +
+ +
+ {% if oUIBlock.HasPrec() %} +
+
+ {% else %} +     + {% endif %} +
{{ oUIBlock.GetIdx() }} / {{ oUIBlock.GetCount() }}
+ {% if oUIBlock.HasNext() %} +
+
+ {% else %} +     + {% endif %} +
+ {% endblock %} +
\ No newline at end of file diff --git a/templates/base/components/navigation/layout.js.twig b/templates/base/components/navigation/layout.js.twig new file mode 100644 index 000000000..934df3b25 --- /dev/null +++ b/templates/base/components/navigation/layout.js.twig @@ -0,0 +1,26 @@ +{# @copyright Copyright (C) 2010-2021 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} +console.warn('ICI'); +$('#{{ oUIBlock.GetId() }}-back').on('click', function() { + window.location = '{{ oUIBlock.GetUrlSearch()|raw }}'; +}); + +$('#{{ oUIBlock.GetId() }}-first').on('click', function() { + $('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlFirst() | raw}} '); + $('#ibo-form-navigation').submit(); +}); + +$('#{{ oUIBlock.GetId() }}-prev').on('click', function() { + $('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlPrev()| raw }} '); + $('#ibo-form-navigation').submit(); +}); + +$('#{{ oUIBlock.GetId() }}-next').on('click', function() { + $('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlNext() | raw}} '); + $('#ibo-form-navigation').submit(); +}); + +$('#{{ oUIBlock.GetId() }}-last').on('click', function() { + $('#ibo-form-navigation').attr('action',' {{ oUIBlock.GetUrlLast() | raw}} '); + $('#ibo-form-navigation').submit() +}); \ No newline at end of file