From 06b8df26b13b37738739d3b20706f6412f9493f0 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 26 Jan 2012 12:32:37 +0100 Subject: [PATCH] Fix coding standards --- config/config.sample.yml | 13 +- config/services.sample.yml | 34 ++--- lib/Alchemy/Phrasea/Application/Admin.php | 2 +- lib/Alchemy/Phrasea/Application/Api.php | 8 +- lib/Alchemy/Phrasea/Application/Lightbox.php | 3 +- lib/Alchemy/Phrasea/Application/OAuth2.php | 18 +-- lib/Alchemy/Phrasea/Application/Overview.php | 2 +- lib/Alchemy/Phrasea/Application/Prod.php | 3 +- lib/Alchemy/Phrasea/Application/Root.php | 5 +- lib/Alchemy/Phrasea/Application/Setup.php | 5 +- .../Phrasea/Controller/Admin/Description.php | 7 +- .../Phrasea/Controller/Admin/Fields.php | 2 +- .../Phrasea/Controller/Admin/Publications.php | 7 + lib/Alchemy/Phrasea/Controller/Admin/Root.php | 3 +- .../Phrasea/Controller/Admin/Subdefs.php | 5 +- lib/Alchemy/Phrasea/Controller/Exception.php | 6 +- .../Phrasea/Controller/Prod/Basket.php | 36 ++--- lib/Alchemy/Phrasea/Controller/Prod/Edit.php | 16 +- .../Controller/Prod/MoveCollection.php | 2 +- .../Phrasea/Controller/Prod/Printer.php | 1 + lib/Alchemy/Phrasea/Controller/Prod/Push.php | 4 +- lib/Alchemy/Phrasea/Controller/Prod/Root.php | 2 +- lib/Alchemy/Phrasea/Controller/Prod/Story.php | 2 +- .../Phrasea/Controller/Prod/Tooltip.php | 6 +- .../Phrasea/Controller/Prod/UsrLists.php | 64 ++++---- .../Phrasea/Controller/Prod/WorkZone.php | 12 +- .../Phrasea/Controller/Root/RSSFeeds.php | 10 +- .../Phrasea/Controller/Setup/Installer.php | 12 +- .../Phrasea/Controller/Setup/Upgrader.php | 2 +- .../Controller/Utils/ConnectionTest.php | 4 +- .../Phrasea/Controller/Utils/PathFileTest.php | 2 +- lib/Alchemy/Phrasea/Core.php | 55 +++---- lib/Alchemy/Phrasea/Core/Configuration.php | 76 +++++----- .../Core/Configuration/Application.php | 17 ++- .../Phrasea/Core/Configuration/Handler.php | 22 +-- .../Phrasea/Core/Configuration/Parameter.php | 2 +- .../Phrasea/Core/Configuration/Parser.php | 10 +- .../Core/Configuration/Parser/Yaml.php | 6 +- .../Core/Configuration/Specification.php | 24 +-- .../Phrasea/Core/Service/Cache/ApcCache.php | 4 +- .../Phrasea/Core/Service/Cache/ArrayCache.php | 4 +- .../Core/Service/Cache/MemcacheCache.php | 8 +- .../Core/Service/Cache/MemcachedCache.php | 2 +- .../Phrasea/Core/Service/Cache/RedisCache.php | 2 +- .../Core/Service/Cache/XcacheCache.php | 8 +- .../Core/Service/Log/Doctrine/Monolog.php | 12 +- .../Core/Service/Log/Doctrine/Phpecho.php | 6 +- .../Phrasea/Core/Service/Log/Monolog.php | 2 +- .../Phrasea/Core/Service/Orm/Doctrine.php | 14 +- .../Phrasea/Core/Service/ServiceAbstract.php | 16 +- .../Phrasea/Core/Service/ServiceInterface.php | 10 +- .../Core/Service/TemplateEngine/Twig.php | 4 +- .../Core/ServiceBuilder/AbstractBuilder.php | 11 +- .../Phrasea/Core/ServiceBuilder/Cache.php | 10 +- .../Phrasea/Core/ServiceBuilder/Log.php | 2 +- .../Phrasea/Core/ServiceBuilder/Orm.php | 10 +- .../Core/ServiceBuilder/TemplateEngine.php | 10 +- lib/Alchemy/Phrasea/Core/Version.php | 2 +- lib/Alchemy/Phrasea/Helper/Helper.php | 10 +- lib/Alchemy/Phrasea/Helper/Prod.php | 12 +- lib/Alchemy/Phrasea/Helper/Record/Bridge.php | 2 +- lib/Alchemy/Phrasea/Helper/Record/Edit.php | 11 +- lib/Alchemy/Phrasea/Helper/Record/Feed.php | 2 +- lib/Alchemy/Phrasea/Helper/Record/Helper.php | 9 +- .../Phrasea/Helper/Record/MoveCollection.php | 15 +- lib/Alchemy/Phrasea/Helper/Record/Printer.php | 8 +- lib/Alchemy/Phrasea/Helper/Record/Push.php | 6 +- lib/Alchemy/Phrasea/Helper/User/Edit.php | 4 +- lib/Alchemy/Phrasea/Helper/User/Manage.php | 4 +- lib/Alchemy/Phrasea/Helper/WorkZone.php | 18 +-- lib/Alchemy/Phrasea/Out/Module/PDF.php | 2 +- lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php | 10 +- .../ControlProviderInterface.php | 20 +-- .../ControlProvider/UserProvider.php | 13 +- lib/Alchemy/Phrasea/Vocabulary/Controller.php | 6 +- lib/Alchemy/Phrasea/Vocabulary/Term.php | 34 ++--- lib/Doctrine/Entities/Basket.php | 26 ++-- lib/Doctrine/Entities/BasketElement.php | 20 +-- lib/Doctrine/Entities/StoryWZ.php | 12 +- lib/Doctrine/Entities/UsrList.php | 18 ++- lib/Doctrine/Entities/UsrListEntry.php | 12 +- lib/Doctrine/Entities/UsrListOwner.php | 14 +- lib/Doctrine/Entities/ValidationData.php | 16 +- .../Entities/ValidationParticipant.php | 25 +-- lib/Doctrine/Entities/ValidationSession.php | 25 +-- lib/Doctrine/Logger/MonologSQLLogger.php | 8 +- .../Proxies/EntitiesBasketElementProxy.php | 27 +++- lib/Doctrine/Proxies/EntitiesBasketProxy.php | 35 ++++- lib/Doctrine/Proxies/EntitiesStoryWZProxy.php | 21 ++- .../Proxies/EntitiesUsrListEntryProxy.php | 19 ++- .../Proxies/EntitiesUsrListOwnerProxy.php | 21 ++- lib/Doctrine/Proxies/EntitiesUsrListProxy.php | 21 ++- .../Proxies/EntitiesValidationDataProxy.php | 19 ++- .../EntitiesValidationParticipantProxy.php | 28 +++- .../EntitiesValidationSessionProxy.php | 35 ++++- .../Repositories/BasketElementRepository.php | 26 ++-- .../Repositories/BasketRepository.php | 50 +++--- .../Repositories/BasketElementRepository.php | 2 +- .../Repositories/BasketRepository.php | 2 +- .../Repositories/StoryWZRepository.php | 2 +- .../Repositories/UsrListEntryRepository.php | 2 +- .../Repositories/UsrListOwnerRepository.php | 2 +- .../Repositories/UsrListRepository.php | 2 +- .../ValidationParticipantRepository.php | 2 +- .../Repositories/StoryWZRepository.php | 2 +- .../Repositories/UsrListEntryRepository.php | 18 +-- .../Repositories/UsrListOwnerRepository.php | 8 +- .../Repositories/UsrListRepository.php | 24 +-- .../ValidationParticipantRepository.php | 2 +- lib/Doctrine/Types/Blob.php | 2 +- lib/Doctrine/Types/Enum.php | 2 +- lib/Doctrine/Types/LongBlob.php | 2 +- lib/Doctrine/Types/VarBinary.php | 2 +- lib/classes/ACL.class.php | 46 ++++-- lib/classes/API/OAuth2/Adapter.class.php | 2 +- lib/classes/API/V1/Log.class.php | 94 ++++++------ lib/classes/API/V1/adapter.class.php | 11 +- lib/classes/Bridge/Exception.class.php | 2 +- lib/classes/DailymotionWithoutOauth2.php | 13 +- lib/classes/Exception/BadRequest.class.php | 2 +- .../Setup/FixBadEmailAddresses.class.php | 6 +- lib/classes/Feed/Abstract.class.php | 2 +- lib/classes/Feed/Adapter.class.php | 14 +- lib/classes/Feed/Entry/Adapter.class.php | 4 +- lib/classes/Feed/XML/Cooliris.class.php | 2 + lib/classes/Session/Handler.class.php | 6 +- lib/classes/Setup/Upgrade.class.php | 6 +- lib/classes/User/Adapter.class.php | 15 +- lib/classes/User/Query.class.php | 5 +- lib/classes/appbox.class.php | 17 ++- lib/classes/base.class.php | 4 +- lib/classes/bootstrap.class.php | 8 +- lib/classes/caption/Field/Value.class.php | 34 ++--- lib/classes/caption/field.class.php | 27 ++-- lib/classes/caption/record.class.php | 4 +- lib/classes/collection.class.php | 2 +- lib/classes/connection.class.php | 3 + lib/classes/connection/abstract.class.php | 2 +- lib/classes/databox.class.php | 18 ++- lib/classes/databox/cgu.class.php | 4 +- .../databox/descriptionStructure.class.php | 2 +- lib/classes/databox/field.class.php | 8 +- lib/classes/databox/status.class.php | 18 +-- lib/classes/deprecated/prodUtils.php | 8 +- lib/classes/deprecated/push.api.php | 22 +-- lib/classes/eventsmanager/broker.class.php | 2 +- .../eventsmanager/eventAbstract.class.php | 2 +- .../notify/orderdeliver.class.php | 4 +- .../eventsmanager/notify/validate.class.php | 2 +- .../notify/validationdone.class.php | 4 +- .../notify/validationreminder.class.php | 4 +- lib/classes/gatekeeper.class.php | 10 +- lib/classes/geonames.class.php | 14 +- lib/classes/http/query.class.php | 6 + lib/classes/http/request.class.php | 2 +- lib/classes/lazaretFile.class.php | 2 +- lib/classes/module/admin.class.php | 4 +- .../module/console/fileConfigCheck.class.php | 14 +- .../module/console/systemUpgrade.class.php | 4 +- lib/classes/module/report.class.php | 2 + lib/classes/module/report/activity.class.php | 7 +- lib/classes/module/report/dashboard.class.php | 6 +- .../module/report/dashboard/feed.class.php | 9 +- .../module/report/dashboard/sort.class.php | 8 +- lib/classes/module/report/download.class.php | 2 +- lib/classes/module/report/nav.class.php | 4 +- lib/classes/patch/320f.class.php | 8 +- lib/classes/patch/360.class.php | 66 ++++---- lib/classes/phrasea.class.php | 6 +- lib/classes/random.class.php | 4 +- lib/classes/record/adapter.class.php | 25 +-- lib/classes/record/preview.class.php | 16 +- lib/classes/registry.class.php | 5 +- .../adapter/phrasea/engine.class.php | 8 +- .../adapter/phrasea/queryParser.class.php | 44 +++++- .../adapter/sphinx/engine.class.php | 4 +- lib/classes/searchEngine/options.class.php | 4 +- lib/classes/set/export.class.php | 18 ++- lib/classes/set/exportorder.class.php | 2 +- lib/classes/set/order.class.php | 26 ++-- lib/classes/setup.class.php | 22 ++- lib/classes/task/manager.class.php | 3 +- lib/classes/task/period/ftp.class.php | 12 +- lib/classes/task/period/outofdate.class.php | 32 ++-- .../task/period/upgradetov32.class.php | 11 +- lib/classes/task/period/writemeta.class.php | 21 +-- .../Doctrine/Entities.BasketElement.dcm.yml | 2 +- .../Doctrine/Entities.UsrListOwner.dcm.yml | 2 +- .../Doctrine/Entities.ValidationData.dcm.yml | 6 +- .../Entities.ValidationParticipant.dcm.yml | 2 +- lib/conf.d/PhraseaFixture/AbstractWZ.php | 8 +- .../PhraseaFixture/Basket/LoadFiveBaskets.php | 2 +- .../PhraseaFixture/Basket/LoadOneBasket.php | 12 +- .../Basket/LoadOneBasketEnv.php | 10 +- .../PhraseaFixture/Story/LoadOneStory.php | 2 +- .../PhraseaFixture/UsrLists/ListAbstract.php | 8 +- .../PhraseaFixture/UsrLists/UsrList.php | 4 +- .../PhraseaFixture/UsrLists/UsrListEntry.php | 10 +- .../PhraseaFixture/UsrLists/UsrListOwner.php | 6 +- .../LoadOneParticipant.php | 2 +- .../LoadParticipantWithSession.php | 4 +- .../LoadOneValidationSession.php | 14 +- lib/phpunit.xml.dist | 4 +- lib/unitTest/ACLTest.php | 72 ++++----- .../Phrasea/Application/ApiJsonTest.php | 10 +- .../Phrasea/Application/ApiYamlTest.php | 2 +- .../Phrasea/Application/OverviewTest.php | 2 +- .../Alchemy/Phrasea/Application/RootTest.php | 2 +- .../Alchemy/Phrasea/Application/SetupTest.php | 2 +- .../Phrasea/Controller/Admin/FieldsTest.php | 14 +- .../Controller/Admin/PublicationTest.php | 4 +- .../Phrasea/Controller/Admin/SubdefsTest.php | 18 +-- .../Phrasea/Controller/Admin/UsersTest.php | 18 +-- .../Phrasea/Controller/BoilerPlate.php | 26 ++-- .../Phrasea/Controller/Prod/BasketTest.php | 44 +++--- .../Phrasea/Controller/Prod/BridgeTest.php | 4 +- .../Phrasea/Controller/Prod/EditTest.php | 22 +-- .../Phrasea/Controller/Prod/FeedTest.php | 12 +- .../Controller/Prod/MoveCollectionTest.php | 12 +- .../Phrasea/Controller/Prod/PrinterTest.php | 16 +- .../Phrasea/Controller/Prod/PushTest.php | 18 +-- .../Phrasea/Controller/Prod/RootTest.php | 20 +-- .../Phrasea/Controller/Prod/StoryTest.php | 6 +- .../Phrasea/Controller/Prod/TooltipTest.php | 2 +- .../Phrasea/Controller/Prod/UsrListsTest.php | 142 +++++++++--------- .../Phrasea/Controller/Prod/WorkZoneTest.php | 6 +- .../Phrasea/Controller/Root/RSSFeedTest.php | 12 +- .../Controller/Setup/InstallerTest.php | 14 +- .../Phrasea/Controller/Setup/UpgraderTest.php | 14 +- .../Controller/Utils/ConnectionTestTest.php | 14 +- .../Controller/Utils/PathFileTestTest.php | 14 +- .../Core/Configuration/ApplicationTest.php | 6 +- .../Core/Configuration/ConfigurationTest.php | 4 +- .../Core/Configuration/HandlerTest.php | 4 +- .../Phrasea/Core/Configuration/ParserTest.php | 6 +- .../Configuration/confTestFiles/config.yml | 10 +- .../Configuration/confTestFiles/services.yml | 26 ++-- .../Core/Service/Cache/ApcCacheTest.php | 6 +- .../Core/Service/Cache/ArrayCacheTest.php | 4 +- .../Core/Service/Cache/MemcacheCacheTest.php | 6 +- .../Core/Service/Cache/XcacheCacheTest.php | 6 +- .../Core/Service/Log/Doctrine/MonologTest.php | 4 +- .../Core/Service/Log/Doctrine/PhpechoTest.php | 2 +- .../Phrasea/Core/Service/Log/MonologTest.php | 8 +- .../Phrasea/Core/Service/Orm/DoctrineTest.php | 20 +-- .../Core/Service/ServiceAbtractTest.php | 8 +- .../ServiceBuilder/AbstractBuilderTest.php | 6 +- .../Core/ServiceBuilder/CacheBuilderTest.php | 4 +- .../Core/ServiceBuilder/LogBuilderTest.php | 4 +- .../Core/ServiceBuilder/OrmBuilderTest.php | 6 +- .../ServiceBuilder/TemplateBuilderTest.php | 4 +- .../Alchemy/Phrasea/Core/VersionTest.php | 4 +- lib/unitTest/Alchemy/Phrasea/CoreTest.php | 6 +- .../Phrasea/Helper/Record/BridgeTest.php | 2 +- .../Phrasea/Helper/Record/EditTest.php | 20 +-- .../Phrasea/Helper/Record/FeedTest.php | 2 +- .../Phrasea/Helper/Record/HelperTest.php | 28 ++-- .../Helper/Record/MoveCollectionTest.php | 6 +- .../Phrasea/Helper/Record/PrinterTest.php | 4 +- .../Phrasea/Helper/Record/PushTest.php | 2 +- .../Phrasea/Helper/Record/TooltipTest.php | 2 +- lib/unitTest/Bridge/Bridge_AccountTest.php | 2 +- lib/unitTest/Doctrine/Entities/BasketTest.php | 10 +- .../Doctrine/Repositories/BasketTest.php | 4 +- lib/unitTest/api/v1/api_v1_adapterTest.php | 34 ++--- lib/unitTest/api/v1/api_v1_resultTest.php | 2 +- lib/unitTest/databox/databox_fieldTest.php | 6 +- lib/unitTest/databox/databox_statusTest.php | 8 +- lib/unitTest/record/adapterTest.php | 22 +-- lib/unitTest/report/dashboardTest.php | 4 +- lib/unitTest/searchEngine_optionsTest.php | 52 +++---- lib/unitTest/userTest.php | 14 +- .../web/admin/databox/doc_structure.twig | 4 +- templates/web/admin/editusers.twig | 6 +- templates/web/admin/editusers_timelimit.twig | 4 +- templates/web/admin/index.html.twig | 4 +- templates/web/admin/tree.html.twig | 62 ++++---- templates/web/common/menubar.twig | 14 +- templates/web/common/technical_datas.twig | 2 +- templates/web/prod/Baskets/Create.html.twig | 12 +- templates/web/prod/Baskets/Reorder.html.twig | 14 +- templates/web/prod/Baskets/Update.html.twig | 2 +- templates/web/prod/Story/Create.html.twig | 14 +- templates/web/prod/Tooltip/Basket.html.twig | 2 +- templates/web/prod/Tooltip/Story.html.twig | 2 +- templates/web/prod/Tooltip/User.html.twig | 4 +- templates/web/prod/WorkZone/Basket.html.twig | 2 +- .../prod/WorkZone/Browser/Basket.html.twig | 26 ++-- .../prod/WorkZone/Browser/Browser.html.twig | 44 +++--- .../prod/WorkZone/Browser/Results.html.twig | 14 +- templates/web/prod/WorkZone/Macros.twig | 36 ++--- templates/web/prod/WorkZone/Story.html.twig | 2 +- templates/web/prod/actions/Push.html.twig | 41 ++--- .../prod/actions/printer_default.html.twig | 2 +- templates/web/prod/index.html.twig | 19 +-- templates/web/setup/step2.html.twig | 4 +- www/admin/cgus.php | 2 +- www/admin/databases.php | 2 +- www/admin/demand.php | 2 +- www/admin/taskmanager.php | 3 +- www/client/answer.php | 5 +- www/client/homeinterpubbask.php | 2 +- www/include/download.php | 4 +- www/include/sendmailpage.php | 6 +- www/login/register.php | 7 +- www/prod/chgstatus.php | 2 +- www/prod/docfunction.php | 6 +- www/prod/pushdoc.php | 14 +- www/report/ajax_table_content.php | 3 +- www/report/tab.php | 3 +- www/thesaurus2/thesaurus.php | 4 +- www/upload/index.php | 2 +- 312 files changed, 2017 insertions(+), 1651 deletions(-) diff --git a/config/config.sample.yml b/config/config.sample.yml index 0e30106c80..551e972506 100644 --- a/config/config.sample.yml +++ b/config/config.sample.yml @@ -9,18 +9,18 @@ environment : prod ################# # DEVELOPPEMENT # ################# -dev: +dev: #Phraseanet refers to phraseanet app specific configuration phraseanet: servername: 'http://sub.domain.tld/' maintenance: false debug: true display_errors: true - + #Assign your phraseanet application connection #Connections are defined in connexions.yml configuration file database: main_connexion - + #Assign your template engine service & ORM service #Services are defined in service.yml configuration file template_engine: twig_debug @@ -36,10 +36,10 @@ prod: debug: false display_errors: false database: main_connexion - + template_engine: twig orm: doctrine_prod - + ############## # TEST # ############## @@ -50,8 +50,7 @@ test: debug: true display_errors: true database: main_connexion - + template_engine: twig_debug orm: doctrine_test - \ No newline at end of file diff --git a/config/services.sample.yml b/config/services.sample.yml index 77191b69e5..62a8e076e5 100644 --- a/config/services.sample.yml +++ b/config/services.sample.yml @@ -11,12 +11,12 @@ twig: debug: false #The charset used by the templates charset: utf-8 - #Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist) + #Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist) #And replace them with a null value. When set to true, Twig throws an exception instead (default to false) strict_variables: true #Optimize the node tree before compilation optimizer: true - + twig_debug: type: twig options: @@ -25,7 +25,7 @@ twig_debug: strict_variables: true autoescape: true optimizer: true - + #Doctrine developement service options #Service name doctrine_dev: @@ -47,15 +47,15 @@ doctrine_dev: query: array_cache result: array_cache metadata: array_cache - # Assign a service to log doctrine queries + # Assign a service to log doctrine queries log: query_logger - + # Doctrine test service options doctrine_test: type: doctrine options: debug: true - #Doctrine use a different connection configuration base to run tests + #Doctrine use a different connection configuration base to run tests dbal: test_connexion orm: cache: @@ -63,7 +63,7 @@ doctrine_test: result: array_cache metadata: array_cache log: query_logger - + # Doctrine production service options doctrine_prod: type: doctrine @@ -76,15 +76,15 @@ doctrine_prod: result: apc_cache metadata: apc_cache log: query_logger - - + + # Define a Log service # This one is defined to handle the logs of doctrine queries # Only Monolog is available as a logger service # Please Notice that for doctrine ONLY a echo logger service is available, see below # Monolog logger use the PHP Monolog library to handle logs using differents handlers query_logger: - type: monolog + type: monolog options: #You can precise the output format #This option is only available when log are used to log doctrine queries @@ -97,34 +97,34 @@ query_logger: channel: query-logger #Define how the logs will be handled #Avalaibale Handler are [rotate, stream] - #Rotate handler is used to stores logs to files that are rotated every day + #Rotate handler is used to stores logs to files that are rotated every day #And a limited number of files are kept by defining the max_day value #Stream handler is used to stores logs in a single local file handler: rotate max_day: 2 #Name of the file where logs are written filename: doctrine-query.log - + # Define a phpecho log service for Doctrine # phpecho logger logs doctrine queries to the standard output using echo/var_dump # Notice that phpecho logger do not have options sql_logger: type: phpecho - + #Define cache services #There are Four deffirent cache type available [array, xcache, apc, memcache] #Only a memcache service can take option to define port & host for the memcache server array_cache: type: array - + memcache_cache: type: memcache options: host: localhost port: 11211 - + apc_cache: type: apc - + xcache_cache: - type: xcache \ No newline at end of file + type: xcache diff --git a/lib/Alchemy/Phrasea/Application/Admin.php b/lib/Alchemy/Phrasea/Application/Admin.php index 5b6c8729fa..c0f458ccc5 100644 --- a/lib/Alchemy/Phrasea/Application/Admin.php +++ b/lib/Alchemy/Phrasea/Application/Admin.php @@ -44,4 +44,4 @@ return call_user_func( }); return $app; - }); \ No newline at end of file + }); diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index adc50a9cd3..e8926c32d4 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -44,7 +44,7 @@ return call_user_func(function() $app['p4user'] = null; /** - * @var API_OAuth2_Token + * @var API_OAuth2_Token */ $app['token'] = null; @@ -123,6 +123,7 @@ return call_user_func(function() } } } + return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action); }; @@ -141,6 +142,7 @@ return call_user_func(function() $app['token'] = \API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken()); if ($session->is_authenticated()) + return; if ($oauth2_adapter->has_ses_id()) { @@ -152,7 +154,7 @@ return call_user_func(function() } catch (\Exception $e) { - + } } $auth = new \Session_Authentication_None($app['p4user']); @@ -738,4 +740,4 @@ return call_user_func(function() //// */ //// public function add_user(\Symfony\Component\HttpFoundation\Request $app['request']); return $app; - }); \ No newline at end of file + }); diff --git a/lib/Alchemy/Phrasea/Application/Lightbox.php b/lib/Alchemy/Phrasea/Application/Lightbox.php index a05107aa38..0a6b09042e 100644 --- a/lib/Alchemy/Phrasea/Application/Lightbox.php +++ b/lib/Alchemy/Phrasea/Application/Lightbox.php @@ -77,6 +77,7 @@ return call_user_func( $browser = \Browser::getInstance(); if (!$browser->isMobile()) + return new Response(''); @@ -506,7 +507,7 @@ return call_user_func( , 200 , array('Content-Type' => 'application/json') ); - + $response->setCharset('UTF-8'); return $response; diff --git a/lib/Alchemy/Phrasea/Application/OAuth2.php b/lib/Alchemy/Phrasea/Application/OAuth2.php index a6ed0dd0bc..f6a0a65948 100644 --- a/lib/Alchemy/Phrasea/Application/OAuth2.php +++ b/lib/Alchemy/Phrasea/Application/OAuth2.php @@ -339,9 +339,9 @@ return call_user_func(function() } catch (Exception $e) { - + } - + $Serializer = $app['Core']['Serializer']; return new Response( @@ -374,9 +374,9 @@ return call_user_func(function() } catch (Exception $e) { - + } - + $Serializer = $app['Core']['Serializer']; return new Response( @@ -400,9 +400,9 @@ return call_user_func(function() } catch (Exception $e) { - + } - + $Serializer = $app['Core']['Serializer']; return new Response( @@ -424,9 +424,9 @@ return call_user_func(function() } catch (\Exception $e) { - + } - + $Serializer = $app['Core']['Serializer']; return new Response( @@ -455,4 +455,4 @@ return call_user_func(function() return $app; - }); \ No newline at end of file + }); diff --git a/lib/Alchemy/Phrasea/Application/Overview.php b/lib/Alchemy/Phrasea/Application/Overview.php index 531b5372a2..323c43f676 100644 --- a/lib/Alchemy/Phrasea/Application/Overview.php +++ b/lib/Alchemy/Phrasea/Application/Overview.php @@ -71,7 +71,7 @@ return call_user_func( } catch (\Exception $e) { - + } return \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment'); diff --git a/lib/Alchemy/Phrasea/Application/Prod.php b/lib/Alchemy/Phrasea/Application/Prod.php index ce93329c2d..ac28dfa10e 100644 --- a/lib/Alchemy/Phrasea/Application/Prod.php +++ b/lib/Alchemy/Phrasea/Application/Prod.php @@ -97,6 +97,7 @@ return call_user_func(function() return new response($twig->render('/prod/actions/Bridge/deactivated.twig', $params), 200); } + return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200); } if ($request->getRequestFormat() == 'json') @@ -114,4 +115,4 @@ return call_user_func(function() return $app; - }); \ No newline at end of file + }); diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 365816eec2..1ee962e211 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -36,10 +36,13 @@ return call_user_func(function() { $browser = \Browser::getInstance(); if ($browser->isMobile()) + return $app->redirect("/login/?redirect=/lightbox"); elseif ($browser->isNewGeneration()) + return $app->redirect("/login/?redirect=/prod"); else + return $app->redirect("/login/?redirect=/client"); }); @@ -71,4 +74,4 @@ return call_user_func(function() return $app; } -); \ No newline at end of file +); diff --git a/lib/Alchemy/Phrasea/Application/Setup.php b/lib/Alchemy/Phrasea/Application/Setup.php index 5b085da85e..8f1020c953 100644 --- a/lib/Alchemy/Phrasea/Application/Setup.php +++ b/lib/Alchemy/Phrasea/Application/Setup.php @@ -183,8 +183,10 @@ return call_user_func(function() $app->get('/', function() use ($app) { if ($app['install'] === true) + return $app->redirect('/setup/installer/'); if ($app['upgrade'] === true) + return $app->redirect('/setup/upgrader/'); }); @@ -197,6 +199,7 @@ return call_user_func(function() $app->error(function($e) use ($app) { if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled) + return $app->redirect('/login'); return new Response( @@ -211,4 +214,4 @@ return call_user_func(function() }); return $app; - }); \ No newline at end of file + }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Description.php b/lib/Alchemy/Phrasea/Controller/Admin/Description.php index 9fdb4ce73f..10c3c87d48 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Description.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Description.php @@ -88,7 +88,7 @@ class Description implements ControllerProviderInterface } catch (\Exception $e) { - + } $dces_element = null; @@ -136,7 +136,7 @@ class Description implements ControllerProviderInterface } catch (\Exception $e) { - + } } } @@ -183,7 +183,8 @@ class Description implements ControllerProviderInterface return new Response($Core->getTwig()->render('admin/databox/doc_structure.twig', $params)); }); + return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php index 505f6be406..ac5948aace 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php @@ -37,7 +37,7 @@ class Fields implements ControllerProviderInterface $controllers->get('/checkmulti/', function() use ($app, $appbox) { $request = $app['request']; - + $multi = ($request->get('multi') === 'true'); $metadata = \databox_field::load_class_from_xpath($request->get('source')); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php index 4d123bf716..6dc3bcebfc 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php @@ -88,6 +88,7 @@ class Publications implements ControllerProviderInterface $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); if (!$feed->is_owner($user)) + return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it')); $request = $app['request']; @@ -116,6 +117,7 @@ class Publications implements ControllerProviderInterface $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); if (!$feed->is_owner($user)) + return new Response('ERROR:you are not allowed'); $request = $app["request"]; @@ -123,20 +125,25 @@ class Publications implements ControllerProviderInterface $fileData = $request->files->get("Filedata"); if ($fileData['error'] !== 0) + return new Response('ERROR:error while upload'); $file = new \system_file($fileData['tmp_name']); if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif'))) + return new Response('ERROR:bad filetype'); if ($file->getSize() > 200000) + return new Response('ERROR:file too large'); $datas = $file->get_technical_datas(); if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT])) + return new Response('ERROR:file is not square'); if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT]) + return new Response('ERROR:file is not square'); $feed->set_icon($file); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Root.php b/lib/Alchemy/Phrasea/Controller/Admin/Root.php index 1121c4bd40..2331e4a883 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Root.php @@ -44,7 +44,7 @@ class Root implements ControllerProviderInterface $Core = $app['Core']; $appbox = \appbox::get_instance(); $user = $Core->getAuthenticatedUser(); - + \User_Adapter::updateClientInfos(3); $section = $app['request']->get('section', false); @@ -106,6 +106,7 @@ class Root implements ControllerProviderInterface )) ); }); + return $controllers; } diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php index af61037352..d19e8c4798 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php @@ -126,11 +126,12 @@ class Subdefs implements ControllerProviderInterface } } $subdefs->set_subdef($group, $name, $class, $downloadable, $options); - } + } } return \phrasea::redirect('/admin/subdefs/' . $databox->get_sbas_id() . '/'); }); + return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Controller/Exception.php b/lib/Alchemy/Phrasea/Controller/Exception.php index fd9101df75..4fc86eb317 100644 --- a/lib/Alchemy/Phrasea/Controller/Exception.php +++ b/lib/Alchemy/Phrasea/Controller/Exception.php @@ -10,12 +10,12 @@ */ namespace Alchemy\Phrasea\Controller; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ class Exception extends \Exception { - -} \ No newline at end of file + +} diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php index 67fe52d597..3bb0d816da 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php @@ -37,13 +37,13 @@ class Basket implements ControllerProviderInterface /** * This route is used to create a Basket - * + * * @params name : title (mandatory) * @params desc : description (optionnal) * @params lst : Phraseanet serialized record list (optionnal) - * + * * @accept JSON / YAML - * + * */ $controllers->post('/', function(Application $app) { @@ -119,9 +119,9 @@ class Basket implements ControllerProviderInterface /** * This route is used to delete a basket - * + * * @accept JSON / HTML - * + * */ $controllers->post('/{basket_id}/delete/', function(Application $app, Request $request, $basket_id) { @@ -152,7 +152,7 @@ class Basket implements ControllerProviderInterface }); /** - * Removes a BasketElement + * Removes a BasketElement */ $controllers->post( '/{basket_id}/delete/{basket_element_id}/' @@ -194,10 +194,10 @@ class Basket implements ControllerProviderInterface /** * Update name and description of a basket - * + * * @param name string mandatory * @param description string optionnal - * + * */ $controllers->post('/{basket_id}/update/', function(Application $app, Request $request, $basket_id) { @@ -255,7 +255,7 @@ class Basket implements ControllerProviderInterface /** - * Get the Basket reorder form + * Get the Basket reorder form */ $controllers->get( '/{basket_id}/reorder/' @@ -280,10 +280,10 @@ class Basket implements ControllerProviderInterface /** * Toggle the status of a Basket - * + * * @param acrhive : 0|1 (mandatory) - * - * @returns JSON / HTML + * + * @returns JSON / HTML */ $controllers->post('/{basket_id}/archive/', function(Application $app, Request $request, $basket_id) { @@ -307,7 +307,7 @@ class Basket implements ControllerProviderInterface { $message = _('Basket has been unarchived'); } - + $data = array( 'success' => true , 'archive' => $archive_status @@ -399,11 +399,11 @@ class Basket implements ControllerProviderInterface /** - * + * * Move Basket element from a basket to another - * + * * @params elements Array : list of basket element id - * + * */ $controllers->post( '/{basket_id}/stealElements/' @@ -459,7 +459,7 @@ class Basket implements ControllerProviderInterface }); /** - * Get basket creation form + * Get basket creation form */ $controllers->get('/create/', function(Application $app) { @@ -470,7 +470,7 @@ class Basket implements ControllerProviderInterface }); /** - * Get a basket + * Get a basket */ $controllers->get('/{basket_id}/', function(Application $app, $basket_id) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php index de831101d8..08fa143cf2 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php @@ -49,11 +49,11 @@ class Edit implements ControllerProviderInterface $controllers->get('/vocabulary/{vocabulary}/', function(Application $app, Request $request, $vocabulary) { $datas = array('success'=>false, 'message'=>'', 'results'=>array()); - + $Serializer = $app['Core']['Serializer']; - + $sbas_id = (int) $request->get('sbas_id'); - + try { $VC = \Alchemy\Phrasea\Vocabulary\Controller::get($vocabulary); @@ -62,17 +62,17 @@ class Edit implements ControllerProviderInterface catch(\Exception $e) { $datas['message'] = _('Vocabulary not found'); - + $datas = $Serializer->serialize($datas, 'json'); - + return new response($datas, 200, array('Content-Type'=>'application/json')); } - + $query = $request->get('query'); - + $datas['success'] = true; $datas['results'] = $VC->find($query, $app['Core']->getAuthenticatedUser(), $databox); - + return new response($Serializer->serialize($datas, 'json'), 200, array('Content-Type'=>'application/json')); } ); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php index 6239ae674a..24fcde8a4d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php @@ -62,4 +62,4 @@ class MoveCollection implements ControllerProviderInterface return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php index 09b98cee23..faf4f46f6f 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php @@ -62,6 +62,7 @@ class Printer implements ControllerProviderInterface ->log($record, \Session_Logger::EVENT_PRINT, $layout, ''); } $PDF = new PDFExport($printer->get_elements(), $layout); + return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf')); } ); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php index 0f88577e11..ae904035f8 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php @@ -249,7 +249,7 @@ class Push implements ControllerProviderInterface } catch (\Exception_NotFound $e) { - + } $Participant = new \Entities\ValidationParticipant(); @@ -335,7 +335,7 @@ class Push implements ControllerProviderInterface ->like(\User_Query::LIKE_LASTNAME, $request->get('query')) ->like(\User_Query::LIKE_LOGIN, $request->get('query')) ->like_match(\User_Query::LIKE_MATCH_OR); - + $result = $query->include_phantoms() ->limit(0, 50) ->execute()->get_results(); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php index 1d4a0ac81b..82cc9ba9b8 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php @@ -103,7 +103,7 @@ class Root implements ControllerProviderInterface /* @var $twig \Twig_Environment */ $twig = $app['Core']->getTwig(); - + $Serializer = $app['Core']['Serializer']; $out = $twig->render('prod/index.html.twig', array( diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 2c0e44b859..5caf227b2f 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -105,7 +105,7 @@ class Story implements ControllerProviderInterface 'record_id' => $Story->get_record_id(), ) ); - + $datas = $app['Core']['Serializer']->serialize($data, 'json'); return new Response($datas, 200, array('Content-type' => 'application/json')); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php index 1f76478e23..1cbcd7faeb 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php @@ -102,13 +102,13 @@ class Tooltip implements ControllerProviderInterface $record = new \record_adapter($sbas_id, $record_id, $number); $search_engine = null; - + if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false) { $search_engine = new \searchEngine_adapter($app['appbox']->get_registry()); $search_engine->set_options($search_engine_options); } - + /* @var $twig \Twig_Environment */ $twig = $app['Core']->getTwig(); @@ -200,4 +200,4 @@ class Tooltip implements ControllerProviderInterface return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php index 9bfa1f5d83..cf0e5c5c3a 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php @@ -98,9 +98,9 @@ class UsrLists implements ControllerProviderInterface $controllers->post('/list/', function(Application $app) { $request = $app['request']; - + $list_name = $request->get('name'); - + $datas = array( 'success' => false , 'message' => sprintf(_('Unable to create list %s'), $list_name) @@ -112,7 +112,7 @@ class UsrLists implements ControllerProviderInterface { throw new ControllerException(_('List name is required')); } - + $em = $app['Core']->getEntityManager(); $List = new \Entities\UsrList(); @@ -159,7 +159,7 @@ class UsrLists implements ControllerProviderInterface $repository = $em->getRepository('\Entities\UsrList'); $list = $repository->findUserListByUserAndId($user, $list_id); - + $owners = $entries = $lists = array(); foreach ($list->getOwners() as $owner) @@ -215,16 +215,16 @@ class UsrLists implements ControllerProviderInterface 'success' => false , 'message' => _('Unable to update list') ); - + try { $list_name = $request->get('name'); - + if(!$list_name) { throw new ControllerException(_('List name is required')); } - + $user = $app['Core']->getAuthenticatedUser(); $em = $app['Core']->getEntityManager(); @@ -266,9 +266,9 @@ class UsrLists implements ControllerProviderInterface try { $repository = $em->getRepository('\Entities\UsrList'); - + $user = $app['Core']->getAuthenticatedUser(); - + $list = $repository->findUserListByUserAndId($user, $list_id); $em->remove($list); @@ -305,19 +305,19 @@ class UsrLists implements ControllerProviderInterface try { $repository = $em->getRepository('\Entities\UsrList'); - + $user = $app['Core']->getAuthenticatedUser(); $list = $repository->findUserListByUserAndId($user, $list_id); /* @var $list \Entities\UsrList */ - + $entry_repository = $em->getRepository('\Entities\UsrListEntry'); - + $user_entry = $entry_repository->findEntryByListAndEntryId($list, $entry_id); $em->remove($user_entry); $em->flush(); - + $datas = array( 'success' => true , 'message' => _('Entry removed from list') @@ -345,7 +345,7 @@ class UsrLists implements ControllerProviderInterface { $em = $app['Core']->getEntityManager(); $user = $app['Core']->getAuthenticatedUser(); - + try { $repository = $em->getRepository('\Entities\UsrList'); @@ -399,14 +399,14 @@ class UsrLists implements ControllerProviderInterface $list = $repository->findUserListByUserAndId($user, $list_id); /* @var $list \Entities\UsrList */ - + if($list->getOwner($user)->getRole() < \Entities\UsrListOwner::ROLE_EDITOR) { throw new \Exception('You are not authorized to do this'); } - + $new_owner = \User_Adapter::getInstance($usr_id, \appbox::get_instance()); - + if($list->hasAccess($new_owner)) { $owner = $list->getOwner($new_owner); @@ -416,20 +416,20 @@ class UsrLists implements ControllerProviderInterface $owner = new \Entities\UsrListOwner(); $owner->setList($list); $owner->setUser($new_owner); - + $list->addUsrListOwner($owner); - + $em->persist($owner); $em->merge($list); } - + $role = $app['request']->get('role', \Entities\UsrListOwner::ROLE_USER); - + $owner->setRole($role); - + $em->merge($owner); $em->flush(); - + $datas = array( 'success' => true , 'message' => _('List shared to user') @@ -437,20 +437,20 @@ class UsrLists implements ControllerProviderInterface } catch (\Exception $e) { - + $datas = array( 'success' => false , 'message' => _('Unable to share the list with the usr') ); } - + $Json = $app['Core']['Serializer']->serialize($datas, 'json'); return new Response($Json, 200, array('Content-Type' => 'application/json')); } ); /** - * UnShare a list to a user + * UnShare a list to a user */ $controllers->post('/list/{list_id}/unshare/{owner_id}/', function(Application $app, $list_id, $owner_id) { @@ -463,19 +463,19 @@ class UsrLists implements ControllerProviderInterface $list = $repository->findUserListByUserAndId($user, $list_id); /* @var $list \Entities\UsrList */ - + if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_ADMIN) { throw new \Exception('You are not authorized to do this'); } - + $owners_repository = $em->getRepository('\Entities\UsrListOwner'); - + $owner = $owners_repository->findByListAndOwner($list, $owner_id); - + $em->remove($owner); $em->flush(); - + $datas = array( 'success' => true , 'message' => _('Owner removed from list') @@ -489,7 +489,7 @@ class UsrLists implements ControllerProviderInterface , 'message' => _('Unable to add usr to list') ); } - + $Json = $app['Core']['Serializer']->serialize($datas, 'json'); return new Response($Json, 200, array('Content-Type' => 'application/json')); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php index aa50c206e2..b0a65beaf9 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php @@ -51,11 +51,11 @@ class WorkZone implements ControllerProviderInterface $controllers->get('/Browse/', function(Application $app) { $date_obj = new \DateTime(); - + $params = array( 'CurrentYear' => $date_obj->format('Y') ); - + return new Response( $app['Core']->getTwig()->render('prod/WorkZone/Browser/Browser.html.twig' , $params @@ -76,10 +76,10 @@ class WorkZone implements ControllerProviderInterface $BasketRepo = $em->getRepository('\Entities\Basket'); $Page = (int) $request->get('Page', 0); - + $PerPage = 10; $offsetStart = max(($Page - 1) * $PerPage, 0); - + $Baskets = $BasketRepo->findWorkzoneBasket( $user @@ -106,7 +106,7 @@ class WorkZone implements ControllerProviderInterface return new Response($app['Core']->getTwig()->render('prod/WorkZone/Browser/Results.html.twig', $params)); }); - + $controllers->get('/Browse/Basket/{basket_id}/', function(Application $app, $basket_id) { @@ -114,7 +114,7 @@ class WorkZone implements ControllerProviderInterface $basket = $em->getRepository('\Entities\Basket') ->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser()); - + $params = array( 'Basket'=>$basket ); diff --git a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php index f0a66ff8b6..6b951bb243 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php +++ b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php @@ -48,17 +48,17 @@ class RSSFeeds implements ControllerProviderInterface { $content = new \Feed_XML_RSS(); } - + if ($format == \Feed_Adapter::FORMAT_ATOM) { $content = new \Feed_XML_Atom(); } - + if($format == \Feed_Adapter::FORMAT_COOLIRIS) { $content = new \Feed_XML_Cooliris(); } - + if ($user instanceof \User_Adapter) $link = $feed->get_user_link($registry, $user, $format, $page); else @@ -86,7 +86,7 @@ class RSSFeeds implements ControllerProviderInterface } foreach ($entries->get_entries() as $entry) $content->set_item($entry); - + $render = $content->render(); $response = new Response($render, 200, array('Content-Type' => $content->get_mimetype())); $response->setCharset('UTF-8'); @@ -180,7 +180,7 @@ class RSSFeeds implements ControllerProviderInterface return $display_feed($feed, \Feed_Adapter::FORMAT_COOLIRIS , $page); }); - + return $controllers; } diff --git a/lib/Alchemy/Phrasea/Controller/Setup/Installer.php b/lib/Alchemy/Phrasea/Controller/Setup/Installer.php index 56aa8c41df..3202510f16 100644 --- a/lib/Alchemy/Phrasea/Controller/Setup/Installer.php +++ b/lib/Alchemy/Phrasea/Controller/Setup/Installer.php @@ -132,9 +132,9 @@ class Installer implements ControllerProviderInterface set_time_limit(360); \phrasea::use_i18n(\Session_Handler::get_locale()); $request = $app['request']; - + $servername = $request->getScheme() . '://' . $request->getHttpHost() . '/'; - + $setupRegistry = new \Setup_Registry(); $setupRegistry->set('GV_ServerName', $servername); @@ -168,14 +168,14 @@ class Installer implements ControllerProviderInterface { return $app->redirect('/setup/installer/step2/?error=' . _('Databox is unreachable')); } - + \setup::rollback($conn, $connbas); try { $setupRegistry = new \Setup_Registry(); $setupRegistry->set('GV_ServerName', $servername); - + $appbox = \appbox::create($setupRegistry, $conn, $appbox_name, true); $handler = new \Alchemy\Phrasea\Core\Configuration\Handler( @@ -196,11 +196,11 @@ class Installer implements ControllerProviderInterface ); $ormService = $ormServiceBuilder->buildService(); - + if ($ormService->getType() === 'doctrine') { /* @var $em \Doctrine\ORM\EntityManager */ - + $em = $ormService->getService(); $metadatas = $em->getMetadataFactory()->getAllMetadata(); diff --git a/lib/Alchemy/Phrasea/Controller/Setup/Upgrader.php b/lib/Alchemy/Phrasea/Controller/Setup/Upgrader.php index d8ba2d1ca2..0e0922846d 100644 --- a/lib/Alchemy/Phrasea/Controller/Setup/Upgrader.php +++ b/lib/Alchemy/Phrasea/Controller/Setup/Upgrader.php @@ -88,4 +88,4 @@ class Upgrader implements ControllerProviderInterface return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php b/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php index 67f10a07e0..6522aadf13 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php @@ -52,7 +52,7 @@ class ConnectionTest implements ControllerProviderInterface } catch (\Exception $e) { - + } if ($dbname && $connection_ok === true) @@ -85,7 +85,7 @@ class ConnectionTest implements ControllerProviderInterface } catch (\Exception $e) { - + } } diff --git a/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php b/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php index 14b8687fc2..29838de99d 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php @@ -75,4 +75,4 @@ class PathFileTest implements ControllerProviderInterface return $controllers; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core.php b/lib/Alchemy/Phrasea/Core.php index 1aac0bc5e5..b8cf645c56 100644 --- a/lib/Alchemy/Phrasea/Core.php +++ b/lib/Alchemy/Phrasea/Core.php @@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core\Configuration; require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php'; /** - * + * * Phraseanet Core Container * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 @@ -149,13 +149,14 @@ class Core extends \Pimple $gatekeeper = \gatekeeper::getInstance(); $gatekeeper->check_directory(); } + return; } /** * Load Configuration - * - * @param type $environnement + * + * @param type $environnement */ private function init() { @@ -175,8 +176,8 @@ class Core extends \Pimple /** * Getter - * - * @return \Registry + * + * @return \Registry */ public function getRegistry() { @@ -185,8 +186,8 @@ class Core extends \Pimple /** * Getter - * - * @return \Registry + * + * @return \Registry */ public function getCache() { @@ -195,8 +196,8 @@ class Core extends \Pimple /** * Getter - * - * @return \Doctrine\ORM\EntityManager + * + * @return \Doctrine\ORM\EntityManager */ public function getEntityManager() { @@ -205,7 +206,7 @@ class Core extends \Pimple /** * Getter - * + * * @return \Twig_Environment */ public function getTwig() @@ -215,8 +216,8 @@ class Core extends \Pimple /** * Getter - * - * @return Alchemy\Phrasea\Core\Version + * + * @return Alchemy\Phrasea\Core\Version */ public function getVersion() { @@ -225,7 +226,7 @@ class Core extends \Pimple /** * Getter - * + * * @return \Symfony\Component\Serializer\Serializer */ public function getSerializer() @@ -235,8 +236,8 @@ class Core extends \Pimple /** * Tell if current seession is authenticated - * - * @return boolean + * + * @return boolean */ public function isAuthenticated() { @@ -247,8 +248,8 @@ class Core extends \Pimple /** * Return the current authenticated phraseanet user - * - * @return \User_adapter + * + * @return \User_adapter */ public function getAuthenticatedUser() { @@ -260,7 +261,7 @@ class Core extends \Pimple /** * Getter - * + * * @return Core\Configuration */ public function getConfiguration() @@ -309,8 +310,8 @@ class Core extends \Pimple /** * Initialiaze phraseanet log process - * - * @return Core + * + * @return Core */ protected function initLoggers() { @@ -332,8 +333,8 @@ class Core extends \Pimple /** * Return available language for phraseanet - * - * @return Array + * + * @return Array */ public static function getAvailableLanguages() { @@ -341,8 +342,8 @@ class Core extends \Pimple } /** - * Set Language - * + * Set Language + * */ protected function detectLanguage() { @@ -387,7 +388,7 @@ class Core extends \Pimple /** * Register directory and namespaces for autoloading app classes - * + * */ public static function initAutoloads() { @@ -425,7 +426,7 @@ class Core extends \Pimple /** * Initialize some PHP configuration variables - * + * */ public static function initPHPConf() { @@ -446,7 +447,7 @@ class Core extends \Pimple /** * Return the current working environnement (test, dev, prod etc ...) - * + * * @return string */ public function getEnv() diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index 637f297726..5e9df3414e 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -17,7 +17,7 @@ use Alchemy\Phrasea\Core\Configuration\Parser as ConfigurationParser; /** * Handle configuration file mechanism of phraseanet - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -33,7 +33,7 @@ class Configuration /** * Class that take care of configuration process - * @var Configuration\Handler + * @var Configuration\Handler */ private $configurationHandler; @@ -44,7 +44,7 @@ class Configuration private $environment; /** - * + * * @param type $envName the name of the loaded environnement */ public function __construct(Configuration\Handler $handler, $environment = null) @@ -65,7 +65,7 @@ class Configuration } catch (\Exception $e) { - + } } @@ -80,7 +80,7 @@ class Configuration /** * Setter - * @param Configuration\Handler $configurationHandler + * @param Configuration\Handler $configurationHandler */ public function setConfigurationHandler(Configuration\Handler $configurationHandler) { @@ -89,8 +89,8 @@ class Configuration /** * Return the current used environnement - * - * @return string + * + * @return string */ public function getEnvironnement() { @@ -98,13 +98,14 @@ class Configuration { $this->getConfiguration(); } + return $this->environment; } /** * Return the current used environnement - * - * @return string + * + * @return string */ public function setEnvironnement($environement = null) { @@ -114,7 +115,7 @@ class Configuration /** * Check if current environnement is on debug mode * Default to false - * @return boolean + * @return boolean */ public function isDebug() { @@ -128,13 +129,14 @@ class Configuration { $debug = false; } + return $debug; } /** * Check if phrasea is currently maintained * Default to false - * @return boolean + * @return boolean */ public function isMaintained() { @@ -148,13 +150,14 @@ class Configuration { $maintained = false; } + return $maintained; } /** * Check if current environnement should display errors * Default to false - * @return boolean + * @return boolean */ public function isDisplayingErrors() { @@ -168,24 +171,26 @@ class Configuration { $displayErrors = false; } + return $displayErrors; } /** * Return the phraseanet scope configurations values - * + * * @return ParameterBag */ public function getPhraseanet() { $phraseanetConf = $this->getConfiguration()->get('phraseanet'); + return new ParameterBag($phraseanetConf); } /** * Tell if the application is installed - * - * @return boolean + * + * @return boolean */ public function isInstalled() { @@ -194,13 +199,13 @@ class Configuration /** * Return the configuration - * + * * @return ParameterBag\ParameterBag */ public function getConfiguration() { $configuration = array(); - + if ($this->installed) { $configuration = $this->configurationHandler->handle($this->environment); @@ -212,8 +217,8 @@ class Configuration /** * Return Available logger - * - * @return Array + * + * @return Array */ public function getAvailableDoctrineLogger() { @@ -222,7 +227,7 @@ class Configuration /** * Return the connexion parameters as configuration parameter object - * + * * @return ParameterBag */ public function getConnexion($name = 'main_connexion') @@ -250,7 +255,7 @@ class Configuration /** * Return all connexions defined in connexions.yml - * @return ParameterBag + * @return ParameterBag */ public function getConnexions() { @@ -262,7 +267,7 @@ class Configuration /** * Return a the configuration file as an SplFileObject - * + * * @return \SplFileObject */ public function getFile() @@ -272,12 +277,13 @@ class Configuration /** * Return the full configuration file as an Array - * - * @return Array + * + * @return Array */ public function all() { $allConf = $this->configurationHandler->getParser()->parse($this->getFile()); + return $allConf; } @@ -295,10 +301,10 @@ class Configuration /** * Write datas in config file - * + * * @param array $data * @param type $flag - * @return Configuration + * @return Configuration */ public function write(Array $data, $flag = 0, $delete = false) { @@ -326,7 +332,7 @@ class Configuration /** * Delete configuration file - * @return Configuration + * @return Configuration */ public function delete() { @@ -339,7 +345,7 @@ class Configuration } catch (\Exception $e) { - + } return $this; @@ -347,7 +353,7 @@ class Configuration /** * Return configuration service for template_engine - * @return string + * @return string */ public function getTemplating() { @@ -365,9 +371,9 @@ class Configuration /** * Return the selected service configuration - * + * * @param type $name - * @return ParameterBag + * @return ParameterBag */ public function getService($name = 'twig') { @@ -394,7 +400,7 @@ class Configuration /** * return the service file - * @return \SplFileObject + * @return \SplFileObject */ public function getServiceFile() { @@ -403,7 +409,7 @@ class Configuration /** * Return the connexion file - * @return \SplFileObject + * @return \SplFileObject */ public function getConnexionFile() { @@ -412,7 +418,7 @@ class Configuration /** * Refresh the configuration - * @return Configuration + * @return Configuration */ public function refresh() { @@ -439,4 +445,4 @@ class Configuration return $this; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Application.php b/lib/Alchemy/Phrasea/Core/Configuration/Application.php index 914a2e3df0..f539ce7101 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Application.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Application.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration; /** * Precise some informations about phraseanet configuration mechanism - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -44,6 +44,7 @@ class Application implements Specification , $this->getConfigurationFileName() , $this->getConfigurationFileExtension() ); + return $path; } @@ -67,7 +68,7 @@ class Application implements Specification /** * Return the selected environnment from configuration file - * + * * @return string */ public function getSelectedEnv(Array $config) @@ -81,8 +82,8 @@ class Application implements Specification } /** - * Return the main configuration file - * + * Return the main configuration file + * * @return \SplFileObject */ public function getConfigurationFile() @@ -91,8 +92,8 @@ class Application implements Specification } /** - * Return the main configuration file - * + * Return the main configuration file + * * @return \SplFileObject */ public function getServiceFile() @@ -101,8 +102,8 @@ class Application implements Specification } /** - * Return the main configuration file - * + * Return the main configuration file + * * @return \SplFileObject */ public function getConnexionFile() diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Handler.php b/lib/Alchemy/Phrasea/Core/Configuration/Handler.php index 3f66163f26..278d9e4d6a 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Handler.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Handler.php @@ -15,7 +15,7 @@ use \Symfony\Component\Yaml\Yaml; /** * Handle configuration mechanism - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -24,27 +24,27 @@ class Handler { /** * Configuration file specification interface - * @var ConfigurationSpecification + * @var ConfigurationSpecification */ protected $confSpecification; /** - * A file parser interface + * A file parser interface * @var Parser\ParserInterface */ protected $parser; - + /** - * The environnment selected - * @var string + * The environnment selected + * @var string */ private $selectedEnvironnment; /** * Tell handler the configuration specification ans which parser to use - * + * * @param ConfigurationSpecification $configSpec - * @param Parser\ParserInterface $parser + * @param Parser\ParserInterface $parser */ public function __construct(Specification $configSpec, Parser $parser) { @@ -54,7 +54,7 @@ class Handler /** * Getter - * @return Specification + * @return Specification */ public function getSpecification() { @@ -72,7 +72,7 @@ class Handler /** * Handle the configuration process and return the final configuration - * + * * @param strinig $name the name of the loaded environnement * @return Array */ @@ -90,7 +90,7 @@ class Handler } $this->selectedEnvironnment = $selectedEnv; - + if (!isset($env[$selectedEnv])) { throw new \Exception(sprintf("The choosen development environment '%s' is not declared in %s", $selectedEnv, $file->getFileName())); diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Parameter.php b/lib/Alchemy/Phrasea/Core/Configuration/Parameter.php index d93c39c0e7..95223b3cd5 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Parameter.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Parameter.php @@ -34,4 +34,4 @@ class Parameter extends ParameterBag } } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Parser.php b/lib/Alchemy/Phrasea/Core/Configuration/Parser.php index 28d79406fb..50979b7278 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Parser.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Parser.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration; /** * A interface to parse configuration file - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -22,17 +22,17 @@ interface Parser { /** * Parse the configuration file $file to an array - * + * * @param \SplFileObject $file the file to parse * @return Array */ public function parse(\SplFileObject $file); - + /** * Dump into string from array - * + * * @param $conf * @return string */ public function dump(Array $conf, $level); -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Parser/Yaml.php b/lib/Alchemy/Phrasea/Core/Configuration/Parser/Yaml.php index 270adda8a9..91543c81ac 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Parser/Yaml.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Parser/Yaml.php @@ -14,7 +14,7 @@ use Symfony\Component\Yaml\Yaml as SfYaml; /** * Parse a configuration file in yaml format and return an array of values - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -36,7 +36,7 @@ class Yaml implements \Alchemy\Phrasea\Core\Configuration\Parser throw new \Exception(sprintf('Failed to parse the configuration file %s', $e->getMessage())); } } - + /** * * @Override @@ -46,4 +46,4 @@ class Yaml implements \Alchemy\Phrasea\Core\Configuration\Parser return SfYaml::dump($conf, $level); } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Specification.php b/lib/Alchemy/Phrasea/Core/Configuration/Specification.php index 11cd79103f..a1ea1f07ec 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Specification.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Specification.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration; /** * A interface to precise some specific configuration file mechanism - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -22,32 +22,32 @@ interface Specification { /** - * Return the pathname of the configuration file - * + * Return the pathname of the configuration file + * * @return string */ public function getConfigurationPathName(); - + /** * Return the path to the configuration file - * + * * @return string */ public function getConfigurationFilePath(); - + /** * Return the configurationFile extension - * + * * @return string */ public function getConfigurationFileExtension(); - + /** * Return the name of the configuration file - * + * * @return string */ public function getConfigurationFileName(); - - -} \ No newline at end of file + + +} diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/ApcCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/ApcCache.php index e023690cb7..91217f8279 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/ApcCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/ApcCache.php @@ -33,7 +33,7 @@ class ApcCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { @@ -63,7 +63,7 @@ class ApcCache extends ServiceAbstract implements ServiceInterface { throw new \Exception(sprintf('Registry dependency does not implement registryInterface for %s service', $this->name)); } - + return $registry; } diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/ArrayCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/ArrayCache.php index 4387be15a3..599cc7573f 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/ArrayCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/ArrayCache.php @@ -19,7 +19,7 @@ use Doctrine\Common\Cache as CacheService; /** * Array cache - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -34,7 +34,7 @@ class ArrayCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/MemcacheCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/MemcacheCache.php index e65b623dda..afeeaa9ba8 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/MemcacheCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/MemcacheCache.php @@ -48,7 +48,7 @@ class MemcacheCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { @@ -60,11 +60,11 @@ class MemcacheCache extends ServiceAbstract implements ServiceInterface $memcache = new \Memcache(); $memcache->addServer($this->host, $this->port); - + $key = sprintf("%s:%s", $this->host, $this->port); - + $stats = @$memcache->getExtendedStats(); - + if ($stats[$key]) { $memcache->connect($this->host, $this->port); diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/MemcachedCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/MemcachedCache.php index b9bc4a0979..6caa8f1866 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/MemcachedCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/MemcachedCache.php @@ -49,7 +49,7 @@ class MemcachedCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/RedisCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/RedisCache.php index 439fde700d..87fe131bfe 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/RedisCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/RedisCache.php @@ -49,7 +49,7 @@ class RedisCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { diff --git a/lib/Alchemy/Phrasea/Core/Service/Cache/XcacheCache.php b/lib/Alchemy/Phrasea/Core/Service/Cache/XcacheCache.php index 78f87cf94a..2dc44748bf 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Cache/XcacheCache.php +++ b/lib/Alchemy/Phrasea/Core/Service/Cache/XcacheCache.php @@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core, use Doctrine\Common\Cache as CacheService; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -33,7 +33,7 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface /** * - * @return Cache\ApcCache + * @return Cache\ApcCache */ public function getService() { @@ -45,7 +45,7 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface $registry = $this->getRegistry(); $service = new CacheService\XcacheCache(); - + $service->setNamespace($registry->get("GV_sit", "")); return $service; @@ -68,4 +68,4 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface return $registry; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Monolog.php b/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Monolog.php index 6dfd13162f..9c3b16b773 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Monolog.php +++ b/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Monolog.php @@ -29,11 +29,11 @@ class Monolog extends ParentLog implements ServiceInterface const JSON_OUTPUT = 'json'; const YAML_OUTPUT = 'yaml'; const VAR_DUMP_OUTPUT = 'vdump'; - + protected $outputs = array( self::JSON_OUTPUT, self::YAML_OUTPUT, self::VAR_DUMP_OUTPUT ); - + public function getService() { $output = isset($this->options["output"]) ? $this->options["output"] : self::JSON_OUTPUT; @@ -41,7 +41,7 @@ class Monolog extends ParentLog implements ServiceInterface if (!in_array($output, $this->outputs)) { throw new \Exception(sprintf( - "The output type '%s' declared in %s %s service is not valid. + "The output type '%s' declared in %s %s service is not valid. Available types are %s." , $output , $this->name @@ -53,10 +53,10 @@ class Monolog extends ParentLog implements ServiceInterface return new MonologSQLLogger($this->monolog, $output); } - + public function getType() { return 'doctrine_monolog'; } - -} \ No newline at end of file + +} diff --git a/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Phpecho.php b/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Phpecho.php index 4e7d64d654..6d948b0d84 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Phpecho.php +++ b/lib/Alchemy/Phrasea/Core/Service/Log/Doctrine/Phpecho.php @@ -26,7 +26,7 @@ use Doctrine\DBAL\Logging\EchoSQLLogger; class Phpecho extends ServiceAbstract implements ServiceInterface { - + public function getService() { return new EchoSQLLogger(); @@ -36,10 +36,10 @@ class Phpecho extends ServiceAbstract implements ServiceInterface { return 'phpecho'; } - + public function getScope() { return 'log'; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Service/Log/Monolog.php b/lib/Alchemy/Phrasea/Core/Service/Log/Monolog.php index b65cc37420..8eb90a6c5c 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Log/Monolog.php +++ b/lib/Alchemy/Phrasea/Core/Service/Log/Monolog.php @@ -61,7 +61,7 @@ class Monolog extends ServiceAbstract implements ServiceInterface if (!array_key_exists($handler, $this->handlers)) { throw new \Exception(sprintf( - "The handler type '%s' declared in %s %s service is not valid. + "The handler type '%s' declared in %s %s service is not valid. Available types are %s." , $handler , $this->name diff --git a/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php b/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php index 466ebf93af..6df771be9f 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php +++ b/lib/Alchemy/Phrasea/Core/Service/Orm/Doctrine.php @@ -20,7 +20,7 @@ use Doctrine\DBAL\Types\Type, use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -137,7 +137,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface $config->setProxyNamespace('Proxies'); $connexion = isset($options["dbal"]) ? $options["dbal"] : false; - + if (!$connexion) { throw new \Exception(sprintf( @@ -323,9 +323,9 @@ class Doctrine extends ServiceAbstract implements ServiceInterface } /** - * - * - * @param type $cacheName + * + * + * @param type $cacheName */ private function getCache($cacheDoctrine, $serviceName = null) { @@ -360,7 +360,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface if (!in_array($type, $this->caches)) { throw new \Exception(sprintf( - "The cache type '%s' declared in %s %s service is not valid. + "The cache type '%s' declared in %s %s service is not valid. Available types are %s." , $type , $this->name @@ -408,7 +408,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface if (!in_array($type, $this->loggers)) { throw new \Exception(sprintf( - "The logger type '%s' declared in %s %s service is not valid. + "The logger type '%s' declared in %s %s service is not valid. Available types are %s." , $type , $this->name diff --git a/lib/Alchemy/Phrasea/Core/Service/ServiceAbstract.php b/lib/Alchemy/Phrasea/Core/Service/ServiceAbstract.php index 2177eb90ff..16741b1d26 100644 --- a/lib/Alchemy/Phrasea/Core/Service/ServiceAbstract.php +++ b/lib/Alchemy/Phrasea/Core/Service/ServiceAbstract.php @@ -26,7 +26,7 @@ abstract class ServiceAbstract protected $name; protected $options; protected $configuration; - + private $dependencies; public function __construct($name, Array $options, Array $dependencies) @@ -34,7 +34,7 @@ abstract class ServiceAbstract $this->name = $name; $this->options = $options; $this->dependencies = $dependencies; - + $spec = new Core\Configuration\Application(); $parser = new Core\Configuration\Parser\Yaml(); $handler = new Core\Configuration\Handler($spec, $parser); @@ -48,21 +48,21 @@ abstract class ServiceAbstract { throw new \Exception(sprintf("Unknow dependency %s for %s service ", $name, $this->name)); } - + return $this->dependencies[$name]; } - - + + /** * - * @return Array + * @return Array */ public function getDependencies() { return $this->dependencies; } - + /** * * @return string @@ -90,4 +90,4 @@ abstract class ServiceAbstract return ''; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Service/ServiceInterface.php b/lib/Alchemy/Phrasea/Core/Service/ServiceInterface.php index 0189b5ab23..7bf3f1b475 100644 --- a/lib/Alchemy/Phrasea/Core/Service/ServiceInterface.php +++ b/lib/Alchemy/Phrasea/Core/Service/ServiceInterface.php @@ -21,12 +21,12 @@ namespace Alchemy\Phrasea\Core\Service; interface ServiceInterface { public function getName(); - + public function getType(); - + public function getService(); - + public function getOptions(); - + public function getScope(); -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Service/TemplateEngine/Twig.php b/lib/Alchemy/Phrasea/Core/Service/TemplateEngine/Twig.php index 8cdc63d361..16fc61b38b 100644 --- a/lib/Alchemy/Phrasea/Core/Service/TemplateEngine/Twig.php +++ b/lib/Alchemy/Phrasea/Core/Service/TemplateEngine/Twig.php @@ -53,7 +53,7 @@ class Twig extends ServiceAbstract implements ServiceInterface /** * Load phraseanet global variable - * it' s like any other template variable, + * it' s like any other template variable, * except that it’s available in all templates and macros * @return void */ @@ -199,4 +199,4 @@ class Twig extends ServiceAbstract implements ServiceInterface return 'template_engine'; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilder.php b/lib/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilder.php index 35eb9238d7..6523864680 100644 --- a/lib/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilder.php +++ b/lib/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilder.php @@ -23,7 +23,7 @@ abstract class AbstractBuilder { protected static $optionsNotMandatory = array(); - + private $service; public function __construct($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) @@ -38,7 +38,7 @@ abstract class AbstractBuilder /** * - * @return ServiceAbstract + * @return ServiceAbstract */ public function buildService() { @@ -49,7 +49,7 @@ abstract class AbstractBuilder { throw new \Exception("Abstract factory does not create any concrete Service"); } - + protected static function getServiceOptions($type, ParameterBag $configuration) { if(!in_array($type, static::$optionsNotMandatory)) @@ -67,7 +67,8 @@ abstract class AbstractBuilder $options = array(); } } + return $options; } - -} \ No newline at end of file + +} diff --git a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Cache.php b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Cache.php index 0c91ddc687..ef3be88b8e 100644 --- a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Cache.php +++ b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Cache.php @@ -23,15 +23,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; class Cache extends AbstractBuilder { protected static $optionsNotMandatory = array('apc', 'xcache', 'memcache', 'array', 'memcached', 'redis'); - + public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) { $type = $configuration->get("type"); - + $options = parent::getServiceOptions($type, $configuration); - + $className = sprintf("\Alchemy\Phrasea\Core\Service\Cache\%sCache", ucfirst($type)); - + if (class_exists($className)) { return new $className($name, $options, $dependencies); @@ -46,4 +46,4 @@ class Cache extends AbstractBuilder } } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Log.php b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Log.php index 867417a812..28085751da 100644 --- a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Log.php +++ b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Log.php @@ -54,4 +54,4 @@ class Log extends AbstractBuilder } } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Orm.php b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Orm.php index 57f1a8c8b5..1f0b39872c 100644 --- a/lib/Alchemy/Phrasea/Core/ServiceBuilder/Orm.php +++ b/lib/Alchemy/Phrasea/Core/ServiceBuilder/Orm.php @@ -22,15 +22,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; */ class Orm extends AbstractBuilder { - + public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) { $type = $configuration->get("type"); - + $options = parent::getServiceOptions($type, $configuration); - + $className = sprintf("\Alchemy\Phrasea\Core\Service\Orm\%s", ucfirst($type)); - + if (class_exists($className)) { return new $className($name, $options, $dependencies); @@ -45,4 +45,4 @@ class Orm extends AbstractBuilder } } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/ServiceBuilder/TemplateEngine.php b/lib/Alchemy/Phrasea/Core/ServiceBuilder/TemplateEngine.php index bbbb3b9380..9c4908116c 100644 --- a/lib/Alchemy/Phrasea/Core/ServiceBuilder/TemplateEngine.php +++ b/lib/Alchemy/Phrasea/Core/ServiceBuilder/TemplateEngine.php @@ -22,15 +22,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; */ class TemplateEngine extends AbstractBuilder { - + public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) { $type = $configuration->get("type"); - + $options = parent::getServiceOptions($type, $configuration); - + $className = sprintf("\Alchemy\Phrasea\Core\Service\TemplateEngine\%s", ucfirst($type)); - + if (class_exists($className)) { return new $className($name, $options, $dependencies); @@ -45,4 +45,4 @@ class TemplateEngine extends AbstractBuilder } } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index 7c9340de77..3b3c86a887 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -12,7 +12,7 @@ namespace Alchemy\Phrasea\Core; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/Alchemy/Phrasea/Helper/Helper.php b/lib/Alchemy/Phrasea/Helper/Helper.php index a485301fb2..d4fecc1093 100644 --- a/lib/Alchemy/Phrasea/Helper/Helper.php +++ b/lib/Alchemy/Phrasea/Helper/Helper.php @@ -25,20 +25,20 @@ class Helper /** * - * @var \Alchemy\Phrasea\Core\Kernel + * @var \Alchemy\Phrasea\Core\Kernel */ protected $core; /** * - * @var \Symfony\Component\HttpFoundation\Request + * @var \Symfony\Component\HttpFoundation\Request */ protected $request; /** * * @param Kernel $kernel - * @return Helper + * @return Helper */ public function __construct(Core $core, Request $Request) { @@ -50,7 +50,7 @@ class Helper /** * - * @return \Alchemy\Phrasea\Core + * @return \Alchemy\Phrasea\Core */ public function getCore() { @@ -59,7 +59,7 @@ class Helper /** * - * @return \Symfony\Component\HttpFoundation\Request + * @return \Symfony\Component\HttpFoundation\Request */ public function getRequest() { diff --git a/lib/Alchemy/Phrasea/Helper/Prod.php b/lib/Alchemy/Phrasea/Helper/Prod.php index f539f425a4..ecfbd4eb30 100644 --- a/lib/Alchemy/Phrasea/Helper/Prod.php +++ b/lib/Alchemy/Phrasea/Helper/Prod.php @@ -15,14 +15,14 @@ use Alchemy\Phrasea\Core; use Symfony\Component\HttpFoundation\Request; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ class Prod extends \Alchemy\Phrasea\Helper\Helper { - + public function get_search_datas() { $search_datas = array( @@ -35,7 +35,7 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper $appbox = \appbox::get_instance(); $session = $appbox->get_session(); $user = $this->getCore()->getAuthenticatedUser(); - + $searchSet = $user->getPrefs('search'); foreach ($user->ACL()->get_granted_sbas() as $databox) @@ -75,7 +75,7 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper else $dates[$id] = array('sbas' => array($sbas_id), 'fieldname' => $name); } - + if (isset($fields[$name])) { $fields[$name]['sbas'][] = $sbas_id; @@ -108,9 +108,9 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper return $search_datas; } - + public function getRandom() { return md5(time() . mt_rand(100000, 999999)); } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Helper/Record/Bridge.php b/lib/Alchemy/Phrasea/Helper/Record/Bridge.php index f9425d2075..c2b50b768e 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Bridge.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Bridge.php @@ -23,5 +23,5 @@ use Symfony\Component\HttpFoundation\Request; */ class Bridge extends RecordHelper { - + } diff --git a/lib/Alchemy/Phrasea/Helper/Record/Edit.php b/lib/Alchemy/Phrasea/Helper/Record/Edit.php index 0ebdce70c8..d790a9fdb4 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Edit.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Edit.php @@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core, /** * Edit Record Helper * This object handles /edit/ request and filters records that user can edit - * + * * It prepares metadatas, databases structures. * * @package @@ -72,14 +72,14 @@ class Edit extends RecordHelper /** * - * @var type + * @var type */ protected $has_thesaurus = false; /** * * @param \Alchemy\Phrasea\Core $core - * @return Edit + * @return Edit */ public function __construct(Core $core, Request $Request) { @@ -493,11 +493,12 @@ class Edit extends RecordHelper } catch (Exception $e) { - + } } if (!is_array($request->get('mds'))) + return $this; $sbas_id = (int) $request->get('sbid'); @@ -544,7 +545,7 @@ class Edit extends RecordHelper } /** - * todo : this should not work + * todo : this should not work */ if ($write_edit_el instanceof \databox_field) { diff --git a/lib/Alchemy/Phrasea/Helper/Record/Feed.php b/lib/Alchemy/Phrasea/Helper/Record/Feed.php index 1a08e8bf83..36c0652528 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Feed.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Feed.php @@ -45,7 +45,7 @@ class Feed extends RecordHelper /** * * @param \Alchemy\Phrasea\Core $core - * @return Feed + * @return Feed */ public function __construct(Core $core, Request $Request) { diff --git a/lib/Alchemy/Phrasea/Helper/Record/Helper.php b/lib/Alchemy/Phrasea/Helper/Record/Helper.php index 4699309515..ecdfffe423 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Helper.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Helper.php @@ -15,7 +15,7 @@ use Alchemy\Phrasea\Core; use Symfony\Component\HttpFoundation\Request; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -99,7 +99,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper /** * * @param \Alchemy\Phrasea\Core $core - * @return Helper + * @return Helper */ public function __construct(Core $core, Request $Request) { @@ -195,6 +195,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper if (!$this->is_single_grouping()) throw new Exception('Cannot use ' . __METHOD__ . ' here'); foreach ($this->get_elements() as $record) + return $record; } @@ -287,8 +288,10 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper public function get_serialize_list() { if ($this->is_single_grouping()) + return $this->get_grouping_head()->get_serialize_key(); else + return $this->selection->serialize_list(); } @@ -303,4 +306,4 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper return $this; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Helper/Record/MoveCollection.php b/lib/Alchemy/Phrasea/Helper/Record/MoveCollection.php index 2e67f1926e..07fc44ffab 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/MoveCollection.php +++ b/lib/Alchemy/Phrasea/Helper/Record/MoveCollection.php @@ -44,7 +44,7 @@ class MoveCollection extends RecordHelper /** * * @param \Alchemy\Phrasea\Core $core - * @return MoveCollection + * @return MoveCollection */ public function __construct(Core $core, Request $Request) { @@ -64,6 +64,7 @@ class MoveCollection extends RecordHelper $this->available_destinations = array(); if (!$this->is_possible) + return $this; $this->available_destinations = array_keys( @@ -101,17 +102,17 @@ class MoveCollection extends RecordHelper $user = $this->getCore()->getAuthenticatedUser(); $baseId = $request->get('base_id'); - + $base_dest = $user->ACL()->has_right_on_base($baseId, 'canaddrecord') ? $request->get('base_id') : false; - + if(!$user->ACL()->has_right_on_base($baseId, 'canaddrecord')) { throw new \Exception_Unauthorized(sprintf("%s do not have the permission to move records to %s", $user->get_login())); } - - + + if (!$this->is_possible()) throw new Exception('This action is not possible'); @@ -130,8 +131,8 @@ class MoveCollection extends RecordHelper } } } - - + + $collection = \collection::get_from_base_id($base_dest); foreach ($this->selection as $record) diff --git a/lib/Alchemy/Phrasea/Helper/Record/Printer.php b/lib/Alchemy/Phrasea/Helper/Record/Printer.php index 76a72b9f71..8ae7118381 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Printer.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Printer.php @@ -18,7 +18,7 @@ use Alchemy\Phrasea\Helper\Record\Helper as RecordHelper, /** * Edit Record Helper * This object handles /edit/ request and filters records that user can edit - * + * * It prepares metadatas, databases structures. * * @package @@ -33,7 +33,7 @@ class Printer extends RecordHelper /** * * @param \Alchemy\Phrasea\Core $core - * @return Printer + * @return Printer */ public function __construct(Core $core, Request $Request) { @@ -68,7 +68,7 @@ class Printer extends RecordHelper } catch (\Exception $e) { - + } } @@ -87,7 +87,7 @@ class Printer extends RecordHelper } catch (\Exception $e) { - + } } diff --git a/lib/Alchemy/Phrasea/Helper/Record/Push.php b/lib/Alchemy/Phrasea/Helper/Record/Push.php index 06d3d29d74..2afca8df86 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Push.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Push.php @@ -18,7 +18,7 @@ use Alchemy\Phrasea\Helper\Record\Helper as RecordHelper, /** * Edit Record Helper * This object handles /edit/ request and filters records that user can edit - * + * * It prepares metadatas, databases structures. * * @package @@ -29,7 +29,7 @@ class Push extends RecordHelper { protected $flatten_groupings = true; - + protected $required_rights = array('canpush'); - + } diff --git a/lib/Alchemy/Phrasea/Helper/User/Edit.php b/lib/Alchemy/Phrasea/Helper/User/Edit.php index 18c789d379..3eafd16acd 100644 --- a/lib/Alchemy/Phrasea/Helper/User/Edit.php +++ b/lib/Alchemy/Phrasea/Helper/User/Edit.php @@ -433,7 +433,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper $rights[$k] = $right . '_' . $base_id; } $parm = $request->get_parms_from_serialized_datas($rights, 'values'); - + foreach ($parm as $p => $v) { if (trim($v) == '') @@ -602,7 +602,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper } $current_user = \User_adapter::getInstance($session->get_usr_id(), $appbox); - + $base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin'))); foreach ($this->users as $usr_id) diff --git a/lib/Alchemy/Phrasea/Helper/User/Manage.php b/lib/Alchemy/Phrasea/Helper/User/Manage.php index 2ad622ee3e..6a36961d72 100644 --- a/lib/Alchemy/Phrasea/Helper/User/Manage.php +++ b/lib/Alchemy/Phrasea/Helper/User/Manage.php @@ -140,8 +140,8 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper if (is_null($v)) $this->query_parms[$k] = false; } - - + + $query = new \User_Query($appbox); $templates = $query ->only_templates(true) diff --git a/lib/Alchemy/Phrasea/Helper/WorkZone.php b/lib/Alchemy/Phrasea/Helper/WorkZone.php index aba0ea3b74..c53d125bcd 100644 --- a/lib/Alchemy/Phrasea/Helper/WorkZone.php +++ b/lib/Alchemy/Phrasea/Helper/WorkZone.php @@ -15,7 +15,7 @@ use Alchemy\Phrasea\Core; use Symfony\Component\HttpFoundation\Request; /** - * + * * WorkZone provides methods for working with the working zone of Phraseanet * Production. This zones handles Non-Archived baskets, stories and Validation * people are waiting from me. @@ -26,20 +26,20 @@ use Symfony\Component\HttpFoundation\Request; */ class WorkZone extends Helper { - + const BASKETS = 'baskets'; const STORIES = 'stories'; const VALIDATIONS = 'validations'; - + /** - * + * * Returns an ArrayCollection containing three keys : - * - self::BASKETS : an ArrayCollection of the actives baskets + * - self::BASKETS : an ArrayCollection of the actives baskets * (Non Archived) * - self::STORIES : an ArrayCollection of working stories * - self::VALIDATIONS : the validation people are waiting from me * - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function getContent() { @@ -51,17 +51,17 @@ class WorkZone extends Helper $ret = new \Doctrine\Common\Collections\ArrayCollection(); - + $baskets = $repo_baskets->findActiveByUser($current_user); $validations = $repo_baskets->findActiveValidationByUser($current_user); /* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */ $repo_stories = $em->getRepository('Entities\StoryWZ'); - + $ret->set(self::BASKETS, $baskets); $ret->set(self::VALIDATIONS, $validations); $ret->set(self::STORIES, $repo_stories->findByUser($current_user)); - + return $ret; } diff --git a/lib/Alchemy/Phrasea/Out/Module/PDF.php b/lib/Alchemy/Phrasea/Out/Module/PDF.php index 5194663d18..76ecb7bc6d 100644 --- a/lib/Alchemy/Phrasea/Out/Module/PDF.php +++ b/lib/Alchemy/Phrasea/Out/Module/PDF.php @@ -17,7 +17,7 @@ require_once __DIR__ . '/../../../../vendor/tcpdf/tcpdf.php'; /** * Creates a PDF - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php index 0740769fd3..d681d42450 100644 --- a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php +++ b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php @@ -12,7 +12,7 @@ namespace Alchemy\Phrasea\Out\Tool; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -23,7 +23,7 @@ class PhraseaPDF extends \TCPDF function Header() { - + } function Footer() @@ -32,13 +32,13 @@ class PhraseaPDF extends \TCPDF $mr = $this->SetRightMargin(0); $this->SetY(-15); - + $this->SetFont(self::FONT, 'I', 8); $this->Cell(0, 10, 'Page ' . $this->PageNo(), 0, 0, 'C'); $this->SetFont(self::FONT, '', 8); $w = $this->GetStringWidth('Printed by'); - + $this->SetFont(self::FONT, 'B', 8); $w += $this->GetStringWidth(' Phraseanet'); @@ -46,7 +46,7 @@ class PhraseaPDF extends \TCPDF $this->SetFont(self::FONT, '', 8); $this->Write(8, 'Printed by'); - + $this->SetFont(self::FONT, 'B', 8); $this->Write(8, ' Phraseanet'); } diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php index 03998e069b..cc2dd1d5e1 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php +++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Vocabulary\ControlProvider; /** * ControlProvider Interface - * + * * This interface should be used to interconnect vocabularies and metadatas * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 @@ -24,19 +24,19 @@ interface ControlProviderInterface /** * @return the type of the ControlProvider - * - * ControlProvider class should be named like {type}Provider + * + * ControlProvider class should be named like {type}Provider * in the ControlProvider namespace */ public static function getType(); /** - * @return stringa simple i18n word to reprsent this vocabullary + * @return stringa simple i18n word to reprsent this vocabullary */ public static function getName(); /** - * @return boolean validate an $id in the vocabulary + * @return boolean validate an $id in the vocabulary */ public static function validate($id); @@ -48,13 +48,13 @@ interface ControlProviderInterface /** * Find matching Term in the vocabulary repository - * + * * @param string $query A scalar quaery - * @param \User_Adapter $for_user The user doing the query + * @param \User_Adapter $for_user The user doing the query * @param \databox $on_databox The databox where vocabulary should be requested - * - * @return Doctrine\Common\Collections\ArrayCollection + * + * @return Doctrine\Common\Collections\ArrayCollection */ public static function find($query, \User_Adapter $for_user, \databox $on_databox); -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php index c924fb9ede..b26069cbe5 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php +++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php @@ -23,7 +23,7 @@ class UserProvider implements ControlProviderInterface { /** - * @return string + * @return string */ public static function getType() { @@ -32,7 +32,7 @@ class UserProvider implements ControlProviderInterface /** * - * @return type + * @return type */ public static function getName() { @@ -44,7 +44,7 @@ class UserProvider implements ControlProviderInterface * @param string $query * @param \User_Adapter $for_user * @param \databox $on_databox - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public static function find($query, \User_Adapter $for_user, \databox $on_databox) { @@ -75,18 +75,19 @@ class UserProvider implements ControlProviderInterface /** * * @param mixed $id - * @return boolean + * @return boolean */ public static function validate($id) { try { \User_Adapter::getInstance($id, appbox::get_instance()); + return true; } catch (\Exception $e) { - + } return false; @@ -95,7 +96,7 @@ class UserProvider implements ControlProviderInterface /** * * @param mixed $id - * @return string + * @return string */ public static function getValue($id) { diff --git a/lib/Alchemy/Phrasea/Vocabulary/Controller.php b/lib/Alchemy/Phrasea/Vocabulary/Controller.php index f8553d4e25..feb8b02f9b 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/Controller.php +++ b/lib/Alchemy/Phrasea/Vocabulary/Controller.php @@ -12,8 +12,8 @@ namespace Alchemy\Phrasea\Vocabulary; /** - * Vocabulary Controller - * + * Vocabulary Controller + * * Various methods fro controlling vocabularies inside Phraseanet * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 @@ -44,7 +44,7 @@ class Controller /** * Returns an array of available ControlProviders * - * @return array + * @return array */ public static function getAvailable() { diff --git a/lib/Alchemy/Phrasea/Vocabulary/Term.php b/lib/Alchemy/Phrasea/Vocabulary/Term.php index c602a7e376..74dd6ea826 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/Term.php +++ b/lib/Alchemy/Phrasea/Vocabulary/Term.php @@ -13,10 +13,10 @@ namespace Alchemy\Phrasea\Vocabulary\ControlProvider; /** * Vocabulary Term - * + * * A Term of vocabulary has a Value, and optionnal context, ControllerProvider * and an Id - * + * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ @@ -25,38 +25,38 @@ class Term /** * - * @var string + * @var string */ protected $value; /** * - * @var string + * @var string */ protected $context; /** * - * @var ControlProviderInterface + * @var ControlProviderInterface */ protected $type; /** * - * @var mixed + * @var mixed */ protected $id; /** * Construct a Term - * + * * @param string $value the scalar value of the Term * @param string $context A string defining the context of the Term * @param ControlProviderInterface $type A Vocabulary Controller * @param mixed $id The id of the term in the Vocabulary Controller - * + * * @return \Alchemy\Phrasea\Vocabulary\ControlProvider\Term - * @throws Exception + * @throws Exception */ public function __construct($value, $context = null, ControlProviderInterface $type = null, $id = null) { @@ -76,8 +76,8 @@ class Term /** * Get the scalar value of a term - * - * @return string + * + * @return string */ public function getValue() { @@ -86,8 +86,8 @@ class Term /** * Get the content of a term - * - * @return string + * + * @return string */ public function getContext() { @@ -95,8 +95,8 @@ class Term } /** - * - * @return ControlProviderInterface + * + * @return ControlProviderInterface */ public function getType() { @@ -105,11 +105,11 @@ class Term /** * - * @return mixed + * @return mixed */ public function getId() { return $this->id; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/Basket.php b/lib/Doctrine/Entities/Basket.php index 31aaee68fe..c6895b428b 100644 --- a/lib/Doctrine/Entities/Basket.php +++ b/lib/Doctrine/Entities/Basket.php @@ -76,7 +76,7 @@ class Basket /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -96,7 +96,7 @@ class Basket /** * Get name * - * @return string + * @return string */ public function getName() { @@ -116,7 +116,7 @@ class Basket /** * Get description * - * @return text + * @return text */ public function getDescription() { @@ -136,7 +136,7 @@ class Basket /** * Get usr_id * - * @return integer + * @return integer */ public function getUsrId() { @@ -156,7 +156,7 @@ class Basket /** * Get pusher_id * - * @return integer + * @return integer */ public function getPusherId() { @@ -176,7 +176,7 @@ class Basket /** * Get archived * - * @return boolean + * @return boolean */ public function getArchived() { @@ -196,7 +196,7 @@ class Basket /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -216,7 +216,7 @@ class Basket /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -236,7 +236,7 @@ class Basket /** * Get elements * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getElements() { @@ -287,7 +287,7 @@ class Basket /** * Get validation * - * @return Entities\ValidationSession + * @return Entities\ValidationSession */ public function getValidation() { @@ -312,7 +312,7 @@ class Basket /** * Get is_read * - * @return boolean + * @return boolean */ public function getIsRead() { @@ -349,7 +349,7 @@ class Basket } catch (Exception $e) { - + } } @@ -358,4 +358,4 @@ class Basket return $totSize; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/BasketElement.php b/lib/Doctrine/Entities/BasketElement.php index 059b7e7adf..89b3f24a23 100644 --- a/lib/Doctrine/Entities/BasketElement.php +++ b/lib/Doctrine/Entities/BasketElement.php @@ -61,7 +61,7 @@ class BasketElement /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -81,7 +81,7 @@ class BasketElement /** * Get record_id * - * @return integer + * @return integer */ public function getRecordId() { @@ -101,7 +101,7 @@ class BasketElement /** * Get sbas_id * - * @return integer + * @return integer */ public function getSbasId() { @@ -121,7 +121,7 @@ class BasketElement /** * Get ord * - * @return integer + * @return integer */ public function getOrd() { @@ -141,7 +141,7 @@ class BasketElement /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -161,7 +161,7 @@ class BasketElement /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -181,7 +181,7 @@ class BasketElement /** * Get basket * - * @return Entities\Basket + * @return Entities\Basket */ public function getBasket() { @@ -227,7 +227,7 @@ class BasketElement /** * Get validation_datas * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getValidationDatas() { @@ -237,7 +237,7 @@ class BasketElement /** * * @param \User_Adapter $user - * @return \Entities\ValidationData + * @return \Entities\ValidationData */ public function getUserValidationDatas(\User_Adapter $user) { @@ -253,4 +253,4 @@ class BasketElement throw new \Exception('There is no such participant'); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/StoryWZ.php b/lib/Doctrine/Entities/StoryWZ.php index 930e1a9e74..68c5ad5b30 100644 --- a/lib/Doctrine/Entities/StoryWZ.php +++ b/lib/Doctrine/Entities/StoryWZ.php @@ -53,7 +53,7 @@ class StoryWZ /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -73,7 +73,7 @@ class StoryWZ /** * Get sbas_id * - * @return integer + * @return integer */ public function getSbasId() { @@ -93,7 +93,7 @@ class StoryWZ /** * Get record_id * - * @return integer + * @return integer */ public function getRecordId() { @@ -113,7 +113,7 @@ class StoryWZ /** * Get usr_id * - * @return integer + * @return integer */ public function getUsrId() { @@ -133,7 +133,7 @@ class StoryWZ /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -164,4 +164,4 @@ class StoryWZ $this->setSbasId($record->get_sbas_id()); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrList.php b/lib/Doctrine/Entities/UsrList.php index 5d1f5c8edd..fdc49cd1bc 100644 --- a/lib/Doctrine/Entities/UsrList.php +++ b/lib/Doctrine/Entities/UsrList.php @@ -58,7 +58,7 @@ class UsrList /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -78,7 +78,7 @@ class UsrList /** * Get name * - * @return string + * @return string */ public function getName() { @@ -98,7 +98,7 @@ class UsrList /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -118,7 +118,7 @@ class UsrList /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -138,7 +138,7 @@ class UsrList /** * Get owners * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getOwners() { @@ -150,6 +150,7 @@ class UsrList foreach ($this->getOwners() as $owner) { if ($owner->getUser()->get_id() == $user->get_id()) + return true; } @@ -159,13 +160,14 @@ class UsrList /** * * @param \User_Adapter $user - * @return \Entities\UsrListOwner + * @return \Entities\UsrListOwner */ public function getOwner(\User_Adapter $user) { foreach ($this->getOwners() as $owner) { if ($owner->getUser()->get_id() == $user->get_id()) + return $owner; } @@ -185,11 +187,11 @@ class UsrList /** * Get entries * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getEntries() { return $this->entries; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrListEntry.php b/lib/Doctrine/Entities/UsrListEntry.php index ef4575d2bc..89f50c80b2 100644 --- a/lib/Doctrine/Entities/UsrListEntry.php +++ b/lib/Doctrine/Entities/UsrListEntry.php @@ -47,7 +47,7 @@ class UsrListEntry /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -67,7 +67,7 @@ class UsrListEntry /** * Get usr_id * - * @return integer + * @return integer */ public function getUsrId() { @@ -87,7 +87,7 @@ class UsrListEntry /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -107,7 +107,7 @@ class UsrListEntry /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -127,7 +127,7 @@ class UsrListEntry /** * Get list * - * @return Entities\UsrList + * @return Entities\UsrList */ public function getList() { @@ -143,4 +143,4 @@ class UsrListEntry return $this->setUsrId($user->get_id()); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrListOwner.php b/lib/Doctrine/Entities/UsrListOwner.php index 9f2267bf2f..280b71e3a8 100644 --- a/lib/Doctrine/Entities/UsrListOwner.php +++ b/lib/Doctrine/Entities/UsrListOwner.php @@ -55,7 +55,7 @@ class UsrListOwner /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -75,7 +75,7 @@ class UsrListOwner /** * Get usr_id * - * @return integer + * @return integer */ public function getUsrId() { @@ -98,7 +98,7 @@ class UsrListOwner /** * Get role * - * @return string + * @return string */ public function getRole() { @@ -118,7 +118,7 @@ class UsrListOwner /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -138,7 +138,7 @@ class UsrListOwner /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -158,7 +158,7 @@ class UsrListOwner /** * Get list * - * @return Entities\UsrList + * @return Entities\UsrList */ public function getList() { @@ -175,4 +175,4 @@ class UsrListOwner return \User_Adapter::getInstance($this->getUsrId(), \appbox::get_instance()); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationData.php b/lib/Doctrine/Entities/ValidationData.php index dc356cfe38..6467314107 100644 --- a/lib/Doctrine/Entities/ValidationData.php +++ b/lib/Doctrine/Entities/ValidationData.php @@ -10,7 +10,7 @@ */ namespace Entities; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -51,7 +51,7 @@ class ValidationData /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -71,7 +71,7 @@ class ValidationData /** * Get agreement * - * @return boolean + * @return boolean */ public function getAgreement() { @@ -91,7 +91,7 @@ class ValidationData /** * Get note * - * @return text + * @return text */ public function getNote() { @@ -111,7 +111,7 @@ class ValidationData /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -131,7 +131,7 @@ class ValidationData /** * Get participant * - * @return Entities\ValidationParticipant + * @return Entities\ValidationParticipant */ public function getParticipant() { @@ -151,10 +151,10 @@ class ValidationData /** * Get basket_element * - * @return Entities\BasketElement + * @return Entities\BasketElement */ public function getBasketElement() { return $this->basket_element; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationParticipant.php b/lib/Doctrine/Entities/ValidationParticipant.php index 2fb2330d23..24944fec08 100644 --- a/lib/Doctrine/Entities/ValidationParticipant.php +++ b/lib/Doctrine/Entities/ValidationParticipant.php @@ -12,7 +12,7 @@ namespace Entities; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -73,7 +73,7 @@ class ValidationParticipant /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -93,7 +93,7 @@ class ValidationParticipant /** * Get usr_id * - * @return integer + * @return integer */ public function getUsrId() { @@ -123,7 +123,7 @@ class ValidationParticipant /** * Get session * - * @return Entities\ValidationSession + * @return Entities\ValidationSession */ public function getSession() { @@ -143,7 +143,7 @@ class ValidationParticipant /** * Get is_aware * - * @return boolean + * @return boolean */ public function getIsAware() { @@ -153,11 +153,12 @@ class ValidationParticipant /** * * @param \User_Adapter $user - * @return ValidationParticipant + * @return ValidationParticipant */ public function setUser(\User_Adapter $user) { $this->usr_id = $user->get_id(); + return $this; } @@ -179,7 +180,7 @@ class ValidationParticipant /** * Get reminded * - * @return datetime + * @return datetime */ public function getReminded() { @@ -189,7 +190,7 @@ class ValidationParticipant /** * Get datas * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getDatas() { @@ -209,7 +210,7 @@ class ValidationParticipant /** * Get is_confirmed * - * @return boolean + * @return boolean */ public function getIsConfirmed() { @@ -229,7 +230,7 @@ class ValidationParticipant /** * Get can_agree * - * @return boolean + * @return boolean */ public function getCanAgree() { @@ -249,7 +250,7 @@ class ValidationParticipant /** * Get can_see_others * - * @return boolean + * @return boolean */ public function getCanSeeOthers() { @@ -276,4 +277,4 @@ class ValidationParticipant return true; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationSession.php b/lib/Doctrine/Entities/ValidationSession.php index 42d05e2767..f6dd812af7 100644 --- a/lib/Doctrine/Entities/ValidationSession.php +++ b/lib/Doctrine/Entities/ValidationSession.php @@ -78,7 +78,7 @@ class ValidationSession /** * Get id * - * @return integer + * @return integer */ public function getId() { @@ -98,7 +98,7 @@ class ValidationSession /** * Get name * - * @return string + * @return string */ public function getName() { @@ -118,7 +118,7 @@ class ValidationSession /** * Get description * - * @return text + * @return text */ public function getDescription() { @@ -138,7 +138,7 @@ class ValidationSession /** * Get archived * - * @return boolean + * @return boolean */ public function getArchived() { @@ -158,7 +158,7 @@ class ValidationSession /** * Get created * - * @return datetime + * @return datetime */ public function getCreated() { @@ -178,7 +178,7 @@ class ValidationSession /** * Get updated * - * @return datetime + * @return datetime */ public function getUpdated() { @@ -198,7 +198,7 @@ class ValidationSession /** * Get expires * - * @return datetime + * @return datetime */ public function getExpires() { @@ -218,7 +218,7 @@ class ValidationSession /** * Get reminded * - * @return datetime + * @return datetime */ public function getReminded() { @@ -238,7 +238,7 @@ class ValidationSession /** * Get basket * - * @return Entities\Basket + * @return Entities\Basket */ public function getBasket() { @@ -258,7 +258,7 @@ class ValidationSession /** * Get participants * - * @return Doctrine\Common\Collections\Collection + * @return Doctrine\Common\Collections\Collection */ public function getParticipants() { @@ -306,7 +306,7 @@ class ValidationSession /** * Get initiator_id * - * @return integer + * @return integer */ public function getInitiatorId() { @@ -321,6 +321,7 @@ class ValidationSession public function setInitiator(\User_Adapter $user) { $this->initiator_id = $user->get_id(); + return; } @@ -383,4 +384,4 @@ class ValidationSession } } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Logger/MonologSQLLogger.php b/lib/Doctrine/Logger/MonologSQLLogger.php index b33b921dcf..7026fd8558 100644 --- a/lib/Doctrine/Logger/MonologSQLLogger.php +++ b/lib/Doctrine/Logger/MonologSQLLogger.php @@ -16,7 +16,7 @@ use Monolog\Handler\StreamHandler; /** * Log doctrine sql request with monolog - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -26,7 +26,7 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger const JSON = 'json'; const YAML = 'yaml'; const VDUMP = 'vdump'; - + /** * * @var \Monolog\Logger @@ -38,7 +38,7 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger /** * Tell which monolog user to use and which format to output - * + * * @param \Monolog\Logger $logger A monolog logger instance * @param type $type the output format */ @@ -90,4 +90,4 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger $this->logger->debug($message); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php b/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php index 4aef7e8e65..dcae261cf7 100644 --- a/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php +++ b/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php @@ -34,119 +34,138 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setRecordId($recordId) { $this->__load(); + return parent::setRecordId($recordId); } public function getRecordId() { $this->__load(); + return parent::getRecordId(); } public function setSbasId($sbasId) { $this->__load(); + return parent::setSbasId($sbasId); } public function getSbasId() { $this->__load(); + return parent::getSbasId(); } public function setOrd($ord) { $this->__load(); + return parent::setOrd($ord); } public function getOrd() { $this->__load(); + return parent::getOrd(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function setBasket(\Entities\Basket $basket) { $this->__load(); + return parent::setBasket($basket); } public function getBasket() { $this->__load(); + return parent::getBasket(); } public function getRecord() { $this->__load(); + return parent::getRecord(); } public function setRecord(\record_adapter $record) { $this->__load(); + return parent::setRecord($record); } public function setLastInBasket() { $this->__load(); + return parent::setLastInBasket(); } public function addValidationData(\Entities\ValidationData $validationDatas) { $this->__load(); + return parent::addValidationData($validationDatas); } public function getValidationDatas() { $this->__load(); + return parent::getValidationDatas(); } public function getUserValidationDatas(\User_Adapter $user) { $this->__load(); + return parent::getUserValidationDatas($user); } @@ -170,6 +189,6 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesBasketProxy.php b/lib/Doctrine/Proxies/EntitiesBasketProxy.php index 1ed363229c..f273af75e4 100644 --- a/lib/Doctrine/Proxies/EntitiesBasketProxy.php +++ b/lib/Doctrine/Proxies/EntitiesBasketProxy.php @@ -34,167 +34,194 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setName($name) { $this->__load(); + return parent::setName($name); } public function getName() { $this->__load(); + return parent::getName(); } public function setDescription($description) { $this->__load(); + return parent::setDescription($description); } public function getDescription() { $this->__load(); + return parent::getDescription(); } public function setUsrId($usrId) { $this->__load(); + return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); + return parent::getUsrId(); } public function setPusherId($pusherId) { $this->__load(); + return parent::setPusherId($pusherId); } public function getPusherId() { $this->__load(); + return parent::getPusherId(); } public function setArchived($archived) { $this->__load(); + return parent::setArchived($archived); } public function getArchived() { $this->__load(); + return parent::getArchived(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function addBasketElement(\Entities\BasketElement $elements) { $this->__load(); + return parent::addBasketElement($elements); } public function getElements() { $this->__load(); + return parent::getElements(); } public function setPusher(\User_Adapter $user) { $this->__load(); + return parent::setPusher($user); } public function getPusher() { $this->__load(); + return parent::getPusher(); } public function setOwner(\User_Adapter $user) { $this->__load(); + return parent::setOwner($user); } public function getOwner() { $this->__load(); + return parent::getOwner(); } public function setValidation(\Entities\ValidationSession $validation) { $this->__load(); + return parent::setValidation($validation); } public function getValidation() { $this->__load(); + return parent::getValidation(); } public function setIsRead($isRead) { $this->__load(); + return parent::setIsRead($isRead); } public function getIsRead() { $this->__load(); + return parent::getIsRead(); } public function hasRecord(\record_adapter $record) { $this->__load(); + return parent::hasRecord($record); } public function getSize() { $this->__load(); + return parent::getSize(); } @@ -218,6 +245,6 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php b/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php index 566c78675e..5d3f428cd5 100644 --- a/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php +++ b/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php @@ -34,83 +34,96 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setSbasId($sbasId) { $this->__load(); + return parent::setSbasId($sbasId); } public function getSbasId() { $this->__load(); + return parent::getSbasId(); } public function setRecordId($recordId) { $this->__load(); + return parent::setRecordId($recordId); } public function getRecordId() { $this->__load(); + return parent::getRecordId(); } public function setUsrId($usrId) { $this->__load(); + return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); + return parent::getUsrId(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUser(\User_Adapter $user) { $this->__load(); + return parent::setUser($user); } public function getUser() { $this->__load(); + return parent::getUser(); } public function getRecord() { $this->__load(); + return parent::getRecord(); } public function setRecord(\record_adapter $record) { $this->__load(); + return parent::setRecord($record); } @@ -134,6 +147,6 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php b/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php index fdc40e6062..991a1350c3 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php +++ b/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php @@ -34,71 +34,82 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setUsrId($usrId) { $this->__load(); + return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); + return parent::getUsrId(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function setList(\Entities\UsrList $list) { $this->__load(); + return parent::setList($list); } public function getList() { $this->__load(); + return parent::getList(); } public function getUser() { $this->__load(); + return parent::getUser(); } public function setUser(\User_Adapter $user) { $this->__load(); + return parent::setUser($user); } @@ -122,6 +133,6 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php b/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php index 6765ac71e8..26d2422c8d 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php +++ b/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php @@ -34,83 +34,96 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setUsrId($usrId) { $this->__load(); + return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); + return parent::getUsrId(); } public function setRole($role) { $this->__load(); + return parent::setRole($role); } public function getRole() { $this->__load(); + return parent::getRole(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function setList(\Entities\UsrList $list) { $this->__load(); + return parent::setList($list); } public function getList() { $this->__load(); + return parent::getList(); } public function setUser(\User_Adapter $user) { $this->__load(); + return parent::setUser($user); } public function getUser() { $this->__load(); + return parent::getUser(); } @@ -134,6 +147,6 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesUsrListProxy.php b/lib/Doctrine/Proxies/EntitiesUsrListProxy.php index 8826826001..d0bb440209 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListProxy.php +++ b/lib/Doctrine/Proxies/EntitiesUsrListProxy.php @@ -34,83 +34,96 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setName($name) { $this->__load(); + return parent::setName($name); } public function getName() { $this->__load(); + return parent::getName(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function addUsrListOwner(\Entities\UsrListOwner $owners) { $this->__load(); + return parent::addUsrListOwner($owners); } public function getOwners() { $this->__load(); + return parent::getOwners(); } public function hasAccess(\User_Adapter $user) { $this->__load(); + return parent::hasAccess($user); } public function getOwner(\User_Adapter $user) { $this->__load(); + return parent::getOwner($user); } public function addUsrListEntry(\Entities\UsrListEntry $entry) { $this->__load(); + return parent::addUsrListEntry($entry); } public function getEntries() { $this->__load(); + return parent::getEntries(); } @@ -134,6 +147,6 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php b/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php index 16ce6c81b8..5c136c35d5 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php +++ b/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php @@ -34,71 +34,82 @@ class EntitiesValidationDataProxy extends \Entities\ValidationData implements \D unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setAgreement($agreement) { $this->__load(); + return parent::setAgreement($agreement); } public function getAgreement() { $this->__load(); + return parent::getAgreement(); } public function setNote($note) { $this->__load(); + return parent::setNote($note); } public function getNote() { $this->__load(); + return parent::getNote(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function setParticipant(\Entities\ValidationParticipant $participant) { $this->__load(); + return parent::setParticipant($participant); } public function getParticipant() { $this->__load(); + return parent::getParticipant(); } public function setBasketElement(\Entities\BasketElement $basketElement) { $this->__load(); + return parent::setBasketElement($basketElement); } public function getBasketElement() { $this->__load(); + return parent::getBasketElement(); } @@ -122,6 +133,6 @@ class EntitiesValidationDataProxy extends \Entities\ValidationData implements \D } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php b/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php index a30a98d72e..c79491fe63 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php +++ b/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php @@ -34,125 +34,145 @@ class EntitiesValidationParticipantProxy extends \Entities\ValidationParticipant unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setUsrId($usrId) { $this->__load(); + return parent::setUsrId($usrId); } public function getUsrId() { $this->__load(); + return parent::getUsrId(); } public function addValidationData(\Entities\ValidationData $datas) { $this->__load(); + return parent::addValidationData($datas); } public function setSession(\Entities\ValidationSession $session) { $this->__load(); + return parent::setSession($session); } public function getSession() { $this->__load(); + return parent::getSession(); } public function setIsAware($isAware) { $this->__load(); + return parent::setIsAware($isAware); } public function getIsAware() { $this->__load(); + return parent::getIsAware(); } public function setUser(\User_Adapter $user) { $this->__load(); + return parent::setUser($user); } public function getUser() { $this->__load(); + return parent::getUser(); } public function setReminded($reminded) { $this->__load(); + return parent::setReminded($reminded); } public function getReminded() { $this->__load(); + return parent::getReminded(); } public function getDatas() { $this->__load(); + return parent::getDatas(); } public function setIsConfirmed($isConfirmed) { $this->__load(); + return parent::setIsConfirmed($isConfirmed); } public function getIsConfirmed() { $this->__load(); + return parent::getIsConfirmed(); } public function setCanAgree($canAgree) { $this->__load(); + return parent::setCanAgree($canAgree); } public function getCanAgree() { $this->__load(); + return parent::getCanAgree(); } public function setCanSeeOthers($canSeeOthers) { $this->__load(); + return parent::setCanSeeOthers($canSeeOthers); } public function getCanSeeOthers() { $this->__load(); + return parent::getCanSeeOthers(); } public function isReleasable() { $this->__load(); + return parent::isReleasable(); } @@ -176,6 +196,6 @@ class EntitiesValidationParticipantProxy extends \Entities\ValidationParticipant } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php b/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php index 0c6dd668c4..920a6c8cdb 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php +++ b/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php @@ -34,167 +34,194 @@ class EntitiesValidationSessionProxy extends \Entities\ValidationSession impleme unset($this->_entityPersister, $this->_identifier); } } - - + + public function getId() { $this->__load(); + return parent::getId(); } public function setName($name) { $this->__load(); + return parent::setName($name); } public function getName() { $this->__load(); + return parent::getName(); } public function setDescription($description) { $this->__load(); + return parent::setDescription($description); } public function getDescription() { $this->__load(); + return parent::getDescription(); } public function setArchived($archived) { $this->__load(); + return parent::setArchived($archived); } public function getArchived() { $this->__load(); + return parent::getArchived(); } public function setCreated($created) { $this->__load(); + return parent::setCreated($created); } public function getCreated() { $this->__load(); + return parent::getCreated(); } public function setUpdated($updated) { $this->__load(); + return parent::setUpdated($updated); } public function getUpdated() { $this->__load(); + return parent::getUpdated(); } public function setExpires($expires) { $this->__load(); + return parent::setExpires($expires); } public function getExpires() { $this->__load(); + return parent::getExpires(); } public function setReminded($reminded) { $this->__load(); + return parent::setReminded($reminded); } public function getReminded() { $this->__load(); + return parent::getReminded(); } public function setBasket(\Entities\Basket $basket) { $this->__load(); + return parent::setBasket($basket); } public function getBasket() { $this->__load(); + return parent::getBasket(); } public function addValidationParticipant(\Entities\ValidationParticipant $participants) { $this->__load(); + return parent::addValidationParticipant($participants); } public function getParticipants() { $this->__load(); + return parent::getParticipants(); } public function getParticipant(\User_Adapter $user) { $this->__load(); + return parent::getParticipant($user); } public function setInitiatorId($initiatorId) { $this->__load(); + return parent::setInitiatorId($initiatorId); } public function getInitiatorId() { $this->__load(); + return parent::getInitiatorId(); } public function isInitiator(\User_Adapter $user) { $this->__load(); + return parent::isInitiator($user); } public function setInitiator(\User_Adapter $user) { $this->__load(); + return parent::setInitiator($user); } public function getInitiator() { $this->__load(); + return parent::getInitiator(); } public function isFinished() { $this->__load(); + return parent::isFinished(); } public function getValidationString(\User_Adapter $user) { $this->__load(); + return parent::getValidationString($user); } @@ -218,6 +245,6 @@ class EntitiesValidationSessionProxy extends \Entities\ValidationSession impleme } unset($this->_entityPersister, $this->_identifier); } - + } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/BasketElementRepository.php b/lib/Doctrine/Repositories/BasketElementRepository.php index d3346b6b2d..00a5535bda 100644 --- a/lib/Doctrine/Repositories/BasketElementRepository.php +++ b/lib/Doctrine/Repositories/BasketElementRepository.php @@ -15,7 +15,7 @@ class BasketElementRepository extends EntityRepository public function findUserElement($element_id, \User_Adapter $user) { - $dql = 'SELECT e FROM Entities\BasketElement e + $dql = 'SELECT e FROM Entities\BasketElement e JOIN e.basket b WHERE b.usr_id = :usr_id AND e.id = :element_id'; @@ -29,10 +29,10 @@ class BasketElementRepository extends EntityRepository return $query->getOneOrNullResult(); } - + public function findElementsByRecord(\record_adapter $record) { - $dql = 'SELECT e FROM Entities\BasketElement e + $dql = 'SELECT e FROM Entities\BasketElement e WHERE e.record_id = :record_id AND e.sbas_id = :sbas_id'; $params = array( @@ -45,7 +45,7 @@ class BasketElementRepository extends EntityRepository return $query->getResult(); } - + /** * * @param \record_adapter $record @@ -54,9 +54,9 @@ class BasketElementRepository extends EntityRepository */ public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user) { - $dql = 'SELECT e FROM Entities\BasketElement e + $dql = 'SELECT e FROM Entities\BasketElement e JOIN e.basket b - WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL + WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL AND e.record_id = :record_id AND e.sbas_id = :sbas_id'; $params = array( @@ -70,14 +70,14 @@ class BasketElementRepository extends EntityRepository return $query->getResult(); } - + public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user) { - $dql = 'SELECT e FROM Entities\BasketElement e - JOIN e.basket b + $dql = 'SELECT e FROM Entities\BasketElement e + JOIN e.basket b JOIN b.validation v JOIN v.participants p - WHERE p.usr_id = :usr_id + WHERE p.usr_id = :usr_id AND e.record_id = :record_id AND e.sbas_id = :sbas_id'; $params = array( @@ -91,12 +91,12 @@ class BasketElementRepository extends EntityRepository return $query->getResult(); } - + /** * * @param type $element_id * @param \User_Adapter $user - * @return \Entities\BasketELement + * @return \Entities\BasketELement */ public function findElement($element_id, \User_Adapter $user) { @@ -116,4 +116,4 @@ class BasketElementRepository extends EntityRepository return $element; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/BasketRepository.php b/lib/Doctrine/Repositories/BasketRepository.php index 9737ae4098..acdf6caef5 100644 --- a/lib/Doctrine/Repositories/BasketRepository.php +++ b/lib/Doctrine/Repositories/BasketRepository.php @@ -32,11 +32,11 @@ class BasketRepository extends EntityRepository * Returns all basket for a given user that are not marked as archived * * @param \User_Adapter $user - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function findActiveByUser(\User_Adapter $user) { - $dql = 'SELECT b FROM Entities\Basket b + $dql = 'SELECT b FROM Entities\Basket b WHERE b.usr_id = :usr_id AND b.archived = false'; $query = $this->_em->createQuery($dql); @@ -49,12 +49,12 @@ class BasketRepository extends EntityRepository * Returns all unread basket for a given user that are not marked as archived * * @param \User_Adapter $user - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function findUnreadActiveByUser(\User_Adapter $user) { - $dql = 'SELECT b FROM Entities\Basket b - WHERE b.usr_id = :usr_id + $dql = 'SELECT b FROM Entities\Basket b + WHERE b.usr_id = :usr_id AND b.archived = false AND b.is_read = false'; $query = $this->_em->createQuery($dql); @@ -64,18 +64,18 @@ class BasketRepository extends EntityRepository } /** - * Returns all baskets that are in validation session not expired and + * Returns all baskets that are in validation session not expired and * where a specified user is participant (not owner) * * @param \User_Adapter $user - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function findActiveValidationByUser(\User_Adapter $user) { - $dql = 'SELECT b FROM Entities\Basket b - JOIN b.validation s - JOIN s.participants p - WHERE b.usr_id != ?1 AND p.usr_id = ?2 + $dql = 'SELECT b FROM Entities\Basket b + JOIN b.validation s + JOIN s.participants p + WHERE b.usr_id != ?1 AND p.usr_id = ?2 AND s.expires > CURRENT_TIMESTAMP()'; $query = $this->_em->createQuery($dql); @@ -91,7 +91,7 @@ class BasketRepository extends EntityRepository * @throws \Exception_Forbidden * @param type $basket_id * @param \User_Adapter $user - * @return \Entities\Basket + * @return \Entities\Basket */ public function findUserBasket($basket_id, \User_Adapter $user) { @@ -114,8 +114,8 @@ class BasketRepository extends EntityRepository public function findContainingRecord(\record_adapter $record) { - $dql = 'SELECT b FROM Entities\Basket b - JOIN b.elements e + $dql = 'SELECT b FROM Entities\Basket b + JOIN b.elements e WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id'; $params = array( @@ -135,16 +135,16 @@ class BasketRepository extends EntityRepository switch ($type) { case self::RECEIVED: - $dql = 'SELECT b FROM Entities\Basket b + $dql = 'SELECT b FROM Entities\Basket b WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL'; $params = array( 'usr_id' => $user->get_id() ); break; case self::VALIDATION_DONE: - $dql = 'SELECT b FROM Entities\Basket b - JOIN b.validation s - JOIN s.participants p + $dql = 'SELECT b FROM Entities\Basket b + JOIN b.validation s + JOIN s.participants p WHERE b.usr_id != ?1 AND p.usr_id = ?2'; $params = array( 1 => $user->get_id() @@ -152,7 +152,7 @@ class BasketRepository extends EntityRepository ); break; case self::VALIDATION_SENT: - $dql = 'SELECT b FROM Entities\Basket b + $dql = 'SELECT b FROM Entities\Basket b JOIN b.validation v WHERE b.usr_id = :usr_id'; $params = array( @@ -160,8 +160,8 @@ class BasketRepository extends EntityRepository ); break; default: - $dql = 'SELECT b FROM Entities\Basket b - LEFT JOIN b.validation s LEFT JOIN s.participants p + $dql = 'SELECT b FROM Entities\Basket b + LEFT JOIN b.validation s LEFT JOIN s.participants p WHERE (b.usr_id = :usr_id OR p.usr_id = :validating_usr_id)'; $params = array( 'usr_id' => $user->get_id(), @@ -169,19 +169,19 @@ class BasketRepository extends EntityRepository ); break; } - + if (ctype_digit($year) && strlen($year) == 4) { $dql .= ' AND b.created >= :min_date AND b.created <= :max_date '; - + $params['min_date'] = sprintf('%d-01-01 00:00:00', $year); $params['max_date'] = sprintf('%d-12-31 23:59:59', $year); } - + if (trim($query) !== '') { $dql .= ' AND (b.name LIKE :name OR b.description LIKE :description) '; - + $params['name'] = '%'.$query.'%'; $params['description'] = '%'.$query.'%'; } diff --git a/lib/Doctrine/Repositories/Repositories/BasketElementRepository.php b/lib/Doctrine/Repositories/Repositories/BasketElementRepository.php index 97bfa3fc08..fc95aec78b 100644 --- a/lib/Doctrine/Repositories/Repositories/BasketElementRepository.php +++ b/lib/Doctrine/Repositories/Repositories/BasketElementRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class BasketElementRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/BasketRepository.php b/lib/Doctrine/Repositories/Repositories/BasketRepository.php index a340a417a8..7592fddd80 100644 --- a/lib/Doctrine/Repositories/Repositories/BasketRepository.php +++ b/lib/Doctrine/Repositories/Repositories/BasketRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class BasketRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/StoryWZRepository.php b/lib/Doctrine/Repositories/Repositories/StoryWZRepository.php index 139550f26d..37bce25fdd 100644 --- a/lib/Doctrine/Repositories/Repositories/StoryWZRepository.php +++ b/lib/Doctrine/Repositories/Repositories/StoryWZRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class StoryWZRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/UsrListEntryRepository.php b/lib/Doctrine/Repositories/Repositories/UsrListEntryRepository.php index e48ea9de52..74bd46ee0f 100644 --- a/lib/Doctrine/Repositories/Repositories/UsrListEntryRepository.php +++ b/lib/Doctrine/Repositories/Repositories/UsrListEntryRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class UsrListEntryRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/UsrListOwnerRepository.php b/lib/Doctrine/Repositories/Repositories/UsrListOwnerRepository.php index 9ebab13851..aeeaccf112 100644 --- a/lib/Doctrine/Repositories/Repositories/UsrListOwnerRepository.php +++ b/lib/Doctrine/Repositories/Repositories/UsrListOwnerRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class UsrListOwnerRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/UsrListRepository.php b/lib/Doctrine/Repositories/Repositories/UsrListRepository.php index 8a5d0b3f9f..cb420479a7 100644 --- a/lib/Doctrine/Repositories/Repositories/UsrListRepository.php +++ b/lib/Doctrine/Repositories/Repositories/UsrListRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class UsrListRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/Repositories/ValidationParticipantRepository.php b/lib/Doctrine/Repositories/Repositories/ValidationParticipantRepository.php index 80bb8431b6..933ededd23 100644 --- a/lib/Doctrine/Repositories/Repositories/ValidationParticipantRepository.php +++ b/lib/Doctrine/Repositories/Repositories/ValidationParticipantRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class ValidationParticipantRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/StoryWZRepository.php b/lib/Doctrine/Repositories/StoryWZRepository.php index 7e58bcaf28..deb4f7b887 100644 --- a/lib/Doctrine/Repositories/StoryWZRepository.php +++ b/lib/Doctrine/Repositories/StoryWZRepository.php @@ -29,4 +29,4 @@ class StoryWZRepository extends EntityRepository ); } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/UsrListEntryRepository.php b/lib/Doctrine/Repositories/UsrListEntryRepository.php index a66157fd8e..677e7a0fd9 100644 --- a/lib/Doctrine/Repositories/UsrListEntryRepository.php +++ b/lib/Doctrine/Repositories/UsrListEntryRepository.php @@ -12,19 +12,19 @@ use Doctrine\ORM\EntityRepository; */ class UsrListEntryRepository extends EntityRepository { - + /** * Get all lists entries matching a given User * * @param \User_Adapter $user - * @param type $like + * @param type $like */ public function findUserList(\User_Adapter $user) { - $dql = 'SELECT e FROM Entities\UsrListEntry e + $dql = 'SELECT e FROM Entities\UsrListEntry e WHERE e.usr_id = :usr_id'; - - + + $params = array( 'usr_id' => $user->get_id(), ); @@ -34,16 +34,16 @@ class UsrListEntryRepository extends EntityRepository return $query->getResult(); } - + public function findEntryByListAndEntryId(\Entities\UsrList $list, $entry_id) { $entry = $this->find($entry_id); - + if(!$entry) { throw new \Exception_NotFound('Entry not found'); } - + /* @var $entry \Entities\UsrListEntry */ if($entry->getList()->getId() != $list->getId()) { @@ -52,4 +52,4 @@ class UsrListEntryRepository extends EntityRepository return $entry; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/UsrListOwnerRepository.php b/lib/Doctrine/Repositories/UsrListOwnerRepository.php index 5a58262215..c1fb66d3e1 100644 --- a/lib/Doctrine/Repositories/UsrListOwnerRepository.php +++ b/lib/Doctrine/Repositories/UsrListOwnerRepository.php @@ -13,11 +13,11 @@ use Doctrine\ORM\EntityRepository; class UsrListOwnerRepository extends EntityRepository { /** - * + * * * @param \Entities\UsrList $list * @param type $owner_id - * @return \Entities\UsrList + * @return \Entities\UsrList */ public function findByListAndOwner(\Entities\UsrList $list, $owner_id) { @@ -36,5 +36,5 @@ class UsrListOwnerRepository extends EntityRepository return $owner; } - -} \ No newline at end of file + +} diff --git a/lib/Doctrine/Repositories/UsrListRepository.php b/lib/Doctrine/Repositories/UsrListRepository.php index beeb8d1b3d..a4f83dbd63 100644 --- a/lib/Doctrine/Repositories/UsrListRepository.php +++ b/lib/Doctrine/Repositories/UsrListRepository.php @@ -16,15 +16,15 @@ class UsrListRepository extends EntityRepository * Get all lists readable for a given User * * @param \User_Adapter $user - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function findUserLists(\User_Adapter $user) { - $dql = 'SELECT l FROM Entities\UsrList l + $dql = 'SELECT l FROM Entities\UsrList l JOIN l.owners o WHERE o.usr_id = :usr_id'; - - + + $params = array( 'usr_id' => $user->get_id(), ); @@ -34,12 +34,12 @@ class UsrListRepository extends EntityRepository return $query->getResult(); } - + /** * * @param \User_Adapter $user * @param type $list_id - * @return \Entities\UsrList + * @return \Entities\UsrList */ public function findUserListByUserAndId(\User_Adapter $user, $list_id) { @@ -58,20 +58,20 @@ class UsrListRepository extends EntityRepository return $list; } - + /** * Search for a UsrList like '' with a given value, for a user * * @param \User_Adapter $user * @param type $name - * @return \Doctrine\Common\Collections\ArrayCollection + * @return \Doctrine\Common\Collections\ArrayCollection */ public function findUserListLike(\User_Adapter $user, $name) { - $dql = 'SELECT l FROM Entities\UsrList l + $dql = 'SELECT l FROM Entities\UsrList l JOIN l.owners o WHERE o.usr_id = :usr_id AND l.name LIKE :name'; - + $params = array( 'usr_id' => $user->get_id(), 'name' => $name.'%' @@ -82,5 +82,5 @@ class UsrListRepository extends EntityRepository return $query->getResult(); } - -} \ No newline at end of file + +} diff --git a/lib/Doctrine/Repositories/ValidationParticipantRepository.php b/lib/Doctrine/Repositories/ValidationParticipantRepository.php index cab02ba7d7..6340358c5a 100644 --- a/lib/Doctrine/Repositories/ValidationParticipantRepository.php +++ b/lib/Doctrine/Repositories/ValidationParticipantRepository.php @@ -21,6 +21,6 @@ use Doctrine\ORM\EntityRepository; */ class ValidationParticipantRepository extends EntityRepository { - + } diff --git a/lib/Doctrine/Types/Blob.php b/lib/Doctrine/Types/Blob.php index 38875e886e..9f6ead26d5 100644 --- a/lib/Doctrine/Types/Blob.php +++ b/lib/Doctrine/Types/Blob.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/Doctrine/Types/Enum.php b/lib/Doctrine/Types/Enum.php index c1a329768b..6c9a51d4d9 100644 --- a/lib/Doctrine/Types/Enum.php +++ b/lib/Doctrine/Types/Enum.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/Doctrine/Types/LongBlob.php b/lib/Doctrine/Types/LongBlob.php index a29fc9b67f..6ac39ddb01 100644 --- a/lib/Doctrine/Types/LongBlob.php +++ b/lib/Doctrine/Types/LongBlob.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/Doctrine/Types/VarBinary.php b/lib/Doctrine/Types/VarBinary.php index 09324ac897..b8796064ad 100644 --- a/lib/Doctrine/Types/VarBinary.php +++ b/lib/Doctrine/Types/VarBinary.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/classes/ACL.class.php b/lib/classes/ACL.class.php index 197ff62859..cc4132b073 100644 --- a/lib/classes/ACL.class.php +++ b/lib/classes/ACL.class.php @@ -92,7 +92,7 @@ class ACL implements cache_cacheableInterface const CACHE_RIGHTS_SBAS = 'rights_sbas'; const CACHE_RIGHTS_RECORDS = 'rights_records'; const CACHE_GLOBAL_RIGHTS = 'global_rights'; - + const GRANT_ACTION_PUSH = 'push'; const GRANT_ACTION_VALIDATE = 'validate'; @@ -124,6 +124,7 @@ class ACL implements cache_cacheableInterface $key = $record->get_serialize_key(); if (array_key_exists($key, $this->_rights_records_document)) + return true; return false; @@ -191,6 +192,7 @@ class ACL implements cache_cacheableInterface $key = $record->get_serialize_key(); if (array_key_exists($key, $this->_rights_records_preview)) + return true; return false; @@ -244,6 +246,7 @@ class ACL implements cache_cacheableInterface public function apply_model(User_Interface $template_user, Array $base_ids) { if (count($base_ids) == 0) + return $this; $sbas_ids = array(); @@ -301,7 +304,7 @@ class ACL implements cache_cacheableInterface $bas_to_acces = $masks_to_give = $rights_to_give = array(); /** - * map masks (and+xor) of template to masks to apply to user on base + * map masks (and+xor) of template to masks to apply to user on base * (and_and, and_or, xor_and, xor_or) */ $sbmap = array( @@ -400,6 +403,7 @@ class ACL implements cache_cacheableInterface $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; if ($this->is_limited($base_id)) @@ -487,6 +491,7 @@ class ACL implements cache_cacheableInterface $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; return $this->_rights_bas[$base_id]['restrict_dwnld']; @@ -503,6 +508,7 @@ class ACL implements cache_cacheableInterface $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; return (int) $this->_rights_bas[$base_id]['remain_dwnld']; @@ -520,6 +526,7 @@ class ACL implements cache_cacheableInterface $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; $this->_rights_bas[$base_id]['remain_dwnld'] = @@ -559,12 +566,14 @@ class ACL implements cache_cacheableInterface $this->load_rights_sbas(); if (!isset($this->_rights_sbas[$sbas_id])) + return false; if (!isset($this->_rights_sbas[$sbas_id][$right])) throw new Exception('This right does not exists'); if ($this->_rights_sbas[$sbas_id][$right] === true) + return true; return false; @@ -580,6 +589,7 @@ class ACL implements cache_cacheableInterface { $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; return $this->_rights_bas[$base_id]['mask_and']; @@ -595,6 +605,7 @@ class ACL implements cache_cacheableInterface { $this->load_rights_bas(); if (!$this->has_access_to_base($base_id)) + return false; return $this->_rights_bas[$base_id]['mask_xor']; @@ -638,21 +649,21 @@ class ACL implements cache_cacheableInterface { $this->load_rights_bas(); $ret = array(); - + foreach($this->appbox->get_databoxes() as $databox) { if ($sbas_ids && !in_array($databox->get_sbas_id(), $sbas_ids)) { continue; } - + foreach ($databox->get_collections() as $collection) { $continue = false; if(!array_key_exists($collection->get_base_id(), $this->_rights_bas)) continue; - + $base_id = $collection->get_base_id(); $datas = $this->_rights_bas[$base_id]; @@ -720,7 +731,7 @@ class ACL implements cache_cacheableInterface } catch (Exception $e) { - + } } @@ -736,6 +747,7 @@ class ACL implements cache_cacheableInterface { if ($this->_rights_records_preview) + return $this; try @@ -748,7 +760,7 @@ class ACL implements cache_cacheableInterface } catch (Exception $e) { - + } $sql = 'SELECT sbas_id, record_id, preview, document FROM records_rights WHERE usr_id = :usr_id'; @@ -789,6 +801,7 @@ class ACL implements cache_cacheableInterface { if ($this->_rights_sbas && $this->_global_rights) + return $this; try @@ -800,7 +813,7 @@ class ACL implements cache_cacheableInterface } catch (Exception $e) { - + } $sql = 'SELECT sbasusr.* FROM sbasusr, sbas @@ -850,6 +863,7 @@ class ACL implements cache_cacheableInterface protected function load_rights_bas() { if ($this->_rights_bas && $this->_global_rights && is_array($this->_limited)) + return $this; try @@ -862,7 +876,7 @@ class ACL implements cache_cacheableInterface } catch (Exception $e) { - + } $sql = 'SELECT u.* FROM basusr u, bas b, sbas s @@ -1353,6 +1367,7 @@ class ACL implements cache_cacheableInterface $stmt->closeCursor(); if (!$row) + return $this; $this->give_access_to_base(array($base_id_dest)); @@ -1519,6 +1534,7 @@ class ACL implements cache_cacheableInterface { $this->load_rights_bas(); if (!isset($this->_limited[$base_id])) + return null; return ($this->_limited[$base_id]); } @@ -1527,18 +1543,18 @@ class ACL implements cache_cacheableInterface { if ($limit) { - $sql = 'UPDATE basusr + $sql = 'UPDATE basusr SET time_limited = 1 - , limited_from = :limited_from - , limited_to = :limited_to + , limited_from = :limited_from + , limited_to = :limited_to WHERE base_id = :base_id AND usr_id = :usr_id'; } else { - $sql = 'UPDATE basusr + $sql = 'UPDATE basusr SET time_limited = 0 - , limited_from = :limited_from - , limited_to = :limited_to + , limited_from = :limited_from + , limited_to = :limited_to WHERE base_id = :base_id AND usr_id = :usr_id'; } diff --git a/lib/classes/API/OAuth2/Adapter.class.php b/lib/classes/API/OAuth2/Adapter.class.php index c70cf6f381..5e93db5c2a 100644 --- a/lib/classes/API/OAuth2/Adapter.class.php +++ b/lib/classes/API/OAuth2/Adapter.class.php @@ -551,7 +551,7 @@ class API_OAuth2_Adapter extends OAuth2 return $account; } - + /** * * @param int $usr_id diff --git a/lib/classes/API/V1/Log.class.php b/lib/classes/API/V1/Log.class.php index 269efe547c..e562c4e143 100644 --- a/lib/classes/API/V1/Log.class.php +++ b/lib/classes/API/V1/Log.class.php @@ -71,7 +71,7 @@ class API_V1_Log /** * - * @var API_OAuth2_Account + * @var API_OAuth2_Account */ protected $account; @@ -85,7 +85,7 @@ class API_V1_Log * * @param appbox $appbox * @param Request $request - * @param API_OAuth2_Account $account + * @param API_OAuth2_Account $account */ public function __construct(appbox &$appbox, $log_id) { @@ -93,16 +93,16 @@ class API_V1_Log $this->id = (int) $log_id; $sql = ' - SELECT + SELECT api_log_id, api_account_id, api_log_route, - api_log_date, - api_log_status_code, - api_log_format, - api_log_ressource, - api_log_general, - api_log_aspect, + api_log_date, + api_log_status_code, + api_log_format, + api_log_ressource, + api_log_general, + api_log_aspect, api_log_action FROM api_logs @@ -172,7 +172,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -184,7 +184,7 @@ class API_V1_Log public function set_status_code($status_code) { $this->status_code = (int) $status_code; - + $sql = 'UPDATE api_log SET api_log_status_code = :code WHERE api_log_id = :log_id'; @@ -197,7 +197,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -208,12 +208,12 @@ class API_V1_Log public function set_format($format) { - + if (!in_array($format, array('json', 'jsonp', 'yaml', 'unknow'))) throw new Exception_InvalidArgument(); - + $this->format = $format; - + $sql = 'UPDATE api_log SET api_log_format = :format WHERE api_log_id = :log_id'; @@ -226,7 +226,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -239,9 +239,9 @@ class API_V1_Log { if (!in_array($format, array(self::DATABOXES_RESSOURCE,self::BASKETS_RESSOURCE, self::FEEDS_RESSOURCE, self::RECORDS_RESSOURCE))) throw new Exception_InvalidArgument(); - + $this->ressource = $ressource; - + $sql = 'UPDATE api_log SET api_log_ressource = :ressource WHERE api_log_id = :log_id'; @@ -254,7 +254,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -266,7 +266,7 @@ class API_V1_Log public function set_general($general) { $this->general = $general; - + $sql = 'UPDATE api_log SET api_log_general = :general WHERE api_log_id = :log_id'; @@ -279,7 +279,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -291,7 +291,7 @@ class API_V1_Log public function set_aspect($aspect) { $this->aspect = $aspect; - + $sql = 'UPDATE api_log SET api_log_aspect = :aspect WHERE api_log_id = :log_id'; @@ -304,7 +304,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -316,7 +316,7 @@ class API_V1_Log public function set_action($action) { $this->action = $action; - + $sql = 'UPDATE api_log SET api_log_action = :action WHERE api_log_id = :log_id'; @@ -329,7 +329,7 @@ class API_V1_Log $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - + return $this; } @@ -338,8 +338,8 @@ class API_V1_Log return $this->account; } - - public static function create(appbox &$appbox, API_OAuth2_Account $account, $route, $status_code, $format, $ressource, $general = null, $aspect = null, $action = null) + + public static function create(appbox &$appbox, API_OAuth2_Account $account, $route, $status_code, $format, $ressource, $general = null, $aspect = null, $action = null) { $sql = ' INSERT INTO @@ -347,38 +347,38 @@ class API_V1_Log api_log_id, api_account_id, api_log_route, - api_log_date, - api_log_status_code, - api_log_format, - api_log_ressource, - api_log_general, - api_log_aspect, + api_log_date, + api_log_status_code, + api_log_format, + api_log_ressource, + api_log_general, + api_log_aspect, api_log_action ) VALUES ( null, :account_id, :route, - NOW(), - :status_code, - :format, - :ressource, - :general, - :aspect, + NOW(), + :status_code, + :format, + :ressource, + :general, + :aspect, :action )'; - + $params = array( ':account_id' => $account->get_id(), ':route' => $route, - ':status_code' => $status_code, - ':format' => $format, - ':ressource' => $ressource, - ':general' => $general, - ':aspect' => $aspect, - ':action' => $action + ':status_code' => $status_code, + ':format' => $format, + ':ressource' => $ressource, + ':general' => $general, + ':aspect' => $aspect, + ':action' => $action ); - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); diff --git a/lib/classes/API/V1/adapter.class.php b/lib/classes/API/V1/adapter.class.php index e5bda1403f..ead836f4db 100644 --- a/lib/classes/API/V1/adapter.class.php +++ b/lib/classes/API/V1/adapter.class.php @@ -557,7 +557,7 @@ class API_V1_adapter extends API_V1_Abstract */ public function add_record_tobasket(Request $request, $databox_id, $record_id) { - + } /** @@ -857,7 +857,7 @@ class API_V1_adapter extends API_V1_Abstract */ public function remove_publications(Request $request, $publication_id) { - + } /** @@ -985,7 +985,7 @@ class API_V1_adapter extends API_V1_Abstract */ public function search_users(Request $request) { - + } /** @@ -995,7 +995,7 @@ class API_V1_adapter extends API_V1_Abstract */ public function get_user_acces(Request $request, $usr_id) { - + } /** @@ -1004,7 +1004,7 @@ class API_V1_adapter extends API_V1_Abstract */ public function add_user(Request $request) { - + } /** @@ -1101,6 +1101,7 @@ class API_V1_adapter extends API_V1_Abstract * @todo ajouter une option pour avoir les values serialisées * dans un cas multi */ + return array( 'meta_id' => $value->getId() , 'meta_structure_id' => $field->get_meta_struct_id() diff --git a/lib/classes/Bridge/Exception.class.php b/lib/classes/Bridge/Exception.class.php index 2c080be9da..fb4215aeef 100644 --- a/lib/classes/Bridge/Exception.class.php +++ b/lib/classes/Bridge/Exception.class.php @@ -18,4 +18,4 @@ class Bridge_Exception extends \Exception { -} \ No newline at end of file +} diff --git a/lib/classes/DailymotionWithoutOauth2.php b/lib/classes/DailymotionWithoutOauth2.php index 007ffd0665..855b481d9b 100644 --- a/lib/classes/DailymotionWithoutOauth2.php +++ b/lib/classes/DailymotionWithoutOauth2.php @@ -14,8 +14,8 @@ require_once __DIR__ . '/../vendor/dailymotion-sdk-php/Dailymotion.php'; class DailymotionWithoutOauth2 extends Dailymotion { - - + + /** * Call a remote method. * @@ -37,7 +37,7 @@ class DailymotionWithoutOauth2 extends Dailymotion 'call' => $method, 'args' => $args, )); - + $status_code = null; try { @@ -45,7 +45,7 @@ class DailymotionWithoutOauth2 extends Dailymotion } catch (DailymotionAuthException $e) { - + if ($e->error === 'invalid_token') { throw new Bridge_Exception_ActionAuthNeedReconnect(); @@ -84,8 +84,8 @@ class DailymotionWithoutOauth2 extends Dailymotion return $result['result']; } - - + + /** * Upload a file on the Dailymotion servers and generate an URL to be used with API methods. * @@ -100,6 +100,7 @@ class DailymotionWithoutOauth2 extends Dailymotion $this->timeout = null; $result = json_decode($this->httpRequest($result['upload_url'], array('file' => '@' . $filePath)), true); $this->timeout = $timeout; + return $result['url']; } } diff --git a/lib/classes/Exception/BadRequest.class.php b/lib/classes/Exception/BadRequest.class.php index ac3d439e17..019ca68d0b 100644 --- a/lib/classes/Exception/BadRequest.class.php +++ b/lib/classes/Exception/BadRequest.class.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com diff --git a/lib/classes/Exception/Setup/FixBadEmailAddresses.class.php b/lib/classes/Exception/Setup/FixBadEmailAddresses.class.php index 659d857471..2625d4013a 100644 --- a/lib/classes/Exception/Setup/FixBadEmailAddresses.class.php +++ b/lib/classes/Exception/Setup/FixBadEmailAddresses.class.php @@ -10,12 +10,12 @@ */ /** - * + * * @package Exception * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ class Exception_Setup_FixBadEmailAddresses extends Exception { - -} \ No newline at end of file + +} diff --git a/lib/classes/Feed/Abstract.class.php b/lib/classes/Feed/Abstract.class.php index b9450c260d..0c976c98d1 100644 --- a/lib/classes/Feed/Abstract.class.php +++ b/lib/classes/Feed/Abstract.class.php @@ -26,7 +26,7 @@ abstract class Feed_Abstract */ const FORMAT_ATOM = 'atom'; /** - * + * */ const FORMAT_COOLIRIS = 'cooliris'; diff --git a/lib/classes/Feed/Adapter.class.php b/lib/classes/Feed/Adapter.class.php index 71f97021df..6705feb602 100644 --- a/lib/classes/Feed/Adapter.class.php +++ b/lib/classes/Feed/Adapter.class.php @@ -91,7 +91,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea } catch (Exception $e) { - + } $sql = 'SELECT id, title, subtitle, created_on, updated_on, base_id, public @@ -135,6 +135,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea public function get_icon_url() { if ($this->icon_url) + return $this->icon_url; $url = '/skins/icons/rss32.gif'; @@ -248,6 +249,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea public function has_access(User_Adapter $user) { if ($this->get_collection() instanceof collection) + return $user->ACL()->has_access_to_base($this->collection->get_base_id()); return true; } @@ -262,7 +264,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea { return false; } - + return $this->public; } @@ -292,6 +294,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea public function add_publisher(User_Adapter $user) { if (in_array($user->get_id(), array_keys($this->get_publishers()))) + return $this; Feed_Publisher_Adapter::create($this->appbox, $user, $this, false); @@ -307,6 +310,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea protected function load_publishers() { if (is_array($this->publishers)) + return $this->publishers; $sql = 'SELECT id, usr_id, owner FROM feed_publishers @@ -493,7 +497,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea } catch (Exception $e) { - + } $sql = 'SELECT count(id) as number @@ -596,6 +600,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea public function get_homepage_link(registryInterface $registry, $format, $page = null) { if (!$this->is_public()) + return null; switch ($format) { @@ -637,11 +642,12 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea try { if (!$renew) + return $this->get_data_from_cache($cache_key); } catch (Exception $e) { - + } $sql = 'SELECT token FROM feed_tokens diff --git a/lib/classes/Feed/Entry/Adapter.class.php b/lib/classes/Feed/Entry/Adapter.class.php index ef7c035543..aa15389755 100644 --- a/lib/classes/Feed/Entry/Adapter.class.php +++ b/lib/classes/Feed/Entry/Adapter.class.php @@ -357,11 +357,11 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa return $this->publisher; } - + /** * * @param User_adapter $user - * @return boolean + * @return boolean */ public function is_publisher(User_adapter $user) { diff --git a/lib/classes/Feed/XML/Cooliris.class.php b/lib/classes/Feed/XML/Cooliris.class.php index d60f87b201..8bf18786f3 100644 --- a/lib/classes/Feed/XML/Cooliris.class.php +++ b/lib/classes/Feed/XML/Cooliris.class.php @@ -370,9 +370,11 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface $medium = strtolower($content->get_record()->get_type()); if (!in_array($medium, array('image', 'audio', 'video'))) + return $this; if (!$preview_permalink || !$thumbnail_permalink) + return $this; //add item node to channel node diff --git a/lib/classes/Session/Handler.class.php b/lib/classes/Session/Handler.class.php index c43685f9ca..1d821e31d2 100644 --- a/lib/classes/Session/Handler.class.php +++ b/lib/classes/Session/Handler.class.php @@ -324,7 +324,7 @@ class Session_Handler { if (!$this->phrasea_session instanceof Session_Phrasea) throw new \Exception('No phrasea session available'); - + $this->phrasea_session->open(); return $this; @@ -571,7 +571,7 @@ class Session_Handler } $Core = bootstrap::getCore(); - + $registry = $Core->getRegistry(); $date_two_day = new DateTime('+' . (int) $registry->get('GV_validation_reminder') . ' days'); @@ -598,7 +598,7 @@ class Session_Handler 'ssel_id' => $row['ssel_id'], 'from' => $row['owner'], 'validate_id' => $row['validate_id'], - 'url' => $registry->get('GV_ServerName') + 'url' => $registry->get('GV_ServerName') . 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value'] ); diff --git a/lib/classes/Setup/Upgrade.class.php b/lib/classes/Setup/Upgrade.class.php index f656918ea2..8d17fafc32 100644 --- a/lib/classes/Setup/Upgrade.class.php +++ b/lib/classes/Setup/Upgrade.class.php @@ -55,14 +55,14 @@ class Setup_Upgrade { throw new Exception_Setup_UpgradeAlreadyStarted('The upgrade is already started'); } - + $this->appbox = $appbox; - + if(count(User_Adapter::get_wrong_email_users($appbox)) > 0) { throw new Exception_Setup_FixBadEmailAddresses('Please fix the database before starting'); } - + $this->write_lock(); return $this; diff --git a/lib/classes/User/Adapter.class.php b/lib/classes/User/Adapter.class.php index e013de6505..3368b570e8 100644 --- a/lib/classes/User/Adapter.class.php +++ b/lib/classes/User/Adapter.class.php @@ -907,6 +907,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public static function get_usr_id_from_email($email) { if (is_null($email)) + return false; $conn = connection::getPDOConnection(); @@ -1255,7 +1256,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public function get_applied_template() { - + return $this->applied_template; } @@ -1277,6 +1278,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface protected function load_preferences() { if ($this->_prefs) + return $this; $sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id'; $stmt = $this->appbox->get_connection()->prepare($sql); @@ -1371,7 +1373,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return $this; @@ -1477,6 +1479,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface { $this->load_preferences(); if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value) + return $value; $ok = true; @@ -1514,6 +1517,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface $appbox = appbox::get_instance(); $session = $appbox->get_session(); if (!$session->is_authenticated()) + return; $ses_id = $session->get_ses_id(); @@ -1572,7 +1576,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } } } @@ -1636,7 +1640,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return false; @@ -1722,7 +1726,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return $locale; @@ -1788,6 +1792,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public function get_nonce() { if ($this->nonce) + return $this->nonce; $nonce = false; diff --git a/lib/classes/User/Query.class.php b/lib/classes/User/Query.class.php index aa962ba946..18fcadf804 100644 --- a/lib/classes/User/Query.class.php +++ b/lib/classes/User/Query.class.php @@ -269,7 +269,7 @@ class User_Query implements User_QueryInterface $extra = $this->include_phantoms ? ' OR sbas_id IS NULL ' : ''; $not_sbas_id = array_diff($this->active_sbas, $this->sbas_ids); - + if (count($not_sbas_id) > 0 && count($not_sbas_id) < count($this->sbas_ids)) { $sql .= sprintf(' AND ((sbas_id != %s ) ' . $extra . ')' @@ -489,6 +489,7 @@ class User_Query implements User_QueryInterface public function get_total() { if ($this->total) + return $this->total; $conn = $this->appbox->get_connection(); @@ -637,6 +638,7 @@ class User_Query implements User_QueryInterface public function on_base_ids(Array $base_ids = null) { if (!$base_ids) + return $this; $this->bases_restrictions = true; @@ -661,6 +663,7 @@ class User_Query implements User_QueryInterface public function on_sbas_ids(Array $sbas_ids = null) { if (!$sbas_ids) + return $this; $this->sbas_restrictions = true; diff --git a/lib/classes/appbox.class.php b/lib/classes/appbox.class.php index 707023ddb0..f10bc9a22f 100644 --- a/lib/classes/appbox.class.php +++ b/lib/classes/appbox.class.php @@ -138,10 +138,12 @@ class appbox extends base $custom_path.= $collection->get_base_id(); if (is_null($pathfile)) + return $this; $datas = file_get_contents($pathfile->getPathname()); if (is_null($datas)) + return $this; file_put_contents($file, $datas); @@ -193,10 +195,12 @@ class appbox extends base $custom_path.= $pic_type . '_' . $databox->get_sbas_id(); if (is_null($pathfile)) + return $this; $datas = file_get_contents($pathfile->getPathname()); if (is_null($datas)) + return $this; file_put_contents($file, $datas); @@ -513,12 +517,12 @@ class appbox extends base //rewrite service file $serviceFile = $appConf->getServiceFile(); $services = $configuration->getConfigurationHandler()->getParser()->parse($serviceFile); - + foreach ($services as $serviceName => $service) { if ($serviceName === "doctrine_prod") { - + $services["doctrine_prod"]["options"]["orm"]["cache"] = array( "query" => $cacheService, "result" => $cacheService, @@ -526,7 +530,7 @@ class appbox extends base ); } } - + $yaml = $configuration->getConfigurationHandler()->getParser()->dump($services, 5); if (!file_put_contents($serviceFile->getPathname(), $yaml) !== false) @@ -571,7 +575,7 @@ class appbox extends base } catch (Exception $e) { - + } try @@ -608,6 +612,7 @@ class appbox extends base public function get_databoxes() { if ($this->databoxes) + return $this->databoxes; $ret = array(); @@ -619,7 +624,7 @@ class appbox extends base } catch (Exception $e) { - + } } @@ -636,7 +641,7 @@ class appbox extends base } catch (Exception $e) { - + } $sql = 'SELECT sbas_id FROM sbas'; diff --git a/lib/classes/base.class.php b/lib/classes/base.class.php index 5fd8c5fee5..58a2b8b32b 100644 --- a/lib/classes/base.class.php +++ b/lib/classes/base.class.php @@ -258,8 +258,10 @@ abstract class base implements cache_cacheableInterface public function upgradeavailable() { if ($this->get_version()) + return version_compare(\Alchemy\Phrasea\Core\Version::getNumber(), $this->get_version(), '>'); else + return true; } @@ -337,7 +339,7 @@ abstract class base implements cache_cacheableInterface $current_version = $this->get_version(); $Core = bootstrap::getCore(); - + $upgrader->set_current_message(sprintf(_('Applying patches on %s'), $this->get_dbname())); if ($apply_patches) { diff --git a/lib/classes/bootstrap.class.php b/lib/classes/bootstrap.class.php index ba02642051..3a15255684 100644 --- a/lib/classes/bootstrap.class.php +++ b/lib/classes/bootstrap.class.php @@ -29,9 +29,9 @@ class bootstrap } /** - * - * @param $env - * @return Alchemy\Phrasea\Core + * + * @param $env + * @return Alchemy\Phrasea\Core */ public static function execute($env = null) { @@ -47,7 +47,7 @@ class bootstrap /** * - * @return Alchemy\Phrasea\Core + * @return Alchemy\Phrasea\Core */ public static function getCore() { diff --git a/lib/classes/caption/Field/Value.class.php b/lib/classes/caption/Field/Value.class.php index baa0236ef9..9c467bf0cf 100644 --- a/lib/classes/caption/Field/Value.class.php +++ b/lib/classes/caption/Field/Value.class.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -20,22 +20,22 @@ class caption_Field_Value /** * - * @var int + * @var int */ protected $id; /** * - * @var string + * @var string */ protected $value; /** * - * @var databox_field + * @var databox_field */ protected $databox_field; /** * - * @var record_adapter + * @var record_adapter */ protected $record; @@ -44,7 +44,7 @@ class caption_Field_Value * @param databox_field $databox_field * @param record_adapter $record * @param type $id - * @return \caption_Field_Value + * @return \caption_Field_Value */ public function __construct(databox_field $databox_field, record_adapter $record, $id) { @@ -116,27 +116,27 @@ class caption_Field_Value return $this; } - + public function setVocab(\Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface $vocabulary, $vocab_id) { - + $params = array( ':VocabType' => $vocabulary->getType() , ':VocabularyId' => $vocab_id ); - $sql_up = 'UPDATE metadatas - SET VocabularyType = :VocabType, VocabularyId = :VocabularyId + $sql_up = 'UPDATE metadatas + SET VocabularyType = :VocabType, VocabularyId = :VocabularyId WHERE id = :meta_id'; $stmt_up = $connbas->prepare($sql_up); $stmt_up->execute($params); $stmt_up->closeCursor(); - + $this->set_value($vocabulary->getValue($vocab_id)); - + return $this; } - + public function set_value($value) { @@ -170,7 +170,7 @@ class caption_Field_Value } catch (Exception $e) { - + } $this->update_cache_value($value); @@ -232,8 +232,8 @@ class caption_Field_Value $sbas_id = $databox_field->get_databox()->get_sbas_id(); $connbas = $databox_field->get_connection(); - - $sql_ins = 'INSERT INTO metadatas + + $sql_ins = 'INSERT INTO metadatas (id, record_id, meta_struct_id, value, VocabularyType, VocabularyId) VALUES (null, :record_id, :field, :value, :VocabType, :VocabId)'; @@ -257,4 +257,4 @@ class caption_Field_Value return $caption_field_value; } -} \ No newline at end of file +} diff --git a/lib/classes/caption/field.class.php b/lib/classes/caption/field.class.php index 4c281d2fe5..87e9b7887e 100644 --- a/lib/classes/caption/field.class.php +++ b/lib/classes/caption/field.class.php @@ -58,8 +58,8 @@ class caption_field //implements cache_cacheableInterface $connbas = $databox_field->get_connection(); - $sql = 'SELECT id FROM metadatas - WHERE record_id = :record_id + $sql = 'SELECT id FROM metadatas + WHERE record_id = :record_id AND meta_struct_id = :meta_struct_id'; $params = array( @@ -75,7 +75,7 @@ class caption_field //implements cache_cacheableInterface if (!$databox_field->is_multi() && count($rs) > 1) { /** - * TRIGG CORRECTION; + * TRIGG CORRECTION; */ } @@ -86,10 +86,10 @@ class caption_field //implements cache_cacheableInterface return $this; } - + /** * - * @return record_adapter + * @return record_adapter */ public function get_record() { @@ -221,9 +221,9 @@ class caption_field //implements cache_cacheableInterface $separator = ' '; else $separator = ' ' . $separator . ' '; - + $array_values = array(); - + foreach($values as $value) { $array_values[] = $value->getValue(); @@ -264,7 +264,7 @@ class caption_field //implements cache_cacheableInterface // } // catch (Exception $e) // { -// +// // } // // $this->update_cache_value($value); @@ -380,17 +380,17 @@ class caption_field //implements cache_cacheableInterface // return $this->value; // } // } - + public function get_values() { return $this->values; } - + public function get_value($meta_id) { return $this->values[$meta_id]; } - + public function get_serialized_values($custom_separator = false) { if ($this->databox_field->is_multi() === true) @@ -407,10 +407,11 @@ class caption_field //implements cache_cacheableInterface foreach($this->values as $value) { /* @var $value Caption_Field_Value */ + return $value->getValue(); } } - + return null; } @@ -665,7 +666,7 @@ class caption_field //implements cache_cacheableInterface } catch (Exception $e) { - + } } diff --git a/lib/classes/caption/record.class.php b/lib/classes/caption/record.class.php index 53adfb9697..385445661a 100644 --- a/lib/classes/caption/record.class.php +++ b/lib/classes/caption/record.class.php @@ -60,6 +60,7 @@ class caption_record implements caption_interface, cache_cacheableInterface protected function retrieve_fields() { if (is_array($this->fields)) + return $this->fields; $fields = array(); @@ -96,7 +97,7 @@ class caption_record implements caption_interface, cache_cacheableInterface } catch (Exception $e) { - + } } $this->fields = $rec_fields; @@ -133,6 +134,7 @@ class caption_record implements caption_interface, cache_cacheableInterface { $fields = $this->retrieve_fields(); if (isset($this->dces_elements[$label])) + return $fields[$this->dces_elements[$label]]; return null; } diff --git a/lib/classes/collection.class.php b/lib/classes/collection.class.php index 681eecde27..dfdac9877d 100644 --- a/lib/classes/collection.class.php +++ b/lib/classes/collection.class.php @@ -65,7 +65,7 @@ class collection implements cache_cacheableInterface } catch (Exception $e) { - + } $connbas = $this->databox->get_connection(); diff --git a/lib/classes/connection.class.php b/lib/classes/connection.class.php index 65344ac08d..016e25edcb 100755 --- a/lib/classes/connection.class.php +++ b/lib/classes/connection.class.php @@ -54,6 +54,7 @@ class connection { $registry = registry::get_instance(); if (!$registry->get('GV_debug')) + return; $totalTime = 0; @@ -120,6 +121,7 @@ class connection $name = (int) $name; } else + return false; if (!isset(self::$_PDO_instance[$name])) @@ -173,6 +175,7 @@ class connection } } if (array_key_exists($name, self::$_PDO_instance)) + return self::$_PDO_instance[$name]; throw new Exception('Connection not available'); } diff --git a/lib/classes/connection/abstract.class.php b/lib/classes/connection/abstract.class.php index 1d5be4b4f1..66c2a8ff64 100644 --- a/lib/classes/connection/abstract.class.php +++ b/lib/classes/connection/abstract.class.php @@ -40,7 +40,7 @@ abstract class connection_abstract extends PDO public static function html_pdo_exception(PDOException $e) { $p = array('e' => $e); - + $core = \bootstrap::getCore(); $twig = $core->getTwig(); diff --git a/lib/classes/databox.class.php b/lib/classes/databox.class.php index a42131ed30..282fd0e3ff 100644 --- a/lib/classes/databox.class.php +++ b/lib/classes/databox.class.php @@ -142,7 +142,7 @@ class databox extends base } catch (Exception $e) { - + } } @@ -157,7 +157,7 @@ class databox extends base } catch (Exception $e) { - + } $conn = connection::getPDOConnection(); @@ -451,6 +451,7 @@ class databox extends base $stmt->closeCursor(); if ($row) + return self::get_instance((int) $row['sbas_id']); try @@ -463,7 +464,7 @@ class databox extends base } catch (Exception $e) { - + } $sql = 'USE `' . $dbname . '`'; @@ -575,6 +576,7 @@ class databox extends base public function get_meta_structure() { if ($this->meta_struct) + return $this->meta_struct; try @@ -697,6 +699,7 @@ class databox extends base } } if ($n > $limit) + return true; return false; @@ -986,7 +989,7 @@ class databox extends base } catch (Exception $e) { - + } if (isset($field['regname'])) @@ -1220,6 +1223,7 @@ class databox extends base public function get_structure() { if ($this->structure) + return $this->structure; $this->structure = $this->retrieve_structure(); @@ -1234,7 +1238,7 @@ class databox extends base } catch (Exception $e) { - + } $structure = null; @@ -1260,6 +1264,7 @@ class databox extends base public function get_cterms() { if ($this->cterms) + return $this->cterms; $sql = "SELECT value FROM pref WHERE prop='cterms'"; @@ -1426,6 +1431,7 @@ class databox extends base public function get_cgus() { if ($this->cgus) + return $this->cgus; $this->load_cgus(); @@ -1443,7 +1449,7 @@ class databox extends base } catch (Exception $e) { - + } $sql = 'SELECT value, locale, updated_on FROM pref WHERE prop ="ToU"'; diff --git a/lib/classes/databox/cgu.class.php b/lib/classes/databox/cgu.class.php index 0ba6b99485..1c701dd382 100644 --- a/lib/classes/databox/cgu.class.php +++ b/lib/classes/databox/cgu.class.php @@ -94,12 +94,12 @@ class databox_cgu $terms = array(); $appbox = appbox::get_instance(); $session = $appbox->get_session(); - + if(!$home) { $user = User_Adapter::getInstance($session->get_usr_id(), $appbox); } - + foreach ($appbox->get_databoxes() as $databox) { try diff --git a/lib/classes/databox/descriptionStructure.class.php b/lib/classes/databox/descriptionStructure.class.php index 74e36a6ea3..83faa90e2c 100644 --- a/lib/classes/databox/descriptionStructure.class.php +++ b/lib/classes/databox/descriptionStructure.class.php @@ -94,7 +94,7 @@ class databox_descriptionStructure implements IteratorAggregate public function get_element_by_name($name) { $name = databox_field::generateName($name); - + if (isset($this->cache_name_id[$name])) return $this->elements[$this->cache_name_id[$name]]; diff --git a/lib/classes/databox/field.class.php b/lib/classes/databox/field.class.php index 95ddae1f10..dee0925938 100644 --- a/lib/classes/databox/field.class.php +++ b/lib/classes/databox/field.class.php @@ -667,7 +667,7 @@ class databox_field implements cache_cacheableInterface } catch (Exception $e) { - + } return $this; @@ -875,14 +875,14 @@ class databox_field implements cache_cacheableInterface return self::get_instance($databox, $id); } - - + + public static function generateName($name) { $unicode_processor = new unicode(); $name = $unicode_processor->remove_nonazAZ09($name, false, false); - + return $unicode_processor->remove_first_digits($name); } diff --git a/lib/classes/databox/status.class.php b/lib/classes/databox/status.class.php index ed3262c244..904f75ed27 100644 --- a/lib/classes/databox/status.class.php +++ b/lib/classes/databox/status.class.php @@ -479,7 +479,7 @@ class databox_status $conn = connection::getPDOConnection(); $status = '0'; - + if(substr($stat1, 0, 2) === '0x') { $stat1 = self::hex2bin(substr($stat1, 2)); @@ -518,7 +518,7 @@ class databox_status { $stat2 = self::hex2bin(substr($stat2, 2)); } - + $sql = 'select bin(0b' . trim($stat1) . ' & ~0b' . trim($stat2) . ') as result'; $stmt = $conn->prepare($sql); @@ -548,7 +548,7 @@ class databox_status { $stat2 = self::hex2bin(substr($stat2, 2)); } - + $sql = 'select bin(0b' . trim($stat1) . ' | 0b' . trim($stat2) . ') as result'; $stmt = $conn->prepare($sql); @@ -567,12 +567,12 @@ class databox_status public static function dec2bin($status) { $status = (string) $status; - + if(!ctype_digit($status)) { throw new \Exception('Non-decimal value'); } - + $conn = connection::getPDOConnection(); $sql = 'select bin(' . $status . ') as result'; @@ -583,7 +583,7 @@ class databox_status $stmt->closeCursor(); $status = '0'; - + if ($row) { $status = $row['result']; @@ -599,12 +599,12 @@ class databox_status { $status = substr($status, 2); } - + if(!ctype_xdigit($status)) { throw new \Exception('Non-hexadecimal value'); } - + $conn = connection::getPDOConnection(); $sql = 'select BIN( CAST( 0x'.trim($status).' AS UNSIGNED ) ) as result'; @@ -615,7 +615,7 @@ class databox_status $stmt->closeCursor(); $status = '0'; - + if ($row) { $status = $row['result']; diff --git a/lib/classes/deprecated/prodUtils.php b/lib/classes/deprecated/prodUtils.php index 07a51cd776..db9f285c91 100644 --- a/lib/classes/deprecated/prodUtils.php +++ b/lib/classes/deprecated/prodUtils.php @@ -20,7 +20,7 @@ function deleteRecord($lst, $del_children) $Core = bootstrap::getCore(); $em = $Core->getEntityManager(); $BE_repository = $em->getRepository('\Entities\BasketElement'); - + $appbox = appbox::get_instance(); $session = $appbox->get_session(); $registry = $Core->getRegistry(); @@ -96,14 +96,14 @@ function deleteRecord($lst, $del_children) } } $ret[] = implode('_', $rid); - + $basket_elements = $BE_repository->findElementsByRecord($record); foreach($basket_elements as $basket_element) { $em->remove($basket_element); } - + $record->delete(); unset($record); } @@ -115,7 +115,7 @@ function deleteRecord($lst, $del_children) } $em->flush(); - + return p4string::jsonencode($ret); } diff --git a/lib/classes/deprecated/push.api.php b/lib/classes/deprecated/push.api.php index 3b3d10c680..baf6fa39d5 100644 --- a/lib/classes/deprecated/push.api.php +++ b/lib/classes/deprecated/push.api.php @@ -1509,7 +1509,7 @@ function pushIt($usr, $newBask, $parmLST, $users, $mail_content, $lng, $accuse) } $em = $Core->getEntityManager(); - + foreach ($users as $oneuser => $rights) { $new_basket = null; @@ -1524,26 +1524,26 @@ function pushIt($usr, $newBask, $parmLST, $users, $mail_content, $lng, $accuse) $new_basket->setIsRead(false); $new_basket->setPusher($pusher); $new_basket->setOwner($user); - + $em->persist($new_basket); - + $nbchu++; foreach($parmLST as $basrec) { $basrec = explode('_', $basrec); - + $record = new record_adapter($basrec[0], $basrec[1]); - + $BasketElement = new Entities\BasketElement(); $BasketElement->setRecord($record); $BasketElement->setBasket($new_basket); - + $em->persist($BasketElement); - + $new_basket->addBasketElement($BasketElement); } - + $em->flush(); $finalUsers[] = $user->get_id(); @@ -1631,13 +1631,13 @@ function pushValidation($usr, $ssel_id, $listUsrs, $time, $mail_content, $accuse $em = $Core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $Core->getAuthenticatedUser()); $basket->setIsRead(false); - + $em->merge($basket); - + $em->flush(); foreach ($listUsrs as $oneuser => $rights) diff --git a/lib/classes/eventsmanager/broker.class.php b/lib/classes/eventsmanager/broker.class.php index 6a8712cb83..e2771c8f30 100644 --- a/lib/classes/eventsmanager/broker.class.php +++ b/lib/classes/eventsmanager/broker.class.php @@ -14,7 +14,7 @@ class eventsmanager_broker protected $appbox; /** * - * @var \Alchemy\Phrasea\Core + * @var \Alchemy\Phrasea\Core */ protected $core; diff --git a/lib/classes/eventsmanager/eventAbstract.class.php b/lib/classes/eventsmanager/eventAbstract.class.php index b1f97412a3..343567774a 100644 --- a/lib/classes/eventsmanager/eventAbstract.class.php +++ b/lib/classes/eventsmanager/eventAbstract.class.php @@ -17,7 +17,7 @@ abstract class eventsmanager_eventAbstract protected $registry; /** * - * @var \Alchemy\Phrasea\Core + * @var \Alchemy\Phrasea\Core */ protected $core; /** diff --git a/lib/classes/eventsmanager/notify/orderdeliver.class.php b/lib/classes/eventsmanager/notify/orderdeliver.class.php index 1470b49d6a..21293899ab 100644 --- a/lib/classes/eventsmanager/notify/orderdeliver.class.php +++ b/lib/classes/eventsmanager/notify/orderdeliver.class.php @@ -149,7 +149,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); } catch (Exception $e) @@ -201,7 +201,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); } catch (Exception $e) diff --git a/lib/classes/eventsmanager/notify/validate.class.php b/lib/classes/eventsmanager/notify/validate.class.php index ebe965a58a..cd03d0c0ee 100644 --- a/lib/classes/eventsmanager/notify/validate.class.php +++ b/lib/classes/eventsmanager/notify/validate.class.php @@ -142,7 +142,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); $basket_name = trim($basket->getName()) ?: _('Une selection'); diff --git a/lib/classes/eventsmanager/notify/validationdone.class.php b/lib/classes/eventsmanager/notify/validationdone.class.php index 8e81ab3988..609bcdc556 100644 --- a/lib/classes/eventsmanager/notify/validationdone.class.php +++ b/lib/classes/eventsmanager/notify/validationdone.class.php @@ -145,7 +145,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); } catch (Exception $e) @@ -198,7 +198,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); } catch (Exception $e) diff --git a/lib/classes/eventsmanager/notify/validationreminder.class.php b/lib/classes/eventsmanager/notify/validationreminder.class.php index 548bb48a6b..28f6954cd4 100644 --- a/lib/classes/eventsmanager/notify/validationreminder.class.php +++ b/lib/classes/eventsmanager/notify/validationreminder.class.php @@ -158,9 +158,9 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra { $em = $this->core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + $basket = $repository->findUserBasket($ssel_id, $this->core->getAuthenticatedUser()); - + $basket_name = trim($basket->getName()) ? : _('Une selection'); } catch (Exception $e) diff --git a/lib/classes/gatekeeper.class.php b/lib/classes/gatekeeper.class.php index 97aa6996bb..240310e931 100644 --- a/lib/classes/gatekeeper.class.php +++ b/lib/classes/gatekeeper.class.php @@ -76,6 +76,7 @@ class gatekeeper $session = $appbox->get_session(); if (http_request::is_command_line()) + return; if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF'])) @@ -104,7 +105,7 @@ class gatekeeper } catch (Exception $e) { - + } } @@ -121,6 +122,7 @@ class gatekeeper if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php' || $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php' || $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php') + return; phrasea::redirect('/login/?redirect=/thesaurus2'); break; @@ -129,6 +131,7 @@ class gatekeeper break; case 'admin': if ($this->_script_name === 'runscheduler.php') + return; phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']); break; @@ -148,6 +151,7 @@ class gatekeeper return; case 'setup': if ($appbox->upgradeavailable()) + return; else phrasea::redirect('/login/'); @@ -264,6 +268,7 @@ class gatekeeper $parm = $request->get_parms('LOG'); if (is_null($parm["LOG"])) + return $this; try @@ -281,11 +286,12 @@ class gatekeeper try { $datas = random::helloToken($parm['LOG']); + return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/"); } catch (Exception_NotFound $e) { - + } return $this; diff --git a/lib/classes/geonames.class.php b/lib/classes/geonames.class.php index 7b84b7a032..c09aeaa19e 100644 --- a/lib/classes/geonames.class.php +++ b/lib/classes/geonames.class.php @@ -3,15 +3,15 @@ class geonames { protected static $NamesFromId = array(); - + protected static $CountryFromId = array(); - + protected static $CountryCodeFromId = array(); - + protected static $GeonameFromIp = array(); - + protected static $Searches = array(); - + public function name_from_id($geonameid) { $registry = registry::get_instance(); @@ -42,7 +42,7 @@ class geonames { return ''; } - + $registry = registry::get_instance(); $url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/') . 'get_name.php?geonameid=' @@ -103,6 +103,7 @@ class geonames $cityName = self::clean_input($cityName); if (strlen($cityName) === 0) + return $output; $registry = registry::get_instance(); @@ -143,6 +144,7 @@ class geonames public function find_geoname_from_ip($ip) { if (array_key_exists($ip, $this->cache_ips)) + return $this->cache_ips[$ip]; $output = array( diff --git a/lib/classes/http/query.class.php b/lib/classes/http/query.class.php index 30009ccd14..86f6a8a9e1 100644 --- a/lib/classes/http/query.class.php +++ b/lib/classes/http/query.class.php @@ -26,9 +26,11 @@ class http_query public static function getHttpCodeFromUrl($url) { if (!is_scalar($url)) + return null; if (trim($url) === '') + return null; $ch = curl_init(); @@ -52,9 +54,11 @@ class http_query public static function getHttpHeaders($url) { if (!is_scalar($url)) + return null; if (trim($url) === '') + return null; $ch = curl_init(); @@ -83,9 +87,11 @@ class http_query public static function getUrl($url, $post_data = false) { if (!is_scalar($url)) + return null; if (trim($url) === '') + return null; $ch = curl_init(); diff --git a/lib/classes/http/request.class.php b/lib/classes/http/request.class.php index c83ee48623..622228dc60 100644 --- a/lib/classes/http/request.class.php +++ b/lib/classes/http/request.class.php @@ -93,7 +93,7 @@ class http_request return true; return false; } - + public function is_secure() { return ( diff --git a/lib/classes/lazaretFile.class.php b/lib/classes/lazaretFile.class.php index 3a4c0646a4..6df683398c 100644 --- a/lib/classes/lazaretFile.class.php +++ b/lib/classes/lazaretFile.class.php @@ -138,7 +138,7 @@ class lazaretFile $record = new record_adapter($sbas_id, $record_id); $record->substitute_subdef('document', new system_file($pathfile)); - + $this->delete(); return $this; diff --git a/lib/classes/module/admin.class.php b/lib/classes/module/admin.class.php index 513ec0a5ea..5cd66b3947 100644 --- a/lib/classes/module/admin.class.php +++ b/lib/classes/module/admin.class.php @@ -76,10 +76,10 @@ class module_admin , 'off_databoxes' => $off_databoxes ); - + $core = \bootstrap::getCore(); $twig = $core->getTwig(); - + return $twig->render('admin/tree.html.twig', $params); } diff --git a/lib/classes/module/console/fileConfigCheck.class.php b/lib/classes/module/console/fileConfigCheck.class.php index 9853ec3299..cd505c7ab4 100644 --- a/lib/classes/module/console/fileConfigCheck.class.php +++ b/lib/classes/module/console/fileConfigCheck.class.php @@ -34,7 +34,7 @@ class module_console_fileConfigCheck extends Command /** * - * @var \Alchemy\Phrasea\Core\Configuration + * @var \Alchemy\Phrasea\Core\Configuration */ protected $configuration; protected $env; @@ -169,6 +169,7 @@ class module_console_fileConfigCheck extends Command throw new \Exception(sprintf("Check parsing file\n"), null, $e); } $output->writeln("Parsing File OK"); + return; } @@ -183,6 +184,7 @@ class module_console_fileConfigCheck extends Command throw new \Exception(sprintf("Check get selected environment\n"), null, $e); } $output->writeln("Get Selected Environment OK"); + return; } @@ -203,6 +205,7 @@ class module_console_fileConfigCheck extends Command throw new \Exception(sprintf("Check get selected environment from file\n"), null, $e); } $output->writeln("Get Selected Environment from file OK"); + return; } @@ -262,6 +265,7 @@ class module_console_fileConfigCheck extends Command } $output->writeln("Phraseanet Scope OK"); + return; } @@ -297,6 +301,7 @@ class module_console_fileConfigCheck extends Command throw new \Exception(sprintf("Check Database Scope\n"), null, $e); } $output->writeln("Database Scope OK"); + return; } @@ -330,7 +335,7 @@ class module_console_fileConfigCheck extends Command ); $service = $serviceBuilder->buildService(); - + if ($service->getType() === 'twig') { $twig = $service->getService(); @@ -383,6 +388,7 @@ class module_console_fileConfigCheck extends Command } $output->writeln("Template engine service OK"); + return; } @@ -391,6 +397,7 @@ class module_console_fileConfigCheck extends Command if (!$this->connexionOk) { $output->writeln("As ORM service test depends on database test success, it is not executed"); + return; } @@ -416,7 +423,7 @@ class module_console_fileConfigCheck extends Command } $registry = \registry::get_instance(); - + $serviceBuilder = new Core\ServiceBuilder\Orm( $ormName , $configuration @@ -502,6 +509,7 @@ class module_console_fileConfigCheck extends Command } $output->writeln("ORM service OK"); + return; } diff --git a/lib/classes/module/console/systemUpgrade.class.php b/lib/classes/module/console/systemUpgrade.class.php index b7d7e033b7..8de04d0cc7 100644 --- a/lib/classes/module/console/systemUpgrade.class.php +++ b/lib/classes/module/console/systemUpgrade.class.php @@ -62,9 +62,9 @@ class module_console_systemUpgrade extends Command } $conn = \connection::getPDOConnection(); - + $credentials = $conn->get_credentials(); - + $handler = new \Alchemy\Phrasea\Core\Configuration\Handler( new \Alchemy\Phrasea\Core\Configuration\Application(), new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml() diff --git a/lib/classes/module/report.class.php b/lib/classes/module/report.class.php index 4d4eb62210..d052c83597 100644 --- a/lib/classes/module/report.class.php +++ b/lib/classes/module/report.class.php @@ -500,6 +500,7 @@ class module_report public function getOrder($k = false) { if ($k === false) + return $this->tab_order; return $this->tab_order[$k]; } @@ -819,6 +820,7 @@ class module_report public function buildReport($tab = false, $groupby = false, $on = false) { if (sizeof($this->report) > 0) + return $this->report; $conn = connection::getPDOConnection($this->sbas_id); diff --git a/lib/classes/module/report/activity.class.php b/lib/classes/module/report/activity.class.php index 97b0e31bc2..6411fc531d 100644 --- a/lib/classes/module/report/activity.class.php +++ b/lib/classes/module/report/activity.class.php @@ -935,7 +935,7 @@ class module_report_activity extends module_report AND (" . $collfilter['sql'] . ") GROUP by ddate ORDER BY ddate ASC"; - + $stmt = $conn->prepare($sql); $stmt->execute($params); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -951,7 +951,7 @@ class module_report_activity extends module_report { $res[$key] = number_format($act, 2, '.', ''); } - + return $res; } @@ -1102,7 +1102,7 @@ class module_report_activity extends module_report AND (" . $collfilter['sql'] . ") GROUP BY ddate ORDER BY activity ASC "; - + $stmt = $conn->prepare($sql); $stmt->execute($params); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -1112,6 +1112,7 @@ class module_report_activity extends module_report $date = new DateTime($row['ddate']); $result[$date->format(DATE_ATOM)] = $row['activity']; } + return $result; } diff --git a/lib/classes/module/report/dashboard.class.php b/lib/classes/module/report/dashboard.class.php index 17c525625b..96a6c6fcac 100644 --- a/lib/classes/module/report/dashboard.class.php +++ b/lib/classes/module/report/dashboard.class.php @@ -157,8 +157,10 @@ class module_report_dashboard implements module_report_dashboard_componentInterf public function isValid() { if (isset($this->dashboard) && sizeof($this->dashboard) > 0) + return true; else + return false; } @@ -348,11 +350,11 @@ class module_report_dashboard implements module_report_dashboard_componentInterf } catch (Exception $e) { - + } $i++; } - + return; } diff --git a/lib/classes/module/report/dashboard/feed.class.php b/lib/classes/module/report/dashboard/feed.class.php index 24373e673a..5d244a262f 100644 --- a/lib/classes/module/report/dashboard/feed.class.php +++ b/lib/classes/module/report/dashboard/feed.class.php @@ -75,9 +75,9 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI } catch (Exception $e) { - + } - + $tmp = new self($sbasid, $sbas_coll, $dmin, $dmax); $appbox->set_data_to_cache($tmp, $cache_id); @@ -131,7 +131,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI * @return */ public function process() - { + { try { //Get number of DLs @@ -250,8 +250,9 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI } catch(PDOException $e) { - + } + return; } diff --git a/lib/classes/module/report/dashboard/sort.class.php b/lib/classes/module/report/dashboard/sort.class.php index 40eb57f882..94c2f2418a 100644 --- a/lib/classes/module/report/dashboard/sort.class.php +++ b/lib/classes/module/report/dashboard/sort.class.php @@ -149,8 +149,10 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI public function isValid() { if (isset($this->arraySorted) && sizeof($this->arraySorted) > 0) + return true; else + return false; } @@ -162,10 +164,11 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI public function getTop($nbtop) { if (!is_int($nbtop)) + return array(); - + $tmp = array(); - + if ($this->isValid()) { foreach ($this->arraySorted as $k => $v) @@ -182,6 +185,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI } } } + return $tmp; } diff --git a/lib/classes/module/report/download.class.php b/lib/classes/module/report/download.class.php index da9475b17b..b53cebf137 100644 --- a/lib/classes/module/report/download.class.php +++ b/lib/classes/module/report/download.class.php @@ -38,7 +38,7 @@ class module_report_download extends module_report 'mime' => 'subdef.mime', 'file' => 'subdef.file' ); - + /** * constructor * diff --git a/lib/classes/module/report/nav.class.php b/lib/classes/module/report/nav.class.php index afcd27c8d5..89232dd429 100644 --- a/lib/classes/module/report/nav.class.php +++ b/lib/classes/module/report/nav.class.php @@ -603,10 +603,10 @@ class module_report_nav extends module_report , 'titre' => $record->get_title() , 'taille' => $document->get_size() ); - + $this->setDisplayNav(); $this->setReport(); - + return $this->report; } diff --git a/lib/classes/patch/320f.class.php b/lib/classes/patch/320f.class.php index 5031e58803..7777e680cb 100644 --- a/lib/classes/patch/320f.class.php +++ b/lib/classes/patch/320f.class.php @@ -55,7 +55,7 @@ class patch_320f implements patchInterface function apply(base &$appbox) { $feeds = array(); - + try { $sql = 'ALTER TABLE `ssel` ADD `migrated` INT NOT NULL DEFAULT "0"'; @@ -65,9 +65,9 @@ class patch_320f implements patchInterface } catch(Exception $e) { - + } - + $sql = 'SELECT ssel_id, usr_id, name, descript, pub_date , updater, pub_restrict, homelink FROM ssel WHERE (public = "1" or homelink="1") and migrated = 0'; @@ -123,7 +123,7 @@ class patch_320f implements patchInterface } } - $sql = 'UPDATE ssel SET deleted = "1", migrated="1" + $sql = 'UPDATE ssel SET deleted = "1", migrated="1" WHERE ssel_id = :ssel_id'; $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(array(':ssel_id' => $row['ssel_id'])); diff --git a/lib/classes/patch/360.class.php b/lib/classes/patch/360.class.php index 8e0a40c1f2..fabacc2be6 100644 --- a/lib/classes/patch/360.class.php +++ b/lib/classes/patch/360.class.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -55,50 +55,50 @@ class patch_360 implements patchInterface function apply(base &$appbox) { // $Core = bootstrap::getCore(); -// +// // $sql = 'SELECT ssel_id, name FROM ssel'; // // $stmt = $appbox->get_connection()->prepare($sql); // $stmt->execute(); // $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); // $stmt->closeCursor(); - - + + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'INSERT INTO StoryWZ + + $sql = 'INSERT INTO StoryWZ ( SELECT null as id, sbas_id, rid as record_id, usr_id, date as created - FROM ssel + FROM ssel WHERE temporaryType = "1" )'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'INSERT INTO Baskets + + $sql = 'INSERT INTO Baskets ( SELECT ssel_id as id, name, descript as description, usr_id - , pushFrom as pusher_id, - 0 as archived, date as created, updater as updated, 1 as is_read - FROM ssel + , pushFrom as pusher_id, + 0 as archived, date as created, updater as updated, 1 as is_read + FROM ssel WHERE temporaryType = "0" )'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - + $sql = 'UPDATE Baskets SET pusher_id = NULL WHERE pusher_id = 0'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'INSERT INTO ValidationSessions + + $sql = 'INSERT INTO ValidationSessions ( SELECT id, v.ssel_id as basket_id ,created_on as created ,updated_on as updated ,expires_on as expires @@ -106,50 +106,50 @@ class patch_360 implements patchInterface FROM ssel s, validate v WHERE v.ssel_id = s.ssel_id AND v.usr_id = s.usr_id )'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'INSERT INTO ValidationParticipants + + $sql = 'INSERT INTO ValidationParticipants ( SELECT id, v.usr_id, id AS ValidationSession_id , 1 AS is_aware, last_reminder AS reminded FROM validate v, ssel s WHERE s.ssel_id = v.ssel_id )'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'INSERT INTO ValidationDatas + + $sql = 'INSERT INTO ValidationDatas ( SELECT null as id, v.id as participant_id , d.sselcont_id as basket_element_id , d.agreement, d.note, d.updated_on as updated - FROM validate v, ssel s, validate_datas as d + FROM validate v, ssel s, validate_datas as d WHERE s.ssel_id = v.ssel_id and v.id = d.validate_id )'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'UPDATE ValidationDatas + + $sql = 'UPDATE ValidationDatas SET agreement = NULL where agreement = "0"'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - - $sql = 'UPDATE ValidationDatas + + $sql = 'UPDATE ValidationDatas SET agreement = "0" where agreement = "-1"'; - + $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - + return true; } diff --git a/lib/classes/phrasea.class.php b/lib/classes/phrasea.class.php index ffb863da85..9f4460d966 100644 --- a/lib/classes/phrasea.class.php +++ b/lib/classes/phrasea.class.php @@ -112,7 +112,7 @@ class phrasea $configuration = new \Alchemy\Phrasea\Core\Configuration($handler); $choosenConnexion = $configuration->getPhraseanet()->get('database'); - + $connexion = $configuration->getConnexion($choosenConnexion); $hostname = $connexion->get('host'); @@ -238,6 +238,7 @@ class phrasea public static function sbas_params() { if (self::$_sbas_params) + return self::$_sbas_params; $appbox = appbox::get_instance(); @@ -249,7 +250,7 @@ class phrasea } catch (Exception $e) { - + } self::$_sbas_params = array(); @@ -274,6 +275,7 @@ class phrasea { $usr_id = User_Adapter::get_usr_id_from_login('invite'); if (!$usr_id) + return false; $appbox = appbox::get_instance(); $user = User_Adapter::getInstance($usr_id, $appbox); diff --git a/lib/classes/random.class.php b/lib/classes/random.class.php index d547875033..24a615b66f 100644 --- a/lib/classes/random.class.php +++ b/lib/classes/random.class.php @@ -202,8 +202,8 @@ class random self::cleanTokens(); $conn = connection::getPDOConnection(); - $sql = 'SELECT * FROM tokens - WHERE value = :token + $sql = 'SELECT * FROM tokens + WHERE value = :token AND (expire_on > NOW() OR expire_on IS NULL)'; $stmt = $conn->prepare($sql); $stmt->execute(array(':token' => $token)); diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 5e5c34c56f..08a75dc068 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -182,7 +182,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $connbas = $this->databox->get_connection(); @@ -516,7 +516,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return null; @@ -566,7 +566,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $sql = 'SELECT BIN(status) as status FROM record WHERE record_id = :record_id'; @@ -650,7 +650,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $connbas = $this->get_databox()->get_connection(); @@ -749,8 +749,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface if ($data) { if (isset($this->technical_datas[$data])) + return $this->technical_datas[$data]; else + return false; } @@ -846,7 +848,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface /* @var $field caption_field */ /** - * Replacing original name in multi values is non sense + * Replacing original name in multi values is non sense */ if (!$field->is_multi()) { @@ -867,7 +869,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } } - $sql = 'UPDATE record + $sql = 'UPDATE record SET originalname = :originalname WHERE record_id = :record_id'; $params = array( @@ -1220,7 +1222,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $this->delete_data_from_cache(self::CACHE_SUBDEFS); @@ -1472,7 +1474,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $this->delete_data_from_cache(self::CACHE_STATUS); @@ -1487,6 +1489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface public function get_reg_name() { if (!$this->is_grouping()) + return false; $balisename = ''; @@ -1683,6 +1686,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface { $hd = $this->get_subdef('document'); if ($hd->is_physically_present()) + return new system_file(p4string::addEndSlash($hd->get_path()) . $hd->get_file()); return null; } @@ -1901,7 +1905,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } $this->delete_data_from_cache(self::CACHE_SUBDEFS); } @@ -1995,7 +1999,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface } catch (Exception $e) { - + } } @@ -2020,6 +2024,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $repo = $em->getRepository('\Entities\Basket'); /* @var $$repo \Repositories\BasketRepository */ + return $repo->findContainingRecord($this); } diff --git a/lib/classes/record/preview.class.php b/lib/classes/record/preview.class.php index 9aeb8cd758..3010c37047 100644 --- a/lib/classes/record/preview.class.php +++ b/lib/classes/record/preview.class.php @@ -141,7 +141,7 @@ class record_preview extends record_adapter case "BASK": $em = $Core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + /* @var $repository \Repositories\BasketRepository */ $Basket = $repository->findUserBasket($contId, $Core->getAuthenticatedUser()); @@ -211,6 +211,7 @@ class record_preview extends record_adapter public function get_train($pos = 0, $query='', searchEngine_adapter $search_engine=null) { if ($this->train) + return $this->train; switch ($this->env) @@ -273,10 +274,11 @@ class record_preview extends record_adapter public function get_title($highlight = '', searchEngine_adapter $search_engine=null) { if ($this->title) + return $this->title; - + $this->title = collection::getLogo($this->get_base_id()) . ' '; - + switch ($this->env) { @@ -329,6 +331,7 @@ class record_preview extends record_adapter public function get_short_history() { if (!is_null($this->short_history)) + return $this->short_history; $tab = array(); @@ -382,14 +385,14 @@ class record_preview extends record_adapter if (!isset($tab[$hour][$site][$action][$row['usr_id']])) { $user = null; - + try { $user = \User_Adapter::getInstance($row['usr_id'], $appbox); } catch (Exception $e) { - + } $tab[$hour][$site][$action][$row['usr_id']] = @@ -421,6 +424,7 @@ class record_preview extends record_adapter public function get_view_popularity() { if (!is_null($this->view_popularity)) + return $this->view_popularity; $appbox = appbox::get_instance(); $session = $appbox->get_session(); @@ -518,6 +522,7 @@ class record_preview extends record_adapter public function get_refferer_popularity() { if (!is_null($this->refferer_popularity)) + return $this->refferer_popularity; $appbox = appbox::get_instance(); $session = $appbox->get_session(); @@ -604,6 +609,7 @@ class record_preview extends record_adapter { if (!is_null($this->download_popularity)) + return $this->download_popularity; $appbox = appbox::get_instance(); $session = $appbox->get_session(); diff --git a/lib/classes/registry.class.php b/lib/classes/registry.class.php index 1ab18eecf4..d6345477d8 100644 --- a/lib/classes/registry.class.php +++ b/lib/classes/registry.class.php @@ -71,6 +71,7 @@ class registry implements registryInterface $this->cache->set('GV_debug', $configuration->isDebug()); $this->cache->set('GV_maintenance', $configuration->isMaintained()); } + return $this; } @@ -96,7 +97,7 @@ class registry implements registryInterface } catch (Exception $e) { - + } foreach ($rs as $row) { @@ -139,8 +140,10 @@ class registry implements registryInterface $this->load(); if (!$this->cache->is_set($key) && !is_null($defaultvalue)) + return $defaultvalue; else + return $this->cache->get($key); } diff --git a/lib/classes/searchEngine/adapter/phrasea/engine.class.php b/lib/classes/searchEngine/adapter/phrasea/engine.class.php index 416f5f0446..b8ae74692e 100644 --- a/lib/classes/searchEngine/adapter/phrasea/engine.class.php +++ b/lib/classes/searchEngine/adapter/phrasea/engine.class.php @@ -143,7 +143,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract public function set_options(searchEngine_options $options) { $this->options = $options; - + $this->opt_search_type = (int) $options->get_search_type(); $this->opt_bases = $options->get_bases(); $this->opt_fields = $options->get_fields(); @@ -397,7 +397,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract $total_time = 0; $sort = ''; - + if($this->options->get_sortby()) { switch($this->options->get_sortord()) @@ -412,7 +412,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract } $sort .= '0' . $this->options->get_sortby(); } - + foreach ($this->queries as $sbas_id => $qry) { $this->results[$sbas_id] = phrasea_query2( @@ -651,7 +651,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract { $val = $field['value']; } - + $ret[] = $val; } diff --git a/lib/classes/searchEngine/adapter/phrasea/queryParser.class.php b/lib/classes/searchEngine/adapter/phrasea/queryParser.class.php index fcbff91988..2bfcd61aa7 100644 --- a/lib/classes/searchEngine/adapter/phrasea/queryParser.class.php +++ b/lib/classes/searchEngine/adapter/phrasea/queryParser.class.php @@ -122,6 +122,7 @@ class searchEngine_adapter_phrasea_queryParser $this->proposals = Array("QRY" => "", "BASES" => array()); $this->phq = $this->mb_trim($phq, 'UTF-8'); if ($this->phq != "") + return($this->maketree(0)); else { @@ -139,14 +140,18 @@ class searchEngine_adapter_phrasea_queryParser { case "SIMPLE": if (is_array($tree["VALUE"])) + return(implode(" ", $tree["VALUE"])); else + return($tree["VALUE"]); break; case "QSIMPLE": if (is_array($tree["VALUE"])) + return("\"" . implode(" ", $tree["VALUE"]) . "\""); else + return("\"" . $tree["VALUE"] . "\""); break; case "PHRASEA_KW_ALL": @@ -154,15 +159,19 @@ class searchEngine_adapter_phrasea_queryParser break; case "PHRASEA_KW_LAST": if ($tree["PNUM"] !== null) + return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); else + return($tree["VALUE"][0]); break; case "OPS": case "OPK": if (isset($tree["PNUM"])) + return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . "[" . $tree["PNUM"] . "] " . $this->astext($tree["RB"]) . ")"); else + return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . " " . $this->astext($tree["RB"]) . ")"); break; } @@ -183,8 +192,10 @@ class searchEngine_adapter_phrasea_queryParser if ($tree) { if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") + return($tree["COMPLEXITY"] = $this->calc_complexity($tree["LB"]) + $this->calc_complexity($tree["RB"])); else + return($tree["COMPLEXITY"] = 1); } } @@ -348,6 +359,7 @@ class searchEngine_adapter_phrasea_queryParser function priority_opk(&$tree, $depth = 0) { if (!$tree) + return; if ($tree["CLASS"] == "OPK" && ($tree["LB"]["CLASS"] == "OPS" || $tree["LB"]["CLASS"] == "OPK")) { @@ -366,6 +378,7 @@ class searchEngine_adapter_phrasea_queryParser function distrib_opk(&$tree, $depth = 0) { if (!$tree) + return; if ($tree["CLASS"] == "OPK" && ($tree["RB"]["CLASS"] == "OPS")) { @@ -392,6 +405,7 @@ class searchEngine_adapter_phrasea_queryParser function thesaurus2_apply(&$tree, $bid) { if (!$tree) + return; if (($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE") && isset($tree["SREF"]) && isset($tree["SREF"]["TIDS"])) { @@ -458,6 +472,7 @@ class searchEngine_adapter_phrasea_queryParser if ($depth == 0) $ret = $tree; if (!$useThesaurus) + return; // full-text only : inchangé if (($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE")) { @@ -592,6 +607,7 @@ class searchEngine_adapter_phrasea_queryParser $this->proposals["BASES"]["b$bid"] = array("BID" => $bid, "NAME" => $name, "TERMS" => array()); if (!$tree) + return(0); $ambigus = 0; @@ -632,7 +648,7 @@ class searchEngine_adapter_phrasea_queryParser } else { - + } $tsy[$lng][] = $zsy; } @@ -733,15 +749,19 @@ class searchEngine_adapter_phrasea_queryParser break; case "PHRASEA_KW_LAST": if ($tree["PNUM"] !== null) + return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); else + return($tree["VALUE"][0]); break; case "OPS": case "OPK": if (isset($tree["PNUM"])) + return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . '[' . $tree["PNUM"] . '] ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')'); else + return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . ' ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')'); break; } @@ -904,8 +924,10 @@ class searchEngine_adapter_phrasea_queryParser function containsColonOperator(&$tree) { if (!$tree) + return(false); if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON && ($tree["RB"]["CLASS"] == "SIMPLE" || $tree["RB"]["CLASS"] == "QSIMPLE")) + return(true); $ret = false; if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") @@ -1028,15 +1050,19 @@ class searchEngine_adapter_phrasea_queryParser break; case "PHRASEA_KW_LAST": if ($tree["PNUM"] !== null) + return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); else + return($tree["VALUE"][0]); break; case "OPS": case "OPK": if (isset($tree["PNUM"])) + return("(" . $this->astext_ambigu($tree["LB"], $ambiguites, $mouseCallback, $depth + 1) . " " . $tree["VALUE"] . "[" . $tree["PNUM"] . "] " . $this->astext_ambigu($tree["RB"], $ambiguites, $mouseCallback, $depth + 1) . ")"); else + return("(" . $this->astext_ambigu($tree["LB"], $ambiguites, $mouseCallback, $depth + 1) . " " . $tree["VALUE"] . " " . $this->astext_ambigu($tree["RB"], $ambiguites, $mouseCallback, $depth + 1) . ")"); break; } @@ -1045,6 +1071,7 @@ class searchEngine_adapter_phrasea_queryParser function get_ambigu(&$tree, $mouseCallback = "void", $depth = 0) { if (!$tree) + return(""); unset($tree["DEPTH"]); if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") @@ -1054,7 +1081,7 @@ class searchEngine_adapter_phrasea_queryParser } else { - + } if ($depth == 0) { @@ -1069,14 +1096,17 @@ class searchEngine_adapter_phrasea_queryParser function set_default(&$tree, &$emptyw, $depth = 0) { if (!$tree) + return(true); if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") { if ($tree["CLASS"] == "OPS") { if (!$this->set_default($tree["LB"], $emptyw, $depth + 1)) + return(false); if (!$this->set_default($tree["RB"], $emptyw, $depth + 1)) + return(false); } else // OPK ! @@ -1210,6 +1240,7 @@ class searchEngine_adapter_phrasea_queryParser $nmodif += $this->factor_or2($tree["RB"], $depth + 1); } } + return($nmodif); } @@ -1607,6 +1638,7 @@ class searchEngine_adapter_phrasea_queryParser // quand on est entre guillements les tokens perdent leur signification $tree = $this->addtotree($tree, $t, $depth, $inquote); if (!$tree) + return(null); } else @@ -1629,6 +1661,7 @@ class searchEngine_adapter_phrasea_queryParser // quand on est entre guillements les tokens perdent leur signification $tree = $this->addtotree($tree, $t, $depth, $inquote); if (!$tree) + return(null); } else // '(' : appel récursif @@ -1656,6 +1689,7 @@ class searchEngine_adapter_phrasea_queryParser } } if (!$tree) + return(null); } break; @@ -1712,6 +1746,7 @@ class searchEngine_adapter_phrasea_queryParser } } if (!$tree) + return(null); } break; @@ -1724,6 +1759,7 @@ class searchEngine_adapter_phrasea_queryParser print("-------------------------\n"); } if (!$tree) + return(null); break; } @@ -1750,6 +1786,7 @@ class searchEngine_adapter_phrasea_queryParser } if (!$t) + return($tree); switch ($t["CLASS"]) { @@ -2009,6 +2046,7 @@ class searchEngine_adapter_phrasea_queryParser function nexttoken($inquote = false) { if ($this->phq == "") + return(null); switch ($c = substr($this->phq, 0, 1)) { @@ -2143,8 +2181,10 @@ class searchEngine_adapter_phrasea_queryParser $this->phq = $this->mb_ltrim(mb_substr($this->phq, $i + 1, 99999, 'UTF-8'), 'UTF-8'); } if ($t != "") + return(array("CLASS" => "TOK_WORD", "VALUE" => $t)); else + return(array("CLASS" => "TOK_VOID", "VALUE" => $t)); break; } diff --git a/lib/classes/searchEngine/adapter/sphinx/engine.class.php b/lib/classes/searchEngine/adapter/sphinx/engine.class.php index ffec0529b3..bc5c825471 100644 --- a/lib/classes/searchEngine/adapter/sphinx/engine.class.php +++ b/lib/classes/searchEngine/adapter/sphinx/engine.class.php @@ -752,9 +752,9 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i 'before_match' => "", 'after_match' => "" ); - + $fields_to_send = array(); - + foreach($fields as $k=>$f) { $fields_to_send[$k] = $f['value']; diff --git a/lib/classes/searchEngine/options.class.php b/lib/classes/searchEngine/options.class.php index a684b86014..a518fdff54 100644 --- a/lib/classes/searchEngine/options.class.php +++ b/lib/classes/searchEngine/options.class.php @@ -454,13 +454,13 @@ class searchEngine_options implements Serializable { $tmpvalue = (array) $value; $value = array(); - + foreach($tmpvalue as $k=>$data) { $k = ctype_digit($k) ? (int) $k : $k; $value[$k] = $data; } - + } $this->$key = $value; diff --git a/lib/classes/set/export.class.php b/lib/classes/set/export.class.php index a6c82c158b..2d736e94cb 100644 --- a/lib/classes/set/export.class.php +++ b/lib/classes/set/export.class.php @@ -37,13 +37,13 @@ class set_export extends set_abstract public function __construct($lst, $sstid) { $Core = bootstrap::getCore(); - + $appbox = appbox::get_instance(); $session = $appbox->get_session(); $registry = $appbox->get_registry(); $user = $Core->getAuthenticatedUser(); - + $download_list = array(); $remain_hd = array(); @@ -52,7 +52,7 @@ class set_export extends set_abstract { $em = $Core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + /* @var $repository \Repositories\BasketRepository */ $Basket = $repository->findUserBasket($sstid, $user); @@ -479,7 +479,7 @@ class set_export extends set_abstract $sd = $download_element->get_subdefs(); foreach ($download_element->get_downloadable() as $name => $properties) - { + { if ($properties === false || !in_array($name, $subdefs)) { continue; @@ -762,6 +762,7 @@ class set_export extends set_abstract return false; } if (isset($list['complete']) && $list['complete'] === true) + return; @@ -993,13 +994,13 @@ class set_export extends set_abstract else { /** - * + * * Header "Pragma: public" SHOULD be present. * In case it is not present, download on IE 8 and previous over HTTPS * will fail. - * + * * @todo : merge this shitty fix with Response object. - * + * */ if (!headers_sent()) { @@ -1011,6 +1012,7 @@ class set_export extends set_abstract $response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";"); $response->headers->set('Content-Length', filesize($file)); $response->setContent(file_get_contents($file)); + return $response; } } @@ -1061,7 +1063,7 @@ class set_export extends set_abstract $user = false; if ($anonymous) { - + } else { diff --git a/lib/classes/set/exportorder.class.php b/lib/classes/set/exportorder.class.php index 975f4c9abc..cd47d19038 100644 --- a/lib/classes/set/exportorder.class.php +++ b/lib/classes/set/exportorder.class.php @@ -28,7 +28,7 @@ class set_exportorder extends set_export public function order_available_elements($from_usr_id, $usage, $deadline) { $Core = bootstrap::getCore(); - + $lst = $this->get_orderable_lst(); $conn = connection::getPDOConnection(); diff --git a/lib/classes/set/order.class.php b/lib/classes/set/order.class.php index 327f0d0bed..9c19979958 100644 --- a/lib/classes/set/order.class.php +++ b/lib/classes/set/order.class.php @@ -220,25 +220,25 @@ class set_order extends set_abstract } $core = \bootstrap::getCore(); - + $em = $core->getEntityManager(); $repository = $em->getRepository('\Entities\Basket'); - + /* @var $repository \Repositories\BasketRepository */ $Basket = $repository->findUserBasket($this->ssel_id, $core->getAuthenticatedUser()); - + if(!$Basket) { $Basket = new Basket(); $Basket->setName(sprintf(_('Commande du %s'), $this->created_on->format('Y-m-d'))); $Basket->setOwner($this->user); $Basket->setPusher($core->getAuthenticatedUser()); - + $em->persist($Basket); $em->flush(); - + $this->ssel_id = $Basket->getId(); - + $sql = 'UPDATE `order` SET ssel_id = :ssel_id WHERE id = :order_id'; $stmt = $conn->prepare($sql); $stmt->execute(array(':ssel_id' => $Basket->getId(), ':order_id' => $this->id)); @@ -264,17 +264,17 @@ class set_order extends set_abstract { $sbas_id = phrasea::sbasFromBas($basrec['base_id']); $record = new record_adapter($sbas_id, $basrec['record_id']); - + $BasketElement = new BasketElement(); $BasketElement->setRecord($record); $BasketElement->setBasket($Basket); - + $Basket->addBasketElement($BasketElement); - + $em->persist($BasketElement); - + $em->merge($Basket); - + $params = array( ':usr_id' => $session->get_usr_id() , ':order_id' => $this->id @@ -285,7 +285,7 @@ class set_order extends set_abstract $n++; $this->user->ACL()->grant_hd_on($record, $pusher, 'order'); - + unset($record); } catch (Exception $e) @@ -293,7 +293,7 @@ class set_order extends set_abstract } } - + $em->flush(); $stmt->closeCursor(); diff --git a/lib/classes/setup.class.php b/lib/classes/setup.class.php index 9cbf760ee0..f84f62e523 100644 --- a/lib/classes/setup.class.php +++ b/lib/classes/setup.class.php @@ -79,8 +79,9 @@ class setup } catch (\Exception $e) { - + } + return $installed; } @@ -304,11 +305,13 @@ class setup protected static function discover_binary($binary, array $look_here = array()) { if (system_server::get_platform() == 'WINDOWS') + return null; foreach ($look_here as $place) { if (is_executable($place)) + return $place; } @@ -320,6 +323,7 @@ class setup $registry = registry::get_instance(); if ($registry->get('GV_h264_streaming') !== true) + return; ?>

mod_auth_token configuration

@@ -531,6 +535,7 @@ class setup $language_name) @@ -754,11 +760,14 @@ class setup if (($current === '' || $current === 'off' || $current === '0') && $is_flag) if ($value === 'off' || $value === '0' || $value === '') + return $current; if (($current === '1' || $current === 'on') && $is_flag) if ($value === 'on' || $value === '1') + return $current; if ($current === $value) + return $current; } @@ -785,7 +794,7 @@ class setup } catch (Exception $e) { - + } } if ($connbas) @@ -801,7 +810,7 @@ class setup } catch (Exception $e) { - + } } } @@ -815,7 +824,7 @@ class setup } catch (\Exception $e) { - + } try @@ -825,7 +834,7 @@ class setup } catch (\Exception $e) { - + } try @@ -835,7 +844,7 @@ class setup } catch (\Exception $e) { - + } return; @@ -843,4 +852,3 @@ class setup } - \ No newline at end of file diff --git a/lib/classes/task/manager.class.php b/lib/classes/task/manager.class.php index 51767999d7..6783b59049 100644 --- a/lib/classes/task/manager.class.php +++ b/lib/classes/task/manager.class.php @@ -112,7 +112,7 @@ class task_manager return $row; } - + public static function getAvailableTasks() { $registry = registry::get_instance(); @@ -150,6 +150,7 @@ class task_manager closedir($hdir); } } + return $tasks; } } diff --git a/lib/classes/task/period/ftp.class.php b/lib/classes/task/period/ftp.class.php index ed092c21a7..a021fbc3d2 100644 --- a/lib/classes/task/period/ftp.class.php +++ b/lib/classes/task/period/ftp.class.php @@ -459,7 +459,7 @@ class task_period_ftp extends task_appboxAbstract if (in_array(trim($basefolder), array('.', './', ''))) $basefolder = '/'; - + foreach ($ftp_export['files'] as $fileid => $file) { $base_id = $file["base_id"]; @@ -567,7 +567,7 @@ class task_period_ftp extends task_appboxAbstract { if($this->debug) echo "\nlogfile \n"; - + $date = new DateTime(); $remote_file = $date->format('U'); @@ -575,12 +575,12 @@ class task_period_ftp extends task_appboxAbstract FROM ftp_export_elements WHERE ftp_export_id = :ftp_export_id AND error = "0" AND done="1"'; - + $stmt = $conn->prepare($sql); $stmt->execute(array(':ftp_export_id'=>$id)); $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC); $stmt->closeCursor(); - + $buffer = '#transfert finished '.$date->format(DATE_ATOM)."\n\n"; foreach ($rs as $row) @@ -602,7 +602,7 @@ class task_period_ftp extends task_appboxAbstract $ftp_client->chdir($ftp_export["destfolder"]); $ftp_client->put($remotefile, $tmpfile); - + unlink($tmpfile); } @@ -766,7 +766,7 @@ class task_period_ftp extends task_appboxAbstract _('task::ftp:Status about your FTP transfert from %1$s to %2$s') , $registry->get('GV_homeTitle'), $ftp_server ); - + mail::ftp_sent($sendermail, $subject, $sender_message); mail::ftp_receive($mail, $receiver_message); diff --git a/lib/classes/task/period/outofdate.class.php b/lib/classes/task/period/outofdate.class.php index a5802b408b..bf47c45f0f 100644 --- a/lib/classes/task/period/outofdate.class.php +++ b/lib/classes/task/period/outofdate.class.php @@ -162,6 +162,7 @@ class task_period_outofdate extends task_abstract parent.calcSQL(); ..."; for(i in data.date_fields) html += "\n"; @@ -308,12 +310,13 @@ class task_period_outofdate extends task_abstract for(fld=0; fld<=2; fld++) $("#status"+fld).html(html); } - }); + }); + return; } - - - + + + 0 ? $nchanged : 'NORECSTODO'); + return($ret); } - - - + + + /* function doRecords() { @@ -911,9 +915,9 @@ class task_period_outofdate extends task_abstract private function calcSQL($sxTaskSettings) { $ret = array(); - + $this->sxTaskSettings = $sxTaskSettings; - + $date1 = $date2 = NULL; $field1 = $field2 = ''; @@ -1007,7 +1011,7 @@ class task_period_outofdate extends task_abstract SET " . $sqlset[0] . " WHERE " . $w; // printf("%d : %s \n%s", __LINE__, $sql, var_export($params, true)); - + $ret[] = array('sql'=>$sql, 'params'=>$params); // $stmt = $this->connbas->prepare($sql); @@ -1271,7 +1275,7 @@ class task_period_outofdate extends task_abstract } catch(Exception $e) { - + } } break; diff --git a/lib/classes/task/period/upgradetov32.class.php b/lib/classes/task/period/upgradetov32.class.php index f63f6bfc29..c3d1138b6c 100644 --- a/lib/classes/task/period/upgradetov32.class.php +++ b/lib/classes/task/period/upgradetov32.class.php @@ -68,6 +68,7 @@ class task_period_upgradetov32 extends task_abstract { printf("sbas_id '" . $this->sbas_id . "' invalide\n"); $this->return_value = self::RETURNSTATUS_STOPPED; + return; } @@ -241,7 +242,7 @@ class task_period_upgradetov32 extends task_abstract } catch (Exception $e) { - + } } @@ -369,11 +370,13 @@ class task_period_upgradetov32 extends task_abstract if ($n_done >= 5000) { $this->return_value = task_abstract::RETURNSTATUS_TORESTART; + return; - } + } if ($memory > 100) { $this->return_value = task_abstract::RETURNSTATUS_TORESTART; + return; } } @@ -408,9 +411,9 @@ class task_period_upgradetov32 extends task_abstract $stmt->closeCursor(); $this->setProgress(0, 0); - + $this->return_value = self::RETURNSTATUS_TODELETE; - + flush(); return; diff --git a/lib/classes/task/period/writemeta.class.php b/lib/classes/task/period/writemeta.class.php index 3e87a4193b..726aa92278 100644 --- a/lib/classes/task/period/writemeta.class.php +++ b/lib/classes/task/period/writemeta.class.php @@ -307,7 +307,7 @@ class task_period_writemeta extends task_databoxAbstract $fields = $record->get_caption()->get_fields(); $subCMD = ''; - + if ($record->get_uuid()) { $subCMD .= '-XMP-exif:ImageUniqueID='; @@ -315,7 +315,7 @@ class task_period_writemeta extends task_databoxAbstract $subCMD .= '-IPTC:UniqueDocumentID='; $subCMD .= escapeshellarg($record->get_uuid()); } - + foreach ($fields as $field) { $meta = $field->get_databox_field(); @@ -326,23 +326,23 @@ class task_period_writemeta extends task_databoxAbstract $multi = $meta->is_multi(); $type = $meta->get_type(); $datas = $field->get_value(); - + if ($multi) { $datas = $field->get_value(); foreach ($datas as $value) { $value = $this->format_value($type, $value); - - $subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'='; + + $subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'='; $subCMD .= escapeshellarg($value).' '; } } else { $datas = $this->format_value($type, $datas); - - $subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'='; + + $subCMD .= '-'.$meta->get_metadata_namespace().':'.$meta->get_metadata_tagname().'='; $subCMD .= escapeshellarg($datas).' '; } } @@ -355,17 +355,18 @@ class task_period_writemeta extends task_databoxAbstract $cmd .= ( $registry->get('GV_exiftool') . ' -m -overwrite_original '); if ($name != 'document' || $this->clear_doc) $cmd .= '-all:all= '; - + $cmd .= ' -codedcharacterset=utf8 '; - + $cmd .= $subCMD.' '.escapeshellarg($file); - + $this->log(sprintf(('writing meta for sbas_id=%1$d - record_id=%2$d (%3$s)'), $this->sbas_id, $record_id, $name)); $s = trim(shell_exec($cmd)); $this->log("\t" . $s); } + return $this; } diff --git a/lib/conf.d/Doctrine/Entities.BasketElement.dcm.yml b/lib/conf.d/Doctrine/Entities.BasketElement.dcm.yml index 1ec3141289..a37e116d87 100644 --- a/lib/conf.d/Doctrine/Entities.BasketElement.dcm.yml +++ b/lib/conf.d/Doctrine/Entities.BasketElement.dcm.yml @@ -10,7 +10,7 @@ Entities\BasketElement: type: integer generator: strategy: AUTO - + fields: record_id: type: integer diff --git a/lib/conf.d/Doctrine/Entities.UsrListOwner.dcm.yml b/lib/conf.d/Doctrine/Entities.UsrListOwner.dcm.yml index 7afebbff4c..9fb72bc084 100644 --- a/lib/conf.d/Doctrine/Entities.UsrListOwner.dcm.yml +++ b/lib/conf.d/Doctrine/Entities.UsrListOwner.dcm.yml @@ -33,6 +33,6 @@ Entities\UsrListOwner: name: list_id referencedColumnName: id cascade: ["persist"] - + diff --git a/lib/conf.d/Doctrine/Entities.ValidationData.dcm.yml b/lib/conf.d/Doctrine/Entities.ValidationData.dcm.yml index bf9bbe799a..0133e0da2d 100644 --- a/lib/conf.d/Doctrine/Entities.ValidationData.dcm.yml +++ b/lib/conf.d/Doctrine/Entities.ValidationData.dcm.yml @@ -7,10 +7,10 @@ Entities\ValidationData: generator: strategy: AUTO fields: - agreement: + agreement: type: boolean nullable: true - note: + note: type: text nullable: true updated: @@ -32,4 +32,4 @@ Entities\ValidationData: joinColumn: name: basket_element_id referencedColumnName: id - cascade: ["persist"] \ No newline at end of file + cascade: ["persist"] diff --git a/lib/conf.d/Doctrine/Entities.ValidationParticipant.dcm.yml b/lib/conf.d/Doctrine/Entities.ValidationParticipant.dcm.yml index cc0038ecf4..0d458c6e9d 100644 --- a/lib/conf.d/Doctrine/Entities.ValidationParticipant.dcm.yml +++ b/lib/conf.d/Doctrine/Entities.ValidationParticipant.dcm.yml @@ -33,4 +33,4 @@ Entities\ValidationParticipant: joinColumn: name: ValidationSession_id referencedColumnName: id - cascade: ["persist"] \ No newline at end of file + cascade: ["persist"] diff --git a/lib/conf.d/PhraseaFixture/AbstractWZ.php b/lib/conf.d/PhraseaFixture/AbstractWZ.php index bdd5c09863..8c80f2d384 100644 --- a/lib/conf.d/PhraseaFixture/AbstractWZ.php +++ b/lib/conf.d/PhraseaFixture/AbstractWZ.php @@ -22,10 +22,10 @@ use Doctrine\Common\DataFixtures\AbstractFixture; abstract class AbstractWZ extends AbstractFixture { protected $user; - + protected $record; - - + + public function getUser() { return $this->user; @@ -47,4 +47,4 @@ abstract class AbstractWZ extends AbstractFixture $this->record = $record; } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php b/lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php index 2224bcc632..3e42b13034 100644 --- a/lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php +++ b/lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php @@ -53,4 +53,4 @@ class LoadFiveBaskets extends \PhraseaFixture\AbstractWZ implements FixtureInter $manager->flush(); } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php index 6f6ebb91af..fc9ea7083c 100644 --- a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php +++ b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php @@ -32,23 +32,23 @@ class LoadOneBasket extends \PhraseaFixture\AbstractWZ implements FixtureInterfa public function load($manager) { $basket = new \Entities\Basket(); - + $basket->setName('test'); $basket->setDescription('description'); - + if (null === $this->user) { throw new \LogicException('Fill a user to store a new basket'); } - + $basket->setOwner($this->user); - + $manager->persist($basket); $manager->flush(); - + $this->basket = $basket; $this->addReference('one-basket', $basket); } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php index 187be190ad..6ab35c431c 100644 --- a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php +++ b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php @@ -63,11 +63,11 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte { throw new \LogicException('Fill a user to store a new basket'); } - + $basket->setOwner($this->user); $this->addElementToBasket($manager, $basket); - + $validationSession = new \Entities\ValidationSession(); $validationSession->setBasket($basket); @@ -120,13 +120,13 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte { throw new \LogicException('Add new elements to basket'); } - + foreach ($this->basketElements as $record) { $basketElement = new \Entities\BasketElement(); $basketElement->setRecord($record); - + $basketElement->setBasket($basket); $manager->persist($basketElement); @@ -135,4 +135,4 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte $manager->flush(); } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/Story/LoadOneStory.php b/lib/conf.d/PhraseaFixture/Story/LoadOneStory.php index c24f7956fe..2a29f6b1de 100644 --- a/lib/conf.d/PhraseaFixture/Story/LoadOneStory.php +++ b/lib/conf.d/PhraseaFixture/Story/LoadOneStory.php @@ -54,4 +54,4 @@ class LoadOneStory extends \PhraseaFixture\AbstractWZ implements FixtureInterfac $this->addReference('one-story', $story); } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php b/lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php index bebbe353b6..29f360d934 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php @@ -10,18 +10,18 @@ */ namespace PhraseaFixture\UsrLists; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ abstract class ListAbstract extends \Doctrine\Common\DataFixtures\AbstractFixture { - + protected $user; - + protected $list; - + public function getUser() { return $this->user; diff --git a/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php b/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php index 9384160f12..14a23a824a 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php @@ -37,10 +37,10 @@ class UsrList extends ListAbstract implements FixtureInterface $list->setName('new list'); $list->addUsrListOwner($owner); - + /* @var $owner \Entities\UsrListOwner */ $owner->setList($list); - + $manager->persist($list); $manager->merge($owner); $manager->flush(); diff --git a/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php b/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php index 76dd54ea95..7d5e00e823 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php @@ -10,7 +10,7 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -44,15 +44,15 @@ class UsrListEntry extends ListAbstract implements FixtureInterface { throw new \LogicException('Fill a user to store a new basket'); } - + $list = $this->getReference('one-list'); - + $entry->setUser($this->user); $entry->setList($list); - + /* @var $list \Entities\UsrList */ $list->addUsrListEntry($entry); - + $manager->persist($entry); $manager->flush(); diff --git a/lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php b/lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php index 9650c4f21c..7da0fa90c9 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php @@ -13,7 +13,7 @@ namespace PhraseaFixture\UsrLists; use Doctrine\ORM\EntityManager; use Doctrine\Common\DataFixtures\FixtureInterface; /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com @@ -32,12 +32,12 @@ class UsrListOwner extends ListAbstract implements FixtureInterface $owner = new \Entities\UsrListOwner(); $owner->setRole(\Entities\UsrListOwner::ROLE_ADMIN); - + if (null === $this->user) { throw new \LogicException('Fill a user to store a new basket'); } - + $owner->setUser($this->user); $manager->persist($owner); diff --git a/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php b/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php index b9c9f6af18..fb03a0d1ff 100644 --- a/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php +++ b/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php @@ -51,4 +51,4 @@ class LoadOneParticipant extends \PhraseaFixture\AbstractWZ implements FixtureIn $this->addReference('one-validation-participant', $validationParticipant); } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php b/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php index a4ca44b00a..e730e949da 100644 --- a/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php +++ b/lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php @@ -34,7 +34,7 @@ class LoadParticipantWithSession extends \PhraseaFixture\AbstractWZ implements F * @var \Entities\ValidationSession */ private $session; - + public function load($manager) { $validationParticipant = new \Entities\ValidationParticipant(); @@ -63,4 +63,4 @@ class LoadParticipantWithSession extends \PhraseaFixture\AbstractWZ implements F } -} \ No newline at end of file +} diff --git a/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php b/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php index 5bfdc21d44..b25457ef4d 100644 --- a/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php +++ b/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php @@ -32,30 +32,30 @@ class LoadOneValidationSession extends \PhraseaFixture\AbstractWZ implements Fix public function load($manager) { $validationSession = new \Entities\ValidationSession(); - + $validationSession->setBasket( $this->getReference('one-basket') // load the one-basket stored reference ); - + $validationSession->setDescription('Une description au hasard'); $validationSession->setName('Un nom de validation'); - + $expires = new \DateTime(); $expires->modify('+1 week'); $validationSession->setExpires($expires); - + if (null === $this->user) { throw new \LogicException('Fill a user to store a new validation Session'); } $validationSession->setInitiator($this->user); - + $manager->persist($validationSession); $manager->flush(); - + $this->validationSession = $validationSession; $this->addReference('one-validation-session', $validationSession); } -} \ No newline at end of file +} diff --git a/lib/phpunit.xml.dist b/lib/phpunit.xml.dist index c8aac2acd0..35bbca23e6 100644 --- a/lib/phpunit.xml.dist +++ b/lib/phpunit.xml.dist @@ -24,13 +24,13 @@ - + ../lib/unitTest/ - + diff --git a/lib/unitTest/ACLTest.php b/lib/unitTest/ACLTest.php index 612b51ad0b..b907c81cb9 100644 --- a/lib/unitTest/ACLTest.php +++ b/lib/unitTest/ACLTest.php @@ -655,48 +655,48 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testis_limited() { $appbox = appbox::get_instance(); - + $found = false; - + foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) { $base_id = $collection->get_base_id(); - + if(!self::$user->ACL()->has_access_to_base($base_id)) continue; - + $this->assertFalse(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, true, new DateTime('-1 day'), new DateTime('+1 day')); - + $this->assertFalse(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, false, new DateTime('-1 day'), new DateTime('+1 day')); - + $this->assertFalse(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, true, new DateTime('+1 day'), new DateTime('+2 day')); - + $this->assertTrue(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, true, new DateTime('-2 day'), new DateTime('-1 day')); - + $this->assertTrue(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, true, new DateTime('-2 day'), new DateTime('+2 day')); - + $this->assertFalse(self::$user->ACL()->is_limited($base_id)); - + self::$user->ACL()->set_limits($base_id, false, new DateTime('-2 day'), new DateTime('+2 day')); - + $this->assertFalse(self::$user->ACL()->is_limited($base_id)); - + $found = true; } } - + if(!$found) $this->fail ('Unable to test'); } @@ -704,50 +704,50 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testget_limits() { $appbox = appbox::get_instance(); - + $found = false; - + foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) { $base_id = $collection->get_base_id(); - + if(!self::$user->ACL()->has_access_to_base($base_id)) continue; - + $minusone = new DateTime('-1 day'); - + $plusone = new DateTime('+1 day'); - + self::$user->ACL()->set_limits($base_id, true, $minusone, $plusone); - + $limits = self::$user->ACL()->get_limits($base_id); - + $this->assertEquals($limits['dmin'], $minusone); - + $this->assertEquals($limits['dmax'], $plusone); - + $minustwo = new DateTime('-2 day'); - + $plustwo = new DateTime('-2 day'); - + self::$user->ACL()->set_limits($base_id, true, $minustwo, $plustwo); - + $limits = self::$user->ACL()->get_limits($base_id); $this->assertEquals($limits['dmin'], $minustwo); - + $this->assertEquals($limits['dmax'], $plustwo); - + self::$user->ACL()->set_limits($base_id, false); - + $this->assertNull(self::$user->ACL()->get_limits($base_id)); - + $found = true; } } - + if(!$found) $this->fail ('Unable to test'); } diff --git a/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php b/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php index 876a0d4e3f..1fa09f788d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/ApiJsonTest.php @@ -809,9 +809,9 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract { $appbox = appbox::get_instance(); $usr_id = $appbox->get_session()->get_usr_id(); - + $basket = $this->insertOneBasket(); - + $route = '/baskets/' . $basket->getId() . '/content/?oauth_token=' . self::$token; $this->evaluateMethodNotAllowedRoute($route, array('POST', 'PUT', 'DELETE')); @@ -849,7 +849,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract { $basket = $this->insertOneBasket(); - + $route = '/baskets/' . $basket->getId() . '/setname/?oauth_token=' . self::$token; $this->evaluateMethodNotAllowedRoute($route, array('GET', 'PUT', 'DELETE')); @@ -905,7 +905,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract public function testSetBasketDescription() { $basket = $this->insertOneBasket(); - + $route = '/baskets/' . $basket->getId() . '/setdescription/?oauth_token=' . self::$token; $this->evaluateMethodNotAllowedRoute($route, array('GET', 'PUT', 'DELETE')); @@ -944,7 +944,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract $this->evaluateMetaJson200($content); $this->assertObjectHasAttribute("baskets", $content->response); - + $found = false; foreach ($content->response->baskets as $basket) { diff --git a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php index c1e11b7e9a..176d206389 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php @@ -215,7 +215,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract } catch (Exception_Databox_FieldNotFound $e) { - + } $route = '/databoxes/' . $databox_id . '/metadatas/?oauth_token=' . self::$token; diff --git a/lib/unitTest/Alchemy/Phrasea/Application/OverviewTest.php b/lib/unitTest/Alchemy/Phrasea/Application/OverviewTest.php index 190f1bfa68..f7db0476ee 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/OverviewTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/OverviewTest.php @@ -119,7 +119,7 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract $crawler = $this->client->request('GET', $url); $response = $this->client->getResponse(); - + if (self::$record_1->get_preview()->get_baseurl() !== '') { $this->assertEquals(302, $response->getStatusCode()); diff --git a/lib/unitTest/Alchemy/Phrasea/Application/RootTest.php b/lib/unitTest/Alchemy/Phrasea/Application/RootTest.php index 6b05053335..697a28fa6d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/RootTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/RootTest.php @@ -17,7 +17,7 @@ class ApplicationRootTest extends PhraseanetWebTestCaseAuthenticatedAbstract { return require __DIR__ . '/../../../../Alchemy/Phrasea/Application/Root.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Application/SetupTest.php b/lib/unitTest/Alchemy/Phrasea/Application/SetupTest.php index 79ad795c10..9ad795b963 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/SetupTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/SetupTest.php @@ -17,7 +17,7 @@ class ApplicationSetupTest extends PhraseanetWebTestCaseAuthenticatedAbstract { return require __DIR__ . '/../../../../Alchemy/Phrasea/Application/Setup.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php index 51a127732a..2d400bba23 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php @@ -10,18 +10,18 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -79,7 +79,7 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertTrue(is_object($datas)); $this->assertTrue(!!$datas->result); $this->assertEquals($field->is_readonly(), !!$datas->is_readonly); - + $field->delete(); } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php index 810ddfaa6b..09ca42cdb1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php @@ -316,7 +316,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica } catch (\Exception $e) { - + } $this->assertRegexp("#FILEHREF:/custom/feed_" . $feed->get_id() . ".jpg?[0-9]*#", $response->getContent()); @@ -437,7 +437,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica } catch(\Exception $e) { - + } } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php index b2e8d338de..40f60d1796 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php @@ -8,20 +8,20 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAuthenticatedAbstract. */ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { - - + + /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -32,7 +32,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Admin.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php index 06af71d614..caaebeea2b 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php @@ -10,18 +10,18 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; protected $usersParameters; @@ -74,7 +74,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract } catch (\Exception $e) { - + } } @@ -302,6 +302,6 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertRegexp("#charset=UTF-8#", $response->headers->get("content-type")); $this->assertEquals("attachment; filename=export.txt", $response->headers->get("content-disposition")); } - - + + } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/BoilerPlate.php b/lib/unitTest/Alchemy/Phrasea/Controller/BoilerPlate.php index d050dc8c6e..383563df41 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/BoilerPlate.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/BoilerPlate.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAbstract.class.inc'; /** - * Always load the controller file for CodeCoverage + * Always load the controller file for CodeCoverage */ require_once __DIR__ . '/../../../../../Alchemy/Phrasea/Controller/My/Controller.php'; @@ -10,30 +10,30 @@ use Silex\WebTestCase; use Symfony\Component\HttpFoundation\Response; /** - * + * * This class is a BoilerPlate for a Controller Test * - * - You should extends PhraseanetWebTestCaseAuthenticatedAbstract if the + * - You should extends PhraseanetWebTestCaseAuthenticatedAbstract if the * controller required authentication - * - * - The Class Name should end with "Test" to be detected by - * + * + * - The Class Name should end with "Test" to be detected by + * */ class BoilerPlate extends \PhraseanetWebTestCaseAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -44,7 +44,7 @@ class BoilerPlate extends \PhraseanetWebTestCaseAbstract { return require __DIR__ . '/../../../../Path/To/Application.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php index bdd560bf75..613fd39fa3 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php @@ -48,7 +48,7 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract '42', self::$record_no_access->get_serialize_key() ); - + $lst = implode(';', $records); $this->client->request( @@ -492,19 +492,19 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(2, $basket->getElements()->count()); } - + public function testRouteStealElements() { $em = self::$core->getEntityManager(); - + $BasketElement = $this->insertOneBasketElement(); - + $Basket_1 = $BasketElement->getBasket(); - + $Basket_2 = $this->insertOneBasket(); - + $route = sprintf('/baskets/%s/stealElements/', $Basket_2->getId()); - + $crawler = $this->client->request( 'POST', $route, array( 'elements' => array($BasketElement->getId(), 'ufdsd') @@ -512,8 +512,8 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract ); $response = $this->client->getResponse(); - - + + $this->assertEquals(302, $response->getStatusCode()); $em = self::$core->getEntityManager(); @@ -522,25 +522,25 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $basket = $em->getRepository('Entities\Basket')->find($Basket_1->getId()); $this->assertInstanceOf('\Entities\Basket', $basket); $this->assertEquals(0, $basket->getElements()->count()); - + $basket = $em->getRepository('Entities\Basket')->find($Basket_2->getId()); $this->assertInstanceOf('\Entities\Basket', $basket); $this->assertEquals(1, $basket->getElements()->count()); } - + public function testRouteStealElementsJson() { $em = self::$core->getEntityManager(); - + $BasketElement = $this->insertOneBasketElement(); - + $Basket_1 = $BasketElement->getBasket(); - + $Basket_2 = $this->insertOneBasket(); - + $route = sprintf('/baskets/%s/stealElements/', $Basket_2->getId()); - + $crawler = $this->client->request( 'POST', $route, array( 'elements' => array($BasketElement->getId()) @@ -551,19 +551,19 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract ); $response = $this->client->getResponse(); - - + + $this->assertEquals(200, $response->getStatusCode()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('message', $datas); $this->assertArrayHasKey('success', $datas); $basket = $em->getRepository('Entities\Basket')->find($Basket_1->getId()); $this->assertInstanceOf('\Entities\Basket', $basket); $this->assertEquals(0, $basket->getElements()->count()); - + $basket = $em->getRepository('Entities\Basket')->find($Basket_2->getId()); $this->assertInstanceOf('\Entities\Basket', $basket); $this->assertEquals(1, $basket->getElements()->count()); @@ -622,4 +622,4 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(0, $count); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php index 00986340d4..db75158d56 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php @@ -264,7 +264,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract } catch (Exception $e) { - + } try @@ -274,7 +274,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract } catch (Exception $e) { - + } } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/EditTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/EditTest.php index 4abd87ba0e..7c5a819fc1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/EditTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/EditTest.php @@ -12,18 +12,18 @@ class ControllerEditTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = 1; @@ -47,18 +47,18 @@ class ControllerEditTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteSlash() { $this->client->request('POST', '/records/edit/', array('lst' => self::$record_1->get_serialize_key())); - + $response = $this->client->getResponse(); - + $this->assertTrue($response->isOk()); } - + public function testApply() { $this->client->request('POST', '/records/edit/apply/', array('lst' => self::$record_1->get_serialize_key())); - + $response = $this->client->getResponse(); - + $this->assertTrue($response->isOk()); } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php index 34bdc9fcdf..0ed450a957 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php @@ -12,25 +12,25 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract /** * - * @var Feed_Adapter + * @var Feed_Adapter */ protected $feed; /** * - * @var Feed_Entry_Adapter + * @var Feed_Entry_Adapter */ protected $entry; /** * - * @var Feed_Entry_Item + * @var Feed_Entry_Item */ protected $item; /** * - * @var Feed_Publisher_Adapter + * @var Feed_Publisher_Adapter */ protected $publisher; protected $client; @@ -96,7 +96,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->publisher->delete(); } } - + parent::tearDown(); } @@ -343,7 +343,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract } catch (Exception $e) { - + } } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MoveCollectionTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MoveCollectionTest.php index e728bdc3b4..d3245cf0d0 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MoveCollectionTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MoveCollectionTest.php @@ -10,18 +10,18 @@ class ControllerMoveCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAb { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = 1; diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PrinterTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PrinterTest.php index db1e017098..ae47110ae7 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PrinterTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PrinterTest.php @@ -10,18 +10,18 @@ class ControllerPrinterTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = 2; @@ -60,9 +60,9 @@ class ControllerPrinterTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRoutePrintPdf() { - + $this->markTestSkipped("Undefined variable: k_path_url \n /Users/nicolasl/workspace/phraseanet/lib/vendor/tcpdf/config/tcpdf_config.php:75"); - + $records = array( self::$record_1->get_serialize_key(), self::$record_2->get_serialize_key() diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PushTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PushTest.php index 63da2cfd59..bb73dfec51 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PushTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/PushTest.php @@ -10,18 +10,18 @@ class ControllerPushTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = 2; @@ -62,7 +62,7 @@ class ControllerPushTest extends \PhraseanetWebTestCaseAuthenticatedAbstract self::$record_1->get_serialize_key() , self::$record_2->get_serialize_key() ); - + $receivers = array( array('usr_id'=>self::$user_alt1->get_id(), 'HD'=>1) , array('usr_id'=>self::$user_alt2->get_id(), 'HD'=>0) @@ -96,7 +96,7 @@ class ControllerPushTest extends \PhraseanetWebTestCaseAuthenticatedAbstract self::$record_1->get_serialize_key() , self::$record_2->get_serialize_key() ); - + $participants = array( array( 'usr_id' => self::$user_alt1->get_id(), @@ -148,7 +148,7 @@ class ControllerPushTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals('UTF-8', $response->getCharset()); $datas = (array) json_decode($response->getContent()); - + $this->assertTrue(is_array($datas), 'Json is valid'); } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/RootTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/RootTest.php index 628cf41ad2..215d5189c1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/RootTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/RootTest.php @@ -10,17 +10,17 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -31,7 +31,7 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Prod.php'; } - + public function setUp() { parent::setUp(); @@ -44,13 +44,13 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteSlash() { $crawler = $this->client->request('GET', '/'); - - + + $response = $this->client->getResponse(); /* @var $response \Symfony\Component\HttpFoundation\Response */ $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + } } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/StoryTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/StoryTest.php index 78cdb7dd44..4311c67270 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/StoryTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/StoryTest.php @@ -229,7 +229,7 @@ class ControllerStoryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract } } - - -} \ No newline at end of file + + +} diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php index 265485231f..f5885e8f9f 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php @@ -94,7 +94,7 @@ class ControllerTooltipTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $option = new \searchEngine_options(); $crawler = $this->client->request('POST', $route, array('options_serial' => serialize($option))); - + $this->assertTrue($this->client->getResponse()->isOk()); } } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php index 05fe552537..c3d305693c 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php @@ -10,17 +10,17 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -31,7 +31,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Prod.php'; } - + public function setUp() { parent::setUp(); @@ -58,12 +58,12 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); $this->assertEquals(4, count($datas['lists'])); } - + protected function checkList($list, $owners = true, $users = true) { $this->assertInstanceOf('stdClass', $list); @@ -72,24 +72,24 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertObjectHasAttribute('updated', $list); $this->assertObjectHasAttribute('owners', $list); $this->assertObjectHasAttribute('users', $list); - + if($owners) $this->assertTrue(count($list->owners) > 0); - + foreach($list->owners as $owner) { $this->checkOwner($owner); } - + if($users) $this->assertTrue(count($list->users) > 0); - + foreach($list->users as $user) { $this->checkUser($user); } } - + public function testPostList() { $route = '/lists/list/'; @@ -100,34 +100,34 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertFalse($datas['success']); - + $this->client->request('POST', $route, array('name'=>'New List')); $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertTrue($datas['success']); } - + public function testGetList() { $entry = $this->insertOneUsrListEntry(self::$user,self::$user_alt1); $list_id = $entry->getList()->getId(); - + $route = '/lists/list/' . $list_id . '/'; $this->client->request('GET', $route); @@ -136,111 +136,111 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertTrue(is_array($datas)); $this->assertArrayhasKey('list', $datas); $this->checkList($datas['list']); } - + public function testPostUpdate() { $entry = $this->insertOneUsrListEntry(self::$user,self::$user_alt1); $list_id = $entry->getList()->getId(); - + $route = '/lists/list/' . $list_id . '/update/'; $this->client->request('POST', $route); $response = $this->client->getResponse(); - + $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertFalse($datas['success']); - - + + $this->client->request('POST', $route, array('name'=>'New NAME')); $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertTrue($datas['success']); } - - - - + + + + public function testPostDelete() { $entry = $this->insertOneUsrListEntry(self::$user,self::$user_alt1); $list_id = $entry->getList()->getId(); - + $route = '/lists/list/' . $list_id . '/delete/'; $this->client->request('POST', $route); $response = $this->client->getResponse(); - + $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertTrue($datas['success']); - + $repository = self::$core->getEntityManager()->getRepository('Entities\UsrList'); $this->assertNull($repository->find($list_id)); } - + public function testPostRemoveEntry() { $entry = $this->insertOneUsrListEntry(self::$user,self::$user_alt1); $list_id = $entry->getList()->getId(); $entry_id = $entry->getId(); - + $route = '/lists/list/' . $list_id . '/remove/' . $entry_id . '/'; $this->client->request('POST', $route); $response = $this->client->getResponse(); - + $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertTrue($datas['success']); - + $repository = self::$core->getEntityManager()->getRepository('Entities\UsrListEntry'); $this->assertNull($repository->find($entry_id)); } - + public function testPostAddEntry() { $list = $this->insertOneUsrList(self::$user); - + $this->assertEquals(0, $list->getEntries()->count()); $route = '/lists/list/' . $list->getId() . '/add/' . self::$user->get_id() . '/'; @@ -248,28 +248,28 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->client->request('POST', $route); $response = $this->client->getResponse(); - + $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); - + $this->assertTrue($datas['success']); - + $repository = self::$core->getEntityManager()->getRepository('Entities\UsrList'); $list = $repository->find($list->getId()); - + $this->assertEquals(1, $list->getEntries()->count()); } - + public function testPostShareList() { $list = $this->insertOneUsrList(self::$user); - + $this->assertEquals(1, $list->getOwners()->count()); $route = '/lists/list/' . $list->getId() . '/share/' . self::$user_alt1->get_id() . '/'; @@ -277,25 +277,25 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->client->request('POST', $route); $response = $this->client->getResponse(); - + $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $datas = (array) json_decode($response->getContent()); - + $this->assertArrayHasKey('success', $datas); $this->assertArrayHasKey('message', $datas); $this->assertTrue($datas['success']); - + $repository = self::$core->getEntityManager()->getRepository('Entities\UsrList'); $list = $repository->find($list->getId()); - + $this->assertEquals(2, $list->getOwners()->count()); } - - + + protected function checkOwner($owner) { $this->assertInstanceOf('stdClass', $owner); @@ -308,7 +308,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertObjectHasAttribute('role', $owner); $this->assertTrue(ctype_digit($owner->role)); } - + protected function checkUser($user) { $this->assertInstanceOf('stdClass', $user); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php index b7cfa1238e..a631be5d39 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php @@ -67,7 +67,7 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract } catch (\Exception $e) { - + } try @@ -136,7 +136,7 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract } catch (\Exception $e) { - + } //attach @@ -206,4 +206,4 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract //story not yet Attched } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php index 76eddb349f..d06d678d7a 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php @@ -168,9 +168,9 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract /** * XML is not verified due to Validator Service bug */ - + return; - + try { $validator = new W3CFeedRawValidator($xml); @@ -258,7 +258,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract $offset_start = ($offset_start++) * $n_entries; $collection = $feed->get_entries($offset_start, $n_entries); $entries = $collection->get_entries(); - if (sizeof($entries) == 0) //no more + if (sizeof($entries) == 0) //no more break; } $feed_entry = array_shift($entries); @@ -336,6 +336,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract { $current_attributes[$attribute->name] = $attribute->value; } + return $current_attributes; } @@ -475,7 +476,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract ) ); - + foreach ($fields as $key_field => $field) { if ($field["media_field"]["name"] == $node->nodeName) @@ -521,6 +522,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract unset($item_entries[$key]); //remove } }; + return $remove; } @@ -567,7 +569,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract $offset_start = ($offset_start++) * $n_entries; $collection = $feed->get_entries($offset_start, $n_entries); $entries = $collection->get_entries(); - if (sizeof($entries) == 0) //no more + if (sizeof($entries) == 0) //no more break; } $feed_entry = array_shift($entries); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Setup/InstallerTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Setup/InstallerTest.php index c7488874e7..12c6514c19 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Setup/InstallerTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Setup/InstallerTest.php @@ -10,17 +10,17 @@ class ControllerInstallerTest extends \PhraseanetWebTestCaseAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -31,7 +31,7 @@ class ControllerInstallerTest extends \PhraseanetWebTestCaseAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Setup.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Setup/UpgraderTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Setup/UpgraderTest.php index a36b821bd4..8e56d76a32 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Setup/UpgraderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Setup/UpgraderTest.php @@ -10,17 +10,17 @@ class ControllerUpgraderTest extends \PhraseanetWebTestCaseAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -31,7 +31,7 @@ class ControllerUpgraderTest extends \PhraseanetWebTestCaseAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Setup.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Utils/ConnectionTestTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Utils/ConnectionTestTest.php index eea5c29c79..8526c97be1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Utils/ConnectionTestTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Utils/ConnectionTestTest.php @@ -10,18 +10,18 @@ class ControllerConnectionTestTest extends \PhraseanetWebTestCaseAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -134,6 +134,6 @@ class ControllerConnectionTestTest extends \PhraseanetWebTestCaseAbstract $this->assertObjectHasAttribute('is_databox', $content); $this->assertFalse($content->database); } - + } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Utils/PathFileTestTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Utils/PathFileTestTest.php index 739470134e..589607cac8 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Utils/PathFileTestTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Utils/PathFileTestTest.php @@ -10,17 +10,17 @@ class ControllerPathFileTestTest extends \PhraseanetWebTestCaseAbstract { /** - * As controllers use WebTestCase, it requires a client + * As controllers use WebTestCase, it requires a client */ protected $client; /** * If the controller tests require some records, specify it her - * - * For example, this will loacd 2 records + * + * For example, this will loacd 2 records * (self::$record_1 and self::$record_2) : - * - * $need_records = 2; - * + * + * $need_records = 2; + * */ protected static $need_records = false; @@ -31,7 +31,7 @@ class ControllerPathFileTestTest extends \PhraseanetWebTestCaseAbstract { return require __DIR__ . '/../../../../../Alchemy/Phrasea/Application/Admin.php'; } - + public function setUp() { parent::setUp(); diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ApplicationTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ApplicationTest.php index fea3e19adc..fffbe4718d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ApplicationTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ApplicationTest.php @@ -25,7 +25,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract /** * - * @var \Alchemy\Phrasea\Core\Configuration\Application + * @var \Alchemy\Phrasea\Core\Configuration\Application */ public function setUp() { @@ -41,7 +41,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract public function testGetConfigurationFile() { $app = new Application(); - + try { $this->assertInstanceOf('SplFileObject', $app->getConfigurationFile()); @@ -61,7 +61,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract public function testIsExtended() { $app = new Application(); - + $envs = array(Application::KEYWORD_ENV => 'dev'); $this->assertEquals('dev', $app->getSelectedEnv($envs)); $envs = array('blabla' => 'blabla'); diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php index 4e22472051..e880d7ea17 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php @@ -162,8 +162,8 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract // } // catch (\Exception $e) // { -// +// // } // } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/HandlerTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/HandlerTest.php index 40a968cd39..95a93098de 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/HandlerTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/HandlerTest.php @@ -165,8 +165,8 @@ class handlerTest extends \PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ParserTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ParserTest.php index e8c8cb32fd..4a11df00c3 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ParserTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ParserTest.php @@ -46,7 +46,7 @@ class parserTest extends \PhraseanetPHPUnitAbstract } catch (Exception $e) { - + } } @@ -64,8 +64,8 @@ class parserTest extends \PhraseanetPHPUnitAbstract } catch (Exception $e) { - + } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/config.yml b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/config.yml index 29924ae235..ebc0e78299 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/config.yml +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/config.yml @@ -29,7 +29,7 @@ test: template_engine: twig_debug orm: doctrine_test cache: array_cache - + no_debug: phraseanet: servername: 'http://dev.phrasea.net/' @@ -40,7 +40,7 @@ no_debug: template_engine: twig_debug orm: doctrine_test cache: array_cache - + no_maintenance: phraseanet: servername: 'http://dev.phrasea.net/' @@ -51,7 +51,7 @@ no_maintenance: template_engine: twig_debug orm: doctrine_test cache: array_cache - + no_display_errors: phraseanet: servername: 'http://dev.phrasea.net/' @@ -62,7 +62,7 @@ no_display_errors: template_engine: twig_debug orm: doctrine_test cache: array_cache - + missing_phraseanet: ##phraseanet: ##servername: 'http://dev.phrasea.net/' @@ -72,4 +72,4 @@ missing_phraseanet: ##database: main_connexion template_engine: twig_debug orm: doctrine_test - cache: array_cache \ No newline at end of file + cache: array_cache diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/services.yml b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/services.yml index 124e678ded..d65cfbdd3a 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/services.yml +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/confTestFiles/services.yml @@ -5,7 +5,7 @@ twig: charset: utf-8 strict_variables: true optimizer: true - + twig_debug: type: twig options: @@ -14,7 +14,7 @@ twig_debug: strict_variables: true autoescape: true optimizer: true - + doctrine_dev: type: doctrine options: @@ -26,7 +26,7 @@ doctrine_dev: result: array_cache metadata: array_cache log: query_logger - + doctrine_test: type: doctrine options: @@ -38,7 +38,7 @@ doctrine_test: result: array_cache metadata: array_cache log: query_logger - + doctrine_prod: type: doctrine options: @@ -50,30 +50,30 @@ doctrine_prod: result: apc_cache metadata: apc_cache log: query_logger - - + + query_logger: - type: monolog + type: monolog options: output: json channel: query-logger max_day: 2 filename: doctrine-query.log - + sql_logger: type: normal - + array_cache: type: array - + memcache_cache: type: memcache options: host: localhost port: 11211 - + apc_cache: type: apc - + xcache_cache: - type: xcache \ No newline at end of file + type: xcache diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ApcCacheTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ApcCacheTest.php index 550b445772..cf8f2c588a 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ApcCacheTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ApcCacheTest.php @@ -53,7 +53,7 @@ class ApcCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } } @@ -71,7 +71,7 @@ class ApcCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -84,4 +84,4 @@ class ApcCacheTest extends PhraseanetPHPUnitAbstract $this->assertEquals("apc", $cache->getType()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ArrayCacheTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ArrayCacheTest.php index 11af9074d1..f0e574d5c5 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ArrayCacheTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/ArrayCacheTest.php @@ -56,7 +56,7 @@ class ArrayCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -69,4 +69,4 @@ class ArrayCacheTest extends PhraseanetPHPUnitAbstract $this->assertEquals("array", $cache->getType()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/MemcacheCacheTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/MemcacheCacheTest.php index 757b11e146..40382543a4 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/MemcacheCacheTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/MemcacheCacheTest.php @@ -53,7 +53,7 @@ class MemcacheCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } } @@ -71,7 +71,7 @@ class MemcacheCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -108,4 +108,4 @@ class MemcacheCacheTest extends PhraseanetPHPUnitAbstract $this->assertEquals(\Alchemy\Phrasea\Core\Service\Cache\MemcacheCache::DEFAULT_PORT, $cache->getPort()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/XcacheCacheTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/XcacheCacheTest.php index 5fa3cddcb2..6274a3f370 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/XcacheCacheTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Cache/XcacheCacheTest.php @@ -53,7 +53,7 @@ class XcacheCacheTest extends PhraseanetPHPUnitAbstract } catch(\Exception $e) { - + } } } @@ -71,7 +71,7 @@ class XcacheCacheTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -84,4 +84,4 @@ class XcacheCacheTest extends PhraseanetPHPUnitAbstract $this->assertEquals("xcache", $cache->getType()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/MonologTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/MonologTest.php index 3a86690131..16e3f1f130 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/MonologTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/MonologTest.php @@ -67,8 +67,8 @@ class DoctrineMonologTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/PhpechoTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/PhpechoTest.php index 4cda299805..0a928c6681 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/PhpechoTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/Doctrine/PhpechoTest.php @@ -46,4 +46,4 @@ class DoctrinePhpechoTest extends PhraseanetPHPUnitAbstract $this->assertEquals("log", $log->getScope()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/MonologTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/MonologTest.php index 30b2bcf90d..9bfe4eeb54 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/MonologTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Log/MonologTest.php @@ -74,7 +74,7 @@ class MonologTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -90,7 +90,7 @@ class MonologTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -106,8 +106,8 @@ class MonologTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/Orm/DoctrineTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/Orm/DoctrineTest.php index 9a6b0d296e..bf0a38954c 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/Orm/DoctrineTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/Orm/DoctrineTest.php @@ -81,7 +81,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -103,7 +103,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract { $registry = $this->getMock('RegistryInterface'); $this->options["orm"]["cache"]["result"] = "unknowCache"; - + try { $doctrine = new \Alchemy\Phrasea\Core\Service\Orm\Doctrine( @@ -113,7 +113,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch(\Exception $e) { - + } } @@ -183,7 +183,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } } @@ -201,7 +201,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -218,7 +218,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -235,7 +235,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -288,7 +288,7 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract // } // catch (\Exception $e) // { -// +// // } // } // @@ -296,10 +296,10 @@ class DoctrineTest extends PhraseanetPHPUnitAbstract // { // switch ($className) // { -// case 'Alchemy\Phrasea\Core\Configuration': +// case 'Alchemy\Phrasea\Core\Configuration': // echo('yo');return 'ConfMock'; // break; -// default: +// default: // return $className; // break; // } diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Service/ServiceAbtractTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Service/ServiceAbtractTest.php index 1e6ca6ad19..758aa7c420 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Service/ServiceAbtractTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Service/ServiceAbtractTest.php @@ -22,7 +22,7 @@ class ServiceAbstractTest extends PhraseanetPHPUnitAbstract /** * - * @var \Alchemy\Phrasea\Core\Service\ServiceAbstract + * @var \Alchemy\Phrasea\Core\Service\ServiceAbstract */ protected $object; @@ -67,14 +67,14 @@ class ServiceAbstractTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } public function testGetDependency() { $dep = $this->object->getDependency('dependency'); - + $this->assertEquals('one_dependency', $dep); } @@ -82,4 +82,4 @@ class ServiceAbstractTest extends PhraseanetPHPUnitAbstract { $this->assertEmpty($this->object->getVersion()); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilderTest.php b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilderTest.php index b60affa39a..26d1b70102 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/AbstractBuilderTest.php @@ -37,7 +37,7 @@ class AbstractBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -58,7 +58,7 @@ class AbstractBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/CacheBuilderTest.php b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/CacheBuilderTest.php index c1cc778571..caa22c497c 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/CacheBuilderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/CacheBuilderTest.php @@ -33,7 +33,7 @@ class CacheBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -47,4 +47,4 @@ class CacheBuilderTest extends PhraseanetPHPUnitAbstract $this->assertInstanceOf("\Alchemy\Phrasea\Core\Service\ServiceAbstract", $service); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/LogBuilderTest.php b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/LogBuilderTest.php index 3f51c35699..342df367fb 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/LogBuilderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/LogBuilderTest.php @@ -33,7 +33,7 @@ class LogBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -61,4 +61,4 @@ class LogBuilderTest extends PhraseanetPHPUnitAbstract $this->assertInstanceOf("\Alchemy\Phrasea\Core\Service\ServiceAbstract", $service); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/OrmBuilderTest.php b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/OrmBuilderTest.php index 0b2d544b22..4bdccc2381 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/OrmBuilderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/OrmBuilderTest.php @@ -33,14 +33,14 @@ class OrmBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } public function testCreate() { $registry = $this->getMock("\RegistryInterface"); - + $configuration = new Symfony\Component\DependencyInjection\ParameterBag\ParameterBag( array("type" => "doctrine", "options" => array( "debug" => false @@ -61,4 +61,4 @@ class OrmBuilderTest extends PhraseanetPHPUnitAbstract $this->assertInstanceOf("\Alchemy\Phrasea\Core\Service\ServiceAbstract", $service); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/TemplateBuilderTest.php b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/TemplateBuilderTest.php index ed52b9218e..d4959b2ae6 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/TemplateBuilderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/ServiceBuilder/TemplateBuilderTest.php @@ -33,7 +33,7 @@ class TemplateBuilderTest extends PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -47,4 +47,4 @@ class TemplateBuilderTest extends PhraseanetPHPUnitAbstract $this->assertInstanceOf("\Alchemy\Phrasea\Core\Service\ServiceAbstract", $service); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Core/VersionTest.php b/lib/unitTest/Alchemy/Phrasea/Core/VersionTest.php index 4265ce872c..456cf6ae9d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/VersionTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/VersionTest.php @@ -27,10 +27,10 @@ class VersionTest extends \PhraseanetPHPUnitAbstract $this->assertTrue(is_string(Version::getNumber())); $this->assertRegExp('/[\d]{1}\.[\d]{1,2}\.[\d]{1,2}/', Version::getNumber()); } - + public function testGetName() { $this->assertTrue(is_string(Version::getName())); $this->assertTrue(strlen(Version::getName()) > 3); } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/CoreTest.php b/lib/unitTest/Alchemy/Phrasea/CoreTest.php index 4cfc4d59df..aff7ffa6dc 100644 --- a/lib/unitTest/Alchemy/Phrasea/CoreTest.php +++ b/lib/unitTest/Alchemy/Phrasea/CoreTest.php @@ -108,12 +108,12 @@ class CoreTest extends PhraseanetPHPUnitAbstract public function testNotInstalled() { - + if (!extension_loaded('test_helpers')) { $this->fail("test_helpers extension required"); } - + set_new_overload(array($this, 'newCallback')); $handler = new \Alchemy\Phrasea\Core\Configuration\Handler( @@ -147,4 +147,4 @@ class CoreTest extends PhraseanetPHPUnitAbstract } } -} \ No newline at end of file +} diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/BridgeTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/BridgeTest.php index 22d72df3a5..62e0146d19 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/BridgeTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/BridgeTest.php @@ -22,7 +22,7 @@ class HelperBridgeTest extends \PhraseanetPHPUnitAuthenticatedAbstract { parent::setUp(); } - + public function testFooBar() { // Remove the following lines when you implement this test. diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/EditTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/EditTest.php index 1e8c915882..2a5b332138 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/EditTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/EditTest.php @@ -24,7 +24,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testPropose_editing(). */ public function testPropose_editing() @@ -36,7 +36,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testHas_thesaurus(). */ public function testHas_thesaurus() @@ -48,7 +48,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_javascript_elements_ids(). */ public function testGet_javascript_elements_ids() @@ -60,7 +60,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_javascript_elements(). */ public function testGet_javascript_elements() @@ -72,7 +72,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_javascript_sugg_values(). */ public function testGet_javascript_sugg_values() @@ -84,7 +84,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_javascript_status(). */ public function testGet_javascript_status() @@ -96,7 +96,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_javascript_fields(). */ public function testGet_javascript_fields() @@ -108,7 +108,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_status(). */ public function testGet_status() @@ -120,7 +120,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_fields(). */ public function testGet_fields() @@ -132,7 +132,7 @@ class HelperEditTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testExecute(). */ public function testExecute() diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/FeedTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/FeedTest.php index 62fb297cf9..b30477df88 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/FeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/FeedTest.php @@ -22,7 +22,7 @@ class HelperFeedTest extends \PhraseanetPHPUnitAuthenticatedAbstract { parent::setUp(); } - + public function testFooBar() { // Remove the following lines when you implement this test. diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/HelperTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/HelperTest.php index bff7a43f8d..19b69c8b0b 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/HelperTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/HelperTest.php @@ -24,7 +24,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testIs_basket(). */ public function testIs_basket() @@ -36,7 +36,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_original_basket(). */ public function testGet_original_basket() @@ -48,7 +48,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testIs_single_grouping(). */ public function testIs_single_grouping() @@ -60,7 +60,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_grouping_head(). */ public function testGet_grouping_head() @@ -72,7 +72,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_elements(). */ public function testGet_elements() @@ -84,7 +84,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testHas_many_sbas(). */ public function testHas_many_sbas() @@ -96,7 +96,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testIs_possible(). */ public function testIs_possible() @@ -108,7 +108,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_not_actionable(). */ public function testGet_count_not_actionable() @@ -120,7 +120,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_actionable(). */ public function testGet_count_actionable() @@ -132,7 +132,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_actionable_groupings(). */ public function testGet_count_actionable_groupings() @@ -144,7 +144,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_element_received(). */ public function testGet_count_element_received() @@ -156,7 +156,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_sbas_id(). */ public function testGet_sbas_id() @@ -168,7 +168,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_serialize_list(). */ public function testGet_serialize_list() @@ -180,7 +180,7 @@ class HelperHelperTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGrep_records(). */ public function testGrep_records() diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/MoveCollectionTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/MoveCollectionTest.php index 002c1a7875..eefdac0c3a 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/MoveCollectionTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/MoveCollectionTest.php @@ -24,7 +24,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testAvailable_destination(). */ public function testAvailable_destination() @@ -36,7 +36,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testPropose(). */ public function testPropose() @@ -48,7 +48,7 @@ class HelperMoveCollectionTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testExecute(). */ public function testExecute() diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/PrinterTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/PrinterTest.php index 4de62c2084..8dd83fd111 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/PrinterTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/PrinterTest.php @@ -24,7 +24,7 @@ class HelperPrinterTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_preview(). */ public function testGet_count_preview() @@ -36,7 +36,7 @@ class HelperPrinterTest extends \PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_count_thumbnail(). */ public function testGet_count_thumbnail() diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/PushTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/PushTest.php index ea11d7e96f..00eafb77d1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/PushTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/PushTest.php @@ -25,7 +25,7 @@ class HelperPushTest extends \PhraseanetPHPUnitAuthenticatedAbstract /** - * + * * @todo Implement testSearch(). */ public function testSearch() diff --git a/lib/unitTest/Alchemy/Phrasea/Helper/Record/TooltipTest.php b/lib/unitTest/Alchemy/Phrasea/Helper/Record/TooltipTest.php index fc2e513282..1bf165132d 100644 --- a/lib/unitTest/Alchemy/Phrasea/Helper/Record/TooltipTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Helper/Record/TooltipTest.php @@ -22,7 +22,7 @@ class HelperTooltipTest extends \PhraseanetPHPUnitAuthenticatedAbstract { parent::setUp(); } - + public function testFooBar() { // Remove the following lines when you implement this test. diff --git a/lib/unitTest/Bridge/Bridge_AccountTest.php b/lib/unitTest/Bridge/Bridge_AccountTest.php index 12f981fa36..83de5d936f 100644 --- a/lib/unitTest/Bridge/Bridge_AccountTest.php +++ b/lib/unitTest/Bridge/Bridge_AccountTest.php @@ -56,7 +56,7 @@ class Bridge_AccountTest extends PhraseanetPHPUnitAuthenticatedAbstract } catch (Bridge_Exception_AccountNotFound $e) { - + } $this->api->delete(); diff --git a/lib/unitTest/Doctrine/Entities/BasketTest.php b/lib/unitTest/Doctrine/Entities/BasketTest.php index ef5c556062..02945673fe 100644 --- a/lib/unitTest/Doctrine/Entities/BasketTest.php +++ b/lib/unitTest/Doctrine/Entities/BasketTest.php @@ -152,7 +152,7 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGetValidation() { $this->assertNull($this->basket->getValidation()); - + $validationSession = new \Entities\ValidationSession(); $validationSession->setBasket($this->basket); @@ -165,13 +165,13 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract $expires->modify('+1 week'); $validationSession->setExpires($expires); - + $validationSession->setInitiator(self::$user); - + $this->em->persist($validationSession); - + $this->em->flush(); - + $this->em->refresh($this->basket); $this->assertInstanceOf('\Entities\ValidationSession', $this->basket->getValidation()); diff --git a/lib/unitTest/Doctrine/Repositories/BasketTest.php b/lib/unitTest/Doctrine/Repositories/BasketTest.php index e202b9ac98..8ac1bfde34 100644 --- a/lib/unitTest/Doctrine/Repositories/BasketTest.php +++ b/lib/unitTest/Doctrine/Repositories/BasketTest.php @@ -10,8 +10,8 @@ */ /** - * + * * @package * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com - */ \ No newline at end of file + */ diff --git a/lib/unitTest/api/v1/api_v1_adapterTest.php b/lib/unitTest/api/v1/api_v1_adapterTest.php index 77cba267a6..cf08fb43e6 100644 --- a/lib/unitTest/api/v1/api_v1_adapterTest.php +++ b/lib/unitTest/api/v1/api_v1_adapterTest.php @@ -263,9 +263,9 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $metadatas = array_shift($metadatas); $metadatas["value"] = "new_value"; - + $request = new Request(array("metadatas" => array($metadatas)), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json')); - + $result = $this->object->set_record_metadatas($request, self::$record_1->get_sbas_id(), self::$record_1->get_record_id()); $this->checkResponseField($result, "metadatas", PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT); @@ -377,10 +377,10 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $appbox = appbox::get_instance(); $session = $appbox->get_session(); $usr_id = $session->get_usr_id(); - + $em = self::$core->getEntityManager(); $repo = $em->getRepository('\Entities\Basket'); - + /* @var $repo \Repositories\BasketRepository */ $basket = $repo->findUserBasket($ssel_id, self::$core->getAuthenticatedUser()); @@ -394,16 +394,16 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $appbox = appbox::get_instance(); $usr_id = $appbox->get_session()->get_usr_id(); $user = User_Adapter::getInstance($usr_id, $appbox); - + $em = self::$core->getEntityManager(); - + $Basket = new Entities\Basket(); $Basket->setName('Delete test'); $Basket->setOwner($user); - + $em->persist($Basket); $em->flush(); - + $ssel_id = $Basket->getId(); $request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json')); @@ -413,7 +413,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $this->assertTrue(is_object(json_decode($result->format()))); $repo = $em->getRepository('\Entities\Basket'); - + try { $repo->findUserBasket($ssel_id, $user); @@ -429,7 +429,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract { $appbox = appbox::get_instance(); $usr_id = $appbox->get_session()->get_usr_id(); - + $basket = $this->insertOneBasket(); $request = new Request(array(), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json')); @@ -443,9 +443,9 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract { $appbox = appbox::get_instance(); $usr_id = $appbox->get_session()->get_usr_id(); - + $basket = $this->insertOneBasket(); - + $request = new Request(array(), array(), array('name' => 'PROUTO'), array(), array(), array('HTTP_Accept' => 'application/json')); $result = $this->object->set_basket_title($request, $basket->getId()); $this->assertEquals(200, $result->get_http_code()); @@ -453,9 +453,9 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $this->assertTrue(is_object(json_decode($result->format()))); $repository =self::$core->getEntityManager()->getRepository('\Entities\Basket'); - + $ret_bask = $repository->find($basket->getId()); - + $this->assertEquals('PROUTO', $ret_bask->getName()); } @@ -463,7 +463,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract { $appbox = appbox::get_instance(); $usr_id = $appbox->get_session()->get_usr_id(); - + $basket = $this->insertOneBasket(); $request = new Request(array(), array(), array('description' => 'une belle description'), array(), array(), array('HTTP_Accept' => 'application/json')); @@ -473,9 +473,9 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $this->assertTrue(is_object(json_decode($result->format()))); $repository =self::$core->getEntityManager()->getRepository('\Entities\Basket'); - + $ret_bask = $repository->find($basket->getId()); - + $this->assertEquals('une belle description', $ret_bask->getDescription()); } diff --git a/lib/unitTest/api/v1/api_v1_resultTest.php b/lib/unitTest/api/v1/api_v1_resultTest.php index 9d02ce20c3..c165dc2199 100644 --- a/lib/unitTest/api/v1/api_v1_resultTest.php +++ b/lib/unitTest/api/v1/api_v1_resultTest.php @@ -3,7 +3,7 @@ require_once __DIR__ . "/../../../../lib/vendor/oauth2/lib/OAuth2.inc"; require_once __DIR__ . '/../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc'; require_once __DIR__ . '/../../../../lib/vendor/symfony/src/Symfony/Component/Yaml/Parser.php'; - + use Symfony\Component\HttpFoundation\Request; /** diff --git a/lib/unitTest/databox/databox_fieldTest.php b/lib/unitTest/databox/databox_fieldTest.php index 10e07786a4..1a168ad51c 100644 --- a/lib/unitTest/databox/databox_fieldTest.php +++ b/lib/unitTest/databox/databox_fieldTest.php @@ -26,12 +26,12 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract { $this->databox = self::$record_1->get_databox(); $this->name = 'Field Test'; - + $this->object = $this->databox->get_meta_structure()->get_element_by_name($this->name); - + if(!$this->object instanceof databox_field) $this->object = databox_field::create($this->databox, $this->name); - + $this->id = $this->object->get_id(); } diff --git a/lib/unitTest/databox/databox_statusTest.php b/lib/unitTest/databox/databox_statusTest.php index 4d5e631080..57c62f164f 100644 --- a/lib/unitTest/databox/databox_statusTest.php +++ b/lib/unitTest/databox/databox_statusTest.php @@ -153,13 +153,13 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract public function testDec2bin() { $this->assertEquals('1010', databox_status::dec2bin('10')); - + try { } catch(Exception $e) { - + } } @@ -167,7 +167,7 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract { $this->assertEquals('10100001', databox_status::hex2bin('0x0A1')); $this->assertEquals('10100001', databox_status::hex2bin('0A1')); - + try { databox_status::hex2bin('G1'); @@ -175,7 +175,7 @@ class databox_statusTest extends PhraseanetPHPUnitAbstract } catch(Exception $e) { - + } } diff --git a/lib/unitTest/record/adapterTest.php b/lib/unitTest/record/adapterTest.php index f3cb1ce1fb..d70067bbc6 100644 --- a/lib/unitTest/record/adapterTest.php +++ b/lib/unitTest/record/adapterTest.php @@ -88,7 +88,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract } catch (Exception $e) { - + } $old_type = self::$record_1->get_type(); self::$record_1->set_type('video'); @@ -165,7 +165,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGenerate_subdefs() { - + } public function testGet_sha256() @@ -305,20 +305,20 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $meta_structure_el = self::$collection->get_databox()->get_meta_structure()->get_elements(); $current_caption = self::$record_1->get_caption(); - + $metadatas = array(); - + foreach ($meta_structure_el as $meta_el) { $current_fields = $current_caption->get_fields(array($meta_el->get_name())); - + $field = null; - + if (count($current_fields) > 0) { $field = array_pop($current_fields); } - + if($meta_el->is_multi()) { if($field) @@ -332,7 +332,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract ); } } - + $metadatas[] = array( 'meta_struct_id' => $meta_el->get_id() , 'meta_id' => null @@ -357,12 +357,12 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract else { $meta_id = null; - + if($field) { $meta_id = array_pop($field->get_values())->getId(); } - + $metadatas[] = array( 'meta_struct_id' => $meta_el->get_id() , 'meta_id' => $meta_id @@ -393,7 +393,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract { $initial_values[] = $value->getValue(); } - + $this->assertEquals($multi_imploded, implode(' ' . $meta_el->get_separator() . ' ', $initial_values)); $this->assertEquals($multi_imploded, $field->get_serialized_values()); } diff --git a/lib/unitTest/report/dashboardTest.php b/lib/unitTest/report/dashboardTest.php index 5e53ca90a4..b90949669b 100644 --- a/lib/unitTest/report/dashboardTest.php +++ b/lib/unitTest/report/dashboardTest.php @@ -100,7 +100,7 @@ class dashboardTest extends PhraseanetPHPUnitAbstract { if ($key == 'activity_added') { - + } $this->assertLessThanOrEqual($nbDay, count($dash)); } @@ -119,7 +119,7 @@ class dashboardTest extends PhraseanetPHPUnitAbstract } catch (Exception $e) { - + } } diff --git a/lib/unitTest/searchEngine_optionsTest.php b/lib/unitTest/searchEngine_optionsTest.php index 89a7a53d76..bfeb307a14 100644 --- a/lib/unitTest/searchEngine_optionsTest.php +++ b/lib/unitTest/searchEngine_optionsTest.php @@ -29,11 +29,11 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract */ public function tearDown() { - + } /** - * + * */ public function testSet_locale() { @@ -43,7 +43,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_locale(). */ public function testGet_locale() @@ -54,7 +54,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_sort(). */ public function testSet_sort() @@ -70,7 +70,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_sortby(). */ public function testGet_sortby() @@ -83,7 +83,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_sortord(). */ public function testGet_sortord() @@ -96,7 +96,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_use_stemming(). */ public function testSet_use_stemming() @@ -110,7 +110,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_use_stemming(). */ public function testGet_use_stemming() @@ -124,7 +124,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_search_type(). */ public function testSet_search_type() @@ -141,7 +141,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_search_type(). */ public function testGet_search_type() @@ -158,7 +158,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_bases(). */ public function testSet_bases() @@ -169,7 +169,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_bases(). */ public function testGet_bases() @@ -180,7 +180,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_fields(). */ public function testSet_fields() @@ -192,7 +192,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_fields(). */ public function testGet_fields() @@ -204,7 +204,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_status(). */ public function testSet_status() @@ -216,7 +216,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_status(). */ public function testGet_status() @@ -228,7 +228,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_record_type(). */ public function testSet_record_type() @@ -240,7 +240,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_record_type(). */ public function testGet_record_type() @@ -252,7 +252,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_min_date(). */ public function testSet_min_date() @@ -264,7 +264,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_min_date(). */ public function testGet_min_date() @@ -276,7 +276,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_max_date(). */ public function testSet_max_date() @@ -288,7 +288,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_max_date(). */ public function testGet_max_date() @@ -300,7 +300,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSet_date_fields(). */ public function testSet_date_fields() @@ -312,7 +312,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testGet_date_fields(). */ public function testGet_date_fields() @@ -324,7 +324,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testSerialize(). */ public function testSerialize() @@ -344,7 +344,7 @@ class searchEngine_optionsTest extends PhraseanetPHPUnitAuthenticatedAbstract } /** - * + * * @todo Implement testUnserialize(). */ public function testUnserialize() diff --git a/lib/unitTest/userTest.php b/lib/unitTest/userTest.php index 3231c61fe8..1f0abe4e01 100644 --- a/lib/unitTest/userTest.php +++ b/lib/unitTest/userTest.php @@ -23,8 +23,8 @@ require_once __DIR__ . '/PhraseanetPHPUnitAbstract.class.inc'; class userTest extends PhraseanetPHPUnitAbstract { - - + + public function testMail() { $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); @@ -32,10 +32,10 @@ class userTest extends PhraseanetPHPUnitAbstract { $appbox = appbox::get_instance(); - self::$user->set_email(null); + self::$user->set_email(null); $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); - self::$user->set_email(''); + self::$user->set_email(''); $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); self::$user->set_email('noone@example.com'); $this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noone@example.com')); @@ -46,14 +46,14 @@ class userTest extends PhraseanetPHPUnitAbstract } try { - + self::$user->set_email('noonealt1@example.com'); $this->fail('A user already got this address'); } catch(Exception $e) { - + } $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); } -} \ No newline at end of file +} diff --git a/templates/web/admin/databox/doc_structure.twig b/templates/web/admin/databox/doc_structure.twig index ce13f0d34b..7782b83db1 100644 --- a/templates/web/admin/databox/doc_structure.twig +++ b/templates/web/admin/databox/doc_structure.twig @@ -319,7 +319,7 @@ - + - + diff --git a/templates/web/admin/editusers.twig b/templates/web/admin/editusers.twig index 37cda2aed5..af17fbfc4a 100644 --- a/templates/web/admin/editusers.twig +++ b/templates/web/admin/editusers.twig @@ -124,7 +124,7 @@ {% if main_user is not empty %} - + {% if main_user.is_special is not empty %} {% if main_user.get_login() == 'invite' %} {% trans 'Reglages:: reglages d acces guest' %} @@ -199,7 +199,7 @@ {% endif %} - + {{rights['sbas_id']|sbas_name}} @@ -556,7 +556,7 @@ {% endif %}
- + {% trans 'boutton::retour' %}
diff --git a/templates/web/admin/editusers_timelimit.twig b/templates/web/admin/editusers_timelimit.twig index f02348863f..8a9ce7f0f1 100644 --- a/templates/web/admin/editusers_timelimit.twig +++ b/templates/web/admin/editusers_timelimit.twig @@ -21,13 +21,13 @@ - {% trans 'De' %} + {% trans 'De' %} - {% trans 'A' %} + {% trans 'A' %} diff --git a/templates/web/admin/index.html.twig b/templates/web/admin/index.html.twig index e0e152796e..58ea26cefb 100644 --- a/templates/web/admin/index.html.twig +++ b/templates/web/admin/index.html.twig @@ -94,7 +94,7 @@ } }) }; - + function activeTree(click) { $('#FNDR').treeview({ @@ -142,7 +142,7 @@ activeTree(true); } ); - + function refreshBaskets() { return; diff --git a/templates/web/admin/tree.html.twig b/templates/web/admin/tree.html.twig index 34ac09b66a..924da30e3e 100644 --- a/templates/web/admin/tree.html.twig +++ b/templates/web/admin/tree.html.twig @@ -32,7 +32,7 @@ {% endif %}
  • - + {% trans 'admin::utilisateurs: utilisateurs connectes' %} @@ -40,13 +40,13 @@ {% if user.ACL().has_right('manageusers') %}
  • - + {% trans 'admin::utilisateurs: utilisateurs' %}
  • - + {% trans 'admin::utilisateurs: demandes en cours' %} @@ -64,7 +64,7 @@ {% if user.ACL().has_right('taskmanager') %}
  • - + {% trans 'admin::utilisateurs: gestionnaire de taches' %} @@ -73,7 +73,7 @@
  • \ No newline at end of file + diff --git a/templates/web/common/menubar.twig b/templates/web/common/menubar.twig index d825b55d38..ea020127eb 100644 --- a/templates/web/common/menubar.twig +++ b/templates/web/common/menubar.twig @@ -32,7 +32,7 @@ {% endif %} {% endif %}
  • - + {% if browser.isNewGeneration and registry.get('GV_thesaurus') == true and user.ACL.has_access_to_module('thesaurus') %}
  • @@ -42,8 +42,8 @@
  • {% endif %} - - + + {# MODULE #} {% if user.ACL.has_access_to_module('admin') %}
  • @@ -104,20 +104,20 @@
  • {% endif %} - + {% endif %}
      - + {% if module == "client" or module == "prod" %}
    1. {% trans 'Notifications' %} - +
      {% if events.get_unread_notifications_number > 0 %} @@ -191,4 +191,4 @@ \ No newline at end of file +
      diff --git a/templates/web/common/technical_datas.twig b/templates/web/common/technical_datas.twig index e0a049b1a6..e4be582d65 100644 --- a/templates/web/common/technical_datas.twig +++ b/templates/web/common/technical_datas.twig @@ -18,7 +18,7 @@
      {% endif %} {% endif %} - + {% if record.get_original_name() %} {% trans 'Nom Original' %} : {{record.get_original_name() }} diff --git a/templates/web/prod/Baskets/Create.html.twig b/templates/web/prod/Baskets/Create.html.twig index a1f08aacbe..4895714cbd 100644 --- a/templates/web/prod/Baskets/Create.html.twig +++ b/templates/web/prod/Baskets/Create.html.twig @@ -2,19 +2,19 @@ - + - + - + - + - \ No newline at end of file + diff --git a/templates/web/prod/Baskets/Reorder.html.twig b/templates/web/prod/Baskets/Reorder.html.twig index bc64813e11..6510f2c5d2 100644 --- a/templates/web/prod/Baskets/Reorder.html.twig +++ b/templates/web/prod/Baskets/Reorder.html.twig @@ -23,12 +23,12 @@ - + \ No newline at end of file + diff --git a/templates/web/prod/Baskets/Update.html.twig b/templates/web/prod/Baskets/Update.html.twig index cbd06c9487..2f14122f00 100644 --- a/templates/web/prod/Baskets/Update.html.twig +++ b/templates/web/prod/Baskets/Update.html.twig @@ -47,7 +47,7 @@ } }); - + return false; }); diff --git a/templates/web/prod/Story/Create.html.twig b/templates/web/prod/Story/Create.html.twig index fac49fc3c7..136835535a 100644 --- a/templates/web/prod/Story/Create.html.twig +++ b/templates/web/prod/Story/Create.html.twig @@ -2,26 +2,26 @@ - + - + - + - + - + - \ No newline at end of file + diff --git a/templates/web/prod/Tooltip/Basket.html.twig b/templates/web/prod/Tooltip/Basket.html.twig index 7bf6aa06f8..574f7d55fb 100644 --- a/templates/web/prod/Tooltip/Basket.html.twig +++ b/templates/web/prod/Tooltip/Basket.html.twig @@ -24,4 +24,4 @@
    {% endif %} {% endfor %} - \ No newline at end of file + diff --git a/templates/web/prod/Tooltip/Story.html.twig b/templates/web/prod/Tooltip/Story.html.twig index f99af6c494..fa08e664e2 100644 --- a/templates/web/prod/Tooltip/Story.html.twig +++ b/templates/web/prod/Tooltip/Story.html.twig @@ -24,4 +24,4 @@ {% endif %} {% endfor %} - \ No newline at end of file + diff --git a/templates/web/prod/Tooltip/User.html.twig b/templates/web/prod/Tooltip/User.html.twig index 48216ce197..cb4c4ce32a 100644 --- a/templates/web/prod/Tooltip/User.html.twig +++ b/templates/web/prod/Tooltip/User.html.twig @@ -4,11 +4,11 @@

    {{ user.get_display_name() }}

    -
      +
      • {{ user.get_email() }}
      • {{ user.get_company() }}
      • {{ user.get_job() }}
      • {{ user.get_position() }}
    - \ No newline at end of file + diff --git a/templates/web/prod/WorkZone/Basket.html.twig b/templates/web/prod/WorkZone/Basket.html.twig index 33e59abddc..a2aef43bc7 100644 --- a/templates/web/prod/WorkZone/Basket.html.twig +++ b/templates/web/prod/WorkZone/Basket.html.twig @@ -60,7 +60,7 @@ {% set basket_scope = 'objects'%} {% import 'prod/WorkZone/Macros.twig' as Macros %} - + {% if basket.getValidation() and basket.getValidation().getInitiator() == core.getAuthenticatedUser() %} {{ Macros.display_validation(basket, ordre, user, session) }} {% else %} diff --git a/templates/web/prod/WorkZone/Browser/Basket.html.twig b/templates/web/prod/WorkZone/Browser/Basket.html.twig index c829da4b1d..672304be6c 100644 --- a/templates/web/prod/WorkZone/Browser/Basket.html.twig +++ b/templates/web/prod/WorkZone/Browser/Basket.html.twig @@ -4,7 +4,7 @@
    - + {% trans 'Back to basket list' %} @@ -29,9 +29,9 @@ - + {% set top = 0 %} - + {% if Basket.getPusher() %} {% set top = top + 40 %}
    @@ -45,7 +45,7 @@
    {% endif %} - + {% if Basket.getValidation() %} {% set top = top + 160 %}
    @@ -64,9 +64,9 @@
    {% endif %} - + {% set top = top + 40 %} - +
    {% set ElementsCount = Basket.getElements().count() %} @@ -79,14 +79,14 @@ {% endif %}
    - - + + {% set top = top + 40 %} - - + + {% import 'common/thumbnail.html' as thumbnail %} - - + +
    {% for BasketElement in Basket.getElements() %} @@ -106,4 +106,4 @@ {% endfor %}
    - \ No newline at end of file + diff --git a/templates/web/prod/WorkZone/Browser/Browser.html.twig b/templates/web/prod/WorkZone/Browser/Browser.html.twig index 1213ef3fad..31bb1f2b98 100644 --- a/templates/web/prod/WorkZone/Browser/Browser.html.twig +++ b/templates/web/prod/WorkZone/Browser/Browser.html.twig @@ -4,7 +4,7 @@
    - +

    {% trans 'See' %}

    • @@ -85,9 +85,9 @@
    \ No newline at end of file + diff --git a/templates/web/prod/WorkZone/Browser/Results.html.twig b/templates/web/prod/WorkZone/Browser/Results.html.twig index 203e8bf7ba..fc0b813e8e 100644 --- a/templates/web/prod/WorkZone/Browser/Results.html.twig +++ b/templates/web/prod/WorkZone/Browser/Results.html.twig @@ -19,7 +19,7 @@ {% endif %} - Page {{ Page }} / {{ MaxPage }} + Page {{ Page }} / {{ MaxPage }} {% if Page + 1 <= MaxPage %} @@ -63,7 +63,7 @@ {{ Basket.getName() }} - + {% if Basket.getPusher() %}

    {% set user_name = '' ~ Basket.getPusher().get_display_name() ~ '' %} @@ -72,8 +72,8 @@ {% endtrans %}

    {% endif %} - - + + {% if Basket.getValidation() %}

    {% set list_participants = '' %} @@ -87,7 +87,7 @@ {% endtrans %}

    {% endif %} - + @@ -118,7 +118,7 @@ {% endif %} - Page {{ Page }} / {{ MaxPage }} + Page {{ Page }} / {{ MaxPage }} {% if Page + 1 <= MaxPage %} @@ -128,4 +128,4 @@ - \ No newline at end of file + diff --git a/templates/web/prod/WorkZone/Macros.twig b/templates/web/prod/WorkZone/Macros.twig index d2c223cf4f..544de645ee 100644 --- a/templates/web/prod/WorkZone/Macros.twig +++ b/templates/web/prod/WorkZone/Macros.twig @@ -3,10 +3,10 @@
    {% endmacro %} - + {% macro display_basket(basket, user, session) %} {% for basket_element in basket.getElements() %} @@ -225,7 +225,7 @@ {% endfor %} {% endmacro %} - + {% macro display_validation(basket, ordre, user, session) %}
    @@ -273,4 +273,4 @@ {% endfor %} -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/templates/web/prod/WorkZone/Story.html.twig b/templates/web/prod/WorkZone/Story.html.twig index 91761c2a54..bf7fa7c0f2 100644 --- a/templates/web/prod/WorkZone/Story.html.twig +++ b/templates/web/prod/WorkZone/Story.html.twig @@ -52,7 +52,7 @@
    - {% trans 'Certaines donnees du panier ont change' %} + {% trans 'Certaines donnees du panier ont change' %} {% trans 'rafraichir' %} diff --git a/templates/web/prod/actions/Push.html.twig b/templates/web/prod/actions/Push.html.twig index a625ede15c..7175b33785 100644 --- a/templates/web/prod/actions/Push.html.twig +++ b/templates/web/prod/actions/Push.html.twig @@ -1,5 +1,5 @@
    -
    +
    @@ -26,17 +26,17 @@
    -
    -
    +
    + -
    +
    @@ -55,7 +55,7 @@ -
    +
    @@ -64,14 +64,14 @@
    \ No newline at end of file + diff --git a/templates/web/prod/actions/printer_default.html.twig b/templates/web/prod/actions/printer_default.html.twig index 3fd5ea83b2..1d07e012cc 100644 --- a/templates/web/prod/actions/printer_default.html.twig +++ b/templates/web/prod/actions/printer_default.html.twig @@ -1,4 +1,4 @@ - + {% if printer.get_count_actionable() > 0 %} diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 10f2f2023b..5677b52d17 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -78,7 +78,7 @@ -