Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. <cfsilent>
  2. <!--- getprojectswithadvisors.cfm Copyright (c) 2003 UW Board of Regents
  3.  
  4. Description:
  5. Returns a query with the projects and the advisors info
  6. Parameters:
  7. results - the name of the returned query.
  8. Usage:
  9. called as a custom tag <cfmodule template="#request.customtagspath#/projectswithadvisors.cfm">
  10. Created:
  11. 4/28/04; Deanna
  12. Revised
  13. today's date; developer
  14. --->
  15.  
  16. <cfparam name="attributes.results" default="getAdvisors">
  17.  
  18.  
  19. <cfset structclear(application)>
  20. <!--- If the query hasn't been cached to the application scope, do that first --->
  21. <cfif not isdefined("application.querystruct.advisors") or isDefined("url.reset")>
  22.  
  23. <cfquery name="getadvisors" password="#request.pword#" username="#request.uname#" datasource="#request.dsn#">
  24. SELECT pt.name AS project, pt.projectid, p.personid, d.working_ttl, d.fullname, d.last_name, d.phone, d.fax, d.address, d.city, d.state, d.zip, d.email
  25. FROM project pt, person p,
  26. (SELECT p.prsn_id, r.working_ttl, dirfunctions.formatdirfullname(p.prsn_id) AS fullname, p.last_name,
  27. dirfunctions.formatdirphone(p.prsn_id, dpp.phn_id) AS phone,
  28. dirfunctions.formatdirfax(p.prsn_id, dpf.fax_id) AS fax,
  29. CASE WHEN dpa.str IS NOT NULL THEN dpa.str ELSE dpa.pobox END AS address,
  30. dpa.city, dpa.st as state, dpa.zip,
  31. CASE WHEN dirfunctions.formatdiremail(n.prsn_id, n.net_id) != 'Unknown' THEN '<a href="mailto:' || dirfunctions.formatdiremail(n.prsn_id, n.net_id) || '">' || dirfunctions.formatdiremail(n.prsn_id, n.net_id) || '</a>' END AS clickableemail,
  32. dirfunctions.formatdiremail(n.prsn_id, n.net_id) AS email
  33. FROM dir_role r, dir_emp_role e, dir_prsn p,
  34. dir_prsn_phn dpp, dir_prsn_fax dpf, dir_prsn_addr dpa, dir_netid_mapping n
  35. WHERE r.deleted_fl = 'N'
  36. AND r.role_id = e.role_id
  37. AND e.prsn_id = p.prsn_id
  38. AND p.prsn_id = dpp.prsn_id
  39. AND p.prsn_id = dpf.prsn_id
  40. AND dpp.prmy_fl = 'Y'
  41. AND p.prsn_id = dpa.prsn_id
  42. AND p.prsn_id = n.prsn_id (+)) d
  43. WHERE pt.advisor = p.personid (+)
  44. AND p.personid = d.prsn_id (+)
  45. AND pt.active = 1
  46. AND pt.projectid IN (SELECT distinct(projectid) FROM projectcounty)
  47. ORDER BY project
  48. </cfquery>
  49.  
  50. <cflock scope="application" type="exclusive" timeout="10">
  51. <cfset application.querystruct.advisors = getadvisors>
  52. </cflock>
  53. </cfif>
  54.  
  55. <!--- Set the caller results to the application variable --->
  56. <cfset "caller.#attributes.results#" = application.querystruct.advisors>
  57.  
  58. </cfsilent>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement