Sunday 5 May 2013

KwaMoja now has a plugin architecture!

Yesterday Munir blogged about the new KwaMoja plugin architecture. As he says in his post this will enable both open source and commercial plugins to be written for KwaMoja. The code with this system in can be found here, and a demo plugin can be downloaded from here.

This is an exciting new development as it means that specialist areas, such as health and education, to name but two, can now have full KwaMoja support. Previously code for this sort of area would not have been part of the main line, as it would be too specific to be included.

It also provides an opportunity for third party developers to make money from the KwaMoja ecosystem.

KwaMoja plugins come as zip files, they must be uploaded to the KwaMoja installation from the browser interface, and then unpacked and installed via the same interface.

There are three scripts that have been added to KwaMoja: PluginUpload.php to load the plugin to the installation, PluginInstall.php to unpack and install the plugin and PluginUnInstall.php to remove the plugin.

Later today I hope to post a tutorial on how to create your own plugins.

This code could be adapted to work in webERP if Phil Daintree wanted to work with us on doing that. From his recent behaviour I suspect he wont.

Friday 3 May 2013

Where did you say the truth was Phil?

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will apologise and amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.


Phil Daintree has recently started to say that the truth is at the web site he hijacked from a project that was started by an Indian gentleman as a result of this exchange on here:

http://weberp-accounting.1478800.n4.nabble.com/Add-all-into-Shipment-td4655643.html#a4655738

However let us ignore the ethics of stealing another projects domain name to use to attack a developer in your own project, but rather let us put to rest what is really the truth once and for all.

Writing "Hate Pages" about fellow developers and then denying them the right to reply has always been Phil Daintree's weapon of choice when trying to bully developers out of the project. Back on 11 September 2007 when Phil was trying to bully most of the early webERP developers out of the project, he wrote to me telling me he had written one of his hate pages about them and was going to publish it on weberp.org. At the time I dissuaded him from this action. He again brought the subject on the following day, and again I had to dissuade him. Unfortunately when he came to writing his "hate page" about me there was nobody left to dissuade him.

Phil starts off by saying that the page is a defense against things I have said in this blog. However as anybody associated with the project for long can tell you Phil has been putting up hate pages about me for several years now, as can be seen rightv back in this thread: http://weberp-accounting.1478800.n4.nabble.com/AP-checks-td4019909.html#a4040317 All my blog posts are date stamped, so this is a lie.

Phil then says that anybody who opposes him must be me in disguise and says all their messages come from the same IP address. Where is your proof of this silly statement Phil? Oh there is none, because it is a lie! This from a man who poses on the internet as somebody called Anthony to attack me!!

Phil then goes on to say that the fixed asset module I wrote did not work. Yes it did, and is still in use at one of Uganda's biggest retailers (Bata shoes). Where is the link to these bugs Phil? Oh there is none because it is a lie.

Phil says he then removed me as admin. I have linked to the posts where he removed me as admin in an earlier blog post. The real reason was that he was upset that we had an argument over retaining the purchase order history. Where is your proof that this when you removed me Phil? Oh there is none because it is a lie!

Amendment 2712/2013:

Phil has now sent me evidence that he withdrew my svn access before the discussion on purchase ordering. This may or may not prove that he also withdrew my admin at this point, but he certainly didn't have the courage to tell me this either publicly or privately until after he had his ego dented by the PO conversation.

Phil then claims credit for some changes done to purchase ordering. As I have linked to in an earlier post the changes were written by me. As I had at that point had my access to svn removed, I posted the changes to a different repository. As demonstrated in the earlier post, Phil took my commit and then posted it the following day (these commits are date stamped by sourceforge) claiming it as his own work!! What is more incredible is that he now claims I "bitterly opposed" my own changes. Phil where is your proof of any of this? Oh there is none because it is a lie.

Phil says he originally removed my svn access because I was overwriting his changes. Does he post any links to this? No he doesn't because there are none. It is just another of his lies.

Amendment 27/12/2013

Phil has now sent me a commit where I had accidentally over written some changes that he had done. I apologised for this almost immediately after, as our commits had crossed. I was in Africa at the time on a very slow internet connection and hadn't had time to update. The commit only overwrote some case changes to variable names. Hardly the crime of the century. Certainly not as bad as his recent commit forcing many users off webERP. My​ reaction was to immediately apologise to Phil , and explain. His reaction was to remove my SVN access.

Phil says I wanted to do the database upgrades in a new language of my own invention calle "pseudo sql" In fact the language was PHP as can be seen here:
https://sourceforge.net/p/weberp/code/9402/ Where is the proof of this new language Phil? Oh there is none because it is a lie!

Phil then claims I was "violently" opposed to his number formatting system. All I suggested was that we used the functionality that PHP provides for doing this instead of inventing his own functionality. No violence used whatsoever!! Phil's solution also requires that the locale be installed, as has been discovered by him since. Where is your proof of this "violence" Phil? Oh there is none because it is another lie!

Phil then goes into a long diatribe on his attempt to claim the copyright to the whole codebase. This contradicts itself at every twist and turn, in his desperate attempts to deny it. As far as I can make out the latest story is that saying that the copyright is owned by weberp.org is a secret code for saying that the copyright is actually owned by the individual authors. Really Phil? In that case why the need for a secret code? Why the need for subterfuge? If thats what you mean just say it and be clear! Or is it just another lie?

He then goes on to say that my access to the mailing list is only moderated! Not so as anyone can see from the messages to that nabble forum. For instance here:
http://weberp-accounting.1478800.n4.nabble.com/BOMExtendedQTY-php-does-not-properly-handle-PO-Quantities-td4656253.html As anyone can see Bob's postings to the nabble forum are allowed through to the mailing lists mine are not. Are these postings in any way abusive? No, it is just another of Phil's lies.

On the subject of abuse as anybody can see by reading the archives, more often than not the abuse was started by Phil, as a result of him losing a technical discussion.

Phil says he took away my svn access because I was no longer making a useful contribution. Strange that he has continued to take my code and commit it, just claiming it as his own code!! Does he post any links to where my contribution was not useful? No he doesn't.

Phil then goes into a long quote purportedly written by me. Does he post a link to this post? No he doesn't. Can he find it in googles cache? No he can't. In fact can he find it anywhere? No can you as a reader? I have tried searching for it by using some phrases from it, and the only person who appears to have written it is Phil Daintree. Oh dear another lie Phil?

He then prints a reply to his own comment. I shall ignore most of this as commenting on his own comment is just silly.

Then he tries to justify a different method of calculating a developers contribution to the code. All I can do is point people to his original comment here: http://weberp-accounting.1478800.n4.nabble.com/Copyright-notices-and-License-statements-tt1487216.html#a1487221 How bitter do you have to be to keep changing these things to try and show that you are a bigger and more important person??

+Phil Daintree  says in his hate pages:
 

"http://sourceforge.net/p/web-erp/code/5834
 
contained references to his Kwamoja fork.
I asked him to review and fix it... he refused."
 
Strange because http://sourceforge.net/p/web-erp/code/5836/ clearly shows me 
removing these references to KwaMoja immediately +Phil Daintree  pointed out my mistake - An 
accidental mistake I apologised to him about straight away. He then goes on to fabricate
an email where I apparently say I wasn't going to remove these references, even
though sourceforges SVN clearly shows I already had!!  
 
+Phil Daintree says that I am not a member of the ICAEW. Quite right I am not, but when did I claim to be?
What I have said is that I am a UK qualified accountant. Phil is very careful in his choice of language
here because he implies that I am not a qualified accountant without actually saying so. 
He knows what my qualifications are because I have shown them to him so he resorts to such
innuendo in the hope people won't read too deeply into what he says. This is another reason why
+Phil Daintree  is so frightened of allowing me a right to reply to his lies.

+Phil Daintree has said I overwrote some of his work on purchase ordering and has
linked to some commits on this subject. Yes I fixed some bugs as Phil's work didn't  
deal with cancelled orders. I notice these bug fixes are still in the webERP code 
today!! Strange that exactly 5 years on Phil hasn't got around to removing this
code if it is so bad!! It is typical of the man that he tells these lies and doesn't have the 
honesty to allow me to link to the evidence showing that all that he says about me
is just lies, lies, and yet more lies! 

+Phil Daintree says in his hate pages that the reason he removed my ability to commit to the webERP project was that I misspelled  the name of a CSS class in one of my commits. As anybody who understands HTML/CSS programming can tell him if a web browser finds a css class it doesn't know it just ignores it. There was no performance loss or harm to the user interface. Compare this to some of the really bad commits he and others have done! Interestingly a css class of the exact same name was soon added to webERP meaning that +Phil Daintree  himself now commits code with this identical css class in it!!

So that's it? No comments on what I have said in this blog at all, despite that being what it was titled as. Just lies and nasty innuendos about my coding and my character that he cannot prove because they are just lies.

I will leave it to the reader to judge what is the truth. I have always been content to put the facts before the community and let them judge. I see no need for censorship or banning. So why does Phil believe in censorship and banning to avoid criticism?

ps Phil, can you stop sending the hate mail that pollutes my inbox every day?

Hate blog????????

This page is written in response to the lies that +Phil Daintree  has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

Phil has described my blog in the webERP forums as a hate blog!!

This is a very strange description for it. I assume he is not talking about the tutorials on the use of the api that he banned from the forums, or yesterdays tutorial on the security systems.

This blog was written as a reaction  to his continually posting hate pages about me on the web. I ignored them for years, but in the end was persuaded to to publish the truth here. There is nothing in this blog that Phil disputes. All posts are sent to him first to allow him the opportunity to review and dispute anything. He can freely comment (though I am not allowed to comment on the lies he says about me) anywhere in this blog. I back up all my allegations with facts, and links to those facts. Unlike Phil.

I feel sad for Phil, after all we were friends for a while. The life of a liar is not easy, continually looking over your shoulder to see if you are being found out. Look at the lengths the poor guy has to go censoring me, to try and ensure nobody finds him out. No Phil, I don't hate you, if you brings out any emotion it is just pity. It really saddens me that you have fallen to such a low level that you should resort to such lies in pursuit of your rather pathetic personal vendetta against me.

Phil and I have both worked hard at webERP over the years, and you can see the amount we have both done by following the link he recommends here:
http://weberp-accounting.1478800.n4.nabble.com/Copyright-notices-and-License-statements-tt1487216.html#a1487221

Thursday 2 May 2013

KwaMoja/webERP security

This question came up recently on the webERP forum:

I'm new to webERP and naturally have some questions. I've created a role called "Inventory" in Access Permission Maintenance, then a user for this role and limited access to just "Display Inventory" module in User Maintenance. But I'd like to further limit access so my inventory user can NOT see pages in this range:

• Inventory Valuation Report
...
• List Negative Stocks
• Stock Transfer Note[/align]

The webERP Manual is vague on this. Is there a doc I can read to find out can I restrict a user, for example, to just Inventory.Maintenance.View or Update Prices Based On Costs?


Unfortunately the advice the poster was given was complex and not really correct, and the administrator of the forum has blocked me from helping people there. However, there is a much simpler answer which doesn't involve setting up phantom security tokens, and other complexities. This is to go to each of the reports they want removed in the "Page Security Settings" option in the setup module, and from there just give it a security token of a higher level than the inventory user. For instance set it to "General Ledger Reports/Inquiries" which makes more sense for something like an Inventory Valuation report. Then the report will be gone from the users screen the next time they log in. It's as simple as that!

However that led me to thinking that a lot of people (including it seems the current webERP project developer) who don't really understand the security system within KwaMoja/webERP so I thought it might be good to explain how it works.

Every user has a security role. These roles are meant to mirror their real life roles. So for instance we may have a role of an inventory clerk, and a role of an accountant. There can be any number of inventory clerks, and any number of accountants, all having the same role. As many roles as are wanted can be created.

Each role is given a number of security tokens. Each of these tokens permits the user with that role to perform different functions. There are a number of predefined tokens:


0 Main Index Page

1 Order Entry/Inquiries customer access only

2 Basic Reports and Inquiries with selection options

3 Credit notes and AR management

4 Purchasing data/PO Entry/Reorder Levels

5 Accounts Payable

6 Petty Cash

7 Bank Reconciliations

8 General ledger reports/inquiries

9 Supplier centre - Supplier access only

10 General Ledger Maintenance, stock valuation & Configuration

11 Inventory Management and Pricing

15
User Management and System Administration

When a user tries to access a function, the security token for that functionality is looked up in a database table called scripts and it is then compared with the array of security tokens that is owned by the role allotted to that user. If the token is in that array, the functionality can be accessed, if not, then access is denied.

This lookup is also performed when displaying the menus, and if the security token is not there, the menu option will not be displayed.

This system is simple elegant and flexible. It can be made as simple or as complex as an organisation requires. For instance a one person business only needs one security token, and one role, whereas a large business with hundreds of employees will have a very complex structure.

I hope this helps provide some insight into how the system works.

Thursday 25 April 2013

Phil Daintree's shameless lies - Part 6

This page is written in response to the lies that +Phil Daintree  has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

Well it seems our hopes for a resolution to this were premature. No sooner have the lawyers of one hosting company forced Phil Daintree to remove his lies about me, he moves to another. The lawyers of that hosting company force him out and he moves to another. With the help of those lawyers we are seeking a world wide blacklisting for him to stop him owning any domains, and remove any he currently owns from his control.

Funny that he will never discuss these points. He has the chance on here - I have publicly committed to non interference with his comments, and will happily submit to third party checking of that claim. He doesn't allow me the right to comment on his page though. I am sure readers will form their own opinions about why he is so scared to resolve these issues by discussion.

Most of his page consists of a post I have allegedly made. I have searched via Bing, Google, and Yahoo, and have failed to find this post anywhere, except on pages posted by Phil Daintree. Funny this.... I am sure readers will form their own opinions about why he is so afraid to resolve these issues by normal discussion.

Lastly on the subject in my previous post on the subject of copyright. Phil Daintree for some reason thinks that it is important that under his instructions when I had just joined the project that I had put the copyright notice on to webERP. I then took legal advice discovered it was wrong and after consultation with Phil Daintree I removed the earlier bug I had done. Can someone tell me why this supports his case to own the copyright of my work?

The bible tells us:
Thou shalt not bear false witness against thy neighbour.

Phil would do well to remember this teaching

Saturday 20 April 2013

Now can we all move on?

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.


Phil Daintree has now been forced to take down his "untrue, offensive, slanderous, harassing" web page about me. Let us hope that he can now move on with what he is good at, that is developing webERP code. This can only be good for his state of mind.

I agree with Mu, that as an act of atonement for all the lies and misinformation he has spread about me and others, the decent thing to do would be to redirect traffic from kwamoja.org to the project site at kwamoja.com.

To take another projects web site in pursuit of a nasty personal vendetta, offends all the notions of etiquette in open source. Open source is about all working together.

Saturday 13 April 2013

Phil Daintree's shameless lies - Part 5

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.


Phil's claim to own the copyright of all the webERP code.

The Berne convention asserts that the copyright is owned by the author of a work unless they have explicitly handed over that ownership to a second party. It further states that no copyright message is needed to assert this right, and that proof of authorship is sufficient. Some free software projects (most notably the GNU project) ask that the copyright on all contributions be physically signed over to them. This has never been done with webERP and given that as he himself has said he has fallen out with most contributors it is unlikely that he would retrospectively given this permission.

In September 2012 Phil Daintree unilaterally took the decision to alter the footer on webERP to state that the copyright to all the code was owned by weberp.org, a domain name owned by himself. This was, in the words of Fred Schuettler (a contributor to webERP) an adolescent attempt by Phil Daintree to goad me into an argument on the subject.

However it is important to those of us who have contribute significantly to webERP (my contribution can be found by following the link Phil Daintree suggests in this email). Phil has suggested in the past that he wished to change the license to the Apache license, which would mean that anybody could take my code and turn it into a commercial closed source application. I am certainly not alone in the world of Free software by being opposed to my code being licensed in this way as a simple Google search will show you. Phil Daintree says he will swear in court to the fact that "Tim is violently opposed to this for his own reasons". This implies that:

1 - I have been violent on the subject. Even in writing I have merely stated that I don't like permissive licenses. Can Phil Daintree produce any example of violence, or would this be perjury if he swore to it in court?
2 - That my reasons are somehow devious. Is he stating that the libreoffice developers antipathy to the apache license devious?

When I queried why Phil Daintree had decided to make this change without speaking to any of the other contributors, he initially claimed that he was not the owner of weberp.org and that weberp.org was owned and controlled by all the contributors. However while trying to get the launchpad site set up by Zhiguo Yuan removed he asserts that "I am the owner of the weberp domain.". Also a simple whois search shows that Phil Daintree is the owner of weberp.org. If the contributors have any control of weberp.org then how come Phil Daintree has asserted that only content that he agrees with will be included? How come only he gets to decide who can help people on the forum? Come on Phil get real!

I then pointed out that weberp.org did not exist as a legal entity and so could not own the copyright. Phil countered here by saying that "weberp.org did exist as a legal entity by vitue of the statement ol intent". However his recent statement on this issue says "To even suggest that a domain name could actually own anything is foolishness in any event". Who is the fool Phil? It appears that he has done a 180 degree turn on this and still ended up pointing the same way!!

In English law there is a concept (and most countries have a similar concept in their law) called the man on the Clapham omnibus. This basically asks what the ordinary reasonable person approaching an issue would think. I assert that any reasonable person on viewing webERP would believe that the copyright is owned by weberp.org, and on looking up that domain name would believe it was owned by Phil Daintree, and thus the copyright was owned by Phil Daintree.

Phil Daintree now asserts that when he is saying that weberp.org owns the copyright then "any idiot" would see that he meant that the copyright was owned by the contributors. Obviously I am not an idiot then!! If this is what Phil Daintree means then why the subterfuge? Why not just say that? All I have ever asked him to do is to clarify his motives for making that change at that point in time.

Phil Daintree likes to pretend that the only person who is upset by his claims to own the copyright of all the code. Not so. This has been an going issue with other developers since that start of the project.

So I say, "Come on Phil tell us the reason you made this change".

+Phil Daintree
that he creates a COPYRIGHT.txt file in webERP he clearly lays out that the copyright of the contributions belongs to the author of those contributions, which if he wants he can then link to from the footer of every page. +Phil Daintree refuses to even consider this. People can decide for themselves why he will not make a clear and unequivocal statement like this>

Sunday 7 April 2013

Who does he think he is punishing?

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.


+Phil Daintree  has announced that ...as punishment for exposing his lies in this blog he has withdrawn my svn access and he will no longer accept code from me and he says that as further punishment my forum account is terminated to try to force me to stop helping people on the forums...
So I can no longer spend my time helping users on the forums and users can no longer use my code.
Who is this punishing Phil?
There is already a bug reported here that I have fixed and sent to Phil but +Phil Daintree  is refusing to apply this fix, so users of webERP have to put up with this bug.
As has happened frequently throughout history, it's not the lies that have been Phil Daintree's undoing, but the the attempts at covering them up.

Programming the KwaMoja API - Error codes

In the last couple of parts of this tutorial which can be found here

API Client Part 1 and API Client Part 2

we produced a simple client application where a user selected a location, typed in a part code and the application fetched the info about how much stock was available from that location from our KwaMoja implementation.

This code can be fetched from here:

http://www.kwamoja.com/documentation/xml-rpc_tutorial.zip


However we did not touch on what would happen if something goes wrong. Load up the application, and you should see a screen similar to this one:


Now load index.php into our editor and change the password on line 38 from 'kwamoja' to 'wrong'. Now if we reload index.php we get this screen.

As you can see it cannot fetch any locations as the authentication does not work on this kwamoja instance. However it provides us with no information about why this has happened. If you recall from the tutorials regarding the writing of the client, the XML-RPC call returns an array containing two elements, the first - $Response[0] in our client - contains an integer code, and the second the result of the inquiry, if one is expected. If the integer code is zero, this indicates success. Any other code indicates an error. These error code can be found listed here.  As you can see error code 1 indicates 'NoAuthorisation' which will be the error returned if the user name or password is incorrect.

To catch the errors we create a session variable (not the best way I know, but convenient for this tutorial) to hold any error messages that happen, so that we can show the to the user. So the initialisation code at the top of index.php becomes:

<?php
    include 'xmlrpc/lib/xmlrpc.inc';
    $xmlrpc_internalencoding='UTF-8';
    include 'xmlrpc/lib/xmlrpcs.inc';
    $_SESSION['Errors'] = array();
?>


and then at the bottom of the output we have a loop to output these errors:

foreach ($_SESSION['Errors'] as $Error) {
    echo $Error;
}


Now we just need to capture that error. We need to put this code at the bottom of the GetLocations() function so that it now reads:

if ($ReturnValue[0] == 0) {
    return $ReturnValue[1];
} elseif ($ReturnValue[0] == 1) {
    $_SESSION['Errors'][] = 'Incorrect login/password credentials used';
}


Now run the index.php script again in your browser and you should get out put similar to this:

We just need to put this code at the bottom of our other functions, and then they will all be able to catch this error.

Now if we put the proper password back in index.php should work as before.

Now try entering a stock code that you know doesn't exist and see what happens. I entered a part code called 'wrong' and this is what I see.

This is not very helpful output so we need catch this error. A quick look here shows that error code 1047 is 'StockCodeDoesntExist' and this should be returned if the code we entered is wrong. So we need to capture error 1047 in the GetStockQuantity() function. The code at the end of this function now becomes:

} elseif ($ReturnValue[0] == 1) {
    $_SESSION['Errors'][] = 'Incorrect login/password credentials used';
} elseif ($ReturnValue[0] == 1047) {
    $_SESSION['Errors'][] = 'The stock code you entered does not exist';
}


So now the function is checking that the user/password is correct and also checking that the stock code is correct and providing useful feedback in the case of any problems. We could go on and check for other errors but this should be enough for now.

I have uploaded the new tutorial files to here.

Next time I will have a look at debugging the application when an error we haven't caught occurs.

Thursday 4 April 2013

An open letter to Phil Daintree of webERP

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

As with anything I publish, anybody (except the viagara  salesmen) can comment on my blog. I make a public commitment that I will not attempt to forge or censor any posts, as goes on in all the communication channels on webERP. If +Phil Daintree wishes to dispute anything in this blog he is free to do so. If I am wrong I will alter my post. I trust in the common sense and intelligence of people to read the facts and to make up their own minds.

Phil Daintree was forced into issuing a public apology for his lies regarding me on the webERP developers list. I tried to post a reply to the mailing list but as always happens to my posts it was immediately rejected. I believe it makes some valid points so I publish it in full here:

Phil,
Thanks for the apology, which I accept in the spirit that it was sent.

I do think you are wrong on one matter though. You say "It is a sad
reflection of the state of our relationship that I automatically assume the worst". I would rather say that "It is a sad reflection on
your perception of the state of our relationship that you
automatically assume the worst". You see every action of mine (and
anyone who has disagreed with something you have said) through a prism
of hatred that means you only want to assume that the action was in
some way aimed to get at you. It is not. There is no conspiracy to get
at you. No conspiracy to make your life hard. In all the cases where
you have read this into someone's actions there is a much simpler
explanation than that, as was the case here.

All I want is to be able to develop software in a community where
anything can be discussed without fear of threats or abuse if I say
something you don't agree with. I just want to develop software in a
community where the ownership rights of contributors are honoured. I
want to develop software in a community where all contributors are
treated with respect, not where they will be publicly belittled for
weeks when you don't like their contributions. A community where if
their contributions need improving, then they are politely helped to
improve so that they can get better.

You seem to have made it clear that this is not the sort of community
you want, and there is nothing I can do about that. You control all
the means of communication in the community and you have shown that
you are determined to use that control to eliminate any dissent. That
is why I also contribute to other projects, where the community is
more like the one I talked about above.

When I feel that the work is not going to be controversial I also
include it in webERP, and all other work is immediately available for
you to decide for yourself.

You have said before that your banning me means you no longer have to
defend your decisions. I think this is wrong. I think as the leader of
the community you have an obligation to defend your decisions if
members of the community ask for reasons.

In conclusion Phil, there are no plots or counter plots. There never
were. The state of our relationship is only within you, and you are
the only one who can break that cycle.


Thanks
Tim 

Monday 1 April 2013

Phil Daintree's shameless lies - Part 4

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree  is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.


As with anything I publish, anybody (except the viagara  salesmen) can comment on my blog. I make a public commitment that I will not attempt to forge or censor any posts, as goes on in all the communication channels on webERP. If Phil Daintree wishes to dispute anything in this blog he is free to do so. If I am wrong I will alter my post. I trust in the common sense and intelligence of people to read the facts and to make up their own minds.

Lie number 6 - Phil Daintree's outrageous libel against Kalmer Piiskop and myself

I didn't intend  to write another of these so quickly after the last one, but I am very annoyed on behalf of Kalmer and myself. At 12.56 pm BST on the 31/3/2013 Kalmer sent a bug fix into the webERP developers mailing list. As it was a serious problem I immediately applied the fix, and updated the webERP subversion repository.

At 22.06pm on the same day Phil Daintree then wrote a nasty and abusive email to the same list accusing Kalmer and I of trying to undermine the project by deliberately making Phil Daintree's life more difficult. He threatened me with the removal of my commit access. The basis of his accusations seemed to be that the commit produced a large diff (actually only 166 lines that takes a few seconds to scan if you view the code side by side as is possible with sourceforge). I sent the reply below to the mailing list but Phil Daintree has rejected it:


Phil,

This email is deeply offensive both to Kalmer and myself. You sent
this email accusing us of playing silly tricks and trying to make your
life difficult, whilst all that had happened was Kalmer sent a patch
to improve webERP and I committed it.

The email was sent at 22.06 BST on 31/3/13. Then at 22.17 BST on
31/3/13 you applied Kalmer's patch yourself and got precisely the same
diff back that I had got.

Both Kalmer and I are way too busy for the sort of silly games you
play. If you spent your time developing instead of trying to come up
with ever more bizarre ways to stop me helping people on the forums
webERP would be the gainer.

Where is your apology to us? Have you really sunk this low that you
should make allegations like this on a public mailing list?

Any forks I contribute to, (and for that matter the one you help
sponsor) are not in competition with us at webERP. They share code
freely. We are all after the same thing. There is no hiding code till
after the release has been done. We can (and do) take their code and
include it when we want. Please either start behaving respectfully to
the contributors to webERP or leave the project.

Thanks
Tim

As I have stated in previous blog posts I am perfectly happy to debate any issue with Phil Daintree, with no forgeries or censorship. It seems he is not so honourable as he makes these libels against webERP contributors, and then refuses that person the opportunity to respond. This is a truly despicable way to behave.

I have never, and will never do anything to harm the project. I have spent many thousands of hours working on webERP and many thousands of pounds promoting it. I find it cowardly and despicable for Phil Daintree to use his absolute control of all the project resources to spread his lies about me like this. It is about time he moved on.

Here is a screenshot of my editor showing Phil Daintree's windows line endings on his file.


Please note that Phil has now apologised for this lie. The full text of his apology is as follows:

Sorry Tim, I apologise unreservedly - I can see this is not a silly trick to make life deliberately more difficult for me. It is a sad reflection of the state of our relationship that I automatically assume the worst. I should check my facts in future.

 

Phil 

 

Saturday 30 March 2013

Phil Daintree's shameless lies - Part 3

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

As with anything I publish, anybody (except the viagara  salesmen) can comment on my blog. I make a public commitment that I will not attempt to forge or censor any posts, as goes on in all the communication channels on webERP. If Phil Daintree wishes to dispute anything in this blog he is free to do so. If I am wrong I will alter my post. I trust in the common sense and intelligence of people to read the facts and to make up their own minds.

Lie number 5 - Phil Daintree makes untrue statements about me on the mailing list, and refuses me the right to reply

This is more than one lie, but to save space (there are so many lies to get through) I will combine them all into one. Here are a selected few of his untrue statements:

  1. Phil Daintree said here http://weberp-accounting.1478800.n4.nabble.com/Copyright-td4655625i20.html#a4655722 that "I understand Tim is ranting to everyone he can off list now". This was totally untrue. The only emails I had sent to people off list were helping them with webERP queries that they had put on the list, and that Phil Daintree had rejected my replies to them on the list. I challenge Phil Daintree to find one person who had received a "rant" from me. Why does this upset me? Because Phil Daintree has sent this to a publicly archived mailing list. He refuses me the right to reply to that list to challenge this assertion. This gives credibility to his lie.
  2. Phil Daintree said in a post to the mailing list here http://weberp-accounting.1478800.n4.nabble.com/Fwd-Web-erp-svn-SF-net-SVN-web-erp-5765-trunk-tt4656055.html that I was "..hell bent on destroying the project..". This because I had removed the trailing white space that he had put onto the end of the lines. The interesting thing here is that Phil Daintree reversed my patch, and then immediately applied it as his own work, and then in some of his recent web pages about me has even included it to prove that he has written "most of the code in webERP". If that patch shows I am "hell bent on destroying the project" then obviously so is he!! Again I was not given the right of reply. Why does this upset me? Because Phil Daintree has sent this to a publicly archived mailing list. He refuses me the right to reply to that list to challenge this assertion. This gives credibility to his lie.
  3. Phil Daintree says in a post here http://weberp-accounting.1478800.n4.nabble.com/Fwd-Re-WebERP-developers-Tag-tt4656191.html#a4656194 that "... I get these silly emails almost daily!..". On that particular day I had just returned from nearly three weeks away trying out the new golf clubs! I hadn't even taken a laptop with me! I couldn't have been sending him any emails let alone silly ones. I do occasionally write to Phil Daintree when he has posted a lie about me, and if I send an email to anyone that mentions Phil Daintree I do copy him on it, so that he can be sure there is no rant, and so that he has the opportunity to reply! Can Phil Daintree say that he copies me on emails that refer to me? Has anyone received an email about me from him that mentions me that doesn't include me in the address? I know that many have as they have forwarded them to me. Why does this upset me? Because Phil Daintree has sent this to a publicly archived mailing list. He refuses me the right to reply to that list to challenge this assertion. This gives credibility to his lie.
On the subject of right to reply Phil Daintree can make any comments on this blog that he wants, and I publicly promise that I wont interfere with them in any way. I am more than happy to debate any issue with him, and to let others decide on the basis of the facts. Unlike him I see no need for forgery or censorship to push my point of view, I am happy for the facts to be debated and for others to decide.

As this post is basically three lies rolled into one, and its longer than I intended I will leave it there for this time.

Sunday 10 March 2013

Can open source be developed behind closed doors?

This page is written in response to the lies that +Phil Daintree has written about me, and spread on the internet. Despite years of searching he has been unable to find anything I have written that is untrue, and he has had to resort to vague generalities, faked emails, and badly fabricated screenshots (you can see the joins if you zoom in using any bit mapped image editor). +Phil Daintree is welcome to make any comments to these pages, as he has done in the past. If I agree with what he says I will amend my writings, if I do not agree I have allowed his comments to stand next to mine so that people can make their own judgements. I have every confidence in the intelligence of readers to make a sensible judgement based on the facts. +Phil Daintree will not allow me the right of reply to any of the lies he has told about me. It seems to me significant that he realises that if people see both sides of the argument they will see through his lies.

As with anything I publish, anybody (except the viagara  salesmen) can comment on my blog. I make a public commitment that I will not attempt to forge or censor any posts, as goes on in all the communication channels on webERP. If Phil Daintree wishes to dispute anything in this blog he is free to do so. If I am wrong I will alter my post. I trust in the common sense and intelligence of people to read the facts and to make up their own minds.

WebERP has started to move to a "behind closed doors" development model, whereby most of the code changes don't get pushed out to svn until after a release has been done. For instance the changes made for 4.10 weren't committed to svn until after 4.10 was released and then as one large patch (http://sourceforge.net/p/web-erp/code/5797/). The same has since been done for the 4.10.1 release. So the question is, can this development methodology work in the long term?

Not committing code changes until after a release has been done, was a tactic that Oracle employed with mysql as an attempt to stop any forks (such as mariadb) from using their code until after they had released it (http://www.mysqlperformanceblog.com/2012/08/16/where-to-get-a-bzr-tree-of-the-latest-mysql-releases/), and to make taking those commits harder. It seems the intention was to give Oracle a commercial advantage. Presumably this is also the intention behind Logic Works using this technique for their webERP commits. However eventually Oracle was forced to drop this tactic.

I feel that in the end one of the great advantages that open source development has is the concept of "peer review" where the code can be looked at and reviewed by everybody, thus finding and fixing  bugs before it is unleashed as a release for people to use in their businesses.

This was shown when the latest version of webERP was released with two scripts that wouldn't even run due to syntax errors in them, and the release had to be redone with the fixes in them, leading to the embarrassing result of there being two different file releases with the same name.

I think in the end Logic Works will like Oracle be forced to give up this behind closed doors development methodology.

Amendment 15/01/2014 - Phil has since said that he wasn't deliberately holding back committing his work, some of it was out for testing at customers and he didn't consider the rest of it sufficient to warrant a commit until after the release was made. Strange that when the work was committed it contained so many errors, but as I have said many times I want this blog to be a true and accurate record so I include Phil's comments so that all may judge.

Amendment 04/11/2014 - +Phil Daintree persists in denying this despite the evidence against him being so obvious. This is the initial commit Phil did on the 2/2/2013 for the release of 4.10.1 as is shown by the update to the Change.log file "+2/2/13 Version 4.10.1 Released". There then follows 5 commits of bug fixes. Here is a huge commit he did on the 22/2/2013 containing a lot of files that were initially in the 4.10.1 release but not updated to subversion. As can be seen Phil now updates the release date of 4.10.1 to the 22/2/2013, nearly 3 weeks after the first release. Phil has said "these files had been tested for some time on a customers server". However  here and here are examples of corrections I made immediately after this huge commit to scripts that wouldn't even run as they contain PHP syntax errors. Not only had they not been tested on a customers server they hadn't even been tested by Phil. Then here we have yet another release of 4.10.1 dated 25/2/2013 23 days after the first release of 4.10.1.
How Phil can persist with his lies in the face of such obvious evidence is a mystery only he can explain.

Thursday 7 March 2013

Programming the KwaMoja API - A simple client part 2

This is the second part of the tutorial on building a PHP client to extract data from KwaMoja via the API. If you missed the first, read this first. In the last part we created a client that queried the KwaMoja installation and extracted a list of stock locations, we then used to populate a drop down list in our HTML page. What we then wanted to do, was to extract the full name of the location, rather than just showing the code.

To do this we need a function much like the one we used to extract the array of location codes. Here is the full code:

    function LocationName($LocationCode) {

        //Encode the data items
        $UserID = php_xmlrpc_encode("admin");
        $Password = php_xmlrpc_encode("kwamoja");
        $Code = php_xmlrpc_encode($LocationCode);

        //Create a client object to use for xmlrpc call and set its debug level to zero
        $Client = new xmlrpc_client("http://localhost/KwaMoja/api/api_xml-rpc.php");
        $Client->setDebug(0);


        //Create a message object, containing the parameters and the function name
        $Message = new xmlrpcmsg('kwamoja.xmlrpc_GetLocationDetails', array($Code, $UserID, $Password));


        //Use the client object to send the message object to the server, returning the response
        $Response = $Client->send($Message);


        //Decode the response and return the array
        $ReturnValue = php_xmlrpc_decode($Response->value());
        if ($ReturnValue[0] == 0) {
            return $ReturnValue[1]['locationname'];
        }
    }


The first section encodes the parameters as XML. The first two parameters are always the userid/password combination, and for this function call we need a third parameter, which is the code of the location that we require the name of. The second section is identical to the previous function and creates an instance of the XML-RPC client class. The third section then creates an instance of the message class, with the first parameter being the full name of the API function being called, in this case kwamoja.xmlrpc_GetLocationDetails, and then the second parameter is an array of the encoded parameters, (location code, userid, password). This message is then sent to the server, and the response decoded into an array called $ReturnValue.

As last time the first element of the array signifies whether the function was successful (a zero), or any other integer for an error code. The second element is an associative array of details for that location. The key of each element is the field name for that value. In our case we just want the location name, so we return the element ['locationname']. If it was the telephone number we were interested in we would just return the ['tel'] element.

Changing the line in the HTML where we fill the drop down box to:

echo '<option value="'.$LocationCode.'">'.LocationName($LocationCode).'</option>';

we can see that the web page in our browser now looks a little better.

The full name of the location appears in the drop down the list, but the value returned by the form is still just the code.

All that is left to complete our client, is to type a stock code in the text box, submit the form and return the amount of stock for that code at the chosen location. First we need to insert some PHP code in the HTML to handle the form being sent:

<?php
        if (isset($_POST['submit'])) {
            echo 'The quantity of '.$_POST['StockID'].' at '.$_POST['location'] . ' is : ''.GetStockQuantity($_POST['StockID'], $_POST['location']);
        }
 ?>


As you can see this calls another PHP function - GetStockQuantity() - that retrieves the stock quantity for the required item at the required location. Looking at the API function reference in the manual the API function we require is kwamoja.xmlrpc_GetStockBalance. However this time there is a small addition we require as this function returns an array containing the stock balances at all the locations for the given stock item.

The full code for the PHP function is:


    function GetStockQuantity($StockID, $LocationCode) {
        //Encode the data items
        $UserID = php_xmlrpc_encode("admin");
        $Password = php_xmlrpc_encode("kwamoja");
        $StockCode = php_xmlrpc_encode($StockID);

        //Create a client object to use for xmlrpc call and set its debug level to zero
        $Client = new xmlrpc_client("http://localhost/KwaMoja/api/api_xml-rpc.php");
        $Client->setDebug(0);
        //Create a message object, containing the parameters and the function name
        $Message = new xmlrpcmsg('kwamoja.xmlrpc_GetStockBalance', array($StockCode, $UserID, $Password));
        //Use the client object to send the message object to the server, returning the response
        $Response = $Client->send($Message);
        //Decode the response and return the array
        $ReturnValue = php_xmlrpc_decode($Response->value());
        if ($ReturnValue[0] == 0) {
            $Items = $ReturnValue[1];
            for ($i=0; $i<sizeOf($Items); $i++) {
                if ($Items[$i]['loccode']==$LocationCode) {
                    return $Items[$i]['quantity'];
                }
            }
        }
    }


I wont go through this in details as it is mostly the same as the previous functions. The key section is the last:

        $ReturnValue = php_xmlrpc_decode($Response->value());
        if ($ReturnValue[0] == 0) {
            $Items = $ReturnValue[1];
            for ($i=0; $i<sizeOf($Items); $i++) {
                if ($Items[$i]['loccode']==$LocationCode) {
                    return $Items[$i]['quantity'];
                }
            }
        }


Here the RPC returns an array of locations with the stock quantities for each location, and we filter out the location we need.

Putting all this together we get the following when we run the script in our browser:

Looking at the stock status in KwaMoja we see:

Showing that we have returned the correct numbers.

I have uploaded the source for this tutorial to http://www.kwamoja.com/documentation/xml-rpc_tutorial.zip please feel free to download and try it out.

In the next part I will introduce some error checking into the code.