Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8026 Posts in 1851 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Private Description Data  (Read 309 times)
0 Members and 1 Guest are viewing this topic.
PaulW
New Member
*

Karma: 0
Offline Offline

Posts: 0

Hospital Pharmacist


WWW
« on: February 17, 2005, 01:34:00 PM »

I'm just getting started with CalendarScript and am really pleased!

I am setting up a calendar for our hospital pharmacy and will be posting confidential information in the "Description" and/or "Detail" (added) fields.  For HIPAA restrictions, we would want the "Title" field, but NOT the Description or Detail fields, to be visible for unregistered (public) viewers.  A user would have to be logged-in in order to see the potentially confidential information.

Two approaches seem to make sense, but I don't see any settings to effect either:
1.  Allow only logged-in users to evoke event detail display when clicking on the Event Title; perhaps a message box indicating "Detail viewable only by registered users" or something.
2.  Designate, at the field level, whether the field data is viewable to public viewers; maybe indicating with "xxxx..." a field that has data and is protected.

I've searched a bit on the forum, but not found what I'm looking for.  Please point me in the right direction.

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: February 17, 2005, 02:34:00 PM »

** I've searched a bit on the forum, but not found what I'm looking for. **

Often you will not find the exact solution for what you're wanting to do but can find methods which can be adapted to your purpose.

** Please point me in the right direction. **

** 1. Allow only logged-in users to evoke event detail display when clicking on the Event Title **

From the message titled "Display a calendar showing only events with certain catagory" posted 2 messages before yours:

LINK > First attempt at customization

But instead of excluding printing of the event title on the calendar display, just conditionally print the link for it.

You might also look at some of these links from the same message:

LINK > private or hidden event
LINK > Public and private calendars
LINK > Public/Private Events

You might be able to find more examples by searching the forum for "private" (without the quotes).

** 2. Designate, at the field level, whether the field data is viewable to public viewers **

From the Unofficial CalendarScript - Mods and Plugins site in the 'Links' section:

LINK > Break apart event title and description

But instead of bolding the particular field, negate the printing if it altogether?

JFYI

Dan O.


[This message has been edited by DanO (edited February 17, 2005).]

Logged
PaulW
New Member
*

Karma: 0
Offline Offline

Posts: 0

Hospital Pharmacist


WWW
« Reply #2 on: February 17, 2005, 02:49:00 PM »

Thanks, Dan.

I'll take your advice and look around for customization.

I didn't want to dig into the code to attempt a modification if a configuration setting would accomplish what I'm trying to do.

------------------

Logged
PaulW
New Member
*

Karma: 0
Offline Offline

Posts: 0

Hospital Pharmacist


WWW
« Reply #3 on: February 17, 2005, 09:21:00 PM »

So, here's what I did...

In .../calendarscript/templates/calendars/custom/default.html, line #311, as follows:

<TR>
<TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD>
<TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD>
</TR>

Edited to:

<TR>
<TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD>
<% if ( ($User->{username} ne "anonymous") ) { %>
Huh??<TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN>[/TD>
<% } %>

</TR>

That change results in displaying the text of the fields only if the username is not "anonymous", i.e. a registered user.

Are there any pitfalls here that I should be aware of?

[This message has been edited by PaulW (edited February 17, 2005).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #4 on: February 18, 2005, 01:42:00 AM »

** Are there any pitfalls here that I should be aware of? **

1. The following is not an HTML tag (if it is actually what you have used in your page code):

>[/TD>

2. You can not just leave out a whole <TD>...</TD> section (even if the page will still display in IE - it may not in other browsers). You should balance out the code and if necessary, replace it with empty <TD>...</TD> equivalent to that was removed.

JFYI

Dan O.

------------------

Logged
PaulW
New Member
*

Karma: 0
Offline Offline

Posts: 0

Hospital Pharmacist


WWW
« Reply #5 on: February 18, 2005, 06:04:00 AM »

Oops.  The open bracket you see is a remnant of a BBCode that I had put in my post and then almost deleted.  It can be ignored in the above code.

I found that I also need to insert the same condition in the Search response screen where the Description is displayed and also on the List view for "Today" where the description shows also.  When I've done that I'll post here so that someone else can utilize this method if they like.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #6 on: February 18, 2005, 12:26:00 PM »

**  When I've done that I'll post here so that someone else can utilize this method if they like. **

I'm sure someone will make use of any modifications you can supply.

Dan O.

------------------

Logged
PaulW
New Member
*

Karma: 0
Offline Offline

Posts: 0

Hospital Pharmacist


WWW
« Reply #7 on: February 18, 2005, 12:57:00 PM »

Here's the modifications I made.  It's a bit long, but I didn't see how to attach a file to the post...

This modification allows for the display of event details ONLY for registered CalenderScript users.  It uses the following condition
   <% if ( ($User->{username} ne "anonymous") ) { %>
       [ code that displays the event detail goes here ]
   <% } %>
as a condition of displaying event detail.  There are three locations in default.html that need to be edited with this condition.  Be sure to edit the default.html for calendar used.  The following example applies to:
   .../calendarscript/templates/calendars/default/default.html

======================================================================

Display of Today as a List...
Around line 275, find:

<%-- LIST VIEW --%>
<CENTER><TABLE BORDER="0" WIDTH=90%><TR><TD>
<SPAN CLASS="text">
<%IF EVENTS EXIST%>
   <DL>
   <%FOREACH EVENT%>
       <DT>
       <% if ($_SHOW_GRID_EVENT_BULLET) {%>•<%}%>
       <% if ($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") { %>
           <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %>
       <% } %>
       <% if ($_SHOW_EVENT_TIMES eq "ALL") { %>
           <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %>
       <% } %>
       <% if (($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") && ($EVENT->{'schedule'}->{'start_time'})) { %> : <% } %>
       <%= EVENT FIELD(title) %>
       <FONT SIZE="-2">[<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;">details</A>]<BR></FONT>
       <DD>
       <%= EVENT FIELD(description) %>
   <%/FOREACH%>
   </DL>
<%ELSE%>
   <BR><I><%= $_NO_EVENTS_LABEL %></I><BR>
<%/IF%>
</SPAN>
</TD></TR></TABLE></CENTER>

Edit to:

<%-- LIST VIEW --%>
<CENTER><TABLE BORDER="0" WIDTH=90%><TR><TD>
<SPAN CLASS="text">
<%IF EVENTS EXIST%>
   <DL>
   <%FOREACH EVENT%>
       <DT>
       <% if ($_SHOW_GRID_EVENT_BULLET) {%>•<%}%>
       <% if ($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") { %>
           <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %>
       <% } %>
       <% if ($_SHOW_EVENT_TIMES eq "ALL") { %>
           <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %>
       <% } %>
       <% if (($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") && ($EVENT->{'schedule'}->{'start_time'})) { %> : <% } %>
       <%= EVENT FIELD(title) %>
       <FONT SIZE="-2">[<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;">details</A>]<BR></FONT>
       <DD>
       <% if ( ($User->{username} ne "anonymous") ) { %>
           <%= EVENT FIELD(description) %>
       <% } %>
   <%/FOREACH%>
   </DL>
<%ELSE%>
   <BR><I><%= $_NO_EVENTS_LABEL %></I><BR>
<%/IF%>
</SPAN>
</TD></TR></TABLE></CENTER>

======================================================================

Display of event details...
Around line 300, find:

<%-- EVENT VIEW --%>
<% } elsif ($VIEW eq "Event") { %>
   <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
   <%
   foreach (@$fields) {
       next unless ($db->{'properties'}->{$_}->{'display_details'});
   %>
       <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR>
   <% } %>
   </TABLE>

Edit to:

<%-- EVENT VIEW --%>
<% } elsif ($VIEW eq "Event") { %>
   <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
   <%
   foreach (@$fields) {
       next unless ($db->{'properties'}->{$_}->{'display_details'});
   %>
       <TR>
       <TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD>
       <% if ( ($User->{username} ne "anonymous") ) { %>
           <TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD>
       <% } %>
       </TR>
   <% } %>
   </TABLE>

======================================================================

Display of search results...
Around line 370 find:

<TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
   <TR>
       <TH><SPAN CLASS="text">First Occurrence</SPAN></TH>
       <TH><SPAN CLASS="text">Title</SPAN></TH>
       <TH><SPAN CLASS="text">Description</SPAN></TH>
   </TR>
   <% FOREACH SEARCH RESULT %>
   <TR>
       <TD>
           <SPAN CLASS="text">
           <% IF NEXT OCCURRENCE EXISTS %>
           <%=$MONTH_NAMES->[$EVENT->{schedule}->{nextoccurrence}->{month}-1]%> <%=$EVENT->{schedule}->{nextoccurrence}->{date}%>, <%=$EVENT->{schedule}->{nextoccurrence}->{year}%>
           <% ELSE %>
           None
           <% /IF %>
           </SPAN>
       </TD>
       <TD><A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></A></TD>
       <TD><SPAN CLASS="text"><%= EVENT FIELD(description) %></SPAN></TD>
   </TR>
   <% /FOREACH %>
</TABLE>

Edit to:

<TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
   <TR>
       <TH><SPAN CLASS="text">First Occurrence</SPAN></TH>
       <TH><SPAN CLASS="text">Title</SPAN></TH>
       <% if ( ($User->{username} ne "anonymous") ) { %>
           <TH><SPAN CLASS="text">Description</SPAN></TH>
       <% } %>
       </TR>
   </TR>
   <% FOREACH SEARCH RESULT %>
   <TR>
       <TD>
           <SPAN CLASS="text">
           <% IF NEXT OCCURRENCE EXISTS %>
           <%=$MONTH_NAMES->[$EVENT->{schedule}->{nextoccurrence}->{month}-1]%> <%=$EVENT->{schedule}->{nextoccurrence}->{date}%>, <%=$EVENT->{schedule}->{nextoccurrence}->{year}%>
           <% ELSE %>
           None
           <% /IF %>
           </SPAN>
       </TD>
       <TD><A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></A></TD>
       <% if ( ($User->{username} ne "anonymous") ) { %>
           <TD><SPAN CLASS="text"><%= EVENT FIELD(description) %></SPAN></TD>
       <% } %>
   </TR>
   <% /FOREACH %>
               </TABLE>

======================================================================

Sorry, the forum software appears to be removing leading spaces.  Therefore, the indentation is lost.

[This message has been edited by PaulW (edited February 18, 2005).]

Logged
Pages: [1]   Go Up
Print
Jump to: