Commit e054ff93 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

work on bootstrap

parent 91632d18
Pipeline #7389 passed with stage
in 37 minutes and 29 seconds
......@@ -1390,13 +1390,52 @@ class AbonneController extends ZendAfi_Controller_Action {
}
public function ajaxReviewAction() {
session_write_close();
$this->getHelper('ViewRenderer')->setNoRender();
if(!$this->_user)
return $this->_response->setHttpResponseCode(520);
if(!$this->_request->isPost())
return $this->_response->setHttpResponseCode(520);
$form = new ZendAfi_Form_Review;
$post = $this->_request->getPost();
$form->populate($post);
$rating = ($mine = Class_AvisNotice::find($this->_getParam('id')))
? $mine
: new Class_AvisNotice;
$rating
->beImportMode()
->setUser($this->_user)
->setIdNotice($this->_getParam('record_id'))
->setClefOeuvre($this->_getParam('record_key'))
->setUserRole($this->_user)
->setModerationOK()
->updateAttributes($post);
if ($this->_getPost('entete') || $this->_getPost('avis'))
$rating->setModerationNOK();
if (!$form->isValidModelAndArray($rating, $post))
return $this->_response->setHttpResponseCode(520);
if (!$rating->save())
return $this->_response->setHttpResponseCode(520);
return $this->_response->setHttpResponseCode(200);
}
public function editReviewAction() {
if (!$review = Class_AvisNotice::find($this->_getParam('id', null)))
if (!$this->view->review = Class_AvisNotice::find($this->_getParam('id', null)))
return $this->_redirectClose($this->_getReferer());
$this->view->titre = $this->_('Modifier l\'avis');
$this->view->review = $review;
}
......@@ -1404,13 +1443,10 @@ class AbonneController extends ZendAfi_Controller_Action {
if (!$review = Class_AvisNotice::find($this->_getParam('id', null)))
return $this->_redirectClose($this->_getReferer());
$this->view->titre = $this->_('Supprimer l\'avis');
$this->view->titre = $this->_('Supprimer un avis');
$this->view->review = $review;
if ($this->_getParam('redirect'))
return $this->_redirectClose($this->_getReferer());
if ($this->_getParam('delete')) {
$review->delete();
$this->_helper->notify($this->_('L\'avis a bien été supprimé'),
......@@ -1478,6 +1514,11 @@ class AbonneController extends ZendAfi_Controller_Action {
return $this->_redirectClose($this->_getReferer());
}
if (!$this->view->selection->isMine()) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
$this->view->criteria =
(new Class_CriteresRecherche())
->setParams(array_merge($this->_request->getParams(),
......@@ -1485,6 +1526,80 @@ class AbonneController extends ZendAfi_Controller_Action {
}
public function ajouterLeDocumentALaSelectionAction() {
session_write_close();
$this->getHelper('ViewRenderer')->setNoRender();
if (!$selection = Class_PanierNotice::find($this->_getParam('id')))
return $this->_response->setHttpResponseCode(404);
if (!$selection->isMine())
return $this->_response->setHttpResponseCode(404);
if (!$record = Class_Notice::find($this->_getParam('record_id')))
return $this->_response->setHttpResponseCode(404);
$selection->addNotice($record);
$selection->save();
}
public function supprimerDeLaSelectionAction() {
$this->view->titre = $this->_('Retirer un document');
if (!$this->view->selection = Class_PanierNotice::find($this->_getParam('selection_id'))) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
if (!$this->view->selection->isMine()) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
if (!$this->view->record = Class_Notice::find($this->_getParam('record_id'))) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
if ($this->_getParam('delete')) {
$this->view->selection
->removeNotice($this->view->record)
->save();
$this->_helper->notify($this->_('Le document a bien été retiré'),
['status' => 'delete']);
return $this->_redirectClose($this->_getReferer());
}
}
public function creerSelectionAction() {
$this->view->titre = $this->view->_('Créer une sélection');
$this->view->form = new ZendAfi_Form();
$this->view->form
->addElement('text',
'libelle',
['placeholder' => 'Titre de la sélection'])
->addUniqDisplayGroup('group')
->populate($this->_request->getParams())
->setAction($this->view->url());
if(!$this->_request->isPost())
return;
$selection = Class_PanierNotice::newForUser($this->_user);
$selection->setLibelle($this->_request->getPost('libelle'));
if(!$this->view->form->isValidModelAndArray($selection, $this->_request->getPost()))
return;
$selection->save();
$selection->index();
return $this->_redirectClose($this->_getReferer());
}
public function mesAvisAction() {
}
......@@ -1494,10 +1609,18 @@ class AbonneController extends ZendAfi_Controller_Action {
public function donnerDesAvisAction() {
$this->view->criteria =
(new Class_CriteresRecherche())
->setParams(array_merge($this->_request->getParams(),
['tri' => Class_CriteresRecherche::SORT_PUBLICATION]));
}
public function suivreUneRechercheAction() {
$this->view->criteria =
(new Class_CriteresRecherche())
->setParams(array_merge($this->_request->getParams(),
['tri' => Class_CriteresRecherche::SORT_PUBLICATION]));
}
......@@ -1539,4 +1662,44 @@ class AbonneController extends ZendAfi_Controller_Action {
$form->addDecorator('Errors');
}
}
public function exporterLaSelectionAction() {
$this->view->titre = $this->_('Exporter la sélection');
if (!$this->view->selection = Class_PanierNotice::find($this->_getParam('selection_id'))) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
if (!$this->view->selection->isMine()) {
$this->_helper->notify($this->_('Une erreur c\'est produite.'), ['status' => 'error']);
return $this->_redirectClose($this->_getReferer());
}
if (!$format = $this->_getParam('format'))
return;
$data = ('unimarc' == $format)
? $this->view->selection->toUnimarcIso2709()
: $this->view->selection->toTabbedList();
$this->getHelper('ViewRenderer')->setNoRender();
$name = sprintf('%s_id_%s_%s',
(new Class_TimeSource)->dateYmd(),
$this->view->selection->getId(),
str_replace(' ', '_', $this->view->selection->getLibelle()));
$response = $this->_response;
$response->clearAllHeaders();
$response->setHeader('Content-Type', 'text/plain; name="' . $name . '.txt"', true);
$response->setHeader('Content-Disposition', 'attachment; filename="' . $name . '.txt"', true);
$response->setHeader('Content-Transfer-Encoding', 'base64', true);
$response->setHeader('Expires', '0');
$response->setHeader('Cache-Control', 'no-cache, must-revalidate');
$response->setHeader('Pragma', 'no-cache');
$response->setHeader('Access-Control-Allow-Origin', '*');
$response->setBody($data);
}
}
\ No newline at end of file
<?php
echo $this->renderInlineForm($this->form);
\ No newline at end of file
......@@ -2,21 +2,17 @@
$wrapper = (new Intonation_Library_View_Wrapper_Review)
->setModel($this->review)
->setView($this);
$html = [$this->div(['class' => 'col-10 p-2 m-2 text-left'],
$this->cardifyFullDescription($wrapper)),
$this->div(['class' => 'col-10'],
$html = [$this->div(['class' => 'col-10'],
$this->tag('h3',
$this->_('Supprimer l\'avis'),
$this->_('Supprimer l\'avis %s',
$wrapper->getMainTitle()),
['class' => 'pt-2 mx-2 border-top border-danger'])),
$this->div(['class' => 'col-10'],
$this->div(['class' => 'm-2 p-2 btn-group text-white'],
$this->tagAnchor(['redirect' => '1'],
$this->_('Non'),
['class' => 'btn btn-info'])
$this->Button_Back(new Class_Entity(['Attribs' => ['class' => 'btn btn-info']]))
. $this->tagAnchor(['delete' => '1'],
$this->_('Oui'),
['class' => 'btn btn-danger'])))];
echo $this->grid(implode($html), [], ['class' => 'justify-content-center']);
echo $this->grid(implode($html), [], ['class' => 'justify-content-center text-center']);
<?php
echo $this->abonne_RateRecords($this->user);
echo $this->abonne_RateRecords($this->user, $this->criteria);
<?php
$html = [$this->div(['class' => 'col-10'],
$this->tag('h3',
$this->_('Exporter la sélection %s',
$this->selection->getLibelle()),
['class' => 'pt-2 mx-2 border-top border-danger'])),
$this->div(['class' => 'col-10'],
$this->div(['class' => 'm-2 p-2 btn-group text-white'],
$this->Button_Back(new Class_Entity(['Attribs' => ['class' => 'btn btn-info']]))
. $this->tagAnchor(['format' => 'unimarc',
'render' => null],
$this->_('UNIMARC'),
['class' => 'btn btn-success'])
. $this->tagAnchor(['format' => 'list',
'render' => null],
$this->_('Liste'),
['class' => 'btn btn-warning'])))];
echo $this->grid(implode($html), [], ['class' => 'justify-content-center text-center']);
<?php
echo $this->abonne_FollowASearch($this->user);
echo $this->abonne_FollowASearch($this->user, $this->criteria);
<?php
$wrapper = (new Intonation_Library_View_Wrapper_Record)
->setModel($this->record)
->setView($this);
$html = [$this->div(['class' => 'col-10'],
$this->tag('h3',
$this->_('Retirer le document %s de la sélection %s',
$wrapper->getMainTitle(),
$this->selection->getLibelle()),
['class' => 'pt-2 mx-2 border-top border-danger'])),
$this->div(['class' => 'col-10'],
$this->div(['class' => 'm-2 p-2 btn-group text-white'],
$this->Button_Back(new Class_Entity(['Attribs' => ['class' => 'btn btn-info']]))
. $this->tagAnchor(['delete' => '1'],
$this->_('Oui'),
['class' => 'btn btn-danger'])))];
echo $this->grid(implode($html), [], ['class' => 'justify-content-center text-center']);
......@@ -1603,7 +1603,7 @@ class Class_Notice extends Storm_Model_Abstract {
$sep=chr(9);
$enreg = Class_Codification::getInstance()->getLibelleFacette("T".$this->getTypeDoc()).$sep;
$enreg .= $this->getTitrePrincipal().$sep;
$enreg .= $this->getTitrePrincipal(' ').$sep;
$enreg .= $this->getAuteurPrincipal().$sep;
$enreg .= $this->getEditeur().$sep;
$enreg .= implode(',', $this->getCollections()).$sep;
......
......@@ -390,4 +390,10 @@ class ZendAfi_Form extends Zend_Form {
return $this;
}
public function setId($id) {
$this->setAttrib('id', $id);
return $this;
}
}
\ No newline at end of file
......@@ -33,7 +33,8 @@ $("#%1$s input[name=note]").click(function() {
$("#%1$s input[name=note]").parent().removeClass("checked");
if (!$(this).is("checked"))
return $(this).parent().addClass("checked");
});',
});
',
$id));
$this
......
......@@ -48,6 +48,7 @@ class ZendAfi_Form_Search_Advanced extends ZendAfi_Form {
->addElement('select',
'operateur_editeur',
['multiOptions' => $this->_getOperators()])
->addElement('text',
'rech_editeur',
['label' => $this->_('Editeurs')])
......
......@@ -34,11 +34,6 @@ body {
box-shadow: 1px 1px 5px var(--front-shadow);
}
[class*="carousel-control"]:hover,
.carousel-indicators li:hover {
background-color: var(--front-background-overlay);
}
#site_web_wrapper {
background-color: var(--front-background);
}
......@@ -251,6 +246,7 @@ pre {
.card {
white-space: normal;
word-wrap: normal;
}
.card-text {
......@@ -261,22 +257,21 @@ pre {
margin-left: 0;
}
[class*="carousel-control"] {
width: 5%;
[class*="carousel-control"],
.carousel-indicators li {
transition: all 0.4s;
}
[class*="carousel-control"]:hover {
width: 15%;
[class*="carousel-control"] {
width: auto;
}
[class*="carousel-control"],
.carousel-indicators li {
transition: all 0.4s;
height: 7px;
}
.carousel-indicators {
bottom: -1em;
margin-bottom: 0;
.carousel-indicators li:hover {
opacity: 1;
}
[id*='resources'] .list-group-item {
......@@ -409,10 +404,6 @@ label[data-name=note] ~ div label.multi-element-label + br {
color: inherit;
}
.carousel-indicators:hover {
background-color: var(--front-background-overlay);
}
.badge {
text-transform: lowercase;
}
......@@ -477,4 +468,8 @@ dl.row {
.card-img-overlay .card-link > * {
display: inline-block;
white-space: normal;
}
.rating-score {
display: inline-flex;
}
\ No newline at end of file
......@@ -104,7 +104,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'a' => 'btn-link',
'a class active' => '',
'a class nav-link' => '',
'a class card-link' => 'no_wrap',
'a class card-link' => '',
'a class list-group-item' => '',
'a class account-loans' => 'btn btn-sm list-group-item-info',
'ul' => 'list-unstyled',
......@@ -171,6 +171,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'add' => 'class fas fa-plus-square',
'delete' => 'class fas fa-minus',
'edit' => 'class fas fa-edit',
'check-list' => 'class fas fa-tasks',
'rename' => 'class fas fa-edit',
'rss' => 'class fas fa-rss',
......@@ -258,7 +259,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
protected function _mergeData($default, $data) {
$merged = array_merge($default, $data);
$merged = array_merge($data, $default);
if (count(array_filter(array_keys($default), 'is_string')))
return $merged;
......
......@@ -89,6 +89,7 @@ abstract class Intonation_Library_View_Wrapper_Abstract {
abstract public function getActions();
abstract public function getDescription();
abstract public function getFullDescription();
abstract public function getDescriptionTitle();
abstract public function getBadges();
......
......@@ -77,6 +77,12 @@ class Intonation_Library_View_Wrapper_Article extends Intonation_Library_View_Wr
}
public function getFullDescription() {
return $this->_view->renderArticleBadges($this->_model)
. $this->_model->getSummary();
}
public function getDescriptionTitle() {
return $this->_('Résumé de l\'article "%s"', $this->_model->getTitre());
}
......
......@@ -79,6 +79,18 @@ class Intonation_Library_View_Wrapper_Hold extends Intonation_Library_View_Wrapp
}
public function getFullDescription() {
if (!$this->_model->getNoticeOPAC())
return '';
$wrapper = (new Intonation_Library_View_Wrapper_Record)
->setView($this->_view)
->setModel($this->_model->getNoticeOPAC());
return $wrapper->getFullDescription();
}
public function getDescriptionTitle() {
return '';
}
......
......@@ -63,6 +63,11 @@ class Intonation_Library_View_Wrapper_Item extends Intonation_Library_View_Wrapp
}
public function getFullDescription() {
return $this->getDescription();
}
public function getDescriptionTitle() {
return '';
}
......
......@@ -79,6 +79,19 @@ class Intonation_Library_View_Wrapper_Loan extends Intonation_Library_View_Wrapp
}
public function getFullDescription() {
if (!$this->_model->getNoticeOPAC())
return '';
$wrapper = (new Intonation_Library_View_Wrapper_Record)
->setView($this->_view)
->setModel($this->_model->getNoticeOPAC());
return $this->getBadges()
. $wrapper->getFullDescription();
}
public function getDescriptionTitle() {
return '';
}
......
......@@ -92,6 +92,12 @@ class Intonation_Library_View_Wrapper_Newsletter extends Intonation_Library_View
}
public function getFullDescription() {
$template = $this->_model->newTemplate();
return $template->getBodyHTML();
}
public function getDescriptionTitle() {
}
......
......@@ -74,6 +74,12 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
}
public function getFullDescription() {
return $this->getBadges()
. $this->_model->getResume();
}
public function getDescriptionTitle() {
return $this->_('Résumé du document "%s"', $this->getMainTitle());
}
......
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