Module: nagvis Branch: master Commit: a5d130e7d1ad30c4bbea746a258ae0666f53caac URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=a5d130e7d1ad30c4bbea746a258ae0666f53caac
Author: Lars Michelsen <[email protected]> Date: Wed Dec 29 11:10:42 2010 +0100 Switched frontend drag/drop save code from temporary oid to id attribute --- share/frontend/nagvis-js/js/ajaxActions.js | 2 +- share/server/core/classes/CoreModMap.php | 25 +++---------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/share/frontend/nagvis-js/js/ajaxActions.js b/share/frontend/nagvis-js/js/ajaxActions.js index 83cd907..bd01439 100644 --- a/share/frontend/nagvis-js/js/ajaxActions.js +++ b/share/frontend/nagvis-js/js/ajaxActions.js @@ -39,7 +39,7 @@ function saveObjectAfterAnchorAction(oAnchor) { urlPart = handleDragResult(objId, anchorId); var oResult = getSyncRequest(oGeneralProperties.path_server + '?mod=Map&act=modifyObject&map=' - + oPageProperties.map_name + '&oid=' + objId + urlPart); + + oPageProperties.map_name + '&id=' + objId + urlPart); if(oResult && oResult.status != 'OK') { alert(oResult.message); diff --git a/share/server/core/classes/CoreModMap.php b/share/server/core/classes/CoreModMap.php index 3983502..c301535 100644 --- a/share/server/core/classes/CoreModMap.php +++ b/share/server/core/classes/CoreModMap.php @@ -655,10 +655,6 @@ class CoreModMap extends CoreModule { try { $MAPCFG->readMapConfig(); } catch(MapCfgInvalid $e) {} - - // Transform oid to type and id until everything is switched to oid - if(isset($a['oid']) && $a['oid'] !== '') - list($a['type'], $a['id']) = $MAPCFG->objIdToTypeAndNum($a['oid']); // set options in the array foreach($a['opts'] AS $key => $val) { @@ -684,29 +680,17 @@ class CoreModMap extends CoreModule { $aResponse = array_merge($_GET, $_POST); // FIXME: Maybe change all to POST $FHANDLER = new CoreRequestHandler($aResponse); - - // ID and Type are used by the WUI. OID is used - // by the regular frontend. Remove the type and id - // params // Check for needed params if($bValid && !$FHANDLER->isSetAndNotEmpty('map')) $bValid = false; - if($bValid && !$FHANDLER->isSetAndNotEmpty('oid')) { - if($bValid && !$FHANDLER->isSetAndNotEmpty('type')) - $bValid = false; - if($bValid && !$FHANDLER->isSetAndNotEmpty('id')) - $bValid = false; - } + if($bValid && !$FHANDLER->isSetAndNotEmpty('id')) + $bValid = false; // All fields: Regex check if($bValid && !$FHANDLER->match('map', MATCH_MAP_NAME)) $bValid = false; - if($bValid && $FHANDLER->isSetAndNotEmpty('oid') && !$FHANDLER->match('oid', MATCH_INTEGER)) - $bValid = false; - if($bValid && $FHANDLER->isSetAndNotEmpty('type') && !$FHANDLER->match('type', MATCH_OBJECTTYPE)) - $bValid = false; - if($bValid && $FHANDLER->isSetAndNotEmpty('id') && !$FHANDLER->match('id', MATCH_INTEGER)) + if($bValid && $FHANDLER->isSetAndNotEmpty('id') && !$FHANDLER->match('id', MATCH_OBJECTID)) $bValid = false; // Check if the map exists @@ -722,10 +706,8 @@ class CoreModMap extends CoreModule { unset($aOpts['act']); unset($aOpts['mod']); unset($aOpts['map']); - unset($aOpts['type']); unset($aOpts['ref']); unset($aOpts['id']); - unset($aOpts['oid']); unset($aOpts['timestamp']); // Also remove all "helper fields" which begin with a _ @@ -741,7 +723,6 @@ class CoreModMap extends CoreModule { return Array('map' => $FHANDLER->get('map'), 'type' => $FHANDLER->get('type'), 'id' => $FHANDLER->get('id'), - 'oid' => $FHANDLER->get('oid'), 'refresh' => $FHANDLER->get('ref'), 'opts' => $aOpts); } else { ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
