PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.24
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.24
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / assets / js-templates / form-components.php

form-components.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.24, at assets/js-templates/form-components.php

984 lines 48.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script type="text/x-template" id="tmpl-wpuf-dynamic-field">
2 <div>
3
4 <div class="panel-field-opt panel-field-opt-text">
5 <label>
6 <?php _e( 'Dynamic value population', 'weforms' ); ?>
7 <help-text text="<?php _e( 'Field value or options can be populated dynamically through filter hook or query string', 'weforms' ); ?>"></help-text>
8 </label>
9
10 <ul>
11 <li>
12 <label>
13 <input type="checkbox" value="yes" v-model="dynamic.status"> <?php _e( 'Allow field to be populated dynamically', 'weforms' ); ?>
14 </label>
15 </li>
16 </ul>
17 </div>
18
19
20 <template v-if="dynamic.status">
21
22 <div class="panel-field-opt panel-field-opt-text"><label>
23 <?php _e( 'Parameter Name', 'weforms' ); ?>
24 <help-text text="<?php _e( 'Enter a Parameter Name, using that the field value can be populated through filter hook or query string', 'weforms' ); ?>"></help-text>
25 <input type="text" v-model="dynamic.param_name">
26 </label>
27 </div>
28 </template>
29
30 </div>
31 </script>
32
33 <script type="text/x-template" id="tmpl-wpuf-field-name">
34 <div>
35 <div class="panel-field-opt panel-field-name clearfix">
36
37 <label>
38 <?php _e( 'First Name', 'weforms' ); ?>
39 </label>
40
41 <div class="name-field-placeholder">
42
43 <div class="name-merge-tag-holder">
44 <input type="text" v-model="editing_form_field.first_name.placeholder">
45 <wpuf-merge-tags
46 filter="no_fields"
47 v-on:insert="insertValue"
48 :field="{name: 'first_name', type: 'placeholder'}">
49 </wpuf-merge-tags>
50 </div>
51
52 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
53 </div>
54
55 <div class="name-field-value">
56 <div class="name-merge-tag-holder">
57 <input type="text" v-model="editing_form_field.first_name.default">
58 <wpuf-merge-tags
59 filter="no_fields"
60 v-on:insert="insertValue"
61 :field="{name: 'first_name', type: 'default'}">
62 </wpuf-merge-tags>
63 </div>
64
65 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
66 </div>
67 </div>
68
69 <div class="panel-field-opt panel-field-name clearfix" v-if="editing_form_field.format !== 'first-last'">
70
71 <label>
72 <?php _e( 'Middle Name', 'weforms' ); ?>
73 </label>
74
75 <div class="name-field-placeholder">
76 <div class="name-merge-tag-holder">
77 <input type="text" v-model="editing_form_field.middle_name.placeholder">
78 <wpuf-merge-tags
79 filter="no_fields"
80 v-on:insert="insertValue"
81 :field="{name: 'middle_name', type: 'placeholder'}">
82 </wpuf-merge-tags>
83 </div>
84
85 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
86 </div>
87
88 <div class="name-field-value">
89
90 <div class="name-merge-tag-holder">
91 <input type="text" v-model="editing_form_field.middle_name.default">
92 <wpuf-merge-tags
93 filter="no_fields"
94 v-on:insert="insertValue"
95 :field="{name: 'middle_name', type: 'default'}">
96 </wpuf-merge-tags>
97 </div>
98
99 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
100 </div>
101 </div>
102
103 <div class="panel-field-opt panel-field-name clearfix">
104
105 <label>
106 <?php _e( 'Last Name', 'weforms' ); ?>
107 </label>
108
109 <div class="name-field-placeholder">
110
111 <div class="name-merge-tag-holder">
112 <input type="text" v-model="editing_form_field.last_name.placeholder">
113 <wpuf-merge-tags
114 filter="no_fields"
115 v-on:insert="insertValue"
116 :field="{name: 'last_name', type: 'placeholder'}">
117 </wpuf-merge-tags>
118 </div>
119
120 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
121 </div>
122
123 <div class="name-field-value">
124 <div class="name-merge-tag-holder">
125 <input type="text" v-model="editing_form_field.last_name.default">
126 <wpuf-merge-tags
127 filter="no_fields"
128 v-on:insert="insertValue"
129 :field="{name: 'last_name', type: 'default'}">
130 </wpuf-merge-tags>
131 </div>
132 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
133 </div>
134 </div>
135 </div>
136 </script>
137
138 <script type="text/x-template" id="tmpl-wpuf-field-text-with-tag">
139 <div v-if="met_dependencies" class="panel-field-opt panel-field-opt-text field-text-with-tag">
140 <label>
141 {{ option_field.title }} <help-text v-if="option_field.help_text" :text="option_field.help_text"></help-text>
142
143 <input
144 v-if="option_field.variation && 'number' === option_field.variation"
145 type="number"
146 v-model="value"
147 @focusout="on_focusout"
148 @keyup="on_keyup"
149 >
150
151 <input
152 v-if="!option_field.variation"
153 type="text"
154 v-model="value"
155 @focusout="on_focusout"
156 @keyup="on_keyup"
157 >
158
159 <wpuf-merge-tags :filter="option_field.tag_filter" v-on:insert="insertValue"></wpuf-merge-tags>
160 </label>
161 </div>
162 </script>
163
164 <script type="text/x-template" id="tmpl-wpuf-form-date_field">
165 <div class="wpuf-fields">
166 <input
167 type="text"
168 :class="class_names('datepicker')"
169 :placeholder="field.format"
170 :value="field.default"
171 :size="field.size"
172 >
173 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
174 </div></script>
175
176 <script type="text/x-template" id="tmpl-wpuf-form-name_field">
177 <div class="wpuf-fields">
178
179 <div :class="['wpuf-name-field-wrap', 'format-' + field.format]">
180 <div class="wpuf-name-field-first-name">
181 <input
182 type="text"
183 :class="class_names('textfield')"
184 :placeholder="field.first_name.placeholder"
185 :value="field.first_name.default"
186 :size="field.size"
187 >
188 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.first_name.sub }}</label>
189 </div>
190
191 <div class="wpuf-name-field-middle-name">
192 <input
193 type="text"
194 :class="class_names('textfield')"
195 :placeholder="field.middle_name.placeholder"
196 :value="field.middle_name.default"
197 :size="field.size"
198 >
199 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.middle_name.sub }}</label>
200 </div>
201
202 <div class="wpuf-name-field-last-name">
203 <input
204 type="text"
205 :class="class_names('textfield')"
206 :placeholder="field.last_name.placeholder"
207 :value="field.last_name.default"
208 :size="field.size"
209 >
210 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.last_name.sub }}</label>
211 </div>
212 </div>
213
214 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
215 </div>
216 </script>
217
218 <script type="text/x-template" id="tmpl-wpuf-form-notification">
219 <div>
220 <!-- <pre>{{ notifications.length }}</pre> -->
221 <a href="#" class="button button-secondary add-notification" v-on:click.prevent="addNew"><span class="dashicons dashicons-plus-alt"></span> <?php _e( 'Add Notification', 'weforms' ); ?></a>
222
223 <div :class="[editing ? 'editing' : '', 'notification-wrap']">
224 <!-- notification-wrap -->
225
226 <div class="notification-table-wrap">
227 <table class="wp-list-table widefat fixed striped posts wpuf-cf-notification-table">
228 <thead>
229 <tr>
230 <th class="col-toggle">&nbsp;</th>
231 <th class="col-name"><?php _e( 'Name', 'weforms' ); ?></th>
232 <th class="col-subject"><?php _e( 'Subject', 'weforms' ); ?></th>
233 <th class="col-action">&nbsp;</th>
234 </tr>
235 </thead>
236 <tbody>
237 <tr v-for="(notification, index) in notifications">
238 <td class="col-toggle">
239 <a href="#" v-on:click.prevent="toggelNotification(index)">
240 <img v-if="notification.active" src="<?php echo WPUF_ASSET_URI; ?>/images/active.png" width="24" alt="status">
241 <img v-else src="<?php echo WPUF_ASSET_URI; ?>/images/inactive.png" width="24" alt="status">
242 </a>
243 </td>
244 <td class="col-name"><a href="#" v-on:click.prevent="editItem(index)">{{ notification.name }}</a></td>
245 <td class="col-subject">{{ notification.type === 'email' ? notification.subject : notification.smsText }}</td>
246 <td class="col-action">
247 <a href="#" v-on:click.prevent="duplicate(index)" title="<?php esc_attr_e( 'Duplicate', 'weforms' ); ?>"><span class="dashicons dashicons-admin-page"></span></a>
248 <a href="#" v-on:click.prevent="editItem(index)" title="<?php esc_attr_e( 'Settings', 'weforms' ); ?>"><span class="dashicons dashicons-admin-generic"></span></a>
249 </td>
250 </tr>
251 <tr v-if="!notifications.length">
252 <td colspan="4"><?php _e( 'No notifications found', 'weforms' ); ?></td>
253 </tr>
254 </tbody>
255 </table>
256 </div><!-- .notification-table-wrap -->
257
258 <div class="notification-edit-area" v-if="notifications[editingIndex]">
259
260 <div class="notification-head">
261 <input type="text" name="" v-model="notifications[editingIndex].name" v-on:keyup.enter="editDone()" value="Admin Notification">
262 </div>
263
264 <div class="form-fields">
265
266 <div class="notification-row notification-field">
267 <label for="notification-title"><?php _e( 'Type', 'weforms' ); ?></label>
268 <select type="text" v-model="notifications[editingIndex].type">
269 <option value="email"><?php _e( 'Email Notification', 'weforms' ); ?></option>
270 <option value="sms"><?php _e( 'SMS Notification', 'weforms' ); ?></option>
271 </select>
272 </div>
273
274 <template v-if="notifications[editingIndex].type == 'email' ">
275 <div class="notification-row">
276 <div class="row-one-half notification-field first">
277 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
278 <input type="text" v-model="notifications[editingIndex].to">
279 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="to"></wpuf-merge-tags>
280 </div>
281
282 <div class="row-one-half notification-field">
283 <label for="notification-title"><?php _e( 'Reply To', 'weforms' ); ?></label>
284 <input type="email" v-model="notifications[editingIndex].replyTo">
285 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="replyTo"></wpuf-merge-tags>
286 </div>
287 </div>
288
289 <div class="notification-row notification-field">
290 <label for="notification-title"><?php _e( 'Subject', 'weforms' ); ?></label>
291 <input type="text" v-model="notifications[editingIndex].subject">
292 <wpuf-merge-tags v-on:insert="insertValue" field="subject"></wpuf-merge-tags>
293 </div>
294
295 <div class="notification-row notification-field">
296 <label for="notification-title"><?php _e( 'Email Message', 'weforms' ); ?></label>
297
298 <weforms-text-editor
299 v-model="notifications[editingIndex].message"
300 :i18n="i18n"
301 :editingIndex="editingIndex"
302 >
303 </weforms-text-editor>
304
305 <wpuf-merge-tags v-on:insert="insertValueEditor" field="message"></wpuf-merge-tags>
306 </div>
307 </template>
308 <template v-else>
309 <template v-if="has_sms">
310 <div class="notification-row notification-field">
311 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
312 <input type="text" v-model="notifications[editingIndex].smsTo">
313 <wpuf-merge-tags v-on:insert="insertValue" field="smsTo"></wpuf-merge-tags>
314 </div>
315 <div class="notification-row notification-field">
316 <label for="notification-title"><?php _e( 'SMS Text', 'weforms' ); ?></label>
317 <textarea name="" rows="6" v-model="notifications[editingIndex].smsText"></textarea>
318 <wpuf-merge-tags v-on:insert="insertValue" field="smsText"></wpuf-merge-tags>
319 </div>
320 </template>
321 <template v-else>
322 <p>
323 <label class="wpuf-pro-text-alert">
324 <a :href="pro_link" target="_blank"><?php _e( 'SMS notification moule not found', 'wpuf' ); ?></a>
325 </label>
326 </p>
327 </template>
328 </template>
329
330 <section class="advanced-fields">
331 <a href="#" class="field-toggle" v-on:click.prevent="toggleAdvanced()"><span class="dashicons dashicons-arrow-right"></span><?php _e( ' Advanced', 'weforms' ); ?></a>
332
333 <div class="advanced-field-wrap">
334 <p class="wpuf-pro-text-alert"><?php _e( 'Make sure that your mail server is configured properly for the following "From" fields', 'weforms' ); ?></p>
335 <template v-if="notifications[editingIndex].type == 'email' ">
336 <div class="notification-row">
337 <div class="row-one-half notification-field first">
338 <label for="notification-title"><?php _e( 'From Name', 'weforms' ); ?></label>
339 <input type="text" v-model="notifications[editingIndex].fromName">
340 <wpuf-merge-tags v-on:insert="insertValue" field="fromName"></wpuf-merge-tags>
341 </div>
342
343 <div class="row-one-half notification-field">
344 <label for="notification-title"><?php _e( 'From Address', 'weforms' ); ?></label>
345 <input type="email" name="" v-model="notifications[editingIndex].fromAddress">
346 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="fromAddress"></wpuf-merge-tags>
347 </div>
348 </div>
349
350 <div class="notification-row">
351 <div class="row-one-half notification-field first">
352 <label for="notification-title"><?php _e( 'CC', 'weforms' ); ?></label>
353 <input type="email" name="" v-model="notifications[editingIndex].cc">
354 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="cc"></wpuf-merge-tags>
355 </div>
356
357 <div class="row-one-half notification-field">
358 <label for="notification-title"><?php _e( 'BCC', 'weforms' ); ?></label>
359 <input type="email" name="" v-model="notifications[editingIndex].bcc">
360 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="bcc"></wpuf-merge-tags>
361 </div>
362 </div>
363 </template>
364
365 <div class="notification-row notification-field">
366 <template v-if="is_pro">
367
368 <notification-conditional-logics
369 :notification="notifications[editingIndex]"
370 >
371 </notification-conditional-logics>
372
373 </template>
374 <template v-else>
375 <label class="wpuf-pro-text-alert">
376 <a :href="pro_link" target="_blank"><?php _e( 'Conditional Logics available in Pro Version', 'wpuf' ); ?></a>
377 </label>
378 </template>
379 </div>
380 </div>
381 </section><!-- .advanced-fields -->
382 </div>
383
384 <div class="submit-area">
385 <a href="#" v-on:click.prevent="deleteItem(editingIndex)" title="<?php esc_attr_e( 'Delete', 'weforms' ); ?>"><span class="dashicons dashicons-trash"></span></a>
386 <button class="button button-secondary" v-on:click.prevent="editDone()"><?php _e( 'Done', 'weforms' ); ?></button>
387 </div>
388 </div><!-- .notification-edit-area -->
389
390 </div><!-- .notification-wrap -->
391 </div>
392 </script>
393
394 <script type="text/x-template" id="tmpl-wpuf-integration">
395 <div class="wpuf-integrations-wrap">
396
397 <template v-if="hasIntegrations">
398 <div :class="['wpuf-integration', isAvailable(integration.id) ? '' : 'collapsed']" v-for="integration in integrations">
399 <div :class="['wpuf-panel', isActive(integration.id) ? 'panel-checked' : '']">
400 <div class="wpuf-panel-body">
401 <span class="premium-badge" v-if="!isAvailable(integration.id)"><?php _e( 'Premium', 'weforms' ); ?></span>
402 <img class="icon" :src="integration.icon" :alt="integration.title">
403 </div>
404 <div class="wpuf-panel-footer">
405 <div class="wpuf-setting">
406 <a href="#" @click.prevent="openModal($event.target)" title="<?php _e( 'Settings', 'weforms' ); ?>">
407 <svg width="21px" height="21px" viewBox="0 0 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
408 <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
409 <g id="Individual-Form-Integration-Page-Design---weForms" transform="translate(-203.000000, -290.000000)" fill="#CCCCCC" fill-rule="nonzero">
410 <g id="Group-4" transform="translate(183.000000, 116.000000)">
411 <path d="M40.9342889,183.334097 C40.9010806,183.038903 40.5568864,182.817077 40.259262,182.817077 C39.2970029,182.817077 38.4431201,182.252081 38.0850175,181.378295 C37.7191793,180.483334 37.9550754,179.439603 38.6722182,178.781783 C38.8979565,178.575428 38.9253826,178.229992 38.7360563,177.990038 C38.2435578,177.364644 37.6837832,176.799726 37.0725944,176.310131 C36.8332603,176.118075 36.4821119,176.144797 36.2745796,176.374592 C35.648701,177.06773 34.5244636,177.325342 33.6557347,176.962873 C32.7516878,176.582588 32.1815991,175.666531 32.237389,174.683199 C32.2557512,174.374331 32.030013,174.10578 31.7220744,174.069916 C30.9377337,173.979201 30.1465168,173.976388 29.3598319,174.063665 C29.0554096,174.097263 28.8296713,174.359485 28.8399073,174.664447 C28.8741314,175.63809 28.2971666,176.53813 27.4021055,176.90474 C26.5437688,177.255333 25.4274233,176.999909 24.8027948,176.312944 C24.5963565,176.086664 24.2509121,176.058848 24.0104059,176.246294 C23.3810893,176.740031 22.8087346,177.305417 22.3117041,177.925655 C22.1178459,178.16678 22.1463659,178.516279 22.3743701,178.723728 C23.105187,179.385534 23.3411612,180.438328 22.9614927,181.343602 C22.5990145,182.206684 21.7027813,182.762929 20.6767623,182.762929 C20.3438199,182.752224 20.1066736,182.975691 20.0702617,183.278387 C19.9779036,184.06724 19.9768096,184.871017 20.0657297,185.666278 C20.0987036,185.962723 20.4533682,186.182595 20.7542743,186.182595 C21.6686353,186.159233 22.5465063,186.725323 22.9147667,187.621456 C23.2818551,188.516417 23.0458809,189.559522 22.3276441,190.217889 C22.1029998,190.424245 22.0744797,190.769134 22.2638061,191.009087 C22.7516945,191.630496 23.3115472,192.195961 23.9249239,192.689619 C24.1655082,192.883473 24.5155626,192.856126 24.7241107,192.62633 C25.3523334,191.931473 26.4764927,191.67433 27.3417836,192.037503 C28.2480965,192.416615 28.8181852,193.332594 28.7623952,194.316473 C28.7441893,194.625498 28.9710214,194.894517 29.2777098,194.929835 C29.6789441,194.976638 30.0826006,195 30.4873511,195 C30.8715515,195 31.25583,194.978903 31.6400304,194.936164 C31.9445309,194.902565 32.1701129,194.640344 32.1598769,194.334835 C32.1246371,193.361739 32.7026176,192.461699 33.5965067,192.095713 C34.4606255,191.742777 35.5722828,192.001092 36.1969894,192.687353 C36.4045998,192.913164 36.7476219,192.940433 36.9894564,192.753612 C37.617601,192.261048 38.1887836,191.69613 38.6881582,191.074173 C38.8819384,190.833595 38.8545904,190.483549 38.6254141,190.276178 C37.8945972,189.614373 37.657451,188.561423 38.0371194,187.656773 C38.39405,186.805177 39.2569967,186.233383 40.185188,186.233383 L40.3150519,186.236743 C40.6161144,186.2612 40.8931106,186.029294 40.9296007,185.721988 C41.0221151,184.932432 41.023209,184.129358 40.9342889,183.334097 Z M30.5166525,188.024555 C28.5852583,188.024555 27.0142326,186.453568 27.0142326,184.522222 C27.0142326,182.590953 28.5852583,181.019888 30.5166525,181.019888 C32.4479686,181.019888 34.0189943,182.590953 34.0189943,184.522222 C34.0189943,186.453568 32.4479686,188.024555 30.5166525,188.024555 Z" id="Shape" transform="translate(30.500000, 184.500000) scale(-1, 1) translate(-30.500000, -184.500000) "></path>
412 </g>
413 </g>
414 </g>
415 </svg>
416 </a>
417 </div>
418 <div :class="['wpuf-toggle-switch', 'big', isActive(integration.id) ? 'checked' : '']" v-on:click="toggleState(integration.id, $event.target)">
419 <span class="toggle-indicator"></span>
420 </div>
421 </div>
422 </div>
423
424 <div :id="integration.id" class="wf-modal" role="dialog">
425 <div class="wf-modal-dialog">
426 <div class="wf-modal-content">
427 <div class="wf-modal-header">
428 <div class="modal-header-left">
429 <div :class="['wpuf-toggle-switch', 'big', isActive(integration.id) ? 'checked' : '']" v-on:click="toggleState(integration.id, $event.target)">
430 <span class="toggle-indicator"></span>
431 </div>
432 <img class="icon" height="30px" :src="integration.icon" :alt="integration.title">
433 </div>
434 <span class="modal-close" @click.prevent="hideModal($event.target)">x</span>
435 </div>
436 <div class="wf-modal-body">
437 <div v-if="isAvailable(integration.id)">
438 <component :is="'wpuf-integration-' + integration.id" :id="integration.id"></component>
439 </div>
440 <div v-else>
441 <?php _e( 'This feature is available on the premium version only.', 'best-contact-form' ); ?>
442 <a class="button" :href="pro_link" target="_blank"><?php _e( 'Upgrade to Pro', 'best-contact-form' ); ?></a>
443 </div>
444 </div>
445 <div class="wf-modal-footer">
446 <button type="button" class="button button-primary" @click="save_form_builder($event.target)">
447 <?php _e( 'Save Form', 'weforms' ); ?>
448 </button>
449 </div>
450 </div>
451 </div>
452 </div>
453
454 </div>
455 </template>
456
457 <div v-else>
458 <?php _e( 'No integration found.', 'best-contact-form' ); ?>
459 </div>
460 </div>
461 </script>
462
463 <script type="text/x-template" id="tmpl-wpuf-integration-erp">
464 <div>
465
466 <?php if ( !function_exists( 'erp_crm_get_contact_groups' ) ) { ?>
467
468 <p>
469 <?php printf( __( '<a href="%s" target="_blank">WP ERP</a> plugin is not installed. Please install the plugin first.', 'weforms' ), 'https://wordpress.org/plugins/erp/' ); ?>
470 </p>
471
472 <?php } else { ?>
473 <?php
474 $erp_contact_groups = erp_crm_get_contact_groups( [
475 'number' => -1,
476 'orderby' => 'name',
477 'order' => 'ASC',
478 ] );
479 ?>
480
481 <div class="wpuf-int-form-row">
482 <div class="wpuf-int-field-label">
483 <label for="erp-group-id"><?php _e( 'Contact Group', 'weforms' ); ?></label>
484 </div>
485 <div class="wpuf-int-field">
486 <ul style="margin: 0;">
487 <?php foreach ( $erp_contact_groups as $group ) { ?>
488 <li>
489 <label>
490 <input type="checkbox" v-model="settings.group" class="checkbox" value="<?php echo $group->id; ?>">
491 <?php echo $group->name; ?>
492 </label>
493 </li>
494 <?php } ?>
495 </ul>
496 </div>
497 </div>
498
499 <div class="wpuf-int-form-row">
500 <div class="wpuf-int-field-label">
501 <label for="erp-group-id"><?php _e( 'Life Stage', 'weforms' ); ?></label>
502 </div>
503 <div class="wpuf-int-field">
504 <select v-model="settings.stage">
505 <?php echo erp_crm_get_life_stages_dropdown(); ?>
506 </select>
507 </div>
508 </div>
509
510 <fieldset>
511 <legend><?php _e( 'Mapping Fields', 'weforms' ); ?></legend>
512
513 <p class="description" style="padding: 0 0 10px 0;">
514 <?php _e( 'Please map the form input fields with ERP required fields', 'weforms' ); ?>
515 </p>
516
517 <div class="wpuf-int-form-row mapping-fields">
518 <div class="wpuf-int-field-label">
519 <label><?php _e( 'Email Address', 'default' ); ?> <span class="required">*</span></label>
520 </div>
521 <div class="wpuf-int-field">
522 <div class="wpuf-int-field-small">
523 <input type="email" class="regular-text" v-model="settings.fields.email">
524 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="email"></wpuf-merge-tags>
525 </div>
526 </div>
527 </div>
528
529 <div class="wpuf-int-form-row">
530 <div class="wpuf-int-field-label">
531 <label><?php _e( 'First Name', 'default' ); ?></label>
532 </div>
533 <div class="wpuf-int-field">
534 <div class="wpuf-int-field-small">
535 <input type="text" class="regular-text" v-model="settings.fields.first_name">
536 <wpuf-merge-tags v-on:insert="insertValue" field="first_name"></wpuf-merge-tags>
537 </div>
538 </div>
539 </div>
540
541 <div class="wpuf-int-form-row">
542 <div class="wpuf-int-field-label">
543 <label><?php _e( 'Last Name', 'default' ); ?></label>
544 </div>
545 <div class="wpuf-int-field">
546 <div class="wpuf-int-field-small">
547 <input type="text" class="regular-text" v-model="settings.fields.last_name">
548 <wpuf-merge-tags v-on:insert="insertValue" field="last_name"></wpuf-merge-tags>
549 </div>
550 </div>
551 </div>
552 </fieldset>
553
554 <?php } ?>
555 </div></script>
556
557 <script type="text/x-template" id="tmpl-wpuf-integration-slack">
558 <div>
559 <div class="wpuf-int-form-row">
560 <div class="wpuf-int-field-label">
561 <label for="mailchimp-list-id"><?php _e( 'Slack Webhook URL', 'weforms' ); ?></label>
562 </div>
563 <div class="wpuf-int-field">
564 <input type="url" class="regular-text" v-model="settings.url" placeholder="https://hooks.slack.com/services/...">
565 <p class="help"><?php printf( __( '%sSlack webhook URL%s to send our JSON payloads (%sView documentation%s)', 'weforms' ), '<a href="https://api.slack.com/incoming-webhooks" target="_blank" >', '</a>', '<a href="https://wedevs.com/docs/weforms/integrations/slack/" target="_blank" >', '</a>' ); ?></p>
566 </div>
567 </div>
568 </div></script>
569
570 <script type="text/x-template" id="tmpl-wpuf-integration-sprout-invoices">
571 <div>
572
573 <?php if (!function_exists( 'sprout_invoices_load' )) { ?>
574
575 <p>
576 <?php printf( __( '<a href="%s" target="_blank">Sprout Invoices</a> plugin is not installed. Please install the plugin first.', 'weforms' ), 'https://wordpress.org/plugins/sprout-invoices/' ); ?>
577 </p>
578
579 <?php } else { ?>
580
581 <div class="wpuf-int-form-row">
582 <div class="wpuf-int-field-label">
583 <label for="sprout-invoices-doctype"><?php _e( 'Create New', 'weforms' ); ?></label>
584 </div>
585 <div class="wpuf-int-field">
586 <select v-model="settings.doctype">
587 <option value="estimate"><?php _e( 'Quote', 'weforms' ) ?></option>
588 <option value="invoice"><?php _e( 'Invoice', 'weforms' ) ?></option>
589 <option value="client"><?php _e( 'Client (only)', 'weforms' ) ?></option>
590 </select>
591 </div>
592 </div>
593
594
595 <fieldset>
596 <legend><?php _e( 'Mapping Fields', 'weforms' ); ?></legend>
597
598 <p class="description" style="padding: 0 0 10px 0;">
599 <?php _e( 'Please map the form input fields with Sprout Invoices fields', 'weforms' ); ?>
600 </p>
601
602 <div class="wpuf-int-form-row mapping-fields">
603 <div class="wpuf-int-field-label">
604 <label><?php _e( 'Invoice/Quote Title', 'default' ); ?></label>
605 </div>
606 <div class="wpuf-int-field">
607 <div class="wpuf-int-field-small">
608 <input type="email" class="regular-text" v-model="settings.fields.subject">
609 <wpuf-merge-tags v-on:insert="insertValue" field="subject"></wpuf-merge-tags>
610 </div>
611 </div>
612 </div>
613
614 <div class="wpuf-int-form-row mapping-fields">
615 <div class="wpuf-int-field-label">
616 <label><?php _e( 'Client Name', 'default' ); ?></label>
617 </div>
618 <div class="wpuf-int-field">
619 <div class="wpuf-int-field-small">
620 <input type="email" class="regular-text" v-model="settings.fields.client_name">
621 <wpuf-merge-tags v-on:insert="insertValue" field="client_name"></wpuf-merge-tags>
622 </div>
623 </div>
624 </div>
625
626 <div class="wpuf-int-form-row mapping-fields">
627 <div class="wpuf-int-field-label">
628 <label><?php _e( 'Email Address', 'default' ); ?></label>
629 </div>
630 <div class="wpuf-int-field">
631 <div class="wpuf-int-field-small">
632 <input type="email" class="regular-text" v-model="settings.fields.email">
633 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue"
634 field="email"></wpuf-merge-tags>
635 </div>
636 </div>
637 </div>
638
639 <div class="wpuf-int-form-row">
640 <div class="wpuf-int-field-label">
641 <label><?php _e( 'First Name', 'default' ); ?></label>
642 </div>
643 <div class="wpuf-int-field">
644 <div class="wpuf-int-field-small">
645 <input type="text" class="regular-text" v-model="settings.fields.first_name">
646 <wpuf-merge-tags v-on:insert="insertValue" field="first_name"></wpuf-merge-tags>
647 </div>
648 </div>
649 </div>
650
651 <div class="wpuf-int-form-row">
652 <div class="wpuf-int-field-label">
653 <label><?php _e( 'Last Name', 'default' ); ?></label>
654 </div>
655 <div class="wpuf-int-field">
656 <div class="wpuf-int-field-small">
657 <input type="text" class="regular-text" v-model="settings.fields.last_name">
658 <wpuf-merge-tags v-on:insert="insertValue" field="last_name"></wpuf-merge-tags>
659 </div>
660 </div>
661 </div>
662
663 <?php if (class_exists( 'WeForms_Pro' )) : ?>
664
665 <div class="wpuf-int-form-row">
666 <div class="wpuf-int-field-label">
667 <label><?php _e( 'Address', 'default' ); ?></label>
668 </div>
669 <div class="wpuf-int-field">
670 <div class="wpuf-int-field-small">
671 <input type="text" class="regular-text" v-model="settings.fields.address">
672 <wpuf-merge-tags v-on:insert="insertValue" field="address"></wpuf-merge-tags>
673 </div>
674 </div>
675 </div>
676
677 <?php endif ?>
678
679 <div class="wpuf-int-form-row">
680 <div class="wpuf-int-field-label">
681 <label><?php _e( 'Notes', 'default' ); ?></label>
682 </div>
683 <div class="wpuf-int-field">
684 <div class="wpuf-int-field-small">
685 <input type="text" class="regular-text" v-model="settings.fields.notes">
686 <wpuf-merge-tags v-on:insert="insertValue" field="notes"></wpuf-merge-tags>
687 </div>
688 </div>
689 </div>
690
691 <div class="wpuf-int-form-row">
692 <div class="wpuf-int-field-label">
693 <label><?php _e( 'Due Date', 'default' ); ?></label>
694 </div>
695 <div class="wpuf-int-field">
696 <div class="wpuf-int-field-small">
697 <input type="text" class="regular-text" v-model="settings.fields.duedate">
698 <wpuf-merge-tags filter="date_field" v-on:insert="insertValue"
699 field="duedate"></wpuf-merge-tags>
700 </div>
701 </div>
702 </div>
703
704 <div class="wpuf-int-form-row">
705 <div class="wpuf-int-field-label">
706 <label><?php _e( 'Quote/Invoice #', 'default' ); ?></label>
707 </div>
708 <div class="wpuf-int-field">
709 <div class="wpuf-int-field-small">
710 <input type="text" class="regular-text" v-model="settings.fields.number">
711 <wpuf-merge-tags v-on:insert="insertValue" field="number"></wpuf-merge-tags>
712 </div>
713 </div>
714 </div>
715
716
717 <div class="wpuf-int-form-row">
718 <div class="wpuf-int-field-label">
719 <label><?php _e( 'VAT Number', 'default' ); ?></label>
720 </div>
721 <div class="wpuf-int-field">
722 <div class="wpuf-int-field-small">
723 <input type="text" class="regular-text" v-model="settings.fields.vat">
724 <wpuf-merge-tags v-on:insert="insertValue" field="vat"></wpuf-merge-tags>
725 </div>
726 </div>
727 </div>
728
729 <div class="wpuf-int-form-row">
730 <div class="wpuf-int-field-label">
731 <label><?php _e( 'Line Items', 'default' ); ?></label>
732 </div>
733 <div class="wpuf-int-field">
734 <div class="wpuf-int-field-small">
735 <input type="text" class="regular-text" v-model="settings.fields.line_items">
736 <wpuf-merge-tags v-on:insert="insertValue"
737 field="line_items"></wpuf-merge-tags>
738 </div>
739 </div>
740 </div>
741
742 </fieldset>
743
744 <div class="wpuf-int-form-row">
745 <div class="wpuf-int-field">
746 <label for="create-client-and-user" class="weforms-switch">
747 <input type="checkbox" id="create-client-and-user" v-model="settings.create_user_and_client">
748 <span class="switch-slider round"></span>
749 <?php _e( 'Create Client and User', 'default' ); ?>
750 </label>
751 </div>
752 </div>
753
754 <div class="wpuf-int-form-row">
755 <div class="wpuf-int-field">
756 <label for="redirect" class="weforms-switch">
757 <input type="checkbox" id="redirect" v-model="settings.redirect">
758 <span class="switch-slider round"></span>
759 <?php _e( 'Redirect to Quote/Invoice after Submission', 'default' ); ?>
760 </label>
761 </div>
762 </div>
763
764 <?php } ?>
765 </div>
766 </script>
767
768 <script type="text/x-template" id="tmpl-wpuf-merge-tags">
769 <div class="wpuf-merge-tag-wrap">
770 <a href="#" v-on:click.prevent="toggleFields($event)" class="merge-tag-link" title="<?php echo esc_attr( 'Click to toggle merge tags', 'wpuf' ); ?>"><span class="dashicons dashicons-editor-code"></span></a>
771
772 <!-- <pre>{{ form_fields.length }}</pre> -->
773
774 <div class="wpuf-merge-tags">
775 <div class="merge-tag-section" v-if="!filter || filter !== 'no_fields' ">
776 <div class="merge-tag-head"><?php _e( 'Form Fields', 'wpuf' ); ?></div>
777
778 <ul>
779 <template v-if="form_fields.length">
780 <li v-for="field in form_fields">
781
782 <template v-if="field.template === 'name_field'">
783 <a href="#" v-on:click.prevent="insertField('name-full', field.name);">{{ field.label }}</a>
784 (
785 <a href="#" v-on:click.prevent="insertField('name-first', field.name);"><?php _e( 'first', 'wpuf' ); ?></a> |
786 <a href="#" v-on:click.prevent="insertField('name-middle', field.name);"><?php _e( 'middle', 'wpuf' ); ?></a> |
787 <a href="#" v-on:click.prevent="insertField('name-last', field.name);"><?php _e( 'last', 'wpuf' ); ?></a>
788 )
789 </template>
790
791 <template v-else-if="field.template === 'image_upload'">
792 <a href="#" v-on:click.prevent="insertField('image', field.name);">{{ field.label }}</a>
793 </template>
794
795 <template v-else-if="field.template === 'file_upload'">
796 <a href="#" v-on:click.prevent="insertField('file', field.name);">{{ field.label }}</a>
797 </template>
798
799 <a v-else href="#" v-on:click.prevent="insertField('field', field.name);">{{ field.label }} </a>
800
801 </li>
802 </template>
803 <li v-else>
804 <?php _e( 'No fields available', 'wpuf' ); ?>
805 </li>
806 </ul>
807 </div><!-- .merge-tag-section -->
808
809 <template v-if="!fieldsonly">
810
811 <?php
812 if ( function_exists( 'weforms_get_merge_tags' ) ) {
813 $merge_tags = weforms_get_merge_tags();
814
815 foreach ( $merge_tags as $section_key => $section ) {
816 ?>
817
818 <div class="merge-tag-section">
819 <div class="merge-tag-head"><?php echo $section['title']; ?></div>
820
821 <ul>
822 <?php foreach ( $section['tags'] as $key => $value ) { ?>
823 <li>
824 <a href="#" v-on:click.prevent="insertField('<?php echo $key; ?>');"><?php echo $value; ?></a>
825 </li>
826 <?php } ?>
827 </ul>
828 </div><!-- .merge-tag-section -->
829
830 <?php
831 }
832 }
833 ?>
834 </template>
835 </div><!-- .merge-tags -->
836 </div>
837 </script>
838
839 <script type="text/x-template" id="tmpl-wpuf-modal">
840 <div>
841 <div :class="['wpuf-form-template-modal', show ? 'show' : 'hide' ]">
842
843 <span class="screen-reader-text"><?php _e( 'Modal window. Press escape to close.', 'wpuf' ); ?></span>
844 <a href="#" class="close" v-on:click.prevent="closeModal()">× <span class="screen-reader-text"><?php _e( 'Close modal window', 'wpuf' ); ?></span></a>
845
846 <header class="modal-header">
847 <slot name="header"></slot>
848 </header>
849
850 <div :class="['content-container', this.$slots.footer ? 'modal-footer' : 'no-footer']">
851 <div class="content">
852 <slot name="body"></slot>
853 </div>
854 </div>
855
856 <footer v-if="this.$slots.footer">
857 <slot name="footer"></slot>
858 </footer>
859 </div>
860 <div :class="['wpuf-form-template-modal-backdrop', show ? 'show' : 'hide' ]"></div>
861 </div>
862 </script>
863
864 <script type="text/x-template" id="tmpl-wpuf-template-modal">
865 <div class="wefroms-form-templates">
866 <wpuf-modal :show.sync="show" :onClose="onClose">
867 <h2 slot="header">
868 <?php _e( 'Select a Template', 'weforms' ); ?>
869 <small><?php printf( __( 'Select from a pre-defined template or from a <a href="#" %s>blank form</a>', 'weforms' ), '@click.prevent="blankForm()"' ); ?></small>
870
871 <span class="choose-form-categroy">
872 <?php _e( 'Select Category', 'weforms' ); ?> &nbsp;
873 <select v-model="category">
874 <option value="all">All</option>
875 <?php
876 $registry = weforms()->templates->get_templates();
877 $categories = weforms_get_form_template_categories();
878 $colors = weforms_get_flat_ui_colors();
879
880 foreach ( $categories as $key => $category ) {
881 printf( '<option value="%s">%s</option>', $key, $category['name'] );
882 }
883 ?>
884 </select>
885 </span>
886 </h2>
887
888 <div slot="body">
889
890 <?php
891
892 // remove the blank form from index as it's handled separately
893 if ( array_key_exists( 'blank', $registry ) ) {
894 unset( $registry['blank'] );
895 }
896
897 foreach ( $categories as $category_id => $category ) {
898 ?>
899 <div class="clearfix" v-if="category=='<?php echo $category_id; ?>' || category=='all'">
900
901 <?php
902
903 printf( '<h2><i class="%s" style="color: %s"></i> &nbsp; %s</h2> <ul class="clearfix">', $category['icon'], $colors[array_rand( $colors )], $category['name'] );
904
905 if ( $category_id == 'default' ) {
906 ?>
907
908 <li class="blank-form">
909 <h3><?php _e( 'Blank Form', 'weforms' ); ?></h3>
910
911 <div class="blank-form-text">
912 <span class="dashicons dashicons-plus"></span>
913 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
914 </div>
915
916 <div class="form-create-overlay">
917
918 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
919 <br>
920 <button class="button button-primary" @click.prevent="blankForm($event.target)" title="<?php echo esc_attr( 'Blank Form' ); ?>">
921 <?php _e( 'Create Form', 'weforms' ); ?>
922 </button>
923 </div>
924 </li>
925
926 <?php
927 }
928
929 foreach ( $registry as $key => $template ) {
930 if ( $category_id !== $template->category ) {
931 continue;
932 }
933
934 $is_available = true;
935 $class = 'template-active';
936 $title = $template->title;
937 $image = $template->image ? $template->image : '';
938
939 if ( !$template->is_enabled() ) {
940 $title = __( 'This integration is not installed.', 'weforms' );
941 $class = 'template-inactive';
942 $is_available = false;
943 } ?>
944
945 <li class="<?php echo $class; ?>">
946 <h3><?php _e( $title, 'weforms' ); ?></h3>
947
948 <?php if ( $image ) {
949 printf( '<img src="%s" alt="%s">', $image, $title );
950 } ?>
951
952 <div class="form-create-overlay">
953
954 <div class="title"><?php echo $template->get_title(); ?></div>
955 <div class="description"><?php echo $template->get_description(); ?></div>
956 <br>
957
958 <button class="button button-primary" @click.prevent="createForm('<?php echo $key; ?>', $event.target)" title="<?php echo esc_attr( $title ); ?>" <?php echo $is_available ? '' : 'disabled="disabled"'; ?>>
959 <?php if ( $is_available ) { ?>
960 <?php _e( 'Create Form', 'weforms' ); ?>
961 <?php } else { ?>
962 <?php _e( 'Require Pro Upgrade', 'weforms' ); ?>
963 <?php } ?>
964 </button>
965 </div>
966 </li>
967 <?php
968 } ?>
969
970 </ul></div>
971
972 <?php
973 }
974 ?>
975 </div>
976 </wpuf-modal>
977 </div></script>
978
979 <script type="text/x-template" id="tmpl-wpuf-weforms-text-editor">
980 <div>
981 <textarea :value="value" :id="'wefroms-tinymce-' + editorId" rows="5"></textarea>
982 </div>
983 </script>
984