Skip to content
Snippets Groups Projects

Hotline 6.55

Merged Patrick Barroca requested to merge hotline_6.55 into master
Compare and
+ 967
564
Preferences
Compare changes
Files
@@ -16,12 +16,12 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 - Controleur localisations
//////////////////////////////////////////////////////////////////////////////////////////
class BibController extends Zend_Controller_Action {
class BibController extends ZendAfi_Controller_Action {
private $_pathImg = "./public/admin/images/";
function indexAction() {
@@ -41,8 +41,8 @@ class BibController extends Zend_Controller_Action {
protected function _getArticlesForBibs($bibs) {
if (Class_Profil::getCurrentProfil()->getModulePreference('bib',
$this->getRequest()->getActionName(),
if (Class_Profil::getCurrentProfil()->getModulePreference('bib',
$this->getRequest()->getActionName(),
'hide_news'))
return array();
@@ -50,7 +50,7 @@ class BibController extends Zend_Controller_Action {
$art_loader = Class_Article::getLoader();
foreach($bibs as $bib)
$news = array_merge($news,
$news = array_merge($news,
$art_loader->getArticlesByPreferences(array('id_bib' => $bib->getId())));
return $art_loader->filterByLocaleAndWorkflow($news);
}
@@ -77,7 +77,7 @@ class BibController extends Zend_Controller_Action {
function zoneviewAction() {
$bibs = $this->_prepareZoneMap();
$bibs = $this->_prepareZoneMap();
$this->view->articles = $this->_getArticlesForBibs($bibs);
}
@@ -88,43 +88,32 @@ class BibController extends Zend_Controller_Action {
function selectionAction() {
$this->view->title = "Selection de bibliothèque";
$class_zone = new Class_Zone();
$class_bib = new Class_Bib();
$zone_array = $class_zone->getAllZone();
$this->view->territoire = $zone_array;
$this->view->bib = $class_bib;
// Url de retour
$url=$_SERVER["HTTP_REFERER"];
$pos=strPos($_SERVER["HTTP_REFERER"],"bib_select");
if($pos) $url=substr($url,0,$pos-1);
if(strPos($url,"?") === false) $url.="?"; else $url.="&";
$this->view->url_retour=$url."bib_select=";
// Selection active
$id_bibs=$_SESSION["selection_bib"]["id_bibs"];
if($id_bibs) {
$this->view->sel_bib=array();
$id_bibs=explode(",",$id_bibs);
foreach($id_bibs as $bib) $this->view->sel_bib[$bib]=true;
$this->view->titre = $this->view->_('Sélection de bibliothèques pour la recherche');
$this->view->zones = Class_Zone::findAll();
$this->view->id_bibs_session = ($id_bibs = Zend_Registry::get('session')->id_bibs) ? $id_bibs : [];
$this->view->form_action = $this->view->url(['controller' => 'bib',
'action' => 'selection'],
null ,true);
if($this->_request->isPost()) {
if(false === strpos($this->_getReferer(), '/recherche/simple'))
return $this->_redirectToReferer();
return $this->_redirectToRefererWithNewParams(['bib_select' => implode(',',$id_bibs)]);
}
else $this->view->sel_bib="all";
}
//------------------------------------------------------------------------------------------------------
// Google maps
//------------------------------------------------------------------------------------------------------
function mapviewAction() {
$id_bib = (int)$this->_request->getParam('id_bib');
if($id_bib<=0) $this->_redirect('opac/bib/index');
$retour = $this->_request->getParam('retour');
// Url de retour
if($retour == "notice")
if($retour == "notice")
$this->view->url_retour = $_SESSION["recherche"]["retour_notice"];
if(substr($retour,0,5)=="http:")
if(substr($retour,0,5)=="http:")
$this->view->url_retour=$retour;
else {
$this->view->url_retour = sprintf('%s/bib/bibview/id/%d', BASE_URL, $id_bib);
@@ -135,7 +124,7 @@ class BibController extends Zend_Controller_Action {
$data = ZendAfi_Filters_Serialize::unserialize($bib->GOOGLE_MAP);
// Pas de carte
if(!$data)
if(!$data)
$this->_redirect($this->view->url_retour);
// Création du javascript