本文整理匯總了PHP中JEVHelper::isEventEditor方法的典型用法代碼示例。如果您正苦於以下問題:PHP JEVHelper::isEventEditor方法的具體用法?PHP JEVHelper::isEventEditor怎麽用?PHP JEVHelper::isEventEditor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JEVHelper
的用法示例。
在下文中一共展示了JEVHelper::isEventEditor方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit
function edit($tpl = null)
{
$document =& JFactory::getDocument();
include JEV_LIBS . "editStrings.php";
$document->addScriptDeclaration($editStrings);
// WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
JEVHelper::script('editical.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
$document->setTitle(JText::_('EDIT_ICAL_EVENT'));
// Set toolbar items for the page
JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents');
$bar =& JToolBar::getInstance('toolbar');
if ($this->id > 0) {
if ($this->editCopy) {
$this->toolbarConfirmButton("icalevent.save", JText::_("save_copy_warning"), 'save', 'save', 'Save', false);
$this->toolbarConfirmButton("icalevent.apply", JText::_("save_copy_warning"), 'apply', 'apply', 'Jev_Apply', false);
} else {
$this->toolbarConfirmButton("icalevent.save", JText::_("save_icalevent_warning"), 'save', 'save', 'Save', false);
$this->toolbarConfirmButton("icalevent.apply", JText::_("save_icalevent_warning"), 'apply', 'apply', 'JEV_Apply', false);
}
} else {
JToolBarHelper::save('icalevent.save');
if (JEVHelper::isEventEditor()) {
JToolBarHelper::apply('icalevent.apply', "JEV_Apply");
}
//$bar->appendButton( 'Apply', 'apply', "Apply",'icalevent.apply', false, false );
}
JToolBarHelper::cancel('icalevent.list');
//JToolBarHelper::help( 'screen.icalevent.edit', true);
$this->_hideSubmenu();
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
//$section = $params->getValue("section",0);
JHTML::_('behavior.tooltip');
$this->setCreatorLookup();
}
示例2: _createFilter
function _createFilter($prefix = "")
{
if (!$this->filterField) {
return "ev.state=1";
}
// The default is only to show published events
if ($this->filter_value == 0) {
return "ev.state=1";
}
// only show published events to non-logged in users
$user = JFactory::getUser();
if ($user->get('id') == 0) {
return "ev.state=1";
}
if (JEVHelper::isEventPublisher(true) || JEVHelper::isEventEditor()) {
if ($this->filter_value == -1) {
return "";
}
return "ev.state=0";
} else {
if (JEVHelper::isEventCreator()) {
$user = JFactory::getUser();
if ($this->filter_value == -1) {
return "(ev.state=1 OR ev.created_by=" . $user->id . ")";
}
return "ev.state=0 && ev.created_by=" . $user->id;
}
}
return "ev.state=1";
}
示例3: edit
function edit($tpl = null)
{
$document =& JFactory::getDocument();
include JEV_ADMINLIBS . "/editStrings.php";
$document->addScriptDeclaration($editStrings);
// WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
if (JVersion::isCompatible("1.6.0")) {
JEVHelper::stylesheet('eventsadmin16.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
} else {
JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
}
JEVHelper::script('editical.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
//JEVHelper::script('toolbarfix.js','components/'.JEV_COM_COMPONENT.'/assets/js/');
$document->setTitle(JText::_('EDIT_ICAL_EVENT'));
// Set toolbar items for the page
JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents');
$bar =& JToolBar::getInstance('toolbar');
if ($this->id > 0) {
if ($this->editCopy) {
$this->toolbarConfirmButton("icalevent.save", JText::_("save_copy_warning"), 'save', 'save', 'Save', false);
if (JEVHelper::isEventEditor()) {
$this->toolbarConfirmButton("icalevent.apply", JText::_("save_copy_warning"), 'apply', 'apply', 'Apply', false);
}
} else {
$this->toolbarConfirmButton("icalevent.save", JText::_("save_icalevent_warning"), 'save', 'save', 'Save', false);
if (JEVHelper::isEventEditor()) {
$this->toolbarConfirmButton("icalevent.apply", JText::_("save_icalevent_warning"), 'apply', 'apply', 'Apply', false);
}
}
} else {
$this->toolbarButton("icalevent.save", 'save', 'save', 'Save', false);
if (JEVHelper::isEventEditor()) {
$this->toolbarButton("icalevent.apply", 'apply', 'apply', 'Apply', false);
}
}
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($params->get("editpopup", 0)) {
$document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
$this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
JRequest::setVar('tmpl', 'component');
//force the component template
} else {
if ($this->id > 0) {
$this->toolbarButton("icalevent.detail", 'cancel', 'cancel', 'Cancel', false);
} else {
$this->toolbarLinkButton("day.listevents", 'cancel', 'cancel', 'Cancel', false);
}
}
JHTML::_('behavior.tooltip');
// I pass in the rp_id so that I can return to the repeat I was viewing before editing
$this->assign("rp_id", JRequest::getInt("rp_id", 0));
$this->setCreatorLookup();
$this->_adminStart();
parent::displaytemplate($tpl);
$this->_adminEnd();
}
示例4: edit
function edit($tpl = null)
{
$document = JFactory::getDocument();
include JEV_ADMINLIBS . "/editStrings.php";
$document->addScriptDeclaration($editStrings);
JEVHelper::script('editical.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
JEVHelper::script('JevStdRequiredFields.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
$document->setTitle(JText::_('EDIT_ICAL_REPEAT'));
// Set toolbar items for the page
JToolBarHelper::title(JText::_('EDIT_ICAL_REPEAT'), 'jevents');
$bar = JToolBar::getInstance('toolbar');
$this->toolbarConfirmButton("icalrepeat.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'Save', false);
if (JEVHelper::isEventEditor()) {
$this->toolbarConfirmButton("icalrepeat.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'jev_Apply', false);
}
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
$document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
$this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
JRequest::setVar('tmpl', 'component');
//force the component template
} else {
$this->toolbarButton("icalevent.detail", 'cancel', 'cancel', 'Cancel', false);
}
//JToolBarHelper::help( 'screen.icalrepeat.edit', true);
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
JHTML::_('behavior.tooltip');
$this->_adminStart();
if (JevJoomlaVersion::isCompatible("3.0")) {
// load Joomla javascript classes
JHTML::_('behavior.core');
$this->setLayout("edit");
} else {
$this->setLayout("edit16");
}
$this->setupEditForm();
JEVHelper::componentStylesheet($this, "editextra.css");
jimport('joomla.filesystem.file');
// Lets check if we have editted before! if not... rename the custom file.
if (JFile::exists(JPATH_SITE . "/components/com_jevents/assets/css/jevcustom.css")) {
// It is definitely now created, lets load it!
JEVHelper::stylesheet('jevcustom.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
}
parent::displaytemplate($tpl);
$this->_adminEnd();
}
示例5: hasAdvancedRowPermissions
/**
* Test to see if user is creator of the event or editor or above
*
* @param unknown_type $row
* @param unknown_type $user
* @return unknown
*/
function hasAdvancedRowPermissions($row, $user = null)
{
// TODO make this call a plugin
if ($user == null) {
$user = JFactory::getUser();
}
// strictt publishing test
if (JEVHelper::isEventEditor() || JEVHelper::isEventPublisher(true)) {
return true;
}
if (is_null($row)) {
return false;
} else {
if ($row->created_by() == $user->id) {
return true;
}
}
return false;
}
示例6: canEditEvent
/**
* Test to see if user can edit event
*
* @param unknown_type $row
* @param unknown_type $user
* @return unknown
*/
public static function canEditEvent($row, $user = null)
{
// store in static to save repeated database calls
static $authdata_coreedit = array();
static $authdata_editown = array();
// TODO make this call a plugin
if ($user == null) {
$user = JFactory::getUser();
}
if ($user->id == 0) {
return false;
}
// are we authorised to do anything with this category or calendar
$jevuser = JEVHelper::getAuthorisedUser();
if ($row->_icsid > 0 && $jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
$allowedcals = explode("|", $jevuser->calendars);
if (!in_array($row->_icsid, $allowedcals)) {
return false;
}
}
if ($row->_catid > 0 && $jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
$allowedcats = explode("|", $jevuser->categories);
if (!in_array($row->_catid, $allowedcats)) {
return false;
}
// check multi cats too
if (JEVHelper::rowCatids($row)) {
if (count(array_diff(JEVHelper::rowCatids($row), $allowedcats))) {
return false;
}
}
}
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$authorisedonly = $params->get("authorisedonly", 0);
if ($authorisedonly) {
if ($jevuser && $jevuser->published) {
// creator can edit their own event
if ($jevuser->cancreate && $row->_created_by == $user->id) {
return true;
} else {
if ($jevuser->canedit) {
return true;
}
}
}
return false;
}
if (JEVHelper::isEventEditor()) {
// any category restrictions on this?
// This involes TOO many database queries in Joomla - one per category which can be a LOT
/*
$cats = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.edit');
$cats_own = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.edit.own');
if (in_array($row->_catid, $cats))
return true;
else if (in_array($row->_catid, $cats_own))
return true;
else return false;
*/
$key = $row->catids() ? json_encode($row->catids()) : json_encode(intval($row->catid()));
if (!isset($authdata_coreedit[$key])) {
$authdata_coreedit[$key] = JEVHelper::authoriseCategories('core.edit', $key, $user);
}
if ($authdata_coreedit[$key]) {
return true;
} else {
if ($user->id > 0 && $row->created_by() == $user->id) {
if (!isset($authdata_editown[$key])) {
$authdata_editown[$key] = JEVHelper::authoriseCategories('core.edit.own', $key, $user);
}
return $authdata_editown[$key];
}
}
// category settings trumps overall setting
return false;
return true;
} else {
if ($user->id > 0 && $row->created_by() == $user->id) {
if ($authorisedonly) {
if ($jevuser) {
if ($jevuser->published && $jevuser->cancreate) {
return true;
}
} else {
return false;
}
}
// other users can always edit their own unless blocked by category
// This involes TOO many database queries in Joomla - one per category which can be a LOT
/*
$cats = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.edit');
$cats_own = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.edit.own');
if (in_array($row->_catid, $cats))
//.........這裏部分代碼省略.........
示例7: edit
function edit($tpl = null)
{
$document = JFactory::getDocument();
include JEV_ADMINLIBS . "/editStrings.php";
$document->addScriptDeclaration($editStrings);
JEVHelper::script('editicalJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
JEVHelper::script('JevStdRequiredFieldsJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
if ($this->row->title() <= "") {
// Set toolbar items for the page
JToolBarHelper::title(JText::_('CREATE_ICAL_EVENT'), 'jevents');
$document->setTitle(JText::_('CREATE_ICAL_EVENT'));
} else {
// Set toolbar items for the page
JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents');
$document->setTitle(JText::_('EDIT_ICAL_EVENT'));
}
$bar = JToolBar::getInstance('toolbar');
if ($this->id > 0) {
if ($this->editCopy) {
if (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row)) {
$this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_COPY_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
}
//$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
$this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
} else {
if (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row)) {
$this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
}
//$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
$this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
}
} else {
$canEditOwn = false;
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if (!$params->get("authorisedonly", 0)) {
$juser = JFactory::getUser();
$canEditOwn = $juser->authorise('core.edit.own', 'com_jevents');
}
if (JEVHelper::isEventEditor() || $canEditOwn) {
$this->toolbarButton("icalevent.apply", 'apply', 'apply', 'JEV_SAVE', false);
}
//JToolBarHelper::save('icalevent.savenew', "JEV_Save_New");
$this->toolbarButton("icalevent.save", 'save', 'save', 'JEV_SAVE_CLOSE', false);
}
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$evedrd = $params->get("editreturnto", "day.listevents");
if ($params->get("editpopup", 0)) {
$document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
$this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
JRequest::setVar('tmpl', 'component');
//force the component template
} else {
if ($this->id > 0) {
$this->toolbarButton("icalrepeat.detail", 'cancel', 'cancel', 'Cancel', false);
} else {
$this->toolbarButton($evedrd, 'cancel', 'cancel', 'Cancel', false);
}
}
// I pass in the rp_id so that I can return to the repeat I was viewing before editing
$this->assign("rp_id", JRequest::getInt("rp_id", 0));
$this->_adminStart();
// load Joomla javascript classes
JHTML::_('behavior.core');
$this->setLayout("edit");
JEVHelper::componentStylesheet($this, "editextra.css");
jimport('joomla.filesystem.file');
// Lets check if we have editted before! if not... rename the custom file.
if (JFile::exists(JPATH_SITE . "/components/com_jevents/assets/css/jevcustom.css")) {
// It is definitely now created, lets load it!
JEVHelper::stylesheet('jevcustom.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
}
$this->setupEditForm();
parent::displaytemplate($tpl);
$this->_adminEnd();
}
示例8: edit
function edit($tpl = null)
{
$document = JFactory::getDocument();
include JEV_ADMINLIBS . "editStrings.php";
$document->addScriptDeclaration($editStrings);
// WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
JEVHelper::script('editicalJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
JEVHelper::script('JevStdRequiredFieldsJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
if ($this->row->title() <= "") {
$document->setTitle(JText::_('CREATE_ICAL_EVENT'));
// Set toolbar items for the page
JToolBarHelper::title(JText::_('CREATE_ICAL_EVENT'), 'jevents');
} else {
$document->setTitle(JText::_('EDIT_ICAL_EVENT'));
// Set toolbar items for the page
JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents');
}
$bar = JToolBar::getInstance('toolbar');
if ($this->id > 0) {
if ($this->editCopy) {
$this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_COPY_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
$this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
} else {
$this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
$this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
}
} else {
if (JEVHelper::isEventEditor()) {
JToolBarHelper::apply('icalevent.apply', "JEV_SAVE");
}
JToolBarHelper::save('icalevent.save');
JToolBarHelper::save2new('icalevent.savenew', "JEV_SAVE_NEW");
}
JToolBarHelper::cancel('icalevent.list');
//JToolBarHelper::help( 'screen.icalevent.edit', true);
// TODO move this into JForm field type!
$this->setCreatorLookup();
// load Joomla javascript classes
JHTML::_('behavior.core');
$this->setLayout("edit");
$this->setupEditForm();
}
示例9: listIcalEventRepeatsByCreator
function listIcalEventRepeatsByCreator($creator_id, $limitstart, $limit, $orderby = "rpt.startrepeat")
{
// Use alternative data source
$rows = array();
$skipJEvents = false;
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('fetchListIcalEventRepeatsByCreator', array(&$skipJEvents, &$rows, $creator_id, $limitstart, $limit, $orderby));
if ($skipJEvents) {
return $rows;
}
$user = JFactory::getUser();
$db = JFactory::getDBO();
$cfg = JEVConfig::getInstance();
$rows_per_page = $limit;
if (empty($limitstart) || !$limitstart) {
$limitstart = 0;
}
$limit = "";
if ($limitstart > 0 || $rows_per_page > 0) {
$limit = "LIMIT {$limitstart}, {$rows_per_page}";
}
// process the new plugins
// get extra data and conditionality from plugins
$extrawhere = array();
$extrajoin = array();
$extrafields = "";
// must have comma prefix
$extratables = "";
// must have comma prefix
$needsgroup = false;
$catwhere = "\n WHERE ev.catid IN(" . $this->accessibleCategoryList() . ")";
$params = JComponentHelper::getParams("com_jevents");
if ($params->get("multicategory", 0)) {
$extrajoin[] = "\n #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
$extrajoin[] = "\n #__categories AS catmapcat ON catmap.catid = catmapcat.id";
$extrafields .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
$extrawhere[] = " catmapcat.access IN (" . JEVHelper::getAid($user) . ")";
$extrawhere[] = " catmap.catid IN(" . $this->accessibleCategoryList() . ")";
$needsgroup = true;
$catwhere = "\n WHERE 1 ";
}
$adminCats = JEVHelper::categoryAdmin();
$where = '';
if ($creator_id == 'ADMIN' || JEVHelper::isEventEditor() || JEVHelper::isEventPublisher(true)) {
$where = "";
} else {
if ($adminCats && count($adminCats) > 0) {
if ($params->get("multicategory", 0)) {
$adminCats = " OR catmap.catid IN(" . implode(",", $adminCats) . ")";
} else {
$adminCats = " OR ev.catid IN(" . implode(",", $adminCats) . ")";
}
$where = " AND ( ev.created_by = " . $user->id . $adminCats . ")";
} else {
$where = " AND ev.created_by = '{$creator_id}' ";
}
}
$frontendPublish = JEVHelper::isEventPublisher();
$filters = jevFilterProcessing::getInstance(array("published", "justmine", "category", "startdate", "search", "repeating"));
$filters->setWhereJoin($extrawhere, $extrajoin);
$needsgroup = false;
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onListIcalEvents', array(&$extrafields, &$extratables, &$extrawhere, &$extrajoin, &$needsgroup));
$extrajoin = count($extrajoin) ? " \n LEFT JOIN " . implode(" \n LEFT JOIN ", $extrajoin) : '';
$extrawhere = count($extrawhere) ? ' AND ' . implode(' AND ', $extrawhere) : '';
$needsgroup = false;
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onListIcalEvents', array(&$extrafields, &$extratables, &$extrawhere, &$extrajoin, &$needsgroup));
if ($frontendPublish) {
// TODO fine a single query way of doing this !!!
$query = "SELECT rp_id" . "\n FROM #__jevents_repetition as rpt " . "\n LEFT JOIN #__jevents_vevent as ev ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . $extrawhere . $where . "\n AND icsf.state=1" . "\n GROUP BY rpt.rp_id" . "\n ORDER BY " . ($orderby != "" ? $orderby : "rpt.startrepeat ASC") . "\n {$limit}";
$db->setQuery($query);
$rplist = $db->loadColumn();
//echo $db->explain();
$rplist = implode(',', array_merge(array(-1), $rplist));
$query = "SELECT ev.*, rpt.*, rr.*, det.*, ev.state as published" . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat ) as ydn, MONTH(rpt.endrepeat ) as mdn, DAYOFMONTH(rpt.endrepeat ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat ) as hdn, MINUTE(rpt.endrepeat ) as mindn, SECOND(rpt.endrepeat ) as sdn" . "\n FROM #__jevents_vevent as ev " . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n AND rpt.eventid = ev.ev_id" . "\n AND rpt.rp_id IN({$rplist})" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . $extrawhere . $where . "\n AND icsf.state=1" . "\n GROUP BY rpt.rp_id" . "\n ORDER BY " . ($orderby != "" ? $orderby : "rpt.startrepeat ASC");
} else {
// TODO fine a single query way of doing this !!!
$query = "SELECT rp_id" . "\n FROM #__jevents_vevent as ev " . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . $extrawhere . "\n AND icsf.state=1" . $where . "\n GROUP BY rpt.rp_id" . "\n ORDER BY " . ($orderby != "" ? $orderby : "rpt.startrepeat ASC") . "\n {$limit}";
$db->setQuery($query);
$rplist = $db->loadColumn();
$rplist = implode(',', array_merge(array(-1), $rplist));
$query = "SELECT ev.*, rpt.*, rr.*, det.*, ev.state as published" . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat ) as ydn, MONTH(rpt.endrepeat ) as mdn, DAYOFMONTH(rpt.endrepeat ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat ) as hdn, MINUTE(rpt.endrepeat ) as mindn, SECOND(rpt.endrepeat ) as sdn" . "\n FROM #__jevents_vevent as ev " . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n AND rpt.rp_id IN({$rplist})" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . $where . "\n AND icsf.state=1" . $extrawhere . "\n GROUP BY rpt.rp_id" . "\n ORDER BY " . ($orderby != "" ? $orderby : "rpt.startrepeat ASC");
}
$db->setQuery($query);
$icalrows = $db->loadObjectList();
$icalcount = count($icalrows);
for ($i = 0; $i < $icalcount; $i++) {
// convert rows to jIcalEvents
$icalrows[$i] = new jIcalEventRepeat($icalrows[$i]);
}
JEventsDBModel::translateEvents($icalrows);
JEVHelper::onDisplayCustomFieldsMultiRow($icalrows);
return $icalrows;
}
示例10: defined
* @package JEvents
* @copyright Copyright (C) 2008-2009 GWE Systems Ltd
* @license GNU/GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html
* @link http://www.jevents.net
*/
defined('_JEXEC') or die('Restricted access');
// get configuration object
$cfg = JEVConfig::getInstance();
if ($this->editCopy || $this->repeatId == 0) {
$repeatStyle = " class='jeveditrepeats jevdatetime ' ";
} else {
$repeatStyle = "style='display:none;' class='jeveditrepeats jevdatetime' ";
}
// Disable event repeats for non-full editors if disable repeats is enabled
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($params->get("disablerepeats", 0) && !JEVHelper::isEventEditor()) {
$repeatStyle = "style='display:none;' class='jeveditrepeats' ";
}
?>
<div style="clear:both;" class="jevdatetime">
<fieldset class="jev_sed"><legend><?php
echo JText::_("Start_End_Duration");
?>
</legend>
<div class="control-group form-inline allDayEvent">
<?php
echo $this->form->getLabel("allDayEvent");
?>
<span>
<?php
echo $this->form->getInput("allDayEvent");
示例11: canEditEvent
/**
* Test to see if user can edit event
*
* @param unknown_type $row
* @param unknown_type $user
* @return unknown
*/
function canEditEvent($row, $user = null)
{
// TODO make this call a plugin
if ($user == null) {
$user =& JFactory::getUser();
}
// are we authorised to do anything with this category or calendar
$jevuser =& JEVHelper::getAuthorisedUser();
if ($row->_icsid > 0 && $jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
$allowedcals = explode("|", $jevuser->calendars);
if (!in_array($row->_icsid, $allowedcals)) {
return false;
}
}
if ($row->_catid > 0 && $jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
$allowedcats = explode("|", $jevuser->categories);
if (!in_array($row->_catid, $allowedcats)) {
return false;
}
}
if (JEVHelper::isEventEditor()) {
return true;
} else {
if ($user->id > 0 && $row->created_by() == $user->id) {
if ($jevuser) {
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$authorisedonly = $params->get("authorisedonly", 0);
if ($authorisedonly) {
if ($jevuser->published && $jevuser->cancreate) {
return true;
}
}
}
if (JVersion::isCompatible("1.6.0")) {
$cats = $user->getAuthorisedCategories('com_jevents', 'core.edit');
$cats_own = $user->getAuthorisedCategories('com_jevents', 'core.edit.own');
if (in_array($row->_catid, $cats)) {
return true;
} else {
if (in_array($row->_catid, $cats_own)) {
return true;
}
}
} else {
return true;
}
}
}
if (JVersion::isCompatible("1.6.0")) {
if ($user->id > 0 && $row->catid() > 0) {
return $user->authorise('core.edit', 'com_jevents.category.' . $row->catid());
}
}
return false;
}