diff --git a/.gitignore b/.gitignore
index 486982132..c07006940 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,7 +17,7 @@ docker-compose.*
acake2php*.zip
/app/Config/database.php*
/app/Config/database.sql*
-/app/Config/Schema/schema_*.php
+/app/Config/Schema/schema.php*
/app/tmp
/app/Vendor/
!/app/Vendor/autoload.php
diff --git a/Scripts/config_app_database.sh b/Scripts/config_app_database.sh
index 5a81dc370..407a2b5b4 100755
--- a/Scripts/config_app_database.sh
+++ b/Scripts/config_app_database.sh
@@ -27,9 +27,9 @@ wd="$TOPDIR/app/Config"
while [[ "$#" -gt 0 ]]; do case $1 in
*.php)
dbfile=$1
- outfile=$(echo "$dbfile" | cut -d . -f 1)
+ file=$(echo "$dbfile" | cut -d . -f 1)
# shellcheck source=cp_bkp_old.sh
- . "${TOPDIR}/Scripts/cp_bkp_old.sh" "$wd" "$dbfile" "${outfile}.php"
+ . "${TOPDIR}/Scripts/cp_bkp_old.sh" "$wd" "$dbfile" "${file}.php"
;;
*.sock )
if [ -n "$(command -v mysql)" ]; then
diff --git a/Scripts/lib/shell_prompt.sh b/Scripts/lib/shell_prompt.sh
index fcd0e2e39..2ede9ba29 100755
--- a/Scripts/lib/shell_prompt.sh
+++ b/Scripts/lib/shell_prompt.sh
@@ -50,7 +50,7 @@ patches() {
}
#; export -f patches
cakephp() {
- "${TOPDIR}/app/Console/cake" -working "${TOPDIR}/app" "$@"
+ "${TOPDIR}/app/Console/cake.php" "$@"
}
#; export -f cakephp
docker_name() {
diff --git a/app/Config/Schema/schema.cms.php b/app/Config/Schema/schema.cms.php
index b5df1bb75..f07cb9f06 100644
--- a/app/Config/Schema/schema.cms.php
+++ b/app/Config/Schema/schema.cms.php
@@ -1,4 +1,11 @@
-u
+* pour mettre à jour la base données */
class AppSchema extends CakeSchema {
public $file = 'schema.php';
@@ -11,18 +18,28 @@ public function after($event = array()) {
}
public $achat = array(
- 'fk_reference_commande' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false, 'key' => 'primary'),
- 'fk_reference_facture' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_magasin' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'id_commande' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false, 'key' => 'primary'),
+ 'id_facture' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary'),
+ 'id_magasin' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary'),
'indexes' => array(
- 'PRIMARY' => array('column' => array('fk_reference_commande', 'fk_reference_facture', 'fk_reference_magasin'), 'unique' => 1)
+ 'PRIMARY' => array('column' => array('id_commande', 'id_facture', 'id_magasin'), 'unique' => 1)
+ ),
+ 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
+ );
+
+ public $cake_sessions = array(
+ 'id' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'primary'),
+ 'data' => array('type' => 'text', 'null' => true, 'default' => null),
+ 'expires' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $categorie = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary', 'autoIncrement' => true),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 50, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'nom' => array('type' => 'string', 'null' => false, 'length' => 50, 'key' => 'primary'),
'parent' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 3, 'unsigned' => false, 'key' => 'index'),
'image' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'indexes' => array(
@@ -33,53 +50,55 @@ public function after($event = array()) {
);
public $classification = array(
- 'reference_classe' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_categorie' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
+ 'id' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary'),
+ 'nom' => array('type' => 'string', 'null' => false, 'length' => 30),
+ 'id_categorie' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
'indexes' => array(
- 'PRIMARY' => array('column' => 'reference_classe', 'unique' => 1)
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
- public $client = array(
- 'identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'email' => array('type' => 'string', 'null' => false, 'length' => 60, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_id_mdp' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 32, 'key' => 'unique', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'prenom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ public $clients = array(
+ 'id' => array('type' => 'string', 'null' => false, 'length' => 50, 'key' => 'primary'),
+ 'email' => array('type' => 'string', 'null' => false, 'length' => 255),
+ 'id_motdepasse' => array('type' => 'string', 'null' => true, 'length' => 255),
+ 'nom' => array('type' => 'string', 'null' => false, 'length' => 30),
+ 'prenom' => array('type' => 'string', 'null' => false, 'length' => 30),
'annee_de_naissance' => array('type' => 'text', 'null' => false, 'length' => 4),
- 'adresse' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'ville' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pays' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'numero_tel' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 20, 'unsigned' => false),
+ 'adresse' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 30),
+ 'codepostal' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'unsigned' => false),
+ 'ville' => array('type' => 'string', 'null' => false, 'length' => 40),
+ 'pays' => array('type' => 'string', 'null' => false, 'length' => 20),
+ 'telephone' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 20, 'unsigned' => false),
+ 'role' => array('type' => 'string', 'null' => false, 'length' => 20),
+ 'cree' => array('type' => 'date', 'null' => false),
+ 'modifie' => array('type' => 'date', 'null' => false),
'indexes' => array(
- 'PRIMARY' => array('column' => 'identifiant', 'unique' => 1),
- 'fk_id_mdp' => array('column' => 'fk_id_mdp', 'unique' => 1),
- 'fk_id_mdp_2' => array('column' => 'fk_id_mdp', 'unique' => 1)
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $commande = array(
- 'reference' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'date_de_commande' => array('type' => 'date', 'null' => false, 'key' => 'index'),
- 'fk_reference_produit' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_promotion' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
+ 'id_produit' => array('type' => 'string', 'null' => false, 'length' => 20),
+ 'id_promotion' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
'indexes' => array(
- 'PRIMARY' => array('column' => 'reference', 'unique' => 1),
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
'date_de_commande' => array('column' => 'date_de_commande', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $compte = array(
- 'fk_identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'id' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary'),
'nb_de_produits_achetes' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'key' => 'index'),
'montant_d_achat_total' => array('type' => 'decimal', 'null' => false, 'default' => '0.0', 'length' => '6,1', 'unsigned' => false),
'date_ouverture_du_compte' => array('type' => 'date', 'null' => false),
'indexes' => array(
- 'PRIMARY' => array('column' => 'fk_identifiant', 'unique' => 1),
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
'nb_de_produits_achetes' => array('column' => array('nb_de_produits_achetes', 'montant_d_achat_total', 'date_ouverture_du_compte'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
@@ -87,30 +106,30 @@ public function after($event = array()) {
public $articles = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'entete' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_categorie' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
- 'corps' => array('type' => 'text', 'null' => false, 'length' => 4, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'entete' => array('type' => 'string', 'null' => false, 'length' => 250),
+ 'id_categorie' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
+ 'corps' => array('type' => 'text', 'null' => false, 'length' => 4),
'date' => array('type' => 'date', 'null' => false),
- 'published' => array('type' => 'date', 'null' => false),
- 'indexes' => array(
+ 'published' => array('type' => 'date', 'null' => false),
+ 'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $disponibilite = array(
- 'fk_id_produit' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false, 'key' => 'primary'),
- 'fk_reference_exemplaire' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false, 'key' => 'primary'),
+ 'id_exemplaire' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary'),
'indexes' => array(
- 'PRIMARY' => array('column' => array('fk_id_produit', 'fk_reference_exemplaire'), 'unique' => 1)
+ 'PRIMARY' => array('column' => array('id', 'id_exemplaire'), 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $editeur = array(
- 'code_editeur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'code_editeur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary'),
'image' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 5, 'unsigned' => false),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'nom' => array('type' => 'string', 'null' => false, 'length' => 20),
'indexes' => array(
'PRIMARY' => array('column' => 'code_editeur', 'unique' => 1)
),
@@ -118,9 +137,9 @@ public function after($event = array()) {
);
public $exemplaire = array(
- 'code_reference' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'code_reference' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary'),
'date_de_livraison' => array('type' => 'date', 'null' => false),
- 'fk_id_produit' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false),
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false),
'indexes' => array(
'PRIMARY' => array('column' => 'code_reference', 'unique' => 1)
),
@@ -128,25 +147,25 @@ public function after($event = array()) {
);
public $facture = array(
- 'reference' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'reference' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary'),
'montant_facture' => array('type' => 'decimal', 'null' => true, 'default' => null, 'length' => '6,1', 'unsigned' => false),
'date_de_facturation' => array('type' => 'date', 'null' => false),
- 'mode_de_paiement' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'mode_de_paiement' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'index'),
+ 'id' => array('type' => 'string', 'null' => false, 'length' => 20),
'indexes' => array(
'PRIMARY' => array('column' => 'reference', 'unique' => 1),
- 'mode_de_paiement' => array('column' => array('mode_de_paiement', 'fk_identifiant'), 'unique' => 0)
+ 'mode_de_paiement' => array('column' => array('mode_de_paiement', 'id'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $fournisseur = array(
- 'code_fournisseur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'adresse' => array('type' => 'string', 'null' => false, 'length' => 40, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'code_fournisseur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary'),
+ 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'key' => 'index'),
+ 'adresse' => array('type' => 'string', 'null' => false, 'length' => 40),
'numero_tel' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 20, 'unsigned' => false),
- 'ville' => array('type' => 'string', 'null' => false, 'length' => 15, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pays' => array('type' => 'string', 'null' => false, 'length' => 15, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'ville' => array('type' => 'string', 'null' => false, 'length' => 15),
+ 'pays' => array('type' => 'string', 'null' => false, 'length' => 15),
'indexes' => array(
'PRIMARY' => array('column' => 'code_fournisseur', 'unique' => 1),
'nom' => array('column' => array('nom', 'ville', 'pays'), 'unique' => 0)
@@ -156,10 +175,10 @@ public function after($event = array()) {
public $image = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'nom' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'nom' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 250),
'image' => array('type' => 'mediumbinary', 'null' => false, 'default' => null),
- 'mime' => array('type' => 'string', 'null' => false, 'default' => 'image/png', 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'description' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'mime' => array('type' => 'string', 'null' => false, 'default' => 'image/png', 'length' => 250),
+ 'description' => array('type' => 'text', 'null' => true, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
@@ -169,13 +188,13 @@ public function after($event = array()) {
public $info = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'categorie' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
- 'titre' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'auteur' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'contenu' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'langue' => array('type' => 'string', 'null' => false, 'length' => 32, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'titre' => array('type' => 'text', 'null' => false, 'default' => null),
+ 'auteur' => array('type' => 'string', 'null' => false, 'length' => 250),
+ 'contenu' => array('type' => 'text', 'null' => false, 'default' => null),
+ 'langue' => array('type' => 'string', 'null' => false, 'length' => 32),
'date' => array('type' => 'date', 'null' => false),
'published' => array('type' => 'date', 'null' => false),
- 'images' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 35, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'images' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 35),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
@@ -184,9 +203,9 @@ public function after($event = array()) {
public $messages = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'titre' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'texte' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pseudo' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'titre' => array('type' => 'string', 'null' => false, 'length' => 250),
+ 'texte' => array('type' => 'text', 'null' => false, 'default' => null),
+ 'id_client' => array('type' => 'string', 'null' => false, 'length' => 255),
'date' => array('type' => 'date', 'null' => false),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
@@ -195,21 +214,24 @@ public function after($event = array()) {
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
- public $motdepasse = array(
- 'id_unique' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'motdepasse' => array('type' => 'string', 'null' => false, 'length' => 8, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ public $motdepasses = array(
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary', 'autoIncrement' => true),
+ 'password' => array('type' => 'string', 'null' => false, 'length' => 255),
+ 'password_confirm' => array('type' => 'string', 'null' => false, 'length' => 255),
+ 'cree' => array('type' => 'date', 'null' => false),
+ 'modifie' => array('type' => 'date', 'null' => false),
'indexes' => array(
- 'PRIMARY' => array('column' => 'id_unique', 'unique' => 1)
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $php4u_bookmarks = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'unsigned' => true, 'key' => 'primary'),
- 'dbase' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'user' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'label' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'query' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'dbase' => array('type' => 'string', 'null' => false, 'length' => 128),
+ 'user' => array('type' => 'string', 'null' => false, 'length' => 128),
+ 'label' => array('type' => 'string', 'null' => false, 'length' => 128),
+ 'query' => array('type' => 'text', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1)
),
diff --git a/app/Config/Schema/schema.php b/app/Config/Schema/schema.php
deleted file mode 100644
index b5df1bb75..000000000
--- a/app/Config/Schema/schema.php
+++ /dev/null
@@ -1,219 +0,0 @@
- array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false, 'key' => 'primary'),
- 'fk_reference_facture' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_magasin' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => array('fk_reference_commande', 'fk_reference_facture', 'fk_reference_magasin'), 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $categorie = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary', 'autoIncrement' => true),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 50, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'parent' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 3, 'unsigned' => false, 'key' => 'index'),
- 'image' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => array('id', 'nom'), 'unique' => 1),
- 'parent' => array('column' => 'parent', 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $classification = array(
- 'reference_classe' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_categorie' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'reference_classe', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $client = array(
- 'identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'email' => array('type' => 'string', 'null' => false, 'length' => 60, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_id_mdp' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 32, 'key' => 'unique', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'prenom' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'annee_de_naissance' => array('type' => 'text', 'null' => false, 'length' => 4),
- 'adresse' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 30, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'ville' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pays' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'numero_tel' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 20, 'unsigned' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'identifiant', 'unique' => 1),
- 'fk_id_mdp' => array('column' => 'fk_id_mdp', 'unique' => 1),
- 'fk_id_mdp_2' => array('column' => 'fk_id_mdp', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $commande = array(
- 'reference' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'date_de_commande' => array('type' => 'date', 'null' => false, 'key' => 'index'),
- 'fk_reference_produit' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_promotion' => array('type' => 'integer', 'null' => false, 'default' => '0', 'unsigned' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'reference', 'unique' => 1),
- 'date_de_commande' => array('column' => 'date_de_commande', 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $compte = array(
- 'fk_identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nb_de_produits_achetes' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'key' => 'index'),
- 'montant_d_achat_total' => array('type' => 'decimal', 'null' => false, 'default' => '0.0', 'length' => '6,1', 'unsigned' => false),
- 'date_ouverture_du_compte' => array('type' => 'date', 'null' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'fk_identifiant', 'unique' => 1),
- 'nb_de_produits_achetes' => array('column' => array('nb_de_produits_achetes', 'montant_d_achat_total', 'date_ouverture_du_compte'), 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $articles = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'entete' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_reference_categorie' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
- 'corps' => array('type' => 'text', 'null' => false, 'length' => 4, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'date' => array('type' => 'date', 'null' => false),
- 'published' => array('type' => 'date', 'null' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $disponibilite = array(
- 'fk_id_produit' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false, 'key' => 'primary'),
- 'fk_reference_exemplaire' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => array('fk_id_produit', 'fk_reference_exemplaire'), 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $editeur = array(
- 'code_editeur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'image' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 5, 'unsigned' => false),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'code_editeur', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $exemplaire = array(
- 'code_reference' => array('type' => 'string', 'null' => false, 'length' => 20, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'date_de_livraison' => array('type' => 'date', 'null' => false),
- 'fk_id_produit' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5, 'unsigned' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'code_reference', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $facture = array(
- 'reference' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'montant_facture' => array('type' => 'decimal', 'null' => true, 'default' => null, 'length' => '6,1', 'unsigned' => false),
- 'date_de_facturation' => array('type' => 'date', 'null' => false),
- 'mode_de_paiement' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'fk_identifiant' => array('type' => 'string', 'null' => false, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'reference', 'unique' => 1),
- 'mode_de_paiement' => array('column' => array('mode_de_paiement', 'fk_identifiant'), 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $fournisseur = array(
- 'code_fournisseur' => array('type' => 'string', 'null' => false, 'length' => 4, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'nom' => array('type' => 'string', 'null' => false, 'length' => 30, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'adresse' => array('type' => 'string', 'null' => false, 'length' => 40, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'numero_tel' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 20, 'unsigned' => false),
- 'ville' => array('type' => 'string', 'null' => false, 'length' => 15, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pays' => array('type' => 'string', 'null' => false, 'length' => 15, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'code_fournisseur', 'unique' => 1),
- 'nom' => array('column' => array('nom', 'ville', 'pays'), 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB', 'comment' => 'Fournisseurs des produits')
- );
-
- public $image = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'nom' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'image' => array('type' => 'mediumbinary', 'null' => false, 'default' => null),
- 'mime' => array('type' => 'string', 'null' => false, 'default' => 'image/png', 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'description' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $info = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'categorie' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
- 'titre' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'auteur' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'contenu' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'langue' => array('type' => 'string', 'null' => false, 'length' => 32, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'date' => array('type' => 'date', 'null' => false),
- 'published' => array('type' => 'date', 'null' => false),
- 'images' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 35, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $messages = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
- 'titre' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'texte' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pseudo' => array('type' => 'string', 'null' => false, 'length' => 250, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'date' => array('type' => 'date', 'null' => false),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1),
- 'date' => array('column' => 'date', 'unique' => 0)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $motdepasse = array(
- 'id_unique' => array('type' => 'string', 'null' => false, 'length' => 32, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'motdepasse' => array('type' => 'string', 'null' => false, 'length' => 8, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id_unique', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
- public $php4u_bookmarks = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'unsigned' => true, 'key' => 'primary'),
- 'dbase' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'user' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'label' => array('type' => 'string', 'null' => false, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'query' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1)
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
- );
-
-}
diff --git a/app/Config/email.php b/app/Config/email.php
new file mode 100644
index 000000000..132c32b0f
--- /dev/null
+++ b/app/Config/email.php
@@ -0,0 +1,28 @@
+ 'Mail',
+ 'from' => 'webmaster@localhost',
+ //'charset' => 'utf-8',
+ //'headerCharset' => 'utf-8',
+ );
+ public $gmail = array(
+ 'host' => 'smtp.gmail.com',
+ 'port' => 465,
+ 'username' => 'my@gmail.com',
+ 'password' => 'secret',
+ 'transport' => 'Smtp',
+ 'tls' => true
+ );
+ public function __construct() {
+ $this->default['from'] = getenv('SERVER_NAME') ? 'no-reply@' . getenv('SERVER_NAME') : $this->default['from'];
+ }
+}
+ ?>
diff --git a/app/Config/routes.php b/app/Config/routes.php
index e59e20bcc..14b15f3f3 100755
--- a/app/Config/routes.php
+++ b/app/Config/routes.php
@@ -29,6 +29,30 @@
* views are prefixed with "admin/" => admin_action()
*/
Router::connect('/admin/e14/:action/*', array('controller' => 'e14', 'admin' => true));
+/**
+ *************************************************** ArticleController routing
+ * the one star(*) wildcard is for one-to-one passed arguments separated by the slash '/'
+ */
+Router::connect('/users/psd/:action/*', array('controller' => 'MotDePasse'));
+/**
+ * the two stars(**) wildcard is for many-to-one argument passed as a whole string
+ */
+Router::connect('/users/psd/**', array('controller' => 'MotDePasse', 'action' => 'index'));
+/**
+ */
+Router::connect('/admin/users/psd/:action/*', array('controller' => 'MotDePasse', 'admin' => true));
+/**
+ *************************************************** ArticleController routing
+ * the one star(*) wildcard is for one-to-one passed arguments separated by the slash '/'
+ */
+Router::connect('/users/:action/*', array('controller' => 'client'));
+/**
+ * the two stars(**) wildcard is for many-to-one argument passed as a whole string
+ */
+Router::connect('/users/**', array('controller' => 'client', 'action' => 'index'));
+/**
+ */
+Router::connect('/admin/users/:action/*', array('controller' => 'client', 'admin' => true));
/**
*************************************************** ArticleController routing
* the one star(*) wildcard is for one-to-one passed arguments separated by the slash '/'
diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php
index 1814dfbf1..49e4da5a4 100755
--- a/app/Controller/AppController.php
+++ b/app/Controller/AppController.php
@@ -21,7 +21,7 @@
*/
App::uses('Controller', 'Controller');
App::uses('Index', 'Cms');
-
+App::uses('AuthComponent', 'Controller/Component/');
/**
* Application Controller
*
@@ -38,12 +38,44 @@ class AppController extends Controller {
*/
public $components = array('DebugKit.Toolbar',
'Flash' => array(
- 'className' => 'MyFlash'));
+ 'className' => 'MyFlash'
+ ),
+ 'Auth' => array(
+ 'loginRedirect' => array('controller' => 'clients', 'action' => 'index'),
+ 'logoutRedirect' => array('controller' => 'e14', 'action' => 'index'),
+ 'authError' => "Veuillez vous authentifier, s'il-vous-plaît.",
+ 'authenticate' => array(
+ AuthComponent::ALL => array(
+ 'userModel' => 'Client',
+ 'fields' => array(
+ 'username' => 'id', // 'username' par défaut
+ 'password' => 'id_motdepasse' // 'password' par défaut
+ )
+ ),
+ 'Basic',
+ 'Form'
+ ),
+ 'authorize' => array('Controller')
+ )
+ );
+
+ /** Gestion simple des acces controlés par role. Un 'controller' dépendant de cette méthode pour
+ * définir l'autorisation Client pour une action donnée
+ */
+ public function isAuthorized($user) {
+ /* Admin peut accéder à toute action */
+ if (isset($user['role']) && $user['role'] === 'admin') {
+ return true;
+ }
+
+ /* Refus par défaut */
+ return false;
+ }
public $helpers = array('Info' => array(
'index' => null,
'countPerPage' => '10',
'md' => true
- ), 'Markdown.Markdown' => true, 'Form', 'Html', 'Js', 'Time', 'Flash');
+ ), 'Markdown.Markdown' => true, 'Text', 'Form', 'Html', 'Js', 'Time', 'Flash');
protected $_r;
public function __construct($request = null, $response = null) {
@@ -55,8 +87,13 @@ public function __construct($request = null, $response = null) {
}
public function beforeFilter() {
+ parent::beforeFilter();
/* internationalisation (i18n) */
Configure::write('Config.language', $this->_r->getLanguage());
+ /* AuthComponent de ne pas exiger un login pour toutes les actions index et view*/
+ $this->Auth->allow(
+ 'index',
+ 'view');
}
/**
diff --git a/app/Controller/ArticleController.php b/app/Controller/ArticleController.php
index 8e29bb290..c8a9fab30 100644
--- a/app/Controller/ArticleController.php
+++ b/app/Controller/ArticleController.php
@@ -40,11 +40,11 @@ function publierImages() {
)
);
- public function index($fk_reference_categorie = null) {
- if ($fk_reference_categorie === null) {
+ public function index($id__categorie = null) {
+ if ($id__categorie === null) {
$this->set('articles', $this->Article->find('all'));
} else {
- $this->set('articles', $this->Article->find($fk_reference_categorie));
+ $this->set('articles', $this->Article->find($id__categorie));
}
$this->set("pIndex", "activites__index");
$this->render(null, "default-e14");
diff --git a/app/Controller/ClientController.php b/app/Controller/ClientController.php
new file mode 100644
index 000000000..3fea9ee28
--- /dev/null
+++ b/app/Controller/ClientController.php
@@ -0,0 +1,159 @@
+Auth->allow('add', 'logout');
+ }
+
+ public function admin_login() {
+ $this->Auth->redirectUrl(array('action' => 'index', 'admin' => true));
+ return $this->redirect(array('action' => 'login', 'admin' => false));
+ }
+ public function login() {
+ if ($this->request->is('post')) {
+ if ($this->Auth->login()) {
+ return $this->redirect($this->Auth->redirectUrl());
+ } else {
+ $this->Flash->error(__("Invalid username or password"));
+ }
+ }
+ $this->set('pIndex', 'users__login');
+ $this->render(null, 'default-e14');
+ }
+
+ public function admin_logout() {
+ return $this->redirect(array('action' => 'logout', 'admin' => false));
+ }
+ public function logout() {
+ return $this->redirect($this->Auth->logout());
+ }
+
+ public function index() {
+ $this->set('pIndex', 'users__index');
+ $this->render(null, 'default-e14');
+ }
+
+ public function admin_index() {
+ $this->Client->recursive = 0;
+ $this->set('clients', $this->paginate());
+ $this->set('pIndex', 'users__adminindex');
+ $this->render(null, 'admin_default-e14');
+ }
+
+ public function admin_view($id = 0) {
+ return $this->redirect(array('action' => 'view', 'admin' => false, $id));
+ }
+ public function view($id = 0) {
+ if (!$id) {
+ return $this->redirect(array("action" => "index"));
+ }
+ if (!$this->Client->exists($id)) {
+ throw new NotFoundException(__('Invalid username'));
+ }
+ $this->set('client', $this->Client->findById($id));
+ $this->set('pIndex', 'users__view');
+ $this->render(null, 'default-e14');
+ }
+ public function admin_add() {
+ return $this->redirect(array('action' => 'add', 'admin' => false));
+ }
+ public function add() {
+ if ($this->request->is('post')) {
+ $this->Client->create();
+ if ($this->Client->save($this->request->data)) {
+ $this->Flash->success(__('Subscription success'));
+ $id = $this->Client->id;
+ $this->request->data['Client'] = array_merge(
+ $this->request->data['Client'],
+ array('id' => $id)
+ );
+ /* Desaffectaction du 'password' en requete,
+ pour éviter la sauvegarde en session en clair du mot de passe en appelant login.
+ unset($this->request->data['Client']['id_motdepasse']);*/
+ $this->Auth->login($this->request->data['Client']);
+ /* Le mot de passe sera cree ensuite */
+ return $this->redirect(array('controller' => 'MotDePasse', 'action' => 'add', $id));
+ } else {
+ $this->Flash->error(__('Failed to subscribe. Please try again'));
+ }
+ }
+ $this->set('pIndex', 'users__add');
+ $this->render(null, 'default-e14');
+ }
+ public function admin_edit($id = null, $id_motdepasse = null) {
+ return $this->redirect(array('action' => 'edit', 'admin' => false, $id, $id_motdepasse));
+ }
+ public function edit($id = null, $id_motdepasse = null) {
+ $this->Client->id = $id;
+ if (!$this->Client->exists()) {
+ throw new NotFoundException(__('Invalid username'));
+ }
+ if(isset($id_motdepasse)) {
+ $this->Client->id_motdepasse = $id_motdepasse;
+ }
+ if ($this->request->is('post') || $this->request->is('put')) {
+ if ($this->Client->save($this->request->data)) {
+ $this->Flash->success(__('Saved changes success!'));
+ return $this->redirect(array('action' => 'index'));
+ } else {
+ $this->Flash->error(__('Failed to save changes. Please try again'));
+ }
+ } else {
+ $this->request->data = $this->Client->findById($id);
+ /* Desaffectaction du 'password' en requete,
+ pour éviter la sauvegarde en session en clair du mot de passe en appelant login. */
+ unset($this->request->data['Client']['id_motdepasse']);
+ }
+ $this->set('pIndex', 'users__edit');
+ $this->render(null, 'default-e14');
+ }
+ public function admin_delete($id = null) {
+ return $this->redirect(array('action' => 'delete', 'admin' => false));
+ }
+
+ public function delete($id = null) {
+ // Avant 2.5, utilisez
+ // $this->request->onlyAllow('post');
+
+ $this->request->allowMethod('post');
+
+ $this->Client->id = $id;
+ if (!$this->Client->exists()) {
+ throw new NotFoundException(__('Invalid username'));
+ }
+ if ($this->Client->delete()) {
+ $this->Flash->success(__('Subscription was removed'));
+ return $this->redirect(array('action' => 'index'));
+ }
+ $this->Flash->error(__('Subscription could NOT be removed'));
+ return $this->redirect(array('action' => 'index'));
+ }
+
+ public function admin_recovery() {
+ return $this->redirect(array('action' => 'recovery', 'admin' => false));
+ }
+ public function recovery() {
+ $this->set('client', $this->Client);
+ $Email = new CakeEmail();
+ $Email->helpers(array('Html', 'Text'));
+ /* app/view/Emails*/
+ $Email->template('recovery', 'default')
+ ->emailFormat('html')
+ ->to($this->Client->email)
+ ->send();
+ }
+
+}
+?>
diff --git a/app/Controller/Component/MyFlashComponent.php b/app/Controller/Component/MyFlashComponent.php
index d02e30b14..bf6f59750 100644
--- a/app/Controller/Component/MyFlashComponent.php
+++ b/app/Controller/Component/MyFlashComponent.php
@@ -31,18 +31,23 @@ public function beforeRender(Controller $controller) {
public function shutDown(Controller $controller) {
parent::shutdown($controller);
-
+
}
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
parent::beforeRedirect($controller, $url, $status, $exit);
}
-
- public function success($message) {
+
+ public function success($message) {
$this->set($message, array('params' => array('class' => 'success')));
}
-
+
public function error($message) {
$this->set($message, array('params' => array('class' => 'error')));
}
+
+ public function notice($message) {
+ $this->set($message, array('params' => array('class' => 'notice')));
+ }
+
}
diff --git a/app/Controller/E14Controller.php b/app/Controller/E14Controller.php
index 313107f8c..4da7d1f39 100644
--- a/app/Controller/E14Controller.php
+++ b/app/Controller/E14Controller.php
@@ -22,6 +22,9 @@ public function __construct($request = null, $response = null) {
$route = Router::currentRoute();
i_debug($route);
}
+ public function beforeFilter() {
+ $this->Auth->allow();
+ }
/** @param string $p page filename.php (optional)
*/
public function index($p = NULL, $images = NULL) {
diff --git a/app/Controller/MessageController.php b/app/Controller/MessageController.php
index 882fa38db..9f4ef0c92 100644
--- a/app/Controller/MessageController.php
+++ b/app/Controller/MessageController.php
@@ -11,11 +11,15 @@
*/
class MessageController extends AppController {
- public function index($fk_identifiant = null) {
- if ($fk_identifiant === null) {
+ public function __construct($request = null, $response = null) {
+ parent::__construct($request, $response);
+ }
+
+ public function index($id = null) {
+ if ($id === null) {
$this->set('messages', $this->Message->find('all'));
} else {
- $this->set('messages', $this->Message->find($fk_identifiant));
+ $this->set('messages', $this->Message->find($id));
}
$this->set("pIndex","contactus__index");
$this->render(null, "default-e14");
@@ -25,8 +29,6 @@ public function index($fk_identifiant = null) {
* @param String $p method name
*/
public function admin_index($p = null) {
- //debug($this->request->params);
- //debug($GLOBALS);
$this->set('pIndex', 'admin__contactus');
$this->set('pMethod', $p);
$this->render(null, "default-e14");
@@ -49,15 +51,80 @@ public function view($id) {
public function add($id = null) {
if (empty($this->request->data)) {
$this->request->data = $this->Message->findById($id);
- } else {
- /* sauvegarde du message */
- include_once APP . $r->r['include__php_constantes.inc'];
- /* ajouter dans la base de donnees */
- $sql = new SQL(SERVEUR, BASE, CLIENT, CLIENT_MDP);
- }
+ } else if ($this->request->is('post')) {
+ $this->Message->create();
+ $this->request->data['Message']['id'] = $this->Auth->user('id');
+ if ($this->Message->save($this->request->data)) {
+ $this->Flash->success(__('Message posted'));
+ return $this->redirect(array('action' => 'index'));
+ }
+ $this->Flash->error(__('Unable to post the message'));
+ }
$this->set("pIndex","contactus__write");
$this->render(null, "default-e14");
}
+
+ public function edit($id = null) {
+ if (!$id) {
+/* throw new NotFoundException(__('Invalid message'));*/
+ return $this->redirect(array('action' => 'add'));
+ }
+
+ $post = $this->Message->findById($id);
+ if (!$post) {
+ throw new NotFoundException(__('Invalid message'));
+ }
+
+ if ($this->request->is(array('post', 'put'))) {
+ $this->Message->id = $id;
+ if ($this->Message->save($this->request->data)) {
+ $this->Flash->success(__('Message was successfully updated'));
+ return $this->redirect(array('action' => 'index'));
+ }
+ $this->Flash->error(__('Impossible to modify the message'));
+ }
+
+ if (!$this->request->data) {
+ $this->request->data = $post;
+ }
+ $this->set("pIndex","contactus__edit");
+ $this->render(null, "default-e14");
+}
+ public function delete($id) {
+ /* devier les requetes delete?id=
+ Paginator->counter(array(
+ 'format' => __('Page {:page} of {:pages}, display from {:current} records out of {:count}, starting from record {:start}, until {:end}')
+ ));
+ ?> ,
Total Queries: %s queries"
msgstr ""
-#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:47
+#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:67
+msgid "%s duplicate queries run."
+msgstr ""
+
+#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:70
msgid "Query Explain:"
msgstr ""
-#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:50
+#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:73
msgid "Click an \"Explain\" link above, to see the query explanation."
msgstr ""
-#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:55
+#: Plugin/DebugKit/View/Elements/sql_log_panel.ctp:79
msgid "No active database connections"
msgstr ""
@@ -238,7 +250,7 @@ msgstr ""
msgid "View Variables"
msgstr ""
-#: Plugin/DebugKit/View/Helper/DebugTimerHelper.php:45
+#: Plugin/DebugKit/View/Helper/DebugTimerHelper.php:44
msgid "Rendering View"
msgstr ""
@@ -246,11 +258,11 @@ msgstr ""
msgid "Rendering %s"
msgstr ""
-#: Plugin/DebugKit/View/Helper/DebugTimerHelper.php:86
+#: Plugin/DebugKit/View/Helper/DebugTimerHelper.php:88
msgid "View render complete"
msgstr ""
-#: Plugin/DebugKit/View/Helper/HtmlToolbarHelper.php:205
+#: Plugin/DebugKit/View/Helper/HtmlToolbarHelper.php:231
msgid "Explain"
msgstr ""
@@ -262,7 +274,7 @@ msgstr ""
msgid "No markup errors found"
msgstr ""
-#: Plugin/DebugKit/View/Helper/ToolbarHelper.php:189
+#: Plugin/DebugKit/View/Helper/ToolbarHelper.php:190
msgid "maybe slow"
msgstr ""
diff --git a/app/Locale/default.pot b/app/Locale/default.pot
index 016f6fa4c..d81f7919b 100644
--- a/app/Locale/default.pot
+++ b/app/Locale/default.pot
@@ -13,15 +13,457 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: Controller/ArticleController.php:52
-msgid "Invalid article"
+#: Controller/ClientController.php:29
+msgid "Invalid username or password"
msgstr ""
-#: Controller/ArticleController.php:62
-msgid "Your article has been saved."
+#: Controller/ClientController.php:63;101;134
+msgid "Invalid username"
msgstr ""
-#: Controller/ArticleController.php:65
-msgid "Unable to add your article."
+#: Controller/ClientController.php:76
+msgid "Subscription success"
+msgstr ""
+
+#: Controller/ClientController.php:89
+msgid "Failed to subscribe. Please try again"
+msgstr ""
+
+#: Controller/ClientController.php:108
+msgid "Saved changes success!"
+msgstr ""
+
+#: Controller/ClientController.php:111
+msgid "Failed to save changes. Please try again"
+msgstr ""
+
+#: Controller/ClientController.php:137
+msgid "Subscription was removed"
+msgstr ""
+
+#: Controller/ClientController.php:140
+msgid "Subscription could NOT be removed"
+msgstr ""
+
+#: Controller/MessageController.php:39;44;76
+msgid "Invalid message"
+msgstr ""
+
+#: Controller/MessageController.php:58
+msgid "Message posted"
+msgstr ""
+
+#: Controller/MessageController.php:61
+msgid "Unable to post the message"
+msgstr ""
+
+#: Controller/MessageController.php:82
+msgid "Message was successfully updated"
+msgstr ""
+
+#: Controller/MessageController.php:85
+msgid "Impossible to modify the message"
+msgstr ""
+
+#: Controller/MessageController.php:102
+msgid "Message %s was successfully removed."
+msgstr ""
+
+#: Controller/MessageController.php:106
+msgid "Message %s could NOT be removed"
+msgstr ""
+
+#: Controller/MotDePasseController.php:33
+msgid "Password was NOT saved"
+msgstr ""
+
+#: Controller/MotDePasseController.php:38
+msgid "Subscription saving %s..."
+msgstr ""
+
+#: Controller/MotDePasseController.php:49;70
+msgid "Password could NOT be saved. Please try again"
+msgstr ""
+
+#: Controller/MotDePasseController.php:59;89
+msgid "Invalid password"
+msgstr ""
+
+#: Controller/MotDePasseController.php:67
+msgid "Password was saved"
+msgstr ""
+
+#: Controller/MotDePasseController.php:96
+msgid "Password was removed"
+msgstr ""
+
+#: Controller/MotDePasseController.php:100
+msgid "Invalid '%s' subscription"
+msgstr ""
+
+#: Controller/MotDePasseController.php:102
+msgid "Subscription '%s' doesn't match the password"
+msgstr ""
+
+#: Controller/MotDePasseController.php:104
+msgid "Password could NOT be removed"
+msgstr ""
+
+#: Plugin/Datasources/Model/Datasource/ArraySource.php:125
+msgid "No records found in model."
+msgstr ""
+
+#: Plugin/Datasources/Model/Datasource/CouchdbSource.php:80
+msgid "CouchDB Error: connection failed"
+msgstr ""
+
+#: Plugin/Datasources/Model/Datasource/XmlrpcSource.php:133
+msgid "Transport error - could not open socket"
+msgstr ""
+
+#: Plugin/Datasources/Model/Datasource/XmlrpcSource.php:136
+msgid "Transport error - HTTP status code was not 200"
+msgstr ""
+
+#: Plugin/Datasources/Model/Datasource/XmlrpcSource.php:180
+msgid "Parse error. Not well formed"
+msgstr ""
+
+#: View/Client/add.ctp:4
+msgid "Add a new subscription"
+msgstr ""
+
+#: View/Client/add.ctp:6
+#: View/Client/edit.ctp:6
+#: View/Client/view.ctp:4
+msgid "My username"
+msgstr ""
+
+#: View/Client/add.ctp:7
+#: View/Client/edit.ctp:7
+#: View/Client/view.ctp:9
+msgid "My email address"
+msgstr ""
+
+#: View/Client/add.ctp:9
+#: View/Client/edit.ctp:9
+#: View/Client/view.ctp:14
+msgid "My first name"
+msgstr ""
+
+#: View/Client/add.ctp:10
+#: View/Client/edit.ctp:10
+#: View/Client/view.ctp:19
+msgid "My name"
+msgstr ""
+
+#: View/Client/add.ctp:11
+#: View/Client/edit.ctp:11
+#: View/Client/view.ctp:24
+msgid "My birthday"
+msgstr ""
+
+#: View/Client/add.ctp:12
+#: View/Client/edit.ctp:12
+#: View/Client/view.ctp:29
+msgid "My street address"
+msgstr ""
+
+#: View/Client/add.ctp:13
+#: View/Client/edit.ctp:13
+#: View/Client/view.ctp:34
+msgid "My city code"
+msgstr ""
+
+#: View/Client/add.ctp:14
+#: View/Client/edit.ctp:14
+#: View/Client/view.ctp:39
+msgid "My city"
+msgstr ""
+
+#: View/Client/add.ctp:15
+#: View/Client/edit.ctp:15
+#: View/Client/view.ctp:44
+msgid "My country"
+msgstr ""
+
+#: View/Client/add.ctp:26
+#: View/Client/edit.ctp:26
+msgid "Continue"
+msgstr ""
+
+#: View/Client/add.ctp:29
+#: View/Client/admin_index.ctp:20;70
+#: View/Client/edit.ctp:29
+#: View/Client/index.ctp:5
+#: View/Client/login.ctp:14
+#: View/Client/view.ctp:72
+#: View/Emails/html/recovery.ctp:5
+#: View/Emails/text/recovery.ctp:5
+#: View/MotDePasse/add.ctp:19
+#: View/MotDePasse/edit.ctp:19
+#: View/MotDePasse/index.ctp:4
+#: View/MotDePasse/view.ctp:32
+msgid "Actions"
+msgstr ""
+
+#: View/Client/add.ctp:31
+msgid "My subscription"
+msgstr ""
+
+#: View/Client/admin_index.ctp:2
+msgid "Profils clients"
+msgstr ""
+
+#: View/Client/admin_index.ctp:45
+msgid "View"
+msgstr ""
+
+#: View/Client/admin_index.ctp:46
+msgid "Modify"
+msgstr ""
+
+#: View/Client/admin_index.ctp:47
+#: View/Client/edit.ctp:32
+msgid "Unsubscribe"
+msgstr ""
+
+#: View/Client/admin_index.ctp:49
+#: View/Client/view.ctp:78
+msgid "Are you sure to unsubscribe # %s?"
+msgstr ""
+
+#: View/Client/admin_index.ctp:58
+msgid "Page {:page} of {:pages}, display from {:current} records out of {:count}, starting from record {:start}, until {:end}"
+msgstr ""
+
+#: View/Client/admin_index.ctp:63
+msgid "previous"
+msgstr ""
+
+#: View/Client/admin_index.ctp:65
+msgid "next"
+msgstr ""
+
+#: View/Client/admin_index.ctp:72
+msgid "Subscribe"
+msgstr ""
+
+#: View/Client/edit.ctp:4
+msgid "Modify my profile information"
+msgstr ""
+
+#: View/Client/edit.ctp:31
+#: View/Client/view.ctp:81
+msgid "Change my password"
+msgstr ""
+
+#: View/Client/edit.ctp:32
+msgid "Are you sure you want to remove # %s?"
+msgstr ""
+
+#: View/Client/edit.ctp:33
+msgid "Member list"
+msgstr ""
+
+#: View/Client/index.ctp:2
+msgid "Dashboard"
+msgstr ""
+
+#: View/Client/index.ctp:7
+msgid "Connect"
+msgstr ""
+
+#: View/Client/index.ctp:8
+#: View/Client/login.ctp:15
+msgid "New subscription"
+msgstr ""
+
+#: View/Client/login.ctp:6
+msgid "Please enter an username"
+msgstr ""
+
+#: View/Client/login.ctp:12
+msgid "Sign in"
+msgstr ""
+
+#: View/Client/login.ctp:16
+msgid "Forgot my password ?"
+msgstr ""
+
+#: View/Client/view.ctp:2
+msgid "Client"
+msgstr ""
+
+#: View/Client/view.ctp:49
+msgid "My phone number"
+msgstr ""
+
+#: View/Client/view.ctp:54
+msgid "My role"
+msgstr ""
+
+#: View/Client/view.ctp:59
+msgid "Created on"
+msgstr ""
+
+#: View/Client/view.ctp:64
+msgid "Modified on"
+msgstr ""
+
+#: View/Client/view.ctp:74
+msgid "Modify subscription"
+msgstr ""
+
+#: View/Client/view.ctp:75
+msgid "Remove subscription"
+msgstr ""
+
+#: View/Emails/html/recovery.ctp:1
+#: View/Emails/text/recovery.ctp:1
+msgid "Cher utilisateur %s"
+msgstr ""
+
+#: View/Emails/html/recovery.ctp:2
+#: View/Emails/text/recovery.ctp:2
+msgid "Vous avez demandé la récupération de votre mot de passe. Par sécurité, nous vous recommandons de réinitialiser celui-ci."
+msgstr ""
+
+#: View/Emails/html/recovery.ctp:3
+#: View/Emails/text/recovery.ctp:3
+msgid "Si vous n'êtes pas l'auteur de cette demande, vous pouvez ignorer ce message."
+msgstr ""
+
+#: View/Emails/html/recovery.ctp:7
+#: View/Emails/text/recovery.ctp:6
+msgid "Réinitialiser le mot de passe"
+msgstr ""
+
+#: View/Emails/html/recovery.ctp:12
+#: View/Emails/text/recovery.ctp:9
+msgid "Ce message est généré à la demande de l'utilisateur."
+msgstr ""
+
+#: View/Message/add.ctp:4
+#: View/Message/edit.ctp:4
+msgid "Sujet de votre message"
+msgstr ""
+
+#: View/Message/add.ctp:7
+#: View/Message/edit.ctp:7
+msgid "Contenu du message"
+msgstr ""
+
+#: View/Message/add.ctp:9
+msgid "Auteur"
+msgstr ""
+
+#: View/Message/add.ctp:11
+#: View/Message/edit.ctp:11
+msgid "Date"
+msgstr ""
+
+#: View/Message/add.ctp:13
+msgid "Poster un ticket"
+msgstr ""
+
+#: View/Message/edit.ctp:2
+#: View/Message/index.ctp:20
+msgid "Modifier un message"
+msgstr ""
+
+#: View/Message/edit.ctp:9
+msgid "Pseudonyme"
+msgstr ""
+
+#: View/Message/edit.ctp:14
+msgid "Sauvegarder"
+msgstr ""
+
+#: View/Message/index.ctp:5
+msgid "Poster un message"
+msgstr ""
+
+#: View/Message/index.ctp:8
+msgid "Tableau de bord"
+msgstr ""
+
+#: View/Message/index.ctp:9
+#: View/Message/view.ctp:5
+msgid "date"
+msgstr ""
+
+#: View/Message/index.ctp:9
+#: View/Message/view.ctp:5
+msgid "titre"
+msgstr ""
+
+#: View/Message/index.ctp:9
+msgid "id"
+msgstr ""
+
+#: View/Message/index.ctp:24
+msgid "Supprimer"
+msgstr ""
+
+#: View/Message/view.ctp:4
+msgid "Ticket view"
+msgstr ""
+
+#: View/MotDePasse/add.ctp:4
+msgid "Créer mon mot de passe"
+msgstr ""
+
+#: View/MotDePasse/add.ctp:16
+#: View/MotDePasse/edit.ctp:16
+msgid "Soumettre"
+msgstr ""
+
+#: View/MotDePasse/add.ctp:21
+#: View/MotDePasse/edit.ctp:28
+msgid "Mon profil"
+msgstr ""
+
+#: View/MotDePasse/edit.ctp:4
+#: View/MotDePasse/index.ctp:6
+#: View/MotDePasse/view.ctp:34
+msgid "Modifier mon mot de passe"
+msgstr ""
+
+#: View/MotDePasse/edit.ctp:22
+#: View/MotDePasse/index.ctp:7
+#: View/MotDePasse/view.ctp:35
+msgid "Réinitialiser mon mot de passe"
+msgstr ""
+
+#: View/MotDePasse/edit.ctp:26
+#: View/MotDePasse/index.ctp:11
+#: View/MotDePasse/view.ctp:39
+msgid "Êtes-vous certain de réinitialiser votre mot de passe ?"
+msgstr ""
+
+#: View/MotDePasse/index.ctp:2
+#: View/MotDePasse/view.ctp:2;9
+msgid "Mot de passe"
+msgstr ""
+
+#: View/MotDePasse/index.ctp:13
+msgid "Modifier le profil"
+msgstr ""
+
+#: View/MotDePasse/view.ctp:4
+msgid "Id"
+msgstr ""
+
+#: View/MotDePasse/view.ctp:14
+msgid "Confirmation du mot de passe"
+msgstr ""
+
+#: View/MotDePasse/view.ctp:19
+msgid "Créé le"
+msgstr ""
+
+#: View/MotDePasse/view.ctp:24
+msgid "Modifié le"
msgstr ""
diff --git a/app/Locale/formulaire.pot b/app/Locale/formulaire.pot
new file mode 100644
index 000000000..8a19a53e3
--- /dev/null
+++ b/app/Locale/formulaire.pot
@@ -0,0 +1,71 @@
+# LANGUAGE translation of CakePHP Application
+# Copyright YEAR NAME
+
+
+
+
+
+
+
+
+
+ Paginator->sort('id'); ?>
+ Paginator->sort('email'); ?>
+ Paginator->sort('id_motdepasse'); ?>
+ Paginator->sort('nom'); ?>
+ Paginator->sort('prenom'); ?>
+ Paginator->sort('annee_de_naissance'); ?>
+ Paginator->sort('adresse'); ?>
+ Paginator->sort('codepostal'); ?>
+ Paginator->sort('ville'); ?>
+ Paginator->sort('pays'); ?>
+ Paginator->sort('telephone'); ?>
+ Paginator->sort('role'); ?>
+ Paginator->sort('cree'); ?>
+ Paginator->sort('modifie'); ?>
+
+
+
+
+
+
+
+
+ Html->link(strlen($client['MotDePasse']['password']), array(
+ 'controller' => 'Motdepasse', 'action' => 'view', $client['MotDePasse']['id']
+ )); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Html->link(__('View'), array('action' => 'view', $client['Client']['id'])); ?>
+ Html->link(__('Modify'), array('action' => 'edit', $client['Client']['id'])); ?>
+ Form->postLink(__('Unsubscribe'), array(
+ 'action' => 'delete', $client['Client']['id']), array(
+ 'confirm' => __('Are you sure to unsubscribe # %s?', $client['Client']['id']))); ?>
+
+
+
+
+
+
+
+
+
diff --git a/app/View/Client/view.ctp b/app/View/Client/view.ctp
new file mode 100644
index 000000000..3dc6a6ad2
--- /dev/null
+++ b/app/View/Client/view.ctp
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+ : + +
+queryString)) : ?> ++ : + queryString); ?> +
+ +params)) : ?> + : + params); ?> + +: Schema/myschema.php +:
./configure.sh -d -u -p<sql-root-password>+ +element('exception_stack_trace'); +?> diff --git a/app/View/Message/add.ctp b/app/View/Message/add.ctp index 3017dc18d..84ffba8b5 100644 --- a/app/View/Message/add.ctp +++ b/app/View/Message/add.ctp @@ -1,14 +1,14 @@ Form->create('Message'); - echo $this->Form->input('titre', array('label' => $r->lang('titre', 'contactus'), + echo $this->Form->create('Message'); + echo $this->Form->input('titre', array('label' => __('Sujet de votre message'), 'required' => true)); - echo $this->Form->input('texte', array('label' => $r->lang('texte', 'contactus'), + echo $this->Form->input('texte', array( + 'label' => __('Contenu du message'), 'required' => true)); - echo $this->Form->input('fk_identifiant', array('label' => $r->lang('identifiant', 'contactus'), + echo $this->Form->input('id', array('label' => __('Auteur'), 'required' => true)); - echo $this->Form->input('date', array('label' => $r->lang('date', 'contactus'), + echo $this->Form->input('date', array('label' => __('Date'), 'required' => true)); - echo $this->Form->end($r->lang('write', 'contactus')); -?> \ No newline at end of file + echo $this->Form->end(__('Poster un ticket')); +?> diff --git a/app/View/Message/edit.ctp b/app/View/Message/edit.ctp new file mode 100644 index 000000000..c63505d67 --- /dev/null +++ b/app/View/Message/edit.ctp @@ -0,0 +1,15 @@ +Form->create('Message'); +echo $this->Form->input('titre', array('label' => __('Sujet de votre message'), + 'required' => true)); +echo $this->Form->input('texte', array( + 'label' => __('Contenu du message'), + 'required' => true)); +echo $this->Form->input('id', array('label' => __('Pseudonyme'), + 'required' => true)); +echo $this->Form->input('date', array('label' => __('Date'), + 'required' => true)); +echo $this->Form->input('id', array('hidden' => true)); +echo $this->Form->end(__('Sauvegarder')); +?> diff --git a/app/View/Message/index.ctp b/app/View/Message/index.ctp index c39bae0f2..1c809ed88 100644 --- a/app/View/Message/index.ctp +++ b/app/View/Message/index.ctp @@ -1,20 +1,30 @@ lang("contactus")); -$t->setContenu_Ligne(0, $r->lang(array("date", "titre", "identifiant"), "contactus")); +require APP . $r->r['include__php_tbl.class.inc']; +echo $this->Html->link( + __('Poster un message'), + array('controller' => 'message', 'action' => 'add') +); +$t = new Tableau(count($messages) + 1, 5, __('Tableau de bord')); +$t->setContenu_Ligne(0, array(__('date'), __('titre'), __('id'))); /* On fait un tour des $messages array */ for ($i = 1; $i < count($messages) + 1; $i++) { $message = $messages[$i - 1]; - $t->setContenu_Cellule($i, 0, $message['Message']['fk_identifiant']); - $t->setContenu_Cellule($i, 1, $this->Html->link($message['Message']['id'], array('controller' => 'message', - 'action' => 'view', - array($message['Message']['id']))) + $t->setContenu_Cellule($i, 0, $message['Message']['date']); + $t->setContenu_Cellule($i, 1, $this->Html->link($message['Message']['titre'], array( + 'action' => 'view', $message['Message']['id'])) + ); + $t->setContenu_Cellule($i, 2, $this->Text->autoLinkEmails($message['Message']['id'])); + $t->setContenu_Cellule($i, 3, $this->Html->link(__('Modifier un message'), array( + 'action' => 'edit', $message['Message']['id'])) + ); + $t->setContenu_Cellule($i, 4, $this->Form->postLink( + __('Supprimer'), + array('action' => 'delete', $message['Message']['id']), + array('confirm' => 'Êtes-vous sûr ?')) ); - $t->setContenu_Cellule($i, 2, $message['Message']['published']); } -echo $t->fin(); +echo $t->fin(4); ?> diff --git a/app/View/Message/view.ctp b/app/View/Message/view.ctp index 9c6d35451..cf939920f 100644 --- a/app/View/Message/view.ctp +++ b/app/View/Message/view.ctp @@ -1,12 +1,12 @@ lang("view", "contactus")); - $t->setContenu_Colonne(0, $r->lang(array("date", "titre", "texte"), "contactus")); + require APP . $r->r['include__php_tbl.class.inc']; + $t = new Tableau(3, 2, __('Ticket view')); + $t->setContenu_Colonne(0, array(__('date'), __('titre'), + $this->Text->autoLinkEmails($message['id']) + )); $t->setContenu_Cellule(0, 1, $message['Message']['date']); $t->setContenu_Cellule(1, 1, $message['Message']['titre']); - $t->setContenu_Cellule(2, 2, $message['Message']['texte']); - $t->fin(1); - + $t->setContenu_Cellule(2, 1, $this->Markdown->transform($this->Text->autoLink($message['Message']['texte']))); + echo $t->fin(4); ?> diff --git a/app/View/MotDePasse/add.ctp b/app/View/MotDePasse/add.ctp new file mode 100644 index 000000000..ec5d1e03b --- /dev/null +++ b/app/View/MotDePasse/add.ctp @@ -0,0 +1,23 @@ +