Print in Custom Action

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
stpaulin
User
Posts: 137

Print in Custom Action

Post by stpaulin »

Hi,
I use fpdf in a php page to print a report from a list page.
In ListOptions Rendered event :

$this->ListOptions->Items["print"]->Body = "<a class=\"btn btn-default center\" href=\"fpdfreports/ac_remise.php?id=".$this->id->CurrentValue."&current_user_id=". CurrentUserID() ."\" target=\"_blank\"><i class=\"fas fa-solid fa-print\"></i></a>";

Then, I can print my report for each record.

Now, I want to call my page that makes the print (ac_remise.php) in a custom_action.
My purpose is to print the the report for each selected records from a list page using a custom action.

How can I do that ?

Help please


mobhar
User
Posts: 11660

Post by mobhar »


stpaulin
User
Posts: 137

Post by stpaulin »

Can you help me with the use of key_m[] in my case ?

I've tried before replying without success.
What i did :

Table setup => "Multi-Update page"
Multi-Update : enabled
Modal-dialog : enabled

I define just one field for multi-update modal and then in Page_Redirecting event of multi-update page :

// Page Redirecting event
function Page_Redirecting(&$url)
{
    // Example:
    //$url = "your URL";
    $url = "fpdfreports/ac_remise.php?id=".$this->id->$row['id']."&current_user_id=". CurrentUserID()."&keys=key_m[]";
}

But it doesn't work.
How can I send selected records to "ac_remise.php" ?
Help please


mobhar
User
Posts: 11660

Post by mobhar »

You may put this code in Page_Redirecting server event under Multi-Update page to check the filter string:

$this->setMessage($this->getFilterFromRecordKeys(false));


mobhar
User
Posts: 11660

Post by mobhar »

If you want to get only the selected records key, then you may put this following code in Page_Redirecting server event under Multi-Update page:

if (!empty(Post("key_m")))
    $this->setMessage("Selected keys: " . implode(',', Post("key_m")));

Post Reply