Extension talk:JSWikiGantt

Jump to navigation Jump to search

About this board

Not compatible with Skin Minerva_Neue

1
80.146.191.154 (talkcontribs)

This extension is not compatible with the mobile Skin "MinervaNeue" - every link doesnt work after using the skin in desktop or mobile. with disabled extension jswikigantt everything works perfect. (MW 1.31.7)

Reply to "Not compatible with Skin Minerva_Neue"

Not compatible with templates?

2
Michael Chidester (talkcontribs)

I'm trying to set up templates that can automatically generate gantt charts based on inputs, but there seem to be fundamental compatibility problems.

  • Template variables are not accepted as inputs, and seem to cause "Fatal error: Call to a member function getElementsByTagName() on a non-object"
  • Magic words and parser functions cause the same phenomenon
  • Templates containing task entries (like one template per task declaration) are discarded
  • My only success has been including the entire block of code in a single template, including the opening and closing tags, with all hard-coded values; this transcludes normally

My ultimate objective is get this extension running in a Semantic Mediawiki environment, to generate Gantt charts based on the outputs of #ask queries, but that means each line of the chart needs to be packaged as an individual template, and the values delivered to it as template variables. There was once an extension that did this automatically, but it has been mothballed.

What I need to be able to do is something like this:

Template:EQDD contributor tracker gantt chart/row

<includeonly>
  <task>
    <pID>{{#vardefineecho: taskid | {{#expr: {{#var:taskid}} + 10 }} }}</pID>
    <pName>{{{2|}}}</pName>
    <pStart>{{#dateformat: {{{3|}}} |ISO 8601}}</pStart>
    <pEnd>{{#dateformat: {{{4|}}} |ISO 8601}}</pEnd>
    <pColor>36b</pColor>
    <pLink>{{canonicalurl: {{{1|}}} }}</pLink>
   </task>
</includeonly>

Please advise.

MW 1.25.2
PHP 5.5.38
MySQL 5.7.20-log
SMW 2.5.6

~ Michael Chidester (Contact) 20:07, 24 October 2018 (UTC)

Nux (talkcontribs)

You can use something like this to load external XML with tasks:

<jsgantt loadxml="1">
<a href="http://localhost/wiki-jsgantt/job_cal.xml">link</a>
</jsgantt>

You can load an article like this too:

<jsgantt loadxml="1">
<a href="http://localhost/wiki/index.php/Loading_jsgantt/xml?action=raw">link</a>
</jsgantt>

The problem is that when `action=raw` is used then templates will not be transcluded. So only static xml would work. And when `action=render` is used then everything is rendered which includes `jsgantt` tags. You could just have tasks in some other root tag... But then mediawiki will escape XML and it will look like this:

<p>&lt;root&gt;
&lt;task&gt;
&lt;pID&gt;20&lt;/pID&gt;
&lt;pName&gt;Nux&lt;/pName&gt;
&lt;pStart&gt;2011-06-10&lt;/pStart&gt;
&lt;pEnd&gt;2011-06-14&lt;/pEnd&gt;
&lt;pColor&gt;00cc00&lt;/pColor&gt;
&lt;pRes&gt;Time off&lt;/pRes&gt;
&lt;/task&gt;
&lt;/root&gt;
</p>

So... Basically you have to figure out a way to generate XML with your tasks and then loading it with jsgantt will work. Just not sure if it's possible to generate XML with templates. With Lua maybe?

Reply to "Not compatible with templates?"

Month view not work in this example

4
58.60.230.112 (talkcontribs)

MediaWiki 1.16.2 PHP 5.3.2-1ubuntu4 (apache2handler) MySQL 5.1.41-3ubuntu12

Nux (talkcontribs)

Do you have a public URL I could check? If no, please check for any errors in JavaScript console. Also provide more details about a browser you are using and what settings do you have in JSWikiGantt.config.php.

193.227.215.155 (talkcontribs)

Any news ? In my month view installation does not work.

Nux (talkcontribs)

Works fine for me. Please add more details and send me an URL to your wiki.

I will not be able to reproduce if you don't provide details.

Reply to "Month view not work in this example"

Default display is on Current Date

2
Clifford.kasper (talkcontribs)

Hello. I really like this extension, well done.

Is there a setting or method for the default display to always center the Gantt Chart on today's date? Thank you.

Nux (talkcontribs)

Yes, if a current date is in a time span of a chart then the chart should be scrolled to the current date automatically. It should be noted however that it works only once you save the gantt and not in preview mode IIRC. If it doesn't work for you then please state your browser name and version and I should be able to take a look tomorrow.

Reply to "Default display is on Current Date"
131.188.164.197 (talkcontribs)

Hi, I would like to use dates in DD/MM/YYYY format. I have tried DD-MM-YYYY DD.MM.YYYY, however no chart is produced

Nux (talkcontribs)

You need to change your date format settings in the jsgantt_inline.js. I'm guessing you want strDateInputFormat : 'd/m/Y'. You may also want to change display formats too.

For all available letters see date-functions.js.

Reply to "Dates"
85.176.206.158 (talkcontribs)

Hello Nux,

I uploaded all files for JSWikiGantt and prepared a test-page with your code example, but nothing happens. Due to version page of my wiki JSWikiGantt is installed. I run MediaWiki 1.20, PHP 5.3.22 (cgi-fcgi).
As I can see in the source code of the test-page at least some script is included:

<script src="/cms/wiki/extensions/JSWikiGantt/jsgantt_inline.js?0"></script>

<script>

oJSGantInline.init()

oJSGant.AddTaskItem(new JSGantt.TaskItem(10, 'WCF Changes', , , '0000ff', 'http://your_bugzilla_domain.com/flyspray/index.php?do=details&task_id=10', 0, , 0, 1, 0, 1, , )) oJSGant.AddTaskItem(new JSGantt.TaskItem(20, 'Move to WCF from remoting', '2010-07-11', '2010-07-15', '0000ff', 'http://your_bugzilla_domain.com/flyspray/index.php?do=details&task_id=20', 0, 'Rich', 10, 0, 10, 1, , )) oJSGant.AddTaskItem(new JSGantt.TaskItem(30, 'add Auditing', '2010-07-19', '2010-07-21', '0000ff', 'http://your_bugzilla_domain.com/flyspray/index.php?do=details&task_id=30', 0, 'Mal', 50, 0, 10, 1, '20', )) oJSGantInline.draw(); </script>

I'm somewhat new to mediawiki, so I don't know what to do further or where to look up, what's going wrong. I also searched for other extensions doing the same, but your extensions seems to me the right one. Help would be very nice. Thanks a lot. Epic.

Nux (talkcontribs)

Personally I use older version of MediaWiki, but I've recently received a report that the extension works fine in MW 1.21. If you quoted this literally then there are apostrophes missing for some reason. This might be on PHP side. The JS code for the first task should be:

 (10, 'WCF Changes', '', '',..., 0, '', 0, ...))

Notice empty string after WCF Changes. The code responsible is in "JSWikiGantt.body.php" in "renderInnerXML". You can check if replacing single apostrophes with "\'" will help. I'm just guessing here because I'm not using PHP as fcgi which might have some weird defaults.

EDIT: I just noticed it's simply MediaWiki that replaces single quotes with italic font formatting in comments :-). So that might not be it... See if JS console of your browser is showing any errors. If it does you can post them here. If you have any public URL (or a page I could have a look at) then feel free to write to me.

I'm not visiting mw.org regularly so leave me a note on my talk page or send me an e-mail.

60.217.72.25 (talkcontribs)

Do you have the "JSWikiGantt.zip" file?

Nux (talkcontribs)

Sorry, I've moved some stuff on my site. Fixed the URL and made a proper redirect.

Reply to "Working with MediaWiki 1.20?"
Nux (talkcontribs)

Mediawiki 1.15 does not work. (Sorry) Problably the lack of ny quick check of the extension Would be nice to have more details about the .config file (samples??)

Server Config:

  • Qnap 219
    • MediaWiki 1.15.1
    • PHP 5.2.11 (apache2handler)
    • MySQL 5.1.36-log

58.60.230.112; 01:24, 3 February 2012

I haven't tested on 1.15. I consider 1.16 the last good and stable Mediawiki I think you should upgrade to it. Sadly I won't have time to test this against 1.15.

60.217.72.25 (talkcontribs)

Can you send the JSWikiGantt.zip file to me? email: bigkun@outlook.com Thank you!

Reply to "Problem with Mediawiki 1.15"

Setting the default format to week

2
134.67.237.31 (talkcontribs)

Is there a way to set the default format to week rather than day?

Nux (talkcontribs)

Sure. Just change "strDefaultViewFormat" to whatever option you want (available options are shown in the comment). In most cases you will only need to change "jsgantt_inline.js", but you can also use the same setting in "jsgantt_loader.js".

Reply to "Setting the default format to week"

Problems with Mediawiki 1.18.3 and Milestones

5
195.124.137.166 (talkcontribs)

Hi. I have problems with Mediawiki 1.18.3 and JSWikiGannt. Using Milestones is messing up the layout. Or am i using them wrongly ? Example:

 <jsgantt>
   <task><pID>010</pID><pStart>2012-03-01</pStart><pEnd>2012-04-19</pEnd><pColor>ff0000</pColor><pName>Do some stuff</pName><pDepend></pDepend></task>
   <task><pID>020</pID><pStart>2012-04-20</pStart><pEnd>2012-04-20</pEnd><pColor>00ff00</pColor><pMile>1</pMile><pName>Stuff done</pName><pDepend>10</pDepend></task>
   <task><pID>030</pID><pStart>2012-04-21</pStart><pEnd>2012-05-10</pEnd><pColor>00ffff</pColor><pName>Do more stuff</pName><pDepend></pDepend></task>
 </jsgantt>

Result is that the line with the milestone is getting something like an extra "Linefeed" after the description in the first column.

Thanks for help.

Nux (talkcontribs)

I haven't really used stones, but it should work now in 0.5.5.

I also have 0.6 which is a bit more cleaned up version, but I haven't had time to really finish it. Maybe in summer...

195.124.137.166 (talkcontribs)

Hi Nux,

thanks for the quick reply. Milestones are working much better now ... but ... ;-) Could you maybe have a look at the dependencies for milestones. This does not seem to work as expected (see example)

 <jsgantt>
   <task><pID>010</pID><pStart>2012-03-01</pStart><pEnd>2012-04-19</pEnd><pColor>ff0000</pColor><pName>Do some stuff</pName><pDepend></pDepend></task>
   <task><pID>020</pID><pStart>2012-04-20</pStart><pEnd>2012-04-20</pEnd><pColor>00ff00</pColor><pName>Stuff done</pName><pDepend>10</pDepend><pMile>1</pMile></task>
   <task><pID>030</pID><pStart>2012-04-21</pStart><pEnd>2012-05-10</pEnd><pColor>00ffff</pColor><pName>Do more stuff</pName><pDepend>20</pDepend></task>
 </jsgantt>

Regards, Michael

Nux (talkcontribs)

I've replaced 0.5.5 with another fix. It seems that the original author of jsGantt never really used milestones too ;-).

Reply to "Problems with Mediawiki 1.18.3 and Milestones"
There are no older topics