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

dev #36620 : boite formation : fix RT comments

parent 153d2f67
Branches
Tags
6 merge requests!1553Master,!1519Master,!1506Master,!1502Master,!1451Dev#36620 improve formation widget,!1437Dev#36620 improve formation widget
......@@ -6,7 +6,7 @@ $url_edit_participants = $this->url(['controller' => 'session-formation',
echo sprintf("<div><a href='%s'>%d / %d-%d</a></div>",
$url_edit_participants,
count($this->session->getStagiaires()),
$this->session->numberOfStagiaires(),
$this->session->getEffectifMin(),
$this->session->getEffectifMax());
......
......@@ -208,7 +208,7 @@ class Class_SessionFormation extends Storm_Model_Abstract {
/** @return bool */
public function isFull() {
return count($this->getStagiaires()) >= $this->getEffectifMax();
return $this->numberOfStagiaires() >= $this->getEffectifMax();
}
......
......@@ -70,8 +70,8 @@ class ZendAfi_View_Helper_Accueil_FormationsWidget extends ZendAfi_View_Helper_A
usort($formations,
function($formation_one, $formation_two)
{
$count_one = (count($formation_one->getStagiaires()));
$count_two = count($formation_two->getStagiaires());
$count_one = $formation_one->numberOfStagiaires();
$count_two = $formation_two->numberOfStagiaires();
if($count_one == $count_two)
return 0;
......
......@@ -49,9 +49,10 @@ class Render_Session {
public function displayCustomFields($session) {
$html='';
foreach ($session->getAllCustomFields()->getFields() as $custom_field) {
if (! ($value=$session->getCustomField($custom_field->getLabel())))
continue;
$html.=$this->view->tag('dt', $this->view->_($custom_field->getLabel()));
foreach ($custom_field->getValues() as $value)
$html .= $this->view->tag('dd', $value->getLabel());
$html .= $this->view->tag('dd', $value);
}
return $html;
}
......
......@@ -48,8 +48,6 @@ class Render_Sessions {
class Render_Sessions_Table extends Render_Sessions{
public function render($sessions) {
if(count(array_filter($sessions))<1)
return $this->view->tag('span', $this->view->_('Pas de session programmée'), ['class' => 'error']);
$html = $this->headers();
$html.= $this->tBody($sessions);
......@@ -71,9 +69,11 @@ class Render_Sessions_Table extends Render_Sessions{
protected function tBody($sessions) {
$html = '';
if(array_filter($sessions)>0)
foreach($sessions as $session)
$html.= $this->view->renderSession($session, 'Table');
if(count(array_filter($sessions))<1)
return $this->view->tag('span', $this->view->_('Pas de session programmée'), ['class' => 'error']);
foreach($sessions as $session)
$html.= $this->view->renderSession($session, 'Table');
return $this->view->tag('tbody', $html);
}
......@@ -84,9 +84,6 @@ class Render_Sessions_Table extends Render_Sessions{
class Render_Sessions_Block extends Render_Sessions {
public function render($sessions) {
if(count(array_filter($sessions))<1)
return $this->view->tag('span', $this->view->_('Pas de session programmée'), ['class' => 'error']);
return $this->view->tag('div', $this->_renderContent($sessions), ['class' => 'sessions']);
}
......@@ -94,9 +91,12 @@ class Render_Sessions_Block extends Render_Sessions {
protected function _renderContent($sessions) {
$html = '';
if(array_filter($sessions) > 0)
foreach($sessions as $session)
$html.= $this->view->renderSession($session, 'Block');
if(count(array_filter($sessions))<1)
return $this->view->tag('span', $this->view->_('Pas de session programmée'), ['class' => 'error']);
foreach($sessions as $session)
$html.= $this->view->renderSession($session, 'Block');
return $html;
}
......
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