Skip to content
Snippets Groups Projects
Commit 3c30a0bf authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

hotline#110024 : OPAC : add cardnumber information for loggedin user

parent 263b58ff
No related merge requests found
Pipeline #10168 failed with stage
in 42 minutes and 5 seconds
- ticket #110024 : OPAC : Ajouter l'information du code barre lecteur dans la page
\ No newline at end of file
......@@ -53,14 +53,20 @@ class ZendAfi_Controller_Action_Helper_View extends Zend_View {
$action,
Class_Profil::getCurrentProfil()->getId());
$logged = Class_Users::getIdentity() ? 'true' : 'false';
$logged = ($current_user = Class_Users::getIdentity()) ? 'true' : 'false';
$this->body_attribs = ['class' => $classes,
'data-logged' => $logged];
$this->bodyParam = sprintf('class="%s" data-logged="%s"',
$classes,
$logged);
if ($current_user) {
$this->body_attribs['data-idabon'] = [ $current_user->getIdabon()];
$this->bodyParam .= sprintf(' data-idabon="%s"',$current_user->getIdabon());
}
}
......
......@@ -236,6 +236,7 @@ class IndexControllerWithLoggedUserTest extends AbstractControllerTestCase {
ZendAfi_Auth::getInstance()->logUser($this->fixture('Class_Users',
['id' => 1,
'login' => 'tom',
'idabon' => '1234',
'date_maj' => '',
'password' => 'ok']));
$this->dispatch('index/index', true);
......@@ -248,6 +249,12 @@ class IndexControllerWithLoggedUserTest extends AbstractControllerTestCase {
}
/** @test */
public function bodyShouldHaveDataIdAbon1234() {
$this->assertXPath('//body[@data-idabon="1234"]');
}
/** @test */
public function bodyShouldHaveClassOpac() {
$this->assertXPath('//body[contains(@class, "opac")]');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment