コード例 #1
0
    // 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)) {
        exit($gL10n->get('SYS_NO_RIGHTS'));
    }
コード例 #2
0
ファイル: profile.php プロジェクト: bash-t/admidio
    // *******************************************************************************
    // Alle Rollen auflisten, die dem Mitglied zugeordnet waren
    $count_show_roles = 0;
    $result_role = getFormerRolesFromDatabase($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.formerRoleCount="' . $count_role . '";</script>');
    }
    $page->addHtml('
    <div class="panel panel-default" id="profile_former_roles_box" ' . $visible . '>
        <div class="panel-heading">' . $gL10n->get('PRO_FORMER_ROLE_MEMBERSHIP') . '</div>
        <div class="panel-body" id="profile_former_roles_box_body">
            ' . getRoleMemberships('former_role_list', $user, $result_role, $count_role, false) . '
        </div>
    </div>');
}
if ($gPreferences['profile_show_extern_roles'] == 1 && ($gCurrentOrganization->getValue('org_org_id_parent') > 0 || $gCurrentOrganization->hasChildOrganizations())) {
    // *******************************************************************************
    // Block with roles from other organizations
    // *******************************************************************************
    // list all roles where the viewed user has an active membership
    $sql = 'SELECT *
              FROM ' . TBL_MEMBERS . ', ' . TBL_ROLES . ', ' . TBL_CATEGORIES . ', ' . TBL_ORGANIZATIONS . '
             WHERE mem_rol_id = rol_id
               AND mem_begin <= \'' . DATE_NOW . '\'
               AND mem_end   >= \'' . DATE_NOW . '\'
               AND mem_usr_id = ' . $user->getValue('usr_id') . '
               AND rol_valid   = 1
コード例 #3
0
    // Alle Rollen auflisten, die dem Mitglied zugeordnet waren
    $count_show_roles = 0;
    $roleStatement = getFormerRolesFromDatabase($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.formerRoleCount="' . $count_role . '";</script>');
    }
    // @ptabaden: Changed to h3
    $page->addHtml('
    <div class="panel panel-default" id="profile_former_roles_box" ' . $visible . '>
        <div class="panel-heading"><h3>' . $gL10n->get('PRO_FORMER_ROLE_MEMBERSHIP') . '<h3></div>
        <div class="panel-body" id="profile_former_roles_box_body">
            ' . getRoleMemberships('former_role_list', $user, $roleStatement, $count_role, false) . '
        </div>
    </div>');
}
if ($gPreferences['profile_show_extern_roles'] == 1 && ($gCurrentOrganization->getValue('org_org_id_parent') > 0 || $gCurrentOrganization->hasChildOrganizations())) {
    // *******************************************************************************
    // Block with roles from other organizations
    // *******************************************************************************
    // list all roles where the viewed user has an active membership
    $sql = 'SELECT *
              FROM ' . TBL_MEMBERS . '
        INNER JOIN ' . TBL_ROLES . '
                ON rol_id = mem_rol_id
        INNER JOIN ' . TBL_CATEGORIES . '
                ON cat_id = rol_cat_id
        INNER JOIN ' . TBL_ORGANIZATIONS . '
コード例 #4
0
ファイル: profile_function.php プロジェクト: bash-t/admidio
    // 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) {
        die($gL10n->get('SYS_NO_RIGHTS'));
    }