Example #1
0
$form->addSelectBox('rol_this_list_view', $gL10n->get('ROL_SEE_ROLE_MEMBERSHIP'), $selectBoxEntries, array('defaultValue' => $role->getValue('rol_this_list_view'), 'showContextDependentFirstEntry' => false, 'helpTextIdLabel' => array('ROL_RIGHT_THIS_LIST_VIEW_DESC', $gL10n->get('ROL_RIGHT_ALL_LISTS_VIEW'))));
$selectBoxEntries = array(0 => $gL10n->get('ROL_NO_ADDITIONAL_RIGHTS'), 1 => $gL10n->get('SYS_ASSIGN_MEMBERS'), 2 => $gL10n->get('SYS_EDIT_MEMBERS'), 3 => $gL10n->get('ROL_ASSIGN_EDIT_MEMBERS'));
$form->addSelectBox('rol_leader_rights', $gL10n->get('SYS_LEADER'), $selectBoxEntries, array('defaultValue' => $role->getValue('rol_leader_rights'), 'showContextDependentFirstEntry' => false, 'helpTextIdLabel' => 'ROL_LEADER_RIGHTS_DESC'));
$selectBoxEntries = array(0 => $gL10n->get('ROL_SYSTEM_DEFAULT_LIST'));
// SQL-Statement fuer alle Listenkonfigurationen vorbereiten, die angezeigt werdne sollen
$sql = 'SELECT lst_id, lst_name FROM ' . TBL_LISTS . '
         WHERE lst_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
           AND lst_global = 1
           AND lst_name IS NOT NULL
         ORDER BY lst_global ASC, lst_name ASC';
$pdoStatement = $gDb->query($sql);
while ($row = $pdoStatement->fetch()) {
    $selectBoxEntries[$row['lst_id']] = $row['lst_name'];
}
$form->addSelectBox('rol_lst_id', $gL10n->get('ROL_DEFAULT_LIST'), $selectBoxEntries, array('defaultValue' => $role->getValue('rol_lst_id'), 'showContextDependentFirstEntry' => false, 'helpTextIdLabel' => 'ROL_DEFAULT_LIST_DESC'));
$form->addCheckbox('rol_default_registration', $gL10n->get('ROL_DEFAULT_REGISTRATION'), $role->getValue('rol_default_registration'), array('helpTextIdLabel' => 'ROL_DEFAULT_REGISTRATION_DESC'));
$form->addInput('rol_max_members', $gL10n->get('SYS_MAX_PARTICIPANTS') . '<br />(' . $gL10n->get('ROL_WITHOUT_LEADER') . ')', $role->getValue('rol_max_members'), array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 99999));
$form->addInput('rol_cost', $gL10n->get('SYS_CONTRIBUTION') . ' ' . $gPreferences['system_currency'], $role->getValue('rol_cost'), array('maxLength' => 6, 'class' => 'form-control-small'));
$form->addSelectBox('rol_cost_period', $gL10n->get('SYS_CONTRIBUTION_PERIOD'), $role->getCostPeriods(), array('defaultValue' => $role->getValue('rol_cost_period')));
$form->closeGroupBox();
$form->openGroupBox('gb_authorization', $gL10n->get('SYS_AUTHORIZATION'));
$form->addCheckbox('rol_assign_roles', $gL10n->get('ROL_RIGHT_ASSIGN_ROLES'), $role->getValue('rol_assign_roles'), array('helpTextIdLabel' => 'ROL_RIGHT_ASSIGN_ROLES_DESC', 'icon' => 'roles.png'));
$form->addCheckbox('rol_all_lists_view', $gL10n->get('ROL_RIGHT_ALL_LISTS_VIEW'), $role->getValue('rol_all_lists_view'), array('icon' => 'lists.png'));
$form->addCheckbox('rol_approve_users', $gL10n->get('ROL_RIGHT_APPROVE_USERS'), $role->getValue('rol_approve_users'), array('icon' => 'new_registrations.png'));
$form->addCheckbox('rol_edit_user', $gL10n->get('ROL_RIGHT_EDIT_USER'), $role->getValue('rol_edit_user'), array('helpTextIdLabel' => 'ROL_RIGHT_EDIT_USER_DESC', 'icon' => 'group.png'));
if ($gPreferences['enable_mail_module'] > 0) {
    $form->addCheckbox('rol_mail_to_all', $gL10n->get('ROL_RIGHT_MAIL_TO_ALL'), $role->getValue('rol_mail_to_all'), array('icon' => 'email.png'));
}
$form->addCheckbox('rol_profile', $gL10n->get('ROL_RIGHT_PROFILE'), $role->getValue('rol_profile'), array('icon' => 'profile.png'));
if ($gPreferences['enable_announcements_module'] > 0) {
    $form->addCheckbox('rol_announcements', $gL10n->get('ROL_RIGHT_ANNOUNCEMENTS'), $role->getValue('rol_announcements'), array('icon' => 'announcements.png'));
Example #2
0
 // get module menu
 $membersAssignmentMenu = $page->getMenu();
 $membersAssignmentMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
 if ($gCurrentUser->editUsers()) {
     $membersAssignmentMenu->addItem('menu_item_create_user', $g_root_path . '/adm_program/modules/members/members_new.php', $gL10n->get('MEM_CREATE_USER'), 'add.png');
 }
 $navbarForm = new HtmlForm('navbar_show_all_users_form', '', $page, array('type' => 'navbar', 'setFocus' => false));
 $sql = 'SELECT rol_id, rol_name, cat_name 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 )
          ORDER BY cat_sequence, rol_name';
 $navbarForm->addSelectBoxFromSql('filter_rol_id', $gL10n->get('SYS_ROLE'), $gDb, $sql, array('defaultValue' => $getFilterRoleId, 'firstEntry' => $gL10n->get('SYS_ALL')));
 $navbarForm->addCheckbox('mem_show_all', $gL10n->get('MEM_SHOW_ALL_USERS'), 0, array('helpTextIdLabel' => 'MEM_SHOW_USERS_DESC'));
 $membersAssignmentMenu->addForm($navbarForm->show(false));
 // create table object
 $table = new HtmlTable('tbl_assign_role_membership', $page, true, true, 'table table-condensed');
 $table->setMessageIfNoRowsFound('SYS_NO_ENTRIES_FOUND');
 // create column header to assign role leaders
 $htmlLeaderColumn = $gL10n->get('SYS_LEADER');
 // show icon that leaders have no additional rights
 if ($role->getValue('rol_leader_rights') == ROLE_LEADER_NO_RIGHTS) {
     $htmlLeaderColumn .= '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/info.png"
         alt="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" title="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" />';
 }
 // show icon with edit user right if leader has this right
 if ($role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_EDIT || $role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_ASSIGN_EDIT) {
     $htmlLeaderColumn .= '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/profile_edit.png"
         alt="' . $gL10n->get('ROL_LEADER_EDIT_MEMBERS') . '" title="' . $gL10n->get('ROL_LEADER_EDIT_MEMBERS') . '" />';
Example #3
0
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion_modules" href="#collapse_events">
                            <img class="admidio-panel-heading-icon" src="' . THEME_PATH . '/icons/dates.png" alt="' . $gL10n->get('DAT_DATES') . '" />' . $gL10n->get('DAT_DATES') . '
                        </a>
                    </h4>
                </div>
                <div id="collapse_events" class="panel-collapse collapse">
                    <div class="panel-body">');
// show form
$form = new HtmlForm('events_preferences_form', $g_root_path . '/adm_program/modules/preferences/preferences_function.php?form=events', $page, array('class' => 'form-preferences'));
$selectBoxEntries = array('0' => $gL10n->get('SYS_DEACTIVATED'), '1' => $gL10n->get('SYS_ACTIVATED'), '2' => $gL10n->get('ORG_ONLY_FOR_REGISTERED_USER'));
$form->addSelectBox('enable_dates_module', $gL10n->get('ORG_ACCESS_TO_MODULE'), $selectBoxEntries, array('defaultValue' => $form_values['enable_dates_module'], 'showContextDependentFirstEntry' => false, 'helpTextIdInline' => 'ORG_ACCESS_TO_MODULE_DESC'));
$selectBoxEntries = array('html' => $gL10n->get('DAT_VIEW_MODE_DETAIL'), 'compact' => $gL10n->get('DAT_VIEW_MODE_COMPACT'));
$form->addSelectBox('dates_viewmode', $gL10n->get('DAT_VIEW_MODE'), $selectBoxEntries, array('defaultValue' => $form_values['dates_viewmode'], 'showContextDependentFirstEntry' => false, 'helpTextIdInline' => array('DAT_VIEW_MODE_DESC', 'DAT_VIEW_MODE_DETAIL', 'DAT_VIEW_MODE_COMPACT')));
$form->addInput('dates_per_page', $gL10n->get('ORG_NUMBER_OF_ENTRIES_PER_PAGE'), $form_values['dates_per_page'], array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 9999, 'helpTextIdInline' => 'ORG_NUMBER_OF_ENTRIES_PER_PAGE_DESC'));
$form->addCheckbox('enable_dates_ical', $gL10n->get('DAT_ENABLE_ICAL'), $form_values['enable_dates_ical'], array('helpTextIdInline' => 'DAT_ENABLE_ICAL_DESC'));
$form->addInput('dates_ical_days_past', $gL10n->get('DAT_ICAL_DAYS_PAST'), $form_values['dates_ical_days_past'], array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 9999, 'helpTextIdInline' => 'DAT_ICAL_DAYS_PAST_DESC'));
$form->addInput('dates_ical_days_future', $gL10n->get('DAT_ICAL_DAYS_FUTURE'), $form_values['dates_ical_days_future'], array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 9999, 'helpTextIdInline' => 'DAT_ICAL_DAYS_FUTURE_DESC'));
$form->addCheckbox('dates_show_map_link', $gL10n->get('DAT_SHOW_MAP_LINK'), $form_values['dates_show_map_link'], array('helpTextIdInline' => 'DAT_SHOW_MAP_LINK_DESC'));
$html = '<a class="btn" href="' . $g_root_path . '/adm_program/modules/categories/categories.php?type=DAT&amp;title=' . $gL10n->get('DAT_CALENDAR') . '"><img
                                    src="' . THEME_PATH . '/icons/application_view_tile.png" alt="' . $gL10n->get('DAT_SWITCH_TO_CALENDAR_ADMINISTRATION') . '" />' . $gL10n->get('DAT_SWITCH_TO_CALENDAR_ADMINISTRATION') . '</a>';
$htmlDesc = $gL10n->get('DAT_EDIT_CALENDAR_DESC') . '<div class="alert alert-warning alert-small" role="alert"><span class="glyphicon glyphicon-warning-sign"></span>' . $gL10n->get('ORG_NOT_SAVED_SETTINGS_LOST') . '</div>';
$form->addCustomContent($gL10n->get('DAT_MANAGE_CALENDARS'), $html, array('helpTextIdInline' => $htmlDesc));
$form->addCheckbox('dates_show_rooms', $gL10n->get('DAT_ROOM_SELECTABLE'), $form_values['dates_show_rooms'], array('helpTextIdInline' => 'DAT_ROOM_SELECTABLE_DESC'));
$html = '<a class="btn" href="' . $g_root_path . '/adm_program/modules/rooms/rooms.php"><img
                                    src="' . THEME_PATH . '/icons/home.png" alt="' . $gL10n->get('DAT_SWITCH_TO_ROOM_ADMINISTRATION') . '" />' . $gL10n->get('DAT_SWITCH_TO_ROOM_ADMINISTRATION') . '</a>';
$htmlDesc = $gL10n->get('DAT_EDIT_ROOMS_DESC') . '<div class="alert alert-warning alert-small" role="alert"><span class="glyphicon glyphicon-warning-sign"></span>' . $gL10n->get('ORG_NOT_SAVED_SETTINGS_LOST') . '</div>';
$form->addCustomContent($gL10n->get('DAT_EDIT_ROOMS'), $html, array('helpTextIdInline' => $htmlDesc));
$form->addSubmitButton('btn_save_events', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
$page->addHtml($form->show(false));
$page->addHtml('</div>
Example #4
0
            // delete all other configurations
            $del_list = new ListConfiguration($gDb, $configuration['lst_id']);
            $del_list->delete();
        } else {
            // now add configuration to array
            $configurationsArray[] = array($configuration['lst_id'], $objListTimestamp->format($gPreferences['system_date'] . ' ' . $gPreferences['system_time']), $actualGroup);
        }
    } else {
        // now add configuration to array
        $configurationsArray[] = array($configuration['lst_id'], $configuration['lst_name'], $actualGroup);
    }
}
$form->addSelectBox('sel_select_configuation', $gL10n->get('LST_SELECT_CONFIGURATION'), $configurationsArray, array('defaultValue' => $formValues['sel_select_configuation'], 'showContextDependentFirstEntry' => false));
// Webmasters could upgrade a configuration to a global configuration that is visible to all users
if ($gCurrentUser->isWebmaster()) {
    $form->addCheckbox('cbx_global_configuration', $gL10n->get('LST_CONFIGURATION_ALL_USERS'), $list->getValue('lst_global'), array('defaultValue' => $formValues['cbx_global_configuration'], 'helpTextIdLabel' => 'LST_PRESET_CONFIGURATION_DESC'));
}
$form->addDescription($gL10n->get('LST_ADD_COLUMNS_DESC'));
$form->addHtml('
    <div class="table-responsive">
    <table class="table table-condensed" id="mylist_fields_table">
        <thead>
            <tr>
                <th style="width: 20%;">' . $gL10n->get('SYS_ABR_NO') . '</th>
                <th style="width: 37%;">' . $gL10n->get('SYS_CONTENT') . '</th>
                <th style="width: 18%;">' . $gL10n->get('SYS_ORDER') . '</th>
                <th style="width: 25%;">' . $gL10n->get('SYS_CONDITION') . '
                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                        href="' . $g_root_path . '/adm_program/system/msg_window.php?message_id=mylist_condition&amp;inline=true">
                        <img src="' . THEME_PATH . '/icons/help.png" alt="Help" />
                    </a>
Example #5
0
$loginMenu = $page->getMenu();
$loginMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// 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
Example #6
0
$form->openGroupBox('gb_presentation', $gL10n->get('SYS_PRESENTATION'));
$userFieldText = array('CHECKBOX' => $gL10n->get('SYS_CHECKBOX'), 'DATE' => $gL10n->get('SYS_DATE'), 'DECIMAL' => $gL10n->get('SYS_DECIMAL_NUMBER'), 'DROPDOWN' => $gL10n->get('SYS_DROPDOWN_LISTBOX'), 'EMAIL' => $gL10n->get('SYS_EMAIL'), 'NUMBER' => $gL10n->get('SYS_NUMBER'), 'PHONE' => $gL10n->get('SYS_PHONE'), 'RADIO_BUTTON' => $gL10n->get('SYS_RADIO_BUTTON'), 'TEXT' => $gL10n->get('SYS_TEXT') . ' (100 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'TEXT_BIG' => $gL10n->get('SYS_TEXT') . ' (4000 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'URL' => $gL10n->get('ORG_URL'));
asort($userFieldText);
if ($userField->getValue('usf_system') == 1) {
    // bei Systemfeldern darf der Datentyp nicht mehr veraendert werden
    $form->addInput('usf_type', $gL10n->get('ORG_DATATYPE'), $userFieldText[$userField->getValue('usf_type')], array('maxLength' => 30, 'property' => FIELD_DISABLED));
} else {
    // fuer jeden Feldtypen einen Eintrag in der Combobox anlegen
    $form->addSelectBox('usf_type', $gL10n->get('ORG_DATATYPE'), $userFieldText, array('property' => FIELD_REQUIRED, 'defaultValue' => $userField->getValue('usf_type')));
}
$form->addMultilineTextInput('usf_value_list', $gL10n->get('ORG_VALUE_LIST'), $userField->getValue('usf_value_list', 'database'), 6, array('property' => FIELD_REQUIRED, 'helpTextIdLabel' => 'ORG_VALUE_LIST_DESC'));
$form->addInput('usf_icon', $gL10n->get('SYS_ICON'), $userField->getValue('usf_icon', 'database'), array('maxLength' => 2000));
$form->addInput('usf_url', $gL10n->get('ORG_URL'), $userField->getValue('usf_url'), array('maxLength' => 2000, 'helpTextIdLabel' => 'ORG_FIELD_URL_DESC'));
$form->closeGroupBox();
$form->openGroupBox('gb_authorization', $gL10n->get('SYS_AUTHORIZATION'));
$form->addCheckbox('usf_hidden', $gL10n->get('ORG_FIELD_NOT_HIDDEN'), $userField->getValue('usf_hidden'), array('helpTextIdLabel' => 'ORG_FIELD_HIDDEN_DESC', 'icon' => 'eye.png'));
$form->addCheckbox('usf_disabled', $gL10n->get('ORG_FIELD_DISABLED', $gL10n->get('ROL_RIGHT_EDIT_USER')), $userField->getValue('usf_disabled'), array('helpTextIdLabel' => 'ORG_FIELD_DISABLED_DESC', 'icon' => 'textfield_key.png'));
if ($userField->getValue('usf_name_intern') === 'LAST_NAME' || $userField->getValue('usf_name_intern') === 'FIRST_NAME') {
    $form->addCheckbox('usf_mandatory', $gL10n->get('ORG_FIELD_REQUIRED'), $userField->getValue('usf_mandatory'), array('property' => FIELD_DISABLED, 'helpTextIdLabel' => 'ORG_FIELD_REQUIRED_DESC', 'icon' => 'asterisk_yellow.png'));
} else {
    $form->addCheckbox('usf_mandatory', $gL10n->get('ORG_FIELD_REQUIRED'), $userField->getValue('usf_mandatory'), array('helpTextIdLabel' => 'ORG_FIELD_REQUIRED_DESC', 'icon' => 'asterisk_yellow.png'));
}
$form->closeGroupBox();
$form->openGroupBox('gb_description', $gL10n->get('SYS_DESCRIPTION'), 'admidio-panel-editor');
$form->addEditor('usf_description', null, $userField->getValue('usf_description'), array('height' => '200px'));
$form->closeGroupBox();
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($userField->getValue('usf_usr_id_create'), $userField->getValue('usf_timestamp_create'), $userField->getValue('usf_usr_id_change'), $userField->getValue('usf_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Example #7
0
 // add profile fields to form
 $fieldProperty = FIELD_DEFAULT;
 $helpId = null;
 if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_disabled') == 1 && !$gCurrentUser->editUsers() && $getNewUser == 0) {
     // disable field if this is configured in profile field configuration
     $fieldProperty = FIELD_DISABLED;
 } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_mandatory') == 1) {
     // set mandatory field
     $fieldProperty = FIELD_REQUIRED;
 }
 if (strlen($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_description')) > 0) {
     $helpId = array('item_field_description', $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name_intern'));
 }
 // code for different field types
 if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'CHECKBOX') {
     $form->addCheckbox('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')), $fieldProperty, $helpId, null, $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon', 'database'));
 } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'DROPDOWN' || $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name_intern') === 'ROOM_ID') {
     // set array with values and set default value
     if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name_intern') === 'ROOM_ID') {
         if ($gDbType === 'mysql') {
             $sql = 'SELECT room_id, CONCAT(room_name, \' (\', room_capacity, \'+\', IFNULL(room_overhang, \'0\'), \')\') FROM ' . TBL_ROOMS . ' ORDER BY room_name';
         } else {
             $sql = 'SELECT room_id, room_name || \' (\' || room_capacity || \'+\' || COALESCE(room_overhang, \'0\') || \')\' FROM ' . TBL_ROOMS . ' ORDER BY room_name';
         }
         $defaultValue = '';
         if ($getNewItem == 0) {
             $defaultValue = $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id');
         }
         $form->addSelectBoxFromSql('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $gDb, $sql, array('property' => $fieldProperty, 'showContextDependentFirstEntry' => true, 'defaultValue' => $defaultValue));
     } else {
         $arrListValues = $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_value_list');
if ($gPreferences['dates_show_rooms'] == true) {
    if ($gDbType === 'mysql') {
        $sql = 'SELECT room_id, CONCAT(room_name, \' (\', room_capacity, \'+\', IFNULL(room_overhang, \'0\'), \')\')
                      FROM ' . TBL_ROOMS . '
                  ORDER BY room_name';
    } else {
        $sql = 'SELECT room_id, room_name || \' (\' || room_capacity || \'+\' || COALESCE(room_overhang, \'0\') || \')\'
                      FROM ' . TBL_ROOMS . '
                  ORDER BY room_name';
    }
    $form->addSelectBoxFromSql('dat_room_id', $gL10n->get('SYS_ROOM'), $gDb, $sql, array('defaultValue' => $date->getValue('dat_room_id')));
}
$form->closeGroupBox();
// @ptabaden: changed "&" to "und" and added h3
$form->openGroupBox('gb_period_calendar', '<h3>' . $gL10n->get('SYS_PERIOD') . ' und ' . $gL10n->get('DAT_CALENDAR') . '</h3>');
$form->addCheckbox('dat_all_day', $gL10n->get('DAT_ALL_DAY'), $date->getValue('dat_all_day'));
$form->addInput('date_from', $gL10n->get('SYS_START'), $date->getValue('dat_begin', $gPreferences['system_date'] . ' ' . $gPreferences['system_time']), array('type' => 'datetime', 'property' => FIELD_REQUIRED));
$form->addInput('date_to', $gL10n->get('SYS_END'), $date->getValue('dat_end', $gPreferences['system_date'] . ' ' . $gPreferences['system_time']), array('type' => 'datetime', 'property' => FIELD_REQUIRED));
$form->addSelectBoxForCategories('dat_cat_id', $gL10n->get('DAT_CALENDAR'), $gDb, 'DAT', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $date->getValue('dat_cat_id')));
$form->closeGroupBox();
// @ptabaden: changed "&" to "und" and added h3
$form->openGroupBox('gb_visibility_registration', '<h3>' . $gL10n->get('DAT_VISIBILITY') . ' und ' . $gL10n->get('SYS_REGISTRATION') . '</h3>');
// add a multiselectbox to the form where the user can choose all roles that should see this event
// first read all relevant roles from database and create an array with them
$sql = 'SELECT *
              FROM ' . TBL_ROLES . '
        INNER JOIN ' . TBL_CATEGORIES . '
                ON cat_id = rol_cat_id
             WHERE rol_valid   = 1
               AND rol_visible = 1
               AND (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
Example #9
0
        $form_values['first_row'] = 0;
    }
} else {
    $form_values['first_row'] = 1;
    $form_values['import_coding'] = 'iso-8859-1';
    $form_values['import_role_id'] = 0;
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$importCsvConfigMenu = $page->getMenu();
$importCsvConfigMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
$page->addHtml('<p class="lead">' . $gL10n->get('MEM_ASSIGN_FIELDS_DESC') . '</p>');
// show form
$form = new HtmlForm('import_assign_fields_form', $g_root_path . '/adm_program/modules/members/import_csv.php', $page, array('type' => 'vertical'));
$form->addCheckbox('first_row', $gL10n->get('MEM_FIRST_LINE_COLUMN_NAME'), $form_values['first_row']);
$htmlFieldTable = '
    <table class="table table-condensed">
        <thead>
            <tr>
                <th>' . $gL10n->get('MEM_PROFILE_FIELD') . '</th>
                <th>' . $gL10n->get('MEM_FILE_COLUMN') . '</th>
            </tr>
        </thead>';
$line = reset($_SESSION['file_lines']);
$arrayCsvColumns = explode($_SESSION['value_separator'], $line);
$category = '';
// jedes Benutzerfeld aus der Datenbank auflisten
foreach ($gProfileFields->mProfileFields as $field) {
    if ($category != $field->getValue('cat_id')) {
        if ($category !== '') {
    if (!$announcement->editRight()) {
        $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
    }
}
if (isset($_SESSION['announcements_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $announcement->setArray($_SESSION['announcements_request']);
    unset($_SESSION['announcements_request']);
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$announcementsMenu = $page->getMenu();
$announcementsMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
$form = new HtmlForm('announcements_edit_form', $g_root_path . '/adm_program/modules/announcements/announcements_function.php?ann_id=' . $getAnnId . '&amp;headline=' . $getHeadline . '&amp;mode=1', $page);
$form->addInput('ann_headline', $gL10n->get('SYS_TITLE'), $announcement->getValue('ann_headline'), array('maxLength' => 100, 'property' => FIELD_REQUIRED));
// if current organization has a parent organization or is child organizations then show option to set this announcement to global
if ($gCurrentOrganization->getValue('org_org_id_parent') > 0 || $gCurrentOrganization->hasChildOrganizations()) {
    // show all organizations where this organization is mother or child organization
    $organizations = '- ' . $gCurrentOrganization->getValue('org_longname') . ',<br />- ';
    $organizations .= implode(',<br />- ', $gCurrentOrganization->getOrganizationsInRelationship(true, true, true));
    $form->addCheckbox('ann_global', $gL10n->get('SYS_ENTRY_MULTI_ORGA'), $announcement->getValue('ann_global'), array('helpTextIdLabel' => array('SYS_DATA_GLOBAL', $organizations)));
}
$form->addEditor('ann_description', $gL10n->get('SYS_TEXT'), $announcement->getValue('ann_description'), array('property' => FIELD_REQUIRED));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($announcement->getValue('ann_usr_id_create'), $announcement->getValue('ann_timestamp_create'), $announcement->getValue('ann_usr_id_change'), $announcement->getValue('ann_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Example #11
0
 // add profile fields to form
 $fieldProperty = FIELD_DEFAULT;
 $helpId = '';
 if ($gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_disabled') == 1 && !$gCurrentUser->hasRightEditProfile($user, false) && $getNewUser === 0) {
     // disable field if this is configured in profile field configuration
     $fieldProperty = FIELD_DISABLED;
 } elseif ($gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_mandatory') == 1) {
     // set mandatory field
     $fieldProperty = FIELD_REQUIRED;
 }
 if (strlen($gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_description')) > 0) {
     $helpId = array('user_field_description', $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_name_intern'));
 }
 // code for different field types
 if ($gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_type') === 'CHECKBOX') {
     $form->addCheckbox('usf-' . $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_id'), $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_name'), $user->getValue($field->getValue('usf_name_intern')), array('property' => $fieldProperty, 'helpTextIdLabel' => $helpId, 'icon' => $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_icon', 'database')));
 } elseif ($gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_type') === 'DROPDOWN' || $field->getValue('usf_name_intern') === 'COUNTRY') {
     // set array with values and set default value
     if ($field->getValue('usf_name_intern') === 'COUNTRY') {
         $arrListValues = $gL10n->getCountries();
         $defaultValue = null;
         if ($user->getValue('usr_id') == 0 && strlen($gPreferences['default_country']) > 0) {
             $defaultValue = $gPreferences['default_country'];
         } elseif ($user->getValue('usr_id') > 0 && strlen($user->getValue($field->getValue('usf_name_intern'))) > 0) {
             $defaultValue = $user->getValue($field->getValue('usf_name_intern'), 'database');
         }
     } else {
         $arrListValues = $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_value_list');
         $defaultValue = $user->getValue($field->getValue('usf_name_intern'), 'database');
     }
     $form->addSelectBox('usf-' . $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_id'), $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_name'), $arrListValues, array('property' => $fieldProperty, 'defaultValue' => $defaultValue, 'helpTextIdLabel' => $helpId, 'icon' => $gProfileFields->getProperty($field->getValue('usf_name_intern'), 'usf_icon', 'database')));
Example #12
0
$categoryCreateMenu = $page->getMenu();
$categoryCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
$form = new HtmlForm('categories_edit_form', $g_root_path . '/adm_program/modules/categories/categories_function.php?cat_id=' . $getCatId . '&amp;type=' . $getType . '&amp;mode=1', $page);
// systemcategories should not be renamed
$fieldPropertyCatName = FIELD_REQUIRED;
if ($category->getValue('cat_system') == 1) {
    $fieldPropertyCatName = FIELD_DISABLED;
}
$form->addInput('cat_name', $gL10n->get('SYS_NAME'), $category->getValue('cat_name', 'database'), array('maxLength' => 100, 'property' => $fieldPropertyCatName));
if ($getType === 'USF') {
    // if current organization has a parent organization or is child organizations then show option to set this category to global
    if ($category->getValue('cat_system') == 0 && $gCurrentOrganization->countAllRecords() > 1) {
        // show all organizations where this organization is mother or child organization
        $organizations = '- ' . $gCurrentOrganization->getValue('org_longname') . ',<br />- ';
        $organizations .= implode(',<br />- ', $gCurrentOrganization->getOrganizationsInRelationship(true, true, true));
        $value = 0;
        if ($category->getValue('cat_org_id') == 0) {
            $value = 1;
        }
        $form->addCheckbox('show_in_several_organizations', $gL10n->get('SYS_ENTRY_MULTI_ORGA'), $value, array('helpTextIdLabel' => array('SYS_DATA_GLOBAL', $organizations)));
    }
} else {
    $form->addCheckbox('cat_hidden', $gL10n->get('SYS_VISIBLE_TO_USERS', $getTitle), $category->getValue('cat_hidden'), array('icon' => 'user_key.png'));
}
$form->addCheckbox('cat_default', $gL10n->get('CAT_DEFAULT_VAR', $getTitle), $category->getValue('cat_default'), array('icon' => 'star.png'));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($category->getValue('cat_usr_id_create'), $category->getValue('cat_timestamp_create'), $category->getValue('cat_usr_id_change'), $category->getValue('cat_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Example #13
0
        // add entry to array of all photo albums
        $photoAlbumsArray[$parentPhotoAlbum->getValue('pho_id')] = $vorschub . '&#151; ' . $parentPhotoAlbum->getValue('pho_name') . '&nbsp(' . $parentPhotoAlbum->getValue('pho_begin', 'Y') . ')';
        subfolder($parentPhotoAlbum->getValue('pho_id'), $vorschub, $photoAlbum, $phoId);
    }
    //while
}
//function
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$photoAlbumMenu = $page->getMenu();
$photoAlbumMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
if ($getMode === 'new') {
    $parentAlbumId = $getPhotoId;
} else {
    $parentAlbumId = $photoAlbum->getValue('pho_pho_id_parent');
}
// show form
$form = new HtmlForm('photo_album_edit_form', $g_root_path . '/adm_program/modules/photos/photo_album_function.php?pho_id=' . $getPhotoId . '&amp;mode=' . $getMode, $page);
$form->addInput('pho_name', $gL10n->get('PHO_ALBUM'), $photoAlbum->getValue('pho_name'), array('property' => FIELD_REQUIRED, 'maxLength' => 50));
subfolder(null, '', $photoAlbum, $getPhotoId);
$form->addSelectBox('pho_pho_id_parent', $gL10n->get('PHO_PARENT_ALBUM'), $photoAlbumsArray, array('property' => FIELD_REQUIRED, 'defaultValue' => $parentAlbumId, 'showContextDependentFirstEntry' => false, 'helpTextIdLabel' => array('PHO_PARENT_ALBUM_DESC', $gL10n->get('PHO_PHOTO_ALBUMS'))));
$form->addInput('pho_begin', $gL10n->get('SYS_START'), $photoAlbum->getValue('pho_begin'), array('property' => FIELD_REQUIRED, 'type' => 'date', 'maxLength' => 10));
$form->addInput('pho_end', $gL10n->get('SYS_END'), $photoAlbum->getValue('pho_end'), array('type' => 'date', 'maxLength' => 10));
$form->addInput('pho_photographers', $gL10n->get('PHO_PHOTOGRAPHER'), $photoAlbum->getValue('pho_photographers'), array('maxLength' => 100));
$form->addCheckbox('pho_locked', $gL10n->get('PHO_ALBUM_LOCK'), $photoAlbum->getValue('pho_locked'), array('helpTextIdLabel' => 'PHO_ALBUM_LOCK_DESC'));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($photoAlbum->getValue('pho_usr_id_create'), $photoAlbum->getValue('pho_timestamp_create'), $photoAlbum->getValue('pho_usr_id_change'), $photoAlbum->getValue('pho_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Example #14
0
     while ($row = $gDb->fetch_array($result)) {
         $list[] = array('groupID: ' . $row['rol_id'], $row['rol_name'], '');
     }
 }
 $form->addSelectBox('msg_to', $gL10n->get('SYS_TO'), $list, array('property' => FIELD_REQUIRED, 'showContextDependentFirstEntry' => false, 'multiselect' => true, 'helpTextIdLabel' => 'MAI_SEND_MAIL_TO_ROLE'));
 $form->addLine();
 if ($gCurrentUser->getValue('usr_id') > 0) {
     $form->addInput('name', $gL10n->get('MAI_YOUR_NAME'), $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
     $form->addInput('mailfrom', $gL10n->get('MAI_YOUR_EMAIL'), $gCurrentUser->getValue('EMAIL'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
 } else {
     $form->addInput('name', $gL10n->get('MAI_YOUR_NAME'), $form_values['name'], array('maxLength' => 50, 'property' => FIELD_REQUIRED));
     $form->addInput('mailfrom', $gL10n->get('MAI_YOUR_EMAIL'), $form_values['mailfrom'], array('maxLength' => 50, 'property' => FIELD_REQUIRED));
 }
 // show option to send a copy to your email address only for registered users because of spam abuse
 if ($gValidLogin) {
     $form->addCheckbox('carbon_copy', $gL10n->get('MAI_SEND_COPY'), $form_values['carbon_copy']);
 }
 // if preference is set then show a checkbox where the user can request a delivery confirmation for the email
 if ($gCurrentUser->getValue('usr_id') > 0 && $gPreferences['mail_delivery_confirmation'] == 2 || $gPreferences['mail_delivery_confirmation'] == 1) {
     $form->addCheckbox('delivery_confirmation', $gL10n->get('MAI_DELIVERY_CONFIRMATION'), $form_values['delivery_confirmation']);
 }
 $form->closeGroupBox();
 $form->openGroupBox('gb_mail_message', $gL10n->get('SYS_MESSAGE'));
 $form->addInput('subject', $gL10n->get('MAI_SUBJECT'), $form_values['subject'], array('maxLength' => 77, 'property' => FIELD_REQUIRED));
 // Nur eingeloggte User duerfen Attachments anhaengen...
 if ($gValidLogin && $gPreferences['max_email_attachment_size'] > 0 && ini_get('file_uploads') == '1') {
     $form->addFileUpload('btn_add_attachment', $gL10n->get('MAI_ATTACHEMENT'), array('enableMultiUploads' => true, 'multiUploadLabel' => $gL10n->get('MAI_ADD_ATTACHEMENT'), 'hideUploadField' => true, 'helpTextIdLabel' => array('MAI_MAX_ATTACHMENT_SIZE', Email::getMaxAttachementSize('mb'))));
 }
 // add textfield or ckeditor to form
 if ($gValidLogin == true && $gPreferences['mail_html_registered_users'] == 1) {
     $form->addEditor('msg_body', null, $form_values['msg_body'], array('property' => FIELD_REQUIRED));
Example #15
0
    }
}
$htmlRoleSelection .= '
        </select>
    </div>
    <div class="col-sm-2" style="text-align: center;">
        <br /><br /><br />
        <a class="admidio-icon-link" href="javascript:removeRoles()"><img
            src="' . THEME_PATH . '/icons/back.png" alt="' . $gL10n->get('SYS_REMOVE_ROLE') . '" title="' . $gL10n->get('SYS_REMOVE_ROLE') . '" /></a>
        <a class="admidio-icon-link" href="javascript:addRoles()"><img
            src="' . THEME_PATH . '/icons/forward.png" alt="' . $gL10n->get('SYS_ADD_ROLE') . '" title="' . $gL10n->get('SYS_ADD_ROLE') . '" /></a>
    </div>
    <div class="col-sm-5 form-group">
        <label for="adm_allowed_roles"><img class="admidio-icon-info" src="' . THEME_PATH . '/icons/ok.png" alt="' . $gL10n->get('DOW_ACCESS_ALLOWED') . '" title="' . $gL10n->get('DOW_ACCESS_ALLOWED') . '" />' . $gL10n->get('DOW_ACCESS_ALLOWED') . '</label>
        <select id="adm_allowed_roles" name="AllowedRoles[]" class="form-control" multiple="multiple" size="8" style="max-width: 300px;">';
for ($i = 0; $i < count($roleSet); $i++) {
    $nextRole = $roleSet[$i];
    $htmlRoleSelection .= '<option value="' . $nextRole['rol_id'] . '">' . $nextRole['rol_name'] . '</option>';
}
$htmlRoleSelection .= '
        </select>
    </div>';
$form->addCheckbox('fol_public', $gL10n->get('DOW_NO_PUBLIC_ACCESS'), $checkboxValue, array('property' => $fieldMode, 'helpTextIdLabel' => 'DOW_PUBLIC_DOWNLOAD_FLAG', 'icon' => THEME_PATH . '/icons/lock.png'));
$form->openGroupBox('adm_roles_box', $gL10n->get('DOW_ROLE_ACCESS_PERMISSIONS'));
$form->addDescription($gL10n->get('DOW_ROLE_ACCESS_PERMISSIONS_DESC'));
$form->addCustomContent(null, $htmlRoleSelection);
$form->closeGroupBox();
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();