Commit 2134f6fb authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

tabs to spaces

parent b4117ca3

Too many changes to show.

To preserve performance only 443 of 443+ files are displayed.
......@@ -19,444 +19,444 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AccueilController extends Zend_Controller_Action {
private $id_profil; // Profil a modifier
private $config; // Qui a appelé la config : "admin" ou "accueil"
private $id_module; // Identifiant unique du module a traiter
private $type_module; // Identifiant du module à traiter
private $id_profil; // Profil a modifier
private $config; // Qui a appelé la config : "admin" ou "accueil"
private $id_module; // Identifiant unique du module a traiter
private $type_module; // Identifiant du module à traiter
/** @var Class_Systeme_ModulesAccueil */
private $_systemeModulesAccueil;
/** @var Class_Systeme_ModulesAccueil */
private $_systemeModulesAccueil;
public function preDispatch() {
parent::preDispatch();
public function preDispatch() {
parent::preDispatch();
// Changer le layout
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->setLayoutScript('subModal.phtml');
// Changer le layout
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->setLayoutScript('subModal.phtml');
// Recup des parametres
$this->id_module = $this->_request->getParam("id_module");
$this->id_profil = $this->_request->getParam("id_profil");
$this->config = $this->_request->getParam("config");
// Recup des parametres
$this->id_module = $this->_request->getParam("id_module");
$this->id_profil = $this->_request->getParam("id_profil");
$this->config = $this->_request->getParam("config");
// On initalise les proprietes
if (!$this->profil = Class_Profil::find($this->id_profil)) {
$this->profil = Class_Profil::getCurrentProfil();
$this->id_profil = $this->profil->getId();
}
// On initalise les proprietes
if (!$this->profil = Class_Profil::find($this->id_profil)) {
$this->profil = Class_Profil::getCurrentProfil();
$this->id_profil = $this->profil->getId();
}
$this->type_module = $this->_getParam('type_module');
$this->type_module = $this->_getParam('type_module');
$user = Class_Users::getIdentity();
$user = Class_Users::getIdentity();
if ((!$user->isAdminBib() && !$user->hasRightConfigFront())
|| ($user->isAdminBib() && ($user->getIdSite() !== $this->profil->getIdSite()))) {
$this->_redirect('admin/index');
return;
}
if ((!$user->isAdminBib() && !$user->hasRightConfigFront())
|| ($user->isAdminBib() && ($user->getIdSite() !== $this->profil->getIdSite()))) {
$this->_redirect('admin/index');
return;
}
$this->preferences = ($this->config == 'admin')
? $this->_extractProperties()
: $this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module);
$this->preferences = ($this->config == 'admin')
? $this->_extractProperties()
: $this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module);
$boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : '';
$this->view->preferences = $this->preferences;
$this->view->url = $this->_request->getRequestUri();
$boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : '';
$this->view->preferences = $this->preferences;
$this->view->url = $this->_request->getRequestUri();
$this->view->combo_templates = ZendAfi_View_Helper_Accueil_Base::getComboTemplates($boite, $this->profil);
$this->view->id_profil = $this->profil->getId();
$this->view->id_bib = $this->profil->getIdSite();
$this->view->combo_templates = ZendAfi_View_Helper_Accueil_Base::getComboTemplates($boite, $this->profil);
$this->view->id_profil = $this->profil->getId();
$this->view->id_bib = $this->profil->getIdSite();
$this->_systemeModulesAccueil = new Class_Systeme_ModulesAccueil();
$this->_systemeModulesAccueil = new Class_Systeme_ModulesAccueil();
Zend_Layout::startMvc([]);
}
Zend_Layout::startMvc([]);
}
public function calendrierAction() {
$this->_simpleAction('CALENDAR');
}
public function calendrierAction() {
$this->_simpleAction('CALENDAR');
}
public function menuverticalAction() {
$this->_simpleAction('MENU_VERTICAL');
}
public function menuverticalAction() {
$this->_simpleAction('MENU_VERTICAL');
}
public function rechguideeAction() {
$this->_simpleAction('RECH_GUIDEE');
}
public function rechguideeAction() {
$this->_simpleAction('RECH_GUIDEE');
}
public function rechsimpleAction() {
$this->view->getHelper('ComboProfils')
->setTagId('profil_redirect')
->setTagName('profil_redirect')
->addEmptyOption();
public function rechsimpleAction() {
$this->view->getHelper('ComboProfils')
->setTagId('profil_redirect')
->setTagName('profil_redirect')
->addEmptyOption();
$this->_simpleAction('RECH_SIMPLE');
}
$this->_simpleAction('RECH_SIMPLE');
}
public function cartezonesAction() {
$this->_simpleAction('CARTE_ZONES');
}
public function cartezonesAction() {
$this->_simpleAction('CARTE_ZONES');
}
public function preprocessSitoCategories() {
if ((int)$this->_getParam('type_aff',0)!=3)
return;
public function preprocessSitoCategories() {
if ((int)$this->_getParam('type_aff',0)!=3)
return;
if ($categories=explode('-',$this->_getParam('id_categorie')))
$this->_request->setPost('id_categorie',$categories[0]);
if ($categories=explode('-',$this->_getParam('id_categorie')))
$this->_request->setPost('id_categorie',$categories[0]);
}
public function sitothequeAction() {
$this->preprocessSitoCategories();
$this->_request->setPost('group_by_categorie','0');
$this->_simpleAction('SITO');
}
}
public function sitothequeAction() {
$this->preprocessSitoCategories();
$this->_request->setPost('group_by_categorie','0');
$this->_simpleAction('SITO');
}
public function domainBrowserAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'DOMAIN_BROWSER')['preferences'];
$this->_simpleAction('DOMAIN_BROWSER');
}
public function domainBrowserAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'DOMAIN_BROWSER')['preferences'];
$this->_simpleAction('DOMAIN_BROWSER');
}
public function formationsWidgetAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'FORMATIONS_WIDGET')['preferences'];
$this->_simpleAction('FORMATIONS_WIDGET');
}
public function formationsWidgetAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'FORMATIONS_WIDGET')['preferences'];
$this->_simpleAction('FORMATIONS_WIDGET');
}
public function newsAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
return;
}
public function newsAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
return;
}
$this->_simpleAction('NEWS');
}
$this->_simpleAction('NEWS');
}
public function rssAction() {
$this->_simpleAction('RSS');
}
public function rssAction() {
$this->_simpleAction('RSS');
}
public function langueAction() {
$this->_simpleAction('LANGUE');
}
public function langueAction() {
$this->_simpleAction('LANGUE');
}
public function loginAction() {
$this->_simpleAction('LOGIN');
}
public function loginAction() {
$this->_simpleAction('LOGIN');
}
public function compteursAction() {
$this->_simpleAction('COMPTEURS');
}
public function compteursAction() {
$this->_simpleAction('COMPTEURS');
}
public function pretsAction() {
$this->_simpleAction('PRETS');
}
public function pretsAction() {
$this->_simpleAction('PRETS');
}
public function historiqueRecherchesAction() {
$this->_simpleAction('HISTORIQUE_RECHERCHES');
}
public function historiqueRecherchesAction() {
$this->_simpleAction('HISTORIQUE_RECHERCHES');
}
public function reservationsAction() {
$this->_simpleAction('RESERVATIONS');
}
public function reservationsAction() {
$this->_simpleAction('RESERVATIONS');
}
public function multimediaAction() {
$this->_simpleAction('MULTIMEDIA');
}
public function multimediaAction() {
$this->_simpleAction('MULTIMEDIA');
}
public function newslettersAction() {
$this->_simpleAction('NEWSLETTERS');
}
public function newslettersAction() {
$this->_simpleAction('NEWSLETTERS');
}
public function panierAction() {
$this->_simpleAction('PANIER');
}
public function panierAction() {
$this->_simpleAction('PANIER');
}
public function bibliothequeNumeriqueAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
$this->_simpleAction('BIB_NUMERIQUE');
}
public function bibliothequeNumeriqueAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
$this->_simpleAction('BIB_NUMERIQUE');
}
$this->view->categories = Class_AlbumCategorie::getLoader()->getCollections();
$moduleBibNumerique = $this->_systemeModulesAccueil->getModuleByCode('BIB_NUMERIQUE');
$this->view->displayModes = $moduleBibNumerique->getDisplayModes();
$this->view->orderModes = $moduleBibNumerique->getOrderModes();
$this->view->categories = Class_AlbumCategorie::getLoader()->getCollections();
$moduleBibNumerique = $this->_systemeModulesAccueil->getModuleByCode('BIB_NUMERIQUE');
$this->view->displayModes = $moduleBibNumerique->getDisplayModes();
$this->view->orderModes = $moduleBibNumerique->getOrderModes();
$this->view->albums = Class_AlbumCategorie::getLoader()->findAlbumsRecursively();
}
$this->view->albums = Class_AlbumCategorie::getLoader()->findAlbumsRecursively();
}
public function tagsAction() {
// Retour du formulaire
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
$enreg['nombre'] = (int)$this->_getParam('nombre', 10);
$enreg['limite'] = (int)$this->_getParam('limite', 1000);
$enreg['type_tags'] = $enreg['type_tags_codes'];
$this->_updateEtRetour($enreg, 'TAGS');
} else {
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
}
}
public function tagsAction() {
// Retour du formulaire
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
$enreg['nombre'] = (int)$this->_getParam('nombre', 10);
$enreg['limite'] = (int)$this->_getParam('limite', 1000);
$enreg['type_tags'] = $enreg['type_tags_codes'];
$this->_updateEtRetour($enreg, 'TAGS');
} else {
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
}
}
public function critiquesAction() {
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
if ($enreg["id_panier"]) {
$user = ZendAfi_Auth::getInstance()->getIdentity();
$enreg["id_catalogue"] = 0;
$enreg["id_user"] = $user->ID_USER;
public function critiquesAction() {
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
if ($enreg["id_panier"]) {
$user = ZendAfi_Auth::getInstance()->getIdentity();
$enreg["id_catalogue"] = 0;
$enreg["id_user"] = $user->ID_USER;
} else {
$enreg["id_user"] = 0;
}
} else {
$enreg["id_user"] = 0;
}
$this->_updateEtRetour($enreg, 'CRITIQUES');
}
$this->_updateEtRetour($enreg, 'CRITIQUES');
}
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
$this->view->paniers = Class_PanierNotice::getPaniersForCombo();
}
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
$this->view->paniers = Class_PanierNotice::getPaniersForCombo();
}
public function catalogueAction() {
if ($this->_request->isPost()) {
extract($_POST);
$nb_requete = intval($nb_requete);
if (!$nb_requete)
$nb_requete = 200;
$nb_aff = intval($nb_aff);
if (!$nb_aff)
$nb_aff = 10;
if ($ordre == "1")
$nb_requete = $nb_aff; // si ordre strict on ne lit pas plus de notices qu'on en affiche
$enreg["message"] = $message;
$enreg["notices"] = $notices;
$enreg["format"] = $format;
$enreg["ordre"] = $ordre;
$enreg["type_doc"] = $type_doc;
$enreg["section"] = $section;
$enreg["genre"] = $genre;
$enreg["dewey"] = $dewey;
$enreg["pcdm4"] = $pcdm4;
$enreg["matiere"] = $matiere;
$enreg["nb_requete"] = $nb_requete;
$enreg["nb_aff"] = $nb_aff;
$this->_updateEtRetour($enreg, 'CATALOGUE');
}
}
public function kiosqueAction() {
if ($this->_request->isPost()) {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
if ($this->isAFlashStyleSelected())
$_POST['profil_redirect'] = '';
$this->_updateConfig('KIOSQUE');
}
}
$this->view->styles_liste = $this->_getStylesListes();
$this->view->flash_selected = $this->isAFlashStyleSelected();
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
$this->view->paniers = Class_PanierNotice::getPaniersForCombo();
}
protected function isAFlashStyleSelected() {
return Class_Systeme_ModulesAccueil::moduleByCode('KIOSQUE')
->isAFlashStyle($this->_getParam('style_liste',
$this->view->preferences['style_liste']));
}
protected function _unsetStyleReload(&$enreg) {
if (array_key_exists('styles_reload', $enreg)) {
unset($enreg["styles_reload"]);
}
}
protected function _setTypeDAnalyse(&$enreg) {
$enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ;
$enreg['nb_notices'] = (1 < (int)$enreg['nb_notices']) ?
(int)$enreg["nb_notices"]
: 1;
$enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ;
$enreg['nb_analyse'] = (int)$enreg['nb_analyse'];
if ($enreg['nb_analyse'] < $enreg['nb_notices'])
$enreg['nb_analyse'] = $enreg['nb_notices'] + 10;
}
protected function _setPanierOrDomaine(&$enreg) {
if ($enreg['id_panier'] > 0)
$enreg['id_catalogue'] = 0;
if ($enreg['id_catalogue'] > 0)
$enreg['id_panier'] = 0;
}
protected function _updateConfig($type) {
$enreg = $this->_request->getPost();
$this->_unsetStyleReload($enreg);
$this->_setTypeDAnalyse($enreg);
$this->_setPanierOrDomaine($enreg);
$this->_updateEtRetour($enreg, $type);
}
public function kiosqueChangeSelectionAction() {
$this->getHelper('ViewRenderer')->setNoRender();
$module_config = $this->profil
->getModuleAccueilConfig($this->id_module, 'KIOSQUE');
$selected_elementId = explode('-', $this->_request->getPost('domaine_panier'));
if($selected_elementId[0] == 'p') {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = $selected_elementId[1];
} else if ($selected_elementId[0] == 'c') {
$module_config['preferences']['id_panier'] = 0;
$module_config['preferences']['id_catalogue'] = $selected_elementId[1];
} else {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = 0;
}
$this->profil
->updateModuleConfigAccueil($this->id_module, $module_config)
->save();
$this->_redirect($this->_request->getServer('HTTP_REFERER'));
}
public function conteneur2colonnesAction() {
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
$this->preferences = array_merge($this->preferences, $enreg);
foreach(['gauche', 'droite'] as $colonne)
$enreg['col_' . $colonne .'_module_id'] = $this->createModuleFor($colonne);
return $this->_updateEtRetour($enreg, 'CONTENEUR_DEUX_COLONNES');
}
$modules_accueil = Class_Systeme_ModulesAccueil::getModules();
$modules = [];
foreach ($modules_accueil as $key => $module)
$modules[$key] = $module->getLibelle();
$this->view->modules = $modules;
}
public function catalogueAction() {
if ($this->_request->isPost()) {
extract($_POST);
$nb_requete = intval($nb_requete);
if (!$nb_requete)
$nb_requete = 200;
$nb_aff = intval($nb_aff);
if (!$nb_aff)
$nb_aff = 10;
if ($ordre == "1")
$nb_requete = $nb_aff; // si ordre strict on ne lit pas plus de notices qu'on en affiche
$enreg["message"] = $message;
$enreg["notices"] = $notices;
$enreg["format"] = $format;
$enreg["ordre"] = $ordre;
$enreg["type_doc"] = $type_doc;
$enreg["section"] = $section;
$enreg["genre"] = $genre;
$enreg["dewey"] = $dewey;
$enreg["pcdm4"] = $pcdm4;
$enreg["matiere"] = $matiere;
$enreg["nb_requete"] = $nb_requete;
$enreg["nb_aff"] = $nb_aff;
$this->_updateEtRetour($enreg, 'CATALOGUE');
}
}
public function kiosqueAction() {
if ($this->_request->isPost()) {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
if ($this->isAFlashStyleSelected())
$_POST['profil_redirect'] = '';
$this->_updateConfig('KIOSQUE');
}
}
$this->view->styles_liste = $this->_getStylesListes();
$this->view->flash_selected = $this->isAFlashStyleSelected();
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();