Fix coding standards

This commit is contained in:
Romain Neutron
2012-01-26 12:32:37 +01:00
parent 692bb01b75
commit 06b8df26b1
312 changed files with 2017 additions and 1651 deletions

View File

@@ -54,4 +54,3 @@ test:
template_engine: twig_debug template_engine: twig_debug
orm: doctrine_test orm: doctrine_test

View File

@@ -123,6 +123,7 @@ return call_user_func(function()
} }
} }
} }
return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action); 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()); $app['token'] = \API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken());
if ($session->is_authenticated()) if ($session->is_authenticated())
return; return;
if ($oauth2_adapter->has_ses_id()) if ($oauth2_adapter->has_ses_id())
{ {

View File

@@ -77,6 +77,7 @@ return call_user_func(
$browser = \Browser::getInstance(); $browser = \Browser::getInstance();
if (!$browser->isMobile()) if (!$browser->isMobile())
return new Response(''); return new Response('');

View File

@@ -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/deactivated.twig', $params), 200);
} }
return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200); return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200);
} }
if ($request->getRequestFormat() == 'json') if ($request->getRequestFormat() == 'json')

View File

@@ -36,10 +36,13 @@ return call_user_func(function()
{ {
$browser = \Browser::getInstance(); $browser = \Browser::getInstance();
if ($browser->isMobile()) if ($browser->isMobile())
return $app->redirect("/login/?redirect=/lightbox"); return $app->redirect("/login/?redirect=/lightbox");
elseif ($browser->isNewGeneration()) elseif ($browser->isNewGeneration())
return $app->redirect("/login/?redirect=/prod"); return $app->redirect("/login/?redirect=/prod");
else else
return $app->redirect("/login/?redirect=/client"); return $app->redirect("/login/?redirect=/client");
}); });

View File

@@ -183,8 +183,10 @@ return call_user_func(function()
$app->get('/', function() use ($app) $app->get('/', function() use ($app)
{ {
if ($app['install'] === true) if ($app['install'] === true)
return $app->redirect('/setup/installer/'); return $app->redirect('/setup/installer/');
if ($app['upgrade'] === true) if ($app['upgrade'] === true)
return $app->redirect('/setup/upgrader/'); return $app->redirect('/setup/upgrader/');
}); });
@@ -197,6 +199,7 @@ return call_user_func(function()
$app->error(function($e) use ($app) $app->error(function($e) use ($app)
{ {
if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled) if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled)
return $app->redirect('/login'); return $app->redirect('/login');
return new Response( return new Response(

View File

@@ -183,6 +183,7 @@ class Description implements ControllerProviderInterface
return new Response($Core->getTwig()->render('admin/databox/doc_structure.twig', $params)); return new Response($Core->getTwig()->render('admin/databox/doc_structure.twig', $params));
}); });
return $controllers; return $controllers;
} }

View File

@@ -88,6 +88,7 @@ class Publications implements ControllerProviderInterface
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user)) 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')); return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it'));
$request = $app['request']; $request = $app['request'];
@@ -116,6 +117,7 @@ class Publications implements ControllerProviderInterface
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user)) if (!$feed->is_owner($user))
return new Response('ERROR:you are not allowed'); return new Response('ERROR:you are not allowed');
$request = $app["request"]; $request = $app["request"];
@@ -123,20 +125,25 @@ class Publications implements ControllerProviderInterface
$fileData = $request->files->get("Filedata"); $fileData = $request->files->get("Filedata");
if ($fileData['error'] !== 0) if ($fileData['error'] !== 0)
return new Response('ERROR:error while upload'); return new Response('ERROR:error while upload');
$file = new \system_file($fileData['tmp_name']); $file = new \system_file($fileData['tmp_name']);
if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif'))) if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif')))
return new Response('ERROR:bad filetype'); return new Response('ERROR:bad filetype');
if ($file->getSize() > 200000) if ($file->getSize() > 200000)
return new Response('ERROR:file too large'); return new Response('ERROR:file too large');
$datas = $file->get_technical_datas(); $datas = $file->get_technical_datas();
if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT])) if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT]))
return new Response('ERROR:file is not square'); return new Response('ERROR:file is not square');
if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT]) if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT])
return new Response('ERROR:file is not square'); return new Response('ERROR:file is not square');
$feed->set_icon($file); $feed->set_icon($file);

View File

@@ -106,6 +106,7 @@ class Root implements ControllerProviderInterface
)) ))
); );
}); });
return $controllers; return $controllers;
} }

View File

@@ -131,6 +131,7 @@ class Subdefs implements ControllerProviderInterface
return \phrasea::redirect('/admin/subdefs/' . $databox->get_sbas_id() . '/'); return \phrasea::redirect('/admin/subdefs/' . $databox->get_sbas_id() . '/');
}); });
return $controllers; return $controllers;
} }
} }

View File

@@ -62,6 +62,7 @@ class Printer implements ControllerProviderInterface
->log($record, \Session_Logger::EVENT_PRINT, $layout, ''); ->log($record, \Session_Logger::EVENT_PRINT, $layout, '');
} }
$PDF = new PDFExport($printer->get_elements(), $layout); $PDF = new PDFExport($printer->get_elements(), $layout);
return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf')); return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
} }
); );

View File

@@ -149,6 +149,7 @@ class Core extends \Pimple
$gatekeeper = \gatekeeper::getInstance(); $gatekeeper = \gatekeeper::getInstance();
$gatekeeper->check_directory(); $gatekeeper->check_directory();
} }
return; return;
} }

View File

@@ -98,6 +98,7 @@ class Configuration
{ {
$this->getConfiguration(); $this->getConfiguration();
} }
return $this->environment; return $this->environment;
} }
@@ -128,6 +129,7 @@ class Configuration
{ {
$debug = false; $debug = false;
} }
return $debug; return $debug;
} }
@@ -148,6 +150,7 @@ class Configuration
{ {
$maintained = false; $maintained = false;
} }
return $maintained; return $maintained;
} }
@@ -168,6 +171,7 @@ class Configuration
{ {
$displayErrors = false; $displayErrors = false;
} }
return $displayErrors; return $displayErrors;
} }
@@ -179,6 +183,7 @@ class Configuration
public function getPhraseanet() public function getPhraseanet()
{ {
$phraseanetConf = $this->getConfiguration()->get('phraseanet'); $phraseanetConf = $this->getConfiguration()->get('phraseanet');
return new ParameterBag($phraseanetConf); return new ParameterBag($phraseanetConf);
} }
@@ -278,6 +283,7 @@ class Configuration
public function all() public function all()
{ {
$allConf = $this->configurationHandler->getParser()->parse($this->getFile()); $allConf = $this->configurationHandler->getParser()->parse($this->getFile());
return $allConf; return $allConf;
} }

View File

@@ -44,6 +44,7 @@ class Application implements Specification
, $this->getConfigurationFileName() , $this->getConfigurationFileName()
, $this->getConfigurationFileExtension() , $this->getConfigurationFileExtension()
); );
return $path; return $path;
} }

View File

@@ -67,6 +67,7 @@ abstract class AbstractBuilder
$options = array(); $options = array();
} }
} }
return $options; return $options;
} }

View File

@@ -498,6 +498,7 @@ class Edit extends RecordHelper
} }
if (!is_array($request->get('mds'))) if (!is_array($request->get('mds')))
return $this; return $this;
$sbas_id = (int) $request->get('sbid'); $sbas_id = (int) $request->get('sbid');

View File

@@ -195,6 +195,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
if (!$this->is_single_grouping()) if (!$this->is_single_grouping())
throw new Exception('Cannot use ' . __METHOD__ . ' here'); throw new Exception('Cannot use ' . __METHOD__ . ' here');
foreach ($this->get_elements() as $record) foreach ($this->get_elements() as $record)
return $record; return $record;
} }
@@ -287,8 +288,10 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
public function get_serialize_list() public function get_serialize_list()
{ {
if ($this->is_single_grouping()) if ($this->is_single_grouping())
return $this->get_grouping_head()->get_serialize_key(); return $this->get_grouping_head()->get_serialize_key();
else else
return $this->selection->serialize_list(); return $this->selection->serialize_list();
} }

View File

@@ -64,6 +64,7 @@ class MoveCollection extends RecordHelper
$this->available_destinations = array(); $this->available_destinations = array();
if (!$this->is_possible) if (!$this->is_possible)
return $this; return $this;
$this->available_destinations = array_keys( $this->available_destinations = array_keys(

View File

@@ -82,6 +82,7 @@ class UserProvider implements ControlProviderInterface
try try
{ {
\User_Adapter::getInstance($id, appbox::get_instance()); \User_Adapter::getInstance($id, appbox::get_instance());
return true; return true;
} }
catch (\Exception $e) catch (\Exception $e)

View File

@@ -150,6 +150,7 @@ class UsrList
foreach ($this->getOwners() as $owner) foreach ($this->getOwners() as $owner)
{ {
if ($owner->getUser()->get_id() == $user->get_id()) if ($owner->getUser()->get_id() == $user->get_id())
return true; return true;
} }
@@ -166,6 +167,7 @@ class UsrList
foreach ($this->getOwners() as $owner) foreach ($this->getOwners() as $owner)
{ {
if ($owner->getUser()->get_id() == $user->get_id()) if ($owner->getUser()->get_id() == $user->get_id())
return $owner; return $owner;
} }

View File

@@ -158,6 +158,7 @@ class ValidationParticipant
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->usr_id = $user->get_id(); $this->usr_id = $user->get_id();
return $this; return $this;
} }

View File

@@ -321,6 +321,7 @@ class ValidationSession
public function setInitiator(\User_Adapter $user) public function setInitiator(\User_Adapter $user)
{ {
$this->initiator_id = $user->get_id(); $this->initiator_id = $user->get_id();
return; return;
} }

View File

@@ -39,114 +39,133 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setRecordId($recordId) public function setRecordId($recordId)
{ {
$this->__load(); $this->__load();
return parent::setRecordId($recordId); return parent::setRecordId($recordId);
} }
public function getRecordId() public function getRecordId()
{ {
$this->__load(); $this->__load();
return parent::getRecordId(); return parent::getRecordId();
} }
public function setSbasId($sbasId) public function setSbasId($sbasId)
{ {
$this->__load(); $this->__load();
return parent::setSbasId($sbasId); return parent::setSbasId($sbasId);
} }
public function getSbasId() public function getSbasId()
{ {
$this->__load(); $this->__load();
return parent::getSbasId(); return parent::getSbasId();
} }
public function setOrd($ord) public function setOrd($ord)
{ {
$this->__load(); $this->__load();
return parent::setOrd($ord); return parent::setOrd($ord);
} }
public function getOrd() public function getOrd()
{ {
$this->__load(); $this->__load();
return parent::getOrd(); return parent::getOrd();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setBasket(\Entities\Basket $basket) public function setBasket(\Entities\Basket $basket)
{ {
$this->__load(); $this->__load();
return parent::setBasket($basket); return parent::setBasket($basket);
} }
public function getBasket() public function getBasket()
{ {
$this->__load(); $this->__load();
return parent::getBasket(); return parent::getBasket();
} }
public function getRecord() public function getRecord()
{ {
$this->__load(); $this->__load();
return parent::getRecord(); return parent::getRecord();
} }
public function setRecord(\record_adapter $record) public function setRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::setRecord($record); return parent::setRecord($record);
} }
public function setLastInBasket() public function setLastInBasket()
{ {
$this->__load(); $this->__load();
return parent::setLastInBasket(); return parent::setLastInBasket();
} }
public function addValidationData(\Entities\ValidationData $validationDatas) public function addValidationData(\Entities\ValidationData $validationDatas)
{ {
$this->__load(); $this->__load();
return parent::addValidationData($validationDatas); return parent::addValidationData($validationDatas);
} }
public function getValidationDatas() public function getValidationDatas()
{ {
$this->__load(); $this->__load();
return parent::getValidationDatas(); return parent::getValidationDatas();
} }
public function getUserValidationDatas(\User_Adapter $user) public function getUserValidationDatas(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getUserValidationDatas($user); return parent::getUserValidationDatas($user);
} }

View File

@@ -39,162 +39,189 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setDescription($description) public function setDescription($description)
{ {
$this->__load(); $this->__load();
return parent::setDescription($description); return parent::setDescription($description);
} }
public function getDescription() public function getDescription()
{ {
$this->__load(); $this->__load();
return parent::getDescription(); return parent::getDescription();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setPusherId($pusherId) public function setPusherId($pusherId)
{ {
$this->__load(); $this->__load();
return parent::setPusherId($pusherId); return parent::setPusherId($pusherId);
} }
public function getPusherId() public function getPusherId()
{ {
$this->__load(); $this->__load();
return parent::getPusherId(); return parent::getPusherId();
} }
public function setArchived($archived) public function setArchived($archived)
{ {
$this->__load(); $this->__load();
return parent::setArchived($archived); return parent::setArchived($archived);
} }
public function getArchived() public function getArchived()
{ {
$this->__load(); $this->__load();
return parent::getArchived(); return parent::getArchived();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function addBasketElement(\Entities\BasketElement $elements) public function addBasketElement(\Entities\BasketElement $elements)
{ {
$this->__load(); $this->__load();
return parent::addBasketElement($elements); return parent::addBasketElement($elements);
} }
public function getElements() public function getElements()
{ {
$this->__load(); $this->__load();
return parent::getElements(); return parent::getElements();
} }
public function setPusher(\User_Adapter $user) public function setPusher(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setPusher($user); return parent::setPusher($user);
} }
public function getPusher() public function getPusher()
{ {
$this->__load(); $this->__load();
return parent::getPusher(); return parent::getPusher();
} }
public function setOwner(\User_Adapter $user) public function setOwner(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setOwner($user); return parent::setOwner($user);
} }
public function getOwner() public function getOwner()
{ {
$this->__load(); $this->__load();
return parent::getOwner(); return parent::getOwner();
} }
public function setValidation(\Entities\ValidationSession $validation) public function setValidation(\Entities\ValidationSession $validation)
{ {
$this->__load(); $this->__load();
return parent::setValidation($validation); return parent::setValidation($validation);
} }
public function getValidation() public function getValidation()
{ {
$this->__load(); $this->__load();
return parent::getValidation(); return parent::getValidation();
} }
public function setIsRead($isRead) public function setIsRead($isRead)
{ {
$this->__load(); $this->__load();
return parent::setIsRead($isRead); return parent::setIsRead($isRead);
} }
public function getIsRead() public function getIsRead()
{ {
$this->__load(); $this->__load();
return parent::getIsRead(); return parent::getIsRead();
} }
public function hasRecord(\record_adapter $record) public function hasRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::hasRecord($record); return parent::hasRecord($record);
} }
public function getSize() public function getSize()
{ {
$this->__load(); $this->__load();
return parent::getSize(); return parent::getSize();
} }

View File

@@ -39,78 +39,91 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setSbasId($sbasId) public function setSbasId($sbasId)
{ {
$this->__load(); $this->__load();
return parent::setSbasId($sbasId); return parent::setSbasId($sbasId);
} }
public function getSbasId() public function getSbasId()
{ {
$this->__load(); $this->__load();
return parent::getSbasId(); return parent::getSbasId();
} }
public function setRecordId($recordId) public function setRecordId($recordId)
{ {
$this->__load(); $this->__load();
return parent::setRecordId($recordId); return parent::setRecordId($recordId);
} }
public function getRecordId() public function getRecordId()
{ {
$this->__load(); $this->__load();
return parent::getRecordId(); return parent::getRecordId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function getRecord() public function getRecord()
{ {
$this->__load(); $this->__load();
return parent::getRecord(); return parent::getRecord();
} }
public function setRecord(\record_adapter $record) public function setRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::setRecord($record); return parent::setRecord($record);
} }

View File

@@ -39,66 +39,77 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setList(\Entities\UsrList $list) public function setList(\Entities\UsrList $list)
{ {
$this->__load(); $this->__load();
return parent::setList($list); return parent::setList($list);
} }
public function getList() public function getList()
{ {
$this->__load(); $this->__load();
return parent::getList(); return parent::getList();
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }

View File

@@ -39,78 +39,91 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setRole($role) public function setRole($role)
{ {
$this->__load(); $this->__load();
return parent::setRole($role); return parent::setRole($role);
} }
public function getRole() public function getRole()
{ {
$this->__load(); $this->__load();
return parent::getRole(); return parent::getRole();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setList(\Entities\UsrList $list) public function setList(\Entities\UsrList $list)
{ {
$this->__load(); $this->__load();
return parent::setList($list); return parent::setList($list);
} }
public function getList() public function getList()
{ {
$this->__load(); $this->__load();
return parent::getList(); return parent::getList();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }

View File

@@ -39,78 +39,91 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function addUsrListOwner(\Entities\UsrListOwner $owners) public function addUsrListOwner(\Entities\UsrListOwner $owners)
{ {
$this->__load(); $this->__load();
return parent::addUsrListOwner($owners); return parent::addUsrListOwner($owners);
} }
public function getOwners() public function getOwners()
{ {
$this->__load(); $this->__load();
return parent::getOwners(); return parent::getOwners();
} }
public function hasAccess(\User_Adapter $user) public function hasAccess(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::hasAccess($user); return parent::hasAccess($user);
} }
public function getOwner(\User_Adapter $user) public function getOwner(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getOwner($user); return parent::getOwner($user);
} }
public function addUsrListEntry(\Entities\UsrListEntry $entry) public function addUsrListEntry(\Entities\UsrListEntry $entry)
{ {
$this->__load(); $this->__load();
return parent::addUsrListEntry($entry); return parent::addUsrListEntry($entry);
} }
public function getEntries() public function getEntries()
{ {
$this->__load(); $this->__load();
return parent::getEntries(); return parent::getEntries();
} }

View File

@@ -39,66 +39,77 @@ class EntitiesValidationDataProxy extends \Entities\ValidationData implements \D
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setAgreement($agreement) public function setAgreement($agreement)
{ {
$this->__load(); $this->__load();
return parent::setAgreement($agreement); return parent::setAgreement($agreement);
} }
public function getAgreement() public function getAgreement()
{ {
$this->__load(); $this->__load();
return parent::getAgreement(); return parent::getAgreement();
} }
public function setNote($note) public function setNote($note)
{ {
$this->__load(); $this->__load();
return parent::setNote($note); return parent::setNote($note);
} }
public function getNote() public function getNote()
{ {
$this->__load(); $this->__load();
return parent::getNote(); return parent::getNote();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setParticipant(\Entities\ValidationParticipant $participant) public function setParticipant(\Entities\ValidationParticipant $participant)
{ {
$this->__load(); $this->__load();
return parent::setParticipant($participant); return parent::setParticipant($participant);
} }
public function getParticipant() public function getParticipant()
{ {
$this->__load(); $this->__load();
return parent::getParticipant(); return parent::getParticipant();
} }
public function setBasketElement(\Entities\BasketElement $basketElement) public function setBasketElement(\Entities\BasketElement $basketElement)
{ {
$this->__load(); $this->__load();
return parent::setBasketElement($basketElement); return parent::setBasketElement($basketElement);
} }
public function getBasketElement() public function getBasketElement()
{ {
$this->__load(); $this->__load();
return parent::getBasketElement(); return parent::getBasketElement();
} }

View File

@@ -39,120 +39,140 @@ class EntitiesValidationParticipantProxy extends \Entities\ValidationParticipant
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function addValidationData(\Entities\ValidationData $datas) public function addValidationData(\Entities\ValidationData $datas)
{ {
$this->__load(); $this->__load();
return parent::addValidationData($datas); return parent::addValidationData($datas);
} }
public function setSession(\Entities\ValidationSession $session) public function setSession(\Entities\ValidationSession $session)
{ {
$this->__load(); $this->__load();
return parent::setSession($session); return parent::setSession($session);
} }
public function getSession() public function getSession()
{ {
$this->__load(); $this->__load();
return parent::getSession(); return parent::getSession();
} }
public function setIsAware($isAware) public function setIsAware($isAware)
{ {
$this->__load(); $this->__load();
return parent::setIsAware($isAware); return parent::setIsAware($isAware);
} }
public function getIsAware() public function getIsAware()
{ {
$this->__load(); $this->__load();
return parent::getIsAware(); return parent::getIsAware();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function setReminded($reminded) public function setReminded($reminded)
{ {
$this->__load(); $this->__load();
return parent::setReminded($reminded); return parent::setReminded($reminded);
} }
public function getReminded() public function getReminded()
{ {
$this->__load(); $this->__load();
return parent::getReminded(); return parent::getReminded();
} }
public function getDatas() public function getDatas()
{ {
$this->__load(); $this->__load();
return parent::getDatas(); return parent::getDatas();
} }
public function setIsConfirmed($isConfirmed) public function setIsConfirmed($isConfirmed)
{ {
$this->__load(); $this->__load();
return parent::setIsConfirmed($isConfirmed); return parent::setIsConfirmed($isConfirmed);
} }
public function getIsConfirmed() public function getIsConfirmed()
{ {
$this->__load(); $this->__load();
return parent::getIsConfirmed(); return parent::getIsConfirmed();
} }
public function setCanAgree($canAgree) public function setCanAgree($canAgree)
{ {
$this->__load(); $this->__load();
return parent::setCanAgree($canAgree); return parent::setCanAgree($canAgree);
} }
public function getCanAgree() public function getCanAgree()
{ {
$this->__load(); $this->__load();
return parent::getCanAgree(); return parent::getCanAgree();
} }
public function setCanSeeOthers($canSeeOthers) public function setCanSeeOthers($canSeeOthers)
{ {
$this->__load(); $this->__load();
return parent::setCanSeeOthers($canSeeOthers); return parent::setCanSeeOthers($canSeeOthers);
} }
public function getCanSeeOthers() public function getCanSeeOthers()
{ {
$this->__load(); $this->__load();
return parent::getCanSeeOthers(); return parent::getCanSeeOthers();
} }
public function isReleasable() public function isReleasable()
{ {
$this->__load(); $this->__load();
return parent::isReleasable(); return parent::isReleasable();
} }

View File

@@ -39,162 +39,189 @@ class EntitiesValidationSessionProxy extends \Entities\ValidationSession impleme
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setDescription($description) public function setDescription($description)
{ {
$this->__load(); $this->__load();
return parent::setDescription($description); return parent::setDescription($description);
} }
public function getDescription() public function getDescription()
{ {
$this->__load(); $this->__load();
return parent::getDescription(); return parent::getDescription();
} }
public function setArchived($archived) public function setArchived($archived)
{ {
$this->__load(); $this->__load();
return parent::setArchived($archived); return parent::setArchived($archived);
} }
public function getArchived() public function getArchived()
{ {
$this->__load(); $this->__load();
return parent::getArchived(); return parent::getArchived();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setExpires($expires) public function setExpires($expires)
{ {
$this->__load(); $this->__load();
return parent::setExpires($expires); return parent::setExpires($expires);
} }
public function getExpires() public function getExpires()
{ {
$this->__load(); $this->__load();
return parent::getExpires(); return parent::getExpires();
} }
public function setReminded($reminded) public function setReminded($reminded)
{ {
$this->__load(); $this->__load();
return parent::setReminded($reminded); return parent::setReminded($reminded);
} }
public function getReminded() public function getReminded()
{ {
$this->__load(); $this->__load();
return parent::getReminded(); return parent::getReminded();
} }
public function setBasket(\Entities\Basket $basket) public function setBasket(\Entities\Basket $basket)
{ {
$this->__load(); $this->__load();
return parent::setBasket($basket); return parent::setBasket($basket);
} }
public function getBasket() public function getBasket()
{ {
$this->__load(); $this->__load();
return parent::getBasket(); return parent::getBasket();
} }
public function addValidationParticipant(\Entities\ValidationParticipant $participants) public function addValidationParticipant(\Entities\ValidationParticipant $participants)
{ {
$this->__load(); $this->__load();
return parent::addValidationParticipant($participants); return parent::addValidationParticipant($participants);
} }
public function getParticipants() public function getParticipants()
{ {
$this->__load(); $this->__load();
return parent::getParticipants(); return parent::getParticipants();
} }
public function getParticipant(\User_Adapter $user) public function getParticipant(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getParticipant($user); return parent::getParticipant($user);
} }
public function setInitiatorId($initiatorId) public function setInitiatorId($initiatorId)
{ {
$this->__load(); $this->__load();
return parent::setInitiatorId($initiatorId); return parent::setInitiatorId($initiatorId);
} }
public function getInitiatorId() public function getInitiatorId()
{ {
$this->__load(); $this->__load();
return parent::getInitiatorId(); return parent::getInitiatorId();
} }
public function isInitiator(\User_Adapter $user) public function isInitiator(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::isInitiator($user); return parent::isInitiator($user);
} }
public function setInitiator(\User_Adapter $user) public function setInitiator(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setInitiator($user); return parent::setInitiator($user);
} }
public function getInitiator() public function getInitiator()
{ {
$this->__load(); $this->__load();
return parent::getInitiator(); return parent::getInitiator();
} }
public function isFinished() public function isFinished()
{ {
$this->__load(); $this->__load();
return parent::isFinished(); return parent::isFinished();
} }
public function getValidationString(\User_Adapter $user) public function getValidationString(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getValidationString($user); return parent::getValidationString($user);
} }

View File

@@ -124,6 +124,7 @@ class ACL implements cache_cacheableInterface
$key = $record->get_serialize_key(); $key = $record->get_serialize_key();
if (array_key_exists($key, $this->_rights_records_document)) if (array_key_exists($key, $this->_rights_records_document))
return true; return true;
return false; return false;
@@ -191,6 +192,7 @@ class ACL implements cache_cacheableInterface
$key = $record->get_serialize_key(); $key = $record->get_serialize_key();
if (array_key_exists($key, $this->_rights_records_preview)) if (array_key_exists($key, $this->_rights_records_preview))
return true; return true;
return false; return false;
@@ -244,6 +246,7 @@ class ACL implements cache_cacheableInterface
public function apply_model(User_Interface $template_user, Array $base_ids) public function apply_model(User_Interface $template_user, Array $base_ids)
{ {
if (count($base_ids) == 0) if (count($base_ids) == 0)
return $this; return $this;
$sbas_ids = array(); $sbas_ids = array();
@@ -400,6 +403,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
if ($this->is_limited($base_id)) if ($this->is_limited($base_id))
@@ -487,6 +491,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
return $this->_rights_bas[$base_id]['restrict_dwnld']; return $this->_rights_bas[$base_id]['restrict_dwnld'];
@@ -503,6 +508,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
return (int) $this->_rights_bas[$base_id]['remain_dwnld']; return (int) $this->_rights_bas[$base_id]['remain_dwnld'];
@@ -520,6 +526,7 @@ class ACL implements cache_cacheableInterface
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
$this->_rights_bas[$base_id]['remain_dwnld'] = $this->_rights_bas[$base_id]['remain_dwnld'] =
@@ -559,12 +566,14 @@ class ACL implements cache_cacheableInterface
$this->load_rights_sbas(); $this->load_rights_sbas();
if (!isset($this->_rights_sbas[$sbas_id])) if (!isset($this->_rights_sbas[$sbas_id]))
return false; return false;
if (!isset($this->_rights_sbas[$sbas_id][$right])) if (!isset($this->_rights_sbas[$sbas_id][$right]))
throw new Exception('This right does not exists'); throw new Exception('This right does not exists');
if ($this->_rights_sbas[$sbas_id][$right] === true) if ($this->_rights_sbas[$sbas_id][$right] === true)
return true; return true;
return false; return false;
@@ -580,6 +589,7 @@ class ACL implements cache_cacheableInterface
{ {
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
return $this->_rights_bas[$base_id]['mask_and']; return $this->_rights_bas[$base_id]['mask_and'];
@@ -595,6 +605,7 @@ class ACL implements cache_cacheableInterface
{ {
$this->load_rights_bas(); $this->load_rights_bas();
if (!$this->has_access_to_base($base_id)) if (!$this->has_access_to_base($base_id))
return false; return false;
return $this->_rights_bas[$base_id]['mask_xor']; return $this->_rights_bas[$base_id]['mask_xor'];
@@ -736,6 +747,7 @@ class ACL implements cache_cacheableInterface
{ {
if ($this->_rights_records_preview) if ($this->_rights_records_preview)
return $this; return $this;
try try
@@ -789,6 +801,7 @@ class ACL implements cache_cacheableInterface
{ {
if ($this->_rights_sbas && $this->_global_rights) if ($this->_rights_sbas && $this->_global_rights)
return $this; return $this;
try try
@@ -850,6 +863,7 @@ class ACL implements cache_cacheableInterface
protected function load_rights_bas() protected function load_rights_bas()
{ {
if ($this->_rights_bas && $this->_global_rights && is_array($this->_limited)) if ($this->_rights_bas && $this->_global_rights && is_array($this->_limited))
return $this; return $this;
try try
@@ -1353,6 +1367,7 @@ class ACL implements cache_cacheableInterface
$stmt->closeCursor(); $stmt->closeCursor();
if (!$row) if (!$row)
return $this; return $this;
$this->give_access_to_base(array($base_id_dest)); $this->give_access_to_base(array($base_id_dest));
@@ -1519,6 +1534,7 @@ class ACL implements cache_cacheableInterface
{ {
$this->load_rights_bas(); $this->load_rights_bas();
if (!isset($this->_limited[$base_id])) if (!isset($this->_limited[$base_id]))
return null; return null;
return ($this->_limited[$base_id]); return ($this->_limited[$base_id]);
} }

View File

@@ -1101,6 +1101,7 @@ class API_V1_adapter extends API_V1_Abstract
* @todo ajouter une option pour avoir les values serialisées * @todo ajouter une option pour avoir les values serialisées
* dans un cas multi * dans un cas multi
*/ */
return array( return array(
'meta_id' => $value->getId() 'meta_id' => $value->getId()
, 'meta_structure_id' => $field->get_meta_struct_id() , 'meta_structure_id' => $field->get_meta_struct_id()

View File

@@ -100,6 +100,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
$this->timeout = null; $this->timeout = null;
$result = json_decode($this->httpRequest($result['upload_url'], array('file' => '@' . $filePath)), true); $result = json_decode($this->httpRequest($result['upload_url'], array('file' => '@' . $filePath)), true);
$this->timeout = $timeout; $this->timeout = $timeout;
return $result['url']; return $result['url'];
} }
} }

View File

@@ -135,6 +135,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
public function get_icon_url() public function get_icon_url()
{ {
if ($this->icon_url) if ($this->icon_url)
return $this->icon_url; return $this->icon_url;
$url = '/skins/icons/rss32.gif'; $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) public function has_access(User_Adapter $user)
{ {
if ($this->get_collection() instanceof collection) if ($this->get_collection() instanceof collection)
return $user->ACL()->has_access_to_base($this->collection->get_base_id()); return $user->ACL()->has_access_to_base($this->collection->get_base_id());
return true; return true;
} }
@@ -292,6 +294,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
public function add_publisher(User_Adapter $user) public function add_publisher(User_Adapter $user)
{ {
if (in_array($user->get_id(), array_keys($this->get_publishers()))) if (in_array($user->get_id(), array_keys($this->get_publishers())))
return $this; return $this;
Feed_Publisher_Adapter::create($this->appbox, $user, $this, false); 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() protected function load_publishers()
{ {
if (is_array($this->publishers)) if (is_array($this->publishers))
return $this->publishers; return $this->publishers;
$sql = 'SELECT id, usr_id, owner FROM feed_publishers $sql = 'SELECT id, usr_id, owner FROM feed_publishers
@@ -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) public function get_homepage_link(registryInterface $registry, $format, $page = null)
{ {
if (!$this->is_public()) if (!$this->is_public())
return null; return null;
switch ($format) switch ($format)
{ {
@@ -637,6 +642,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
try try
{ {
if (!$renew) if (!$renew)
return $this->get_data_from_cache($cache_key); return $this->get_data_from_cache($cache_key);
} }
catch (Exception $e) catch (Exception $e)

View File

@@ -370,9 +370,11 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
$medium = strtolower($content->get_record()->get_type()); $medium = strtolower($content->get_record()->get_type());
if (!in_array($medium, array('image', 'audio', 'video'))) if (!in_array($medium, array('image', 'audio', 'video')))
return $this; return $this;
if (!$preview_permalink || !$thumbnail_permalink) if (!$preview_permalink || !$thumbnail_permalink)
return $this; return $this;
//add item node to channel node //add item node to channel node

View File

@@ -907,6 +907,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public static function get_usr_id_from_email($email) public static function get_usr_id_from_email($email)
{ {
if (is_null($email)) if (is_null($email))
return false; return false;
$conn = connection::getPDOConnection(); $conn = connection::getPDOConnection();
@@ -1277,6 +1278,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
protected function load_preferences() protected function load_preferences()
{ {
if ($this->_prefs) if ($this->_prefs)
return $this; return $this;
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id'; $sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
$stmt = $this->appbox->get_connection()->prepare($sql); $stmt = $this->appbox->get_connection()->prepare($sql);
@@ -1477,6 +1479,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
{ {
$this->load_preferences(); $this->load_preferences();
if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value) if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value)
return $value; return $value;
$ok = true; $ok = true;
@@ -1514,6 +1517,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$session = $appbox->get_session(); $session = $appbox->get_session();
if (!$session->is_authenticated()) if (!$session->is_authenticated())
return; return;
$ses_id = $session->get_ses_id(); $ses_id = $session->get_ses_id();
@@ -1788,6 +1792,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public function get_nonce() public function get_nonce()
{ {
if ($this->nonce) if ($this->nonce)
return $this->nonce; return $this->nonce;
$nonce = false; $nonce = false;

View File

@@ -489,6 +489,7 @@ class User_Query implements User_QueryInterface
public function get_total() public function get_total()
{ {
if ($this->total) if ($this->total)
return $this->total; return $this->total;
$conn = $this->appbox->get_connection(); $conn = $this->appbox->get_connection();
@@ -637,6 +638,7 @@ class User_Query implements User_QueryInterface
public function on_base_ids(Array $base_ids = null) public function on_base_ids(Array $base_ids = null)
{ {
if (!$base_ids) if (!$base_ids)
return $this; return $this;
$this->bases_restrictions = true; $this->bases_restrictions = true;
@@ -661,6 +663,7 @@ class User_Query implements User_QueryInterface
public function on_sbas_ids(Array $sbas_ids = null) public function on_sbas_ids(Array $sbas_ids = null)
{ {
if (!$sbas_ids) if (!$sbas_ids)
return $this; return $this;
$this->sbas_restrictions = true; $this->sbas_restrictions = true;

View File

@@ -138,10 +138,12 @@ class appbox extends base
$custom_path.= $collection->get_base_id(); $custom_path.= $collection->get_base_id();
if (is_null($pathfile)) if (is_null($pathfile))
return $this; return $this;
$datas = file_get_contents($pathfile->getPathname()); $datas = file_get_contents($pathfile->getPathname());
if (is_null($datas)) if (is_null($datas))
return $this; return $this;
file_put_contents($file, $datas); file_put_contents($file, $datas);
@@ -193,10 +195,12 @@ class appbox extends base
$custom_path.= $pic_type . '_' . $databox->get_sbas_id(); $custom_path.= $pic_type . '_' . $databox->get_sbas_id();
if (is_null($pathfile)) if (is_null($pathfile))
return $this; return $this;
$datas = file_get_contents($pathfile->getPathname()); $datas = file_get_contents($pathfile->getPathname());
if (is_null($datas)) if (is_null($datas))
return $this; return $this;
file_put_contents($file, $datas); file_put_contents($file, $datas);
@@ -608,6 +612,7 @@ class appbox extends base
public function get_databoxes() public function get_databoxes()
{ {
if ($this->databoxes) if ($this->databoxes)
return $this->databoxes; return $this->databoxes;
$ret = array(); $ret = array();

View File

@@ -258,8 +258,10 @@ abstract class base implements cache_cacheableInterface
public function upgradeavailable() public function upgradeavailable()
{ {
if ($this->get_version()) if ($this->get_version())
return version_compare(\Alchemy\Phrasea\Core\Version::getNumber(), $this->get_version(), '>'); return version_compare(\Alchemy\Phrasea\Core\Version::getNumber(), $this->get_version(), '>');
else else
return true; return true;
} }

View File

@@ -407,6 +407,7 @@ class caption_field //implements cache_cacheableInterface
foreach($this->values as $value) foreach($this->values as $value)
{ {
/* @var $value Caption_Field_Value */ /* @var $value Caption_Field_Value */
return $value->getValue(); return $value->getValue();
} }
} }

View File

@@ -60,6 +60,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
protected function retrieve_fields() protected function retrieve_fields()
{ {
if (is_array($this->fields)) if (is_array($this->fields))
return $this->fields; return $this->fields;
$fields = array(); $fields = array();
@@ -133,6 +134,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
{ {
$fields = $this->retrieve_fields(); $fields = $this->retrieve_fields();
if (isset($this->dces_elements[$label])) if (isset($this->dces_elements[$label]))
return $fields[$this->dces_elements[$label]]; return $fields[$this->dces_elements[$label]];
return null; return null;
} }

View File

@@ -54,6 +54,7 @@ class connection
{ {
$registry = registry::get_instance(); $registry = registry::get_instance();
if (!$registry->get('GV_debug')) if (!$registry->get('GV_debug'))
return; return;
$totalTime = 0; $totalTime = 0;
@@ -120,6 +121,7 @@ class connection
$name = (int) $name; $name = (int) $name;
} }
else else
return false; return false;
if (!isset(self::$_PDO_instance[$name])) if (!isset(self::$_PDO_instance[$name]))
@@ -173,6 +175,7 @@ class connection
} }
} }
if (array_key_exists($name, self::$_PDO_instance)) if (array_key_exists($name, self::$_PDO_instance))
return self::$_PDO_instance[$name]; return self::$_PDO_instance[$name];
throw new Exception('Connection not available'); throw new Exception('Connection not available');
} }

View File

@@ -451,6 +451,7 @@ class databox extends base
$stmt->closeCursor(); $stmt->closeCursor();
if ($row) if ($row)
return self::get_instance((int) $row['sbas_id']); return self::get_instance((int) $row['sbas_id']);
try try
@@ -575,6 +576,7 @@ class databox extends base
public function get_meta_structure() public function get_meta_structure()
{ {
if ($this->meta_struct) if ($this->meta_struct)
return $this->meta_struct; return $this->meta_struct;
try try
@@ -697,6 +699,7 @@ class databox extends base
} }
} }
if ($n > $limit) if ($n > $limit)
return true; return true;
return false; return false;
@@ -1220,6 +1223,7 @@ class databox extends base
public function get_structure() public function get_structure()
{ {
if ($this->structure) if ($this->structure)
return $this->structure; return $this->structure;
$this->structure = $this->retrieve_structure(); $this->structure = $this->retrieve_structure();
@@ -1260,6 +1264,7 @@ class databox extends base
public function get_cterms() public function get_cterms()
{ {
if ($this->cterms) if ($this->cterms)
return $this->cterms; return $this->cterms;
$sql = "SELECT value FROM pref WHERE prop='cterms'"; $sql = "SELECT value FROM pref WHERE prop='cterms'";
@@ -1426,6 +1431,7 @@ class databox extends base
public function get_cgus() public function get_cgus()
{ {
if ($this->cgus) if ($this->cgus)
return $this->cgus; return $this->cgus;
$this->load_cgus(); $this->load_cgus();

View File

@@ -76,6 +76,7 @@ class gatekeeper
$session = $appbox->get_session(); $session = $appbox->get_session();
if (http_request::is_command_line()) if (http_request::is_command_line())
return; return;
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF'])) if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
@@ -121,6 +122,7 @@ class gatekeeper
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php' if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php' || $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php') || $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
return; return;
phrasea::redirect('/login/?redirect=/thesaurus2'); phrasea::redirect('/login/?redirect=/thesaurus2');
break; break;
@@ -129,6 +131,7 @@ class gatekeeper
break; break;
case 'admin': case 'admin':
if ($this->_script_name === 'runscheduler.php') if ($this->_script_name === 'runscheduler.php')
return; return;
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']); phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
break; break;
@@ -148,6 +151,7 @@ class gatekeeper
return; return;
case 'setup': case 'setup':
if ($appbox->upgradeavailable()) if ($appbox->upgradeavailable())
return; return;
else else
phrasea::redirect('/login/'); phrasea::redirect('/login/');
@@ -264,6 +268,7 @@ class gatekeeper
$parm = $request->get_parms('LOG'); $parm = $request->get_parms('LOG');
if (is_null($parm["LOG"])) if (is_null($parm["LOG"]))
return $this; return $this;
try try
@@ -281,6 +286,7 @@ class gatekeeper
try try
{ {
$datas = random::helloToken($parm['LOG']); $datas = random::helloToken($parm['LOG']);
return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/"); return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/");
} }
catch (Exception_NotFound $e) catch (Exception_NotFound $e)

View File

@@ -103,6 +103,7 @@ class geonames
$cityName = self::clean_input($cityName); $cityName = self::clean_input($cityName);
if (strlen($cityName) === 0) if (strlen($cityName) === 0)
return $output; return $output;
$registry = registry::get_instance(); $registry = registry::get_instance();
@@ -143,6 +144,7 @@ class geonames
public function find_geoname_from_ip($ip) public function find_geoname_from_ip($ip)
{ {
if (array_key_exists($ip, $this->cache_ips)) if (array_key_exists($ip, $this->cache_ips))
return $this->cache_ips[$ip]; return $this->cache_ips[$ip];
$output = array( $output = array(

View File

@@ -26,9 +26,11 @@ class http_query
public static function getHttpCodeFromUrl($url) public static function getHttpCodeFromUrl($url)
{ {
if (!is_scalar($url)) if (!is_scalar($url))
return null; return null;
if (trim($url) === '') if (trim($url) === '')
return null; return null;
$ch = curl_init(); $ch = curl_init();
@@ -52,9 +54,11 @@ class http_query
public static function getHttpHeaders($url) public static function getHttpHeaders($url)
{ {
if (!is_scalar($url)) if (!is_scalar($url))
return null; return null;
if (trim($url) === '') if (trim($url) === '')
return null; return null;
$ch = curl_init(); $ch = curl_init();
@@ -83,9 +87,11 @@ class http_query
public static function getUrl($url, $post_data = false) public static function getUrl($url, $post_data = false)
{ {
if (!is_scalar($url)) if (!is_scalar($url))
return null; return null;
if (trim($url) === '') if (trim($url) === '')
return null; return null;
$ch = curl_init(); $ch = curl_init();

View File

@@ -169,6 +169,7 @@ class module_console_fileConfigCheck extends Command
throw new \Exception(sprintf("Check parsing file\n"), null, $e); throw new \Exception(sprintf("Check parsing file\n"), null, $e);
} }
$output->writeln("<info>Parsing File OK</info>"); $output->writeln("<info>Parsing File OK</info>");
return; return;
} }
@@ -183,6 +184,7 @@ class module_console_fileConfigCheck extends Command
throw new \Exception(sprintf("Check get selected environment\n"), null, $e); throw new \Exception(sprintf("Check get selected environment\n"), null, $e);
} }
$output->writeln("<info>Get Selected Environment OK</info>"); $output->writeln("<info>Get Selected Environment OK</info>");
return; return;
} }
@@ -203,6 +205,7 @@ class module_console_fileConfigCheck extends Command
throw new \Exception(sprintf("Check get selected environment from file\n"), null, $e); throw new \Exception(sprintf("Check get selected environment from file\n"), null, $e);
} }
$output->writeln("<info>Get Selected Environment from file OK</info>"); $output->writeln("<info>Get Selected Environment from file OK</info>");
return; return;
} }
@@ -262,6 +265,7 @@ class module_console_fileConfigCheck extends Command
} }
$output->writeln("<info>Phraseanet Scope OK</info>"); $output->writeln("<info>Phraseanet Scope OK</info>");
return; return;
} }
@@ -297,6 +301,7 @@ class module_console_fileConfigCheck extends Command
throw new \Exception(sprintf("Check Database Scope\n"), null, $e); throw new \Exception(sprintf("Check Database Scope\n"), null, $e);
} }
$output->writeln("<info>Database Scope OK</info>"); $output->writeln("<info>Database Scope OK</info>");
return; return;
} }
@@ -383,6 +388,7 @@ class module_console_fileConfigCheck extends Command
} }
$output->writeln("<info>Template engine service OK</info>"); $output->writeln("<info>Template engine service OK</info>");
return; return;
} }
@@ -391,6 +397,7 @@ class module_console_fileConfigCheck extends Command
if (!$this->connexionOk) if (!$this->connexionOk)
{ {
$output->writeln("<comment>As ORM service test depends on database test success, it is not executed</comment>"); $output->writeln("<comment>As ORM service test depends on database test success, it is not executed</comment>");
return; return;
} }
@@ -502,6 +509,7 @@ class module_console_fileConfigCheck extends Command
} }
$output->writeln("<info>ORM service OK</info>"); $output->writeln("<info>ORM service OK</info>");
return; return;
} }

View File

@@ -500,6 +500,7 @@ class module_report
public function getOrder($k = false) public function getOrder($k = false)
{ {
if ($k === false) if ($k === false)
return $this->tab_order; return $this->tab_order;
return $this->tab_order[$k]; return $this->tab_order[$k];
} }
@@ -819,6 +820,7 @@ class module_report
public function buildReport($tab = false, $groupby = false, $on = false) public function buildReport($tab = false, $groupby = false, $on = false)
{ {
if (sizeof($this->report) > 0) if (sizeof($this->report) > 0)
return $this->report; return $this->report;
$conn = connection::getPDOConnection($this->sbas_id); $conn = connection::getPDOConnection($this->sbas_id);

View File

@@ -1112,6 +1112,7 @@ class module_report_activity extends module_report
$date = new DateTime($row['ddate']); $date = new DateTime($row['ddate']);
$result[$date->format(DATE_ATOM)] = $row['activity']; $result[$date->format(DATE_ATOM)] = $row['activity'];
} }
return $result; return $result;
} }

View File

@@ -157,8 +157,10 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
public function isValid() public function isValid()
{ {
if (isset($this->dashboard) && sizeof($this->dashboard) > 0) if (isset($this->dashboard) && sizeof($this->dashboard) > 0)
return true; return true;
else else
return false; return false;
} }

View File

@@ -252,6 +252,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
{ {
} }
return; return;
} }

View File

@@ -149,8 +149,10 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
public function isValid() public function isValid()
{ {
if (isset($this->arraySorted) && sizeof($this->arraySorted) > 0) if (isset($this->arraySorted) && sizeof($this->arraySorted) > 0)
return true; return true;
else else
return false; return false;
} }
@@ -162,6 +164,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
public function getTop($nbtop) public function getTop($nbtop)
{ {
if (!is_int($nbtop)) if (!is_int($nbtop))
return array(); return array();
$tmp = array(); $tmp = array();
@@ -182,6 +185,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
} }
} }
} }
return $tmp; return $tmp;
} }

View File

@@ -238,6 +238,7 @@ class phrasea
public static function sbas_params() public static function sbas_params()
{ {
if (self::$_sbas_params) if (self::$_sbas_params)
return self::$_sbas_params; return self::$_sbas_params;
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
@@ -274,6 +275,7 @@ class phrasea
{ {
$usr_id = User_Adapter::get_usr_id_from_login('invite'); $usr_id = User_Adapter::get_usr_id_from_login('invite');
if (!$usr_id) if (!$usr_id)
return false; return false;
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$user = User_Adapter::getInstance($usr_id, $appbox); $user = User_Adapter::getInstance($usr_id, $appbox);

View File

@@ -749,8 +749,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
if ($data) if ($data)
{ {
if (isset($this->technical_datas[$data])) if (isset($this->technical_datas[$data]))
return $this->technical_datas[$data]; return $this->technical_datas[$data];
else else
return false; return false;
} }
@@ -1487,6 +1489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
public function get_reg_name() public function get_reg_name()
{ {
if (!$this->is_grouping()) if (!$this->is_grouping())
return false; return false;
$balisename = ''; $balisename = '';
@@ -1683,6 +1686,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{ {
$hd = $this->get_subdef('document'); $hd = $this->get_subdef('document');
if ($hd->is_physically_present()) if ($hd->is_physically_present())
return new system_file(p4string::addEndSlash($hd->get_path()) . $hd->get_file()); return new system_file(p4string::addEndSlash($hd->get_path()) . $hd->get_file());
return null; return null;
} }
@@ -2020,6 +2024,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$repo = $em->getRepository('\Entities\Basket'); $repo = $em->getRepository('\Entities\Basket');
/* @var $$repo \Repositories\BasketRepository */ /* @var $$repo \Repositories\BasketRepository */
return $repo->findContainingRecord($this); return $repo->findContainingRecord($this);
} }

View File

@@ -211,6 +211,7 @@ class record_preview extends record_adapter
public function get_train($pos = 0, $query='', searchEngine_adapter $search_engine=null) public function get_train($pos = 0, $query='', searchEngine_adapter $search_engine=null)
{ {
if ($this->train) if ($this->train)
return $this->train; return $this->train;
switch ($this->env) switch ($this->env)
@@ -273,6 +274,7 @@ class record_preview extends record_adapter
public function get_title($highlight = '', searchEngine_adapter $search_engine=null) public function get_title($highlight = '', searchEngine_adapter $search_engine=null)
{ {
if ($this->title) if ($this->title)
return $this->title; return $this->title;
$this->title = collection::getLogo($this->get_base_id()) . ' '; $this->title = collection::getLogo($this->get_base_id()) . ' ';
@@ -329,6 +331,7 @@ class record_preview extends record_adapter
public function get_short_history() public function get_short_history()
{ {
if (!is_null($this->short_history)) if (!is_null($this->short_history))
return $this->short_history; return $this->short_history;
$tab = array(); $tab = array();
@@ -421,6 +424,7 @@ class record_preview extends record_adapter
public function get_view_popularity() public function get_view_popularity()
{ {
if (!is_null($this->view_popularity)) if (!is_null($this->view_popularity))
return $this->view_popularity; return $this->view_popularity;
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$session = $appbox->get_session(); $session = $appbox->get_session();
@@ -518,6 +522,7 @@ class record_preview extends record_adapter
public function get_refferer_popularity() public function get_refferer_popularity()
{ {
if (!is_null($this->refferer_popularity)) if (!is_null($this->refferer_popularity))
return $this->refferer_popularity; return $this->refferer_popularity;
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$session = $appbox->get_session(); $session = $appbox->get_session();
@@ -604,6 +609,7 @@ class record_preview extends record_adapter
{ {
if (!is_null($this->download_popularity)) if (!is_null($this->download_popularity))
return $this->download_popularity; return $this->download_popularity;
$appbox = appbox::get_instance(); $appbox = appbox::get_instance();
$session = $appbox->get_session(); $session = $appbox->get_session();

View File

@@ -71,6 +71,7 @@ class registry implements registryInterface
$this->cache->set('GV_debug', $configuration->isDebug()); $this->cache->set('GV_debug', $configuration->isDebug());
$this->cache->set('GV_maintenance', $configuration->isMaintained()); $this->cache->set('GV_maintenance', $configuration->isMaintained());
} }
return $this; return $this;
} }
@@ -139,8 +140,10 @@ class registry implements registryInterface
$this->load(); $this->load();
if (!$this->cache->is_set($key) && !is_null($defaultvalue)) if (!$this->cache->is_set($key) && !is_null($defaultvalue))
return $defaultvalue; return $defaultvalue;
else else
return $this->cache->get($key); return $this->cache->get($key);
} }

View File

@@ -122,6 +122,7 @@ class searchEngine_adapter_phrasea_queryParser
$this->proposals = Array("QRY" => "", "BASES" => array()); $this->proposals = Array("QRY" => "", "BASES" => array());
$this->phq = $this->mb_trim($phq, 'UTF-8'); $this->phq = $this->mb_trim($phq, 'UTF-8');
if ($this->phq != "") if ($this->phq != "")
return($this->maketree(0)); return($this->maketree(0));
else else
{ {
@@ -139,14 +140,18 @@ class searchEngine_adapter_phrasea_queryParser
{ {
case "SIMPLE": case "SIMPLE":
if (is_array($tree["VALUE"])) if (is_array($tree["VALUE"]))
return(implode(" ", $tree["VALUE"])); return(implode(" ", $tree["VALUE"]));
else else
return($tree["VALUE"]); return($tree["VALUE"]);
break; break;
case "QSIMPLE": case "QSIMPLE":
if (is_array($tree["VALUE"])) if (is_array($tree["VALUE"]))
return("\"" . implode(" ", $tree["VALUE"]) . "\""); return("\"" . implode(" ", $tree["VALUE"]) . "\"");
else else
return("\"" . $tree["VALUE"] . "\""); return("\"" . $tree["VALUE"] . "\"");
break; break;
case "PHRASEA_KW_ALL": case "PHRASEA_KW_ALL":
@@ -154,15 +159,19 @@ class searchEngine_adapter_phrasea_queryParser
break; break;
case "PHRASEA_KW_LAST": case "PHRASEA_KW_LAST":
if ($tree["PNUM"] !== null) if ($tree["PNUM"] !== null)
return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]");
else else
return($tree["VALUE"][0]); return($tree["VALUE"][0]);
break; break;
case "OPS": case "OPS":
case "OPK": case "OPK":
if (isset($tree["PNUM"])) if (isset($tree["PNUM"]))
return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . "[" . $tree["PNUM"] . "] " . $this->astext($tree["RB"]) . ")"); return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . "[" . $tree["PNUM"] . "] " . $this->astext($tree["RB"]) . ")");
else else
return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . " " . $this->astext($tree["RB"]) . ")"); return("(" . $this->astext($tree["LB"]) . " " . $tree["VALUE"] . " " . $this->astext($tree["RB"]) . ")");
break; break;
} }
@@ -183,8 +192,10 @@ class searchEngine_adapter_phrasea_queryParser
if ($tree) if ($tree)
{ {
if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK")
return($tree["COMPLEXITY"] = $this->calc_complexity($tree["LB"]) + $this->calc_complexity($tree["RB"])); return($tree["COMPLEXITY"] = $this->calc_complexity($tree["LB"]) + $this->calc_complexity($tree["RB"]));
else else
return($tree["COMPLEXITY"] = 1); return($tree["COMPLEXITY"] = 1);
} }
} }
@@ -348,6 +359,7 @@ class searchEngine_adapter_phrasea_queryParser
function priority_opk(&$tree, $depth = 0) function priority_opk(&$tree, $depth = 0)
{ {
if (!$tree) if (!$tree)
return; return;
if ($tree["CLASS"] == "OPK" && ($tree["LB"]["CLASS"] == "OPS" || $tree["LB"]["CLASS"] == "OPK")) 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) function distrib_opk(&$tree, $depth = 0)
{ {
if (!$tree) if (!$tree)
return; return;
if ($tree["CLASS"] == "OPK" && ($tree["RB"]["CLASS"] == "OPS")) if ($tree["CLASS"] == "OPK" && ($tree["RB"]["CLASS"] == "OPS"))
{ {
@@ -392,6 +405,7 @@ class searchEngine_adapter_phrasea_queryParser
function thesaurus2_apply(&$tree, $bid) function thesaurus2_apply(&$tree, $bid)
{ {
if (!$tree) if (!$tree)
return; return;
if (($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE") && isset($tree["SREF"]) && isset($tree["SREF"]["TIDS"])) 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) if ($depth == 0)
$ret = $tree; $ret = $tree;
if (!$useThesaurus) if (!$useThesaurus)
return; // full-text only : inchangé return; // full-text only : inchangé
if (($tree["CLASS"] == "SIMPLE" || $tree["CLASS"] == "QSIMPLE")) 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()); $this->proposals["BASES"]["b$bid"] = array("BID" => $bid, "NAME" => $name, "TERMS" => array());
if (!$tree) if (!$tree)
return(0); return(0);
$ambigus = 0; $ambigus = 0;
@@ -733,15 +749,19 @@ class searchEngine_adapter_phrasea_queryParser
break; break;
case "PHRASEA_KW_LAST": case "PHRASEA_KW_LAST":
if ($tree["PNUM"] !== null) if ($tree["PNUM"] !== null)
return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]");
else else
return($tree["VALUE"][0]); return($tree["VALUE"][0]);
break; break;
case "OPS": case "OPS":
case "OPK": case "OPK":
if (isset($tree["PNUM"])) if (isset($tree["PNUM"]))
return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . '[' . $tree["PNUM"] . '] ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')'); return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . '[' . $tree["PNUM"] . '] ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')');
else else
return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . ' ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')'); return('(' . $this->_queryAsHTML($tree["LB"], $depth + 1) . ' ' . $tree["VALUE"] . ' ' . $this->_queryAsHTML($tree["RB"], $depth + 1) . ')');
break; break;
} }
@@ -904,8 +924,10 @@ class searchEngine_adapter_phrasea_queryParser
function containsColonOperator(&$tree) function containsColonOperator(&$tree)
{ {
if (!$tree) if (!$tree)
return(false); return(false);
if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON && ($tree["RB"]["CLASS"] == "SIMPLE" || $tree["RB"]["CLASS"] == "QSIMPLE")) if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON && ($tree["RB"]["CLASS"] == "SIMPLE" || $tree["RB"]["CLASS"] == "QSIMPLE"))
return(true); return(true);
$ret = false; $ret = false;
if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK")
@@ -1028,15 +1050,19 @@ class searchEngine_adapter_phrasea_queryParser
break; break;
case "PHRASEA_KW_LAST": case "PHRASEA_KW_LAST":
if ($tree["PNUM"] !== null) if ($tree["PNUM"] !== null)
return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]"); return("" . $tree["VALUE"][0] . "[" . $tree["PNUM"] . "]");
else else
return($tree["VALUE"][0]); return($tree["VALUE"][0]);
break; break;
case "OPS": case "OPS":
case "OPK": case "OPK":
if (isset($tree["PNUM"])) 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) . ")"); return("(" . $this->astext_ambigu($tree["LB"], $ambiguites, $mouseCallback, $depth + 1) . " " . $tree["VALUE"] . "[" . $tree["PNUM"] . "] " . $this->astext_ambigu($tree["RB"], $ambiguites, $mouseCallback, $depth + 1) . ")");
else else
return("(" . $this->astext_ambigu($tree["LB"], $ambiguites, $mouseCallback, $depth + 1) . " " . $tree["VALUE"] . " " . $this->astext_ambigu($tree["RB"], $ambiguites, $mouseCallback, $depth + 1) . ")"); return("(" . $this->astext_ambigu($tree["LB"], $ambiguites, $mouseCallback, $depth + 1) . " " . $tree["VALUE"] . " " . $this->astext_ambigu($tree["RB"], $ambiguites, $mouseCallback, $depth + 1) . ")");
break; break;
} }
@@ -1045,6 +1071,7 @@ class searchEngine_adapter_phrasea_queryParser
function get_ambigu(&$tree, $mouseCallback = "void", $depth = 0) function get_ambigu(&$tree, $mouseCallback = "void", $depth = 0)
{ {
if (!$tree) if (!$tree)
return(""); return("");
unset($tree["DEPTH"]); unset($tree["DEPTH"]);
if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK")
@@ -1069,14 +1096,17 @@ class searchEngine_adapter_phrasea_queryParser
function set_default(&$tree, &$emptyw, $depth = 0) function set_default(&$tree, &$emptyw, $depth = 0)
{ {
if (!$tree) if (!$tree)
return(true); return(true);
if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") if ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK")
{ {
if ($tree["CLASS"] == "OPS") if ($tree["CLASS"] == "OPS")
{ {
if (!$this->set_default($tree["LB"], $emptyw, $depth + 1)) if (!$this->set_default($tree["LB"], $emptyw, $depth + 1))
return(false); return(false);
if (!$this->set_default($tree["RB"], $emptyw, $depth + 1)) if (!$this->set_default($tree["RB"], $emptyw, $depth + 1))
return(false); return(false);
} }
else // OPK ! else // OPK !
@@ -1210,6 +1240,7 @@ class searchEngine_adapter_phrasea_queryParser
$nmodif += $this->factor_or2($tree["RB"], $depth + 1); $nmodif += $this->factor_or2($tree["RB"], $depth + 1);
} }
} }
return($nmodif); return($nmodif);
} }
@@ -1607,6 +1638,7 @@ class searchEngine_adapter_phrasea_queryParser
// quand on est entre guillements les tokens perdent leur signification // quand on est entre guillements les tokens perdent leur signification
$tree = $this->addtotree($tree, $t, $depth, $inquote); $tree = $this->addtotree($tree, $t, $depth, $inquote);
if (!$tree) if (!$tree)
return(null); return(null);
} }
else else
@@ -1629,6 +1661,7 @@ class searchEngine_adapter_phrasea_queryParser
// quand on est entre guillements les tokens perdent leur signification // quand on est entre guillements les tokens perdent leur signification
$tree = $this->addtotree($tree, $t, $depth, $inquote); $tree = $this->addtotree($tree, $t, $depth, $inquote);
if (!$tree) if (!$tree)
return(null); return(null);
} }
else // '(' : appel récursif else // '(' : appel récursif
@@ -1656,6 +1689,7 @@ class searchEngine_adapter_phrasea_queryParser
} }
} }
if (!$tree) if (!$tree)
return(null); return(null);
} }
break; break;
@@ -1712,6 +1746,7 @@ class searchEngine_adapter_phrasea_queryParser
} }
} }
if (!$tree) if (!$tree)
return(null); return(null);
} }
break; break;
@@ -1724,6 +1759,7 @@ class searchEngine_adapter_phrasea_queryParser
print("-------------------------\n"); print("-------------------------\n");
} }
if (!$tree) if (!$tree)
return(null); return(null);
break; break;
} }
@@ -1750,6 +1786,7 @@ class searchEngine_adapter_phrasea_queryParser
} }
if (!$t) if (!$t)
return($tree); return($tree);
switch ($t["CLASS"]) switch ($t["CLASS"])
{ {
@@ -2009,6 +2046,7 @@ class searchEngine_adapter_phrasea_queryParser
function nexttoken($inquote = false) function nexttoken($inquote = false)
{ {
if ($this->phq == "") if ($this->phq == "")
return(null); return(null);
switch ($c = substr($this->phq, 0, 1)) 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'); $this->phq = $this->mb_ltrim(mb_substr($this->phq, $i + 1, 99999, 'UTF-8'), 'UTF-8');
} }
if ($t != "") if ($t != "")
return(array("CLASS" => "TOK_WORD", "VALUE" => $t)); return(array("CLASS" => "TOK_WORD", "VALUE" => $t));
else else
return(array("CLASS" => "TOK_VOID", "VALUE" => $t)); return(array("CLASS" => "TOK_VOID", "VALUE" => $t));
break; break;
} }

View File

@@ -762,6 +762,7 @@ class set_export extends set_abstract
return false; return false;
} }
if (isset($list['complete']) && $list['complete'] === true) if (isset($list['complete']) && $list['complete'] === true)
return; return;
@@ -1011,6 +1012,7 @@ class set_export extends set_abstract
$response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";"); $response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";");
$response->headers->set('Content-Length', filesize($file)); $response->headers->set('Content-Length', filesize($file));
$response->setContent(file_get_contents($file)); $response->setContent(file_get_contents($file));
return $response; return $response;
} }
} }

View File

@@ -81,6 +81,7 @@ class setup
{ {
} }
return $installed; return $installed;
} }
@@ -304,11 +305,13 @@ class setup
protected static function discover_binary($binary, array $look_here = array()) protected static function discover_binary($binary, array $look_here = array())
{ {
if (system_server::get_platform() == 'WINDOWS') if (system_server::get_platform() == 'WINDOWS')
return null; return null;
foreach ($look_here as $place) foreach ($look_here as $place)
{ {
if (is_executable($place)) if (is_executable($place))
return $place; return $place;
} }
@@ -320,6 +323,7 @@ class setup
$registry = registry::get_instance(); $registry = registry::get_instance();
if ($registry->get('GV_h264_streaming') !== true) if ($registry->get('GV_h264_streaming') !== true)
return; return;
?> ?>
<h1>mod_auth_token configuration </h1> <h1>mod_auth_token configuration </h1>
@@ -531,6 +535,7 @@ class setup
</form> </form>
<?php <?php
return; return;
} }
@@ -722,6 +727,7 @@ class setup
$constraints = array(); $constraints = array();
if (!extension_loaded('gettext')) if (!extension_loaded('gettext'))
return new Setup_ConstraintsIterator($constraints); return new Setup_ConstraintsIterator($constraints);
foreach (User_Adapter::$locales as $code => $language_name) foreach (User_Adapter::$locales as $code => $language_name)
@@ -754,11 +760,14 @@ class setup
if (($current === '' || $current === 'off' || $current === '0') && $is_flag) if (($current === '' || $current === 'off' || $current === '0') && $is_flag)
if ($value === 'off' || $value === '0' || $value === '') if ($value === 'off' || $value === '0' || $value === '')
return $current; return $current;
if (($current === '1' || $current === 'on') && $is_flag) if (($current === '1' || $current === 'on') && $is_flag)
if ($value === 'on' || $value === '1') if ($value === 'on' || $value === '1')
return $current; return $current;
if ($current === $value) if ($current === $value)
return $current; return $current;
} }
@@ -843,4 +852,3 @@ class setup
} }

View File

@@ -150,6 +150,7 @@ class task_manager
closedir($hdir); closedir($hdir);
} }
} }
return $tasks; return $tasks;
} }
} }

View File

@@ -162,6 +162,7 @@ class task_period_outofdate extends task_abstract
parent.calcSQL(); parent.calcSQL();
</script> </script>
<?php <?php
return(""); return("");
} }
else // ... so we NEVER come here else // ... so we NEVER come here
@@ -218,6 +219,7 @@ class task_period_outofdate extends task_abstract
jQuery.map($(this).serializeArray(), function(n, i){ jQuery.map($(this).serializeArray(), function(n, i){
json[n['name']] = n['value']; json[n['name']] = n['value'];
}); });
return json; return json;
}; };
})( jQuery ); })( jQuery );
@@ -309,6 +311,7 @@ class task_period_outofdate extends task_abstract
$("#status"+fld).html(html); $("#status"+fld).html(html);
} }
}); });
return; return;
} }
@@ -682,6 +685,7 @@ class task_period_outofdate extends task_abstract
} }
$ret = ($nchanged > 0 ? $nchanged : 'NORECSTODO'); $ret = ($nchanged > 0 ? $nchanged : 'NORECSTODO');
return($ret); return($ret);
} }

View File

@@ -68,6 +68,7 @@ class task_period_upgradetov32 extends task_abstract
{ {
printf("sbas_id '" . $this->sbas_id . "' invalide\n"); printf("sbas_id '" . $this->sbas_id . "' invalide\n");
$this->return_value = self::RETURNSTATUS_STOPPED; $this->return_value = self::RETURNSTATUS_STOPPED;
return; return;
} }
@@ -369,11 +370,13 @@ class task_period_upgradetov32 extends task_abstract
if ($n_done >= 5000) if ($n_done >= 5000)
{ {
$this->return_value = task_abstract::RETURNSTATUS_TORESTART; $this->return_value = task_abstract::RETURNSTATUS_TORESTART;
return; return;
} }
if ($memory > 100) if ($memory > 100)
{ {
$this->return_value = task_abstract::RETURNSTATUS_TORESTART; $this->return_value = task_abstract::RETURNSTATUS_TORESTART;
return; return;
} }
} }

View File

@@ -366,6 +366,7 @@ class task_period_writemeta extends task_databoxAbstract
$this->log("\t" . $s); $this->log("\t" . $s);
} }
return $this; return $this;
} }

View File

@@ -336,6 +336,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
{ {
$current_attributes[$attribute->name] = $attribute->value; $current_attributes[$attribute->name] = $attribute->value;
} }
return $current_attributes; return $current_attributes;
} }
@@ -521,6 +522,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
unset($item_entries[$key]); //remove unset($item_entries[$key]); //remove
} }
}; };
return $remove; return $remove;
} }

View File

@@ -111,6 +111,7 @@
results.removeClass('loading').append(data); results.removeClass('loading').append(data);
activateLinks(results); activateLinks(results);
active_archiver(results); active_archiver(results);
return; return;
} }
@@ -148,6 +149,7 @@
return false; return false;
}); });
active_archiver($('.Basket', $container)); active_archiver($('.Basket', $container));
return; return;
} }
@@ -205,6 +207,7 @@
if(!data.success) if(!data.success)
{ {
humane.error(data.message); humane.error(data.message);
return; return;
} }
if(data.archive === true) if(data.archive === true)
@@ -219,6 +222,7 @@
} }
p4.WorkZone.refresh(); p4.WorkZone.refresh();
return; return;
} }

View File

@@ -89,6 +89,7 @@
}, },
select: function( event, ui ) { select: function( event, ui ) {
p4.Mustache('Push-Badge', ui.item, appendBadge); p4.Mustache('Push-Badge', ui.item, appendBadge);
return false; return false;
} }
}) })

View File

@@ -1186,6 +1186,7 @@
if(data.apps && parseInt(data.apps)>1) if(data.apps && parseInt(data.apps)>1)
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 60000)); t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 60000));
window.setTimeout("sessionactive();", t); window.setTimeout("sessionactive();", t);
return; return;
} }
}) })

View File

@@ -351,6 +351,7 @@ foreach ($tasks as $t)
{ {
if(window.console) if(window.console)
console.log('No task like this'); console.log('No task like this');
return(false); return(false);
} }

View File

@@ -72,6 +72,7 @@ $qrySbas = array();
if (is_null($parm['bas'])) if (is_null($parm['bas']))
{ {
echo 'vous devez selectionner des collections dans lesquelles chercher'; echo 'vous devez selectionner des collections dans lesquelles chercher';
return; return;
} }

View File

@@ -220,6 +220,7 @@ if ($request->has_post_datas())
if ($newUsrEmail) if ($newUsrEmail)
{ {
$user->set_mail_locked(true); $user->set_mail_locked(true);
return phrasea::redirect('/login/sendmail-confirm.php?usr_id=' . $newid); return phrasea::redirect('/login/sendmail-confirm.php?usr_id=' . $newid);
} }

View File

@@ -287,6 +287,7 @@ function doUserConf($conf, $param)
return $new_conf; return $new_conf;
} }
else else
return $conf; return $conf;
} }

View File

@@ -336,6 +336,7 @@ function doUserConf($conf, $param)
return $new_conf; return $new_conf;
} }
else else
return $conf; return $conf;
} }