Skip to content

Commit

Permalink
Mise a jour data_path
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubuc committed Oct 10, 2013
1 parent 32ad268 commit 21e4d71
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 35 deletions.
2 changes: 1 addition & 1 deletion application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/GestionDesDocumentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/PieceJointeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions application/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<script type='text/javascript'>window.top.window.callback();</script>";
Expand Down
12 changes: 6 additions & 6 deletions application/views/scripts/dossier/creationdoc.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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 == ''){
Expand All @@ -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');
Expand Down Expand Up @@ -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.'/';
?>
2 changes: 1 addition & 1 deletion application/views/scripts/dossier/dialoggenrapport.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<form name='etabRapport' id='etabRapport'>
";
echo "Selectionnez le rapport que vous souhaitez générer : &nbsp;";
$dirname = DATA_PATH . "/uploads/documents";
$dirname = REAL_DATA_PATH . "/uploads/documents";
$dir = opendir($dirname);

echo "<select name='fichierSelect' id='fichierSelect' >";
Expand Down
8 changes: 4 additions & 4 deletions application/views/scripts/dossier/generationconvoc.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ foreach($this->membresFiles as $val => $membre){

if($membre->COURRIER_CONVOCATIONSALLE != NULL){
$nomFichier = $membre->ID_COMMISSIONMEMBRE."CONVOCATIONSALLE_".$membre->COURRIER_CONVOCATIONSALLE;
$odf = new Odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
$odf = new Odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
//Generation du segment ListePrescription
$villeODF = $odf->setSegment('villeDoss');

Expand Down Expand Up @@ -79,7 +79,7 @@ foreach($this->membresFiles as $val => $membre){

$idPj = savePj($this->idComm ,$membre->LIBELLE_COMMISSIONMEMBRE);

$odf->saveToDisk(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
$odf->saveToDisk(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");

echo "<span id='notif' class='ui-state-highlight ui-corner-all' style='padding: 0.3em;'>La convocation pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." à bien été généré</span><br/><br/><br/>";

Expand Down Expand Up @@ -109,7 +109,7 @@ foreach($this->membresFiles as $val => $membre){

//On commence par selectionner le document approprié
$nomFichier = $membre->ID_COMMISSIONMEMBRE."CONVOCATIONSALLE_".$membre->COURRIER_CONVOCATIONSALLE;
$odf = new Odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
$odf = new Odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);

//Generation du segment grpLoop
$grpLoop = $odf->setSegment('grpLoop');
Expand Down Expand Up @@ -173,7 +173,7 @@ foreach($this->membresFiles as $val => $membre){

$idPj = savePj($this->idComm ,$membre->LIBELLE_COMMISSIONMEMBRE);

$odf->saveToDisk(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
$odf->saveToDisk(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");

echo "<span id='notif' class='ui-state-highlight ui-corner-all' style='padding: 0.3em;'>La convocation pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." à bien été généré</span><br/><br/><br/>";
}else{
Expand Down
26 changes: 13 additions & 13 deletions application/views/scripts/dossier/generationodj.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ foreach($this->membresFiles as $val => $membre){
//génération du document par commune pour les maires par exemple
//si le document concernant ce membre existe alors on rentre dans la boucle
$nomFichier = $membre->ID_COMMISSIONMEMBRE."ODJ_".$membre->COURRIER_ODJ;
//echo DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier;
if (file_exists(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier)){
$odf = new Odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
//echo REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier;
if (file_exists(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier)){
$odf = new Odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
//$odf = new odf("./data/uploads/courriers/ordreDuJour.odt");
//Generation du segment membres
$membreLoop = $odf->setSegment('membresComm');
Expand Down Expand Up @@ -79,7 +79,7 @@ foreach($this->membresFiles as $val => $membre){
}
$odf->mergeSegment($membreLoop);
$idPj = savePj($this->idComm);
$odf->saveToDisk(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
$odf->saveToDisk(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
echo "<span id='notif' class='ui-state-highlight ui-corner-all' style='padding: 0.3em;'>L'ordre du jour pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." à bien été généré </span><br/><br/><br/>";
}else{
echo "<span id='notif' class='ui-state-error' style='padding: 0.3em;'>Le fichier pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." n'a pas été renseigné</span><br/><br/><br/>";
Expand All @@ -92,8 +92,8 @@ foreach($this->membresFiles as $val => $membre){
//si le membre du groupement en question posède un document le concernant on génére la convocation
$nomFichier = $membre->ID_COMMISSIONMEMBRE."ODJ_".$membre->COURRIER_ODJ;

if (file_exists(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier)){
$odf = new Odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
if (file_exists(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier)){
$odf = new Odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);

$model_groupement = new Model_DbTable_Groupement();
$infosGroupement = $model_groupement->get($membre->ID_GROUPEMENT);
Expand All @@ -108,9 +108,9 @@ foreach($this->membresFiles as $val => $membre){

//On commence par selectionner le document approprié
$nomFichier = $membre->ID_COMMISSIONMEMBRE."ODJ_".$membre->COURRIER_ODJ;
$odf = new odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);
$odf = new odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier);

//echo DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier;
//echo REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier;

//Generation du segment grpLoop

Expand Down Expand Up @@ -162,7 +162,7 @@ foreach($this->membresFiles as $val => $membre){
$grpLoop->merge();
$odf->mergeSegment($grpLoop);
$idPj = savePj($this->idComm);
$odf->saveToDisk(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
$odf->saveToDisk(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
echo "<span id='notif' class='ui-state-highlight ui-corner-all' style='padding: 0.3em;'>L'ordre du jour pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." à bien été généré </span><br/><br/><br/>";
}else{
echo "<span id='notif' class='ui-state-error' style='padding: 0.3em;'>Le fichier pour le membre : ".$membre->LIBELLE_COMMISSIONMEMBRE." n'a pas été renseigné</span><br/><br/><br/>";
Expand All @@ -181,15 +181,15 @@ function addChamp($odfName, $nomOdf, $variable){

}
}
//echo DATA_PATH.DIRECTORY_SEPARATOR;
//echo REAL_DATA_PATH.DIRECTORY_SEPARATOR;
//Zend_Debug::dump($this->membresFiles->toArray());


/*
$consonne = array("a", "e", "i", "o", "u", "y", "A", "E", "I", "O", "U", "Y");
//$odf = new odf(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR."ordreDuJour.odt");
//$odf = new odf(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR."ordreDuJour.odt");
addChamp($odf,'commissionNom',$this->commissionInfos[0]['LIBELLE_COMMISSION']);
$dateDuJour = new Zend_Date();
Expand All @@ -215,8 +215,8 @@ $odf->mergeSegment($dossierLoop);
*/

//$odf->saveToDisk(DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
//DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier
//$odf->saveToDisk(REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."pieces-jointes".DIRECTORY_SEPARATOR.$idPj.".odt");
//REAL_DATA_PATH.DIRECTORY_SEPARATOR."uploads".DIRECTORY_SEPARATOR."courriers".DIRECTORY_SEPARATOR.$nomFichier

function savePj($dateCommId){
//ENREGISTEMENT DANS PIECE JOINTES
Expand Down
File renamed without changes.
Binary file added public/data/uploads/avatars/large/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/data/uploads/avatars/medium/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added public/data/uploads/avatars/small/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

// Define path to application directory
defined('DATA_PATH')
|| define('DATA_PATH', realpath(dirname(__FILE__) . '/../data'));
|| define('DATA_PATH', '/data');

// Define path to application directory
defined('REAL_DATA_PATH')
|| define('REAL_DATA_PATH', realpath(dirname(__FILE__) . '/../public/data'));

// Get include path
set_include_path(implode(PATH_SEPARATOR, array(
Expand Down

0 comments on commit 21e4d71

Please sign in to comment.