Skip to content

Commit

Permalink
Fix search on computer details activated packages table
Browse files Browse the repository at this point in the history
  • Loading branch information
charleneauger committed Jul 18, 2023
1 parent 12b4da9 commit 74280aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
$list_col_cant_del = $list_fields;
$default_fields = $list_col_cant_del;

$queryDetails = "SELECT a.name, IFNULL(d.tvalue, '%s') as tvalue,d.ivalue,IFNULL(STR_TO_DATE(d.comments, '%s'), '%s') as comments,e.fileid, e.pack_loc,h.name as name_server,h.id,a.comment, CONCAT(d.ivalue,';',d.tvalue) as status
$queryDetails = "SELECT a.name as name, IFNULL(d.tvalue, '%s') as tvalue,d.ivalue,IFNULL(STR_TO_DATE(d.comments, '%s'), '%s') as comments,e.fileid, e.pack_loc,h.name as name_server,h.id,a.comment, CONCAT(d.ivalue,';',d.tvalue) as status
FROM devices d left join download_enable e on e.id=d.ivalue
LEFT JOIN download_available a ON e.fileid=a.fileid
LEFT JOIN hardware h on h.id=e.server_id
WHERE d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=%s
UNION
SELECT '%s', IFNULL(d.tvalue, '%s') as tvalue,d.ivalue,IFNULL(STR_TO_DATE(d.comments, '%s'), '%s') as comments,e.fileid, '%s',h.name,h.id,a.comment, CONCAT(d.ivalue,';',d.tvalue) as status
SELECT IFNULL(a.name, '%s') as name, IFNULL(d.tvalue, '%s') as tvalue,d.ivalue,IFNULL(STR_TO_DATE(d.comments, '%s'), '%s') as comments,e.fileid, '%s',h.name,h.id,a.comment, CONCAT(d.ivalue,';',d.tvalue) as status
FROM devices d left join download_enable e on e.id=d.ivalue
LEFT JOIN download_available a ON e.fileid=a.fileid
LEFT JOIN hardware h on h.id=e.server_id
Expand All @@ -96,6 +96,7 @@
$tab_options['ARG_SQL'] = $arg;

$tab_options['NO_SEARCH']['pack_loc'] = 'pack_loc';
$tab_options['SPECIAL_SEARCH'] = "COMP_DEPLOY";

ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del);

Expand Down
6 changes: 6 additions & 0 deletions require/function_table_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,12 @@ function ajaxfiltre($queryDetails,$tab_options){
$index++;
}
}
// Special process for computer details teledeploy query
if(isset($tab_options['SPECIAL_SEARCH']) && $tab_options['SPECIAL_SEARCH'] == "COMP_DEPLOY" && !is_null($filter)) {
$explodeQuery = explode("d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=%s", $queryDetails);
$queryDetails = $explodeQuery[0]."d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=%s HAVING".$filter.")".$explodeQuery[1];
}

$queryDetails .= $filter.") ";
}
return $queryDetails;
Expand Down

0 comments on commit 74280aa

Please sign in to comment.