|
|
@@ -452,7 +452,10 @@ class ProcesHelper {
|
|
|
if (is_array($id_zasob)) {
|
|
|
$sqlFilter = " cw.ID_ZASOB in ".implode(',', $id_zasob);
|
|
|
}
|
|
|
- $sql = "select
|
|
|
+ return array_map(function ($row) {
|
|
|
+ return $row['ID_PROCES_INIT'];
|
|
|
+ }, DB::getPDO()->fetchAll("
|
|
|
+ select
|
|
|
cps.ID_PROCES_INIT
|
|
|
, cw.ID_PROCES
|
|
|
from CRM_WSKAZNIK as cw
|
|
|
@@ -460,18 +463,11 @@ class ProcesHelper {
|
|
|
where cw.A_STATUS in('NORMAL', 'WAITING')
|
|
|
and cps.ID_PROCES_INIT > 0 and
|
|
|
{$sqlFilter}
|
|
|
- ";
|
|
|
- $res = $db->query($sql);
|
|
|
- while ($h = $db->fetch($res)) {
|
|
|
- $ret[] = $h->ID_PROCES_INIT;
|
|
|
- }
|
|
|
- return $ret;
|
|
|
+ "));
|
|
|
}
|
|
|
|
|
|
public static function getZasobTableInfo($idTable) {
|
|
|
- $tableInfo = null;
|
|
|
- $db = DB::getDB();
|
|
|
- $sql = <<<SQL
|
|
|
+ return (object)DB::getPDO()->fetchFirst("
|
|
|
select tv.`ID_TABLE` as `ID`
|
|
|
, tv.`TABLE_NAME` as `DESC`
|
|
|
, tv.`TABLE_LABEL` as `DESC_PL`
|
|
|
@@ -483,12 +479,7 @@ class ProcesHelper {
|
|
|
join `CRM_LISTA_ZASOBOW` as zpp on(zpp.`ID`=tv.`ID_DATABASE`)
|
|
|
where tv.`ID_TABLE`='{$idTable}'
|
|
|
limit 1
|
|
|
-SQL;
|
|
|
- $res = $db->query($sql);
|
|
|
- if ($res) {
|
|
|
- $tableInfo = $db->fetch($res);
|
|
|
- }
|
|
|
- return $tableInfo;
|
|
|
+ ");
|
|
|
}
|
|
|
|
|
|
public static function getZasobTableInfoByUri($uri) {
|
|
|
@@ -537,38 +528,25 @@ SQL;
|
|
|
}
|
|
|
|
|
|
public static function getZasobInfo($zasobID) {
|
|
|
- $zasobObj = null;
|
|
|
- $db = DB::getDB();
|
|
|
- $sql = "select z.`ID`, z.`DESC`, z.`DESC_PL`, z.`OPIS`, z.`TYPE`
|
|
|
+ return (object)DB::getPDO()->fetchFirst("
|
|
|
+ select z.`ID`, z.`DESC`, z.`DESC_PL`, z.`OPIS`, z.`TYPE`
|
|
|
, zp.`ID` as P__ID
|
|
|
, zp.`DESC` as P__DESC
|
|
|
, zp.`TYPE` as P__TYPE
|
|
|
from `CRM_LISTA_ZASOBOW` as z
|
|
|
left join `CRM_LISTA_ZASOBOW` as zp on(zp.`ID`=z.`PARENT_ID`)
|
|
|
where z.`ID`='{$zasobID}'
|
|
|
- ";
|
|
|
- $res = $db->query($sql);
|
|
|
- if ($res) {
|
|
|
- $zasobObj = $db->fetch($res);
|
|
|
- }
|
|
|
- return $zasobObj;
|
|
|
+ ");
|
|
|
}
|
|
|
|
|
|
public static function getZasobTableID($tblName) {
|
|
|
- $zasobID = 0;
|
|
|
- $db = DB::getDB();
|
|
|
- $sql = "select z.`ID`
|
|
|
+ return DB::getPDO()->fetchValue("
|
|
|
+ select z.`ID`
|
|
|
from `CRM_LISTA_ZASOBOW` as z
|
|
|
where z.`DESC`='{$tblName}'
|
|
|
and z.`TYPE`='TABELA'
|
|
|
and z.`A_STATUS` in('NORMAL','WAITING')
|
|
|
- ";
|
|
|
- $res = $db->query($sql);
|
|
|
- if ($res) {
|
|
|
- $r = $db->fetch($res);
|
|
|
- $zasobID = $r->ID;
|
|
|
- }
|
|
|
- return $zasobID;
|
|
|
+ ");
|
|
|
}
|
|
|
|
|
|
}
|