コード例 #1
0
 function canEditData()
 {
     $oCurrentMember = Member::CurrentMember();
     $iCurrentMemberID = $oCurrentMember->ID;
     $iDataSheetID = $this->ID;
     if ($iCurrentMemberID && ($oDataSheetID = DataObject::get('DataSheet', "ID = '{$iDataSheetID}' AND MemberID = '{$iCurrentMemberID}'"))) {
         return true;
     }
 }
コード例 #2
0
 function OrderStepField()
 {
     return new OrderStepField($name = "MyOrderStep", $this, Member::CurrentMember());
 }
コード例 #3
0
 /**
  * Map regions to an array
  * 
  * @return mixed An array of regions, or false 
  */
 function mapCleanUps()
 {
     // Get Member
     $oCurrentMember = Member::CurrentMember();
     $oCurrentMemberID = $oCurrentMember->ID;
     $oCleanUpGroups = DataObject::get('CleanUpGroup', "CreatorID = '{$oCurrentMemberID}'");
     // If there are CleanUpGroups
     if ($oCleanUpGroups) {
         // Set a return array
         $aReturn = array();
         // Loop through the CleanUpGroups
         foreach ($oCleanUpGroups as $oCleanUpGroup) {
             // Add the value, title, and class items
             $aReturn[$oCleanUpGroup->ID] = $oCleanUpGroup->Title;
         }
         // Return the array
         return $aReturn;
     } else {
         return false;
     }
 }
コード例 #4
0
	function unsubscribe() {
		$member = Member::CurrentMember();
		if(!$member) return false;
		$this->dataRecord->Subscribers()->remove($member);
		Director::redirectBack();
		return;
	}
コード例 #5
0
 /**
  * Returns the current member
  * @return NULL | Member
  */
 function AccountMember()
 {
     return Member::CurrentMember();
 }
コード例 #6
0
 public function MyDataSheets()
 {
     $oCurrentMember = Member::CurrentMember();
     $iCurrentMemberID = $oCurrentMember->ID;
     if ($iCurrentMemberID && ($oDataSheets = DataObject::get('DataSheet', "MemberID = '{$iCurrentMemberID}'"))) {
         return $oDataSheets;
     }
 }