|
|
@@ -1,8 +1,10 @@
|
|
|
<?php
|
|
|
|
|
|
+Lib::loadClass('UI');
|
|
|
+
|
|
|
class ProjectKosztorysSchema {
|
|
|
|
|
|
- public static function getSchema() {
|
|
|
+ public static function getSchema($showErrors = false) {
|
|
|
static $_schema = null;
|
|
|
if (null !== $_schema) return $_schema;
|
|
|
/*
|
|
|
@@ -110,11 +112,11 @@ class ProjectKosztorysSchema {
|
|
|
if (('INNE' == $z['TYPE']) or ('TYP_KOSZTU' == $z['TYPE'])) {
|
|
|
} else if ('TABELA' == $z['TYPE']) {
|
|
|
} else {
|
|
|
- SE_Layout::alert('warnig', "BUG: unimplemented type '{$z['TYPE']}' for zasob nr: {$z['ID']}");
|
|
|
+ if ($showErrors) UI::alert('warnig', "BUG: unimplemented type '{$z['TYPE']}' for zasob nr: {$z['ID']}");
|
|
|
}
|
|
|
}
|
|
|
DBG::_('DBG', '>1', "config", $conf, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
- {// validate schema - show warnings
|
|
|
+ if ($showErrors) {// validate schema - show warnings
|
|
|
foreach ($conf['layer'] as $layer) {
|
|
|
try {
|
|
|
if (empty($layer['tabela_id'])) throw new Exception("brak zdefiniowanego aliasa do tabeli dla warstwy {$layer['label']}");
|
|
|
@@ -125,7 +127,7 @@ class ProjectKosztorysSchema {
|
|
|
default: throw new Exception("Nieznana jednostka '{$layer['jednostka']}' dla warstwy [{$layer['tabela_id']}] {$layer['label']}");
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
- SE_Layout::alert('warning', $e->getMessage());
|
|
|
+ UI::alert('warning', $e->getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|