20,7 → 20,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
|
// CVS : $Id: projetControleur.class.php,v 1.20 2005-11-23 11:37:05 alexandre_tb Exp $ |
// CVS : $Id: projetControleur.class.php,v 1.21 2005-11-25 14:49:26 alexandre_tb Exp $ |
|
/** |
* Application projet |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.20 $ |
*@version $Revision: 1.21 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
308,10 → 308,10 |
$this->_action = PROJET_ACTION_VOIR_RESUME ; |
break ; |
case PROJET_ACTION_INSCRIPTION_LISTE : $retour .= $this->inscriptionListe() ; |
$this->_action = PROJET_ACTION_VOIR_RESUME ; |
$this->_action = PROJET_ACTION_VOIR_FORUM ; |
break ; |
case PROJET_ACTION_DESINSCRIPTION_LISTE : $retour .= $this->desinscriptionListe() ; |
$this->_action = PROJET_ACTION_VOIR_RESUME ; |
$this->_action = PROJET_ACTION_VOIR_FORUM ; |
break ; |
case PROJET_ACTION_REFERENCER_LISTE : $retour .= $this->referencerListeExterne() ; |
break ; |
403,193 → 403,9 |
$auth = $this->_auth->getAuth() ; // Pour raccourcir le code |
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; // -------------- |
|
return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ; |
|
// Si la présentation est par arbre |
// TODO : Organiser différemment les présentations |
// En utilisant des templates |
if ($this->_presentation == 'arbre') { |
$titre = '<h1>Arbre des Projets</h1>'."\n" ; |
include_once PROJET_CHEMIN_API_ARBRE.'arbre.class.php' ; |
// initialisation de variables |
$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(), |
$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'])) { |
// $_POST['statut'] et $_GET['identifiant_projet'] proviennent du formulaire voir HTML_listeProjet |
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ; |
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ; |
$annuaire->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ; |
$projet = new projet ($this->_db, $_GET['identifiant_projet']) ; |
$projet->getListesAssociees() ; |
$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) |
$statut_liste = new statut_liste($this->_db) ; |
$tableau_statut = $statut_liste->getTousLesStatuts() ; |
|
$statut = '' ; |
$i = 0 ; |
$HTML_projetListe->setModeModification() ; |
$HTML_projetListe->setURL($this->_url) ; |
foreach ($projetListe as $projet) { |
if (participe::getStatutSurProjetCourant($id_u, $projet->getId(), $this->_db) == 4) continue ; |
if ($auth) { |
if ($projet->avoirListe()) { |
$projet->getListesAssociees() ; |
$statut = $utilisateur_liste->getStatutInscrit($projet->_listes_associes[0]->getId(), $this->_auth) ; |
//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>' |
) ; |
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(\''. |
PROJET_SE_DESINSCRIRE_CONFIRMATION.'\');">'.PROJET_SE_DESINSCRIRE.'</a>') ; |
if ($projet->avoirListe()) { |
array_push ($ligne_tableau, $statut) ; |
} else { |
array_push($ligne_tableau, '') ; |
} |
array_push ($tableau_resultat, $ligne_tableau) ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ; |
} |
$statut = '' ; |
} |
$HTML_projetListe->construitListe ($tableau_resultat, $tableau_statut) ; |
|
|
if ($HTML_projetListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_PARTICIPER.'</p>'; |
$res .= $HTML_projetListe->toHTML() ; |
} |
} else { |
$res .= '<p>'.PROJET_INSCRIT_AUCUN_PROJET.'</p>' ; |
} |
} |
|
// Un texte pour ceux qui ne sont pas identifiés |
if (!$auth) { |
$res .= '<p>'.PROJET_TEXTE_NON_IDENTIFIE.'</p>'."\n" ; |
} |
|
// Maintenant la liste des projets où l'utilisateur ne participe pas. |
// Et si pas loggué tous les projets |
if ($auth) { |
$projetNonParticipantListe = $participant -> getProjetsNonParticipant($id_u) ; |
// Si certain projet sont à exclure, on les exclu |
$projet_a_exclure = array() ; |
if (count($this->_projet_exclu)) { |
arsort($this->_projet_exclu) ; |
foreach ($this->_projet_exclu as $valeur) { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
if ($projetNonParticipantListe[$i]->getId() == $valeur) array_push ($projet_a_exclure, $i);} |
} |
} |
if (PROJET_UTILISE_TYPE && $this->_type != '') { |
for ($i = 0; $i < count($projetNonParticipantListe); $i++) { |
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(), |
'<a href="'.$this->_url->getURL().'">'.$projet->getTitre().'</a>' // le nom du projet |
) ; |
$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) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) $res .= $HTML_projetNonParticipantListe->toHTML() ; |
} else { |
$projetNonParticipantListe = & $projetListe ; |
$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) { |
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $projet->getId()) ; |
$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) ; |
} |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
$HTML_projetNonParticipantListe->construitListe($liste_projet) ; |
if ($HTML_projetNonParticipantListe->getRowCount() > 1) { |
$res .= '<p>'.PROJET_TOUS_LES_PROJETS.'</p>' ; |
$res .= $HTML_projetNonParticipantListe->toHTML() ; |
} |
} |
return $titre.$res ; |
} // end of member function mesProjets |
|
/** |
765,6 → 581,7 |
} |
$res .= '</ul>' ; |
$res .= "</div>\n" ; |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ; |
return $res ; |
} // end of member function menuGeneral |
|
1741,6 → 1558,7 |
} |
$liste->construireListe($tableau_wikini) ; |
$res .= $liste->toHTML(); |
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ; |
return $res ; |
|
|