Skip to content
Snippets Groups Projects
Commit e9fadc33 authored by efalcy's avatar efalcy
Browse files

Ajout d'un controller admin/type-docs

parent ecf0f376
No related merge requests found
......@@ -424,6 +424,7 @@ application/modules/admin/controllers/SitoController.php -text
application/modules/admin/controllers/StatController.php -text
application/modules/admin/controllers/SuggestionAchatController.php -text
application/modules/admin/controllers/SystemeController.php -text
application/modules/admin/controllers/TypeDocsController.php -text
application/modules/admin/controllers/UploadController.php -text
application/modules/admin/controllers/UsergroupController.php -text
application/modules/admin/controllers/UsersController.php -text
......@@ -667,6 +668,7 @@ application/modules/admin/views/scripts/systeme/mailtest.phtml -text
application/modules/admin/views/scripts/systeme/phpinfo.phtml -text
application/modules/admin/views/scripts/systeme/updatethesaurus.phtml -text
application/modules/admin/views/scripts/systeme/webservices.phtml -text
application/modules/admin/views/scripts/type-docs/index.phtml -text
application/modules/admin/views/scripts/upload/biographie-notice.phtml -text
application/modules/admin/views/scripts/upload/biographie-uploaded.phtml -text
application/modules/admin/views/scripts/upload/multiple.phtml -text
......@@ -5952,6 +5954,7 @@ tests/application/modules/admin/controllers/StatControllerTest.php -text
tests/application/modules/admin/controllers/SuggestionAchatControllerTest.php -text
tests/application/modules/admin/controllers/SystemeControllerTest.php -text
tests/application/modules/admin/controllers/SystemeControllerWebServicesTest.php -text
tests/application/modules/admin/controllers/TypeDocsControllerTest.php -text
tests/application/modules/admin/controllers/UploadControllerTest.php -text
tests/application/modules/admin/controllers/UserGroupControllerTest.php -text
tests/application/modules/admin/controllers/UsergroupControllerMultimediaTest.php -text
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_TypeDocsController extends ZendAfi_Controller_Action {
public function getRessourceDefinitions() {
return [
'model' => ['class' => 'Class_TypeDoc',
'name' => 'type_doc',
'order' => 'libelle']
];
}
}
?>
\ No newline at end of file
<?php
echo $this->tagModelTable($this->type_docs,
[$this->_('Libelle')],
['label'],
[],
'type_docs');
?>
......@@ -61,6 +61,9 @@ class TypeDocLoader {
return $this;
}
public function findAllBy($select) {
return $this->findAll();
}
public function findAll() {
if (isset($this->_all_instances))
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class TypeDocsControllerTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Class_CosmoVar::newInstanceWithId('types_docs', ['liste' => "0:non identifié\r\n1:Livres\r\n2:périodiques"]);
$this->dispatch('/admin/type-docs/',true);
}
/** @test */
public function tableShouldContainsLivresTypeDoc() {
$this->assertXPathContentContains('//tbody//tr[2]//td', 'Livres',$this->_response->getBody());
}
}
?>
\ No newline at end of file
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