|
|
@@ -1126,13 +1126,14 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
// console.log('FieldWidget: generate function to render field('+_fieldName+') fieldProps: ', fieldProps);
|
|
|
return function(val, fieldPK, row) {
|
|
|
// console.log('FieldWidget: pk('+fieldPK+') run function to render field('+_fieldName+') with value: ', val, ', fieldProps: ', fieldProps);
|
|
|
+ // if (val.length > 5) return '('+val.length+')' + printFirst5 + '...' => open more info
|
|
|
return _.map(val, function(v) {
|
|
|
if (!v || !v.xlink) return '';
|
|
|
var idRemote = v.xlink.split('.').pop()
|
|
|
var nsRemote = v.xlink.split(':').pop().split('.').shift()
|
|
|
- var seLink = '<?= Request::getPathUri(); ?>index.php?_route=ViewTableAjax&namespace=' + fieldProps.xsdRefNsPrefix + '/' + nsRemote + '#EDIT/' + idRemote;
|
|
|
+ var seLink = '<?= Request::getPathUri(); ?>index.php?_route=ViewTableAjax&namespace=' + fieldProps.xsdRefNsPrefix.replace(/__x3A__/g, '/') + '/' + nsRemote + '#EDIT/' + idRemote;
|
|
|
var wfsLink = fieldProps.xsdRefUri + '#' + fieldProps.xsdRefType + '.' + idRemote;
|
|
|
- return '<a href="' + seLink + '" title="' + wfsLink + '">' + v.xlink + '</a>';
|
|
|
+ return '<a class="btn btn-xs btn-default" href="' + seLink + '" title="' + wfsLink + '">' + idRemote + '</a>';
|
|
|
}).join(' ');
|
|
|
}
|
|
|
}(fldName, fieldProps));
|
|
|
@@ -1158,8 +1159,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
|
|
|
priv.renderRow = function(props) {
|
|
|
var rowNode = $('<tr></tr>'),
|
|
|
- uniqueColName = _state.primaryKey,
|
|
|
- rowPK = (uniqueColName in props)? props[uniqueColName] : null,
|
|
|
+ rowPK = (_state.primaryKey in props) ? props[_state.primaryKey] : null,
|
|
|
cellNode,
|
|
|
columnName, columnProps, val, cellCnt, format, showTooltip, fldWidgetNode,
|
|
|
dbg = priv.options.debug
|
|
|
@@ -1179,7 +1179,7 @@ var p5UI_TableAjax_generateFunctionNode = function(funObj, rowPK, props) {
|
|
|
$(p5Utils__format('<input class="unique" {0} {1} type="checkbox" />', [check, checkable])).appendTo(cellNode);
|
|
|
}
|
|
|
|
|
|
- if (uniqueColName) rowNode.data('unique', rowPK);
|
|
|
+ if (_state.primaryKey) rowNode.data('unique', rowPK);
|
|
|
|
|
|
//create cells
|
|
|
for (var i = 0; i < _state.colsSorted.length; i++) {
|
|
|
@@ -4283,7 +4283,7 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
|
|
|
if ($DBG) echo "fieldID: {$fieldID}\n";
|
|
|
|
|
|
- $row = $this->_acl->getItem($rowID);
|
|
|
+ $row = $this->_acl->buildQuery([])->getItem($rowID);
|
|
|
if (!$row) {
|
|
|
echo "404: No item ID({$rowID})";
|
|
|
exit;
|
|
|
@@ -4389,7 +4389,7 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
$fieldID = $this->_acl->getFieldIdByName($fieldName);
|
|
|
if (!$fieldID) throw new HttpException("Field not exists!", 404);
|
|
|
|
|
|
- $item = $this->_acl->getItem($primaryKey);
|
|
|
+ $item = $this->_acl->buildQuery([])->getItem($primaryKey);
|
|
|
if (!$item) throw new HttpException("Item not exists!", 404);
|
|
|
|
|
|
$itemFromUser = $this->_acl->convertObjectFromUserInput($args, $type = 'array_by_id', $prefix = 'f');
|
|
|
@@ -4410,7 +4410,7 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
$response->type = 'info';
|
|
|
$response->msg = "Nie wprowadzono żadnych zmian";
|
|
|
}
|
|
|
- $response->record = $this->_acl->getItem($primaryKey);
|
|
|
+ $response->record = $this->_acl->buildQuery([])->getItem($primaryKey);
|
|
|
}
|
|
|
catch (Exception $e) {
|
|
|
$response->type = 'error';
|
|
|
@@ -4424,7 +4424,7 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
|
$acl = $this->_acl;
|
|
|
|
|
|
- $record = (array)$acl->getItem($id);
|
|
|
+ $record = $acl->buildQuery([])->getItem($id);
|
|
|
if (!$acl->canWriteRecord($record) && !$acl->hasPermSuperWrite()) {
|
|
|
UI::alert('danger', "Brak dostępu do rekordu");// TODO: more info - reason
|
|
|
return;
|
|
|
@@ -4887,7 +4887,7 @@ jQuery(document).ready(function(){
|
|
|
$response->type = 'success';
|
|
|
$response->msg = "Utworzono pomyślnie rekord nr {$createdId}";
|
|
|
$response->id = $createdId;
|
|
|
- $response->record = $this->_acl->getItem($createdId);
|
|
|
+ $response->record = $this->_acl->buildQuery([])->getItem($createdId);
|
|
|
}
|
|
|
else {
|
|
|
$response->type = 'error';
|
|
|
@@ -4908,7 +4908,7 @@ jQuery(document).ready(function(){
|
|
|
throw new HttpException("Wrong param ID!", 404);
|
|
|
}
|
|
|
|
|
|
- $item = $this->_acl->getItem($id);
|
|
|
+ $item = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$item) {
|
|
|
throw new HttpException("Item '{$id}' not exists!", 404);
|
|
|
}
|
|
|
@@ -4925,7 +4925,7 @@ jQuery(document).ready(function(){
|
|
|
$response->type = 'success';
|
|
|
$response->msg = "Rekord skopiowany pomyślnie - utworzono rekord nr {$createdId}";
|
|
|
$response->id = $createdId;
|
|
|
- $response->record = $this->_acl->getItem($createdId);
|
|
|
+ $response->record = $this->_acl->buildQuery([])->getItem($createdId);
|
|
|
}
|
|
|
else {
|
|
|
$response->type = 'error';
|
|
|
@@ -4944,7 +4944,7 @@ jQuery(document).ready(function(){
|
|
|
$jsonResponse = array();
|
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
|
$acl = $this->_acl;
|
|
|
- $record = $acl->getItem($id);
|
|
|
+ $record = $acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new HttpException("404: No item ID({$id})", 404);
|
|
|
|
|
|
$visibleCols = $acl->getRealFieldList();
|
|
|
@@ -5010,7 +5010,7 @@ jQuery(document).ready(function(){
|
|
|
$dbID = $this->_acl->getDB();
|
|
|
$db = DB::getDB($dbID);
|
|
|
if (!$db) throw new HttpException("No DB ({$dbID})", 406);
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new HttpException("No item ID({$rowID})", 404);
|
|
|
if (!$this->_acl->canReadRecord($record)) throw new Exception("Brak uprawnień do odczytu");
|
|
|
if (!$this->_acl->canWriteRecord($record)) throw new Exception("Brak uprawnień do zapisu");
|
|
|
@@ -5060,7 +5060,7 @@ jQuery(document).ready(function(){
|
|
|
$dbID = $this->_acl->getDB();
|
|
|
$db = DB::getDB($dbID);
|
|
|
if (!$db) throw new HttpException("No DB ({$dbID})", 406);
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new HttpException("No item ID({$rowID})", 404);
|
|
|
if (!$this->_acl->canReadRecord($record)) throw new Exception("Brak uprawnień do odczytu");
|
|
|
if (!$this->_acl->canWriteRecord($record)) throw new Exception("Brak uprawnień do zapisu");
|
|
|
@@ -5089,7 +5089,7 @@ jQuery(document).ready(function(){
|
|
|
$dbID = $this->_acl->getDB();
|
|
|
$db = DB::getDB($dbID);
|
|
|
if (!$db) throw new HttpException("No DB ({$dbID})", 406);
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new HttpException("No item ID({$rowID})", 404);
|
|
|
if (!$this->_acl->canReadRecord($record)) throw new Exception("Brak uprawnień do odczytu");
|
|
|
$tblName = $this->_acl->getName();
|
|
|
@@ -5117,7 +5117,7 @@ jQuery(document).ready(function(){
|
|
|
$db = DB::getDB($dbID);
|
|
|
if (!$db) throw new HttpException("No DB", 406);
|
|
|
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new Exception("No item ID({$rowID})", 404);
|
|
|
|
|
|
$tblName = $this->_acl->getName();
|
|
|
@@ -5228,7 +5228,7 @@ jQuery(document).ready(function(){
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) {
|
|
|
header('HTTP/1.0 404 Not Found');
|
|
|
echo 'No item ID(' . $rowID . ')';
|
|
|
@@ -5359,7 +5359,7 @@ jQuery(document).ready(function(){
|
|
|
$db = DB::getDB($dbID);
|
|
|
if (!$db) throw new HttpException("", 406);
|
|
|
|
|
|
- $record = $this->_acl->getItem($id);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($id);
|
|
|
if (!$record) throw new HttpException("404: No item ID({$rowID})", 404);
|
|
|
|
|
|
if (!$this->_acl->canReadRecord($record)) throw new Exception("Brak uprawnień do odczytu");
|
|
|
@@ -6388,7 +6388,7 @@ jQuery(document).ready(function(){
|
|
|
}
|
|
|
// TODO: validate polygon - ex.: POLYGON((2072030.2315435 7234115.910678,2072029.4815435 7234093.660678,2072115.2315435 7234091.160678,2072115.4815435 7234113.660678,2072115.2315435 7234113.660678,2072094.2315435 7234113.910678,2072030.2315435 7234115.910678)))
|
|
|
|
|
|
- $record = $this->_acl->getItem($primaryKey);
|
|
|
+ $record = $this->_acl->buildQuery([])->getItem($primaryKey);
|
|
|
if (!$this->_acl->canWriteRecord($record) && !$this->_acl->hasPermSuperWrite()) {
|
|
|
throw new HttpException("Brak dostępu do rekordu", 403);
|
|
|
}
|
|
|
@@ -6412,7 +6412,7 @@ jQuery(document).ready(function(){
|
|
|
$response->type = 'info';
|
|
|
$response->msg = "Nie wprowadzono żadnych zmian";
|
|
|
}
|
|
|
- $response->record = $this->_acl->getItem($primaryKey);
|
|
|
+ $response->record = $this->_acl->buildQuery([])->getItem($primaryKey);
|
|
|
}
|
|
|
catch (Exception $e) {
|
|
|
$response->type = 'error';
|