Menu
Welcome, Guest
Username: Password: Secret Key Remember me
Welcome to the Developer forum!
Get all your questions answered here. Learn to integrate calendar in your application.
  • Page:
  • 1

TOPIC: Invoking onclick handler, open appointment from another window

Invoking onclick handler, open appointment from another window 9 years 1 month ago #362

  • austinbest
  • austinbest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
I can find where the rows & columns are for the calendar entries, but i am curious what the handler is to invoke the click function.

Basically i have this calendar intertwined in a huge Company Manager system, i spent 2 weeks custom writing add/edit/delete functionality with our system, clients, support tickets, etc..

My next request from someone in tech support is to be able to use a hot key such as \"Alt+A\" on the client card to go to the calendar and open an appointment on todays date and time for the client. I can handle this except for the opening of the appointment. When you are looking at the calendar and you click on a time to get the CSS popup, i need to know how to replicate that. Is there a function or anything i am missing that i can use to do this?

Also coloring the background of specific time blocks or times is another request. Is this even possible since they are all located in the same div with the same class on the tds?

I would like to keep this calendar, but i am starting to get requests that i can not find the answers for.

Auto refresh, formless appointment creation, private filter, client integration, support ticket integration, add/edit/delete/complete etc i have already added, but these new ones i cant seem to find the codes in the files to integrate it.

Any help would be appreciated.

Please Log in or Create an account to join the conversation.

Last edit: by austinbest.

Re:Invoking onclick handler, open appointment from another window 9 years 1 month ago #363

  • austinbest
  • austinbest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Ok, so with all the great help and responses, i figured it out.

in calendar.php
	 	startAjax();
		drawCalendar(); 
	 	
		new Web2Cal.TimeControl(jQuery(\"#eventStartTime\").get(0));
        new Web2Cal.TimeControl(jQuery(\"#eventEndTime\").get(0), jQuery(\"#eventStartTime\").get(0), {
            onTimeSelect: updateDateForTime,
            dateField: \"eventEndDate\"
        });

After that, add
		<?
		if ($_GET[\'awb\'])
		{
		?>
			document.getElementById(\'appreminder\').checked = \"checked\"; // Check the reminder box
			document.getElementById(\'defaultNewEventTemplate\').style.left=0; // Set it to left
			document.getElementById(\'defaultNewEventTemplate\').style.top=0; // Set it to top
			document.getElementById(\'appclientId\').value 	= \'<? echo $_GET[\'appclientId\'] ?>\';
			document.getElementById(\'q\').value 				= \'<? echo $_GET[\'q\'] ?>\';
			document.getElementById(\'eventStartDate\').value = \"<? echo date(\'n/j/Y\') ?>\";
			document.getElementById(\'eventStartTime\').value = \"<? echo date(\'g:i A\', (round(time() / (60*15)) * (60*15))) ?>\";
			document.getElementById(\'eventEndTime\').value 	= \"<? echo date(\'g:i A\', (round(time() / (60*15)) * (60*15) + (60*30))) ?>\";
			document.getElementById(\'eventEndDate\').value	= \"<? echo date(\'n/j/Y\') ?>\";
			document.getElementById(\'defaultNewEventTemplate\').style.display=\"block\"; // Display the box
		<?
		}
		?>

Alot of that is stuff i need for my custom use of the appointment creator. The main thing is the 3 default.* and start.* & stop.*

With those set on the fly, i then make the box display with the bottom line. I use mine in a loaded iframe, so i use an ajax function to load the iframe and change the src on the fly from \"calendar.php\" to
//						document.getElementById(\'iFrameCal\').src=\'cal/calendar.php?awb=1&appclientId=\'+ document.getElementById(\'edit_old_client\').value +\'&q=\'+ document.getElementById(\'scheduleFirstName\').value +\' \'+ document.getElementById(\'scheduleLastName\').value;
//						calendarButton.onclick();

and i add the GET vars to make it load the box. It works for me anyways, enjoy if anyone else needs it. The entire point is so i dont have to click on the actual calendar to open the new appointment window, i can click on it from any page and have it direct to the calendar and clicked for me.

Please Log in or Create an account to join the conversation.

Re:Invoking onclick handler, open appointment from another window 9 years 1 month ago #364

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 142
  • Karma: 1
  • Thank you received: 1
Austin:

Couple of questions

1. What version of calendar are you using? Basic / Premium?
2. What do intend to do? I am assuming on click of a button (external to calendar), you want to open the new event form? do you also require the ghost event (The event div element that is created by dragging) to be shown?

Based on this info, I may be able to tell you a easy method to do this.

Thanks

Please Log in or Create an account to join the conversation.


Team Web2Cal.

Re:Invoking onclick handler, open appointment from another window 9 years 1 month ago #365

  • austinbest
  • austinbest's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
I am using basic, and the more info that can be provided, the easier things would be. I\'ve created formless appointment adding via php/ajax, i\'ve added drag/drop to the new appointment form, i\'ve added the add/edit/delete to the appointments. It has taken awhile to learn the codes/classes of the calendar, but i\'ve just about got it down now.

Either way, anything that someone else knows that i may not, i will always take that information for future use, so feel free!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.343 seconds
Powered by Kunena Forum

LATEST IN FORUM

  • No posts to display.

ABOUT US