Beispiel #1
0
use Galette\Repository\Titles;
use Galette\Core\PasswordImage;
/** @ignore */
require_once 'includes/galette.inc.php';
if (!$preferences->pref_bool_selfsubscribe) {
    header('location:index.php');
    die;
}
$dyn_fields = new DynamicFields();
$member = new Adherent();
//mark as self membership
$member->setSelfMembership();
// flagging required fields
$fc = new FieldsConfig(Adherent::TABLE, $members_fields, $members_fields_cats);
// flagging required fields invisible to members
$fc->setNotRequired('activite_adh');
$fc->setNotRequired('id_statut');
$required = $fc->getRequired();
// flagging fields visibility
$visibles = $fc->getVisibilities();
// disable some fields
$disabled = $member->disabled_fields;
// DEBUT parametrage des champs
// On recupere de la base la longueur et les flags des champs
// et on initialise des valeurs par defaut
$update_string = '';
$insert_string_fields = '';
$insert_string_values = '';
$has_register = false;
$fields = Adherent::getDbFields();
if (isset($_POST["nom_adh"])) {
Beispiel #2
0
        $disabled = $member->adm_edit_disabled_fields + $member->staff_edit_disabled_fields + $member->disabled_fields;
    }
    if ($preferences->pref_mail_method == GaletteMail::METHOD_DISABLED) {
        $disabled['send_mail'] = 'disabled="disabled"';
    }
} else {
    $member->load($login->id);
    $adherent['id_adh'] = $login->id;
    // disable some fields
    $disabled = $member->disabled_fields + $member->edit_disabled_fields;
}
// flagging required fields
$fc = new FieldsConfig(Adherent::TABLE, $members_fields, $members_fields_cats);
// password required if we create a new member
if ($member->id != '') {
    $fc->setNotRequired('mdp_adh');
}
//address and mail fields are not required if member has a parent
$no_parent_required = array('adresse_adh', 'adresse2_adh', 'cp_adh', 'ville_adh', 'email_adh');
if ($member->hasParent()) {
    foreach ($no_parent_required as $field) {
        if ($fc->isRequired($field)) {
            $fc->setNotRequired($field);
        } else {
            $i = array_search($field, $no_parent_required);
            unset($no_parent_required[$i]);
        }
    }
    $tpl->assign('no_parent_required', $no_parent_required);
}
// flagging required fields invisible to members