[MediaWiki-commits] [Gerrit] mediawiki...SemanticGenealogy[master]: Fixing Umherirrender remarks

2017-08-08 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370638 )

Change subject: Fixing Umherirrender remarks
..

Fixing Umherirrender remarks

Change-Id: Ic83e52fa90497f535ebe6d63160fac1d386c0b7d
---
M .gitignore
M Gruntfile.js
M composer.json
3 files changed, 5 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/38/370638/1

diff --git a/.gitignore b/.gitignore
index 9e6e403..b123629 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,4 @@
 node_modules/
 vendor/
-
-.svn
-*~
-*.kate-swp
-.*.swp
-vendor
-node_modules
+composer.lock
 styles/.sass-cache/
diff --git a/Gruntfile.js b/Gruntfile.js
index 39ed369..77314df 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,6 +2,8 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
 
+   require('load-grunt-tasks')(grunt);
+
grunt.initConfig({
banana: {
all: 'i18n/'
@@ -49,5 +51,4 @@
grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'jshint' ] );
grunt.registerTask( 'default', [ 'clean', 'sass', 'test' ] );
 
-   require('load-grunt-tasks')(grunt);
 };
diff --git a/composer.json b/composer.json
index 3eac7bb..a996d54 100644
--- a/composer.json
+++ b/composer.json
@@ -27,10 +27,10 @@
 "squizlabs/php_codesniffer": "3.0.1"
 },
 "scripts": {
-"check": [
+"test": [
 "phpcs --standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki 
--extensions=php,php5,inc --ignore=vendor -p ."
 ],
-"patch": [
+"fix": [
 "phpcbf 
--standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki 
--extensions=php,php5,inc --ignore=vendor -p ."
 ]
 },

-- 
To view, visit https://gerrit.wikimedia.org/r/370638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic83e52fa90497f535ebe6d63160fac1d386c0b7d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticGenealogy
Gerrit-Branch: master
Gerrit-Owner: Wilkins 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SemanticGenealogy[master]: Patch for the previous commit in review

2017-08-08 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370632 )

Change subject: Patch for the previous commit in review
..

Patch for the previous commit in review

Handling Kghbln comments
- https urls
- removing shim
- compatibiliy with MediaWiki 1.23+
- some cleanup
- merging INSTALL into README

Change-Id: I12e27d9f1ce001934382cae0c34659d32ec1
---
D INSTALL
M README.md
D SemanticGenealogy.i18n.php
M SemanticGenealogy.php
4 files changed, 108 insertions(+), 93 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/32/370632/1

diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 459c84a..000
--- a/INSTALL
+++ /dev/null
@@ -1,20 +0,0 @@
-
-== Requirements ==
-
-Semantic Genealogy requires:
-* MediaWiki 1.19 or above
-* Semantic MediaWiki 1.17 or above
-* PHP 5.3 or above
-
-
-== Installation ==
-
-Installation instructions are available online in a more convenient form for
-reading at https://www.mediawiki.org/wiki/Extension:SemanticGenalogy
-
-Copy all files into MediaWiki's extensions folder, either by using Git or by
-extracting an installation package. You need to enter one line to your local
-settings (somewhere after the inclusion of Semantic MediaWiki):
-
-// Semantic Genealogy
-require_once( "$IP/extensions/SemanticGenealogy/SemanticGenealogy.php" );
diff --git a/README.md b/README.md
index 619f185..8c61cb1 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,95 @@
 Semantic Genealogy
 ==
-THIS EXTENSION IS CURRENTLY IN DEVELOPMENT AND IS NOT DONE TO BE USED IN A 
PRODUCTION ENVIRONMENT. BREAKING CHANGES CAN BE INTRODUCED !
 
+Features
+
 
-### Features
-* Special page to generate a FamilyTree
+* Special page to generate a FamilyTree : `Special:FamilyTree`
 * Include FamilyTree inside pages with a wiki code
 * Several Trees: Ancestors Tree, Descendants Tree, Relation Link Tree, 
Descendants list
 * Several Styles: Simple, Boxes
 * GEDCOM file format export
 
 
-### Authors
-* Thomas Pellissier Tanon  (Maintainer)
+Requirements
+
+
+Semantic Genealogy requires:
+* MediaWiki 1.23 or above
+* Semantic MediaWiki 1.7 or above
+* PHP 5.4 or above
 
 
-### Links
+Installation
+
+
+ Installation from source
+
+Installation instructions are available online in a more convenient form for
+reading at https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy
+
+Copy all files into MediaWiki's extensions folder, either by using Git or by
+extracting an installation package. You need to enter one line to your local
+settings (somewhere after the inclusion of Semantic MediaWiki):
+
+
+ Installation from composer
+
+Not yet.
+
+
+Configuration
+-
+
+```php
+// Semantic Genealogy
+require_once "$IP/extensions/SemanticGenealogy/SemanticGenealogy.php";
+
+// Insert the $wgGenealogicalProperties array to specify which Semantic 
properties match which concept.
+// The properties can differ if you used personnal nouns that fit your 
language.
+
+// Here is an example of a french configuration
+$wgGenealogicalProperties = array(
+'givenname' => 'Prenom',
+'surname' => 'Nom',
+'nickname' => 'Surnom',
+'sex' => 'Sexe',
+'birthdate' => 'Datenaissance',
+'birthplace' => 'Lieunaissance',
+'deathdate' => 'Datedeces',
+'deathplace' => 'Lieudeces',
+'father' => 'Pere',
+'mother' => 'Mere',
+'partner' => 'Conjoint'
+);
+
+// Here is an example of an english configuration
+$wgGenealogicalProperties = array(
+'givenname' => 'Firstname',
+'surname' => 'Lastname',
+'nickname' => 'Nickname',
+'sex' => 'Sex',
+'birthdate' => 'date of birth',
+'birthplace' => 'place of birth',
+'deathdate' => 'date of death',
+'deathplace' => 'place of death',
+'father' => 'Father',
+'mother' => 'Mother',
+'partner' => 'Conjoint'
+);
+
+```
+
+
+Authors
+---
+
+* Thomas Pellissier Tanon  (Author, Maintainer)
+* Thibault Taillandier  (Developer)
+
+
+Links
+-
+
 * Official extension page : 
https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy
 
diff --git a/SemanticGenealogy.i18n.php b/SemanticGenealogy.i18n.php
deleted file mode 100644
index d127f33..000
--- a/SemanticGenealogy.i18n.php
+++ /dev/null
@@ -1,44 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = [];
-if ( !function_exists( 

[MediaWiki-commits] [Gerrit] mediawiki...SemanticGenealogy[master]: Patch for the previous commit in review - fixing syntax base...

2017-08-07 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370594 )

Change subject: Patch for the previous commit in review - fixing syntax based 
on codesniffer v0.10 - deleting composer.lock
..

Patch for the previous commit in review
- fixing syntax based on codesniffer v0.10
- deleting composer.lock

Change-Id: I726a246e89c8b5b381f7ff1233ca59019ae86d57
---
M Gedcom5FilePrinter.php
M Gedcom5ResultPrinter.php
M GenealogicalFilePrinter.php
M PersonPageValues.php
M SemanticGenealogy.alias.php
M SemanticGenealogy.body.php
M SemanticGenealogy.i18n.php
M SemanticGenealogy.php
M SemanticGenealogyException.php
M SpecialFamilyTree.php
M Tools.php
M composer.json
D composer.lock
M src/Decorator/BoxDecorator.php
M src/Decorator/SimpleDecorator.php
M src/Decorator/TreeDecorator.php
M src/Decorator/TreeDecoratorFactory.php
M src/Tree/AncestorsFamilyTree.php
M src/Tree/DescendantFamilyTree.php
M src/Tree/DescendantListFamilyTree.php
M src/Tree/FamilyTree.php
M src/Tree/FamilyTreeFactory.php
M src/Tree/LinkFamilyTree.php
23 files changed, 319 insertions(+), 352 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/94/370594/1

diff --git a/Gedcom5FilePrinter.php b/Gedcom5FilePrinter.php
index e13811e..47b3787 100644
--- a/Gedcom5FilePrinter.php
+++ b/Gedcom5FilePrinter.php
@@ -11,11 +11,10 @@
  * @licence GNU GPL v2+
  * @author  Thomas Pellissier Tanon 
  */
-class Gedcom5FilePrinter extends GenealogicalFilePrinter
-{
+class Gedcom5FilePrinter extends GenealogicalFilePrinter {
 
-   protected $families = array();
-   protected $familiesByPerson = array();
+   protected $families = [];
+   protected $familiesByPerson = [];
 
/**
 * Set file in $this->file property
@@ -23,7 +22,6 @@
 * @return void
 */
protected function setFile() {
-
$this->setFamiliesList();
 
$this->addHead();
@@ -42,20 +40,25 @@
 * @return void
 */
protected function setFamiliesList() {
-
foreach ( $this->people as $child ) {
-   $id = $this->getFamilyIdForChild( $child );
-   if ( $id != '0S0' ) {
-   $this->addChildToFamily( $id, $child );
-   list( $fatherId, $motherId ) = explode( 'S', 
$id );
-   $this->addFamilyToPerson( $id, $fatherId );
-   $this->addFamilyToPerson( $id, $motherId );
+   $familyId = $this->getFamilyIdForChild( $child );
+   if ( $familyId != '0S0' ) {
+   $this->addChildToFamily( $familyId, $child );
+   list( $fatherId, $motherId ) = explode( 'S', 
$familyId );
+   $this->addFamilyToPerson( $familyId, $fatherId 
);
+   $this->addFamilyToPerson( $familyId, $motherId 
);
}
}
}
 
+   /**
+* Get the family Id if the given child
+*
+* @param object $child the PersonPageValues object of the child
+*
+* @return string the key
+*/
protected function getFamilyIdForChild( PersonPageValues $child ) {
-
$key = '';
if ( $child->father instanceof SMWDIWikiPage
&& isset( 
$this->people[$child->father->getTitle()->getArticleID()] ) ) {
@@ -78,36 +81,51 @@
return $key;
}
 
+   /**
+* Adds a child to a family
+*
+* @param string $familyKey the family key
+* @param object $child the PersonPageValues object of the child to add
+*
+* @return void
+*/
protected function addChildToFamily( $familyKey, PersonPageValues 
$child ) {
-
$childId = $child->title->getArticleID();
if ( isset( $this->families[$familyKey] ) ) {
if ( !in_array( $childId, $this->families[$familyKey] ) 
) {
$this->families[$familyKey][] = $childId;
}
} else {
-   $this->families[$familyKey] = array( $childId );
+   $this->families[$familyKey] = [ $childId ];
}
}
 
+   /**
+* Adds a family to a person
+*
+* @param integer $familyId the id of the family
+* @param integer $personId the id of the person
+*
+* @return void
+*/
protected function addFamilyToPerson( $familyId, $personId ) {
-
if ( $personId != 0 ) {
if ( isset( $this->familiesByPerson[$personId] ) ) {
if ( !in_array( $familyId, 

[MediaWiki-commits] [Gerrit] Correcting notice and refactoring the SpecialPage form - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245912

Change subject: Correcting notice and refactoring the SpecialPage form
..

Correcting notice and refactoring the SpecialPage form

Change-Id: I29880189fe1c69a7cbdd4a4723da20011bc09341
---
M FamilyTreeTag.php
M SpecialFamilyTree.php
2 files changed, 42 insertions(+), 27 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/12/245912/1

diff --git a/FamilyTreeTag.php b/FamilyTreeTag.php
index d4e34ab..264b6ef 100644
--- a/FamilyTreeTag.php
+++ b/FamilyTreeTag.php
@@ -54,9 +54,11 @@
 $familytree->setPerson($args[self::ATTR_PERSON]);
 $familytree->setNumberOfGenerations($args[self::ATTR_DEPTH]);
 
-$personName2 = $args[self::ATTR_PERSON2];
-if ($personName2) {
-$familytree->setPerson2($personName2);
+if (isset($args[self::ATTR_PERSON2])) {
+$personName2 = $args[self::ATTR_PERSON2];
+if ($personName2) {
+$familytree->setPerson2($personName2);
+}
 }
 
 $familytree->render();
diff --git a/SpecialFamilyTree.php b/SpecialFamilyTree.php
index 8b0a380..cee36c8 100644
--- a/SpecialFamilyTree.php
+++ b/SpecialFamilyTree.php
@@ -34,10 +34,9 @@
  */
 public function execute($par)
 {
-global $wgRequest, $wgScript;
+global $wgRequest;
 
 $this->setHeaders();
-$output = $this->getOutput();
 
 if ($par != '') {
 $parts = explode('/', urldecode($par));
@@ -63,9 +62,41 @@
 $pageName2 = '';
 }
 
+$this->showForm(array('type' => $type, 'pageName' => $pageName, 
'numOfGenerations' => $numOfGenerations, 'pageName2' => $pageName2));
+
+if ($pageName == '') {
+return;
+}
+
+$familytree = FamilyTreeFactory::create($type);
+$familytree->setPerson($pageName);
+
+if ($pageName2) {
+$familytree->setPerson2($pageName2);
+}
+
+$familytree->setOutput($this->getOutput());
+$familytree->setNumberOfGenerations($numOfGenerations);
+
+$familytree->render();
+return Status::newGood();
+}
+
+/**
+ * Display the search form for a genealogy tree
+ * 
+ * @param array $params the array of search parameters
+ *
+ * @return void
+ */
+protected function showForm($params)
+{
+global $wgScript;
+
+$output = $this->getOutput();
 if (!$this->mIncluding) {
 $output->addModules('ext.smg.specialfamilytree');
-$typeSelect = new XmlSelect('type', 'type', $type);
+$typeSelect = new XmlSelect('type', 'type', $params['type']);
 
$typeSelect->addOption(wfMsg('semanticgenealogy-specialfamilytree-type-ancestors'),
 'ancestors');
 
$typeSelect->addOption(wfMsg('semanticgenealogy-specialfamilytree-type-descendant'),
 'descendant');
 
$typeSelect->addOption(wfMsg('semanticgenealogy-specialfamilytree-type-link'), 
'link');
@@ -79,7 +110,7 @@
 
Xml::label(wfMsg('semanticgenealogy-specialfamilytree-label-page'), 'page') .
 Xml::closeElement('th') .
 Xml::openElement('td', array('class' => 'mw-input')) .
-Xml::input('page', 30, $pageName, array( 'class' => 
'smg-input-page' )) .
+Xml::input('page', 30, $params['pageName'], array( 'class' => 
'smg-input-page' )) .
 Xml::closeElement('td') .
 Xml::closeElement('tr') .
 Xml::openElement('tr', array('id' => 'smg-form-entry-type' )) .
@@ -95,7 +126,7 @@
 
Xml::label(wfMsg('semanticgenealogy-specialfamilytree-label-gen'), 'gen') .
 Xml::closeElement('th') .
 Xml::openElement('td', array('class' => 'mw-input')) .
-Xml::input('gen', 2, $numOfGenerations) .
+Xml::input('gen', 2, $params['numOfGenerations']) .
 Xml::closeElement('td') .
 Xml::closeElement('tr') .
 Xml::openElement('tr', array('id' => 'smg-form-entry-page2' )) 
.
@@ -103,7 +134,7 @@
 
Xml::label(wfMsg('semanticgenealogy-specialfamilytree-label-page2'), 'page2') .
 Xml::closeElement('th') .
 Xml::openElement('td', array('class' => 'mw-input')) .
-Xml::input('page2', 30, $pageName2, array( 'class' => 
'smg-input-page' )) .
+Xml::input('page2', 30, $params['pageName2'], array( 'class' 
=> 'smg-input-page' )) .
 Xml::closeElement('td') .
 Xml::closeElement('tr') .
 Xml::closeElement('table') .
@@ -112,24 +143,6 @@
 Xml::closeElement('form')
 );
 }
-
-if ($pageName == '') {
-return;
-   

[MediaWiki-commits] [Gerrit] PSR2 Syntax and one class per file - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245906

Change subject: PSR2 Syntax and one class per file
..

PSR2 Syntax and one class per file

Change-Id: I9aa98b6d408866cf9c440fe1e0dfc95624d5af11
---
M AncestorsFamilyTree.php
M DescendantFamilyTree.php
M FamilyTree.php
M FamilyTreeFactory.php
M FamilyTreeTag.php
A Gedcom5FilePrinter.php
M Gedcom5ResultPrinter.php
M GenealogicalFilePrinter.php
M PersonPageValues.php
M RelationFamilyTree.php
M SemanticGenealogy.alias.php
M SemanticGenealogy.body.php
M SemanticGenealogy.i18n.php
M SemanticGenealogy.php
M SpecialFamilyTree.php
15 files changed, 691 insertions(+), 644 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/06/245906/1

diff --git a/AncestorsFamilyTree.php b/AncestorsFamilyTree.php
index a527e20..25ff254 100644
--- a/AncestorsFamilyTree.php
+++ b/AncestorsFamilyTree.php
@@ -4,7 +4,7 @@
  * AncestorsFamilyTree object
  *
  * Handle a FamilyTree to display the ancestors of the person
- * 
+ *
  * @file AncestorsFamilyTree.php
  * @ingroup SemanticGenealogy
  *
@@ -23,10 +23,10 @@
 public function getAncestors()
 {
 $tree = array();
-$tree[0][1] = new PersonPageValues( $this->person );
+$tree[0][1] = new PersonPageValues($this->person);
 
-for($i = 0; $i < $this->numOfGenerations && $tree[$i] !== null; $i++ ) 
{
-$tree = $this->addGenInTree( $i + 1, $tree );
+for ($i = 0; $i < $this->numOfGenerations && $tree[$i] !== null; $i++) 
{
+$tree = $this->addGenInTree($i + 1, $tree);
 }
 return $tree;
 }
@@ -43,19 +43,20 @@
 $output = $this->getOutput();
 $output->addHTML('');
 $col = 1;
-for( $i = $this->numOfGenerations - 1; $i >= 0; $i-- ) {
-if( isset( $tree[$i] ) ) {
+for ($i = $this->numOfGenerations - 1; $i >= 0; $i--) {
+if (isset( $tree[$i] )) {
 $output->addHTML('');
 foreach ($tree[$i] as $sosa => $person) {
 $output->addHTML('');
-if($person !== null) {
-$output->addHTML($sosa . '' );
- $output->addWikiText( 
$person->getDescriptionWikiText( true ) );
-if($sosa != 1) {
-if($sosa % 2 == 0)
-$output->addHTML( '\\' );
-else
-$output->addHTML( '/' );
+if ($person !== null) {
+$output->addHTML($sosa . '');
+ 
$output->addWikiText($person->getDescriptionWikiText(true));
+if ($sosa != 1) {
+if ($sosa % 2 == 0) {
+$output->addHTML('\\');
+} else {
+$output->addHTML('/');
+}
 }
 }
 $output->addHTML('');
diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php
index ab60323..36c21e4 100644
--- a/DescendantFamilyTree.php
+++ b/DescendantFamilyTree.php
@@ -4,7 +4,7 @@
  * DescandantFamilyTree object
  *
  * Handle a FamilyTree to display the descendants of a person
- * 
+ *
  * @file DescendantFamilyTree.php
  * @ingroup SemanticGenealogy
  *
@@ -20,15 +20,17 @@
  *
  * @return void
  */
-public function outputDescendantLine( $person, $pellissier, $end ) {
+public function outputDescendantLine($person, $pellissier, $end)
+{
 $output = $this->getOutput();
 $children = $person->getChildren();
 $i = 1;
-foreach($children as $child) {
+foreach ($children as $child) {
 $pel = $pellissier . $i . '.';
-$output->addWikiText( $pel . ' ' . $child->getDescriptionWikiText( 
false ) );
-if( $end > 0 )
-$this->outputDescendantLine( $child, $pel, $end - 1);
+$output->addWikiText($pel . ' ' . 
$child->getDescriptionWikiText(false));
+if ($end > 0) {
+$this->outputDescendantLine($child, $pel, $end - 1);
+}
 $i++;
 }
 }
@@ -41,8 +43,8 @@
 public function render()
 {
 $output = $this->getOutput();
-$main = new PersonPageValues( $this->person );
-$output->addWikiText( $main->getDescriptionWikiText( false ) );
-$this->outputDescendantLine( $main, '', $this->numOfGenerations );
+$main = new PersonPageValues($this->person);
+$output->addWikiText($main->getDescriptionWikiText(false));
+$this->outputDescendantLine($main, '', $this->numOfGenerations);
 }
 }
diff --git a/FamilyTree.php b/FamilyTree.php
index ed4d10a..c1c0f3f 100644
--- 

[MediaWiki-commits] [Gerrit] Refactoring the FamilyTree calls with a FamilyTreeFactory in... - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245905

Change subject: Refactoring the FamilyTree calls with a FamilyTreeFactory into 
the SpecialPage and the FamilyTreeTag object
..

Refactoring the FamilyTree calls with a FamilyTreeFactory into the SpecialPage 
and the FamilyTreeTag object

Change-Id: I02693b0020e2e111e3f39b94ee4f5e8530f8127e
---
A AncestorsFamilyTree.php
A DescendantFamilyTree.php
M FamilyTree.php
A FamilyTreeFactory.php
M FamilyTreeTag.php
M PersonPageValues.php
A RelationFamilyTree.php
M SemanticGenealogy.php
M SpecialFamilyTree.php
9 files changed, 597 insertions(+), 362 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/05/245905/1

diff --git a/AncestorsFamilyTree.php b/AncestorsFamilyTree.php
new file mode 100644
index 000..a527e20
--- /dev/null
+++ b/AncestorsFamilyTree.php
@@ -0,0 +1,69 @@
+
+ * @author Thibault Taillandier < thiba...@taillandier.name >
+ */
+class AncestorsFamilyTree extends FamilyTree
+{
+
+/**
+ * List the ancestors of the person for all needed generations
+ *
+ * @return array the generations tree
+ */
+public function getAncestors()
+{
+$tree = array();
+$tree[0][1] = new PersonPageValues( $this->person );
+
+for($i = 0; $i < $this->numOfGenerations && $tree[$i] !== null; $i++ ) 
{
+$tree = $this->addGenInTree( $i + 1, $tree );
+}
+return $tree;
+}
+
+
+/**
+ * Render the tree of ancestors
+ *
+ * @return void
+ */
+public function render()
+{
+$tree = $this->getAncestors();
+$output = $this->getOutput();
+$output->addHTML('');
+$col = 1;
+for( $i = $this->numOfGenerations - 1; $i >= 0; $i-- ) {
+if( isset( $tree[$i] ) ) {
+$output->addHTML('');
+foreach ($tree[$i] as $sosa => $person) {
+$output->addHTML('');
+if($person !== null) {
+$output->addHTML($sosa . '' );
+ $output->addWikiText( 
$person->getDescriptionWikiText( true ) );
+if($sosa != 1) {
+if($sosa % 2 == 0)
+$output->addHTML( '\\' );
+else
+$output->addHTML( '/' );
+}
+}
+$output->addHTML('');
+}
+$output->addHTML('');
+}
+$col *= 2;
+}
+$output->addHTML('');
+}
+}
diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php
new file mode 100644
index 000..ab60323
--- /dev/null
+++ b/DescendantFamilyTree.php
@@ -0,0 +1,48 @@
+
+ * @author Thibault Taillandier < thiba...@taillandier.name >
+ */
+class DescendantFamilyTree extends FamilyTree
+{
+
+/**
+ * List the descendants for all needed generations
+ *
+ * @return void
+ */
+public function outputDescendantLine( $person, $pellissier, $end ) {
+$output = $this->getOutput();
+$children = $person->getChildren();
+$i = 1;
+foreach($children as $child) {
+$pel = $pellissier . $i . '.';
+$output->addWikiText( $pel . ' ' . $child->getDescriptionWikiText( 
false ) );
+if( $end > 0 )
+$this->outputDescendantLine( $child, $pel, $end - 1);
+$i++;
+}
+}
+
+/**
+ * Render the tree of descendants
+ *
+ * @return void
+ */
+public function render()
+{
+$output = $this->getOutput();
+$main = new PersonPageValues( $this->person );
+$output->addWikiText( $main->getDescriptionWikiText( false ) );
+$this->outputDescendantLine( $main, '', $this->numOfGenerations );
+}
+}
diff --git a/FamilyTree.php b/FamilyTree.php
index 63ebb72..ed4d10a 100644
--- a/FamilyTree.php
+++ b/FamilyTree.php
@@ -1,234 +1,142 @@
 
+ * @author  Thomas Pellissier Tanon 
+ * @author  Thibault Taillandier 
  */
-class FamilyTree
+abstract class FamilyTree
 {
 
-private $output;
+protected $output;
+protected $person;
+protected $personName;
+protected $numOfGenerations;
 
+/**
+ * Setter for the person
+ * 
+ * @param string $personName the name of the page of the person
+ *
+ * @return void
+ */
+public function setPerson($personName)
+{
+$this->personName = $personName;
+$this->person = PersonPageValues::getPageFromName($personName);
+}
 
+/**
+ * Setter for the number of generations
+ * 
+ * @param integer $numOfGenerations the number of generations
+ *
+ * @return void
+ */
+public function 

[MediaWiki-commits] [Gerrit] Syntax and documentation (to be continued...) - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245908

Change subject: Syntax and documentation (to be continued...)
..

Syntax and documentation (to be continued...)

Change-Id: I0a21fb890964e7376162b84cb11643d4b8338a84
---
M AncestorsFamilyTree.php
M DescendantFamilyTree.php
M FamilyTreeFactory.php
M FamilyTreeTag.php
M Gedcom5FilePrinter.php
M Gedcom5ResultPrinter.php
M GenealogicalFilePrinter.php
M PersonPageValues.php
M RelationFamilyTree.php
M SemanticGenealogy.alias.php
M SemanticGenealogy.body.php
M SemanticGenealogy.php
12 files changed, 85 insertions(+), 38 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/08/245908/1

diff --git a/AncestorsFamilyTree.php b/AncestorsFamilyTree.php
index 25ff254..3ebc623 100644
--- a/AncestorsFamilyTree.php
+++ b/AncestorsFamilyTree.php
@@ -5,12 +5,12 @@
  *
  * Handle a FamilyTree to display the ancestors of the person
  *
- * @file AncestorsFamilyTree.php
+ * @fileAncestorsFamilyTree.php
  * @ingroup SemanticGenealogy
  *
  * @licence GNU GPL v2+
- * @author Thomas Pellissier Tanon < thoma...@hotmail.fr >
- * @author Thibault Taillandier < thiba...@taillandier.name >
+ * @author  Thomas Pellissier Tanon 
+ * @author  Thibault Taillandier 
  */
 class AncestorsFamilyTree extends FamilyTree
 {
diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php
index 36c21e4..218e269 100644
--- a/DescendantFamilyTree.php
+++ b/DescendantFamilyTree.php
@@ -5,12 +5,12 @@
  *
  * Handle a FamilyTree to display the descendants of a person
  *
- * @file DescendantFamilyTree.php
+ * @fileDescendantFamilyTree.php
  * @ingroup SemanticGenealogy
  *
  * @licence GNU GPL v2+
- * @author Thomas Pellissier Tanon < thoma...@hotmail.fr >
- * @author Thibault Taillandier < thiba...@taillandier.name >
+ * @author  Thomas Pellissier Tanon 
+ * @author  Thibault Taillandier 
  */
 class DescendantFamilyTree extends FamilyTree
 {
diff --git a/FamilyTreeFactory.php b/FamilyTreeFactory.php
index 563c485..f3bcac7 100644
--- a/FamilyTreeFactory.php
+++ b/FamilyTreeFactory.php
@@ -1,9 +1,26 @@
 
+ */
 class FamilyTreeFactory
 {
 
+/**
+ * Create a new FamilyTree object
+ * 
+ * @param string $type the type of the wanted FamilyTree 
+ *
+ * @return object a new FamilyTree Object
+ */
 public static function create($type)
 {
 switch($type) {
@@ -19,6 +36,5 @@
 default:
 $output->addWikiText('' . 
wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . 
'');
 }
-
 }
 }
diff --git a/FamilyTreeTag.php b/FamilyTreeTag.php
index f89ae18..d4e34ab 100644
--- a/FamilyTreeTag.php
+++ b/FamilyTreeTag.php
@@ -5,11 +5,11 @@
  *
  * Handle the  tag using a FamilyTree object
  *
- * @file FamilyTreeTag.php
+ * @fileFamilyTreeTag.php
  * @ingroup SemanticGenealogy
  *
  * @licence GNU GPL v2+
- * @author Thibault Taillandier < thiba...@taillandier.name >
+ * @author  Thibault Taillandier 
  */
 class FamilyTreeTag
 {
@@ -20,7 +20,13 @@
 const ATTR_DEPTH = "depth";
 const ATTR_TYPE = "type";
 
-// Hook our callback function into the parser
+/**
+ * Hook our callback function into the parser
+ *
+ * @param Parser $parser the MW parser
+ *
+ * @return true
+ */
 public static function wfFamilytreeParserInit(Parser $parser)
 {
 // When the parser sees the  tag, it executes
diff --git a/Gedcom5FilePrinter.php b/Gedcom5FilePrinter.php
index 1e8aa4d..433f629 100644
--- a/Gedcom5FilePrinter.php
+++ b/Gedcom5FilePrinter.php
@@ -1,5 +1,16 @@
 
+ */
 class Gedcom5FilePrinter extends GenealogicalFilePrinter
 {
 
@@ -7,7 +18,9 @@
 protected $familiesByPerson = array();
 
 /**
- * set file in $this->file property
+ * Set file in $this->file property
+ *
+ * @return void
  */
 protected function setFile()
 {
@@ -23,6 +36,11 @@
 $this->addRow(0, 'TRLR');
 }
 
+/**
+ * Set Families List
+ *
+ * @return void
+ */
 protected function setFamiliesList()
 {
 $i = 1;
@@ -84,7 +102,7 @@
 }
 
 /**
- * add GEDCOM header
+ * Add GEDCOM header
  */
 protected function addHead()
 {
@@ -109,8 +127,11 @@
 }
 
 /**
- * add the GEDCOM for a person
+ * Add the GEDCOM for a person
+ *
  * @param $person PersonPageValues
+ *
+ * @return void
  */
 protected function addPerson($id, PersonPageValues $person)
 {
diff --git a/Gedcom5ResultPrinter.php b/Gedcom5ResultPrinter.php
index 5e3cceb..48b868e 100644
--- a/Gedcom5ResultPrinter.php
+++ b/Gedcom5ResultPrinter.php
@@ -3,11 +3,11 @@
 /**
  * Printer class for creating GEDCOM exports
  *
- * 

[MediaWiki-commits] [Gerrit] Changing Extension version - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245911

Change subject: Changing Extension version
..

Changing Extension version

Change-Id: I896e30364e507dfe5d4133bef628d9b7457321c8
---
M SemanticGenealogy.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/11/245911/1

diff --git a/SemanticGenealogy.php b/SemanticGenealogy.php
index f45577c..4ac2940 100644
--- a/SemanticGenealogy.php
+++ b/SemanticGenealogy.php
@@ -36,7 +36,7 @@
 die( 'Error: This version of Semantic Genealogy requires Semantic 
MediaWiki 1.7 or above.' );
 }
 
-define('SG_VERSION', '0.2.0 alpha');
+define('SG_VERSION', '0.3.0');
 
 $wgExtensionCredits['semantic'][] = array(
 'path' => __FILE__,

-- 
To view, visit https://gerrit.wikimedia.org/r/245911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I896e30364e507dfe5d4133bef628d9b7457321c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticGenealogy
Gerrit-Branch: master
Gerrit-Owner: Wilkins 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Creating tag to insert the tree into pages - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245904

Change subject: Creating  tag to insert the tree into pages
..

Creating  tag to insert the tree into pages

Change-Id: I20684accceddcd96b6c6754d4348fba66c1d8f00
---
A FamilyTree.php
A FamilyTreeTag.php
M SemanticGenealogy.php
M SpecialFamilyTree.php
4 files changed, 314 insertions(+), 206 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/04/245904/1

diff --git a/FamilyTree.php b/FamilyTree.php
new file mode 100644
index 000..63ebb72
--- /dev/null
+++ b/FamilyTree.php
@@ -0,0 +1,234 @@
+
+ */
+class FamilyTree
+{
+
+private $output;
+
+
+public function setOutput($output)
+{
+$this->output = $output;
+}
+
+public function getOutput()
+{
+return $this->output;
+}
+
+   /**
+* Return the number of people in a generation
+*
+* @param  int $gen The number of the generation (beginning at 0)
+* @return int
+*/
+   public static function getNumOfPeopleInGen( $gen ) {
+   $result = 1;
+   for($i = 0; $i < $gen; $i++ ) {
+   $result *= 2;
+   }
+   return $result;
+   }
+
+   public function getAncestors( SMWDIWikiPage $page, $numOfGenerations ) {
+   $tree = array();
+   $tree[0][1] = new PersonPageValues( $page );
+
+   for($i = 0; $i < $numOfGenerations && $tree[$i] !== null; $i++ 
) {
+   $tree = $this->addGenInTree( $i + 1, $tree );
+   }
+   return $tree;
+   }
+
+   public function addGenInTree( $gen, array $tree ) {
+   $empty = true;
+   $son = self::getNumOfPeopleInGen( $gen - 1 );
+   $end = $son * 4;
+   for( $parent = $son * 2; $parent < $end; true ) {
+   if( isset( $tree[$gen - 1][$son] ) ) {
+   $father = $tree[$gen - 1][$son]->father;
+   if( $father instanceof SMWDIWikiPage ) {
+   $tree[$gen][$parent] = new 
PersonPageValues( $father );
+   $empty = false;
+   } else {
+   $tree[$gen][$parent] = null;
+   }
+   $parent++;
+
+   $mother = $tree[$gen - 1][$son]->mother;
+   if( $mother instanceof SMWDIWikiPage ) {
+   $tree[$gen][$parent] = new 
PersonPageValues( $mother );
+   $empty = false;
+   } else {
+   $tree[$gen][$parent] = null;
+   }
+   $parent++;
+   } else {
+   $parent += 2;
+   }
+   $son++;
+   }
+   //Verif s'il n'y a personne dans la génération
+   if($empty) {
+   $tree[$gen] = null;
+   }
+   return $tree;
+   }
+
+   public function outputAncestorsTree( array $tree, $numOfGenerations ) {
+   $output = $this->getOutput();
+   $output->addHTML('');
+   $col = 1;
+   for( $i = $numOfGenerations - 1; $i >= 0; $i-- ) {
+   if( isset( $tree[$i] ) ) {
+   $output->addHTML('');
+   foreach ($tree[$i] as $sosa => $person) {
+   $output->addHTML('');
+   if($person !== null) {
+   $output->addHTML($sosa . 
'' );
+$output->addWikiText( 
$person->getDescriptionWikiText( true ) );
+   if($sosa != 1) {
+   if($sosa % 2 == 0)
+   
$output->addHTML( '\\' );
+   else
+   
$output->addHTML( '/' );
+   }
+   }
+   $output->addHTML('');
+   }
+   $output->addHTML('');
+   }
+   $col *= 2;
+   }
+   $output->addHTML('');
+   }
+
+   public function outputDescendantList( SMWDIWikiPage $main, 
$numOfGenerations ) {
+  

[MediaWiki-commits] [Gerrit] Dynamic loading for all types of FamilyTrees - Adding TODO file - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245913

Change subject: Dynamic loading for all types of FamilyTrees - Adding TODO file
..

Dynamic loading for all types of FamilyTrees - Adding TODO file

Change-Id: Ie0cecf5a65bdfc851dd8cb308849b69f8a625c13
---
M AncestorsFamilyTree.php
M DescendantFamilyTree.php
M FamilyTree.php
M FamilyTreeFactory.php
M FamilyTreeTag.php
M PersonPageValues.php
M RelationFamilyTree.php
M SpecialFamilyTree.php
A TODO
M specialFamilyTree.js
10 files changed, 86 insertions(+), 28 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/13/245913/1

diff --git a/AncestorsFamilyTree.php b/AncestorsFamilyTree.php
index 3ebc623..89cf5ee 100644
--- a/AncestorsFamilyTree.php
+++ b/AncestorsFamilyTree.php
@@ -15,6 +15,8 @@
 class AncestorsFamilyTree extends FamilyTree
 {
 
+const NAME = 'ancestors';
+
 /**
  * List the ancestors of the person for all needed generations
  *
diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php
index 5656612..c62983f 100644
--- a/DescendantFamilyTree.php
+++ b/DescendantFamilyTree.php
@@ -14,6 +14,7 @@
  */
 class DescendantFamilyTree extends FamilyTree
 {
+const NAME = 'descendant';
 
 /**
  * List the descendants for all needed generations
diff --git a/FamilyTree.php b/FamilyTree.php
index 92b9582..592c5a9 100644
--- a/FamilyTree.php
+++ b/FamilyTree.php
@@ -15,6 +15,8 @@
 abstract class FamilyTree
 {
 
+const NAME = 'root';
+
 protected $output;
 protected $person;
 protected $personName;
diff --git a/FamilyTreeFactory.php b/FamilyTreeFactory.php
index 2c819fc..05a73f9 100644
--- a/FamilyTreeFactory.php
+++ b/FamilyTreeFactory.php
@@ -24,18 +24,45 @@
 public static function create($type)
 {
 global $wgOut;
-switch($type) {
-case 'ancestors':
-return new AncestorsFamilyTree();
-break;
-case 'descendant':
-return new DescendantFamilyTree();
-break;
-case 'link':
-return new RelationFamilyTree();
-break;
-default:
-$wgOut->addWikiText('' . 
wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . 
'');
+$trees = self::listTrees();
+foreach ($trees as $tree) {
+if ($type == $tree::NAME) {
+return new $tree();
+}
 }
+$wgOut->addWikiText('' . 
wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . 
'');
+}
+
+/**
+ * List the existing tree types
+ *
+ * @return array the list of FamilyTree classes availables
+ */
+public static function listTrees()
+{
+$trees = array();
+foreach (new DirectoryIterator(__DIR__) as $file) {
+if ($file->isDot()) {
+continue;
+}
+if (!$file->isFile()) {
+continue;
+}
+if (!preg_match("#.php$#", $file->getFilename())) {
+continue;
+}
+require_once $file->getPathname();
+$className = $file->getBasename('.php');
+try {
+$classRef = new ReflectionClass($className);
+} catch (ReflectionException $e) {
+continue;
+}
+
+if (!$classRef->isAbstract() && 
$classRef->isSubclassOf('FamilyTree')) {
+$trees[] = new $className;
+}
+}
+return $trees;
 }
 }
diff --git a/FamilyTreeTag.php b/FamilyTreeTag.php
index 264b6ef..297cea3 100644
--- a/FamilyTreeTag.php
+++ b/FamilyTreeTag.php
@@ -50,18 +50,20 @@
 // A new OutputPage writer
 $output = new OutputPage;
 $familytree = FamilyTreeFactory::create($args[self::ATTR_TYPE]);
-$familytree->setOutput($output);
-$familytree->setPerson($args[self::ATTR_PERSON]);
-$familytree->setNumberOfGenerations($args[self::ATTR_DEPTH]);
+if ($familytree) {
+$familytree->setOutput($output);
+$familytree->setPerson($args[self::ATTR_PERSON]);
+$familytree->setNumberOfGenerations($args[self::ATTR_DEPTH]);
 
-if (isset($args[self::ATTR_PERSON2])) {
-$personName2 = $args[self::ATTR_PERSON2];
-if ($personName2) {
-$familytree->setPerson2($personName2);
+if (isset($args[self::ATTR_PERSON2])) {
+$personName2 = $args[self::ATTR_PERSON2];
+if ($personName2) {
+$familytree->setPerson2($personName2);
+}
 }
-}
 
-$familytree->render();
+$familytree->render();
+}
 
 $output->setArticleBodyOnly(true);
 ob_start();
diff --git 

[MediaWiki-commits] [Gerrit] Adding a 'Genealogy' group in Special:SpecialPages - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245907

Change subject: Adding a 'Genealogy' group in Special:SpecialPages
..

Adding a 'Genealogy' group in Special:SpecialPages

Change-Id: Ie3935a400d051eade268bc545b3d56df7016c5e2
---
M SpecialFamilyTree.php
M i18n/en.json
M i18n/fr.json
3 files changed, 8 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/07/245907/1

diff --git a/SpecialFamilyTree.php b/SpecialFamilyTree.php
index 852f414..8b0a380 100644
--- a/SpecialFamilyTree.php
+++ b/SpecialFamilyTree.php
@@ -3,11 +3,11 @@
 /**
  * Special page that show a family tree
  *
- * @file SpecialFamilyTree.php
+ * @fileSpecialFamilyTree.php
  * @ingroup SemanticGenealogy
  *
  * @licence GNU GPL v2+
- * @author Thomas Pellissier Tanon < thoma...@hotmail.fr >
+ * @author  Thomas Pellissier Tanon 
  */
 class SpecialFamilyTree extends SpecialPage
 {
@@ -21,7 +21,7 @@
  */
 public function __construct($name = 'FamilyTree')
 {
-parent::__construct($name, 'other');
+parent::__construct($name, '');
 $this->mIncludable = true;
 }
 
@@ -152,7 +152,6 @@
 return wfMsg('semanticgenealogy-specialfamilytree-title');
 }
 
-
 /**
  * Get the groupe name
  *
@@ -160,6 +159,6 @@
  */
 protected function getGroupName()
 {
-return 'other';
+return 'genealogy';
 }
 }
diff --git a/i18n/en.json b/i18n/en.json
index 167f2da..80d2769 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -18,5 +18,6 @@
 "semanticgenealogy-specialfamilytree-label-gen": "Number of generation",
 "semanticgenealogy-specialfamilytree-error-nosecondpagename": "You have to 
provide a name of a persons page in 
\"{{int:semanticgenealogy-specialfamilytree-label-page2}}\" field.",
 "semanticgenealogy-specialfamilytree-error-nolinkfound": "No link found 
between [[$1]] and [[$2]].",
-"semanticgenealogy-specialfamilytree-error-unknowntype": "The $1 type is 
unknown."
+"semanticgenealogy-specialfamilytree-error-unknowntype": "The $1 type is 
unknown.",
+"specialpages-group-genealogy": "Genealogy"
 }
diff --git a/i18n/fr.json b/i18n/fr.json
index a133075..867d867 100644
--- a/i18n/fr.json
+++ b/i18n/fr.json
@@ -20,5 +20,6 @@
"semanticgenealogy-specialfamilytree-label-gen": "Nombre de 
générations",
"semanticgenealogy-specialfamilytree-error-nosecondpagename": "Vous 
devez mettre le nom d'une page dans le champ « 
{{int:semanticgenealogy-specialfamilytree-étiquette-page2}}. »",
"semanticgenealogy-specialfamilytree-error-nolinkfound": "Aucun lien 
trouvé entre [[$1]] et [[$2]].",
-   "semanticgenealogy-specialfamilytree-error-unknowntype": "Le type $1 
est inconnu."
+   "semanticgenealogy-specialfamilytree-error-unknowntype": "Le type $1 
est inconnu.",
+"specialpages-group-genealogy": "Généalogie"
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/245907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3935a400d051eade268bc545b3d56df7016c5e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticGenealogy
Gerrit-Branch: master
Gerrit-Owner: Wilkins 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Code cleanup from PHPMD suggestions - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245910

Change subject: Code cleanup from PHPMD suggestions
..

Code cleanup from PHPMD suggestions

Change-Id: I8af8116dc3e2499c3fd4688ee002ac2d4a4f5a6b
---
M DescendantFamilyTree.php
M FamilyTree.php
M FamilyTreeFactory.php
M Gedcom5FilePrinter.php
M GenealogicalFilePrinter.php
M PersonPageValues.php
M SemanticGenealogy.body.php
7 files changed, 17 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/10/245910/1

diff --git a/DescendantFamilyTree.php b/DescendantFamilyTree.php
index 218e269..5656612 100644
--- a/DescendantFamilyTree.php
+++ b/DescendantFamilyTree.php
@@ -24,14 +24,14 @@
 {
 $output = $this->getOutput();
 $children = $person->getChildren();
-$i = 1;
+$count = 1;
 foreach ($children as $child) {
-$pel = $pellissier . $i . '.';
+$pel = $pellissier . $count . '.';
 $output->addWikiText($pel . ' ' . 
$child->getDescriptionWikiText(false));
 if ($end > 0) {
 $this->outputDescendantLine($child, $pel, $end - 1);
 }
-$i++;
+$count++;
 }
 }
 
diff --git a/FamilyTree.php b/FamilyTree.php
index c1c0f3f..92b9582 100644
--- a/FamilyTree.php
+++ b/FamilyTree.php
@@ -137,6 +137,6 @@
  */
 public function render()
 {
-$output->addHtml("");
+$this->output->addHtml("");
 }
 }
diff --git a/FamilyTreeFactory.php b/FamilyTreeFactory.php
index f3bcac7..2c819fc 100644
--- a/FamilyTreeFactory.php
+++ b/FamilyTreeFactory.php
@@ -16,13 +16,14 @@
 
 /**
  * Create a new FamilyTree object
- * 
- * @param string $type the type of the wanted FamilyTree 
+ *
+ * @param string $type the type of the wanted FamilyTree
  *
  * @return object a new FamilyTree Object
  */
 public static function create($type)
 {
+global $wgOut;
 switch($type) {
 case 'ancestors':
 return new AncestorsFamilyTree();
@@ -34,7 +35,7 @@
 return new RelationFamilyTree();
 break;
 default:
-$output->addWikiText('' . 
wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . 
'');
+$wgOut->addWikiText('' . 
wfMsg('semanticgenealogy-specialfamilytree-error-unknowntype', $type) . 
'');
 }
 }
 }
diff --git a/Gedcom5FilePrinter.php b/Gedcom5FilePrinter.php
index 433f629..aad0851 100644
--- a/Gedcom5FilePrinter.php
+++ b/Gedcom5FilePrinter.php
@@ -43,7 +43,6 @@
  */
 protected function setFamiliesList()
 {
-$i = 1;
 foreach ($this->people as $child) {
 $id = $this->getFamilyIdForChild($child);
 if ($id != '0S0') {
diff --git a/GenealogicalFilePrinter.php b/GenealogicalFilePrinter.php
index 8348a5c..b62a4fd 100644
--- a/GenealogicalFilePrinter.php
+++ b/GenealogicalFilePrinter.php
@@ -18,7 +18,7 @@
  * Add people to the GEDCOM file
  *
  * @param $people array|PersonPageValues
- * 
+ *
  * @return void
  */
 public function addPeople($people)
diff --git a/PersonPageValues.php b/PersonPageValues.php
index 6e6e633..3dee77f 100644
--- a/PersonPageValues.php
+++ b/PersonPageValues.php
@@ -89,16 +89,16 @@
 return $this->children;
 }
 
-public static function comparePeopleByBirthDate(PersonPageValues $a, 
PersonPageValues $b)
+public static function comparePeopleByBirthDate(PersonPageValues $personA, 
PersonPageValues $personB)
 {
-if ($a->birthdate instanceof SMWDITime) {
-$aKey = $a->birthdate->getSortKey();
+if ($personA->birthdate instanceof SMWDITime) {
+$aKey = $personA->birthdate->getSortKey();
 } else {
 $aKey = 3000;
 }
 
-if ($b->birthdate instanceof SMWDITime) {
-$bKey = $b->birthdate->getSortKey();
+if ($personB->birthdate instanceof SMWDITime) {
+$bKey = $personB->birthdate->getSortKey();
 } else {
 $bKey = 3000;
 }
@@ -132,10 +132,10 @@
 return $text;
 }
 
-protected static function getWikiTextDateFromSMWDITime(SMWDITime $di)
+protected static function getWikiTextDateFromSMWDITime(SMWDITime $dataItem)
 {
 $val = new SMWTimeValue(SMWDataItem::TYPE_TIME);
-$val->setDataItem($di);
+$val->setDataItem($dataItem);
 return $val->getShortWikiText();
 }
 
diff --git a/SemanticGenealogy.body.php b/SemanticGenealogy.body.php
index 41c2fd2..22d2dac 100644
--- a/SemanticGenealogy.body.php
+++ b/SemanticGenealogy.body.php
@@ -24,7 +24,7 @@
 return $properties;
 }
 
-global $wgGenealogicalProperties, $wgOut;
+global 

[MediaWiki-commits] [Gerrit] Adding Changelog and README - change (mediawiki...SemanticGenealogy)

2015-10-13 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245909

Change subject: Adding Changelog and README
..

Adding Changelog and README

Change-Id: I52649da7e8f3b30f52733c8cf1c6effdc3d1d772
---
M README
M RELEASE-NOTES
2 files changed, 29 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/09/245909/1

diff --git a/README b/README
index 53be4a1..3bfc331 100644
--- a/README
+++ b/README
@@ -1,2 +1,18 @@
-THIS EXTENSION IS CURRENTLY IN DEVELOPMENT AND IS NOT DONE TO BE USED IN A 
PRODUCTION ENVIRONMENT. BRAKING CHANGES CAN BE INTRODUCED !
+Semantic Genealogy
+==
+THIS EXTENSION IS CURRENTLY IN DEVELOPMENT AND IS NOT DONE TO BE USED IN A 
PRODUCTION ENVIRONMENT. BREAKING CHANGES CAN BE INTRODUCED !
+
+
+### Features
+* Special page to generate a FamilyTree
+* GEDCOM file format export
+* familytree tag to insert a FamilyTree into a page
+
+
+### Authors
+* Thomas Pellissier Tanon  (Maintainer)
+
+
+### Links
+* Official extension page : 
https://www.mediawiki.org/wiki/Extension:Semantic_Genealogy
 
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 1333ed7..3b69d4c 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1 +1,12 @@
-TODO
+### Changelog
+
+**v0.3**
+- Bugfixes on the family tree
+- Adding familytree tag
+
+**v0.2**
+- Translations
+
+**v0.1**
+- Special page FamilyTree
+- Gedcom export

-- 
To view, visit https://gerrit.wikimedia.org/r/245909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52649da7e8f3b30f52733c8cf1c6effdc3d1d772
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticGenealogy
Gerrit-Branch: master
Gerrit-Owner: Wilkins 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Bugfixes - Using motherId for the WIFE in Gedcom file. Corre... - change (mediawiki...SemanticGenealogy)

2015-10-12 Thread Wilkins (Code Review)
Wilkins has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245262

Change subject: Bugfixes - Using motherId for the WIFE in Gedcom file. 
Correcting the numerotation in the generated tree of Special:FamilyTree.
..

Bugfixes - Using motherId for the WIFE in Gedcom file. Correcting the
numerotation in the generated tree of Special:FamilyTree.

Change-Id: I3b97283192b8fed882565f64233bb5f17f62ce76
---
M GenealogicalFilePrinter.php
M SpecialFamilyTree.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/62/245262/1

diff --git a/GenealogicalFilePrinter.php b/GenealogicalFilePrinter.php
index 8c5cc6e..bcbe810 100644
--- a/GenealogicalFilePrinter.php
+++ b/GenealogicalFilePrinter.php
@@ -178,7 +178,7 @@
$this->addRow( 1, 'HUSB', '@I' . $fatherId . '@' );
}
if( $motherId != 0 ) {
-   $this->addRow( 1, 'WIFE', '@I' . $fatherId . '@' );
+   $this->addRow( 1, 'WIFE', '@I' . $motherId . '@' );
}
foreach( $children as $childId ) {
$this->addRow( 1, 'CHIL', '@I' . $childId . '@' );
diff --git a/SpecialFamilyTree.php b/SpecialFamilyTree.php
index f77c73e..0b5367c 100644
--- a/SpecialFamilyTree.php
+++ b/SpecialFamilyTree.php
@@ -168,7 +168,7 @@
$empty = true;
$son = self::getNumOfPeopleInGen( $gen - 1 );
$end = $son * 4;
-   for( $parent = $son * 2; $parent < $end; $parent++ ) {
+   for( $parent = $son * 2; $parent < $end; true ) {
if( isset( $tree[$gen - 1][$son] ) ) {
$father = $tree[$gen - 1][$son]->father;
if( $father instanceof SMWDIWikiPage ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/245262
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b97283192b8fed882565f64233bb5f17f62ce76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticGenealogy
Gerrit-Branch: master
Gerrit-Owner: Wilkins 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits