Hello Isabelle,

This is actually alot simpler than it seems.

Here's some brief example specs on this application.  You should expand upon these to 
suit your needs.

Tables needed:

CONTACTS
----------------------------
ID_CONTACT (PK: AUTO INC INT)
FNAME (VARCHAR)
MNAME (VARCHAR)
LNAME (VARCHAR)
SSN (VARCHAR)
EMAIL (VARCHAR)

CONTACT_TYPES (manager, employee, etc.)
----------------------------
ID_CONTACT_TYPE (PK: AUTO INC INT)
CONTACT_TYPE (VARCHAR)

CONTACT_TYPES_TO_CONTACTS (a person might be a part of several different types)
----------------------------
ID_CONTACT_TYPE (INT)
ID_CONTACT (INT)

MANAGERS_EMPLOYEES
----------------------------
ID_MANAGER (FK: ID_CONTACT)
ID_EMPLOYEE (FK: ID_CONTACT)

VACATION_REQUESTS
----------------------------
ID_VACATION_REQUEST (PK: AUTO INC INT)
DT_REQUEST_DATE (DATE/TIME)
ID_EMPLOYEE (FK: ID_CONTACT) (INT)
ID_MANAGER (FK: ID_CONTACT) (INT)
DT_VACATION_START_DATE (DATE/TIME)
DT_VACATION_END_DATE (DATE/TIME)
PENDING (INT)
APPROVED (INT)
TAKEN (INT)


STEP 1: IDENTIFY THE USER
You need to know who the employee is, so you'll to have them "login".  This can be 
done with a login form that asks for their name and possibly the last 4 digits of 
their SSN (or something like that).  Run a query on the contacts table to verify their 
identity.  Then set session var session.id_contact and CFLOCATION to the vacation form.

STEP 2: FIND OUT WHO THIS PERSON'S MANAGER IS
Based upon the session._id_contact, run a query on the MANAGERS_EMPLOYEES table to 
find out which manager is assigned to this user.  Join that query to the contacts 
table to retrieve their name for display on the form.  (This may not be necessary.)

Insert the vacation data into the table, making sure that the following default column 
values are used:  PENDING=1, APPROVED=0, TAKEN=0.

NOTE: STEP 3 could be combined with step 2.

STEP 3: CREATE A SCRIPT TO SEARCH THROUGH PENDING VACATIONS
Create a query which searches the vacations table for all rows where the pending 
column = 1.

Run the same query as described in step 2 to figure out which manager is assigned to 
this employee.

Now based upon the results of the two queries above, create a CFMAIL script containing 
all the contents of the vacation request form which will be sent to the manager.

STEP 4: CFSCHEDULED EVENT
Create a cfschedule for step 3.  The pro of using a cfschedule is that you can 
continously notify the managers about pending vacation requets until they log in to 
ths system and do something about it!  The con is that they'll continue to receive 
messages until they do something about it.  Depending upon how often you want to nag 
the managers will determine what regularity you run the script.  You could also skip 
this step and simply combine step 2 & 3.

STEP 5: MANAGING THE VACATION REQUESTS
So now that the manager has been notified, they'll need to login and approve or not 
approve the form. They login in the same manner as described above for employees.  
Based upon their session.id_contact, run a query on the managers_employees table and 
then a query on the vacations table to figure out whether this manager has any 
employees requesting vacations.  Based upon those results, create a list of vacation 
requests.  Each vacation requets links to the vacation authorization form which is 
dynamically populated based upon a query you'll run to populate it.

The vacation authorization form should not allow the manager to do anything excpet 
change values for the following:
APPROVED?
TAKEN?

Note that the user does not change the pending value because that will be done 
automatically when you update the record.  (Set the PENDING=0)

STEP 6: STATUS NOTIFICATIONS
Finally, using similar logic as described in steps 2,3, and 4, send notifications to 
whomever.  

Hopefully this gives you a nice jump start.

---mark

 
--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net 
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------


> -----Original Message-----
> From: Isabelle Lynch [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 28, 2000 7:55 AM
> To: CF-Talk
> Subject: Vacation Form
> 
> 
> I am attempting to create a vacation form that works in the following
> manner:
> 
> (1) User completes the form
> (2) Using a drop down list, user selects the appropriate manager, and the
> form is e-mailed to that manager
> (3) Manager receives the form, selects the correct approval/disaproval of
> vacation
> (4) If approved is checked, form automatically goes to the 
> receptionist for
> input into the corporate calendar, and the initial user receives his/her
> approval via e-mail
> (5) If vacation is disaproved, an e-mail is sent to the initial user
> advising that vacation has been disapproved.
> 
> Can this be done in CF? Or is there a better way to do this? Can this be
> done at all?
> 
> I know how to program up to (2) but am lost the rest of the way. 
> I am Newbie
> #1. Please help.
> 
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to