function display($tpl = null) { $app = JFactory::getApplication(); JHTML::stylesheet(JoaktreeHelper::joaktreecss()); $this->canDo = JoaktreeHelper::getActions(); // Get data from the model $items =& $this->get('Data'); $pagination =& $this->get('Pagination'); //Filter $context = 'com_joaktree.jt_applications.list.'; $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'jte.id', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($context . 'search', 'search', '', 'string'); $search = JString::strtolower($search); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); JoaktreeHelper::addSubmenu('applications'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
public function save($form) { $canDo = JoaktreeHelper::getActions(); $msg = JText::_('JTAPPS_MESSAGE_NOSAVE'); if ($canDo->get('core.create') || $canDo->get('core.edit')) { $ret = parent::save($form); if ($ret) { $msg = JText::_('JT_MESSAGE_SAVED'); } // Bind the rules. if (isset($form['rules'])) { $actions = array(); $tmp = array(); $tmp[0] = ''; foreach ($data['rules'] as $action => $identities) { $identities = array_diff($identities, $tmp); $actions[$action] = $identities; } $table = $this->getTable(); $rules = new JRules($actions); $table->setRules($rules); } } return $msg; }
function display($tpl = null) { // Load the parameters. $this->map = $this->get('map'); if ($this->map->params['service'] == 'interactivemap') { $this->lists = array(); $app = JFactory::getApplication('site'); //$document = &JFactory::getDocument(); $this->params = $app->getParams(); $this->params->merge(JoaktreeHelper::getTheme(true, true)); // set up style declaration //$document->addStyleDeclaration($this->map->getStyleDeclaration()); // add javascript $this->script = $this->map->getMapScript(); if ($this->script) { $this->toolkit = $this->map->getToolkit(); //if ($toolkit) { // $document->addScript($toolkit); //} //$document->addScriptDeclaration($script); $this->lists['userAccess'] = true; } else { $this->lists['userAccess'] = false; } parent::display($tpl); } }
function display($tpl = null) { $params = JoaktreeHelper::getJTParams(); // Access $lists['userAccess'] = $this->get('access'); $lists['treeId'] = $this->get('treeId'); $lists['technology'] = $this->get('technology'); // Person + generations $personId = array(); $this->person = $this->get('person'); $personId[] = $this->person->id . '|1'; $lists['ancestorLevel'] = $params->get('ancestorlevel', 1); $lists['startGenNum'] = 1; $lists['endGenNum'] = $lists['ancestorLevel'] + 4; $lists['app_id'] = $this->person->app_id; // show dates $lists['showDates'] = $params->get('ancestordates', 0); // last update $lists['lastUpdate'] = JText::_('JT_LASTUPDATED') . ': ' . JoaktreeHelper::convertDateTime($this->person->lastUpdateDate); // copyright $lists['CR'] = JoaktreeHelper::getJoaktreeCR(); $this->assignRef('personId', $personId); $this->assignRef('lists', $lists); parent::display($tpl); }
function display($tpl = null) { // Get data from the model $items =& $this->get('Items'); $menus = JoaktreeHelper::getMenus('joaktree'); $this->assignRef('items', $items); $this->assignRef('menus', $menus); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::script(JoaktreeHelper::jsfile()); $this->addToolbar(); $items =& $this->get('Data'); $this->assignRef('items', $items); parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $canDo = JoaktreeHelper::getActions(); JToolBarHelper::title(' ' . JText::_('COM_JOAKTREE_CONTROL_PANEL'), 'joaktree'); if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_joaktree', '460'); } JToolBarHelper::help('JoaktreeManuel', true, 'http://joaktree.com/index.php/en/joaktree/manual'); }
public function getPerson() { static $person; if (!isset($person)) { $id['app_id'] = JoaktreeHelper::getApplicationId(); $id['person_id'] = JoaktreeHelper::getPersonId(); $person = new Person($id, 'basic'); } return $person; }
function __construct() { $id = array(); $id['map'] = Map::getMapId(true); $id['location'] = Map::getLocationId(true); $id['distance'] = Map::getDistance(true); $id['person'] = JoaktreeHelper::getPersonId(false, true); $id['tree'] = JoaktreeHelper::getTreeId(false, true); $id['app'] = JoaktreeHelper::getApplicationId(false, true); $this->map = new Map($id); parent::__construct(); }
public function store() { $params = JoaktreeHelper::getJTParams($this->app_id); $indLogging = $params->get('indLogging'); if ($indLogging) { // Logging is switched on $ret = parent::store(); } else { // Logging is switched off $ret = true; } return $ret; }
function display($tpl = null) { $app = JFactory::getApplication('site'); $document =& JFactory::getDocument(); // Load the parameters. $params = $app->getParams(); $params->merge(JoaktreeHelper::getTheme(true, true)); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($params->get('theme'))); // get user info $userId = $this->get('userId'); if (!$userId || $userId == 0) { $document->addScript(JoaktreeHelper::joaktreejs('jtform.js')); } // Logs $this->name = $this->get('personName'); $this->items = $this->get('items'); $this->pagination = $this->get('pagination'); // check display method $tmpl = $this->get('tmpl'); if ($tmpl) { //return $retObject = $this->get('returnObject'); if (!is_object($retObject)) { $retObject = new stdClass(); $retObject->object = 'prsn'; } $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=changehistory' . '&tmpl=' . $tmpl . '&retId=' . base64_encode(json_encode($retObject)); } else { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=changehistory'; } $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); if (count($this->items) > 0) { // set title, meta title $title = $this->name ? $this->name : JText::_('JT_CHANGEHISTORY'); $document->setTitle($title); $document->setMetadata('title', $title); // set additional meta tags if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } } parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { // First load the treeId! $this->lists['treeId'] = $this->get('treeId'); // Load the parameters. $this->params = JoaktreeHelper::getJTParams(true); if ($this->params->get('siteedit', 1)) { $this->canDo = JoaktreeHelper::getActions(); } else { $this->canDo = null; } // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($this->params->get('theme'))); $document =& JFactory::getDocument(); $document->addScript(JoaktreeHelper::joaktreejs('toggle.js')); $this->lists['lineEnd'] = $document->_getLineEnd(); // Initialiase variables. $this->form = $this->get('Form'); $this->lists['appId'] = $this->get('applicationId'); $this->lists['appName'] = $this->get('applicationName'); $relationId = $this->get('relationId'); if (isset($relationId)) { $this->relation = $this->get('relation'); $this->lists['action'] = $this->get('action'); } $this->lists['action'] = isset($this->lists['action']) ? $this->lists['action'] : 'new'; $this->picture = $this->get('picture'); $personId = $this->get('personId'); if (isset($personId)) { $this->lists['userAccess'] = $this->get('access'); $this->item = $this->get('Item'); $this->lists['indLiving'] = $this->item->living; } else { $this->lists['userAccess'] = true; $this->lists['indLiving'] = false; } $patronym = $this->params->get('patronym', 0); $this->lists['indPatronym'] = $patronym == 0 ? false : true; $familyname = $this->params->get('familyname', 0); $this->lists['indNamePreposition'] = $familyname == 1 ? true : false; $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); if ($this->lists['userAccess']) { // set title if (isset($personId)) { $title = $this->item->firstName . ' ' . $this->item->familyName; $document->setTitle($title); } } parent::display($tpl); }
function display($tpl = null) { if ($tpl == null) { $this->lists = array(); $app = JFactory::getApplication('site'); $document =& JFactory::getDocument(); // Load the parameters. $this->params = $app->getParams(); $this->params->merge(JoaktreeHelper::getGedCom()); $this->params->merge(JoaktreeHelper::getTheme(true, true)); if ($this->params->get('siteedit', 1)) { $this->canDo = JoaktreeHelper::getActions(false); } else { $this->canDo = null; } // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($this->params->get('theme'))); // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->lists['userAccess'] = $this->get('access'); $this->lists['action'] = $this->get('action'); if ($this->lists['action'] == 'select') { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=repository' . '&tmpl=component' . '&action=' . $this->lists['action']; } else { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=repository'; } $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); } if ($this->lists['userAccess']) { // set title, meta title if ($this->params->get('gedcomName')) { $title = $this->params->get('gedcomName'); $document->setTitle($title); $document->setMetadata('title', $title); } // set additional meta tags if ($this->params->get('menu-meta_description')) { $document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $document->setMetadata('robots', $this->params->get('robots')); } } parent::display($tpl); }
function display($tpl = null) { $app = JFactory::getApplication(); JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::script(JoaktreeHelper::jsfile()); $this->canDo = JoaktreeHelper::getActions(); // Get data from the model $this->items =& $this->get('Data'); $this->pagination =& $this->get('Pagination'); //Filter $context = 'com_joaktree.jt_trees.list.'; $this->filter['state'] = $app->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'cmd'); $this->filter['apptitle'] = $app->getUserStateFromRequest($context . 'filter_apptitle', 'filter_apptitle', '', 'int'); $this->filter['gendex'] = $app->getUserStateFromRequest($context . 'filter_gendex', 'filter_gendex', '', 'int'); $this->filter['order'] = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'jte.id', 'cmd'); $this->filter['order_Dir'] = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($context . 'search', 'search', '', 'string'); $search = JString::strtolower($search); // table ordering $this->lists['order_Dir'] = $this->filter['order_Dir']; $this->lists['order'] = $this->filter['order']; // search filter $this->lists['search'] = $search; // state filter $this->state = array('published' => 1, 'unpublished' => 1, 'archived' => 0, 'trash' => 0, 'all' => 0); // application filter $this->appTitle = JoaktreeHelper::getApplications(); // gendex filter $this->gendex = array(); $selectObj = new StdClass(); $selectObj->value = 1; $selectObj->text = JText::_('JNO'); $this->gendex[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 2; $selectObj->text = JText::_('JYES'); $this->gendex[] = $selectObj; unset($selectObj); $this->lists['jsscript'] = $this->getJTscript(); $this->lists['action'] = $this->get('action'); if ($this->lists['action'] == 'assign') { $this->lists['act_treeId'] = $this->get('treeId'); } JoaktreeHelper::addSubmenu('trees'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
function display($tpl = null) { $params = JoaktreeHelper::getJTParams(); $document =& JFactory::getDocument(); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($params->get('theme'))); // Access $lists['userAccess'] = $this->get('access'); $lists['treeId'] = $this->get('treeId'); $lists['technology'] = $this->get('technology'); // Person + generations $personId = array(); $this->person = $this->get('person'); $personId[] = $this->person->id . '|1'; $lists['ancestorLevel'] = $params->get('ancestorlevel', 1); $lists['startGenNum'] = 1; $lists['endGenNum'] = $lists['ancestorLevel'] + 4; $lists['app_id'] = $this->person->app_id; // show dates $lists['showDates'] = $params->get('ancestordates', 0); // last update $lists['lastUpdate'] = JoaktreeHelper::lastUpdateDateTimePerson($this->person->lastUpdateDate); // copyright $lists['CR'] = JoaktreeHelper::getJoaktreeCR(); $this->assignRef('personId', $personId); $this->assignRef('lists', $lists); if ($lists['userAccess']) { // set title, meta title $document->setTitle($this->person->fullName); $document->setMetadata('title', $this->person->fullName); // set additional meta tags if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } // robots if ($this->person->robots > 0) { $document->setMetadata('robots', JoaktreeHelper::stringRobots($this->person->robots)); } else { if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } } } parent::display($tpl); }
public function log($crud, $changeDateTimeOverride = null) { if (!$this->check()) { return false; } $params = JoaktreeHelper::getJTParams($this->app_id); $indLogging = $params->get('indLogging'); if ($indLogging) { // Logging is switched on switch ($crud) { case "C": $this->logevent = 'JT_C_' . strtoupper($this->object); break; case "R": $this->logevent = 'JT_R_' . strtoupper($this->object); break; case "U": $this->logevent = 'JT_U_' . strtoupper($this->object); break; case "D": $this->logevent = 'JT_D_' . strtoupper($this->object); break; case "L": // Time of gedcom load $this->logevent = 'JT_L_' . strtoupper($this->object); break; case "I": // Date/time is imported from GedCom file $this->logevent = 'JT_I_' . strtoupper($this->object); break; default: $this->logevent = 'JT_A_' . strtoupper($this->object); break; } if (empty($changeDateTimeOverride)) { // If no timestamp value is passed to functon, than current time is used. $currentdate = JFactory::getDate(); $this->changeDateTime = $currentdate->Format('Y-m-d H:i:s', false, false); } else { $this->changeDateTime = $changeDateTimeOverride; } $ret = $this->store(); } else { // Logging is switched off $ret = true; } return $ret; }
/** * Display the view */ public function display($tpl = null) { JHTML::stylesheet(JoaktreeHelper::joaktreecss()); // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->geoCodeSet = $this->get('GeocodeResultSet'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->canDo = JoaktreeHelper::getActions(); $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $this->lists = array(); $app = JFactory::getApplication('site'); $document =& JFactory::getDocument(); // Load the parameters. $this->map = $this->get('map'); $this->params = $app->getParams(); $this->params->merge(JoaktreeHelper::getTheme(true, true)); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($this->params->get('theme'))); if ($this->map->params['service'] == 'staticmap') { // Get data from the model $this->mapview = $this->get('mapView'); $this->lists['userAccess'] = $this->mapview ? true : false; if ($this->lists['userAccess']) { // set title, meta title if ($this->map->params['name']) { $title = $this->map->params['name']; $document->setTitle($title); $document->setMetadata('title', $title); } // set additional meta tags if ($this->params->get('menu-meta_description')) { $document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $document->setMetadata('robots', $this->params->get('robots')); } } } if ($this->map->params['service'] == 'interactivemap') { $this->lists['href'] = 'index.php?option=com_joaktree' . '&tmpl=component' . '&format=raw' . '&view=interactivemap' . '&mapId=' . $this->map->params['id']; } // user interaction $this->lists['mapHtmlId'] = 'jt-map-id'; $this->lists['uicontrol'] = $this->map->getUIControl($this->lists['mapHtmlId']); // copyright $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); parent::display($tpl); }
function display($tpl = null) { $params = JoaktreeHelper::getJTParams(); // Access $lists['userAccess'] = $this->get('access'); $lists['treeId'] = $this->get('treeId'); $lists['technology'] = $this->get('technology'); // Person + generations $personId = array(); $this->person = $this->get('person'); $personId[] = $this->person->id . '|1'; $lists['startGenNum'] = 1; $lists['endGenNum'] = (int) $params->get('descendantlevel', 20); $lists['app_id'] = $this->person->app_id; $this->assignRef('personId', $personId); $this->assignRef('lists', $lists); parent::display($tpl); }
private function checkValue($name, $value) { static $initCharacters; $db =& JFactory::getDBO(); if ($name == 'personId') { $tmp = explode('!', $value); if (strlen($tmp[1]) > (int) JoaktreeHelper::getIdlength()) { die('wrong request'); } $tmp[0] = (int) $tmp[0]; $tmp[1] = $db->escape($tmp[1]); $retValue = $tmp; } else { $retValue = $db->escape($value); $retValue = (int) $retValue; } return $retValue; }
/** * Display the view */ public function display($tpl = null) { JHTML::stylesheet(JoaktreeHelper::joaktreecss()); // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // use cookies $params = JComponentHelper::getParams('com_joaktree'); $this->indCookie = $params->get('indCookies', true); $this->canDo = JoaktreeHelper::getActions(); $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $this->lists = array(); // Load the parameters. $this->params = JoaktreeHelper::getJTParams(); // Get data from the model $this->treeinfo = $this->get('treeinfo'); $menus = $this->get('menus'); // Id's and settings $this->lists['tree_id'] = $this->get('treeId'); $this->lists['userAccess'] = $this->get('access'); $this->lists['menuItemId'] = $menus[$this->lists['tree_id']]; //namelist $this->lists['columns'] = (int) $this->params->get('columns', '3'); $this->namelist = $this->get('namelist'); $this->lists['numberRows'] = (int) ceil(count($this->namelist) / $this->lists['columns']); $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=joaktreelist' . '&Itemid=' . $this->lists['menuItemId'] . '&treeId=' . $this->lists['tree_id']; parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = $this->item->id == 0; $canDo = JoaktreeHelper::getActions(); JToolBarHelper::title($isNew ? JText::_('JTTHEME_TITLE_NEW') : JText::_('JTTHEME_TITLE_EDIT'), 'theme'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolBarHelper::apply('apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('save', 'JTOOLBAR_SAVE'); } if (empty($this->item->id)) { JToolBarHelper::cancel('theme.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('theme.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JoaktreeManuel', true, 'http://joaktree.com/index.php/en/joaktree/manual'); }
function display($tpl = null) { $this->lists = array(); // Load the parameters. $this->params = JoaktreeHelper::getJTParams(); // Get data from the model $this->treeinfo = $this->get('treeinfo'); $menus = $this->get('menus'); // Id's and settings $this->lists['tree_id'] = $this->get('treeId'); $this->lists['userAccess'] = $this->get('access'); $this->lists['menuItemId'] = $menus[$this->lists['tree_id']]; $this->lists['interactiveMap'] = $this->get('interactiveMap'); //location list $this->lists['columns'] = (int) $this->params->get('columnsLoc', '3'); $this->locationlist = $this->get('locationlist'); $this->lists['numberRows'] = (int) ceil(count($this->locationlist) / $this->lists['columns']); $this->lists['linkMap'] = 'index.php?option=com_joaktree' . '&view=interactivemap' . '&tmpl=component' . '&format=raw' . '&treeId=' . $this->lists['tree_id']; $this->lists['linkList'] = 'index.php?option=com_joaktree' . '&view=joaktreelist' . '&tmpl=component' . '&layout=location' . '&treeId=' . $this->lists['tree_id']; parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $canDo = JoaktreeHelper::getActions(); JToolBarHelper::title(' ' . JText::_('JTMAPS_TITLE'), 'map'); if ($canDo->get('core.create')) { JToolBarHelper::addNew(); } if ($canDo->get('core.edit')) { JToolBarHelper::editList(); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('JT_CONFIRMDELETE'); } JToolBarHelper::divider(); //($task = '', $icon = '', $iconOver = '', $alt = '', $listSelect = true) JToolBarHelper::custom('locations', 'location', 'JT_SUBMENU_LOCATIONS', 'JT_SUBMENU_LOCATIONS', false); JToolBarHelper::divider(); JToolBarHelper::help('JoaktreeManuel', true, 'http://joaktree.com/index.php/en/joaktree/manual'); // Sidebar JHtmlSidebar::setAction('index.php?option=com_joaktree&view=jt_maps'); }
/** * Method to get the field options. * * @return array The field option objects. * @since 11.1 */ protected function getOptions($gedcomtype, $indLiving) { // Possible gedcom-types are: person, name, relation // Initialize variables. $options = array(); $levels = JoaktreeHelper::getUserAccessLevels(); // Get the database object. $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select(' code '); $query->from(' #__joaktree_display_settings '); $query->where(' level = ' . $db->quote($gedcomtype) . ' '); $query->where(' published = true '); $query->where(' code NOT IN (' . $db->quote('NAME') . ', ' . $db->quote('NOTE') . ', ' . $db->quote('ENOT') . ', ' . $db->quote('SOUR') . ', ' . $db->quote('ESOU') . ') '); if ($indLiving == true) { $query->where(' accessLiving IN ' . $levels . ' '); } else { $query->where(' access IN ' . $levels . ' '); } // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Check for an error. if ($db->getErrorNum()) { JError::raiseWarning(500, $db->getErrorMsg()); return $options; } // Build the field options. if (!empty($items)) { foreach ($items as $item) { $options[] = JHtml::_('select.option', $item->code, JText::_($item->code)); } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }
private function _buildQuery() { $query = $this->_db->getQuery(true); $query->select(' jmp.id '); $query->select(' jmp.name '); $query->select(' jmp.period_start '); $query->select(' jmp.period_end '); $query->select(' jmp.app_id '); $query->select(' japp.title AS appTitle '); $query->select(' CASE jmp.service ' . ' WHEN ' . $this->_db->quote('staticmap') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_TYPE_STATIC')) . ' ' . ' WHEN ' . $this->_db->quote('interactivemap') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_TYPE_INTERACTIVE')) . ' ' . ' ELSE ' . $this->_db->quote(JText::_('JTMAP_TYPE_STATIC')) . ' ' . ' END AS service '); $query->select(' CASE jmp.selection ' . ' WHEN ' . $this->_db->quote('application') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_APP')) . ' ' . ' WHEN ' . $this->_db->quote('tree') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_TREE')) . ' ' . ' WHEN ' . $this->_db->quote('location') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_LOCATION')) . ' ' . ' WHEN ' . $this->_db->quote('person') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_PERSON')) . ' ' . ' WHEN ' . $this->_db->quote('persons') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_PERSONS')) . ' ' . ' WHEN ' . $this->_db->quote('name') . ' ' . ' THEN ' . $this->_db->quote(JText::_('JTMAP_SELECTION_NAME')) . ' ' . ' ELSE ' . $this->_db->quote(JText::_('JTMAP_SELECTION_APP')) . ' ' . ' END AS selection '); $query->select(' CASE jmp.selection ' . ' WHEN ' . $this->_db->quote('application') . ' ' . ' THEN japp.title ' . ' WHEN ' . $this->_db->quote('tree') . ' ' . ' THEN jte.name ' . ' WHEN ' . $this->_db->quote('location') . ' ' . ' THEN jmp.subject ' . ' WHEN ' . $this->_db->quote('person') . ' ' . ' THEN ' . JoaktreeHelper::getConcatenatedFullName() . ' ' . ' ELSE jmp.subject ' . ' END AS subject '); $query->from(' #__joaktree_maps jmp '); $query->innerJoin(' #__joaktree_applications japp ' . ' ON ( japp.id = jmp.app_id ) '); $query->leftJoin(' #__joaktree_trees jte ' . ' ON ( jte.id = jmp.tree_id ) '); $query->leftJoin(' #__joaktree_persons jpn ' . ' ON ( jpn.app_id = jmp.app_id ' . ' AND jpn.id = jmp.person_id ' . ' ) '); // WHERE, GROUP BY and ORDER BY clauses for the query $wheres = $this->_buildContentWhere(); foreach ($wheres as $where) { $query->where(' ' . $where . ' '); } $query->order(' ' . $this->_buildContentOrderBy() . ' '); return $query; }
function getJoaktreeList() { $related = array(); $jt_likes = array(); // we only searching for persons when currently one article is shown if ($this->_option == 'com_content' && $this->_view == 'article' && $this->_id) { $params = JComponentHelper::getParams('com_joaktree'); $indArticleLink = (int) $params->get('indArticleLink', 9); // we only searching for persons when Joaktree setting is set if ($indArticleLink != 0) { $displayAccess = JoaktreeHelper::getDisplayAccess(); $userAccess = JoaktreeHelper::getUserAccess(); $accessLevels = JoaktreeHelper::getUserAccessLevels(); // select the meta keywords from the item $query = $this->_db->getQuery(true); $query->select(' metakey '); $query->from(' #__content '); $query->where(' id = ' . (int) $this->_id . ' '); $this->_db->setQuery($query); if ($metakey = trim($this->_db->loadResult())) { // explode the meta keys on a comma $keys = explode(',', $metakey); // assemble any non-blank word(s) foreach ($keys as $key) { $key = trim($key); if ($key) { // no commas $jt_likes[] = $this->_db->escape($key); } } } // process the "jt_likes" - search in joaktree tables if (count($jt_likes)) { // select from Joaktree tables $query->clear(); $query->select(' jpn.app_id '); $query->select(' jpn.id '); $query->select(' CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) AS title '); $query->select(' NULL AS created '); $query->select(' jan.default_tree_id AS catid '); $query->select(' NULL AS cat_access '); $query->select(' NULL AS cat_state '); $query->from(' #__joaktree_persons jpn '); $query->innerJoin(' #__joaktree_admin_persons jan ' . ' ON ( jan.app_id = jpn.app_id ' . ' AND jan.id = jpn.id ' . ' AND jan.published = 1 ' . ' AND jan.page = 1 ' . ' AND ( (jan.living = false AND ' . $displayAccess['NAMEname']->notLiving . ' = 2 ) ' . ' OR (jan.living = true AND ' . $displayAccess['NAMEname']->living . ' = 2 ) ' . ' ) ' . ' ) '); $query->innerJoin(' #__joaktree_trees jte ' . ' ON ( jte.app_id = jan.app_id ' . ' AND jte.id = jan.default_tree_id ' . ' AND jte.published = true ' . ' AND jte.access IN ' . $accessLevels . ' ' . ' ) '); // section to set the where-clause if ($indArticleLink == 9) { // 9: All options $query->where(' jpn.id = "' . implode('" OR jpn.id = "', $jt_likes) . '" ' . ' OR CONCAT_WS( ' . $this->_db->quote('!') . ' ' . ' , jpn.app_id ' . ' , jpn.id ' . ' ) = "' . implode('" OR CONCAT_WS( ' . $this->_db->quote('!') . ' ' . ' , jpn.app_id ' . ' , jpn.id ' . ' ) = "', $jt_likes) . '" ' . ' OR CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) ' . ' LIKE "%' . implode('%" OR CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) LIKE "%', $jt_likes) . '%" '); } if ($indArticleLink == 1) { // 1: By ID $query->where(' jpn.id = "' . implode('" OR jpn.id = "', $jt_likes) . '" ' . ' OR CONCAT_WS( ' . $this->_db->quote('!') . ' ' . ' , jpn.app_id ' . ' , jpn.id ' . ' ) = "' . implode('" OR CONCAT_WS( ' . $this->_db->quote('!') . ' ' . ' , jpn.app_id ' . ' , jpn.id ' . ' ) = "', $jt_likes) . '" '); } if ($indArticleLink == 2) { // 2: By first name $query->where(' jpn.firstName ' . ' LIKE "%' . implode('%" OR jpn.firstName LIKE "%', $jt_likes) . '%" '); } if ($indArticleLink == 3) { // 3: By family name $query->where(' CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) ' . ' LIKE "%' . implode('%" OR CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) LIKE "%', $jt_likes) . '%" '); } if ($indArticleLink == 4 or $indArticleLink == 5) { // 4: By first + family name; 5: All names $query->where(' CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) ' . ' LIKE "%' . implode('%" OR CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) LIKE "%', $jt_likes) . '%" '); } // end section for setting where-clause -> continue with creating the query $query->order(' CONCAT_WS( ' . $this->_db->quote(' ') . ' ' . ' , jpn.firstName ' . ' , jpn.namePreposition ' . ' , jpn.familyName ' . ' ) '); $this->_db->setQuery($query); $temp = $this->_db->loadObjectList(); if (count($temp)) { // get menuId & technology $menus = JoaktreeHelper::getMenus('joaktree'); $technology = JoaktreeHelper::getTechnology(); $linkBase = 'index.php?option=com_joaktree&view=joaktree&tech=' . $technology . ''; foreach ($temp as $row) { $menuItemId = $menus[$row->catid]; $row->route = JRoute::_($linkBase . '&Itemid=' . $menuItemId . '&treeId=' . $row->catid . '&personId=' . $row->app_id . '!' . $row->id); $row->robot = $technology == 'a' ? '' : 'rel="noindex, nofollow"'; $related[] = $row; } } unset($temp); } } } return $related; }
public function getAssignFamilyTree() { $canDo = JoaktreeHelper::getActions(); $tmp = JFactory::getApplication()->input->get('init', null, 'int'); $procObject = (int) $tmp == 1 ? $this->initProcessObject() : $this->getProcessObject(); if ($canDo->get('core.create') && $canDo->get('core.edit')) { switch ($procObject->status) { case 'start': // continue // continue case 'starttree': // continue // continue case 'progtree': // continue // continue case 'endtree': // continue // continue case 'treedef_1': // continue // continue case 'treedef_2': // continue // continue case 'treedef_3': // continue // continue case 'treedef_4': // continue // continue case 'treedef_5': // continue // continue case 'treedef_6': // continue $familyTree = new jt_trees($procObject); $resObject = $familyTree->assignFamilyTree(); $resObject->current = strftime('%H:%M:%S'); $this->setProcessObject($resObject); $return = json_encode($resObject); break; case 'endtreedef': // we are done with this app $resObject = $this->initProcessObject($procObject->japp_ids); $resObject->current = strftime('%H:%M:%S'); $resObject->msg = JText::sprintf('JTPROCESS_END_MSG', $procObject->id); $return = json_encode($resObject); break; // End: Addition for processing tree-persons // End: Addition for processing tree-persons case 'end': case 'error': // continue // continue default: // continue $procObject->status = 'error'; $return = json_encode($procObject); break; } } else { $procObject->status = 'error'; $procObject->msg = JText::_('JT_NOTAUTHORISED'); $return = json_encode($procObject); } return $return; }
public function getLastUpdate() { return JoaktreeHelper::lastUpdateDateTime(); }