예제 #1
0
 /**
  * @param integer $p_timestamp Timestamp representing the time the event occurred.
  * @param integer $p_user_id   An user identifier.
  * @param integer $p_issue_id  A issue identifier.
  * @param string  $p_tag_name  Tag name linked to the issue.
  * @param boolean $p_tag       Whether tag was being linked or unlinked from the issue.
  */
 public function __construct($p_timestamp, $p_user_id, $p_issue_id, $p_tag_name, $p_tag)
 {
     parent::__construct($p_timestamp, $p_user_id);
     $this->issue_id = $p_issue_id;
     $this->tag_name = $p_tag_name;
     $this->tag = $p_tag;
 }
 /**
  * @param integer $p_timestamp  Timestamp representing the time the event occurred.
  * @param integer $p_user_id    An user identifier.
  * @param integer $p_issue_id   A issue identifier.
  * @param integer $p_old_status Old status value of issue.
  * @param integer $p_new_status New status value of issue.
  */
 public function __construct($p_timestamp, $p_user_id, $p_issue_id, $p_old_status, $p_new_status)
 {
     parent::__construct($p_timestamp, $p_user_id, $p_issue_id);
     $this->issue_id = $p_issue_id;
     $this->old_status = $p_old_status;
     $this->new_status = $p_new_status;
 }
 /**
  * 
  */
 public function testMarkTimelineEventAsStarred()
 {
     $member = $this->objFromFixture('Member', 'reciever');
     TimelineEvent::notify($member, 'Im important message to u!');
     $this->assertEquals(0, TimelineEvent::get_starred($member)->count());
     $notifications = TimelineEvent::get_all($member);
     $this->assertEquals(1, $notifications->count());
     $notifications->first()->markAsStarred();
     $this->assertEquals(1, TimelineEvent::get_starred($member)->count());
     $notifications->first()->markAsNotStarred();
     $this->assertEquals(0, TimelineEvent::get_starred($member)->count());
 }
 /**
  * 
  * @param int $id
  * @param FieldList $fields
  * @return Form
  */
 public function getEditForm($id = null, $fields = null)
 {
     $fields = new FieldList();
     $notifications = TimelineEvent::get_all(Member::currentUser());
     $gridField = new GridField('TimelineEvents', 'Timeline', $notifications, new TimelineConfig());
     $fields->add($gridField);
     $form = CMSForm::create($this, "EditForm", $fields, new FieldList())->setHTMLID('Form_EditForm');
     $form->setResponseNegotiator($this->getResponseNegotiator());
     $form->addExtraClass('cms-edit-form');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     $form->setAttribute('data-pjax-fragment', 'CurrentForm');
     return $form;
 }
 /**
  * 
  * @param SS_HTTPRequest $request
  */
 public function run($request)
 {
     $memberEmail = $request->requestVar('email');
     $message = trim($request->requestVar('message'));
     if (!$memberEmail) {
         echo 'Please provide an email, eg ?email=user@example.com' . PHP_EOL;
         exit(1);
     }
     $members = Member::get()->filter('Email', $memberEmail);
     if (!$members->count()) {
         echo 'Please provide an existing member email' . PHP_EOL;
         exit(1);
     }
     $member = $members->first();
     if (!$message) {
         echo 'Please provide a message, eg ?message=hello' . PHP_EOL;
         exit(1);
     }
     TimelineEvent::notify($member, $message);
     echo 'Member ' . $member->Email . ' has been notified' . PHP_EOL;
 }
 /**
  * @param integer $p_timestamp Timestamp representing the time the event occurred.
  * @param integer $p_user_id   An user identifier.
  * @param integer $p_issue_id  A issue identifier.
  */
 public function __construct($p_timestamp, $p_user_id, $p_issue_id)
 {
     parent::__construct($p_timestamp, $p_user_id);
     $this->issue_id = $p_issue_id;
 }
 /**
  * 
  * @param Member $member
  */
 public static function get_all(Member $member)
 {
     return TimelineEvent::get()->filter(array('MemberID' => $member->ID));
 }