• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Note类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Note的典型用法代码示例。如果您正苦于以下问题:PHP Note类的具体用法?PHP Note怎么用?PHP Note使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Note类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: eventAddUpdateDraft

 function eventAddUpdateDraft(EventControler $evtcl)
 {
     $id = $evtcl->id;
     $type = $evtcl->id_type;
     $text = $evtcl->text;
     if ($text != '') {
         $do_note = new Note();
         $text = $do_note->htmlCleanUp($text);
         $q = new sqlQuery($this->getDbCon());
         $q->query("SET CHARACTER SET utf8");
         $q->query("select * from " . $this->table . " Where id= " . $id . " AND id_type = '" . $type . "' \n                AND iduser = " . $_SESSION['do_User']->iduser);
         if ($q->getNumRows()) {
             // Update
             while ($q->fetch()) {
                 $idnote_draft = $q->getData("idnote_draft");
             }
             $this->getId($idnote_draft);
             $this->note_content = $text;
             $this->timestamp = time();
             $this->update();
         } else {
             //Insert
             $this->id = $id;
             $this->id_type = $type;
             $this->iduser = $_SESSION['do_User']->iduser;
             $this->note_content = $text;
             $this->timestamp = time();
             $this->add();
         }
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:NoteDraft.class.php


示例2: saveFile

 function saveFile($note, $portal = false)
 {
     global $sugar_config;
     $focus = new Note();
     if (!empty($note['id'])) {
         $focus->retrieve($note['id']);
     } else {
         return '-1';
     }
     if (!empty($note['file'])) {
         $decodedFile = base64_decode($note['file']);
         $this->upload_file->set_for_soap($note['filename'], $decodedFile);
         $ext_pos = strrpos($this->upload_file->stored_file_name, ".");
         $this->upload_file->file_ext = substr($this->upload_file->stored_file_name, $ext_pos + 1);
         if (in_array($this->upload_file->file_ext, $sugar_config['upload_badext'])) {
             $this->upload_file->stored_file_name .= ".txt";
             $this->upload_file->file_ext = "txt";
         }
         $focus->filename = $this->upload_file->get_stored_file_name();
         $focus->file_mime_type = $this->upload_file->getMimeSoap($focus->filename);
         $focus->id = $note['id'];
         $return_id = $focus->save();
         $this->upload_file->final_move($focus->id);
     } else {
         return '-1';
     }
     return $return_id;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:28,代码来源:NoteSoap.php


示例3: registerUser

 /**
  * This function will create a new user object and return the newly created user object.
  *
  * @param array $userInfo This should have the properties: username, firstname, lastname, password, ui_language
  *
  * @return mixed
  */
 public function registerUser(array $userInfo, $userLanguage)
 {
     $user = \User::create($userInfo);
     //make the first user an admin
     if (\User::all()->count() <= 1) {
         $user->is_admin = 1;
     }
     // Trim trailing whitespace from user first and last name.
     $user->firstname = trim($user->firstname);
     $user->lastname = trim($user->lastname);
     $user->save();
     \Setting::create(['ui_language' => $userLanguage, 'user_id' => $user->id]);
     /* Add welcome note to user - create notebook, tag and note */
     //$notebookCreate = Notebook::create(array('title' => Lang::get('notebooks.welcome_notebook_title')));
     $notebookCreate = new \Notebook();
     $notebookCreate->title = Lang::get('notebooks.welcome_notebook_title');
     $notebookCreate->save();
     $notebookCreate->users()->attach($user->id, ['umask' => \PaperworkHelpers::UMASK_OWNER]);
     //$tagCreate = Tag::create(array('title' => Lang::get('notebooks.welcome_note_tag'), 'visibility' => 0));
     $tagCreate = new \Tag();
     $tagCreate->title = Lang::get('notebooks.welcome_note_tag');
     $tagCreate->visibility = 0;
     $tagCreate->user_id = $user->id;
     $tagCreate->save();
     //$tagCreate->users()->attach($user->id);
     $noteCreate = new \Note();
     $versionCreate = new \Version(['title' => Lang::get('notebooks.welcome_note_title'), 'content' => Lang::get('notebooks.welcome_note_content'), 'content_preview' => mb_substr(strip_tags(Lang::get('notebooks.welcome_note_content')), 0, 255), 'user_id' => $user->id]);
     $versionCreate->save();
     $noteCreate->version()->associate($versionCreate);
     $noteCreate->notebook_id = $notebookCreate->id;
     $noteCreate->save();
     $noteCreate->users()->attach($user->id, ['umask' => \PaperworkHelpers::UMASK_OWNER]);
     $noteCreate->tags()->sync([$tagCreate->id]);
     return $user;
 }
开发者ID:jinchen891021,项目名称:paperwork,代码行数:42,代码来源:UserRegistrator.php


示例4: action_AddNote

 function action_AddNote()
 {
     global $sugar_config;
     // $this->view = 'AddNote';
     // Creamos una nota
     require_once "modules/Notes/Note.php";
     $nota = new Note();
     $nota->name = "Signed Invoice " . date();
     $nota->parent_type = "reg_invoices";
     $nota->parent_id = $_POST['record'];
     // Guardamos la nota y obtenemos el id
     $id = $nota->save();
     // Guardamos el archivo ($_POST['doc'])
     if ($_POST['type'] == 'XML') {
         file_put_contents(trim($sugar_config['upload_dir'], " /") . "/{$id}", trim(html_entity_decode($_POST['doc'])));
         $nota->file_mime_type = "text/xml";
         $nota->filename = "Factura.xml";
         $nota->save();
     } else {
         if ($_POST['type'] == 'PDF') {
             file_put_contents(trim($sugar_config['upload_dir'], " /") . "/{$id}", base64_decode($_POST['doc']));
             $nota->file_mime_type = "application/pdf";
             $nota->filename = "Factura.pdf";
             $nota->save();
         }
     }
     die;
 }
开发者ID:pixprod,项目名称:Regoluna-Invoices-for-SugarCRM,代码行数:28,代码来源:controller.php


示例5: create

 public function create($data, $save = true)
 {
     $note = new Note($this, $data);
     if ($save) {
         $note->save();
     }
     return $note;
 }
开发者ID:bandwidthcom,项目名称:php-bandwidth-iris,代码行数:8,代码来源:NotesModel.php


示例6: hasSharesDebt

 public function hasSharesDebt($id = null)
 {
     $options = array('conditions' => array('Condo.' . $this->primaryKey => $id));
     $this->contain('Fraction');
     $condo = $this->find('first', $options);
     $fractions = Set::extract('/Fraction/id', $condo);
     $Note = new Note();
     return $hasSharesDebt = $Note->find('count', array('conditions' => array('Note.fraction_id' => $fractions, 'Note.note_type_id =' => 2, 'Note.note_status_id <' => 3, 'Note.document_date < NOW()')));
 }
开发者ID:cepedag14,项目名称:phkondo,代码行数:9,代码来源:Condo.php


示例7: send_email

 function send_email($module, $module_type, $printable, $file_name, $attach)
 {
     require_once 'modules/Emails/Email.php';
     global $current_user, $mod_strings, $sugar_config;
     //First Create e-mail draft
     $email = new Email();
     // set the id for relationships
     $email->id = create_guid();
     $email->new_with_id = true;
     //subject
     $email->name = $mod_strings['LBL_EMAIL_NAME'] . ' ' . $module->name;
     //body
     $email->description_html = $printable;
     //type is draft
     $email->type = "draft";
     $email->status = "draft";
     if (!empty($module->billing_contact_id) && $module->billing_contact_id != "") {
         require_once 'modules/Contacts/Contact.php';
         $contact = new Contact();
         $contact->retrieve($module->billing_contact_id);
         $email->parent_type = 'Contacts';
         $email->parent_id = $contact->id;
         if (!empty($contact->email1)) {
             $email->to_addrs_emails = $contact->email1 . ";";
             $email->to_addrs = $module->billing_contact_name . " <" . $contact->email1 . ">";
         }
     }
     //team id
     $email->team_id = $current_user->default_team;
     //assigned_user_id
     $email->assigned_user_id = $current_user->id;
     //Save the email object
     global $timedate;
     $email->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()));
     $email->save(FALSE);
     $email_id = $email->id;
     if ($attach) {
         $note = new Note();
         $note->modified_user_id = $current_user->id;
         $note->created_by = $current_user->id;
         $note->name = $file_name;
         $note->parent_type = 'Emails';
         $note->parent_id = $email_id;
         $note->file_mime_type = 'application/pdf';
         $note->filename = $file_name;
         $note->save();
         rename($sugar_config['upload_dir'] . 'attachfile.pdf', $sugar_config['upload_dir'] . $note->id);
     }
     //redirect
     if ($email_id == "") {
         echo "Unable to initiate Email Client";
         exit;
     } else {
         header("Location: index.php?action=Compose&module=Emails&return_module=" . $module_type . "&return_action=DetailView&return_id=" . $_REQUEST['record'] . "&recordId=" . $email_id);
     }
 }
开发者ID:isrealconsulting,项目名称:ic-suite,代码行数:56,代码来源:sendEmail.php


示例8: createNoteWithOwnerAndRelatedAccount

 public static function createNoteWithOwnerAndRelatedAccount($name, $owner, $account)
 {
     $occurredOnStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
     $note = new Note();
     $note->owner = $owner;
     $note->occurredOnDateTime = $occurredOnStamp;
     $note->description = $name;
     $note->activityItems->add($account);
     $saved = $note->save();
     assert('$saved');
     return $note;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:NoteTestHelper.php


示例9: getNotesByLead

function getNotesByLead($lid)
{
    $db = Database::obtain();
    //check if Lead already exist
    $sql = "SELECT * FROM `" . TBL_NOTES . "` WHERE `lid` = '{$lid}'";
    $results = $db->query($sql);
    $notes = array();
    while ($row = mysql_fetch_assoc($results)) {
        $note = new Note();
        $note->noteFromArray($row);
        $notes[] = $note;
    }
    return $notes;
}
开发者ID:nitzanb,项目名称:take-a-hike,代码行数:14,代码来源:function.php


示例10: set_recovery_post

 public function set_recovery_post()
 {
     $NoteList = new ObjList(['db_where_Arr' => ['status' => -1], 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'Note', 'limitstart_Num' => 0, 'limitcount_Num' => 100]);
     foreach ($NoteList->obj_Arr as $key => $value_note) {
         $Note = new Note(['noteid_Num' => $value_note->noteid_Num]);
         $Note->recovery();
     }
     if (!empty($NoteList->obj_Arr)) {
         $this->load->model('Message');
         $this->Message->show(['message' => '復原成功', 'url' => 'admin/base/note/set/set']);
     } else {
         $this->load->model('Message');
         $this->Message->show(['message' => '已無可復原的項目', 'url' => 'admin/base/note/set/set']);
     }
 }
开发者ID:fansWoo,项目名称:win_the_world,代码行数:15,代码来源:Set.php


示例11: dashboard

 public function dashboard()
 {
     $user = Auth::user();
     $publicnotes = Note::where('user_id', '=', Auth::user()->id)->where('public_or_private', '=', 'public')->get();
     $privatenotes = Note::where('user_id', '=', Auth::user()->id)->where('public_or_private', '=', 'private')->get();
     $publicsheets = Sheet::where('user_id', '=', Auth::user()->id)->where('public_or_private', '=', 'public')->get();
     $privatesheets = Sheet::where('user_id', '=', Auth::user()->id)->where('public_or_private', '=', 'private')->get();
     $publicmeetups = Meetup::where('admin_id', '=', Auth::user()->id)->get();
     $yournotes = Note::where('user_id', '=', Auth::user()->id)->take(5)->get();
     $yoursheets = Sheet::where('user_id', '=', Auth::user()->id)->take(5)->get();
     $yourmeetups = Meetup::where('admin_id', '=', Auth::user()->id)->take(5)->get();
     $userlists = DB::table('sheets')->where('user_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(5);
     $usernotes = DB::table('notes')->where('user_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(5);
     $alladmin = DB::table('meetups')->where('admin_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(5);
     $allmeetups = DB::table('attendees')->where('attendee_id', Auth::user()->id)->orderBy('created_at', 'desc')->paginate(5);
     $meetupsyouarepartof = [];
     if ($allmeetups != null) {
         foreach ($allmeetups as $individualmeetups) {
             $meetup = Meetup::find($individualmeetups->meetup_id);
             array_push($meetupsyouarepartof, $meetup->title);
         }
     } else {
         array_push($meetupsyouarepartof, 'You are not attending any meetups, or you are admin of all of them!');
     }
     return View::make('/users/dashboard')->with('user', $user)->with('userlists', $userlists)->with('usernotes', $usernotes)->with('alladmin', $alladmin)->with('meetupsyouarepartof', $meetupsyouarepartof)->with('publicnotes', $publicnotes)->with('privatenotes', $privatenotes)->with('publicsheets', $publicsheets)->with('privatesheets', $privatesheets)->with('publicmeetups', $publicmeetups)->with('yournotes', $yournotes)->with('yoursheets', $yoursheets)->with('yourmeetups', $yourmeetups);
 }
开发者ID:betanotes,项目名称:betanotes.dev,代码行数:26,代码来源:HomeController.php


示例12: testLoad

 public function testLoad()
 {
     $this->assertEquals(2, Group::getCount());
     $this->assertEquals(0, Role::getCount());
     $this->assertEquals(0, Account::getCount());
     $this->assertEquals(0, Contact::getCount());
     $this->assertEquals(0, Opportunity::getCount());
     $this->assertEquals(0, Meeting::getCount());
     $this->assertEquals(0, Note::getCount());
     $this->assertEquals(0, Task::getCount());
     $this->assertEquals(1, User::getCount());
     $this->assertEquals(0, ProductCatalog::getCount());
     $this->assertEquals(0, ProductCategory::getCount());
     $this->assertEquals(0, ProductTemplate::getCount());
     $this->assertEquals(0, Product::getCount());
     $messageLogger = new MessageLogger();
     DemoDataUtil::unsetLoadedModules();
     DemoDataUtil::load($messageLogger, 3);
     $this->assertEquals(8, Group::getCount());
     $this->assertEquals(3, Role::getCount());
     $this->assertEquals(3, Account::getCount());
     $this->assertEquals(16, Contact::getCount());
     $this->assertEquals(6, Opportunity::getCount());
     $this->assertEquals(18, Meeting::getCount());
     $this->assertEquals(12, Note::getCount());
     $this->assertEquals(9, Task::getCount());
     $this->assertEquals(10, User::getCount());
     $this->assertEquals(1, ProductCatalog::getCount());
     $this->assertEquals(6, ProductCategory::getCount());
     $this->assertEquals(32, ProductTemplate::getCount());
     $this->assertEquals(59, Product::getCount());
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:32,代码来源:DemoDataUtilTest.php


示例13: __construct

 /**
  * This is construct base of the class.
  *
  * A public constructor; initializes the variable $instanceDataBase.
  *
  */
 public function __construct($instanceDataBase)
 {
     parent::__construct($instanceDataBase);
     Note::setDataOperationBusiness($instanceDataBase);
     Note::getBusiness();
     Note::getDescriptionBusiness();
 }
开发者ID:vicholuis,项目名称:proyectopruebalms,代码行数:13,代码来源:StudentTaskFile.php


示例14: createNote

 /**
  * Create Note and Version instances
  *
  * $created_at and $updated_at values we have from parsed xml
  *
  * @param $title
  * @param $content
  * @param $created_at
  * @param $updated_at
  * @return \Note
  */
 protected function createNote($title, $content, $created_at, $updated_at)
 {
     $noteCreate = new \Note();
     $noteCreate->created_at = $created_at;
     $noteCreate->updated_at = $updated_at;
     // Add spaces for strip_tags
     $contentPreview = preg_replace('/(<[^>]+>)/', '$1 ', $content);
     $contentPreview = strip_tags($contentPreview);
     $versionCreate = new \Version(['title' => $title, 'content' => $content, 'content_preview' => mb_substr($contentPreview, 0, 255), 'created_at' => $created_at, 'updated_at' => $updated_at, 'user_id' => \Auth::user()->id]);
     $versionCreate->save();
     $noteCreate->version()->associate($versionCreate);
     $noteCreate->notebook_id = $this->notebook->id;
     $noteCreate->save();
     $noteCreate->users()->attach(\Auth::user()->id, array('umask' => \PaperworkHelpers::UMASK_OWNER));
     return $noteCreate;
 }
开发者ID:Liongold,项目名称:paperwork,代码行数:27,代码来源:AbstractImport.php


示例15: ArticleNote

 /**
  * Constructor.
  */
 function ArticleNote()
 {
     if (Config::getVar('debug', 'deprecation_warnings')) {
         trigger_error('Deprecated class ArticleNote. Use Note instead');
     }
     parent::Note();
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:10,代码来源:ArticleNote.inc.php


示例16: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Note::create([]);
     }
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:7,代码来源:NotesTableSeeder.php


示例17: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $note = Note::find($id);
     $note->delete();
     Session::flash('message', 'Successfully deleted the Note you have selected!');
     return Redirect::to('notes');
 }
开发者ID:kimjay1,项目名称:noteweb,代码行数:13,代码来源:NoteController.php


示例18: createNote

 /**
  * Set a note (create a new one)
  * @param string $note_text note text that will be created
  * @return bool feedback (was the note created properly ?)
  */
 public static function createNote($note_text)
 {
     if (!$note_text || strlen($note_text) == 0) {
         Session::add('feedback_negative', Text::get('FEEDBACK_NOTE_CREATION_FAILED'));
         return false;
     }
     $note = new Note();
     $note->setNoteText($note_text);
     $note->setUserId(Session::get('user_id'));
     $note->save();
     if ($note) {
         return true;
     }
     // default return
     Session::add('feedback_negative', Text::get('FEEDBACK_NOTE_CREATION_FAILED'));
     return false;
 }
开发者ID:KyleGoslan,项目名称:Huge-Propel,代码行数:22,代码来源:NoteModel.php


示例19: get_id_from_gedcom

 static function &getInstance($data, $simple = true)
 {
     global $gedcom_record_cache, $GEDCOM, $pgv_changes;
     if (is_array($data)) {
         $ged_id = $data['ged_id'];
         $pid = $data['xref'];
     } else {
         $ged_id = get_id_from_gedcom($GEDCOM);
         $pid = $data;
     }
     // Check the cache first
     if (isset($gedcom_record_cache[$pid][$ged_id])) {
         return $gedcom_record_cache[$pid][$ged_id];
     }
     // Look for the record in the database
     if (!is_array($data)) {
         $data = fetch_other_record($pid, $ged_id);
         // If we didn't find the record in the database, it may be remote
         if (!$data && strpos($pid, ':')) {
             list($servid, $remoteid) = explode(':', $pid);
             $service = ServiceClient::getInstance($servid);
             if ($service) {
                 // TYPE will be replaced with the type from the remote record
                 $data = $service->mergeGedcomRecord($remoteid, "0 @{$pid}@ TYPE\n1 RFN {$pid}", false);
             }
         }
         // If we didn't find the record in the database, it may be new/pending
         if (!$data && PGV_USER_CAN_EDIT && isset($pgv_changes[$pid . '_' . $GEDCOM])) {
             $data = find_updated_record($pid);
             $fromfile = true;
         }
         // If we still didn't find it, it doesn't exist
         if (!$data) {
             return null;
         }
     }
     // Create the object
     $object = new Note($data, $simple);
     if (!empty($fromfile)) {
         $object->setChanged(true);
     }
     // Store it in the cache
     $gedcom_record_cache[$object->xref][$object->ged_id] =& $object;
     return $object;
 }
开发者ID:bitweaver,项目名称:phpgedview,代码行数:45,代码来源:class_note.php


示例20: testCreateProperNameFieldContainsFirstAndLastName

 /**
  * @ticket 19499
  */
 public function testCreateProperNameFieldContainsFirstAndLastName()
 {
     require_once "modules/Contacts/Contact.php";
     $contact = new Contact();
     $contact->first_name = "Josh";
     $contact->last_name = "Chi";
     $contact->salutation = "Mr";
     $contact->title = 'VP Operations';
     $contact->disable_row_level_security = true;
     $contact_id = $contact->save();
     $note = new Note();
     $note->contact_id = $contact_id;
     $note->disable_row_level_security = true;
     $note->fill_in_additional_detail_fields();
     $this->assertContains($contact->first_name, $note->contact_name);
     $this->assertContains($contact->last_name, $note->contact_name);
     $GLOBALS['db']->query('DELETE FROM contacts WHERE id =\'' . $contact_id . '\'');
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:21,代码来源:NotesTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Notepad类代码示例发布时间:2022-05-23
下一篇:
PHP Normalizer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap