Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wiki Integration - system parameters
02-24-2015, 05:39 AM,
#1
Wiki Integration - system parameters
I am trying to integrate WackoWiki but I can't get it to show the link on the relevant pages. Looking at the code in systemparamters.php (1) and in miscfunctions.php (2) I believe the selection box in (1) delivers an index number into the session variables whereas in (2) the function wikiLink is looking for wiki names like 'WackoWiki', 'MediaWiki', etc.

As the function cannot find any of the names it decides you don't want any integration!

Memo: I notice the demo site uses WikkiWiki which isn't offered in the standard download so I assume the demo site is not using the standard download files, which is a bit cheeky. Anyway will the standard download be improved in this area or are we on our own on this?
Reply
02-24-2015, 03:19 PM, (This post was last modified: 02-24-2015, 03:22 PM by phil.)
#2
RE: Wiki Integration - system parameters
Yes the demo is using the standard code - wacko wiki works for wikkiwiki.
what version are you using?
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
02-24-2015, 11:42 PM,
#3
RE: Wiki Integration - system parameters
(02-24-2015, 03:19 PM)phil Wrote: Yes the demo is using the standard code - wacko wiki works for wikkiwiki.
what version are you using?
Thanks for your reply. I have been trying version 4.11.5
I looked at the code in 4.12.2 and it looked the same in the areas that I think determine whether or not to display the link to the wiki.

I will install 4.12.2 and try again.

I'm not sure what you meant by 'wacko wiki works for wikkiwiki'. The choices offered in system parameters are WackoWiki, MediaWiki and DokuWiki.
Reply
02-25-2015, 03:30 AM,
#4
RE: Wiki Integration - system parameters
I have installed 4.12.2 and the wiki integration is still non-functional (for me at least)!

To fix it I have changed SystemParameters.php Just after declaring the variable array $WikiApplications I have put it into the session variable:
PHP Code:
$_SESSION['WikiApplications'] = $WikiApplications
This will allow finding the name of the selected Wiki name from the index number 'WikiApp' that gets saved in $_SESSION when one is chosen.

Then in the wikiLink function (in MiscFunctions.php) we can get the 'WikiApplications' array, and 'WikiApp' (index number) from the $_SESSION variable and extract the name of the Wiki. Having got the name we can now complete building the string for the link to show on the page.

The function wikiLink was originally built from 2 if statements. We can replace the second one with:
PHP Code:
$chosenWikiApp $_SESSION['WikiApplications'][$_SESSION['WikiApp']];
    switch (
$chosenWikiApp) {
        case 
'WackoWiki':
            echo 
'<a target="_blank" href="' $WikiPath $WikiType .  $WikiPageID '">' _('Wiki ' $WikiType ' Knowledge Base') . ' </a>  <br />';
            break;
        case 
'MediaWiki':
            echo 
'<a target="_blank" href="' $WikiPath 'index.php?title=' $WikiType '/' $WikiPageID '">' _('Wiki ' $WikiType ' Knowledge Base') . '</a><br />';
            break;
        case 
'DokuWiki':
            echo 
'<a target="_blank" href="' $WikiPath '/doku.php?id=' $WikiType ':' $WikiPageID '">' _('Wiki ' $WikiType ' Knowledge Base') . '</a><br />';
            break;
    } 

These changes seem to work for me, perhaps someone more familiar with the code can check it over. And of course check the original didn't work which was where I started and I'm still puzzled why it didn't for me and nobody else has mentioned it!
Reply
02-25-2015, 11:19 PM,
#5
RE: Wiki Integration - system parameters
Sorry folks. My solution will only work during the session that the system parameters were updated, and probably only for that user too! - so please ignore my code modification suggested in my last post.

I will have another look at it.
Reply
02-26-2015, 02:34 AM,
#6
RE: Wiki Integration - system parameters
I have had another look at this issue and realized the original intent of the author was to save the name (as opposed to the index number) of the selected Wiki in the config table in the DB. It looks as if this table is read into the $_SESSION array at the start of each session so whenever we build the link to the Wiki we extract the Wiki name from $_SESSION and use the wikiLink function in MiscFunctions.php to construct the URL string with other bits of text appropriate to the chosen Wiki.

So if we change SystemParameters.php at line 991 by replacing:
PHP Code:
for ($i=0$i sizeof($WikiApplications); $i++ ) {
    echo 
'<option '.($_SESSION['WikiApp'] == $i 'selected="selected" ' '').'value="'$i .'">' $WikiApplications[$i]  . '</option>';

by
PHP Code:
foreach ($WikiApplications as $WikiApp) {
    echo 
'<option '.($_SESSION['WikiApp'] == $WikiApp 'selected="selected" ' '').'value="'$WikiApp .'">' $WikiApp  '</option>';

then the original wikiLink function in MiscFunctions.php can stay as it was and the links will show on the relevant pages.

I'd appreciate those more familiar with the code than me to check this out as if I'm right anyone new coming to webERP and hoping to find easy Wiki integration (like me!) will find the integration is broken and move on ...
Reply
04-15-2015, 01:42 AM,
#7
RE: Wiki Integration - system parameters
Hi
I just had the same issue and found a real simple solution, I put the URL (after the domain)for my wiki in and selected Disabled in the drop-down and everything worked fine, hope this helps.
Andylira



(02-26-2015, 02:34 AM)GreenFlatDog Wrote: I have had another look at this issue and realized the original intent of the author was to save the name (as opposed to the index number) of the selected Wiki in the config table in the DB. It looks as if this table is read into the $_SESSION array at the start of each session so whenever we build the link to the Wiki we extract the Wiki name from $_SESSION and use the wikiLink function in MiscFunctions.php to construct the URL string with other bits of text appropriate to the chosen Wiki.

So if we change SystemParameters.php at line 991 by replacing:
PHP Code:
for ($i=0$i sizeof($WikiApplications); $i++ ) {
    echo 
'<option '.($_SESSION['WikiApp'] == $i 'selected="selected" ' '').'value="'$i .'">' $WikiApplications[$i]  . '</option>';

by
PHP Code:
foreach ($WikiApplications as $WikiApp) {
    echo 
'<option '.($_SESSION['WikiApp'] == $WikiApp 'selected="selected" ' '').'value="'$WikiApp .'">' $WikiApp  '</option>';

then the original wikiLink function in MiscFunctions.php can stay as it was and the links will show on the relevant pages.

I'd appreciate those more familiar with the code than me to check this out as if I'm right anyone new coming to webERP and hoping to find easy Wiki integration (like me!) will find the integration is broken and move on ...

Reply
04-15-2015, 03:09 AM,
#8
RE: Wiki Integration - system parameters
Thanks for following this up, but I'm not sure I understand what you've done here. Have you added something (the URL) in the box for the path to the wiki and then disabled the wiki integration via its drop-down box - and this makes the integration work? Does it survive logging out and logging back in (ie. beyond the current session)?
Reply
04-15-2015, 01:06 PM,
#9
RE: Wiki Integration - system parameters
Hi,

You must add URL in the box for the path. Otherwise it does not work.

There is a bug since webERP4.11.2. It's fixed now in the trunk.

Best regards!

Exson
Reply
04-24-2015, 11:10 AM,
#10
RE: Wiki Integration - system parameters
Just wanted to clarify, because it took me a little tinkering to understand Exson & Andylira:

In "SETUP"-->"SYSTEM PARAMETERS":
- Wiki Application: DISABLED (required for wiki integration to work)
- Wiki Path: the path of your wiki (installed on the same root path as your webERP folder, but 'next' to it ... i.e.: folder_path/webERP & folder_path/wiki)

It looks, like GreenFlatDog pointed out, that there was a little bit of a logic switch between a numerical index and just dropping in a wiki path. Because of this quirk, setting the "Wiki Application" dropdown to the Wiki application you are using will cause the hyperlinks to not be generated. Disabling it will allow the wiki hyperlinks to be properly generated based upon the path you set.

Sounds like this little quirk will be fixed soon - loving the wiki integration!

Thanks all.
---

Timothy Snowden
Solid Rock Design Co.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)