[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Epnadmin-fr] CVS: epnadmin configuration.php,1.4,1.5 constantes.inc.php
From: |
Loïc Dayot |
Subject: |
[Epnadmin-fr] CVS: epnadmin configuration.php,1.4,1.5 constantes.inc.php,1.19,1.20 entete.inc.php,1.18,1.19 fr.lang.inc.php,1.3,1.4 horaires.php,1.10,1.11 logiciels.php,1.4,1.5 materiels.php,1.6,1.7 |
Date: |
Fri, 31 Jan 2003 16:19:42 -0500 |
Update of /cvsroot/epnadmin/epnadmin
In directory subversions:/tmp/cvs-serv29989/epnadmin
Modified Files:
configuration.php constantes.inc.php entete.inc.php
fr.lang.inc.php horaires.php logiciels.php materiels.php
Log Message:
Modularisation suite mais pas fin...
Index: configuration.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/configuration.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** configuration.php 28 Jan 2003 23:13:45 -0000 1.4
--- configuration.php 31 Jan 2003 21:19:40 -0000 1.5
***************
*** 325,329 ****
// Retrouver la fonctionnalité rendue active
$req4="SELECT * FROM fonctions WHERE id='$suivante'";
! //debug($req4);
$res4=executeRequete($req4);
$fctajoutee=mysql_fetch_object($res4);
--- 325,329 ----
// Retrouver la fonctionnalité rendue active
$req4="SELECT * FROM fonctions WHERE id='$suivante'";
! debug($req4);
$res4=executeRequete($req4);
$fctajoutee=mysql_fetch_object($res4);
***************
*** 397,406 ****
break;
! case 31 : // Voir les droits des structures
! affiche_autorisations($id);
break;
case 32 : // Modifier les drotis des structures
! saisie_autorisations($id);
break;
--- 397,408 ----
break;
! case 31 : // Voir les droits des structures
! // TODO : choix de la structure
! affiche_autorisations($id_structure);
break;
case 32 : // Modifier les drotis des structures
! // TODO : choix de la structure
! saisie_autorisations($id_structure);
break;
Index: constantes.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/constantes.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** constantes.inc.php 28 Jan 2003 23:13:45 -0000 1.19
--- constantes.inc.php 31 Jan 2003 21:19:40 -0000 1.20
***************
*** 37,40 ****
--- 37,41 ----
$dir_tmp_images="/tmp/"; // utilisé dans print.php et 6cartes.php
// C'est un dossier dans lequel le user apache a des droits
d'écriture
+ $url_epnadmin="http://localhost/epnadmin/"; //sert dans les messages d'erreur
// Exécution des commandes bash
***************
*** 67,71 ****
// et des domaines de
courriels
// utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="127.0.0.1"; // sert dans courriel.inc.php
// constantes
--- 68,72 ----
// et des domaines de
courriels
// utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="192.168.0.253"; // sert dans courriel.inc.php
// constantes
Index: entete.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/entete.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** entete.inc.php 28 Jan 2003 23:13:45 -0000 1.18
--- entete.inc.php 31 Jan 2003 21:19:40 -0000 1.19
***************
*** 280,286 ****
}
-
- // TODO : Prêt et emprunt de matériel ou logiciels
- /*
echo "
<tr>
--- 280,283 ----
***************
*** 295,309 ****
<tr>
<td valign=\"top\" bgcolor=\"$cfond\"><br></td>
! <td valign=\"top\">
! <a href=\"prets.php?operation=2\">emprunter</a><br>
! <a href=\"prets.php?operation=1\">prêter</a>\n";
!
! if ($isadmin)
! {
! echo "<br>
! <a href=\"prets.php?operation=3\">tous les prêts</a><br>
! <a href=\"materiels.php?operation=5\">parc</a>\n";
! }
echo "
--- 292,303 ----
<tr>
<td valign=\"top\" bgcolor=\"$cfond\"><br></td>
! <td valign=\"top\">\n";
! if (PRETS>"~")
! echo "<a href=\"prets.php?operation=2\">emprunter</a>
! <br><a href=\"prets.php?operation=1\">prêter</a>
! <br><a href=\"prets.php?operation=3\">tous les prêts</a>";
! if (PARC>"~")
! echo "<a href=\"materiels.php\">parc</a>\n";
echo "
***************
*** 316,320 ****
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>\n";
! */
// if ($isadmin=="super") // Suppri avec 0.6
--- 310,314 ----
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>\n";
!
// if ($isadmin=="super") // Suppri avec 0.6
Index: fr.lang.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/fr.lang.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** fr.lang.inc.php 28 Jan 2003 23:13:45 -0000 1.3
--- fr.lang.inc.php 31 Jan 2003 21:19:40 -0000 1.4
***************
*** 21,24 ****
--- 21,25 ----
http://epnadmin.pierrefitte93.fr/
*/
+ require_once("constantes.inc.php");
// configuration.php
***************
*** 65,73 ****
$questions="questions";
$titrequestions="Base des questions d'autoévaluation";
// Toutes ou beaucoup
srand((float) microtime()*1000000);
$pasledroit="<p>";
! switch (rand())
{
case 0 : $pasledroit.="Encore fourvoyé(e), ce n'est pas un endroit pour toi...
--- 66,82 ----
$questions="questions";
$titrequestions="Base des questions d'autoévaluation";
+
+ // Horaires.php
+ $manqueinfosalle="<p>Problème : il me manque l'information sur la salle
!</p>\n";
+ $salleintrouvable="<p>Problème : la salle n'a pas été retrouvée !</p>\n";
+
+ // Logiciels.php
+ $manqueinfologiciel="<p>Problème : il me manque l'information sur le logiciel
!</p>\n";
+ $logicielintrouvable="<p>Problème : le logiciel n'a pas été retrouvé !</p>\n";
// Toutes ou beaucoup
srand((float) microtime()*1000000);
$pasledroit="<p>";
! switch (rand(0, 4))
{
case 0 : $pasledroit.="Encore fourvoyé(e), ce n'est pas un endroit pour toi...
***************
*** 79,88 ****
case 3 : $pasledroit.="Vous n'avez pas les autorisations suffisantes pour
accéder à ce service.
Adressez-vous à votre administrateur si vous pensez que c'est
une erreur."; break;
}
$pasledroit.="</p>
! <p><a href=\"/\">Retour</a></p>\n";
! $fctnonactive="<p>La fonctionnalité gérée dans cette écran a été
désactivée.</p>
! <p><a href=\"/\">Retour</a></p>\n";
--- 88,99 ----
case 3 : $pasledroit.="Vous n'avez pas les autorisations suffisantes pour
accéder à ce service.
Adressez-vous à votre administrateur si vous pensez que c'est
une erreur."; break;
+ case 4 : $pasledroit.="C'est un vrai labyrinthe, n'est-ce pas, ce site...
+ Quoi qu'il en soit vous êtes perdus.</p>\n"; break;
}
$pasledroit.="</p>
! <p><a href=\"$url_epnadmin\">Retour</a></p>\n";
! $fctnonactive="<p>La fonctionnalité gérée dans cet écran a été désactivée.</p>
! <p><a href=\"$url_epnadmin\">Retour</a></p>\n";
Index: horaires.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/horaires.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** horaires.php 26 Jan 2003 23:09:59 -0000 1.10
--- horaires.php 31 Jan 2003 21:19:40 -0000 1.11
***************
*** 160,174 ****
if (!$tranchehoraire->ouverture)
echo "F ";
! elseif (HORAIRES>="40" || (HORAIRES>="20" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=11&id_localisation=$id_localisation&date=$datecur&debut=$heure\">f</a>
\n";
if ($tranchehoraire->ouverture=="accès individuels")
echo "I ";
! elseif (HORAIRES>="40" || (HORAIRES>="20" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=12&id_localisation=$id_localisation&date=$datecur&debut=$heure\">i</a>
";
if ($tranchehoraire->ouverture=="activités collectives")
echo "C ";
! elseif (HORAIRES>="40" || (HORAIRES>="20" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=13&id_localisation=$id_localisation&date=$datecur&debut=$heure\">c</a>";
--- 160,174 ----
if (!$tranchehoraire->ouverture)
echo "F ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=11&id_localisation=$id_localisation&date=$datecur&debut=$heure\">f</a>
\n";
if ($tranchehoraire->ouverture=="accès individuels")
echo "I ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=12&id_localisation=$id_localisation&date=$datecur&debut=$heure\">i</a>
";
if ($tranchehoraire->ouverture=="activités collectives")
echo "C ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$tranchehoraire->id_structure))
echo "<a
href=\"$PHP_SELF?operation=13&id_localisation=$id_localisation&date=$datecur&debut=$heure\">c</a>";
***************
*** 182,187 ****
} // while
! echo "</tr>
! <tr><td colspan=\"$nbcol\" align=\"center\">
<a
href=\"$PHP_SELF?operation=2&id_localisation=$id_localisation&date=$date\">Appliquer
le modèle</a>
<br><a
href=\"$PHP_SELF?operation=3&id_localisation=$id_localisation&date=$date\">Vider</a></td>
--- 182,189 ----
} // while
! echo "</tr>\n";
!
! if (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$tranchehoraire->id_structure))
! echo "<tr><td colspan=\"$nbcol\" align=\"center\">
<a
href=\"$PHP_SELF?operation=2&id_localisation=$id_localisation&date=$date\">Appliquer
le modèle</a>
<br><a
href=\"$PHP_SELF?operation=3&id_localisation=$id_localisation&date=$date\">Vider</a></td>
***************
*** 202,206 ****
$req = "SELECT DISTINCT structures.ville AS ville,
structures.structure AS structure,
! localisations.salle AS salle
FROM localisations
LEFT JOIN structures ON structures.id=localisations.id_structure
--- 204,209 ----
$req = "SELECT DISTINCT structures.ville AS ville,
structures.structure AS structure,
! localisations.salle AS salle,
! id_structure
FROM localisations
LEFT JOIN structures ON structures.id=localisations.id_structure
***************
*** 271,285 ****
if (!$tranchehoraire->ouverture)
echo "F ";
! else
echo "<a
href=\"$PHP_SELF?operation=51&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">f</a>
\n";
if ($tranchehoraire->ouverture=="accès individuels")
echo "I ";
! else
echo "<a
href=\"$PHP_SELF?operation=52&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">i</a>
";
if ($tranchehoraire->ouverture=="activités collectives")
echo "C ";
! else
echo "<a
href=\"$PHP_SELF?operation=53&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">c</a>";
--- 274,288 ----
if (!$tranchehoraire->ouverture)
echo "F ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$reponse->id_structure))
echo "<a
href=\"$PHP_SELF?operation=51&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">f</a>
\n";
if ($tranchehoraire->ouverture=="accès individuels")
echo "I ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$reponse->id_structure))
echo "<a
href=\"$PHP_SELF?operation=52&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">i</a>
";
if ($tranchehoraire->ouverture=="activités collectives")
echo "C ";
! elseif (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$reponse->id_structure))
echo "<a
href=\"$PHP_SELF?operation=53&id_localisation=$id_localisation&nomjour=$nomjour&debut=$heure\">c</a>";
***************
*** 296,300 ****
mysql_free_result($res);
}
!
// Début du contenu de la page
--- 299,327 ----
mysql_free_result($res);
}
!
! function verifiedroits($droit="r")
! {
! global $id_localisation, $id_structure,
! $manqueinfosalle, $salleintrouvable, $pasledroit;
! // retrouver la localisation
! if (!$id_localisation)
! $mes=$manqueinfosalle; {
! echo $manqueinfosalle;
! return FALSE;
! }
! $res=recherche("localisations", "id", id_localisation);
! if (! $localisation=mysql_fetch_object($res))
! {
! echo $salleintrouvable;
! return FALSE;
! }
! // On regarde si on a les droits
! if ( !(HORAIRES_AUTRES>=$droit || (HORAIRES_MOI>=$droit &&
id_structure==$reponse->id_structure)))
! {
! echo $pasledroit;
! return FALSE;
! }
! return TRUE;
! }
// Début du contenu de la page
***************
*** 304,328 ****
switch($operation)
{
! case 51 : // fermer un créneau
! if (HORAIRES<"20")
! {
! echo $pasledroit;
! break;
! }
$ouverture="";
case 52 : // ouvrir accès individuel d'un créneau
- if (HORAIRES<"20")
- {
- echo $pasledroit;
- break;
- }
if (!$ouverture)
$ouverture="accès individuels";
case 53 : // ouvrir activité collective d'un créneau
! if (HORAIRES<"20")
! {
! echo $pasledroit;
break;
- }
if (!$ouverture)
$ouverture="activités collectives";
--- 331,342 ----
switch($operation)
{
! case 51 : // fermer un créneau
$ouverture="";
case 52 : // ouvrir accès individuel d'un créneau
if (!$ouverture)
$ouverture="accès individuels";
case 53 : // ouvrir activité collective d'un créneau
! if (! verifiedroits("w"))
break;
if (!$ouverture)
$ouverture="activités collectives";
***************
*** 439,471 ****
case 5 : // Affichage des modèles hebdomadaires
! if (HORAIRES<"20")
! {
! echo $pasledroit;
break;
- }
afficheModèle($id_localisation);
break;
case 11 : // fermer un créneau
- if (HORAIRES<"20")
- {
- echo $pasledroit;
- break;
- }
$ouverture="";
case 12 : // ouvrir accès individuel d'un créneau
- if (HORAIRES<"20")
- {
- echo $pasledroit;
- break;
- }
if (!$ouverture)
$ouverture="accès individuels";
case 13 : // ouvrir activité collective d'un créneau
! if (HORAIRES<"20")
! {
! echo $pasledroit;
break;
- }
if (!$ouverture)
$ouverture="activités collectives";
--- 453,469 ----
case 5 : // Affichage des modèles hebdomadaires
! if (! verifiedroits("r"))
break;
afficheModèle($id_localisation);
break;
case 11 : // fermer un créneau
$ouverture="";
case 12 : // ouvrir accès individuel d'un créneau
if (!$ouverture)
$ouverture="accès individuels";
case 13 : // ouvrir activité collective d'un créneau
! if (! verifiedroits("w"))
break;
if (!$ouverture)
$ouverture="activités collectives";
***************
*** 580,592 ****
case 1 : // Affichage du calendrier d'une salle pour un moi correpondant
à une date (courante)
afficheCalendrier($id_localisation, $date);
break;
case 2 : // Appliquer le modèle de calendrier pour une semaine donnée
! if (HORAIRES<"20")
! {
! echo $pasledroit;
break;
- }
// On commence par vider complètement le calendrier pour la semaine
donnée.
echo "<p>Vider le calendrier pour la semaine concernée...";
--- 578,589 ----
case 1 : // Affichage du calendrier d'une salle pour un moi correpondant
à une date (courante)
+ if (! droits("r"))
+ break;
afficheCalendrier($id_localisation, $date);
break;
case 2 : // Appliquer le modèle de calendrier pour une semaine donnée
! if (! verifiedroits("w"))
break;
// On commence par vider complètement le calendrier pour la semaine
donnée.
echo "<p>Vider le calendrier pour la semaine concernée...";
***************
*** 618,626 ****
case 3 : // Vider le calendrier pour une semaine donnée
! if (HORAIRES<"20")
! {
! echo $pasledroit;
break;
- }
// On commence par vider complètement le calendrier pour la semaine
donnée.
echo "<p>Vider le calendrier pour la semaine concernée...";
--- 615,620 ----
case 3 : // Vider le calendrier pour une semaine donnée
! if (! verifiedroits("w"))
break;
// On commence par vider complètement le calendrier pour la semaine
donnée.
echo "<p>Vider le calendrier pour la semaine concernée...";
***************
*** 634,643 ****
default : // liste des localisations
- // TODO : ne présenter que les salles de la structure qui est
identifiée en ce moment, sauf administrateur
$req = "SELECT ville, localisations.id AS id_localisation, structure,
salle, id_structure
FROM localisations
LEFT JOIN structures ON
localisations.id_structure=structures.id ";
! /*if (HORAIRES<"30")
! $req.= "WHERE id_structure=$id_structure ";*/
$req.= "ORDER BY ville, structure, salle";
$res = executeRequete($req);
--- 628,636 ----
default : // liste des localisations
$req = "SELECT ville, localisations.id AS id_localisation, structure,
salle, id_structure
FROM localisations
LEFT JOIN structures ON
localisations.id_structure=structures.id ";
! if (HORAIRES_AUTRES<"r"))
! $req.= "WHERE id_structure=$id_structure ";
$req.= "ORDER BY ville, structure, salle";
$res = executeRequete($req);
***************
*** 650,657 ****
<td>$local->structure</td>
<td>$local->salle</td>\n";
! if (HORAIRES>="30" || (HORAIRES>=20 &&
id_structure==$local->id_structure))
echo "<td><a
href=\"$PHP_SELF?operation=1&id_localisation=$local->id_localisation\">calendrier</a></td>\n";
! if (HORAIRES>"30" || (HORAIRES>=20 &&
id_structure==$local->id_structure))
echo "<td><a
href=\"$PHP_SELF?operation=5&id_localisation=$local->id_localisation\">modèle
hebdomadaire</a></td>\n";
echo "</tr>\n";
}
--- 643,654 ----
<td>$local->structure</td>
<td>$local->salle</td>\n";
! if (HORAIRES_AUTRES>="r" || (HORAIRES_MOI>="r" &&
id_structure==$local->id_structure))
echo "<td><a
href=\"$PHP_SELF?operation=1&id_localisation=$local->id_localisation\">calendrier</a></td>\n";
! else
! echo "<td></td>\n";
! if (HORAIRES_AUTRES>="w" || (HORAIRES_MOI>="w" &&
id_structure==$local->id_structure))
echo "<td><a
href=\"$PHP_SELF?operation=5&id_localisation=$local->id_localisation\">modèle
hebdomadaire</a></td>\n";
+ else
+ echo "<td></td>\n";
echo "</tr>\n";
}
Index: logiciels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/logiciels.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** logiciels.php 5 Jan 2003 20:34:01 -0000 1.4
--- logiciels.php 31 Jan 2003 21:19:40 -0000 1.5
***************
*** 22,26 ****
*/
! require_once("header.inc.php");
//require_once("constantes.inc.php"); // définition des constantes
//require_once("fonctions.inc.php"); // concernant des fonctions
transversales inclassables
--- 22,32 ----
*/
! require_once("header.inc.php");
! if (! defined("FCT_PARC"))
! {
! echo $fctnonactive;
! exit;
! }
!
//require_once("constantes.inc.php"); // définition des constantes
//require_once("fonctions.inc.php"); // concernant des fonctions
transversales inclassables
***************
*** 43,57 ****
<?
$titr = "Gestion du parc de logiciels";
! $datemaj="5 janvier 2003";
require("entete.inc.php");
switch ($operation)
{
case 11 : // confirmation d'ajout ou mise à jour
! if (!$isadmin)
! {
! echo "<p>Petit curieux, vous n'avez rien à faire là...</p>\n";
! break;
! }
$mes="";
--- 49,87 ----
<?
$titr = "Gestion du parc de logiciels";
! $datemaj="31 janvier 2003";
require("entete.inc.php");
+ function verifiedroits($droit="r")
+ {
+ global $id_logiciel, $id_structure,
+ $pasledroit;
+ if (!$id_logiciel)
+ {
+ echo $manqueinfologiciel;
+ return FALSE;
+ }
+ $req="SELECT id_structure FROM localisations
+ LEFT JOIN materiels ON materiels.id_localisation=localisations.id
+ LEFT JOIN logi_mate ON logi_mate.id_materiel=materiels.id
+ WHERE logi_mate.id=\"$id_logiciel\"";
+ $res=executeRequete($req);
+ if (! $logiciel=mysql_fetch_object($res))
+ {
+ echo $logicielintrouvable;
+ return FALSE;
+ }
+ if (!(PARC_AUTRES>=$droit || (PARC_MOI>=$droit &&
$logiciel->id_structure==$id_structure)))
+ {
+ echo $pasledroit;
+ return FALSE;
+ }
+ return TRUE;
+ }
+
switch ($operation)
{
case 11 : // confirmation d'ajout ou mise à jour
! if (! verifiedroits("w"))
! break;
$mes="";
***************
*** 85,89 ****
$req = "UPDATE logiciels SET type=\"$type\", "
. "titre=\"$titre\", licence=\"$licence\",
info_achat=\"$info_achat\", "
! . "commentaire=\"$commentaire\",
pret_possible=\"$pret_possible\",
reservable=\"$reservable\", image=\"$image\"";
$req .= " WHERE id = \"$id_logiciel\"";
--- 115,119 ----
$req = "UPDATE logiciels SET type=\"$type\", "
. "titre=\"$titre\", licence=\"$licence\",
info_achat=\"$info_achat\", "
! . "commentaire=\"$commentaire\",
pret_possible=\"$pret_possible\",
reservable=\"$reservable\", image=\"$image\"";
$req .= " WHERE id = \"$id_logiciel\"";
***************
*** 108,117 ****
case 2 : // formulaire d'édition
! // Saisie pour modification d'un enregistrement
! if (!$isadmin)
! {
! echo "<p>C'est un vrai labyrinthe, n'est-ce pas, ce site... Quoi qu'il
en soit vous êtes perdus.</p>\n";
! break;
! }
$res = recherche("logiciels", "id", $id_logiciel);
if ($logi = mysql_fetch_array($res))
--- 138,144 ----
case 2 : // formulaire d'édition
! if (! verifiedroits("w"))
! break;
!
$res = recherche("logiciels", "id", $id_logiciel);
if ($logi = mysql_fetch_array($res))
***************
*** 120,129 ****
case 1 : // formulaire d'ajout
! // Début du fomulaire de saisie d'enregistrement de logiciels
! if (!$isadmin)
! {
! echo "<p>Encore vous, mais que faites-vous là ?..</p>\n";
! break;
! }
echo "<form action=\"$PHP_SELF\" method=\"post\">";
--- 147,153 ----
case 1 : // formulaire d'ajout
! // Début du fomulaire de saisie d'enregistrement de logiciels
! if (PARC_MOI<"w" && PARC_AUTRES<"w")
! break;
echo "<form action=\"$PHP_SELF\" method=\"post\">";
***************
*** 170,175 ****
$req = "SELECT * FROM materiels
! LEFT JOIN logi_mate ON materiels.id=logi_mate.id_materiel
! ORDER BY type,id_localisation,materiel";
$res = executeRequete($req);
$mat = mysql_fetch_object($res);
--- 194,202 ----
$req = "SELECT * FROM materiels
! LEFT JOIN logi_mate ON
materiels.id=logi_mate.id_materiel";
! if (PARC_AUTRES<"w")
! $req.=" LEFT JOIN localisations ON
localisations.id=materiels.id_localisation
! WHERE id_structure=\"$id_structure\"";
! $req.=" ORDER BY type,id_localisation,materiel";
$res = executeRequete($req);
$mat = mysql_fetch_object($res);
***************
*** 218,226 ****
case 3 : // formulaire de suppression
! if (!$isadmin)
! {
! echo "<p>C'est une erreur, ou c'est volontaire...</p>\n";
! break;
! }
echo "<p>Attention, tu vas supprimer le logiciel et tous les liens avec
les materiels.</p>\n";
echo "<p><a
href=\"logiciels.php?operation=31&id_logiciel=$id_logiciel\">Confirmer la
suppression</a></p>\n";
--- 245,250 ----
case 3 : // formulaire de suppression
! if (! verifiedroits("w"))
! break;
echo "<p>Attention, tu vas supprimer le logiciel et tous les liens avec
les materiels.</p>\n";
echo "<p><a
href=\"logiciels.php?operation=31&id_logiciel=$id_logiciel\">Confirmer la
suppression</a></p>\n";
***************
*** 228,236 ****
case 31 : // confirmation de suppression
! if (!isadmin)
! {
! echo "<p>Alors, on visite à où il ne faudrait pas ???</p>\n";
! break;
! }
echo "<p>Le matériel est supprimé</p>\n";
$req = "DELETE FROM logiciels WHERE id=$id_logiciel";
--- 252,257 ----
case 31 : // confirmation de suppression
! if (! verifiedroits("w"))
! break;
echo "<p>Le matériel est supprimé</p>\n";
$req = "DELETE FROM logiciels WHERE id=$id_logiciel";
***************
*** 243,247 ****
case 5 :
// Affichage de la liste des materiels
! if ($isadmin)
{
$req = "SELECT * FROM logiciels ORDER BY type, titre, licence";
--- 264,268 ----
case 5 :
// Affichage de la liste des materiels
! if (PARC>"~")
{
$req = "SELECT * FROM logiciels ORDER BY type, titre, licence";
***************
*** 252,280 ****
$type="";
while ($log = mysql_fetch_object($res))
! {
! echo "<tr>\n";
! if ($type!=$log->type)
! {
! echo "<th>$log->type</th>\n";
! $type=$log->type;
! }
! else
! echo "<td></td>\n";
! echo "<td>$log->titre ($log->licence)";
! if ($log->commentaire!="") echo "<br><i>$log->commentaire</i>";
! echo "</td>
! <td nowrap><a href=\"$PHP_SELF?id_logiciel=$log->id\">$info</a>
! <a
href=\"$PHP_SELF?operation=2&id_logiciel=$log->id\">$modifier</a>
! <a
href=\"$PHP_SELF?operation=3&id_logiciel=$log->id\">$supprimer</a></td></tr>\n";
}
! echo "<tr><td colspan='4'></td><td><a
href=\"$PHP_SELF?operation=1\">$ajouter</a></td></tr>\n";
echo "</table>\n";
}
else
! echo "<p>Vous vous êtes encore perdu là où il ne faut pas...</p>\n";
break;
default : // affichage détails
! if ($id_logiciel)
{
// affichage d'un résumé du matériel et des éléments attenants
--- 273,306 ----
$type="";
while ($log = mysql_fetch_object($res))
! {
! if (verifiedroits("r"))
! {
! echo "<tr>\n";
! if ($type!=$log->type)
! {
! echo "<th>$log->type</th>\n";
! $type=$log->type;
! }
! else
! echo "<td></td>\n";
! echo "<td>$log->titre ($log->licence)";
! if ($log->commentaire!="") echo "<br><i>$log->commentaire</i>";
! echo "</td>
! <td nowrap><a
href=\"$PHP_SELF?id_logiciel=$log->id\">$info</a>\n";
! if (verifiedroits("w"))
! echo " <a
href=\"$PHP_SELF?operation=2&id_logiciel=$log->id\">$modifier</a>
! <a
href=\"$PHP_SELF?operation=3&id_logiciel=$log->id\">$supprimer</a></td></tr>\n";
! }
}
! if (PARC_MOI>="w" || PARC_AUTRES>="w")
! echo "<tr><td colspan='4'></td><td><a
href=\"$PHP_SELF?operation=1\">$ajouter</a></td></tr>\n";
echo "</table>\n";
}
else
! echo $pasledroit;
break;
default : // affichage détails
! if (verifiedroits("r"))
{
// affichage d'un résumé du matériel et des éléments attenants
***************
*** 312,332 ****
echo "</table>\n";
}
- else
- echo "<p>Logiciel non trouvé dans la base</p>\n";
}
else
! echo "<p>Que faites-vous là, vous ne devriez pas vous y trouver
!</p>\n";
break;
} // switch
! if ($isadmin)
! echo "<p><a href=\"logiciels.php?operation=5&$idu\">Voir la liste des
logiciels</a>.</p>
! <p><a href=\"materiels.php?operation=5&$idu\">Voir la liste des
materiels</a>.</p>\n";
else
! echo "<p><a href=\"/\">Retour au bercail.</a>.</p>\n";
require("basdepage.inc.php");
echo "</body></html>\n";
require("footer.inc.php");
! ?>
\ No newline at end of file
--- 338,359 ----
echo "</table>\n";
}
}
else
! echo $pasledroit;
break;
} // switch
! if (PARC_AUTRES>="r")
! echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des
logiciels</a>.</p>
! <p><a href=\"materiels.php?operation=5\">Voir la liste des
materiels</a>.</p>\n";
! elseif (PARC_MOI>="r")
! echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des logiciels
de ma structure</a>.</p>
! <p><a href=\"materiels.php?operation=5\">Voir la liste des materiels
de ma structure</a>.</p>\n";
else
! echo $pasledroit;
require("basdepage.inc.php");
echo "</body></html>\n";
require("footer.inc.php");
! ?>
Index: materiels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/materiels.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** materiels.php 5 Jan 2003 20:34:01 -0000 1.6
--- materiels.php 31 Jan 2003 21:19:40 -0000 1.7
***************
*** 22,26 ****
*/
! require_once("header.inc.php");
require_once("constantes.inc.php"); // définition des constantes
//require_once("fonctions.inc.php"); // concernant des fonctions
transversales inclassables
--- 22,32 ----
*/
! require_once("header.inc.php");
! if (! defined("FCT_PARC"))
! {
! $fctnonactive;
! exit;
! }
!
require_once("constantes.inc.php"); // définition des constantes
//require_once("fonctions.inc.php"); // concernant des fonctions
transversales inclassables
***************
*** 42,46 ****
<?
$titr = "Gestion du parc de matériel";
! $datemaj="5 janvier 2003";
require("entete.inc.php");
--- 48,52 ----
<?
$titr = "Gestion du parc de matériel";
! $datemaj="31 janvier 2003";
require("entete.inc.php");
***************
*** 416,418 ****
echo "</body></html>\n";
require("footer.inc.php");
! ?>
\ No newline at end of file
--- 422,424 ----
echo "</body></html>\n";
require("footer.inc.php");
! ?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Epnadmin-fr] CVS: epnadmin configuration.php,1.4,1.5 constantes.inc.php,1.19,1.20 entete.inc.php,1.18,1.19 fr.lang.inc.php,1.3,1.4 horaires.php,1.10,1.11 logiciels.php,1.4,1.5 materiels.php,1.6,1.7,
Loïc Dayot <=