Coder Social home page Coder Social logo

semanticmediawiki / semantictasks Goto Github PK

View Code? Open in Web Editor NEW
7.0 11.0 6.0 425 KB

Provides email task notifications and reminders

Home Page: https://www.mediawiki.org/wiki/Extension:Semantic_Tasks

License: GNU General Public License v2.0

JavaScript 1.68% PHP 89.56% Shell 8.76%
st notifications smw semantic mw semantic-mediawiki e-mail

semantictasks's Introduction

Semantic Tasks

Build Status Code Coverage Scrutinizer Quality Score Latest Stable Version Packagist download count

Semantic Tasks (a.k.a. ST) is a Semantic Mediawiki extension that provides task notification and reminder emails with the help of semantic annotations.

In contrast to the built in notification systems in MediaWiki (watching pages), this extension can be used to trigger notifications without user interaction with the MediaWiki system, e. g. by filling in a form (using the PageForms extension) where a user name is entered in a form and in the resulting template the respective properties are set to trigger a email notification (see below).

Requirements

  • PHP 7.3 or later
  • MediaWiki 1.35 or later
  • Semantic MediaWiki 3.2 or later

Installation

The recommended way to install Semantic Tasks is using Composer with MediaWiki's built-in support for Composer.

Note that the required extension Semantic MediaWiki must be installed first according to the installation instructions provided.

Step 1

Change to the base directory of your MediaWiki installation. If you do not have a "composer.local.json" file yet, create one and add the following content to it:

{
	"require": {
		"mediawiki/semantic-tasks": "~2.0"
	}
}

If you already have a "composer.local.json" file add the following line to the end of the "require" section in your file:

"mediawiki/semantic-tasks": "~2.0"

Remember to add a comma to the end of the preceding line in this section.

Step 2

Run the following command in your shell:

php composer.phar update --no-dev

Note if you have Git installed on your system add the --prefer-source flag to the above command.

Step 3

Add the following line to the end of your "LocalSettings.php" file:

wfLoadExtension( 'SemanticTasks' );

Step 4

You must run a cron job e.g. once a day to trigger the reminders to be sent by e-mail. To do so add the following line to your crontab to execute the respective script every day at 12:

0 12 * * * php /path/to/SemanticTasks/maintenance/checkForReminders.php

Step 5

It is possible to adapt the names of the properties for your wiki via configuration in the "LocalSettings.php" file. This is an optional step if you would like to use different property names. This is the list of default settings:

  • $stgPropertyAssignedTo = 'Assigned to';
  • $stgPropertyCarbonCopy = 'Carbon copy';
  • $stgPropertyTargetDate = 'Target date';
  • $stgPropertyReminderAt = 'Reminder at';
  • $stgPropertyStatus = 'Status';
  • $stgPropertyAssignedToGroup = 'Assigned to group';
  • $stgPropertyHasAssignee = 'Has assignee';

Configuration

  • SemanticTasksNotifyIfUnassigned - (default: false) If set to true will notify users being unassigned from tasks
  • $stgNotificationFromSystemAddress - (default: false) If set to true will use $wgSiteName and $wgPasswordSender for notification emails From field

Usage

Notification emails

They are sent as soon a page is saved. The system looks for the [[Assigned to::*]], [[Carbon copy::*]] and/or [[Assigned to group::*]] properties.

Groups

Create a group page with properties [[Has assignee::*]] and then assign the group to the task with [[Assigned to group::*]] property.

Status

Set Status to [[Status::Closed]] to inform assignees that the task has been closed and to disable notifications and reminders.

Reminder emails

Once the script execution is triggered via cron the software looks for the [[Reminder at::*]] and the [[Target date::*]] property. It then sends reminders to all the assignees.

Contribution and support

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guideline.

Version history

See release notes.

Credits

Semantic Tasks was initially created by Steren Giannini for Creative Commons. Later it was sponsored by KDZ - Centre for Public Administration Research, with most upgrade work done by Peter Grassberger. Currently it is sponsored by KM-A Knowledge Management Associates, with most upgrade work done by thomas-topway-it.

License

GNU General Public License, version 2 or later, see COPYING file.

semantictasks's People

Contributors

dependabot[bot] avatar hashar avatar jeroendedauw avatar kghbln avatar krabina avatar ladsgroup avatar legoktm avatar mtyeh411 avatar mwjames avatar nikitarana07 avatar petertheone avatar reedy avatar shirayuki avatar siebrand avatar thomas-topway-it avatar tosfos avatar translatewiki avatar umherirrender avatar vedmaka avatar yaronkoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semantictasks's Issues

Edit API broken

Setup

  • MediaWiki | 1.34.0-rc.1 (8c60cd5)19:12, 18 November 2019
  • PHP | 7.2.24-0ubuntu0.18.04.1 (apache2handler)
  • MariaDB | 10.1.41-MariaDB-0ubuntu0.18.04.1
  • Semantic MediaWiki | 3.2.0-alpha (9a9a3d5) 15:40, 25 November 2019
  • Semantic Tasks | 2.0.0-alpha (cb85bb1) 15:15, 25 November 2019

Issue

API error - Error at /../w/extensions/SemanticTasks/src/Assignees.php(211)

Seen here: https://sandbox.semantic-mediawiki.org/wiki/GeoJson:Berlin

Steps to reproduce: login in and add marker to map

image

Backtrace

#0 /../w/extensions/SemanticTasks/src/Assignees.php(45): ST\Assignees->getProperties(string, WikiPage, Revision)
#1 /../w/extensions/SemanticTasks/src/Assignees.php(25): ST\Assignees->getCurrentAssignees(WikiPage, NULL)
#2 /../w/includes/Hooks.php(174): ST\Assignees->saveAssignees(WikiPage, User, Maps\MediaWiki\Content\GeoJsonContent, CommentStoreComment, integer, NULL, NULL, integer, Status)
#3 /../w/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#4 /../w/includes/Storage/PageUpdater.php(736): Hooks::run(string, array)
#5 /../w/includes/page/WikiPage.php(1931): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#6 /../w/includes/EditPage.php(2341): WikiPage->doEditContent(Maps\MediaWiki\Content\GeoJsonContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#7 /../w/includes/EditPage.php(1617): EditPage->internalAttemptSave(array, boolean)
#8 /../w/includes/api/ApiEditPage.php(383): EditPage->attemptSave(array)
#9 /../w/includes/api/ApiMain.php(1598): ApiEditPage->execute()
#10 /../w/includes/api/ApiMain.php(537): ApiMain->executeAction()
#11 /../w/includes/api/ApiMain.php(508): ApiMain->executeActionWithErrorHandling()
#12 /../w/api.php(87): ApiMain->execute()
#13 {main}

Class 'ST\Assignees' not found

Setup and configuration

  • MediaWiki | 1.34.0-rc.0 (366bf66)22:03, 15 October 2019
  • PHP | 7.2.19-0ubuntu0.18.04.2 (apache2handler)
  • MariaDB | 10.1.41-MariaDB-0ubuntu0.18.04.1
  • Semantic Tasks master

Issue

Error from line 65 of /../w/extensions/SemanticTasks/SemanticTasks.php: Class 'ST\Assignees' not found

This happens after upgrading from MW 1.33 to MW 1.34

Backtrace

#0 /../w/includes/Setup.php(896): SemanticTasks::onExtensionFunction()
#1 /../w/maintenance/doMaintenance.php(83): require_once(string)
#2 /../w/maintenance/update.php(277): require_once(string)
#3 {main}

E-Mails are sent on null edits

Setup and configuration

  • SMW version:3.1.1
  • ST version:2.0
  • MW version:1.31
  • PHP version: 7.2.14 (fpm-fcgi)
  • DB (MySQL etc. and version):MySQL | 5.5.62-cll

Issue

E-Mails are sent, even if null edits happen. This should not be the case. The diff that is sent is the diff of the last edit, not the actual diff (that should be empty).

Steps to reproduce the observation (recommendation is to use the sandbox):
Klick on edit on a page, then save without an edit. The null edit is not shown in the version history of MediaWiki and therefore should not send an e-mail.

On creation of new page, 2 emails are sent

Setup and configuration

  • SMW version: 3.1.1
  • ST version: 2.0
  • MW version: 1.31
  • PHP version: 7.1.26 (fpm-fcgi)
  • DB (MySQL etc. and version): MySQL | 5.5.62-cll

Issue

When a new page is created and at the same time a task is assigned, two e-mails are send.

Steps to reproduce the observation:
Creat a new page "Test" with the content
[[Assigned to::User:Krabina]]
Then User:Krabina will get 2 E-Mails

One titled "New task: Test", one with "Assigned task:Test".

Only one e-mail shoudl be sent in this case

Make "ST_CheckForReminders.php" obey generic script parameters

Setup and configuration

  • MediaWiki | 1.32.1 (c6f078c)05:11, 11. Mai 2019
  • PHP | 7.2.17-0ubuntu0.18.04.1 (apache2handler)
  • MariaDB | 10.1.38-MariaDB-0ubuntu0.18.04.2
  • Semantic MediaWiki | 3.1.0-alpha (81df573) 14:51, 13. Mai 2019
  • SemanticTasks | 2.0.0-alpha (7f4b7e3) 09:47, 16. Mai 2019

Issue

php ST_CheckForReminders.php -- quiet

still returns the "ST check for reminders" message.

I guess it will be good to move the script to the "maintenance" directory and rename it to "checkForReminders.php" at the same time. Since we are looking at a breaking release anyways ...

On Page creation with assigned User no mail is send

Setup and configuration

  • SMW version: 3.0.2
  • ST version: 9e5b4b3
  • MW version: 1.32.1
  • PHP version: 7.2.16-1+020190307202415.17+stretch1.gbpa7be82+wmf1 (apache2handler)
  • DB (MySQL etc. and version): MariaDB 10.1.38-MariaDB-0+deb9u1

Issue

Steps to reproduce: Create a page with content: [[Assigned to::User:Admin]].
Expected result: An Email is send.
What happens: No Email is send.

It works on page edit but not on new page.

getNewAssignees is called but getCurrentAssignees doesn't return any assignees. Could it be that on PageContentSaveComplete Hook there are no properties saved yet for new pages? Is there a better hook to use instead? I don't know how to explain that.

Call to undefined method DifferenceEngine::getOldRevision()

Setup and configuration

  • SMW version: 3.1.0
  • ST version: 2.0.0-alpha (4993064) 17:09, 17. Sep. 2019
  • MW version: 1.31.4
  • PHP version: 7.1.26 (fpm-fcgi)
  • DB (MySQL etc. and version): MySQL | 5.5.62-cll

Issue

 /index.php?title=60116_-_Projektbeginn&action=formedit Error from line 209 of /home/kdz/intern/extensions/SemanticTasks/src/SemanticTasksMailer.php: Call to undefined method DifferenceEngine::getOldRevision()

Backtrace

#0. extensions/SemanticTasks/src/SemanticTasksMailer.php(159): ST\SemanticTasksMailer::generateDiffBodyTxt(Title)
#1. extensions/SemanticTasks/src/SemanticTasksMailer.php(119): ST\SemanticTasksMailer::mailNotification(array, string, Title, User, integer)
#2 extensions/SemanticTasks/src/SemanticTasksMailer.php(65): ST\SemanticTasksMailer::mailAssignees(WikiPage, WikitextContent, User, integer, ST\Assignees)
#3 extensions/SemanticTasks/SemanticTasks.php(74): ST\SemanticTasksMailer::mailAssigneesUpdatedTask(ST\Assignees, WikiPage, User, WikitextContent, string, integer, NULL, NULL, integer)
#4 /includes/Hooks.php(177): SemanticTasks::{closure}(WikiPage, User, WikitextContent, string, integer, NULL, NULL, integer, Revision, Status, boolean, integer)
#5 /includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#6 /includes/page/WikiPage.php(1853): Hooks::run(string, array)
#7 [internal function]: WikiPage->{closure}(Wikimedia\Rdbms\DatabaseMysqli, string)
#8 /includes/libs/rdbms/database/Database.php(3664): call_user_func_array(Closure, array)
#9 /includes/deferred/AtomicSectionUpdate.php(35): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#10 /includes/deferred/DeferredUpdates.php(259): AtomicSectionUpdate->doUpdate()
#11 /home/kdz/intern/includes/deferred/DeferredUpdates.php(210): DeferredUpdates::runUpdate(AtomicSectionUpdate, Wikimedia\Rdbms\LBFactorySimple, string, integer)
#12 /includes/deferred/DeferredUpdates.php(127): DeferredUpdates::execute(array, string, integer)
#13 /includes/MediaWiki.php(606): DeferredUpdates::doUpdates(string, integer)
#14 /includes/MediaWiki.php(575): MediaWiki::preOutputCommit(RequestContext, Closure)
#15 /includes/MediaWiki.php(877): MediaWiki->doPreOutputCommit(Closure)
#16 /includes/MediaWiki.php(524): MediaWiki->main()
#17 /index.php(42): MediaWiki->run()
#18 {main}

Steps to reproduce

  1. Create a new page with property "Assigned to" some User. No E-Mail is sent.
  2. Other user edits the page. The error is displayed, however the changes in the page are saved. No E-Mail is sent.

Make 2.0.0 release

Tracking issue for the 2.0.0 release.

  • Write RELEASE NOTES
  • Update "README.md"
  • Update "/docs/"
  • Update "composer.json"
  • Update version number "extension.json"
  • Create tag
  • Add release to Wikidata
  • Update homepage
  • Announce via mail
  • Do a release tweet on Twitter
  • Run composer update on smw.o
  • Update "LocalSettings.php"
  • Start development of new version
    • Update "extension.json" (new alpha version)

(todo list copied from latest release of the SIL Extension)

ST sends out E-Mails on minor edits

Setup and configuration

Software Version
MediaWiki 1.35.4
PHP 7.3.30 (fpm-fcgi)
MariaDB 10.3.31-MariaDB
ICU 50.2
Semantic MediaWiki 3.2.3 (5619c2d) 00:40, 30. Mär. 2021
Semantic Tasks 2.0.1 (d43fcef) 00:02, 27. Nov. 2020

Issue

After upgrading from MW 1.31 to MW 1.35, ST sends out e-mail notifications even if "minor edit" is checked.

Desired behaviour is that on minor edits, no e-mail is sent (as it was iin MW 1.31)

Eliminate dependency on cron jobs for sending mails

Feature request:

I have never used this, but according to the documentation, you would have to setup a cron job in order to execute a mail delivery on a date you set for a task.

I just recently was pointed by @hexmode to this extension: https://github.com/hallowelt/mwstake-mediawiki-component-runjobstrigger
As far as I understand it, this could be used by Semantic Tasks so a MediaWiki job would be created to send notification e-mails instead of a cron job. But I might be wrong.

ST not compatible with SMW 4.x

Issue

The current version of ST seems not to be compatible with SMW 4.x. If you enable it, the following error shows:

[4f2023c3f2d606fb4f7f4520] /wiki/ Error from line 66 of ../extensions/SemanticTasks/SemanticTasks.php: Class 'ST\Assignees' not found

Backtrace:

#0 /var/www/km-a/1.35.6/includes/Setup.php(806): SemanticTasks::onExtensionFunction()
#1 /var/www/km-a/1.35.6/includes/WebStart.php(89): require_once(string)
#2 /var/www/km-a/1.35.6/index.php(44): require(string)
#3 {main}

Allow custom property mapping

Setup and configuration

  • MediaWiki | 1.32.1 (c6f078c)05:11, 11. Mai 2019
  • PHP | 7.2.17-0ubuntu0.18.04.1 (apache2handler)
  • MariaDB | 10.1.38-MariaDB-0ubuntu0.18.04.2
  • Semantic MediaWiki | 3.1.0-alpha (81df573) 14:51, 13. Mai 2019
  • SemanticTasks | 2.0.0-alpha (7f4b7e3) 09:47, 16. Mai 2019

Issue

If I understand correctly the properties "Assigned to", "Carbon copy", "Reminder at" and "Target date" are hard coded, i.e. cannot be changed. I believe it will be a very good improvement if this could be either configured or changed via dedicated system messages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.