| Line 18... |
Line 18... |
| 18 |
// | You should have received a copy of the GNU General Public |
|
18 |
// | You should have received a copy of the GNU General Public |
|
| 19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
| 20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 22... |
Line 22... |
| 22 |
|
22 |
|
| Line 23... |
Line 23... |
| 23 |
// CVS : $Id: projetControleur.class.php,v 1.45 2008-08-26 12:42:10 alexandre_tb Exp $
|
23 |
// CVS : $Id: projetControleur.class.php,v 1.46 2008-08-28 14:48:54 alexandre_tb Exp $
|
| 24 |
|
24 |
|
| 25 |
/**
|
25 |
/**
|
| 26 |
* Application projet
|
26 |
* Application projet
|
| Line 31... |
Line 31... |
| 31 |
//Auteur original :
|
31 |
//Auteur original :
|
| 32 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
32 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
| 33 |
//Autres auteurs :
|
33 |
//Autres auteurs :
|
| 34 |
*@author Aucun
|
34 |
*@author Aucun
|
| 35 |
*@copyright Tela-Botanica 2000-2004
|
35 |
*@copyright Tela-Botanica 2000-2004
|
| 36 |
*@version $Revision: 1.45 $
|
36 |
*@version $Revision: 1.46 $
|
| 37 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
| 38 |
*/
|
38 |
*/
|
| Line 39... |
Line 39... |
| 39 |
|
39 |
|
| 40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 562... |
Line 562... |
| 562 |
}
|
562 |
}
|
| 563 |
// Gestion projet
|
563 |
// Gestion projet
|
| 564 |
if ($isCoord || $isAdm) {
|
564 |
if ($isCoord || $isAdm) {
|
| 565 |
$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
|
565 |
$res .= '<li class="projet_niv1">'.PROJET_GESTION_PROJET ;
|
| 566 |
$res .= '<ul id="projet_group_niv2_ges">' ;
|
566 |
$res .= '<ul id="projet_group_niv2_ges">' ;
|
| 567 |
// L'action modifier les propriétés du projet
|
567 |
// L'action modifier les proprietes du projet
|
| 568 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
|
568 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
|
| 569 |
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
|
569 |
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
|
| 570 |
if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
|
570 |
if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
|
| 571 |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
|
571 |
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
|
| 572 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
|
572 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
|
| Line 911... |
Line 911... |
| 911 |
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
|
911 |
$formulaire_document = new HTML_formulaireDocument('formulaire_document', 'post',preg_replace ("/&/", "&", $this->_url->getURL())) ;
|
| 912 |
$formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
|
912 |
$formulaire_document->construitFormulaire(PROJET_ACTION_MODIFIER_V) ;
|
| 913 |
if ($formulaire_document->validate()) {
|
913 |
if ($formulaire_document->validate()) {
|
| 914 |
// Creation d'un objet document vide
|
914 |
// Creation d'un objet document vide
|
| 915 |
$document = new document ($this->_id_document, $this->_db) ;
|
915 |
$document = new document ($this->_id_document, $this->_db) ;
|
| 916 |
// On passe aussi le numero de répertoire s'il existe
|
916 |
// On passe aussi le numero de repertoire s'il existe
|
| 917 |
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
|
917 |
if ($this->_id_repertoire != '') $document->setIdRepertoire($this->_id_repertoire) ;
|
| 918 |
$document->majSQL($formulaire_document->getSubmitValues()) ;
|
918 |
$document->majSQL($formulaire_document->getSubmitValues()) ;
|
| 919 |
} else {
|
919 |
} else {
|
| 920 |
return $formulaire_document->toHTML() ;
|
920 |
return $formulaire_document->toHTML() ;
|
| 921 |
}
|
921 |
}
|
| Line 1092... |
Line 1092... |
| 1092 |
return $formulaire_mail->toHTML() ;
|
1092 |
return $formulaire_mail->toHTML() ;
|
| 1093 |
}
|
1093 |
}
|
| 1094 |
} // end of member function envoyerUnMailValidation
|
1094 |
} // end of member function envoyerUnMailValidation
|
| Line 1095... |
Line 1095... |
| 1095 |
|
1095 |
|
| 1096 |
/**
|
1096 |
/**
|
| 1097 |
* Renvoie le formulaire de création d'une liste.
|
1097 |
* Renvoie le formulaire de creation d'une liste.
|
| 1098 |
*
|
1098 |
*
|
| 1099 |
* @param int action Indique le type d'action, PROJET_ACTION_NOUVELLE_LISTE
|
1099 |
* @param int action Indique le type d'action, PROJET_ACTION_NOUVELLE_LISTE
|
| 1100 |
* @return string
|
1100 |
* @return string
|
| 1101 |
* @access public
|
1101 |
* @access public
|
| Line 1111... |
Line 1111... |
| 1111 |
$formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
|
1111 |
$formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
|
| 1112 |
return $res.$formulaire_liste->toHTML() ;
|
1112 |
return $res.$formulaire_liste->toHTML() ;
|
| 1113 |
}
|
1113 |
}
|
| Line 1114... |
Line 1114... |
| 1114 |
|
1114 |
|
| 1115 |
/**
|
1115 |
/**
|
| 1116 |
* Transmet au serveur la demande de création d'une nouvelle liste.
|
1116 |
* Transmet au serveur la demande de creation d'une nouvelle liste.
|
| 1117 |
*
|
1117 |
*
|
| 1118 |
* @return void
|
1118 |
* @return void
|
| 1119 |
* @access public
|
1119 |
* @access public
|
| 1120 |
*/
|
1120 |
*/
|
| Line 1128... |
Line 1128... |
| 1128 |
if ($formulaire_liste->validate()) {
|
1128 |
if ($formulaire_liste->validate()) {
|
| 1129 |
// creation de l'objet liste_discussion
|
1129 |
// creation de l'objet liste_discussion
|
| 1130 |
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php';
|
1130 |
include_once PROJET_CHEMIN_CLASSES.'liste_discussion.class.php';
|
| 1131 |
$liste = new liste_discussion('', $this->_db) ;
|
1131 |
$liste = new liste_discussion('', $this->_db) ;
|
| Line 1132... |
Line 1132... |
| 1132 |
|
1132 |
|
| 1133 |
// On vérifie que le nom de la liste soit unique
|
1133 |
// On verifie que le nom de la liste soit unique
|
| 1134 |
if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
|
1134 |
if (liste_discussion::verifieDoubleListe($formulaire_liste->getSubmitValue('nom_liste').'@'.
|
| 1135 |
$formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
|
1135 |
$formulaire_liste->getSubmitValue('domaine_liste'), $this->_db)) {
|
| 1136 |
// On rajoute la liste dans la base
|
1136 |
// On rajoute la liste dans la base
|
| Line 1161... |
Line 1161... |
| 1161 |
return $formulaire_liste->toHTML() ;
|
1161 |
return $formulaire_liste->toHTML() ;
|
| 1162 |
}
|
1162 |
}
|
| 1163 |
} // end of member function nouvelleListeValidation
|
1163 |
} // end of member function nouvelleListeValidation
|
| Line 1164... |
Line 1164... |
| 1164 |
|
1164 |
|
| 1165 |
/**
|
1165 |
/**
|
| 1166 |
* Supprime la liste de discussion associée au projet
|
1166 |
* Supprime la liste de discussion associee au projet
|
| 1167 |
*
|
1167 |
*
|
| 1168 |
* @return void
|
1168 |
* @return void
|
| 1169 |
* @access public
|
1169 |
* @access public
|
| 1170 |
*/
|
1170 |
*/
|
| Line 1182... |
Line 1182... |
| 1182 |
|
1182 |
|
| 1183 |
|
1183 |
|
| 1184 |
/**
|
1184 |
/**
|
| 1185 |
*
|
1185 |
*
|
| 1186 |
*
|
1186 |
*
|
| 1187 |
* @param string presentation Pour affecter une présentation au projet
|
1187 |
* @param string presentation Pour affecter une presentation au projet
|
| 1188 |
* @return void
|
1188 |
* @return void
|
| 1189 |
* @access public
|
1189 |
* @access public
|
| 1190 |
*/
|
1190 |
*/
|
| Line 1203... |
Line 1203... |
| 1203 |
function setType( $type)
|
1203 |
function setType( $type)
|
| 1204 |
{
|
1204 |
{
|
| 1205 |
$this->_type = $type ;
|
1205 |
$this->_type = $type ;
|
| 1206 |
} // end of member function setPresentation
|
1206 |
} // end of member function setPresentation
|
| Line 1207... |
Line -... |
| 1207 |
|
- |
|
| 1208 |
|
- |
|
| 1209 |
/**
|
- |
|
| 1210 |
* Fonction affichant les participants à un projet
|
- |
|
| 1211 |
*
|
- |
|
| 1212 |
* @return string
|
- |
|
| 1213 |
* @access public
|
- |
|
| 1214 |
*/
|
- |
|
| 1215 |
function voirParticipants( )
|
- |
|
| 1216 |
{
|
- |
|
| 1217 |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
|
- |
|
| 1218 |
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
|
- |
|
| 1219 |
$projet = new projet ($this->_db, $this->_id_projet) ;
|
- |
|
| 1220 |
$titre = '<h1>'.$projet->getTitre().'</h1>'."\n" ;
|
- |
|
| 1221 |
$titre .= '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
|
- |
|
| 1222 |
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
|
- |
|
| 1223 |
$participants = new participe($this->_db) ;
|
- |
|
| 1224 |
|
- |
|
| 1225 |
// On teste ici s'il y a une mise à jour de statut
|
- |
|
| 1226 |
if (isset($_POST['statut'])) {
|
- |
|
| 1227 |
// $_GET['id_utilisateur'] et $_GET['statut'] proviennent du formulaire voir HTML_listeParticipants
|
- |
|
| 1228 |
$participants->setStatut($_POST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
|
- |
|
| 1229 |
}
|
- |
|
| 1230 |
|
- |
|
| 1231 |
// Ce qui suit doit être amàliorà pour sortir la requête sur l'annuaire
|
- |
|
| 1232 |
// On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
|
- |
|
| 1233 |
if (isset($_POST['mail_utilisateur'])) {
|
- |
|
| 1234 |
$requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
|
- |
|
| 1235 |
$resultat = $this->_db->query ($requete) ;
|
- |
|
| 1236 |
if (DB::isError ($resultat)) {
|
- |
|
| 1237 |
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
|
- |
|
| 1238 |
}
|
- |
|
| 1239 |
if (!$resultat->numRows()) {
|
- |
|
| 1240 |
$msg = PROJET_MAIL_ABSENT;
|
- |
|
| 1241 |
} else {
|
- |
|
| 1242 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
|
- |
|
| 1243 |
$participants->setStatut(3, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
|
- |
|
| 1244 |
}
|
- |
|
| 1245 |
}
|
- |
|
| 1246 |
|
- |
|
| 1247 |
if ($this->_auth->getAuth()) {
|
- |
|
| 1248 |
$statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
|
- |
|
| 1249 |
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
|
- |
|
| 1250 |
if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
|
- |
|
| 1251 |
if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR ;
|
- |
|
| 1252 |
$HTML_listeParticipants = new HTML_listeParticipants(true) ;
|
- |
|
| 1253 |
if ($statut < 2) $HTML_listeParticipants->setModeModification() ;
|
- |
|
| 1254 |
// Mise en place de l'url
|
- |
|
| 1255 |
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
|
- |
|
| 1256 |
$HTML_listeParticipants->setURL($this->_url) ;
|
- |
|
| 1257 |
// Construction de l'entete
|
- |
|
| 1258 |
$entete = array (PROJET_NOM, PROJET_PRENOM) ;
|
- |
|
| 1259 |
|
- |
|
| 1260 |
if ($this->_auth->getAuth()) {
|
- |
|
| 1261 |
array_push ($entete, PROJET_MAIL) ;
|
- |
|
| 1262 |
} else {
|
- |
|
| 1263 |
$droits = PROJET_DROIT_AUCUN ;
|
- |
|
| 1264 |
}
|
- |
|
| 1265 |
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ;
|
- |
|
| 1266 |
array_push ($entete, PROJET_DATE_INSCRIPTION) ;
|
- |
|
| 1267 |
$HTML_listeParticipants->construitEntete($entete) ;
|
- |
|
| 1268 |
|
- |
|
| 1269 |
$HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM_COORD, $this->_db)) ;
|
- |
|
| 1270 |
|
- |
|
| 1271 |
$res = $HTML_listeParticipants->toHTML() ;
|
- |
|
| 1272 |
|
- |
|
| 1273 |
if ($statut < 2) {
|
- |
|
| 1274 |
$res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
|
- |
|
| 1275 |
$res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
|
- |
|
| 1276 |
if (isset ($msg) && $msg != '') {
|
- |
|
| 1277 |
$res .= '<div>'.$msg.'</div>' ;
|
- |
|
| 1278 |
}
|
- |
|
| 1279 |
$res .= '<input type="text" name="mail_utilisateur" size="32" />' ;
|
- |
|
| 1280 |
$res .= '<input type="submit" value="'.PROJET_NOUVEAU_UTILISATEUR.'" />'."\n" ;
|
- |
|
| 1281 |
$res .= '</form>'."\n" ;
|
- |
|
| 1282 |
}
|
- |
|
| 1283 |
} else {
|
- |
|
| 1284 |
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ;
|
- |
|
| 1285 |
}
|
- |
|
| 1286 |
return $titre.$res ;
|
- |
|
| 1287 |
|
- |
|
| 1288 |
} // end of member function voirParticipants
|
- |
|
| 1289 |
|
1207 |
|
| 1290 |
/**
|
1208 |
/**
|
| 1291 |
* Inscrit un utilisateur a un projet avec le statut observateur
|
1209 |
* Inscrit un utilisateur a un projet avec le statut observateur
|
| 1292 |
*
|
1210 |
*
|
| 1293 |
* @return void
|
1211 |
* @return void
|
| Line 1488... |
Line 1406... |
| 1488 |
$url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
|
1406 |
$url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
|
| 1489 |
$res =admin_afficherContenuCorps();
|
1407 |
$res =admin_afficherContenuCorps();
|
| 1490 |
$res .= '<br /><a href="'.$this->_url->getURL().'">'.PROJET_RETOUR_RESUME.'</a>';
|
1408 |
$res .= '<br /><a href="'.$this->_url->getURL().'">'.PROJET_RETOUR_RESUME.'</a>';
|
| 1491 |
return $res;
|
1409 |
return $res;
|
| Line 1492... |
Line 1410... |
| 1492 |
|
1410 |
|
| Line 1493... |
Line 1411... |
| 1493 |
} // end of member function formulaireWiki
|
1411 |
}
|
| 1494 |
|
1412 |
|
| 1495 |
|
1413 |
|
| Line 1496... |
Line 1414... |
| 1496 |
function associerWiki( )
|
1414 |
function associerWiki( )
|
| 1497 |
{
|
1415 |
{
|
| Line 1498... |
Line 1416... |
| 1498 |
$res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
|
1416 |
$res = '<h1>'.PROJET_ASSOCIER_WIKI.'</h1>'."\n" ;
|
| 1499 |
|
1417 |
|
| 1500 |
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
|
1418 |
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
|
| Line 1501... |
Line 1419... |
| 1501 |
$res='';
|
1419 |
$res='';
|
| 1502 |
|
1420 |
|
| Line 1517... |
Line 1435... |
| 1517 |
|
1435 |
|
| Line 1518... |
Line 1436... |
| 1518 |
$tableau_wikini = array() ;
|
1436 |
$tableau_wikini = array() ;
|
| 1519 |
|
1437 |
|
| 1520 |
while ($ligne = $resultat->fetchRow()) {
|
1438 |
while ($ligne = $resultat->fetchRow()) {
|
| 1521 |
$this->_url->addQueryString ('id_wikini', $ligne[0]) ;
|
1439 |
$this->_url->addQueryString ('id_wikini', $ligne[0]) ;
|
| 1522 |
array_push ($tableau_wikini, array ($ligne[1]."\n", // première colonne, le nom de l'application
|
1440 |
array_push ($tableau_wikini, array ($ligne[1]."\n", // Premiere colonne, le nom de l'application
|
| 1523 |
$ligne[2]."\n", // Deuxieme colonne, la page par defaut
|
1441 |
$ligne[2]."\n", // Deuxieme colonne, la page par defaut
|
| 1524 |
'<a href="'.$this->_url->getURL()."&".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
|
1442 |
'<a href="'.$this->_url->getURL()."&".PROJET_VARIABLE_ACTION."=".PROJET_ACTION_ASSOCIER_WIKI_V."".'">'.PROJET_CHOISIR_WIKINI.'</a>'."\n",
|
| 1525 |
));
|
1443 |
));
|
| Line 1608... |
Line 1526... |
| 1608 |
$HTML_formulaireListeExterne->setDefaults($default) ;
|
1526 |
$HTML_formulaireListeExterne->setDefaults($default) ;
|
| 1609 |
return $res.$HTML_formulaireListeExterne->toHTML() ;
|
1527 |
return $res.$HTML_formulaireListeExterne->toHTML() ;
|
| 1610 |
} // end of member function referencerListeExterne
|
1528 |
} // end of member function referencerListeExterne
|
| Line 1611... |
Line 1529... |
| 1611 |
|
1529 |
|
| 1612 |
/**
|
1530 |
/**
|
| 1613 |
* Réalise les mises à jours dans la table projet_lien_liste_externe
|
1531 |
* Realise les mises a jours dans la table projet_lien_liste_externe
|
| 1614 |
*
|
1532 |
*
|
| 1615 |
* @return void
|
1533 |
* @return void
|
| 1616 |
* @access public
|
1534 |
* @access public
|
| 1617 |
*/
|
1535 |
*/
|
| Line 1767... |
Line 1685... |
| 1767 |
}
|
1685 |
}
|
| 1768 |
}
|
1686 |
}
|
| 1769 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1687 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 1770 |
*
|
1688 |
*
|
| 1771 |
* $Log: not supported by cvs2svn $
|
1689 |
* $Log: not supported by cvs2svn $
|
| - |
|
1690 |
* Revision 1.45 2008-08-26 12:42:10 alexandre_tb
|
| - |
|
1691 |
* nettoyage url apres suppression d un fichier
|
| - |
|
1692 |
*
|
| 1772 |
* Revision 1.44 2008-08-26 08:52:28 alexandre_tb
|
1693 |
* Revision 1.44 2008-08-26 08:52:28 alexandre_tb
|
| 1773 |
* suppression de la methode accueilProjet desormais remplacee par resume.php
|
1694 |
* suppression de la methode accueilProjet desormais remplacee par resume.php
|
| 1774 |
*
|
1695 |
*
|
| 1775 |
* Revision 1.43 2008-08-25 15:06:59 alexandre_tb
|
1696 |
* Revision 1.43 2008-08-25 15:06:59 alexandre_tb
|
| 1776 |
* ajout:
|
1697 |
* ajout:
|