Merge pull request #21513 from JKingsnorth/core-2846-1-improve-start-end-date-validation
[civicrm-core.git] / xml / schema / Contact / SavedSearch.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>SavedSearch</class>
6 <name>civicrm_saved_search</name>
7 <comment>Users can save their complex SQL queries and use them later.</comment>
8 <icon>fa-search-plus</icon>
9 <add>1.1</add>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Saved Search ID</title>
14 <required>true</required>
15 <comment>Saved Search ID</comment>
16 <html>
17 <type>Number</type>
18 </html>
19 <add>1.1</add>
20 </field>
21 <primaryKey>
22 <name>id</name>
23 <autoincrement>false</autoincrement>
24 </primaryKey>
25
26 <field>
27 <name>name</name>
28 <title>Saved Search Name</title>
29 <type>varchar</type>
30 <length>255</length>
31 <default>NULL</default>
32 <comment>Unique name of saved search</comment>
33 <html>
34 <type>Text</type>
35 </html>
36 <add>1.0</add>
37 </field>
38 <index>
39 <name>UI_name</name>
40 <fieldName>name</fieldName>
41 <unique>true</unique>
42 <add>5.32</add>
43 </index>
44
45 <field>
46 <name>label</name>
47 <title>Saved Search Label</title>
48 <type>varchar</type>
49 <length>255</length>
50 <default>NULL</default>
51 <comment>Administrative label for search</comment>
52 <html>
53 <label>Label</label>
54 <type>Text</type>
55 </html>
56 <add>5.32</add>
57 </field>
58
59 <field>
60 <name>form_values</name>
61 <title>Submitted Form Values</title>
62 <type>text</type>
63 <import>true</import>
64 <comment>Submitted form values for this search</comment>
65 <serialize>PHP</serialize>
66 <add>1.1</add>
67 </field>
68
69 <field>
70 <name>mapping_id</name>
71 <type>int unsigned</type>
72 <title>Mapping ID</title>
73 <comment>Foreign key to civicrm_mapping used for saved search-builder searches.</comment>
74 <html>
75 <label>Mapping</label>
76 </html>
77 <add>1.5</add>
78 </field>
79 <foreignKey>
80 <name>mapping_id</name>
81 <table>civicrm_mapping</table>
82 <key>id</key>
83 <onDelete>SET NULL</onDelete>
84 <add>1.5</add>
85 </foreignKey>
86
87 <field>
88 <name>search_custom_id</name>
89 <type>int unsigned</type>
90 <title>Option Value ID</title>
91 <comment>Foreign key to civicrm_option value table used for saved custom searches.</comment>
92 <add>2.0</add>
93 </field>
94
95 <field>
96 <name>where_clause</name>
97 <type>text</type>
98 <title>Where Clause</title>
99 <comment>the sql where clause if a saved search acl</comment>
100 <add>1.6</add>
101 <drop>5.24</drop>
102 </field>
103
104 <field>
105 <name>select_tables</name>
106 <type>text</type>
107 <title>Select Tables</title>
108 <comment>the tables to be included in a select data</comment>
109 <serialize>PHP</serialize>
110 <add>1.6</add>
111 <drop>5.24</drop>
112 </field>
113
114 <field>
115 <name>where_tables</name>
116 <type>text</type>
117 <title>Where Tables</title>
118 <comment>the tables to be included in the count statement</comment>
119 <serialize>PHP</serialize>
120 <add>1.6</add>
121 <drop>5.24</drop>
122 </field>
123
124 <field>
125 <name>api_entity</name>
126 <type>varchar</type>
127 <title>Entity Name</title>
128 <length>255</length>
129 <comment>Entity name for API based search</comment>
130 <add>5.24</add>
131 <pseudoconstant>
132 <callback>CRM_Contact_BAO_SavedSearch::getApiEntityOptions</callback>
133 </pseudoconstant>
134 </field>
135
136 <field>
137 <name>api_params</name>
138 <type>text</type>
139 <title>API Parameters</title>
140 <comment>Parameters for API based search</comment>
141 <serialize>JSON</serialize>
142 <add>5.24</add>
143 </field>
144 <field>
145 <name>created_id</name>
146 <type>int unsigned</type>
147 <title>Created By Contact ID</title>
148 <comment>FK to contact table.</comment>
149 <html>
150 <label>Created By</label>
151 </html>
152 <readonly>true</readonly>
153 <add>5.36</add>
154 </field>
155 <foreignKey>
156 <name>created_id</name>
157 <table>civicrm_contact</table>
158 <key>id</key>
159 <add>5.36</add>
160 <onDelete>SET NULL</onDelete>
161 </foreignKey>
162 <field>
163 <name>modified_id</name>
164 <type>int unsigned</type>
165 <title>Modified By Contact ID</title>
166 <comment>FK to contact table.</comment>
167 <html>
168 <label>Modified By</label>
169 </html>
170 <readonly>true</readonly>
171 <add>5.36</add>
172 </field>
173 <foreignKey>
174 <name>modified_id</name>
175 <table>civicrm_contact</table>
176 <key>id</key>
177 <add>5.36</add>
178 <onDelete>SET NULL</onDelete>
179 </foreignKey>
180 <field>
181 <name>expires_date</name>
182 <type>timestamp</type>
183 <title>Search Expiry Date</title>
184 <required>false</required>
185 <comment>Optional date after which the search is not needed</comment>
186 <add>5.36</add>
187 </field>
188 <field>
189 <name>created_date</name>
190 <type>timestamp</type>
191 <comment>When the search was created.</comment>
192 <required>true</required>
193 <default>CURRENT_TIMESTAMP</default>
194 <readonly>true</readonly>
195 <add>5.36</add>
196 </field>
197 <field>
198 <name>modified_date</name>
199 <type>timestamp</type>
200 <comment>When the search was last modified.</comment>
201 <required>true</required>
202 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
203 <add>5.36</add>
204 <readonly>true</readonly>
205 </field>
206 <field>
207 <name>description</name>
208 <type>text</type>
209 <title>Saved Search Description</title>
210 <html>
211 <type>TextArea</type>
212 <rows>2</rows>
213 <cols>60</cols>
214 </html>
215 <add>5.36</add>
216 </field>
217 </table>