Add getAuthenticator usage

Replace $app['authentication']->getUser() by $app->getAuthenticatedUser()
replace twig app['authentication'].getUser() with corresponding method
This commit is contained in:
Benoît Burnichon
2015-06-30 19:51:02 +02:00
parent 3804eb5408
commit 4880f2bf5a
113 changed files with 437 additions and 428 deletions

View File

@@ -10,6 +10,7 @@
namespace Alchemy\Phrasea\Application\Helper; namespace Alchemy\Phrasea\Application\Helper;
use Alchemy\Phrasea\Authentication\Authenticator; use Alchemy\Phrasea\Authentication\Authenticator;
use Alchemy\Phrasea\Model\Entities\User;
trait AuthenticatorAware trait AuthenticatorAware
{ {
@@ -66,4 +67,12 @@ trait AuthenticatorAware
return $this->authenticator; return $this->authenticator;
} }
/**
* @return User|null
*/
public function getAuthenticatedUser()
{
return $this->getAuthenticator()->getUser();
}
} }

View File

@@ -93,12 +93,12 @@ class JsFixtures extends Command
private function loginUser(Application $app, User $user) private function loginUser(Application $app, User $user)
{ {
$app['authentication']->openAccount($user); $app->getAuthenticator()->openAccount($user);
} }
private function logoutUser(Application $app) private function logoutUser(Application $app)
{ {
$app['authentication']->closeAccount(); $app->getAuthenticator()->closeAccount();
} }
private function writeResponse(OutputInterface $output, $method, $path, $to, $authenticateUser = false) private function writeResponse(OutputInterface $output, $method, $path, $to, $authenticateUser = false)

View File

@@ -128,7 +128,7 @@ class DashboardController extends Controller
$this->app->abort(400, '"admins" parameter must contains at least one value.'); $this->app->abort(400, '"admins" parameter must contains at least one value.');
} }
/** @var Authenticator $authenticator */ /** @var Authenticator $authenticator */
$authenticator = $this->app['authentication']; $authenticator = $this->app->getAuthenticator();
if (!in_array($authenticator->getUser()->getId(), $admins)) { if (!in_array($authenticator->getUser()->getId(), $admins)) {
$admins[] = $authenticator->getUser()->getId(); $admins[] = $authenticator->getUser()->getId();
} }

View File

@@ -271,7 +271,7 @@ class DataboxController extends Controller
$connection->beginTransaction(); $connection->beginTransaction();
try { try {
/** @var Authenticator $authenticator */ /** @var Authenticator $authenticator */
$authenticator = $this->app['authentication']; $authenticator = $this->app->getAuthenticator();
$baseId = \collection::mount_collection( $baseId = \collection::mount_collection(
$this->app, $this->app,
$this->findDataboxById($databox_id), $this->findDataboxById($databox_id),

View File

@@ -222,7 +222,7 @@ class DataboxesController extends Controller
$this->app['phraseanet.appbox']->get_connection()->beginTransaction(); $this->app['phraseanet.appbox']->get_connection()->beginTransaction();
$base = \databox::mount($this->app, $hostname, $port, $user, $password, $dbName); $base = \databox::mount($this->app, $hostname, $port, $user, $password, $dbName);
$base->registerAdmin($this->app['authentication']->getUser()); $base->registerAdmin($this->app->getAuthenticatedUser());
$this->app['phraseanet.appbox']->get_connection()->commit(); $this->app['phraseanet.appbox']->get_connection()->commit();
return $this->app->redirectPath('admin_database', [ return $this->app->redirectPath('admin_database', [

View File

@@ -208,7 +208,7 @@ class RecordsRequest extends ArrayCollection
if ($request->get('ssel')) { if ($request->get('ssel')) {
$basket = $app['converter.basket']->convert($request->get('ssel')); $basket = $app['converter.basket']->convert($request->get('ssel'));
$app['acl.basket']->hasAccess($basket, $app['authentication']->getUser()); $app['acl.basket']->hasAccess($basket, $app->getAuthenticatedUser());
foreach ($basket->getElements() as $basket_element) { foreach ($basket->getElements() as $basket_element) {
$received[$basket_element->getRecord($app)->get_serialize_key()] = $basket_element->getRecord($app); $received[$basket_element->getRecord($app)->get_serialize_key()] = $basket_element->getRecord($app);
@@ -217,7 +217,7 @@ class RecordsRequest extends ArrayCollection
$repository = $app['repo.story-wz']; $repository = $app['repo.story-wz'];
$storyWZ = $repository->findByUserAndId( $storyWZ = $repository->findByUserAndId(
$app, $app['authentication']->getUser() $app, $app->getAuthenticatedUser()
, $request->get('story') , $request->get('story')
); );
@@ -243,20 +243,20 @@ class RecordsRequest extends ArrayCollection
$to_remove = []; $to_remove = [];
foreach ($elements as $id => $record) { foreach ($elements as $id => $record) {
if (!$app['acl']->get($app['authentication']->getUser())->has_access_to_record($record)) { if (!$app['acl']->get($app->getAuthenticatedUser())->has_access_to_record($record)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }
foreach ($rightsColl as $right) { foreach ($rightsColl as $right) {
if (!$app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), $right)) { if (!$app['acl']->get($app->getAuthenticatedUser())->has_right_on_base($record->get_base_id(), $right)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }
} }
foreach ($rightsDatabox as $right) { foreach ($rightsDatabox as $right) {
if (!$app['acl']->get($app['authentication']->getUser())->has_right_on_sbas($record->get_sbas_id(), $right)) { if (!$app['acl']->get($app->getAuthenticatedUser())->has_right_on_sbas($record->get_sbas_id(), $right)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }

View File

@@ -177,7 +177,7 @@ class SetupController extends Controller
$user = $installer->install($email, $password, $abConn, $servername, $dataPath, $dbConn, $template, $binaryData); $user = $installer->install($email, $password, $abConn, $servername, $dataPath, $dbConn, $template, $binaryData);
$this->app['authentication']->openAccount($user); $this->app->getAuthenticator()->openAccount($user);
return $this->app->redirectPath('admin', [ return $this->app->redirectPath('admin', [
'section' => 'taskmanager', 'section' => 'taskmanager',

View File

@@ -24,7 +24,7 @@ class Datafiles implements ControllerProviderInterface, ServiceProviderInterface
public function register(Application $app) public function register(Application $app)
{ {
$app['controller.datafiles'] = $app->share(function (PhraseaApplication $app) { $app['controller.datafiles'] = $app->share(function (PhraseaApplication $app) {
return (new DatafileController($app, $app['phraseanet.appbox'], $app['acl'], $app['authentication'])) return (new DatafileController($app, $app['phraseanet.appbox'], $app['acl'], $app->getAuthenticator()))
->setDataboxLoggerLocator($app['phraseanet.logger']) ->setDataboxLoggerLocator($app['phraseanet.logger'])
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve')) ->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
; ;
@@ -40,7 +40,7 @@ class Datafiles implements ControllerProviderInterface, ServiceProviderInterface
$controllers = $app['controllers_factory']; $controllers = $app['controllers_factory'];
$controllers->before(function (Request $request) use ($app) { $controllers->before(function (Request $request) use ($app) {
if (!$app['authentication']->isAuthenticated()) { if (!$app->getAuthenticator()->isAuthenticated()) {
$app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri())); $app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri()));
} }
}); });

View File

@@ -119,8 +119,8 @@ class Lightbox implements ControllerProviderInterface, ServiceProviderInterface
return null; return null;
} }
if ($app['authentication']->isAuthenticated()) { if ($app->getAuthenticator()->isAuthenticated()) {
$app['authentication']->closeAccount(); $app->getAuthenticator()->closeAccount();
} }
if (null === $token = $app['repo.tokens']->findValidToken($request->query->get('LOG'))) { if (null === $token = $app['repo.tokens']->findValidToken($request->query->get('LOG'))) {
@@ -130,7 +130,7 @@ class Lightbox implements ControllerProviderInterface, ServiceProviderInterface
} }
/** @var Token $token */ /** @var Token $token */
$app['authentication']->openAccount($token->getUser()); $app->getAuthenticator()->openAccount($token->getUser());
switch ($token->getType()) { switch ($token->getType()) {
case TokenManipulator::TYPE_FEED_ENTRY: case TokenManipulator::TYPE_FEED_ENTRY:

View File

@@ -24,7 +24,7 @@ class Permalink implements ControllerProviderInterface, ServiceProviderInterface
public function register(Application $app) public function register(Application $app)
{ {
$app['controller.permalink'] = $app->share(function (PhraseaApplication $app) { $app['controller.permalink'] = $app->share(function (PhraseaApplication $app) {
return (new PermalinkController($app, $app['phraseanet.appbox'], $app['acl'], $app['authentication'])) return (new PermalinkController($app, $app['phraseanet.appbox'], $app['acl'], $app->getAuthenticator()))
->setDataboxLoggerLocator($app['phraseanet.logger']) ->setDataboxLoggerLocator($app['phraseanet.logger'])
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve')) ->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
; ;

View File

@@ -36,9 +36,9 @@ class PersistentCookieSubscriber implements EventSubscriberInterface
{ {
$request = $event->getRequest(); $request = $event->getRequest();
if ($this->app['configuration.store']->isSetup() && $request->cookies->has('persistent') && !$this->app['authentication']->isAuthenticated()) { if ($this->app['configuration.store']->isSetup() && $request->cookies->has('persistent') && !$this->app->getAuthenticator()->isAuthenticated()) {
if (false !== $session = $this->app['authentication.persistent-manager']->getSession($request->cookies->get('persistent'))) { if (false !== $session = $this->app['authentication.persistent-manager']->getSession($request->cookies->get('persistent'))) {
$this->app['authentication']->refreshAccount($session); $this->app->getAuthenticator()->refreshAccount($session);
} }
} }
} }

View File

@@ -97,7 +97,7 @@ class SessionManagerSubscriber implements EventSubscriberInterface
} }
// if we are already disconnected (ex. from another window), quit immediatly // if we are already disconnected (ex. from another window), quit immediatly
if (!($this->app['authentication']->isAuthenticated())) { if (!($this->app->getAuthenticator()->isAuthenticated())) {
if ($event->getRequest()->isXmlHttpRequest()) { if ($event->getRequest()->isXmlHttpRequest()) {
$response = new Response("End-Session", 403); $response = new Response("End-Session", 403);
} else { } else {
@@ -120,7 +120,7 @@ class SessionManagerSubscriber implements EventSubscriberInterface
$dt = $now->getTimestamp() - $session->getUpdated()->getTimestamp(); $dt = $now->getTimestamp() - $session->getUpdated()->getTimestamp();
if ($idle > 0 && $dt > $idle) { if ($idle > 0 && $dt > $idle) {
// we must disconnet due to idletime // we must disconnet due to idletime
$this->app['authentication']->closeAccount(); $this->app->getAuthenticator()->closeAccount();
if ($event->getRequest()->isXmlHttpRequest()) { if ($event->getRequest()->isXmlHttpRequest()) {
$response = new Response("End-Session", 403); $response = new Response("End-Session", 403);
} else { } else {

View File

@@ -28,14 +28,14 @@ class BasketMiddlewareProvider implements ServiceProviderInterface
$app['middleware.basket.user-access'] = $app->protect(function (Request $request, Application $app) { $app['middleware.basket.user-access'] = $app->protect(function (Request $request, Application $app) {
if ($request->attributes->has('basket')) { if ($request->attributes->has('basket')) {
if (!$app['acl.basket']->hasAccess($request->attributes->get('basket'), $app['authentication']->getUser())) { if (!$app['acl.basket']->hasAccess($request->attributes->get('basket'), $app->getAuthenticatedUser())) {
throw new AccessDeniedHttpException('Current user does not have access to the basket'); throw new AccessDeniedHttpException('Current user does not have access to the basket');
} }
} }
}); });
$app['middleware.basket.user-is-owner'] = $app->protect(function (Request $request, Application $app) { $app['middleware.basket.user-is-owner'] = $app->protect(function (Request $request, Application $app) {
if (!$app['acl.basket']->isOwner($request->attributes->get('basket'), $app['authentication']->getUser())) { if (!$app['acl.basket']->isOwner($request->attributes->get('basket'), $app->getAuthenticatedUser())) {
throw new AccessDeniedHttpException('Only basket owner can modify the basket'); throw new AccessDeniedHttpException('Only basket owner can modify the basket');
} }
}); });

View File

@@ -182,7 +182,7 @@ class RssFormatter extends FeedFormatterAbstract implements FeedFormatterInterfa
if ($feed->isPublic()) { if ($feed->isPublic()) {
$link = $app['feed.link-generator-collection']->generatePublic($feed, FeedLinkGenerator::FORMAT_RSS); $link = $app['feed.link-generator-collection']->generatePublic($feed, FeedLinkGenerator::FORMAT_RSS);
} else { } else {
$link = $app['feed.link-generator-collection']->generate($feed, $app['authentication']->getUser(), FeedLinkGenerator::FORMAT_RSS); $link = $app['feed.link-generator-collection']->generate($feed, $app->getAuthenticatedUser(), FeedLinkGenerator::FORMAT_RSS);
} }
$this->addTag($document, $item, 'title', $entry->getTitle()); $this->addTag($document, $item, 'title', $entry->getTitle());

View File

@@ -25,19 +25,19 @@ class Prod extends Helper
$bases = $fields = $dates = $sort = array(); $bases = $fields = $dates = $sort = array();
if (!$this->app['authentication']->getUser()) { if (!$this->app->getAuthenticatedUser()) {
return $searchData; return $searchData;
} }
$searchSet = json_decode($this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'search'), true); $searchSet = json_decode($this->app['settings']->getUserSetting($this->app->getAuthenticatedUser(), 'search'), true);
$saveSettings = $this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'advanced_search_reload'); $saveSettings = $this->app['settings']->getUserSetting($this->app->getAuthenticatedUser(), 'advanced_search_reload');
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_sbas() as $databox) { foreach ($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_sbas() as $databox) {
$sbasId = $databox->get_sbas_id(); $sbasId = $databox->get_sbas_id();
$bases[$sbasId] = array('thesaurus' => (trim($databox->get_thesaurus()) !== ""), 'cterms' => false, 'collections' => array(), 'sbas_id' => $sbasId); $bases[$sbasId] = array('thesaurus' => (trim($databox->get_thesaurus()) !== ""), 'cterms' => false, 'collections' => array(), 'sbas_id' => $sbasId);
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base([], [$databox->get_sbas_id()]) as $coll) { foreach ($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base([], [$databox->get_sbas_id()]) as $coll) {
$selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbasId])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbasId])) : true) : true; $selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbasId])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbasId])) : true) : true;
$bases[$sbasId]['collections'][] = array('selected' => $selected, 'base_id' => $coll->get_base_id()); $bases[$sbasId]['collections'][] = array('selected' => $selected, 'base_id' => $coll->get_base_id());
} }
@@ -78,7 +78,7 @@ class Prod extends Helper
if (!$bases[$sbasId]['thesaurus']) { if (!$bases[$sbasId]['thesaurus']) {
continue; continue;
} }
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbasId, 'bas_modif_th')) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($sbasId, 'bas_modif_th')) {
continue; continue;
} }

View File

@@ -109,7 +109,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
if (trim($Request->get('ssel')) !== '') { if (trim($Request->get('ssel')) !== '') {
$Basket = $app['converter.basket']->convert($Request->get('ssel')); $Basket = $app['converter.basket']->convert($Request->get('ssel'));
$app['acl.basket']->hasAccess($Basket, $app['authentication']->getUser()); $app['acl.basket']->hasAccess($Basket, $app->getAuthenticatedUser());
$this->selection->load_basket($Basket); $this->selection->load_basket($Basket);
@@ -118,7 +118,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
} elseif (trim($Request->get('story')) !== '') { } elseif (trim($Request->get('story')) !== '') {
$repository = $app['repo.story-wz']; $repository = $app['repo.story-wz'];
$storyWZ = $repository->findByUserAndId($app, $app['authentication']->getUser(), $Request->get('story')); $storyWZ = $repository->findByUserAndId($app, $app->getAuthenticatedUser(), $Request->get('story'));
$this->selection->load_list([$storyWZ->getRecord($this->app)->get_serialize_key()], $this->flatten_groupings); $this->selection->load_list([$storyWZ->getRecord($this->app)->get_serialize_key()], $this->flatten_groupings);
} else { } else {

View File

@@ -59,7 +59,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function delete_users() public function delete_users()
{ {
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
if ($this->app['authentication']->getUser()->getId() === (int) $usr_id) { if ($this->app->getAuthenticatedUser()->getId() === (int) $usr_id) {
continue; continue;
} }
$user = $this->app['repo.users']->find($usr_id); $user = $this->app['repo.users']->find($usr_id);
@@ -71,7 +71,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
protected function delete_user(User $user) protected function delete_user(User $user)
{ {
$list = array_keys($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['canadmin'])); $list = array_keys($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['canadmin']));
$this->app['acl']->get($user)->revoke_access_from_bases($list); $this->app['acl']->get($user)->revoke_access_from_bases($list);
@@ -84,7 +84,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function get_users_rights() public function get_users_rights()
{ {
$list = array_keys($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['canadmin'])); $list = array_keys($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['canadmin']));
$sql = "SELECT $sql = "SELECT
b.sbas_id, b.sbas_id,
@@ -476,7 +476,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function apply_rights() public function apply_rights()
{ {
$ACL = $this->app['acl']->get($this->app['authentication']->getUser()); $ACL = $this->app['acl']->get($this->app->getAuthenticatedUser());
$base_ids = array_keys($ACL->get_granted_base(['canadmin'])); $base_ids = array_keys($ACL->get_granted_base(['canadmin']));
$update = $create = $delete = $create_sbas = $update_sbas = []; $update = $create = $delete = $create_sbas = $update_sbas = [];
@@ -684,11 +684,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
if (null === $template) { if (null === $template) {
throw new NotFoundHttpException(sprintf('Given template "%s" could not be found', $this->request->get('template'))); throw new NotFoundHttpException(sprintf('Given template "%s" could not be found', $this->request->get('template')));
} }
if (null === $template->getTemplateOwner() || $template->getTemplateOwner()->getId() !== $this->app['authentication']->getUser()->getId()) { if (null === $template->getTemplateOwner() || $template->getTemplateOwner()->getId() !== $this->app->getAuthenticatedUser()->getId()) {
throw new AccessDeniedHttpException('You are not the owner of the template'); throw new AccessDeniedHttpException('You are not the owner of the template');
} }
$base_ids = array_keys($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['canadmin'])); $base_ids = array_keys($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['canadmin']));
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
$user = $this->app['repo.users']->find($usr_id); $user = $this->app['repo.users']->find($usr_id);
@@ -744,7 +744,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$activate = !!$this->request->get('limit'); $activate = !!$this->request->get('limit');
$base_ids = array_keys($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['canadmin'])); $base_ids = array_keys($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['canadmin']));
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
$user = $this->app['repo.users']->find($usr_id); $user = $this->app['repo.users']->find($usr_id);
@@ -763,7 +763,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function resetRights() public function resetRights()
{ {
$base_ids = array_keys($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['canadmin'])); $base_ids = array_keys($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['canadmin']));
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
$user = $this->app['repo.users']->find($usr_id); $user = $this->app['repo.users']->find($usr_id);
@@ -772,7 +772,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
if ($user->isTemplate()) { if ($user->isTemplate()) {
$template = $user; $template = $user;
if ($template->getTemplateOwner()->getId() !== $this->app['authentication']->getUser()->getId()) { if ($template->getTemplateOwner()->getId() !== $this->app->getAuthenticatedUser()->getId()) {
continue; continue;
} }
} }

View File

@@ -76,7 +76,7 @@ class Manage extends Helper
->last_model_is($this->query_parms['last_model']) ->last_model_is($this->query_parms['last_model'])
->get_inactives($this->query_parms['inactives']) ->get_inactives($this->query_parms['inactives'])
->include_templates(false) ->include_templates(false)
->on_bases_where_i_am($this->app['acl']->get($this->app['authentication']->getUser()), ['canadmin']) ->on_bases_where_i_am($this->app['acl']->get($this->app->getAuthenticatedUser()), ['canadmin'])
->execute(); ->execute();
return $this->results->get_results(); return $this->results->get_results();
@@ -114,7 +114,7 @@ class Manage extends Helper
->last_model_is($this->query_parms['last_model']) ->last_model_is($this->query_parms['last_model'])
->get_inactives($this->query_parms['inactives']) ->get_inactives($this->query_parms['inactives'])
->include_templates(true) ->include_templates(true)
->on_bases_where_i_am($this->app['acl']->get($this->app['authentication']->getUser()), ['canadmin']) ->on_bases_where_i_am($this->app['acl']->get($this->app->getAuthenticatedUser()), ['canadmin'])
->limit($offset_start, $results_quantity) ->limit($offset_start, $results_quantity)
->execute(); ->execute();
@@ -198,8 +198,8 @@ class Manage extends Helper
throw new \Exception_InvalidArgument('Invalid template name'); throw new \Exception_InvalidArgument('Invalid template name');
} }
$created_user = $this->app['manipulator.user']->createTemplate($name, $this->app['authentication']->getUser()); $created_user = $this->app['manipulator.user']->createTemplate($name, $this->app->getAuthenticatedUser());
$this->usr_id = $this->app['authentication']->getUser()->getId(); $this->usr_id = $this->app->getAuthenticatedUser()->getId();
return $created_user; return $created_user;
} }

View File

@@ -39,26 +39,26 @@ class WorkZone extends Helper
$ret = new ArrayCollection(); $ret = new ArrayCollection();
$baskets = $repo_baskets->findActiveByUser($this->app['authentication']->getUser(), $sort); $baskets = $repo_baskets->findActiveByUser($this->app->getAuthenticatedUser(), $sort);
// force creation of a default basket // force creation of a default basket
if (0 === count($baskets)) { if (0 === count($baskets)) {
$basket = new BasketEntity(); $basket = new BasketEntity();
$basket->setName($this->app->trans('Default basket')); $basket->setName($this->app->trans('Default basket'));
$basket->setUser($this->app['authentication']->getUser()); $basket->setUser($this->app->getAuthenticatedUser());
$this->app['orm.em']->persist($basket); $this->app['orm.em']->persist($basket);
$this->app['orm.em']->flush(); $this->app['orm.em']->flush();
$baskets = [$basket]; $baskets = [$basket];
} }
$validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort); $validations = $repo_baskets->findActiveValidationByUser($this->app->getAuthenticatedUser(), $sort);
/* @var $repo_stories Alchemy\Phrasea\Model\Repositories\StoryWZRepository */ /* @var $repo_stories Alchemy\Phrasea\Model\Repositories\StoryWZRepository */
$repo_stories = $this->app['repo.story-wz']; $repo_stories = $this->app['repo.story-wz'];
$stories = $repo_stories->findByUser($this->app, $this->app['authentication']->getUser(), $sort); $stories = $repo_stories->findByUser($this->app, $this->app->getAuthenticatedUser(), $sort);
$ret->set(self::BASKETS, $baskets); $ret->set(self::BASKETS, $baskets);
$ret->set(self::VALIDATIONS, $validations); $ret->set(self::VALIDATIONS, $validations);

View File

@@ -166,7 +166,7 @@ class PDF
$fimg = $subdef->get_pathfile(); $fimg = $subdef->get_pathfile();
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($rec->get_base_id(), "nowatermark") if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($rec->get_base_id(), "nowatermark")
&& $subdef->get_type() == \media_subdef::TYPE_IMAGE) { && $subdef->get_type() == \media_subdef::TYPE_IMAGE) {
$fimg = \recordutils_image::watermark($this->app, $subdef); $fimg = \recordutils_image::watermark($this->app, $subdef);
} }
@@ -438,7 +438,7 @@ class PDF
$f = $subdef->get_pathfile(); $f = $subdef->get_pathfile();
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($rec->get_base_id(), "nowatermark") if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($rec->get_base_id(), "nowatermark")
&& $subdef->get_type() == \media_subdef::TYPE_IMAGE) && $subdef->get_type() == \media_subdef::TYPE_IMAGE)
$f = \recordutils_image::watermark($this->app, $subdef); $f = \recordutils_image::watermark($this->app, $subdef);

View File

@@ -396,11 +396,11 @@ class ElasticSearchEngine implements SearchEngineInterface
private function createACLFilters() private function createACLFilters()
{ {
// No ACLs if no user // No ACLs if no user
if (false === $this->app['authentication']->isAuthenticated()) { if (false === $this->app->getAuthenticator()->isAuthenticated()) {
return []; return [];
} }
$acl = $this->app['acl']->get($this->app['authentication']->getUser()); $acl = $this->app['acl']->get($this->app->getAuthenticatedUser());
$grantedCollections = array_keys($acl->get_granted_base(['actif'])); $grantedCollections = array_keys($acl->get_granted_base(['actif']));

View File

@@ -550,7 +550,7 @@ class SearchEngineOptions
$options->setLocale($app['locale']); $options->setLocale($app['locale']);
/** @var Authenticator $authenticator */ /** @var Authenticator $authenticator */
$authenticator = $app['authentication']; $authenticator = $app->getAuthenticator();
$isAuthenticated = $authenticator->isAuthenticated(); $isAuthenticated = $authenticator->isAuthenticated();
/** @var ACLProvider $aclProvider */ /** @var ACLProvider $aclProvider */
$aclProvider = $app['acl']; $aclProvider = $app['acl'];

View File

@@ -41,7 +41,7 @@ class Firewall
{ {
$this->requireNotGuest(); $this->requireNotGuest();
if (!$this->app['acl']->get($this->app['authentication']->getUser())->is_admin()) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->is_admin()) {
$this->app->abort(403, 'Admin role is required'); $this->app->abort(403, 'Admin role is required');
} }
@@ -50,7 +50,7 @@ class Firewall
public function requireAccessToModule($module) public function requireAccessToModule($module)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_module($module)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_module($module)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -59,7 +59,7 @@ class Firewall
public function requireAccessToSbas($sbas_id) public function requireAccessToSbas($sbas_id)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_sbas($sbas_id)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_sbas($sbas_id)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -68,7 +68,7 @@ class Firewall
public function requireAccessToBase($base_id) public function requireAccessToBase($base_id)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_base($base_id)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_base($base_id)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -77,7 +77,7 @@ class Firewall
public function requireRight($right) public function requireRight($right)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right($right)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right($right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -86,7 +86,7 @@ class Firewall
public function requireRightOnBase($base_id, $right) public function requireRightOnBase($base_id, $right)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($base_id, $right)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($base_id, $right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -95,7 +95,7 @@ class Firewall
public function requireRightOnSbas($sbas_id, $right) public function requireRightOnSbas($sbas_id, $right)
{ {
if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, $right)) { if (!$this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($sbas_id, $right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -104,7 +104,7 @@ class Firewall
public function requireNotGuest() public function requireNotGuest()
{ {
if ($this->app['authentication']->getUser()->isGuest()) { if ($this->app->getAuthenticatedUser()->isGuest()) {
$this->app->abort(403, 'Guests do not have admin role'); $this->app->abort(403, 'Guests do not have admin role');
} }
@@ -117,7 +117,7 @@ class Firewall
if (null !== $request) { if (null !== $request) {
$params['redirect'] = '..' . $request->getPathInfo().'?'.$request->getQueryString(); $params['redirect'] = '..' . $request->getPathInfo().'?'.$request->getQueryString();
} }
if (!$this->app['authentication']->isAuthenticated()) { if (!$this->app->getAuthenticator()->isAuthenticated()) {
return new RedirectResponse($this->app->path('homepage', $params)); return new RedirectResponse($this->app->path('homepage', $params));
} }
} }
@@ -139,14 +139,14 @@ class Firewall
public function requireNotAuthenticated() public function requireNotAuthenticated()
{ {
if ($this->app['authentication']->isAuthenticated()) { if ($this->app->getAuthenticator()->isAuthenticated()) {
return new RedirectResponse($this->app->path('prod')); return new RedirectResponse($this->app->path('prod'));
} }
} }
public function requireOrdersAdmin() public function requireOrdersAdmin()
{ {
if (false === !!count($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base(['order_master']))) { if (false === !!count($this->app['acl']->get($this->app->getAuthenticatedUser())->get_granted_base(['order_master']))) {
$this->app->abort(403, 'You are not an order admin'); $this->app->abort(403, 'You are not an order admin');
} }

View File

@@ -128,14 +128,14 @@ class PhraseanetExtension extends \Twig_Extension
public function isGrantedOnDatabox($databoxId, $rights) public function isGrantedOnDatabox($databoxId, $rights)
{ {
if (false === ($this->app['authentication']->getUser() instanceof User)) { if (false === ($this->app->getAuthenticatedUser() instanceof User)) {
return false; return false;
} }
$rights = (array) $rights; $rights = (array) $rights;
foreach ($rights as $right) { foreach ($rights as $right) {
if (false === $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($databoxId, $right)) { if (false === $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($databoxId, $right)) {
return false; return false;
} }
@@ -146,14 +146,14 @@ class PhraseanetExtension extends \Twig_Extension
public function isGrantedOnCollection($baseId, $rights) public function isGrantedOnCollection($baseId, $rights)
{ {
if (false === ($this->app['authentication']->getUser() instanceof User)) { if (false === ($this->app->getAuthenticatedUser() instanceof User)) {
return false; return false;
} }
$rights = (array) $rights; $rights = (array) $rights;
foreach ($rights as $right) { foreach ($rights as $right) {
if (false === $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($baseId, $right)) { if (false === $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($baseId, $right)) {
return false; return false;
} }
@@ -177,12 +177,12 @@ class PhraseanetExtension extends \Twig_Extension
public function hasAccessSubDefinition(RecordInterface $record, $subDefinition) public function hasAccessSubDefinition(RecordInterface $record, $subDefinition)
{ {
if (false === ($this->app['authentication']->getUser() instanceof User)) { if (false === ($this->app->getAuthenticatedUser() instanceof User)) {
return false; return false;
} }
return $this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_subdef($record, $subDefinition); return $this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_subdef($record, $subDefinition);
} }
public function getDoctypeIcon(RecordInterface $record) public function getDoctypeIcon(RecordInterface $record)
@@ -260,12 +260,12 @@ class PhraseanetExtension extends \Twig_Extension
public function getUserSetting($setting, $default = null) public function getUserSetting($setting, $default = null)
{ {
if (false === ($this->app['authentication']->getUser() instanceof User)) { if (false === ($this->app->getAuthenticatedUser() instanceof User)) {
return $default; return $default;
} }
return $this->app['settings']->getUserSetting($this->app['authentication']->getUser(), $setting, $default); return $this->app['settings']->getUserSetting($this->app->getAuthenticatedUser(), $setting, $default);
} }
public function getCheckerFromFQCN($checkerFQCN) public function getCheckerFromFQCN($checkerFQCN)

View File

@@ -98,8 +98,8 @@ class Session_Logger
{ {
$colls = []; $colls = [];
if ($app['authentication']->getUser()) { if ($app->getAuthenticatedUser()) {
$bases = $app['acl']->get($app['authentication']->getUser())->get_granted_base([], [$databox->get_sbas_id()]); $bases = $app['acl']->get($app->getAuthenticatedUser())->get_granted_base([], [$databox->get_sbas_id()]);
foreach ($bases as $collection) { foreach ($bases as $collection) {
$colls[] = $collection->get_coll_id(); $colls[] = $collection->get_coll_id();
} }
@@ -118,9 +118,9 @@ class Session_Logger
$params = [ $params = [
':ses_id' => $app['session']->get('session_id'), ':ses_id' => $app['session']->get('session_id'),
':usr_login' => $app['authentication']->getUser() ? $app['authentication']->getUser()->getLogin() : null, ':usr_login' => $app->getAuthenticatedUser() ? $app->getAuthenticatedUser()->getLogin() : null,
':site_id' => $app['conf']->get(['main', 'key']), ':site_id' => $app['conf']->get(['main', 'key']),
':usr_id' => $app['authentication']->isAuthenticated() ? $app['authentication']->getUser()->getId() : null, ':usr_id' => $app->getAuthenticator()->isAuthenticated() ? $app->getAuthenticatedUser()->getId() : null,
':browser' => $browser->getBrowser(), ':browser' => $browser->getBrowser(),
':browser_version' => $browser->getExtendedVersion(), ':browser_version' => $browser->getExtendedVersion(),
':platform' => $browser->getPlatform(), ':platform' => $browser->getPlatform(),
@@ -128,10 +128,10 @@ class Session_Logger
':ip' => $browser->getIP(), ':ip' => $browser->getIP(),
':user_agent' => $browser->getUserAgent(), ':user_agent' => $browser->getUserAgent(),
':appli' => serialize([]), ':appli' => serialize([]),
':fonction' => $app['authentication']->getUser() ? $app['authentication']->getUser()->getJob() : null, ':fonction' => $app->getAuthenticatedUser() ? $app->getAuthenticatedUser()->getJob() : null,
':company' => $app['authentication']->getUser() ? $app['authentication']->getUser()->getCompany() : null, ':company' => $app->getAuthenticatedUser() ? $app->getAuthenticatedUser()->getCompany() : null,
':activity' => $app['authentication']->getUser() ? $app['authentication']->getUser()->getActivity() : null, ':activity' => $app->getAuthenticatedUser() ? $app->getAuthenticatedUser()->getActivity() : null,
':country' => $app['authentication']->getUser() ? $app['authentication']->getUser()->getCountry() : null ':country' => $app->getAuthenticatedUser() ? $app->getAuthenticatedUser()->getCountry() : null
]; ];
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
@@ -157,7 +157,7 @@ class Session_Logger
public static function load(Application $app, databox $databox) public static function load(Application $app, databox $databox)
{ {
if ( ! $app['authentication']->isAuthenticated()) { if ( ! $app->getAuthenticator()->isAuthenticated()) {
throw new Exception_Session_LoggerNotFound('Not authenticated'); throw new Exception_Session_LoggerNotFound('Not authenticated');
} }
@@ -182,7 +182,7 @@ class Session_Logger
public static function updateClientInfos(Application $app, $appId) public static function updateClientInfos(Application $app, $appId)
{ {
if (!$app['authentication']->isAuthenticated()) { if (!$app->getAuthenticator()->isAuthenticated()) {
return; return;
} }
@@ -218,7 +218,7 @@ class Session_Logger
]; ];
if (isset($appName[$appId])) { if (isset($appName[$appId])) {
$sbas_ids = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_sbas()); $sbas_ids = array_keys($app['acl']->get($app->getAuthenticatedUser())->get_granted_sbas());
foreach ($sbas_ids as $sbas_id) { foreach ($sbas_ids as $sbas_id) {
try { try {

View File

@@ -814,14 +814,14 @@ class User_Query implements User_QueryInterface
} }
if ($this->only_templates === true) { if ($this->only_templates === true) {
if (!$this->app['authentication']->getUser()) { if (!$this->app->getAuthenticatedUser()) {
throw new InvalidArgumentException('Unable to load templates while disconnected'); throw new InvalidArgumentException('Unable to load templates while disconnected');
} }
$sql .= ' AND model_of = ' . $this->app['authentication']->getUser()->getId(); $sql .= ' AND model_of = ' . $this->app->getAuthenticatedUser()->getId();
} elseif ($this->include_templates === false) { } elseif ($this->include_templates === false) {
$sql .= ' AND model_of IS NULL'; $sql .= ' AND model_of IS NULL';
} elseif ($this->app['authentication']->getUser()) { } elseif ($this->app->getAuthenticatedUser()) {
$sql .= ' AND (model_of IS NULL OR model_of = ' . $this->app['authentication']->getUser()->getId() . ' ) '; $sql .= ' AND (model_of IS NULL OR model_of = ' . $this->app->getAuthenticatedUser()->getId() . ' ) ';
} else { } else {
$sql .= ' AND model_of IS NULL'; $sql .= ' AND model_of IS NULL';
} }

View File

@@ -59,10 +59,10 @@ class databox_cgu
$userValidation = true; $userValidation = true;
if (! $home) { if (! $home) {
if ( ! $app['acl']->get($app['authentication']->getUser())->has_access_to_sbas($databox->get_sbas_id())) { if ( ! $app['acl']->get($app->getAuthenticatedUser())->has_access_to_sbas($databox->get_sbas_id())) {
continue; continue;
} }
$userValidation = ($app['settings']->getUserSetting($app['authentication']->getUser(), 'terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== ''); $userValidation = ($app['settings']->getUserSetting($app->getAuthenticatedUser(), 'terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== '');
} }
if ($userValidation) if ($userValidation)

View File

@@ -22,10 +22,10 @@ class databox_status
public static function getSearchStatus(Application $app) public static function getSearchStatus(Application $app)
{ {
$see_all = $structures = $stats = []; $see_all = $structures = $stats = [];
foreach ($app['acl']->get($app['authentication']->getUser())->get_granted_sbas() as $databox) { foreach ($app['acl']->get($app->getAuthenticatedUser())->get_granted_sbas() as $databox) {
$see_all[$databox->get_sbas_id()] = false; $see_all[$databox->get_sbas_id()] = false;
foreach ($databox->get_collections() as $collection) { foreach ($databox->get_collections() as $collection) {
if ($app['acl']->get($app['authentication']->getUser())->has_right_on_base($collection->get_base_id(), 'chgstatus')) { if ($app['acl']->get($app->getAuthenticatedUser())->has_right_on_base($collection->get_base_id(), 'chgstatus')) {
$see_all[$databox->get_sbas_id()] = true; $see_all[$databox->get_sbas_id()] = true;
break; break;
} }

View File

@@ -105,7 +105,7 @@ class eventsmanager_broker
FROM notifications WHERE usr_id = :usr_id'; FROM notifications WHERE usr_id = :usr_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':usr_id' => $this->app['authentication']->getUser()->getId()]); $stmt->execute([':usr_id' => $this->app->getAuthenticatedUser()->getId()]);
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
@@ -123,7 +123,7 @@ class eventsmanager_broker
$data = ['notifications' => [], 'next' => '']; $data = ['notifications' => [], 'next' => ''];
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':usr_id' => $this->app['authentication']->getUser()->getId()]); $stmt->execute([':usr_id' => $this->app->getAuthenticatedUser()->getId()]);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
@@ -179,7 +179,7 @@ class eventsmanager_broker
FROM notifications FROM notifications
WHERE usr_id = :usr_id AND unread="1"'; WHERE usr_id = :usr_id AND unread="1"';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':usr_id' => $this->app['authentication']->getUser()->getId()]); $stmt->execute([':usr_id' => $this->app->getAuthenticatedUser()->getId()]);
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
@@ -198,7 +198,7 @@ class eventsmanager_broker
FROM notifications WHERE usr_id = :usr_id'; FROM notifications WHERE usr_id = :usr_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':usr_id' => $this->app['authentication']->getUser()->getId()]); $stmt->execute([':usr_id' => $this->app->getAuthenticatedUser()->getId()]);
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
@@ -216,7 +216,7 @@ class eventsmanager_broker
$ret = []; $ret = [];
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':usr_id' => $this->app['authentication']->getUser()->getId()]); $stmt->execute([':usr_id' => $this->app->getAuthenticatedUser()->getId()]);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();

View File

@@ -50,7 +50,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
try { try {
$repository = $this->app['repo.baskets']; $repository = $this->app['repo.baskets'];
$basket = $repository->findUserBasket($ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($ssel_id, $this->app->getAuthenticatedUser(), false);
} catch (\Exception $e) { } catch (\Exception $e) {
return []; return [];
} }

View File

@@ -49,7 +49,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
try { try {
$repository = $this->app['repo.baskets']; $repository = $this->app['repo.baskets'];
$basket = $repository->findUserBasket($ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($ssel_id, $this->app->getAuthenticatedUser(), false);
} catch (\Exception $e) { } catch (\Exception $e) {
return []; return [];
} }

View File

@@ -253,7 +253,7 @@ class module_report
$this->dmax = $d2; $this->dmax = $d2;
$this->sbas_id = $sbas_id; $this->sbas_id = $sbas_id;
$this->list_coll_id = $collist; $this->list_coll_id = $collist;
$this->user_id = $this->app['authentication']->getUser()->getId(); $this->user_id = $this->app->getAuthenticatedUser()->getId();
$this->periode = sprintf( $this->periode = sprintf(
'%s - %s ', '%s - %s ',
$this->app['date-formatter']->getPrettyString(new \DateTime($d1)), $this->app['date-formatter']->getPrettyString(new \DateTime($d1)),

View File

@@ -1712,7 +1712,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
throw new Exception('This record is not a grouping'); throw new Exception('This record is not a grouping');
} }
if ($this->app['authentication']->getUser()) { if ($this->app->getAuthenticatedUser()) {
$sql = 'SELECT record_id $sql = 'SELECT record_id
FROM regroup g FROM regroup g
INNER JOIN (record r INNER JOIN (record r
@@ -1728,7 +1728,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$params = [ $params = [
':site' => $this->app['conf']->get(['main', 'key']), ':site' => $this->app['conf']->get(['main', 'key']),
':usr_id' => $this->app['authentication']->getUser()->getId(), ':usr_id' => $this->app->getAuthenticatedUser()->getId(),
':record_id' => $this->get_record_id(), ':record_id' => $this->get_record_id(),
]; ];
} else { } else {
@@ -1780,7 +1780,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$stmt = $this->get_databox()->get_connection()->prepare($sql); $stmt = $this->get_databox()->get_connection()->prepare($sql);
$stmt->execute([ $stmt->execute([
':site' => $this->app['conf']->get(['main', 'key']), ':site' => $this->app['conf']->get(['main', 'key']),
':usr_id' => $this->app['authentication']->getUser()->getId(), ':usr_id' => $this->app->getAuthenticatedUser()->getId(),
':record_id' => $this->get_record_id(), ':record_id' => $this->get_record_id(),
]); ]);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);

View File

@@ -102,17 +102,17 @@ class record_exportElement extends record_adapter
'thumbnail' => true 'thumbnail' => true
]; ];
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'candwnldhd')) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
$go_dl['document'] = true; $go_dl['document'] = true;
} }
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'candwnldpreview')) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
$go_dl['preview'] = true; $go_dl['preview'] = true;
} }
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_hd_grant($this)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_hd_grant($this)) {
$go_dl['document'] = true; $go_dl['document'] = true;
$go_dl['preview'] = true; $go_dl['preview'] = true;
} }
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_preview_grant($this)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_preview_grant($this)) {
$go_dl['preview'] = true; $go_dl['preview'] = true;
} }
@@ -122,14 +122,14 @@ class record_exportElement extends record_adapter
->who_have_right(['order_master']) ->who_have_right(['order_master'])
->execute()->get_results(); ->execute()->get_results();
$go_cmd = (count($masters) > 0 && $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->base_id, 'cancmd')); $go_cmd = (count($masters) > 0 && $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($this->base_id, 'cancmd'));
$orderable['document'] = false; $orderable['document'] = false;
$downloadable['document'] = false; $downloadable['document'] = false;
if (isset($sd['document']) && is_file($sd['document']->get_pathfile())) { if (isset($sd['document']) && is_file($sd['document']->get_pathfile())) {
if ($go_dl['document'] === true) { if ($go_dl['document'] === true) {
if ($this->app['acl']->get($this->app['authentication']->getUser())->is_restricted_download($this->base_id)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->is_restricted_download($this->base_id)) {
$this->remain_hd --; $this->remain_hd --;
if ($this->remain_hd >= 0) { if ($this->remain_hd >= 0) {
$localizedLabel = $this->app->trans('document original'); $localizedLabel = $this->app->trans('document original');
@@ -183,7 +183,7 @@ class record_exportElement extends record_adapter
if (isset($sd[$name]) && $sd[$name]->is_physically_present()) { if (isset($sd[$name]) && $sd[$name]->is_physically_present()) {
if ($class == 'document') { if ($class == 'document') {
if ($this->app['acl']->get($this->app['authentication']->getUser())->is_restricted_download($this->base_id)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->is_restricted_download($this->base_id)) {
$this->remain_hd --; $this->remain_hd --;
if ($this->remain_hd >= 0) if ($this->remain_hd >= 0)
$downloadable[$name] = [ $downloadable[$name] = [

View File

@@ -139,7 +139,7 @@ class record_preview extends record_adapter
break; break;
case "BASK": case "BASK":
$Basket = $app['converter.basket']->convert($contId); $Basket = $app['converter.basket']->convert($contId);
$app['acl.basket']->hasAccess($Basket, $app['authentication']->getUser()); $app['acl.basket']->hasAccess($Basket, $app->getAuthenticatedUser());
/* @var $Basket Basket */ /* @var $Basket Basket */
$this->container = $Basket; $this->container = $Basket;
@@ -325,7 +325,7 @@ class record_preview extends record_adapter
$tab = []; $tab = [];
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'canreport'); $report = $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'canreport');
$databox = $this->app->findDataboxById($this->get_sbas_id()); $databox = $this->app->findDataboxById($this->get_sbas_id());
$connsbas = $databox->get_connection(); $connsbas = $databox->get_connection();
@@ -338,7 +338,7 @@ class record_preview extends record_adapter
if (! $report) { if (! $report) {
$sql .= ' AND ((l.usrid = :usr_id AND l.site= :site) OR action="add")'; $sql .= ' AND ((l.usrid = :usr_id AND l.site= :site) OR action="add")';
$params[':usr_id'] = $this->app['authentication']->getUser()->getId(); $params[':usr_id'] = $this->app->getAuthenticatedUser()->getId();
$params[':site'] = $this->app['conf']->get(['main', 'key']); $params[':site'] = $this->app['conf']->get(['main', 'key']);
} }
@@ -401,7 +401,7 @@ class record_preview extends record_adapter
return $this->view_popularity; return $this->view_popularity;
} }
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base( $report = $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base(
$this->get_base_id(), 'canreport'); $this->get_base_id(), 'canreport');
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) { if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {
@@ -491,7 +491,7 @@ class record_preview extends record_adapter
return $this->refferer_popularity; return $this->refferer_popularity;
} }
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base( $report = $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base(
$this->get_base_id(), 'canreport'); $this->get_base_id(), 'canreport');
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) { if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {
@@ -564,7 +564,7 @@ class record_preview extends record_adapter
return $this->download_popularity; return $this->download_popularity;
} }
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'canreport'); $report = $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'canreport');
$ret = false; $ret = false;
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) { if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {

View File

@@ -49,7 +49,7 @@ class set_export extends set_abstract
if ($storyWZid) { if ($storyWZid) {
$repository = $app['repo.story-wz']; $repository = $app['repo.story-wz'];
$storyWZ = $repository->findByUserAndId($this->app, $app['authentication']->getUser(), $storyWZid); $storyWZ = $repository->findByUserAndId($this->app, $app->getAuthenticatedUser(), $storyWZid);
$lst = $storyWZ->getRecord($this->app)->get_serialize_key(); $lst = $storyWZ->getRecord($this->app)->get_serialize_key();
} }
@@ -58,7 +58,7 @@ class set_export extends set_abstract
$repository = $app['repo.baskets']; $repository = $app['repo.baskets'];
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */ /* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */
$Basket = $repository->findUserBasket($sstid, $app['authentication']->getUser(), false); $Basket = $repository->findUserBasket($sstid, $app->getAuthenticatedUser(), false);
$this->exportName = str_replace([' ', '\\', '/'], '_', $Basket->getName()) . "_" . date("Y-n-d"); $this->exportName = str_replace([' ', '\\', '/'], '_', $Basket->getName()) . "_" . date("Y-n-d");
foreach ($Basket->getElements() as $basket_element) { foreach ($Basket->getElements() as $basket_element) {
@@ -66,8 +66,8 @@ class set_export extends set_abstract
$record_id = $basket_element->getRecord($this->app)->get_record_id(); $record_id = $basket_element->getRecord($this->app)->get_record_id();
if (!isset($remain_hd[$base_id])) { if (!isset($remain_hd[$base_id])) {
if ($app['acl']->get($app['authentication']->getUser())->is_restricted_download($base_id)) { if ($app['acl']->get($app->getAuthenticatedUser())->is_restricted_download($base_id)) {
$remain_hd[$base_id] = $app['acl']->get($app['authentication']->getUser())->remaining_download($base_id); $remain_hd[$base_id] = $app['acl']->get($app->getAuthenticatedUser())->remaining_download($base_id);
} else { } else {
$remain_hd[$base_id] = false; $remain_hd[$base_id] = false;
} }
@@ -106,8 +106,8 @@ class set_export extends set_abstract
$record_id = $child_basrec->get_record_id(); $record_id = $child_basrec->get_record_id();
if (!isset($remain_hd[$base_id])) { if (!isset($remain_hd[$base_id])) {
if ($app['acl']->get($app['authentication']->getUser())->is_restricted_download($base_id)) { if ($app['acl']->get($app->getAuthenticatedUser())->is_restricted_download($base_id)) {
$remain_hd[$base_id] = $app['acl']->get($app['authentication']->getUser())->remaining_download($base_id); $remain_hd[$base_id] = $app['acl']->get($app->getAuthenticatedUser())->remaining_download($base_id);
} else { } else {
$remain_hd[$base_id] = false; $remain_hd[$base_id] = false;
} }
@@ -129,8 +129,8 @@ class set_export extends set_abstract
$record_id = $record->get_record_id(); $record_id = $record->get_record_id();
if (!isset($remain_hd[$base_id])) { if (!isset($remain_hd[$base_id])) {
if ($app['acl']->get($app['authentication']->getUser())->is_restricted_download($base_id)) { if ($app['acl']->get($app->getAuthenticatedUser())->is_restricted_download($base_id)) {
$remain_hd[$base_id] = $app['acl']->get($app['authentication']->getUser())->remaining_download($base_id); $remain_hd[$base_id] = $app['acl']->get($app->getAuthenticatedUser())->remaining_download($base_id);
} else { } else {
$remain_hd[$base_id] = false; $remain_hd[$base_id] = false;
} }
@@ -164,7 +164,7 @@ class set_export extends set_abstract
$this->businessFieldsAccess = false; $this->businessFieldsAccess = false;
foreach ($this->elements as $download_element) { foreach ($this->elements as $download_element) {
if ($app['acl']->get($app['authentication']->getUser())->has_right_on_base($download_element->get_base_id(), 'canmodifrecord')) { if ($app['acl']->get($app->getAuthenticatedUser())->has_right_on_base($download_element->get_base_id(), 'canmodifrecord')) {
$this->businessFieldsAccess = true; $this->businessFieldsAccess = true;
} }
@@ -216,11 +216,11 @@ class set_export extends set_abstract
$display_ftp = []; $display_ftp = [];
$hasadminright = $app['acl']->get($app['authentication']->getUser())->has_right('addrecord') $hasadminright = $app['acl']->get($app->getAuthenticatedUser())->has_right('addrecord')
|| $app['acl']->get($app['authentication']->getUser())->has_right('deleterecord') || $app['acl']->get($app->getAuthenticatedUser())->has_right('deleterecord')
|| $app['acl']->get($app['authentication']->getUser())->has_right('modifyrecord') || $app['acl']->get($app->getAuthenticatedUser())->has_right('modifyrecord')
|| $app['acl']->get($app['authentication']->getUser())->has_right('coll_manage') || $app['acl']->get($app->getAuthenticatedUser())->has_right('coll_manage')
|| $app['acl']->get($app['authentication']->getUser())->has_right('coll_modify_struct'); || $app['acl']->get($app->getAuthenticatedUser())->has_right('coll_modify_struct');
$this->ftp_datas = []; $this->ftp_datas = [];
@@ -228,7 +228,7 @@ class set_export extends set_abstract
$display_ftp = $display_download; $display_ftp = $display_download;
$this->total_ftp = $this->total_download; $this->total_ftp = $this->total_download;
$lst_base_id = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base()); $lst_base_id = array_keys($app['acl']->get($app->getAuthenticatedUser())->get_granted_base());
if ($hasadminright) { if ($hasadminright) {
$sql = "SELECT Users.id AS usr_id ,Users.login AS usr_login ,Users.email AS usr_mail, FtpCredential.* $sql = "SELECT Users.id AS usr_id ,Users.login AS usr_login ,Users.email AS usr_mail, FtpCredential.*
@@ -258,7 +258,7 @@ class set_export extends set_abstract
) )
) )
GROUP BY Users.id "; GROUP BY Users.id ";
$params = [':usr_id' => $app['authentication']->getUser()->getId()]; $params = [':usr_id' => $app->getAuthenticatedUser()->getId()];
} }
$datas[] = [ $datas[] = [
@@ -272,7 +272,7 @@ class set_export extends set_abstract
'prefix_folder' => 'Export_' . date("Y-m-d_H.i.s"), 'prefix_folder' => 'Export_' . date("Y-m-d_H.i.s"),
'passive' => false, 'passive' => false,
'max_retry' => 5, 'max_retry' => 5,
'sendermail' => $app['authentication']->getUser()->getEmail() 'sendermail' => $app->getAuthenticatedUser()->getEmail()
]; ];
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
@@ -296,7 +296,7 @@ class set_export extends set_abstract
'passive' => !! $row['passive'], 'passive' => !! $row['passive'],
'max_retry' => $row['max_retry'], 'max_retry' => $row['max_retry'],
'usr_mail' => $row['usr_mail'], 'usr_mail' => $row['usr_mail'],
'sender_mail' => $app['authentication']->getUser()->getEmail() 'sender_mail' => $app->getAuthenticatedUser()->getEmail()
]; ];
} }
@@ -631,7 +631,7 @@ class set_export extends set_abstract
$files[$id]["export_name"] = $tmp_name; $files[$id]["export_name"] = $tmp_name;
if (in_array('caption', $subdefs)) { if (in_array('caption', $subdefs)) {
$caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app['authentication']->getUser()->getId().'/'; $caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app->getAuthenticatedUser()->getId().'/';
$filesystem->mkdir($caption_dir, 0750); $filesystem->mkdir($caption_dir, 0750);
@@ -652,7 +652,7 @@ class set_export extends set_abstract
} }
if (in_array('caption-yaml', $subdefs)) { if (in_array('caption-yaml', $subdefs)) {
$caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app['authentication']->getUser()->getId().'/'; $caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app->getAuthenticatedUser()->getId().'/';
$filesystem->mkdir($caption_dir, 0750); $filesystem->mkdir($caption_dir, 0750);
@@ -775,8 +775,8 @@ class set_export extends set_abstract
$log["poids"] = $obj["size"]; $log["poids"] = $obj["size"];
$log["shortXml"] = $app['serializer.caption']->serialize($record_object->get_caption(), CaptionSerializer::SERIALIZE_XML); $log["shortXml"] = $app['serializer.caption']->serialize($record_object->get_caption(), CaptionSerializer::SERIALIZE_XML);
$tmplog[$record_object->get_base_id()][] = $log; $tmplog[$record_object->get_base_id()][] = $log;
if (!$anonymous && $o == 'document' && null !== $app['authentication']->getUser()) { if (!$anonymous && $o == 'document' && null !== $app->getAuthenticatedUser()) {
$app['acl']->get($app['authentication']->getUser())->remove_remaining($record_object->get_base_id()); $app['acl']->get($app->getAuthenticatedUser())->remove_remaining($record_object->get_base_id());
} }
} }
@@ -786,7 +786,7 @@ class set_export extends set_abstract
$list_base = array_unique(array_keys($tmplog)); $list_base = array_unique(array_keys($tmplog));
if (!$anonymous && null !== $app['authentication']->getUser()) { if (!$anonymous && null !== $app->getAuthenticatedUser()) {
$sql = "UPDATE basusr $sql = "UPDATE basusr
SET remain_dwnld = :remain_dl SET remain_dwnld = :remain_dl
WHERE base_id = :base_id AND usr_id = :usr_id"; WHERE base_id = :base_id AND usr_id = :usr_id";
@@ -794,11 +794,11 @@ class set_export extends set_abstract
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
foreach ($list_base as $base_id) { foreach ($list_base as $base_id) {
if ($app['acl']->get($app['authentication']->getUser())->is_restricted_download($base_id)) { if ($app['acl']->get($app->getAuthenticatedUser())->is_restricted_download($base_id)) {
$params = [ $params = [
':remain_dl' => $app['acl']->get($app['authentication']->getUser())->remaining_download($base_id) ':remain_dl' => $app['acl']->get($app->getAuthenticatedUser())->remaining_download($base_id)
, ':base_id' => $base_id , ':base_id' => $base_id
, ':usr_id' => $app['acl']->get($app['authentication']->getUser())->getId() , ':usr_id' => $app['acl']->get($app->getAuthenticatedUser())->getId()
]; ];
$stmt->execute($params); $stmt->execute($params);

View File

@@ -39,7 +39,7 @@ class set_exportftp extends set_export
$text_mail_receiver = "Bonjour,\n" $text_mail_receiver = "Bonjour,\n"
. "L'utilisateur " . "L'utilisateur "
. $this->app['authentication']->getUser()->getDisplayName() . " (login : " . $this->app['authentication']->getUser()->getLogin() . ") " . $this->app->getAuthenticatedUser()->getDisplayName() . " (login : " . $this->app->getAuthenticatedUser()->getLogin() . ") "
. "a fait un transfert FTP sur le serveur ayant comme adresse \"" . "a fait un transfert FTP sur le serveur ayant comme adresse \""
. $host . "\" avec le login \"" . $login . "\" " . $host . "\" avec le login \"" . $login . "\" "
. "et pour repertoire de destination \"" . "et pour repertoire de destination \""
@@ -58,10 +58,10 @@ class set_exportftp extends set_export
->setMail($email_dest) ->setMail($email_dest)
->setLogfile($logfile) ->setLogfile($logfile)
->setFoldertocreate($makedirectory) ->setFoldertocreate($makedirectory)
->setUser($this->app['authentication']->getUser()) ->setUser($this->app->getAuthenticatedUser())
->setTextMailSender($text_mail_sender) ->setTextMailSender($text_mail_sender)
->setTextMailReceiver($text_mail_receiver) ->setTextMailReceiver($text_mail_receiver)
->setSendermail($this->app['authentication']->getUser()->getEmail()) ->setSendermail($this->app->getAuthenticatedUser()->getEmail())
->setDestfolder($destfolder) ->setDestfolder($destfolder)
->setPassif($passif == '1') ->setPassif($passif == '1')
->setPwd($password) ->setPwd($password)

View File

@@ -57,26 +57,26 @@ class set_selection extends set_abstract
$sbas_id = $record->get_sbas_id(); $sbas_id = $record->get_sbas_id();
$record_id = $record->get_record_id(); $record_id = $record->get_record_id();
if (! $rights) { if (! $rights) {
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_hd_grant($record)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_hd_grant($record)) {
continue; continue;
} }
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_preview_grant($record)) { if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_preview_grant($record)) {
continue; continue;
} }
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_base($base_id)) { if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_base($base_id)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }
} else { } else {
foreach ($rights as $right) { foreach ($rights as $right) {
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($base_id, $right)) { if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($base_id, $right)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }
} }
foreach ($sbas_rights as $right) { foreach ($sbas_rights as $right) {
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, $right)) { if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($sbas_id, $right)) {
$to_remove[] = $id; $to_remove[] = $id;
continue; continue;
} }
@@ -88,8 +88,8 @@ class set_selection extends set_abstract
$sql = 'SELECT record_id $sql = 'SELECT record_id
FROM record FROM record
WHERE ((status ^ ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_xor($base_id) . ') WHERE ((status ^ ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_xor($base_id) . ')
& ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_and($base_id) . ')=0 & ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_and($base_id) . ')=0
AND record_id = :record_id'; AND record_id = :record_id';
$stmt = $connsbas->prepare($sql); $stmt = $connsbas->prepare($sql);

View File

@@ -33,7 +33,7 @@
<h1 id="namePhr">{{home_title}}</h1> <h1 id="namePhr">{{home_title}}</h1>
</div> </div>
{% if not app['authentication'].isAuthenticated() %} {% if not app.getAuthenticator().isAuthenticated() %}
<div id="content-box" class="span6 offset3"> <div id="content-box" class="span6 offset3">
<form id="login-form" class="form-vertical" method="post"> <form id="login-form" class="form-vertical" method="post">
{% for key,value in auth.getParams %} {% for key,value in auth.getParams %}
@@ -54,8 +54,8 @@
</p> </p>
</div> </div>
{% else %} {% else %}
{% if app['authentication'].getUser() is not none %} {% if app.getAuthenticatedUser() is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %} {% set username = '<b>' ~ app.getAuthenticatedUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %} {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -37,8 +37,8 @@
<h1 id="namePhr">{{ app['conf'].get(['registry', 'general', 'title']) }}</h1> <h1 id="namePhr">{{ app['conf'].get(['registry', 'general', 'title']) }}</h1>
</div> </div>
{% if app['authentication'].getUser() is not none %} {% if app.getAuthenticatedUser() is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %} {% set username = '<b>' ~ app.getAuthenticatedUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %} {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -36,11 +36,11 @@
<div id="content" data-role="content"> <div id="content" data-role="content">
{{ thumbnail.format100percent(record.get_preview()) }} {{ thumbnail.format100percent(record.get_preview()) }}
{% if basket_element.getBasket().getValidation() %} {% if basket_element.getBasket().getValidation() %}
{% if basket_element.getBasket().getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket_element.getBasket().getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;"> <fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;">
<input {% if basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" /> <input {% if basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" />
<label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-yes_{{basket_element.getId()}}">{{ 'validation:: OUI' | trans }}</label> <label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-yes_{{basket_element.getId()}}">{{ 'validation:: OUI' | trans }}</label>
<input {% if basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == false and basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" /> <input {% if basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == false and basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" />
<label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-no_{{basket_element.getId()}}">{{ 'validation:: NON' | trans }}</label> <label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-no_{{basket_element.getId()}}">{{ 'validation:: NON' | trans }}</label>
</fieldset> </fieldset>
{% endif %} {% endif %}

View File

@@ -19,7 +19,7 @@
<form action=""> <form action="">
<textarea class="note_area" <textarea class="note_area"
id="note_area_{{basket_element.getId()}}" id="note_area_{{basket_element.getId()}}"
{% if basket_element.getUserValidationDatas(app['authentication'].getUser()).getNote() == '' %}placeholder="Note"{% endif %}>{{basket_element.getUserValidationDatas(app['authentication'].getUser()).getNote()}}</textarea> {% if basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getNote() == '' %}placeholder="Note"{% endif %}>{{basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getNote()}}</textarea>
<button type="submit" class="note_area_validate">{{ 'boutton::valider' | trans }}</button> <button type="submit" class="note_area_validate">{{ 'boutton::valider' | trans }}</button>
<input name="sselcont_id" value="{{basket_element.getId()}}" type="hidden"/> <input name="sselcont_id" value="{{basket_element.getId()}}" type="hidden"/>
</form> </form>

View File

@@ -1,5 +1,5 @@
{% for validationDatas in basket_element.getValidationDatas() %} {% for validationDatas in basket_element.getValidationDatas() %}
{% set is_mine = validationDatas.getParticipant().getUser().getId() == app['authentication'].getUser().getId() %} {% set is_mine = validationDatas.getParticipant().getUser().getId() == app.getAuthenticatedUser().getId() %}
{% if validationDatas.getNote() != '' or (validationDatas.getAgreement() is not null and is_mine) %} {% if validationDatas.getNote() != '' or (validationDatas.getAgreement() is not null and is_mine) %}
<li> <li>
<h3 style="text-align:left;"> <h3 style="text-align:left;">

View File

@@ -4,7 +4,7 @@
{% block javascript %} {% block javascript %}
<script type="text/javascript"> <script type="text/javascript">
{% if basket.getValidation() %} {% if basket.getValidation() %}
var releasable = {% if basket.getValidation().getParticipant(app['authentication'].getUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %} var releasable = {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %}
{% endif %} {% endif %}
</script> </script>
<script type="text/javascript" src="{{ path('minifier', { 'f' : 'skins/lightbox/jquery.validator.mobile.js' }) }}"></script> <script type="text/javascript" src="{{ path('minifier', { 'f' : 'skins/lightbox/jquery.validator.mobile.js' }) }}"></script>
@@ -30,8 +30,8 @@
<ul class="image_set"> <ul class="image_set">
{% for basket_element in basket.getElements() %} {% for basket_element in basket.getElements() %}
<li class="image_box" id="sselcontid_{{basket_element.getId()}}"> <li class="image_box" id="sselcontid_{{basket_element.getId()}}">
{% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<div class="valid_choice valid_choice_{{basket_element.getId()}} {% if basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == true %}agree{% elseif basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == false and basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is not null %}disagree{% endif %}"> <div class="valid_choice valid_choice_{{basket_element.getId()}} {% if basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == true %}agree{% elseif basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == false and basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is not null %}disagree{% endif %}">
</div> </div>
{% endif %} {% endif %}
<a href="{{ path('lightbox_ajax_load_basketelement', { 'sselcont_id' : basket_element.getId() }) }}"> <a href="{{ path('lightbox_ajax_load_basketelement', { 'sselcont_id' : basket_element.getId() }) }}">
@@ -43,7 +43,7 @@
</ul> </ul>
</div> </div>
<div data-role="footer"> <div data-role="footer">
{% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket.getValidation() and basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<button class="confirm_report" style="width:100%;" title="{{ 'validation::envoyer mon rapport' | trans }}"> <button class="confirm_report" style="width:100%;" title="{{ 'validation::envoyer mon rapport' | trans }}">
{{ 'validation::envoyer mon rapport' | trans }} {{ 'validation::envoyer mon rapport' | trans }}
<img src="/skins/icons/loader1F1E1B.gif" style="visibility:hidden;" class="loader"/> <img src="/skins/icons/loader1F1E1B.gif" style="visibility:hidden;" class="loader"/>

View File

@@ -34,7 +34,7 @@
<li>{{ collection.get_record_amount() }} records <a class="ajax" target="rights" href="{{ path('admin_collection_display_document_details', { 'bas_id' : collection.get_base_id() }) }}">{{ 'phraseanet:: details' | trans }}</a></li> <li>{{ collection.get_record_amount() }} records <a class="ajax" target="rights" href="{{ path('admin_collection_display_document_details', { 'bas_id' : collection.get_base_id() }) }}">{{ 'phraseanet:: details' | trans }}</a></li>
</ul> </ul>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<div class="well well-small"> <div class="well well-small">
<h5>{{ 'admin::collection:: Gestionnaires des commandes' | trans }}</h5> <h5>{{ 'admin::collection:: Gestionnaires des commandes' | trans }}</h5>
<form id="admin_adder" action="{{ path('admin_collection_submit_order_admins', { 'bas_id' : bas_id }) }}" method="post" style="margin:0;"> <form id="admin_adder" action="{{ path('admin_collection_submit_order_admins', { 'bas_id' : bas_id }) }}" method="post" style="margin:0;">
@@ -143,7 +143,7 @@
<h5>{{ 'admin::base:collection: minilogo actuel' | trans }}</h5> <h5>{{ 'admin::base:collection: minilogo actuel' | trans }}</h5>
{% if collection.getLogo(bas_id, app) is not empty %} {% if collection.getLogo(bas_id, app) is not empty %}
<div class="thumbnail" style="width:120px;height:24px;margin-top:5px;margin-bottom:5px">{{ collection.getLogo(bas_id, app) | raw }}</div> <div class="thumbnail" style="width:120px;height:24px;margin-top:5px;margin-bottom:5px">{{ collection.getLogo(bas_id, app) | raw }}</div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_logo', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form method="post" action="{{ path('admin_collection_delete_logo', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini" > <button class="btn btn-danger btn-mini" >
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -151,7 +151,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span> <span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_logo', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_logo', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button"> <span class="btn btn-success fileinput-button">
@@ -168,7 +168,7 @@
<h5>{{ "Watermark" | trans }}</h5> <h5>{{ "Watermark" | trans }}</h5>
{% if collection.getWatermark(bas_id) is not empty %} {% if collection.getWatermark(bas_id) is not empty %}
<div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div> <div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form method="post" action="{{ path('admin_collection_delete_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini"> <button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -176,7 +176,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span> <span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button"> <span class="btn btn-success fileinput-button">
@@ -193,7 +193,7 @@
<h5>{{ "Stamp logo" | trans }}</h5> <h5>{{ "Stamp logo" | trans }}</h5>
{% if collection.getStamp(bas_id) is not empty %} {% if collection.getStamp(bas_id) is not empty %}
<div class="thumbnail" style="max-height:120px;max-width:260px">{{ collection.getStamp(bas_id)| raw }}</div> <div class="thumbnail" style="max-height:120px;max-width:260px">{{ collection.getStamp(bas_id)| raw }}</div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form method="post" action="{{ path('admin_collection_delete_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini"> <button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -201,7 +201,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %} {% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span> <span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button"> <span class="btn btn-success fileinput-button">

View File

@@ -32,10 +32,10 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
{% if app['acl'].get(app['authentication'].getUser()).get_granted_base(["canadmin"]) | length > 0 %} {% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) | length > 0 %}
<select id="othcollsel" name="othcollsel" disabled> <select id="othcollsel" name="othcollsel" disabled>
<option>{{ "choisir" | trans }}</option> <option>{{ "choisir" | trans }}</option>
{% for collection in app['acl'].get(app['authentication'].getUser()).get_granted_base(["canadmin"]) %} {% for collection in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_label(app['locale']) }}</option> <option value="{{ collection.get_base_id() }}">{{ collection.get_label(app['locale']) }}</option>
{% endfor %} {% endfor %}
</select> </select>

View File

@@ -24,7 +24,7 @@
<tr> <tr>
<td colspan='2'><strong>{{ 'admin::monitor: bases sur lesquelles l\'utilisateur est connecte :' | trans }} :</strong></td> <td colspan='2'><strong>{{ 'admin::monitor: bases sur lesquelles l\'utilisateur est connecte :' | trans }} :</strong></td>
</tr> </tr>
{% for databox in app['acl'].get(user).get_granted_sbas() %} {% for databox in app.getAclForUser(user).get_granted_sbas() %}
<tr> <tr>
<td colspan='2' style='overflow:hidden;' >{{ databox.get_label(app['locale']) }}</td> <td colspan='2' style='overflow:hidden;' >{{ databox.get_label(app['locale']) }}</td>
</tr> </tr>

View File

@@ -43,7 +43,7 @@
</ul> </ul>
</div> </div>
{% if app['acl'].get(app['authentication'].getUser()).is_admin() %} {% if app.getAclForUser(app.getAuthenticatedUser()).is_admin() %}
<div class="db_infos"> <div class="db_infos">
<h2>{{ 'admin::base: Version' | trans }}</h2> <h2>{{ 'admin::base: Version' | trans }}</h2>

View File

@@ -30,7 +30,7 @@
<li> <li>
{{ 'admin::base: Alias' | trans }} : <span id="viewname">{{ databox.get_label(app['locale']) }}</span> {{ 'admin::base: Alias' | trans }} : <span id="viewname">{{ databox.get_label(app['locale']) }}</span>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<img src="/skins/icons/edit_0.gif" id="show-view-name" /> <img src="/skins/icons/edit_0.gif" id="show-view-name" />
<div class="well well-small" id="change-view-name" style="display:none;"> <div class="well well-small" id="change-view-name" style="display:none;">
<form method="post" action="{{ path('admin_database_rename', {'databox_id': databox.get_sbas_id()}) }}"> <form method="post" action="{{ path('admin_database_rename', {'databox_id': databox.get_sbas_id()}) }}">
@@ -92,7 +92,7 @@
</div> </div>
</div> </div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<div> <div>
<form method="post" action="{{ path('admin_database_set_indexable', {'databox_id': databox.get_sbas_id()}) }}" style="margin:0;"> <form method="post" action="{{ path('admin_database_set_indexable', {'databox_id': databox.get_sbas_id()}) }}" style="margin:0;">
<label class="checkbox" for="is_indexable"> <label class="checkbox" for="is_indexable">
@@ -183,7 +183,7 @@
<li> <li>
<form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}"> <form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}">
{% trans with {'%name%' : name} %}Monter la collection %name%{% endtrans %}<br/> {% trans with {'%name%' : name} %}Monter la collection %name%{% endtrans %}<br/>
{% if app['acl'].get(app['authentication'].getUser()).get_granted_base(["canadmin"]) | length > 0 %} {% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) | length > 0 %}
<label for="othcollsel">{{ "admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces" | trans }}</label> <label for="othcollsel">{{ "admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces" | trans }}</label>
<select id="othcollsel" name="othcollsel" > <select id="othcollsel" name="othcollsel" >
<option value="">{{ "choisir" | trans }}</option> <option value="">{{ "choisir" | trans }}</option>
@@ -232,7 +232,7 @@
<h4>{{ "admin::base: logo impression PDF" | trans }}</h4> <h4>{{ "admin::base: logo impression PDF" | trans }}</h4>
<div id="printLogoDIV_OK"> <div id="printLogoDIV_OK">
<img class="thumbnail" id="printLogo" src="/custom/minilogos/logopdf_{{ databox.get_sbas_id() }}.jpg" /> <img class="thumbnail" id="printLogo" src="/custom/minilogos/logopdf_{{ databox.get_sbas_id() }}.jpg" />
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<form method="post" target="right" action="{{ path('admin_database_delete_logo', {'databox_id': databox.get_sbas_id()}) }}" > <form method="post" target="right" action="{{ path('admin_database_delete_logo', {'databox_id': databox.get_sbas_id()}) }}" >
<button class="btn btn-mini btn-danger">{{ "admin::base:collection: supprimer le logo" | trans }}</button> <button class="btn btn-mini btn-danger">{{ "admin::base:collection: supprimer le logo" | trans }}</button>
</form> </form>
@@ -240,7 +240,7 @@
</div> </div>
<div id="printLogoDIV_NONE"> <div id="printLogoDIV_NONE">
{{ "admin::base:collection: aucun fichier (minilogo, watermark ...)" | trans }} {{ "admin::base:collection: aucun fichier (minilogo, watermark ...)" | trans }}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<input id="fileupload" class="no-ajax" type="file" name="newLogoPdf" data-url="{{ path('admin_database_submit_logo', {'databox_id': databox.get_sbas_id()}) }}" accept="image/jpg, image/jpeg"> <input id="fileupload" class="no-ajax" type="file" name="newLogoPdf" data-url="{{ path('admin_database_submit_logo', {'databox_id': databox.get_sbas_id()}) }}" accept="image/jpg, image/jpeg">
<i>{{ "admin::base: envoyer un logo (jpeg 35px de hauteur max)" | trans }}</i> <i>{{ "admin::base: envoyer un logo (jpeg 35px de hauteur max)" | trans }}</i>
{% endif %} {% endif %}

View File

@@ -25,7 +25,7 @@
{% endif %} {% endif %}
{% if name == 'access' %} {% if name == 'access' %}
{% if class != 'checked' and type == 'base' and app['acl'].get(admin).has_access_to_base(id) is empty %} {% if class != 'checked' and type == 'base' and app.getAclForUser(admin).has_access_to_base(id) is empty %}
<div class="no_switch"> <div class="no_switch">
</div> </div>
{% else %} {% else %}
@@ -34,10 +34,10 @@
</div> </div>
{% endif %} {% endif %}
{% else %} {% else %}
{% if class != 'checked' and type == 'base' and app['acl'].get(admin).has_right_on_base(id, name) is empty %} {% if class != 'checked' and type == 'base' and app.getAclForUser(admin).has_right_on_base(id, name) is empty %}
<div class="no_switch"> <div class="no_switch">
</div> </div>
{% elseif class != 'checked' and type == 'sbas' and app['acl'].get(admin).has_right_on_sbas(id, name) is empty %} {% elseif class != 'checked' and type == 'sbas' and app.getAclForUser(admin).has_right_on_sbas(id, name) is empty %}
<div class="no_switch"> <div class="no_switch">
</div> </div>
{% else %} {% else %}
@@ -322,16 +322,16 @@
</div> </div>
</td> </td>
<td style="text-align:center;width:19px;" title="{{ 'Allowed to publish' | trans }}"> <td style="text-align:center;width:19px;" title="{{ 'Allowed to publish' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_chupub', users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'bas_chupub', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{{ 'Manage Thesaurus' | trans }}"> <td style="text-align:center;width:19px;" title="{{ 'Manage Thesaurus' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_modif_th', users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'bas_modif_th', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{{ 'Manage Database' | trans }}"> <td style="text-align:center;width:19px;" title="{{ 'Manage Database' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_manage', users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'bas_manage', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{{ 'Manage DB fields' | trans }}"> <td style="text-align:center;width:19px;" title="{{ 'Manage DB fields' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_modify_struct', users, 'sbas')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'bas_modify_struct', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:48px;"></td> <td style="text-align:center;width:48px;"></td>
</tr> </tr>
@@ -341,25 +341,25 @@
{{rights['base_id']|bas_labels(app)}} {{rights['base_id']|bas_labels(app)}}
</td> </td>
<td class="users_col case_right_access" title="{{ 'Access' | trans }}"> <td class="users_col case_right_access" title="{{ 'Access' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'access', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'access', users, 'base')}}
</td> </td>
<td class="users_col case_right_actif" title="{{ 'Active' | trans }}"> <td class="users_col case_right_actif" title="{{ 'Active' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'actif', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'actif', users, 'base')}}
</td> </td>
<td class="users_col case_right_canputinalbum" title="{{ 'Allowed to add in basket' | trans }}"> <td class="users_col case_right_canputinalbum" title="{{ 'Allowed to add in basket' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canputinalbum', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canputinalbum', users, 'base')}}
</td> </td>
<td class="users_col case_right_candwnldpreview" title="{{ 'Access to preview' | trans }}"> <td class="users_col case_right_candwnldpreview" title="{{ 'Access to preview' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'candwnldpreview', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candwnldpreview', users, 'base')}}
</td> </td>
<td class="users_col case_right_nowatermark" title="{{ 'Remove watermark' | trans }}"> <td class="users_col case_right_nowatermark" title="{{ 'Remove watermark' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'nowatermark', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'nowatermark', users, 'base')}}
</td> </td>
<td class="users_col case_right_candwnldhd" title="{{ 'Access to HD' | trans }}"> <td class="users_col case_right_candwnldhd" title="{{ 'Access to HD' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'candwnldhd', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candwnldhd', users, 'base')}}
</td> </td>
<td class="users_col case_right_cancmd" title="{{ 'Allowed to order' | trans }}"> <td class="users_col case_right_cancmd" title="{{ 'Allowed to order' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'cancmd', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'cancmd', users, 'base')}}
</td> </td>
<td class="users_col case_right_quota" title="{{ 'Set download quotas' | trans }}"> <td class="users_col case_right_quota" title="{{ 'Set download quotas' | trans }}">
<div class="quota_trigger quota_{{rights['base_id']}} base_{{rights['base_id']}}"> <div class="quota_trigger quota_{{rights['base_id']}} base_{{rights['base_id']}}">
@@ -395,34 +395,34 @@
<td style="text-align:center;width:100px;"></td> <td style="text-align:center;width:100px;"></td>
<td class="users_col case_right_canaddrecord" title="{{ 'Allowed to add' | trans }}"> <td class="users_col case_right_canaddrecord" title="{{ 'Allowed to add' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canaddrecord', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canaddrecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_canmodifrecord" title="{{ 'Allowed to edit' | trans }}"> <td class="users_col case_right_canmodifrecord" title="{{ 'Allowed to edit' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canmodifrecord', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canmodifrecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_chgstatus" title="{{ 'Allowed to change statuses' | trans }}"> <td class="users_col case_right_chgstatus" title="{{ 'Allowed to change statuses' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'chgstatus', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'chgstatus', users, 'base')}}
</td> </td>
<td class="users_col case_right_candeleterecord" title="{{ 'Allowed to delete' | trans }}"> <td class="users_col case_right_candeleterecord" title="{{ 'Allowed to delete' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'candeleterecord', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candeleterecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_imgtools" title="{{ 'Access to image tools' | trans }}"> <td class="users_col case_right_imgtools" title="{{ 'Access to image tools' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'imgtools', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'imgtools', users, 'base')}}
</td> </td>
<td class="users_col case_right_canadmin" title="{{ 'Manage users' | trans }}"> <td class="users_col case_right_canadmin" title="{{ 'Manage users' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canadmin', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canadmin', users, 'base')}}
</td> </td>
<td class="users_col case_right_canreport" title="{{ 'Allowed to access report' | trans }}"> <td class="users_col case_right_canreport" title="{{ 'Allowed to access report' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canreport', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canreport', users, 'base')}}
</td> </td>
<td class="users_col case_right_canpush" title="{{ 'Allowed to push' | trans }}"> <td class="users_col case_right_canpush" title="{{ 'Allowed to push' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'canpush', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canpush', users, 'base')}}
</td> </td>
<td class="users_col case_right_manage" title="{{ 'Manage collection' | trans }}"> <td class="users_col case_right_manage" title="{{ 'Manage collection' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'manage', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'manage', users, 'base')}}
</td> </td>
<td class="users_col case_right_modify" title="{{ 'Manage values lists' | trans }}"> <td class="users_col case_right_modify" title="{{ 'Manage values lists' | trans }}">
{{_self.format_checkbox(app['authentication'].getUser(), rights, 'modify_struct', users, 'base')}} {{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'modify_struct', users, 'base')}}
</td> </td>
<td colspan="5"> <td colspan="5">

View File

@@ -58,7 +58,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="admin-app" data-usr="{{ app['authentication'].getUser().getId() }}" data-notif-url="{{ path('list_notifications') }}"> <div id="admin-app" data-usr="{{ app.getAuthenticatedUser().getId() }}" data-notif-url="{{ path('list_notifications') }}">
<div id="left" class="PNB left-view" style="width:250px;right:auto;" data-tree-url="{{ path("admin_display_tree") }}" data-websocket="{{ "ws://" ~ app["conf"].get(["main" ,"websocket-server", "host"]) ~ ":" ~ app["conf"].get(["main" ,"websocket-server", "port"]) ~ "/websockets" }}"> <div id="left" class="PNB left-view" style="width:250px;right:auto;" data-tree-url="{{ path("admin_display_tree") }}" data-websocket="{{ "ws://" ~ app["conf"].get(["main" ,"websocket-server", "host"]) ~ ":" ~ app["conf"].get(["main" ,"websocket-server", "port"]) ~ "/websockets" }}">
<div class="PNB10" style="right:0; top:28px;"> <div class="PNB10" style="right:0; top:28px;">
<div id="FNDR"> <div id="FNDR">

View File

@@ -6,7 +6,7 @@
{% if error %} {% if error %}
<div class="error alert alert-error">{{ error }}</div> <div class="error alert alert-error">{{ error }}</div>
{% endif %} {% endif %}
{% if feed.isOwner(app['authentication'].getUser()) %} {% if feed.isOwner(app.getAuthenticatedUser()) %}
<h2>{{ 'Edition' | trans }}</h2> <h2>{{ 'Edition' | trans }}</h2>
<div class="control-group"> <div class="control-group">
<div id="pub_icon"> <div id="pub_icon">
@@ -101,7 +101,7 @@
<div class="controls"> <div class="controls">
<select id="edit_pub_base_id" class="input-large" name="base_id" {% if feed.isPublic() %}disabled="disabled"{% endif %}> <select id="edit_pub_base_id" class="input-large" name="base_id" {% if feed.isPublic() %}disabled="disabled"{% endif %}>
<option value="">{{ 'Non-Restreinte (publique)' | trans }}</option> <option value="">{{ 'Non-Restreinte (publique)' | trans }}</option>
{% for databox in app['acl'].get(app['authentication'].getUser()).get_granted_sbas('bas_chupub') %} {% for databox in app.getAclForUser(app.getAuthenticatedUser()).get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_label(app['locale']) }}"> <optgroup label="{{ databox.get_label(app['locale']) }}">
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
<option {% if feed.getBaseId() and feed.getCollection(app).get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option> <option {% if feed.getBaseId() and feed.getCollection(app).get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>

View File

@@ -23,7 +23,7 @@
<div class="controls"> <div class="controls">
<select id="add_pub_base_id" class="input-large" name="base_id"> <select id="add_pub_base_id" class="input-large" name="base_id">
<option value="">{{ 'Non-Restreinte (publique)' | trans }}</option> <option value="">{{ 'Non-Restreinte (publique)' | trans }}</option>
{% for databox in app['acl'].get(app['authentication'].getUser()).get_granted_sbas('bas_chupub') %} {% for databox in app.getAclForUser(app.getAuthenticatedUser()).get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_label(app['locale']) }}"> <optgroup label="{{ databox.get_label(app['locale']) }}">
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option> <option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
@@ -90,7 +90,7 @@
{% endif %} {% endif %}
</td> </td>
<td valign="center" align="center"> <td valign="center" align="center">
{% if feed.isOwner(app['authentication'].getUser()) %} {% if feed.isOwner(app.getAuthenticatedUser()) %}
<form class="no-ajax form_publication" action="{{ path('admin_feeds_feed_delete', { 'id' : feed.getId() }) }}" method="post" style="margin:0;"> <form class="no-ajax form_publication" action="{{ path('admin_feeds_feed_delete', { 'id' : feed.getId() }) }}" method="post" style="margin:0;">
<button class="feed_remover btn btn-mini">{{ 'boutton::supprimer' | trans }}</button> <button class="feed_remover btn btn-mini">{{ 'boutton::supprimer' | trans }}</button>
</form> </form>

View File

@@ -2,7 +2,7 @@
<ul id="tree" class="filetree"> <ul id="tree" class="filetree">
{% if app['acl'].get(app['authentication'].getUser()).is_admin() %} {% if app.getAclForUser(app.getAuthenticatedUser()).is_admin() %}
<li> <li>
<a target="right" href="{{ path('admin_dashboard') }}" class="ajax"> <a target="right" href="{{ path('admin_dashboard') }}" class="ajax">
<img src="/skins/admin/Dashboard.png" /> <img src="/skins/admin/Dashboard.png" />
@@ -15,7 +15,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).is_admin() %} {% if app.getAclForUser(app.getAuthenticatedUser()).is_admin() %}
<li> <li>
<a target="right" href="{{ path('setup_display_globals') }}" class="ajax"> <a target="right" href="{{ path('setup_display_globals') }}" class="ajax">
<img src="/skins/admin/Setup.png" /> <img src="/skins/admin/Setup.png" />
@@ -36,7 +36,7 @@
</a> </a>
</li> </li>
{% if app['acl'].get(app['authentication'].getUser()).has_right('manageusers') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('manageusers') %}
<li class="{% if feature == 'users' %}selected{% endif %}"> <li class="{% if feature == 'users' %}selected{% endif %}">
<a target="right" href="{{ path('admin_users_search') }}" class="ajax zone_editusers"> <a target="right" href="{{ path('admin_users_search') }}" class="ajax zone_editusers">
<img src="/skins/admin/Users.png" /> <img src="/skins/admin/Users.png" />
@@ -51,7 +51,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('bas_chupub') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('bas_chupub') %}
<li class=""> <li class="">
<a target="right" href="{{ path('admin_feeds_list') }}" class="ajax"> <a target="right" href="{{ path('admin_feeds_list') }}" class="ajax">
<img src="/skins/icons/rss16.png" /> <img src="/skins/icons/rss16.png" />
@@ -60,7 +60,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('taskmanager') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('taskmanager') %}
<li class="{% if feature == 'taskmanager' %}selected{% endif %}"> <li class="{% if feature == 'taskmanager' %}selected{% endif %}">
<a target="right" href="{{ path('admin_tasks_list') }}" class="ajax"> <a target="right" href="{{ path('admin_tasks_list') }}" class="ajax">
<img src="/skins/admin/TaskManager.png" /> <img src="/skins/admin/TaskManager.png" />
@@ -103,7 +103,7 @@
</div> </div>
<ul> <ul>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_sbas( sbas_id , 'bas_modify_struct') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_sbas( sbas_id , 'bas_modify_struct') %}
<li> <li>
<a target="right" class="ajax" href="{{ path('database_display_stucture', { 'databox_id' : sbas_id }) }}"> <a target="right" class="ajax" href="{{ path('database_display_stucture', { 'databox_id' : sbas_id }) }}">
<img src="/skins/icons/miniadjust01.gif"/> <img src="/skins/icons/miniadjust01.gif"/>
@@ -145,7 +145,7 @@
{% set seeUsrGene = false %} {% set seeUsrGene = false %}
{% for coll in databox.get_collections() %} {% for coll in databox.get_collections() %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base( coll.get_base_id() , 'canadmin') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base( coll.get_base_id() , 'canadmin') %}
{% set seeUsrGene = true %} {% set seeUsrGene = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@@ -160,9 +160,9 @@
{% endif %} {% endif %}
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
{% if (collection.get_base_id() in app['acl'].get(app['authentication'].getUser()).get_granted_base(['canadmin'])|keys {% if (collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['canadmin'])|keys
or collection.get_base_id() in app['acl'].get(app['authentication'].getUser()).get_granted_base(['manage'])|keys or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['manage'])|keys
or collection.get_base_id() in app['acl'].get(app['authentication'].getUser()).get_granted_base(['modify_struct'])|keys) %} or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['modify_struct'])|keys) %}
{% if feature == 'collection' and featured == collection.get_base_id() %} {% if feature == 'collection' and featured == collection.get_base_id() %}
{% set coll_selected = true %} {% set coll_selected = true %}
@@ -178,7 +178,7 @@
</div> </div>
<ul> <ul>
{% if (app['acl'].get(app['authentication'].getUser()).has_right_on_base(collection.get_base_id(), 'modify_struct')) %} {% if (app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), 'modify_struct')) %}
<li> <li>
<a target="right" href="{{ path('admin_collection_display_suggested_values', { 'bas_id' : collection.get_base_id() }) }}" class="ajax"> <a target="right" href="{{ path('admin_collection_display_suggested_values', { 'bas_id' : collection.get_base_id() }) }}" class="ajax">
<img src="/skins/icons/foldph20open_0.gif"/> <img src="/skins/icons/foldph20open_0.gif"/>
@@ -187,7 +187,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(collection.get_base_id(), 'canadmin') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), 'canadmin') %}
<li> <li>
<a target="right" href="{{ path('admin_users_search', { 'base_id' : [ collection.get_base_id() ] }) }}" class="ajax"> <a target="right" href="{{ path('admin_users_search', { 'base_id' : [ collection.get_base_id() ] }) }}" class="ajax">
<img src="/skins/admin/Users.png"/> <img src="/skins/admin/Users.png"/>

View File

@@ -126,7 +126,7 @@
{% if usr.isTemplate() %} {% if usr.isTemplate() %}
<img title="{{ 'This is a template' | trans }}" src="/skins/icons/template.png"/> <img title="{{ 'This is a template' | trans }}" src="/skins/icons/template.png"/>
{% else %} {% else %}
{% if app['acl'].get(usr).is_phantom() %} {% if app.getAclForUser(usr).is_phantom() %}
<img title="{{ 'This user has no rights' | trans }}" src="/skins/admin/ghost.png"/> <img title="{{ 'This user has no rights' | trans }}" src="/skins/admin/ghost.png"/>
{% endif %} {% endif %}
{{usr.getId()}} {{usr.getId()}}

View File

@@ -33,7 +33,7 @@
<h1 id="namePhr">{{home_title}}</h1> <h1 id="namePhr">{{home_title}}</h1>
</div> </div>
{% if not app['authentication'].isAuthenticated() %} {% if not app.getAuthenticator().isAuthenticated() %}
<div id="content-box" class="span6 offset3"> <div id="content-box" class="span6 offset3">
<form id="login-form" class="form-vertical" method="post"> <form id="login-form" class="form-vertical" method="post">
{% for key,value in auth.getParams %} {% for key,value in auth.getParams %}
@@ -56,7 +56,7 @@
</div> </div>
{% else %} {% else %}
{% if user is not none %} {% if user is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %} {% set username = '<b>' ~ app.getAuthenticatedUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %} {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -37,8 +37,8 @@
<h1 id="namePhr">{{ app['conf'].get(['registry', 'general', 'title']) }}</h1> <h1 id="namePhr">{{ app['conf'].get(['registry', 'general', 'title']) }}</h1>
</div> </div>
{% if app['authentication'].getUser() is not none %} {% if app.getAuthenticatedUser() is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %} {% set username = '<b>' ~ app.getAuthenticatedUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %} {% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -43,7 +43,7 @@
<div class="baskCreate" title="{{ 'action:: nouveau panier' | trans }}" onclick="newBasket();"></div> <div class="baskCreate" title="{{ 'action:: nouveau panier' | trans }}" onclick="newBasket();"></div>
<div style="float:right;position:relative;width:3px;height:16px;"></div> <div style="float:right;position:relative;width:3px;height:16px;"></div>
{% if total_baskets > 0 and (app['acl'].get(app['authentication'].getUser()).has_right("candwnldhd") or app['acl'].get(app['authentication'].getUser()).has_right("candwnldpreview") or app['acl'].get(app['authentication'].getUser()).has_right("cancmd") > 0) %} {% if total_baskets > 0 and (app.getAclForUser(app.getAuthenticatedUser()).has_right("candwnldhd") or app.getAclForUser(app.getAuthenticatedUser()).has_right("candwnldpreview") or app.getAclForUser(app.getAuthenticatedUser()).has_right("cancmd") > 0) %}
<div class="baskDownload" title="{{ 'action : exporter' | trans }}" onclick="evt_dwnl();"></div> <div class="baskDownload" title="{{ 'action : exporter' | trans }}" onclick="evt_dwnl();"></div>
{% endif %} {% endif %}
@@ -113,10 +113,10 @@
onclick="evt_del_in_chutier({{ element.getId() }});" onclick="evt_del_in_chutier({{ element.getId() }});"
title="{{ 'action : supprimer' | trans }}"> title="{{ 'action : supprimer' | trans }}">
</div> </div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldhd')
or app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview')
or app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'cancmd') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'cancmd')
or app['acl'].get(app['authentication'].getUser()).has_preview_grant(record) %} or app.getAclForUser(app.getAuthenticatedUser()).has_preview_grant(record) %}
<div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{{ 'action : exporter' | trans }}"></div> <div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{{ 'action : exporter' | trans }}"></div>
{% endif %} {% endif %}
</div> </div>

View File

@@ -461,7 +461,7 @@
dataType: 'json', dataType: 'json',
data: { data: {
app : 2, app : 2,
usr : {{ app['authentication'].getUser().getId() }} usr : {{ app.getAuthenticatedUser().getId() }}
}, },
error: function(){ error: function(){
window.setTimeout("pollNotifications();", 10000); window.setTimeout("pollNotifications();", 10000);

View File

@@ -20,7 +20,7 @@
{% set s_width = subdef.get_width() %} {% set s_width = subdef.get_width() %}
{% set s_height = subdef.get_height() %} {% set s_height = subdef.get_height() %}
{% endif %} {% endif %}
{% if app['authentication'].isAuthenticated() == true %} {% if app.getAuthenticator().isAuthenticated() == true %}
{% set url = subdef.get_url() %} {% set url = subdef.get_url() %}
{% else %} {% else %}
{% set url = subdef.get_permalink().get_url() %} {% set url = subdef.get_permalink().get_url() %}

View File

@@ -78,7 +78,7 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app['authentication'].getUser().isGuest() %} {% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app.getAuthenticatedUser().isGuest() %}
<script type="text/javascript"> <script type="text/javascript">
p4.Dialog.get(1).Close(); p4.Dialog.get(1).Close();
var $dialog = p4.Dialog.Create({ var $dialog = p4.Dialog.Create({
@@ -180,7 +180,7 @@
<div> <div>
{{ 'export::mail: destinataire' | trans }} {{ 'export::mail: destinataire' | trans }}
<input type="text" value="" name="destmail" class="required span4"> <input type="text" value="" name="destmail" class="required span4">
{% set my_email = app['authentication'].getUser().getEmail() %} {% set my_email = app.getAuthenticatedUser().getEmail() %}
{% if my_email != '' %} {% if my_email != '' %}
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" name="reading_confirm" value="1" /> <input type="checkbox" name="reading_confirm" value="1" />
@@ -311,9 +311,9 @@
<label class="control-label" for="sexe">{{ 'Civility' | trans }}</label> <label class="control-label" for="sexe">{{ 'Civility' | trans }}</label>
<div class="controls"> <div class="controls">
<select name="sexe" id="sexe"> <select name="sexe" id="sexe">
<option {% if app['authentication'].getUser().getGender == 0 %}selected="selected"{% endif %} value="0">{{ 'admin::compte-utilisateur:sexe: mademoiselle' | trans }}</option> <option {% if app.getAuthenticatedUser().getGender == 0 %}selected="selected"{% endif %} value="0">{{ 'admin::compte-utilisateur:sexe: mademoiselle' | trans }}</option>
<option {% if app['authentication'].getUser().getGender == 1 %}selected="selected"{% endif %} value="1">{{ 'admin::compte-utilisateur:sexe: madame' | trans }}</option> <option {% if app.getAuthenticatedUser().getGender == 1 %}selected="selected"{% endif %} value="1">{{ 'admin::compte-utilisateur:sexe: madame' | trans }}</option>
<option {% if app['authentication'].getUser().getGender == 2 %}selected="selected"{% endif %} value="2">{{ 'admin::compte-utilisateur:sexe: monsieur' | trans }}</option> <option {% if app.getAuthenticatedUser().getGender == 2 %}selected="selected"{% endif %} value="2">{{ 'admin::compte-utilisateur:sexe: monsieur' | trans }}</option>
</select> </select>
</div> </div>
</div> </div>
@@ -321,70 +321,70 @@
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_lastname">{{ 'admin::compte-utilisateur nom' | trans }}</label> <label class="control-label" for="usr_lastname">{{ 'admin::compte-utilisateur nom' | trans }}</label>
<div class="controls"> <div class="controls">
<input id='usr_lastname' type="text" name="usr_nom" class="required" value="{{ app['authentication'].getUser().getLastName() }}"/> <input id='usr_lastname' type="text" name="usr_nom" class="required" value="{{ app.getAuthenticatedUser().getLastName() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_firstname">{{ 'admin::compte-utilisateur prenom' | trans }}</label> <label class="control-label" for="usr_firstname">{{ 'admin::compte-utilisateur prenom' | trans }}</label>
<div class="controls"> <div class="controls">
<input type="text" name="usr_prenom" class="required" id="usr_firstname" value="{{ app['authentication'].getUser().getFirstName() }}"/> <input type="text" name="usr_prenom" class="required" id="usr_firstname" value="{{ app.getAuthenticatedUser().getFirstName() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_mail"> {{ 'admin::compte-utilisateur email' | trans }}</label> <label class="control-label" for="usr_mail"> {{ 'admin::compte-utilisateur email' | trans }}</label>
<div class="controls"> <div class="controls">
<input class="required" type="text" name="usr_mail" id="usr_mail" value="{{ app['authentication'].getUser().getEmail() }}"/> <input class="required" type="text" name="usr_mail" id="usr_mail" value="{{ app.getAuthenticatedUser().getEmail() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_tel">{{ 'admin::compte-utilisateur telephone' | trans }}</label> <label class="control-label" for="usr_tel">{{ 'admin::compte-utilisateur telephone' | trans }}</label>
<div class="controls"> <div class="controls">
<input type="text" name="tel" id="usr_tel" value="{{ app['authentication'].getUser().getPhone() }}"/> <input type="text" name="tel" id="usr_tel" value="{{ app.getAuthenticatedUser().getPhone() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_societe">{{ 'admin::compte-utilisateur societe' | trans }}</label> <label class="control-label" for="usr_societe">{{ 'admin::compte-utilisateur societe' | trans }}</label>
<div class="controls"> <div class="controls">
<input type="text" name="societe" id="usr_societe" value="{{ app['authentication'].getUser().getCompany() }}"/> <input type="text" name="societe" id="usr_societe" value="{{ app.getAuthenticatedUser().getCompany() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_function">{{ 'admin::compte-utilisateur poste' | trans }}</label> <label class="control-label" for="usr_function">{{ 'admin::compte-utilisateur poste' | trans }}</label>
<div class="controls"> <div class="controls">
<input type="text" name="fonction" id="usr_fonction" value="{{ app['authentication'].getUser().getJob() }}"/> <input type="text" name="fonction" id="usr_fonction" value="{{ app.getAuthenticatedUser().getJob() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_address">{{ 'admin::compte-utilisateur adresse' | trans }}</label> <label class="control-label" for="usr_address">{{ 'admin::compte-utilisateur adresse' | trans }}</label>
<div class="controls"> <div class="controls">
<input class="required" type="text" name="adresse" id="usr_adresse" value="{{ app['authentication'].getUser().getAddress() }}"/> <input class="required" type="text" name="adresse" id="usr_adresse" value="{{ app.getAuthenticatedUser().getAddress() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_zip_code">{{ 'admin::compte-utilisateur code postal' | trans }}</label> <label class="control-label" for="usr_zip_code">{{ 'admin::compte-utilisateur code postal' | trans }}</label>
<div class="controls"> <div class="controls">
<input id="usr_zip_code" type="text" name="cpostal" name="cpostal" class="required" value="{{ app['authentication'].getUser().getZipCode() }}"/> <input id="usr_zip_code" type="text" name="cpostal" name="cpostal" class="required" value="{{ app.getAuthenticatedUser().getZipCode() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="command_geoname_field">{{ 'admin::compte-utilisateur ville' | trans }}</label> <label class="control-label" for="command_geoname_field">{{ 'admin::compte-utilisateur ville' | trans }}</label>
<div class="controls"> <div class="controls">
<input class="required geoname_field" type="text" name="geonameid" id="command_geoname_field" value="{{ app['authentication'].getUser().getGeonameId() }}" /> <input class="required geoname_field" type="text" name="geonameid" id="command_geoname_field" value="{{ app.getAuthenticatedUser().getGeonameId() }}" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_fax">{{ 'admin::compte-utilisateur fax' | trans }}</label> <label class="control-label" for="usr_fax">{{ 'admin::compte-utilisateur fax' | trans }}</label>
<div class="controls"> <div class="controls">
<input type="text" id="usr_fax" name="fax" value="{{ app['authentication'].getUser().getFax() }}"/> <input type="text" id="usr_fax" name="fax" value="{{ app.getAuthenticatedUser().getFax() }}"/>
</div> </div>
</div> </div>
@@ -666,7 +666,7 @@
$('input[name="obj[]"]:checked', $('#download')).each(function(i,n){ $('input[name="obj[]"]:checked', $('#download')).each(function(i,n){
$('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true); $('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true);
}); });
$('input[name="destmail"]', $('#sendmail')).val("{{app['authentication'].getUser().getEmail()}}"); $('input[name="destmail"]', $('#sendmail')).val("{{app.getAuthenticatedUser().getEmail()}}");
var tabs = $('.tabs', dialog.getDomElement()); var tabs = $('.tabs', dialog.getDomElement());
tabs.tabs("option", "active", 1); tabs.tabs("option", "active", 1);

View File

@@ -110,7 +110,7 @@
{% endif %} {% endif %}
{{ _self.caption_field(field, bounceable|default(true), extra_classes) }} {{ _self.caption_field(field, bounceable|default(true), extra_classes) }}
{% endfor %} {% endfor %}
{% if technical_data|default(true) and app['authentication'].getUser() is not none and app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') == 'group' %} {% if technical_data|default(true) and app.getAuthenticatedUser() is not none and app['settings'].getUserSetting(app.getAuthenticatedUser(), 'technical_display') == 'group' %}
<hr/> <hr/>
{% include 'common/technical_datas.html.twig' %} {% include 'common/technical_datas.html.twig' %}
{% endif %} {% endif %}
@@ -123,7 +123,7 @@
{{ caption_field(record, name, value)|e|highlight }} {{ caption_field(record, name, value)|e|highlight }}
</div> </div>
{% endfor %} {% endfor %}
{% if display_exif|default(true) and app['authentication'].user is not none and user_setting('technical_display') == 'group' %} {% if display_exif|default(true) and app.getAuthenticator().user is not none and user_setting('technical_display') == 'group' %}
<hr/> <hr/>
{% include 'common/technical_datas.html.twig' %} {% include 'common/technical_datas.html.twig' %}
{% endif %} {% endif %}

View File

@@ -6,7 +6,7 @@
<img src="/skins/logos/logo.png" alt="" id="mainLogo"> <img src="/skins/logos/logo.png" alt="" id="mainLogo">
</span> </span>
</li> </li>
{% if module is defined and module != "lightbox" and app['authentication'].isAuthenticated() %} {% if module is defined and module != "lightbox" and app.getAuthenticator().isAuthenticated() %}
<li> <li>
<a target="_blank" href="{{ path('prod') }}"> <a target="_blank" href="{{ path('prod') }}">
<span class=""> <span class="">
@@ -15,7 +15,7 @@
</a> </a>
</li> </li>
{% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app['acl'].get(app['authentication'].getUser()).has_access_to_module('thesaurus') %} {% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus') %}
<li> <li>
<a target="_blank" href="{{ path('thesaurus') }}"> <a target="_blank" href="{{ path('thesaurus') }}">
<span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}"> <span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}">
@@ -27,7 +27,7 @@
{# MODULE #} {# MODULE #}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_module('admin') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('admin') %}
<li> <li>
<a target="_blank" href="{{ path('admin') }}"> <a target="_blank" href="{{ path('admin') }}">
<span class="{% if module is defined and module == "admin" %}selected{% endif %}"> <span class="{% if module is defined and module == "admin" %}selected{% endif %}">
@@ -38,7 +38,7 @@
{% endif %} {% endif %}
{# MODULE #} {# MODULE #}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_module('report') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('report') %}
<li> <li>
<a target="_blank" href="{{ path('report_dashboard') }}"> <a target="_blank" href="{{ path('report_dashboard') }}">
<span class="{% if module is defined and module == "report" %}selected{% endif %}"> <span class="{% if module is defined and module == "report" %}selected{% endif %}">
@@ -59,7 +59,7 @@
{# MODULE #} {# MODULE #}
{% if module is defined and module == "prod" %} {% if module is defined and module == "prod" %}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_module('upload') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('upload') %}
<li> <li>
{% set link = path('upload_html5_form') %} {% set link = path('upload_html5_form') %}
@@ -87,7 +87,7 @@
</li> </li>
{% endif %} {% endif %}
{% if module is defined and module == "prod" and app['acl'].get(app['authentication'].getUser()).has_right('order_master') %} {% if module is defined and module == "prod" and app.getAclForUser(app.getAuthenticatedUser()).has_right('order_master') %}
<li> <li>
<a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{{ 'Orders manager' | trans }}"> <a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{{ 'Orders manager' | trans }}">
<span> <span>
@@ -104,7 +104,7 @@
<div class="PNB right" style="left:auto;overflow:hidden;"> <div class="PNB right" style="left:auto;overflow:hidden;">
<ol> <ol>
{% if app['authentication'].isAuthenticated() and module == "prod" %} {% if app.getAuthenticator().isAuthenticated() and module == "prod" %}
<li id="notification_trigger"> <li id="notification_trigger">
<a href="#" style="font-weight:bold;text-decoration:none;"> <a href="#" style="font-weight:bold;text-decoration:none;">
<span> <span>
@@ -119,15 +119,15 @@
</li> </li>
{% endif %} {% endif %}
<li class="user"> <li class="user">
{% if app['authentication'].isAuthenticated() %} {% if app.getAuthenticator().isAuthenticated() %}
{% if app['authentication'].getUser().isGuest %} {% if app.getAuthenticatedUser().isGuest %}
<span> <span>
{{ 'Guest' | trans }} {{ 'Guest' | trans }}
</span> </span>
{% else %} {% else %}
<a target="_blank" href="{{ path('account') }}" title="{{ 'login:: Mon compte' | trans }}"> <a target="_blank" href="{{ path('account') }}" title="{{ 'login:: Mon compte' | trans }}">
<span> <span>
{{app['authentication'].getUser().getLogin()}} {{app.getAuthenticatedUser().getLogin()}}
</span> </span>
</a> </a>
{% endif %} {% endif %}
@@ -162,7 +162,7 @@
</table> </table>
</li> </li>
<li> <li>
{% if app['authentication'].isAuthenticated() %} {% if app.getAuthenticator().isAuthenticated() %}
<a href="{{ path('logout', { 'redirect' : '..' ~ app['request'].getPathInfo() }) }}" target="_self"> <a href="{{ path('logout', { 'redirect' : '..' ~ app['request'].getPathInfo() }) }}" target="_self">
<span> <span>
{{ 'phraseanet:: deconnection' | trans }} {{ 'phraseanet:: deconnection' | trans }}
@@ -174,7 +174,7 @@
</div> </div>
</div> </div>
{% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %} {% if app.getAuthenticator().isAuthenticated() and (module == "client" or module == "prod") %}
<div style="display:none;z-index:30000;" id="notification_box"> <div style="display:none;z-index:30000;" id="notification_box">
{% set notifications = app['events-manager'].get_notifications %} {% set notifications = app['events-manager'].get_notifications %}
{% include 'prod/notifications.html.twig' %} {% include 'prod/notifications.html.twig' %}

View File

@@ -9,7 +9,7 @@
{% set previewHtml5 = null %} {% set previewHtml5 = null %}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') %}
{% set preview_obj = record.get_preview() %} {% set preview_obj = record.get_preview() %}
{% else %} {% else %}
{% set preview_obj = record.get_thumbnail() %} {% set preview_obj = record.get_thumbnail() %}

View File

@@ -35,7 +35,7 @@
)%} )%}
{% endif %} {% endif %}
{% set url = app['authentication'].isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %} {% set url = app.getAuthenticator().isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %}
{% if wrap %} {% if wrap %}
<div style="width:{{box_w}}px;height:{{box_h}}px;" class="thumb_wrapper {{extra_class|default('')}}" > <div style="width:{{box_w}}px;height:{{box_h}}px;" class="thumb_wrapper {{extra_class|default('')}}" >

View File

@@ -14,11 +14,11 @@
</table> </table>
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div style="margin-left:10px;width:220px;"> <div style="margin-left:10px;width:220px;">
{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }} {{ basket.getValidation().getValidationString(app, app.getAuthenticatedUser()) }}
</div> </div>
<ul style="margin:10px 0 0 20px;width:200px;"> <ul style="margin:10px 0 0 20px;width:200px;">
{% for validation_data in basket_element.getValidationDatas() %} {% for validation_data in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['authentication'].getUser()).getCanSeeOthers() or validation_data.getParticipant().getUser() == app['authentication'].getUser() %} {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanSeeOthers() or validation_data.getParticipant().getUser() == app.getAuthenticatedUser() %}
{% if validation_data.getAgreement() == true %} {% if validation_data.getAgreement() == true %}
{% set classuser = 'agree' %} {% set classuser = 'agree' %}
{% elseif validation_data.getAgreement() is null %} {% elseif validation_data.getAgreement() is null %}
@@ -27,19 +27,19 @@
{% set classuser = 'disagree' %} {% set classuser = 'disagree' %}
{% endif %} {% endif %}
{% set participant = validation_data.getParticipant().getUser() %} {% set participant = validation_data.getParticipant().getUser() %}
<li class="{% if participant.getId() == app['authentication'].getUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName()}}</li> <li class="{% if participant.getId() == app.getAuthenticatedUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName()}}</li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<div class="left choices"> <div class="left choices">
<div style="height:60px;margin-top:15px;"> <div style="height:60px;margin-top:15px;">
<table cellspacing="0" cellpadding="0" style="width:230px;"> <table cellspacing="0" cellpadding="0" style="width:230px;">
<tr> <tr>
<td> <td>
{% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() %} {% set agreement = basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() %}
<div style="width:70px;margin:0px auto 0;" class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}"> <div style="width:70px;margin:0px auto 0;" class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}">
<img src="/skins/lightbox/agree-bigie6.gif" style="vertical-align:middle;"/><span>{{ 'validation:: OUI' | trans }}</span> <img src="/skins/lightbox/agree-bigie6.gif" style="vertical-align:middle;"/><span>{{ 'validation:: OUI' | trans }}</span>
</div> </div>

View File

@@ -1,4 +1,4 @@
{% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket.getValidation() and basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<button class="confirm_report" title="{{ 'validation::envoyer mon rapport' | trans }}"> <button class="confirm_report" title="{{ 'validation::envoyer mon rapport' | trans }}">
<img src="/skins/lightbox/envoyerie6.gif"/> <img src="/skins/lightbox/envoyerie6.gif"/>
{{ 'validation::envoyer mon rapport' | trans }} {{ 'validation::envoyer mon rapport' | trans }}

View File

@@ -34,7 +34,7 @@
</div> </div>
<div class="lightbox_container left"> <div class="lightbox_container left">
{% if first_item %} {% if first_item %}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(first_item.getRecord(app), 'preview') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(first_item.getRecord(app), 'preview') %}
{% set preview = first_item.getRecord(app).get_preview() %} {% set preview = first_item.getRecord(app).get_preview() %}
{% else %} {% else %}
{% set preview = first_item.getRecord(app).get_thumbnail() %} {% set preview = first_item.getRecord(app).get_thumbnail() %}
@@ -81,7 +81,7 @@
<div class="right_column_wrapper right_column_wrapper_caption left unselectable" style="width:230px;height:auto;"> <div class="right_column_wrapper right_column_wrapper_caption left unselectable" style="width:230px;height:auto;">
<div id="record_infos"> <div id="record_infos">
<div class="lightbox_container"> <div class="lightbox_container">
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(first_item.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(first_item.getRecord(app).get_base_id(), 'canmodifrecord') %}
{% if first_item %} {% if first_item %}
{{macro.caption(first_item.getRecord(app), business, false)}} {{macro.caption(first_item.getRecord(app), business, false)}}
{% endif %} {% endif %}

View File

@@ -54,7 +54,7 @@
</h2> </h2>
{% if basket.getValidation().isFinished() %} {% if basket.getValidation().isFinished() %}
{{ '(validation) session terminee' | trans }} {{ '(validation) session terminee' | trans }}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser()).getIsConfirmed() %} {% elseif basket.getValidation().getParticipant(app.getAuthenticatedUser()).getIsConfirmed() %}
{{ '(validation) envoyee' | trans }} {{ '(validation) envoyee' | trans }}
{% else %} {% else %}
{{ '(validation) a envoyer' | trans }} {{ '(validation) a envoyer' | trans }}
@@ -70,7 +70,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div>{{ basket.getDescription() }}</div> <div>{{ basket.getDescription() }}</div>
<div>{{ basket.getValidation.getValidationString(app, app['authentication'].getUser()) }}</div> <div>{{ basket.getValidation.getValidationString(app, app.getAuthenticatedUser()) }}</div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -9,9 +9,9 @@
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div class="agreement"> <div class="agreement">
<img src="/skins/lightbox/agree.png" <img src="/skins/lightbox/agree.png"
class="agree_button {%if element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == false or element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" /> class="agree_button {%if element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == false or element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" />
<img src="/skins/lightbox/disagree.png" <img src="/skins/lightbox/disagree.png"
class="disagree_button {%if element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == true or element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == true or element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}} {{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}

View File

@@ -93,7 +93,7 @@
<div id="record_infos"> <div id="record_infos">
<div class="lightbox_container"> <div class="lightbox_container">
{% if basket_element %} {% if basket_element %}
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %}
{{macro.caption(basket_element.getRecord(app), business, false)}} {{macro.caption(basket_element.getRecord(app), business, false)}}
{% endif %} {% endif %}
</div> </div>

View File

@@ -13,10 +13,10 @@
</tbody> </tbody>
</table> </table>
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div> <div>{{ basket.getValidation().getValidationString(app, app.getAuthenticatedUser()) }}</div>
<ul> <ul>
{% for choice in basket_element.getValidationDatas() %} {% for choice in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['authentication'].getUser()).getCanSeeOthers() or choice.getParticipant().getUser() == app['authentication'].getUser() %} {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanSeeOthers() or choice.getParticipant().getUser() == app.getAuthenticatedUser() %}
{% if choice.getAgreement() == true %} {% if choice.getAgreement() == true %}
{% set classuser = 'agree' %} {% set classuser = 'agree' %}
{% elseif choice.getAgreement() is null %} {% elseif choice.getAgreement() is null %}
@@ -25,17 +25,17 @@
{% set classuser = 'disagree' %} {% set classuser = 'disagree' %}
{% endif %} {% endif %}
{% set participant = choice.getParticipant().getUser() %} {% set participant = choice.getParticipant().getUser() %}
<li class="{% if participant.getId() == app['authentication'].getUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName()}}</li> <li class="{% if participant.getId() == app.getAuthenticatedUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName()}}</li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
</div> </div>
<div class="PNB user_infos"> <div class="PNB user_infos">
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<div class="PNB choices"> <div class="PNB choices">
<div style="height:60px;"> <div style="height:60px;">
{% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() %} {% set agreement = basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() %}
<div class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}"> <div class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}">
<img src="/skins/lightbox/agree-big.png"/><span class="title15">{{ 'validation:: OUI' | trans }}</span> <img src="/skins/lightbox/agree-big.png"/><span class="title15">{{ 'validation:: OUI' | trans }}</span>
</div> </div>

View File

@@ -1,4 +1,4 @@
{% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %} {% if basket.getValidation() and basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<button class="confirm_report" style="width:100%;" title="{{ 'validation::envoyer mon rapport' | trans }}"> <button class="confirm_report" style="width:100%;" title="{{ 'validation::envoyer mon rapport' | trans }}">
<img src="/skins/lightbox/envoyer.png"/> <img src="/skins/lightbox/envoyer.png"/>
{{ 'validation::envoyer mon rapport' | trans }} {{ 'validation::envoyer mon rapport' | trans }}

View File

@@ -40,7 +40,7 @@
</div> </div>
<div class="lightbox_container PNB record_display_box"> <div class="lightbox_container PNB record_display_box">
{% if first_item %} {% if first_item %}
{% if app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(first_item.getRecord(app), 'preview') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(first_item.getRecord(app), 'preview') %}
{% set bask_prev = first_item.getRecord(app).get_preview() %} {% set bask_prev = first_item.getRecord(app).get_preview() %}
{% else %} {% else %}
{% set bask_prev = first_item.getRecord(app).get_thumbnail() %} {% set bask_prev = first_item.getRecord(app).get_thumbnail() %}
@@ -79,7 +79,7 @@
<div class="right_column_wrapper caption right_column_wrapper_caption PNB"> <div class="right_column_wrapper caption right_column_wrapper_caption PNB">
<div id="record_infos" class="PNB"> <div id="record_infos" class="PNB">
<div class="lightbox_container PNB"> <div class="lightbox_container PNB">
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(first_item.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(first_item.getRecord(app).get_base_id(), 'canmodifrecord') %}
{% if first_item %} {% if first_item %}
{{macro.caption(first_item.getRecord(app), business, false)}} {{macro.caption(first_item.getRecord(app), business, false)}}
{% endif %} {% endif %}

View File

@@ -55,7 +55,7 @@
</h2> </h2>
{% if basket.getValidation().isFinished() %} {% if basket.getValidation().isFinished() %}
{{ '(validation) session terminee' | trans }} {{ '(validation) session terminee' | trans }}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser()).getIsConfirmed() %} {% elseif basket.getValidation().getParticipant(app.getAuthenticatedUser()).getIsConfirmed() %}
{{ '(validation) envoyee' | trans }} {{ '(validation) envoyee' | trans }}
{% else %} {% else %}
{{ '(validation) a envoyer' | trans }} {{ '(validation) a envoyer' | trans }}
@@ -71,7 +71,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div>{{ basket.getDescription() }}</div> <div>{{ basket.getDescription() }}</div>
<div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div> <div>{{ basket.getValidation().getValidationString(app, app.getAuthenticatedUser()) }}</div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -10,9 +10,9 @@
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div class="agreement"> <div class="agreement">
<img src="/skins/lightbox/agree.png" <img src="/skins/lightbox/agree.png"
class="agree_button {%if element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == false or element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" /> class="agree_button {%if element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == false or element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" />
<img src="/skins/lightbox/disagree.png" <img src="/skins/lightbox/disagree.png"
class="disagree_button {%if element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() == true or element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() == true or element.getUserValidationDatas(app.getAuthenticatedUser()).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}} {{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}

View File

@@ -8,7 +8,7 @@
<hr/> <hr/>
{% for validationDatas in basket_element.getValidationDatas() %} {% for validationDatas in basket_element.getValidationDatas() %}
{% if validationDatas.getNote() != '' %} {% if validationDatas.getNote() != '' %}
<div class="note_wrapper ui-corner-all {% if validationDatas.getParticipant().getUser().getId() == app['authentication'].getUser().getId() %}my_note{% endif %} "> <div class="note_wrapper ui-corner-all {% if validationDatas.getParticipant().getUser().getId() == app.getAuthenticatedUser().getId() %}my_note{% endif %} ">
<span class="note_author title15"> <span class="note_author title15">
{{validationDatas.getParticipant().getUser().getDisplayName()}} {{validationDatas.getParticipant().getUser().getDisplayName()}}
</span> : {{ validationDatas.getNote()|nl2br }} </span> : {{ validationDatas.getNote()|nl2br }}
@@ -17,7 +17,7 @@
{% endfor %} {% endfor %}
<form> <form>
<textarea>{{basket_element.getUserValidationDatas(app['authentication'].getUser()).getNote()}}</textarea> <textarea>{{basket_element.getUserValidationDatas(app.getAuthenticatedUser()).getNote()}}</textarea>
<div class="buttons"> <div class="buttons">
<button class="note_closer ui-corner-all"> <button class="note_closer ui-corner-all">
{{ 'boutton::fermer' | trans }} {{ 'boutton::fermer' | trans }}

View File

@@ -1,8 +1,8 @@
{% if basket_element and basket_element.getBasket().getValidation() %} {% if basket_element and basket_element.getBasket().getValidation() %}
<div class="agreement_selector" style="display:none;"> <div class="agreement_selector" style="display:none;">
<img src="/skins/lightbox/agree-big.png" <img src="/skins/lightbox/agree-big.png"
class="{% if basket_element.getUserValidationDatas (app['authentication'].getUser()) != true %}not_decided{% endif %} agree_{{basket_element.getId()}}"/> class="{% if basket_element.getUserValidationDatas (app.getAuthenticatedUser()) != true %}not_decided{% endif %} agree_{{basket_element.getId()}}"/>
<img src="/skins/lightbox/disagree-big.png" <img src="/skins/lightbox/disagree-big.png"
class="{% if basket_element.getUserValidationDatas (app['authentication'].getUser()) != false %}not_decided{% endif %} disagree_{{basket_element.getId()}}" /> class="{% if basket_element.getUserValidationDatas (app.getAuthenticatedUser()) != false %}not_decided{% endif %} disagree_{{basket_element.getId()}}" />
</div> </div>
{% endif %} {% endif %}

View File

@@ -94,7 +94,7 @@
<div id="record_infos" class="PNB"> <div id="record_infos" class="PNB">
<div class="lightbox_container PNB"> <div class="lightbox_container PNB">
{% if basket_element %} {% if basket_element %}
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %}
{{macro.caption(basket_element.getRecord(app), business, false)}} {{macro.caption(basket_element.getRecord(app), business, false)}}
{% endif %} {% endif %}
</div> </div>
@@ -178,7 +178,7 @@
<div id="dialog_dwnl" title="{{ 'action : exporter' | trans }}" style="display:none;"></div> <div id="dialog_dwnl" title="{{ 'action : exporter' | trans }}" style="display:none;"></div>
<script type="text/javascript"> <script type="text/javascript">
{% if basket.getValidation() %} {% if basket.getValidation() %}
p4.releasable = {% if basket.getValidation().getParticipant(app['authentication'].getUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %} p4.releasable = {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %}
{% endif %} {% endif %}
</script> </script>
{% endblock %} {% endblock %}

View File

@@ -2,7 +2,7 @@
<label>{{ 'Collection' | trans }}</label> <label>{{ 'Collection' | trans }}</label>
<select name="base_id"> <select name="base_id">
{% for collection in app['acl'].get(app['authentication'].getUser()).get_granted_base(['canaddrecord']) %} {% for collection in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['canaddrecord']) %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_label(app['locale']) }} / {{ collection.get_label(app['locale']) }}</option> <option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_label(app['locale']) }} / {{ collection.get_label(app['locale']) }}</option>
{% endfor %} {% endfor %}
</select> </select>

View File

@@ -1,7 +1,7 @@
{% extends 'prod/Tooltip/Tooltip.html.twig' %} {% extends 'prod/Tooltip/Tooltip.html.twig' %}
{% set title %} {% set title %}
app['authentication'].getUser().getDisplayName() app.getAuthenticatedUser().getDisplayName()
{% endset %} {% endset %}
{% set width = 300 %} {% set width = 300 %}
{% set maxwidth = null %} {% set maxwidth = null %}
@@ -12,12 +12,12 @@
<img style="margin:14px 8px;" src="/skins/icons/user.png"/> <img style="margin:14px 8px;" src="/skins/icons/user.png"/>
</div> </div>
<div class="PNB" style="left:100px;"> <div class="PNB" style="left:100px;">
<h1> {{ app['authentication'].getUser().getDisplayName() }}</h1> <h1> {{ app.getAuthenticatedUser().getDisplayName() }}</h1>
<ul> <ul>
<li>{{ app['authentication'].getUser().getEmail() }}</li> <li>{{ app.getAuthenticatedUser().getEmail() }}</li>
<li>{{ app['authentication'].getUser().getCompany() }}</li> <li>{{ app.getAuthenticatedUser().getCompany() }}</li>
<li>{{ app['authentication'].getUser().getJob() }}</li> <li>{{ app.getAuthenticatedUser().getJob() }}</li>
<li>{{ app['authentication'].getUser().getActivity() }}</li> <li>{{ app.getAuthenticatedUser().getActivity() }}</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -11,36 +11,36 @@
<img src="/skins/prod/000000/images/print_history.png"/> <img src="/skins/prod/000000/images/print_history.png"/>
</button> </button>
{% if app['acl'].get(app['authentication'].getUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<button class="ui-corner-all TOOL_ppen_btn basket_window" title="{{ 'action : editer' | trans }}"> <button class="ui-corner-all TOOL_ppen_btn basket_window" title="{{ 'action : editer' | trans }}">
<img src="/skins/prod/000000/images/ppen_history.png"/> <img src="/skins/prod/000000/images/ppen_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('changestatus') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('changestatus') %}
<button class="ui-corner-all TOOL_chgstatus_btn basket_window" title="{{ 'action : status' | trans }}"> <button class="ui-corner-all TOOL_chgstatus_btn basket_window" title="{{ 'action : status' | trans }}">
<img src="/skins/prod/000000/images/chgstatus_history.png"/> <img src="/skins/prod/000000/images/chgstatus_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('deleterecord') and app['acl'].get(app['authentication'].getUser()).has_right('addrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('deleterecord') and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
<button class="ui-corner-all TOOL_chgcoll_btn basket_window" title="{{ 'action : collection' | trans }}"> <button class="ui-corner-all TOOL_chgcoll_btn basket_window" title="{{ 'action : collection' | trans }}">
<img src="/skins/prod/000000/images/chgcoll_history.png"/> <img src="/skins/prod/000000/images/chgcoll_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('push') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('push') %}
<button class="ui-corner-all TOOL_pushdoc_btn basket_window" title="{{ 'action : push' | trans }}"> <button class="ui-corner-all TOOL_pushdoc_btn basket_window" title="{{ 'action : push' | trans }}">
<img src="/skins/icons/push16.png"/> <img src="/skins/icons/push16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('push') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('push') %}
<button class="ui-corner-all TOOL_feedback_btn basket_window" title="{{ 'Feedback' | trans }}"> <button class="ui-corner-all TOOL_feedback_btn basket_window" title="{{ 'Feedback' | trans }}">
<img src="/skins/icons/feedback16.png"/> <img src="/skins/icons/feedback16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('bas_chupub') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('bas_chupub') %}
<button class="ui-corner-all TOOL_bridge_btn basket_window" title="{{ 'action : bridge' | trans }}"> <button class="ui-corner-all TOOL_bridge_btn basket_window" title="{{ 'action : bridge' | trans }}">
<img src="/skins/icons/door.png"/> <img src="/skins/icons/door.png"/>
</button> </button>
@@ -49,7 +49,7 @@
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('doctools') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('doctools') %}
<button class="ui-corner-all TOOL_imgtools_btn basket_window" title="{{ 'action : outils' | trans }}"> <button class="ui-corner-all TOOL_imgtools_btn basket_window" title="{{ 'action : outils' | trans }}">
<img src="/skins/prod/000000/images/imgtools_history.png"/> <img src="/skins/prod/000000/images/imgtools_history.png"/>
</button> </button>

View File

@@ -11,7 +11,7 @@
<td> <td>
<h1 class="title"> <h1 class="title">
<img class="loader" src="/skins/prod/Basket/Browser/loader.gif" /> <img class="loader" src="/skins/prod/Basket/Browser/loader.gif" />
{% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['authentication'].getUser()) %} {% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app.getAuthenticatedUser()) %}
<a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};"> <a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
<span> <span>
<img src="/skins/prod/Basket/Browser/archive.png"/> <img src="/skins/prod/Basket/Browser/archive.png"/>

View File

@@ -50,7 +50,7 @@
<td class="content"> <td class="content">
<h1 class="title"> <h1 class="title">
<img class="loader" src="/skins/prod/Basket/Browser/loader.gif" /> <img class="loader" src="/skins/prod/Basket/Browser/loader.gif" />
{% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['authentication'].getUser()) %} {% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app.getAuthenticatedUser()) %}
<a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};"> <a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
<span> <span>
<img src="/skins/prod/Basket/Browser/archive.png"/> <img src="/skins/prod/Basket/Browser/archive.png"/>

View File

@@ -48,7 +48,7 @@
onclick="downloadThis('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }} onclick="downloadThis('ssel={{basket.getId()}}');">{{ 'action::exporter' | trans }}
</div> </div>
</div> </div>
{% if app['acl'].get(app['authentication'].getUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<div title="" class="context-menu-item menu3-custom-item"> <div title="" class="context-menu-item menu3-custom-item">
<div onclick="editThis('SSTT','{{basket.getId()}}');" style="" <div onclick="editThis('SSTT','{{basket.getId()}}');" style=""
class="context-menu-item-inner">{{ 'edit' | trans }} class="context-menu-item-inner">{{ 'edit' | trans }}
@@ -230,7 +230,7 @@
onclick="downloadThis('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }} onclick="downloadThis('lst={{story.getRecord(app).get_serialize_key()}}');">{{ 'action::exporter' | trans }}
</div> </div>
</div> </div>
{% if app['acl'].get(app['authentication'].getUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<div title="" class="context-menu-item menu3-custom-item"> <div title="" class="context-menu-item menu3-custom-item">
<div onclick="editThis('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style="" <div onclick="editThis('IMGT','{{story.getRecord(app).get_serialize_key()}}');" style=""
class="context-menu-item-inner">{{ 'action::editer' | trans }} class="context-menu-item-inner">{{ 'action::editer' | trans }}
@@ -268,10 +268,10 @@
{% macro element(wz_scope, container, contained, record, ord) %} {% macro element(wz_scope, container, contained, record, ord) %}
{% set box_height = 110 %} {% set box_height = 110 %}
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_title_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %}
{% set box_height = (box_height + 20) %} {% set box_height = (box_height + 20) %}
{% endif %} {% endif %}
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_status_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_status_display') == '1' %}
{% set box_height = (box_height + 20) %} {% set box_height = (box_height + 20) %}
{% endif %} {% endif %}
@@ -281,12 +281,12 @@
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;" class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}"> id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/> <input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_title_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') == '1' %}
<div class="title"> <div class="title">
{{record.get_title()}} {{record.get_title()}}
</div> </div>
{% endif %} {% endif %}
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_status_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_status_display') == '1' %}
<div class="status" style="position:relative;height:20px;overflow-y:visible;z-index:15;"> <div class="status" style="position:relative;height:20px;overflow-y:visible;z-index:15;">
{% for flag in record_flags(record) %} {% for flag in record_flags(record) %}
<img src="{{ flag.path }}" title="{{ attribute(flag.labels, app.locale) }}" /> <img src="{{ flag.path }}" title="{{ attribute(flag.labels, app.locale) }}" />
@@ -311,7 +311,7 @@
class="WorkZoneElementRemover {{ wz_scope }}" title="{{ 'delete' | trans }}" > class="WorkZoneElementRemover {{ wz_scope }}" title="{{ 'delete' | trans }}" >
X X
</a> </a>
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_caption_display') == '1' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_caption_display') == '1' %}
<div class="captionRolloverTips" tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'basket', 'number' : record.get_number() }) }}"></div> <div class="captionRolloverTips" tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'basket', 'number' : record.get_number() }) }}"></div>
{% endif %} {% endif %}
</div> </div>
@@ -347,7 +347,7 @@
<td style="width:100%;"> <td style="width:100%;">
<table style=width:100%> <table style=width:100%>
{% for choice in basket_element.getValidationDatas() %} {% for choice in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['authentication'].getUser()).getCanSeeOthers() or choice.getParticipant().getUser() == app['authentication'].getUser() %} {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).getCanSeeOthers() or choice.getParticipant().getUser() == app.getAuthenticatedUser() %}
<tr> <tr>
<td> {{ choice.getParticipant().getUser().getDisplayName() }} </td> <td> {{ choice.getParticipant().getUser().getDisplayName() }} </td>
<td> <td>

View File

@@ -11,36 +11,36 @@
<img src="/skins/prod/000000/images/print_history.png"/> <img src="/skins/prod/000000/images/print_history.png"/>
</button> </button>
{% if app['acl'].get(app['authentication'].getUser()).has_right('modifyrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('modifyrecord') %}
<button class="ui-corner-all TOOL_ppen_btn story_window" title="{{ 'action : editer' | trans }}"> <button class="ui-corner-all TOOL_ppen_btn story_window" title="{{ 'action : editer' | trans }}">
<img src="/skins/prod/000000/images/ppen_history.png"/> <img src="/skins/prod/000000/images/ppen_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('changestatus') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('changestatus') %}
<button class="ui-corner-all TOOL_chgstatus_btn story_window" title="{{ 'action : status' | trans }}"> <button class="ui-corner-all TOOL_chgstatus_btn story_window" title="{{ 'action : status' | trans }}">
<img src="/skins/prod/000000/images/chgstatus_history.png"/> <img src="/skins/prod/000000/images/chgstatus_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('deleterecord') and app['acl'].get(app['authentication'].getUser()).has_right('addrecord') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('deleterecord') and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
<button class="ui-corner-all TOOL_chgcoll_btn story_window" title="{{ 'action : collection' | trans }}"> <button class="ui-corner-all TOOL_chgcoll_btn story_window" title="{{ 'action : collection' | trans }}">
<img src="/skins/prod/000000/images/chgcoll_history.png"/> <img src="/skins/prod/000000/images/chgcoll_history.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('push') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('push') %}
<button class="ui-corner-all TOOL_pushdoc_btn story_window" title="{{ 'action : push' | trans }}"> <button class="ui-corner-all TOOL_pushdoc_btn story_window" title="{{ 'action : push' | trans }}">
<img src="/skins/icons/push16.png"/> <img src="/skins/icons/push16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('push') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('push') %}
<button class="ui-corner-all TOOL_feedback_btn story_window" title="{{ 'Feedback' | trans }}"> <button class="ui-corner-all TOOL_feedback_btn story_window" title="{{ 'Feedback' | trans }}">
<img src="/skins/icons/feedback16.png"/> <img src="/skins/icons/feedback16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('bas_chupub') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('bas_chupub') %}
<button class="ui-corner-all TOOL_bridge_btn story_window" title="{{ 'action : bridge' | trans }}"> <button class="ui-corner-all TOOL_bridge_btn story_window" title="{{ 'action : bridge' | trans }}">
<img src="/skins/icons/door.png"/> <img src="/skins/icons/door.png"/>
</button> </button>
@@ -49,7 +49,7 @@
</button> </button>
{% endif %} {% endif %}
{% if app['acl'].get(app['authentication'].getUser()).has_right('doctools') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('doctools') %}
<button class="ui-corner-all TOOL_imgtools_btn story_window" title="{{ 'action : outils' | trans }}"> <button class="ui-corner-all TOOL_imgtools_btn story_window" title="{{ 'action : outils' | trans }}">
<img src="/skins/prod/000000/images/imgtools_history.gif"/> <img src="/skins/prod/000000/images/imgtools_history.gif"/>
</button> </button>

View File

@@ -33,7 +33,7 @@
<input type="hidden" name="usr_id" value="{{ owner.getUser().getId() }}" /> <input type="hidden" name="usr_id" value="{{ owner.getUser().getId() }}" />
</td> </td>
<td style="padding-right:10px;min-width:100px;"> <td style="padding-right:10px;min-width:100px;">
{% if app['authentication'].getUser().getId() == owner.getUser().getId() %} {% if app.getAuthenticatedUser().getId() == owner.getUser().getId() %}
{% if owner.getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if owner.getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %}
{{ 'You are Admin' | trans }} {{ 'You are Admin' | trans }}
{% endif %} {% endif %}
@@ -53,7 +53,7 @@
{% endif %} {% endif %}
</td> </td>
<td style="width:15px"> <td style="width:15px">
{% if app['authentication'].getUser().getId() == owner.getUser().getId() %} {% if app.getAuthenticatedUser().getId() == owner.getUser().getId() %}
<a href="#" class="deleter"> <a href="#" class="deleter">
<img src="/skins/prod/Push/close_badge.png" title="{{ 'Remove' | trans }}"/> <img src="/skins/prod/Push/close_badge.png" title="{{ 'Remove' | trans }}"/>
</a> </a>

View File

@@ -5,7 +5,7 @@
<table style="height: 40px;"> <table style="height: 40px;">
<tr> <tr>
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<form class="form-inline" method="POST" name="SaveName" action="{{ path('prod_lists_list_update', { 'list_id' : list.getId() }) }}"> <form class="form-inline" method="POST" name="SaveName" action="{{ path('prod_lists_list_update', { 'list_id' : list.getId() }) }}">
<label>{{ 'List Name' | trans }}</label> <label>{{ 'List Name' | trans }}</label>
<input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/> <input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/>
@@ -16,14 +16,14 @@
{% endif %} {% endif %}
</td> </td>
<td style="text-align:right;white-space:nowrap;"> <td style="text-align:right;white-space:nowrap;">
{% if list.getOwner(app['authentication'].getUser()).getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() == constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<a href="{{ path('prod_lists_list_share', { 'list_id' : list.getId() }) }}" title="{{ 'Share the list' | trans }}" class="list_sharer"> <a href="{{ path('prod_lists_list_share', { 'list_id' : list.getId() }) }}" title="{{ 'Share the list' | trans }}" class="list_sharer">
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{{ "Set sharing permission" | trans }} {{ "Set sharing permission" | trans }}
</a> </a>
{% endif %} {% endif %}
</td> </td>
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<td style="text-align:right;white-space:nowrap;width:150px;"> <td style="text-align:right;white-space:nowrap;width:150px;">
<button class="deleter btn btn-inverse" data-list-id="{{ list.getId() }}"> <button class="deleter btn btn-inverse" data-list-id="{{ list.getId() }}">
{{ 'Delete' | trans }} {{ 'Delete' | trans }}
@@ -39,20 +39,20 @@
<p> <p>
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %} {% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %}
{% trans with {'%length%' : length} %}%length% peoples{% endtrans %} {% trans with {'%length%' : length} %}%length% peoples{% endtrans %}
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<button class="EditToggle btn btn-inverse">{{ 'Edit' | trans }}</button> <button class="EditToggle btn btn-inverse">{{ 'Edit' | trans }}</button>
{% endif %} {% endif %}
</p> </p>
</div> </div>
<div class="PNB" style="top:35px;overflow:auto;"> <div class="PNB" style="top:35px;overflow:auto;">
{% set role = list.getOwner(app['authentication'].getUser()).getRole() %} {% set role = list.getOwner(app.getAuthenticatedUser()).getRole() %}
{% for entry in list.getEntries() %} {% for entry in list.getEntries() %}
{{ ListsMacros.badgeReadonly(entry, role) }} {{ ListsMacros.badgeReadonly(entry, role) }}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<div class="PNB content readwrite grey-bg" style="display:none;top:40px;"> <div class="PNB content readwrite grey-bg" style="display:none;top:40px;">
<form name="list-editor-search" method="POST" action="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}"> <form name="list-editor-search" method="POST" action="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}">
<div class="PNB10" style="height:160px;"> <div class="PNB10" style="height:160px;">

View File

@@ -14,7 +14,7 @@
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %} {% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a href="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}" class="list_link"> <a href="{{ path('prod_push_list_edit', { 'list_id' : list.getId() }) }}" class="list_link">
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{% else %} {% else %}
<img src="/skins/icons/SHARE16.png" /> <img src="/skins/icons/SHARE16.png" />

View File

@@ -62,7 +62,7 @@
{% for list in lists %} {% for list in lists %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a class="list_loader" href="{{ path('prod_push_lists_list', { 'list_id' : list.getId() }) }}"> <a class="list_loader" href="{{ path('prod_push_lists_list', { 'list_id' : list.getId() }) }}">
{% if list.getOwner(app['authentication'].getUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app.getAuthenticatedUser()).getRole() >= constant('Alchemy\\Phrasea\\Model\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{% else %} {% else %}
<img src="/skins/icons/SHARE16.png" /> <img src="/skins/icons/SHARE16.png" />
@@ -87,7 +87,7 @@
<input class="search" name="users-search" placeholder="{{ 'Users' | trans }}" type="text" style="width:210px;"/> <input class="search" name="users-search" placeholder="{{ 'Users' | trans }}" type="text" style="width:210px;"/>
<br/> <br/>
{{ 'Select a user in the list' | trans }} <br/> {{ 'Select a user in the list' | trans }} <br/>
{% if app['acl'].get(app['authentication'].getUser()).has_right('manageusers') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right('manageusers') %}
{{ 'or' | trans }} {{ 'or' | trans }}
<a href="{{ path('prod_push_add_user') }}" class="user_adder link">{{ 'Add user' | trans }}</a> <a href="{{ path('prod_push_add_user') }}" class="user_adder link">{{ 'Add user' | trans }}</a>
{% endif %} {% endif %}

View File

@@ -4,8 +4,8 @@
{% set cont_width = 130 %} {% set cont_width = 130 %}
{% set cont_height = 140 %} {% set cont_height = 140 %}
{% else %} {% else %}
{% set cont_width = app['settings'].getUserSetting(app['authentication'].getUser(), 'editing_images_size') %} {% set cont_width = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'editing_images_size') %}
{% set cont_height = app['settings'].getUserSetting(app['authentication'].getUser(), 'editing_images_size') %} {% set cont_height = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'editing_images_size') %}
{% endif %} {% endif %}
{% set i = record.get_number() %} {% set i = record.get_number() %}
@@ -27,7 +27,7 @@
{% endif %} {% endif %}
{% set class_status = 'nostatus' %} {% set class_status = 'nostatus' %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'chgstatus') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'chgstatus') %}
{% set class_status = '' %} {% set class_status = '' %}
{% endif %} {% endif %}
@@ -71,8 +71,8 @@
{% trans %}prod::editing::fields: status{% endtrans %} {% trans %}prod::editing::fields: status{% endtrans %}
</div> </div>
{% set cssfile = '000000' %} {% set cssfile = '000000' %}
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'css') %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'css') %}
{% set cssfile = app['settings'].getUserSetting(app['authentication'].getUser(), 'css') %} {% set cssfile = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'css') %}
{% endif %} {% endif %}
{% for field in fields %} {% for field in fields %}
{% set i = field.get_id() %} {% set i = field.get_id() %}
@@ -127,7 +127,7 @@
<input style="font-size:2px; width:5px;" type="text" id="editFakefocus" /> <input style="font-size:2px; width:5px;" type="text" id="editFakefocus" />
</form> </form>
</div> </div>
<div id="EDIT_TOP" style="height:{{app['settings'].getUserSetting(app['authentication'].getUser(), 'editing_top_box')}};"> <div id="EDIT_TOP" style="height:{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'editing_top_box')}};">
<div id="EDIT_MENU"> <div id="EDIT_MENU">
<div id="EDIT_ZOOMSLIDER" > <div id="EDIT_ZOOMSLIDER" >
</div> </div>
@@ -150,7 +150,7 @@
<div id='EDIT_MID'> <div id='EDIT_MID'>
<div id='EDIT_MID_L' class='ui-corner-all'> <div id='EDIT_MID_L' class='ui-corner-all'>
<div id="divS_wrapper" style="width:{{app['settings'].getUserSetting(app['authentication'].getUser(), 'editing_right_box')}}"> <div id="divS_wrapper" style="width:{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'editing_right_box')}}">
<div id="divS"> <div id="divS">
{{_self.HTML_fieldlist(recordsRequest, fields)}} {{_self.HTML_fieldlist(recordsRequest, fields)}}
</div> </div>
@@ -230,7 +230,7 @@
<div id="idExplain" class="PNB"></div> <div id="idExplain" class="PNB"></div>
</div> </div>
</div> </div>
<div id="EDIT_MID_R" style="width:{{app['settings'].getUserSetting(app['authentication'].getUser(), 'editing_left_box')}}"> <div id="EDIT_MID_R" style="width:{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'editing_left_box')}}">
<div style='position:absolute; top:0; left:0; right:0; bottom:0;' class='tabs'> <div style='position:absolute; top:0; left:0; right:0; bottom:0;' class='tabs'>
<ul> <ul>
{% if thesaurus %} {% if thesaurus %}

View File

@@ -55,16 +55,16 @@
<label for="feed_add_subtitle"><b>{{ 'publication : sous titre' | trans }}</b></label> <label for="feed_add_subtitle"><b>{{ 'publication : sous titre' | trans }}</b></label>
<textarea id="feed_add_subtitle" style="max-width:500px" class="input-block-level" name="subtitle" rows="5">{{desc}}</textarea> <textarea id="feed_add_subtitle" style="max-width:500px" class="input-block-level" name="subtitle" rows="5">{{desc}}</textarea>
<label for="feed_add_author_name"><b>{{ 'publication : autheur' | trans }}</b></label> <label for="feed_add_author_name"><b>{{ 'publication : autheur' | trans }}</b></label>
<input class="required_text input-block-level" style="max-width:500px" type="text" name="author_name" id="feed_add_author_name" value="{{ app['authentication'].getUser().getDisplayName() }}" /> <input class="required_text input-block-level" style="max-width:500px" type="text" name="author_name" id="feed_add_author_name" value="{{ app.getAuthenticatedUser().getDisplayName() }}" />
<label for="feed_add_author_mail"><b>{{ 'publication : email autheur' | trans }}</b></label> <label for="feed_add_author_mail"><b>{{ 'publication : email autheur' | trans }}</b></label>
<input class="required_text input-block-level" style="max-width:500px" type="text" name="author_mail" id="feed_add_author_mail" value="{{ app['authentication'].getUser().getEmail() }}" /> <input class="required_text input-block-level" style="max-width:500px" type="text" name="author_mail" id="feed_add_author_mail" value="{{ app.getAuthenticatedUser().getEmail() }}" />
</div> </div>
<div class="span6"> <div class="span6">
<div class="feeds"> <div class="feeds">
<h1>{{ 'Fils disponibles' | trans }}</h1> <h1>{{ 'Fils disponibles' | trans }}</h1>
<div class="list"> <div class="list">
{% for feed in feeds %} {% for feed in feeds %}
{% if feed.isPublisher(app['authentication'].getUser()) %} {% if feed.isPublisher(app.getAuthenticatedUser()) %}
<div class="feed {% if loop.index is odd%}odd{% endif %}"> <div class="feed {% if loop.index is odd%}odd{% endif %}">
<span>{{ feed.getTitle() }}</span> <span>{{ feed.getTitle() }}</span>
{% if feed.isPublic() %} {% if feed.isPublic() %}

View File

@@ -51,7 +51,7 @@
<div class="list"> <div class="list">
{% set feed_id = entry.getFeed().getId() %} {% set feed_id = entry.getFeed().getId() %}
{% for feed in feeds %} {% for feed in feeds %}
{% if feed.isPublisher(app['authentication'].getUser()) %} {% if feed.isPublisher(app.getAuthenticatedUser()) %}
<div class="feed {% if loop.index is odd%}odd{% endif %} {% if feed_id == feed.getId() %}selected{% endif %}"> <div class="feed {% if loop.index is odd%}odd{% endif %} {% if feed_id == feed.getId() %}selected{% endif %}">
<span>{{ feed.getTitle() }}</span> <span>{{ feed.getTitle() }}</span>
<input type="hidden" value="{{ feed.getId() }}"/> <input type="hidden" value="{{ feed.getId() }}"/>

View File

@@ -54,14 +54,14 @@
{% block rss %} {% block rss %}
{% for feed in feeds %} {% for feed in feeds %}
{% set link = app['feed.user-link-generator'].generate(feed, app['authentication'].getUser(), 'rss') %} {% set link = app['feed.user-link-generator'].generate(feed, app.getAuthenticatedUser(), 'rss') %}
<link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" /> <link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" />
{% set link = app['feed.user-link-generator'].generate(feed, app['authentication'].getUser(), 'atom') %} {% set link = app['feed.user-link-generator'].generate(feed, app.getAuthenticatedUser(), 'atom') %}
<link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" /> <link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" />
{% endfor %} {% endfor %}
{% set link = app['feed.aggregate-link-generator'].generate(aggregate, app['authentication'].getUser(), 'rss') %} {% set link = app['feed.aggregate-link-generator'].generate(aggregate, app.getAuthenticatedUser(), 'rss') %}
<link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" /> <link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" />
{% set link = app['feed.aggregate-link-generator'].generate(aggregate, app['authentication'].getUser(), 'atom') %} {% set link = app['feed.aggregate-link-generator'].generate(aggregate, app.getAuthenticatedUser(), 'atom') %}
<link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" /> <link rel="alternate" type="{{ link.getMimetype() }}" title="{{ link.getTitle() }}" href="{{ link.getURI() }}" />
{% endblock %} {% endblock %}
@@ -97,12 +97,12 @@
<style title="color_selection" type="text/css"> <style title="color_selection" type="text/css">
/* .diapo.ui-selecting,#reorder_box .diapo.selecting, #EDIT_ALL .diapo.selecting, .list.selecting, .list.selecting .diapo { /* .diapo.ui-selecting,#reorder_box .diapo.selecting, #EDIT_ALL .diapo.selecting, .list.selecting, .list.selecting .diapo {
color: #{{ app['settings'].getUserSetting(app['authentication'].getUser(), 'fontcolor-selection', 'FFFFFF') }}; color: #{{ app['settings'].getUserSetting(app.getAuthenticatedUser(), 'fontcolor-selection', 'FFFFFF') }};
background-color: #{{ app['settings'].getUserSetting(app['authentication'].getUser(), 'background-selection-disabled', '333333')}}}; background-color: #{{ app['settings'].getUserSetting(app.getAuthenticatedUser(), 'background-selection-disabled', '333333')}}};
}*/ }*/
.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo { .diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo {
color: {{"#" ~ app['settings'].getUserSetting(app['authentication'].getUser(), 'fontcolor-selection', 'FFFFFF')}}; color: {{"#" ~ app['settings'].getUserSetting(app.getAuthenticatedUser(), 'fontcolor-selection', 'FFFFFF')}};
background-color: {{"#" ~ app['settings'].getUserSetting(app['authentication'].getUser(), 'background-selection', '404040')}}; background-color: {{"#" ~ app['settings'].getUserSetting(app.getAuthenticatedUser(), 'background-selection', '404040')}};
} }
</style> </style>
<!-- Include Fancytree skin and library --> <!-- Include Fancytree skin and library -->
@@ -176,7 +176,7 @@
</script> </script>
{% endif %} {% endif %}
{% set ratio = app['settings'].getUserSetting(app['authentication'].getUser(), 'search_window') %} {% set ratio = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'search_window') %}
{% if ratio == 0 %} {% if ratio == 0 %}
{% set ratio = '0.333' %} {% set ratio = '0.333' %}
{% endif %} {% endif %}
@@ -197,7 +197,7 @@
ondblclick="return(thesau_dblclickThesaurus(event));" onclick="return(thesau_clickThesaurus(event));"> ondblclick="return(thesau_dblclickThesaurus(event));" onclick="return(thesau_clickThesaurus(event));">
<button id="facets-back-btn" style="display:none;">back</button> <button id="facets-back-btn" style="display:none;">back</button>
</div> </div>
{% include 'prod/tab_thesaurus.html.twig' with {has_access_to_module: app['acl'].get(app['authentication'].getUser()).has_access_to_module('thesaurus')} %} {% include 'prod/tab_thesaurus.html.twig' with {has_access_to_module: app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus')} %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</div> </div>
@@ -216,7 +216,7 @@
{{ 'Browse Baskets' | trans }} {{ 'Browse Baskets' | trans }}
</a> </a>
</div> </div>
{% if app['conf'].get(['registry', 'modules', 'stories']) and app['acl'].get(app['authentication'].getUser()).has_right('addrecord') %} {% if app['conf'].get(['registry', 'modules', 'stories']) and app.getAclForUser(app.getAuthenticatedUser()).has_right('addrecord') %}
<div class="context-menu-item-inner"> <div class="context-menu-item-inner">
<a title="{{ 'action:: nouveau reportage' | trans }}" class="dialog small-dialog" href="{{ path('prod_stories_create') }}"> <a title="{{ 'action:: nouveau reportage' | trans }}" class="dialog small-dialog" href="{{ path('prod_stories_create') }}">
<img style="cursor:pointer;" src="/skins/icons/mtadd_0.gif" title="{{ 'action:: nouveau reportage' | trans }}" /> <img style="cursor:pointer;" src="/skins/icons/mtadd_0.gif" title="{{ 'action:: nouveau reportage' | trans }}" />
@@ -250,9 +250,9 @@
<div id="headBlock" class="PNB"> <div id="headBlock" class="PNB">
<div class="searchFormWrapper"> <div class="searchFormWrapper">
<form id="searchForm" method="POST" action="{{ path('prod_query') }}" name="phrasea_query" class="phrasea_query"> <form id="searchForm" method="POST" action="{{ path('prod_query') }}" name="phrasea_query" class="phrasea_query">
<input id="SENT_query" name="qry" type="hidden" value="{{app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page_query')}}"> <input id="SENT_query" name="qry" type="hidden" value="{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page_query')}}">
<div class="input-append"> <div class="input-append">
<input id="EDIT_query" name="fake_qry" type="text" autocomplete="off" class="search query" value="{{app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page_query')}}"> <input id="EDIT_query" name="fake_qry" type="text" autocomplete="off" class="search query" value="{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page_query')}}">
<a id="ADV_query" href="#" class="btn btn-inverse adv_trigger adv_search_button"> <a id="ADV_query" href="#" class="btn btn-inverse adv_trigger adv_search_button">
<img src="/skins/icons/settings.png" title="{{ 'Advanced Search' | trans }}"/> <img src="/skins/icons/settings.png" title="{{ 'Advanced Search' | trans }}"/>
</a> </a>
@@ -446,17 +446,17 @@
<div id="idFrameT" class="PNB ui-corner-top"> <div id="idFrameT" class="PNB ui-corner-top">
<div class="tools PNB10 btn-toolbar"> <div class="tools PNB10 btn-toolbar">
{% include "prod/toolbar.html.twig" with {acl: app['acl'].get(app['authentication'].getUser())} %} {% include "prod/toolbar.html.twig" with {acl: app.getAclForUser(app.getAuthenticatedUser())} %}
<a href="#" id="settings" onclick="lookBox(this,event);return false;">{{ 'Preferences' | trans }} </a> <a href="#" id="settings" onclick="lookBox(this,event);return false;">{{ 'Preferences' | trans }} </a>
</div> </div>
<div id="answers" class=" PNB10"> <div id="answers" class=" PNB10">
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page') == 'QUERY' %} {% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') == 'QUERY' %}
$('form[name="phrasea_query"]').addClass('triggerAfterInit'); $('form[name="phrasea_query"]').addClass('triggerAfterInit');
{% elseif app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page') == 'LAST_QUERY' %} {% elseif app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') == 'LAST_QUERY' %}
$('form[name="phrasea_query"]').addClass('triggerAfterInit'); $('form[name="phrasea_query"]').addClass('triggerAfterInit');
{% elseif app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page') == 'PUBLI' %} {% elseif app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') == 'PUBLI' %}
getHome('PUBLI'); getHome('PUBLI');
{% endif %} {% endif %}
}); });
@@ -520,7 +520,7 @@
<div id="MESSAGE-push"></div> <div id="MESSAGE-push"></div>
<div id="MESSAGE-publi"></div> <div id="MESSAGE-publi"></div>
<div id="DIALOG"></div> <div id="DIALOG"></div>
<div id="keyboard-dialog" class="{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{{ 'raccourci :: a propos des raccourcis claviers' | trans }}"> <div id="keyboard-dialog" class="{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{{ 'raccourci :: a propos des raccourcis claviers' | trans }}">
<div> <div>
<h1>{{ 'Raccourcis claviers en cours de recherche :' | trans }}</h1> <h1>{{ 'Raccourcis claviers en cours de recherche :' | trans }}</h1>
<ul> <ul>
@@ -583,7 +583,7 @@
<div id="look_box_screen"> <div id="look_box_screen">
<div class="box"> <div class="box">
<div class="" style="float:left; width:100%;margin-top:20px;"> <div class="" style="float:left; width:100%;margin-top:20px;">
{% set mod = app['settings'].getUserSetting(app['authentication'].getUser(), 'advanced_search_reload') %} {% set mod = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'advanced_search_reload') %}
<label class="checkbox inline" for="user_settings_advanced_search_reload"> <label class="checkbox inline" for="user_settings_advanced_search_reload">
<input onchange="setPref('advanced_search_reload',$(this).attr('checked')?'1' : '0');" name="advanced_search_reload" type="checkbox" style="margin: 3px 0 0 -18px;" class="checkbox" value="1" id="user_settings_advanced_search_reload" {% if mod == '1' %}checked="checked"{% endif %}/> <input onchange="setPref('advanced_search_reload',$(this).attr('checked')?'1' : '0');" name="advanced_search_reload" type="checkbox" style="margin: 3px 0 0 -18px;" class="checkbox" value="1" id="user_settings_advanced_search_reload" {% if mod == '1' %}checked="checked"{% endif %}/>
{{ 'Use latest search settings on Production loading' | trans }} {{ 'Use latest search settings on Production loading' | trans }}
@@ -593,7 +593,7 @@
<div class="box"> <div class="box">
<div class="" style="float:left; width:49%;"> <div class="" style="float:left; width:49%;">
<h1>{{ 'Mode de presentation' | trans }}</h1> <h1>{{ 'Mode de presentation' | trans }}</h1>
{% set mod = app['settings'].getUserSetting(app['authentication'].getUser(), 'view') %} {% set mod = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'view') %}
<label class="radio inline" for="thumbs_view"> <label class="radio inline" for="thumbs_view">
<input onchange="setPref('view',$(this).val());" name="view_type" type="radio" style="margin: 3px 0 0 -18px;" class="radio" value="thumbs" id="thumbs_view" {% if mod == 'thumbs' %}checked="checked"{% endif %}/> <input onchange="setPref('view',$(this).val());" name="view_type" type="radio" style="margin: 3px 0 0 -18px;" class="radio" value="thumbs" id="thumbs_view" {% if mod == 'thumbs' %}checked="checked"{% endif %}/>
{{ 'reponses:: mode vignettes' | trans }} {{ 'reponses:: mode vignettes' | trans }}
@@ -612,7 +612,7 @@
</div> </div>
</div> </div>
<div class="box"> <div class="box">
{% set rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %} {% set rollover_thumbnail = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'rollover_thumbnail') %}
<h1>{{ 'Presentation de vignettes' | trans }}</h1> <h1>{{ 'Presentation de vignettes' | trans }}</h1>
<label class="radio" for="rollover_caption"> <label class="radio" for="rollover_caption">
<input onchange="setPref('rollover_thumbnail',$(this).val());" name="rollover_thumbnail" type="radio" class="radio" value="caption" id="rollover_caption" {% if rollover_thumbnail == 'caption' %}checked="checked" {% endif %}/> <input onchange="setPref('rollover_thumbnail',$(this).val());" name="rollover_thumbnail" type="radio" class="radio" value="caption" id="rollover_caption" {% if rollover_thumbnail == 'caption' %}checked="checked" {% endif %}/>
@@ -624,7 +624,7 @@
</label> </label>
</div> </div>
<div class="box"> <div class="box">
{% set technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %} {% set technical_display = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'technical_display') %}
<h1>{{'Display technical data' | trans }}</h1> <h1>{{'Display technical data' | trans }}</h1>
<label class="radio" for="technical_show"> <label class="radio" for="technical_show">
<input onchange="setPref('technical_display',$(this).val());" name="technical_display" type="radio" class="radio" value="1" id="technical_show" {% if technical_display == '1' %}checked="checked"{% endif %}/> <input onchange="setPref('technical_display',$(this).val());" name="technical_display" type="radio" class="radio" value="1" id="technical_show" {% if technical_display == '1' %}checked="checked"{% endif %}/>
@@ -640,7 +640,7 @@
</label> </label>
</div> </div>
<div class="box"> <div class="box">
{% set doctype_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'doctype_display') %} {% set doctype_display = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'doctype_display') %}
<h1>{{'Type de documents' | trans }}</h1> <h1>{{'Type de documents' | trans }}</h1>
<label class="checkbox" for="doctype_display_show"> <label class="checkbox" for="doctype_display_show">
<input onchange="setPref('doctype_display',($(this).attr('checked') ? '1' :'0'));" name="doctype_display" type="checkbox" class="checkbox" value="1" id="doctype_display_show" {% if doctype_display != '0' %}checked="checked"{% endif %}/> <input onchange="setPref('doctype_display',($(this).attr('checked') ? '1' :'0'));" name="doctype_display" type="checkbox" class="checkbox" value="1" id="doctype_display_show" {% if doctype_display != '0' %}checked="checked"{% endif %}/>
@@ -653,14 +653,14 @@
<h1>{{ 'reponses:: images par pages :' | trans }}</h1> <h1>{{ 'reponses:: images par pages :' | trans }}</h1>
<div class="box"> <div class="box">
<div id="nperpage_slider" class="ui-corner-all" style="width:100px; display:inline-block;"></div> <div id="nperpage_slider" class="ui-corner-all" style="width:100px; display:inline-block;"></div>
<input type="text" readonly style="width:35px;" value="{{app['settings'].getUserSetting(app['authentication'].getUser(), 'images_per_page')}}" id="nperpage_value"/> <input type="text" readonly style="width:35px;" value="{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'images_per_page')}}" id="nperpage_value"/>
</div> </div>
</div> </div>
<div style="float:right; width:49%;"> <div style="float:right; width:49%;">
<h1>{{ 'reponses:: taille des images :' | trans }}</h1> <h1>{{ 'reponses:: taille des images :' | trans }}</h1>
<div class="box"> <div class="box">
<div id="sizeAns_slider" class="ui-corner-all" style="width:100px;display:inline-block;"></div> <div id="sizeAns_slider" class="ui-corner-all" style="width:100px;display:inline-block;"></div>
<input type="hidden" value="{{app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')}}" id="sizeAns_value"/> <input type="hidden" value="{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'images_size')}}" id="sizeAns_value"/>
</div> </div>
</div> </div>
</div> </div>
@@ -676,7 +676,7 @@
<div class="box"> <div class="box">
<h1>{{ 'Affichage au demarrage' | trans }}</h1> <h1>{{ 'Affichage au demarrage' | trans }}</h1>
<form class="form-inline"> <form class="form-inline">
{% set start_page_pref = app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page') %} {% set start_page_pref = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') %}
<select class="span4" name="start_page" onchange="start_page_selector();"> <select class="span4" name="start_page" onchange="start_page_selector();">
<option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} > <option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} >
{{ 'Ma derniere question' | trans }} {{ 'Ma derniere question' | trans }}
@@ -691,7 +691,7 @@
{{ 'Aide' | trans }} {{ 'Aide' | trans }}
</option> </option>
</select> </select>
<input type="text" class="span4" name="start_page_value" value="{{ app['settings'].getUserSetting(app['authentication'].getUser(), 'start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" /> <input type="text" class="span4" name="start_page_value" value="{{ app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" />
<input type="button" class="btn btn-inverse" value="{{'boutton::valider' | trans }}" onclick="set_start_page();" /> <input type="button" class="btn btn-inverse" value="{{'boutton::valider' | trans }}" onclick="set_start_page();" />
</form> </form>
</div> </div>
@@ -767,7 +767,7 @@
<div class="box"> <div class="box">
<h1>{{ 'Presentation de vignettes de panier' | trans }}</h1> <h1>{{ 'Presentation de vignettes de panier' | trans }}</h1>
<div> <div>
{% set basket_status_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_status_display') %} {% set basket_status_display = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_status_display') %}
<label for="basket_status_display" class="checkbox"> <label for="basket_status_display" class="checkbox">
<input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'));" <input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'));"
name="basket_status_display" type="checkbox" class="checkbox" value="1" name="basket_status_display" type="checkbox" class="checkbox" value="1"
@@ -776,7 +776,7 @@
</label> </label>
</div> </div>
<div> <div>
{% set basket_caption_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_caption_display') %} {% set basket_caption_display = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_caption_display') %}
<label for="basket_caption_display" class="checkbox"> <label for="basket_caption_display" class="checkbox">
<input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'));" <input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'));"
name="basket_caption_display" type="checkbox" class="checkbox" value="1" name="basket_caption_display" type="checkbox" class="checkbox" value="1"
@@ -785,7 +785,7 @@
</label> </label>
</div> </div>
<div> <div>
{% set basket_title_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'basket_title_display') %} {% set basket_title_display = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'basket_title_display') %}
<label for="basket_title_display" class="checkbox"> <label for="basket_title_display" class="checkbox">
<input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'));" <input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'));"
name="basket_title_display" type="checkbox" class="checkbox" value="1" name="basket_title_display" type="checkbox" class="checkbox" value="1"
@@ -888,7 +888,7 @@
<script type="text/javascript" src="{{ path('minifier', { 'g' : 'prod' }) }}"></script> <script type="text/javascript" src="{{ path('minifier', { 'g' : 'prod' }) }}"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
p4.reg_delete="{% if app['settings'].getUserSetting(app['authentication'].getUser(), "warning_on_delete_story") %}true{% else %}false{% endif %}"; p4.reg_delete="{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), "warning_on_delete_story") %}true{% else %}false{% endif %}";
}); });
function pollNotifications(){ function pollNotifications(){
@@ -898,7 +898,7 @@
dataType: "json", dataType: "json",
data: { data: {
module : 1, module : 1,
usr : {{app['authentication'].getUser().getId()}} usr : {{app.getAuthenticatedUser().getId()}}
}, },
error: function(){ error: function(){
window.setTimeout("pollNotifications();", 10000); window.setTimeout("pollNotifications();", 10000);

View File

@@ -55,8 +55,8 @@
{{ 'report::Modification du document -- je ne me souviens plus de quoi...' | trans }} {{ 'report::Modification du document -- je ne me souviens plus de quoi...' | trans }}
{% endif %} {% endif %}
<span class="actor"> <span class="actor">
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'canreport') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'canreport') %}
{% if done['user'] and done['user'].getId() != app['authentication'].getUser().getId() %} {% if done['user'] and done['user'].getId() != app.getAuthenticatedUser().getId() %}
{% set user_infos = done['user'].getDisplayName() %} {% set user_infos = done['user'].getDisplayName() %}
{% trans with {'%user_infos%' : user_infos} %}report:: par %user_infos%{% endtrans %} {% trans with {'%user_infos%' : user_infos} %}report:: par %user_infos%{% endtrans %}
{% endif %} {% endif %}

View File

@@ -1,5 +1,5 @@
{% if (record.is_from_basket is empty) and app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'canputinalbum') %} {% if (record.is_from_basket is empty) and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'canputinalbum') %}
<div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}" <div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}"
class="baskAdder" title="{{ 'action : ajouter au panier' | trans }}" class="baskAdder" title="{{ 'action : ajouter au panier' | trans }}"
onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);"></div> onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);"></div>
@@ -17,7 +17,7 @@
<div class="printer" title="'{{ 'action : print' | trans }}" <div class="printer" title="'{{ 'action : print' | trans }}"
onclick="evt_print('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div> onclick="evt_print('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div>
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') or app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldhd') or app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), 'candwnldpreview') %}
<div class="downloader" title="{{ 'action : exporter' | trans }}" <div class="downloader" title="{{ 'action : exporter' | trans }}"
onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div> onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div>
{% endif %} {% endif %}

View File

@@ -22,7 +22,7 @@
</h1> </h1>
</td> </td>
<td style="width:60px;text-align:right;"> <td style="width:60px;text-align:right;">
{% if entry.feed.isOwner(app['authentication'].user) or entry.isPublisher(app['authentication'].user) %} {% if entry.feed.isOwner(app.getAuthenticator().user) or entry.isPublisher(app.getAuthenticator().user) %}
<a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.id }) }}"> <a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.id }) }}">
<img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/> <img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/>
</a> </a>

View File

@@ -16,7 +16,7 @@
</h1> </h1>
</td> </td>
<td style="width:60px;text-align:right;"> <td style="width:60px;text-align:right;">
{% if entry.feed.isOwner(app['authentication'].user) or entry.isPublisher(app['authentication'].user) %} {% if entry.feed.isOwner(app.getAuthenticator().user) or entry.isPublisher(app.getAuthenticator().user) %}
<a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.id }) }}"> <a class="tools options feed_edit" href="{{ path('prod_feeds_entry_edit', { 'id' : entry.id }) }}">
<img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/> <img src="/skins/icons/file-edit.png" title="{{ 'boutton::editer' | trans }}"/>
</a> </a>

View File

@@ -370,8 +370,8 @@
</h5> </h5>
<ul class="thumbnails"> <ul class="thumbnails">
{% for record in records %} {% for record in records %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), "canaddrecord") {% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "canaddrecord")
and app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), "candeleterecord") %} and app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(record.get_base_id(), "candeleterecord") %}
<li class="records-subititution span3"> <li class="records-subititution span3">
<div class="thumbnail"> <div class="thumbnail">
<div class="record-thumb" style="text-align:center;"> <div class="record-thumb" style="text-align:center;">

View File

@@ -12,7 +12,7 @@
{% block javascript %} {% block javascript %}
<script type="text/javascript" > <script type="text/javascript" >
var usrId = '{{ app['authentication'].user.getId }}' ; var usrId = '{{ app.getAuthenticator().user.getId }}' ;
var language = { var language = {
valider : '{{ "boutton::valider" | trans }}', valider : '{{ "boutton::valider" | trans }}',

Some files were not shown because too many files have changed in this diff Show More