$contrib = new Contribution((int) $id_cotis);
            if ($contrib->id == '') {
                //not possible to load contribution, exit
                header('location: index.php');
                die;
            }
        } else {
            $args = array('type' => $selected_type, 'adh' => $id_adh);
            if ($trans_id != '') {
                $args['trans'] = $trans_id;
            }
            if ($preferences->pref_membership_ext != '') {
                $args['ext'] = $preferences->pref_membership_ext;
            }
            $contrib = new Contribution($args);
            if ($contrib->isTransactionPart()) {
                $id_adh = $contrib->member;
                //Should we disable contribution member selection if we're from
                //a transaction? In most cases, it would be OK I guess, but I'm
                //very unsure
                //$disabled['id_adh'] = ' disabled="disabled"';
            }
        }
        //second step only: first step, and all the rest
        // flagging required fields for second step
        $second_required = array('montant_cotis' => 1, 'date_debut_cotis' => 1, 'date_fin_cotis' => $contrib->isCotis());
        $required = $required + $second_required;
    }
}
// Validation
$contribution['dyn'] = array();