Exemplo n.º 1
0
 public function execute($request)
 {
     $user_id = coreContext::getInstance()->getUser()->getUserId();
     $this->filter = $this->getUser()->getLocalPrefs()->get('review.graph.filter', '');
     $carddata = ReviewsPeer::getLeitnerBoxCounts($this->filter);
     $this->restudy_cards = $carddata[0]['expired_cards'];
     // count untested cards and add to graph
     $this->untested_cards = ReviewsPeer::getCountUntested($user_id, $this->filter);
     $carddata[0]['fresh_cards'] = $this->untested_cards;
     $carddata[0]['total_cards'] += $this->untested_cards;
     // count totals (save a database query)
     //$this->total_cards = 0;
     $this->expired_total = 0;
     for ($i = 0; $i < count($carddata); $i++) {
         $box =& $carddata[$i];
         //$this->total_cards += $box['total_cards'];
         // count expired cards, EXCEPT the red stack
         if ($i > 0) {
             $this->expired_total += $box['expired_cards'];
         }
     }
     $this->chart_data = $this->makeChartData($carddata);
     //DBG::printr($this->chart_data);exit;
     $this->me = $this;
     return coreView::SUCCESS;
 }