Merge pull request #6090 from aspangaro/5.0-b1

Fix: Field comments not registered in new member public form & presentation
This commit is contained in:
Laurent Destailleur 2016-12-08 12:47:31 +01:00 committed by GitHub
commit cdf0707c5a
3 changed files with 14 additions and 10 deletions

View File

@ -83,6 +83,9 @@ class Adherent extends CommonObject
var $datevalid;
var $birth;
var $note_public;
var $note_private;
var $typeid; // Id type adherent
var $type; // Libelle type adherent
var $need_subscription;
@ -410,7 +413,9 @@ class Adherent extends CommonObject
$this->country_id=($this->country_id > 0?$this->country_id:$this->country_id);
$this->state_id=($this->state_id > 0?$this->state_id:$this->state_id);
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname));
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname));
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname));
$this->note_public=($this->note_public?$this->note_public:$this->note_public);
$this->note_private=($this->note_private?$this->note_private:$this->note_private);
// Check parameters
if (! empty($conf->global->ADHERENT_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -440,7 +445,7 @@ class Adherent extends CommonObject
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
$sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
$sql.= ", note_private=" .($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", note_public=" .($this->note_private?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", note_public=" .($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null");
$sql.= ", public='".$this->public."'";
$sql.= ", statut=" .$this->statut;
@ -1146,11 +1151,11 @@ class Adherent extends CommonObject
$this->birth = $this->db->jdate($obj->birthday);
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->note_public = $obj->note_public;
$this->morphy = $obj->morphy;
$this->typeid = $obj->fk_adherent_type;
$this->type = $obj->type;
$this->type = $obj->type;
$this->need_subscription = $obj->subscription;
$this->user_id = $obj->user_id;

View File

@ -238,11 +238,10 @@ if ($action == 'add')
$adh->pass = $_POST["pass1"];
}
$adh->photo = $_POST["photo"];
$adh->note = $_POST["note"];
$adh->country_id = $_POST["country_id"];
$adh->state_id = $_POST["state_id"];
$adh->typeid = $_POST["type"];
$adh->note = $_POST["comment"];
$adh->note_private= $_POST["note_private"];
$adh->morphy = $_POST["morphy"];
$adh->birth = $birthday;
@ -520,7 +519,7 @@ foreach($extrafields->attribute_label as $key=>$value)
// Comments
print '<tr>';
print '<td valign="top">'.$langs->trans("Comments").'</td>';
print '<td valign="top"><textarea name="comment" wrap="soft" cols="60" rows="'.ROWS_4.'">'.dol_escape_htmltag(GETPOST('comment')).'</textarea></td>';
print '<td valign="top"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private')).'</textarea></td>';
print '</tr>'."\n";
// Add specific fields used by Dolibarr foundation for example

View File

@ -95,10 +95,10 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">'.nl2br($object->address).'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Zip").' '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.' '.$object->town.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.' '.$object->town.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'.$object->country.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.$object->email.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.$object->birth.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
if (isset($object->photo) && $object->photo !='')
{
@ -111,7 +111,7 @@ if ($id > 0)
// print "<tr><td>$value</td><td>".$object->array_options["options_$key"]."&nbsp;</td></tr>\n";
// }
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'.nl2br($object->note).'</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'.nl2br($object->note_public).'</td></tr>';
print '</table>';
}