Ejemplo n.º 1
0
 private function ConfirmSignup(Raidplan $raidplan, Raidplan_display $raidplan_display)
 {
     global $config;
     $signup_id = request_var('signup_id', 0);
     $signup = new RaidplanSignup();
     $signup->confirmsignup($signup_id);
     $confirmed = $raidplan->getSignups();
     if ($config['rp_rppushmode'] == 0 && $confirmed['confirmed'] > 0) {
         //autopush
         $raidplan->raidplan_push();
     }
     $signup->signupmessenger(5, $raidplan, $this->cal->getEventlist());
     $raidplan->Get_Raidplan();
     $raidplan->Check_auth();
     $raidplan_display->DisplayRaidplan($raidplan);
 }
Ejemplo n.º 2
0
 /**
  * Completes the raidroles, selects all signups that have a role, then makes signup objects, returns array of objects to role
  *  0 unavailable
  *  1 maybe
  *  2 available
  *  3 confirmed
  *
  */
 private function _get_Signups(\bbdkp\controller\points\Points $Points, \bbdkp\controller\members\Members $Member)
 {
     global $phpbb_root_path, $phpEx, $db;
     $result = RaidplanSignup::GetSignupSQL($this->id);
     $this->signoffs = array();
     while ($row = $db->sql_fetchrow($result)) {
         if (!isset($this->eventlist[$this->event_type])) {
             //this event is closed, so fetch the whole eventlist including closed ones.
             $this->eventlist = new \bbdkp\controller\raidplanner\rpevents(0);
             $this->eventlist = $this->eventlist->events;
         }
         if ($row['signup_val'] > 0) {
             //bind signup class instance to role array
             $rpsignup = new RaidplanSignup();
             $rpsignup->setSignupId($row['signup_id']);
             $rpsignup->setRaidplanId($row['raidplan_id']);
             $rpsignup->setPosterId($row['poster_id']);
             $rpsignup->setPosterName($row['poster_name']);
             $rpsignup->setPosterColour($row['poster_colour']);
             $rpsignup->setPosterIp($row['poster_ip']);
             $rpsignup->setSignupTime($row['post_time']);
             $rpsignup->setSignupVal($row['signup_val']);
             $rpsignup->setSignupCount($row['signup_count']);
             $rpsignup->setComment($row['signup_detail']);
             $bbcode = array('bitfield' => $row['bbcode_bitfield'], 'uid' => $row['bbcode_uid']);
             $rpsignup->setBbcode($bbcode);
             $rpsignup->setConfirm($row['role_confirm']);
             $rpsignup->setRoleid($row['role_id']);
             $rpsignup->setRoleName($row['role_name']);
             $rpsignup->setDkpmemberid($row['dkpmember_id']);
             $rpsignup->setDkpmembername($row['member_name']);
             $rpsignup->setClassname($row['member_class']);
             $rpsignup->setImagename($row['imagename']);
             $rpsignup->setColorcode($row['colorcode']);
             $rpsignup->setRaceimg((string) ($row['member_gender_id'] == 0 ? $row['image_male'] : $row['image_female']));
             $rpsignup->setlevel($row['member_level']);
             $rpsignup->setGenderid($row['member_gender_id']);
             $Points->member_id = (int) $rpsignup->getDkpmemberid();
             $Points->dkpid = $this->eventlist[$this->event_type]['dkpid'];
             $Points->read_account();
             $rpsignup->setDkpCurrent($Points->total_net);
             $rpsignup->setPriorityRatio($Points->pr_net);
             $rpsignup->setLastraid($Points->lastraid);
             $rpsignup->setAttendanceP1(0);
             // @todo
             $rpsignup->setDkmemberpurl(append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&" . URI_NAMEID . '=' . $rpsignup->getDkpmemberid() . '&' . URI_DKPSYS . '=' . $Points->dkpid));
             // now add to raidrole array
             if ($rpsignup->getSignupVal() == 1 || $rpsignup->getSignupVal() == 2) {
                 // maybe + available
                 $this->raidroles[$row['role_id']]['role_signups'][] = $rpsignup;
             } elseif ($rpsignup->getSignupVal() == 3) {
                 //confirmed
                 $this->raidroles[$row['role_id']]['role_confirmations'][] = $rpsignup;
             }
             unset($rpsignup);
         } else {
             //sign offs
             //bind signup class instance to role array
             $rpsignoff = new RaidplanSignup();
             $rpsignoff->setSignupId($row['signup_id']);
             $rpsignoff->setRaidplanId($row['raidplan_id']);
             $rpsignoff->setPosterId($row['poster_id']);
             $rpsignoff->setPosterName($row['poster_name']);
             $rpsignoff->setPosterColour($row['poster_colour']);
             $rpsignoff->setPosterIp($row['poster_ip']);
             $rpsignoff->setSignupTime($row['post_time']);
             $rpsignoff->setSignupVal($row['signup_val']);
             $rpsignoff->setSignupCount($row['signup_count']);
             $rpsignoff->setComment($row['signup_detail']);
             $bbcode = array('bitfield' => $row['bbcode_bitfield'], 'uid' => $row['bbcode_uid']);
             $rpsignoff->setBbcode($bbcode);
             $rpsignoff->setConfirm($row['role_confirm']);
             $rpsignoff->setRoleid($row['role_id']);
             $rpsignoff->setRoleName($row['role_name']);
             $rpsignoff->setDkpmemberid($row['dkpmember_id']);
             $rpsignoff->setDkpmembername($row['member_name']);
             $rpsignoff->setClassname($row['member_class']);
             $rpsignoff->setImagename($row['imagename']);
             $rpsignoff->setColorcode($row['colorcode']);
             $rpsignoff->setRaceimg((string) ($row['member_gender_id'] == 0 ? $row['image_male'] : $row['image_female']));
             $rpsignoff->setlevel($row['member_level']);
             $rpsignoff->setGenderid($row['member_gender_id']);
             $Points->member_id = (int) $rpsignoff->getDkpmemberid();
             $Points->dkpid = $this->eventlist[$this->event_type]['dkpid'];
             $Points->read_account();
             $rpsignoff->setDkpCurrent($Points->total_net);
             $rpsignoff->setPriorityRatio($Points->pr_net);
             $rpsignoff->setLastraid($Points->lastraid);
             $rpsignoff->setAttendanceP1(0);
             // @todo
             $rpsignoff->setDkmemberpurl(append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&" . URI_NAMEID . '=' . $rpsignoff->getDkpmemberid() . '&' . URI_DKPSYS . '=' . $Points->dkpid));
             $this->signoffs[] = $rpsignoff;
             unset($rpsignoff);
         }
     }
     $db->sql_freeresult($result);
     unset($role_id);
     unset($role);
     unset($row);
 }