Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Libriciel
web-DPO
Commits
d1790957
Commit
d1790957
authored
May 16, 2019
by
Théo GUILLON
Committed by
Théo GUILLON
May 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout : mise en place d'une FAQ
parent
45fab2e8
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
2541 additions
and
74 deletions
+2541
-74
app/Config/Schema/CreationBase/patchs/1.0.1_to_1.0.2.sql
app/Config/Schema/CreationBase/patchs/1.0.1_to_1.0.2.sql
+47
-0
app/Config/bootstrap.php
app/Config/bootstrap.php
+1
-0
app/Config/webdpo.inc.default
app/Config/webdpo.inc.default
+10
-1
app/Controller/ArticlesController.php
app/Controller/ArticlesController.php
+712
-0
app/Controller/OrganisationsController.php
app/Controller/OrganisationsController.php
+21
-12
app/Controller/SoustraitantsController.php
app/Controller/SoustraitantsController.php
+6
-2
app/Lib/basics.php
app/Lib/basics.php
+5
-2
app/Locale/fra/LC_MESSAGES/article.po
app/Locale/fra/LC_MESSAGES/article.po
+165
-0
app/Locale/fra/LC_MESSAGES/default.po
app/Locale/fra/LC_MESSAGES/default.po
+9
-0
app/Model/Article.php
app/Model/Article.php
+70
-0
app/Model/ArticleOrganisation.php
app/Model/ArticleOrganisation.php
+49
-0
app/Model/Fichierarticle.php
app/Model/Fichierarticle.php
+192
-0
app/Model/ListeDroit.php
app/Model/ListeDroit.php
+4
-0
app/Model/Organisation.php
app/Model/Organisation.php
+70
-55
app/View/Articles/consulter.ctp
app/View/Articles/consulter.ctp
+65
-0
app/View/Articles/edit.ctp
app/View/Articles/edit.ctp
+336
-0
app/View/Articles/entite.ctp
app/View/Articles/entite.ctp
+98
-0
app/View/Articles/faq.ctp
app/View/Articles/faq.ctp
+88
-0
app/View/Articles/index.ctp
app/View/Articles/index.ctp
+356
-0
app/View/Articles/show.ctp
app/View/Articles/show.ctp
+166
-0
app/View/Helper/TinyMCEHelper.php
app/View/Helper/TinyMCEHelper.php
+32
-0
app/View/Layouts/default.ctp
app/View/Layouts/default.ctp
+36
-1
bower.json
bower.json
+3
-1
No files found.
app/Config/Schema/CreationBase/patchs/1.0.1_to_1.0.2.sql
View file @
d1790957
...
...
@@ -10,4 +10,51 @@ UPDATE organisations SET nomresponsable = UPPER(nomresponsable);
ALTER
TABLE
users
ADD
COLUMN
ldap
BOOLEAN
DEFAULT
FALSE
;
ALTER
TABLE
users
ALTER
COLUMN
notification
drop
not
null
;
--
-- Création de la table articles
--
CREATE
TABLE
articles
(
id
serial
NOT
NULL
PRIMARY
KEY
,
name
VARCHAR
(
100
)
NOT
NULL
,
description
TEXT
,
createdbyorganisation
INT
DEFAULT
NULL
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
--
-- Création de la table fichierarticles
--
CREATE
TABLE
fichierarticles
(
id
SERIAL
NOT
NULL
PRIMARY
KEY
,
nom
VARCHAR
(
100
)
NOT
NULL
,
url
VARCHAR
(
100
)
NOT
NULL
,
article_id
INTEGER
NOT
NULL
REFERENCES
articles
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
created
timestamp
without
time
zone
NOT
NULL
,
modified
timestamp
without
time
zone
NOT
NULL
);
CREATE
UNIQUE
INDEX
fichierarticles_nom_article_id_idx
ON
fichierarticles
(
nom
,
article_id
);
--
-- Création de la table de jointure Articles Organisations
--
CREATE
TABLE
articles_organisations
(
id
SERIAL
PRIMARY
KEY
NOT
NULL
,
article_id
INTEGER
NOT
NULL
REFERENCES
articles
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
organisation_id
INTEGER
NOT
NULL
REFERENCES
organisations
(
id
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
);
CREATE
UNIQUE
INDEX
articles_organisations_article_id_organisation_id_idx
ON
articles_organisations
(
article_id
,
organisation_id
);
--
-- Insertion de valeur dans la table liste_droits
--
INSERT
INTO
liste_droits
(
libelle
,
value
,
created
,
modified
)
VALUES
(
'Créer un article dans la FAQ'
,
16
,
NOW
(),
NOW
()),
(
'Modifier un article dans la FAQ'
,
17
,
NOW
(),
NOW
()),
(
'Consulter la FAQ'
,
18
,
NOW
(),
NOW
()),
(
'Supprimer un article dans la FAQ'
,
19
,
NOW
(),
NOW
());
COMMIT
;
app/Config/bootstrap.php
View file @
d1790957
...
...
@@ -63,6 +63,7 @@ Inflector::rules('plural', array(
'rules'
=>
array
(),
'irregular'
=>
array
(
'fiche'
=>
'fiches'
,
'article_organisation'
=>
'articles_organisations'
,
'organisation_user'
=>
'organisations_users'
,
'soustraitant_organisation'
=>
'soustraitants_organisations'
,
'responsable_organisation'
=>
'responsables_organisations'
...
...
app/Config/webdpo.inc.default
View file @
d1790957
...
...
@@ -19,6 +19,7 @@ Configure::write('GS_RESOLUTION', 300);
//Dossier qui va contenir tout les fichiers uploder
define
(
'FICHIER'
,
"files"
);
define
(
'CHEMIN_FICHIER'
,
APP
.
FICHIER
.
DS
);
//Dossier qui va contenir toutes les pièces jointes a un traitement
define
(
'PIECE_JOINT'
,
DS
.
"piece_joint_traitement"
);
...
...
@@ -57,6 +58,14 @@ define('CHEMIN_CONNECTEURS_AUTHENTIFICATION', APP . FICHIER . CONNECTEURS . AUTH
define
(
'EXPORTS'
,
DS
.
"exports"
);
define
(
'CHEMIN_EXPORTS'
,
APP
.
FICHIER
.
EXPORTS
.
DS
);
//Dossier qui va contenir toutes les pièces jointes a un article
define
(
'PIECE_JOINT_ARTICLE'
,
DS
.
"piece_joint_article"
);
define
(
'CHEMIN_PIECE_JOINT_ARTICLE'
,
APP
.
FICHIER
.
PIECE_JOINT_ARTICLE
.
DS
);
//Dossier qui va contenir toutes les pièces jointes temporaire d'un article
define
(
'PIECE_JOINT_ARTICLE_TMP'
,
DS
.
"piece_joint_article_tmp"
);
define
(
'CHEMIN_PIECE_JOINT_ARTICLE_TMP'
,
APP
.
FICHIER
.
PIECE_JOINT_ARTICLE
.
PIECE_JOINT_ARTICLE_TMP
.
DS
);
//Format des dates et heures
define
(
'FORMAT_DATE'
,
'%e-%m-%Y'
);
define
(
'FORMAT_DATE_HEURE'
,
'%e-%m-%Y à %H:%M'
);
...
...
@@ -65,4 +74,4 @@ define('FORMAT_DATE_HEURE', '%e-%m-%Y à %H:%M');
define
(
'REGEXP_ALPHA_FR'
,
'/^[a-zA-Z\-ÂÀâàÇçÉÊÈËéêèëÎÏîïÔÖôöÛÙûù ]*$/i'
);
//Validation champs email
define
(
'REGEXP_EMAIL_FR'
,
'/^[a-zA-Z1-9\-@.]*$/i'
);
\ No newline at end of file
define
(
'REGEXP_EMAIL_FR'
,
'/^[a-zA-Z1-9\-@.]*$/i'
);
app/Controller/ArticlesController.php
0 → 100644
View file @
d1790957
This diff is collapsed.
Click to expand it.
app/Controller/OrganisationsController.php
View file @
d1790957
...
...
@@ -548,11 +548,13 @@ class OrganisationsController extends AppController {
$id
=
trim
((
string
)
Hash
::
get
(
$this
->
request
->
data
,
'Organisation.organisationcible'
));
$id
=
$id
===
''
?
null
:
$id
;
}
$userId
=
$this
->
Auth
->
user
(
'id'
);
if
(
$id
==
null
)
{
$idArray
=
$this
->
OrganisationUser
->
find
(
'first'
,
[
'conditions'
=>
[
'OrganisationUser.user_id'
=>
$
this
->
Auth
->
user
(
'id'
)
'OrganisationUser.user_id'
=>
$
userId
]
]);
...
...
@@ -589,10 +591,10 @@ class OrganisationsController extends AppController {
]);
$this
->
Session
->
write
(
'Organisation'
,
$change
[
'Organisation'
]);
$
test
=
$this
->
Droit
->
find
(
'all'
,
[
$
droits
=
$this
->
Droit
->
find
(
'all'
,
[
'conditions'
=>
[
'OrganisationUser.user_id'
=>
$
this
->
Auth
->
user
(
'id'
)
,
'OrganisationUser.organisation_id'
=>
$
this
->
Session
->
read
(
'Organisation.id'
)
'OrganisationUser.user_id'
=>
$
userId
,
'OrganisationUser.organisation_id'
=>
$
id
],
'contain'
=>
[
'ListeDroit'
=>
[
...
...
@@ -603,12 +605,12 @@ class OrganisationsController extends AppController {
]
]
]);
$result
=
[];
foreach
(
$
test
as
$value
)
{
foreach
(
$
droits
as
$value
)
{
array_push
(
$result
,
$value
[
'ListeDroit'
][
'value'
]);
}
if
(
empty
(
$result
)
&&
!
$this
->
Droits
->
isSu
())
{
$this
->
Session
->
setFlash
(
__d
(
'organisation'
,
'organisation.flasherrorAucunDroitEntite'
),
'flasherror'
);
$this
->
redirect
([
...
...
@@ -710,7 +712,8 @@ class OrganisationsController extends AppController {
'Droit'
=>
[
ListeDroit
::
REDIGER_TRAITEMENT
,
ListeDroit
::
CONSULTER_REGISTRE
,
ListeDroit
::
TELECHARGER_TRAITEMENT_REGISTRE
ListeDroit
::
TELECHARGER_TRAITEMENT_REGISTRE
,
ListeDroit
::
CONSULTER_ARTICLE_FAQ
]
],
[
...
...
@@ -721,7 +724,8 @@ class OrganisationsController extends AppController {
'Droit'
=>
[
ListeDroit
::
VALIDER_TRAITEMENT
,
ListeDroit
::
CONSULTER_REGISTRE
,
ListeDroit
::
TELECHARGER_TRAITEMENT_REGISTRE
ListeDroit
::
TELECHARGER_TRAITEMENT_REGISTRE
,
ListeDroit
::
CONSULTER_ARTICLE_FAQ
]
],
[
...
...
@@ -731,7 +735,8 @@ class OrganisationsController extends AppController {
],
'Droit'
=>
[
ListeDroit
::
VISER_TRAITEMENT
,
ListeDroit
::
CONSULTER_REGISTRE
ListeDroit
::
CONSULTER_REGISTRE
,
ListeDroit
::
CONSULTER_ARTICLE_FAQ
]
],
[
...
...
@@ -752,7 +757,11 @@ class OrganisationsController extends AppController {
ListeDroit
::
MODIFIER_ORGANISATION
,
ListeDroit
::
CREER_PROFIL
,
ListeDroit
::
MODIFIER_PROFIL
,
ListeDroit
::
SUPPRIMER_PROFIL
ListeDroit
::
SUPPRIMER_PROFIL
,
ListeDroit
::
CREER_ARTICLE_FAQ
,
ListeDroit
::
MODIFIER_ARTICLE_FAQ
,
ListeDroit
::
CONSULTER_ARTICLE_FAQ
,
ListeDroit
::
SUPPRIMER_ARTICLE_FAQ
]
]
];
...
...
app/Controller/SoustraitantsController.php
View file @
d1790957
...
...
@@ -87,9 +87,13 @@ class SoustraitantsController extends AppController {
'Soustraitant'
=>
$resultSoustraitant
]
];
$this
->
Organisation
->
create
(
$data
);
$success
=
$success
&&
false
!==
$this
->
Organisation
->
save
(
null
,
[
'atomic'
=>
false
]);
debug
(
$data
);
// $this->Organisation->create($data);
// $success = $success && false !== $this->Organisation->save(null, ['atomic' => false]);
}
die
;
if
(
$success
==
true
)
{
$this
->
Organisation
->
commit
();
...
...
app/Lib/basics.php
View file @
d1790957
...
...
@@ -259,7 +259,9 @@ function create_arborescence_files($user_id = null)
APP
.
FICHIER
.
PIECE_JOINT
.
PIECE_JOINT_CONVERSION
,
APP
.
FICHIER
.
NORMES
,
APP
.
FICHIER
.
EXPORTS
,
APP
.
FICHIER
.
CONNECTEURS
APP
.
FICHIER
.
CONNECTEURS
,
CHEMIN_PIECE_JOINT_ARTICLE
,
CHEMIN_PIECE_JOINT_ARTICLE_TMP
];
if
(
$user_id
!==
null
)
{
...
...
@@ -267,6 +269,7 @@ function create_arborescence_files($user_id = null)
$paths
,
[
APP
.
FICHIER
.
PIECE_JOINT
.
PIECE_JOINT_TMP
.
DS
.
$user_id
,
CHEMIN_PIECE_JOINT_ARTICLE_TMP
.
$user_id
,
]
);
}
...
...
@@ -278,4 +281,4 @@ function create_arborescence_files($user_id = null)
}
}
return
$success
;
}
\ No newline at end of file
}
app/Locale/fra/LC_MESSAGES/article.po
0 → 100644
View file @
d1790957
# Locale fra
# article.po
#
# web-DPO : https://www.libriciel.fr/web-cil/
#
# @author Théo Guillon
# @copyright Libriciel SCOP
# @link https://www.libriciel.fr/
# @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt CeCiLL v2
#
####################### Controller/AdminsController.php #######################
msgid "article.titreIndex"
msgstr "Liste des articles présents dans la FAQ"
msgid "article.titreAjouterArticle"
msgstr "Ajouter un article"
msgid "article.titreModificationArticle"
msgstr "Modification d'un article"
###############################################################################
############################## Session->setFlash ##############################
#### SUCCESS ####
msgid "article.flashsuccessArticleEnregistrer"
msgstr "L'article a bien été enregistré"
msgid "article.flashsuccessSuppressionArticleEntite"
msgstr "L'article a bien été supprimé"
msgid "article.flashsuccessDissocierSoustraitantEntite"
msgstr "La dissociation du sous-traitant de l'entité a été enregistée"
msgid "article.flashsuccessSuppressionSoustraitantEntite"
msgstr "La suppression de l'article dans le FAQ a été enregistée"
msgid "article.flashsuccessAnnexeSupprimer"
msgstr "L'annexe a bien été supprimé"
################
#### ERREUR ####
msgid "article.flasherrorErreurEnregistrementArticle"
msgstr "Une erreur s'est produite lors de l'enregistrement de l'article"
msgid "article.flasherrorErreurDissocierSoustraitantEntite"
msgstr "Une erreur est survenue lors de la dissociation du sous-traitant de l'entité"
msgid "article.flasherrorErreurSuppressionArticleEntite"
msgstr "Une erreur est survenue lors de la suppression de l'article dans la FAQ"
msgid "article.flasherrorErreurAssociationExistanteArticleEntite"
msgstr "Certaines associations entre l'article de la FAQ et des entitté sont existantes. L'article ne peut donc pas être supprimé."
################
###############################################################################
######################### View/Soustraitants/index.ctp #########################
msgid "article.btnFiltrerArticle"
msgstr " Filtrer les articles de la FAQ"
msgid "article.champFiltreNameArticle"
msgstr "Filtrer par titre"
msgid "article.placeholderFiltreNameArticle"
msgstr "Choisir un titre"
msgid "article.placeholderChampFiltreEntite"
msgstr "Choisir une entité"
msgid "article.btnAffecterArticleAEntite"
msgstr "Associer un article à la FAQ d'une entité"
msgid "article.popupTitreAffecterArticle"
msgstr "Associer un ou plusieurs article(s) à une ou plusieurs entité(s)"
msgid "article.titreTableauNameArticle"
msgstr "Nom de l'article"
msgid "article.titreTableauEntiteArticle"
msgstr "Entité visualisatrice"
msgid "article.titreTableauAction"
msgstr "Actions"
msgid "article.btnAjouterArticle"
msgstr " Ajouter un article"
msgid "article.textAucunArticle"
msgstr "Il n'existe aucun article dans la FAQ"
msgid "article.commentaireBtnVisualiserArticle"
msgstr "Visualiser l'article"
msgid "article.commentaireBtnModifierArticle"
msgstr "Modifier l'article"
msgid "article.commentaireBtnSupprimerArticle"
msgstr "Supprimer l'article"
msgid "article.confirmationSupprimerArticle"
msgstr "Voulez vous supprimer l'article : "
###############################################################################
#################### View/Soustraitants/edit.ctp | add.ctp ####################
msgid "article.ongletArticle"
msgstr "Article"
msgid "article.ongletAnnexe"
msgstr "Annexe(s)"
msgid "article.champName"
msgstr "Titre"
msgid "article.placeholderChampName"
msgstr "Titre (requis)"
msgid "article.champDescription"
msgstr "Texte"
msgid "article.textAjouterPieceJointe"
msgstr "Ajouter une pièce jointe"
msgid "article.textTypeFichierAccepter"
msgstr "Seuls les fichiers au format '.doc', '.docx', '.ppt', '.pptx', '.gif', '.jpeg', '.jpg', '.png', '.odp', '.ods', '.odt', '.pdf' sont acceptés"
msgid "article.textInfoPieceJointe"
msgstr "Pièce jointe associée :"
msgid "article.textInfoAucunePieceJointe"
msgstr "Aucune pièce jointe"
###############################################################################
######################### index.ctp | edit.ctp #########################
msgid "article.placeholderSelectOrganisation"
msgstr "Sélectionnez une ou plusieurs entité(s) (facultatif)"
msgid "article.champSelectOrganisation"
msgstr "Associer à une ou plusieurs entité(s)"
###############################################################################
######################### View/Soustraitants/entite.ctp ########################
msgid "article.commentaireBtnDissocierArticleEntite"
msgstr "Dissocier l'article de l'entité"
msgid "article.confirmationDissocierArticleEntite"
msgstr "Voulez vous dissocier l'article "
msgid "article.textAucunArticleEntite"
msgstr "Il n'existe aucun article dans votre entité"
###############################################################################
app/Locale/fra/LC_MESSAGES/default.po
View file @
d1790957
...
...
@@ -126,6 +126,15 @@ msgstr "Description"
msgid "default.popupTitreTableauAction"
msgstr "Action"
msgid "default.titreFAQ"
msgstr "FAQ"
msgid "default.sousTitreToutesLaFAQ"
msgstr "Toutes la FAQ"
msgid "default.sousTitreMaFAQ"
msgstr "Ma FAQ"
msgid "default.titreNormes"
msgstr "Normes"
...
...
app/Model/Article.php
0 → 100644
View file @
d1790957
<?php
/**
* Model Article
*
* web-DPO : Outil de gestion de vos traitements dans le cadre de la
* réglementation relative à la protection des données personnelles (RGPD)
*
* Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
*
* Licensed under The CeCiLL V2 License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
* @link https://www.libriciel.fr/web-cil/
* @since web-DPO v1.0.0
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html CeCiLL V2 License
* @version v1.0.0
* @package AppModel
*/
App
::
uses
(
'AppModel'
,
'Model'
);
class
Article
extends
AppModel
{
public
$name
=
'Article'
;
public
$validationDomain
=
'validation'
;
/**
* Règles de validation supplémentaires.
*
* @var array
*/
public
$validate
=
[
'name'
=>
[
'isUniqueMultiple'
=>
[
'rule'
=>
'isUnique'
,
'message'
=>
'validation.valeurDejaUtilisee'
]
]
];
/**
* hasMany associations
*
* @var array
*
* @access public
* @created 11/04/2018
* @version v1.0.0
*/
public
$hasAndBelongsToMany
=
[
'Organisation'
=>
[
'className'
=>
'Organisation'
,
'joinTable'
=>
'articles_organisations'
,
'foreignKey'
=>
'article_id'
,
'associationForeignKey'
=>
'organisation_id'
,
'unique'
=>
true
,
'conditions'
=>
''
,
'fields'
=>
''
,
'order'
=>
''
,
'limit'
=>
''
,
'offset'
=>
''
,
'finderQuery'
=>
''
,
'with'
=>
'ArticleOrganisation'
]
];
}
app/Model/ArticleOrganisation.php
0 → 100644
View file @
d1790957
<?php
/**
* Model ArticleOrganisation
*
* web-DPO : Outil de gestion de vos traitements dans le cadre de la
* réglementation relative à la protection des données personnelles (RGPD)
*
* Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
*
* Licensed under The CeCiLL V2 License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
* @link https://www.libriciel.fr/web-cil/
* @since web-DPO v1.0.2
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html CeCiLL V2 License
* @version v1.0.2
* @package AppModel
*/
App
::
uses
(
'AppModel'
,
'Model'
);
class
ArticleOrganisation
extends
AppModel
{
public
$name
=
'ArticleOrganisation'
;
/**
* belongsTo associations
*
* @var array
*
* @access public
* @created 18/04/2019
* @version V1.0.2
*/
public
$belongsTo
=
[
'Article'
=>
[
'className'
=>
'Article'
,
'foreignKey'
=>
'article_id'
],
'Organisation'
=>
[
'className'
=>
'Organisation'
,
'foreignKey'
=>
'organisation_id'
]
];
}
app/Model/Fichierarticle.php
0 → 100644
View file @
d1790957
<?php
/**
* Model Fichierarticle
*
* web-DPO : Outil de gestion de vos traitements dans le cadre de la
* réglementation relative à la protection des données personnelles (RGPD)
*
* Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
*
* Licensed under The CeCiLL V2 License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Libriciel SCOP (https://www.libriciel.fr/)
* @link https://www.libriciel.fr/web-cil/
* @since web-DPO v1.0.0
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html CeCiLL V2 License
* @version v1.0.0
* @package AppModel
*/
App
::
uses
(
'AppModel'
,
'Model'
);
App
::
uses
(
'Folder'
,
'Utility'
);
class
Fichierarticle
extends
AppModel
{
public
$name
=
'Fichierarticle'
;
public
$validationDomain
=
'validation'
;
/**
* Règles de validation supplémentaires.
*
* @var array
*/
public
$validate
=
[
'nom'
=>
[
'isUniqueMultiple'
=>
[
'rule'
=>
[
'isUniqueMultiple'
,
[
'nom'
,
'article_id'
]],
'message'
=>
'validation.valeurDejaUtilisee'
]
],
'article_id'
=>
[
'isUniqueMultiple'
=>
[
'rule'
=>
[
'isUniqueMultiple'
,
[
'nom'
,
'article_id'
]],
'message'
=>
'validation.valeurDejaUtilisee'
]
]
];
/**
* belongsTo associations
*
* @var array
*
* @access public
* @created 29/04/2015
* @version V1.0.0
*/
public
$belongsTo
=
[
'Article'
=>
[
'className'
=>
'Article'
,
'foreignKey'
=>
'articl0_id'
]
];
/**
*
* @param type $idArticle
* @param type $uuidDossier
* @param type $idUser
* @param boolean $transaction La méthode doit-elle gérer elle-même une
* transaction (par défaut: false) ?
* @return boolean
*/
public
function
transfereSave
(
$idArticle
,
$uuidDossier
,
$idUser
,
$transaction
=
false
)
{
if
(
!
empty
(
$uuidDossier
)){
$files
=
array_diff
(
scandir
(
CHEMIN_PIECE_JOINT_ARTICLE_TMP
.
$idUser
.
DS
.
$uuidDossier
),
array
(
'..'
,
'.'
));
if
(
isset
(
$files
)
&&
!
empty
(
$files
))
{
$success
=
true
;
if
(
$transaction
==
true
)
{
$this
->
begin
();
}
// On verifie si le dossier file existe. Si c'est pas le cas on le cree
if
(
!
file_exists
(
CHEMIN_FICHIER
))
{
mkdir
(
CHEMIN_FICHIER
,
0777
,
true
);
mkdir
(
CHEMIN_PIECE_JOINT
,
0777
,
true
);
mkdir
(
CHEMIN_MODELES
,
0777
,
true
);
mkdir
(
CHEMIN_REGISTRE
,
0777
,
true
);
}
else
{
if
(
!
file_exists
(
CHEMIN_PIECE_JOINT_ARTICLE
))
{
mkdir
(
CHEMIN_PIECE_JOINT_ARTICLE
,
0777
,
true
);
}