diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 64696fdfac..e0c6cd8ed9 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -315,8 +315,8 @@ return call_user_func(function() return $app['response']($result); } ); - - + + $route = '/records/{databox_id}/{record_id}/caption/'; $app->get( $route, function($databox_id, $record_id) use ($app) diff --git a/lib/Alchemy/Phrasea/Application/Lightbox.php b/lib/Alchemy/Phrasea/Application/Lightbox.php index fd67182353..481fee06db 100644 --- a/lib/Alchemy/Phrasea/Application/Lightbox.php +++ b/lib/Alchemy/Phrasea/Application/Lightbox.php @@ -293,7 +293,7 @@ return call_user_func( $basket_collection = $repository->findActiveValidationAndBasketByUser( $app['Core']->getAuthenticatedUser() ); - + $basket = $repository->findUserBasket( $ssel_id , $app['Core']->getAuthenticatedUser() diff --git a/lib/Alchemy/Phrasea/Application/OAuth2.php b/lib/Alchemy/Phrasea/Application/OAuth2.php index 3744926402..78b423e05e 100644 --- a/lib/Alchemy/Phrasea/Application/OAuth2.php +++ b/lib/Alchemy/Phrasea/Application/OAuth2.php @@ -271,7 +271,7 @@ return call_user_func(function() */ $route = "/applications/dev/new"; $app->get($route, function() use ($app) - { + { $var = array("violations" => null, 'form' => null, 'request' => $app['request']); return $app['response']('api/auth/application_dev_new.twig', $var); diff --git a/lib/Alchemy/Phrasea/Application/Setup.php b/lib/Alchemy/Phrasea/Application/Setup.php index 6425c98c77..180615c736 100644 --- a/lib/Alchemy/Phrasea/Application/Setup.php +++ b/lib/Alchemy/Phrasea/Application/Setup.php @@ -67,8 +67,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/'); }); diff --git a/lib/Alchemy/Phrasea/Cache/ApcCache.php b/lib/Alchemy/Phrasea/Cache/ApcCache.php index 64bc65b742..59f4d643c0 100644 --- a/lib/Alchemy/Phrasea/Cache/ApcCache.php +++ b/lib/Alchemy/Phrasea/Cache/ApcCache.php @@ -57,4 +57,4 @@ class ApcCache extends DoctrineApc implements Cache return apc_clear_cache() && apc_clear_cache('user'); } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Cache/ArrayCache.php b/lib/Alchemy/Phrasea/Cache/ArrayCache.php index c5f45834ea..50e32f7577 100644 --- a/lib/Alchemy/Phrasea/Cache/ArrayCache.php +++ b/lib/Alchemy/Phrasea/Cache/ArrayCache.php @@ -40,6 +40,7 @@ class ArrayCache extends DoctrineArray implements Cache { throw new Exception(sprintf('Unable to find key %s', $id)); } + return $this->fetch($id); } @@ -60,4 +61,4 @@ class ArrayCache extends DoctrineArray implements Cache return true; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Cache/Cache.php b/lib/Alchemy/Phrasea/Cache/Cache.php index 810260a4f8..91e94382fd 100644 --- a/lib/Alchemy/Phrasea/Cache/Cache.php +++ b/lib/Alchemy/Phrasea/Cache/Cache.php @@ -32,4 +32,4 @@ interface Cache extends DoctrineCache public function deleteMulti(array $array_keys); -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php index 06d72e2233..fd28285334 100644 --- a/lib/Alchemy/Phrasea/Cache/Manager.php +++ b/lib/Alchemy/Phrasea/Cache/Manager.php @@ -88,7 +88,7 @@ class Manager if ($this->hasChange($cacheKey, $service_name)) { $driver->flush(); - + if ($write) { $this->registry[$cacheKey] = $service_name; diff --git a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php index c3de20998f..084e98bb0a 100644 --- a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php +++ b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php @@ -57,4 +57,4 @@ class MemcacheCache extends DoctrineMemcache implements Cache return $this->getMemcache()->flush(); } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Cache/XcacheCache.php b/lib/Alchemy/Phrasea/Cache/XcacheCache.php index dce9e3412f..907639727f 100644 --- a/lib/Alchemy/Phrasea/Cache/XcacheCache.php +++ b/lib/Alchemy/Phrasea/Cache/XcacheCache.php @@ -57,4 +57,4 @@ class XcacheCache extends DoctrineXcache implements Cache return xcache_clear_cache(XC_TYPE_VAR, 0); } -} \ 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 014066d9ac..294d841c95 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php @@ -412,22 +412,22 @@ class Basket implements ControllerProviderInterface $em->persist($basket_element); $basket->addBasketElement($basket_element); - + if(null !== $validationSession = $basket->getValidation()) { if(false !== $validationSession->isFinished()) { continue; } - + $participants = $validationSession->getParticipants(); - + foreach($participants as $participant) { $validationData = new \Entities\ValidationData(); $validationData->setParticipant($participant); $validationData->setBasketElement($basket_element); - + $em->persist($validationData); } } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php index 52c83931e2..52c937be1e 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php @@ -763,7 +763,7 @@ class Push implements ControllerProviderInterface { $query->havePositions($request->get('Position')); } - + $sort = $request->get('srt', 'usr_creationdate'); $ord = $request->get('ord', 'desc'); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php index f9fb355df8..8d7bd9b7a7 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php @@ -44,7 +44,7 @@ class Root implements ControllerProviderInterface $registry = $app['Core']->getRegistry(); $user = $app['Core']->getAuthenticatedUser(); $cssPath = $registry->get('GV_RootPath') . 'www/skins/prod/'; - + $css = array(); $cssfile = false; @@ -79,7 +79,7 @@ class Root implements ControllerProviderInterface $thjslist = ""; $queries_topics = ''; - + if ($registry->get('GV_client_render_topics') == 'popups') { $queries_topics = \queries::dropdown_topics(); @@ -90,7 +90,7 @@ class Root implements ControllerProviderInterface } $sbas = $bas2sbas = array(); - + foreach ($appbox->get_databoxes() as $databox) { $sbas_id = $databox->get_sbas_id(); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 1aa7099fcd..ae5d2c3ea3 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -110,7 +110,7 @@ class Story implements ControllerProviderInterface , 'meta_id' => null , 'value' => $value ); - + break; } @@ -334,7 +334,7 @@ class Story implements ControllerProviderInterface } catch (\Exception $e) { - + } $Serializer = $app['Core']['Serializer']; diff --git a/lib/Alchemy/Phrasea/Core.php b/lib/Alchemy/Phrasea/Core.php index 8277d5aad0..7316eb1148 100644 --- a/lib/Alchemy/Phrasea/Core.php +++ b/lib/Alchemy/Phrasea/Core.php @@ -279,7 +279,7 @@ class Core extends \Pimple { return \User_Adapter::getInstance($session->get_usr_id(), $appbox); } - + return null; } diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index e7d7704e01..f50910a33b 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -49,6 +49,7 @@ class Configuration { $specifications = new Configuration\ApplicationSpecification(); } + return new self($specifications, $environment); } diff --git a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php index abb8b97834..e37d97d6df 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php @@ -134,12 +134,14 @@ class ApplicationSpecification implements Specification $this->getConfigurationsFile(); $this->getConnexionsFile(); $this->getServicesFile(); + return true; } catch (\Exception $e) { } + return false; } diff --git a/lib/Alchemy/Phrasea/Core/Service/Exception/ServiceNotFound.php b/lib/Alchemy/Phrasea/Core/Service/Exception/ServiceNotFound.php index 986b51fdcc..237d734448 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Exception/ServiceNotFound.php +++ b/lib/Alchemy/Phrasea/Core/Service/Exception/ServiceNotFound.php @@ -19,4 +19,4 @@ namespace Alchemy\Phrasea\Core\Service\Exception; class ServiceNotFound extends \Exception { -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Core/Service/Log/FirePHP.php b/lib/Alchemy/Phrasea/Core/Service/Log/FirePHP.php index 819d6bdbec..071c819560 100644 --- a/lib/Alchemy/Phrasea/Core/Service/Log/FirePHP.php +++ b/lib/Alchemy/Phrasea/Core/Service/Log/FirePHP.php @@ -36,7 +36,7 @@ class FirePHP extends ServiceAbstract implements ServiceInterface $this->logger = new Logger('FirePHP'); $this->logger->pushHandler(new FirePHPHandler()); - + return $this; } @@ -60,4 +60,4 @@ class FirePHP extends ServiceAbstract implements ServiceInterface return array(); } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/Helper/Prod.php b/lib/Alchemy/Phrasea/Helper/Prod.php index 511438b2b4..be3cf5fce3 100644 --- a/lib/Alchemy/Phrasea/Helper/Prod.php +++ b/lib/Alchemy/Phrasea/Helper/Prod.php @@ -35,10 +35,10 @@ class Prod extends Helper $user = $this->getCore()->getAuthenticatedUser(); if(!$user instanceof \User_Adapter) - { + { return $search_datas; } - + $searchSet = $user->getPrefs('search'); foreach ($user->ACL()->get_granted_sbas() as $databox) diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php index ce4728dbad..cfc1450340 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php +++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php @@ -121,7 +121,7 @@ class UserProvider implements ControlProviderInterface public function getRessource($id) { $Core = \bootstrap::getCore(); - + return \User_Adapter::getInstance($id, \appbox::get_instance($Core)); } diff --git a/lib/Doctrine/Repositories/StoryWZRepository.php b/lib/Doctrine/Repositories/StoryWZRepository.php index 1e739a3844..8b1db19628 100644 --- a/lib/Doctrine/Repositories/StoryWZRepository.php +++ b/lib/Doctrine/Repositories/StoryWZRepository.php @@ -56,6 +56,7 @@ class StoryWZRepository extends EntityRepository { return 0; } + return ($a < $b) ? -1 : 1; }); diff --git a/lib/classes/API/OAuth2/Form/DevAppDesktop.class.php b/lib/classes/API/OAuth2/Form/DevAppDesktop.class.php index b710f758c0..175eea6e4b 100644 --- a/lib/classes/API/OAuth2/Form/DevAppDesktop.class.php +++ b/lib/classes/API/OAuth2/Form/DevAppDesktop.class.php @@ -53,12 +53,12 @@ class API_OAuth2_Form_DevAppDesktop /** * - * @var string + * @var string */ public $type; public $scheme_website; public $urlwebsite; - + /** * * @param Request $request @@ -116,7 +116,7 @@ class API_OAuth2_Form_DevAppDesktop /** * - * @return string + * @return string */ public function getType() { @@ -132,7 +132,7 @@ class API_OAuth2_Form_DevAppDesktop { return $this->urlwebsite; } - + public function getSchemeCallback() { return ''; @@ -152,7 +152,8 @@ class API_OAuth2_Form_DevAppDesktop $metadata->addPropertyConstraint('description', new Constraints\NotBlank($blank)); $metadata->addPropertyConstraint('urlwebsite', new Constraints\NotBlank($blank)); $metadata->addPropertyConstraint('urlwebsite', new Constraints\Url($url)); + return; } -} \ No newline at end of file +} diff --git a/lib/classes/API/OAuth2/Form/DevAppInternet.class.php b/lib/classes/API/OAuth2/Form/DevAppInternet.class.php index bfde92cdde..4e93dca0a3 100644 --- a/lib/classes/API/OAuth2/Form/DevAppInternet.class.php +++ b/lib/classes/API/OAuth2/Form/DevAppInternet.class.php @@ -50,10 +50,10 @@ class API_OAuth2_Form_DevAppInternet * @var string */ public $callback; - + public $scheme_website; public $scheme_callback; - + public $urlwebsite; public $urlcallback; @@ -71,10 +71,10 @@ class API_OAuth2_Form_DevAppInternet $this->scheme_website = $request->get('scheme-website', 'http://'); $this->scheme_callback = $request->get('scheme-callback', 'http://'); $this->type = API_OAuth2_Application::WEB_TYPE; - + $this->urlwebsite = $this->scheme_website.$this->website; $this->urlcallback = $this->scheme_callback.$this->callback; - + return $this; } @@ -116,7 +116,7 @@ class API_OAuth2_Form_DevAppInternet /** * - * @return string + * @return string */ public function getType() { @@ -159,6 +159,7 @@ class API_OAuth2_Form_DevAppInternet $metadata->addPropertyConstraint('urlwebsite', new Constraints\Url($url)); $metadata->addPropertyConstraint('urlcallback', new Constraints\NotBlank($blank)); $metadata->addPropertyConstraint('urlcallback', new Constraints\Url($url)); + return; } diff --git a/lib/classes/API/V1/adapter.class.php b/lib/classes/API/V1/adapter.class.php index 5391d08f8a..6cacd688c8 100644 --- a/lib/classes/API/V1/adapter.class.php +++ b/lib/classes/API/V1/adapter.class.php @@ -207,7 +207,7 @@ class API_V1_adapter extends API_V1_Abstract public function caption_records(Request $request, $databox_id, $record_id) { $result = new API_V1_result($request, $this); - + $record = $this->appbox->get_databox($databox_id)->get_record($record_id); $fields = $record->get_caption()->get_fields(); $ret = array(); @@ -220,9 +220,10 @@ class API_V1_adapter extends API_V1_Abstract ); } $result->set_datas($ret); + return $result; } - + /** * Get an API_V1_result containing the results of a records search * diff --git a/lib/classes/Bridge/Api/Dailymotion/Container.class.php b/lib/classes/Bridge/Api/Dailymotion/Container.class.php index 75cfda257c..d40265c2ec 100644 --- a/lib/classes/Bridge/Api/Dailymotion/Container.class.php +++ b/lib/classes/Bridge/Api/Dailymotion/Container.class.php @@ -130,17 +130,17 @@ class Bridge_Api_Dailymotion_Container implements Bridge_Api_ContainerInterface { return $this->url; } - + public function get_duration() { return ''; } - + public function get_category() { return ''; } - + public function is_private() { return null; diff --git a/lib/classes/Bridge/Api/Flickr.class.php b/lib/classes/Bridge/Api/Flickr.class.php index 9915ca8f7a..f99aa1fb25 100644 --- a/lib/classes/Bridge/Api/Flickr.class.php +++ b/lib/classes/Bridge/Api/Flickr.class.php @@ -377,6 +377,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf if (!$response->isOk()) { if ($response->err_code === 3) //Already exists in photoset + return; throw new Bridge_Exception_ApiConnectorRequestFailed(); } @@ -663,12 +664,15 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf { if (!$this->registry->get('GV_flickr_api')) + return false; if (trim($this->registry->get('GV_flickr_client_id')) === '') + return false; if (trim($this->registry->get('GV_flickr_client_secret')) === '') + return false; return true; diff --git a/lib/classes/Bridge/Api/Flickr/Container.class.php b/lib/classes/Bridge/Api/Flickr/Container.class.php index b11dcfb831..b542d58058 100644 --- a/lib/classes/Bridge/Api/Flickr/Container.class.php +++ b/lib/classes/Bridge/Api/Flickr/Container.class.php @@ -138,17 +138,17 @@ class Bridge_Api_Flickr_Container implements Bridge_Api_ContainerInterface return $this->type; } - + public function get_duration() { return ''; } - + public function get_category() { return ''; } - + public function is_private() { return null; diff --git a/lib/classes/Bridge/Api/Youtube/Container.class.php b/lib/classes/Bridge/Api/Youtube/Container.class.php index 28663f39e3..1775c17d9f 100644 --- a/lib/classes/Bridge/Api/Youtube/Container.class.php +++ b/lib/classes/Bridge/Api/Youtube/Container.class.php @@ -121,14 +121,14 @@ class Bridge_Api_Youtube_Container implements Bridge_Api_ContainerInterface { return ''; } - - + + public function get_category() { return ''; } - - + + public function is_private() { return null; diff --git a/lib/classes/appbox.class.php b/lib/classes/appbox.class.php index 2d68228088..7b10b21297 100644 --- a/lib/classes/appbox.class.php +++ b/lib/classes/appbox.class.php @@ -136,10 +136,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); @@ -191,10 +193,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); @@ -540,6 +544,7 @@ class appbox extends base public function get_databoxes() { if ($this->databoxes) + return $this->databoxes; $ret = array(); diff --git a/lib/classes/base.class.php b/lib/classes/base.class.php index cd2cb38946..f5d87a5270 100644 --- a/lib/classes/base.class.php +++ b/lib/classes/base.class.php @@ -79,6 +79,7 @@ abstract class base implements cache_cacheableInterface public function get_schema() { if ($this->schema) + return $this->schema; $this->load_schema(); @@ -167,6 +168,7 @@ abstract class base implements cache_cacheableInterface { $this->cache = $this->Core->getCache(); } + return $this->cache; } @@ -232,6 +234,7 @@ abstract class base implements cache_cacheableInterface { if ($this->version) + return $this->version; $version = '0.0.0'; @@ -260,8 +263,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; } @@ -399,6 +404,7 @@ abstract class base implements cache_cacheableInterface protected function load_schema() { if ($this->schema) + return $this; $structure = simplexml_load_file(__DIR__ . "/../../lib/conf.d/bases_structure.xml"); diff --git a/lib/classes/cache/databox.class.php b/lib/classes/cache/databox.class.php index 9d35fa1e0c..c23a06ad21 100644 --- a/lib/classes/cache/databox.class.php +++ b/lib/classes/cache/databox.class.php @@ -59,6 +59,7 @@ class cache_databox if ($date <= $last_update) { self::$refreshing = false; + return; } diff --git a/lib/classes/gatekeeper.class.php b/lib/classes/gatekeeper.class.php index b829168ced..b37a216e12 100644 --- a/lib/classes/gatekeeper.class.php +++ b/lib/classes/gatekeeper.class.php @@ -79,6 +79,7 @@ class gatekeeper $session = $appbox->get_session(); if (http_request::is_command_line()) + return; if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF'])) @@ -131,6 +132,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; @@ -139,6 +141,7 @@ class gatekeeper break; case 'admin': if ($this->_script_name === 'runscheduler.php') + return; phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']); break; @@ -158,6 +161,7 @@ class gatekeeper return; case 'setup': if ($appbox->upgradeavailable()) + return; else phrasea::redirect('/login/'); @@ -274,6 +278,7 @@ class gatekeeper $parm = $request->get_parms('LOG'); if (is_null($parm["LOG"])) + return $this; try diff --git a/lib/classes/module/console/fileEnsureDevSetting.class.php b/lib/classes/module/console/fileEnsureDevSetting.class.php index e3596c54a3..8583dd0707 100644 --- a/lib/classes/module/console/fileEnsureDevSetting.class.php +++ b/lib/classes/module/console/fileEnsureDevSetting.class.php @@ -306,6 +306,7 @@ class module_console_fileEnsureDevSetting extends Command $output->writeln(sprintf('Miss required keys %s', implode(', ', $required))); $this->errors++; } + return; } @@ -447,6 +448,7 @@ class module_console_fileEnsureDevSetting extends Command { $config = new \Doctrine\DBAL\Configuration(); $conn = \Doctrine\DBAL\DriverManager::getConnection($connexion->all(), $config); + return true; } catch (\Exception $e) diff --git a/lib/classes/module/console/fileEnsureProductionSetting.class.php b/lib/classes/module/console/fileEnsureProductionSetting.class.php index 66200366f3..b5e87c5f63 100644 --- a/lib/classes/module/console/fileEnsureProductionSetting.class.php +++ b/lib/classes/module/console/fileEnsureProductionSetting.class.php @@ -300,6 +300,7 @@ class module_console_fileEnsureProductionSetting extends Command $output->writeln(sprintf('Miss required keys %s', implode(', ', $required))); $this->errors++; } + return; } @@ -441,6 +442,7 @@ class module_console_fileEnsureProductionSetting extends Command { $config = new \Doctrine\DBAL\Configuration(); $conn = \Doctrine\DBAL\DriverManager::getConnection($connexion->all(), $config); + return true; } catch (\Exception $e) @@ -896,6 +898,7 @@ class module_console_fileEnsureProductionSetting extends Command { return false; } + return $server === $Service->getDriver()->isServer(); } diff --git a/lib/classes/module/report/activity.class.php b/lib/classes/module/report/activity.class.php index c81b080c82..ccfb27d58c 100644 --- a/lib/classes/module/report/activity.class.php +++ b/lib/classes/module/report/activity.class.php @@ -645,7 +645,7 @@ class module_report_activity extends module_report { unset($this->result[$i]); } - + if (isset($this->result[$i]['poiddoc']) && isset($this->result[$i]['poidprev'])) { $this->result[$i]['poiddoc'] = p4string::format_octets($this->result[$i]['poiddoc']); @@ -653,7 +653,7 @@ class module_report_activity extends module_report } } - + $i++; $this->result[$i]['nbprev'] = 0; @@ -692,7 +692,7 @@ class module_report_activity extends module_report $save_user = $user; } - + unset($this->result[$i]); $nb_row = $i + 1; $this->total = $nb_row; @@ -772,7 +772,7 @@ class module_report_activity extends module_report } catch (Exception $e) { - + } } elseif ($value == "size") diff --git a/lib/classes/patch/3602.class.php b/lib/classes/patch/3602.class.php index 619ab62a73..150b5d47b6 100644 --- a/lib/classes/patch/3602.class.php +++ b/lib/classes/patch/3602.class.php @@ -64,9 +64,9 @@ class patch_3602 implements patchInterface } catch(\PDOException $e) { - + } - + return true; } diff --git a/lib/classes/set/order.class.php b/lib/classes/set/order.class.php index c81e43e67a..9f0926010e 100644 --- a/lib/classes/set/order.class.php +++ b/lib/classes/set/order.class.php @@ -222,13 +222,13 @@ class set_order extends set_abstract $core = \bootstrap::getCore(); $em = $core->getEntityManager(); - + $Basket = null; /* @var $repository \Repositories\BasketRepository */ if($this->ssel_id) { $repository = $em->getRepository('\Entities\Basket'); - + try { $Basket = $repository->findUserBasket($this->ssel_id, $core->getAuthenticatedUser(), false); @@ -284,8 +284,8 @@ class set_order extends set_abstract $Basket->addBasketElement($BasketElement); $em->persist($BasketElement); - - + + $params = array( ':usr_id' => $session->get_usr_id() , ':order_id' => $this->id diff --git a/lib/classes/setup.class.php b/lib/classes/setup.class.php index 742941c4c6..097e6375f3 100644 --- a/lib/classes/setup.class.php +++ b/lib/classes/setup.class.php @@ -607,15 +607,15 @@ class setup if ($Core->getCache()->isServer()) { $stats = $Core->getCache()->getStats(); - + echo '
  • ' . sprintf(_('setup::Serveur actif sur %s'), $registry->get('GV_cache_server_host') . ':' . $registry->get('GV_cache_server_port')) . '
  • '; echo ""; - + foreach ($stats as $name => $stat) { echo ""; } - + echo "
    " . $name . " " . $stat . "
    "; } else @@ -806,7 +806,7 @@ class setup $appConf = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification(); $appConf->delete(); - + return; } diff --git a/lib/classes/sphinxrt.class.php b/lib/classes/sphinxrt.class.php index 28deccec5a..2a15d0313d 100644 --- a/lib/classes/sphinxrt.class.php +++ b/lib/classes/sphinxrt.class.php @@ -99,6 +99,7 @@ class sphinxrt $cl = new SphinxClient(); if ($cl->Status() === false) + return $this; $cl->SetServer($registry->get('GV_sphinx_host'), (int) $registry->get('GV_sphinx_port')); diff --git a/lib/conf.d/_GV_template.inc b/lib/conf.d/_GV_template.inc index bb69235ff5..f2e4a8a24c 100644 --- a/lib/conf.d/_GV_template.inc +++ b/lib/conf.d/_GV_template.inc @@ -35,6 +35,7 @@ $extractDateFields = function(\Alchemy\Phrasea\Core $Core) { $date_sort_fields[$date['fieldname']] = $date['fieldname']; } } + return $date_sort_fields; }; diff --git a/lib/phpunit.xml.dist b/lib/phpunit.xml.dist index 262c5f2fb4..5a5c136840 100644 --- a/lib/phpunit.xml.dist +++ b/lib/phpunit.xml.dist @@ -31,7 +31,7 @@ ../lib/unitTest/ - + ./vendor diff --git a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php index f133f64ce9..819c8cb94c 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/ApiYamlTest.php @@ -401,7 +401,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract $this->evaluateBadRequestRoute($route, array('GET')); $this->evaluateMethodNotAllowedRoute($route, array('POST', 'PUT', 'DELETE')); } - + public function testRecordsMetadatasRoute() { foreach (static::$databoxe_ids as $databox_id) @@ -1243,7 +1243,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract $this->assertTrue(is_string($meta["value"])); } } - + protected function evaluateRecordsMetadataResponse($content) { $this->assertArrayHasKey("metadatas", $content["response"]); diff --git a/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php b/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php index 25a88cdb50..4fb1570ab6 100644 --- a/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Application/LightboxTest.php @@ -312,7 +312,7 @@ class ApplicationLightboxTest extends PhraseanetWebTestCaseAuthenticatedAbstract $datas = json_decode($this->client->getResponse()->getContent()); $this->assertTrue(is_object($datas), 'asserting good json datas'); $this->assertTrue($datas->error); - + $validationBasket = $this->insertOneValidationBasket(); $crawler = $this->client->request('POST', '/ajax/SET_RELEASE/' . $validationBasket->getId() . '/'); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php index 73fd755b63..d0b5562041 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php @@ -461,45 +461,45 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(2, $basket->getElements()->count()); } - + public function testAddElementToValidationPost() { - + $em = self::$core->getEntityManager(); - + $datas = $em->getRepository('Entities\ValidationData')->findAll(); $countDatas = count($datas); - + $validationSession = new \Entities\ValidationSession(); - + $validationSession->setDescription('Une description au hasard'); $validationSession->setName('Un nom de validation'); $expires = new \DateTime(); $expires->modify('+1 week'); $validationSession->setExpires($expires); $validationSession->setInitiator(self::$user); - + $basket = new \Entities\Basket(); $basket->setName('test'); $basket->setDescription('description'); $basket->setOwner(self::$user); $basket->setValidation($validationSession); $validationSession->setBasket($basket); - - + + $validationParticipant = new \Entities\ValidationParticipant(); $validationParticipant->setSession($validationSession); $validationParticipant->setUser(self::$user_alt1); $validationSession->addValidationParticipant($validationParticipant); - + $em->persist($validationParticipant); $em->persist($basket); $em->persist($validationSession); - + $em->flush(); - + $route = sprintf('/baskets/%s/addElements/', $basket->getId()); - + $records = array( self::$record_1->get_serialize_key(), self::$record_2->get_serialize_key(), @@ -522,13 +522,13 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $basket = $em->getRepository('Entities\Basket')->find($basket->getId()); $this->assertEquals(2, $basket->getElements()->count()); - + $datas = $em->getRepository('Entities\ValidationData')->findAll(); - + $this->assertTrue($countDatas < count($datas), 'assert that '.count($datas).' > '.$countDatas ); } - + public function testAddElementPostJSON() { $basket = $this->insertOneBasket(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php index d11d0ab39f..bf454e6fb4 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php @@ -271,7 +271,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract } catch (Exception $e) { - + } try @@ -281,7 +281,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract } catch (Exception $e) { - + } } diff --git a/templates/mobile/api/auth/application_dev_new.twig b/templates/mobile/api/auth/application_dev_new.twig index 8fe89acd5d..5490f7092c 100644 --- a/templates/mobile/api/auth/application_dev_new.twig +++ b/templates/mobile/api/auth/application_dev_new.twig @@ -73,7 +73,7 @@ {% if app_type == "web" %} - + - {% endif %} - + {% endif %} + @@ -115,5 +115,5 @@ - - \ No newline at end of file + + diff --git a/templates/mobile/api/auth/native_app_access_token.twig b/templates/mobile/api/auth/native_app_access_token.twig index 33a0e108a6..0ba7bce308 100644 --- a/templates/mobile/api/auth/native_app_access_token.twig +++ b/templates/mobile/api/auth/native_app_access_token.twig @@ -1,8 +1,8 @@ - + - + <title> {% if error is defined %} {% trans 'Fail' %} {% else %} @@ -14,20 +14,20 @@ <!-- Mobile viewport optimized --> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <!-- styles --> - <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap.css" /> - <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap-responsive.css" /> - <link rel="stylesheet" type="text/css" href="/skins/oauth/default.css" /> + <!-- styles --> + <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap.css" /> + <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap-responsive.css" /> + <link rel="stylesheet" type="text/css" href="/skins/oauth/default.css" /> <!-- All JavaScript at the bottom, except this Modernizr build. Modernizr enables HTML5 elements & feature detects for optimal performance. --> <script type="text/javascript" src="/skins/html5/Boilerplate/js/modernizr-2.5.2.min.js"></script> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> - <!--[if lt IE 9]> - <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> - <![endif]--> - </head> + <!--[if lt IE 9]> + <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + </head> <body> <div id="page" class="container"> @@ -59,7 +59,7 @@ {% endtrans %} </p> <input type="text" class="input-large" name="access_token" value="{{token.access_token}}" size="{{token.access_token|length}}"/> - </div> + </div> {% else %} <div id="top-text-box"> <h4>{% trans %}Code d'accès{% endtrans %}</h4> @@ -94,5 +94,5 @@ <script type="text/javascript" src="/skins/html5/bootstrap/js/bootstrap-transition.js"></script> <script type="text/javascript" src="/skins/html5/bootstrap/js/bootstrap-typeahead.js"></script> - </body> -</html> \ No newline at end of file + </body> +</html> diff --git a/templates/web/api/auth/application_dev_new.twig b/templates/web/api/auth/application_dev_new.twig index 8fe89acd5d..5490f7092c 100644 --- a/templates/web/api/auth/application_dev_new.twig +++ b/templates/web/api/auth/application_dev_new.twig @@ -73,7 +73,7 @@ {% if app_type == "web" %} <tr class="callback" style="height:25px;"> <td><label for="callback">{% trans 'URL de callback' %} <br/></label></td> - <td class="url-td"> + <td class="url-td"> <select name="scheme-callback"> <option value="http://">http://</option> <option value="https://">https://</option> diff --git a/templates/web/api/auth/application_dev_show.twig b/templates/web/api/auth/application_dev_show.twig index 4cbd85df5d..b2d6d53388 100644 --- a/templates/web/api/auth/application_dev_show.twig +++ b/templates/web/api/auth/application_dev_show.twig @@ -27,10 +27,10 @@ <td>{% trans 'URL de callback' %}</td> {% if app.get_type == constant('API_OAuth2_Application::DESKTOP_TYPE') %} <td> - <span>{{app.get_redirect_uri}}</span> + <span>{{app.get_redirect_uri}}</span> </td> {% else %} - <td class="url_callback"><span class="url_callback_input">{{app.get_redirect_uri}}</span> + <td class="url_callback"><span class="url_callback_input">{{app.get_redirect_uri}}</span> <button type="button" class="save_callback" style="display:none;">save</button> <button type="button" class="modifier_callback" style="display:none;">modifier</button> </td> diff --git a/templates/web/api/auth/end_user_authorization.twig b/templates/web/api/auth/end_user_authorization.twig index 0c527aac45..eafb6a95c6 100644 --- a/templates/web/api/auth/end_user_authorization.twig +++ b/templates/web/api/auth/end_user_authorization.twig @@ -1,36 +1,36 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html> <head> <meta charset="utf-8" /> - <title>Phraseanet Authentication + Phraseanet Authentication - - - - - - + + + + + + - - + + - -
    + +
    - +

    {{home_title}}

    - + {% if not session.is_authenticated %} - {% else %} + {% else %} {% if user is not none %} {% set username = '' ~ user.get_display_name() ~ '' %}
    @@ -62,7 +62,7 @@ Hello {{username}} {% endtrans %}

    -
    +
    {% endif %} {% if auth.getClient() is not none %}
    @@ -95,8 +95,8 @@
    - {% endif %} - + {% endif %} +
    @@ -115,5 +115,5 @@ - - \ No newline at end of file + + diff --git a/templates/web/api/auth/native_app_access_token.twig b/templates/web/api/auth/native_app_access_token.twig index 2a8c5f149a..9b438febf4 100644 --- a/templates/web/api/auth/native_app_access_token.twig +++ b/templates/web/api/auth/native_app_access_token.twig @@ -1,8 +1,8 @@ - + - + <title> {% if error is defined %} {% trans 'Fail' %} {% else %} @@ -14,20 +14,20 @@ <!-- Mobile viewport optimized --> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <!-- styles --> - <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap.css" /> - <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap-responsive.css" /> - <link rel="stylesheet" type="text/css" href="/skins/oauth/default.css" /> + <!-- styles --> + <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap.css" /> + <link rel="stylesheet" type="text/css" href="/skins/html5/bootstrap/css/bootstrap-responsive.css" /> + <link rel="stylesheet" type="text/css" href="/skins/oauth/default.css" /> <!-- All JavaScript at the bottom, except this Modernizr build. Modernizr enables HTML5 elements & feature detects for optimal performance. --> <script type="text/javascript" src="/skins/html5/Boilerplate/js/modernizr-2.5.2.min.js"></script> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> - <!--[if lt IE 9]> - <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> - <![endif]--> - </head> + <!--[if lt IE 9]> + <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + </head> <body> <div id="page" class="container"> @@ -59,7 +59,7 @@ {% endtrans %} </p> <input type="text" class="input-xlarge" name="access_token" value="{{token.access_token}}" size="{{token.access_token|length}}"/> - </div> + </div> {% else %} <div id="top-text-box"> <h4>{% trans %}Code d'accès{% endtrans %}</h4> @@ -94,5 +94,5 @@ <script type="text/javascript" src="/skins/html5/bootstrap/js/bootstrap-transition.js"></script> <script type="text/javascript" src="/skins/html5/bootstrap/js/bootstrap-typeahead.js"></script> - </body> -</html> \ No newline at end of file + </body> +</html> diff --git a/templates/web/common/dialog_export.twig b/templates/web/common/dialog_export.twig index 2551ce016d..5440cdb9cf 100644 --- a/templates/web/common/dialog_export.twig +++ b/templates/web/common/dialog_export.twig @@ -492,7 +492,7 @@ count += parseInt($(count_el).val()); } }); - + {% set max_download = registry.get('GV_download_max', 120) %} {% set alert_too_big%} "{% trans %} You can not directly download more than {{max_download}} Mo ; time to package all documents is too long{% endtrans %}\n"+ diff --git a/templates/web/prod/Baskets/Reorder.html.twig b/templates/web/prod/Baskets/Reorder.html.twig index 383baf00dd..c9397fb82b 100644 --- a/templates/web/prod/Baskets/Reorder.html.twig +++ b/templates/web/prod/Baskets/Reorder.html.twig @@ -53,6 +53,7 @@ { var val = $.trim($('#auto_order').val()); if(val == '') + return; var sorter = {}; diff --git a/templates/web/prod/Story/Reorder.html.twig b/templates/web/prod/Story/Reorder.html.twig index af77f56b26..e5db3cf0e6 100644 --- a/templates/web/prod/Story/Reorder.html.twig +++ b/templates/web/prod/Story/Reorder.html.twig @@ -53,6 +53,7 @@ { var val = $.trim($('#auto_order').val()); if(val == '') + return; var sorter = {}; diff --git a/templates/web/prod/User/Add.html.twig b/templates/web/prod/User/Add.html.twig index aa31d40738..8b94aabc17 100644 --- a/templates/web/prod/User/Add.html.twig +++ b/templates/web/prod/User/Add.html.twig @@ -62,9 +62,9 @@ </div> <script type="text/javascript"> $(document).ready(function(){ - + $("#QuickAddUser button").button(); - + $("#QuickAddUser form").bind('submit', function(){ diff --git a/templates/web/prod/WorkZone/Story.html.twig b/templates/web/prod/WorkZone/Story.html.twig index aebf458a7c..c8bb284056 100644 --- a/templates/web/prod/WorkZone/Story.html.twig +++ b/templates/web/prod/WorkZone/Story.html.twig @@ -32,7 +32,7 @@ <img src="/skins/icons/push16.png"/> </button> {% endif %} - + {% if user.ACL().has_right('push') %} <button class="ui-corner-all TOOL_feedback_btn basket_window" title="{% trans 'Feedback' %}"> <img src="/skins/icons/feedback16.png"/> diff --git a/templates/web/prod/actions/Feedback/List-Share.html.twig b/templates/web/prod/actions/Feedback/List-Share.html.twig index b72e5d9c91..55697b79e7 100644 --- a/templates/web/prod/actions/Feedback/List-Share.html.twig +++ b/templates/web/prod/actions/Feedback/List-Share.html.twig @@ -88,7 +88,7 @@ return false; }); - + $('.deleter', $container).bind('click', function(){ var owner = $(this).closest('.owner'); var usr_id = owner.find('input[name="usr_id"]').val(); @@ -133,7 +133,7 @@ } }); } - + function unShareWith(usr_id, callback) { @@ -155,6 +155,7 @@ humane.error(data.message); } $dialog.refresh(); + return; }, error: function(){ diff --git a/templates/web/prod/actions/Feedback/list.html.twig b/templates/web/prod/actions/Feedback/list.html.twig index edfbb19b34..a784a9ab2a 100644 --- a/templates/web/prod/actions/Feedback/list.html.twig +++ b/templates/web/prod/actions/Feedback/list.html.twig @@ -93,7 +93,7 @@ <div class="PNB" style="top:40px;height:120px;bottom:auto;"> <table style="table-layout:fixed;width:100%;"> <tr> - <td> + <td> <label>{% trans 'Activite' %}</label> </td> <td> @@ -102,10 +102,10 @@ <td > <label>{% trans 'Company' %}</label> </td> - <td > + <td > <label>{% trans 'Country' %}</label> </td> - <td > + <td > <label>{% trans 'Position' %}</label> </td> </tr> @@ -135,7 +135,7 @@ </select> </td> <td> - + <select size="5" multiple="multiple" name="Country[]" style="width:80%;"> <option value="">{% trans 'All' %}</option> {% for Code, Country in query.getRelatedCountries() %} @@ -144,7 +144,7 @@ </select> </td> <td > - + <select size="5" multiple="multiple" name="Position[]" style="width:80%;"> <option value="">{% trans 'All' %}</option> {% for Position in query.getRelatedPositions() %} diff --git a/templates/web/report/ajax_data_content.twig b/templates/web/report/ajax_data_content.twig index 5a0396dbac..966a2d75ae 100644 --- a/templates/web/report/ajax_data_content.twig +++ b/templates/web/report/ajax_data_content.twig @@ -20,7 +20,7 @@ $(".horizontal-scroller:visible").css("position", "fixed"); } });*/ - + </script> {% if is_infouser %} diff --git a/www/admin/collection.php b/www/admin/collection.php index 2896a7c152..24b89917ee 100644 --- a/www/admin/collection.php +++ b/www/admin/collection.php @@ -292,6 +292,7 @@ phrasea::headers(); }, success: function(data){ alert(data.message); + return; } }); diff --git a/www/admin/demand.php b/www/admin/demand.php index 854bad8f68..0d4153b76e 100644 --- a/www/admin/demand.php +++ b/www/admin/demand.php @@ -226,15 +226,15 @@ if (!is_null($templates) || !is_null($parm['deny']) || !is_null($parm['accept']) bodySize.y = $(window).height(); bodySize.x = $(window).width(); - + var $heightd = $('#tab_demandes').outerHeight(true); var maxSize = (bodySize.y - 120); - + if($heightd > maxSize) { $('#tab_demandes').height(maxSize); } - + } $(document).ready(function(){