diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 2898a26a356..61195218719 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -66,6 +66,7 @@ if ($result) print ""; print '
'; +print ''; print '

'; print ''; print ""; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 82d348a752f..a68e29486e7 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -31,7 +31,16 @@ if ($sortfield == "") { $sortfield="d.nom"; } if ($page == -1) { $page = 0 ; } +/* + * SIZE_LISTE_LIMIT : constante de taille maximale des listes + */ +if (defined("SIZE_LISTE_LIMIT")) +{ + $conf->liste_limit=SIZE_LISTE_LIMIT; +} + $offset = $conf->liste_limit * $page ; + $pageprev = $page - 1; $pagenext = $page + 1; @@ -44,6 +53,12 @@ $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." $sql .= " , d.email, t.libelle as type, d.morphy, d.statut, t.cotisation"; $sql .= " FROM llx_adherent as d, llx_adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut"; +if ( $_POST["action"] == 'search') +{ + if (isset($_POST['search']) && $_POST['search'] != ''){ + $sql .= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')"; + } +} $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $result = $db->query($sql); @@ -72,9 +87,14 @@ if ($result) print_liste_field_titre("Type",$PHP_SELF,"t.libelle","&page=$page&statut=$statut"); print "\n"; + print "\n"; + + print "\n"; - print "\n"; - print "\n"; print "\n"; print "\n"; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 2131922b8bf..bf3ebf2cc22 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -24,6 +24,8 @@ llxHeader(); print_titre("Constantes de configuration Dolibarr"); +//print_r(get_defined_constants()); + print '
Rechercher un adhérent"; + print_liste_field_titre("Personne",$PHP_SELF,"d.morphy","&page=$page&statut=$statut"); + print ""; + print_liste_field_titre("Statut",$PHP_SELF,"d.statut","&page=$page&statut=$statut"); + print "PersonneStatutAction
'; print ''; print ''; @@ -36,31 +38,34 @@ print "\n"; $db = new Db(); $form = new Form($db); -if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add') +if ($user->admin) { - - if ($HTTP_POST_VARS["consttype"] == 0){ - $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='yesno'"; - }else{ - $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'"; - } - - - $result = $db->query($sql); - if (!$result) + if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add') { - print $db->error(); + + if ($HTTP_POST_VARS["consttype"] == 0){ + $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='yesno'"; + }else{ + $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'"; + } + + + $result = $db->query($sql); + if (!$result) + { + print $db->error(); + } } -} -if ($action == 'delete') -{ - $sql = "DELETE FROM llx_const WHERE rowid='$rowid'"; - - $result = $db->query($sql); - if (!$result) + if ($action == 'delete') { - print $db->error(); + $sql = "DELETE FROM llx_const WHERE rowid='$rowid'"; + + $result = $db->query($sql); + if (!$result) + { + print $db->error(); + } } } diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index 74c5bc335fb..d86fdd97883 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -55,7 +55,7 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object( $i); - define ($objp->name, $objp->value); + define ("$objp->name", $objp->value); $i++; } } @@ -196,12 +196,14 @@ Function left_menu($menu) } - if (defined(MAIN_SEARCHFORM_SOCIETE) or defined(MAIN_SEARCHFORM_CONTACT)) + if ((defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0)|| (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0)) { print '
Nom
'; - - if (defined(MAIN_SEARCHFORM_SOCIETE) && MAIN_SEARCHFORM_SOCIETE > 0) + + if (defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0) { + // print constant("MAIN_SEARCHFORM_SOCIETE"); + // echo MAIN_SEARCHFORM_SOCIETE."==MAIN_SEARCHFORM_SOCIETE; le type est " . gettype( MAIN_SEARCHFORM_SOCIETE ) . "
\n"; print 'Societes'; print ''; print ''; @@ -211,7 +213,7 @@ Function left_menu($menu) print ''; } - if (defined(MAIN_SEARCHFORM_CONTACT) && MAIN_SEARCHFORM_CONTACT > 0) + if (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0) { print 'Contacts'; print '
';