How to show print detail page directly

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Helmonder
Posts: 2
Joined: 2013-05-11 09:16

How to show print detail page directly

Post by Helmonder » 2013-05-11 09:32

I use appgine for my website www.arbeidsdeskundige.nl
Is it possible to show the print detail preview page directly when you select an item? And go back to the main page from there?
I would like to let the visitors come on the print detail page in one step
Visitors don't need te see the detail form
I 'll use the detail form only to fill the database with new partners

Helmonder
Posts: 2
Joined: 2013-05-11 09:16

Re: How to show print detail page directly

Post by Helmonder » 2013-05-12 08:27

I use a wrong internet adres:

Helmonder wrote:I use appgine for my website http://www.arbeidsdeskundigenodig.nl
Is it possible to show the print detail preview page directly when you select an item? And go back to the main page from there?
I would like to let the visitors come on the print detail page in one step
Visitors don't need te see the detail form
I 'll use the detail form only to fill the database with new partners

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: How to show print detail page directly

Post by a.gneady » 2013-05-21 20:51

It's doable if you're willing to edit some code ... you should use the tablename_init() hook to change

Code: Select all

$options->Template
to a new table view template that links directly to the printable detail view in case the current user is not signed in ...

You'll also need to create that new table view template ... You can start with the original template at "templates/tablename_templateTV.html" (where tablename is the name of the concerned table) and replace the <%%SELECT%%> placeholder with:

Code: Select all

<a href="tablename_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1">
and the <%%ENDSELECT%%> placeholder with:

Code: Select all

</a>
I assumed in the above code that your table's primary key field is named id ... You should change it in the above code if it's different.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

MikeB
Posts: 18
Joined: 2013-01-08 19:18

Re: How to show print detail page directly

Post by MikeB » 2013-06-19 20:55

I tried following your instructions Ahmad, but could not get this to work. I’ll illustrate what I did with “TableA”. I want to print the detail view (via TableA_templateDVP.html) when I click on the table view record.

In TableA.php in the Hooks directory, I changed:

Code: Select all

function TableA_init(&$options, $memberInfo, &$args){
		return TRUE;
to

Code: Select all

function TableA_init(&$options->Template, $memberInfo, &$args){
		return TRUE;
I changed the template, TableA_template_TV.html using the original TableA_templateTV.html as a guide.
I replaced

Code: Select all

<%%SELECT%%>
placeholder with

Code: Select all

<a href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1">  
and changed the

Code: Select all

<%%ENDSELECT%%>
placeholder with

Code: Select all

</a>
(all occurrences – see below)

Code: Select all

<td id="TableA-ResidentID-<%%VALUE(ResidentID)%%>" valign="top" class="TableA-ResidentID TableBodyNumeric"><a href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(ResidentID)%%></a></td>

<td id="TableA-LastName-<%%VALUE(ResidentID)%%>" valign="top" class="TableA-LastName TableBody"><a href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(LastName)%%></a></td>

<td id="TableA-FirstNames-<%%VALUE(ResidentID)%%>" valign="top" class="TableA-FirstNames TableBody"><a href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(FirstNames)%%></a></td>
When I try to open TableA in the browser, I get a blank screen. Where did I go wrong?

MikeB
Posts: 18
Joined: 2013-01-08 19:18

Re: How to show print detail page directly

Post by MikeB » 2013-07-01 01:27

Hi Guys. I might have made my question difficult/impossible to follow with the formatting here in my last question. I do need help.

I tried following the instructions to display the detail print view directly from the table view, but could not get it to work. I’ll illustrate what I did with “TableA”. I want to print the detail view (via TableA_templateDVP.html) when I click on the record in the table view..

In TableA.php in the Hooks directory, I changed:
function TableA_init(&$options, $memberInfo, &$args){
return TRUE;

to

function TableA_init(&$options->Template, $memberInfo, &$args){
return TRUE;


I changed the template, TableA_template_TV.html using the original TableA_templateTV.html as a guide.
I changed:

<td id="ResidentsOwners-ResidentID-<%%VALUE(ResidentID)%%>" valign="top"
class="ResidentsOwners-ResidentID
TableBodyNumeric"><%%SELECT%%><%%VALUE(ResidentID)%%><%%ENDSELECT%%></td>

<td id="TableA-LastName-<%%VALUE(ResidentID)%%>" valign="top"
class="TableA-LastName
TableBody"><%%SELECT%%><%%VALUE(LastName)%%><%%ENDSELECT%%></td>

<td id="TableA-FirstNames-<%%VALUE(ResidentID)%%>" valign="top"
class="TableA-FirstNames
TableBody"><%%SELECT%%><%%VALUE(FirstNames)%%><%%ENDSELECT%%></td>


to

<td id="TableA-ResidentID-<%%VALUE(ResidentID)%%>" valign="top"
class="TableA-ResidentID TableBodyNumeric"><a
href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(ResidentID)%%></a></td>

<td id="TableA-LastName-<%%VALUE(ResidentID)%%>" valign="top"
class="TableA-LastName TableBody"><a
href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(LastName)%%></a></td>

<td id="TableA-FirstNames-<%%VALUE(ResidentID)%%>" valign="top"
class="TableA-FirstNames TableBody"><a
href="TableA_view.php?SelectedID=<%%VALUE(id)%%>&dvprint_x=1"><%%VALUE(FirstNames)%%></a></td>


MY RESULTS
When I click on a record in the Table View, I get a blank HTML document. If I leave the ->Template change out of TableA.php, I get the detail print view, but with no values in it. Also, I can't get to the detail view, which users with edit permission will need to get to.

Any help would be appreciated. I tried to follow Ahmad's instructions, but obviously did something wrong.

Thanks,
Mike

Post Reply