Skip to content
Snippets Groups Projects
Commit 8b96384f authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #16652 use dedicated Zend View Helpers for formElements + fix css

parent 286efb22
Branches
Tags
4 merge requests!529Hotline 6.56,!519Master,!518Hotline 6.55,!507Hotline #16652 search with bib filter
......@@ -88,6 +88,7 @@ class BibController extends ZendAfi_Controller_Action {
function selectionAction() {
xdebug_break();
$this->view->titre = $this->view->_('Sélection de bibliothèques pour la recherche');
$this->view->zones = Class_Zone::findAll();
$this->view->id_bibs_session = [];
......
......@@ -2,15 +2,13 @@
$this->openBoite($this->titre);
echo $this->tag('p',
$this->_('Vous pouvez sélectionner une ou plusieurs bibliothèques pour effectuer une recherche '));
echo ('<form name="selection" method="post">');
echo $this->formSubmit('Valider', $this->_('Valider la sélection'));
echo $this->tagAnchor('javascript:selectall()',
$this->_('Tout cocher'));
echo $this->tagAnchor('javascript:deselectall()',
$this->_('Tout décocher'));
?>
<form name="selection" method="post">
<?php
echo ('<ul>');
foreach($this->zones as $zone )
{
......@@ -21,17 +19,12 @@ foreach($this->zones as $zone )
foreach($bibs as $bib) {
$coche = in_array($bib->getId(), $this->id_bibs_session) ? ['checked' => 'checked'] : [];
echo $this->tag('li',
$this->tag('span', $bib->getLibelle()).
$this->tagInput(['type' => 'checkbox',
'name' => 'bib_select[]',
'value' => $bib->getIdSite()] + $coche));
$this->formCheckbox('bib_select[]', $bib->getIdSite(), $coche + ['id' => 'bib_select_' . $bib->getId()]).
$this->tag('span', $bib->getLibelle()));
}
echo('</ul></li>');
}
echo ('</ul>');
echo $this->tagInput(['type' => 'submit',
'value' => $this->_('Valider la sélection'),
'name' => 'Valider']);
echo ('</form>');
$this->closeBoite();
?>
<?php
/**
* Copyright (c) 2012-2014, 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 ZendAfi_View_Helper_TagInput extends Zend_View_Helper_HtmlElement {
public function tagInput($attribs) {
$html = '<input ' . $this->_htmlAttribs($attribs);
return $html . '>';
}
}
?>
\ No newline at end of file
......@@ -61,9 +61,7 @@ class ZendAfi_View_Helper_TagRechercheSimple extends Zend_View_Helper_HtmlElemen
$bib_ids = array_key_exists('id_bibs', $_SESSION['selection_bib']) ? $_SESSION['selection_bib']['id_bibs'] : '' ;
$input = $this->view->tagInput(['type' => 'hidden',
'name' => 'bib_select',
'value' => implode(',',$bib_ids)]);
$input = $this->view->formHidden('bib_select', implode(',',$bib_ids));
$anchor = $this->view->tagAnchor($this->view->url(['module' => 'opac',
'controller' => 'bib',
......
......@@ -2883,4 +2883,23 @@ a.loan-export {
.boite.rech_simple .selected_bibs_info span {
display: block;
}
.bib_selection #colContenuInner ul,
.bib_selection #colContenuInner li {
margin: 0;
padding: 0;
}
.bib_selection #colContenuInner form > ul > li {
margin: 10px 0;
}
.bib_selection #colContenuInner input + a,
.bib_selection #colContenuInner input + a + a,
.bib_selection #colContenuInner input + span {
margin-left: 5px;
}
\ 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