From 21e4d71652c90025c0c176143f3db7e37f8d4988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20DUBUC?= Date: Thu, 10 Oct 2013 17:36:31 +0200 Subject: [PATCH] Mise a jour data_path --- application/configs/application.ini | 2 +- .../GestionDesDocumentsController.php | 2 +- .../controllers/PieceJointeController.php | 6 ++-- application/controllers/UserController.php | 8 ++---- .../views/scripts/dossier/creationdoc.phtml | 12 ++++---- .../scripts/dossier/dialoggenrapport.phtml | 2 +- .../scripts/dossier/generationconvoc.phtml | 8 +++--- .../views/scripts/dossier/generationodj.phtml | 26 +++++++++--------- {data => public/data}/sessions/.gitignore | 0 public/data/uploads/avatars/large/1.jpg | Bin 0 -> 7336 bytes .../data}/uploads/avatars/large/default.jpg | Bin public/data/uploads/avatars/medium/1.jpg | Bin 0 -> 4257 bytes .../data}/uploads/avatars/medium/default.jpg | Bin public/data/uploads/avatars/small/1.jpg | Bin 0 -> 970 bytes .../data}/uploads/avatars/small/default.jpg | Bin .../data}/uploads/courriers/.gitignore | 0 .../liste champs courrier rapport.odt | Bin .../data}/uploads/pieces-jointes/.gitignore | 0 .../pieces-jointes/miniatures/.gitignore | 0 public/index.php | 6 +++- 20 files changed, 37 insertions(+), 35 deletions(-) rename {data => public/data}/sessions/.gitignore (100%) create mode 100644 public/data/uploads/avatars/large/1.jpg rename {data => public/data}/uploads/avatars/large/default.jpg (100%) create mode 100644 public/data/uploads/avatars/medium/1.jpg rename {data => public/data}/uploads/avatars/medium/default.jpg (100%) create mode 100644 public/data/uploads/avatars/small/1.jpg rename {data => public/data}/uploads/avatars/small/default.jpg (100%) rename {data => public/data}/uploads/courriers/.gitignore (100%) rename {data => public/data}/uploads/documents/liste champs courrier rapport.odt (100%) rename {data => public/data}/uploads/pieces-jointes/.gitignore (100%) rename {data => public/data}/uploads/pieces-jointes/miniatures/.gitignore (100%) diff --git a/application/configs/application.ini b/application/configs/application.ini index bd8200ac..4b863ea3 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -30,7 +30,7 @@ resources.view.helperPath.Application_Layout_Helper = APPLICATION_PATH "/layouts [development : general] ; Sauvegarde des sessions dans le dossier prevarisc -resources.session.save_path = APPLICATION_PATH "/../data/sessions" +resources.session.save_path = APPLICATION_PATH "/../public/data/sessions" ; Activation de l'affichage des erreurs phpSettings.display_startup_errors = 1 diff --git a/application/controllers/GestionDesDocumentsController.php b/application/controllers/GestionDesDocumentsController.php index 898c2cf6..29b5a0f8 100644 --- a/application/controllers/GestionDesDocumentsController.php +++ b/application/controllers/GestionDesDocumentsController.php @@ -6,7 +6,7 @@ class GestionDesDocumentsController extends Zend_Controller_Action public function init() { - $this->path = DATA_PATH . "/uploads/documents"; + $this->path = REAL_DATA_PATH . "/uploads/documents"; // Actions à effectuées en AJAX $ajaxContext = $this->_helper->getHelper('AjaxContext'); diff --git a/application/controllers/PieceJointeController.php b/application/controllers/PieceJointeController.php index 93effd6c..adf89903 100644 --- a/application/controllers/PieceJointeController.php +++ b/application/controllers/PieceJointeController.php @@ -6,7 +6,7 @@ class PieceJointeController extends Zend_Controller_Action public function init() { - $this->path = DATA_PATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . "pieces-jointes" . DIRECTORY_SEPARATOR; + $this->path = REAL_DATA_PATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . "pieces-jointes" . DIRECTORY_SEPARATOR; // Actions à effectuées en AJAX $ajaxContext = $this->_helper->getHelper('AjaxContext'); @@ -89,7 +89,7 @@ public function indexAction() // On envoi la liste des PJ dans la vue $this->view->listePj = $listePj; //Zend_Debug::dump($this->view->listePj); - $this->view->path = $this->path; + $this->view->path = DATA_PATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . "pieces-jointes" . DIRECTORY_SEPARATOR;; } public function formAction() @@ -251,7 +251,7 @@ public function checkAction() // Données de la pj $this->view->html = $this->view->partial("piece-jointe/display.phtml", array ( - "path" => $this->path, + "path" => DATA_PATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR . "pieces-jointes" . DIRECTORY_SEPARATOR, "listePj" => $DBused->fetchAll("ID_PIECEJOINTE = " . $this->_request->idpj)->toArray(), "droit_ecriture" => true, "type" => $this->_request->type, diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 360cd1b7..f81a6445 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -138,13 +138,11 @@ public function editAvatarAction() if($this->_helper->Droits()->get()->DROITADMINSYS_GROUPE == 0 && Zend_Auth::getInstance()->getIdentity()->ID_UTILISATEUR != $_POST["id"]) $this->_helper->Droits()->redirect(); - require_once 'GD/GD_resize.php'; - if ($_FILES["AVATAR"]["size"] < 1024 * 1024) { - GD_resize($_FILES["AVATAR"]["tmp_name"], DATA_PATH . "/uploads/avatars/small/" . $_POST["id"] . ".jpg", 25, 25); - GD_resize($_FILES["AVATAR"]["tmp_name"], DATA_PATH . "/uploads/avatars/medium/" . $_POST["id"] . ".jpg", 150); - GD_resize($_FILES["AVATAR"]["tmp_name"], DATA_PATH . "/uploads/avatars/large/" . $_POST["id"] . ".jpg", 224); + GD_resize::run($_FILES["AVATAR"]["tmp_name"], REAL_DATA_PATH . "/uploads/avatars/small/" . $_POST["id"] . ".jpg", 25, 25); + GD_resize::run($_FILES["AVATAR"]["tmp_name"], REAL_DATA_PATH . "/uploads/avatars/medium/" . $_POST["id"] . ".jpg", 150); + GD_resize::run($_FILES["AVATAR"]["tmp_name"], REAL_DATA_PATH . "/uploads/avatars/large/" . $_POST["id"] . ".jpg", 224); // CALLBACK echo ""; diff --git a/application/views/scripts/dossier/creationdoc.phtml b/application/views/scripts/dossier/creationdoc.phtml index 90a33969..2d44ab08 100644 --- a/application/views/scripts/dossier/creationdoc.phtml +++ b/application/views/scripts/dossier/creationdoc.phtml @@ -13,7 +13,7 @@ $odf = new odf("./data/uploads/documents/modele_rapport_visite.odt"); } */ -//echo DATA_PATH.$this->fichierSelect; +//echo REAL_DATA_PATH.$this->fichierSelect; function verifInfos($var){ if($var == ''){ @@ -23,7 +23,7 @@ function verifInfos($var){ } } -$odf = new Odf(DATA_PATH.DIRECTORY_SEPARATOR.$this->fichierSelect); +$odf = new Odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR.$this->fichierSelect); try { $odf->setVars('libelle_commission',verifInfos($this->commissionInfos['LIBELLE_COMMISSION']),true,'UTF8'); @@ -260,14 +260,14 @@ try{ //echo $this->idPieceJointe; try{ - $chemin = DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idPieceJointe.".odt"; + $chemin = REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idPieceJointe.".odt"; $odf->saveToDisk($chemin); } catch (OdfException $e) { } -$content_dir = DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idRapportPj.'/'; +$content_dir = REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idRapportPj.'/'; -//echo DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idPieceJointe.".odt"; -//echo DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idRapportPj.'/'; +//echo REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idPieceJointe.".odt"; +//echo REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$this->idRapportPj.'/'; ?> \ No newline at end of file diff --git a/application/views/scripts/dossier/dialoggenrapport.phtml b/application/views/scripts/dossier/dialoggenrapport.phtml index bd36904c..c8e1e53f 100644 --- a/application/views/scripts/dossier/dialoggenrapport.phtml +++ b/application/views/scripts/dossier/dialoggenrapport.phtml @@ -16,7 +16,7 @@
"; echo "Selectionnez le rapport que vous souhaitez générer :  "; - $dirname = DATA_PATH . "/uploads/documents"; + $dirname = REAL_DATA_PATH . "/uploads/documents"; $dir = opendir($dirname); echo "