$adht->note = trim($_POST["comment"]); $adht->mail_valid = trim($_POST["mail_valid"]); $adht->vote = trim($_POST["vote"]); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $adht); if ($ret < 0) { $error++; } $adht->update($user); header("Location: " . $_SERVER["PHP_SELF"] . "?rowid=" . $_POST["rowid"]); exit; } } if ($action == 'delete' && $user->rights->adherent->configurer) { $adht = new AdherentType($db); $adht->delete($rowid); header("Location: " . $_SERVER["PHP_SELF"]); exit; } if ($action == 'commentaire' && $user->rights->adherent->configurer) { $don = new Don($db); $don->fetch($rowid); $don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES)); } /* * View */ llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $form = new Form($db); // Liste of members type if (!$rowid && $action != 'create' && $action != 'edit') {
$object->note = trim($comment); $object->mail_valid = trim($mail_valid); $object->vote = trim($vote); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) { $error++; } $object->update($user); header("Location: " . $_SERVER["PHP_SELF"] . "?rowid=" . $_POST["rowid"]); exit; } } if ($action == 'delete' && $user->rights->adherent->configurer) { $object = new AdherentType($db); $object->delete($rowid); header("Location: " . $_SERVER["PHP_SELF"]); exit; } /* * View */ llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); $form = new Form($db); // List of members type if (!$rowid && $action != 'create' && $action != 'edit') { print_fiche_titre($langs->trans("MembersTypes")); dol_fiche_head(''); $sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote"; $sql .= " FROM " . MAIN_DB_PREFIX . "adherent_type as d"; $sql .= " WHERE d.entity IN (" . getEntity() . ")";
/** * testAdherentTypeDelete * * @param Adherent $localobject Member instance * @return void * * @depends testAdherentDelete * The depends says test is run only if previous is ok */ public function testAdherentTypeDelete($localobject) { global $conf, $user, $langs, $db; $conf = $this->savconf; $user = $this->savuser; $langs = $this->savlangs; $db = $this->savdb; $localobjectat = new AdherentType($this->savdb); $result = $localobjectat->fetch($localobject->typeid); $result = $localobjectat->delete(); print __METHOD__ . " result=" . $result . "\n"; $this->assertLessThan($result, 0); return $localobject->id; }