mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6
This commit is contained in:
@@ -255,13 +255,18 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
|
|
||||||
$em->remove($list);
|
$em->remove($list);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => true
|
||||||
|
, 'message' => sprintf(_('List has been deleted'))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
catch (\Exception $e)
|
catch (\Exception $e)
|
||||||
{
|
{
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
'success' => false
|
'success' => false
|
||||||
, 'message' => sprintf(_('Unable to create list %s'), $list_name)
|
, 'message' => sprintf(_('Unable to delete list'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,11 +280,41 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Remove a usr_id from a list
|
* Remove a usr_id from a list
|
||||||
*/
|
*/
|
||||||
$controllers->post('/list/{list_id}/remove/{usr_id}/', function() use ($app)
|
$controllers->post('/list/{list_id}/remove/{entry_id}/', function() use ($app)
|
||||||
{
|
{
|
||||||
$em = $app['Core']->getEntityManager();
|
$em = $app['Core']->getEntityManager();
|
||||||
|
|
||||||
$repository = $em->getRepository('\Entities\Usr');
|
try
|
||||||
|
{
|
||||||
|
$repository = $em->getRepository('\Entities\UsrList');
|
||||||
|
|
||||||
|
$list = $repository->findUserListByUserAndId($user, $list_id);
|
||||||
|
/* @var $list \Entities\UsrList */
|
||||||
|
|
||||||
|
$entry_repository = $em->getRepository('\Entities\UsrListEntry');
|
||||||
|
|
||||||
|
$user_entry = $entry_repository->findEntryByListAndEntryId($list, $entry_id);
|
||||||
|
|
||||||
|
$em->remove($user_entry);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Entry removed from list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Unable to remove entry from list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Json = $app['Core']['Serializer']->serialize($datas, 'json');
|
||||||
|
|
||||||
|
return new Response($Json, 200, array('Content-Type' => 'application/json'));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -290,7 +325,42 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$em = $app['Core']->getEntityManager();
|
$em = $app['Core']->getEntityManager();
|
||||||
|
|
||||||
$repository = $em->getRepository('\Entities\Usr');
|
try
|
||||||
|
{
|
||||||
|
$repository = $em->getRepository('\Entities\UsrList');
|
||||||
|
|
||||||
|
$list = $repository->findUserListByUserAndId($user, $list_id);
|
||||||
|
/* @var $list \Entities\UsrList */
|
||||||
|
$user_entry = \User_Adapter::getInstance($usr_id, appbox::get_instance());
|
||||||
|
|
||||||
|
$entry = new \Entities\UsrListEntry();
|
||||||
|
$entry->setUser($user_entry);
|
||||||
|
$entry->setList($list);
|
||||||
|
|
||||||
|
$list->addUsrListEntry($entry);
|
||||||
|
|
||||||
|
$em->persist($entry);
|
||||||
|
$em->merge($list);
|
||||||
|
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Usr added to list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Unable to add usr to list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Json = $app['Core']['Serializer']->serialize($datas, 'json');
|
||||||
|
|
||||||
|
return new Response($Json, 200, array('Content-Type' => 'application/json'));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -300,18 +370,108 @@ class UsrLists implements ControllerProviderInterface
|
|||||||
$controllers->post('/list/{list_id}/share/{usr_id}/', function() use ($app)
|
$controllers->post('/list/{list_id}/share/{usr_id}/', function() use ($app)
|
||||||
{
|
{
|
||||||
$em = $app['Core']->getEntityManager();
|
$em = $app['Core']->getEntityManager();
|
||||||
|
$user = $app['Core']->getAuthenticatedUser();
|
||||||
|
|
||||||
$repository = $em->getRepository('\Entities\Usr');
|
try
|
||||||
|
{
|
||||||
|
$repository = $em->getRepository('\Entities\UsrList');
|
||||||
|
|
||||||
|
$list = $repository->findUserListByUserAndId($user, $list_id);
|
||||||
|
/* @var $list \Entities\UsrList */
|
||||||
|
|
||||||
|
if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_EDITOR)
|
||||||
|
{
|
||||||
|
throw new \Exception('You are not authorized to do this');
|
||||||
|
}
|
||||||
|
|
||||||
|
$new_owner = \User_Adapter::getInstance($usr_id, appbox::get_instance());
|
||||||
|
|
||||||
|
if($list->hasAccess($new_owner))
|
||||||
|
{
|
||||||
|
$owner = $list->getOwner($new_owner);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$owner = new \Entities\UsrListOwner();
|
||||||
|
$owner->setList($list);
|
||||||
|
$owner->setUser($new_owner);
|
||||||
|
|
||||||
|
$list->addUsrListOwner($owner);
|
||||||
|
|
||||||
|
$em->persist($owner);
|
||||||
|
$em->merge($list);
|
||||||
|
}
|
||||||
|
|
||||||
|
$role = $app['request']->get('role', \Entities\UsrListOwner::ROLE_USER);
|
||||||
|
|
||||||
|
$owner->setRole($role);
|
||||||
|
|
||||||
|
$em->merge($owner);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Usr added to list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Unable to add usr to list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Json = $app['Core']['Serializer']->serialize($datas, 'json');
|
||||||
|
|
||||||
|
return new Response($Json, 200, array('Content-Type' => 'application/json'));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* UnShare a list to a user
|
* UnShare a list to a user
|
||||||
*/
|
*/
|
||||||
$controllers->post('/list/{list_id}/unshare/{usr_id}/', function() use ($app)
|
$controllers->post('/list/{list_id}/unshare/{owner_id}/', function() use ($app)
|
||||||
{
|
{
|
||||||
$em = $app['Core']->getEntityManager();
|
$em = $app['Core']->getEntityManager();
|
||||||
|
$user = $app['Core']->getAuthenticatedUser();
|
||||||
|
|
||||||
$repository = $em->getRepository('\Entities\Usr');
|
try
|
||||||
|
{
|
||||||
|
$repository = $em->getRepository('\Entities\UsrList');
|
||||||
|
|
||||||
|
$list = $repository->findUserListByUserAndId($user, $list_id);
|
||||||
|
/* @var $list \Entities\UsrList */
|
||||||
|
|
||||||
|
if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_ADMIN)
|
||||||
|
{
|
||||||
|
throw new \Exception('You are not authorized to do this');
|
||||||
|
}
|
||||||
|
|
||||||
|
$owners_repository = $em->getRepository('\Entities\UsrListOwner');
|
||||||
|
|
||||||
|
$owner = $owners_repository->findByListAndOwner($list, $owner_id);
|
||||||
|
|
||||||
|
$em->remove($owner);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Owner removed from list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
$datas = array(
|
||||||
|
'success' => false
|
||||||
|
, 'message' => _('Unable to add usr to list')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Json = $app['Core']['Serializer']->serialize($datas, 'json');
|
||||||
|
|
||||||
|
return new Response($Json, 200, array('Content-Type' => 'application/json'));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -18,6 +18,8 @@ use Alchemy\Phrasea\Core\Configuration;
|
|||||||
require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php';
|
require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
* Phraseanet Core Container
|
||||||
*
|
*
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
@@ -25,7 +27,6 @@ require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php';
|
|||||||
class Core extends \Pimple
|
class Core extends \Pimple
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
protected static $availableLanguages = array(
|
protected static $availableLanguages = array(
|
||||||
'ar_SA' => 'العربية'
|
'ar_SA' => 'العربية'
|
||||||
, 'de_DE' => 'Deutsch'
|
, 'de_DE' => 'Deutsch'
|
||||||
@@ -358,7 +359,6 @@ class Core extends \Pimple
|
|||||||
public static function initAutoloads()
|
public static function initAutoloads()
|
||||||
{
|
{
|
||||||
require_once __DIR__ . '/../../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
|
require_once __DIR__ . '/../../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
|
||||||
|
|
||||||
require_once __DIR__ . '/../../vendor/Twig/lib/Twig/Autoloader.php';
|
require_once __DIR__ . '/../../vendor/Twig/lib/Twig/Autoloader.php';
|
||||||
require_once __DIR__ . '/../../vendor/Twig-extensions/lib/Twig/Extensions/Autoloader.php';
|
require_once __DIR__ . '/../../vendor/Twig-extensions/lib/Twig/Extensions/Autoloader.php';
|
||||||
|
|
||||||
|
@@ -156,6 +156,22 @@ class UsrList
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param \User_Adapter $user
|
||||||
|
* @return \Entities\UsrListOwner
|
||||||
|
*/
|
||||||
|
public function getOwner(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
foreach ($this->getOwners() as $owner)
|
||||||
|
{
|
||||||
|
if ($owner->getUser()->get_id() == $user->get_id())
|
||||||
|
return $owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \Exception('This user is not an owner of the list');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add users
|
* Add users
|
||||||
*
|
*
|
||||||
|
@@ -138,5 +138,9 @@ class UsrListEntry
|
|||||||
{
|
{
|
||||||
return \User_Adapter::getInstance($this->getUsrId(), \appbox::get_instance());
|
return \User_Adapter::getInstance($this->getUsrId(), \appbox::get_instance());
|
||||||
}
|
}
|
||||||
|
public function setUser(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
return $this->setUsrId($user->get_id());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -18,9 +18,9 @@ namespace Entities;
|
|||||||
*/
|
*/
|
||||||
class UsrListOwner
|
class UsrListOwner
|
||||||
{
|
{
|
||||||
const ROLE_USER = 'user';
|
const ROLE_USER = 1;
|
||||||
const ROLE_EDITOR = 'editor';
|
const ROLE_EDITOR = 2;
|
||||||
const ROLE_ADMIN = 'admin';
|
const ROLE_ADMIN = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $id
|
* @var integer $id
|
||||||
|
@@ -96,6 +96,12 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr
|
|||||||
return parent::getUser();
|
return parent::getUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
$this->__load();
|
||||||
|
return parent::setUser($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function __sleep()
|
public function __sleep()
|
||||||
{
|
{
|
||||||
|
@@ -102,6 +102,12 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
|
|||||||
return parent::getList();
|
return parent::getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
$this->__load();
|
||||||
|
return parent::setUser($user);
|
||||||
|
}
|
||||||
|
|
||||||
public function getUser()
|
public function getUser()
|
||||||
{
|
{
|
||||||
$this->__load();
|
$this->__load();
|
||||||
|
@@ -90,6 +90,18 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr
|
|||||||
return parent::getOwners();
|
return parent::getOwners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasAccess(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
$this->__load();
|
||||||
|
return parent::hasAccess($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOwner(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
$this->__load();
|
||||||
|
return parent::getOwner($user);
|
||||||
|
}
|
||||||
|
|
||||||
public function addUsrListEntry(\Entities\UsrListEntry $users)
|
public function addUsrListEntry(\Entities\UsrListEntry $users)
|
||||||
{
|
{
|
||||||
$this->__load();
|
$this->__load();
|
||||||
|
@@ -34,4 +34,22 @@ class UsrListEntryRepository extends EntityRepository
|
|||||||
|
|
||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findEntryByListAndEntryId(\Entities\UsrList $list, $entry_id)
|
||||||
|
{
|
||||||
|
$entry = $this->find($entry_id);
|
||||||
|
|
||||||
|
if(!$entry)
|
||||||
|
{
|
||||||
|
throw new \Exception_NotFound('Entry not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @var $entry \Entities\UsrListEntry */
|
||||||
|
if($entry->getList()->getId() != $list->getId())
|
||||||
|
{
|
||||||
|
throw new \Exception_Forbidden('Entry mismatch list');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $entry;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -12,4 +12,29 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
*/
|
*/
|
||||||
class UsrListOwnerRepository extends EntityRepository
|
class UsrListOwnerRepository extends EntityRepository
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param \Entities\UsrList $list
|
||||||
|
* @param type $owner_id
|
||||||
|
* @return \Entities\UsrList
|
||||||
|
*/
|
||||||
|
public function findByListAndOwner(\Entities\UsrList $list, $owner_id)
|
||||||
|
{
|
||||||
|
$owner = $this->find($owner_id);
|
||||||
|
|
||||||
|
/* @var $owner \Entities\UsrListOwner */
|
||||||
|
if (null === $owner)
|
||||||
|
{
|
||||||
|
throw new \Exception_NotFound(_('Owner is not found'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$owner->getList()->getid() != $list->getId())
|
||||||
|
{
|
||||||
|
throw new \Exception_Forbidden(_('Owner and list mismatch'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $owner;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -321,7 +321,7 @@ class ACL implements cache_cacheableInterface
|
|||||||
|
|
||||||
$this->give_access_to_base($bas_to_acces);
|
$this->give_access_to_base($bas_to_acces);
|
||||||
|
|
||||||
foreach ($rights_to_give as $sbas_id => $rights)
|
foreach ($rights_to_give as $base_id => $rights)
|
||||||
{
|
{
|
||||||
$this->update_rights_to_base($base_id, $rights);
|
$this->update_rights_to_base($base_id, $rights);
|
||||||
}
|
}
|
||||||
|
@@ -110,7 +110,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
'name' => $user_from->get_display_name()
|
'name' => $user_from->get_display_name()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (self::mail($to, $from, $params['ssel_id']))
|
if (self::mail($to, $from, $params['ssel_id'], $params['url']))
|
||||||
$mailed = true;
|
$mailed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
* @param int $ssel_id
|
* @param int $ssel_id
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function mail($to, $from, $ssel_id)
|
function mail($to, $from, $ssel_id, $url)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
$from['name']
|
$from['name']
|
||||||
) . "</div>\n";
|
) . "</div>\n";
|
||||||
|
|
||||||
$body .= "<br/>\n" . $this->registry->get('GV_ServerName') . 'lightbox/validate/' . $ssel_id;
|
$body .= "<br/>\n" . $url;
|
||||||
|
|
||||||
return mail::send_mail($subject, $body, $to, $from, array());
|
return mail::send_mail($subject, $body, $to, $from, array());
|
||||||
}
|
}
|
||||||
|
@@ -76,7 +76,6 @@ class gatekeeper
|
|||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
if (http_request::is_command_line())
|
if (http_request::is_command_line())
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
|
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
|
||||||
@@ -122,7 +121,6 @@ class gatekeeper
|
|||||||
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|
||||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|
||||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
|
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
|
||||||
|
|
||||||
return;
|
return;
|
||||||
phrasea::redirect('/login/?redirect=/thesaurus2');
|
phrasea::redirect('/login/?redirect=/thesaurus2');
|
||||||
break;
|
break;
|
||||||
@@ -131,7 +129,6 @@ class gatekeeper
|
|||||||
break;
|
break;
|
||||||
case 'admin':
|
case 'admin':
|
||||||
if ($this->_script_name === 'runscheduler.php')
|
if ($this->_script_name === 'runscheduler.php')
|
||||||
|
|
||||||
return;
|
return;
|
||||||
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
|
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
|
||||||
break;
|
break;
|
||||||
@@ -151,7 +148,6 @@ class gatekeeper
|
|||||||
return;
|
return;
|
||||||
case 'setup':
|
case 'setup':
|
||||||
if ($appbox->upgradeavailable())
|
if ($appbox->upgradeavailable())
|
||||||
|
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
phrasea::redirect('/login/');
|
phrasea::redirect('/login/');
|
||||||
@@ -268,7 +264,6 @@ class gatekeeper
|
|||||||
$parm = $request->get_parms('LOG');
|
$parm = $request->get_parms('LOG');
|
||||||
|
|
||||||
if (is_null($parm["LOG"]))
|
if (is_null($parm["LOG"]))
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -286,6 +281,7 @@ class gatekeeper
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$datas = random::helloToken($parm['LOG']);
|
$datas = random::helloToken($parm['LOG']);
|
||||||
|
return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/");
|
||||||
}
|
}
|
||||||
catch (Exception_NotFound $e)
|
catch (Exception_NotFound $e)
|
||||||
{
|
{
|
||||||
|
@@ -381,8 +381,14 @@ class record_preview extends record_adapter
|
|||||||
$tab[$hour][$site][$action] = array();
|
$tab[$hour][$site][$action] = array();
|
||||||
|
|
||||||
if (!isset($tab[$hour][$site][$action][$row['usr_id']]))
|
if (!isset($tab[$hour][$site][$action][$row['usr_id']]))
|
||||||
|
{
|
||||||
$tab[$hour][$site][$action][$row['usr_id']] =
|
$tab[$hour][$site][$action][$row['usr_id']] =
|
||||||
array('final' => array(), 'comment' => array());
|
array(
|
||||||
|
'final' => array()
|
||||||
|
, 'comment' => array()
|
||||||
|
, 'user' => \User_Adapter::getInstance($row['usr_id'], $appbox)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!in_array($row['final'], $tab[$hour][$site][$action][$row['usr_id']]['final']))
|
if (!in_array($row['final'], $tab[$hour][$site][$action][$row['usr_id']]['final']))
|
||||||
$tab[$hour][$site][$action][$row['usr_id']]['final'][] =
|
$tab[$hour][$site][$action][$row['usr_id']]['final'][] =
|
||||||
|
@@ -2,6 +2,9 @@ Entities\UsrListOwner:
|
|||||||
type: entity
|
type: entity
|
||||||
repositoryClass: Repositories\UsrListOwnerRepository
|
repositoryClass: Repositories\UsrListOwnerRepository
|
||||||
table: UsrListOwners
|
table: UsrListOwners
|
||||||
|
uniqueConstraints:
|
||||||
|
unique_owner:
|
||||||
|
columns: usr_id,id
|
||||||
id:
|
id:
|
||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
{% for hour, sites in record.get_short_history() %}
|
{% for hour, sites in record.get_short_history() %}
|
||||||
{% for site, actions in sites %}
|
{% for site, actions in sites %}
|
||||||
{% for action, users in actions %}
|
{% for action, users in actions %}
|
||||||
{% for current_user, done in users %}
|
{% for done in users %}
|
||||||
|
|
||||||
<div style="margin:3px 0">
|
<div style="margin:3px 0">
|
||||||
|
|
||||||
@@ -55,8 +55,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="actor">
|
<span class="actor">
|
||||||
{% if user.ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
|
{% if user.ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
|
||||||
{% set user_infos = user.getInfos(current_user) %}
|
{% if done['user'].get_id() != session.get_usr_id() %}
|
||||||
{% if current_user != session.get_usr_id() and user_infos %}
|
{% set user_infos = done['user'].get_display_name() %}
|
||||||
{% trans %}report:: par {{ user_infos }}{% endtrans %}
|
{% trans %}report:: par {{ user_infos }}{% endtrans %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -366,7 +366,7 @@ function manageSession(data, showMessages)
|
|||||||
if($('.notification.unread',box).length > 0)
|
if($('.notification.unread',box).length > 0)
|
||||||
{
|
{
|
||||||
var trigger = $('#notification_trigger') ;
|
var trigger = $('#notification_trigger') ;
|
||||||
$('.counter div',trigger)
|
$('.counter',trigger)
|
||||||
.empty()
|
.empty()
|
||||||
.append($('.notification.unread',box).length);
|
.append($('.notification.unread',box).length);
|
||||||
$('.counter',trigger).css('visibility','visible');
|
$('.counter',trigger).css('visibility','visible');
|
||||||
|
Reference in New Issue
Block a user