| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <?php
- class Route_UrlAction_defaultIn7MkBazaDystrybucji extends RouteBase {
- private $OBJECT;
- private $TABLE = 'IN7_MK_BAZA_DYSTRYBUCJI';
- public function handleAuth() {
- if (!User::logged()) {
- User::authByRequest();
- }
- }
- public function defaultAction() {
- SE_Layout::gora();
- SE_Layout::menu();
- try {
- if (!($ID = V::get("ID_{$this->TABLE}", 0, $_GET, 'int'))) throw new Exception("Błąd parametru");
- if (!(DB::getPDO()->fetchValue("select count(*) from `{$this->TABLE}` where `ID` = {$ID}"))) throw new Exception("Nie znaleziono rekordu");
- $result = ACL::getAclByNamespace("default_db/{$this->TABLE}")->buildQuery(['f_ID' => "$ID", 'limit' => 1])->getItems();
- // if (!$result) $result = ACL::getAclByNamespace("default_db/{$this->TABLE}/{$this->TABLE}")->buildQuery(['f_ID' => "$ID", 'limit' => 1])->getItems();
- if (!$result) throw new Exception("Brak uprawnień");
- $this->OBJECT = $result[0];
- switch ($this->OBJECT['A_STATUS']) {
- case "WAITING":
- $this->test();
- break;
- case "NORMAL":
- $this->test();
- break;
- case "OFF_HARD":
- $this->test();
- break;
- default:
- $this->test();
- //SE_Layout::alert('danger', "Błędny status rekordu.");
- }
- } catch (Exception $e) {
- SE_Layout::alert('danger', $e->getMessage());
- }
- SE_Layout::dol();
- }
-
-
-
- private function test() {
-
- ?>
- <hr>
- TODO:
- <hr>
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Relacje do dzieci
- </td>
- <td>Check minOccurs
- </td>
- <td>Check maxOccurs
- </td>
-
- </tr>
- </table>
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Relacje do rodzicow following/sibling
- </td>
- <td>Check minOccurs
- </td>
- <td>Check maxOccurs
- </td>
-
- </tr>
- </table>
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Relacje akcje
- </td>
- <td>Dowiaz istniejacy brakujacy wymagany obiekt
- </td>
- <td>Dodaj brakujacy obiekt poprzez utworzenie nowego
- </td>
-
- </tr>
- </table>
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Elementy lokalne
- </td>
- <td>Wskaz brakujace elementy nie wypelnione
- </td>
- <td>Wskaz elementy ktore sa niewlasciwie wypelnione - nie powinno ich byc
- </td>
- <td>Wskaz elementy ktore sa niewlasciwie wypelnione - zla treść
- </td>
-
- </tr>
- </table>
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Elementy lokalne - zaleznosci matematyczne assert - wartosci pojedyncze
- </td>
- <td>Wskaz brakujace elementy nie obliczone
- </td>
- <td>Wskaz bledne zaleznosci obliczen - lokalna wartość niezgodna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie istnieje
- </td>
-
- </tr>
- </table>
-
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Elementy lokalne - zaleznosci matematyczne assert - sumy
- </td>
- <td>Wskaz brakujace elementy nie obliczone
- </td>
- <td>Wskaz bledne zaleznosci obliczen - lokalna wartość niezgodna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie kompletna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie istnieje
- </td>
- </tr>
- </table>
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Elementy lokalne - zaleznosci matematyczne assert - sumy
- </td>
- <td>Wskaz brakujace elementy nie obliczone
- </td>
- <td>Wskaz bledne zaleznosci obliczen - lokalna wartość niezgodna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie kompletna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie istnieje
- </td>
- </tr>
- </table>
-
- <table border="1" cellpadding="1" cellspacing="3">
- <tr>
- <td>Elementy zdalne - zaleznosci matematyczne assert - sumy
- </td>
- <td>Wskaz brakujace elementy nie obliczone
- </td>
- <td>Wskaz bledne zaleznosci obliczen - lokalna wartość niezgodna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie kompletna
- </td>
- <td>Wskaz bledne zaleznosci obliczen - zdalna wartość nie istnieje
- </td>
- </tr>
- </table>
- <hr>
- 1. Tu potrzebuje wywolac dane z recurse 1 lub 2
- <hr>
- <hr>
- 2. Potrzebuje dostep do struktury xsd obiektu - plik xsd, dostep do danych z rekordu - moze transakcja pociagnac
- <hr>
- <hr>
- 3. Potrzebuje wywolac XSLT i wywalic jego output
- <hr>
- <hr>
- 4. wyswietlic plik wygenerowny przez xslt
- <hr>
- <hr>
- 5. komunikacja - wynik z XSLT do GUI, GUI akcja do XSLT i nowy wynik - w kolko
- <hr>
-
- <?
- echo "<pre>";
- print_r($this->OBJECT);
- $namespace = 'default_db/IN7_MK_BAZA_DYSTRYBUCJI/IN7_MK_BAZA_DYSTRYBUCJI';
- $item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
- print_r($item);
- echo "</pre>";
- }
-
-
-
- public static function getRefTables($tableFrom) { //copied from BiAuditGenerate.php
- static $refTables = [];
- if (!isset($refTables[$tableFrom])) {
- $namespace = "default_db/{$tableFrom}/{$tableFrom}";
- try {
- $item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
- if (!($item['hasStruct'] && $item['isStructInstalled'] && $item['isObjectActive'])) throw new Exception("Object error");
- $fields = $item['field'];
- $_refTables = [];
- foreach ($fields as $field) {
- list($type, $child) = explode(":", $field['xsdType'], 2);
- if ($type == "ref" && $field['idZasob'] && $field['isActive'] && (!$field['isLocal'])) {
- try {
- $_refTable = ACL::getRefTable($namespace, $child);
- $_refTables[] = $_refTable;
- } catch (Exception $e) {
- }
- }
- }
- $refTables[$tableFrom] = $_refTables;
- } catch (Exception $e) {
- $refTables[$tableFrom] = [];
- }
- }
- return $refTables[$tableFrom];
- }
-
-
- }
|