Index: trunk/extensions/SemanticTasks/SemanticTasks.php |
— | — | @@ -1,10 +1,15 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | if ( !defined( 'MEDIAWIKI' ) ) { |
5 | | - echo "Not a valid entry point"; |
6 | | - exit( 1 ); |
| 5 | + echo "Not a valid entry point"; |
| 6 | + exit( 1 ); |
7 | 7 | } |
8 | 8 | |
| 9 | +if ( !defined( 'SMW_VERSION' ) ) { |
| 10 | + echo "This extension requires Semantic MediaWiki to be installed."; |
| 11 | + exit( 1 ); |
| 12 | +} |
| 13 | + |
9 | 14 | # |
10 | 15 | # This is the path to your installation of SemanticTasks as |
11 | 16 | # seen from the web. Change it if required ($wgScriptPath is the |
— | — | @@ -18,7 +23,7 @@ |
19 | 24 | 'path' => __FILE__, |
20 | 25 | 'name' => 'SemanticTasks', |
21 | 26 | 'author' => 'Steren Giannini, Ryan Lane', |
22 | | - 'version' => '1.3', |
| 27 | + 'version' => '1.4', |
23 | 28 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Tasks', |
24 | 29 | 'descriptionmsg' => 'semantictasks-desc', |
25 | 30 | ); |
— | — | @@ -34,8 +39,8 @@ |
35 | 40 | $wgAutoloadClasses['SemanticTasksMailer'] = $dir . 'SemanticTasks.classes.php'; |
36 | 41 | |
37 | 42 | function SemanticTasksSetupExtension() { |
38 | | - global $wgHooks; |
39 | | - $wgHooks['ArticleSaveComplete'][] = 'SemanticTasksMailer::mailAssigneesUpdatedTask'; |
| 43 | + global $wgHooks; |
| 44 | + $wgHooks['ArticleSaveComplete'][] = 'SemanticTasksMailer::mailAssigneesUpdatedTask'; |
40 | 45 | $wgHooks['ArticleSave'][] = 'SemanticTasksMailer::findOldValues'; |
41 | | - return true; |
| 46 | + return true; |
42 | 47 | } |
Index: trunk/extensions/SemanticTasks/ST_CheckForReminders.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | require_once( "$IP/maintenance/commandLine.inc" ); |
8 | 8 | |
9 | 9 | global $smwgIP; |
10 | | -require_once( $smwgIP . 'includes/SMW_Factbox.php' ); |
| 10 | +require_once( $smwgIP . '/includes/SMW_Factbox.php' ); |
11 | 11 | |
12 | 12 | require_once( dirname( __FILE__ ) . '/SemanticTasks.classes.php' ); |
13 | 13 | |
Index: trunk/extensions/SemanticTasks/SemanticTasks.classes.php |
— | — | @@ -1,5 +1,15 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 5 | + echo "Not a valid entry point"; |
| 6 | + exit( 1 ); |
| 7 | +} |
| 8 | + |
| 9 | +if ( !defined( 'SMW_VERSION' ) ) { |
| 10 | + echo "This extension requires Semantic MediaWiki to be installed."; |
| 11 | + exit( 1 ); |
| 12 | +} |
| 13 | + |
4 | 14 | // constants for message type |
5 | 15 | define( "NEWTASK", 0 ); |
6 | 16 | define( "UPDATE", 1 ); |
— | — | @@ -15,7 +25,7 @@ |
16 | 26 | |
17 | 27 | function findOldValues( &$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags ) { |
18 | 28 | $title = $article->getTitle(); |
19 | | - $title_text = $title->getText(); |
| 29 | + $title_text = $title->getFullText(); |
20 | 30 | |
21 | 31 | $assignees = self::getAssignees( 'Assigned to', $title_text, $user ); |
22 | 32 | $status = self::getStatus( 'Status', $title_text, $user ); |
— | — | @@ -60,7 +70,8 @@ |
61 | 71 | self::printDebug( "Saved task status: " . self::$task_status ); |
62 | 72 | |
63 | 73 | $title = $article->getTitle(); |
64 | | - $title_text = $title->getText(); |
| 74 | + $title_text = $title->getPrefixedText(); |
| 75 | + self::printDebug( "Title text: $title_text" ); |
65 | 76 | |
66 | 77 | $assignees_to_task = array(); |
67 | 78 | $current_assignees = self::getAssignees( 'Assigned to', $title_text, $user ); |
— | — | @@ -251,7 +262,7 @@ |
252 | 263 | // i18n |
253 | 264 | wfLoadExtensionMessages( 'SemanticTasks' ); |
254 | 265 | |
255 | | - $title_text = $title->getText(); |
| 266 | + $title_text = $title->getFullText(); |
256 | 267 | $from = new MailAddress( $user->getEmail(), $user->getName() ); |
257 | 268 | $link = $title->escapeFullURL(); |
258 | 269 | |
— | — | @@ -320,8 +331,10 @@ |
321 | 332 | wfLoadExtensionMessages( 'SemanticTasks' ); |
322 | 333 | |
323 | 334 | // We use the Semantic MediaWiki Processor |
| 335 | + // $smwgIP is defined by Semantic MediaWiki, and we don't allow |
| 336 | + // this file to be sourced unless Semantic MediaWiki is included. |
324 | 337 | global $smwgIP; |
325 | | - include_once( $smwgIP . "includes/SMW_QueryProcessor.php" ); |
| 338 | + include_once( $smwgIP . "/includes/SMW_QueryProcessor.php" ); |
326 | 339 | |
327 | 340 | $params = array(); |
328 | 341 | $inline = true; |