Skip to content

Commit

Permalink
Merge pull request #2 from joomlatools/feature/1-sync
Browse files Browse the repository at this point in the history
Feature/1 sync
  • Loading branch information
amazeika authored Oct 14, 2016
2 parents 3485c41 + d326e0d commit 4389284
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ The following JEvents actions are currently logged:

## Limitations

At the moment and while using the latest stable version of JEvents at this date (v3.4.0RC6), delete actions on Events and their repetitions are not supported due to insufficient data being when triggering the event.
At the moment and while using the latest stable version of JEvents at this date (v3.4.20), delete actions on Events and their repetitions are not supported due to insufficient event data.
4 changes: 2 additions & 2 deletions activity/event.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package LOGman
* @copyright Copyright (C) 2011 - 2015 Timble CVBA. (http://www.timble.net)
* @copyright Copyright (C) 2011 - 2016 Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.joomlatools.com
*/
Expand All @@ -28,7 +28,7 @@ protected function _initialize(KObjectConfig $config)
protected function _objectConfig(KObjectConfig $config)
{
$config->append(array(
'url' => 'option=com_jevents&task=icalevent.edit&cid[]=' . $this->row,
'url' => array('admin' => 'option=com_jevents&task=icalevent.edit&cid[]=' . $this->row),
'subtype' => array('object' => true, 'objectName' => 'JEvents')
));

Expand Down
6 changes: 3 additions & 3 deletions activity/repetition.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package LOGman
* @copyright Copyright (C) 2011 - 2015 Timble CVBA. (http://www.timble.net)
* @copyright Copyright (C) 2011 - 2016 Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.joomlatools.com
*/
Expand Down Expand Up @@ -34,7 +34,7 @@ protected function _objectConfig(KObjectConfig $config)
$url = sprintf('option=com_jevents&task=icalrepeat.edit&cid[]=%d&evid=%d', $this->row, $metadata->event->id);

$config->append(array(
'type' => array('url' => $url, 'find' => 'object'),
'type' => array('url' => array('admin' => $url), 'find' => 'object'),
'subtype' => array('objectName' => 'event', 'object' => true)
));

Expand All @@ -48,7 +48,7 @@ public function getPropertyTarget()
return $this->_getObject(array(
'objectName' => $metadata->event->title,
'find' => 'target',
'url' => 'option=com_jevents&task=icalevent.edit&cid[]=' . $metadata->event->id,
'url' => array('admin' => 'option=com_jevents&task=icalevent.edit&cid[]=' . $metadata->event->id),
'type' => array('objectName' => 'event', 'object' => true),
'subtype' => array('objectName' => 'JEvent', 'object' => true)
));
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{
"name": "joomlatools/logman-jevents",
"type": "joomlatools-installer",
"type": "joomlatools-composer",
"license": "GPLv3",
"description": "Handles logging of JEvents activities",
"keywords": [
Expand All @@ -20,6 +20,6 @@
}
],
"require": {
"joomlatools/installer": "*"
"joomlatools/composer": "*"
}
}
74 changes: 74 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* @package LOGman
* @copyright Copyright (C) 2011 - 2016 Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.joomlatools.com
*/

/**
* LOGman - JEvents installer
*
* @author Arunas Mazeika <https://github.com/amazeika>
* @package Joomlatools\Component\LOGman
*/
class plgLogmanJeventsInstallerScript
{
/**
* @var string The current installed LOGman version.
*/
protected $_logman_ver = null;

public function preflight($type, $installer)
{
$return = true;
$errors = array();

if (version_compare($this->getLogmanVersion(), '3.0.0', '<'))
{
$errors[] = JText::_('This plugin requires a newer LOGman version. Please download the latest version from <a href=http://joomlatools.com target=_blank>joomlatools.com</a> and upgrade.');
$return = false;
}

if ($return == false && $errors)
{
$error = implode('<br />', $errors);
$installer->getParent()->abort($error);
}

return $return;
}

/**
* Returns the current version (if any) of LOGman.
*
* @return string|null The LOGman version if present, null otherwise.
*/
public function getLogmanVersion()
{
if (!$this->_logman_ver) {
$this->_logman_ver = $this->_getExtensionVersion('com_logman');
}

return $this->_logman_ver;
}

/**
* Extension version getter.
*
* @param string $element The element name, e.g. com_extman, com_logman, etc.
* @return mixed|null|string The extension version, null if couldn't be determined.
*/
protected function _getExtensionVersion($element)
{
$version = null;

$query = "SELECT manifest_cache FROM #__extensions WHERE element = '{$element}'";
if ($result = JFactory::getDBO()->setQuery($query)->loadResult()) {
$manifest = new JRegistry($result);
$version = $manifest->get('version', null);
}

return $version;
}
}
4 changes: 2 additions & 2 deletions jevents.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package LOGman
* @copyright Copyright (C) 2011 - 2015 Timble CVBA. (http://www.timble.net)
* @copyright Copyright (C) 2011 - 2016 Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.joomlatools.com
*/
Expand All @@ -15,7 +15,7 @@
* @package Joomlatools\Plugin\LOGman
*/

class PlgLogmanJevents extends ComLogmanPluginAbstract
class PlgLogmanJevents extends ComLogmanPluginJoomla
{
/**
* @var array Queue to make the difference between adds and edits.
Expand Down
25 changes: 22 additions & 3 deletions jevents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
<identifier>plg:logman.jevents</identifier>
<name>plg_logman_jevents</name>
<author>Joomlatools</author>
<creationDate>September 2015</creationDate>
<copyright>Copyright (C) 2011 - 2015 Timble CVBA (http://www.timble.net)</copyright>
<creationDate>October 2016</creationDate>
<copyright>Copyright (C) 2011 - 2016 Timble CVBA (http://www.timble.net)</copyright>
<license>GNU GPLv3 - http://www.gnu.org/licenses/gpl.html</license>
<authorEmail>support@joomlatools.com</authorEmail>
<authorUrl>www.joomlatools.com</authorUrl>
<version>2.1.0</version>
<version>3.0.0</version>
<description>PLG_LOGMAN_JEVENTS_DESC</description>

<scriptfile>install.php</scriptfile>

<files>
<filename plugin="jevents">jevents.php</filename>
<folder>activity</folder>
Expand All @@ -20,4 +22,21 @@
<config>
<fields name="params" />
</config>

<resources>
<resource name="event">
<actions>
<action>add</action>
<action>edit</action>
<action>publish</action>
<action>unpublish</action>
<action>trash</action>
</actions>
</resource>
<resource name="repetition">
<actions>
<action>edit</action>
</actions>
</resource>
</resources>
</extension>
2 changes: 1 addition & 1 deletion language/en-GB/en-GB.plg_logman_jevents.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Copyright © 2015 Timble CVBA. (http://www.timble.net)
; Copyright © 2016 Timble CVBA. (http://www.timble.net)
; GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
; Note : All ini files need to be saved as UTF-8

Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/en-GB.plg_logman_jevents.sys.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Copyright © 2015 Timble CVBA. (http://www.timble.net)
; Copyright © 2016 Timble CVBA. (http://www.timble.net)
; GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
; Note : All ini files need to be saved as UTF-8

Expand Down

0 comments on commit 4389284

Please sign in to comment.