Ejemplo n.º 1
0
 /**
  * Initiaizes the set of groups
  */
 protected function Init()
 {
     $sql = Access::SqlBuilder();
     $tbl = Membergroup::Schema()->Table();
     $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
     $this->groups = Membergroup::Schema()->Fetch(false, null, $order);
     return parent::Init();
 }
Ejemplo n.º 2
0
 /**
  * Initializes the member form
  * @return boolean Returns false to continue processing
  */
 protected function Init()
 {
     $this->member = new Member(Request::GetData('member'));
     $this->groupsExist = Membergroup::Schema()->Count() > 0;
     $this->AddNameField();
     $this->AddEMailField();
     $this->AddPasswordField();
     $this->AddMemberGroupField();
     $this->AddSubmit();
     return parent::Init();
 }
 /**
  * Saves the groups
  */
 private function SaveGroups()
 {
     $assignedIDs = $this->AssignedGroupIDs();
     $selectedIDs = Request::PostArray('Group');
     $this->ClearMembergroups($selectedIDs);
     foreach ($selectedIDs as $selectedID) {
         if (!in_array($selectedID, $assignedIDs)) {
             $confirmGroup = new RegisterConfirmMembergroup();
             $confirmGroup->SetConfirm($this->confirm);
             $confirmGroup->SetMemberGroup(Membergroup::Schema()->ByID($selectedID));
             $confirmGroup->Save();
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Adds the member group options to the checklist
  * @param CheckList $field
  */
 private static function AddMembergroupOptions(CheckList $field)
 {
     $sql = Access::SqlBuilder();
     $tbl = Membergroup::Schema()->Table();
     $orderBy = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
     $groups = Membergroup::Schema()->Fetch(false, null, $orderBy);
     foreach ($groups as $group) {
         $field->AddOption($group->GetID(), $group->GetName());
     }
 }