function CheckAssignRights($statusgruppe_id, $user_id, $seminar_id) { global $perm; list($self_assign_all, $self_assign_exclusive) = CheckSelfAssignAll($seminar_id); if (CheckSelfAssign($statusgruppe_id) && !CheckUserStatusgruppe($statusgruppe_id, $user_id) && !$perm->have_perm("admin") && $perm->have_perm("autor") && ((GetStatusgruppeLimit($statusgruppe_id)==FALSE) || (GetStatusgruppeLimit($statusgruppe_id) > CountMembersPerStatusgruppe($statusgruppe_id))) && !($self_assign_exclusive && in_array($user_id, GetAllSelected($seminar_id))) ) $assign = TRUE; else $assign = FALSE; return $assign; }
// open the template for tree-view of roles $template = $GLOBALS['template_factory']->open('statusgruppen/sem_content'); $template->set_layout('layouts/base.php'); $template->set_attribute('range_id', $range_id); // the persons of the institute who can be added directly $template->set_attribute('seminar_persons', getPersons($range_id, 'sem')); $template->set_attribute('inst_persons', getPersons($range_id, 'inst')); // all statusgroups in a tree-structured array $template->set_attribute('roles', $statusgruppen); // set the options for the box list($self_assign_all, $self_assign_exclusive) = CheckSelfAssignAll($range_id); $template->set_attribute('self_assign_all', $self_assign_all); $template->set_attribute('self_assign_exclusive', $self_assign_exclusive); $template->set_attribute('seminar_class', SeminarCategories::GetBySeminarId($range_id)->id); if (Request::option('cmd') == 'editRole') { $role = new Statusgruppe(Request::option('role_id')); $template->set_attribute('role_data', $role->getData()); $template->set_attribute('edit_role', $role->getId()); } else if (Request::submitted('choosePreset')) { $template->set_attribute('role_data', array('name' => Request::quoted('presetName'))); } $template->set_attribute('show_search_and_members_form', !LockRules::Check($range_id, 'participants')); // quickfilters