PluginProbe
UpStream: a Project Management Plugin for WordPress / trunk
UpStream: a Project Management Plugin for WordPress vtrunk
trunk 1.39.0 1.39.1 1.39.2 1.39.3 2.0.7 2.1.0
upstream / templates / report-parameters / search-fields.php

search-fields.php in UpStream: a Project Management Plugin for WordPress trunk, at templates/report-parameters/search-fields.php

64 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Report parameter template: search-fields
4 *
5 * @package UpStream
6 */
7
8 // Prevent direct access.
9 if ( ! defined( 'ABSPATH' ) || ! isset( $section_id ) ) {
10 exit;
11 }
12
13 $users_info = upstream_get_viewable_users();
14
15 $users = $users_info['by_uid'];
16
17 foreach ( $fields as $field_name => $field ) :
18 $fname = 'upstream_report__' . $section_id . '_' . $field_name;
19
20 if ( $field['display'] ) {
21 $display_fields[ $field_name ] = $field['title'];
22 }
23 if ( ! $field['search'] ) {
24 continue;
25 }
26 ?>
27 <div class="row">
28
29 <div class="col-lg-12 col-xs-12">
30 <div class="form-group">
31 <label><?php echo esc_html( $field['title'] ); ?></label>
32
33 <?php if ( 'string' === $field['type'] || 'text' === $field['type'] ) : ?>
34 <input class="form-control" type="text" name="<?php print esc_attr( $fname ); ?>">
35 <?php elseif ( 'user_id' === $field['type'] ) : ?>
36 <select class="form-control" name="<?php print esc_attr( $fname ); ?>[]" multiple>
37 <?php foreach ( $users as $user_id => $username ) : ?>
38 <option value="<?php echo esc_attr( $user_id ); ?>"><?php echo esc_html( $username ); ?></option>
39 <?php endforeach; ?>
40 </select>
41 <?php elseif ( 'select' === $field['type'] ) : ?>
42 <select class="form-control" name="<?php print esc_attr( $fname ); ?>[]" multiple>
43 <?php foreach ( call_user_func( $field['options_cb'] ) as $key => $value ) : ?>
44 <option value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value ); ?></option>
45 <?php endforeach; ?>
46 </select>
47 <?php elseif ( 'number' === $field['type'] ) : ?>
48 Between
49 <input type="text" name="<?php print esc_attr( $fname ); ?>_lower"> and
50 <input type="text" name="<?php print esc_attr( $fname ); ?>_upper">
51 <input type="hidden" name="<?php print esc_attr( $fname ); ?>" value="number">
52 <?php elseif ( 'date' === $field['type'] ) : ?>
53 Between
54 <input type="text" class="r-datepicker" name="<?php print esc_attr( $fname ); ?>_start"> and
55 <input type="text" class="r-datepicker" name="<?php print esc_attr( $fname ); ?>_end">
56 <input type="hidden" name="<?php print esc_attr( $fname ); ?>" value="date">
57 <?php endif; ?>
58 </div>
59 </div>
60 </div>
61 <?php
62
63 endforeach;
64