|
|
@@ -799,13 +799,14 @@ function task_CRM_MENU() {
|
|
|
|
|
|
|
|
|
function this_user_menu_tree_fetch_data(&$user_menu, $user_menu_tree_flat, $selected_stanowiska) {
|
|
|
+ $db = DB::getDB();
|
|
|
$sql_ids = array();
|
|
|
$sql_ids = array_keys($user_menu_tree_flat);
|
|
|
// add tree parent proces info
|
|
|
if (!empty($sql_ids)) {
|
|
|
$sql = "select * from `CRM_PROCES` as p where p.`ID` in (".implode(", ", $sql_ids)."); ";
|
|
|
- $res = DB::query( $sql );
|
|
|
- while ($r = DB::fetch( $res )) {
|
|
|
+ $res = $db->query($sql);
|
|
|
+ while ($r = $db->fetch($res)) {
|
|
|
$user_menu[$r->ID] = $r;
|
|
|
}
|
|
|
}
|
|
|
@@ -813,12 +814,9 @@ function task_CRM_MENU() {
|
|
|
if (empty($sql_ids)) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!empty($selected_stanowiska)) {
|
|
|
- return;
|
|
|
- }
|
|
|
$sql_only_stanowiska = "";
|
|
|
if (!empty($selected_stanowiska)) {
|
|
|
- //$sql_only_stanowiska = "and z.`ID` in(" . implode(",", $selected_stanowiska) . ")";
|
|
|
+ $sql_only_stanowiska = "and z.`ID` in(" . implode(",", $selected_stanowiska) . ")";
|
|
|
}
|
|
|
$sql = "select
|
|
|
w.`ID` as w_ID
|
|
|
@@ -826,18 +824,18 @@ function task_CRM_MENU() {
|
|
|
, z.`ID`
|
|
|
, z.`TYPE`
|
|
|
, z.`DESC`
|
|
|
- , z.`OPIS`
|
|
|
+ -- , z.`OPIS`
|
|
|
+ , w.`OPIS_ZASOB` as `OPIS`
|
|
|
from `CRM_WSKAZNIK` as w
|
|
|
left join `CRM_LISTA_ZASOBOW` as z on(z.`ID`=w.`ID_ZASOB`)
|
|
|
where
|
|
|
w.`ID_PROCES` in (".implode(", ", $sql_ids).")
|
|
|
and w.`A_STATUS` in('WAITING','NORMAL','MONITOR')
|
|
|
- and w.`ID_PRZYPADEK`=1
|
|
|
and z.`TYPE`='STANOWISKO'
|
|
|
" . $sql_only_stanowiska . "
|
|
|
";
|
|
|
- $res = DB::query( $sql );
|
|
|
- while ($r = DB::fetch( $res )) {
|
|
|
+ $res = $db->query($sql);
|
|
|
+ while ($r = $db->fetch($res)) {
|
|
|
$user_menu[$r->w_ID_PROCES]->KTO []= $r;
|
|
|
}
|
|
|
}
|