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

dev #16260 : add version file

parent d1e03525
6 merge requests!529Hotline 6.56,!512Master,!500Hotline 6.55,!498Master,!496Hotline 6.54,!495Hotline 16499 karvi
This commit is part of merge request !500. Comments created here will be created in the context of that merge request.
- Ticket #16260 : authentification Lectura
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* 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
*/
class Class_AdminVar extends Storm_Model_Abstract {
protected $_table_name = 'bib_admin_var';
protected $_table_primary = 'CLEF';
/** @var array */
protected static $_knownVars;
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* 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
*/
class Class_AdminVar extends Storm_Model_Abstract {
protected $_table_name = 'bib_admin_var';
protected $_table_primary = 'CLEF';
/** @var array */
protected static $_knownVars;
/**
* @param string $name
* @return mixed
*/
public static function get($name) {
$var = static::getLoader()->find($name);
if ($var == null)
return null;
return $var->getValeur();
}
/**
* @param string $name
* @return mixed
*/
public static function get($name) {
$var = static::getLoader()->find($name);
if ($var == null)
return null;
return $var->getValeur();
}
/**
* @param string $name
* @param mixed $value
*/
public static function set($name, $value) {
if (null === ($instance = self::getLoader()->find($name))) {
$instance = self::getLoader()->newInstance()->setClef($name);
}
$instance
->setValeur($value)
->save();
// très particulier à cette table qui n'a pas de primary autoincrément
// si on vient de la créer, last insertid est vide
// donc ici on reprend le champ clef
$instance->setId($instance->getClef());
return $instance;
}
/**
* @param string $name
* @param mixed $value
*/
public static function set($name, $value) {
if (null === ($instance = self::getLoader()->find($name))) {
$instance = self::getLoader()->newInstance()->setClef($name);
}
$instance
->setValeur($value)
->save();
public static function getDefaultLanguage() {
return 'fr';
}
// très particulier à cette table qui n'a pas de primary autoincrément
// si on vient de la créer, last insertid est vide
// donc ici on reprend le champ clef
$instance->setId($instance->getClef());
return $instance;
}
public static function getLangues() {
if (!$langues_value = self::get('LANGUES'))
return array();
$langues = array(self::getDefaultLanguage());
foreach(explode(';', strtolower($langues_value)) as $langue)
$langues []= trim($langue);
return array_unique(array_filter($langues));
}
public static function getDefaultLanguage() {
return 'fr';
}
public static function getLanguesWithoutDefault() {
return array_diff(self::getLangues(), array(self::getDefaultLanguage()));
}
public static function getLangues() {
if (!$langues_value = self::get('LANGUES'))
return array();
$langues = array(self::getDefaultLanguage());
/**
* @return bool
*/
public static function isTranslationEnabled() {
return count(self::getLangues()) > 1;
}
foreach(explode(';', strtolower($langues_value)) as $langue)
$langues []= trim($langue);
return array_unique(array_filter($langues));
}
/**
* @return bool
*/
public static function isModuleEnabled($name) {
if (!$value = self::get($name)) {
return false;
}
public static function getLanguesWithoutDefault() {
return array_diff(self::getLangues(), array(self::getDefaultLanguage()));
}
return (1 == (int)$value);
}
/**
* @return bool
*/
public static function isTranslationEnabled() {
return count(self::getLangues()) > 1;
}
/**
* @return bool
*/
public static function isWorkflowEnabled() {
return self::isModuleEnabled('WORKFLOW');
}
/**
* @return bool
*/
public static function isModuleEnabled($name) {
if (!$value = self::get($name)) {
return false;
}
/**
* @return bool
*/
public static function isBibNumEnabled() {
return self::isModuleEnabled('BIBNUM');
}
return (1 == (int)$value);
}
/**
* @return bool
*/
public static function isFormationEnabled() {
return self::isModuleEnabled('FORMATIONS');
}
/**
* @return bool
*/
public static function isWorkflowEnabled() {
return self::isModuleEnabled('WORKFLOW');
}
public static function isLecturaEnabled() {
return '' != self::get('LECTURA_DOMAIN');
}
/**
* @return bool
*/
public static function isBibNumEnabled() {
return self::isModuleEnabled('BIBNUM');
}
public static function beModuleEnabled($module) {
self::set($module,1);
}
/**
* @return bool
*/
public static function isFormationEnabled() {
return self::isModuleEnabled('FORMATIONS');
}
/**
* @return bool
*/
public static function isVodeclicEnabled() {
return (('' != self::get('VODECLIC_KEY')) && ('' != self::get('VODECLIC_ID')) && ('' != self::get('VODECLIC_BIB_ID')));
}
public static function isLecturaEnabled() {
return '' != self::get('LECTURA_DOMAIN');
}
public static function isToutApprendreEnabled() {
return (('' != self::get('TOUTAPPRENDRE_BIB_ID')) && ('' != self::get('TOUTAPPRENDRE_KEY')));
}
public static function beModuleEnabled($module) {
self::set($module,1);
}
public static function isNumeriquePremiumEnabled() {
return '' != self::get('NUMERIQUE_PREMIUM_URL');
}
/**
* @return bool
*/
public static function isVodeclicEnabled() {
return (('' != self::get('VODECLIC_KEY')) && ('' != self::get('VODECLIC_ID')) && ('' != self::get('VODECLIC_BIB_ID')));
}
/**
* @return bool
*/
public static function isCVSEnabled() {
return (('' != self::get('CVS_BMKEY')) && ('' != self::get('CVS_BMID')) &&
('' != self::get('CVS_SOURCEPASSWORD')) && ('' != self::get('CVS_SOURCEKEY')) &&
('' != self::get('CVS_SOURCEID')) && ('' != self::get('CVS_SOURCENAME'))
);
}
public static function isToutApprendreEnabled() {
return (('' != self::get('TOUTAPPRENDRE_BIB_ID')) && ('' != self::get('TOUTAPPRENDRE_KEY')));
}
/**
* @return bool
*/
public static function isNumilogEnabled() {
return ('' != self::get('NUMILOG_URL') );
}
public static function isNumeriquePremiumEnabled() {
return '' != self::get('NUMERIQUE_PREMIUM_URL');
}
/**
* @return bool
*/
public static function isCyberlibrisEnabled() {
return ('' != self::get('CYBERLIBRIS_URL') );
}
/**
* @return bool
*/
public static function isCVSEnabled() {
return (('' != self::get('CVS_BMKEY')) && ('' != self::get('CVS_BMID')) &&
('' != self::get('CVS_SOURCEPASSWORD')) && ('' != self::get('CVS_SOURCEKEY')) &&
('' != self::get('CVS_SOURCEID')) && ('' != self::get('CVS_SOURCENAME'))
);
}
/**
* @return bool
*/
public static function isTypo3Enabled() {
return ('' != self::get('URL_TYPO3'));
}
/**
* @return bool
*/
public static function isNumilogEnabled() {
return ('' != self::get('NUMILOG_URL') );
}
/**
* @return bool
*/
public static function isCyberlibrisEnabled() {
return ('' != self::get('CYBERLIBRIS_URL') );
}
/**
* @return bool
*/
public static function isTypo3Enabled() {
return ('' != self::get('URL_TYPO3'));
}
/**
* @return bool
*/
public static function isOAIServerEnabled() {
return self::isModuleEnabled('OAI_SERVER');
}
/**
* @return bool
*/
public static function isPackMobileEnabled() {
return self::isModuleEnabled('PACK_MOBILE');
}
/**
* @return bool
*/
public static function isPlanningOuverturesEnabled() {
return self::isMultimediaEnabled();
}
/**
* @return bool
*/
public static function isArteVodEnabled() {
return (('' != self::get('ARTE_VOD_LOGIN'))
&& ('' != self::get('ARTE_VOD_KEY'))
&& ('' != self::get('ARTE_VOD_SSO_KEY')));
}
/**
* @return bool
*/
public static function isMusicMeEnabled() {
return ('' != self::get('MUSICME_URL'));
}
/**
* @return bool
*/
public static function isMultimediaEnabled() {
return ('' != self::get('MULTIMEDIA_KEY'));
}
/**
* @return bool
*/
public static function isWebkioskEnabled() {
return ('' != self::get('WEBKIOSK_KEY'));
}
public static function isLeKioskEnabled() {
return '' != self::get('LEKIOSK_ID');
}
/**
* @return bool
*/
public static function isBeforeDateLastFullIntegrationUsers($date) {
if ('' == self::get('DATE_LAST_FULL_INTEGRATION_USERS')) return true;
return $date >= self::get('DATE_LAST_FULL_INTEGRATION_USERS');
}
public static function isBoitePanierAutoEnabled() {
return self::isModuleEnabled('BOITE_PANIER_AUTO');
}
public static function getKnownVarsKeys() {
return array_keys(static::getKnownVars());
}
/**
* @return array
*/
public static function getKnownVars() {
if (null === self::$_knownVars)
self::$_knownVars = [
'AVIS_MAX_SAISIE' => 'Nombre de caractères maximum autorisé à saisir dans les avis.',
'AVIS_MIN_SAISIE' => 'Nombre de caractères minimum autorisé à saisir dans les avis.',
'BLOG_MAX_NB_CARAC' => 'Nombre de caractères maximum à afficher dans le bloc critiques.',
'NB_AFFICH_AVIS_PAR_AUTEUR' => 'Nombre d\'avis maximum à afficher par utilisateur.',
'CLEF_GOOGLE_MAP' => 'Clef d\'activation pour le plan d\'accès google map. <a target="_blank" href="http://code.google.com/apis/maps/signup.html">Obtenir la clé google map</a>',
'MODO_AVIS' => 'Modération des avis des lecteurs.<br /> 0 = Affichage sans attente de validation<br /> 1 = Affichage seulement après validation.',
'MODO_AVIS_BIBLIO' => 'Modération des avis des bibliothèquaires.<br /> 0 = Affichage sans attente de validation<br /> 1 = Affichage seulement après validation.',
'AVIS_BIB_SEULEMENT' => '0 = Les lecteurs peuvent donner leur avis. <br /> 1 = Seuls les bibliothèquaires peuvent donner leur avis',
'MODO_BLOG' => '0 = Ne requiert pas d\'identification pour saisir des commentaires. <br /> 1 = Requiert l\'identification pour saisir des commentaires.',
'REGISTER_OK' => 'Texte visible par l\'internaute après son inscription.',
'RESA_CONDITION' => 'Texte visible après l\'envoi d\'e-mail de demande de réservation.',
'SITE_OK' => '0 = Site en maintenance. <br /> 1 = Site ouvert.',
'ID_BIBLIOSURF' => 'Nom de la bibliothèque chez bibliosurf (en minuscules)',
'JS_STAT' => 'Javascript code for statistics',
'ID_READ_SPEAKER' => 'Numéro de client Read Speaker <a target="_blank" href="http://webreader.readspeaker.com">http://webreader.readspeaker.com</a>',
'BLUGA_API_KEY' => 'Clé API Bluga Webthumb <a target="_blank" href="http://webthumb.bluga.net/home">http://webthumb.bluga.net/home</a>',
'AIDE_FICHE_ABONNE' => 'Texte d\'aide affiché dans la fiche abonné',
'INTERDIRE_ENREG_UTIL' => 'Supprime l\'affichage du lien d\'enregistrement dans les différents formulaires de connexion et interdit l\'enregistrement d\'utilisateurs',
'LANGUES' => 'Liste des codes langue utilisées en plus du français séparées par des ;. Exemple: en;ro;es',
'CACHE_ACTIF' => implode('<br/>',
['Activer le cache des boîtes (meilleure performance mais mise à jour toutes les ' . ((int)Zend_Registry::get('cache')->getOption('lifetime')) / 60 . 'mn)',
'0 = inactif',
'1 = actif',
sprintf('<a href="%s" >Vider le cache</a>',
Class_Url::assemble(['module' => 'admin',
/**
* @return bool
*/
public static function isOAIServerEnabled() {
return self::isModuleEnabled('OAI_SERVER');
}
/**
* @return bool
*/
public static function isPackMobileEnabled() {
return self::isModuleEnabled('PACK_MOBILE');
}
/**
* @return bool
*/
public static function isPlanningOuverturesEnabled() {
return self::isMultimediaEnabled();
}
/**
* @return bool
*/
public static function isArteVodEnabled() {
return (('' != self::get('ARTE_VOD_LOGIN'))
&& ('' != self::get('ARTE_VOD_KEY'))
&& ('' != self::get('ARTE_VOD_SSO_KEY')));
}
/**
* @return bool
*/
public static function isMusicMeEnabled() {
return ('' != self::get('MUSICME_URL'));
}
/**
* @return bool
*/
public static function isMultimediaEnabled() {
return ('' != self::get('MULTIMEDIA_KEY'));
}
/**
* @return bool
*/
public static function isWebkioskEnabled() {
return ('' != self::get('WEBKIOSK_KEY'));
}
public static function isLeKioskEnabled() {
return '' != self::get('LEKIOSK_ID');
}
/**
* @return bool
*/
public static function isBeforeDateLastFullIntegrationUsers($date) {
if ('' == self::get('DATE_LAST_FULL_INTEGRATION_USERS')) return true;
return $date >= self::get('DATE_LAST_FULL_INTEGRATION_USERS');
}
public static function isBoitePanierAutoEnabled() {
return self::isModuleEnabled('BOITE_PANIER_AUTO');
}
public static function getKnownVarsKeys() {
return array_keys(static::getKnownVars());
}
/**
* @return array
*/
public static function getKnownVars() {
if (null === self::$_knownVars)
self::$_knownVars = [
'AVIS_MAX_SAISIE' => 'Nombre de caractères maximum autorisé à saisir dans les avis.',
'AVIS_MIN_SAISIE' => 'Nombre de caractères minimum autorisé à saisir dans les avis.',
'BLOG_MAX_NB_CARAC' => 'Nombre de caractères maximum à afficher dans le bloc critiques.',
'NB_AFFICH_AVIS_PAR_AUTEUR' => 'Nombre d\'avis maximum à afficher par utilisateur.',
'CLEF_GOOGLE_MAP' => 'Clef d\'activation pour le plan d\'accès google map. <a target="_blank" href="http://code.google.com/apis/maps/signup.html">Obtenir la clé google map</a>',
'MODO_AVIS' => 'Modération des avis des lecteurs.<br /> 0 = Affichage sans attente de validation<br /> 1 = Affichage seulement après validation.',
'MODO_AVIS_BIBLIO' => 'Modération des avis des bibliothèquaires.<br /> 0 = Affichage sans attente de validation<br /> 1 = Affichage seulement après validation.',
'AVIS_BIB_SEULEMENT' => '0 = Les lecteurs peuvent donner leur avis. <br /> 1 = Seuls les bibliothèquaires peuvent donner leur avis',
'MODO_BLOG' => '0 = Ne requiert pas d\'identification pour saisir des commentaires. <br /> 1 = Requiert l\'identification pour saisir des commentaires.',
'REGISTER_OK' => 'Texte visible par l\'internaute après son inscription.',
'RESA_CONDITION' => 'Texte visible après l\'envoi d\'e-mail de demande de réservation.',
'SITE_OK' => '0 = Site en maintenance. <br /> 1 = Site ouvert.',
'ID_BIBLIOSURF' => 'Nom de la bibliothèque chez bibliosurf (en minuscules)',
'JS_STAT' => 'Javascript code for statistics',
'ID_READ_SPEAKER' => 'Numéro de client Read Speaker <a target="_blank" href="http://webreader.readspeaker.com">http://webreader.readspeaker.com</a>',
'BLUGA_API_KEY' => 'Clé API Bluga Webthumb <a target="_blank" href="http://webthumb.bluga.net/home">http://webthumb.bluga.net/home</a>',
'AIDE_FICHE_ABONNE' => 'Texte d\'aide affiché dans la fiche abonné',
'INTERDIRE_ENREG_UTIL' => 'Supprime l\'affichage du lien d\'enregistrement dans les différents formulaires de connexion et interdit l\'enregistrement d\'utilisateurs',
'LANGUES' => 'Liste des codes langue utilisées en plus du français séparées par des ;. Exemple: en;ro;es',
'CACHE_ACTIF' => implode('<br/>',
['Activer le cache des boîtes (meilleure performance mais mise à jour toutes les ' . ((int)Zend_Registry::get('cache')->getOption('lifetime')) / 60 . 'mn)',
'0 = inactif',
'1 = actif',
sprintf('<a href="%s" >Vider le cache</a>',
Class_Url::assemble(['module' => 'admin',
'action' => 'clearcache']))]),
'WORKFLOW' => 'Activer ou désactiver la gestion des validations des articles<br />1 = Activé, Autre valeur = désactivé',
'WORKFLOW_TEXT_MAIL_ARTICLE_PENDING' => 'Contenu de l\'email de notification d\'article en attente de validation',
......@@ -364,7 +364,8 @@ class Class_AdminVar extends Storm_Model_Abstract {
'EXTRA_SKIN_PATH' => 'Chemin vers les skins personnalisées, relatif à ' . Class_Profil_Skin::EXTRA_PATH,
'ENABLE_COLLABORATIVE_BROWSING' => 'Activation de la navigation collaborative. 0 = inactif, 1 = actif',
'KOHA_MULTI_SITES' => 'WS KOHA : Reservation d\'exemplaires pour les multi sites. 0 = inactif, 1 = actif',
'LEKIOSK_ID' => 'Identifiant fournit par lekiosk.com'
'LEKIOSK_ID' => 'Identifiant fournit par lekiosk.com',
'LECTURA_DOMAIN' => 'Domaine utilisée par le serveur lectura pour authentification'
];
return self::$_knownVars;
}
......
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