From 86b02bc17bc31faf4628f1328acca6d5dc0a0e98 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 18:03:34 +0200 Subject: [PATCH 1/2] Update new.php --- htdocs/public/members/new.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..6b8616ab777 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -62,6 +62,8 @@ if (is_numeric($entity)) { define("DOLENTITY", $entity); } + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; @@ -437,10 +439,11 @@ if (empty($reshook) && $action == 'add') { // Action called after a submitted was send and member created successfully // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. + if (empty($reshook) && $action == 'added') { llxHeaderVierge($langs->trans("NewMemberForm")); - // Si on a pas ete redirige + // If we have not been redirected print '

'; print '
'; print $langs->trans("NewMemberbyWeb"); @@ -556,42 +559,51 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''; } - // Company + // Company // TODO : optional hide print ''.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print ''."\n"; + // Title print ''.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').''."\n"; + // Lastname print ''.$langs->trans("Lastname").' *'."\n"; + // Firstname print ''.$langs->trans("Firstname").' *'."\n"; + // EMail print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print ''."\n"; + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Login").' *'."\n"; print ''.$langs->trans("Password").' *'."\n"; print ''.$langs->trans("PasswordRetype").' *'."\n"; } - // Gender + + // Gender // TODO: add diverse gender print ''.$langs->trans("Gender").''; print ''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print ''; + // Address print ''.$langs->trans("Address").''."\n"; print ''."\n"; + // Zip / Town print ''.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; + // Country print ''.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -621,17 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print ''; } + // Birthday print ''.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print ''."\n"; + // Photo print ''.$langs->trans("URLPhoto").''."\n"; + // Public print ''.$langs->trans("Public").''."\n"; + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + // Comments print ''; print ''.$langs->trans("Comments").''; @@ -733,7 +750,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print dol_get_fiche_end(); - // Save + // Save / Submit print '
'; print ''; if (!empty($backtopage)) { @@ -746,6 +763,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
"; print '
'; } else { // Show the table of membership types + // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1)); From 3dc6283eb7216ade80bc5cdd74278545817db1c9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Sep 2022 16:09:05 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/public/members/new.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 6b8616ab777..ccc229e33bf 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -563,47 +563,47 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print ''."\n"; - + // Title print ''.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').''."\n"; - + // Lastname print ''.$langs->trans("Lastname").' *'."\n"; - + // Firstname print ''.$langs->trans("Firstname").' *'."\n"; - + // EMail print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print ''."\n"; - + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Login").' *'."\n"; print ''.$langs->trans("Password").' *'."\n"; print ''.$langs->trans("PasswordRetype").' *'."\n"; } - + // Gender // TODO: add diverse gender print ''.$langs->trans("Gender").''; print ''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print ''; - + // Address print ''.$langs->trans("Address").''."\n"; print ''."\n"; - + // Zip / Town print ''.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; - + // Country print ''.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -633,22 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print ''; } - + // Birthday print ''.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print ''."\n"; - + // Photo print ''.$langs->trans("URLPhoto").''."\n"; - + // Public print ''.$langs->trans("Public").''."\n"; - + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - + // Comments print ''; print ''.$langs->trans("Comments").''; @@ -763,7 +763,6 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
"; print ''; } else { // Show the table of membership types - // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1));