当前位置: 首页>>代码示例>>PHP>>正文


PHP Adherent::update_note方法代码示例

本文整理汇总了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
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:note.php

示例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&eacute;rents|ES:M&oacute;dulo_Miembros');
$form = new Form($db);
if ($id) {
    $head = member_prepare_head($object);
    dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user');
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:note.php

示例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;
    }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:66,代码来源:AdherentTest.php


注:本文中的Adherent::update_note方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。