Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
bbc60722
Commit
bbc60722
authored
Feb 11, 2019
by
Laurent Lécluse
Browse files
Mise en place de la nouvelle config pour les formules de calcul
parent
c4198f55
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
data/Mises à jour/08.1.sql
View file @
bbc60722
This diff is collapsed.
Click to expand it.
module/Application/config/formule.config.php
View file @
bbc60722
...
...
@@ -28,6 +28,9 @@ return [
],
'service_manager'
=>
[
'factories'
=>
[
Service\FormuleService
::
class
=>
Service\Factory\FormuleServiceFactory
::
class
,
],
'invokables'
=>
[
Service\FormuleResultatService
::
class
=>
Service\FormuleResultatService
::
class
,
Service\FormuleResultatServiceService
::
class
=>
Service\FormuleResultatServiceService
::
class
,
...
...
module/Application/src/Application/Entity/Db/Formule.php
0 → 100644
View file @
bbc60722
<?php
namespace
Application\Entity\Db
;
/**
* Formule
*/
class
Formule
{
/**
* @var integer
*/
protected
$id
;
/**
* @var string
*/
protected
$libelle
;
/**
* @var string
*/
protected
$packageName
;
/**
* @var string
*/
protected
$procedureName
;
/**
* Get id
*
* @return integer
*/
public
function
getId
()
{
return
$this
->
id
;
}
/**
* @return string
*/
public
function
getLibelle
()
{
return
$this
->
libelle
;
}
/**
* @param string $libelle
*
* @return Formule
*/
public
function
setLibelle
(
string
$libelle
):
Formule
{
$this
->
libelle
=
$libelle
;
return
$this
;
}
/**
* @return string
*/
public
function
getPackageName
()
{
return
$this
->
packageName
;
}
/**
* @param string $packageName
*
* @return Formule
*/
public
function
setPackageName
(
string
$packageName
):
Formule
{
$this
->
packageName
=
$packageName
;
return
$this
;
}
/**
* @return string
*/
public
function
getProcedureName
()
{
return
$this
->
procedureName
;
}
/**
* @param string $procedureName
*
* @return Formule
*/
public
function
setProcedureName
(
string
$procedureName
):
Formule
{
$this
->
procedureName
=
$procedureName
;
return
$this
;
}
/**
* Retourne la représentation littérale de cet objet.
*
* @return string
*/
public
function
__toString
()
{
return
$this
->
getLibelle
();
}
}
module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Formule.dcm.xml
0 → 100644
View file @
bbc60722
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping
xmlns=
"http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
>
<entity
name=
"Application\Entity\Db\Formule"
table=
"FORMULE"
>
<id
name=
"id"
type=
"integer"
column=
"ID"
>
<generator
strategy=
"SEQUENCE"
/>
</id>
<field
name=
"libelle"
type=
"string"
column=
"LIBELLE"
length=
"100"
nullable=
"false"
/>
<field
name=
"packageName"
type=
"string"
column=
"PACKAGE_NAME"
length=
"30"
nullable=
"false"
/>
<field
name=
"procedureName"
type=
"string"
column=
"PROCEDURE_NAME"
length=
"30"
nullable=
"false"
/>
</entity>
</doctrine-mapping>
module/Application/src/Application/Form/ParametresForm.php
View file @
bbc60722
...
...
@@ -6,6 +6,7 @@ use Application\Entity\Db\Parametre;
use
Application\Service\Traits\AnneeServiceAwareTrait
;
use
Application\Service\Traits\DomaineFonctionnelServiceAwareTrait
;
use
Application\Service\Traits\EtatSortieServiceAwareTrait
;
use
Application\Service\Traits\FormuleServiceAwareTrait
;
use
Application\Service\Traits\PaysServiceAwareTrait
;
use
Application\Service\Traits\ScenarioServiceAwareTrait
;
use
Application\Service\Traits\StructureServiceAwareTrait
;
...
...
@@ -28,6 +29,7 @@ class ParametresForm extends AbstractForm
use
PaysServiceAwareTrait
;
use
StructureServiceAwareTrait
;
use
EtatSortieServiceAwareTrait
;
use
FormuleServiceAwareTrait
;
public
function
init
()
{
...
...
@@ -138,18 +140,14 @@ class ParametresForm extends AbstractForm
$this
->
add
(
$etablissement
);
$this
->
add
([
'
name'
=>
'formule_function_name
'
,
'
type'
=>
'Text
'
,
'options'
=>
[
'
label'
=>
'Fonction'
,
'
type'
=>
'Select
'
,
'
name'
=>
'formule
'
,
'options'
=>
[
'
value_options'
=>
Util
::
collectionAsOptions
(
$this
->
getServiceFormule
()
->
getList
())
,
],
]);
$this
->
add
([
'name'
=>
'formule_package_name'
,
'type'
=>
'Text'
,
'options'
=>
[
'label'
=>
'Package Oracle'
,
'attributes'
=>
[
'class'
=>
'selectpicker'
,
'data-live-search'
=>
'true'
],
]);
...
...
module/Application/src/Application/Service/Factory/FormuleServiceFactory.php
0 → 100755
View file @
bbc60722
<?php
namespace
Application\Service\Factory
;
use
Application\Constants
;
use
Zend\ServiceManager\ServiceLocatorInterface
as
ContainerInterface
;
use
Application\Service\FormuleService
;
/**
* Description of FormuleServiceFactory
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*/
class
FormuleServiceFactory
{
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
*
* @return FormuleService
*/
public
function
__invoke
(
ContainerInterface
$container
,
$requestedName
,
$options
=
null
)
{
$service
=
new
FormuleService
;
$service
->
setEntityManager
(
$container
->
get
(
Constants
::
BDD
));
return
$service
;
}
}
\ No newline at end of file
module/Application/src/Application/Service/FormuleService.php
0 → 100755
View file @
bbc60722
<?php
namespace
Application\Service
;
use
Application\Entity\Db\Formule
;
/**
* Description of FormuleService
*
* @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
*
* @method Formule get($id)
* @method Formule[] getList(\Doctrine\ORM\QueryBuilder $qb = null, $alias = null)
* @method Formule newEntity()
*
*/
class
FormuleService
extends
AbstractEntityService
{
/**
* retourne la classe des entités
*
* @return string
* @throws RuntimeException
*/
public
function
getEntityClass
()
{
return
Formule
::
class
;
}
/**
* Retourne l'alias d'entité courante
*
* @return string
*/
public
function
getAlias
(){
return
'formule'
;
}
}
\ No newline at end of file
module/Application/src/Application/Service/Traits/FormuleServiceAwareTrait.php
0 → 100755
View file @
bbc60722
<?php
namespace
Application\Service\Traits
;
use
Application\Service\FormuleService
;
/**
* Description of FormuleServiceAwareTrait
*
* @author UnicaenCode
*/
trait
FormuleServiceAwareTrait
{
/**
* @var FormuleService
*/
protected
$serviceFormule
;
/**
* @param FormuleService $serviceFormule
* @return self
*/
public
function
setServiceFormule
(
FormuleService
$serviceFormule
)
{
$this
->
serviceFormule
=
$serviceFormule
;
return
$this
;
}
/**
* @return FormuleService
*/
public
function
getServiceFormule
()
:
FormuleService
{
if
(
!
$this
->
serviceFormule
){
$this
->
serviceFormule
=
\
Application
::
$container
->
get
(
FormuleService
::
class
);
}
return
$this
->
serviceFormule
;
}
}
\ No newline at end of file
module/Application/view/application/parametre/generaux.phtml
View file @
bbc60722
...
...
@@ -107,11 +107,8 @@
</div>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<?=
$this
->
formControlGroup
(
$form
->
get
(
'formule_package_name'
));
?>
</div>
<div
class=
"col-md-6"
>
<?=
$this
->
formControlGroup
(
$form
->
get
(
'formule_function_name'
));
?>
<div
class=
"col-md-12"
>
<?=
$this
->
formControlGroup
(
$form
->
get
(
'formule'
));
?>
</div>
</div>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment