本文整理汇总了PHP中Adherent::update_note方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::update_note方法的具体用法?PHP Adherent::update_note怎么用?PHP Adherent::update_note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::update_note方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AdherentType
if ($result > 0)
{
$adht = new AdherentType($db);
$result=$adht->fetch($adh->typeid);
}
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($_POST["action"] == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
{
$db->begin();
$res=$adh->update_note($_POST["note"],$user);
if ($res < 0)
{
$mesg='<div class="error">'.$adh->error.'</div>';
$db->rollback();
}
else
{
$db->commit();
}
}
/*
* View
示例2: GETPOST
$action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
// Security check
$result = restrictedArea($user, 'adherent', $id);
$object = new Adherent($db);
$result = $object->fetch($id);
if ($result > 0) {
$adht = new AdherentType($db);
$result = $adht->fetch($object->typeid);
}
/*
* Actions
*/
if ($action == 'update' && $user->rights->adherent->creer && !$_POST["cancel"]) {
$db->begin();
$res = $object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($res < 0) {
setEventMessage($object->error, 'errors');
$db->rollback();
} else {
$db->commit();
}
}
/*
* View
*/
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
$form = new Form($db);
if ($id) {
$head = member_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user');
示例3: testAdherentUpdate
/**
* testAdherentUpdate
*
* @param Adherent $localobject Member instance
* @return Adherent
*
* @depends testAdherentFetch
* The depends says test is run only if previous is ok
*/
public function testAdherentUpdate($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject->login='newlogin';
$localobject->societe='New company';
$localobject->note='New note after update';
//$localobject->note_public='New note public after update';
$localobject->lastname='New name';
$localobject->firstname='New firstname';
$localobject->address='New address';
$localobject->zip='New zip';
$localobject->town='New town';
$localobject->country_id=2;
$localobject->statut=0;
$localobject->phone='New tel pro';
$localobject->phone_perso='New tel perso';
$localobject->phone_mobile='New tel mobile';
$localobject->email='newemail@newemail.com';
$result=$localobject->update($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
$result=$localobject->update_note($localobject->note);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
//$result=$localobject->update_note_public($localobject->note_public);
//print __METHOD__." id=".$localobject->id." result=".$result."\n";
//$this->assertLessThan($result, 0);
$newobject=new Adherent($this->savdb);
$result=$newobject->fetch($localobject->id);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
$this->assertEquals($localobject->login, $newobject->login);
$this->assertEquals($localobject->societe, $newobject->societe);
$this->assertEquals($localobject->note, $newobject->note);
//$this->assertEquals($localobject->note_public, $newobject->note_public);
$this->assertEquals($localobject->lastname, $newobject->lastname);
$this->assertEquals($localobject->firstname, $newobject->firstname);
$this->assertEquals($localobject->address, $newobject->address);
$this->assertEquals($localobject->zip, $newobject->zip);
$this->assertEquals($localobject->town, $newobject->town);
$this->assertEquals($localobject->country_id, $newobject->country_id);
$this->assertEquals('BE', $newobject->country_code);
$this->assertEquals($localobject->statut, $newobject->statut);
$this->assertEquals($localobject->phone, $newobject->phone);
$this->assertEquals($localobject->phone_perso, $newobject->phone_perso);
$this->assertEquals($localobject->phone_mobile, $newobject->phone_mobile);
$this->assertEquals($localobject->email, $newobject->email);
return $localobject;
}