Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libriciel
web-DPO
Commits
d9097b86
Commit
d9097b86
authored
May 03, 2018
by
Théo GUILLON
Browse files
Merge branch '14-co-responsabilite' into 'master'
Resolve "Co-responsabilité" See merge request web-DPO/web-DPO!15
parents
4a2254e0
cd77080c
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
app/Config/Schema/CreationBase/01-createbase.sql
View file @
d9097b86
...
...
@@ -56,10 +56,11 @@ CREATE TABLE organisations (
numerocil
VARCHAR
(
50
)
DEFAULT
NULL
,
verrouiller
BOOLEAN
NOT
NULL
DEFAULT
TRUE
,
force
INTEGER
NOT
NULL
DEFAULT
4
,
responsable_id
INTEGER
REFERENCES
responsables
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
CREATE
UNIQUE
INDEX
organisations_siret_idx
ON
organisations
(
siret
);
CREATE
UNIQUE
INDEX
organisations_raisonsociale_idx
ON
organisations
(
raisonsociale
);
ALTER
TABLE
organisations
ADD
CONSTRAINT
organisations_telephone_phone_chk
CHECK
(
cakephp_validate_phone
(
telephone
,
NULL
,
'fr'
)
);
...
...
@@ -182,6 +183,7 @@ CREATE TABLE fg_formulaires (
libelle
VARCHAR
(
50
)
NOT
NULL
,
active
BOOL
NOT
NULL
,
description
TEXT
,
soustraitant
BOOL
NOT
NULL
DEFAULT
FALSE
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
...
...
@@ -216,6 +218,9 @@ CREATE TABLE fiches (
organisation_id
integer
NOT
NULL
REFERENCES
organisations
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
norme_id
integer
REFERENCES
normes
(
id
)
ON
UPDATE
CASCADE
,
numero
VARCHAR
(
50
),
soustraitantid
INTEGER
DEFAULT
NULL
,
coresponsable
BOOL
NOT
NULL
DEFAULT
FALSE
,
coresponsableid
INTEGER
DEFAULT
NULL
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
...
...
@@ -462,10 +467,9 @@ CREATE TABLE crons (
);
--
-- Création de la table
f
ou
rnisseur
s
-- Création de la table
s
ou
straitant
s
--
CREATE
TABLE
soustraitants
(
CREATE
TABLE
soustraitants
(
id
serial
NOT
NULL
PRIMARY
KEY
,
raisonsociale
VARCHAR
(
75
)
NOT
NULL
,
siret
VARCHAR
(
14
)
NOT
NULL
,
...
...
@@ -486,7 +490,7 @@ ALTER TABLE soustraitants ADD CONSTRAINT soustraitants_fax_phone_chk CHECK ( cak
ALTER
TABLE
soustraitants
ADD
CONSTRAINT
soustraitants_email_email_chk
CHECK
(
cakephp_validate_email
(
email
)
);
--
-- Création de la table de jointure
F
ou
rnisseur
s Organisations
-- Création de la table de jointure
S
ou
straitant
s Organisations
--
CREATE
TABLE
soustraitants_organisations
(
id
SERIAL
PRIMARY
KEY
NOT
NULL
,
...
...
@@ -496,6 +500,47 @@ CREATE TABLE soustraitants_organisations (
CREATE
UNIQUE
INDEX
soustraitants_organisations_soustraitant_id_organisation_id_idx
ON
soustraitants_organisations
(
soustraitant_id
,
organisation_id
);
--
-- Création de la table responsables
--
CREATE
TABLE
responsables
(
id
serial
NOT
NULL
PRIMARY
KEY
,
nomresponsable
VARCHAR
(
50
)
NOT
NULL
,
prenomresponsable
VARCHAR
(
50
)
NOT
NULL
,
emailresponsable
VARCHAR
(
75
)
NOT
NULL
,
telephoneresponsable
VARCHAR
(
15
)
NOT
NULL
,
fonctionresponsable
VARCHAR
(
75
)
NOT
NULL
,
raisonsocialestructure
VARCHAR
(
75
)
NOT
NULL
,
siretstructure
VARCHAR
(
14
)
NOT
NULL
,
apestructure
VARCHAR
(
5
)
NOT
NULL
,
telephonestructure
VARCHAR
(
15
),
faxstructure
VARCHAR
(
15
),
adressestructure
TEXT
,
emailstructure
VARCHAR
(
75
),
createdbyorganisation
INT
DEFAULT
NULL
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
CREATE
UNIQUE
INDEX
responsables_siretstructure_idx
ON
responsables
(
siretstructure
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_apestructure_alpha_numeric_chk
CHECK
(
cakephp_validate_alpha_numeric
(
apestructure
)
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_telephonestructure_phone_chk
CHECK
(
cakephp_validate_phone
(
telephonestructure
,
NULL
,
'fr'
)
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_faxstructure_phone_chk
CHECK
(
cakephp_validate_phone
(
faxstructure
,
NULL
,
'fr'
)
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_emailstructure_email_chk
CHECK
(
cakephp_validate_email
(
emailstructure
)
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_telephoneresponsable_phone_chk
CHECK
(
cakephp_validate_phone
(
telephoneresponsable
,
NULL
,
'fr'
)
);
ALTER
TABLE
responsables
ADD
CONSTRAINT
responsables_emailresponsable_email_chk
CHECK
(
cakephp_validate_email
(
emailresponsable
)
);
--
-- Création de la table de jointure Responsables Organisations
--
CREATE
TABLE
responsables_organisations
(
id
SERIAL
PRIMARY
KEY
NOT
NULL
,
responsable_id
INTEGER
NOT
NULL
REFERENCES
responsables
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
organisation_id
INTEGER
NOT
NULL
REFERENCES
organisations
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
);
CREATE
UNIQUE
INDEX
responsables_organisations_soustraitant_id_organisation_id_idx
ON
responsables_organisations
(
responsable_id
,
organisation_id
);
-- INFO: voir http://postgresql.developpez.com/sources/?page=chaines
CREATE
OR
REPLACE
FUNCTION
"public"
.
"noaccents_upper"
(
text
)
RETURNS
text
AS
$
body
$
...
...
app/Config/Schema/CreationBase/03-alterTable.sql
deleted
100755 → 0
View file @
4a2254e0
BEGIN
;
ALTER
TABLE
fg_formulaires
ADD
soustraitant
BOOL
NOT
NULL
DEFAULT
FALSE
;
COMMIT
;
\ No newline at end of file
app/Config/bootstrap.php
View file @
d9097b86
...
...
@@ -60,7 +60,8 @@ Inflector::rules('plural', array(
'irregular'
=>
array
(
'fiche'
=>
'fiches'
,
'organisation_user'
=>
'organisations_users'
,
'soustraitant_organisation'
=>
'soustraitants_organisations'
'soustraitant_organisation'
=>
'soustraitants_organisations'
,
'responsable_organisation'
=>
'responsables_organisations'
),
'uninflected'
=>
array
()
));
...
...
app/Controller/FichesController.php
View file @
d9097b86
...
...
@@ -32,6 +32,8 @@ class FichesController extends AppController {
];
public
$uses
=
[
'Responsable'
,
'ResponsableOrganisation'
,
'EtatFiche'
,
'Extrait'
,
'ExtraitRegistre'
,
...
...
@@ -271,32 +273,12 @@ class FichesController extends AppController {
]);
$this
->
set
(
compact
(
'soustraitance'
));
$soustraitants
=
null
;
$condition
=
[];
$query
=
[
'conditions'
=>
$condition
,
'order'
=>
[
'Soustraitant.raisonsociale ASC'
]
];
$subQuery
=
[
'alias'
=>
'soustraitants_organisations'
,
'fields'
=>
[
'soustraitants_organisations.soustraitant_id'
],
'conditions'
=>
[
'soustraitants_organisations.organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
)
]
];
$sql
=
$this
->
SoustraitantOrganisation
->
sql
(
$subQuery
);
$query
[
'conditions'
][]
=
"Soustraitant.id IN (
{
$sql
}
)"
;
$soustraitants
=
$this
->
Soustraitant
->
find
(
'all'
,
[
$query
]);
$soustraitants
=
$this
->
_soustraitants
();
$this
->
set
(
compact
(
'soustraitants'
));
$responsables
=
$this
->
_responsables
();
$this
->
set
(
compact
(
'responsables'
));
if
(
$this
->
request
->
is
(
'POST'
))
{
if
(
'Cancel'
===
Hash
::
get
(
$this
->
request
->
data
,
'submit'
))
{
if
(
!
empty
(
$this
->
Session
->
read
(
'Auth.User.uuid'
))){
...
...
@@ -306,6 +288,22 @@ class FichesController extends AppController {
$this
->
redirect
(
$this
->
Referers
->
get
());
}
if
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
==
false
)
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'nomcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'prenomcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'fonctioncoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'emailcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'telephonecoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'raisonsocialestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'siretstructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'apestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'telephonestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'faxstructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'adressestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'emailstructure'
]
=
null
;
}
$success
=
true
;
$this
->
Fiche
->
begin
();
...
...
@@ -313,7 +311,10 @@ class FichesController extends AppController {
'user_id'
=>
$this
->
Auth
->
user
(
'id'
),
'form_id'
=>
$this
->
request
->
data
[
'Fiche'
][
'formulaire_id'
],
'organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
),
'norme_id'
=>
$this
->
request
->
data
[
'Fiche'
][
'norme'
]
'norme_id'
=>
$this
->
request
->
data
[
'Fiche'
][
'norme'
],
'soustraitantid'
=>
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
],
'coresponsable'
=>
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
],
'coresponsableid'
=>
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]
]);
$success
=
$success
&&
false
!==
$this
->
Fiche
->
save
();
...
...
@@ -325,6 +326,20 @@ class FichesController extends AppController {
unset
(
$this
->
request
->
data
[
'Fiche'
][
'descriptionNorme'
]);
}
if
(
isset
(
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
]))
{
unset
(
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
]);
}
if
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
==
true
)
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
=
'Oui'
;
}
else
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
=
'Non'
;
}
if
(
isset
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]))
{
unset
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]);
}
if
(
$success
==
true
)
{
$last
=
$this
->
Fiche
->
getLastInsertID
();
// $success = $success && false !== $this->Fichier->saveFichier($this->request->data, $last);
...
...
@@ -391,6 +406,61 @@ class FichesController extends AppController {
}
}
protected
function
_responsables
()
{
$condition
=
[];
$query
=
[
'conditions'
=>
$condition
,
'order'
=>
[
'Responsable.raisonsocialestructure ASC'
]
];
$subQuery
=
[
'alias'
=>
'responsables_organisations'
,
'fields'
=>
[
'responsables_organisations.responsable_id'
],
'conditions'
=>
[
'responsables_organisations.responsable_id = Responsable.id'
,
'responsables_organisations.organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
)
]
];
$sql
=
$this
->
ResponsableOrganisation
->
sql
(
$subQuery
);
$query
[
'conditions'
][]
=
"Responsable.id IN (
{
$sql
}
)"
;
$responsables
=
$this
->
Responsable
->
find
(
'all'
,
$query
);
return
$responsables
;
}
protected
function
_soustraitants
()
{
$soustraitants
=
[];
$condition
=
[];
$query
=
[
'conditions'
=>
$condition
,
'order'
=>
[
'Soustraitant.raisonsociale ASC'
]
];
$subQuery
=
[
'alias'
=>
'soustraitants_organisations'
,
'fields'
=>
[
'soustraitants_organisations.soustraitant_id'
],
'conditions'
=>
[
'soustraitants_organisations.organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
)
]
];
$sql
=
$this
->
SoustraitantOrganisation
->
sql
(
$subQuery
);
$query
[
'conditions'
][]
=
"Soustraitant.id IN (
{
$sql
}
)"
;
$soustraitants
=
$this
->
Soustraitant
->
find
(
'all'
,
$query
);
return
$soustraitants
;
}
/**
* Gère la suppression de traitement
*
...
...
@@ -528,32 +598,14 @@ class FichesController extends AppController {
]);
$this
->
set
(
compact
(
'soustraitance'
));
$soustraitants
=
null
;
$condition
=
[];
$query
=
[
'conditions'
=>
$condition
,
'order'
=>
[
'Soustraitant.raisonsociale ASC'
]
];
$subQuery
=
[
'alias'
=>
'soustraitants_organisations'
,
'fields'
=>
[
'soustraitants_organisations.soustraitant_id'
],
'conditions'
=>
[
'soustraitants_organisations.organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
)
]
];
$sql
=
$this
->
SoustraitantOrganisation
->
sql
(
$subQuery
);
$query
[
'conditions'
][]
=
"Soustraitant.id IN (
{
$sql
}
)"
;
$soustraitants
=
$this
->
Soustraitant
->
find
(
'all'
,
[
$query
]);
$soustraitants
=
$this
->
_soustraitants
();
$this
->
set
(
compact
(
'soustraitants'
));
$this
->
set
(
'soustraitantid'
,
$idForm
[
'Fiche'
][
'soustraitantid'
]);
$responsables
=
$this
->
_responsables
();
$this
->
set
(
compact
(
'responsables'
));
$this
->
set
(
'coresponsableid'
,
$idForm
[
'Fiche'
][
'coresponsableid'
]);
// Si on sauvegarde
if
(
$this
->
request
->
is
([
'post'
,
'put'
]))
{
if
(
'Cancel'
===
Hash
::
get
(
$this
->
request
->
data
,
'submit'
))
{
...
...
@@ -564,12 +616,31 @@ class FichesController extends AppController {
$this
->
redirect
(
$this
->
Referers
->
get
());
}
if
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
==
false
)
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'nomcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'prenomcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'fonctioncoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'emailcoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'telephonecoresponsable'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'raisonsocialestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'siretstructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'apestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'telephonestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'faxstructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'adressestructure'
]
=
null
;
$this
->
request
->
data
[
'Fiche'
][
'emailstructure'
]
=
null
;
}
$success
=
true
;
$this
->
Valeur
->
begin
();
$this
->
Fiche
->
id
=
$id
;
$success
=
$success
&&
$this
->
Fiche
->
save
([
'norme_id'
=>
$this
->
request
->
data
[
'Fiche'
][
'norme'
]
'norme_id'
=>
$this
->
request
->
data
[
'Fiche'
][
'norme'
],
'soustraitantid'
=>
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
],
'coresponsable'
=>
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
],
'coresponsableid'
=>
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]
])
!==
false
;
if
(
isset
(
$this
->
request
->
data
[
'Fiche'
][
'norme'
]))
{
...
...
@@ -580,6 +651,20 @@ class FichesController extends AppController {
unset
(
$this
->
request
->
data
[
'Fiche'
][
'descriptionNorme'
]);
}
if
(
isset
(
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
]))
{
unset
(
$this
->
request
->
data
[
'Fiche'
][
'soustraitantid'
]);
}
if
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
==
true
)
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
=
'Oui'
;
}
else
{
$this
->
request
->
data
[
'Fiche'
][
'coresponsable'
]
=
'Non'
;
}
if
(
isset
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]))
{
unset
(
$this
->
request
->
data
[
'Fiche'
][
'coresponsableid'
]);
}
if
(
$success
==
true
)
{
// On récupère les infos des fichier déjà présent avant de les supprimer
// $files = $this->Valeur->find('first', [
...
...
@@ -796,6 +881,8 @@ class FichesController extends AppController {
]
]);
$this
->
set
(
compact
(
'files'
));
$this
->
set
(
'coresponsable'
,
$idForm
[
'Fiche'
][
'coresponsable'
]);
}
/**
...
...
@@ -1288,7 +1375,8 @@ class FichesController extends AppController {
'Fiche.id'
,
'Fiche.form_id'
,
'Fiche.norme_id'
,
'Fiche.numero'
'Fiche.numero'
,
'Fiche.coresponsable'
],
'conditions'
=>
[
'Fiche.id'
=>
$ids
...
...
@@ -1296,7 +1384,8 @@ class FichesController extends AppController {
'contain'
=>
[
'Formulaire'
=>
[
'fields'
=>
[
'Formulaire.libelle'
'Formulaire.libelle'
,
'Formulaire.soustraitant'
,
],
'Champ'
=>
[
'fields'
=>
[
...
...
@@ -1324,7 +1413,7 @@ class FichesController extends AppController {
$csv
=
[];
foreach
(
$traitements
as
$traitement
)
{
$champs
=
Hash
::
extract
(
$traitement
[
'Formulaire'
],
'Champ.details'
);
$champs
=
Hash
::
extract
(
$traitement
[
'Formulaire'
],
'Champ.
{n}.
details'
);
$names
=
Hash
::
extract
(
$traitement
[
'Valeur'
],
'{n}.champ_name'
);
$valeurs
=
Hash
::
extract
(
$traitement
[
'Valeur'
],
'{n}.valeur'
);
...
...
app/Controller/OrganisationsController.php
View file @
d9097b86
...
...
@@ -30,6 +30,7 @@ class OrganisationsController extends AppController {
'Organisation'
,
'OrganisationUser'
,
'OrganisationUserRoles'
,
'Responsable'
,
'Role'
,
'RoleDroit'
,
'User'
...
...
@@ -80,15 +81,20 @@ class OrganisationsController extends AppController {
$this
->
redirect
(
$this
->
Referers
->
get
());
}
$success
=
fals
e
;
$success
=
tru
e
;
$this
->
Organisation
->
begin
();
$recup
=
$this
->
Organisation
->
saveAddEditForm
(
$this
->
request
->
data
);
if
(
is_array
(
$recup
))
{
$idOrganisation
=
$this
->
Organisation
->
getInsertID
();
$success
=
$this
->
_insertRoles
(
$idOrganisation
);
$success
=
$this
->
_insertResponsable
(
$idOrganisation
);
debug
(
$success
);
if
(
$success
==
true
)
{
$success
=
$this
->
_insertRoles
(
$idOrganisation
);
}
if
(
$success
==
true
)
{
$success
=
$this
->
_insertTacheAuto
(
$idOrganisation
);
...
...
@@ -584,6 +590,60 @@ class OrganisationsController extends AppController {
}
}
/**
* Création du responsable lors de la création d'une nouvelle entité
*
* @param int $idOrganisation | id de l'organisation créé
* @return type
*/
protected
function
_insertResponsable
(
$idOrganisation
)
{
$responsable
=
$this
->
Responsable
->
find
(
'first'
,
[
'conditions'
=>
[
'siret'
=>
$this
->
request
->
data
(
'Organisation.siret'
)
]
]);
if
(
empty
(
$responsable
))
{
$success
=
true
;
$this
->
Responsable
->
begin
();
$this
->
Responsable
->
create
([
'nomresponsable'
=>
$this
->
request
->
data
(
'Organisation.nomresponsable'
)
,
'prenomresponsable'
=>
$this
->
request
->
data
(
'Organisation.prenomresponsable'
),
'emailresponsable'
=>
$this
->
request
->
data
(
'Organisation.emailresponsable'
),
'telephoneresponsable'
=>
$this
->
request
->
data
(
'Organisation.telephoneresponsable'
),
'fonctionresponsable'
=>
$this
->
request
->
data
(
'Organisation.fonctionresponsable'
),
'raisonsocialestructure'
=>
$this
->
request
->
data
(
'Organisation.raisonsociale'
),
'siretstructure'
=>
$this
->
request
->
data
(
'Organisation.siret'
),
'apestructure'
=>
$this
->
request
->
data
(
'Organisation.ape'
),
'telephonestructure'
=>
$this
->
request
->
data
(
'Organisation.telephone'
),
'faxstructure'
=>
$this
->
request
->
data
(
'Organisation.fax'
),
'adressestructure'
=>
$this
->
request
->
data
(
'Organisation.adresse'
),
'emailstructure'
=>
$this
->
request
->
data
(
'Organisation.email'
),
'createdbyorganisation'
=>
$idOrganisation
]);
$success
=
$success
&&
false
!==
$this
->
Responsable
->
save
();
if
(
$success
==
true
)
{
$success
=
$success
&&
$this
->
Organisation
->
updateAll
([
'responsable_id'
=>
$this
->
Responsable
->
id
],
[
'id'
=>
$idOrganisation
])
!==
false
;
}
if
(
$success
==
true
)
{
$this
->
Responsable
->
commit
();
return
(
true
);
}
else
{
$this
->
Responsable
->
rollback
();
return
(
false
);
}
}
return
(
true
);
}
/**
* @param int|null $id
*
...
...
app/Controller/RegistresController.php
View file @
d9097b86
...
...
@@ -165,6 +165,11 @@ class RegistresController extends AppController {
$sql
=
$this
->
EtatFiche
->
Fiche
->
Formulaire
->
sql
(
$subQuery
);
$condition
[]
=
"Fiche.form_id IN (
{
$sql
}
)"
;
}
// Filtre sur la co-responsabilité
if
(
!
empty
(
$this
->
request
->
data
[
'Registre'
][
'coresponsable'
]))
{
$condition
[
'Fiche.coresponsable'
]
=
$this
->
request
->
data
[
'Registre'
][
'coresponsable'
];
}
}
if
(
false
===
empty
(
$conditionValeur
))
{
...
...
@@ -188,6 +193,7 @@ class RegistresController extends AppController {
'id'
,
'created'
,
'numero'
,
'coresponsable'
,
'User'
=>
[
'nom'
,
'prenom'
...
...
app/Controller/ResponsablesController.php
0 → 100644
View file @
d9097b86
This diff is collapsed.
Click to expand it.
app/Controller/SoustraitantsController.php
View file @
d9097b86
...
...
@@ -405,8 +405,6 @@ class SoustraitantsController extends AppController {
$this
->
redirect
(
$this
->
Referers
->
get
());
}
debug
(
$this
->
request
->
data
);
$success
=
true
;
$this
->
Soustraitant
->
begin
();
...
...
@@ -573,8 +571,8 @@ class SoustraitantsController extends AppController {
$this
->
SoustraitantOrganisation
->
begin
();
$success
=
$success
&&
false
!==
$this
->
SoustraitantOrganisation
->
deleteAll
([
'organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
),
'soustraitant_id'
=>
$soustraitantId
'
SoustraitantOrganisation.
organisation_id'
=>
$this
->
Session
->
read
(
'Organisation.id'
),
'
SoustraitantOrganisation.
soustraitant_id'
=>
$soustraitantId
]);
if
(
$success
==
true
)
{
...
...
app/Locale/fra/LC_MESSAGES/default.po
View file @
d9097b86
...
...
@@ -159,6 +159,14 @@ msgstr "Super-administrateur"
msgid "default.sousTitreGestionTousUtilisateurs"
msgstr "Gestion de tous les utilisateurs"
msgid "default.titreResponsable"
msgstr "Responsables"
msgid "default.sousTitreListeResponsable"
msgstr "Tous les responsables"
msgid "default.sousTitreMesResponsables"
msgstr "Mes responsable"
###############################################################################
...
...
app/Locale/fra/LC_MESSAGES/fiche.po
View file @
d9097b86
...
...
@@ -215,6 +215,57 @@ msgstr "Adresse du sous-traitant"
msgid "fiche.champSoustraitantemail"
msgstr "E-mail du sous-traitant"
msgid "fiche.textInfoCoresponsable"
msgstr "Co-responsabilité sur le traitement :"
msgid "fiche.champCoresponsable"
msgstr "Co-responsable ?"
msgid "fiche.ongletCoresponsable"
msgstr "Co-responsable"
msgid "fiche.champCoresponsableid"
msgstr "Co-responsable"
msgid "fiche.placeholderChampCoresponsable"
msgstr "Choisir un co-responsable"
msgid "fiche.champNomcoresponsable"
msgstr "Nom du co-responsable"
msgid "fiche.champPrenomcoresponsable"
msgstr "Prénom du co-responsable"
msgid "fiche.champFonctioncoresponsable"
msgstr "Fonction du co-responsable"
msgid "fiche.champEmailcoresponsable"
msgstr "E-mail du co-responsable"
msgid "fiche.champTelephonecoresponsable"
msgstr "Téléphone du co-responsable"
msgid "fiche.champRaisonsocialestructure"
msgstr "Raison sociale de la structure du co-responsable"
msgid "fiche.champSiretstructure"
msgstr "N° Siret de la structure du co-responsable"