Ejemplo n.º 1
0
        if ($getFullScreen) {
            $page->hideThemeHtml();
        }
        $page->setTitle($title);
        $page->setHeadline($headline);
        // Only for active members of a role
        if ($getShowMembers === 0) {
            // create filter menu with elements for start-/enddate
            $filterNavbar = new HtmlNavbar('menu_list_filter', null, null, 'filter');
            $form = new HtmlForm('navbar_filter_form', $g_root_path . '/adm_program/modules/lists/lists_show.php', $page, array('type' => 'navbar', 'setFocus' => false));
            $form->addInput('date_from', $gL10n->get('LST_ROLE_MEMBERSHIP_IN_PERIOD'), $dateFrom, array('type' => 'date', 'maxLength' => 10));
            $form->addInput('date_to', $gL10n->get('LST_ROLE_MEMBERSHIP_TO'), $dateTo, array('type' => 'date', 'maxLength' => 10));
            $form->addInput('lst_id', '', $getListId, array('property' => FIELD_HIDDEN));
            $form->addInput('rol_ids', '', $getRoleIds, array('property' => FIELD_HIDDEN));
            $form->addInput('show_members', '', $getShowMembers, array('property' => FIELD_HIDDEN));
            $form->addSubmitButton('btn_send', $gL10n->get('SYS_OK'));
            $filterNavbar->addForm($form->show(false));
            $page->addHtml($filterNavbar->show(false));
        }
        $page->addHtml('<h5>' . $htmlSubHeadline . '</h5>');
        $page->addJavascript('
            $("#export_list_to").change(function () {
                if($(this).val().length > 1) {
                    var result = $(this).val();
                    $(this).prop("selectedIndex",0);
                    self.location.href = "' . $g_root_path . '/adm_program/modules/lists/lists_show.php?" +
                        "lst_id=' . $getListId . '&rol_ids=' . $getRoleIds . '&mode=" + result + "&show_members=' . $getShowMembers . '&date_from=' . $getDateFrom . '&date_to=' . $getDateTo . '";
                }
            });

            $("#menu_item_print_view").click(function () {
Ejemplo n.º 2
0
        // Foto aus PHP-Temp-Ordner einlesen
        $user_image_data = fread(fopen($_FILES['userfile']['tmp_name'][0], 'r'), $_FILES['userfile']['size'][0]);
        // Zwischenspeichern des neuen Fotos in der Session
        $gCurrentSession->setValue('ses_binary', $user_image_data);
        $gCurrentSession->save();
    }
    //Image-Objekt löschen
    $user_image->delete();
    if ($getItemId == $gCurrentUser->getValue('inv_id')) {
        $headline = $gL10n->get('PRO_EDIT_MY_PROFILE_PICTURE');
    } else {
        $headline = $gL10n->get('PRO_EDIT_PROFILE_PIC_FROM', $inventory->getValue('FIRST_NAME'), $inventory->getValue('LAST_NAME'));
    }
    // create html page object
    $page = new HtmlPage($headline);
    $page->addJavascript('$("#btn_cancel").click(function() {
        self.location.href=\'' . $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=dont_save&inv_id=' . $getItemId . '\';
    });', true);
    // show form
    $form = new HtmlForm('show_new_profile_picture_form', $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=save&amp;inv_id=' . $getItemId, $page);
    $form->addCustomContent($gL10n->get('PRO_CURRENT_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '" alt="' . $gL10n->get('PRO_CURRENT_PICTURE') . '" />');
    $form->addCustomContent($gL10n->get('PRO_NEW_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '&new_photo=1" alt="' . $gL10n->get('PRO_NEW_PICTURE') . '" />');
    $form->addLine();
    $form->openButtonGroup();
    $form->addButton('btn_cancel', $gL10n->get('SYS_ABORT'), array('icon' => THEME_PATH . '/icons/error.png'));
    $form->addSubmitButton('btn_update', $gL10n->get('SYS_APPLY'), array('icon' => THEME_PATH . '/icons/database_in.png'));
    $form->closeButtonGroup();
    // add form to html page and show page
    $page->addHtml($form->show(false));
    $page->show();
}
Ejemplo n.º 3
0
         LEFT JOIN ' . TBL_USER_DATA . ' as last_name
                ON last_name.usd_usr_id = usr_id
               AND last_name.usd_usf_id = ' . $gProfileFields->getProperty('LAST_NAME', 'usf_id') . '
         LEFT JOIN ' . TBL_USER_DATA . ' as first_name
                ON first_name.usd_usr_id = usr_id
               AND first_name.usd_usf_id = ' . $gProfileFields->getProperty('FIRST_NAME', 'usf_id') . '
             WHERE usr_valid  = 1
               AND mem_begin <= \'' . DATE_NOW . '\'
               AND mem_end    > \'' . DATE_NOW . '\'
               AND mem_rol_id IN (' . implode(',', $arrayUniqueRoles) . ')
          GROUP BY usr_id, first_name.usd_value, last_name.usd_value, email.usd_value
          ORDER BY first_name, last_name';
$statement = $gDb->query($sql);
while ($row = $statement->fetch()) {
    $list[] = array($row['usr_id'], $row['first_name'] . ' ' . $row['last_name'] . ' (' . $row['email'] . ')', $gL10n->get('SYS_MEMBERS'));
}
$form->addSelectBox('ecard_recipients', $gL10n->get('SYS_TO'), $list, array('property' => FIELD_REQUIRED, 'defaultValue' => $recipients, 'multiselect' => true));
$form->addLine();
$form->addInput('name_from', $gL10n->get('MAI_YOUR_NAME'), $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
$form->addInput('mail_from', $gL10n->get('MAI_YOUR_EMAIL'), $gCurrentUser->getValue('EMAIL'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
$form->closeGroupBox();
$form->openGroupBox('gb_message', $gL10n->get('SYS_MESSAGE'), 'admidio-panel-editor');
$form->addEditor('ecard_message', null, $message, array('property' => FIELD_REQUIRED, 'toolbar' => 'AdmidioGuestbook'));
$form->closeGroupBox();
$form->openButtonGroup();
$form->addButton('btn_ecard_preview', $gL10n->get('SYS_PREVIEW'), array('icon' => THEME_PATH . '/icons/eye.png'));
$form->addSubmitButton('btn_ecard_submit', $gL10n->get('SYS_SEND'), array('icon' => THEME_PATH . '/icons/email.png'));
$form->closeButtonGroup();
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 4
0
        if ($form_values['new_description'] == null) {
            $form_values['new_description'] = $file->getValue('fil_description');
        }
    } else {
        // get recordset of current folder from databses
        $folder = new TableFolder($gDb);
        $folder->getFolderForDownload($getFolderId);
        $originalName = $folder->getValue('fol_name');
        if ($form_values['new_name'] == null) {
            $form_values['new_name'] = $originalName;
        }
        if ($form_values['new_description'] == null) {
            $form_values['new_description'] = $folder->getValue('fol_description');
        }
    }
} catch (AdmException $e) {
    $e->showHtml();
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$downloadRenameMenu = $page->getMenu();
$downloadRenameMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// create html form
$form = new HtmlForm('edit_download_form', $g_root_path . '/adm_program/modules/downloads/download_function.php?mode=4&amp;folder_id=' . $getFolderId . '&amp;file_id=' . $getFileId, $page);
$form->addInput('previous_name', $gL10n->get('DOW_PREVIOUS_NAME'), $originalName, array('property' => FIELD_DISABLED));
$form->addInput('new_name', $gL10n->get('DOW_NEW_NAME'), $form_values['new_name'], array('maxLength' => 255, 'property' => FIELD_REQUIRED, 'helpTextIdLabel' => 'DOW_FILE_NAME_RULES'));
$form->addMultilineTextInput('new_description', $gL10n->get('SYS_DESCRIPTION'), $form_values['new_description'], 4, array('maxLength' => 255));
$form->addSubmitButton('btn_rename', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 5
0
// show form
$form = new HtmlForm('login_form', $g_root_path . '/adm_program/system/login_check.php', $page, array('showRequiredFields' => false));
$form->addInput('usr_login_name', $gL10n->get('SYS_USERNAME'), null, array('maxLength' => 35, 'property' => FIELD_REQUIRED, 'class' => 'form-control-small'));
// TODO Future: 'minLength' => 8
$form->addInput('usr_password', $gL10n->get('SYS_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'class' => 'form-control-small'));
// show selectbox with all organizations of database
if ($gPreferences['system_organization_select'] == 1) {
    $sql = 'SELECT org_id, org_longname
              FROM ' . TBL_ORGANIZATIONS . '
          ORDER BY org_longname ASC, org_shortname ASC';
    $form->addSelectBoxFromSql('org_id', $gL10n->get('SYS_ORGANIZATION'), $gDb, $sql, array('property' => FIELD_REQUIRED, 'defaultValue' => $gCurrentOrganization->getValue('org_id')));
}
if ($gPreferences['enable_auto_login'] == 1) {
    $form->addCheckbox('auto_login', $gL10n->get('SYS_REMEMBER_ME'), '0');
}
$form->addSubmitButton('btn_login', $gL10n->get('SYS_LOGIN'), array('icon' => THEME_PATH . '/icons/key.png'));
$page->addHtml($form->show(false));
if ($gPreferences['registration_mode'] > 0) {
    $page->addHtml('
        <div id="login_registration_link">
            <small><a href="' . $g_root_path . '/adm_program/modules/registration/registration.php">' . $gL10n->get('SYS_WANT_REGISTER') . '</a></small>
        </div>');
}
// Link bei Loginproblemen
if ($gPreferences['enable_password_recovery'] == 1 && $gPreferences['enable_system_mails'] == 1) {
    // neues Passwort zusenden
    $mail_link = $g_root_path . '/adm_program/system/lost_password.php';
} elseif ($gPreferences['enable_mail_module'] == 1 && $roleWebmaster->getValue('rol_mail_this_role') == 3) {
    // Mailmodul aufrufen mit Webmaster als Ansprechpartner
    $mail_link = $g_root_path . '/adm_program/modules/messages/messages_write.php?rol_id=' . $roleWebmaster->getValue('rol_id') . '&amp;subject=' . $gL10n->get('SYS_LOGIN_PROBLEMS');
} else {
Ejemplo n.º 6
0
$gNavigation->addUrl(CURRENT_URL, $headline);
if (isset($_SESSION['download_request'])) {
    $form_values = strStripSlashesDeep($_SESSION['download_request']);
    unset($_SESSION['download_request']);
} else {
    $form_values['new_folder'] = null;
    $form_values['new_description'] = null;
}
try {
    // get recordset of current folder from database
    $folder = new TableFolder($gDb);
    $folder->getFolderForDownload($getFolderId);
} catch (AdmException $e) {
    $e->showHtml();
}
$parentFolderName = $folder->getValue('fol_name');
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
// @ptabaden: Changed icon of back button
$folderNewMenu = $page->getMenu();
$folderNewMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), '<i class="fa fa-arrow-left" alt="' . $gL10n->get('SYS_BACK') . '" title="' . $gL10n->get('SYS_BACK') . '"></i><div class="iconDescription">' . $gL10n->get('SYS_BACK') . '</div>', '');
$page->addHtml('<p class="lead">' . $gL10n->get('DOW_CREATE_FOLDER_DESC', $parentFolderName) . '</p>');
// show form
$form = new HtmlForm('new_folder_form', $g_root_path . '/adm_program/modules/downloads/download_function.php?mode=3&amp;folder_id=' . $getFolderId, $page);
$form->addInput('new_folder', $gL10n->get('SYS_NAME'), $form_values['new_folder'], array('maxLength' => 255, 'property' => FIELD_REQUIRED));
$form->addMultilineTextInput('new_description', $gL10n->get('SYS_DESCRIPTION'), $form_values['new_description'], 4, array('maxLength' => 4000));
$form->addSubmitButton('btn_create', $gL10n->get('DOW_CREATE_FOLDER'), array('icon' => THEME_PATH . '/icons/folder_create.png', 'class' => ' col-sm-offset-3'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 7
0
$form->addSelectBox('import_coding', $gL10n->get('MEM_CODING'), $selectBoxEntries, array('property' => FIELD_REQUIRED, 'defaultValue' => $form_values['import_coding']));
// add a selectbox to the form where the user can choose a role from all roles he could see
// first read all relevant roles from database and create an array with them
$condition = '';
if (!$gCurrentUser->manageRoles()) {
    // keine Rollen mit Rollenzuordnungsrecht anzeigen
    $condition .= ' AND rol_assign_roles = 0 ';
}
if (!$gCurrentUser->isWebmaster()) {
    // Webmasterrolle nicht anzeigen
    $condition .= ' AND rol_webmaster = 0 ';
}
$sql = 'SELECT * FROM ' . TBL_ROLES . ', ' . TBL_CATEGORIES . '
         WHERE rol_valid   = 1
           AND rol_visible = 1
           AND rol_cat_id  = cat_id
           AND (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
               OR cat_org_id IS NULL )' . $condition . '
         ORDER BY cat_sequence, rol_name';
$statement = $gDb->query($sql);
$roles = array();
while ($row = $statement->fetch()) {
    $roles[] = array($row['rol_id'], $row['rol_name'], $row['cat_name']);
}
$form->addSelectBox('import_role_id', $gL10n->get('MEM_ASSIGN_ROLE'), $roles, array('property' => FIELD_REQUIRED, 'defaultValue' => $form_values['import_role_id'], 'helpTextIdLabel' => 'MEM_ASSIGN_ROLE_FOR_IMPORT'));
$selectBoxEntries = array(1 => $gL10n->get('MEM_NOT_EDIT'), 2 => $gL10n->get('MEM_DUPLICATE'), 3 => $gL10n->get('MEM_REPLACE'), 4 => $gL10n->get('MEM_COMPLEMENT'));
$form->addSelectBox('user_import_mode', $gL10n->get('MEM_EXISTING_USERS'), $selectBoxEntries, array('property' => FIELD_REQUIRED, 'defaultValue' => $form_values['user_import_mode'], 'showContextDependentFirstEntry' => false, 'helpTextIdLabel' => 'MEM_IDENTIFY_USERS'));
$form->addSubmitButton('btn_forward', $gL10n->get('SYS_NEXT'), array('icon' => THEME_PATH . '/icons/forward.png', 'class' => ' col-sm-offset-3'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
    // add textfield or ckeditor to form
    if ($gValidLogin && $gPreferences['mail_html_registered_users'] == 1) {
        $form->addEditor('msg_body', null, $form_values['msg_body'], array(''));
    } else {
        $form->addMultilineTextInput('msg_body', $gL10n->get('SYS_TEXT'), $form_values['msg_body'], 10, array('property' => FIELD_REQUIRED));
    }
    $form->closeGroupBox();
    // if captchas are enabled then visitors of the website must resolve this
    // @ptabaden: Added h3
    if (!$gValidLogin && $gPreferences['enable_mail_captcha'] == 1) {
        $form->openGroupBox('gb_confirmation_of_input', '<h3>' . $gL10n->get('SYS_CONFIRMATION_OF_INPUT') . '</h3>');
        $form->addCaptcha('captcha', $gPreferences['captcha_type']);
        $form->closeGroupBox();
    }
    // @ptabaden: changed icon
    $form->addSubmitButton('btn_send', '<i class="fa fa-paper-plane" alt="' . $gL10n->get('SYS_SEND') . '" title="' . $gL10n->get('SYS_SEND') . '"></i><div id="icon-text">' . $gL10n->get('SYS_SEND') . '</div>', array(''));
    // add form to html page and show page
    $page->addHtml($form->show(false));
}
if (isset($messageStatement)) {
    // @ptabaden: removed br
    $page->addHtml('');
    while ($row = $messageStatement->fetch()) {
        if ($row['msc_usr_id'] == $gCurrentUser->getValue('usr_id')) {
            $sentUser = $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME');
        } else {
            $sentUser = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
        }
        $receiverName = '';
        $messageText = htmlspecialchars_decode($row['msc_message']);
        if ($getMsgType === 'PM') {
Ejemplo n.º 9
0
    // create array with all column heading values
    $columnHeading = array($gL10n->get('BAC_BACKUP_FILE'), $gL10n->get('BAC_CREATION_DATE'), $gL10n->get('SYS_SIZE'), $gL10n->get('SYS_DELETE'));
    $table->setColumnAlignByArray(array('left', 'left', 'right', 'center'));
    $table->addRowHeadingByArray($columnHeading);
    $backup_size_sum = 0;
    foreach ($existingBackupFiles as $key => $old_backup_file) {
        // create array with all column values
        $columnValues = array('<a href="' . $g_root_path . '/adm_program/modules/backup/backup_file_function.php?job=get_file&amp;filename=' . $old_backup_file . '"><img
                src="' . THEME_PATH . '/icons/page_white_compressed.png" alt="' . $old_backup_file . '" title="' . $old_backup_file . '" />' . $old_backup_file . '</a>', date($gPreferences['system_date'] . ' ' . $gPreferences['system_time'], filemtime($backupabsolutepath . $old_backup_file)), round(filesize($backupabsolutepath . $old_backup_file) / 1024) . ' kB', '<a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                href="' . $g_root_path . '/adm_program/system/popup_message.php?type=bac&amp;element_id=row_file_' . $key . '&amp;name=' . urlencode($old_backup_file) . '&amp;database_id=' . $old_backup_file . '"><img
                src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('SYS_DELETE') . '" title="' . $gL10n->get('SYS_DELETE') . '" /></a>');
        $table->addRowByArray($columnValues, 'row_file_' . $key);
        $backup_size_sum = $backup_size_sum + round(filesize($backupabsolutepath . $old_backup_file) / 1024);
    }
    if (count($existingBackupFiles) > 0) {
        $columnValues = array('&nbsp;', $gL10n->get('BAC_SUM'), $backup_size_sum . ' kB', '&nbsp;');
        $table->addRowByArray($columnValues);
    }
    $page->addHtml($table->show(false));
} elseif ($getMode === 'create_backup') {
    ob_start();
    include SERVER_PATH . '/adm_program/modules/backup/backup_script.php';
    $page->addHtml(ob_get_contents());
    ob_end_clean();
    // show button with link to backup list
    $form = new HtmlForm('show_backup_list_form', $g_root_path . '/adm_program/modules/backup/backup.php', $page);
    $form->addSubmitButton('btn_update_overview', $gL10n->get('BAC_BACK_TO_BACKUP_PAGE'), array('icon' => THEME_PATH . '/icons/back.png'));
    $page->addHtml($form->show(false));
}
// show html of complete page
$page->show();
Ejemplo n.º 10
0
    if ($field->getValue('usf_name_intern') === 'LAST_NAME' || $field->getValue('usf_name_intern') === 'FIRST_NAME') {
        $htmlFieldTable .= '&nbsp;&nbsp;<span class="text-danger">(' . $gL10n->get('SYS_MANDATORY_FIELD') . ')</span>';
    }
    $htmlFieldTable .= '</label></td>
                <td>
                    <select class="form-control" size="1" id="usf-' . $field->getValue('usf_id') . '" name="usf-' . $field->getValue('usf_id') . '" style="width: 90%;">';
    if (isset($form_values['usf-' . $field->getValue('usf_id')]) && $form_values['usf-' . $field->getValue('usf_id')] > 0) {
        $htmlFieldTable .= '<option value=""></option>';
    } else {
        $htmlFieldTable .= '<option value="" selected="selected"></option>';
    }
    // Alle Spalten aus der Datei in Combobox auflisten
    foreach ($arrayCsvColumns as $col_key => $col_value) {
        $col_value = trim(strip_tags(str_replace('"', '', $col_value)));
        if (isset($form_values['usf-' . $field->getValue('usf_id')]) && strlen($form_values['usf-' . $field->getValue('usf_id')]) > 0 && $form_values['usf-' . $field->getValue('usf_id')] == $col_key) {
            $htmlFieldTable .= '<option value="' . $col_key . '" selected="selected">' . $col_value . '</option>';
        } else {
            $htmlFieldTable .= '<option value="' . $col_key . '">' . $col_value . '</option>';
        }
    }
    $htmlFieldTable .= '</select>
                </td>
            </tr>';
}
$htmlFieldTable .= '</tbody>
    </table>';
$form->addDescription($htmlFieldTable);
$form->addSubmitButton('btn_forward', $gL10n->get('MEM_IMPORT'), array('icon' => THEME_PATH . '/icons/database_in.png'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 11
0
                    $("#form_members_create_user .form-alert").html("<span class=\\"glyphicon glyphicon-ok\\"></span><strong>' . $gL10n->get('MEM_USER_COULD_BE_CREATED') . '</strong>");
                    $("#form_members_create_user .form-alert").fadeIn("slow");
                    setTimeout(function () {
                        self.location.href="' . $g_root_path . '/adm_program/modules/profile/profile_new.php?new_user=1&lastname=" + $("#lastname").val() + "&firstname=" + $("#firstname").val();
                    },2500);
                } else {
                    if(data.length > 1000) {
                        $(".modal-body").html(data);
                    } else {
                        $("#form_members_create_user .form-alert").attr("class", "alert alert-danger form-alert");
                        $("#form_members_create_user .form-alert").fadeIn();
                        $("#form_members_create_user .form-alert").html("<span class=\\"glyphicon glyphicon-exclamation-sign\\"></span>"+data);
                    }
                }
            }
        });
    });
//--></script>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">' . $gL10n->get('MEM_CREATE_USER') . '</h4>
</div>
<div class="modal-body">
    <p class="lead">' . $gL10n->get('MEM_INPUT_FIRSTNAME_LASTNAME') . '</p>';
$form = new HtmlForm('form_members_create_user', $g_root_path . '/adm_program/modules/members/members_assign.php');
$form->addInput('lastname', $gL10n->get('SYS_LASTNAME'), null, array('maxLength' => 100, 'property' => FIELD_REQUIRED));
$form->addInput('firstname', $gL10n->get('SYS_FIRSTNAME'), null, array('maxLength' => 100, 'property' => FIELD_REQUIRED));
$form->addSubmitButton('btn_add', $gL10n->get('MEM_CREATE_USER'), array('icon' => THEME_PATH . '/icons/add.png', 'class' => ' col-sm-offset-3'));
$form->show();
echo '</div>';
Ejemplo n.º 12
0
function getRoleMemberships($htmlListId, $user, $result_role, $count_role, $directOutput)
{
    global $gDb, $gL10n, $gCurrentUser, $gPreferences, $g_root_path, $gProfileFields;
    $countShowRoles = 0;
    $member = new TableMembers($gDb);
    $role = new TableRoles($gDb);
    $roleMemHTML = '<ul class="list-group admidio-list-roles-assign" id="' . $htmlListId . '">';
    while ($row = $gDb->fetch_array($result_role)) {
        if ($gCurrentUser->hasRightViewRole($row['mem_rol_id']) && $row['rol_visible'] == 1) {
            $formerMembership = false;
            $futureMembership = false;
            $showRoleEndDate = false;
            $deleteMode = 'pro_role';
            $member->clear();
            $member->setArray($row);
            $role->clear();
            $role->setArray($row);
            // if membership will not end, then don't show end date
            if (strcmp($member->getValue('mem_end', 'Y-m-d'), '9999-12-31') != 0) {
                $showRoleEndDate = true;
            }
            // check if membership ends in the past
            if (strcmp(DATE_NOW, $member->getValue('mem_end', 'Y-m-d')) > 0) {
                $formerMembership = true;
                $deleteMode = 'pro_former';
            }
            // check if membership starts in the future
            if (strcmp($member->getValue('mem_begin', 'Y-m-d'), DATE_NOW) > 0) {
                $futureMembership = true;
                $deleteMode = 'pro_future';
            }
            // create list entry for one role
            $roleMemHTML .= '
            <li class="list-group-item" id="role_' . $row['mem_rol_id'] . '">
                <ul class="list-group admidio-list-roles-assign-pos">
                    <li class="list-group-item">
                        <span>' . $role->getValue('cat_name') . ' - ';
            if ($gCurrentUser->hasRightViewRole($member->getValue('mem_rol_id'))) {
                $roleMemHTML .= '<a href="' . $g_root_path . '/adm_program/modules/lists/lists_show.php?mode=html&amp;rol_id=' . $member->getValue('mem_rol_id') . '" title="' . $role->getValue('rol_description') . '">' . $role->getValue('rol_name') . '</a>';
            } else {
                echo $role->getValue('rol_name');
            }
            if ($member->getValue('mem_leader') == 1) {
                $roleMemHTML .= ' - ' . $gL10n->get('SYS_LEADER');
            }
            $roleMemHTML .= '&nbsp;
                        </span>
                        <span class="pull-right text-right">';
            if ($showRoleEndDate == true) {
                $roleMemHTML .= $gL10n->get('SYS_SINCE_TO', $member->getValue('mem_begin', $gPreferences['system_date']), $member->getValue('mem_end', $gPreferences['system_date']));
            } elseif ($futureMembership == true) {
                $roleMemHTML .= $gL10n->get('SYS_FROM', $member->getValue('mem_begin', $gPreferences['system_date']));
            } else {
                $roleMemHTML .= $gL10n->get('SYS_SINCE', $member->getValue('mem_begin', $gPreferences['system_date']));
            }
            if ($role->allowedToAssignMembers($gCurrentUser)) {
                // You are not allowed to delete your own webmaster membership, other roles could be deleted
                if ($role->getValue('rol_webmaster') == 1 && $gCurrentUser->getValue('usr_id') != $user->getValue('usr_id') || $role->getValue('rol_webmaster') == 0) {
                    $roleMemHTML .= '
                                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                                        href="' . $g_root_path . '/adm_program/system/popup_message.php?type=' . $deleteMode . '&amp;element_id=role_' . $role->getValue('rol_id') . '&amp;database_id=' . $member->getValue('mem_id') . '&amp;name=' . urlencode($role->getValue('rol_name')) . '"><img
                                        src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '" title="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '" /></a>';
                } else {
                    $roleMemHTML .= '
                                    <a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
                }
                // do not edit webmaster role
                if ($row['rol_webmaster'] == 0) {
                    $roleMemHTML .= '<a class="admidio-icon-link" style="cursor:pointer;" onclick="profileJS.toggleDetailsOn(' . $member->getValue('mem_id') . ')"><img
                                        src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('PRO_CHANGE_DATE') . '" title="' . $gL10n->get('PRO_CHANGE_DATE') . '" /></a>';
                } else {
                    $roleMemHTML .= '<a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
                }
            }
            // only show info if system setting is activated
            if ($gPreferences['system_show_create_edit'] > 0) {
                $roleMemHTML .= '<a class="admidio-icon-link admMemberInfo" id="member_info_' . $member->getValue('mem_id') . '" href="javascript:"><img src="' . THEME_PATH . '/icons/info.png" alt="' . $gL10n->get('SYS_INFORMATIONS') . '" title="' . $gL10n->get('SYS_INFORMATIONS') . '"/></a>';
            }
            $roleMemHTML .= '</span>
                    </li>
                    <li class="list-group-item" id="membership_period_' . $member->getValue('mem_id') . '" style="visibility: hidden; display: none;"><div class="collapse navbar-collapse">';
            $form = new HtmlForm('membership_period_form_' . $member->getValue('mem_id'), $g_root_path . '/adm_program/modules/profile/profile_function.php?mode=7&amp;user_id=' . $user->getValue('usr_id') . '&amp;mem_id=' . $row['mem_id'], null, array('type' => 'navbar', 'setFocus' => false, 'class' => 'admidio-form-membership-period'));
            $form->addInput('membership_start_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_START'), $member->getValue('mem_begin', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
            $form->addInput('membership_end_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_END'), $member->getValue('mem_end', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
            $form->addSubmitButton('btn_send_' . $member->getValue('mem_id'), $gL10n->get('SYS_OK'));
            $roleMemHTML .= $form->show(false);
            $roleMemHTML .= '</div></li>
                    <li class="list-group-item" id="member_info_' . $member->getValue('mem_id') . '_Content" style="display: none;">';
            // show informations about user who creates the recordset and changed it
            $roleMemHTML .= admFuncShowCreateChangeInfoById($member->getValue('mem_usr_id_create'), $member->getValue('mem_timestamp_create'), $member->getValue('mem_usr_id_change'), $member->getValue('mem_timestamp_change')) . '
                    </li>
                </ul>
            </li>';
            $countShowRoles++;
        }
    }
    if ($countShowRoles == 0) {
        $roleMemHTML = '<div class="block-padding">' . $gL10n->get('PRO_NO_ROLES_VISIBLE') . '</div>';
    } else {
        $roleMemHTML .= '</ul>';
    }
    if ($directOutput) {
        echo $roleMemHTML;
        return '';
    } else {
        return $roleMemHTML;
    }
}
Ejemplo n.º 13
0
 }
 $form = new HtmlForm('plugin-login-form', $g_root_path . '/adm_program/system/login_check.php', null, array('type' => 'vertical', 'setFocus' => false, 'showRequiredFields' => false));
 $form->addInput('plg_usr_login_name', $gL10n->get('SYS_USERNAME'), null, array('property' => FIELD_REQUIRED, 'maxLength' => 35));
 // TODO Future: 'minLength' => 8
 $form->addInput('plg_usr_password', $gL10n->get('SYS_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED));
 // show selectbox with all organizations of database
 if ($gPreferences['system_organization_select'] == 1) {
     $sql = 'SELECT org_id, org_longname
               FROM ' . TBL_ORGANIZATIONS . '
           ORDER BY org_longname ASC, org_shortname ASC';
     $form->addSelectBoxFromSql('plg_org_id', $gL10n->get('SYS_ORGANIZATION'), $gDb, $sql, array('defaultValue' => $gCurrentOrganization->getValue('org_id'), 'showContextDependentFirstEntry' => false));
 }
 if ($gPreferences['enable_auto_login'] == 1) {
     $form->addCheckbox('plg_auto_login', $gL10n->get('SYS_REMEMBER_ME'), '0');
 }
 $form->addSubmitButton('next_page', $gL10n->get('SYS_LOGIN'), array('icon' => $iconCode));
 $form->show();
 echo '<div class="btn-group-vertical" role="group">';
 // show links for registration and help
 if ($plg_show_register_link && $gPreferences['registration_mode']) {
     if ($plg_show_icons) {
         echo '
         <a class="btn" href="' . $g_root_path . '/adm_program/modules/registration/registration.php"><img
             src="' . THEME_PATH . '/icons/new_registrations.png" alt="' . $gL10n->get('SYS_REGISTRATION') . '" />' . $gL10n->get('SYS_REGISTRATION') . '</a>';
     } else {
         echo '<a href="' . $g_root_path . '/adm_program/modules/registration/registration.php" ' . $plg_link_target . '>' . $gL10n->get('SYS_REGISTRATION') . '</a>';
     }
 }
 if ($plg_show_email_link) {
     // read id of webmaster role
     $sql = 'SELECT rol_id
Ejemplo n.º 14
0
}
// Html-Kopf ausgeben
if ($getLinkId > 0) {
    $headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline);
} else {
    $headline = $gL10n->get('SYS_CREATE_VAR', $getHeadline);
}
// add current url to navigation stack
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$linksCreateMenu = $page->getMenu();
$linksCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// Html des Modules ausgeben
if ($getLinkId > 0) {
    $modeEditOrCreate = '3';
} else {
    $modeEditOrCreate = '1';
}
// show form
$form = new HtmlForm('weblinks_edit_form', $g_root_path . '/adm_program/modules/links/links_function.php?lnk_id=' . $getLinkId . '&amp;headline=' . $getHeadline . '&amp;mode=' . $modeEditOrCreate, $page);
$form->addInput('lnk_name', $gL10n->get('LNK_LINK_NAME'), $link->getValue('lnk_name'), array('maxLength' => 250, 'property' => FIELD_REQUIRED));
$form->addInput('lnk_url', $gL10n->get('LNK_LINK_ADDRESS'), $link->getValue('lnk_url'), array('maxLength' => 2000, 'property' => FIELD_REQUIRED));
$form->addSelectBoxForCategories('lnk_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'LNK', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $link->getValue('lnk_cat_id')));
$form->addEditor('lnk_description', $gL10n->get('SYS_DESCRIPTION'), $link->getValue('lnk_description'), array('height' => '150px'));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($link->getValue('lnk_usr_id_create'), $link->getValue('lnk_timestamp_create'), $link->getValue('lnk_usr_id_change'), $link->getValue('lnk_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 15
0
            $fieldType = 'date';
            $maxlength = '10';
        } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'EMAIL') {
            // email could not be longer than 254 characters
            $fieldType = 'email';
            $maxlength = '254';
        } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'URL') {
            // maximal browser compatible url length will be 2000 characters
            $maxlength = '2000';
        } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'NUMBER') {
            $fieldType = 'number';
            $maxlength = array(0, 9999999999, 1);
        } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'cat_name_intern') === 'SOCIAL_NETWORKS') {
            $maxlength = '255';
        } else {
            $maxlength = '50';
        }
        $form->addInput('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $inventory->getValue($field->getValue('inf_name_intern')), array('type' => $fieldType, 'maxlength' => $maxlength, 'property' => $fieldProperty, 'helpTextIdInline' => $helpId, 'class' => $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon')));
    }
}
// div-Container admGroupBoxBody und admGroupBox schliessen
$form->closeGroupBox();
$btn_image = 'disk.png';
$btn_text = $gL10n->get('SYS_SAVE');
$form->addSubmitButton('btn_save', $btn_text, array('icon' => THEME_PATH . '/icons/' . $btn_image));
if ($getNewItem == 0) {
    // show information about inventory who creates the recordset and changed it
    $form->addHtml(admFuncShowCreateChangeInfoById($inventory->getValue('inv_usr_id_create'), $inventory->getValue('inv_timestamp_create'), $inventory->getValue('inv_usr_id_change'), $inventory->getValue('inv_timestamp_change')));
}
$page->addHtml($form->show(false));
$page->show();
Ejemplo n.º 16
0
        require_once '../../installation/db_scripts/preferences.php';
        // set some specific preferences whose values came from user input of the installation wizard
        $orga_preferences['email_administrator'] = $_POST['orgaEmail'];
        $orga_preferences['system_language'] = $gPreferences['system_language'];
        // create all necessary data for this organization
        $newOrganization->setPreferences($orga_preferences, false);
        $newOrganization->createBasicData($gCurrentUser->getValue('usr_id'));
        // if installation of second organization than show organization select at login
        if ($gCurrentOrganization->countAllRecords() === 2) {
            $sql = 'UPDATE ' . TBL_PREFERENCES . ' SET prf_value = 1
                 WHERE prf_name = \'system_organization_select\' ';
            $gDb->query($sql);
        }
        $gDb->endTransaction();
        // create html page object
        $page = new HtmlPage($gL10n->get('INS_SETUP_WAS_SUCCESSFUL'));
        $page->addHtml('<p class="lead">' . $gL10n->get('ORG_ORGANIZATION_SUCCESSFULL_ADDED', $_POST['orgaLongName']) . '</p>');
        // show form
        $form = new HtmlForm('add_new_organization_form', $g_root_path . '/adm_program/modules/preferences/preferences.php', $page);
        $form->addSubmitButton('btn_foward', $gL10n->get('SYS_NEXT'), array('icon' => THEME_PATH . '/icons/forward.png'));
        // add form to html page and show page
        $page->addHtml($form->show(false));
        $page->show();
        // clean up
        unset($_SESSION['add_organization_request']);
        break;
    case 4:
        // show php info page
        echo phpinfo();
        break;
}
Ejemplo n.º 17
0
    $gMessage->show($gL10n->get('SYS_SERVER_NO_UPLOAD'));
}
$gNavigation->addUrl(CURRENT_URL, $headline);
if (isset($_SESSION['download_request'])) {
    $form_values = strStripSlashesDeep($_SESSION['download_request']);
    unset($_SESSION['download_request']);
} else {
    $form_values['new_name'] = null;
    $form_values['new_description'] = null;
}
try {
    // get recordset of current folder from databse
    $folder = new TableFolder($gDb);
    $folder->getFolderForDownload($getFolderId);
} catch (AdmException $e) {
    $e->showHtml();
}
$parentFolderName = $folder->getValue('fol_name');
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$downloadUploadMenu = $page->getMenu();
$downloadUploadMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
$page->addHtml('<p class="lead">' . $gL10n->get('DOW_UPLOAD_TO_FOLDER', $parentFolderName) . '</p>');
// show form
$form = new HtmlForm('upload_files_form', $g_root_path . '/adm_program/modules/downloads/download_function.php?mode=1&amp;folder_id=' . $getFolderId, $page, array('enableFileUpload' => true));
$form->addFileUpload('add_files', $gL10n->get('DOW_CHOOSE_FILE'), array('enableMultiUploads' => true, 'multiUploadLabel' => $gL10n->get('DOW_UPLOAD_ANOTHER_FILE')));
$form->addSubmitButton('btn_upload', $gL10n->get('SYS_UPLOAD'), array('icon' => THEME_PATH . '/icons/page_white_upload.png', 'class' => ' col-sm-offset-3'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();