Skip to content
Snippets Groups Projects

Draft: Update - Matches export, Master-Filter and indicator for Master OSKAs

Open Manuel Schwarz requested to merge filter-export-update into master
3 files
+ 40
31
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 37
0
@@ -87,6 +87,14 @@ class AdminController extends PluginController {
@@ -87,6 +87,14 @@ class AdminController extends PluginController {
}
}
$this->matches = $matches;
$this->matches = $matches;
 
 
$sidebar = Sidebar::Get();
 
$actions = $sidebar->addWidget(new ActionsWidget());
 
$actions->addLink(
 
_('Matches-Liste exportieren'),
 
$this->url_for('admin/export_matches/'),
 
Icon::create('export', 'clickable')
 
);
}
}
public function mentees_action($page = 1, $fach_selection= null, $has_oska = null)
public function mentees_action($page = 1, $fach_selection= null, $has_oska = null)
@@ -457,6 +465,35 @@ class AdminController extends PluginController {
@@ -457,6 +465,35 @@ class AdminController extends PluginController {
$this->redirect('admin/mentees');
$this->redirect('admin/mentees');
}
}
 
public function export_matches_action()
 
{
 
$data = [array(_('Mentor'), _('Mentee'), _('gemeinsames Fach'))];
 
 
foreach(OskaMatches::findAllMatches() as $match){
 
$mentee = User::find($match['mentee_id']);
 
$mentor = User::find($match['mentor_id']);
 
$studycourse = '';
 
 
foreach ($mentee->studycourses as $i => $val) {
 
if ($val->studycourse->fach_id == OskaMentees::find($match['mentee_id'])->getMenteePrefStudycourse()) {
 
$studycourse = $val->studycourse->name;
 
}
 
}
 
 
$mentee_data = array(
 
$mentor->nachname . ', ' . $mentor->vorname,
 
$mentee->nachname . ', ' . $mentee->vorname,
 
$studycourse
 
);
 
array_push($data, $mentee_data);
 
}
 
 
$this->render_csv(
 
$data,
 
'Matches.csv'
 
);
 
}
 
public function export_mentees_action()
public function export_mentees_action()
{
{
$data = [array(_('Vorname'), _('Nachname'), _('Benutzername'), _('E-Mail'), _('Studiengang'), _('präferiertes Fach'), _('hat OSKA'))];
$data = [array(_('Vorname'), _('Nachname'), _('Benutzername'), _('E-Mail'), _('Studiengang'), _('präferiertes Fach'), _('hat OSKA'))];
Loading