Exemplo n.º 1
0
    $itemsAdministrationMenu->addItem('menu_item_maintain_inventory_fields', $g_root_path . '/adm_program/modules/inventory/fields.php', $gL10n->get('PRO_MAINTAIN_ITEM_FIELDS'), 'application_form_edit.png');
}
// Create table object
$itemsTable = new HtmlTable('tbl_invent', $page, true, true, 'table table-condensed');
// create array with all column heading values
$columnHeading = array($gL10n->get('SYS_ABR_NO'), $gL10n->get('SYS_NAME'), $gL10n->get('SYS_ROOM'), $gL10n->get('MEM_UPDATED_ON'), ' ');
$itemsTable->setColumnAlignByArray(array('left', 'left', 'left', 'left', 'right'));
$itemsTable->disableDatatablesColumnsSort(5);
$itemsTable->addRowHeadingByArray($columnHeading);
$itemsTable->setDatatablesRowsPerPage($gPreferences['members_users_per_page']);
$itemsTable->setMessageIfNoRowsFound('SYS_NO_ENTRIES');
$irow = 1;
// count for line in table
while ($row = $mglStatement->fetch()) {
    $timestampChange = new DateTimeExtended($row['timestamp'], 'Y-m-d H:i:s');
    $room = new TableRooms($gDb, $row['room_id']);
    $roomLink = $g_root_path . '/adm_program/system/msg_window.php?message_id=room_detail&message_title=DAT_ROOM_INFORMATIONS&message_var1=' . $row['room_id'] . '&inline=true';
    // create array with all column values
    $columnValues = array($irow, '<a href="' . $g_root_path . '/adm_program/modules/inventory/item.php?item_id=' . $row['inv_id'] . '">' . $row['item_name'] . '</a>', '<a class="admidio-icon-link-popup" href="' . $roomLink . '">' . $room->getValue('room_name') . '</a>');
    $columnValues[] = $timestampChange->format($gPreferences['system_date'] . ' ' . $gPreferences['system_time']);
    $itemAdministration = '';
    // Link to modify Item
    $itemAdministration .= '<a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/inventory/item_new.php?item_id=' . $row['inv_id'] . '"><img
                                src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('MEM_EDIT_USER') . '" title="' . $gL10n->get('MEM_EDIT_USER') . '" /></a>';
    // remove Item
    if ($gCurrentUser->isWebmaster()) {
        $itemAdministration .= '<a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/inventory/items_function.php?item_id=' . $row['inv_id'] . '&amp;mode=6"><img
                                    src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('MEM_REMOVE_USER') . '" title="' . $gL10n->get('MEM_REMOVE_USER') . '" /></a>';
    } else {
        $itemAdministration .= '&nbsp;<img class="admidio-icon-link" src="' . THEME_PATH . '/icons/dummy.png" alt="dummy" />';
    }
Exemplo n.º 2
0
             if ($date->getValue('dat_country') !== '') {
                 // With information about country Google finds the location much better
                 $route_url .= ',%20' . $date->getValue('dat_country');
             }
             $outputLinkLocation .= '
                 <a class="admidio-icon-link" href="' . $route_url . '" target="_blank">
                     <img src="' . THEME_PATH . '/icons/map.png" alt="' . $gL10n->get('SYS_SHOW_ROUTE') . '" title="' . $gL10n->get('SYS_SHOW_ROUTE') . '" />
                 </a>';
         }
     } else {
         $outputLinkLocation = $date->getValue('dat_location');
     }
 }
 // if active, then show room information
 if ($date->getValue('dat_room_id') > 0) {
     $room = new TableRooms($gDb, $date->getValue('dat_room_id'));
     if ($getViewMode === 'html') {
         $roomLink = $g_root_path . '/adm_program/system/msg_window.php?message_id=room_detail&amp;message_title=DAT_ROOM_INFORMATIONS&amp;message_var1=' . $date->getValue('dat_room_id') . '&amp;inline=true';
         $outputLinkRoom = '<strong><a data-toggle="modal" data-target="#admidio_modal" href="' . $roomLink . '">' . $room->getValue('room_name') . '</a></strong>';
     } else {
         $outputLinkRoom = $room->getValue('room_name');
     }
 }
 // count participants of the date
 if ($date->getValue('dat_rol_id') > 0) {
     $participants = new Participants($gDb, $date->getValue('dat_rol_id'));
     $outputNumberMembers = $participants->getCount();
     $outputNumberLeaders = $participants->getNumLeaders();
     if ($getView === 'participants') {
         $participantsArray = $participants->getParticipantsArray($date->getValue('dat_rol_id'));
     }
Exemplo n.º 3
0
 // ------------------------------------------------
 if ($gPreferences['dates_show_rooms'] == 1) {
     if ($_POST['dat_room_id'] > 0) {
         $sql = 'SELECT COUNT(dat_id) AS is_reserved
                   FROM ' . TBL_DATES . '
                  WHERE dat_begin  <= \'' . $endDateTime->getDateTimeString() . '\'
                    AND dat_end    >= \'' . $startDateTime->getDateTimeString() . '\'
                    AND dat_room_id = ' . $_POST['dat_room_id'] . '
                    AND dat_id     <> ' . $getDateId;
         $result = $gDb->query($sql);
         $row = $gDb->fetch_object($result);
         if ($row->is_reserved) {
             $gMessage->show($gL10n->get('DAT_ROOM_RESERVED'));
         }
         $date->setValue('dat_room_id', $_POST['dat_room_id']);
         $room = new TableRooms($gDb);
         $room->readDataById($_POST['dat_room_id']);
         $number = intval($room->getValue('room_capacity')) + intval($room->getValue('room_overhang'));
         $date->setValue('dat_max_members', $number);
         if ($_POST['dat_max_members'] < $number && $_POST['dat_max_members'] > 0) {
             $date->setValue('dat_max_members', $_POST['dat_max_members']);
         }
         // Raumname für Benachrichtigung
         $raum = $room->getValue('room_name');
     }
 }
 // write all POST parameters into the date object
 foreach ($_POST as $key => $value) {
     if (strpos($key, 'dat_') === 0) {
         $date->setValue($key, $value);
     }
Exemplo n.º 4
0
$getRoomId = admFuncVariableIsValid($_GET, 'room_id', 'numeric');
$getHeadline = admFuncVariableIsValid($_GET, 'headline', 'string', array('defaultValue' => $gL10n->get('SYS_ROOM')));
// nur berechtigte User duerfen die Profilfelder bearbeiten
if (!$gCurrentUser->isWebmaster()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// set headline of the script
if ($getRoomId > 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 room object
$room = new TableRooms($gDb);
if ($getRoomId > 0) {
    $room->readDataById($getRoomId);
}
if (isset($_SESSION['rooms_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $room->setArray($_SESSION['rooms_request']);
    unset($_SESSION['rooms_request']);
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$roomsMenu = $page->getMenu();
$roomsMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
Exemplo n.º 5
0
 *
 * room_id : ID of room, that should be shown
 * mode :    1 - create or edit room
 *           2 - delete room
 ***********************************************************************************************
 */
require_once '../../system/common.php';
// Initialize and check the parameters
$getRoomId = admFuncVariableIsValid($_GET, 'room_id', 'numeric');
$getMode = admFuncVariableIsValid($_GET, 'mode', 'numeric', array('requireValue' => true));
// nur berechtigte User duerfen die Profilfelder bearbeiten
if (!$gCurrentUser->isWebmaster()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// Raumobjekt anlegen
$room = new TableRooms($gDb);
if ($getRoomId > 0) {
    $room->readDataById($getRoomId);
}
if ($getMode === 1) {
    $_SESSION['rooms_request'] = $_POST;
    if (!array_key_exists('room_name', $_POST) || $_POST['room_name'] === '') {
        $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_ROOM')));
    }
    if (!array_key_exists('room_capacity', $_POST) || $_POST['room_capacity'] === '') {
        $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('ROO_CAPACITY')));
    }
    // make html in description secure
    $_POST['room_description'] = admFuncVariableIsValid($_POST, 'room_description', 'html');
    // POST Variablen in das Termin-Objekt schreiben
    foreach ($_POST as $key => $value) {
Exemplo n.º 6
0
      LEFT JOIN ' . TBL_USERS . ' cre_username
        ON cre_username.usr_id = room_usr_id_create
      LEFT JOIN ' . TBL_USERS . ' cha_username
        ON cha_username.usr_id = room_usr_id_change ';
}
//read rooms from database
$sql = 'SELECT room.*, ' . $additionalFields . '
          FROM ' . TBL_ROOMS . ' room
               ' . $additionalTables . '
         ORDER BY room_name';
$rooms_result = $gDb->query($sql);
if ($gDb->num_rows($rooms_result) == 0) {
    // Keine Räume gefunden
    $page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRIES') . '</p>');
} else {
    $room = new TableRooms($gDb);
    //Räume auflisten
    while ($row = $gDb->fetch_array($rooms_result)) {
        // GB-Objekt initialisieren und neuen DS uebergeben
        $room->clear();
        $room->setArray($row);
        $page->addHtml('
        <div class="panel panel-primary" id="room_' . $room->getValue('room_id') . '">
            <div class="panel-heading">
                <div class="pull-left">
                    <img class="admidio-panel-heading-icon" src="' . THEME_PATH . '/icons/home.png" alt="' . $room->getValue('room_name') . '" />' . $room->getValue('room_name') . '
                </div>
                <div class="pull-right text-right">
                    <a class="admidio-icon-link" href="' . $g_root_path . '/adm_program/modules/rooms/rooms_new.php?room_id=' . $room->getValue('room_id') . '&amp;headline=' . $textRoom . '"><img 
                        src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('SYS_EDIT') . '" title="' . $gL10n->get('SYS_EDIT') . '" /></a>
                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
Exemplo n.º 7
0
    $gNavigation->addStartUrl(CURRENT_URL, $dates->getHeadline($getHeadline));
}
// read all events for output
if ($datesTotalCount != 0) {
    // Initialize counter and object instances
    $count = 0;
    $date = new TableDate($gDb);
    $participants = new Participants($gDb);
    // New array for the participants of a date
    $memberElements = array();
    // Loop date array and add further information in right position of each date.
    foreach ($datesResult['recordset'] as $row) {
        $date->readDataById($row['dat_id']);
        // get avaiable room information
        if ($date->getValue('dat_room_id') > 0) {
            $room = new TableRooms($gDb, $date->getValue('dat_room_id'));
            $datesResult['recordset'][$count]['room_name'] = $room->getValue('room_name');
        }
        // count members and leaders of the date role and push the result to the array
        if ($date->getValue('dat_rol_id') !== null) {
            $datesResult['recordset'][$count]['dat_num_members'] = $participants->getCount($date->getValue('dat_rol_id'));
            $datesResult['recordset'][$count]['dat_num_leaders'] = $participants->getNumLeaders($date->getValue('dat_rol_id'));
        }
        // For print view also read the participants and push the result to the array with index 'dat_rol_id'
        if ($getViewMode === 'print') {
            if ($date->getValue('dat_rol_id') > 0) {
                $memberElements[$date->getValue('dat_rol_id')] = $participants->getParticipantsArray($date->getValue('dat_rol_id'));
            }
        }
        $count++;
    }
Exemplo n.º 8
0
switch ($getMessageId) {
    case 'CAT_CATEGORY_GLOBAL':
        // 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));
        echo $gL10n->get(strtoupper($getMessageId), $organizations);
        break;
    case 'SYS_DATA_GLOBAL':
        // 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));
        echo $gL10n->get(strtoupper($getMessageId), $organizations);
        break;
    case 'room_detail':
        if (is_numeric($getMessageVar1)) {
            $room = new TableRooms($gDb, $getMessageVar1);
            echo '
                <div class="row">
                    <div class="col-xs-4"><strong>' . $gL10n->get('SYS_ROOM') . ':</strong></div>
                    <div class="col-xs-8">' . $room->getValue('room_name') . '</div>
                </div>
                <div class="row">
                    <div class="col-xs-4"><strong>' . $gL10n->get('ROO_CAPACITY') . ':</strong></div>
                    <div class="col-xs-8">' . $room->getValue('room_capacity') . '</div>
                </div>
                <div class="row">
                    <div class="col-xs-4"><strong>' . $gL10n->get('ROO_OVERHANG') . ':</strong></div>
                    <div class="col-xs-8">' . $room->getValue('room_overhang') . '</div>
                </div>
                <div class="row">
                    <div class="col-xs-4"><strong>' . $gL10n->get('SYS_DESCRIPTION') . ':</strong></div>