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
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Showing pending events in grid template
Pages: [1]   Go Down
Print
Author Topic: Showing pending events in grid template  (Read 2596 times)
0 Members and 1 Guest are viewing this topic.
James Lavery
New Member
*

Karma: 0
Offline Offline

Posts: 0

Software Engineer


« on: March 20, 2003, 03:29:00 AM »

Hi all,
For our boat booking system, it would be great if we could show events pending approval on the grid - preferably in a different colour/font to approved events.

Is this possible?  Again, I assume that it will need tweaks to the template and/or of the scripts (or is there a plugin which will do this?)

(I've also posted this to the plugins forum).

Thanks,

James

[This message has been edited by James Lavery (edited March 20, 2003).]

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: March 20, 2003, 07:27:00 PM »

** it would be great if we could show events pending approval on the grid **

The following line from the calendar.pl file's sub getEvents {
subroutine is responsible for leaving them out of the events shown.
Just comment that line out out and they should be visible.

next unless ($event_details->{$s->{'event_id'}}->{'approved'});

** preferably in a different colour/font **

You would have to set up some conditional in the template similar to:

if (!$EVENT->{'details'}->{'approved'} )
{
do something here;
}

     NOTE: Pseudo code only, not working code!

Dan O.

[This message has been edited by DanO (edited May 17, 2003).]

Logged
James Lavery
New Member
*

Karma: 0
Offline Offline

Posts: 0

Software Engineer


« Reply #2 on: March 21, 2003, 12:16:00 AM »

Hi Dan,
Again - spot on information, thanks.  That's great.  

(Rolls up sleeves, to get editing...)

James

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

Logged
Stacey
Guest
« Reply #3 on: December 08, 2004, 02:48:00 AM »

Would someone be so kind as to help me figure out how to have unapproved events show up in a different color?

I was able to get them to show up on the calendar (as described above) but am not a strong enough coder to figure out how to have unapproved events show up in red.

Grateful thanks for any tips!!!

:Stacey

Logged
Stacey
Guest
« Reply #4 on: December 11, 2004, 10:33:00 PM »

Anyone?
Logged
Stacey
Guest
« Reply #5 on: December 14, 2004, 06:28:00 PM »

Hey, I think I got it!

STEP 1:
- In calendar.pl, find
next unless ($event_details->{$s->{'event_id'}}->{'approved'});
- Comment out that line.

STEP 2:
- in the default.html template, replace all occurrences of

<%= EVENT FIELD(title) %>

with

<%
   if (!$EVENT->{'details'}->{'approved'}) { %><font color="red"><%= EVENT FIELD(title) %></font><% }
else { %><font color="#000000"><%= EVENT FIELD(title) %></font><% }
   %>

Seems to work for me!
And thanks DanO for getting me started  

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: December 20, 2004, 02:10:00 PM »

** I think I got it! **

Glad to hear it.

Dan O.

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

Logged
truthonlytruth
New Member
*

Karma: 0
Offline Offline

Posts: 20

:)


« Reply #7 on: January 17, 2008, 04:35:35 PM »

I did the modification and great job but problem is everyone is seening it and i do not have tool to edit or delete when click on it?

It should be: Only admin or administrator can see it and modify...

Thanks
« Last Edit: January 17, 2008, 04:56:32 PM by truthonlytruth » Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

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


WWW
« Reply #8 on: January 18, 2008, 01:38:38 PM »

** everyone is seeing it... should be only admin or administrator can see it  **

If you want the pending events to only be visible to the administrator, you'll have to put a conditional in the default template code somewhere after each <%FOREACH EVENT%> tag to negate printing of them unless it is the Administrator viewing the calendar. Something like the following might work:

<% next if (!$EVENT->{'details'}->{'approved'} && $User->{name} ne "Administrator" ) ;%>

(The above code is untested, it may require alterations to get it to do what you want. It is just an example of what might be required.)


** i do not have tool to edit or delete when click on it? **

The mod discussed here has nothing to do with that, it is just for displaying pending events on the calendar grids. See the previous forum message "Edit Event directly from Event Details" for how you might go about that feature if you want it.

JMO

Dan O.
Logged
truthonlytruth
New Member
*

Karma: 0
Offline Offline

Posts: 20

:)


« Reply #9 on: January 19, 2008, 10:35:33 AM »

it is not working...

Thanks anyway i give up (I have no coding experience in PERL)...
Logged
Pages: [1]   Go Up
Print
Jump to: