Commit df87f7b9 authored by Ghislain Loas's avatar Ghislain Loas

CIP #57952 wip

parent b4bebbaa
Pipeline #919 failed with stage
in 11 minutes and 33 seconds
......@@ -2,7 +2,7 @@
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* BOKEH 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.
*
......@@ -21,7 +21,7 @@
// Run Bokeh installer if not configured
if ((!file_exists('local.php') || !file_exists('config.ini') || !file_exists('cosmogramme/config.php')) && file_exists('scripts/install-bokeh.php')) {
include('scripts/install-bokeh.php');
include('scripts/install-bokeh.php');
}
require('includes.php');
......
......@@ -19,15 +19,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneAvis extends Class_Systeme_ModulesMenu_Null{
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'ABON_AVIS',
$_isPhone = false,
$_url = ['controller' => 'abonne',
'action' => 'viewavis'];
'action' => 'viewavis'];
public function __construct() {
$this->_libelle = $this->_('Derniers avis');
$this->_form = 'ZendAfi_Form_Configuration_RatingWidget';
}
}
\ No newline at end of file
......@@ -18,16 +18,17 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneCards extends Class_Systeme_ModulesMenu_Null {
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'ABON_CARDS',
$_url = ['controller' => 'abonne',
'action' => 'cards'];
public function __construct() {
$this->_libelle = $this->_('Cartes');
$this->_form = 'ZendAfi_Form_Configuration_CardsWidget';
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneFiche extends Class_Systeme_ModulesMenu_Null {
protected
......@@ -29,6 +30,5 @@ class Class_Systeme_ModulesMenu_AbonneFiche extends Class_Systeme_ModulesMenu_Nu
public function __construct() {
$this->_libelle = $this->_('Fiche abonné');
$this->_form = 'ZendAfi_Form_Configuration_UserWidget';
}
}
\ No newline at end of file
......@@ -18,23 +18,22 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneFormations extends Class_Systeme_ModulesMenu_Null {
/** @var string */
protected $_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES;
/** @var string */
protected $_type_module = 'ABON_FORMATIONS';
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'ABON_FORMATIONS',
$_url = ['controller' => 'formations',
'action' => 'index'];
/** @var string */
protected $_libelle = 'Formations';
/** @var string */
protected $_url = ['controller' => 'formations',
'action' => 'index'];
public function __construct() {
$this->_libelle = $this->_('Formations');
}
public function isVisibleForProfil($profil) {
return Class_AdminVar::isFormationEnabled();
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneModificationFiche extends Class_Systeme_ModulesMenu_Null {
protected
......@@ -29,6 +30,5 @@ class Class_Systeme_ModulesMenu_AbonneModificationFiche extends Class_Systeme_Mo
public function __construct() {
$this->_libelle = $this->_('Modifier ma fiche');
$this->_form = 'ZendAfi_Form_Configuration_UserEditWidget';
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonnePrets extends Class_Systeme_ModulesMenu_Null {
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
......@@ -28,6 +29,5 @@ class Class_Systeme_ModulesMenu_AbonnePrets extends Class_Systeme_ModulesMenu_Nu
public function __construct() {
$this->_libelle = $this->_('Prêts en cours');
$this->_form = 'ZendAfi_Form_Configuration_LoansWidget';
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_AbonneReservations extends Class_Systeme_ModulesMenu_Null {
protected
......@@ -29,6 +30,5 @@ class Class_Systeme_ModulesMenu_AbonneReservations extends Class_Systeme_Modules
public function __construct() {
$this->_libelle = $this->_('Réservations en cours');
$this->_form = 'ZendAfi_Form_Configuration_HoldsWidget';
}
}
\ No newline at end of file
......@@ -32,6 +32,5 @@ class Class_Systeme_ModulesMenu_Accueil extends Class_Systeme_ModulesMenu_Null {
public function __construct() {
$this->_libelle = $this->_('Retour à l\'accueil');
$this->_form = 'ZendAfi_Form_Configuration_Menu_Home';
}
}
\ No newline at end of file
......@@ -18,15 +18,17 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_ArteVOD extends Class_Systeme_ModulesMenu_SSOAbstract {
/** @var string */
protected $_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES;
/** @var string */
protected $_type_module = 'ArteVod';
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'ArteVod';
/** @var string */
protected $_libelle = 'Lien vers ArteVod';
public function __construct() {
$this->_libelle = $this->_('Lien vers ArteVod');
}
public function getArteVodUrlForUser($user) {
......@@ -63,4 +65,4 @@ class Class_Systeme_ModulesMenu_ArteVOD extends Class_Systeme_ModulesMenu_SSOAbs
public function isVisibleForProfil($profil) {
return Class_AdminVar::isArteVODEnabled();
}
}
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ class Class_Systeme_ModulesMenu_Avis extends Class_Systeme_ModulesMenu_Null{
public function __construct() {
$this->_libelle = $this->_('Les avis les plus récents');
$this->_form = 'ZendAfi_Form_Configuration_LastReviewsWidget';
$this->_form = 'ZendAfi_Form_Configuration_Menu_LastReviews';
}
......
......@@ -18,6 +18,7 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_BibliothequeNumerique extends Class_Systeme_ModulesMenu_Null {
protected
......@@ -31,7 +32,7 @@ class Class_Systeme_ModulesMenu_BibliothequeNumerique extends Class_Systeme_Modu
public function __construct() {
$this->_libelle = $this->_('Lien vers un album');
$this->_form = 'ZendAfi_Form_Configuration_AlbumWidget';
$this->_form = 'ZendAfi_Form_Configuration_Menu_Album';
}
......
......@@ -18,17 +18,18 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_CVS extends Class_Systeme_ModulesMenu_SSOAbstract {
/** @var string */
protected $_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES;
/** @var string */
protected $_type_module = 'CVS';
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_ABONNES,
$_type_module = 'CVS',
$_doc_id = null;
/** @var string */
protected $_libelle = 'Lien vers CVS';
protected $_doc_id = null;
public function __construct() {
$this->_libelle = $this->_('Lien vers CVS');
}
public function getCVSUrlForUser($user) {
......
......@@ -18,7 +18,9 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_Catalogue extends Class_Systeme_ModulesMenu_Null{
class Class_Systeme_ModulesMenu_Catalogue extends Class_Systeme_ModulesMenu_Null {
protected
$_group = Class_Systeme_ModulesMenu::GROUP_MENU_CATALOGUES,
$_type_module = 'CATALOGUE',
......@@ -30,7 +32,8 @@ class Class_Systeme_ModulesMenu_Catalogue extends Class_Systeme_ModulesMenu_Null
public function __construct() {
$this->_libelle = $this->_('Domaine');
$this->_form = 'ZendAfi_Form_Configuration_DomainWidget';
$this->_form = 'ZendAfi_Form_Configuration_Menu_Domain';
$this->_defaultValues = ['titre' => $this->_('Catalogue'),
'nb_notices' => 20,
'aleatoire' => 1,
......
......@@ -18,7 +18,9 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_Null extends Class_Systeme_ModulesAccueil_Null {
protected
$_url = '',
$_message='',
......@@ -27,7 +29,8 @@ class Class_Systeme_ModulesMenu_Null extends Class_Systeme_ModulesAccueil_Null {
$_open_in_new_window = false,
$_popupWidth='550',
$_popupHeight='215',
$_type_module;
$_type_module,
$_form = 'ZendAfi_Form_Configuration_Menu_Entry';
public function getUrl($preferences=[]) {
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Form_Configuration_Menu_Album extends ZendAfi_Form_Configuration_Menu_Entry {
public function popupate($datas) {
$this
->addElement('select',
'album_id',
['label' => $this->_('Lien vers l\'album'),
'multipOptions' => $datas['albums']])
->removeDisplayGroup('menu_entry')
->addUniqDisplayGroup('menu_entry');
return parent::popupate($datas);
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Form_Configuration_Menu_Entry extends ZendAfi_Form {
public function init() {
parent::init();
$this
->addElement('text',
'libelle',
['label' => $this->_('Text du lien')])
->addElement('IcoPicker',
'picto',
['label' => $this->_('Icône du lien')])
->addElement('comboProfils',
'use_profil',
['label' => $this->_('Utiliser un profil particulier'),
'empty_option' => true])
->addUniqDisplayGroup('menu_entry');
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Form_Configuration_Menu_LastReviews extends ZendAfi_Form_Configuration_Menu_Entry {
public function init() {
parent::init();
$this
->addElement('text',
'nb',
['label' => $this->_('Nombre d\'avis afficher')])
->removeDisplayGroup('menu_entry')
->addUniqDisplayGroup('menu_entry');
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
include_once('tests/fixtures/RessourcesNumeriquesFixtures.php');
abstract class MenusNavSimpleTestCase extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
......@@ -275,17 +276,17 @@ class MenusEditNavPostReorderDispatchTest extends MenusNavSimpleTestCase {
class MenusDispatchAllMenusTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->fixture('Class_AdminVar',['id'=>'MENU_BOITE', 'valeur' => 1]);
}
public function entries() {
RessourcesNumeriquesFixtures::activateCVS();
$this->fixture('Class_AdminVar', ['id'=>'MENU_BOITE', 'valeur' => 1]);
$this->fixture('Class_AdminVar', ['id' => 'FORMATIONS', 'valeur' => 1]);
public function entries() {
$datas = [];
foreach((new Class_Systeme_ModulesMenu())->getEntries() as $menu)
$datas[] = [[$menu->getForm()],
[$menu->getLabel()]];
$datas[] = [$menu->getForm(),
$menu->getLabel()];
return $datas;
}
......@@ -305,6 +306,6 @@ class MenusDispatchAllMenusTest extends Admin_AbstractControllerTestCase {
* @test
*/
public function formsShouldExists($form, $definition) {
$this->assertNotNull(call_user_func_array([$form, 'new'], [[]]));
$this->assertNotNull(call_user_func([$form, 'newWith']));
}
}
\ No newline at end of file
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