Module: nagvis
Branch: master
Commit: d8710a3a962341d2f4cb700fcec59d1719ca8cf1
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=d8710a3a962341d2f4cb700fcec59d1719ca8cf1

Author: Lars Michelsen <[email protected]>
Date:   Fri Apr 23 19:58:16 2010 +0200

Managers are now allowed to add/modify objects on all maps

---

 share/frontend/wui/classes/WuiMap.php              |    2 +-
 share/frontend/wui/js/wui.js                       |    4 ++--
 .../core/classes/CoreAuthorisationHandler.php      |    1 +
 share/server/core/classes/CoreModMap.php           |    2 +-
 share/server/core/classes/CoreSQLiteHandler.php    |    2 ++
 share/server/core/classes/WuiViewMapAddModify.php  |    4 ++--
 share/userfiles/templates/default.header.html      |    2 +-
 7 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/share/frontend/wui/classes/WuiMap.php 
b/share/frontend/wui/classes/WuiMap.php
index f1712f5..8a95f9d 100644
--- a/share/frontend/wui/classes/WuiMap.php
+++ b/share/frontend/wui/classes/WuiMap.php
@@ -643,7 +643,7 @@ class WuiMap extends GlobalMap {
                
                // Edit link
                $tooltipText .= '<li><a 
style="background-image:url('.$this->CORE->getMainCfg()->getValue('paths','htmlbase').'/frontend/wui/images/modify.png)"'
-                 ." href=\"#\" 
onclick=\"showFrontendDialog('".$this->CORE->getMainCfg()->getValue('paths', 
'htmlbase')."/server/core/ajax_handler.php?mod=Map&act=addModify&do=modify&map=".$this->MAPCFG->getName()."&type=".$obj['type']."&id=".$obj['id']."',
 '".$this->CORE->getLang()->getText('change')."');contextHide();\">"
+                 ." href=\"#\" 
onclick=\"showFrontendDialog('".$this->CORE->getMainCfg()->getValue('paths', 
'htmlbase')."/server/core/ajax_handler.php?mod=Map&act=addModify&do=modify&show=".$this->MAPCFG->getName()."&type=".$obj['type']."&id=".$obj['id']."',
 '".$this->CORE->getLang()->getText('change')."');contextHide();\">"
                        
."<span>".$this->CORE->getLang()->getText('change')."</span></a></li>";
                
                // Position/Size link on lines
diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index 4fac5fb..9cdafde 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -298,13 +298,13 @@ function get_click_pos(e) {
                follow_mouse = false;
                var sUrl;
                if(action_click == 'add' || action_click == 'clone') {
-                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=add&map='+mapname+'&type='+objtype+'&coords='+coords+'&viewType='+viewType;
+                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=add&show='+mapname+'&type='+objtype+'&coords='+coords+'&viewType='+viewType;
                        
                        if(action_click == 'clone' && objid !== -1) {
                                sUrl += '&clone='+objid;
                        }
                } else if(action_click == 'modify' && objid !== -1) {
-                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&map='+mapname+'&type='+objtype+'&id='+objid+'&coords='+coords;
+                       sUrl = 
oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&show='+mapname+'&type='+objtype+'&id='+objid+'&coords='+coords;
                }
                
                // FIXME: Title "+get_label('properties')+"
diff --git a/share/server/core/classes/CoreAuthorisationHandler.php 
b/share/server/core/classes/CoreAuthorisationHandler.php
index f5b2b47..53750cc 100644
--- a/share/server/core/classes/CoreAuthorisationHandler.php
+++ b/share/server/core/classes/CoreAuthorisationHandler.php
@@ -51,6 +51,7 @@ class CoreAuthorisationHandler {
                        'modifyObject' => 'edit',
                        'createObject' => 'edit',
                        'deleteObject' => 'edit',
+                       'addModify' => 'edit',
                ),
                'Overview' => Array(
                        'getOverviewRotations' => 'view',
diff --git a/share/server/core/classes/CoreModMap.php 
b/share/server/core/classes/CoreModMap.php
index 48ae89e..85e58e8 100644
--- a/share/server/core/classes/CoreModMap.php
+++ b/share/server/core/classes/CoreModMap.php
@@ -213,7 +213,7 @@ class CoreModMap extends CoreModule {
                                        }
                                break;
                                case 'addModify':
-                                       $aOpts = Array('map' => MATCH_MAP_NAME,
+                                       $aOpts = Array('show' => MATCH_MAP_NAME,
                                                       'do' => 
MATCH_WUI_ADDMODIFY_DO,
                                                       'type' => 
MATCH_OBJECTTYPE,
                                                       'id' => 
MATCH_INTEGER_EMPTY,
diff --git a/share/server/core/classes/CoreSQLiteHandler.php 
b/share/server/core/classes/CoreSQLiteHandler.php
index 1faf5ef..56c7e93 100644
--- a/share/server/core/classes/CoreSQLiteHandler.php
+++ b/share/server/core/classes/CoreSQLiteHandler.php
@@ -125,6 +125,7 @@ class CoreSQLiteHandler {
                        $this->DB->query('INSERT INTO perms (mod, act, obj) 
VALUES (\'Map\', \'modifyObject\', '.$this->escape($name).')');
                        $this->DB->query('INSERT INTO perms (mod, act, obj) 
VALUES (\'Map\', \'createObject\', '.$this->escape($name).')');
                        $this->DB->query('INSERT INTO perms (mod, act, obj) 
VALUES (\'Map\', \'deleteObject\', '.$this->escape($name).')');
+                       $this->DB->query('INSERT INTO perms (mod, act, obj) 
VALUES (\'Map\', \'addModify\', '.$this->escape($name).')');
                } else {
                        if(DEBUG&&DEBUGLEVEL&2) debug('auth.db: won\'t create 
permissions for map '.$name);
                }
@@ -293,6 +294,7 @@ class CoreSQLiteHandler {
                $this->addRolePerm($data['roleId'], 'Map', 'modifyObject', '*');
                $this->addRolePerm($data['roleId'], 'Map', 'createObject', '*');
                $this->addRolePerm($data['roleId'], 'Map', 'deleteObject', '*');
+               $this->addRolePerm($data['roleId'], 'Map', 'addModify', '*');
                
                // Access assignment: Managers => Allowed to create maps
                $this->addRolePerm($data['roleId'], 'Map', 'add', '*');
diff --git a/share/server/core/classes/WuiViewMapAddModify.php 
b/share/server/core/classes/WuiViewMapAddModify.php
index ebff264..cd8e1e6 100644
--- a/share/server/core/classes/WuiViewMapAddModify.php
+++ b/share/server/core/classes/WuiViewMapAddModify.php
@@ -65,7 +65,7 @@ class WuiViewMapAddModify {
                $TMPL = New CoreTemplateSystem($this->CORE);
                $TMPLSYS = $TMPL->getTmplSys();
                
-               $this->MAPCFG = new WuiMapCfg($this->CORE, $this->aOpts['map']);
+               $this->MAPCFG = new WuiMapCfg($this->CORE, 
$this->aOpts['show']);
                try {
                        $this->MAPCFG->readMapConfig();
                } catch(MapCfgInvalid $e) {}
@@ -81,7 +81,7 @@ class WuiViewMapAddModify {
                        'action' => $action,
                        'type' => $this->aOpts['type'],
                        'id' => $this->aOpts['id'],
-                       'map' => $this->aOpts['map'],
+                       'map' => $this->aOpts['show'],
                        'formContents' => 
$this->getFields().$this->fillFields(),
                        'langSave' => $this->CORE->getLang()->getText('save')
                );
diff --git a/share/userfiles/templates/default.header.html 
b/share/userfiles/templates/default.header.html
index a0328a0..b83227d 100644
--- a/share/userfiles/templates/default.header.html
+++ b/share/userfiles/templates/default.header.html
@@ -79,7 +79,7 @@
                                        <li><a class="submenu-link" 
id="map-addspecial-ddheader" href="#" 
onmouseover="ddMenu('map-addspecial',1,1)" 
onmouseout="ddMenu('map-addspecial',-1)">{$langMapAddSpecial}</a></li>
                                        <li class="spacer"><hr /></li>
                                        <li><a href="#" 
onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&act=manageTmpl&map={$currentMap}',
 '{$langMapManageTmpl}', 300)">{$langMapManageTmpl}</a></li>
-                                       <li><a href="#" 
onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&map={$currentMap}&type=global&id=0',
 '{$langMapOptions}');" class="underline">{$langMapOptions}</a></li>
+                                       <li><a href="#" 
onclick="showFrontendDialog(oGeneralProperties.path_server+'?mod=Map&act=addModify&do=modify&show={$currentMap}&type=global&id=0',
 '{$langMapOptions}');" class="underline">{$langMapOptions}</a></li>
                                </ul>
                        </dd>
                </dl>


------------------------------------------------------------------------------
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to