Jump to content


Photo

[Snippet] zcalendar3


  • Please log in to reply
119 replies to this topic

#81 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 12 October 2007 - 11:42 AM

Snippet updated with...
Tigra validation for the title form field (checks to allow only alphanumeric characters and '_' underscore). to make it compatible with zcal_mini tooltips.

Automatic database connection (instead of providing your database, username and password it is configured automatically).

To update to this version (3.6.5), see the snippet documentation... Basically, besides updating the snippet itself, you will also need to add the line:
<script src="manager/media/tigra_form_validator/validator.js" type="text/javascript"></script>
to your template to load the validator script.

#82 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 12 October 2007 - 12:13 PM

Hey Chris!
I love the awesome Etomite construction zone you are continuously creating. Let me know when you want to be paid to add recurring date functionality :)

Anyhow, Thanks for the update.
I tried this, but had to paste in the manual database connection stuff from v 3.6.4 to get it to work, for some reason the auto method didn't work?

The validation works great :)

#83 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 12 October 2007 - 12:30 PM

I love the awesome Etomite construction zone you are continuously creating.


I wouldn't want your domain name going to waste! Let me know if you want some credits put on there anywhere.

Let me know when you want to be paid to add recurring date functionality smile.gif

I really think it is beyond me, I really would love to but I can't deliver on that one yet....Much more learning to go...

The $GLOBALS['config']; parameters for making the db connection not working has got me stumped. There is no reason that I can see for this to not work for you. We're on the same server aren't we?? Hmmm.

#84 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 30 October 2007 - 04:19 PM

Hey Cris,
I ran into a case where I could not add titles with more that one word (no spaces.) First I thought it was because another event had a single apostrophe in it (') but then I went into phpMyAdmin and saw that all of the apostrophes in other events were properly slashed (Fall Couple\'s Retreat) The error I'm getting is "xxx is not a valid value for "title" where xxx is any title that has a space in it.

If I try to edit an event that was created previously, and has spaces in the title, I cannot save, due to the same error.
any ideas?

#85 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 30 October 2007 - 08:10 PM

These are all the checks that are available with the Tigra Validator:

alpha A string of characters of Latin alphabet, a dot (.) and a hyphen (-)
alphanum Alphanumeric characters and an underline (_)
unsigned Unsigned integer number
integer An integer number
real A number with a decimal point
email E-mail address format
phone Phone number consisting of digits, spaces ( ), dots (.) and hyphens (-)
date Date value formatted as DD-MM-YYYY
time Time value formatted as HH:MM:SS


I can't see a way of allowing spaces AND limiting quotes using this free version. So it looks your options are:
1) Every time you edit an existing event, all an underscore instead of a space (not pretty I know).
2) revert back to the last version that does not use the validator and tell everyone that they can not use apostrophes or it will break zcal-mini, or
3) wait for me to see if I can write my own validating code (no promises on timeline here as I'm not that familiar with javascript but I will give it a go.

#86 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 30 October 2007 - 08:42 PM

Makes sense - I don't grasp the reasons behind why something would be programmed that way. I'll manually add the spaces in phpMyAdmin until we figure this out.

#87 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 31 October 2007 - 03:18 AM

I'm using v 3.6.4 and instructing the client not to put double-quotes in the title... this is pretty acceptable in the time being.

#88 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 05 November 2007 - 01:15 PM

Updated the snippet in the library with a php check for characters that break zcal_mini in the event title. (Now all characters including spaces are allowed except: ' " / ). (removed tigra validation).
Fixed (hopefully) the automatic database connection settings so no manual username and passwords need to be entered in the snippet.

#89 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 05 November 2007 - 01:45 PM

So to be sure: the latest version is updated (3.6.5)?

#90 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 05 November 2007 - 08:46 PM

The version in the library is 3.6.6.: php validator for title. See download page for changelog.

#91 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 05 November 2007 - 10:49 PM

Works like a charm- thanks Cris!

#92 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 08 November 2007 - 09:04 PM

Hey Chris, quick question- is there a way that I can limit calendar editors to users who are admin?

Here's the scenario: I have a site where all users are "logged in" to some protected pages. They want an event calendar- so I installed zcalendar. The problem is, normal low-level users, once logged in, get the event calendar "Add event" form at the top. How can I limit calendar event administration to Etomite admins?

thanks!

#93 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 08 November 2007 - 11:22 PM

I have not really played with the checkPermissions() API to that extent. I would have to look into this a bit more. It "should" be a simple case of checking the level of user permissions and adding that to the line that checks... if(checkPermissions() ==1 && admin==1) but the actual syntax I will have to check.

[EDIT] <removed some potentially confusing and unnecessary instructions>{/EDIT]

Edited by Cris D., 12 November 2007 - 12:58 AM.


#94 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 11 November 2007 - 03:36 AM

To allow only admin to enter calendar items:
under the line: Approx 113
$permission=$etomite->checkPermissions();
add the line:
if($permission==1 && $_SESSION['role']== 1){$permission=1;}else{$permission=0;}

Then only those users who have Administrator accounts (etomite_user_attributes role:1) will be able to see the edit forms. Of course, you could also add other roles to this code to let other users enter data like this:

if($permission==1 && $_SESSION['role']== 1||2||3){$permission=1;}else{$permission=0;}

(Snippet is NOT updated with this code).

Edited by Cris D., 11 November 2007 - 03:59 AM.


#95 djspawn

djspawn

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 06 December 2007 - 04:43 PM

Dumb question but:
Does the JavaScript for the Tigra go in the Snippet, Chunk or Page?

Edited by Dean, 06 December 2007 - 05:25 PM.
removed quote


#96 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 06 December 2007 - 07:51 PM

Dumb question but:
Does the JavaScript for the Tigra go in the Snippet, Chunk or Page?

Not really dumb, but I'm glad you asked otherwise you may have been there a while trying to get it to work with any of the three options listed above :) The javaScript file calendar3.js is a javaScript file that has to be ftp'd up to the manager/media/tigra_calendar folder (you will see calendar1.js, calendar2.js in the same folder).
As of etomite V0.1.6.5 this will be included automatically, but is not included at the moment because the file was released by tigra just after 0.1.6.4 came out.
You could use any of the 3 options listed above, but you would have to change the relative file paths to get it to work, so FTP is definitely easier.

#97 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 06 May 2008 - 09:28 PM

NOTE: zcalendar is NOT currently compatible with Etomite V1.0 due to the old javascript calendar being overwritten.

Although I have not tested it, I expect that the only problem should be that the pop-up date entry calendar does not work (although there may be more terminal issues that I have not identified). For anyone thinking about requesting some support for this snippet:

I'll be looking at backward compatibility for it soon...

#98 djspawn

djspawn

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 06 May 2008 - 09:35 PM

NOTE: zcalendar is NOT currently compatible with Etomite V1.0 due to the old javascript calendar being overwritten.

Although I have not tested it, I expect that the only problem should be that the pop-up date entry calendar does not work (although there may be more terminal issues that I have not identified). For anyone thinking about requesting some support for this snippet:

I'll be looking at backward compatibility for it soon...


Thanks for keep up on it

#99 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 10 May 2008 - 01:37 AM

If you have upgraded to Etomite V1.0 and your zcalendar still works, there is no benefit to using this update.

zcalendar now avaliable as a zip file that includes all the required tigra_calendar files. I could not find any issues with it running in an updated (from Eto 0.6.1.4 to V1.0) installation. I really don't think there should have been any issues at all with it unless people were deleting old folders before upgrading. Anyway, the whole lot is there now for anyone wanting to install from new.

By the way, it should also be backward compatible, however there is a possibility that there are a range of different users with calendar3.js internal paths. If you are one of those whose pop-up calendar stopped working after the upgrade, just overwrite your old tigra_calendar folder with this one and use the new zcalendar snippet (I made no changes to the actual snippet functionality so it will work with a current installation).

Also, I noticed that you can not have the authenticate_visitor and zcalendar on the same page, the .js and form field validation causes conflicts. Just make sure your zcalendar is on it's own page and you should be right.

Also, the call to calendar3.js in the header of the template is no longer required. I have embedded it in the snippet to simplify things. This means that you won't need to be adding the line calling in the calendar to every template you use, but if you have one in your template AND one in the snippet it may cause issues. Just delete the template one (assuming your tigra_calendar resources and calendar3.js file are in the correct place and my snippet embedded call will still point to your existing resources).

#100 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 10 May 2008 - 11:20 AM

After further testing I have realised that the zcalendar javascript is intefered with the FixInertTags chunk which is added in the default Etomite template. If you try to use the tigra_calendar pop-up calendar in a template where FixInertTags exists, the pop-up will happen but the date will not write to the text field.

Therefore: a simple resolution, have a separate zcalendar template that does not contain the FixInertTags chunk in it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users