Exemple #1
0
 /** Display the error code and error message to the user if a database error occurred.
  *  The error must be read by the child method. This method will call a backtrace so
  *  you see the script and specific line in which the error occurred.
  *  @param $code    The database error code that will be displayed.
  *  @param $message The database error message that will be displayed.
  *  @return Will exit the script and returns a html output with the error informations.
  */
 public function db_error($code = 0, $message = '')
 {
     global $g_root_path, $gMessage, $gPreferences, $gCurrentOrganization, $gDebug, $gL10n;
     $htmlOutput = '';
     $backtrace = $this->getBacktrace();
     // Rollback on open transaction
     if ($this->transactions > 0) {
         $this->rollback();
     }
     if (!headers_sent() && isset($gPreferences) && defined('THEME_SERVER_PATH')) {
         // create html page object
         $page = new HtmlPage($gL10n->get('SYS_DATABASE_ERROR'));
     }
     // transform the database error to html
     $error_string = '<div style="font-family: monospace;">
                      <p><b>S Q L - E R R O R</b></p>
                      <p><b>CODE:</b> ' . $code . '</p>
                      ' . $message . '<br /><br />
                      <b>B A C K T R A C E</b><br />
                      ' . $backtrace . '
                      </div>';
     $htmlOutput = $error_string;
     // in debug mode show error in log file
     if ($gDebug === 1) {
         error_log($code . ': ' . $message);
     }
     // display database error to user
     if (!headers_sent() && isset($gPreferences) && defined('THEME_SERVER_PATH')) {
         $page->addHtml($htmlOutput);
         $page->show();
     } else {
         echo $htmlOutput;
     }
     exit;
 }
Exemple #2
0
function Generate_Picker($channel)
{
    $html = "<div class=filter>\n";
    $html .= "  <b>Filter:</b><br>\n";
    $html .= "  <form>\n";
    $StartDate = date("m/d/Y");
    if (isset($_GET["start"])) {
        $StartDate = $_GET["start"];
    }
    $FinishDate = date("m/d/Y");
    if (isset($_GET["end"])) {
        $FinishDate = $_GET["end"];
    }
    $picker = new HtmlTable();
    $picker->InsertRow(array("Start date", "<input id='datepicker' value=\"{$StartDate}\" name='start'>"));
    $picker->BorderSize = 0;
    $picker->InsertRow(array("End date", "<input id='datepicker2' value=\"{$FinishDate}\" name='end'>"));
    $show = "";
    if (isset($_GET['data'])) {
        $show = "checked=on ";
    }
    $checked = "";
    if (isset($_GET['wiki'])) {
        $checked = "checked=on ";
    }
    $picker->InsertRow(array("", "<label><input " . $checked . "type='checkbox' value='true' name='wiki'>Convert to wiki text</label>"));
    $picker->InsertRow(array("", "<label><input " . $show . "type='checkbox' value='true' name='data'>Show part / join / quit / kick / nick</label>"));
    $html .= HtmlPage::IndentText($picker->ToHtml(), 4);
    $html .= "<input type='submit' value='Display'><input type='hidden' name='display' value=\"{$channel}\"></form>\n</div>\n";
    return $html;
}
    function generateUserMenu()
    {
        $menu = HtmlPage::generateSubMenu();
        $menu .= '
            <li ' . ($this->startswith($this->id, 'exercises/my_propose_list') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('exercises/my_propose_list') . '/">' . _('My proposed exercises') . '</a></li>

            ';
        return $menu;
    }
 function generateSubMenu()
 {
     $menu = HtmlPage::generateSubMenu();
     $menu .= '
         <li ' . ($this->startswith($this->id, 'documentation/installation') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/installation/index') . '/">' . _('Installation') . '</a></li>
         <li ' . ($this->startswith($this->id, 'documentation/use') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/use/index') . '/">' . _('Use perroquet') . '</a></li>
         <li ' . ($this->startswith($this->id, 'documentation/help') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/help/index') . '/">' . _('Help tools') . '</a></li>
         <li ' . ($this->startswith($this->id, 'documentation/repositories') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/repositories/index') . '/">' . _('Reporitories') . '</a></li>
         <li ' . ($this->startswith($this->id, 'documentation/exercise_creation') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/exercise_creation/index') . '/">' . _('Exercise creation') . '</a></li>
         <li ' . ($this->startswith($this->id, 'documentation/development') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/development/index') . '/">' . _('Development') . '</a></li>
         ';
     return $menu;
 }
Exemple #5
0
    $photoAlbum =& $_SESSION['photo_album'];
    $photoAlbum->db =& $gDb;
} else {
    $photoAlbum = new TablePhotos($gDb, $getPhotoId);
    $_SESSION['photo_album'] =& $photoAlbum;
}
// check if album belongs to current organization
if ($photoAlbum->getValue('pho_org_shortname') != $gCurrentOrganization->getValue('org_shortname')) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
if ($getMode == 'choose_files') {
    // delete old stuff in upload folder
    $uploadFolder = new Folder(SERVER_PATH . '/adm_my_files/photos/upload');
    $uploadFolder->delete('', true);
    // create html page object
    $page = new HtmlPage();
    $page->hideThemeHtml();
    $page->hideMenu();
    $page->addCssFile($g_root_path . '/adm_program/libs/jquery-file-upload/css/jquery.fileupload.css');
    $page->addJavascriptFile($g_root_path . '/adm_program/libs/jquery-file-upload/js/vendor/jquery.ui.widget.js');
    $page->addJavascriptFile($g_root_path . '/adm_program/libs/jquery-file-upload/js/jquery.iframe-transport.js');
    $page->addJavascriptFile($g_root_path . '/adm_program/libs/jquery-file-upload/js/jquery.fileupload.js');
    $page->addJavascript('
    var countErrorFiles = 0;
    
    $(function () {
        "use strict";
        $("#fileupload").fileupload({
            url: "photoupload.php?mode=upload_files&pho_id=' . $getPhotoId . '",
            sequentialUploads: true,
            dataType: "json",
Exemple #6
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();
 */
require "auth.php";
if (!defined("LOCALE_LIBRARY")) {
    include LIBRARY_PATH . "locale.library";
}
if (!defined("OOPHTML_LIBRARY")) {
    include LIBRARY_PATH . "oophtml.library";
}
if (!defined("ADMINGUI_LIBRARY")) {
    include LIBRARY_PATH . "admingui.library";
}
if (!defined("MODULES_LIBRARY")) {
    include LIBRARY_PATH . "modules.library";
}
$adloc = new Locale("xmlrpcgateway", AMP_LOCALE);
$page = new HtmlPage($adloc->GetStr("title"));
$page->add(pagecaption($adloc->GetStr("title")));
$modcfg = new moduleconfig($env["ampdb"], "xmlrpcgateway");
switch ($env["disp"]["pass"]) {
    case "setcfg":
        $modcfg->setkey("DEST_HOST", $env["disp"]["desthost"]);
        $modcfg->setkey("DEST_PORT", $env["disp"]["destport"]);
        $modcfg->setkey("DEST_CGI", $env["disp"]["destcgi"]);
        break;
}
switch ($env["disp"]["act"]) {
    case "def":
        $table[0][0] = new htmltext($adloc->GetStr("hostdesc"));
        $table[1][0] = new htmlformtext("", "desthost", $modcfg->getkey("DEST_HOST"), "", 20);
        $table[0][1] = new htmltext($adloc->GetStr("hostnote"));
        $table[0][1]->colspan = 2;
            LEFT JOIN ' . TBL_USER_DATA . ' as country
              ON country.usd_usr_id = usr_id
             AND country.usd_usf_id = ' . $gProfileFields->getProperty('COUNTRY', 'usf_id') . '
            LEFT JOIN ' . TBL_ROLES . ' rol
              ON rol.rol_valid   = 1
             AND rol.rol_id      = ' . $getRoleId . '
            LEFT JOIN ' . TBL_MEMBERS . ' mem
              ON mem.mem_rol_id  = rol.rol_id
             AND mem.mem_begin  <= \'' . DATE_NOW . '\'
             AND mem.mem_end     > \'' . DATE_NOW . '\'
             AND mem.mem_usr_id  = usr_id
            WHERE ' . $memberCondition . '
            ORDER BY last_name, first_name ';
    $userStatement = $gDb->query($sql);
    // create html page object
    $page = new HtmlPage($headline);
    $page->enableModal();
    $javascriptCode = '';
    if ($getMembersShowAll == 1) {
        $javascriptCode .= '$("#mem_show_all").prop("checked", true);';
    }
    $javascriptCode .= '
        $("#menu_item_create_user").attr("data-toggle", "modal");
        $("#menu_item_create_user").attr("data-target", "#admidio_modal");

        // change mode of users that should be shown
        $("#filter_rol_id").change(function() {
            window.location.replace("' . $g_root_path . '/adm_program/modules/lists/members_assignment.php?rol_id=' . $getRoleId . '&filter_rol_id=" + $("#filter_rol_id").val() + "&mem_show_all=0");
        });

        // change mode of users that should be shown
Exemple #9
0
 * License      : GNU Public License 2 http://www.gnu.org/licenses/gpl-2.0.html
 *
 ****************************************************************************/
require_once '../../system/common.php';
require_once '../../system/login_valid.php';
// only webmasters are allowed to manage rooms
if (!$gCurrentUser->isWebmaster()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
unset($_SESSION['rooms_request']);
$headline = $gL10n->get('ROO_ROOM_MANAGEMENT');
$textRoom = $gL10n->get('SYS_ROOM');
// Navigation weiterfuehren
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// get module menu
$roomsMenu = $page->getMenu();
// show back link
$roomsMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show link to create new room
$roomsMenu->addItem('menu_item_new_room', $g_root_path . '/adm_program/modules/rooms/rooms_new.php?headline=' . $textRoom, $gL10n->get('SYS_CREATE_VAR', $textRoom), 'add.png');
if ($gPreferences['system_show_create_edit'] == 1) {
    // show firstname and lastname of create and last change user
    $additionalFields = '
        cre_firstname.usd_value || \' \' || cre_surname.usd_value as create_name,
        cha_firstname.usd_value || \' \' || cha_surname.usd_value as change_name ';
    $additionalTables = '
      LEFT JOIN ' . TBL_USER_DATA . ' cre_surname
        ON cre_surname.usd_usr_id = room_usr_id_create
       AND cre_surname.usd_usf_id = ' . $gProfileFields->getProperty('LAST_NAME', 'usf_id') . '
Exemple #10
0
}
// set headline of the script
if ($currentFolder->getValue('fol_fol_id_parent') == null) {
    $headline = $gL10n->get('DOW_DOWNLOADS');
} else {
    $headline = $gL10n->get('DOW_DOWNLOADS') . ' - ' . $currentFolder->getValue('fol_name');
}
// Navigation of the module starts here
$gNavigation->addStartUrl(CURRENT_URL, $headline);
$getFolderId = $currentFolder->getValue('fol_id');
// Get folder content for style
$folderContent = $currentFolder->getFolderContentsForDownload();
// Keep navigation link
$navigationBar = $currentFolder->getNavigationForDownload();
// create html page object
$page = new HtmlPage($headline);
// get module menu
$DownloadsMenu = $page->getMenu();
if ($gCurrentUser->editDownloadRight()) {
    // upload only possible if upload filesize > 0
    if ($gPreferences['max_file_upload_size'] > 0) {
        // show links for upload, create folder and folder configuration
        $DownloadsMenu->addItem('admMenuItemCreateFolder', $g_root_path . '/adm_program/modules/downloads/folder_new.php?folder_id=' . $getFolderId, $gL10n->get('DOW_CREATE_FOLDER'), 'folder_create.png');
        $DownloadsMenu->addItem('admMenuItemAddFile', $g_root_path . '/adm_program/modules/downloads/upload.php?folder_id=' . $getFolderId, $gL10n->get('DOW_UPLOAD_FILE'), 'page_white_upload.png');
    }
    $DownloadsMenu->addItem('admMenuItemConfigFolder', $g_root_path . '/adm_program/modules/downloads/folder_config.php?folder_id=' . $getFolderId, $gL10n->get('SYS_AUTHORIZATION'), 'lock.png');
}
if ($gCurrentUser->isWebmaster()) {
    // show link to system preferences of weblinks
    $DownloadsMenu->addItem('admMenuItemPreferencesLinks', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=downloads', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right');
}
Exemple #11
0
    if (strlen($inventory->getValue($fieldNameIntern)) > 0 || $gInventoryFields->getProperty($fieldNameIntern, 'inf_type') === 'CHECKBOX') {
        $html['label'] = $gInventoryFields->getProperty($fieldNameIntern, 'inf_name');
        $html['value'] = $value;
    }
    return $html;
}
unset($_SESSION['profile_request']);
// set headline
$headline = $gL10n->get('PRO_PROFILE_FROM', $inventory->getValue('ITEM_NAME'));
// if user id was not set and own profile should be shown then initialize navigation
if (!isset($_GET['item_id'])) {
    $gNavigation->clear();
}
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
$page->addCssFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/css/datepicker3.css');
$page->addJavascriptFile($g_root_path . '/adm_program/modules/profile/profile.js');
$page->addJavascriptFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/js/bootstrap-datepicker.js');
$page->addJavascriptFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/js/locales/bootstrap-datepicker.' . $gPreferences['system_language'] . '.js');
$page->addJavascript('
    var profileJS = new profileJSClass();
    profileJS.deleteRole_ConfirmText    = "' . $gL10n->get('ROL_MEMBERSHIP_DEL', '[rol_name]') . '";
    profileJS.deleteFRole_ConfirmText   = "' . $gL10n->get('ROL_LINK_MEMBERSHIP_DEL', '[rol_name]') . '";
    profileJS.setBy_Text                = "' . $gL10n->get('SYS_SET_BY') . '";
    profileJS.inv_id                    = ' . $inventory->getValue('inv_id') . ';

    function showHideMembershipInformation(element) {
        id = "#" + element.attr("id") + "_Content";

        if($(id).css("display") === "none") {
        // Jede Rolle wird nun dem Array hinzugefuegt
        $parentRoleSet[] = array($row_roles->rol_id, $row_roles->rol_name, $row_roles->cat_name);
    }
} else {
    // create new array with numeric keys for logic of method addSelectBox
    $newParentRoleSet = array();
    foreach ($parentRoleSet as $role) {
        $newParentRoleSet[] = array($role['rol_id'], $role['rol_name'], null);
    }
    $parentRoleSet = $newParentRoleSet;
}
// get assigned roles of this folder
$roleSet = $folder->getRoleArrayOfFolder();
// if no roles are assigned then set "all users" as default
if (count($roleSet) === 0) {
    $roleSet[] = 0;
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
// @ptabaden: Changed Icon
$folderConfigMenu = $page->getMenu();
$folderConfigMenu->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_ROLE_ACCESS_PERMISSIONS_DESC', $folder->getValue('fol_name')) . '</p>');
// show form
$form = new HtmlForm('folder_rights_form', $g_root_path . '/adm_program/modules/downloads/download_function.php?mode=7&amp;folder_id=' . $getFolderId, $page);
$form->addSelectBox('adm_allowed_roles', $gL10n->get('DAT_VISIBLE_TO'), $parentRoleSet, array('property' => FIELD_REQUIRED, 'defaultValue' => $roleSet, 'multiselect' => true));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
 * @copyright 2004-2016 The Admidio Team
 * @see http://www.admidio.org/
 * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 only
 ***********************************************************************************************
 */
// if config file doesn't exists, than show installation dialog
if (!file_exists('../adm_my_files/config.php')) {
    header('Location: installation/index.php');
    exit;
}
require_once 'system/common.php';
$headline = 'Platzhalter Startseite';
// Navigation of the module starts here
$gNavigation->addStartUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// main menu of the page
$mainMenu = $page->getMenu();
if ($gValidLogin) {
    // show link to own profile
    $mainMenu->addItem('adm_menu_item_my_profile', $g_root_path . '/adm_program/modules/profile/profile.php', $gL10n->get('PRO_MY_PROFILE'), 'profile.png');
    // show logout link
    $mainMenu->addItem('adm_menu_item_logout', $g_root_path . '/adm_program/system/logout.php', $gL10n->get('SYS_LOGOUT'), 'door_in.png');
} else {
    // show login link
    $mainMenu->addItem('adm_menu_item_login', $g_root_path . '/adm_program/system/login.php', $gL10n->get('SYS_LOGIN'), 'key.png');
    if ($gPreferences['registration_mode'] > 0) {
        // show registration link
        $mainMenu->addItem('adm_menu_item_registration', $g_root_path . '/adm_program/modules/registration/registration.php', $gL10n->get('SYS_REGISTRATION'), 'new_registrations.png');
    }
}
Exemple #14
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
require_once '/data/project/hgztools/public_html/general.php';
// create new page object
$page = new HtmlPage('Wikidata-Auszeichnungs-Abgleich');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'mode', '', '/^(lesenswert|exzellent|informativ|portal)$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->addInline('p', 'Mit diesem Werkzeug lassen sich Unterschiede zwischen den lokalen Auszeichnungsvorlagen und den Daten auf Wikidata feststellen.');
$page->addInline('h2', 'Optionen');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('mode', 'Kategorie');
$optionForm->addHTML('</td><td>');
Exemple #15
0
<?php

$HtmlPage = new HtmlPage();
$HtmlPage->PrintHeaderExt();
?>
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="src/static/css/messages.css">
    </head>
    <body>
    <div class="error">Was not able to get the Project ID. Please contact your REDCap Administrator.</div>
    </body>
    </html>
<?php 
$HtmlPage->PrintFooterExt();
ob_end_flush();
exit;
Exemple #16
0
}
// Initialize and check the parameters
$getStart = admFuncVariableIsValid($_GET, 'start', 'numeric');
$getHeadline = admFuncVariableIsValid($_GET, 'headline', 'string', array('defaultValue' => $gL10n->get('GBO_GUESTBOOK')));
$getGboId = admFuncVariableIsValid($_GET, 'id', 'numeric');
$getModeration = admFuncVariableIsValid($_GET, 'moderation', 'boolean');
if ($getModeration == 1 && !$gCurrentUser->editGuestbookRight()) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
// Navigation faengt hier im Modul an, wenn keine Eintrag direkt aufgerufen wird
if ($getGboId == 0) {
    $gNavigation->clear();
}
$gNavigation->addUrl(CURRENT_URL);
// create html page object
$page = new HtmlPage();
$page->enableModal();
// add rss feed to guestbook
if ($gPreferences['enable_rss'] == 1) {
    $page->addRssFile($g_root_path . '/adm_program/modules/guestbook/rss_guestbook.php?headline=' . $getHeadline, $gL10n->get('SYS_RSS_FEED_FOR_VAR', $gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline));
}
$page->addJavascript('
    function getComments(commentId) {
        // RequestObjekt abschicken und Kommentar laden
        $.get("' . $g_root_path . '/adm_program/modules/guestbook/get_comments.php?cid=" + commentId + "&moderation=" + ' . $getModeration . ',
        function(data) {
            $("#comments_" + commentId).html(data);
        });
    }

    function toggleComments(commentId) {
if (!$gCurrentUser->isWebmaster()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// Initialize and check the parameters
$getStsId = admFuncVariableIsValid($_GET, 'sts_id', 'numeric');
$headline = 'Startseite editieren';
// add current url to navigation stack
$gNavigation->addUrl(CURRENT_URL, $headline);
// Create announcements object
$sts = new TableSts($gDb);
if ($getStsId > 0) {
    $sts->readDataById($getStsId);
}
if (isset($_SESSION['sts_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $sts->setArray($_SESSION['sts_request']);
    unset($_SESSION['sts_request']);
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$stsMenu = $page->getMenu();
$stsMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
$form = new HtmlForm('sts_edit_form', $g_root_path . '/adm_plugins/sts_plugin/sts_save.php?sts_id=' . $getStsId . '&amp;headline=' . $headline . '&amp', $page);
$form->addEditor('sts_description', $headline, $sts->getValue('sts_description'), array('property' => FIELD_REQUIRED));
$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();
    $delMessage = new TableMessage($gDb, $getMsgId);
    // Function to delete message
    $delete = $delMessage->delete();
    if ($delete) {
        echo 'done';
    } else {
        echo 'delete not OK';
    }
    exit;
}
$headline = $gL10n->get('SYS_MESSAGES');
// add current url to navigation stack
$gNavigation->clear();
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
$page->enableModal();
// get module menu for emails
$EmailMenu = $page->getMenu();
// link to write new email
if ($gPreferences['enable_mail_module'] == 1) {
    // @ptabaden: changed icon
    $EmailMenu->addItem('admMenuItemNewEmail', $g_root_path . '/adm_program/modules/messages/messages_write.php', '<i class="fa fa-pencil-square-o" alt="' . $gL10n->get('MAI_SEND_EMAIL') . '" title="' . $gL10n->get('MAI_SEND_EMAIL') . '"></i><div class="iconDescription">' . $gL10n->get('MAI_SEND_EMAIL') . '</div>', '');
}
// link to write new PM
if ($gPreferences['enable_pm_module'] == 1) {
    $EmailMenu->addItem('admMenuItemNewPm', $g_root_path . '/adm_program/modules/messages/messages_write.php?msg_type=PM', $gL10n->get('PMS_SEND_PM'), '/pm.png');
}
// link to Chat
// @ptabaden: hide chat!
// if ($gPreferences['enable_chat_module'] == 1)
Exemple #19
0
}
// Number of events each page for default view 'html' or 'compact' view
if ($gPreferences['dates_per_page'] > 0 && $getViewMode === 'html') {
    $datesPerPage = $gPreferences['dates_per_page'];
} else {
    $datesPerPage = $dates->getDataSetCount();
}
// read relevant events from database
$datesResult = $dates->getDataset($getStart, $datesPerPage);
$datesTotalCount = $dates->getDataSetCount();
if ($getViewMode !== 'print' && $getId === 0) {
    // Navigation of the module starts here
    $gNavigation->addStartUrl(CURRENT_URL, $dates->getHeadline($getHeadline));
}
// create html page object
$page = new HtmlPage($dates->getHeadline($getHeadline));
$page->enableModal();
if ($getViewMode === 'html') {
    $datatable = true;
    $hoverRows = true;
    $classTable = 'table';
    if ($gPreferences['enable_rss'] == 1 && $gPreferences['enable_dates_module'] == 1) {
        $page->addRssFile($g_root_path . '/adm_program/modules/dates/rss_dates.php?headline=' . $getHeadline, $gL10n->get('SYS_RSS_FEED_FOR_VAR', $gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline));
    }
    $page->addJavascript('
        $("#sel_change_view").change(function () {
            self.location.href = "dates.php?view=" + $("#sel_change_view").val() + "&mode=' . $getMode . '&headline=' . $getHeadline . '&date_from=' . $dates->getParameter('dateStartFormatAdmidio') . '&date_to=' . $dates->getParameter('dateEndFormatAdmidio') . '&cat_id=' . $getCatId . '";
        });

        $("#menu_item_print_view").click(function () {
            window.open("' . $g_root_path . '/adm_program/modules/dates/dates.php?view_mode=print&view=' . $getView . '&mode=' . $getMode . '&headline=' . $getHeadline . '&cat_id=' . $getCatId . '&date_from=' . $dates->getParameter('dateStartFormatEnglish') . '&date_to=' . $dates->getParameter('dateEndFormatEnglish') . '", "_blank");
Exemple #20
0
     $pdf->SetHeaderMargin(10);
     $pdf->SetFooterMargin(0);
     // headline for PDF
     $pdf->SetHeaderData('', '', $headline, '');
     // set font
     $pdf->SetFont('times', '', 10);
     // add a page
     $pdf->AddPage();
     // Create table object for display
     $table = new HtmlTable('adm_lists_table', $pdf, $hoverRows, $datatable, $classTable);
     $table->addAttribute('border', '1');
 } elseif ($getMode === 'html') {
     $datatable = true;
     $hoverRows = true;
     // create html page object
     $page = new HtmlPage();
     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));
$usrStatement = $gDb->query($sql);
$members_found = $usrStatement->rowCount();
// if current user can edit profiles than create link to profile otherwise create link to auto assign new registration
if ($gCurrentUser->editUsers()) {
    $urlCreateNewUser = $g_root_path . '/adm_program/modules/profile/profile_new.php?new_user=3&user_id=' . $getNewUserId;
} else {
    $urlCreateNewUser = $g_root_path . '/adm_program/modules/registration/registration_function.php?mode=5&new_user_id=' . $getNewUserId;
}
if ($members_found === 0) {
    // if user doesn't exists than show profile or auto assign roles
    header('Location: ' . $urlCreateNewUser);
    exit;
}
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$registrationAssignMenu = $page->getMenu();
$registrationAssignMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
$page->addHtml('
    <p class="lead">' . $gL10n->get('SYS_SIMILAR_USERS_FOUND', $new_user->getValue('FIRST_NAME') . ' ' . $new_user->getValue('LAST_NAME')) . '</p>
    <div class="panel panel-default">
        <div class="panel-heading">' . $gL10n->get('SYS_USERS_FOUND') . '</div>
        <div class="panel-body">');
// show all found users with their address who have a similar name and show link for further handling
$i = 0;
while ($row = $usrStatement->fetchObject()) {
    if ($i > 0) {
        $page->addHtml('<hr />');
    }
    $page->addHtml('<p>
Exemple #22
0
$gInventoryFields = new InventoryFields($gDb, $gCurrentOrganization->getValue('org_id'));
// alle Items zur Auswahl selektieren
$sql = 'SELECT inv_id, item_name.ind_value as item_name, room_id.ind_value as room_id,
               COALESCE(inv_timestamp_change, inv_timestamp_create) as timestamp
          FROM ' . TBL_INVENT . '
    INNER JOIN ' . TBL_INVENT_DATA . ' as item_name
            ON item_name.ind_itm_id = inv_id
           AND item_name.ind_inf_id = ' . $gInventoryFields->getProperty('ITEM_NAME', 'inf_id') . '
    INNER JOIN ' . TBL_INVENT_DATA . ' as room_id
            ON room_id.ind_itm_id = inv_id
           AND room_id.ind_inf_id = ' . $gInventoryFields->getProperty('ROOM_ID', 'inf_id') . '
         WHERE inv_valid = 1
      ORDER BY item_name.ind_value, room_id.ind_value ';
$mglStatement = $gDb->query($sql);
// create html page object
$page = new HtmlPage($headline);
$page->addJavascript('
        $(".admidio-icon-link-popup").colorbox({rel:\'nofollow\', scrolling:false, onComplete:function() { $("#admButtonNo").focus(); }});
        ', true);
// get module menu
$itemsAdministrationMenu = $page->getMenu();
$itemsAdministrationMenu->addItem('menu_item_create_user', $g_root_path . '/adm_program/modules/inventory/item_new.php', $gL10n->get('INV_CREATE_ITEM'), 'add.png');
// show link to room management
$itemsAdministrationMenu->addItem('menu_item_manage_rooms', $g_root_path . '/adm_program/modules/rooms/rooms.php', $gL10n->get('DAT_SWITCH_TO_ROOM_ADMINISTRATION'), 'home.png');
if ($gCurrentUser->isWebmaster()) {
    // show link to maintain profile fields
    $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
Exemple #23
0
 * @copyright 2004-2015 The Admidio Team
 * @see http://www.admidio.org/
 * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 only
 ***********************************************************************************************
 */
// if config file doesn't exists, than show installation dialog
if (!file_exists('../adm_my_files/config.php')) {
    header('Location: installation/index.php');
    exit;
}
require_once 'system/common.php';
$headline = 'Admidio ' . $gL10n->get('SYS_OVERVIEW');
// Navigation of the module starts here
$gNavigation->addStartUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// main menu of the page
$mainMenu = $page->getMenu();
if ($gValidLogin) {
    // show link to own profile
    $mainMenu->addItem('adm_menu_item_my_profile', $g_root_path . '/adm_program/modules/profile/profile.php', $gL10n->get('PRO_MY_PROFILE'), 'profile.png');
    // show logout link
    $mainMenu->addItem('adm_menu_item_logout', $g_root_path . '/adm_program/system/logout.php', $gL10n->get('SYS_LOGOUT'), 'door_in.png');
} else {
    // show login link
    $mainMenu->addItem('adm_menu_item_login', $g_root_path . '/adm_program/system/login.php', $gL10n->get('SYS_LOGIN'), 'key.png');
    if ($gPreferences['registration_mode'] > 0) {
        // show registration link
        $mainMenu->addItem('adm_menu_item_registration', $g_root_path . '/adm_program/modules/registration/registration.php', $gL10n->get('SYS_REGISTRATION'), 'new_registrations.png');
    }
}
$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();
Exemple #25
0
     $user_image->copyToFile(null, $_FILES['userfile']['tmp_name'][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();
Exemple #26
0
        $gMessage->show($gL10n->get('SYS_USER_NO_EMAIL', $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME')));
    }
}
if (isset($_SESSION['ecard_request'])) {
    // if user is returned to this form after he submit it,
    // then try to restore all values that he has entered before
    $template = $_SESSION['ecard_request']['ecard_template'];
    $recipients = $_SESSION['ecard_request']['ecard_recipients'];
    $message = $_SESSION['ecard_request']['ecard_message'];
} else {
    $template = $gPreferences['ecard_template'];
    $recipients = null;
    $message = '';
}
// create html page object
$page = new HtmlPage($headline);
$page->enableModal();
$page->addJavascriptFile('adm_program/libs/lightbox/ekko-lightbox.min.js');
$page->addJavascript('
    $(document).delegate("*[data-toggle=\\"lightbox\\"]", "click", function(event) { event.preventDefault(); $(this).ekkoLightbox(); });

    $("#admidio_modal").on("show.bs.modal", function () {
        $(this).find(".modal-dialog").css({width: "800px"});
    });

    $("#btn_ecard_preview").click(function(event) {
        event.preventDefault();
        $("#ecard_form input[id=\'submit_action\']").val("preview");
        $("#ecard_form textarea[name=\'ecard_message\']").text( CKEDITOR.instances.ecard_message.getData() );

        $.ajax({ // create an AJAX call...
Exemple #27
0
if (isset($_SESSION['links_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $link->setArray($_SESSION['links_request']);
    unset($_SESSION['links_request']);
}
// 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'));
Exemple #28
0
        $defaultColumnRows = $list->countColumns();
        for ($number = 1; $number <= $list->countColumns(); ++$number) {
            $column = $list->getColumnObject($number);
            if ($column->getValue('lsc_usf_id') > 0) {
                $column_content = $column->getValue('lsc_usf_id');
            } else {
                $column_content = $column->getValue('lsc_special_field');
            }
            $formValues['column' . $number] = $column_content;
            $formValues['sort' . $number] = $column->getValue('lsc_sort');
            $formValues['condition' . $number] = $column->getValue('lsc_filter');
        }
    }
}
// create html page object
$page = new HtmlPage($headline);
$page->enableModal();
$javascriptCode = '
    var listId             = ' . $getListId . ';
    var fieldNumberIntern  = 0;
    var arr_user_fields    = createProfileFieldsArray();
    var arr_default_fields = createColumnsArray();

    // Funktion fuegt eine neue Zeile zum Zuordnen von Spalten fuer die Liste hinzu
    function addColumn()
    {
        // MySQL erlaubt nur 61 gejointe Tabellen
        if(fieldNumberIntern >= 57)
        {
            alert("' . $gL10n->get('LST_NO_MORE_COLUMN') . '");
            return;
        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;
}
Exemple #30
0
    }
} else {
    $role->setValue('rol_this_list_view', '1');
    $role->setValue('rol_mail_this_role', '2');
}
if (isset($_SESSION['roles_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $role->setArray($_SESSION['roles_request']);
    unset($_SESSION['roles_request']);
}
// holt eine Liste der ausgewaehlten abhaengigen Rolen
$childRoles = RoleDependency::getChildRoles($gDb, $getRoleId);
$childRoleObjects = array();
// create html page object
$page = new HtmlPage($headline);
$page->addJavascript('
    checkMaxMemberCount();
    $("#rol_assign_roles").change(function() {
        markRoleRight("rol_assign_roles", "rol_all_lists_view", true);
    });
    $("#rol_all_lists_view").change(function() {
        markRoleRight(\'rol_all_lists_view\', \'rol_assign_roles\', false);
    });
    $("#rol_max_members").change(function() {
        checkMaxMemberCount();
    });', true);
$page->addJavascript('
    // show/hide role dependencies if max count members will be changed
    function checkMaxMemberCount() {
        // Wenn eine Maximale Mitgliederzahl angeben wurde, duerfen keine Rollenabhaengigkeiten bestehen