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


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityEverything ElseGeneral Use (Moderators: scott, DanO, Marty)Adding fields to the approval page
Pages: [1]   Go Down
Print
Author Topic: Adding fields to the approval page  (Read 1599 times)
0 Members and 1 Guest are viewing this topic.
jgold723
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: September 11, 2003, 11:46:00 AM »

I've added calendar fields for contact information for people posting events subject to approval.

I'd like to be able to see that info when I view events pending approval -- but not have it posted on the calendar.

I tried to alter the approve.html page in the Admin section, but it doesn't bring up the data.

What else do I need to change to make this happen?

Thanks,

John


Logged
eladyar
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #1 on: September 11, 2003, 07:41:00 PM »

Did you add the fields on the customize user database screen?

You might want to add them as custom event fields, and then not show them in the details or make them searchable.

------------------
Dale Ray
http://www.sscsoftball.org

Logged

jgold723
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: September 12, 2003, 08:48:00 AM »

I didn't -- because it didn't seem that any info from this database was called when viewing events awaiting approval (all events can be posted by "anonymous".

But I'm willing to give it a shot.

John

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #3 on: September 12, 2003, 12:56:00 PM »

** I've added calendar fields **

You added event fields or fields to the user database?

** I tried to alter the approve.html page in the Admin section **

What code did you try?

If you added the new field to the event database, in the approve.html template where there are lines of code like:

<B>Title: </B><%=$title%><BR>
<B>Description: </B><%=$desc%><BR>
<B>Author: </B><%=$author%><BR>
<B>ID: </B><%= $id%><BR>
<B>Schedule: </B><%= &Event::getScheduleDescription($e->{'schedule'}) %><BR>

You would have to add something like

<B>Contact: </B><%= $e->{'details'}->{'Field_Key'} %><BR>

where Field_Key is the key of the event field you wanted printed there.

Dan O.

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

Logged
jgold723
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: September 12, 2003, 01:46:00 PM »

Hi Dan:

I'm not certain what the field key is -- I was assuming it was the name the program automatically generates for a new field. If not this may be my problem. Here's what I did:

I added two fields to the Event Database:

email
telephone

Then I found the code you mentioned in approve.html and altered it to include my fields, like so:
-----------------------------
<%
$total = 0;
foreach $e (@$events) {
   $total++;
   $id = $e->{'details'}->{'id'};
   $title = $e->{'details'}->{'title'};
   $telephone = $e->{'details'}->{'telephone'};
   $email = $e->{'details'}->{'email'};
   $desc = $e->{'details'}->{'description'};
   $author = $e->{'details'}->{'author_name'}." (".$e->{'details'}->{'author_id'}.")";
%>
<TR>
   <TD ALIGN="center" VALIGN="top">
      <SELECT NAME="APPROVE_<%=$id%>"><OPTION VALUE="">No Action</OPTION><OPTION VALUE="APPROVE">Approve</OPTION><OPTION VALUE="REJECT">Reject</OPTION></SELECT>
      <BR>
      <INPUT TYPE="button" CLASS="button" VALUE="Edit" onClick="edit_event('<%=$id%>')">
   </TD>
   <TD ALIGN="left" VALIGN="top">
      <B>Title: </B><%=$title%><BR>
      <B>Description: </B><%=$desc%><BR>
      <B>Telephone: </B><%=$telephone%><BR>
      <B>Email: </B><%=$email%><BR>
      <B>Author: </B><%=$author%><BR>
      <B>ID: </B><%= $id%><BR>
      <B>Schedule: </B><%= &Event::getScheduleDescription($e->{'schedule'}) %>

-----------------------------
Now, when I get the approval page, I see the event data, and the labels (Email: and Telephone: ) for the email and telephone, but no data in the space next to the labels.

Thanks,

John

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #5 on: September 12, 2003, 07:06:00 PM »

** I'm not certain what the field key is -- I was assuming it was the name the program automatically generates for a new field. **

Yes.

** when I get the approval page, I see the [field] labels (Email: and Telephone: ) but no data  **

I don't know why that would be unless you misspelled something.

Instead of doing the
$telephone = $e->{'details'}->{'telephone'};
thing, just put the variables directly where they're going to be printed like I showed previously. The less typing you do, the less chance of making mistakes.

JMO

Dan O.

[This message has been edited by DanO (edited September 12, 2003).]

Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #6 on: July 20, 2008, 05:39:57 PM »

Does anyone know of a way to have the approval page show all of the fields for an event?  (excluding the schedule, I see there are posts on that).

I tried <%=$e->{'details'}->{'$_'}%> but that doesn't show anything.   I could add lines for each field as is already on the approval page, but not all my calendars have the same fields.   Thank you.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #7 on: July 22, 2008, 05:15:28 PM »

I though I answered this earlier today but I guess not...

What you want to do is more complicated to accomplish. Basically you would have to loop through each $e variable from the previous foreach loop, printing each value out. It should also be possible to skip the displaying of blank fields at that time if wanted.

I can not tell you the exact code to use but there is code in the default.html template just after <%-- EVENT VIEW --%> which might give you an idea of how to go about retrieving the event record data? It goes about it slightly differently however looping through the registered event field names and then looking for those names in the event record data.

JMO

Dan O.

« Last Edit: July 22, 2008, 05:19:45 PM by DanO » Logged
wderzawiec
New Member
*

Karma: 0
Offline Offline

Posts: 15

Web site coordinator


WWW
« Reply #8 on: July 25, 2008, 02:17:12 PM »

**I though I answered this earlier today but I guess not. . . **

Sorry I did not see anything.

** What you want to do is more complicated to accomplish.  Basically you would have to loop through each $e variable from the previous foreach loop, printing each value out.  It should also be possible to skip the displaying of blank fields at that time if wanted.
I can not tell you the exact code to use but there is code in the default. html template just after <%-- EVENT VIEW --%> which might give you an idea of how to go about retrieving the event record data? It goes about it slightly differently however looping through the registered event field names and then looking for those names in the event record data.  **

That was helpful, thank you.   What I did was add a variable for $fields at the top of the approve. html page:
 $fields = &main::DBGetFieldsInDisplayOrder($events_db);

Then, within the foreach loop of events, underneath where it says
<B>Schedule: </B><%= &Event::getScheduleDescription($e->{'schedule'}) %><BR>,

I added another loop:
                <%
      foreach (@$fields) {
         next unless ($events_db->{'properties'}->{$_}->{'display_details'});
         %>
         <B><%=$events_db->{'properties'}->{$_}->{'name'}%>: </B><%=$e->{details}->{$_}%><br>
         <% } %>

It displays the Title twice, but I could take out the <B>Title: </B><%=$title%><BR> line if I want.   Thanks for your time and help.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: July 25, 2008, 09:41:26 PM »

** Sorry I did not see anything. **

I know I worked on it, I must not have posted it.  Undecided

** That was helpful, thank you. **

You're welcome. Thanks for posting the code in case others are interested.

Dan O.
Logged
Pages: [1]   Go Up
Print
Jump to: