1,5 → 1,5 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
20,7 → 20,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
|
// CVS : $Id: projetControleur.class.php,v 1.16 2005-10-25 13:48:27 alexandre_tb Exp $ |
// CVS : $Id: projetControleur.class.php,v 1.17 2005-11-14 10:14:30 ddelon Exp $ |
|
/** |
* Application projet |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.16 $ |
*@version $Revision: 1.17 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
144,13 → 144,13 |
* @access private |
*/ |
var $_auth; |
|
|
/** |
* |
* |
* @access private |
*/ |
var $_url; |
|
|
/** |
* L'identifiant du projet sur lequel on travaille. Dans l'action par défaut, cet |
* attribut n'a pas de valeur. |
183,7 → 183,7 |
* Valeurs possibles: 0, 1, 2, 3 ... |
* @access private |
*/ |
|
|
var $_type ; |
/** |
* Le tableau des projets à ne pas afficher, ni dans l'arbre, ni dans les listes |
190,13 → 190,13 |
* @access private |
*/ |
var $_projet_exclu = array(); |
|
|
/** |
* parametre indiquant le type d'inscription possible |
* @access private |
*/ |
var $_prive = 0 ; |
|
|
/** |
* Méthode principale de la classe. Elle permet d'appeler les méthodes du modules |
* projet en fonction de l'action. |
210,7 → 210,7 |
if ($this->_action == '') { |
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 ; |
224,7 → 224,7 |
} |
$retour = '' ; |
if (!defined('PROJET_MENU_AFFICHER_CONTENU_CORPS')) $retour = $this->menuGeneral() ; |
|
|
switch ($this->_action) { |
case PROJET_DEFAUT : |
$retour .= $this->mesProjets() ; |
291,7 → 291,7 |
$this->_action = PROJET_ACTION_VOIR_RESUME ; |
break ; |
case PROJET_ACTION_S_INSCRIRE : $retour .= $this->inscriptionProjet() ; |
|
|
break ; |
case PROJET_ACTION_DESINSCRIPTION_PROJET : $retour .= $this->desinscriptionProjet() ; |
break ; |
318,7 → 318,7 |
case PROJET_ACTION_REFERENCER_LISTE_V : $retour .= $this->referencerListeExterneValidation() ; |
$this->_action = PROJET_ACTION_VOIR_RESUME ; |
break ; |
|
|
} |
if (!is_int($this->_action)) { |
if (file_exists(PROJET_CHEMIN_APPLI.'actions/'.$this->_action.'.php')) { |
342,7 → 342,7 |
} // end of member function setAction |
|
/** |
* Constructeur. |
* Constructeur. |
* |
* @return void |
* @access public |
357,7 → 357,7 |
$this->_url = $urlObjet ; |
} |
} // end of member function projetControleur |
|
|
/** |
* Renvoie la liste des projets auquel participe la personne logguée, avec son |
* statut et un lien vers l'action pour gérer le projet. |
371,7 → 371,7 |
include_once PROJET_CHEMIN_CLASSES.'statut_liste.class.php' ; |
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ; |
$participant = new participe ($this->_db) ; |
|
|
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
$projetListe = projet::getProjetDuType($this->_type, $this->_db) ; |
if ($this->_presentation == 'arbre')array_push ($projetListe, projet::getProjetRacine($this->_db)) ; |
384,8 → 384,8 |
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
return $res .= PROJET_PAS_DE_LISTE; |
} |
return $res .= PROJET_PAS_DE_LISTE; |
} |
// Si certain projet sont à exclure, on les exclu |
$projet_a_exclure = array() ; |
if (count($this->_projet_exclu)) { |
396,14 → 396,14 |
} |
} |
foreach ($projet_a_exclure as $valeur) unset ($projetListe[$valeur]) ; |
|
|
// Les entêtes des tableaux |
$tableau_label_statut_action = array (PROJET_GERER, PROJET_GERER, PROJET_GERER_FICHIER, PROJET_VOIR_FICHIER, "---") ; |
|
|
$auth = $this->_auth->getAuth() ; // Pour raccourcir le code |
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; // -------------- |
|
|
|
|
// Si la présentation est par arbre |
// TODO : Organiser différemment les présentations |
// En utilisant des templates |
414,36 → 414,36 |
$intensite_feuille = '' ; $longueur_branche = '' ; |
$arbre = new arbre() ; |
// recherche du projet principal |
|
|
$cime=''; |
|
|
foreach ($projetListe as $projet) { |
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ; |
$lien_feuille = $this->_url->getURL() ; |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
|
|
if ($projet->isRacine()) { |
$cime = $arbre->cime($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), $lien_feuille, '') ; |
} else { |
|
$arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), |
|
$arbre->addBranche($projet->getTitre(), $this->_url->getURL(), $projet->getNombreInscrits(), |
$lien_feuille, $lien_feuille, $intensite_feuille, $longueur_branche) ; |
} |
} |
return $titre.'<table>'.$cime.$arbre->affBranche().$arbre->affRacine().'</table>'; |
} |
|
|
// Présentation par liste |
|
|
$titre = '<h1>'.PROJET_LISTE.'</h1>'."\n" ; |
|
|
// On inclue un fichier local |
if (file_exists(PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php')) |
include_once PROJET_CHEMIN_APPLI.'langues/pro_langues_fr.local.inc.php' ; |
// On vérifie si l'utilisateur participe à des projets |
if ($auth) { |
|
|
$utilisateur_liste = new inscription_liste($this->_db) ; |
// On teste ici s'il y a une mise à jour de statut |
if (isset($_POST['statut'])) { |
456,14 → 456,14 |
$utilisateur_liste->modifierTypeInscription($projet->_listes_associes[0],$annuaire, $_POST['statut']) ; |
} |
if (count($participant->getIdProjetsStatuts($id_u))) { |
|
|
$HTML_projetListe = new HTML_listeProjet(true) ; |
$entete_liste = array($auth ? PROJET_VOUS_PARTICIPEZ : PROJET_LISTE) ; |
if ($auth) array_push ($entete_liste, PROJET_SE_DESINSCRIRE, PROJET_LISTE_DE_DISCUSSION) ; |
|
|
|
|
$tableau_resultat = array () ; |
|
|
$HTML_projetListe->construitEntete ($entete_liste) ; |
|
// On construit $tableau_resultat avec une ligne par projet contenant un tableau (titre, statut_nom, id_statut, id_projet) |
483,7 → 483,7 |
//if ($statut == '') $statut = 0 ; |
} |
} |
|
|
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_tableau = array ($projet->getId(), $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' |
503,8 → 503,8 |
$statut = '' ; |
} |
$HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ; |
|
|
|
|
if ($HTML_projetListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_PARTICIPER.'</p>'; |
$res .= $HTML_projetListe->toHTML() ; |
537,20 → 537,20 |
if ($projetNonParticipantListe[$i]->getType() != $this->_type) array_push ($projet_a_exclure, $i) ; |
} |
} |
|
|
foreach ($projet_a_exclure as $valeur) { |
unset ($projetNonParticipantListe[$valeur]) ; |
} |
|
|
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
array_push ($entete_liste, PROJET_S_INSCRIRE) ; |
|
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
|
|
$liste_projet = array() ; |
// La liste |
|
|
foreach ($projetNonParticipantListe as $projet) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$ligne_projet = array ($projet->getResume(), |
558,7 → 558,7 |
) ; |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE) ; |
array_push ($ligne_projet, '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>') ; |
|
|
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
570,7 → 570,7 |
$HTML_projetNonParticipantListe = new HTML_listeProjet(true) ; |
$entete_liste = array (PROJET_LISTE) ; |
$HTML_projetNonParticipantListe->construitEntete($entete_liste) ; |
|
|
$liste_projet = array() ; |
// La liste |
foreach ($projetNonParticipantListe as $projet) { |
578,7 → 578,7 |
$ligne_projet = array ( $projet->getResume(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>', // le nom du projet |
) ; |
|
|
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION); |
array_push ($liste_projet, $ligne_projet) ; |
} |
667,7 → 667,7 |
// L'action modifier les propriétés du projet |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_MODIFIER_PROPRIETES."</a></li>\n" ; |
|
|
if ($projet->avoirListe()) { |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_LISTE) ; |
$texte_liste = PROJET_SUPPRIMER_LISTE ; |
681,12 → 681,20 |
$res .= '<li><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ; |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ; |
$res .= '<li><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ; |
|
|
// L'action gérer les utilisateurs |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_GESTION_UTILISATEUR."</a></li>\n" ; |
|
// L'action créer un wikini |
|
// L'action Gerer les wikis |
/* |
* client/integrateur_wikini/admin_wikini.php |
*/ |
|
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ; |
|
/* |
if (!$projet->getWikini()) { |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_WIKI."</a></li>\n" ; |
694,16 → 702,17 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_SUPPRIMER_WIKI) ; |
$res .= '<li><a href="'.$this->_url->getURL().'" onclick="javascript:return confirm(\''.PROJET_WIKINI_SUPPRIMER.' ?\')">'.PROJET_WIKINI_SUPPRIMER."</a></li>\n" ; |
} |
|
*/ |
|
// L'action choisir un wikini |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_ASSOCIER_WIKI) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_ASSOCIER_WIKI."</a></li>\n" ; |
|
|
} |
// L'action se désinscrire du projet |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_SE_DESINSCRIRE."</a></li>\n" ; |
|
|
// L'action "Mettre un fichier en ligne" |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_METTRE_FICHIER."</a></li>\n" ; |
711,15 → 720,15 |
// L'action créer un répertoire |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ; |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_CREER_REP."</a></li>\n" ; |
|
|
if ($projet->avoirListe()) { |
|
|
// On vérifie si l'utilisateur est inscrit ou non à la liste et on ajoute le lien |
//$projet->getListesAssociees(); |
|
|
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php'; |
foreach ($projet->_listes_associes as $info_liste) { |
|
|
$inscription_liste = new inscription_liste($this->_db) ; |
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) { |
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ; |
736,7 → 745,7 |
$res .= $label_inscription.'</a></li> '; |
} |
} |
|
|
$res .= '</ul>' ; |
} else if ($auth && !$this->_prive){ |
// L'action s'inscrire du projet |
744,7 → 753,7 |
$res .= "<li><a href=\"".$this->_url->getURL()."\">".PROJET_S_INSCRIRE_AU_PROJET."</a></li>\n" ; |
} |
} |
|
|
$res .= "</div>\n" ; |
return $res ; |
} // end of member function menuGeneral |
795,7 → 804,7 |
$formulaire_projet = new HTML_formulaireProjet('formulaire_projet', 'post', str_replace ('&', '&', $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())) { |
851,7 → 860,7 |
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ; |
$formulaire_document->construitFormulaire($action) ; |
if ($action == PROJET_ACTION_MODIFIER) { |
|
|
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ; |
// On affecte dans un tableau les valeurs de chaque champs du formulaire avec le nom de chaque élément de formulaire |
// voir HTML_formulaireDocument |
858,8 → 867,8 |
$valeurs_par_defaut = array ('document_nom' => $document->getNomLong(), |
'document_description' => $document->getDescription(), |
'document_visibilite' => $document->getVisibilite()) ; |
|
// On rajoute un champs caché avec l'identifiant du document |
|
// On rajoute un champs caché avec l'identifiant du document |
$formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ; |
$formulaire_document->setDefaults($valeurs_par_defaut) ; |
} else { |
868,7 → 877,7 |
return $res.$formulaire_document->toHTML() ; |
|
} // end of member function nouveauFichier |
|
|
/** |
* Présente un formulaire pour déplacer un fichier |
* |
877,11 → 886,11 |
function fichierCouper() { |
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ; |
$projet = new projet ($this->_db, $this->_id_projet) ; |
|
|
$res = '<h1>'.PROJET_PROJET.' : '.$projet->getTitre().'</h1>' ; |
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ; |
// On traite le cas où l'on vient de déplacer un fichier |
|
|
if (isset ($_POST['projet_repertoire'])) { |
if (!$document -> deplace ($_POST['projet_repertoire'], $projet->getNomRepertoire())) { |
echo 'echec du déplacement' ; |
954,18 → 963,18 |
// avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire |
$document->setIdProjet ($this->_id_projet) ; |
$document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ; |
|
|
// On passe aussi le numéro de répertoire s'il existe |
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ; |
|
|
$chemin_upload = $document->calculeCheminUploaded($projet->getNomRepertoire()) ; |
|
|
if (!$document->upload (PROJET_CHEMIN_FICHIER.$projet->getNomRepertoire().'/'.$chemin_upload)) { |
echo 'Echec de l\'upload' ; |
trigger_error('echec d\'upload !', E_USER_ERROR) ; |
} |
|
|
|
|
$document->enregistrerSQL($formulaire_document->getSubmitValues(), $projet->getNomRepertoire().'/'.$chemin_upload) ; |
// On ajoute une information de session |
$_SESSION['formulaire_document'] = 'valide'; |
1010,26 → 1019,26 |
{ |
// création de l'objet projet courant |
$projet = new projet ($this->_db, $this->_id_projet) ; |
|
|
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER_V) ; |
$formulaire_repertoire = new HTML_formulaireDocument('formulaire_repertoire', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ; |
$formulaire_repertoire->setType ('repertoire') ; |
$formulaire_repertoire->construitFormulaire() ; |
if ($formulaire_repertoire->validate()) { |
// Création d'un objet |
// Création d'un objet |
$document = new document ("", $this->_db) ; |
// avant d'appeler la méthode enregistrerSQL, il faut indiquer l'identifiant du projet et l'identifiant du propriétaire |
$document->setIdProjet ($this->_id_projet) ; |
$document->setIdProprietaire ($this->_auth->getAuthData (PROJET_CHAMPS_ID)) ; |
|
|
// On passe aussi le numéro de répertoire s'il existe |
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ; |
|
|
$lien = $document->enregistrerSQL($formulaire_repertoire->getSubmitValues(), $projet->getNomRepertoire()) ; |
|
|
// La création du répertoire sur le disque, chemin / nom_repertoire_projet / id_repertoire |
if (!mkdir (PROJET_CHEMIN_FICHIER.$lien)) { |
|
|
$document->suppressionSQL() ; |
return $this->messageErreur(PROJETCONTROLEUR_ERREUR_CREATION_REPERTOIRE).'<br />'.PROJET_CHEMIN_FICHIER.$lien ; |
} |
1049,7 → 1058,7 |
function setIdProjet( $id_projet ) |
{ |
$this->_id_projet = $id_projet ; |
|
|
} // end of member function setIdProjet |
|
/** |
1063,26 → 1072,26 |
$res = '' ; |
// création de l'objet projet courant |
$projet = new projet ($this->_db, $this->_id_projet) ; |
|
|
// récupération de la liste des documents associés |
$liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ; |
|
|
// création de la vue liste de document, on nettoie l'url |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ; |
$vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire) ; |
|
|
// réglage de paramètres de la vue |
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ; |
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ; |
|
|
|
|
$tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ; |
|
|
$vue_liste_document->setCheminNavigation ($tableau_navigation) ; |
// vérification des droits de l'utilisateur |
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_CREE_LE) ; |
|
|
if ($this->_auth->getAuth()) { |
$participant = new participe($this->_db) ; |
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; |
1091,16 → 1100,16 |
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ; |
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ; |
if ($isAdm) $isCoord = true ; |
|
|
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ; |
// si participant, on ajoute le champs visibilite |
|
|
if ($statut !='' || $isAdm) { |
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ; |
} |
// si chef de projet ou si propriétaire d'au moins 1 document |
$proprietaire_un_document = false ; |
|
|
foreach ($liste_documents as $document) { |
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document) { |
$proprietaire_un_document = true ; |
1114,10 → 1123,10 |
$droits = PROJET_DROIT_AUCUN ; |
} |
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ; |
|
|
$vue_liste_document->construitEntete($entete_liste) ; |
$vue_liste_document->construitListe ($liste_documents, $droits) ; |
|
|
$wiki_res = '' ; |
// Les wikinis associés au projet |
if ($projet->getWikini()) { |
1132,20 → 1141,20 |
} |
// On charge les listes de discussion du projet |
// Pour le moment seul ezmlm est supportée |
|
|
$projet->getListesAssociees(); |
$sortie_liste = '' ; |
|
|
if ($projet->avoirListe()) { |
foreach ($projet->_listes_associes as $info_liste) { |
|
|
$liste = new ezmlm_php() ; |
// Paramétrage de la liste |
|
|
$liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom(); |
$liste->listname = $info_liste->getNom() ; |
$liste->listdomain = $info_liste->getDomaine(); |
|
|
if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') { |
$liste->set_action($GLOBALS['action']) ; |
$liste->set_actionargs($GLOBALS['actionargs']) ; |
1156,7 → 1165,7 |
$liste->sendbody = false; |
$liste->sendfooters = false; |
$liste->forcehref = $this->_url->getURL() ; |
|
|
ob_start() ; |
print '<span class="heading">Liste <strong>' . $info_liste->getAdresseEnvoi() ; |
print "</strong></span><br />\n"; |
1188,7 → 1197,7 |
// On appelle la fonction qui affiche un fichier |
$show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]); |
break; |
|
|
case "list_info": |
$info = new ezmlm_listinfo(); |
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ; |
1196,7 → 1205,7 |
$info->listdir = $liste->listdir ; |
$info->listname = $info_liste->getNom(); |
$info->listdomain = $info_liste->getDomaine() ; |
|
|
if (!$info->display()) { |
echo 'Pas de message dans cette liste' ; |
} |
1225,7 → 1234,7 |
} else { |
$sortie_liste = '<div>'.PROJET_PAS_DE_LISTE.'</div>'."\n" ; |
} |
|
|
$res .= "<h1>".$projet->getTitre()."</h1>" ; |
$res .= '<div>'.$projet->getDescription().'</div>'."\n" ; |
$res .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ; |
1234,11 → 1243,11 |
$res .= $vue_liste_document->toHTML() ; |
$res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ; |
$res .= $sortie_liste ; |
|
|
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ; |
$listes_ext = new liste_externe ($this->_db) ; |
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ; |
|
|
if (count ($tableau_liste) != 0) { |
$res .= '<h2>'.PROJET_LISTES_EXTERNES_ASSOCIEES.'</h2>'."\n" ; |
for ($i = 0; $i < count ($tableau_liste); $i++) { |
1285,7 → 1294,7 |
/** |
* Permet d'indiquer au controleur sur quel document on travaille. |
* |
* @param int id_document |
* @param int id_document |
* @return void |
* @access public |
*/ |
1380,23 → 1389,23 |
$formulaire_liste = new HTML_formulaireListe('formulaire_liste', 'post', preg_replace ("/&/", "&", $this->_url->getURL())) ; |
$formulaire_liste->construitFormulaire() ; |
if ($formulaire_liste->validate()) { |
// création de l'objet liste_discussion |
// création de l'objet liste_discussion |
$liste = new liste_discussion('', $this->_db) ; |
|
|
// On vérifie que le nom de la liste soit unique |
if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'. |
$formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) { |
// On rajoute la liste dans la base |
// On rajoute la liste dans la base |
$liste->enregistrerSQL($formulaire_liste->getSubmitValues()) ; |
|
|
// On la relie au projet |
$projet = new projet ($this->_db, $this->_id_projet) ; |
$projet->ajouterListe($liste) ; |
|
|
// Création de la liste |
$resultat_creation = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/creation_liste.php?domaine='. |
$liste->getDomaine().'&liste='.$liste->getNom().'¶metres=aBiud') ; |
|
|
// Ajout du modérateur |
$resultat_ajout_moderateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_moderateur.php?domaine='. |
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$this->_auth->getUserName()) ; |
1408,12 → 1417,12 |
return PROJET_MESSAGE_LISTE_DOUBLE.$formulaire_liste->toHTML() ; |
} |
return $resultat_creation.$resultat_ajout_moderateur.$resultat_ajout_utilisateur; |
|
|
} else { |
return $formulaire_liste->toHTML() ; |
} |
} // end of member function nouvelleListeValidation |
|
|
/** |
* Supprime la liste de discussion associée au projet |
* |
1424,19 → 1433,19 |
{ |
$projet = new projet($this->_db, $this->_id_projet) ; |
$projet->getListesAssociees() ; |
|
|
// ajouter un commande de suppression |
|
|
$commande = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ; |
if (PEAR::isError($commande)) { |
echo $commande->getMessage() ; |
} |
|
|
// Suppression des listes synchronisés |
$commande_supression_3 = 'rm -rf '.PROJET_CHEMIN_LISTES.$projet->_listes_associes[0]->getDomaine(). |
'/'.$projet->_listes_associes[0]->getNom() ; |
$commande->ajouterCommande($commande_supression_3) ; |
|
|
$resultat_suppression = file_get_contents(PROJET_SERVEUR_VPOPMAIL.'/suppression_liste.php?domaine='. |
$projet->_listes_associes[0]->getDomaine().'&liste='.$projet->_listes_associes[0]->getNom()) ; |
$projet->supprimerListe($projet->_listes_associes[0]) ; |
1445,8 → 1454,8 |
|
|
/** |
* |
* |
* |
* @param string presentation Pour affecter une présentation au projet |
* @return void |
* @access public |
1457,8 → 1466,8 |
} // end of member function setPresentation |
|
/** |
* |
* |
* |
* @param string type Pour affecter un type au projet |
* @return void |
* @access public |
1482,13 → 1491,13 |
$titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ; |
$titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ; |
$participants = new participe($this->_db) ; |
|
|
// On teste ici s'il y a une mise à jour de statut |
if (isset($_POST['statut'])) { |
// $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants |
$participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ; |
} |
|
|
// Ce qui suit doit être amélioré pour sortir la requête sur l'annuaire |
// On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants |
if (isset($_POST['mail_utilisateur'])) { |
1504,7 → 1513,7 |
$participants->setStatut(3, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ; |
} |
} |
|
|
if ($this->_auth->getAuth()) { |
$statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ; |
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ; |
1517,7 → 1526,7 |
$HTML_listeParticipants->setURL($this->_url) ; |
// Construction de l'entete |
$entete = array (PROJET_NOM, PROJET_PRENOM) ; |
|
|
if ($this->_auth->getAuth()) { |
array_push ($entete, PROJET_MAIL) ; |
} else { |
1526,11 → 1535,11 |
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ; |
array_push ($entete, PROJET_DATE_INSCRIPTION) ; |
$HTML_listeParticipants->construitEntete($entete) ; |
|
|
$HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM_COORD, $this->_db)) ; |
|
|
$res = $HTML_listeParticipants->toHTML() ; |
|
|
if ($statut < 2) { |
$res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ; |
$res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ; |
1545,7 → 1554,7 |
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ; |
} |
return $titre.$res ; |
|
|
} // end of member function voirParticipants |
|
/** |
1557,13 → 1566,13 |
function inscriptionProjet( ) |
{ |
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireInscriptionProjet.class.php' ; |
|
|
$projet = new projet ($this->_db, $this->_id_projet) ; |
|
|
// Si le projet n'a pas de liste, on inscrit directement |
if (isset ($this->_id_projet)) { |
$participant = new participe($this->_db) ; |
|
|
if (!$projet->avoirListe()) { |
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ; |
return $this->mesProjets() ; |
1582,7 → 1591,7 |
$projet->_listes_associes[0], |
$_POST['radio_inscription_liste']) ; |
} |
|
|
if ($this->_presentation != 'arbre') { |
return $this->mesProjets() ; |
} else { |
1649,7 → 1658,7 |
{ |
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ; |
$participant = new participe($this->_db) ; |
|
|
// Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut |
$participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ; |
$projet = new projet ($this->_db, $this->_id_projet) ; |
1677,12 → 1686,13 |
*/ |
function formulaireWiki( ) |
{ |
$res = '<h1>'.PROJET_CREER_WIKI.'</h1>'."\n" ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCreationWikini.class.php' ; |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI_V) ; |
$HTML_formulaireCreationWikini = new HTML_formulaireCreationWikini('formulaire_wikini', 'post', str_replace('&', '&', $this->_url->getURL())) ; |
$HTML_formulaireCreationWikini->construitFormulaire() ; |
return $res.$HTML_formulaireCreationWikini->toHTML() ; |
|
require_once 'client/integrateur_wikini/bibliotheque/iw_admin_wikini.fonct.php'; |
|
$this->_url->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ; |
$res =admin_afficherContenuCorps(); |
return $res; |
|
} // end of member function formulaireWiki |
|
|
1689,14 → 1699,14 |
function associerWiki( ) |
{ |
$res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ; |
|
$db = &$GLOBALS['_GEN_commun']['pear_db'] ; |
|
$db = &$GLOBALS['_GEN_commun']['pear_db'] ; |
$res=''; |
|
|
// Comportement par défaut |
// requete sur la table gen_wikini pour affichage de la liste des Wikini |
// requete sur la table gen_wikini pour affichage de la liste des Wikini |
$requete = "select gewi_id_wikini, gewi_code_alpha_wikini, gewi_page from gen_wikini" ; |
|
|
$resultat = $db->query ($requete) ; |
if (DB::isError ($resultat)) { |
$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(), |
1703,13 → 1713,13 |
__FILE__, __LINE__, 'admin_wikini') ; |
return ; |
} |
|
|
|
|
$liste = new HTML_TableFragmenteur () ; |
$liste->construireEntete(array (PROJET_NOM_WIKINI,PROJET_PAGE_WIKINI, PROJET_SELECTIONNER_WIKINI)) ; |
|
|
$tableau_wikini = array() ; |
|
|
while ($ligne = $resultat->fetchRow()) { |
$this->_url->addQueryString ('id_wikini', $ligne[0]) ; |
array_push ($tableau_wikini, array ($ligne[1]."\n", // Première colonne, le nom de l'application |
1720,38 → 1730,11 |
$liste->construireListe($tableau_wikini) ; |
$res .= $liste->toHTML(); |
return $res ; |
|
|
|
|
|
|
} // end of member function formulaireWiki |
|
/** |
* Génère un wiki, à partir de la classe gestion wiki |
* |
* @return void |
* @access public |
*/ |
function creationWiki( ) |
{ |
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireCreationWikini.class.php' ; |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_CREER_WIKI_V) ; |
$HTML_formulaireCreationWikini = new HTML_formulaireCreationWikini('formulaire_wikini', 'post', str_replace('&', '&', $this->_url->getURL())) ; |
$HTML_formulaireCreationWikini->construitFormulaire() ; |
if ($HTML_formulaireCreationWikini->validate()) { |
include_once PROJET_CHEMIN_CLASSES.'gestion_wikini.class.php' ; |
|
// On crée une nouvelle connexion avec les paramètres spécifiques aux wikinis |
$connexion_bd = DB::connect('mysql://'.PROJET_UTILISATEUR_WIKINI.':'.PROJET_MDP_WIKINI.'@'.PROJET_HOTE_WIKINI.'/'.PROJET_DB_WIKINI) ; |
$gerantWikini = new gestion_wikini($connexion_bd) ; |
$gerantWikini->creation_tables(strtolower($HTML_formulaireCreationWikini->getSubmitValue('nom_wikini'))) ; |
|
// On crée un objet avec le projet courant |
$projet = new projet($this->_db, $this->_id_projet) ; |
$projet->majNomWikini($HTML_formulaireCreationWikini->getSubmitValue('nom_wikini')); |
} else { |
return $HTML_formulaireCreationWikini->toHTML() ; |
} |
} // end of member function creationWiki |
|
/** |
* Associe un wiki au projet courant |
1761,8 → 1744,8 |
*/ |
|
function associationWiki( ) { |
|
|
|
|
if (isset($_GET['id_wikini'])) { |
$db = &$GLOBALS['_GEN_commun']['pear_db'] ; |
$requete = "select gewi_code_alpha_wikini from gen_wikini where gewi_id_wikini = ".$_GET['id_wikini'] ; |
1772,12 → 1755,12 |
__FILE__, __LINE__, 'admin_wikini') ; |
return ; |
} |
|
|
$ligne = $resultat->fetchRow(); |
$projet = new projet($this->_db, $this->_id_projet) ; |
$projet->majNomWikini($ligne[0]); |
} |
|
|
} |
|
/** |
1834,7 → 1817,7 |
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireListeExterne.class.php' ; |
$HTML_formulaireListeExterne = new HTML_formulaireListeExterne('formulaire_liste_externe', 'post', str_replace('&', '&', $this->_url->getURL())) ; |
$HTML_formulaireListeExterne->construitFormulaire($liste_externe->getListeNom()) ; |
|
|
$liste_externe->enregistrerSQL($HTML_formulaireListeExterne->getSubmitValues(), $this->_id_projet) ; |
} // end of member function referencerListeExterneValidation |
|