Hello,
This is a simple question, but I didn't found any answer in the forum or in the manual.
I need to update a project created with the version 5.1 of PHPRunner and I would like to "convert" it to v5.3.
I've got some problems, the main one being the different usage of custom buttons.
In an Add page, I used 2 custom buttons :
Button #1 : "Validate" button to validate in the DB a given reference number and get the corresponding description back in a field of the page.
Button #2 : "Save and add details" to save the added data and redirect the page to another add-page (not the list page).
When my project is opened with the v5.3, nothing works and I'm not able to recreate this behaviour anymore (even after a "Reset Page").
Here are the details and the problems :
Button #1
In the Visual Editor tab of the Add page, in HTML mode, I added the following code after the reference text box:
<SPAN class=buttonborder><INPUT id=submit2 class=button value=Validate type=submit name=submit2></SPAN>
In the BeforeAddevent, I first check the reference info with the "values" provided by this event and then:
[..]
$values["JOB_description"] = $data["PRD_description"];
if ($_REQUEST["submit2"]=="Validate")
{
$message = "Reference validated";
return false;
} else {
return true;
}
[..]
In the v5.1, it allowed to show the real description in the corresponding field if the user press the "Validate" button OR to save the page if he press the "Save" button.
Unfortunately it doesn't work anymore since, when I press the Validate button, nothing happens!
I tried to use the "insert button" functionnality of the Visual Editor, but since I need to check different "values" of the current page, and to assign the description value it doesn't work because they are not accessible in the server code. Any idea?
Button #2
In the Visual Editor tab of the Add page, in HTML mode, I added the following code after the Save button code:
<SPAN class=buttonborder><INPUT id=submit3 class=button value="Save and add details" type=submit name=submit3></SPAN>
In the AfterAddevent, I check the "requester" like this:
if ($_REQUEST["submit3"]=="Save and add details")
{
header("Location: actions_list.php?mastertable=jobs&masterkey1=".$values["JOB_ID"]);
}
else
{
header("Location: jobs_list.php?a=return");
}
exit();
Again, when I press the button nothing happens.
I tried to change the "id=" content to "saveButton1", but then the redirection never works correctly...
Anyone can help?