Code simpler
This commit is contained in:
parent
c3deed6a57
commit
c2db14f348
@ -397,9 +397,8 @@ class Adherent extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid";
|
||||
foreach($this->array_options as $key => $value)
|
||||
{
|
||||
// Add field o fattribut
|
||||
$attr=substr($key,8);
|
||||
$sql.=",$attr";
|
||||
// Add field of attribut
|
||||
$sql.=",".substr($key,8); // Remove 'options_' prefix
|
||||
}
|
||||
$sql .= ") VALUES (".$this->id;
|
||||
foreach($this->array_options as $key => $value)
|
||||
@ -936,11 +935,11 @@ class Adherent extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_options";
|
||||
$sql.= " WHERE adhid=".$rowid;
|
||||
|
||||
dolibarr_syslog("Adherent::fetch_optionals sql=".$sql, LOG_DEBUG);
|
||||
$result=$this->db->query( $sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
if ($this->db->num_rows($result))
|
||||
{
|
||||
$tab = $this->db->fetch_array($result);
|
||||
|
||||
@ -961,43 +960,6 @@ class Adherent extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fetch optional attribute name
|
||||
*/
|
||||
function fetch_name_optionals()
|
||||
{
|
||||
$array_name_options=array();
|
||||
$sql = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX."adherent_options";
|
||||
|
||||
$result=$this->db->query( $sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
//$array_name_options[]=$tab->Field;
|
||||
while ($tab = $this->db->fetch_object($result))
|
||||
{
|
||||
if ($tab->Field != 'optid' && $tab->Field != 'tms' && $tab->Field != 'adhid')
|
||||
{
|
||||
// we can add this attribute to adherent object
|
||||
$array_name_options[]=$tab->Field;
|
||||
}
|
||||
}
|
||||
return $array_name_options;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return array() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fonction qui insere la cotisation dans la base de donnees
|
||||
|
||||
@ -150,7 +150,7 @@ class AdherentOptions
|
||||
break;
|
||||
}
|
||||
|
||||
dolibarr_syslog("AdherentOptions::create sql=".$sql);
|
||||
dolibarr_syslog("AdherentOptions::create sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
@ -170,15 +170,15 @@ class AdherentOptions
|
||||
\param attrname nom de l'atribut
|
||||
\param label nom du label
|
||||
*/
|
||||
function create_label($attrname,$label='')
|
||||
function create_label($attrname,$label='',$type='',$pos=0,$size=0)
|
||||
{
|
||||
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options_label SET ";
|
||||
$escaped_label=mysql_escape_string($label);
|
||||
$sql .= " name='$attrname',label='".addslashes($escaped_label)."'";
|
||||
|
||||
$sql .= " name='$attrname', label='".addslashes($label)."',";
|
||||
$sql .= " type='".$type."', pos='".$pos."', size='".$size."'";
|
||||
|
||||
dolibarr_syslog("AdherentOptions::create_label sql=".$sql);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
@ -321,60 +321,31 @@ class AdherentOptions
|
||||
*/
|
||||
function fetch_optionals()
|
||||
{
|
||||
$this->fetch_name_optionals();
|
||||
$this->fetch_name_optionals_label();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief fonction qui modifie un label
|
||||
*/
|
||||
function fetch_name_optionals()
|
||||
{
|
||||
$array_name_options=array();
|
||||
$sql = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX."adherent_options";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
{
|
||||
while ($tab = $this->db->fetch_object())
|
||||
{
|
||||
if ($tab->Field != 'optid' && $tab->Field != 'tms' && $tab->Field != 'adhid')
|
||||
{
|
||||
// we can add this attribute to adherent object
|
||||
$array_name_options[]=$tab->Field;
|
||||
$this->attribute_name[$tab->Field]=$tab->Type;
|
||||
}
|
||||
}
|
||||
return $array_name_options;
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}else{
|
||||
print $this->db->error();
|
||||
return array() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief fonction qui modifie un label
|
||||
*/
|
||||
/**
|
||||
* \brief Load array this->attribute_label
|
||||
*/
|
||||
function fetch_name_optionals_label()
|
||||
{
|
||||
$array_name_label=array();
|
||||
$sql = "SELECT name,label FROM ".MAIN_DB_PREFIX."adherent_options_label";
|
||||
|
||||
if ( $this->db->query( $sql) )
|
||||
$sql = "SELECT name,label,type FROM ".MAIN_DB_PREFIX."adherent_options_label";
|
||||
$sql.= " ORDER BY pos";
|
||||
|
||||
dolibarr_syslog("Adherent_options::fetch_name_optionals_label");
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows())
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
while ($tab = $this->db->fetch_object())
|
||||
while ($tab = $this->db->fetch_object($resql))
|
||||
{
|
||||
// we can add this attribute to adherent object
|
||||
$array_name_label[$tab->name]=stripslashes($tab->label);
|
||||
$this->attribute_label[$tab->name]=stripslashes($tab->label);
|
||||
// we can add this attribute to adherent object
|
||||
$array_name_label[$tab->name]=$tab->label;
|
||||
$this->attribute_name[$tab->name]=$tab->type;
|
||||
$this->attribute_label[$tab->name]=$tab->label;
|
||||
}
|
||||
return $array_name_label;
|
||||
}else{
|
||||
|
||||
@ -44,12 +44,12 @@ $canadduser=$user->rights->adherent->creer;
|
||||
// Defini si peux lire/modifier info user ou mot de passe
|
||||
if ($_GET["rowid"])
|
||||
{
|
||||
$caneditfield=$user->rights->adherent->creer;
|
||||
$caneditpassword=$user->rights->adherent->creer;
|
||||
$caneditfield=$user->rights->adherent->creer;
|
||||
$caneditpassword=$user->rights->adherent->creer;
|
||||
}
|
||||
if (! $user->rights->adherent->lire)
|
||||
{
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -521,7 +521,7 @@ if ($errmsg)
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
$adho->fetch_name_optionals_label();
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
@ -539,7 +539,7 @@ if ($action == 'edit')
|
||||
// fetch optionals value
|
||||
$adh->fetch_optionals($rowid);
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
$adho->fetch_name_optionals_label();
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
@ -965,7 +965,7 @@ if ($rowid && $action != 'edit')
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Autres attributs
|
||||
// Other attributs
|
||||
foreach($adho->attribute_label as $key=>$value)
|
||||
{
|
||||
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
*/
|
||||
|
||||
/** \file htdocs/adherents/options.php
|
||||
\ingroup adherent
|
||||
\brief Page de configuratin des champs optionnels
|
||||
\version $Id$
|
||||
*/
|
||||
\ingroup adherent
|
||||
\brief Page de configuratin des champs optionnels
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
|
||||
@ -32,66 +32,70 @@ $langs->load("members");
|
||||
$adho = new AdherentOptions($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if ($_POST["action"] == 'add' && $user->rights->adherent->configurer)
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'add' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
// Type et taille non encore pris en compte => varchar(255)
|
||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
|
||||
{
|
||||
$adho->create($_POST['attrname'],$_POST['type'],$_POST['size']);
|
||||
if (isset($_POST['label']))
|
||||
{
|
||||
$adho->create_label($_POST['attrname'],$_POST['label']);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
$_GET["action"] = 'create';
|
||||
}
|
||||
}
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
// Type et taille non encore pris en compte => varchar(255)
|
||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
|
||||
{
|
||||
$adho->create($_POST['attrname'],$_POST['type'],$_POST['size']);
|
||||
if (isset($_POST['label']))
|
||||
{
|
||||
$adho->create_label($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$_POST['size']);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
$_GET["action"] = 'create';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'update' && $user->rights->adherent->configurer)
|
||||
if ($_POST["action"] == 'update' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
|
||||
{
|
||||
$adho->update($_POST['attrname'],$_POST['type'],$_POST['size']);
|
||||
if (isset($_POST['label']))
|
||||
{
|
||||
$adho->update_label($_POST['attrname'],$_POST['label']);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
}
|
||||
}
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
|
||||
{
|
||||
$adho->update($_POST['attrname'],$_POST['type'],$_POST['size']);
|
||||
if (isset($_POST['label']))
|
||||
{
|
||||
$adho->update_label($_POST['attrname'],$_POST['label']);
|
||||
}
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Suppression attribut
|
||||
if ($_GET["action"] == 'delete' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"]))
|
||||
{
|
||||
$adho->delete($_GET["attrname"]);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
}
|
||||
if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"]))
|
||||
{
|
||||
$adho->delete($_GET["attrname"]);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,8 +113,8 @@ print '<br>';
|
||||
|
||||
if ($mesg) print '<div class="error">'.$mesg.'</div><br>';
|
||||
|
||||
$array_options=$adho->fetch_name_optionals();
|
||||
$array_label=$adho->fetch_name_optionals_label();
|
||||
// Load attribute_label
|
||||
$adho->fetch_name_optionals_label();
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
@ -119,23 +123,19 @@ print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td><td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (sizeof($array_options)>0)
|
||||
{
|
||||
$var=True;
|
||||
foreach($adho->attribute_name as $key => $value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".$adho->attribute_label[$key]." </td>\n";
|
||||
print "<td>$key</td>\n";
|
||||
print "<td>$value</td>\n";
|
||||
print "<td align=\"right\"><a href=\"options.php?action=edit&attrname=$key\">".img_edit()."</a>";
|
||||
print " <a href=\"options.php?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
$var=True;
|
||||
foreach($adho->attribute_name as $key => $value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".$adho->attribute_label[$key]." </td>\n";
|
||||
print "<td>$key</td>\n";
|
||||
print "<td>$value</td>\n";
|
||||
print "<td align=\"right\"><a href=\"options.php?action=edit&attrname=$key\">".img_edit()."</a>";
|
||||
print " <a href=\"options.php?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
@ -144,7 +144,7 @@ print "</table>";
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] != 'create')
|
||||
if ($_GET["action"] != 'create')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"options.php?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
@ -154,14 +154,14 @@ if ($_GET["action"] != 'create')
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Création d'un champ optionnel */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_GET["action"] == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
|
||||
|
||||
print_titre($langs->trans('NewAttribute'));
|
||||
|
||||
print '<form action="options.php" method="post">';
|
||||
@ -169,7 +169,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')</td><td class="valeur"><input type="text" name="attrname" size="10"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">';
|
||||
$form->select_array('type',array('varchar'=>$langs->trans('String'),
|
||||
@ -178,13 +178,13 @@ if ($_GET["action"] == 'create')
|
||||
'date'=>$langs->trans('Date'),
|
||||
'datetime'=>$langs->trans('DateAndTime')));
|
||||
print '</td></tr>';
|
||||
print '<tr><td>Taille</td><td><input type="text" name="size" size="5" value="255"></td></tr>';
|
||||
print '<tr><td>Taille</td><td><input type="text" name="size" size="5" value="255"></td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print "</form>\n";
|
||||
print "</table>\n";
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
@ -194,33 +194,33 @@ if ($_GET["action"] == 'create')
|
||||
if ($_GET["attrname"] && $_GET["action"] == 'edit')
|
||||
{
|
||||
|
||||
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
|
||||
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="options.php?attrname='.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table class="border" width="100%">';
|
||||
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$adho->attribute_label[$_GET["attrname"]].'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AttributeName").'</td><td class="valeur">'.$_GET["attrname"].' </td></tr>';
|
||||
list($type,$size)=preg_split('/\(|\)/',$adho->attribute_name[$_GET["attrname"]]);
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">';
|
||||
$form->select_array('type',array('varchar'=>$langs->trans('String'),
|
||||
'text'=>$langs->trans('Text'),
|
||||
'int'=>$langs->trans('Int'),
|
||||
'date'=>$langs->trans('Date'),
|
||||
'datetime'=>$langs->trans('DateAndTime')),$type);
|
||||
print '</td></tr>';
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="options.php?attrname='.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$adho->attribute_label[$_GET["attrname"]].'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AttributeName").'</td><td class="valeur">'.$_GET["attrname"].' </td></tr>';
|
||||
list($type,$size)=preg_split('/\(|\)/',$adho->attribute_name[$_GET["attrname"]]);
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">';
|
||||
$form->select_array('type',array('varchar'=>$langs->trans('String'),
|
||||
'text'=>$langs->trans('Text'),
|
||||
'int'=>$langs->trans('Int'),
|
||||
'date'=>$langs->trans('Date'),
|
||||
'datetime'=>$langs->trans('DateAndTime')),$type);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Size").'</td><td class="valeur"><input type="text" name="size" size="5" value="'.$size.'"></td></tr>';
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print "</form>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("Size").'</td><td class="valeur"><input type="text" name="size" size="5" value="'.$size.'"></td></tr>';
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print "</form>";
|
||||
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -179,7 +179,7 @@ print_titre($langs->trans("NewMember"));
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
$adho->fetch_name_optionals_label();
|
||||
|
||||
if (isset($_GET["action"]) && $_GET["action"] == 'added')
|
||||
{
|
||||
@ -242,7 +242,7 @@ print '<tr><td><FONT COLOR="red">*</FONT> '.$langs->trans("Login").'</td><td><in
|
||||
print '<tr><td><FONT COLOR="red">*</FONT> '.$langs->trans("Password").'</td><td><input type="password" name="pass1" size="40"><BR><input type="password" name="pass2" size="40"></td></tr>';
|
||||
print '<tr><td>Date de naissance<BR>Format AAAA-MM-JJ</td><td><input type="text" name="naiss" size="40" value="'.$naiss.'"></td></tr>';
|
||||
print '<tr><td><FONT COLOR="blue">*</FONT> URL Photo</td><td><input type="text" name="photo" size="40" value="'.$photo.'"></td></tr>';
|
||||
print '<tr><td>Profil public ?</td><td><input type="checkbox" name="public" checked></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Public").' ?</td><td><input type="checkbox" name="public" checked></td></tr>';
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\"></td></tr>\n";
|
||||
}
|
||||
|
||||
@ -67,10 +67,9 @@ $adho = new AdherentOptions($db);
|
||||
llxHeaderVierge($langs->trans("MemberCard"));
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
$adho->fetch_name_optionals_label();
|
||||
if ($rowid > 0)
|
||||
{
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user