1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-23 05:54:03 +01:00

Fix categorie allegati

This commit is contained in:
Thomas Zilio 2018-10-31 17:46:59 +01:00
parent fdcc16cf14
commit fb2887916e
2 changed files with 5 additions and 3 deletions

View File

@ -39,9 +39,9 @@ if (!function_exists('array_clean')) {
*/
function array_clean($array)
{
return array_filter($array, function ($value) {
return array_values(array_filter($array, function ($value) {
return !empty($value);
});
}));
}
}

View File

@ -183,13 +183,15 @@ class FileManager implements ManagerInterface
</div>';
}
$source = array_clean(array_column($categories, 'category'));
$result .= '
<script src="'.ROOTDIR.'/lib/init.js"></script>
<script>
$(document).ready(function(){
$("#'.$attachment_id.' #categoria").autocomplete({
source: '.json_encode(array_column($categories, 'category')).',
source: '.json_encode($source).',
minLength: 0
}).focus(function() {
$(this).autocomplete("search", $(this).val())