Rev 1148 | Rev 1189 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1148 | Rev 1156 | ||
---|---|---|---|
Line 844... | Line 844... | ||
844 | $res = OIDplus::db()->query("select * from ###objects where " . |
844 | $res = OIDplus::db()->query("select * from ###objects where " . |
845 | "parent = ? or " . |
845 | "parent = ? or " . |
846 | "id = ? or " . |
846 | "id = ? or " . |
847 | "id = ? ", array($req_goto, $req_goto, $parent)); |
847 | "id = ? ", array($req_goto, $req_goto, $parent)); |
848 | } |
848 | } |
849 | $res = new OIDplusNaturalSortedQueryResult($res, 'id'); |
849 | $res->naturalSortByField('id'); |
850 | 850 | ||
851 | $z_used = 0; |
851 | $z_used = 0; |
852 | $y_used = 0; |
852 | $y_used = 0; |
853 | $x_used = 0; |
853 | $x_used = 0; |
854 | $stufe = 0; |
854 | $stufe = 0; |
Line 1008... | Line 1008... | ||
1008 | 1008 | ||
1009 | $result = OIDplus::db()->query("select o.*, r.ra_name " . |
1009 | $result = OIDplus::db()->query("select o.*, r.ra_name " . |
1010 | "from ###objects o " . |
1010 | "from ###objects o " . |
1011 | "left join ###ra r on r.email = o.ra_email " . |
1011 | "left join ###ra r on r.email = o.ra_email " . |
1012 | "where parent = ? ", array($parent)); |
1012 | "where parent = ? ", array($parent)); |
1013 | $result = new OIDplusNaturalSortedQueryResult($result, 'id'); |
1013 | $result->naturalSortByField('id'); |
1014 | 1014 | ||
1015 | $rows = array(); |
1015 | $rows = array(); |
1016 | while ($row = $result->fetch_object()) { |
1016 | while ($row = $result->fetch_object()) { |
1017 | $obj = OIDplusObject::parse($row->id); |
1017 | $obj = OIDplusObject::parse($row->id); |
1018 | if ($obj) $rows[] = array($obj,$row); |
1018 | if ($obj) $rows[] = array($obj,$row); |
Line 1340... | Line 1340... | ||
1340 | * @throws OIDplusException |
1340 | * @throws OIDplusException |
1341 | */ |
1341 | */ |
1342 | public function getNotifications(string $user=null): array { |
1342 | public function getNotifications(string $user=null): array { |
1343 | $notifications = array(); |
1343 | $notifications = array(); |
1344 | $res = OIDplus::db()->query("select id, title from ###objects"); |
1344 | $res = OIDplus::db()->query("select id, title from ###objects"); |
1345 | $res = new OIDplusNaturalSortedQueryResult($res, 'id'); |
1345 | $res->naturalSortByField('id'); |
1346 | if ($res->any()) { |
1346 | if ($res->any()) { |
1347 | $is_admin_logged_in = OIDplus::authUtils()->isAdminLoggedIn(); // run just once, for performance |
1347 | $is_admin_logged_in = OIDplus::authUtils()->isAdminLoggedIn(); // run just once, for performance |
1348 | while ($row = $res->fetch_array()) { |
1348 | while ($row = $res->fetch_array()) { |
1349 | if (empty($row['title'])) { |
1349 | if (empty($row['title'])) { |
1350 | if ($user === 'admin') { |
1350 | if ($user === 'admin') { |