This topic is locked

Opening in a new window from dashboard

4/12/2017 7:32:23 AM
PHPRunner General questions
T
thudsen author

Has anybody had any luck in getting the invoice template to work successfully with a dashboard?
I've created a custom "invoice"/document which is brilliant. I have incorporated it in a project with works via a dashboard. Unfortunately the print view isn't designed to work in a pop up (but I have worked round this by having the invoice open in a new window by right clicking and "open in new frame". Is there anyway to automate this in a dashboard? I've tried with <a href ="link to site" target_blank> but the on the dashboard this seems to be overridden.
I only need to open this one link in a new window. The others are all fine in dashboard popups.
Any ideas appreciated.
Thanks
Terry

A
Athlon 5/30/2017

I do something like this all the time.
Add an additional field and give it a name.. say Print.
Then add view as custom in options.
Use something like this
global $dal;

$tblUsers = $dal->Table("cp1");

$tblUsers->Param["UniueID"]=$data["UniqueID"];

$rs = $tblUsers->FetchByID();

while( $data = db_fetch_array($rs) )

{

$myID = $data["CP1ID"];

//$mDate = $data["CP1_Next_Review"];

}
//$value = $mDate;
if ($value < now())

{

$value = date("d/m/Y", strtotime($value));

$color="red";

$link = '<a href="cp1_edit.php?editid1='.$myID.'" style="text-decoration: none"> <img src="red.png" alt="Edit" </a>';

}

else

{

$value = date("d/m/Y", strtotime($value));

$color="green";

$link = '<a href="cp1_view.php?editid1='.$myID.'" style="text-decoration: none"> <img src="green.png" alt="" </a>';

}

$value = "<span style='color: " . $color . ";'>".$value."</span>".$link;
that puts an image, can be what you like and when clicked, opens any page you want.

This particular code checks a date after getting an ID from a lookup and then makes the correct url to open from it.
Hope that gives you inspiration,
Mike.