Skip to content
Snippets Groups Projects
Commit 10caaa36 authored by llaffont's avatar llaffont
Browse files

Résa multimédia: il est possible de revenir à une étape précédente

parent 85023123
No related merge requests found
...@@ -43,9 +43,13 @@ class ZendAfi_View_Helper_Timeline extends Zend_View_Helper_Abstract { ...@@ -43,9 +43,13 @@ class ZendAfi_View_Helper_Timeline extends Zend_View_Helper_Abstract {
protected function _renderAction($action) { protected function _renderAction($action) {
$html = sprintf('<li%s>%s</li>', $class = $this->_getClassForAction($action);
$this->_getClassForAction($action), $content = $this->view->_($action['label']);
$this->view->_($action['label'])); if ($class == 'passed')
$content = '<a href="'.$action[self::URL].'">'.$content.'</a>';
$html = sprintf('<li class="%s">%s</li>', $class, $content);
if ($action[self::CURRENT]) if ($action[self::CURRENT])
$this->_after_current = true; $this->_after_current = true;
...@@ -55,9 +59,9 @@ class ZendAfi_View_Helper_Timeline extends Zend_View_Helper_Abstract { ...@@ -55,9 +59,9 @@ class ZendAfi_View_Helper_Timeline extends Zend_View_Helper_Abstract {
protected function _getClassForAction($action) { protected function _getClassForAction($action) {
if ($action[self::CURRENT]) if ($action[self::CURRENT])
return ' class="selected"'; return 'selected';
if (!$this->_after_current) if (!$this->_after_current)
return ' class="passed"'; return 'passed';
return ''; return '';
} }
} }
......
...@@ -940,7 +940,7 @@ div.ui-sortable-placeholder { ...@@ -940,7 +940,7 @@ div.ui-sortable-placeholder {
width: 130px; width: 130px;
list-style: none; list-style: none;
background: url(../images/reservation_timeline.png) no-repeat; background: url(../images/reservation_timeline.png) no-repeat;
margin-left: -18px; margin-left: -16px;
font-weight: bold; font-weight: bold;
} }
......
...@@ -808,6 +808,17 @@ class AbonneControllerMultimediaHoldGroupTest extends AbonneControllerMultimedia ...@@ -808,6 +808,17 @@ class AbonneControllerMultimediaHoldGroupTest extends AbonneControllerMultimedia
public function currentTimelineShouldBeSection() { public function currentTimelineShouldBeSection() {
$this->_assertCurrentTimelineStep('Section'); $this->_assertCurrentTimelineStep('Section');
} }
/** @test */
public function timelinePreviousActionsShouldHaveLink() {
$this->assertXPathContentContains('//div[@class="timeline"]//li//a[contains(@href, abonne/multimedia-hold-location)]', 'Lieu');
$this->assertXPathContentContains('//div[@class="timeline"]//li//a[contains(@href, abonne/multimedia-hold-day)]', 'Jour');
$this->assertXPathContentContains('//div[@class="timeline"]//li//a[contains(@href, abonne/multimedia-hold-hours)]', 'Horaires');
$this->assertNotXPathContentContains('//div[@class="timeline"]//li//a', 'Section');
$this->assertNotXPathContentContains('//div[@class="timeline"]//li//a', 'Poste');
$this->assertNotXPathContentContains('//div[@class="timeline"]//li//a', 'Confirmation');
}
} }
......
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