public function load_population($query)
 {
     $userfactory = new \PSU_Population_UserFactory_Simple();
     $population = new \PSU_Population($query, $userfactory);
     $population->query();
     $users = $population->matches;
     return $users;
 }
Exemple #2
0
 /**
  * return the gate's students
  */
 public function students()
 {
     $query = new Population\GateStudents($this->id);
     $factory = new Population\StudentFactory();
     $population = new \PSU_Population($query, $factory);
     $population->query();
     return $population;
 }
 public function init_technicians()
 {
     $query = new \PSU\Population\Query\IDMAttribute('cts', 'permission');
     $factory = new \PSU_Population_UserFactory_PSUPerson();
     $population = new \PSU_Population($query, $factory);
     $population->query();
     foreach ($population as $person) {
         $cts_technicians[$person->wp_id] = $person->formatName("f l");
     }
     $cts_technicians = array(NULL => 'Select a Technician') + $cts_technicians;
     $this->assign('cts_technicians', $cts_technicians);
 }
    }
    //end else
    $response->redirect($redirect);
});
respond('/[:gate_system]/[search:action]', function ($request, $response, $app) {
    $action = $request->param('action');
    if ('search' === $action) {
        $app->breadcrumbs->push('Search');
        $q = $request->param('q');
        // Is $q a PSU ID?
        if (strlen($q) === 9 && ctype_digit($q)) {
            $response->redirect($GLOBALS['BASE_URL'] . '/student/' . $q);
        }
        $query = new TeacherCert\Population\GateSystemStudents($app->gate_system->id);
        $factory = new TeacherCert\Population\StudentFactory();
        $population = new PSU_Population($query, $factory);
        $population->query(array('filter' => $q));
        $app->tpl->assign('population', $population);
        $app->tpl->display('results.tpl');
    }
});
respond('/[:gate_system]/[i:student_gate_system]/[:section]?', function ($request, $response, $app) {
    $sgs_id = $request->param('student_gate_system');
    $section = $request->param('section');
    if ('praxis' === $section) {
        $test_model = new PSU\TeacherCert\Model\Student\Test();
        $app->populate('test_model', $test_model);
    }
    $rc = TeacherCert\ActiveRecord::$rowcache = new TeacherCert\RowCache();
    $rc->cache('PSU\\TeacherCert\\ChecklistItem');
    $rc->cache('PSU\\TeacherCert\\ChecklistItemAnswer');