// POST Variablen in das UserField-Objekt schreiben foreach ($_POST as $key => $value) { if (strpos($key, 'cat_') === 0) { $category->setValue($key, $value); } } $cat_org_merker = $category->getValue('cat_org_id'); // Daten in Datenbank schreiben $returnCode = $category->save(); if ($returnCode < 0) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // falls eine Kategorie von allen Orgas auf eine Bestimmte umgesetzt wurde oder anders herum, // dann muss die Sequenz fuer den alle Kategorien dieses Typs neu gesetzt werden if (isset($_POST['cat_org_id']) && $_POST['cat_org_id'] != $cat_org_merker) { $sequenceCategory = new TableCategory($gDb); $sequence = 0; $sql = 'SELECT * FROM ' . TBL_CATEGORIES . ' WHERE cat_type = "' . $getType . '" AND ( cat_org_id = ' . $gCurrentOrganization->getValue('org_id') . ' OR cat_org_id IS NULL ) ORDER BY cat_org_id ASC, cat_sequence ASC'; $categoriesStatement = $gDb->query($sql); while ($row = $categoriesStatement->fetch()) { ++$sequence; $sequenceCategory->clear(); $sequenceCategory->setArray($row); $sequenceCategory->setValue('cat_sequence', $sequence); $sequenceCategory->save(); }
$gMessage->show($gL10n->get('SYS_ICAL_DISABLED')); } //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
/** * 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; }
// Create table object $categoriesOverview = new HtmlTable('tbl_categories', $page, true); // create array with all column heading values $columnHeading = array($gL10n->get('SYS_TITLE'), ' ', $htmlIconLoginUser, '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/star.png" alt="' . $gL10n->get('CAT_DEFAULT_VAR', $getTitle) . '" title="' . $gL10n->get('CAT_DEFAULT_VAR', $getTitle) . '" />', ' '); $categoriesOverview->setColumnAlignByArray(array('left', 'left', 'left', 'left', 'right')); $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) {
require_once '../../system/common.php'; // 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") {
/** 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; }
$headline = $gL10n->get('SYS_CATEGORY_VAR', $gL10n->get('ORG_PROFILE_FIELDS')); } else { $headline = $gL10n->get('SYS_CATEGORY'); } } 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']);
?> </td> <td><?php echo $row->categoryId; ?> </td> <td><a href="<?php echo $link1; ?> "><?php echo stripslashes($row->categoryName); ?> </a></td> <td><?php $database =& JFactory::getDBO(); $parent = new TableCategory($database); $parent->load($row->parent_id); echo $parent->categoryName; ?> </td> <td><?php echo $accesOptions[$row->access]; ?> </td> <td><?php echo $published; ?> </td> <td>
/** * @return \yii\db\ActiveQuery */ public function getProductCategory() { return $this->hasOne(TableCategory::className(), ['category_id' => 'product_category']); }