Plugin Directory

Changeset 2672151


Ignore:
Timestamp:
02/03/2022 12:01:57 PM (4 years ago)
Author:
liedekef
Message:

custom field of type "People" can now be in more group than one as a field condition

Location:
events-made-easy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • events-made-easy/trunk/eme_formfields.php

    r2671376 r2672151  
    7373     if (isset($_POST['field_purpose']))
    7474         $formfield['field_purpose'] = trim(eme_sanitize_request($_POST['field_purpose']));
    75          $formfield['field_condition'] = trim(eme_sanitize_request($_POST['field_condition']));
     75     $formfield['field_condition'] = join(',',eme_sanitize_request($_POST['field_condition']));
    7676         if (eme_is_multifield($formfield['field_type']) && empty($formfield['field_values'])) {
    7777            $message = __('Error: the field value can not be empty for this type of field.','events-made-easy');
     
    282282   }
    283283
     284   $field_condition_arr=explode(',',$formfield['field_condition']);
    284285   $layout .= "
    285286            </tr>
     
    292293            <tr id='tr_field_condition' class='form-field'>
    293294               <th scope='row' style='vertical-align:top'><label for='field_condition'>".__('Field condition', 'events-made-easy')."</label></th>
    294                <td>".eme_ui_select($formfield['field_condition'],"field_condition",$peoplefieldconditions)."
     295               <td>".eme_ui_multiselect($field_condition_arr,"field_condition",$peoplefieldconditions,5,'',0," eme_select2_width50_class")."
    295296                   <br />".__('Only show this field if the person is member of the selected group. Leave empty to add this field to all people.','events-made-easy')."
    296297               </td>
     
    15651566   global $wpdb;
    15661567   $formfields_table = $wpdb->prefix.FORMFIELDS_TBNAME;
    1567    $sql = $wpdb->prepare("SELECT * FROM $formfields_table where field_purpose='people' AND field_condition=%s",$condition);
     1568   $sql = $wpdb->prepare("SELECT * FROM $formfields_table where field_purpose='people' AND FIND_IN_SET(%s,field_condition)",$condition);
    15681569   return $wpdb->get_results($sql,ARRAY_A);
    15691570}
  • events-made-easy/trunk/readme.txt

    r2671663 r2672151  
    8383
    8484== Changelog ==
     85= 2.2.54 (2022//) =
     86* A custom field of type "People" can now be in more group than one as a field condition, meaning the field will then appear for all people in one of the selected groups when editing a person
     87
    8588= 2.2.54 (2022/02/02) =
    8689* Add order param for multibooking form shortcodes (only has effect when using together with scope or category_id options)
Note: See TracChangeset for help on using the changeset viewer.