diff --git a/htdocs/adherents/XML-RPC.functions.php b/htdocs/adherents/XML-RPC.functions.php index 0b5af22b3ab..ff7324ca429 100644 --- a/htdocs/adherents/XML-RPC.functions.php +++ b/htdocs/adherents/XML-RPC.functions.php @@ -10,6 +10,9 @@ This code is Open Source, released under terms similar to the Artistic License. Read the license at http://www.keithdevens.com/software/license/ Note: this code requires version 4.1.0 or higher of PHP. + +Adaptation pour fonctionnner en PHP 5.0 + */ function & XML_serialize(&$data, $level = 0, $prior_key = NULL){ @@ -80,7 +83,7 @@ class XML { $this->parser = xml_parser_create(); xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_object($this->parser, &$this); + xml_set_object($this->parser, $this); xml_set_element_handler($this->parser, "open", "close"); xml_set_character_data_handler($this->parser, "data"); # register_shutdown_function(array(&$this, 'destruct')); @@ -133,7 +136,7 @@ class XML { $this->parent[$key] = array(); $this->parent = &$this->parent[$key]; - array_unshift($this->parents, &$this->parent); + array_unshift($this->parents, $this->parent); } function data($parser, $data){ @@ -156,7 +159,7 @@ class XML { function & XML_unserialize(&$xml){ $xml_parser = new XML(); - $data = &$xml_parser->parse(&$xml); + $data = &$xml_parser->parse($xml); $xml_parser->destruct(); return $data; } @@ -165,7 +168,7 @@ function & XMLRPC_parse(&$request){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "

Received the following raw request:

" . XMLRPC_show($request, 'print_r', true)); } - $data = &XML_unserialize(&$request); + $data = &XML_unserialize($request); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "

Returning the following parsed request:

" . XMLRPC_show($data, 'print_r', true)); } @@ -187,7 +190,7 @@ function & XMLRPC_prepare($data, $type = NULL){ if(array_key_exists("$n type", $data)){ $type = $data["$n type"]; } - $temp[$n] = XMLRPC_prepare(&$data[$n], $type); + $temp[$n] = XMLRPC_prepare($data[$n], $type); } } }else{ #it's a struct @@ -202,7 +205,7 @@ function & XMLRPC_prepare($data, $type = NULL){ if(array_key_exists("$key type", $data)){ $type = $data["$key type"]; } - $temp[] = array('name' => $key, 'value' => XMLRPC_prepare(&$value, $type)); + $temp[] = array('name' => $key, 'value' => XMLRPC_prepare($value, $type)); } } } @@ -244,12 +247,12 @@ function & XMLRPC_adjustValue(&$current_node){ if(is_array($temp) and array_key_exists(0, $temp)){ $count = count($temp); for($n=0;$n<$count;$n++){ - $temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]); + $temp2[$n] = &XMLRPC_adjustValue($temp[$n]); } $temp = &$temp2; }else{ - $temp2 = &XMLRPC_adjustValue(&$temp); - $temp = array(&$temp2); + $temp2 = &XMLRPC_adjustValue($temp); + $temp = array($temp2); #I do the temp assignment because it avoids copying, # since I can put a reference in the array #PHP's reference model is a bit silly, and I can't just say: @@ -267,12 +270,12 @@ function & XMLRPC_adjustValue(&$current_node){ $count = count($temp); for($n=0;$n<$count;$n++){ #echo "Passing name {$temp[$n][name]}. Value is: " . show($temp[$n][value], var_dump, true) . "
\n"; - $temp2[$temp[$n]['name']] = &XMLRPC_adjustValue(&$temp[$n]['value']); + $temp2[$temp[$n]['name']] = &XMLRPC_adjustValue($temp[$n]['value']); #echo "adjustValue(): After assigning, the value is " . show($temp2[$temp[$n]['name']], var_dump, true) . "
\n"; } }else{ #echo "Passing name $temp[name]
\n"; - $temp2[$temp['name']] = &XMLRPC_adjustValue(&$temp['value']); + $temp2[$temp['name']] = &XMLRPC_adjustValue($temp['value']); } $temp = &$temp2; } @@ -316,7 +319,7 @@ function XMLRPC_getParams($request){ $count = count($temp); for($n = 0; $n < $count; $n++){ #echo "Serializing parameter $n
"; - $temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]['value']); + $temp2[$n] = &XMLRPC_adjustValue($temp[$n]['value']); } }else{ $temp2[0] = &XMLRPC_adjustValue($temp['value']); @@ -390,13 +393,13 @@ function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_age XMLRPC_debug('XMLRPC_request', "

Received the following response:

\n\n" . XMLRPC_show($response, 'print_r', true) . "

Which was serialized into the following data:

\n\n" . XMLRPC_show($data, 'print_r', true)); } if(isset($data['methodResponse']['fault'])){ - $return = array(false, XMLRPC_adjustValue(&$data['methodResponse']['fault']['value'])); + $return = array(false, XMLRPC_adjustValue($data['methodResponse']['fault']['value'])); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_request', "

Returning:

\n\n" . XMLRPC_show($return, 'var_dump', true)); } return $return; }else{ - $return = array(true, XMLRPC_adjustValue(&$data['methodResponse']['params']['param']['value'])); + $return = array(true, XMLRPC_adjustValue($data['methodResponse']['params']['param']['value'])); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_request', "

Returning:

\n\n" . XMLRPC_show($return, 'var_dump', true)); } @@ -407,7 +410,7 @@ function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_age function XMLRPC_response($return_value, $server = NULL){ $data["methodResponse"]["params"]["param"]["value"] = &$return_value; - $return = XML_serialize(&$data); + $return = XML_serialize($data); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_response', "

Received the following data to return:

\n\n" . XMLRPC_show($return_value, 'print_r', true)); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index c5638df0cae..9770e6f8137 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1,6 +1,7 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +42,7 @@ if (isset($action) && $action=='sendinfo') } -if ($HTTP_POST_VARS["action"] == 'cotisation') +if ($_POST["action"] == 'cotisation') { $adh = new Adherent($db); $adh->id = $rowid; @@ -65,7 +66,7 @@ if ($HTTP_POST_VARS["action"] == 'cotisation') //$dateop="$reyear$remonth$reday"; $amount=$cotisation; $acct=new Account($db,ADHERENT_BANK_ACCOUNT); - $insertid=$acct->addline($dateop, $HTTP_POST_VARS["operation"], $HTTP_POST_VARS["label"], $amount, $HTTP_POST_VARS["num_chq"],ADHERENT_BANK_CATEGORIE); + $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE); if ($insertid == '') { print "

Probleme d'insertion : ".$db->error(); @@ -89,8 +90,13 @@ if ($HTTP_POST_VARS["action"] == 'cotisation') $action = "edit"; } -if ($HTTP_POST_VARS["action"] == 'add') +if ($_POST["action"] == 'add') { + $type=$_POST["type"]; + if(!isset($type) || $type==''){ + $error+=1; + $errmsg .="Le type d'adhérent n'est pas renseigné. Vous devez configurer les types d'adhérents avant de pouvoir les ajouter.
\n"; + } $login=$_POST["login"]; // test si le login existe deja if(!isset($login) || $login==''){ @@ -147,8 +153,8 @@ if ($HTTP_POST_VARS["action"] == 'add') $adh->note = $note; $adh->pays = $pays; $adh->typeid = $type; - $adh->commentaire = $HTTP_POST_VARS["comment"]; - $adh->morphy = $HTTP_POST_VARS["morphy"]; + $adh->commentaire = $_POST["comment"]; + $adh->morphy = $_POST["morphy"]; foreach($_POST as $key => $value){ if (ereg("^options_",$key)){ @@ -167,7 +173,7 @@ if ($HTTP_POST_VARS["action"] == 'add') //$dateop="$reyear$remonth$reday"; $amount=$cotisation; $acct=new Account($db,ADHERENT_BANK_ACCOUNT); - $insertid=$acct->addline($dateop, $HTTP_POST_VARS["operation"], $HTTP_POST_VARS["label"], $amount, $HTTP_POST_VARS["num_chq"],ADHERENT_BANK_CATEGORIE); + $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE); if ($insertid == '') { print "

Probleme d'insertion : ".$db->error(); @@ -193,14 +199,14 @@ if ($HTTP_POST_VARS["action"] == 'add') } } -if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) { $adh = new Adherent($db); $adh->delete($rowid); Header("Location: liste.php"); } -if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->validate($user->id); @@ -226,7 +232,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] = } -if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_resign' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->resiliate($user->id); @@ -247,7 +253,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"] llxHeader(); -if ($HTTP_POST_VARS["action"] == 'confirm_add_glasnost' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_add_glasnost' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -264,7 +270,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_add_glasnost' && $HTTP_POST_VARS["conf } } -if ($HTTP_POST_VARS["action"] == 'confirm_del_glasnost' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_del_glasnost' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -281,7 +287,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_del_glasnost' && $HTTP_POST_VARS["conf } } -if ($HTTP_POST_VARS["action"] == 'confirm_del_spip' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_del_spip' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -290,7 +296,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_del_spip' && $HTTP_POST_VARS["confirm" } } -if ($HTTP_POST_VARS["action"] == 'confirm_add_spip' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -309,7 +315,7 @@ if ($errmsg != '') { print ''; print ''; - print "\n"; + print "\n"; print '
Erreur dans l\'execution du formulaire
$errmsg
$errmsg
'; } @@ -430,13 +436,13 @@ if ($rowid > 0) print 'Supprimer un adhérent'; print "La suppression d'un adhérent entraine la suppression de toutes ses cotisations !!!\n"; - print 'Etes-vous sur de vouloir supprimer cet adhérent ?'; + print 'Etes-vous sur de vouloir supprimer cet adhérent ?'; $htmls = new Form($db); $htmls->selectyesno("confirm","no"); print "\n"; - print ''; + print ''; print ''; print "\n"; } @@ -481,13 +487,13 @@ if ($rowid > 0) print 'Résilier une adhésion'; - print 'Etes-vous sur de vouloir résilier cette adhésion ?'; + print 'Etes-vous sur de vouloir résilier cette adhésion ?'; $htmls = new Form($db); $htmls->selectyesno("confirm","no"); print "\n"; - print ''; + print ''; print ''; print "\n"; } @@ -531,13 +537,13 @@ if ($rowid > 0) print 'Valider un adhérent'; - print 'Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.ADHERENT_GLASNOST_SERVEUR.')'; + print 'Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.ADHERENT_GLASNOST_SERVEUR.')'; $htmls = new Form($db); $htmls->selectyesno("confirm","no"); print "\n"; - print ''; + print ''; print ''; print "\n"; } @@ -581,13 +587,13 @@ if ($rowid > 0) print 'Valider un adhérent'; - print 'Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.ADHERENT_SPIP_SERVEUR.')'; + print 'Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.ADHERENT_SPIP_SERVEUR.')'; $htmls = new Form($db); $htmls->selectyesno("confirm","no"); print "\n"; - print ''; + print ''; print ''; print "\n"; } diff --git a/htdocs/adherents/options.php b/htdocs/adherents/options.php index 30ef0f08d34..e1f7db823c8 100644 --- a/htdocs/adherents/options.php +++ b/htdocs/adherents/options.php @@ -98,32 +98,14 @@ if (sizeof($array_options)>0) } print ""; } -print "

"; -/* - * Case 1 - */ - -print ""; - -/* - * Case 2 - */ - -print ""; - -/* - * Case 3 - */ -print ""; - -/* - * Case 4 - */ - -print ""; - -print "
[Nouvel attribut]---

"; + /* + * Barre d'actions + * + */ + print '

'; + print "Nouvel attribut"; + print "
"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ef76a563a36..f4efbf4563f 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -24,16 +24,16 @@ require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); -if ($HTTP_POST_VARS["action"] == 'add' && $user->admin) +if ($_POST["action"] == 'add' && $user->admin) { $adht = new AdherentType($db); - $adht->libelle = $HTTP_POST_VARS["libelle"]; - $adht->cotisation = $HTTP_POST_VARS["cotisation"]; - $adht->commentaire = $HTTP_POST_VARS["comment"]; - $adht->mail_valid = $HTTP_POST_VARS["mail_valid"]; - $adht->vote = $HTTP_POST_VARS["vote"]; + $adht->libelle = $_POST["libelle"]; + $adht->cotisation = $_POST["cotisation"]; + $adht->commentaire = $_POST["comment"]; + $adht->mail_valid = $_POST["mail_valid"]; + $adht->vote = $_POST["vote"]; if ($adht->create($user->id) ) { @@ -41,16 +41,16 @@ if ($HTTP_POST_VARS["action"] == 'add' && $user->admin) } } -if ($HTTP_POST_VARS["action"] == 'update' && $user->admin) +if ($_POST["action"] == 'update' && $user->admin) { $adht = new AdherentType($db); $adht->id = $rowid; - $adht->libelle = $HTTP_POST_VARS["libelle"]; - $adht->cotisation = $HTTP_POST_VARS["cotisation"]; - $adht->commentaire = $HTTP_POST_VARS["comment"]; - $adht->mail_valid = $HTTP_POST_VARS["mail_valid"]; - $adht->vote = $HTTP_POST_VARS["vote"]; + $adht->libelle = $_POST["libelle"]; + $adht->cotisation = $_POST["cotisation"]; + $adht->commentaire = $_POST["comment"]; + $adht->mail_valid = $_POST["mail_valid"]; + $adht->vote = $_POST["vote"]; if ($adht->update($user->id) ) { @@ -67,7 +67,7 @@ if ($action == 'delete') if ($action == 'commentaire') { $don = new Don($db); - $don->set_commentaire($rowid,$HTTP_POST_VARS["commentaire"]); + $don->set_commentaire($rowid,$_POST["commentaire"]); $action = "edit"; } @@ -122,32 +122,14 @@ else } -print "

"; -/* - * Case 1 - */ - -print ''; - -/* - * Case 2 - */ - -print ""; - -/* - * Case 3 - */ -print ""; - -/* - * Case 4 - */ - -print ""; - -print "
[Nouveau Type]---

"; + /* + * Barre d'actions + * + */ + print '

'; + print "Nouveau Type"; + print "
";