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)Problem filtering select_calendar.html
Pages: [1]   Go Down
Print
Author Topic: Problem filtering select_calendar.html  (Read 245 times)
0 Members and 1 Guest are viewing this topic.
k9barry
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: November 26, 2003, 12:21:00 PM »

I have modified the code in the select_calendar.html to filter for calendars the user has VIEW and ADD_EVENT permissions.  This mod works great if the filter returns two or more calendars.  If only one calendar is returned and I try to continue I get a error box stating

! Select a calendar before continuing

The code I modified was:
********************************
<% foreach $cal (sort {$a->{name} cmp $b->{name}} @$calendars) { %>

<%
# only show calendars user has permissions to view
next unless ($User->hasPermission($cal->{'key'},"VIEW")) && ($User->hasPermission($cal->{'key'},"ADD_EVENT"));
%>

<% if ($user->isCalendarAdmin($cal->{'key'})) { %>
*********************************

I think the error is coming from the code below:
*********************************
function dosubmit() {
   var theform = document.forms["mainform"];
   <% if ($count>1) { %>
   if (getInputValue(theform["calendar"]) == "") {
      alert("Select a calendar before continuing");
      return false;
      }
   <% } %>
   theform.submit();
   }
********************************

I have tried chanding the ($count>1) value to 0 or 2 but not success.  I am not sure if I am even changing the right thing.

Any ideas!

Thanks

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: November 26, 2003, 09:26:00 PM »

I came across that very thing for one mod I was making but did not delve into it deeper to try to find the cause or how to work around it. Sorry.

Dan O.

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

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