Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 299 → Rev 300

/trunk/papyrus/applications/admin_application/bibliotheque/HTML_formulaireAppli.class.php
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: HTML_formulaireAppli.class.php,v 1.1 2004-12-13 18:07:28 alex Exp $
// CVS : $Id: HTML_formulaireAppli.class.php,v 1.2 2005-03-09 10:40:33 alex Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
55,7 → 55,7
* class HTML_formulaireProjet
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireAuth extends HTML_QuickForm
class HTML_formulaireAppl extends HTML_QuickForm
{
/**
* Constructeur
69,7 → 69,7
* @return void
* @access public
*/
function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
function HTML_formulaireAppl( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireProjet
94,38 → 94,18
*/
function construitFormulaire($url_retour)
{
$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;
$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 60)) ;
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'abreviation', ADAU_ABREVIATION) ;
$this->addRule ('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'dsn', ADAU_DSN) ;
$this->addRule ('dsn', ADAU_DSN_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'nom_table', ADAU_NOM_TABLE) ;
$this->addRule ('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'champs_login', ADAU_CHAMPS_LOGIN) ;
$this->addRule ('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'champs_passe', ADAU_CHAMPS_PASSE) ;
$this->addRule ('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'cryptage', ADAU_CRYPTAGE) ;
$this->addRule ('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client') ;
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ;
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 50)) ;
$this->addElement ('checkbox', 'applette', ADAP_APPLETTE, '', 0) ;
 
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAP_CHAMPS_REQUIS) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAU_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAP_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAP_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireProjet
?>
/trunk/papyrus/applications/admin_application/bibliotheque/admi_application.fonct.php
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: admi_application.fonct.php,v 1.1 2004-12-13 18:07:28 alex Exp $
// CVS : $Id: admi_application.fonct.php,v 1.2 2005-03-09 10:40:33 alex Exp $
/**
* Contient les fonctions de l'appli admin_auth
*
35,7 → 35,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
49,19 → 49,9
* @return
*/
 
function adau_supprimer_authentification($id_auth, &$db) {
 
// on recherche l'identifiant de gen_site_auth_bdd à partir de gen_site_auth
$requete = "select gsa_ce_auth_bdd from gen_site_auth where gsa_id_auth=".$GLOBALS['id_auth'] ;
function adap_supprimer_application($id_appl, &$db) {
$requete = "delete from gen_application where gap_id_application=$id_appl" ;
$resultat = $db->query ($requete) ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$id_auth_bdd = $ligne->gsa_ce_auth_bdd ;
$requete = "delete from gen_site_auth where gsa_id_auth=$id_auth" ;
$resultat = $db->query ($requete) ;
$requete = "delete from gen_site_auth_bdd where gsab_id_auth_bdd=$id_auth_bdd" ;
$resultat = $db->query ($requete) ;
}
 
/**
70,10 → 60,10
* @return
*/
 
function adau_valeurs_par_defaut ($id_auth, &$db) {
function adap_valeurs_par_defaut ($id_appl, &$db) {
// requete sur gen_site_auth
$requete = "select * from gen_site_auth where gsa_id_auth=$id_auth" ;
$requete = "select * from gen_application where gap_id_application=$id_appl" ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
81,28 → 71,11
}
$tableau_retour = array () ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$tableau_retour['nom_auth'] = $ligne->gsa_nom ;
$tableau_retour['abreviation'] = $ligne->gsa_abreviation ;
$tableau_retour['id_auth_bdd'] = $ligne->gsa_ce_auth_bdd ;
$tableau_retour['id_auth'] = $ligne->gsa_id_auth ;
$tableau_retour['nom_appl'] = $ligne->gap_nom ;
$tableau_retour['description'] = $ligne->gap_description ;
$tableau_retour['chemin'] = $ligne->gap_chemin ;
$tableau_retour['applette'] = $ligne->gap_bool_applette ;
unset ($requete, $resultat) ;
// requete sur gen_site_auth_bdd
$requete = "select * from gen_site_auth_bdd where gsab_id_auth_bdd=$ligne->gsa_ce_auth_bdd" ;
unset ($ligne) ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
return ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$tableau_retour['dsn'] = $ligne->gsab_dsn ;
$tableau_retour['nom_table'] = $ligne->gsab_nom_table ;
$tableau_retour['champs_login'] = $ligne->gsab_nom_champ_login ;
$tableau_retour['champs_passe'] = $ligne->gsab_nom_champ_mdp ;
$tableau_retour['cryptage'] = $ligne->gsab_cryptage_mdp ;
return $tableau_retour ;
}
 
113,21 → 86,14
*/
 
function insertion ($valeur, &$db) {
$id_auth_bdd = SQL_obtenirNouveauId ($db, 'gen_site_auth_bdd', 'gsab_id_auth_bdd') ;
$requete = "insert into gen_site_auth set gsa_id_auth="
.SQL_obtenirNouveauId($db, 'gen_site_auth', 'gsa_id_auth').","
.requete_site_auth($valeur)
.', gsa_ce_auth_bdd='.$id_auth_bdd ;
$id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ;
$requete = "insert into gen_application set gap_id_application="
.$id_appl_bdd.","
.requete_site_appl($valeur) ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
$requete = "insert into gen_site_auth_bdd set gsab_id_auth_bdd=$id_auth_bdd, "
.requete_site_auth_bdd($valeur) ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
137,26 → 103,12
*/
 
function mise_a_jour ($valeur, &$db) {
$requete = "update gen_site_auth set ".requete_site_auth($valeur)
.' where gsa_id_auth='.$GLOBALS['id_auth'] ;
$requete = "update gen_application set ".requete_site_appl($valeur)
.' where gap_id_application='.$GLOBALS['id_appl'] ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
unset ($requete) ;
// on recherche l'identifiant de gen_site_auth_bdd à partir de gen_site_auth
$requete = "select gsa_ce_auth_bdd from gen_site_auth where gsa_id_auth=".$GLOBALS['id_auth'] ;
$resultat = $db->query ($requete) ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$id_auth_bdd = $ligne->gsa_ce_auth_bdd ;
$requete = "update gen_site_auth_bdd set "
.requete_site_auth_bdd($valeur)
.' where gsab_id_auth_bdd='.$id_auth_bdd ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
165,25 → 117,14
* @return string un morceau de code SQL
*/
 
function requete_site_auth (&$valeur) {
return 'gsa_nom="'.$valeur['nom_auth'].'", '
.'gsa_ce_type_auth=1, '
.'gsa_abreviation="'.$valeur['abreviation'].'"' ;
function requete_site_appl (&$valeur) {
return 'gap_nom="'.$valeur['nom_appl'].'", '
.'gap_description="'.$valeur['description'].'", '
.'gap_chemin="'.$valeur['chemin'].'", '
.'gap_bool_applette="'.$valeur['applette'].'"';
}
 
/**
*
*
* @return
*/
 
function requete_site_auth_bdd (&$valeur) {
return 'gsab_dsn="'.$valeur['dsn'].'", '
.'gsab_nom_table="'.$valeur['nom_table'].'", '
.'gsab_nom_champ_login="'.$valeur['champs_login'].'", '
.'gsab_nom_champ_mdp="'.$valeur['champs_passe'].'", '
.'gsab_cryptage_mdp="'.$valeur['cryptage'].'"';
}
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
192,7 → 133,10
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/12/13 18:07:28 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/papyrus/applications/admin_application/langues/adap_langue_fr.inc.php
21,13 → 21,13
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: adap_langue_fr.inc.php,v 1.1 2004-12-13 18:07:38 alex Exp $
// CVS : $Id: adap_langue_fr.inc.php,v 1.2 2005-03-09 10:40:37 alex Exp $
/**
* Gestion des langues de l'application ADME
*
* Contient les constantes pour la langue française de l'application ADME.
* Contient les constantes pour la langue française de l'application ADAP.
*
*@package Admin_auth
*@package Admin_appli
*@subpackage Langues
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
34,7 → 34,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
41,33 → 41,29
// +------------------------------------------------------------------------------------------------------+
// | LISTE des CONSTANTES |
// +------------------------------------------------------------------------------------------------------+
define ("ADAU_NOM_AUTH", "Nom authentification") ;
define ("ADAU_NOM_TABLE", "Nom de la table annuaire") ;
define ("ADAU_MODIFIER", "Modifier") ;
define ("ADAU_SUPPRIMER", "Supprimer") ;
define ("ADAU_AJOUTER", "Ajouter une authentification base de donnée") ;
define ("ADAP_NOM_APPL", "Nom de l'application") ;
define ("ADAP_MODIFIER", "Modifier") ;
define ("ADAP_SUPPRIMER", "Supprimer") ;
define ("ADAP_AJOUTER", "Ajouter une application") ;
 
define ("ADAU_NOM_AUTH_ALERTE", "Vous devez spécifier un nom") ;
define ("ADAU_CHAMPS_REQUIS", "Indique les champs requis") ;
define ("ADAU_ABREVIATION", "Abréviation") ;
define ("ADAU_ABREVIATION_ALERTE", "Vous devez indiquer une abréviation") ;
define ("ADAU_DSN", "Source des donnée (dsn)") ;
define ("ADAU_DSN_ALERTE", "Vous devez indiquer une source des données") ;
define ("ADAU_NOM_TABLE_ALERTE", "Vous devez indiquer le nom de la table annuaire") ;
define ("ADAU_CHAMPS_LOGIN", "Nom du champs login") ;
define ("ADAU_CHAMPS_LOGIN_ALERTE", "Vous devez indiquer le nom du champs login") ;
define ("ADAU_CHAMPS_PASSE", "Nom du champs mot de passe") ;
define ("ADAU_CHAMPS_PASSE_ALERTE", "Vous devez indiquer le nom du champs mot de passe") ;
define ("ADAU_CRYPTAGE", "Fonction de cryptage") ;
define ("ADAU_CRYPTAGE_ALERTE", "Vous devez indiquer un algorithme de cryptage") ;
define ("ADAU_ANNULER", "Annuler") ;
define ("ADAU_VALIDER", "Valider") ;
define ("ADAP_NOM_APPL_ALERTE", "Vous devez spécifier un nom") ;
define ("ADAP_CHAMPS_REQUIS", "Indique les champs requis") ;
define ("ADAP_DESCRIPTION", "Abréviation") ;
 
define ("ADAP_CHEMIN", "Chemin vers l'application") ;
define ("ADAP_CHEMIN_REQUIS", "Le chemin vers l'application est requis") ;
define ("ADAP_APPLETTE", "L'application est elle une applette") ;
define ("ADAP_ANNULER", "Annuler") ;
define ("ADAP_VALIDER", "Valider") ;
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/12/13 18:07:38 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/papyrus/applications/admin_application/admin_application.php
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: admin_application.php,v 1.2 2005-02-28 10:32:59 jpm Exp $
// CVS : $Id: admin_application.php,v 1.3 2005-03-09 10:40:26 alex Exp $
/**
* Application gérant les applications de Papyrus
*
31,7 → 31,7
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
97,13 → 97,13
return 'Identifiez-vous' ;
}
// Le lien pour une nouvelle entrée
$res = '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAU_AJOUTER.'</a>'."\n<br />" ;
$res = '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAP_AJOUTER.'</a>'."\n<br />" ;
// traitement de la suppression
if (isset ($GLOBALS['action']) && $GLOBALS['action'] == 'supprimer') adau_supprimer_authentification($GLOBALS['id_auth'], $db) ;
if (isset ($GLOBALS['action']) && $GLOBALS['action'] == 'supprimer') adap_supprimer_application($GLOBALS['id_appl'], $db) ;
// traitement de l'ajout
if (isset ($GLOBALS['action']) || isset ($GLOBALS['id_auth'])) {
$formulaire = new HTML_formulaireAuth('formulaire_auth', '', str_replace ('&amp;', '&', $url->getURL())) ;
if (isset ($GLOBALS['action']) || isset ($GLOBALS['id_appl'])) {
$formulaire = new HTML_formulaireAppl('formulaire_appl', '', str_replace ('&amp;', '&', $url->getURL())) ;
$formulaire->construitFormulaire($url) ;
// On ajoute un champs caché avec action=nouveau_v
111,10 → 111,10
$formulaire->addElement ('hidden', 'action', 'nouveau_v') ;
return $formulaire->toHTML() ;
}
if (isset ($GLOBALS['id_auth']) && $GLOBALS['action'] != 'modifier_v' && $GLOBALS['action'] != 'supprimer') {
if (isset ($GLOBALS['id_appl']) && $GLOBALS['action'] != 'modifier_v' && $GLOBALS['action'] != 'supprimer') {
$formulaire->addElement ('hidden', 'action', 'modifier_v') ;
$formulaire->addElement ('hidden', 'id_auth', $GLOBALS['id_auth']) ;
$formulaire->setDefaults(adau_valeurs_par_defaut($GLOBALS['id_auth'], $db)) ;
$formulaire->addElement ('hidden', 'id_appl', $GLOBALS['id_appl']) ;
$formulaire->setDefaults(adap_valeurs_par_defaut($GLOBALS['id_appl'], $db)) ;
return $formulaire->toHTML() ;
}
if ($GLOBALS['action'] == 'modifier_v') {
130,28 → 130,25
}
// Comportement par défaut
// requete sur la table gen_site_auth
$requete = "select gap_nom ".
"from gen_application" ;
// requete sur la table gen_application
$requete = "select gap_id_application, gap_nom from gen_application" ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
__FILE__, __LINE__, 'admin_auth') ;
__FILE__, __LINE__, 'admin_appl') ;
return ;
}
$liste = new HTML_TableFragmenteur () ;
$liste->construireEntete(array (ADAU_NOM_AUTH, ADAU_NOM_TABLE, ADAU_MODIFIER, ADAU_SUPPRIMER)) ;
$tableau_auth = array() ;
$liste->construireEntete(array (ADAP_NOM_APPL, ADAP_SUPPRIMER)) ;
$tableau_appl = array() ;
while ($ligne = $resultat->fetchRow()) {
$url->addQueryString ('id_auth', $ligne[0]) ;
array_push ($tableau_auth, array ('<a href="'.$url->getURL().'">'.$ligne[0].'</a>'."\n", // Première colonne, le nom de l'authentification
$ligne[2], // deuxième colonne, le nom de la table d'annuaire
'<a href="'.$url->getURL().'">'.ADAU_MODIFIER.'</a>'."\n", // Colonne modifier
'<a href="'.$url->getURL().'&amp;action=supprimer" onclick="javascript:return confirm (\''.ADAU_SUPPRIMER.' ?\');">'.ADAU_SUPPRIMER.'</a>'."\n"
$url->addQueryString ('id_appl', $ligne[0]) ;
array_push ($tableau_appl, array ('<a href="'.$url->getURL().'">'.$ligne[1].'</a>'."\n", // Première colonne, le nom de l'application
'<a href="'.$url->getURL().'&amp;action=supprimer" onclick="javascript:return confirm (\''.ADAP_SUPPRIMER.' ?\');">'.ADAP_SUPPRIMER.'</a>'."\n"
));
}
$liste->construireListe($tableau_auth) ;
$liste->construireListe($tableau_appl) ;
$res .= $liste->toHTML();
return $res ;
}// Fin de la fonction afficherContenuCorps()
165,6 → 162,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/02/28 10:32:59 jpm
* Changement de nom de dossier.
*
* Revision 1.1 2004/12/13 18:07:19 alex
* version initiale
*