$gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
} elseif ($getType === 'LNK' && !$gCurrentUser->editWeblinksRight()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
} elseif ($getType === 'USF' && !$gCurrentUser->editUsers()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
} elseif ($getType === 'DAT' && !$gCurrentUser->editDates()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
} elseif ($getType === 'AWA' && !$gCurrentUser->editUsers()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// create category object
$category = new TableCategory($gDb);
if ($getCatId > 0) {
    $category->readDataById($getCatId);
    // check if category belongs to actual organization
    if ($category->getValue('cat_org_id') > 0 && $category->getValue('cat_org_id') != $gCurrentOrganization->getValue('org_id')) {
        $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
    }
    // if system category then set cat_name to default
    if ($category->getValue('cat_system') == 1) {
        $_POST['cat_name'] = $category->getValue('cat_name');
    }
} else {
    // create a new category
    $category->setValue('cat_org_id', $gCurrentOrganization->getValue('org_id'));
    $category->setValue('cat_type', $getType);
}
if ($getMode === 1) {
    // Kategorie anlegen oder updaten
    $_SESSION['categories_request'] = $_POST;
    if ((!array_key_exists('cat_name', $_POST) || $_POST['cat_name'] === '') && $category->getValue('cat_system') == 0) {
Example #2
0
}
//create Object
$dates = new ModuleDates();
// get parameters fom $_GET Array stored in class
$parameter = $dates->getParameters();
// set mode, viewmode, startdate and enddate manually
$parameter['mode'] = 2;
$parameter['view_mode'] = 'period';
$parameter['date_from'] = date('Y-m-d', time() - $gPreferences['dates_ical_days_past'] * 86400);
$parameter['date_to'] = date('Y-m-d', time() + $gPreferences['dates_ical_days_future'] * 86400);
// read events for output
$datesResult = $dates->getDataset();
//Headline für Dateinamen
if ($dates->getCatId() > 0) {
    $calendar = new TableCategory($gDb, $dates->getCatId());
    $getHeadline .= '_' . $calendar->getValue('cat_name');
}
$date = new TableDate($gDb);
$iCal = $date->getIcalHeader();
if ($datesResult['numResults'] > 0) {
    $date = new TableDate($gDb);
    foreach ($datesResult['recordset'] as $row) {
        $date->clear();
        $date->setArray($row);
        $iCal .= $date->getIcalVEvent($_SERVER['HTTP_HOST']);
    }
}
$iCal .= $date->getIcalFooter();
if ($parameter['mode'] == 2) {
    // for IE the filename must have special chars in hexadecimal
    if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
Example #3
0
$categoriesOverview->addRowHeadingByArray($columnHeading);
$sql = 'SELECT *
          FROM ' . TBL_CATEGORIES . '
         WHERE (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
               OR cat_org_id IS NULL )
           AND cat_type   = \'' . $getType . '\'
      ORDER BY cat_sequence ASC';
$categoryStatement = $gDb->query($sql);
$flagTbodyWritten = false;
$flagTbodyAllOrgasWritten = false;
$category = new TableCategory($gDb);
// Get data
while ($cat_row = $categoryStatement->fetch()) {
    $category->clear();
    $category->setArray($cat_row);
    if ($category->getValue('cat_system') == 1 && $getType === 'USF') {
        // da bei USF die Kategorie Stammdaten nicht verschoben werden darf, muss hier ein bischen herumgewurschtelt werden
        $categoriesOverview->addTableBody('id', 'cat_' . $category->getValue('cat_id'));
    } elseif ($category->getValue('cat_org_id') == 0 && $getType === 'USF') {
        // Kategorien über alle Organisationen kommen immer zuerst
        if (!$flagTbodyAllOrgasWritten) {
            $flagTbodyAllOrgasWritten = true;
            $categoriesOverview->addTableBody('id', 'cat_all_orgas');
        }
    } else {
        if (!$flagTbodyWritten) {
            $flagTbodyWritten = true;
            $categoriesOverview->addTableBody('id', 'cat_list');
        }
    }
    $htmlMoveRow = ' ';
Example #4
0
 /**
  * Returns a module specific headline
  * @param  string $headline The initial headline of the module.
  * @return string Returns the full headline of the module
  */
 public function getHeadline($headline)
 {
     global $gL10n, $gCurrentOrganization, $gDb;
     // set headline with category name
     if ($this->getParameter('cat_id') > 0) {
         $category = new TableCategory($gDb, $this->getParameter('cat_id'));
         $headline .= ' - ' . $category->getValue('cat_name');
     }
     // check time period if old dates are chosen, then set headline to previous dates
     // Define a prefix
     if ($this->getParameter('dateStartFormatEnglish') < DATE_NOW && $this->getParameter('dateEndFormatEnglish') < DATE_NOW || $this->getParameter('mode') === 'old') {
         $headline = $gL10n->get('DAT_PREVIOUS_DATES', ' ') . $headline;
     }
     if ($this->getParameter('view_mode') === 'print') {
         $headline = $gCurrentOrganization->getValue('org_longname') . ' - ' . $headline;
     }
     return $headline;
 }
Example #5
0
// Initialize and check the parameters
$getStart = admFuncVariableIsValid($_GET, 'start', 'numeric');
$getCatId = admFuncVariableIsValid($_GET, 'cat_id', 'numeric');
$getActiveRole = admFuncVariableIsValid($_GET, 'active_role', 'boolean', array('defaultValue' => 1));
// New Modulelist object
$lists = new ModuleLists();
$lists->setParameter('cat_id', $getCatId);
// set headline
if ($getActiveRole) {
    $headline = $gL10n->get('LST_ACTIVE_ROLES');
} else {
    $headline = $gL10n->get('LST_INACTIVE_ROLES');
}
if ($getCatId > 0) {
    $category = new TableCategory($gDb, $getCatId);
    $headline .= ' - ' . $category->getValue('cat_name');
}
// Navigation of the module starts here
$gNavigation->addStartUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
if ($gPreferences['lists_hide_overview_details'] == 0) {
    $page->addJavascript('$(".collapse").collapse();', true);
}
$page->addJavascript('
    $(".panel-collapse select").change(function () {
        elementId = $(this).attr("id");
        roleId    = elementId.substr(elementId.search(/_/)+1);

        if($(this).val() === "mylist") {
            self.location.href = gRootPath + "/adm_program/modules/lists/mylist.php?rol_id=" + roleId + "&active_role=' . $getActiveRole . '";
Example #6
0
 /** Returns a module specific headline
  *  @param $headline  The initiale headline of the module. 
  *  @return Returns the full headline of the module
  */
 public function getHeadline($headline)
 {
     global $gDb;
     // set headline with category name
     if ($this->getParameter('cat_id') > 0) {
         $category = new TableCategory($gDb, $this->getParameter('cat_id'));
         $headline .= ' - ' . $category->getValue('cat_name');
     }
     return $headline;
 }
Example #7
0
} else {
    $headline = $getTitle;
}
// set headline of the script
if ($getCatId > 0) {
    $headline = $gL10n->get('SYS_EDIT_VAR', $headline);
} else {
    $headline = $gL10n->get('SYS_CREATE_VAR', $headline);
}
$gNavigation->addUrl(CURRENT_URL, $headline);
// UserField-objekt anlegen
$category = new TableCategory($gDb);
if ($getCatId > 0) {
    $category->readDataById($getCatId);
    // Pruefung, ob die Kategorie zur aktuellen Organisation gehoert bzw. allen verfuegbar ist
    if ($category->getValue('cat_org_id') > 0 && $category->getValue('cat_org_id') != $gCurrentOrganization->getValue('org_id')) {
        $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
    }
}
if (isset($_SESSION['categories_request'])) {
    // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt
    // nun die vorher eingegebenen Inhalte ins Objekt schreiben
    $category->setArray($_SESSION['categories_request']);
    if (!isset($_SESSION['categories_request']['show_in_several_organizations'])) {
        $category->setValue('cat_org_id', $gCurrentOrganization->getValue('org_id'));
    }
    unset($_SESSION['categories_request']);
}
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu