Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 5 → Rev 6

/trunk/classes/annuaire.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: annuaire.class.php,v 1.1 2005-09-22 14:02:47 ddelon Exp $
// CVS : $Id: annuaire.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application annuaire
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
108,7 → 108,7
$requete = 'select '.$this->_champs_base[$parametre].
' from '.$this->_champs_base['table'].
' where '.$this->_champs_base['identifiant'].'='.$this->_id_utilisateur ;
$resultat = $this->_db->query ($requete) ;
$resultat = $GLOBALS['projet_db']->query($requete) ;
if (DB::isError($resultat)) {
echo 'erreur '.$resultat->getMessage() ;
}
/trunk/classes/projet.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projet.class.php,v 1.1 2005-09-22 14:02:47 ddelon Exp $
// CVS : $Id: projet.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
140,13 → 140,14
 
/**
*
*
* PHP5
* @return projet
* @access public
*/
function __construct( )
function __construct( &$dbObject, $id_projet = "")
{
$this->projet($dbObject, $id_projet);
} // end of member function __construct
 
/**
429,6 → 430,7
*/
function enregistrerSQL( $tableau_de_valeur )
{
$nom_repertoire = projet::genereNomRepertoire($tableau_de_valeur['projet_titre'], $this->_db) ;
if (!$this->_creationRepertoire ($nom_repertoire)) {
echo 'Impossible de crée un répertoire' ;
436,6 → 438,9
}
$id = SQL_obtenirNouveauId($this->_db, 'projet', 'p_id') ;
$requete = 'insert into projet set p_id='.$id ;
if (!isset($tableau_de_valeur['projet_wikini'])) {
$tableau_de_valeur['projet_wikini']='';
}
$requete .= ', p_titre="'.$tableau_de_valeur['projet_titre'].'", p_description="'.$tableau_de_valeur['projet_description'].'"'.
', p_espace_internet="'.$tableau_de_valeur['projet_espace_internet'].'", p_date_creation=NOW()'.
', p_wikini="'.$tableau_de_valeur['projet_wikini'].'", p_nom_repertoire="'.$nom_repertoire.'", p_resume="'.$tableau_de_valeur['projet_resume'].'"' ;
585,9 → 590,15
if (DB::isError ($resultat)) {
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$nom = strtoupper(substr($chaine, 0, 1)) ;
$nom .= $ligne->p_id + 1 ;
if ($resultat->numRows() > 0) {
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$nom = strtoupper(substr($chaine, 0, 1)) ;
$nom .= $ligne->p_id + 1 ;
}
else {
$nom = strtoupper(substr($chaine, 0, 1)) ;
$nom .= 1 ;
}
return $nom ;
} // end of member function genereNomRepertoire
/trunk/classes/fichier.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: fichier.class.php,v 1.1 2005-09-22 14:02:47 ddelon Exp $
// CVS : $Id: fichier.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
97,7 → 97,7
* @return void
* @access public
*/
function fichier( $chemin, $objetDB = "")
function fichier( $chemin, &$objetDB = "")
{
$this->_chemin = $chemin ;
// On analyse l'extension pour découvrir le type mime
117,8 → 117,9
* @return fichier
* @access public
*/
function __construct( $chemin )
function __construct( $chemin, &$objetDB = "" )
{
$this->fichier($chemin, $objetDB);
} // end of member function __construct
 
/trunk/classes/document.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: document.class.php,v 1.1 2005-09-22 14:02:48 ddelon Exp $
// CVS : $Id: document.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
135,21 → 135,22
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
fichier::fichier($chemin.$ligne->pd_lien, $this->_db) ;
$this->_id = $ligne->pd_id ;
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
$this->_visibilite = $ligne->pd_visibilite ;
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
$this->_id_pere = $ligne->pd_pere ;
}
if ($resultat->numRows()>0) {
fichier::fichier($chemin.$ligne->pd_lien, $this->_db) ;
$this->_id = $ligne->pd_id ;
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
$this->_visibilite = $ligne->pd_visibilite ;
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
$this->_id_pere = $ligne->pd_pere ;
}
}
}
} // end of member function document
162,8 → 163,10
* @return document
* @access public
*/
function __construct( $id_document, &$objetDB )
function __construct( $id_document = "", &$objetDB, $chemin = '', $chemin_icones = '' )
{
$this->document($id_document, $objetDB, $chemin, $chemin_icones);
} // end of member function __construct
 
269,15 → 272,19
*/
function _isRacine( $id_document )
{
$requete = "select pd_pere from projet_documents where pd_id=$id_document" ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if ($ligne->pd_pere == null){
return true ;
}
if ($id_document) {
$requete = "select pd_pere from projet_documents where pd_id=".$id_document ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
if ($resultat->numRows() >0) {
if ($ligne->pd_pere == null){
return true ;
}
}
}
return false ;
} // end of member function _isRacine
 
319,19 → 326,22
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$chemin_rep_id_nom = array() ;
if ($ligne->pd_pere == 0) {
$tab = array ($ligne->pd_id, $ligne->pd_nom) ;
if ($resultat->numRows()>0) {
if ($ligne->pd_pere == 0) {
$tab = array ($ligne->pd_id, $ligne->pd_nom) ;
return $tab ;
} else {
$requete_pere = "select pd_id, pd_nom from projet_documents where pd_id=$ligne->pd_pere" ;
$resultat_pere = $objetDB->query ($requete_pere) ;
if (DB::isError($resultat_pere)) {
die ("Echec de la requete<br />".$resultat_pere->getMessage()."<br />".$resultat_pere->getDebugInfo()) ;
}
$ligne_pere = $resultat_pere->fetchRow (DB_FETCHMODE_OBJECT) ;
array_push ($chemin_rep_id_nom, $ligne->pd_id,$ligne->pd_nom) ;
$tab = document::getCheminIdRepertoire($ligne_pere->pd_id, $objetDB) ;
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, $tab) ;
}
else {
$requete_pere = "select pd_id, pd_nom from projet_documents where pd_id=$ligne->pd_pere" ;
$resultat_pere = $objetDB->query ($requete_pere) ;
if (DB::isError($resultat_pere)) {
die ("Echec de la requete<br />".$resultat_pere->getMessage()."<br />".$resultat_pere->getDebugInfo()) ;
}
$ligne_pere = $resultat_pere->fetchRow (DB_FETCHMODE_OBJECT) ;
array_push ($chemin_rep_id_nom, $ligne->pd_id,$ligne->pd_nom) ;
$tab = document::getCheminIdRepertoire($ligne_pere->pd_id, $objetDB) ;
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, $tab) ;
}
}
$tabl_resultat = array() ;
for ($i = 0; $i < count ($chemin_rep_id_nom); $i++) {
/trunk/classes/projetControleur.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: projetControleur.class.php,v 1.2 2005-09-23 13:58:07 ddelon Exp $
// CVS : $Id: projetControleur.class.php,v 1.3 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
189,11 → 189,13
return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
}
// Si il n'y a pas d'action mais un projet, on transmet par défaut l'action PROJET_VOIR
if ($this->_id_projet != "" && $this->_action == PROJET_DEFAUT) {
$this->_action = PROJET_ACTION_VOIR_RESUME ;
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
}
if ($this->_id_document != "") {
$this->_url->addQueryString (PROJET_VARIABLE_ID_DOCUMENT, $this->_id_document) ;
}
200,6 → 202,7
$retour = '' ;
if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ;
switch ($this->_action) {
case PROJET_DEFAUT :
$retour .= $this->mesProjets() ;
416,7 → 419,7
}
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$ligne_tableau = array ($projet->getId(), $statut, '<a href="'.PROJET_CHEMIN_ATELIERS.$projet->getId().'">'.$projet->getTitre().'</a>') ;
$ligne_tableau = array ($projet->getId(), $statut, '<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>') ;
if ($auth) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
array_push ($ligne_tableau, '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.
462,7 → 465,7
foreach ($projetNonParticipantListe as $projet) {
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ;
$ligne_projet = array (
'<a href="'.PROJET_CHEMIN_ATELIERS.$projet->getId().'">'.$projet->getTitre().'</a>' // le nom du projet
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet
) ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ;
if ($auth) array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ;
678,7 → 681,6
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&amp;', '&', $this->_url->getURL())) ;
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db)) ;
if ($formulaire_projet->validate()) {
$projet = new projet ($this->_db) ;
$projet->setCheminRepertoire (PROJET_CHEMIN_FICHIER) ;
if (!$projet->enregistrerSQL($formulaire_projet->getSubmitValues())) {
/trunk/classes/HTML_listeDocuments.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_listeDocuments.class.php,v 1.1 2005-09-22 14:02:47 ddelon Exp $
// CVS : $Id: HTML_listeDocuments.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
121,8 → 121,9
* @return void
* @access public
*/
function __construct( $utilise_pager )
function __construct( &$url, $utilise_pager = false, $id_repertoire = 0, $auth = '' )
{
$this->HTML_listeDocuments($url, $utilise_pager, $id_repertoire, $auth);
} // end of member function __construct
 
/trunk/classes/HTML_listeProjet.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_listeProjet.class.php,v 1.1 2005-09-22 14:02:48 ddelon Exp $
// CVS : $Id: HTML_listeProjet.class.php,v 1.2 2005-09-26 20:18:27 ddelon Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
79,8 → 79,9
* @return void
* @access public
*/
function __construct( )
function __construct($utilise_pager = false)
{
$this->HTML_listeProjet($utilise_pager);
} // end of member function __cosntruct