Forums

View one record at a time for printing

scott1137 08 Sep, 2011
I've asked this before on Chronoforms (http://chronoengine.com/forums.html?cont=posts&f=2&t=22176&p=73870&hilit=%27View+Details%27+link#p71224.
I have a little more info now and since I'm using ChronoConnectivity and Bob is away this might be a better place to continue.

The setup: forms are submitted securely and when a form is submitted an email is sent to the admin assist letting her know. She then logs in and retrieves the form and prints it out.

When there are several forms submitted they all come out as if one record. Here's an example of the content of the last part of the second to last record and the last record in a series:

Request for Psychiatrist: { REQUEST_FOR_PSYCHIATRIST} Date requested:

Insurance information: Medicare A/B and State Farm Medicare Supplement
Other insurance:
Reason for referral: Pt has reccurent diagnosis ....
Notes: Please get further insurance information from pt. Thank You.

New Record
Edit Record
Delete Record
---------------------------------------------------------------------
xxx, Bill
record number: 278
Record time: 2011-09-08 - 13:28:39

Client's Name: xxxx, Bill Date: 9/8/11 Birthdate: xxxxxxx
Street Address: 3290xxxxxDr #28 City: xxx State: CA Zip: xxxxx
Telephone 1: 123-234-4567 Telephone 2: Telephone 3:

Referred by: xxx, MSW Referrer's phone: vvvv Agency:

SSN: Medicare #:xxxxxxx Effective Date:

Primary MD: P.'s Phone:


Request for Psychiatrist: { REQUEST_FOR_PSYCHIATRIST} Date requested:

Insurance information: Medicare A/B MCAL
Other insurance: MCAL
Reason for referral: Pt has a history ... Thank You.

New Record
Edit Record
Delete Record

This is the end of the this referral sheet record.
Display #
Powered By ChronoConnectivity - ChronoEngine.com
[ Back ]




How would I set this up so she can retrieve one record at a time?
I do not understand how to do do a View Details link or if this is even what I need here.
GreyHead 17 Sep, 2011
Hi Scott,

Here's one way round this.

Set up a new form and use the profile plug-in to get a specified record from the database and lay it out for printing (you may be able to copy, paste and tweak the ChronoConnectivity Body box content).

Set the form ReDirect URL to return to the ChronoConnectivity listing.

In the ChronoConnectivity Body box build a link to the form including the record id:
<a href='index.php?option=com_chronocontact& . . . &cf_id={cf_id}' >Display for printing</a>
You can set a target to open in a new window and add the &tmpl=component to hide the template if you wish.

When the link is Clicked a single record should be displayed for printing.

Alternatively you could add a line at the end of the Body box to add a page break for printing (see the CSS here for example). This might be enough to break the flow up.

Bob
scott1137 17 Sep, 2011
Thanks Bob. Page breaks for printer is new to me. Will try this first.
scott1137 18 Sep, 2011
This worked. Thanks.

However, the delete record link has disappeared. Its coding in the body box is untouched. The front end user group setting was limited to only admin and superadmin so I extended it to rest as the others are but that did not change the behavior.

Will tinker more tomorrow. Maybe, unless you have other suggestions, you'd post or send me a sample of the code you mentioned you write for Joomla user managing.

Thanks,

Scott
GreyHead 18 Sep, 2011
Hi Scott,

Not sure why that would affect the delete record link :-(

The kind of code that I use to manage users in ChronoConnectivity is more or less like this. Header box:
<?php
global $is_admin;
$user =& JFactory::getUser();
if ( in_array($user->gid, array('24', '25')) ) {
  $is_admin = true;
} else {
  $is_admin = false;
}
?>

In the body box:
<?php
global $is_admin;
?>
. . .
<?php if ( $is_admin ) { 
  echo "some HTML";
}
?>
. . .

You can also use the same kind of Code in the Header box to show extra filters or columns to admins only.

In the Form HTML I'd use something similar to limit the form access to admins only:
<?php
$mainframe =& JFactory::getApplication();
$user =& JFactory::getUser();
if ( !in_array($user->gid, array('24', '25')) ) {
  $mainframe->redirect('index.php');
}
?>

Bob
scott1137 18 Sep, 2011
Cleared browser cache, ran Ccleaner and restarted computer this am (after having made permission changes last evening) and the delete record link is back. Off the hook for now.

Will keep the code you suggested for future reference.

Thanks again, Bob.

Scott
This topic is locked and no more replies can be posted.