Address PR comments

This commit is contained in:
Nicolas Le Goff
2014-02-17 14:46:08 +01:00
parent bd110bb8e7
commit eaa1feb765
119 changed files with 358 additions and 347 deletions

View File

@@ -37,14 +37,10 @@ class JsFixtures extends Command
copy($dbRefPath, '/tmp/db.sqlite');
try {
$sbasId = current($this->container['phraseanet.appbox']->get_databoxes())->get_sbas_id();
$this->writeResponse($output, 'GET', '/login/', '/home/login/index.html');
$this->writeResponse($output, 'GET', '/admin/fields/'.$sbasId , '/admin/fields/index.html', true);
$this->writeResponse($output, 'GET', '/admin/task-manager/tasks', '/admin/task-manager/index.html', true);
} catch (\Exception $e) {
throw $e;
}
$sbasId = current($this->container['phraseanet.appbox']->get_databoxes())->get_sbas_id();
$this->writeResponse($output, 'GET', '/login/', '/home/login/index.html');
$this->writeResponse($output, 'GET', '/admin/fields/'.$sbasId , '/admin/fields/index.html', true);
$this->writeResponse($output, 'GET', '/admin/task-manager/tasks', '/admin/task-manager/index.html', true);
$this->copy($output, [
['source' => 'login/common/templates.html.twig', 'target' => 'home/login/templates.html'],

View File

@@ -186,6 +186,7 @@ class RegenerateSqliteDb extends Command
private function insertLazaretFiles(EntityManager $em, \Pimple $DI)
{
$session = new LazaretSession();
$session->setUser($DI['user']);
$em->persist($session);
$em->flush();

View File

@@ -11,6 +11,7 @@
namespace Alchemy\Phrasea\Controller\Admin;
use Alchemy\Phrasea\Exception\RuntimeException;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -176,41 +177,45 @@ class Collection implements ControllerProviderInterface
public function setOrderAdmins(Application $app, Request $request, $bas_id)
{
$success = false;
$admins = array_values($request->request->get('admins', []));
if (count($admins = $request->request->get('admins', [])) > 0) {
$newAdmins = [];
if (count($admins) === 0) {
$app->abort(400, 'No admins provided.');
}
if (!is_array($admins)) {
$app->abort(400, 'Admins must be an array.');
}
$admins = array_map(function ($usrId) use ($app) {
if (null === $user = $app['manipulator.user']->getRepository()->find($usrId)) {
throw new RuntimeException(sprintf('Invalid usrId %s provided.', $usrId));
}
return $user;
}, $admins);
$conn = $app['phraseanet.appbox']->get_connection();
$conn->beginTransaction();
try {
$userQuery = new \User_Query($app);
$result = $userQuery->on_base_ids([$bas_id])
->who_have_right(['order_master'])
->execute()->get_results();
foreach ($result as $user) {
$app['acl']->get($user)->update_rights_to_base($bas_id, ['order_master' => false]);
}
foreach ($admins as $admin) {
$newAdmins[] = $admin;
}
if (count($newAdmins) > 0) {
$conn = $app['phraseanet.appbox']->get_connection();
$conn->beginTransaction();
try {
$userQuery = new \User_Query($app);
$result = $userQuery->on_base_ids([$bas_id])
->who_have_right(['order_master'])
->execute()->get_results();
foreach ($result as $user) {
$app['acl']->get($user)->update_rights_to_base($bas_id, ['order_master' => false]);
}
foreach (array_filter($newAdmins) as $admin) {
if (null !== $user = $app['manipulator.user']->getRepository()->find($admin)) {
$app['acl']->get($user)->update_rights_to_base($bas_id, ['order_master' => true]);
}
}
$conn->commit();
$success = true;
} catch (\Exception $e) {
$conn->rollBack();
}
$app['acl']->get($admin)->update_rights_to_base($bas_id, ['order_master' => true]);
}
$conn->commit();
$success = true;
} catch (\Exception $e) {
$conn->rollBack();
throw $e;
}
return $app->redirectPath('admin_display_collection', [

View File

@@ -14,6 +14,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
use Alchemy\Phrasea\Notification\Receiver;
use Alchemy\Phrasea\Notification\Mail\MailTest;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Alchemy\Phrasea\Exception\RuntimeException;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -146,18 +147,24 @@ class Dashboard implements ControllerProviderInterface
*/
public function addAdmins(Application $app, Request $request)
{
if (count($admins = $request->request->get('admins', [])) > 0) {
if (!in_array($app['authentication']->getUser()->getId(), $admins)) {
$admins[] = $app['authentication']->getUser()->getId();
$admins = $request->request->get('admins', []);
if (count($admins) === 0 || !is_array($admins)) {
$app->abort(400, '"admins" parameter must contains at least one value.');
}
if (!in_array($app['authentication']->getUser()->getId(), $admins)) {
$admins[] = $app['authentication']->getUser()->getId();
}
$admins = array_map(function ($usrId) use ($app) {
if (null === $user = $app['manipulator.user']->getRepository()->find($usrId)) {
throw new RuntimeException(sprintf('Invalid usrId %s provided.', $usrId));
}
if ($admins > 0) {
$app['manipulator.user']->promote(array_filter(array_map(function ($id) use ($app) {
return $app['manipulator.user']->getRepository()->find($id);
}, $admins)));
$app['manipulator.acl']->resetAdminRights($app['manipulator.user']->getRepository()->findAdmins());
}
}
return $user;
}, $admins);
$app['manipulator.user']->promote($admins);
$app['manipulator.acl']->resetAdminRights($admins);
return $app->redirectPath('admin_dashbord');
}

View File

@@ -243,7 +243,7 @@ class Users implements ControllerProviderInterface
$datas[] = [
'email' => $user->getEmail() ? : '',
'login' => $user->getLogin() ? : '',
'name' => $user->getDisplayName($app['translator']) ? : '',
'name' => $user->getDisplayName(),
'id' => $user->getId(),
];
}
@@ -366,7 +366,7 @@ class Users implements ControllerProviderInterface
$currentUsr = null;
$table = ['users' => [], 'coll' => []];
foreach ($app['phraseanet.native-query']->getUsersRegistrationDemand($basList) as $row) {
foreach ($app['EM.native-query']->getUsersRegistrationDemand($basList) as $row) {
$user = $row[0];
if ($user->getId() !== $currentUsr) {
@@ -693,7 +693,7 @@ class Users implements ControllerProviderInterface
}
$basList = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base(['manage']));
$models = $app['phraseanet.native-query']->getModelForUser($app['authentication']->getUser(), $basList);
$models = $app['EM.native-query']->getModelForUser($app['authentication']->getUser(), $basList);
return $app['twig']->render('/admin/user/import/view.html.twig', [
'nb_user_to_add' => $nbUsrToAdd,

View File

@@ -180,7 +180,7 @@ class Baskets implements ControllerProviderInterface
}
$basketCollections = $baskets->partition(function ($key, $basket) {
return (Boolean) $basket->getPusherId();
return null !== $basket->getPusher();
});
return $app['twig']->render('client/baskets.html.twig', [

View File

@@ -221,9 +221,9 @@ class Lightbox implements ControllerProviderInterface
$app['EM']->flush();
}
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getIsAware() === false) {
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
$basket = $app['EM']->merge($basket);
$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
$app['EM']->flush();
}
@@ -268,9 +268,9 @@ class Lightbox implements ControllerProviderInterface
$app['EM']->flush();
}
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getIsAware() === false) {
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
$basket = $app['EM']->merge($basket);
$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
$app['EM']->flush();
}
@@ -350,7 +350,7 @@ class Lightbox implements ControllerProviderInterface
$basket_element = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
$validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser(), $app);
$validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser());
$validationDatas->setNote($note);
@@ -400,11 +400,11 @@ class Lightbox implements ControllerProviderInterface
, $app['authentication']->getUser()
);
/* @var $basket_element BasketElement */
$validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser(), $app);
$validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser());
if (!$basket_element->getBasket()
->getValidation()
->getParticipant($app['authentication']->getUser(), $app)->getCanAgree()) {
->getParticipant($app['authentication']->getUser())->getCanAgree()) {
throw new ControllerException('You can not agree on this');
}
@@ -412,7 +412,7 @@ class Lightbox implements ControllerProviderInterface
$participant = $basket_element->getBasket()
->getValidation()
->getParticipant($app['authentication']->getUser(), $app);
->getParticipant($app['authentication']->getUser());
$app['EM']->merge($basket_element);
@@ -446,14 +446,14 @@ class Lightbox implements ControllerProviderInterface
throw new ControllerException('There is no validation session attached to this basket');
}
if (!$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getCanAgree()) {
if (!$basket->getValidation()->getParticipant($app['authentication']->getUser())->getCanAgree()) {
throw new ControllerException('You have not right to agree');
}
$agreed = false;
/* @var $basket Basket */
foreach ($basket->getElements() as $element) {
if (null !== $element->getUserValidationDatas($app['authentication']->getUser(), $app)->getAgreement()) {
if (null !== $element->getUserValidationDatas($app['authentication']->getUser())->getAgreement()) {
$agreed = true;
}
}
@@ -463,7 +463,7 @@ class Lightbox implements ControllerProviderInterface
}
/* @var $basket Basket */
$participant = $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app);
$participant = $basket->getValidation()->getParticipant($app['authentication']->getUser());
$expires = new \DateTime('+10 days');
$url = $app->url('lightbox', ['LOG' => $app['tokens']->getUrlToken(

View File

@@ -99,8 +99,8 @@ class BasketController implements ControllerProviderInterface
}
if ($basket->getValidation()) {
if ($basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getIsAware() === false) {
$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
if ($basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
$app['EM']->flush();
}
}

View File

@@ -232,7 +232,7 @@ class Export implements ControllerProviderInterface
$url = $app->url('prepare_download', ['token' => $token, 'anonymous']);
$emitter = new Emitter($app['authentication']->getUser()->getDisplayName($app['translator']), $app['authentication']->getUser()->getEmail());
$emitter = new Emitter($app['authentication']->getUser()->getDisplayName(), $app['authentication']->getUser()->getEmail());
foreach ($destMails as $key => $mail) {
try {

View File

@@ -263,7 +263,7 @@ class Order implements ControllerProviderInterface
$basketElement->setRecord($record);
$basketElement->setBasket($basket);
$orderElement->setOrderMasterId($app['authentication']->getUser()->getId());
$orderElement->setOrderMaster($app['authentication']->getUser());
$orderElement->setDeny(false);
$orderElement->getOrder()->setBasket($basket);
@@ -329,7 +329,7 @@ class Order implements ControllerProviderInterface
$elements = $request->request->get('elements', []);
foreach ($order->getElements() as $orderElement) {
if (in_array($orderElement->getId(),$elements)) {
$orderElement->setOrderMasterId($app['authentication']->getUser()->getId());
$orderElement->setOrderMaster($app['authentication']->getUser());
$orderElement->setDeny(true);
$app['EM']->persist($orderElement);

View File

@@ -40,7 +40,7 @@ class Push implements ControllerProviderInterface
'firstname' => $user->getFirstName(),
'lastname' => $user->getLastName(),
'email' => $user->getEmail(),
'display_name' => $user->getDisplayName($app['translator']),
'display_name' => $user->getDisplayName(),
'subtitle' => implode(', ', $subtitle),
];
};
@@ -162,7 +162,7 @@ class Push implements ControllerProviderInterface
try {
$pusher = new RecordHelper\Push($app, $app['request']);
$push_name = $request->request->get('name', $app->trans('Push from %user%', ['%user%' => $app['authentication']->getUser()->getDisplayName($app['translator'])]));
$push_name = $request->request->get('name', $app->trans('Push from %user%', ['%user%' => $app['authentication']->getUser()->getDisplayName()]));
$push_description = $request->request->get('push_description');
$receivers = $request->request->get('participants');
@@ -234,7 +234,7 @@ class Push implements ControllerProviderInterface
'from_email' => $app['authentication']->getUser()->getEmail(),
'to' => $user_receiver->getId(),
'to_email' => $user_receiver->getEmail(),
'to_name' => $user_receiver->getDisplayName($app['translator']),
'to_name' => $user_receiver->getDisplayName(),
'url' => $url,
'accuse' => $receipt,
'message' => $request->request->get('message'),
@@ -278,7 +278,7 @@ class Push implements ControllerProviderInterface
try {
$pusher = new RecordHelper\Push($app, $app['request']);
$validation_name = $request->request->get('name', $app->trans('Validation from %user%', ['%user%' => $app['authentication']->getUser()->getDisplayName($app['translator'])]));
$validation_name = $request->request->get('name', $app->trans('Validation from %user%', ['%user%' => $app['authentication']->getUser()->getDisplayName()]));
$validation_description = $request->request->get('validation_description');
$participants = $request->request->get('participants');
@@ -364,7 +364,7 @@ class Push implements ControllerProviderInterface
}
try {
$Participant = $Validation->getParticipant($participant_user, $app);
$Participant = $Validation->getParticipant($participant_user);
continue;
} catch (NotFoundHttpException $e) {
@@ -429,7 +429,7 @@ class Push implements ControllerProviderInterface
'from_email' => $app['authentication']->getUser()->getEmail(),
'to' => $participant_user->getId(),
'to_email' => $participant_user->getEmail(),
'to_name' => $participant_user->getDisplayName($app['translator']),
'to_name' => $participant_user->getDisplayName(),
'url' => $url,
'accuse' => $receipt,
'message' => $request->request->get('message'),

View File

@@ -92,7 +92,7 @@ class UsrLists implements ControllerProviderInterface
foreach ($list->getOwners() as $owner) {
$owners[] = [
'usr_id' => $owner->getUser()->getId(),
'display_name' => $owner->getUser()->getDisplayName($app['translator']),
'display_name' => $owner->getUser()->getDisplayName(),
'position' => $owner->getUser()->getActivity(),
'job' => $owner->getUser()->getJob(),
'company' => $owner->getUser()->getCompany(),
@@ -104,7 +104,7 @@ class UsrLists implements ControllerProviderInterface
foreach ($list->getEntries() as $entry) {
$entries[] = [
'usr_id' => $entry->getUser()->getId(),
'display_name' => $entry->getUser()->getDisplayName($app['translator']),
'display_name' => $entry->getUser()->getDisplayName(),
'position' => $entry->getUser()->getActivity(),
'job' => $entry->getUser()->getJob(),
'company' => $entry->getUser()->getCompany(),
@@ -203,7 +203,7 @@ class UsrLists implements ControllerProviderInterface
foreach ($list->getOwners() as $owner) {
$owners[] = [
'usr_id' => $owner->getUser()->getId(),
'display_name' => $owner->getUser()->getDisplayName($app['translator']),
'display_name' => $owner->getUser()->getDisplayName(),
'position' => $owner->getUser()->getActivity(),
'job' => $owner->getUser()->getJob(),
'company' => $owner->getUser()->getCompany(),
@@ -215,7 +215,7 @@ class UsrLists implements ControllerProviderInterface
foreach ($list->getEntries() as $entry) {
$entries[] = [
'usr_id' => $entry->getUser()->getId(),
'display_name' => $entry->getUser()->getDisplayName($app['translator']),
'display_name' => $entry->getUser()->getDisplayName(),
'position' => $entry->getUser()->getActivity(),
'job' => $entry->getUser()->getJob(),
'company' => $entry->getUser()->getCompany(),
@@ -372,7 +372,7 @@ class UsrLists implements ControllerProviderInterface
foreach ($request->request->get('usr_ids') as $usr_id) {
$user_entry = $app['manipulator.user']->getRepository()->find($usr_id);
if ($list->has($user_entry, $app))
if ($list->has($user_entry))
continue;
$entry = new UsrListEntry();

View File

@@ -364,6 +364,10 @@ class Login implements ControllerProviderInterface
$user = $app['manipulator.user']->createUser($data['login'], $data['password'], $data['email'], false);
if (isset($data['geonameid'])) {
$app['manipulator.user']->setGeonameId($user, $data['geonameid']);
}
foreach ([
'gender' => 'setGender',
'firstname' => 'setFirstName',
@@ -375,13 +379,8 @@ class Login implements ControllerProviderInterface
'job' => 'setJob',
'company' => 'setCompany',
'position' => 'setActivity',
'geonameid' => 'setGeonameId',
] as $property => $method) {
if (isset($data[$property])) {
if ($property === 'geonameid') {
$app['manipulator.user']->setGeonameId($user, $data[$property]);
continue;
}
call_user_func([$user, $method], $data[$property]);
}
}
@@ -866,7 +865,7 @@ class Login implements ControllerProviderInterface
$app['events-manager']->trigger('__VALIDATION_REMINDER__', [
'to' => $participantId,
'ssel_id' => $basketId,
'from' => $validationSession->getInitiatorId(),
'from' => $validationSession->getInitiator()->getId(),
'validate_id' => $validationSession->getId(),
'url' => $app->url('lightbox_validation', ['basket' => $basketId, 'LOG' => $token]),
]);

View File

@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Model\MonologSQLLogger;
use Alchemy\Phrasea\Model\NativeQueryProvider;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\FileCacheReader;
@@ -155,6 +156,10 @@ class ORMServiceProvider implements ServiceProviderInterface
return $em;
});
$app['EM.native-query'] = $app->share(function ($app) {
return new NativeQueryProvider($app['EM']);
});
}
public function boot(Application $app)

View File

@@ -12,7 +12,6 @@
namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Authentication\ACLProvider;
use Alchemy\Phrasea\Model\NativeQueryProvider;
use Alchemy\Phrasea\Security\Firewall;
use Silex\Application as SilexApplication;
use Silex\ServiceProviderInterface;
@@ -40,10 +39,6 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
return new ACLProvider($app);
});
$app['phraseanet.native-query'] = $app->share(function ($app) {
return new NativeQueryProvider($app['EM']);
});
$app['phraseanet.appbox-register'] = $app->share(function ($app) {
return new \appbox_register($app['phraseanet.appbox']);
});

View File

@@ -28,7 +28,7 @@ class AggregateToken
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -54,7 +54,7 @@ class AggregateToken
*
* @return AggregateToken
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;
@@ -91,5 +91,4 @@ class AggregateToken
{
return $this->value;
}
}

View File

@@ -44,7 +44,7 @@ class Basket
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -56,9 +56,12 @@ class Basket
private $is_read = false;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $pusher_id;
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="pusher_id", referencedColumnName="id")
*
* @return User
**/
private $pusher;
/**
* @ORM\Column(type="boolean")
@@ -93,8 +96,6 @@ class Basket
*/
private $order;
private $pusher;
/**
* Constructor
*/
@@ -164,7 +165,7 @@ class Basket
*
* @return Basket
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;
@@ -203,39 +204,23 @@ class Basket
}
/**
* Set pusher_id
* @param User $user
*
* @param integer $pusherId
* @return Basket
* @return $this
*/
public function setPusherId($pusherId)
public function setPusher(User $user = null)
{
$this->pusher_id = $pusherId;
$this->pusher = $user;
return $this;
}
/**
* Get pusher_id
*
* @return integer
* @return mixed
*/
public function getPusherId()
public function getPusher()
{
return $this->pusher_id;
}
public function setPusher(User $user)
{
$this->setPusherId($user->getId());
$this->pusher = $user;
}
public function getPusher(Application $app)
{
if ($this->getPusherId()) {
return $app['manipulator.user']->getRepository()->find($this->getPusherId());
}
return $this->pusher;
}
/**

View File

@@ -279,10 +279,10 @@ class BasketElement
*
* @return ValidationData
*/
public function getUserValidationDatas(User $user, Application $app)
public function getUserValidationDatas(User $user)
{
foreach ($this->validation_datas as $validationData) {
if ($validationData->getParticipant($app)->getUser()->getId() == $user->getId()) {
if ($validationData->getParticipant()->getUser()->getId() == $user->getId()) {
return $validationData;
}
}

View File

@@ -29,7 +29,7 @@ class FeedPublisher
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -67,7 +67,7 @@ class FeedPublisher
*
* @return FeedPublisher
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -28,7 +28,7 @@ class FeedToken
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -60,7 +60,7 @@ class FeedToken
*
* @return FeedToken
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -29,7 +29,7 @@ class FtpCredential
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="ftpCredential")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
**/
private $user;
@@ -105,7 +105,7 @@ class FtpCredential
*
* @return FtpCredential
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -90,7 +90,7 @@ class FtpExport
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -148,7 +148,7 @@ class FtpExport
*
* @return FtpExport
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -29,7 +29,7 @@ class LazaretSession
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -76,7 +76,7 @@ class LazaretSession
*
* @return LazaretSession
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -29,7 +29,7 @@ class Order
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -89,7 +89,7 @@ class Order
*
* @return Order
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -38,9 +38,12 @@ class OrderElement
private $recordId;
/**
* @ORM\Column(type="integer", nullable=true, name="order_master_id")
*/
private $orderMasterId;
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="order_master", referencedColumnName="id")
*
* @return User
**/
private $orderMaster;
/**
* @ORM\Column(type="boolean", nullable=true)
@@ -64,44 +67,23 @@ class OrderElement
}
/**
* Set order_master_id
* @param User $user
*
* @param integer $orderMasterId
* @return OrderElement
* @return $this
*/
public function setOrderMasterId($orderMasterId)
public function setOrderMaster(User $user = null)
{
$this->orderMasterId = $orderMasterId;
$this->orderMaster = $user;
return $this;
}
/**
* Get order_master_id
*
* @return integer
* @return mixed
*/
public function getOrderMasterId()
public function getOrderMaster()
{
return $this->orderMasterId;
}
/**
*
* Returns the username matching to the order_master_id
*
* @param Application $app
* @return string
*/
public function getOrderMasterName(Application $app)
{
if (isset($this->orderMasterId) && null !== $this->orderMasterId) {
$user = $app['manipulator.user']->getRepository()->find($this->orderMasterId);
return $user->getFirstName();
}
return null;
return $this->orderMaster;
}
/**

View File

@@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table(name="Sessions")
* @ORM\Table(name="Sessions", indexes={@ORM\index(name="user_id", columns={"user_id"})})
* @ORM\Entity(repositoryClass="Alchemy\Phrasea\Model\Repositories\SessionRepository")
*/
class Session
@@ -29,7 +29,7 @@ class Session
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -121,7 +121,7 @@ class Session
*
* @return Session
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -41,7 +41,7 @@ class StoryWZ
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -124,7 +124,7 @@ class StoryWZ
*
* @return StoryWZ
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -27,6 +27,7 @@ use Symfony\Component\Translation\TranslatorInterface;
* indexes={
* @ORM\index(name="login", columns={"login"}),
* @ORM\index(name="mail", columns={"email"}),
* @ORM\index(name="model_of", columns={"model_of"}),
* @ORM\index(name="salted_password", columns={"salted_password"}),
* @ORM\index(name="admin", columns={"admin"}),
* @ORM\index(name="guest", columns={"guest"})
@@ -1030,7 +1031,7 @@ class User
/**
* @return string
*/
public function getDisplayName(TranslatorInterface $translator = null)
public function getDisplayName()
{
if ($this->isTemplate()) {
return $this->getLogin();
@@ -1044,6 +1045,10 @@ class User
return $this->email;
}
if ('' !== trim($this->getLogin())) {
return $this->getLogin();
}
return 'Unnamed user';
}
}

View File

@@ -33,7 +33,7 @@ class UserNotificationSetting
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="notificationSettings")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
**/
private $user;
@@ -80,7 +80,7 @@ class UserNotificationSetting
*
* @return UserNotificationSetting
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -29,7 +29,7 @@ class UserQuery
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="queries")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
**/
private $user;
@@ -65,7 +65,7 @@ class UserQuery
*
* @return UserQuery
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -33,7 +33,7 @@ class UserSetting
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="settings")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
**/
private $user;
@@ -80,7 +80,7 @@ class UserSetting
*
* @return UserSetting
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -32,7 +32,7 @@ class UsrAuthProvider
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -75,7 +75,7 @@ class UsrAuthProvider
*
* @return usrAuthprovider
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -242,10 +242,10 @@ class UsrList
* @param User $user
* @return boolean
*/
public function has(User $user, Application $app)
public function has(User $user)
{
return $this->entries->exists(
function ($key, $entry) use ($user, $app) {
function ($key, $entry) use ($user) {
return $entry->getUser()->getId() === $user->getId();
}
);

View File

@@ -29,7 +29,7 @@ class UsrListEntry
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -68,7 +68,7 @@ class UsrListEntry
*
* @return UsrListEntry
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -33,7 +33,7 @@ class UsrListOwner
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -77,7 +77,7 @@ class UsrListOwner
*
* @return UsrListowner
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -82,7 +82,7 @@ class ValidationParticipant
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
@@ -93,7 +93,7 @@ class ValidationParticipant
*
* @return AggregateToken
*/
public function setUser(User $user = null)
public function setUser(User $user)
{
$this->user = $user;

View File

@@ -30,9 +30,12 @@ class ValidationSession
private $id;
/**
* @ORM\Column(type="integer")
*/
private $initiator_id;
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="initiator_id", referencedColumnName="id", nullable=false)
*
* @return User
**/
private $initiator;
/**
* @Gedmo\Timestampable(on="create")
@@ -81,14 +84,13 @@ class ValidationSession
}
/**
* Set initiator_id
* @param User $user
*
* @param integer $initiatorId
* @return ValidationSession
* @return $this
*/
public function setInitiatorId($initiatorId)
public function setInitiator(User $user)
{
$this->initiator_id = $initiatorId;
$this->initiator = $user;
return $this;
}
@@ -98,28 +100,19 @@ class ValidationSession
*
* @return integer
*/
public function getInitiatorId()
public function getInitiator()
{
return $this->initiator_id;
}
/**
* @param User $user
*
* @return boolean
*/
public function isInitiator(User $user)
{
return $this->getInitiatorId() == $user->getId();
}
public function setInitiator(User $user)
{
$this->initiator_id = $user->getId();
return;
}
public function getInitiator(Application $app)
{
if ($this->initiator_id) {
return $app['manipulator.user']->getRepository()->find($this->initiator_id);
}
return $this->getInitiator()->getId() == $user->getId();
}
/**
@@ -267,10 +260,10 @@ class ValidationSession
return $app->trans('Vous avez envoye cette demande a %n% utilisateurs', ['%n%' => count($this->getParticipants()) - 1]);
}
} else {
if ($this->getParticipant($user, $app)->getCanSeeOthers()) {
return $app->trans('Processus de validation recu de %user% et concernant %n% utilisateurs', ['%user%' => $this->getInitiator($app)->getDisplayName($app['translator']), '%n%' => count($this->getParticipants()) - 1]);
if ($this->getParticipant($user)->getCanSeeOthers()) {
return $app->trans('Processus de validation recu de %user% et concernant %n% utilisateurs', ['%user%' => $this->getInitiator($app)->getDisplayName(), '%n%' => count($this->getParticipants()) - 1]);
} else {
return $app->trans('Processus de validation recu de %user%', ['%user%' => $this->getInitiator($app)->getDisplayName($app['translator'])]);
return $app->trans('Processus de validation recu de %user%', ['%user%' => $this->getInitiator($app)->getDisplayName()]);
}
}
}
@@ -280,7 +273,7 @@ class ValidationSession
*
* @return ValidationParticipant
*/
public function getParticipant(User $user, Application $app)
public function getParticipant(User $user)
{
foreach ($this->getParticipants() as $participant) {
if ($participant->getUser()->getId() == $user->getId()) {

View File

@@ -2,7 +2,7 @@
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -124,7 +124,7 @@ class BasketRepository extends EntityRepository
* @param User $user
* @return Basket
*/
public function findUserBasket(Application $app, $basket_id, User $user, $requireOwner)
public function findUserBasket($basket_id, User $user, $requireOwner)
{
$dql = 'SELECT b
FROM Alchemy\Phrasea\Model\Entities\Basket b
@@ -146,7 +146,7 @@ class BasketRepository extends EntityRepository
if ($basket->getValidation() && !$requireOwner) {
try {
$basket->getValidation()->getParticipant($user, $app);
$basket->getValidation()->getParticipant($user);
$participant = true;
} catch (\Exception $e) {

View File

@@ -46,7 +46,7 @@ class MailInfoNewOrder extends AbstractMail
throw new LogicException('You must set a user before calling getMessage()');
}
return $this->app->trans('%user% has ordered documents', ['%user%' => $this->user->getDisplayName($this->app['translator'])]);
return $this->app->trans('%user% has ordered documents', ['%user%' => $this->user->getDisplayName()]);
}
/**

View File

@@ -62,7 +62,7 @@ class MailInfoOrderCancelled extends AbstractMail
}
return $this->app->trans('%user% a refuse %quantity% elements de votre commande', [
'%user%' => $this->deliverer->getDisplayName($this->app['translator']),
'%user%' => $this->deliverer->getDisplayName(),
'%quantity%' => $this->quantity,
]);
}

View File

@@ -63,7 +63,7 @@ class MailInfoOrderDelivered extends AbstractMail
throw new LogicException('You must set a deliverer before calling getMessage');
}
return $this->app->trans('%user% vous a delivre votre commande, consultez la en ligne a l\'adresse suivante', ['%user%' => $this->deliverer->getDisplayName($this->app['translator'])]);
return $this->app->trans('%user% vous a delivre votre commande, consultez la en ligne a l\'adresse suivante', ['%user%' => $this->deliverer->getDisplayName()]);
}
/**

View File

@@ -62,7 +62,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
}
return
$this->app->trans('You just received a push containing %quantity% documents from %user%', ['%quantity%' => count($this->basket->getElements()), '%user%' => $this->pusher->getDisplayName($this->app['translator'])])
$this->app->trans('You just received a push containing %quantity% documents from %user%', ['%quantity%' => count($this->basket->getElements()), '%user%' => $this->pusher->getDisplayName()])
. "\n" . $this->message;
}

View File

@@ -54,7 +54,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
}
return $this->app->trans('push::mail:: Rapport de validation de %user% pour %title%', [
'%user%' => $this->user->getDisplayName($this->app['translator']),
'%user%' => $this->user->getDisplayName(),
'%title%' => $this->title,
]);
}
@@ -69,7 +69,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
}
return $this->app->trans('%user% has just sent its validation report, you can now see it', [
'%user%' => $this->user->getDisplayName($this->app['translator']),
'%user%' => $this->user->getDisplayName(),
]);
}

View File

@@ -60,7 +60,7 @@ class MailInfoValidationRequest extends AbstractMailWithLink
throw new LogicException('You must set a title before calling getSubject');
}
return $this->app->trans("Validation request from %user% for '%title%'", ['%user%' => $this->user->getDisplayName($this->app['translator']), '%title%' => $this->title]);
return $this->app->trans("Validation request from %user% for '%title%'", ['%user%' => $this->user->getDisplayName(), '%title%' => $this->title]);
}
/**

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -68,7 +68,7 @@ class UserProvider implements ControlProviderInterface
foreach ($users as $user) {
$results->add(
new Term($user->getDisplayName($this->app['translator']), '', $this, $user->getId())
new Term($user->getDisplayName(), '', $this, $user->getId())
);
}
@@ -98,7 +98,7 @@ class UserProvider implements ControlProviderInterface
throw new \Exception('User unknown');
}
return $user->getDisplayName($this->app['translator']);
return $user->getDisplayName();
}
/**

View File

@@ -1363,7 +1363,7 @@ class API_V1_adapter extends API_V1_Abstract
$choices[] = [
'validation_user' => [
'usr_id' => $user->getId(),
'usr_name' => $user->getDisplayName($this->app['translator']),
'usr_name' => $user->getDisplayName(),
'confirmed' => $participant->getIsConfirmed(),
'can_agree' => $participant->getCanAgree(),
'can_see_others' => $participant->getCanSeeOthers(),
@@ -1778,7 +1778,7 @@ class API_V1_adapter extends API_V1_Abstract
'created_on' => $basket->getCreated()->format(DATE_ATOM),
'description' => (string) $basket->getDescription(),
'name' => $basket->getName(),
'pusher_usr_id' => $basket->getPusherId(),
'pusher_usr_id' => $basket->getPusher()->getId(),
'updated_on' => $basket->getUpdated()->format(DATE_ATOM),
'unread' => !$basket->getIsRead(),
'validation_basket' => !!$basket->getValidation()
@@ -1793,7 +1793,7 @@ class API_V1_adapter extends API_V1_Abstract
$users[] = [
'usr_id' => $user->getId(),
'usr_name' => $user->getDisplayName($this->app['translator']),
'usr_name' => $user->getDisplayName(),
'confirmed' => $participant->getIsConfirmed(),
'can_agree' => $participant->getCanAgree(),
'can_see_others' => $participant->getCanSeeOthers(),
@@ -1812,7 +1812,7 @@ class API_V1_adapter extends API_V1_Abstract
'validation_users' => $users,
'expires_on' => $expires_on_atom,
'validation_infos' => $basket->getValidation()->getValidationString($this->app, $this->app['authentication']->getUser()),
'validation_confirmed' => $basket->getValidation()->getParticipant($this->app['authentication']->getUser(), $this->app)->getIsConfirmed(),
'validation_confirmed' => $basket->getValidation()->getParticipant($this->app['authentication']->getUser())->getIsConfirmed(),
'validation_initiator' => $basket->getValidation()->isInitiator($this->app['authentication']->getUser()),
], $ret
);

View File

@@ -50,7 +50,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
$mailColl = [];
try {
$rs = $this->app['phraseanet.native-query']->getAdminsOfBases(array_keys($base_ids));
$rs = $this->app['EM.native-query']->getAdminsOfBases(array_keys($base_ids));
foreach ($rs as $row) {
$user = $row[0];
@@ -129,7 +129,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
}
$ret = [
'text' => $this->app->trans('%user% s\'est enregistre sur une ou plusieurs %before_link% scollections %after_link%', ['%user%' => $user->getDisplayName($this->app['translator']), '%before_link%' => '<a href="/admin/?section=users" target="_blank">', '%after_link%' => '</a>'])
'text' => $this->app->trans('%user% s\'est enregistre sur une ou plusieurs %before_link% scollections %after_link%', ['%user%' => $user->getDisplayName(), '%before_link%' => '<a href="/admin/?section=users" target="_blank">', '%after_link%' => '</a>'])
, 'class' => ''
];

View File

@@ -140,7 +140,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
$ret = [
'text' => $this->app->trans('%user% a passe une %opening_link% commande %end_link%', [

View File

@@ -148,12 +148,12 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
try {
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
$basket = $repository->findUserBasket($ssel_id, $this->app['authentication']->getUser(), false);
} catch (Exception $e) {
return [];
}

View File

@@ -111,7 +111,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
$ret = [
'text' => $this->app->trans('%user% a refuse la livraison de %quantity% document(s) pour votre commande', ['%user%' => $sender, '%quantity%' => $n])

View File

@@ -123,7 +123,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
$ret = [
'text' => $this->app->trans('%user% vous a envoye un %before_link% panier %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="#" onclick="openPreview(\'BASK\',1,\''

View File

@@ -53,7 +53,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
$mailColl = [];
try {
$rs = $this->app['phraseanet.native-query']->getAdminsOfBases(array_keys($base_ids));
$rs = $this->app['EM.native-query']->getAdminsOfBases(array_keys($base_ids));
foreach ($rs as $row) {
$user = $row[0];
@@ -141,7 +141,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
$ret = [
'text' => $this->app->trans('%user% demande votre approbation sur une ou plusieurs %before_link% collections %after_link%', ['%user%' => $sender, '%before_link%' => '<a href="' . $this->app->url('admin', ['section' => 'registrations']) . '" target="_blank">', '%after_link%' => '</a>'])

View File

@@ -74,7 +74,7 @@ class eventsmanager_notify_uploadquarantine extends eventsmanager_notifyAbstract
//Sender
if (null !== $user = $lazaretFile->getSession()->getUser()) {
$sender = $domXML->createElement('sender');
$sender->appendChild($domXML->createTextNode($user->getDisplayName($this->app['translator'])));
$sender->appendChild($domXML->createTextNode($user->getDisplayName()));
$root->appendChild($sender);
$this->notifyUser($user, $datas);

View File

@@ -141,7 +141,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
try {
$basket = $this->app['converter.basket']->convert($ssel_id);

View File

@@ -135,12 +135,12 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
return [];
}
$sender = $registered_user->getDisplayName($this->app['translator']);
$sender = $registered_user->getDisplayName();
try {
$repository = $this->app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
$basket = $repository->findUserBasket($ssel_id, $this->app['authentication']->getUser(), false);
} catch (Exception $e) {
return [];
}

View File

@@ -140,7 +140,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
return [];
}
$sender = $user->getDisplayName($this->app['translator']);
$sender = $user->getDisplayName();
try {
$basket = $this->app['converter.basket']->convert($ssel_id);

View File

@@ -50,7 +50,7 @@ class module_console_checkExtension extends Command
$output->writeln(
sprintf(
"\nWill do the check with user <info>%s</info> (%s)\n"
, $TestUser->getDisplayName($this->container['translator'])
, $TestUser->getDisplayName()
, $TestUser->getEmail()
)
);

View File

@@ -295,7 +295,7 @@ class module_report_activity extends module_report
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$login = $this->app['manipulator.user']->getRepository()->find($usr)->getDisplayName($this->app['translator']);
$login = $this->app['manipulator.user']->getRepository()->find($usr)->getDisplayName();
$this->setChamp($rs);

View File

@@ -78,7 +78,7 @@ class module_report_add extends module_report
$caption = $value;
if ($field == "getter") {
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
$caption = $user->getDisplayName($this->app['translator']);
$caption = $user->getDisplayName();
}
} elseif ($field == 'date')
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));

View File

@@ -78,7 +78,7 @@ class module_report_edit extends module_report
$caption = $value;
if ($field == "getter") {
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
$caption = $user->getDisplayName($this->app['translator']);
$caption = $user->getDisplayName();
}
} elseif ($field == 'date') {
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));

View File

@@ -79,7 +79,7 @@ class module_report_push extends module_report
$caption = $value;
if ($field == "getter") {
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
$caption = $user->getDisplayName($this->app['translator']);
$caption = $user->getDisplayName();
}
} elseif ($field == 'date') {
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));

View File

@@ -79,7 +79,7 @@ class module_report_sent extends module_report
$caption = $value;
if ($field == "getter") {
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
$caption = $user->getDisplayName($this->app['translator']);
$caption = $user->getDisplayName();
}
} elseif ($field == 'date') {
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));

View File

@@ -79,7 +79,7 @@ class module_report_validate extends module_report
$caption = $value;
if ($field == "getter") {
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
$caption = $user->getDisplayName($this->app['translator']);
$caption = $user->getDisplayName();
}
} elseif ($field == 'date') {
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));

View File

@@ -99,7 +99,7 @@ class patch_320alpha4b implements patchInterface
$entry = new FeedEntry();
$entry->setAuthorEmail($user->getEmail());
$entry->setAuthorName($user->getDisplayName($app['translator']));
$entry->setAuthorName($user->getDisplayName());
$entry->setFeed($feed);
$entry->setPublisher($publishers->first());
$entry->setTitle($row['name']);
@@ -187,11 +187,11 @@ class patch_320alpha4b implements patchInterface
if ( ! array_key_exists($user_key, self::$feeds) || ! isset(self::$feeds[$user_key][$feed_key])) {
if ($homelink == '1')
$title = $user->getDisplayName($app['translator']) . ' - ' . 'homelink Feed';
$title = $user->getDisplayName() . ' - ' . 'homelink Feed';
elseif ($pub_restrict == '1')
$title = $user->getDisplayName($app['translator']) . ' - ' . 'private Feed';
$title = $user->getDisplayName() . ' - ' . 'private Feed';
else
$title = $user->getDisplayName($app['translator']) . ' - ' . 'public Feed';
$title = $user->getDisplayName() . ' - ' . 'public Feed';
$feed = new Feed();
$publisher = new FeedPublisher();

View File

@@ -54,7 +54,7 @@ class record_orderElement extends record_adapter
if ($this->order_master_id) {
$user = $this->app['manipulator.user']->getRepository()->find($this->order_master_id);
return $user->getDisplayName($this->app['translator']);
return $user->getDisplayName();
}
return '';

View File

@@ -57,7 +57,7 @@ class set_export extends set_abstract
$repository = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket');
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketRepository */
$Basket = $repository->findUserBasket($this->app, $sstid, $app['authentication']->getUser(), false);
$Basket = $repository->findUserBasket($sstid, $app['authentication']->getUser(), false);
$this->exportName = str_replace([' ', '\\', '/'], '_', $Basket->getName()) . "_" . date("Y-n-d");
foreach ($Basket->getElements() as $basket_element) {

View File

@@ -39,7 +39,7 @@ class set_exportftp extends set_export
$text_mail_receiver = "Bonjour,\n"
. "L'utilisateur "
. $this->app['authentication']->getUser()->getDisplayName($this->app['translator']) . " (login : " . $this->app['authentication']->getUser()->getLogin() . ") "
. $this->app['authentication']->getUser()->getDisplayName() . " (login : " . $this->app['authentication']->getUser()->getLogin() . ") "
. "a fait un transfert FTP sur le serveur ayant comme adresse \""
. $host . "\" avec le login \"" . $login . "\" "
. "et pour repertoire de destination \""

View File

@@ -55,7 +55,7 @@
</div>
{% else %}
{% if app['authentication'].getUser() is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName(app['translator']) ~ '</b>' %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3">
<p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -38,7 +38,7 @@
</div>
{% if app['authentication'].getUser() is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName(app['translator']) ~ '</b>' %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3">
<p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
<img style="vertical-align:middle;"
src="/skins/lightbox/{% if validationDatas.getAgreement() == true %}agree.png{% else %}disagree.png{% endif %}" />
{% endif %}
{{ validationDatas.getParticipant().getUser().getDisplayName(app['translator']) }}
{{ validationDatas.getParticipant().getUser().getDisplayName() }}
</h3>
{% if validationDatas.getNote() != '' %}
<p style="text-align:left;">{{ 'validation:: note' | trans }} : {{ validationDatas.getNote()|nl2br }}</p>

View File

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

View File

@@ -25,7 +25,7 @@
</a>
{% if application.get_creator() is not none %}
<small>
{% set user_name = application.get_creator().getDisplayName(app['translator']) %}
{% set user_name = application.get_creator().getDisplayName() %}
{% trans with {'%user_name%' : user_name} %}par %user_name%{% endtrans %}
</small>
{% endif%}

View File

@@ -44,7 +44,7 @@
<li>
<label for="adm_{{ user.getId() }}" class="checkbox">
<input name="admins[]" type="checkbox" value="{{ user.getId() }}" id="adm_{{ user.getId() }}" checked />
{{ user.getDisplayName(app['translator']) }}
{{ user.getDisplayName() }}
</label>
</li>
{% endfor %}

View File

@@ -10,7 +10,7 @@
<td colspan="2" style="height: 10px;"></td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur nom' | trans }} : </strong>{{ user.getDisplayName(app['translator']) }}</td>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur nom' | trans }} : </strong>{{ user.getDisplayName() }}</td>
</tr>
<tr>
<td colspan="2"><strong>{{ 'admin::compte-utilisateur societe' | trans }} : </strong>{{ user.getCompany() }}</td>
@@ -102,9 +102,9 @@
<tr title="{{ _self.tooltip_connected_users(row) | e }}" class="{% if loop.index is odd %}odd{% else %}even{% endif %} usrTips" id="TREXP_{{ row.getId()}}">
{% if row.getId() == app['session'].get('session_id') %}
<td style="color:#ff0000"><i>{{ row.getUser().getDisplayName(app['translator']) }}</i></td>
<td style="color:#ff0000"><i>{{ row.getUser().getDisplayName() }}</i></td>
{% else %}
<td>{{ row.getUser().getDisplayName(app['translator']) }}</td>
<td>{{ row.getUser().getDisplayName() }}</td>
{% endif %}
<td>

View File

@@ -118,7 +118,7 @@
{{ 'Reglages:: reglages d inscitpition automatisee' | trans }}
{% endif %}
{% else %}
{% set display_name = main_user.getDisplayName(app['translator']) %}
{% set display_name = main_user.getDisplayName() %}
{% trans with {'%display_name%' : display_name} %}Edition des droits de %display_name%{% endtrans %}
{% endif %}
{% else %}

View File

@@ -143,7 +143,7 @@
{{ publisher.getUser().getId() }}
</td>
<td valign="center" align="left">
{{ publisher.getUser().getDisplayName(app['translator']) }}
{{ publisher.getUser().getDisplayName() }}
</td>
<td valign="center" align="left">
{{ publisher.getUser().getEmail() }}

View File

@@ -55,7 +55,7 @@
</div>
{% else %}
{% if user is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName(app['translator']) ~ '</b>' %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3">
<p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -38,7 +38,7 @@
</div>
{% if user is not none %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName(app['translator']) ~ '</b>' %}
{% set username = '<b>' ~ app['authentication'].getUser().getDisplayName() ~ '</b>' %}
<div id="hello-box" class="span6 offset3">
<p class="login_hello">
{% trans with {'%username%' : username} %}Hello %username%{% endtrans %}

View File

@@ -59,8 +59,8 @@
</table>
</div>
<div class="divexterne" style="height:270px;overflow-x:hidden;overflow-y:auto;position:relative">
{% if selected_basket is not none and selected_basket.getPusher(app) is not none %}
{% set pusher_name = selected_basket.getPusher(app).getDisplayName(app['translator']) %}
{% if selected_basket is not none and selected_basket.getPusher() is not none %}
{% set pusher_name = selected_basket.getPusher().getDisplayName() %}
<div class="txtPushClient">
{% trans with {'%pusher_name%' : pusher_name} %}paniers:: panier emis par %pusher_name%{% endtrans %}
</div>

View File

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

View File

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

View File

@@ -54,7 +54,7 @@
</h2>
{% if basket.getValidation().isFinished() %}
{{ '(validation) session terminee' | trans }}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser(), app).getIsConfirmed() %}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser()).getIsConfirmed() %}
{{ '(validation) envoyee' | trans }}
{% else %}
{{ '(validation) a envoyer' | trans }}

View File

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

View File

@@ -16,7 +16,7 @@
<div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div>
<ul>
{% for choice in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanSeeOthers() or choice.getParticipant().getUser() == app['authentication'].getUser() %}
{% if basket.getValidation().getParticipant(app['authentication'].getUser()).getCanSeeOthers() or choice.getParticipant().getUser() == app['authentication'].getUser() %}
{% if choice.getAgreement() == true %}
{% set classuser = 'agree' %}
{% elseif choice.getAgreement() is null %}
@@ -25,17 +25,17 @@
{% set classuser = 'disagree' %}
{% endif %}
{% set participant = choice.getParticipant().getUser() %}
<li class="{% if participant.getId() == app['authentication'].getUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName(app['translator'])}}</li>
<li class="{% if participant.getId() == app['authentication'].getUser().getId() %}me{% endif %} {{classuser}} userchoice">{{participant.getDisplayName()}}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
<div class="PNB user_infos">
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser()).getCanAgree() %}
<div class="PNB choices">
<div style="height:60px;">
{% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() %}
{% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser()).getAgreement() %}
<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>
</div>

View File

@@ -33,7 +33,7 @@
{% set imguser = '<img src="/skins/lightbox/disagree.png" />' %}
{% set styleuser = '' %}
{% endif %}
<b style="{{styleuser}}">{{imguser|raw}} {{validationDatas.getParticipant().getUser().getDisplayName(app['translator'])}}</b>
<b style="{{styleuser}}">{{imguser|raw}} {{validationDatas.getParticipant().getUser().getDisplayName()}}</b>
{% if validationDatas.getNote() != '' %}
: {{validationDatas.getNote()|nl2br}}
{% endif %}

View File

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

View File

@@ -55,7 +55,7 @@
</h2>
{% if basket.getValidation().isFinished() %}
{{ '(validation) session terminee' | trans }}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser(), app).getIsConfirmed() %}
{% elseif basket.getValidation().getParticipant(app['authentication'].getUser()).getIsConfirmed() %}
{{ '(validation) envoyee' | trans }}
{% else %}
{{ '(validation) a envoyer' | trans }}

View File

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

View File

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

View File

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

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