Skip to content
Snippets Groups Projects
Commit 4bf72364 authored by Patrick Barroca's avatar Patrick Barroca
Browse files

rel #18297 : fix border attribute on hold link img

parent c05edfb9
Branches
Tags
3 merge requests!896Master,!807Dev#18297 rgaa search result and viewnotice,!806Dev#18297 rgaa search result and viewnotice
......@@ -18,9 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Notice_ReservationLink extends Zend_View_Helper_HtmlElement {
use Trait_Translator;
class ZendAfi_View_Helper_Notice_ReservationLink extends ZendAfi_View_Helper_BaseHelper {
const HOLD_IMG = 'resa.png';
protected $_bib;
......@@ -39,30 +37,29 @@ class ZendAfi_View_Helper_Notice_ReservationLink extends Zend_View_Helper_HtmlEl
* @return string modified html
*/
public function renderItemOn($ex, $html) {
$html .= '<td class="resa" style="text-align:center;">';
if (1 == $this->_bib->getInterdireResa())
return $html .= '&nbsp;</td>';
return $this->_renderCellWith('&nbsp;');
$type_comm = ($int_bib = Class_IntBib::find($ex['id_int_bib'])) ? $int_bib->getCommSigb() : 0;
if (!$type_comm)
return $this->_renderStandardOn($ex, $html);
return $this->_renderCellWith($this->_renderStandardOn($ex));
if (!$ex['reservable'])
return $html . '&nbsp;</td>';
return $this->_renderCellWith('&nbsp;');
return $this->_renderAjaxOn($ex, $html);
return $this->_renderCellWith($this->_renderAjaxOn($ex));
}
/** @return string */
protected function getHoldImage() {
return Class_Profil::getCurrentProfil()->getUrlImage(self::HOLD_IMG);
protected function _renderCellWith($content) {
return $this->_tag('td', $content, ['class' => 'resa',
'style' => 'text-align:center;']);
}
/** @return string */
protected function _renderStandardOn($ex, $html) {
protected function _renderStandardOn($ex) {
$link = $this->view->url(['controller' => 'recherche',
'action' => 'reservation',
'id_int_bib' => $ex['id_int_bib'],
......@@ -70,22 +67,14 @@ class ZendAfi_View_Helper_Notice_ReservationLink extends Zend_View_Helper_HtmlEl
'id_notice' => $ex['id_notice'],
'cote' => $ex['cote']]);
$html .= sprintf('<a href="%s"><img src="%s" border="0" title="%s" alt="%s"/></a>',
$link,
$this->getHoldImage(),
$this->_holdLabel,
$this->_holdLabel);
return $html . '</td>';
}
/** @return string */
protected function _renderAjaxOn($ex, $html) {
return $this->_renderAjaxLinkOn($ex, $html, 'reservation');
return $this
->_tag('a', $this->_getHoldImage(),
['href' => $link]);
}
/** @return string */
protected function _renderAjaxLinkOn($ex, $html, $functionName) {
protected function _renderAjaxOn($ex) {
$link = $this->view->url(['controller' => 'recherche',
'action' => 'reservation-pickup-ajax',
'id_int_bib' => $ex['id_int_bib'],
......@@ -93,12 +82,25 @@ class ZendAfi_View_Helper_Notice_ReservationLink extends Zend_View_Helper_HtmlEl
'id_origine' => $ex['id'],
'code_annexe' => $ex['code_annexe']]);
$html .= sprintf('<a data-popup="true" href="%s"><img src="%s" border="0" alt="%s" title="%s" style="cursor:pointer" /></a>',
$link,
$this->getHoldImage(),
$this->_holdLabel,
$this->_holdLabel);
return $html .= '</td>';
return $this
->_tag('a', $this->_getHoldImage(),
['href' => $link,
'data-popup' => 'true']);
}
/** @return string */
protected function _getHoldImageUrl() {
return Class_Profil::getCurrentProfil()->getUrlImage(self::HOLD_IMG);
}
/** @return string */
protected function _getHoldImage() {
return $this->view
->tagImg($this->getHoldImageUrl(),
['title' => $this->_holdLabel,
'style' => 'border-style:none;'])
}
}
......
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