getRoleMemberships('role_list', $user, $roleStatement, $count_role, true);
} elseif ($getMode === 5) {
    // reload former role memberships
    $count_show_roles = 0;
    $roleStatement = getFormerRolesFromDatabase($getUserId);
    $count_role = $roleStatement->rowCount();
    getRoleMemberships('former_role_list', $user, $roleStatement, $count_role, true);
    if ($count_role === 0) {
        echo '<script type="text/javascript">$("#profile_former_roles_box").css({ \'display\':\'none\' })</script>';
    } else {
        echo '<script type="text/javascript">$("#profile_former_roles_box").css({ \'display\':\'block\' })</script>';
    }
} elseif ($getMode === 6) {
    // reload future role memberships
    $count_show_roles = 0;
    $roleStatement = getFutureRolesFromDatabase($getUserId);
    $count_role = $roleStatement->rowCount();
    getRoleMemberships('future_role_list', $user, $roleStatement, $count_role, true);
    if ($count_role === 0) {
        echo '<script type="text/javascript">$("#profile_future_roles_box").css({ \'display\':\'none\' })</script>';
    } else {
        echo '<script type="text/javascript">$("#profile_future_roles_box").css({ \'display\':\'block\' })</script>';
    }
} elseif ($getMode === 7) {
    // save membership date changes
    $getMembershipStart = admFuncVariableIsValid($_GET, 'membership_start_date_' . $getMemberId, 'date', array('requireValue' => true));
    $getMembershipEnd = admFuncVariableIsValid($_GET, 'membership_end_date_' . $getMemberId, 'date', array('requireValue' => true));
    $member = new TableMembers($gDb, $getMemberId);
    $role = new TableRoles($gDb, $member->getValue('mem_rol_id'));
    // check if user has the right to edit this membership
    if (!$role->allowedToAssignMembers($gCurrentUser)) {
Пример #2
0
    $count_role = $gDb->num_rows($result_role);
    //Ausgabe
    $page->addHtml('
    <div class="panel panel-default" id="profile_roles_box">
        <div class="panel-heading">
            ' . $gL10n->get('ROL_ROLE_MEMBERSHIPS') . '
        </div>
        <div class="panel-body" id="profile_roles_box_body">
            ' . getRoleMemberships('role_list', $user, $result_role, $count_role, false) . '
        </div>
    </div>');
    // *******************************************************************************
    // block with future memberships
    // *******************************************************************************
    $count_show_roles = 0;
    $result_role = getFutureRolesFromDatabase($user->getValue('usr_id'));
    $count_role = $gDb->num_rows($result_role);
    $visible = "";
    if ($count_role == 0) {
        $visible = ' style="display: none;" ';
    } else {
        $page->addHtml('<script type="text/javascript">profileJS.futureRoleCount="' . $count_role . '";</script>');
    }
    $page->addHtml('
    <div class="panel panel-default" id="profile_future_roles_box" ' . $visible . '>
        <div class="panel-heading">' . $gL10n->get('PRO_FUTURE_ROLE_MEMBERSHIP') . '</div>
        <div class="panel-body" id="profile_future_roles_box_body">
            ' . getRoleMemberships('future_role_list', $user, $result_role, $count_role, false) . '
        </div>
    </div>');
}
Пример #3
0
 // Ausgabe
 // @ptabaden: Added h3
 $page->addHtml('
 <div class="panel panel-default" id="profile_roles_box">
     <div class="panel-heading"><h3>
         ' . $gL10n->get('ROL_ROLE_MEMBERSHIPS') . '</h3>
     </div>
     <div class="panel-body" id="profile_roles_box_body">
         ' . getRoleMemberships('role_list', $user, $roleStatement, $count_role, false) . '
     </div>
 </div>');
 // *******************************************************************************
 // block with future memberships
 // *******************************************************************************
 $count_show_roles = 0;
 $roleStatement = getFutureRolesFromDatabase($user->getValue('usr_id'));
 $count_role = $roleStatement->rowCount();
 $visible = '';
 if ($count_role === 0) {
     $visible = ' style="display: none;" ';
 } else {
     $page->addHtml('<script type="text/javascript">profileJS.futureRoleCount="' . $count_role . '";</script>');
 }
 // @ptabaden: Changed to h3
 $page->addHtml('
 <div class="panel panel-default" id="profile_future_roles_box" ' . $visible . '>
     <div class="panel-heading"><h3>' . $gL10n->get('PRO_FUTURE_ROLE_MEMBERSHIP') . '</h3></div>
     <div class="panel-body" id="profile_future_roles_box_body">
         ' . getRoleMemberships('future_role_list', $user, $roleStatement, $count_role, false) . '
     </div>
 </div>');
Пример #4
0
    getRoleMemberships('role_list', $user, $result_role, $count_role, true);
} elseif ($getMode == 5) {
    // reload former role memberships
    $count_show_roles = 0;
    $result_role = getFormerRolesFromDatabase($getUserId);
    $count_role = $gDb->num_rows($result_role);
    getRoleMemberships('former_role_list', $user, $result_role, $count_role, true);
    if ($count_role == 0) {
        echo '<script type="text/javascript">$("#profile_former_roles_box").css({ \'display\':\'none\' })</script>';
    } else {
        echo '<script type="text/javascript">$("#profile_former_roles_box").css({ \'display\':\'block\' })</script>';
    }
} elseif ($getMode == 6) {
    // reload future role memberships
    $count_show_roles = 0;
    $result_role = getFutureRolesFromDatabase($getUserId);
    $count_role = $gDb->num_rows($result_role);
    getRoleMemberships('future_role_list', $user, $result_role, $count_role, true);
    if ($count_role == 0) {
        echo '<script type="text/javascript">$("#profile_future_roles_box").css({ \'display\':\'none\' })</script>';
    } else {
        echo '<script type="text/javascript">$("#profile_future_roles_box").css({ \'display\':\'block\' })</script>';
    }
} elseif ($getMode == 7) {
    // save membership date changes
    $getMembershipStart = admFuncVariableIsValid($_GET, 'membership_start_date_' . $getMemberId, 'date', array('requireValue' => true));
    $getMembershipEnd = admFuncVariableIsValid($_GET, 'membership_end_date_' . $getMemberId, 'date', array('requireValue' => true));
    $member = new TableMembers($gDb, $getMemberId);
    $role = new TableRoles($gDb, $member->getValue('mem_rol_id'));
    // check if user has the right to edit this membership
    if ($role->allowedToAssignMembers($gCurrentUser) == false) {