//Autres auteurs : *@author Aucun *@copyright Tela-Botanica 2000-2005 *@version $Revision: 1.10 $ // +------------------------------------------------------------------------------------------------------+ */ // +------------------------------------------------------------------------------------------------------+ // | ENTETE du PROGRAMME | // +------------------------------------------------------------------------------------------------------+ // RAPPEL IMPORTANT // On se situe dans la methode run() de la classe projetControleur // if (!isset($retour)) $retour = ''; $bouton_deposer_doc = ''; $bouton_creer_repertoire = ''; // creation de l'objet projet courant include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ; $projet = new projet ($this->_db, $this->_id_projet) ; // recuperation de la liste des documents associes $liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES, $this->_id_repertoire) ; //$html_document = print_r($liste_documents, true); // creation 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' ; $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ; $vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire, $this->_auth) ; if (count ($liste_documents) == 0) $pas_de_document = true; // reglage de parametres 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) ; // verification des droits de l'utilisateur $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ; $loggue = false; if ($this->_auth->getAuth()) { $loggue = true; include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ; $participant = new participe($this->_db) ; $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; $droits = $participant->getStatut($id_u, $this->_id_projet); // si participant, on ajoute le champs visibilite if ($droits <= PROJET_DROIT_CONTRIBUTEUR) { array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ; } // si chef de projet ou si proprietaire d'au moins 1 document $proprietaire_un_document = false ; if ($droit <= PROJET_DROIT_CONTRIBUTEUR ) { array_push ($entete_liste, PROJET_ACTION) ; } switch ($droits) { case PROJET_DROIT_AUCUN : $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); $lien_inscription = $this->_url->getURL(); $laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT; $label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET; $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE); $lien_inscription = $this->_url->getURL(); $label_url_inscription = 'S\'inscrire à ce projet'; break; } $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER); $bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'Déposer un document', 'document'); $bouton_deposer_doc .= '
'; $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE); $bouton_creer_repertoire = bouton::toHTML($this->_url->getURL(), 'Créer un répertoire', 'repertoire'); $bouton_creer_repertoire .= '
'; $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT); } else { $droits = PROJET_DROIT_AUCUN ; $lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');'; GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js'); GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js'); GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n". 'animatedcollapse.init();' ."\n"); $label_url_inscription = 'S\'inscrire à au projet'; } if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ; $vue_liste_document->construitEntete($entete_liste) ; $vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ; // Les liens pour l affichage classique ou arborescent (avec dojo) $this->_url->addQueryString('affichage', 'ajax'); $url_ajax = $this->_url->getURL(); $this->_url->addQueryString('affichage', 'standart'); $url_classique = $this->_url->getURL(); $this->_url->removeQueryString('affichage'); $arbre = document::getArbreDocument($this->_id_projet) ; if (!isset ($_SESSION['mode_affichage'])) { if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; else $_SESSION['mode_affichage'] = 'standart'; } else { if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; } $vue_liste_document->setModeAffichage($_SESSION['mode_affichage']); $html_no_script = ''; if ($vue_liste_document->_mode_affichage == 'ajax') { $html_no_script .= ''; } $html_document .= $vue_liste_document->toHTML($projet->getId(), $droits); $this->_url->removeQueryString(PROJET_VARIABLE_SERVICE); $GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DOCUMENT; ob_start(); include_once PROJET_CHEMIN_APPLI.'/squelettes/document.tpl.html'; $retour .= ob_get_contents(); ob_end_clean(); /* +--Fin du code ----------------------------------------------------------------------------------------+ * * $Log$ * * +-- Fin du code ----------------------------------------------------------------------------------------+ */ ?>