wip on asking for the company name only if price is set
This commit is contained in:
parent
0c6431efd5
commit
6238ff0321
@ -81,6 +81,9 @@ $email = GETPOST("email");
|
||||
$encodedid = GETPOST('id');
|
||||
$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id);
|
||||
|
||||
$project = new Project($db);
|
||||
|
||||
|
||||
// Getting 'securekey'.'id' from Post and decoding it
|
||||
$encodedsecurekeyandid = GETPOST('securekey', 'alpha');
|
||||
$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id);
|
||||
@ -193,10 +196,11 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
||||
}
|
||||
/*if (!GETPOST("societe")) {
|
||||
// If the price has been set, name is required for the invoice
|
||||
if (!GETPOST("societe") && !empty(floatval($project->price_registration))) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
|
||||
}*/
|
||||
}
|
||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
@ -350,7 +354,11 @@ print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."
|
||||
// Email
|
||||
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
// Company
|
||||
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").' </td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
|
||||
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company");
|
||||
if(!empty(floatval($project->price_registration))){
|
||||
print '<FONT COLOR="red">*</FONT>';
|
||||
}
|
||||
print ' </td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
|
||||
print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user