-
+
$this)
- );
+ echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
-
items) && empty($this->items['error'])) : ?>
@@ -61,20 +30,20 @@
-
-
- |
-
+
|
-
+
|
-
+
|
-
+
+ |
+
+
|
@@ -96,11 +65,6 @@
id); ?>
|
-
-
- id; ?>
-
- |
state, $i, 'activities.', true, 'cb'); ?>
|
@@ -113,6 +77,11 @@
updated_date; ?>
|
+
+
+ id; ?>
+
+ |
@@ -132,8 +101,6 @@
-
-
diff --git a/src/admin/views/activities/view.html.php b/src/admin/views/activities/view.html.php
index ea6ab04..d637741 100755
--- a/src/admin/views/activities/view.html.php
+++ b/src/admin/views/activities/view.html.php
@@ -1,6 +1,5 @@
* @package ActivityStream
* @author Techjoomla
* @copyright Copyright (c) 2009-2017 TechJoomla. All rights reserved.
@@ -11,28 +10,31 @@
defined('_JEXEC') or die;
/**
- * HelloWorlds View
+ * ActivityStream View
*
* @since 0.0.1
*/
class ActivityStreamViewActivities extends JViewLegacy
{
+ protected $input;
+
/**
- * Display the Hello World view
+ * Display the ActivityStream view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
- * @return void
+ * @return mixed A string if successful, otherwise an Error object.
*/
+
public function display($tpl = null)
{
// To show all types of activity in list view
- $activitiesModel = $this->getModel();
+ $activitiesModel = $this->getModel();
$activitiesModel->setState("type", 'all');
-
- $this->items = $this->get('Items');
- $this->pagination = $this->get('Pagination');
- $this->state = $this->get('State');
+ $this->input = JFactory::getApplication()->input;
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
@@ -60,20 +62,29 @@ public function display($tpl = null)
*/
protected function addToolBar()
{
- $title = JText::_('Activity Stream');
+ $title = JText::_('Activity Stream');
+ $languageFile = JFactory::getLanguage();
+ $extension = JFactory::getApplication()->input->get('client', '', 'STRING');
+ $base_dir = JPATH_BASE;
- if ($this->pagination->total)
+ // Load the language file for particular extension
+
+ if ($extension)
{
- $title .= "(" . $this->pagination->total . ")";
+ $languageFile->load($extension, $base_dir);
}
- JToolBarHelper::title($title, 'activity');
- JToolBarHelper::deleteList('', 'activities.delete');
- JToolBarHelper::editList('activity.edit');
+ /*if ($this->pagination->total)
+ {
+ $title .= "(" . $this->pagination->total . ")";
+ }*/
+
+ JToolBarHelper::title($title, 'list');
JToolBarHelper::addNew('activity.add');
+ JToolBarHelper::editList('activity.edit');
JToolBarHelper::publish('activity.publish');
JToolBarHelper::unpublish('activity.publish');
- JToolBarHelper::save2copy('activity.save2copy');
+ JToolBarHelper::deleteList('', 'activities.delete');
}
/**
@@ -84,9 +95,9 @@ protected function addToolBar()
protected function getSortFields()
{
return array(
- 'id' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ID'),
- 'state' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_STATE'),
- 'type' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_TYPE'),
+ 'id' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_ID'),
+ 'state' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_STATE'),
+ 'type' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_TYPE'),
'created_date' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_CREATED_DATE'),
'updated_date' => JText::_('COM_ACTIVITYSTREAM_ACTIVITY_UPDATED_DATE')
);
diff --git a/src/build/bump.php b/src/build/bump.php
new file mode 100755
index 0000000..5942c04
--- /dev/null
+++ b/src/build/bump.php
@@ -0,0 +1,404 @@
+ -c
+ *
+ * Examples:
+ * - php build/bump.php -v 3.6.0-dev
+ * - php build/bump.php -v 3.6.0-beta1
+ * - php build/bump.php -v 3.6.0-beta1-dev
+ * - php build/bump.php -v 3.6.0-beta2
+ * - php build/bump.php -v 3.6.0-rc1
+ * - php build/bump.php -v 3.6.0
+ * - php build/bump.php -v 3.6.0 -c Unicorn
+ * - php build/bump.php -v 3.6.0 -c "Custom Codename"
+ * - /usr/bin/php /path/to/joomla-cms/build/bump.php -v 3.7.0
+ *
+ * @package Techjoomla.Build
+ *
+ * @author Techjoomla
+ * @copyright Copyright (C) 2010 - 2018 Techjoomla. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+/**
+ * Display the use of command
+ *
+ * @param string $command The command name
+ *
+ * @return void
+ */
+function usage($command)
+{
+ echo PHP_EOL;
+ echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
+ echo PHP_TAB . '[options]:' . PHP_EOL;
+ echo PHP_TAB . PHP_TAB . '-v :' . PHP_TAB . 'Version (ex: 3.6.0-dev, 3.6.0-beta1, 3.6.0-beta1-dev, 3.6.0-rc1, 3.6.0)' . PHP_EOL;
+ echo PHP_TAB . PHP_TAB . '-c :' . PHP_TAB . 'Codename [optional] (ex: Unicorn)' . PHP_EOL;
+ echo PHP_EOL;
+}
+
+// Constants.
+const PHP_TAB = "\t";
+
+// File paths. THe version file path (If applicable)
+$versionFile = 'PATH_OF_VERSION_FILE';
+
+// This file will vary from component to component
+$coreXmlFiles = array(
+ '/src/activitystream.xml',
+ '/src/plugins/privacy/activitystream/activitystream.xml',
+);
+
+$antJobFile = '/build.xml';
+
+$readMeFiles = array(
+ '/README.md',
+ '/README.txt',
+);
+
+// Change copyright date exclusions. Some systems may try to scan the .git directory, exclude it.
+$directoryLoopExcludeDirectories = array(
+ '/.git',
+ '/.gitlab',
+ '/scripts/ansible-deploy',
+ '/scripts/gulp',
+ '/src/packages/com_jlike',
+ '/tests/codeception',
+);
+
+$directoryLoopExcludeFiles = array(
+ '.gitignore',
+ '/build/bump.php',
+ '/scripts/phing/build.xml',
+);
+
+// Check arguments (exit if incorrect cli arguments).
+$opts = getopt("v:c:");
+
+if (empty($opts['v']))
+{
+ usage($argv[0]);
+ die();
+}
+
+// Check version string (exit if not correct).
+$versionParts = explode('-', $opts['v']);
+
+if (!preg_match('#^[0-9]+\.[0-9]+\.[0-9]+$#', $versionParts[0]))
+{
+ usage($argv[0]);
+ die();
+}
+
+if (isset($versionParts[1]) && !preg_match('#(dev|alpha|beta|rc)[0-9]*#', $versionParts[1]))
+{
+ usage($argv[0]);
+ die();
+}
+
+if (isset($versionParts[2]) && $versionParts[2] !== 'dev')
+{
+ usage($argv[0]);
+ die();
+}
+
+// Make sure we use the correct language and timezone.
+setlocale(LC_ALL, 'en_GB');
+date_default_timezone_set('Asia/Kolkata');
+
+// Make sure file and folder permissions are set correctly.
+umask(022);
+
+// Get version dev status.
+$dev_status = 'Stable';
+
+if (!isset($versionParts[1]))
+{
+ $versionParts[1] = '';
+}
+else
+{
+ if (preg_match('#^dev#', $versionParts[1]))
+ {
+ $dev_status = 'Development';
+ }
+ elseif (preg_match('#^alpha#', $versionParts[1]))
+ {
+ $dev_status = 'Alpha';
+ }
+ elseif (preg_match('#^beta#', $versionParts[1]))
+ {
+ $dev_status = 'Beta';
+ }
+ elseif (preg_match('#^rc#', $versionParts[1]))
+ {
+ $dev_status = 'Release Candidate';
+ }
+}
+
+if (!isset($versionParts[2]))
+{
+ $versionParts[2] = '';
+}
+else
+{
+ $dev_status = 'Development';
+}
+
+// Set version properties.
+$versionSubParts = explode('.', $versionParts[0]);
+
+$version = array(
+ 'main' => $versionSubParts[0] . '.' . $versionSubParts[1],
+ 'major' => $versionSubParts[0],
+ 'minor' => $versionSubParts[1],
+ 'patch' => $versionSubParts[2],
+ 'extra' => (!empty($versionParts[1]) ? $versionParts[1] : '') .
+ (!empty($versionParts[2]) ? (!empty($versionParts[1]) ? '-' : '') . $versionParts[2] : ''),
+ 'release' => $versionSubParts[0] . '.' . $versionSubParts[1] . '.' . $versionSubParts[2],
+ 'dev_devel' => $versionSubParts[2] . (!empty($versionParts[1]) ? '-' .
+ $versionParts[1] : '') . (!empty($versionParts[2]) ? '-' . $versionParts[2] : ''),
+ 'dev_status' => $dev_status,
+ 'build' => '',
+ 'reldate' => date('j-F-Y'),
+ 'reltime' => date('H:i'),
+ 'reltz' => 'GMT',
+ 'credate' => date('jS M Y')
+ );
+
+// Version Codename.
+if (!empty($opts['c']))
+{
+ $version['codename'] = trim($opts['c']);
+}
+
+// Prints version information.
+echo PHP_EOL;
+echo 'Version data:' . PHP_EOL;
+echo '- Main:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . PHP_EOL;
+echo '- Release:' . PHP_TAB . PHP_TAB . $version['release'] . PHP_EOL;
+echo '- Full:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . '.' . $version['dev_devel'] . PHP_EOL;
+echo '- Build:' . PHP_TAB . PHP_TAB . $version['build'] . PHP_EOL;
+echo '- Dev Level:' . PHP_TAB . PHP_TAB . $version['dev_devel'] . PHP_EOL;
+echo '- Dev Status:' . PHP_TAB . PHP_TAB . $version['dev_status'] . PHP_EOL;
+echo '- Release date:' . PHP_TAB . PHP_TAB . $version['reldate'] . PHP_EOL;
+echo '- Release time:' . PHP_TAB . PHP_TAB . $version['reltime'] . PHP_EOL;
+echo '- Release timezone:' . PHP_TAB . $version['reltz'] . PHP_EOL;
+echo '- Creation date:' . PHP_TAB . $version['credate'] . PHP_EOL;
+
+if (!empty($version['codename']))
+{
+ echo '- Codename:' . PHP_TAB . PHP_TAB . $version['codename'] . PHP_EOL;
+}
+
+echo PHP_EOL;
+
+$rootPath = dirname(__DIR__);
+
+// Updates the version in version class.
+if (file_exists($rootPath . $versionFile))
+{
+ $fileContents = file_get_contents($rootPath . $versionFile);
+ $fileContents = preg_replace("#MAJOR_VERSION\s*=\s*[^;]*#", "MAJOR_VERSION = " . $version['major'], $fileContents);
+ $fileContents = preg_replace("#MINOR_VERSION\s*=\s*[^;]*#", "MINOR_VERSION = " . $version['minor'], $fileContents);
+ $fileContents = preg_replace("#PATCH_VERSION\s*=\s*[^;]*#", "PATCH_VERSION = " . $version['patch'], $fileContents);
+ $fileContents = preg_replace("#EXTRA_VERSION\s*=\s*'[^\']*'#", "EXTRA_VERSION = '" . $version['extra'] . "'", $fileContents);
+ $fileContents = preg_replace("#RELEASE\s*=\s*'[^\']*'#", "RELEASE = '" . $version['main'] . "'", $fileContents);
+ $fileContents = preg_replace("#DEV_LEVEL\s*=\s*'[^\']*'#", "DEV_LEVEL = '" . $version['dev_devel'] . "'", $fileContents);
+ $fileContents = preg_replace("#DEV_STATUS\s*=\s*'[^\']*'#", "DEV_STATUS = '" . $version['dev_status'] . "'", $fileContents);
+ $fileContents = preg_replace("#BUILD\s*=\s*'[^\']*'#", "BUILD = '" . $version['build'] . "'", $fileContents);
+ $fileContents = preg_replace("#RELDATE\s*=\s*'[^\']*'#", "RELDATE = '" . $version['reldate'] . "'", $fileContents);
+ $fileContents = preg_replace("#RELTIME\s*=\s*'[^\']*'#", "RELTIME = '" . $version['reltime'] . "'", $fileContents);
+ $fileContents = preg_replace("#RELTZ\s*=\s*'[^\']*'#", "RELTZ = '" . $version['reltz'] . "'", $fileContents);
+
+ if (!empty($version['codename']))
+ {
+ $fileContents = preg_replace("#CODENAME\s*=\s*'[^\']*'#", "CODENAME = '" . $version['codename'] . "'", $fileContents);
+ }
+
+ file_put_contents($rootPath . $versionFile, $fileContents);
+}
+
+// + TJ - chanages
+// Prints TJ specific information.
+$author = 'Techjoomla';
+$authorEmail = 'extensions@techjoomla.com';
+$authorUrl = 'https://techjoomla.com';
+$license = 'http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL';
+$copyright = 'Copyright (C) 2010 - 2018 Techjoomla. All rights reserved.';
+
+echo PHP_EOL;
+
+echo 'Techjoomla copyright info to be added in xml:' . PHP_EOL;
+echo '- author:' . PHP_TAB . PHP_TAB . PHP_TAB . $author . PHP_EOL;
+echo '- authorEmail:' . PHP_TAB . PHP_TAB . PHP_TAB . $authorEmail . PHP_EOL;
+echo '- authorUrl:' . PHP_TAB . PHP_TAB . PHP_TAB . $authorUrl . PHP_EOL;
+echo '- license:' . PHP_TAB . PHP_TAB . PHP_TAB . $license . PHP_EOL;
+echo '- copyright:' . PHP_TAB . PHP_TAB . PHP_TAB . $copyright . PHP_EOL;
+
+echo PHP_EOL;
+
+// + TJ - chanages - end
+
+// Updates the version and creation date in core xml files.
+foreach ($coreXmlFiles as $coreXmlFile)
+{
+ if (file_exists($rootPath . $coreXmlFile))
+ {
+ // @echo 'Processed xml file: ' .$rootPath . $coreXmlFile . PHP_EOL;
+
+ $fileContents = file_get_contents($rootPath . $coreXmlFile);
+
+ $fileContents = preg_replace('#[^<]*#', '' . $version['main'] .
+ '.' . $version['dev_devel'] . '', $fileContents
+ );
+
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $version['credate'] . '', $fileContents
+ );
+
+ // + TJ - chanages
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $author . '', $fileContents
+ );
+
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $authorEmail . '', $fileContents
+ );
+
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $authorUrl . '', $fileContents
+ );
+
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $license . '', $fileContents
+ );
+
+ $fileContents = preg_replace('#[^<]*#', '' .
+ $copyright . '', $fileContents
+ );
+
+ // + TJ - chanages - end
+
+ file_put_contents($rootPath . $coreXmlFile, $fileContents);
+ }
+}
+
+// Updates the version for the `phpdoc` task in the Ant job file.
+if (file_exists($rootPath . $antJobFile))
+{
+ $fileContents = file_get_contents($rootPath . $antJobFile);
+ $fileContents = preg_replace('##', '', $fileContents
+ );
+ file_put_contents($rootPath . $antJobFile, $fileContents);
+}
+
+// Updates the version in readme files.
+foreach ($readMeFiles as $readMeFile)
+{
+ if (file_exists($rootPath . $readMeFile))
+ {
+ $fileContents = file_get_contents($rootPath . $readMeFile);
+ $fileContents = preg_replace('#Joomla! [0-9]+\.[0-9]+ (|\[)version#', 'Joomla! ' . $version['main'] . ' $1version', $fileContents);
+ $fileContents = preg_replace('#Joomla_[0-9]+\.[0-9]+_version#', 'Joomla_' . $version['main'] . '_version', $fileContents);
+ file_put_contents($rootPath . $readMeFile, $fileContents);
+ }
+}
+
+// Updates the copyright date in core files.
+$changedFilesCopyrightDate = 0;
+$changedFilesSinceVersion = 0;
+$year = date('Y');
+$directory = new \RecursiveDirectoryIterator($rootPath);
+$iterator = new \RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
+
+foreach ($iterator as $file)
+{
+ if ($file->isFile())
+ {
+ $filePath = $file->getPathname();
+ $relativePath = str_replace($rootPath, '', $filePath);
+
+ // Exclude certain extensions.
+ if (preg_match('#\.(png|jpeg|jpg|gif|bmp|ico|webp|svg|woff|woff2|ttf|eot)$#', $filePath))
+ {
+ continue;
+ }
+
+ // Exclude certain files.
+ if (in_array($relativePath, $directoryLoopExcludeFiles))
+ {
+ continue;
+ }
+
+ // Exclude certain directories.
+ $continue = true;
+
+ foreach ($directoryLoopExcludeDirectories as $excludeDirectory)
+ {
+ if (preg_match('#^' . preg_quote($excludeDirectory) . '#', $relativePath))
+ {
+ $continue = false;
+ break;
+ }
+ }
+
+ if ($continue)
+ {
+ $changeSinceVersion = false;
+ $changeCopyrightDate = false;
+
+ // Load the file.
+ $fileContents = file_get_contents($filePath);
+
+ // Check if need to change the copyright date.
+ if (preg_match('#2010\s+-\s+[0-9]{4}\s+Techjoomla.\s+All\s+rights#', $fileContents)
+ && !preg_match('#2010\s+-\s+' . $year . '\s+Techjoomla.\s+All\s+rights#', $fileContents))
+ {
+ $changeCopyrightDate = true;
+ $fileContents = preg_replace('#2010\s+-\s+[0-9]{4}\s+Techjoomla.\s+All\s+rights#', '2010 - ' .
+ $year . ' Techjoomla. All rights', $fileContents
+ );
+ $changedFilesCopyrightDate++;
+ }
+
+ // Check if need to change the since version.
+ if ($relativePath !== '/build/bump.php' && preg_match('#__DEPLOY_VERSION__#', $fileContents))
+ {
+ $changeSinceVersion = true;
+ $fileContents = preg_replace('#__DEPLOY_VERSION__#', $version['release'], $fileContents);
+ $changedFilesSinceVersion++;
+ }
+
+ // Save the file.
+ if ($changeCopyrightDate || $changeSinceVersion)
+ {
+ file_put_contents($filePath, $fileContents);
+ }
+
+ // @echo 'Processed file: ' . $filePath . PHP_EOL;
+ }
+ }
+}
+
+if ($changedFilesCopyrightDate > 0 || $changedFilesSinceVersion > 0)
+{
+ if ($changedFilesCopyrightDate > 0)
+ {
+ echo '- Copyright Date changed in ' . $changedFilesCopyrightDate . ' files.' . PHP_EOL;
+ }
+
+ if ($changedFilesSinceVersion > 0)
+ {
+ echo '- Since Version changed in ' . $changedFilesSinceVersion . ' files.' . PHP_EOL;
+ }
+
+ echo PHP_EOL;
+}
+
+echo 'Version bump complete!' . PHP_EOL;
+
diff --git a/src/plugins/privacy/activitystream/activitystream.php b/src/plugins/privacy/activitystream/activitystream.php
index c575eb0..096ddca 100644
--- a/src/plugins/privacy/activitystream/activitystream.php
+++ b/src/plugins/privacy/activitystream/activitystream.php
@@ -19,7 +19,7 @@
/**
* Privacy plugin managing ActivityStream user data
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
class PlgPrivacyActivitystream extends PrivacyPlugin
{
@@ -28,7 +28,7 @@ class PlgPrivacyActivitystream extends PrivacyPlugin
*
* @var boolean
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
protected $autoloadLanguage = true;
@@ -36,7 +36,7 @@ class PlgPrivacyActivitystream extends PrivacyPlugin
* Database object
*
* @var JDatabaseDriver
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
protected $db;
@@ -52,7 +52,7 @@ class PlgPrivacyActivitystream extends PrivacyPlugin
*
* @return PrivacyExportDomain[]
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user = null)
{
@@ -80,7 +80,7 @@ public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser $user
*
* @return PrivacyExportDomain
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
private function createActivityStreamDomain(JTableUser $user)
{
@@ -115,7 +115,7 @@ private function createActivityStreamDomain(JTableUser $user)
*
* @return PrivacyRemovalStatus
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user = null)
{
@@ -139,7 +139,7 @@ public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser $user
*
* @return void
*
- * @since __DEPLOY_VERSION__
+ * @since 1.0.1
*/
public function onPrivacyRemoveData(PrivacyTableRequest $request, JUser $user = null)
{
diff --git a/src/plugins/privacy/activitystream/activitystream.xml b/src/plugins/privacy/activitystream/activitystream.xml
index 9c0008c..f95b777 100644
--- a/src/plugins/privacy/activitystream/activitystream.xml
+++ b/src/plugins/privacy/activitystream/activitystream.xml
@@ -1,7 +1,7 @@
plg_privacy_activitystream
- __DEPLOY_VERSION__
+ 1.0.1
__RELEASE_DATE__
Techjoomla
extensions@techjoomla.com
From 9a110998fb211e2afeb1d45d755729b290c26e5c Mon Sep 17 00:00:00 2001
From: KishoriBKarale <35763119+KishoriBKarale@users.noreply.github.com>
Date: Mon, 14 Jan 2019 17:32:20 +0530
Subject: [PATCH 2/3] Filter condition support for activities (#36)
* Feature #138348 feat: Widget OR Support
* Feature #138348 feat: Widget OR Support
* Feature #138348 feat: Widget OR Support
* Feature #138348 feat: Widget OR Support
---
src/media/scripts/activities.jQuery.js | 5 +++
src/site/controllers/activities.php | 2 ++
src/site/models/activities.php | 47 +++++++++++++++++++++++---
3 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/src/media/scripts/activities.jQuery.js b/src/media/scripts/activities.jQuery.js
index a2b92ee..7ffb8f9 100755
--- a/src/media/scripts/activities.jQuery.js
+++ b/src/media/scripts/activities.jQuery.js
@@ -33,6 +33,7 @@
let object_id = techjoomla.jQuery(ele).attr("tj-activitystream-object-id");
let target_id = techjoomla.jQuery(ele).attr("tj-activitystream-target-id");
let from_date = techjoomla.jQuery(ele).attr("tj-activitystream-from-date");
+ let filter_condition = techjoomla.jQuery(ele).attr("tj-activitystream-filter-condition");
let limit = techjoomla.jQuery(ele).attr("tj-activitystream-limit");
let start = techjoomla.jQuery(ele).attr("start");
let url = root_url+"index.php?option=com_activitystream&task=activities.getActivities";
@@ -61,6 +62,10 @@
{
url += "&limit="+limit;
}
+ if (typeof filter_condition != 'undefined')
+ {
+ url += "&filter_condition="+filter_condition;
+ }
techjoomla.jQuery.ajax({
url: url+"&start="+start,
diff --git a/src/site/controllers/activities.php b/src/site/controllers/activities.php
index 03f48e9..e20da02 100755
--- a/src/site/controllers/activities.php
+++ b/src/site/controllers/activities.php
@@ -74,6 +74,7 @@ public function getActivities()
$from_date = $jinput->get('from_date', '');
$start = $jinput->get('start', '0');
$limit = $jinput->get('limit');
+ $filter_condition = $jinput->get('filter_condition', '', 'STRING');
// Set model state
$ActivityStreamModelActivities->setState("type", $type);
@@ -85,6 +86,7 @@ public function getActivities()
$ActivityStreamModelActivities->setState("access", "1");
$ActivityStreamModelActivities->setState("state", '1');
$ActivityStreamModelActivities->setState("list.start", $start);
+ $ActivityStreamModelActivities->setState("filter_condition", $filter_condition);
$result['results'] = $ActivityStreamModelActivities->getItems();
diff --git a/src/site/models/activities.php b/src/site/models/activities.php
index 2fe4229..d6989b1 100755
--- a/src/site/models/activities.php
+++ b/src/site/models/activities.php
@@ -86,6 +86,7 @@ protected function getListQuery()
$from_date = $this->getState('from_date');
$limit = $this->getState('list.limit');
$start = $this->getState('list.start');
+ $filter_condition = $this->getState('filter_condition');
$result_arr = array();
@@ -99,15 +100,51 @@ protected function getListQuery()
// Get all filters
$filters = $this->get('filter_fields');
- foreach ($filters as $filter)
+ // Default filter condition AND support
+ if ($filter_condition != 'any')
{
- $filterValue = $this->getState($filter);
+ foreach ($filters as $filter)
+ {
+ $filterValue = $this->getState($filter);
+
+ if (!empty($filterValue) && $filter != 'type')
+ {
+ $filterValue = $this->activityStreamActivitiesHelper->buildActivityFilterQuery($filterValue);
+ $query->where($db->quoteName($filter) . ' IN (' . $filterValue . ')');
+ }
+ }
+ }
+ else
+ {
+ // Filter condition OR support
+ $whereClause = array();
- if (!empty($filterValue) && $filter != 'type')
+ foreach ($filters as $filter)
{
- $filterValue = $this->activityStreamActivitiesHelper->buildActivityFilterQuery($filterValue);
- $query->where($db->quoteName($filter) . ' IN (' . $filterValue . ')');
+ $filterValue = $this->getState($filter);
+
+ if (!empty($filterValue) && $filter != 'type')
+ {
+ $filterValue = $this->activityStreamActivitiesHelper->buildActivityFilterQuery($filterValue);
+ $conditionFilters = array('target_id', 'object_id', 'actor_id');
+
+ if (!in_array($filter, $conditionFilters))
+ {
+ $query->where($db->quoteName($filter) . ' IN (' . $filterValue . ')');
+ }
+ else
+ {
+ $whereClause[] = $db->quoteName($filter) . " IN (" . $filterValue . ")";
+ }
+ }
}
+
+ if (!empty($whereClause))
+ {
+ $whereClause = '(' . implode(' OR ', $whereClause) . ')';
+ }
+
+ $query->where($whereClause);
}
// Return results from specified date
From fbb4387af2de0bc190348d8f917e3dd0963ea24d Mon Sep 17 00:00:00 2001
From: Deepa
Date: Fri, 8 Feb 2019 16:59:15 +0530
Subject: [PATCH 3/3] Release version 1.0.1
---
plugins/api/tjactivity/tjactivity.xml | 6 +++---
src/activitystream.xml | 4 ++--
src/plugins/privacy/activitystream/activitystream.xml | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/api/tjactivity/tjactivity.xml b/plugins/api/tjactivity/tjactivity.xml
index 9dd4036..c700ecb 100755
--- a/plugins/api/tjactivity/tjactivity.xml
+++ b/plugins/api/tjactivity/tjactivity.xml
@@ -1,12 +1,12 @@
com_api_tjactivity
- 1.0.0
- 16th Nov 2018
+ 1.0.1
+ 8th Feb 2019
Techjoomla
extensions@techjoomla.com
https://techjoomla.com
- Copyright (C) 2016 - 2018 Techjoomla. All rights reserved.
+ Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
PLG_API_TJACTIVITY_DESCRIPTION
diff --git a/src/activitystream.xml b/src/activitystream.xml
index 8e703a9..2bb1b90 100755
--- a/src/activitystream.xml
+++ b/src/activitystream.xml
@@ -2,11 +2,11 @@
com_activitystream
- 16th Nov 2018
+ 8th Feb 2019
Techjoomla
extensions@techjoomla.com
https://techjoomla.com
- Copyright (C) 2016 - 2018 Techjoomla. All rights reserved.
+ Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
1.0.1
diff --git a/src/plugins/privacy/activitystream/activitystream.xml b/src/plugins/privacy/activitystream/activitystream.xml
index bdfe35a..8d08e61 100644
--- a/src/plugins/privacy/activitystream/activitystream.xml
+++ b/src/plugins/privacy/activitystream/activitystream.xml
@@ -2,11 +2,11 @@
plg_privacy_activitystream
1.0.1
- 16th Nov 2018
+ 8th Feb 2019
Techjoomla
extensions@techjoomla.com
https://techjoomla.com
- Copyright (C) 2016 - 2018 Techjoomla. All rights reserved.
+ Copyright (C) 2016 - 2019 Techjoomla. All rights reserved.
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
PLG_PRIVACY_ACTIVITYSTREAM_XML_DESCRIPTION