diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index 938af64009..9437eec4fe 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -4583,6 +4583,27 @@ $text['label-custom']['ru-ru'] = ""; $text['label-custom']['sv-se'] = ""; $text['label-custom']['uk-ua'] = ""; +$text['label-fields']['en-us'] = "Fields"; +$text['label-fields']['en-gb'] = "Fields"; +$text['label-fields']['ar-eg'] = "Fields"; +$text['label-fields']['de-at'] = "Fields"; +$text['label-fields']['de-ch'] = "Fields"; +$text['label-fields']['de-de'] = "Fields"; +$text['label-fields']['es-cl'] = "Fields"; +$text['label-fields']['es-mx'] = "Fields"; +$text['label-fields']['fr-ca'] = "Fields"; +$text['label-fields']['fr-fr'] = "Fields"; +$text['label-fields']['he-il'] = "Fields"; +$text['label-fields']['it-it'] = "Fields"; +$text['label-fields']['nl-nl'] = "Fields"; +$text['label-fields']['pl-pl'] = "Fields"; +$text['label-fields']['pt-br'] = "Fields"; +$text['label-fields']['pt-pt'] = "Fields"; +$text['label-fields']['ro-ro'] = "Fields"; +$text['label-fields']['ru-ru'] = "Fields"; +$text['label-fields']['sv-se'] = "Fields"; +$text['label-fields']['uk-ua'] = "Fields"; + $text['header-device_import']['en-us'] = "Device Import"; $text['header-device_import']['en-gb'] = "Device Import"; $text['header-device_import']['ar-eg'] = ""; diff --git a/app/devices/device_profiles.php b/app/devices/device_profiles.php index baf3587850..023983e145 100644 --- a/app/devices/device_profiles.php +++ b/app/devices/device_profiles.php @@ -49,6 +49,10 @@ $profiles = $_POST['profiles']; } +//get the search + $search = strtolower($_REQUEST["search"]); + $fields = strtolower($_REQUEST["fields"]); + //process the http post data by action if ($action != '' && is_array($profiles) && @sizeof($profiles) != 0) { switch ($action) { @@ -72,7 +76,7 @@ break; } - header('Location: device_profiles.php'.($search != '' ? '?search='.urlencode($search) : null)); + header('Location: device_profiles.php'.($search != '' ? '?search='.urlencode($search).'&fields='.urlencode($fields) : null)); exit; } @@ -81,22 +85,25 @@ $order = $_GET["order"]; //add the search term - $search = strtolower($_GET["search"]); if (strlen($search) > 0) { $sql_search = "and ("; $sql_search .= " lower(device_profile_name) like :search "; $sql_search .= " or lower(device_profile_description) like :search "; - $sql_search .= " or device_profile_uuid in ( "; - $sql_search .= " select dpk.device_profile_uuid from v_device_profile_keys as dpk "; - $sql_search .= " where dpk.profile_key_value like :search "; - $sql_search .= " or dpk.profile_key_label like :search "; - $sql_search .= " ) "; - $sql_search .= " or device_profile_uuid in ( "; - $sql_search .= " select dps.device_profile_uuid from v_device_profile_settings as dps "; - $sql_search .= " where dps.profile_setting_name like :search "; - $sql_search .= " or dps.profile_setting_value like :search "; - $sql_search .= " or dps.profile_setting_description like :search "; - $sql_search .= " ) "; + if ($fields == 'all' || $fields == 'keys') { + $sql_search .= " or device_profile_uuid in ( "; + $sql_search .= " select dpk.device_profile_uuid from v_device_profile_keys as dpk "; + $sql_search .= " where dpk.profile_key_value like :search "; + $sql_search .= " or dpk.profile_key_label like :search "; + $sql_search .= " ) "; + } + if ($fields == 'all' || $fields == 'settings') { + $sql_search .= " or device_profile_uuid in ( "; + $sql_search .= " select dps.device_profile_uuid from v_device_profile_settings as dps "; + $sql_search .= " where dps.profile_setting_name like :search "; + $sql_search .= " or dps.profile_setting_value like :search "; + $sql_search .= " or dps.profile_setting_description like :search "; + $sql_search .= " ) "; + } $sql_search .= ") "; $parameters['search'] = '%'.$search.'%'; } @@ -114,7 +121,10 @@ //prepare to page the results $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50; - $param = "&search=".$search; + if ($search) { + $param = "&search=".$search; + $param .= "&fields=".$fields; + } if ($_GET['show'] == "all" && permission_exists('device_profile_all')) { $param .= "&show=all"; } @@ -166,7 +176,15 @@ echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']); } } - echo ""; + + echo ""; + echo ""; echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]); echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'device_profiles.php','style'=>($search == '' ? 'display: none;' : null)]); if ($paging_controls_mini != '') { @@ -193,6 +211,7 @@ echo "