Subversion Repositories Applications.projet

Rev

Rev 197 | Rev 398 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 197 Rev 249
Line 8... Line 8...
8
*   | Affiche les derniers fichiers uploader dans le module projet          |
8
*   | Affiche les derniers fichiers uploader dans le module projet          |
9
*   +-----------------------------------------------------------------------+
9
*   +-----------------------------------------------------------------------+
10
*   | Auteur : Alexandre Granier <alexandre@tela-botanica.org> 		        |
10
*   | Auteur : Alexandre Granier <alexandre@tela-botanica.org> 		        |
11
*   +-----------------------------------------------------------------------+
11
*   +-----------------------------------------------------------------------+
Line 12... Line 12...
12
 
12
 
13
*   $Id: projet_derniers_telechargements.php,v 1.4 2007-04-19 09:17:35 alexandre_tb Exp $
13
*   $Id: projet_derniers_telechargements.php,v 1.5 2007-06-25 12:15:06 alexandre_tb Exp $
Line 14... Line 14...
14
*/
14
*/
15
 
15
 
Line 16... Line 16...
16
// Cette application affiche les derniers  documents uploadé dans le module projet
16
// Cette application affiche les derniers  documents uploades dans le module projet
17
// ainsi que tous les documents du module
17
// ainsi que tous les documents du module
18
 
18
 
Line 19... Line 19...
19
// ===========================================================
19
// ===========================================================
20
//                  Configuration
20
//                  Configuration
Line 21... Line 21...
21
// ===========================================================
21
// ===========================================================
22
 
22
 
23
 
23
 
24
// Le nombre à afficher 
24
// Le nombre a afficher 
Line 25... Line 25...
25
define ("PROJET_TELECHARGEMENT_NOMBRE", 8) ;
25
define ("PROJET_TELECHARGEMENT_NOMBRE", 8) ;
26
 
26
 
27
//====================      Les labels      =======================================
-
 
Line 28... Line 27...
28
define ("PROJET_TELECHARGEMENT_TITRE", "Page de téléchargements rapides") ;
27
//====================      Les labels      =======================================
29
define ("PROJET_TELECHARGEMENT_DERNIERS", "Derniers documents mis en ligne") ;
28
define ("PROJET_TELECHARGEMENT_TITRE", "Page de t&eacute;l&eacute;chargements rapides") ;
30
define ("PROJET_TELECHARGEMENT_TOUS", "Tous les documents, par projet") ;
29
define ("PROJET_TELECHARGEMENT_DERNIERS", "Derniers documents mis en ligne") ;
31
 
30
define ("PROJET_TELECHARGEMENT_TOUS", "Tous les documents, par projet") ;
32
//=============bibliothèques PEAR  ===================================
31
 
Line 33... Line 32...
33
include_once 'HTML/Table.php' ;
32
//=============bibliotheques PEAR  ===================================
34
include_once 'HTML/TreeMenu.php' ;
33
include_once 'HTML/Table.php' ;
35
 
-
 
Line -... Line 34...
-
 
34
 
-
 
35
// ========== Bibliotheque Projet ====================================
-
 
36
include_once 'configuration/projet.config.inc.php' ;
-
 
37
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
-
 
38
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
-
 
39
include_once PROJET_CHEMIN_APPLI.'langues/pro_langue_fr.inc.php' ;
-
 
40
 
-
 
41
 
36
// ========== Bibliothèque Projet ====================================
42
function afficherContenuCorps() {
37
include_once 'configuration/projet.config.inc.php' ;
43
    global $id_projet, $repcourant, $baseURL, $projet ;
Line 38... Line 44...
38
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
44
    
Line 39... Line 45...
39
include_once PROJET_CHEMIN_CLASSES.'document.class.php' ;
45
    if (isset($_GET['service'])) {
Line 58... Line 64...
58
    $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
64
    $entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
59
    if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
65
    if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
Line 60... Line 66...
60
        
66
        
61
    $vue_liste_document->construitEntete($entete_liste) ;
67
    $vue_liste_document->construitEntete($entete_liste) ;
62
    $vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $GLOBALS['projet_db']) ;
68
    $vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $GLOBALS['projet_db']) ;
Line 63... Line 69...
63
    $res .= $vue_liste_document->toHTML() ;
69
    $res .= $vue_liste_document->toHTML('', PROJET_DROIT_AUCUN) ;
Line 64... Line -...
64
    
-
 
65
    $res .= "<h2>".PROJET_TELECHARGEMENT_TOUS."</h2>\n" ;
-
 
66
    
70
    
67
    // Création de l'objet TreeMenu
71
    $res .= "<h2>".PROJET_TELECHARGEMENT_TOUS."</h2>\n" ;
68
    //GEN_stockerFichierScript(1, "api/TreeMenu/TreeMenu.js") ;
72
    
69
    
73
 
Line 70... Line 74...
70
    // Les noms des fichiers graphiques
74
    // Les noms des fichiers graphiques
71
    $icon         = 'folder.gif';
75
    $icon         = 'folder.gif';
72
    $expandedIcon = 'folder-expanded.gif';
76
    $expandedIcon = 'folder-expanded.gif';
73
    
77
    
Line 74... Line -...
74
    $i = 0 ;
-
 
75
    // Requete sur les projets
-
 
76
    $requete = "SELECT p_titre, p_id FROM projet ORDER BY p_titre" ;
78
    $i = 0 ;
77
    $resultat = $GLOBALS['projet_db']->query ($requete) or die ("Echec <br />".mysql_error()."<br />$requete") ;
79
    // Requete sur les projets
78
    
80
    $requete = "SELECT p_titre, p_id FROM projet ORDER BY p_titre" ;
79
//    $menu = new HTML_TreeMenu() ;
-
 
80
//    $node = new HTML_TreeNode(array('text' => "Les projets de Tela Botanica", 'link' => "", 'icon' => $icon, 'expandedIcon' => $expandedIcon));
-
 
81
    $noeudProjet = '' ;
81
    $resultat = $GLOBALS['projet_db']->query ($requete) or die ("Echec <br />".mysql_error()."<br />$requete") ;
82
    while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
82
    
83
        $titre = $ligne->p_titre ;
83
    $noeudProjet = '' ;
84
//        $node_1[$i] = &$node->addItem (new HTML_TreeNode(array('text' => $titre, 'link' => "", 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
84
    while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
85
//        projet_fichiers (&$node_1[$i], $ligne->p_id) ;
-
 
86
        $i++ ;
-
 
87
        $noeudProjet .= '<div dojoType="TreeNode" title="'.$ligne->p_titre.'" widgetId="projet_'.
-
 
88
        				$ligne->p_id.'" objectId="projet_'.$ligne->p_id.'" isFolder="true"></div>'."\n";
85
        $titre = $ligne->p_titre ;
89
    }
86
        $i++ ;
90
//    $menu->addItem($node);
87
        $noeudProjet .= '<div dojoType="TreeNode" title="'.$ligne->p_titre.'" widgetId="projet_'.
91
//    $treeMenu = &new HTML_TreeMenu_DHTML($menu, array('images' => 'api/TreeMenu/images', 'defaultClass' => 'text'));
88
        				$ligne->p_id.'" objectId="projet_'.$ligne->p_id.'" isFolder="true"></div>'."\n";
-
 
89
    }
92
//    $res .= "<p>".$treeMenu->toHTML()."</p>\n" ;
90
  
-
 
91
    GEN_stockerFichierScript('dojo', 'api/js/dojo/dojo.js', 'text/javascript');
-
 
92
    GEN_stockerFichierScript('dojoScriptProjet', PROJET_CHEMIN_APPLI.'js/telechargement.js');
-
 
93
    //$res .= '<p>' ;
93
    
94
    
94
    GEN_stockerFichierScript('dojo', 'api/js/dojo/dojo.js', 'text/javascript');
95
    $RCPUrl = PROJET_CHEMIN_APPLI.'services/ecouteArbreFichier.php?id_projet='.$id_projet;
95
    GEN_stockerFichierScript('dojoScriptProjet', PROJET_CHEMIN_APPLI.'js/telechargement.js');
96
	$GLOBALS['url']->addQueryString(PROJET_VARIABLE_SERVICE, 'ecouteArbreFichier');
96
    //$res .= '<p>' ;
97
			
97
    $RPCUrl = PROJET_CHEMIN_APPLI.'services/ecouteArbreFichier.php';
98
	$RCPUrl = $GLOBALS['url']->getURL();
Line 98... Line 99...
98
    $res .= '<div dojoType="TreeLoadingController" RPCUrl="'.$RPCUrl.'" widgetId="treeController" DNDController="create"></div>
99
    $res .= '<div dojoType="TreeLoadingController" RPCUrl="'.$RCPUrl.'" widgetId="treeController" DNDController="create"></div>
Line 99... Line 100...
99
				<div dojoType="TreeSelector" widgetId="treeSelector"></div>
100
				<div dojoType="TreeSelector" widgetId="treeSelector"></div>
100
				<div dojoType="Tree" DNDMode="between" selector="treeSelector" widgetId="bandTree" controller="treeController">
101
				<div dojoType="Tree" DNDMode="between" selector="treeSelector" widgetId="bandTree" controller="treeController">
Line 101... Line 102...
101
				<div dojoType="TreeNode" title="Racine" widgetId="rootNode" objectId="root" isFolder="true">'."\n".
102
				<div dojoType="TreeNode" title="Racine" widgetId="rootNode" objectId="root" isFolder="true">'."\n".
102
			$noeudProjet.'</div></div>';	
103
			$noeudProjet.'</div></div>';	
103
	
104
	
104
    //$res .= '</p>';
105
    //$res .= '</p>';
105
    
106
    
106
    return $res ;
107
    return $res ;
107
}
108
}
Line 108... Line 109...
108
 
109
 
109
/** fonction projet_fichiers() - Remplie un noeud avec les fichiers et répertoires
110
/** fonction projet_fichiers() - Remplie un noeud avec les fichiers et repertoires
110
*
111
*
Line 111... Line 112...
111
* Le noeud est passé en référence. Ainsi, cette fonction ne retourne rien mais modifie le tableau des 
112
* Le noeud est passe en reference. Ainsi, cette fonction ne retourne rien mais modifie le tableau des 
112
* noeuds passé en référence.
113
* noeuds passe en reference.
Line 113... Line 114...
113
*
114
*
114
* return  void
115
* return  void
115
*/
116
*/
Line 164... Line 165...
164
    }
165
    }
165
    $requete_fichiers .= ' ORDER BY projet_documents.pd_nom ASC' ;
166
    $requete_fichiers .= ' ORDER BY projet_documents.pd_nom ASC' ;
Line 166... Line 167...
166
 
167
 
167
    $resultat_fichiers = $GLOBALS['projet_db']->query($requete_fichiers) ;
168
    $resultat_fichiers = $GLOBALS['projet_db']->query($requete_fichiers) ;
168
    if (DB::isError ($resultat_fichiers)) {
169
    if (DB::isError ($resultat_fichiers)) {
169
        die ('Echec de la requete : '.$requete.'<br />'.$resultat_fichiers->getMessage()) ;
170
        die ('Echec de la requete : '.$requete_fichiers.'<br />'.$resultat_fichiers->getMessage()) ;
Line 170... Line 171...
170
    }
171
    }
171
    
172
    
172
    //Stockage des informations sur les fichiers du répertoires courant pour affichage dans un arbre
173
    //Stockage des informations sur les fichiers du répertoires courant pour affichage dans un arbre
Line 185... Line 186...
185
}
186
}
Line 186... Line 187...
186
 
187
 
187
/* +--Fin du code ----------------------------------------------------------------------------------------+
188
/* +--Fin du code ----------------------------------------------------------------------------------------+
188
*
189
*
-
 
190
* $Log: not supported by cvs2svn $
-
 
191
* Revision 1.4  2007/04/19 09:17:35  alexandre_tb
-
 
192
* utilisation de dojo pour afficher l arbre des derniers documents
189
* $Log: not supported by cvs2svn $
193
*
190
* Revision 1.3  2005/10/06 08:23:48  alexandre_tb
194
* Revision 1.3  2005/10/06 08:23:48  alexandre_tb
191
* Ajout de commentaires
195
* Ajout de commentaires
192
*
196
*
193
*
197
*