diff --git a/lib/Alchemy/Phrasea/Cache/WinCacheCache.php b/lib/Alchemy/Phrasea/Cache/WinCacheCache.php index 2a94cb25ab..de995f0325 100644 --- a/lib/Alchemy/Phrasea/Cache/WinCacheCache.php +++ b/lib/Alchemy/Phrasea/Cache/WinCacheCache.php @@ -11,7 +11,7 @@ namespace Alchemy\Phrasea\Cache; -use Doctrine\Common\Cache\WincacheCache as DoctrineWinCache; +use Doctrine\Common\Cache\WinCacheCache as DoctrineWinCache; class WinCacheCache extends DoctrineWinCache implements Cache { diff --git a/lib/Alchemy/Phrasea/Controller/Root/AccountController.php b/lib/Alchemy/Phrasea/Controller/Root/AccountController.php index 8f9107f83a..9d49301c1b 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/AccountController.php +++ b/lib/Alchemy/Phrasea/Controller/Root/AccountController.php @@ -201,6 +201,7 @@ class AccountController extends Controller */ public function accountAccess() { + //var_dump($this->getRegistrationManager()->getRegistrationSummary($this->getAuthenticatedUser()));die; return $this->render('account/access.html.twig', [ 'inscriptions' => $this->getRegistrationManager()->getRegistrationSummary($this->getAuthenticatedUser()) ]); diff --git a/lib/Alchemy/Phrasea/Core/Configuration/RegistrationManager.php b/lib/Alchemy/Phrasea/Core/Configuration/RegistrationManager.php index 992b090644..5bf21bc37c 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/RegistrationManager.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/RegistrationManager.php @@ -176,7 +176,7 @@ class RegistrationManager } if ($isTimeLimited && $isOutDated && $isPending) { - $userRegistration['type'] = 'out-time'; + $userRegistration['type'] = 'out-dated'; return $userRegistration; } diff --git a/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php b/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php index 192bf5660b..d3d9597544 100644 --- a/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php +++ b/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php @@ -12,7 +12,7 @@ namespace Alchemy\Phrasea\TaskManager; use Alchemy\Phrasea\Exception\RuntimeException; -use Alchemy\Phrasea\Model\Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task as liveTask; class LiveInformation { @@ -43,10 +43,11 @@ class LiveInformation /** * Returns live informations about the given task. - * + * @param liveTask $task + * @param boolean $throwException * @return array */ - public function getTask(Task $task, $throwException = false) + public function getTask(liveTask $task, $throwException = false) { $data = $this->query($throwException); @@ -56,7 +57,7 @@ class LiveInformation /** * Returns live informations about some tasks. * - * @param Task[] $tasks + * @param liveTask[] $tasks * @param boolean $throwException * * @return array @@ -73,13 +74,13 @@ class LiveInformation return $ret; } - private function formatTask(Task $task, $data) + private function formatTask(liveTask $task, $data) { $taskData = (isset($data['jobs']) && isset($data['jobs'][$task->getId()])) ? $data['jobs'][$task->getId()] : []; return [ 'configuration' => $task->getStatus(), - 'actual' => isset($taskData['status']) ? $taskData['status'] : Task::STATUS_STOPPED, + 'actual' => isset($taskData['status']) ? $taskData['status'] : liveTask::STATUS_STOPPED, 'process-id' => isset($taskData['process-id']) ? $taskData['process-id'] : null, ]; } diff --git a/resources/www/account/styles/_skin.scss b/resources/www/account/styles/_skin.scss index ab53ae6fd9..5f0cb7d2ab 100644 --- a/resources/www/account/styles/_skin.scss +++ b/resources/www/account/styles/_skin.scss @@ -300,8 +300,8 @@ blockquote { page-break-inside: avoid; background: #f9f9f9; border-left: 10px solid #ccc; - margin: 1.5em 10px; - padding: 0.5em 10px; + margin: 1.5rem 10px; + padding: 0.5rem 10px; quotes: "\201C""\201D""\2018""\2019"; color: #333; } @@ -1056,6 +1056,170 @@ h1, h2, h3, h4 { line-height: 20px; } +#updatingDemand .icon-box { + display: inline-block; + width:2%; + height: 29px; +} + +#updatingDemand .icon-box input { + position: relative; + bottom: 0.4rem; +} + +#updatingDemand .coll-name { + width:48%; + padding-left:2%; + display: inline-block; + line-height: 1.8rem; + height: 100%; +} + +#updatingDemand h3 { + border: 1px solid whitesmoke; + margin: 2rem 0; + text-align: center; +} + +#updatingDemand .coll-name span{ + font-size:initial; +} + +#updatingDemand .cgu-block { + margin:1.6rem auto; +} + +#updatingDemand .base-block { + font-size: 0; +} + +#updatingDemand .status { + font-size:initial; + padding-left: 0.6rem; +} + +#updatingDemand .status-box { + display: inline-block; + width:48%; + line-height: 1.2rem; +} + +#updatingDemand .registration { + width:100%; + display: inline-block; + position:relative; + line-height: 0.8rem; + border: 1px solid #333333; + height: 30px; +} + +#updatingDemand h3:after { + content: ""; + font-family: FontAwesome; + font-weight: 400; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + margin-top: 0; + font-size:2.3rem; + color:#a1a1a1; + float: right; + position: relative; + right: 10px; + -webkit-transition:-webkit-transform .5s; + -moz-transition:-moz-transform .5s; + -o-transition:-o-transform .5s; + -ms-transition:-ms-transform .5s; + transition:transform .5s; + -ms-transform: rotate(270deg); + -webkit-transform: rotate(270deg); + transform: rotate(270deg); + top: 2px; +} + +#updatingDemand h3.toggled:after { + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +#updatingDemand .icon { + width: 20px; + height:20px; + border-radius:10px; + display:inline-block; + position: relative; + top: 0.35rem; +} + +#updatingDemand .icon.active { + background-color:#61BD4F; +} + +#updatingDemand .status.active { + color: #61BD4F; +} + +#updatingDemand .icon.registrable { + background-color:#F2D600; +} + +#updatingDemand .status.registrable { + color: #F2D600; +} + +#updatingDemand .icon.in-time { + background-color:#0079BF; +} + +#updatingDemand .status.in-time { + color: #0079BF; +} + +#updatingDemand .icon.out-dated { + background-color:#EB5A46; +} + +#updatingDemand .status.out-dated { + color: #EB5A46; +} + +#updatingDemand .icon.pending { + background-color:#FFAB4A; +} + +#updatingDemand .status.pending { + color: #FFAB4A; +} + +#updatingDemand .icon.rejected { + background-color:red; +} + +#updatingDemand .status.rejected { + color: red; +} + +#updatingDemand .icon.accepted { + background-color:#61BD4F; +} + +#updatingDemand .status.accepted { + color: #61BD4F; +} + +#updatingDemand .registration:nth-of-type(even) { + background: #333; +} + form[name="changeEmail"] .control-label { width: 200px; } diff --git a/resources/www/admin/styles/main.scss b/resources/www/admin/styles/main.scss index 1fb8750d83..168f1fa1c7 100644 --- a/resources/www/admin/styles/main.scss +++ b/resources/www/admin/styles/main.scss @@ -368,9 +368,6 @@ div.switch_right.unchecked { .board_section { margin: 0 0 30px; } -.board_section ul { - margin: 0 0 20px 15px; -} .board_section div[class="section"] { height: auto; } diff --git a/templates/web/account/access.html.twig b/templates/web/account/access.html.twig index c73a7063c6..0d150daf41 100644 --- a/templates/web/account/access.html.twig +++ b/templates/web/account/access.html.twig @@ -8,206 +8,71 @@ {% block content_account %}
- - - - - - - {% for sbasId, baseInfo in inscriptions %} - +
+ {% for sbasId, baseInfo in inscriptions if baseInfo["display"] %} {% set sbasName = sbasId | sbas_labels(app) %} - {% set private = 0 %} - - {% if baseInfo["registrations"]["by-type"]["accepted"]|length > 0 %} -
- - - - - - {% for base in baseInfo["registrations"]["by-type"]["accepted"] %} - - - - {% endfor %} - - - - {% elseif baseInfo["registrations"]["by-type"]["rejected"]|length > 0 %} - - - - - - - {% for base in baseInfo["registrations"]["by-type"]["rejected"] %} - - - - {% endfor %} - - - - {% elseif baseInfo["registrations"]["by-type"]["pending"]|length > 0 %} - - - - - - - {% for base in baseInfo["registrations"]["by-type"]["pending"] %} - - - - {% endfor %} - - - - {% elseif baseInfo["registrations"]["by-type"]["in-time"]|length > 0 %} - - - - - - - {% for base in baseInfo["registrations"]["by-type"]["in-time"] %} - - - - {% endfor %} - - - - {% elseif baseInfo["registrations"]["by-type"]["out-dated"]|length > 0 %} - - - - - - - {% for base in baseInfo["registrations"]["by-type"]["out-dated"] %} - - - - {% endfor %} - - - - {% elseif baseInfo["registrations"]["by-type"]["inactive"]|length > 0 %} - - - - - - - {% for base in baseInfo["registrations"]["by-type"]["inactive"] %} - - - - {% endfor %} - - - - {% else %} - {% set private = 1 %} - {% endif %} - - {% if attribute(baseInfo["config"]["cgu"], app['locale']) is defined and private == 0 %} - {% set TOU = attribute(baseInfo["config"]["cgu"], app['locale']) %} - - - - - - - {% endif %} - {% for collInfo in baseInfo["config"]["collections"] if (collInfo['registration'] is none and collInfo['can-register']) %} - {% if collInfo["cgu"] is not none and private == 0 %} - - - - - - +
+
{{ TOU['value']|raw }}
+
+ {% endif %} {% endif %} - - - - - - {% endfor %} + {% for baseId, collInfo in baseInfo["collections"] %} + {% set type = collInfo['type'] %} + {% if type == 'inactive' and collInfo['can-register'] %} + {% set type = 'registrable' %} + {% endif %} + {% set show = false %} + {% if type == 'active' or type == 'registrable' or type == 'in-time' or type == 'out-dated' + or type == 'pending' or type == 'rejected' or type == 'accepted' %} + {% set show = true %} + {% endif %} + {% if show == true %} +
+
+ + {{ collInfo["coll-name"] }} + +
+
+ {% if type == 'registrable' %} + + {% else %} + + {% endif %} +
+
+ + {% if type == 'active' %} + {{ "registration:collection.active" | trans }} + {% elseif type == 'registrable' %} + {{ "registration:collection.registrable" | trans }} + {% elseif type == 'in-time' %} + {{ "registration:collection.in-time" | trans }} + {% elseif type == 'out-dated' %} + {{ "registration:collection.out-dated" | trans }} + {% elseif type == 'pending' %} + {{ "registration:collection.pending" | trans }} + {% elseif type == 'rejected' %} + {{ "registration:collection.rejected" | trans }} + {% elseif type == 'accepted' %} + {{ "registration:collection.accepted" | trans }} + {% endif %} + +
+
+ {% endif %} + {% endfor %} + {% endfor %} -
   
-

{{ sbasName }}

-
- {{ "Allowed access to the following collections" | trans }} -
- - {{ base["coll-name"] }} - - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) -
-
-

{{ sbasName }}

-
- {{ "Rejected access to the following collections" | trans }} -
- - {{ base["coll-name"] }} - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) - -
-
-

{{ sbasName }}

-
- {{ "Pending access to the following collections" | trans }} -
- {{ base["coll-name"] }} - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) -
-
-

{{ sbasName }}

-
- {{ "Temporary access to the following collections" | trans }} -
- {{ base["coll-name"] }} - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) -
-
-

{{ sbasName }}

-
- {{ "Outdated access to the following collections" | trans }} -
- {{ base["coll-name"] }} - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) -
-
-

{{ sbasName }}

-
- {{ "Suspended access to the following collections" | trans }} -
- {{ base["coll-name"] }} - ( - {{ "login::register::CGU: lire les CGU" | trans }} - ) -
-
- +

{{ sbasName }}

+
+ {% if attribute(baseInfo["cgu"], app['locale']) is defined %} + {% set TOU = attribute(baseInfo["cgu"], app['locale']) %} + {% if(TOU['value'] != '') %}

{{ "Access to the above bases constitutes acceptance of the following Terms of Use (TOU)." | trans }}

-
{{ TOU['value']|raw }}
{{ "login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes" | trans }}
{{ baseInsc["CGU"] }}
{{ collInfo["coll-name"] }} - - {{ "login::register: Faire une demande d\'acces" | trans }} -
+ +
+ +
{% endblock %} diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/RegistrationManagerTest.php b/tests/Alchemy/Tests/Phrasea/Core/Configuration/RegistrationManagerTest.php index 70d645c40a..b4c8db3f2d 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/RegistrationManagerTest.php +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/RegistrationManagerTest.php @@ -168,7 +168,7 @@ class RegistrationManagerTest extends \PhraseanetTestCase ] ] ], - 'out-time', + 'out-dated', 1 ];