mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 06:48:50 +02:00
suite sdk
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
"pear/archive_tar": "~1.4.14",
|
||||
"pelago/emogrifier": "^6.0.0",
|
||||
"scssphp/scssphp": "^1.10.3",
|
||||
"sensio/framework-extra-bundle": "^6.2",
|
||||
"symfony/console": "5.4.*",
|
||||
"symfony/dotenv": "5.4.*",
|
||||
"symfony/form": "^5.4",
|
||||
|
||||
80
composer.lock
generated
80
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "f8be0ac443526ec9ef41da63f1c16f85",
|
||||
"content-hash": "ae62bd0c415f6f89dc31562548690585",
|
||||
"packages": [
|
||||
{
|
||||
"name": "apereo/phpcas",
|
||||
@@ -2349,6 +2349,84 @@
|
||||
},
|
||||
"time": "2022-07-27T15:52:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sensio/framework-extra-bundle",
|
||||
"version": "v6.2.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
|
||||
"reference": "2f886f4b31f23c76496901acaedfedb6936ba61f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/2f886f4b31f23c76496901acaedfedb6936ba61f",
|
||||
"reference": "2f886f4b31f23c76496901acaedfedb6936ba61f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/annotations": "^1.0|^2.0",
|
||||
"php": ">=7.2.5",
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-kernel": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/doctrine-cache-bundle": "<1.3.1",
|
||||
"doctrine/persistence": "<1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "^2.10|^3.0",
|
||||
"doctrine/doctrine-bundle": "^1.11|^2.0",
|
||||
"doctrine/orm": "^2.5",
|
||||
"symfony/browser-kit": "^4.4|^5.0|^6.0",
|
||||
"symfony/doctrine-bridge": "^4.4|^5.0|^6.0",
|
||||
"symfony/dom-crawler": "^4.4|^5.0|^6.0",
|
||||
"symfony/expression-language": "^4.4|^5.0|^6.0",
|
||||
"symfony/finder": "^4.4|^5.0|^6.0",
|
||||
"symfony/monolog-bridge": "^4.0|^5.0|^6.0",
|
||||
"symfony/monolog-bundle": "^3.2",
|
||||
"symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0",
|
||||
"symfony/security-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/yaml": "^4.4|^5.0|^6.0",
|
||||
"twig/twig": "^1.34|^2.4|^3.0"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Sensio\\Bundle\\FrameworkExtraBundle\\": "src/"
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "This bundle provides a way to configure your controllers with annotations",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"controllers"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v6.2.10"
|
||||
},
|
||||
"abandoned": "Symfony",
|
||||
"time": "2023-02-24T14:57:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/cache",
|
||||
"version": "v5.4.11",
|
||||
|
||||
@@ -55,6 +55,7 @@ const App = function(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
init,
|
||||
handleTooltips,
|
||||
|
||||
106
js/DI/file_test.js
Normal file
106
js/DI/file_test.js
Normal file
@@ -0,0 +1,106 @@
|
||||
|
||||
const FileTest = function(sUrl){
|
||||
|
||||
|
||||
function init(){
|
||||
$('#create_task').on('click', function(e){
|
||||
createTask(e);
|
||||
});
|
||||
}
|
||||
|
||||
function createTask(e){
|
||||
|
||||
// form attributes
|
||||
const sModalId = `file_modal`;
|
||||
const sFormName = `file_form`;
|
||||
|
||||
// crate a new modal
|
||||
const oModal = oToolkit.createFullScreenModal(sModalId, 'Create task');
|
||||
const oModalBody= oModal.querySelector('.modal-body');
|
||||
oModalBody.innerHTML = 'loading...';
|
||||
|
||||
// bootstrap modal
|
||||
const oBootstrapModal = new bootstrap.Modal(`#${sModalId}`);
|
||||
oModal.addEventListener('hidden.bs.modal', event => {
|
||||
// cleanup
|
||||
oBootstrapModal.dispose();
|
||||
event.currentTarget.remove();
|
||||
});
|
||||
oBootstrapModal.show();
|
||||
|
||||
// fetch url
|
||||
fetch(sUrl, {
|
||||
method: 'POST',
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
|
||||
// load modal content
|
||||
oModalBody.innerHTML = data.template;
|
||||
|
||||
listenSaveModalObject(oModal, oBootstrapModal);
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function listenSaveModalObject(oModal, oBootstrapModal)
|
||||
{
|
||||
const oForm = oModal.querySelector('form');
|
||||
|
||||
oForm.addEventListener('submit', function(e){
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
console.log('save');
|
||||
|
||||
// // prepare form data
|
||||
// const data = new URLSearchParams();
|
||||
// for (const pair of new FormData(oForm)) {
|
||||
// data.append(pair[0], pair[1]);
|
||||
// }
|
||||
|
||||
// fetch url
|
||||
fetch(sUrl, {
|
||||
method: 'POST',
|
||||
body: new FormData(oForm)
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
|
||||
// on success
|
||||
if(data.succeeded){
|
||||
|
||||
// hide modal
|
||||
oBootstrapModal.hide();
|
||||
|
||||
}
|
||||
else{
|
||||
console.error('Error while saving object');
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
|
||||
console.error(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
init
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -393,7 +393,9 @@ return array(
|
||||
'Combodo\\iTop\\Core\\MetaModel\\HierarchicalKey' => $baseDir . '/sources/Core/MetaModel/HierarchicalKey.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ConfigurationController' => $baseDir . '/sources/DI/Controller/ConfigurationController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\DefaultController' => $baseDir . '/sources/DI/Controller/DefaultController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\FileTestController' => $baseDir . '/sources/DI/Controller/FileTestController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ObjectController' => $baseDir . '/sources/DI/Controller/ObjectController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ParamConverterTestController' => $baseDir . '/sources/DI/Controller/ParamConverterTestController.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Builder\\AttributeBuilder' => $baseDir . '/sources/DI/Form/Builder/AttributeBuilder.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Builder\\LayoutBuilder' => $baseDir . '/sources/DI/Form/Builder/LayoutBuilder.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Listener\\IFormTypeOptionModifier' => $baseDir . '/sources/DI/Form/Listener/IFormTypeOptionModifier.php',
|
||||
@@ -415,6 +417,7 @@ return array(
|
||||
'Combodo\\iTop\\DI\\ITopKernel' => $baseDir . '/sources/DI/ITopKernel.php',
|
||||
'Combodo\\iTop\\DI\\Services\\ObjectPresentationService' => $baseDir . '/sources/DI/Services/ObjectPresentationService.php',
|
||||
'Combodo\\iTop\\DI\\Services\\ObjectService' => $baseDir . '/sources/DI/Services/ObjectService.php',
|
||||
'Combodo\\iTop\\DI\\Services\\SanitizationParameterConverter' => $baseDir . '/sources/DI/Services/SanitizationParameterConverter.php',
|
||||
'Combodo\\iTop\\DI\\Services\\TwigHelper' => $baseDir . '/sources/DI/Services/TwigHelper.php',
|
||||
'Combodo\\iTop\\DesignDocument' => $baseDir . '/core/designdocument.class.inc.php',
|
||||
'Combodo\\iTop\\DesignElement' => $baseDir . '/core/designdocument.class.inc.php',
|
||||
@@ -1625,6 +1628,36 @@ return array(
|
||||
'ScssPhp\\ScssPhp\\Warn' => $vendorDir . '/scssphp/scssphp/src/Warn.php',
|
||||
'SearchMenuNode' => $baseDir . '/application/menunode.class.inc.php',
|
||||
'SecurityException' => $baseDir . '/application/exceptions/SecurityException.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Cache' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Cache.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationAnnotation' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/ConfigurationAnnotation.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationInterface' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/ConfigurationInterface.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Entity' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Entity.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\IsGranted' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/IsGranted.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Method' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Method.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ParamConverter' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/ParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Route.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Security.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template' => $vendorDir . '/sensio/framework-extra-bundle/src/Configuration/Template.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\AddExpressionLanguageProvidersPass' => $vendorDir . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\AddParamConverterPass' => $vendorDir . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/AddParamConverterPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\OptimizerPass' => $vendorDir . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/OptimizerPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Configuration' => $vendorDir . '/sensio/framework-extra-bundle/src/DependencyInjection/Configuration.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\SensioFrameworkExtraExtension' => $vendorDir . '/sensio/framework-extra-bundle/src/DependencyInjection/SensioFrameworkExtraExtension.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/ControllerListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\HttpCacheListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/HttpCacheListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\IsGrantedListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/IsGrantedListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener' => $vendorDir . '/sensio/framework-extra-bundle/src/EventListener/TemplateListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ArgumentNameConverter' => $vendorDir . '/sensio/framework-extra-bundle/src/Request/ArgumentNameConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DateTimeParamConverter' => $vendorDir . '/sensio/framework-extra-bundle/src/Request/ParamConverter/DateTimeParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter' => $vendorDir . '/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface' => $vendorDir . '/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterInterface.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterManager' => $vendorDir . '/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Routing\\AnnotatedRouteControllerLoader' => $vendorDir . '/sensio/framework-extra-bundle/src/Routing/AnnotatedRouteControllerLoader.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage' => $vendorDir . '/sensio/framework-extra-bundle/src/Security/ExpressionLanguage.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle' => $vendorDir . '/sensio/framework-extra-bundle/src/SensioFrameworkExtraBundle.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Templating\\TemplateGuesser' => $vendorDir . '/sensio/framework-extra-bundle/src/Templating/TemplateGuesser.php',
|
||||
'SeparatorPopupMenuItem' => $baseDir . '/application/applicationextension.inc.php',
|
||||
'SetupLog' => $baseDir . '/core/log.class.inc.php',
|
||||
'Shortcut' => $baseDir . '/application/shortcut.class.inc.php',
|
||||
|
||||
@@ -49,6 +49,7 @@ return array(
|
||||
'Symfony\\Bundle\\TwigBundle\\' => array($vendorDir . '/symfony/twig-bundle'),
|
||||
'Symfony\\Bundle\\FrameworkBundle\\' => array($vendorDir . '/symfony/framework-bundle'),
|
||||
'Symfony\\Bridge\\Twig\\' => array($vendorDir . '/symfony/twig-bridge'),
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\' => array($vendorDir . '/sensio/framework-extra-bundle/src'),
|
||||
'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'),
|
||||
'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
|
||||
@@ -77,6 +77,7 @@ class ComposerStaticInit1f6902bb5e16183d06d6f3022e08a03d
|
||||
'Symfony\\Bundle\\TwigBundle\\' => 26,
|
||||
'Symfony\\Bundle\\FrameworkBundle\\' => 31,
|
||||
'Symfony\\Bridge\\Twig\\' => 20,
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\' => 35,
|
||||
'ScssPhp\\ScssPhp\\' => 16,
|
||||
'Sabberworm\\CSS\\' => 15,
|
||||
),
|
||||
@@ -293,6 +294,10 @@ class ComposerStaticInit1f6902bb5e16183d06d6f3022e08a03d
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/twig-bridge',
|
||||
),
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src',
|
||||
),
|
||||
'ScssPhp\\ScssPhp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/scssphp/scssphp/src',
|
||||
@@ -806,7 +811,9 @@ class ComposerStaticInit1f6902bb5e16183d06d6f3022e08a03d
|
||||
'Combodo\\iTop\\Core\\MetaModel\\HierarchicalKey' => __DIR__ . '/../..' . '/sources/Core/MetaModel/HierarchicalKey.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ConfigurationController' => __DIR__ . '/../..' . '/sources/DI/Controller/ConfigurationController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\DefaultController' => __DIR__ . '/../..' . '/sources/DI/Controller/DefaultController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\FileTestController' => __DIR__ . '/../..' . '/sources/DI/Controller/FileTestController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ObjectController' => __DIR__ . '/../..' . '/sources/DI/Controller/ObjectController.php',
|
||||
'Combodo\\iTop\\DI\\Controller\\ParamConverterTestController' => __DIR__ . '/../..' . '/sources/DI/Controller/ParamConverterTestController.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Builder\\AttributeBuilder' => __DIR__ . '/../..' . '/sources/DI/Form/Builder/AttributeBuilder.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Builder\\LayoutBuilder' => __DIR__ . '/../..' . '/sources/DI/Form/Builder/LayoutBuilder.php',
|
||||
'Combodo\\iTop\\DI\\Form\\Listener\\IFormTypeOptionModifier' => __DIR__ . '/../..' . '/sources/DI/Form/Listener/IFormTypeOptionModifier.php',
|
||||
@@ -828,6 +835,7 @@ class ComposerStaticInit1f6902bb5e16183d06d6f3022e08a03d
|
||||
'Combodo\\iTop\\DI\\ITopKernel' => __DIR__ . '/../..' . '/sources/DI/ITopKernel.php',
|
||||
'Combodo\\iTop\\DI\\Services\\ObjectPresentationService' => __DIR__ . '/../..' . '/sources/DI/Services/ObjectPresentationService.php',
|
||||
'Combodo\\iTop\\DI\\Services\\ObjectService' => __DIR__ . '/../..' . '/sources/DI/Services/ObjectService.php',
|
||||
'Combodo\\iTop\\DI\\Services\\SanitizationParameterConverter' => __DIR__ . '/../..' . '/sources/DI/Services/SanitizationParameterConverter.php',
|
||||
'Combodo\\iTop\\DI\\Services\\TwigHelper' => __DIR__ . '/../..' . '/sources/DI/Services/TwigHelper.php',
|
||||
'Combodo\\iTop\\DesignDocument' => __DIR__ . '/../..' . '/core/designdocument.class.inc.php',
|
||||
'Combodo\\iTop\\DesignElement' => __DIR__ . '/../..' . '/core/designdocument.class.inc.php',
|
||||
@@ -2038,6 +2046,36 @@ class ComposerStaticInit1f6902bb5e16183d06d6f3022e08a03d
|
||||
'ScssPhp\\ScssPhp\\Warn' => __DIR__ . '/..' . '/scssphp/scssphp/src/Warn.php',
|
||||
'SearchMenuNode' => __DIR__ . '/../..' . '/application/menunode.class.inc.php',
|
||||
'SecurityException' => __DIR__ . '/../..' . '/application/exceptions/SecurityException.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Cache' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Cache.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationAnnotation' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/ConfigurationAnnotation.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationInterface' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/ConfigurationInterface.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Entity' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Entity.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\IsGranted' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/IsGranted.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Method' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Method.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ParamConverter' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/ParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Route.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Security.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Configuration/Template.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\AddExpressionLanguageProvidersPass' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\AddParamConverterPass' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/AddParamConverterPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Compiler\\OptimizerPass' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/DependencyInjection/Compiler/OptimizerPass.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\Configuration' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/DependencyInjection/Configuration.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\DependencyInjection\\SensioFrameworkExtraExtension' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/DependencyInjection/SensioFrameworkExtraExtension.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/ControllerListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\HttpCacheListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/HttpCacheListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\IsGrantedListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/IsGrantedListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/ParamConverterListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/SecurityListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/EventListener/TemplateListener.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ArgumentNameConverter' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Request/ArgumentNameConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DateTimeParamConverter' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Request/ParamConverter/DateTimeParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Request/ParamConverter/DoctrineParamConverter.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterInterface.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterManager' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Request/ParamConverter/ParamConverterManager.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Routing\\AnnotatedRouteControllerLoader' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Routing/AnnotatedRouteControllerLoader.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Security/ExpressionLanguage.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/SensioFrameworkExtraBundle.php',
|
||||
'Sensio\\Bundle\\FrameworkExtraBundle\\Templating\\TemplateGuesser' => __DIR__ . '/..' . '/sensio/framework-extra-bundle/src/Templating/TemplateGuesser.php',
|
||||
'SeparatorPopupMenuItem' => __DIR__ . '/../..' . '/application/applicationextension.inc.php',
|
||||
'SetupLog' => __DIR__ . '/../..' . '/core/log.class.inc.php',
|
||||
'Shortcut' => __DIR__ . '/../..' . '/application/shortcut.class.inc.php',
|
||||
|
||||
@@ -2448,6 +2448,87 @@
|
||||
},
|
||||
"install-path": "../scssphp/scssphp"
|
||||
},
|
||||
{
|
||||
"name": "sensio/framework-extra-bundle",
|
||||
"version": "v6.2.10",
|
||||
"version_normalized": "6.2.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
|
||||
"reference": "2f886f4b31f23c76496901acaedfedb6936ba61f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/2f886f4b31f23c76496901acaedfedb6936ba61f",
|
||||
"reference": "2f886f4b31f23c76496901acaedfedb6936ba61f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/annotations": "^1.0|^2.0",
|
||||
"php": ">=7.2.5",
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-kernel": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/doctrine-cache-bundle": "<1.3.1",
|
||||
"doctrine/persistence": "<1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "^2.10|^3.0",
|
||||
"doctrine/doctrine-bundle": "^1.11|^2.0",
|
||||
"doctrine/orm": "^2.5",
|
||||
"symfony/browser-kit": "^4.4|^5.0|^6.0",
|
||||
"symfony/doctrine-bridge": "^4.4|^5.0|^6.0",
|
||||
"symfony/dom-crawler": "^4.4|^5.0|^6.0",
|
||||
"symfony/expression-language": "^4.4|^5.0|^6.0",
|
||||
"symfony/finder": "^4.4|^5.0|^6.0",
|
||||
"symfony/monolog-bridge": "^4.0|^5.0|^6.0",
|
||||
"symfony/monolog-bundle": "^3.2",
|
||||
"symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0",
|
||||
"symfony/security-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/yaml": "^4.4|^5.0|^6.0",
|
||||
"twig/twig": "^1.34|^2.4|^3.0"
|
||||
},
|
||||
"time": "2023-02-24T14:57:12+00:00",
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.1.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Sensio\\Bundle\\FrameworkExtraBundle\\": "src/"
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "This bundle provides a way to configure your controllers with annotations",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"controllers"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/v6.2.10"
|
||||
},
|
||||
"abandoned": "Symfony",
|
||||
"install-path": "../sensio/framework-extra-bundle"
|
||||
},
|
||||
{
|
||||
"name": "symfony/cache",
|
||||
"version": "v5.4.11",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'reference' => '20a663d6316c3d154642298f59863c24ff251350',
|
||||
'reference' => '6e0bcd6d5506a32af675d78f19811498702203ce',
|
||||
'name' => 'combodo/itop',
|
||||
'dev' => true,
|
||||
),
|
||||
@@ -25,7 +25,7 @@
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'reference' => '20a663d6316c3d154642298f59863c24ff251350',
|
||||
'reference' => '6e0bcd6d5506a32af675d78f19811498702203ce',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'combodo/tcpdf' => array(
|
||||
@@ -395,6 +395,15 @@
|
||||
'reference' => '6d44282ccf283e133ab70b6282f8e068ff2f9bf9',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'sensio/framework-extra-bundle' => array(
|
||||
'pretty_version' => 'v6.2.10',
|
||||
'version' => '6.2.10.0',
|
||||
'type' => 'symfony-bundle',
|
||||
'install_path' => __DIR__ . '/../sensio/framework-extra-bundle',
|
||||
'aliases' => array(),
|
||||
'reference' => '2f886f4b31f23c76496901acaedfedb6936ba61f',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/cache' => array(
|
||||
'pretty_version' => 'v5.4.11',
|
||||
'version' => '5.4.11.0',
|
||||
|
||||
82
sources/DI/Controller/FileTestController.php
Normal file
82
sources/DI/Controller/FileTestController.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\DI\Controller;
|
||||
|
||||
use Combodo\iTop\DI\Form\Manager\ObjectFormManager;
|
||||
use Combodo\iTop\DI\Form\Type\Compound\PartialObjectType;
|
||||
use Combodo\iTop\DI\Form\Type\Compound\ObjectType;
|
||||
use Combodo\iTop\DI\Services\ObjectService;
|
||||
use Exception;
|
||||
use MetaModel;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
|
||||
/**
|
||||
* File test controller.
|
||||
*
|
||||
*/
|
||||
class FileTestController extends AbstractController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route("/file_test/form", name="file_test_form", methods={"POST"})
|
||||
*/
|
||||
public function showForm(Request $request) : Response
|
||||
{
|
||||
$oTask = [
|
||||
'task' => 'Write a blog post'
|
||||
];
|
||||
|
||||
$oForm = $this->createFormBuilder($oTask)
|
||||
->add('task', TextType::class)
|
||||
->add('doc', FileType::class)
|
||||
->add('docs', FileType::class, [
|
||||
'multiple' => true
|
||||
])
|
||||
->add('save', SubmitType::class, ['label' => 'Create Task'])
|
||||
->getForm();
|
||||
|
||||
$oForm->handleRequest($request);
|
||||
|
||||
// submitted and valid
|
||||
if ($oForm->isSubmitted() && $oForm->isValid()) {
|
||||
|
||||
$sDataPath = APPROOT . 'data';
|
||||
|
||||
$file = $oForm['doc']->getData();
|
||||
$file->move($sDataPath, $file->getClientOriginalName());
|
||||
|
||||
$files = $oForm['docs']->getData();
|
||||
foreach ($files as $file){
|
||||
$file->move($sDataPath, $file->getClientOriginalName());
|
||||
}
|
||||
|
||||
// return object form
|
||||
return new JsonResponse([
|
||||
'succeeded' => true
|
||||
]);
|
||||
}
|
||||
|
||||
// return object form
|
||||
return new JsonResponse([
|
||||
'template' => $this->renderView('DI/form/form.html.twig', [
|
||||
'form' => $oForm->createView(),
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
48
sources/DI/Controller/ParamConverterTestController.php
Normal file
48
sources/DI/Controller/ParamConverterTestController.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\DI\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
|
||||
/**
|
||||
* Param converter test controller.
|
||||
*
|
||||
* public const ENUM_SANITIZATION_FILTER_INTEGER = 'integer';
|
||||
* public const ENUM_SANITIZATION_FILTER_CLASS = 'class';
|
||||
* public const ENUM_SANITIZATION_FILTER_STRING = 'string';
|
||||
* public const ENUM_SANITIZATION_FILTER_CONTEXT_PARAM = 'context_param';
|
||||
* public const ENUM_SANITIZATION_FILTER_ROUTE = 'route';
|
||||
* public const ENUM_SANITIZATION_FILTER_OPERATION = 'operation';
|
||||
* public const ENUM_SANITIZATION_FILTER_PARAMETER = 'parameter';
|
||||
* public const ENUM_SANITIZATION_FILTER_FIELD_NAME = 'field_name';
|
||||
* public const ENUM_SANITIZATION_FILTER_TRANSACTION_ID = 'transaction_id';
|
||||
* public const ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER = 'element_identifier';
|
||||
* public const ENUM_SANITIZATION_FILTER_VARIABLE_NAME = 'variable_name';
|
||||
* public const ENUM_SANITIZATION_FILTER_RAW_DATA = 'raw_data';
|
||||
* public const ENUM_SANITIZATION_FILTER_URL = 'url';
|
||||
*/
|
||||
class ParamConverterTestController extends AbstractController
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route("/param_converter_test/{integer<\d+>}/{class<\w+>}", name="param_converter_test", methods={"GET"})
|
||||
* @ParamConverter("integer", options={"sanitization" : "integer"})
|
||||
* @ParamConverter("class", options={"sanitization" : "class"})
|
||||
*/
|
||||
public function convert(Request $request, string $integer, string $class) : Response
|
||||
{
|
||||
return $this->json([
|
||||
'sanitization' => [
|
||||
'integer' => $integer,
|
||||
'class' => $class,
|
||||
]
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Combodo\iTop\DI;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
|
||||
use Symfony;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
@@ -27,6 +28,7 @@ class ITopKernel extends BaseKernel
|
||||
$bundles = [
|
||||
new FrameworkBundle(),
|
||||
new TwigBundle(),
|
||||
new SensioFrameworkExtraBundle()
|
||||
];
|
||||
|
||||
if ($this->getEnvironment() == 'dev') {
|
||||
|
||||
25
sources/DI/Services/SanitizationParameterConverter.php
Normal file
25
sources/DI/Services/SanitizationParameterConverter.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\DI\Services;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use utils;
|
||||
|
||||
class SanitizationParameterConverter implements ParamConverterInterface
|
||||
{
|
||||
|
||||
public function apply(Request $request, ParamConverter $configuration)
|
||||
{
|
||||
$sInitial = $request->get($configuration->getName());
|
||||
$sSanitization = $configuration->getOptions()['sanitization'];
|
||||
$oSanitized = utils::Sanitize($sInitial, null, $sSanitization);
|
||||
$request->attributes->set($configuration->getName(), $oSanitized);
|
||||
}
|
||||
|
||||
public function supports(ParamConverter $configuration)
|
||||
{
|
||||
return array_key_exists('sanitization', $configuration->getOptions());
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
{# JS #}
|
||||
<script src="{{ asset_js('DI/toolkit.js') }}"></script>
|
||||
<script src="{{ asset_js('DI/app.js') }}"></script>
|
||||
<script src="{{ asset_js('DI/file_test.js') }}"></script>
|
||||
|
||||
{# - BLOCK HEAD - #}
|
||||
{% block head %}{% endblock %}
|
||||
@@ -80,6 +81,10 @@
|
||||
|
||||
$(document).ready(function(e) {
|
||||
|
||||
// App initialization
|
||||
const oFileTest = new FileTest('{{ path('file_test_form') }}');
|
||||
oFileTest.init();
|
||||
|
||||
{# - BLOCK READY SCRIPTS - #}
|
||||
{% block ready_scripts %}{% endblock %}
|
||||
|
||||
|
||||
@@ -53,6 +53,18 @@
|
||||
<a href="{{ path('configuration_edit') }}" class="nav-link">Edit Configuration</a>
|
||||
</li>
|
||||
|
||||
{# create task #}
|
||||
<li class="nav-item">
|
||||
<a href="#" class="nav-link" id="create_task">Create Task (FileType)</a>
|
||||
</li>
|
||||
|
||||
{# param converter #}
|
||||
<li class="nav-item">
|
||||
<a href="{{ path('param_converter_test', {
|
||||
'parameter' : 'mon-url'
|
||||
}) }}" class="nav-link" id="create_task">Param Converter</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
{# theme dark/light #}
|
||||
|
||||
Reference in New Issue
Block a user