|
1 | 1 | <cfinclude template="/includes/alwaysInclude.cfm">
|
| 2 | +<cfquery name="ctcollector_role" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#"> |
| 3 | + select collector_role from ctcollector_role order by collector_role |
| 4 | +</cfquery> |
2 | 5 | <cfquery name="getColls" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
|
3 | 6 | SELECT
|
4 | 7 | agent_name,
|
5 | 8 | collector_role,
|
6 | 9 | coll_order,
|
7 | 10 | collector.agent_id,
|
8 |
| - institution_acronym |
| 11 | + collector_id |
9 | 12 | FROM
|
10 | 13 | collector,
|
11 |
| - preferred_agent_name, |
12 |
| - cataloged_item, |
13 |
| - collection |
| 14 | + preferred_agent_name |
14 | 15 | WHERE
|
15 |
| - collector.collection_object_id = cataloged_item.collection_object_id and |
16 |
| - cataloged_item.collection_id=collection.collection_id AND |
17 |
| - collector.agent_id = preferred_agent_name.agent_id AND |
18 |
| - collector.collection_object_id = #collection_object_id# |
| 16 | + collector.collection_object_id = #collection_object_id# and |
| 17 | + collector.agent_id = preferred_agent_name.agent_id |
19 | 18 | ORDER BY
|
20 | 19 | collector_role, coll_order
|
21 | 20 | </cfquery>
|
| 21 | +<script> |
| 22 | + function deleteThis(i){ |
| 23 | + $("#name_" + i).val('DELETE'); |
| 24 | + $("#agent_id_" + i).val('DELETE'); |
| 25 | + } |
| 26 | +
|
| 27 | +
|
| 28 | +
|
| 29 | + $(function() { |
| 30 | + $( "#sortable" ).sortable({ |
| 31 | + handle: '.dragger' |
| 32 | + }); |
| 33 | + |
| 34 | + }); |
22 | 35 |
|
23 |
| -<cfoutput> <cfset i=1> |
24 | 36 |
|
25 |
| -<table> |
26 |
| -<cfloop query="getColls"> |
27 |
| - <form name="colls#i#" method="post" action="editColls.cfm" onSubmit="return gotAgentId(this.newagent_id.value)"> |
28 |
| - <input type="hidden" name="collection_object_id" value="#collection_object_id#"> |
29 |
| - <input type="hidden" name="Action" value=""> |
30 |
| - <tr #iif(i MOD 2,DE("class='evenRow'"),DE("class='oddRow'"))# ><td> |
31 |
| - Name: <input type="text" name="Name" value="#getColls.agent_name#" class="reqdClr" |
32 |
| - onchange="getAgent('newagent_id','Name','colls#i#',this.value); return false;" |
33 |
| - onKeyPress="return noenter(event);"> |
| 37 | +</script> |
| 38 | +<cfoutput> |
| 39 | + <cfset i=1> |
| 40 | + <form name="colls" method="post" action="editColls.cfm" > |
| 41 | + <input type="hidden" name="collection_object_id" value="#collection_object_id#"> |
| 42 | + <input type="hidden" name="action" value="saveedits"> |
34 | 43 |
|
35 |
| - <input type="hidden" name="newagent_id"> |
36 |
| - <input type="hidden" name="oldagent_id" value="#agent_id#"> |
37 | 44 |
|
38 |
| - Role: |
39 |
| - <input type="hidden" name="oldRole" value="#getColls.collector_role#"> |
40 |
| - <select name="collector_role" size="1" class="reqdClr"> |
41 |
| - <option <cfif #getColls.collector_role# is 'c'> selected </cfif>value="c">collector</option> |
42 |
| - <option <cfif #getColls.collector_role# is 'p'> selected </cfif>value="p">preparator</option> |
43 |
| - </select> |
44 |
| - Order: |
45 |
| - <input type="hidden" name="oldOrder" value="#getColls.coll_order#"> |
46 |
| - <select name="coll_order" size="1" class="reqdClr"> |
47 |
| - <cfset thisLoop =#getColls.recordcount# +1> |
48 |
| - <cfloop from="1" index="c" to="#thisLoop#"> |
49 |
| - <option |
50 |
| - <cfif #c# is #getColls.coll_order#> selected </cfif>value="#c#">#c#</option> |
51 |
| - |
| 45 | + |
| 46 | + |
| 47 | + <table id="clastbl" border="1"> |
| 48 | + <thead> |
| 49 | + <tr> |
| 50 | + <th>draghandle</th> |
| 51 | + <th>Agent</th> |
| 52 | + <th>Role</th> |
| 53 | + <th>Order</th> |
| 54 | + </tr> |
| 55 | + </thead> |
| 56 | + <tbody id="sortable"> |
| 57 | + <cfloop query="getColls"> |
| 58 | + <input type="hidden" name="collector_id_#i#" value="#collector_id#"> |
| 59 | + <tr #iif(i MOD 2,DE("class='evenRow'"),DE("class='oddRow'"))# id="row_#i#"> |
| 60 | + <td class="dragger"> |
| 61 | + (drag row here) |
| 62 | + </td> |
| 63 | + <td> |
| 64 | + <input type="text" name="name_#i#" id="name_#i#" value="#getColls.agent_name#" class="reqdClr" |
| 65 | + onchange="getAgent('newagent_id','name_#i#','colls',this.value); return false;" |
| 66 | + onKeyPress="return noenter(event);"> |
| 67 | + <input type="hidden" name="agent_id_#i#" id="agent_id_#i#"> |
| 68 | + </td> |
| 69 | + <td> |
| 70 | + <select name="collector_role" size="1" class="reqdClr"> |
| 71 | + <cfloop query="ctcollector_role"> |
| 72 | + <option <cfif getColls.collector_role is ctcollector_role.collector_role> selected="selected" </cfif> |
| 73 | + value="#ctcollector_role.collector_role#">#ctcollector_role.collector_role#</option> |
| 74 | + </cfloop> |
| 75 | + </select> |
| 76 | + </td> |
| 77 | + <td> |
| 78 | + <select name="coll_order" size="1" class="reqdClr"> |
| 79 | + <cfset thisLoop =getColls.recordcount + 1> |
| 80 | + <cfloop from="1" index="c" to="#thisLoop#"> |
| 81 | + <option <cfif c is getColls.coll_order> selected="selected" </cfif>value="#c#">#c#</option> |
| 82 | + </cfloop> |
| 83 | + </select> |
| 84 | + </td> |
| 85 | + <td> |
| 86 | + <input type="button" class="delBtn" value="delete" onclick="deleteThis('#i#');"> |
| 87 | + </td> |
| 88 | + </tr> |
| 89 | + <cfset i = i+1> |
52 | 90 | </cfloop>
|
53 |
| - </select> |
54 |
| - |
55 |
| - <input type="button" |
56 |
| - value="Save" |
57 |
| - class="savBtn" |
58 |
| - onmouseover="this.className='savBtn btnhov'" |
59 |
| - onmouseout="this.className='savBtn'" |
60 |
| - onclick="colls#i#.Action.value='saveEdits';submit();"> |
61 |
| - |
62 |
| - <input type="button" value="Delete" class="delBtn" |
63 |
| - onClick="colls#i#.Action.value='deleteColl';confirmDelete('colls#i#');"> |
64 |
| - |
65 |
| - </td></tr> |
66 |
| - </form> |
67 |
| - <cfset i = #i#+1> |
68 |
| -</cfloop> |
69 |
| -</table> |
70 |
| -<table class="newRec"> |
71 |
| - <tr> |
72 |
| - <td><strong>Add an Agent:</strong></td> |
73 |
| - </tr> |
74 |
| - <tr> |
75 |
| - <td><form name="newColl" method="post" action="editColls.cfm" onSubmit="return gotAgentId(this.newagent_id.value)"> |
76 |
| - <input type="hidden" name="collection_object_id" value="#collection_object_id#"> |
77 |
| - <input type="hidden" name="Action" value="newColl"> |
78 |
| - |
79 |
| - Name: <input type="text" name="name" class="reqdClr" |
80 |
| - onchange="getAgent('newagent_id','name','newColl',this.value); return false;" |
81 |
| - onKeyPress="return noenter(event);"> |
82 |
| - <input type="hidden" name="newagent_id"> |
| 91 | + </tbody> |
| 92 | + </table> |
| 93 | + <input type="hidden" name="number_of_collectors" id="number_of_collectors" value="#i#"> |
| 94 | + <br> |
| 95 | + <input type="submit" value="Save" class="savBtn"> |
| 96 | + </form> |
| 97 | + |
| 98 | + |
83 | 99 |
|
84 | 100 |
|
85 |
| - Role: |
86 |
| - <select name="collector_role" size="1" class="reqdClr"> |
87 |
| - <option value="c">collector</option> |
88 |
| - <option value="p">preparator</option> |
89 |
| - |
90 |
| - </select> |
91 |
| - Order: |
92 |
| - <select name="coll_order" size="1" class="reqdClr"> |
93 |
| - <cfset thisLoop = #getColls.recordcount# +1> |
94 |
| - <cfloop from="1" index="c" to="#thisLoop#"> |
95 |
| - <option <cfif #c# is #thisLoop#> selected </cfif> |
96 |
| - value="#c#">#c#</option> |
97 |
| - |
98 |
| - </cfloop> |
99 |
| - </select> |
| 101 | + <table class="newRec"> |
| 102 | + <tr> |
| 103 | + <td><strong>Add an Agent:</strong></td> |
| 104 | + </tr> |
| 105 | + <tr> |
| 106 | + <td><form name="newColl" method="post" action="editColls.cfm" onSubmit="return gotAgentId(this.newagent_id.value)"> |
| 107 | + <input type="hidden" name="collection_object_id" value="#collection_object_id#"> |
| 108 | + <input type="hidden" name="Action" value="newColl"> |
| 109 | + |
| 110 | + Name: <input type="text" name="name" class="reqdClr" |
| 111 | + onchange="getAgent('newagent_id','name','newColl',this.value); return false;" |
| 112 | + onKeyPress="return noenter(event);"> |
| 113 | + <input type="hidden" name="newagent_id"> |
100 | 114 |
|
101 |
| - <input type="submit" value="Create" class="insBtn" |
102 |
| - onmouseover="this.className='insBtn btnhov'" onmouseout="this.className='insBtn'"> |
103 |
| - |
104 |
| - </form></td> |
105 |
| - </tr> |
106 |
| -</table> |
| 115 | + |
| 116 | + Role: |
| 117 | + <select name="collector_role" size="1" class="reqdClr"> |
| 118 | + <option value="c">collector</option> |
| 119 | + <option value="p">preparator</option> |
| 120 | + |
| 121 | + </select> |
| 122 | + Order: |
| 123 | + <select name="coll_order" size="1" class="reqdClr"> |
| 124 | + <cfset thisLoop = #getColls.recordcount# +1> |
| 125 | + <cfloop from="1" index="c" to="#thisLoop#"> |
| 126 | + <option <cfif #c# is #thisLoop#> selected </cfif> |
| 127 | + value="#c#">#c#</option> |
| 128 | + |
| 129 | + </cfloop> |
| 130 | + </select> |
| 131 | + |
| 132 | + <input type="submit" value="Create" class="insBtn" |
| 133 | + onmouseover="this.className='insBtn btnhov'" onmouseout="this.className='insBtn'"> |
| 134 | + |
| 135 | + </form></td> |
| 136 | + </tr> |
| 137 | + </table> |
107 | 138 | <p>
|
108 | 139 |
|
109 | 140 | </cfoutput>
|
|
0 commit comments