This topic is locked

Adding custom function to bulk-edit records

11/2/2010 9:59:00 AM
PHPRunner General questions
D
dsaunier author

I have objects for sale in my main list, with the "for sale" status on the front page. Currently I need to go into each record to update that status,

whereas I'd like one button to edit several objects at the same time, in this case to be able to put them back for sale by updating their status.

Trials and errors have made me lose serious hair on this while I thought it would be quick and easy. Adding a custom button works but then simple code never gets executed, either custom PHP or Javascript.

The PHPR function is called "onserver" but whenever I enter custom vars in here, the button gets stuck and nothing occurs. I could send a basic email, but am never able to detect checked items and bulk change their status.
I cannot imagine such a simple bulk-edition from the homepage would not be feasible, what do I miss ?
Thanks for any tip !

Sergey Kornilov admin 11/2/2010

As a first step you need to make sure there are no errors in your Javascript or PHP code that may prevent this from working. As a rule of thumb you need to start with really simple code and once you got it working you can add more functionality.
If you have a valid support contract you can post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

D
dsaunier author 11/2/2010

Makes sense. Indeed I started with an email function, and received it, in which I tried to get the id of the cheked boxes.

I then just added the 2nd line and it stopped working, really puzzled here...
$result["txt"] = $params["txt"]." world!";

foreach($keys as $key){$result["txt"] .= $key.'<br />';}

mail("myaddy@gmail.com", 'subject', $result["txt"]);
Can you confirm what I'm trying to do, editing records in bulk from the Listing view, is doable ?
Regards.

Sergey Kornilov admin 11/2/2010

Yes, it's designed for this purpose exactly.

D
dsaunier author 11/3/2010

Hi
I'm very annoyed by what seems a simple function to read checked boxes, I thought it'd take a few minutes to do that with PHPRunner.

Could you shed some light as to why just adding a "foreach" php function seems to make it stop work ?
The syntax checker confirms "Syntax Ok". I have :
// Put your code here.

$msg.= "Checked infos: \n\n";

foreach($keys as $field=>$value)

{

$msg.= $field." : ".$value."\r\n";

}

$emailna ="mine@gmail.com";

$subject="Button test";
$ret=runner_mail(array('to' => $emailna, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
but then checking a box and clicking the button just outputs a "Sending request to server..." msg on screen and I get no email - which I do receive when there is no "for each" loop to try and gather checked values.

I've been a PHPrunner buyer for years and am puzzled here, help much appreciated.
Regards.

Sergey Kornilov admin 11/3/2010

As I mentioned earlier - if you have a valid support contract you can post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

D
dsaunier author 11/4/2010

Hi,
It seems I have no current support, but upgrading is not a priority for me as the current version does what I require. What other support options do you have to answer what will obviously not be a big issue as it is just about saving the value of checkd boxes ?

I do understand the need to have paid support, but a $299 upgrade to solve this makes no sense in my case where I bought several versions of PHPRunner and have 5.1 that does what I need.
Regards.

A
ann 11/4/2010

Hi,
support and upgrade are sold separately.
You can purchase a support for $99 at

http://xlinesoft.com/buy_support.htm