Commit 707183ac authored by lbrun's avatar lbrun
Browse files

dev#7334_prolonger_tous_les_prets_en_une_seule_fois: add title in popup

parent 88504a7e
......@@ -391,15 +391,37 @@ class AbonneController extends ZendAfi_Controller_Action {
$result['statut'] == 1 ? $nb_success++ : $nb_errors++;
$message = $nb_success . ' prêt(s) prolongé(s).<br>';
$message .= $nb_errors . ' prolongation(s) impossible(s).<br>';
foreach($results as $result) {
if ($result['statut'] == 0)
$message .= '<br>Erreur: ' . $result['erreur'];
}
$message .= $this->_getExtensionsError($results, $ids);
}
$this->_renderExtendPopup($title, $message);
}
protected function _getExtensionsError($results, $ids) {
$message = '';
$index = 0;
foreach($results as $result) {
$message .= $this->_getExtensionError($result, $ids[$index]);
$index++;
}
return $message;
}
protected function _getExtensionError($result, $id) {
if ($result['statut'] != 0)
return '';
$loans = $this->_user->getEmprunts();
foreach ($loans as $loan) {
if ($loan->getId() == $id)
$myloan = $loan;
}
return '<br><span style="font-weight:bold">' . $myloan->getTitre() . ':</span> ' . $result['erreur'];
}
protected function _renderExtendPopup($title, $message) {
$this->view->titre = $title;
$this->view->message = $message;
......
Markdown is supported
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