diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 04f1b928222..325802c88cb 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -23,7 +23,7 @@ * \file htdocs/adherents/type.php * \ingroup member * \brief Page de configuration des types d'adherents - * \version $Id$ + * \version $Id: type.php,v 1.69 2011/06/26 21:03:44 eldy Exp $ */ require("../main.inc.php"); @@ -32,7 +32,17 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); $langs->load("members"); -$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; +$rowid=GETPOST("rowid"); + +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0 ; } +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) { $sortorder="DESC"; } +if (! $sortfield) { $sortfield="d.nom"; } // Security check if (! $user->rights->adherent->lire) accessforbidden(); @@ -414,13 +424,12 @@ if ($rowid > 0) $titre.=" (".$membertype->libelle.")"; } - $param=""; + $param="&rowid=".$rowid; if (isset($_GET["statut"])) $param.="&statut=".$_GET["statut"]; if (isset($_GET["search_nom"])) $param.="&search_nom=".$_GET["search_nom"]; if (isset($_GET["search_login"])) $param.="&search_login=".$_GET["search_login"]; if (isset($_GET["search_email"])) $param.="&search_email=".$_GET["search_email"]; if (isset($_GET["filter"])) $param.="&filter=".$_GET["filter"]; - print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); if ($sall) { @@ -428,16 +437,17 @@ if ($rowid > 0) } print '
'; + print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ""; print ''; - print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),"liste.php","d.nom",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Login"),"liste.php","d.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Person"),"liste.php","d.morphy",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EMail"),"liste.php","d.email",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"liste.php","d.statut,d.datefin",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EndSubscription"),"liste.php","d.datefin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),"liste.php","",$param,"",'width="60" align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre @@ -627,5 +637,5 @@ if ($rowid > 0) $db->close(); -llxFooter('$Date$ - $Revision$'); +llxFooter('$Date: 2011/06/26 21:03:44 $ - $Revision: 1.69 $'); ?> diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a8c1fadfcd4..e21904e4242 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -20,7 +20,7 @@ * \file htdocs/core/class/html.formcompany.class.php * \ingroup core * \brief File of class to build HTML component for third parties management - * \version $Id$ + * \version $Id: html.formcompany.class.php,v 1.33 2011/06/26 21:51:56 eldy Exp $ */ @@ -627,8 +627,9 @@ class FormCompany * @param htmlname * @param fields * @param fieldsize + * @param disableautocomplete 1 To disable autocomplete features */ - function select_ziptown($selected='',$htmlname='zipcode',$fields='',$fieldsize=0) + function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0) { global $conf; @@ -637,7 +638,7 @@ class FormCompany $size=''; if (!empty($fieldsize)) $size='size="'.$fieldsize.'"'; - if ($conf->use_javascript_ajax) $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajaxziptown.php')."\n"; + if ($conf->use_javascript_ajax && empty($disableautocomplete)) $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajaxziptown.php')."\n"; $out.= ''."\n"; return $out; diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 313a9104a9f..64690d276f6 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/interfaces.class.php * \ingroup core * \brief Fichier de la classe de gestion des triggers - * \version $Id$ + * \version $Id: interfaces.class.php,v 1.7 2011/06/27 10:41:31 hregis Exp $ */ @@ -184,7 +184,7 @@ class Interfaces { global $conf, $langs; - $html = new Form($db); + $html = new Form($this->db); $files = array(); $modules = array(); @@ -212,7 +212,7 @@ class Interfaces { $langs->load("errors"); print '
'.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/").'
'; - $objMod = new $modName($db); + $objMod = new $modName($this->db); $modules[$i] = $modName; $files[$i] = $file; @@ -222,7 +222,7 @@ class Interfaces else { include_once($dir.'/'.$file); - $objMod = new $modName($db); + $objMod = new $modName($this->db); $modules[$i] = $modName; $files[$i] = $file; @@ -246,7 +246,7 @@ class Interfaces $modName = $modules[$key]; if ($modName) { - $objMod = new $modName($db); + $objMod = new $modName($this->db); // Bypass if workflow module is enabled and if the trigger is compatible if ($workflow && ! empty($objMod->disabled_if_workflow)) continue; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b5cc6dd2839..173895a6d46 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -576,7 +576,7 @@ CoreErrorTitle=System error CoreErrorMessage=Sorry, an error occurred. Check the logs or contact your system administrator. CreditCard=Credit card FieldsWithAreMandatory=Fields with %s are mandatory -FieldsWithIsForPublic=Fields with %s are shown on public list of members. If you don't want this, check the "public" box. +FieldsWithIsForPublic=Fields with %s are shown on public list of members. If you don't want this, check off the "public" box. AccordingToGeoIPDatabase=(according to GeoIP convertion) Line=Line NotSupported=Not supported diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 6c647d51961..51deb9696f1 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -22,7 +22,17 @@ * \file htdocs/public/members/new.php * \ingroup member * \brief Example of form to add a new member - * \version $Id: new.php,v 1.26 2011/06/26 18:53:17 eldy Exp $ + * \version $Id: new.php,v 1.29 2011/06/26 21:51:34 eldy Exp $ + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form + * MEMBER_NEWFORM_EDITAMOUNT Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest paypemt with paypal of paybox + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country */ define("NOLOGIN",1); // This means this output page does not require to be logged. @@ -134,6 +144,16 @@ if ($action == 'add') $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("EMail"))."
\n"; } } + if (GETPOST('type') <= 0) + { + $error+=1; + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))."
\n"; + } + if (! in_array(GETPOST('morphy'),array('mor','phy'))) + { + $error+=1; + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("MorPhy"))."
\n"; + } if (!isset($_POST["nom"]) || !isset($_POST["prenom"]) || $_POST["prenom"]=='' || $_POST["nom"]=='') { $error+=1; @@ -243,7 +263,7 @@ if ($action == 'added') print $langs->trans("NewMemberbyWeb"); print ''; - llxFooterVierge('$Date: 2011/06/26 18:53:17 $ - $Revision: 1.26 $'); + llxFooterVierge('$Date: 2011/06/26 21:51:34 $ - $Revision: 1.29 $'); exit; } @@ -275,19 +295,24 @@ print $langs->trans("FieldsWithIsForPublic",'**').'
'; print ''; @@ -339,9 +364,9 @@ print ''."\n"; // Zip / Town print ''; // Country print '
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'),'zipcode',array('town','selectpays_id','departement_id'),6); +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town','selectpays_id','departement_id'), 6, 1); print ' / '; -print $formcompany->select_ziptown(GETPOST('town'),'town',array('zipcode','selectpays_id','departement_id')); +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode','selectpays_id','departement_id'), 0, 1); print '
'.$langs->trans('Country').''; @@ -390,7 +415,7 @@ print '