Skip to content
Snippets Groups Projects
Commit 74dfb6c0 authored by Till Glöggler's avatar Till Glöggler
Browse files

first version of availability schedule

parent 6269ed4f
No related branches found
No related tags found
No related merge requests found
<?php
/*
* AvailSchedule.class.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @author Till Glggler <till.gloeggler@elan-ev.de>
* @copyright 2013 ELAN e.V. <http://www.elan-ev.de>
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
require_once 'lib/raumplan/draw_raumPlan.php';
require_once 'lib/raumplan/ConflictCounter.class.php';
require_once 'lib/classes/SemesterData.class.php';
class AvailSchedule extends StudipPlugin implements SystemPlugin
{
/**
* Initialize a new instance of the plugin.
*/
function __construct()
{
parent::__construct();
$seminar_id = Request::option('cid', $GLOBALS['SeminarSession']);
$sem = Seminar::getInstance($seminar_id);
if (in_array($sem->status, studygroup_sem_types()) === false) {
if (Navigation::hasItem('/course/members') && $GLOBALS['perm']->have_studip_perm('tutor', $seminar_id)) {
$navigation = Navigation::getItem('/course/members');
$navigation->addSubNavigation('conflicts', new Navigation(_('Verfgbarkeit'), PluginEngine::getLink('availschedule/show')));
}
}
}
function show_action() {
$seminar_id = Request::option('cid');
if (!$seminar_id || !$GLOBALS['perm']->have_studip_perm('tutor', $seminar_id)) {
die;
}
PageLayout::setTitle($GLOBALS['SessSemName']['header_line'] . ' - ' . _('Verfgbarkeitsplan'));
Navigation::activateItem('/course/members/conflicts');
$template_path = $this->getPluginPath() . '/templates';
$template_factory = new Flexi_TemplateFactory($template_path);
$template = $template_factory->open('schedule');
$layout = $GLOBALS['template_factory']->open('layouts/base');
$template->set_layout($layout);
$template->set_attribute('really', Request::option('really'));
$template->set_attribute('semester_id', Request::option('semester_id'));
echo $template->render();
}
}
studip-availability-schedule
============================
Stud.IP Verfügbarkeitsplan
==========================
Setzt spezielle Anpassungen voraus, die momentan nur an der Universität Osnabrück verfügbar sind.
pluginclassname=AvailSchedule
pluginname=AvailabilitySchedule
origin=elan-ev
version=0.1.1
studipMinVersion=2.4
<?php
/*
teilnehmer_conflicts.php - Verfgbarkeitsanzeige der Teilnehmer eines Seminares
Copyright (C) 2005-2013 Marco Diedrich <marco.diedrich@uni-osnabrueck.de>, Till Glggler <till.gloeggler@uni-osnabrueck.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="blank" align="center">
<br/>
<?
$semester = new SemesterData();
$all_semester = $semester->getAllSemesterData();
if (!$really) { ?>
<b>
Sie k&ouml;nnen sich einen sogenannten Verf&uuml;gbarkeitsplan anzeigen lassen.<br/>
Es handelt sich dabei um eine Wochen&uuml;bersicht, worauf sie erkennen k&ouml;nnen
wieviele ihrer Teilnehmer zu den jeweiligen Zeiten andere Veranstaltungen belegen.<br/>
<br/>
Klicken Sie auf ein Semester, um sich daf&uuml;r diesen Verf&uuml;gbarkeitsplan anzeigen zu lassen:<br/>
<?
foreach ($all_semester as $key => $val) {
if ($val['ende'] >= time()) {
echo '<a href="' . URLHelper::getLink('?really=yes&semester_id=' . $key) .'">' . $val['name'] . '</a>';
echo '&nbsp;&nbsp;|&nbsp;&nbsp;';
}
}
?>
</b><br/>
<br/>
<? } else {
flush();
$plan = createPlanData(Request::get('cid'), $all_semester[$semester_id]['beginn']);
printTable($plan, $all_semester[$semester_id]['name']);
flush();
echo "<br/><br/>";
printList($plan);
}
?>
<br/>
</td>
</tr>
</table>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment