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: documents.php,v 1.10 2007-10-02 09:24:53 alexandre_tb Exp $ |
// CVS : $Id: documents.php,v 1.11 2008-08-25 15:02:49 alexandre_tb Exp $ |
/** |
* Application projet |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.10 $ |
*@version $Revision: 1.11 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
44,20 → 44,27 |
// |
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) ; |
|
$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.'AJAX_arbreDocuments.class.php' ; |
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ; |
|
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ; |
|
$vue_liste_document = new AJAX_arbreDocuments($this->_url, false, $this->_id_repertoire, $this->_auth) ; |
$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)) ; |
69,40 → 76,55 |
|
// 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) ; |
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db); |
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR; |
|
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ; |
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ; |
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ; |
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ; |
$droits = $participant->getStatut($id_u, $this->_id_projet); |
|
|
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ; |
// si participant, on ajoute le champs visibilite |
|
if ($statut !='' || $isAdm) { |
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 ; |
|
foreach ($liste_documents as $document) { |
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) { |
$proprietaire_un_document = true ; |
$droits = PROJET_DROIT_PROPRIETAIRE ; |
} |
} |
if ($statut > 0 || $proprietaire_un_document) { |
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 .= '<br style="clear:both" />'; |
$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 .= '<br style="clear:both" />'; |
$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 ; |
|
109,30 → 131,45 |
$vue_liste_document->construitEntete($entete_liste) ; |
$vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ; |
|
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ; |
|
$retour .= '<h2>'.PROJET_DOCUMENT_DU_PROJET.'</h2>'."\n" ; |
// Les liens pour l affichage classique ou arborescent (avec dojo) |
$this->_url->addQueryString('affichage', 'ajax'); |
$retour .= '<a href="'.$this->_url->getURL().'">'.PROJET_AFFICHAGE_ARBORESCENT.'</a>'."\n"; |
$url_ajax = $this->_url->getURL(); |
$this->_url->addQueryString('affichage', 'standart'); |
$retour .= '<a href="'.$this->_url->getURL().'">'.PROJET_AFFICHAGE_CLASSIQUE.'</a>'."\n"; |
$url_classique = $this->_url->getURL(); |
$this->_url->removeQueryString('affichage'); |
|
$arbre = document::getArbreDocument($this->_id_projet) ; |
|
$retour .= '<noscript>'; |
$vue_liste_document->setModeAffichage('standart'); |
$retour .= $vue_liste_document->toHTML('', '') ; |
$retour .= '</noscript>'; |
|
if (!isset ($_SESSION['mode_affichage'])) { |
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; else $_SESSION['mode_affichage'] = 'ajax'; |
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']); |
|
$retour .= $vue_liste_document->toHTML($projet->getId(), $droits); |
$html_no_script = ''; |
if ($vue_liste_document->_mode_affichage == 'ajax') { |
$html_no_script .= '<noscript>'; |
$vue_liste_document->setModeAffichage('standart'); |
$html_no_script .= $vue_liste_document->toHTML('', '') ; |
$html_no_script .= '</noscript>'; |
} |
|
|
$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: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |