/**
  * Gets the name of the range. Copied somewhere from Stud.IP...
  * @access  public
  * @param   string   $rangeID         the rangeID
  * @param   boolean  $html_decode     (optional)
  * @return  string                    The name of the range
  */
 function getRangename($rangeID, $html_decode = true)
 {
     global $user;
     if ($rangeID == "studip") {
         return _("Systemweite Evaluationen");
     }
     $o_type = get_object_type($rangeID, array('sem', 'user', 'inst'));
     if (in_array($o_type, array('sem', 'inst', 'fak'))) {
         $name = getHeaderLine($rangeID);
         if ($name != NULL) {
             if ($html_decode) {
                 $rangename = decodeHTML($name);
             } else {
                 $rangename = $name;
             }
         } else {
             $rangename = _("Kein Titel gefunden.");
         }
         return $rangename;
     }
     if ($o_type != 'user') {
         $user_id = get_userid($rangeID);
     } else {
         $user_id = $rangeID;
     }
     if ($user_id != $user->id) {
         $rangename = _("Profil: ") . get_fullname($user_id, 'full', 1) . " (" . get_username($user_id) . ")";
     } else {
         $rangename = _("Profil");
     }
     return $rangename;
 }
Example #2
0
 /**
  * @todo der include muss weg
  */
 public function showweek_action($timestamp = null)
 {
     $calendar = Calendar::getInstance(Calendar::RANGE_INST, $this->institute_id);
     PageLayout::setTitle(getHeaderLine($this->institute_id) . ' - ' . _("Terminkalender - Wochenansicht"));
     $_SESSION['calendar_sess_control_data']['view_prv'] = 'showweek';
     Navigation::activateItem("/course/calendar/week");
     $atime = $timestamp ?: time();
     $at = date('G', $atime);
     if ($at >= $this->calendar_settings['start'] && $at <= $this->calendar_settings['end'] || !$atime) {
         $st = $this->calendar_settings['start'];
         $et = $this->calendar_settings['end'];
     } elseif ($at < $this->calendar_settings['start']) {
         $st = 0;
         $et = $this->calendar_settings['start'] + 2;
     } else {
         $st = $this->calendar_settings['end'] - 2;
         $et = 23;
     }
     include_once $GLOBALS['RELATIVE_PATH_CALENDAR'] . '/lib/DbCalendarWeek.class.php';
     $this->_calendar = $calendar;
     $this->atime = $atime;
     $this->cmd = 'showweek';
     $this->st = $st;
     $this->et = $et;
 }
Example #3
0
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->institute_id = current($args);
     if ($this->institute_id === '' || !in_array(get_object_type($this->institute_id), words('inst fak')) || !$GLOBALS['perm']->have_studip_perm("admin", $this->institute_id)) {
         $this->set_status(403);
         return FALSE;
     }
     $this->body_id = 'custom_avatar';
     PageLayout::setTitle(getHeaderLine($this->institute_id) . ' - ' . _('Bild ändern'));
     Navigation::activateItem('/admin/institute/details');
     # choose base layout w/o infobox and set tabs
     $layout = $GLOBALS['template_factory']->open('layouts/base_without_infobox');
     $this->set_layout($layout);
 }
Example #4
0
        download_config($range_id, $config_id, Request::quoted('module'));
        page_close();
        exit;
    }
}

PageLayout::setTitle(_("Verwaltung externer Seiten"));

if ($range_id != 'studip') {
    Navigation::activateItem('/admin/institute/external');
    require_once 'lib/admin_search.inc.php';
} else {
    Navigation::activateItem('/admin/locations/external');
}
$mod=Request::quoted('mod');//Change header_line if open object
$header_line = getHeaderLine($range_id);
if ($header_line) {
    PageLayout::setTitle($header_line." - ".PageLayout::getTitle());
    foreach ($GLOBALS['EXTERN_MODULE_TYPES'] as $key => $type) {
        if ($type["module"] == $mod) {
            PageLayout::setTitle(PageLayout::getTitle() . " ({$GLOBALS['EXTERN_MODULE_TYPES'][$key]['name']})");
            break;
        }
    }
}

// upload of configuration
if (Request::option('com') == "do_upload_config") {
    $file_content = file_get_contents($_FILES['the_file']['tmp_name']);

    // revert the changes done by indentJson
Example #5
0
 /**
  * displays a paginated member overview of a studygroup
  *
  * @param string id of a studypgroup
  * @param string page number the current page
  *
  * @return void
  *
  */
 function members_action()
 {
     $id = $_SESSION['SessionSeminar'];
     PageLayout::setTitle(getHeaderLine($_SESSION['SessionSeminar']) . ' - ' . _("Teilnehmende"));
     Navigation::activateItem('/course/members');
     PageLayout::setHelpKeyword('Basis.StudiengruppenBenutzer');
     Request::set('choose_member_parameter', $this->flash['choose_member_parameter']);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($id, 'participants');
     $sem = Course::find($id);
     $this->anzahl = StudygroupModel::countMembers($id);
     $this->groupname = $sem->getFullname();
     $this->sem_id = $id;
     $this->groupdescription = $sem->beschreibung;
     $this->moderators = $sem->getMembersWithStatus('dozent');
     $this->tutors = $sem->getMembersWithStatus('tutor');
     $this->autors = $sem->getMembersWithStatus('autor');
     $this->accepted = $sem->admission_applicants->findBy('status', 'accepted');
     $this->sem_class = Course::findCurrent()->getSemClass();
     $inviting_search = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM auth_user_md5 " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . "LEFT JOIN seminar_user ON (auth_user_md5.user_id = seminar_user.user_id AND seminar_user.Seminar_id = '" . addslashes($id) . "') " . "WHERE perms  NOT IN ('root', 'admin') " . "AND " . get_vis_query() . " AND (username LIKE :input OR Vorname LIKE :input " . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR {$GLOBALS['_fullname_sql']['full_rev']} LIKE :input) " . "ORDER BY fullname ASC", _("Nutzer suchen"), "user_id");
     $this->rechte = $GLOBALS['perm']->have_studip_perm("tutor", $id);
     $actions = new ActionsWidget();
     if ($this->rechte) {
         $mp = MultiPersonSearch::get('studygroup_invite_' . $id)->setLinkText(_('Neue Gruppenmitglieder-/innen einladen'))->setLinkIconPath("")->setTitle(_('Neue Gruppenmitglieder/-innen einladen'))->setExecuteURL($this->url_for('course/studygroup/execute_invite/' . $id, array('view' => Request::get('view'))))->setSearchObject($inviting_search)->addQuickfilter(_('Adressbuch'), User::findCurrent()->contacts->pluck('user_id'))->setNavigationItem('/course/members')->render();
         $element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
         $actions->addElement($element);
     }
     if ($this->rechte || $sem->getSemClass()['studygroup_mode']) {
         $actions->addLink(_('Nachricht an alle Gruppenmitglieder verschicken'), $this->url_for('course/studygroup/message/' . $id), Icon::create('mail', 'clickable'), array('data-dialog' => 1));
     }
     if ($actions->hasElements()) {
         Sidebar::get()->addWidget($actions);
     }
     $this->invitedMembers = StudygroupModel::getInvitations($id);
 }
Example #6
0
if ($perm->have_perm('admin')) {
    if (Navigation::hasItem('/browse/my_courses/list')) {
        Navigation::activateItem('/browse/my_courses/list');
    }
} else {
    if (Navigation::hasItem('/course/admin/main/archive')) {
        Navigation::activateItem('/course/admin/main/archive');
    }
}

PageLayout::setTitle(_("Archivieren von Veranstaltungen"));

//Change header_line if open object
if ($SessSemName[1]) {
    PageLayout::setTitle(getHeaderLine($SessSemName[1]) . " - " . PageLayout::getTitle());
}
// single delete (a Veranstaltung is open)
if ($SessSemName[1]) {
    $archiv_sem[] = "_id_" . $SessSemName[1];
    $archiv_sem[] = "on";
}
if (!is_array($archiv_sem)) {
    $archiv_sem = Request::quotedArray('archiv_sem');
}
// Handlings....
// Kill current list and stuff

if (Request::option('new_session'))
    $_SESSION['archiv_assi_data'] = array();
Example #7
0
 /**
  * show institute basicdata page
  *
  * @param mixed $i_id Optional institute id 
  * @throws AccessDeniedException
  */
 public function index_action($i_id = false)
 {
     PageLayout::setTitle(_('Verwaltung der Grunddaten'));
     Navigation::activateItem('/admin/institute/details');
     //get ID from an open Institut
     $i_view = $i_id ?: Request::option('i_view', $GLOBALS['SessSemName'][1]);
     if (!$i_view) {
         require_once 'lib/admin_search.inc.php';
         // This search just died a little inside, so it should be safe to
         // continue here but we nevertheless return just to be sure
         return;
     } elseif ($i_view === 'new') {
         closeObject();
     }
     //  allow only inst-admin and root to view / edit
     if ($i_view && !$GLOBALS['perm']->have_studip_perm('admin', $i_view) && $i_view !== 'new') {
         throw new AccessDeniedException();
     }
     //Change header_line if open object
     $header_line = getHeaderLine($i_view);
     if ($header_line) {
         PageLayout::setTitle($header_line . ' - ' . PageLayout::getTitle());
     }
     if (Request::get('i_trykill')) {
         $message = _('Sind Sie sicher, dass Sie diese Einrichtung löschen wollen?');
         $post['i_kill'] = 1;
         $post['studipticket'] = get_ticket();
         $this->question = createQuestion2($message, $post, array(), $this->url_for('institute/basicdata/delete/' . $i_view));
     }
     $lockrule = LockRules::getObjectRule($i_view);
     if ($lockrule->description && LockRules::CheckLockRulePermission($i_view, $lockrule['permission'])) {
         PageLayout::postMessage(MessageBox::info(formatLinks($lockrule->description)));
     }
     // Load institute data
     $institute = new Institute($i_view === 'new' ? null : $i_view);
     //add the free administrable datafields
     $datafields = array();
     $localEntries = DataFieldEntry::getDataFieldEntries($institute->id, 'inst');
     if ($localEntries) {
         $invalidEntries = $this->flash['invalid_entries'] ?: array();
         foreach ($localEntries as $entry) {
             if (!$entry->isVisible()) {
                 continue;
             }
             $color = '#000000';
             if (in_array($entry->getId(), $invalidEntries)) {
                 $color = '#ff0000';
             }
             $datafields[] = array('color' => $color, 'title' => $entry->getName(), 'value' => $GLOBALS['perm']->have_perm($entry->isEditable()) && !LockRules::Check($institute['Institut_id'], $entry->getId()) ? $entry->getHTML('datafields') : $entry->getDisplayValue());
         }
     }
     // Read faculties if neccessary
     if (count($institute->sub_institutes) === 0) {
         if ($GLOBALS['perm']->have_perm('root')) {
             $this->faculties = Institute::findBySQL('Institut_id = fakultaets_id ORDER BY Name ASC', array($i_view));
         } else {
             $temp = User::find($GLOBALS['user']->id)->institute_memberships->findBy('inst_perms', 'admin')->pluck('institute');
             $institutes = SimpleORMapCollection::createFromArray($temp);
             $faculties = $institutes->filter(function ($institute) {
                 return $institute->is_fak;
             });
             $this->faculties = $faculties;
         }
     }
     // Indicates whether the current user is allowed to delete the institute
     $this->may_delete = $i_view !== 'new' && !(count($institute->home_courses) || count($institute->sub_institutes)) && ($GLOBALS['perm']->have_perm('root') || $GLOBALS['perm']->is_fak_admin() && get_config('INST_FAK_ADMIN_PERMS') == 'all');
     if (!$this->may_delete) {
         //Set infotext for disabled delete-button
         $reason_txt = _('Löschen nicht möglich.');
         if (count($institute->home_courses) > 0) {
             $reason_txt .= ' ';
             $reason_txt .= sprintf(ngettext('Es ist eine Veranstaltung zugeordnet.', 'Es sind %u Veranstaltungen zugeordnet.', count($institute->home_courses)), count($institute->home_courses));
         }
         if (count($institute->sub_institutes) > 0) {
             $reason_txt .= ' ';
             $reason_txt .= sprintf(ngettext('Es ist eine Einrichtung zugeordnet.', 'Es sind %u Einrichtungen zugeordnet.', count($institute->sub_institutes)), count($institute->sub_institutes));
         }
     }
     // Indicates whether the current user is allowed to change the faculty
     $this->may_edit_faculty = $GLOBALS['perm']->is_fak_admin() && !LockRules::Check($institute['Institut_id'], 'fakultaets_id') && ($GLOBALS['perm']->have_studip_perm('admin', $institute['fakultaets_id']) || $i_view === 'new');
     // Prepare template
     $this->institute = $institute;
     $this->i_view = $i_view;
     $this->datafields = $datafields;
     $this->reason_txt = $reason_txt;
 }
Example #8
0
 protected function getTitle(SingleCalendar $calendar, $title_end)
 {
     $title = '';
     $status = '';
     if ($calendar->getRangeId() == $GLOBALS['user']->id) {
         $title = _('Mein persönlicher Terminkalender');
     } else {
         if ($calendar->getRange() == Calendar::RANGE_USER) {
             $title = sprintf(_('Terminkalender von %s'), $calendar->range_object->getFullname());
         } else {
             $title = getHeaderLine($calendar->getRangeId());
         }
         if ($calendar->havePermission(Calendar::PERMISSION_WRITABLE)) {
             $status = ' (' . _('schreibberechtigt') . ')';
         } else {
             $status = ' (' . _('leseberechtigt') . ')';
         }
     }
     return $title . ' - ' . $title_end . $status;
 }
Example #9
0
 * @version 10. Juni 2003
 * @access  public
 * @package evaluation
 */
require '../lib/bootstrap.php';
ob_start();
// start output buffering
page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));
$perm->check("autor");
$list = Request::option('list');
$view = Request::option('view');
include_once 'lib/seminar_open.php';
PageLayout::setHelpKeyword("Basis.Evaluationen");
$title = _('Verwaltung von Evaluationen');
if ($GLOBALS['SessSemName'][1]) {
    $title = getHeaderLine($GLOBALS['SessSemName'][1]) . ' - ' . $title;
}
PageLayout::setTitle($title);
require_once 'lib/evaluation/evaluation.config.php';
if ($view === 'eval_inst') {
    Navigation::activateItem('/admin/institute/evaluation');
    require_once 'lib/admin_search.inc.php';
} else {
    if ($SessSemName[1] && $view == "eval_sem") {
        Navigation::activateItem('/course/admin/evaluation');
    } else {
        Navigation::activateItem('/tools/evaluation');
    }
}
if ($SessSemName[1] && $view == "eval_sem" || $view == "eval_inst") {
    $the_range = $SessSemName[1];
Example #10
0
        <? if ($file['is_open'] == 'open'): ?>
        <tr>
            <td class="printcontent">&nbsp;</td>
            <td class="printcontent" colspan="3">
                <div style="margin-bottom: 10px;">
                    <b>
                        <a href="<?php 
echo URLHelper::getLink($section['link'], array('auswahl' => $file['id']));
?>
">
                            <?php 
echo Icon::create('files', 'clickable')->asImg();
?>
                            <?php 
echo getHeaderLine($file['id']);
?>
                        </a>
                    </b>
                    <br>
                    <?php 
echo _('Status in der Veranstaltung:');
?>
                    <b><?php 
echo $file['status'] ?: _('unbekannt');
?>
</b>
                </div>
                <div style="margin-bottom: 10px;" align="center">
                    <?php 
echo Studip\LinkButton::create(_('Herunterladen'), '?download_as_zip=' . $file['id']);