diff options
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locations/page.inc.php | 4 | ||||
-rw-r--r-- | modules-available/locations/templates/location-subnets.html | 6 | ||||
-rw-r--r-- | modules-available/roomplanner/hooks/runmode/config.json | 3 | ||||
-rw-r--r-- | modules-available/roomplanner/js/grid.js | 85 | ||||
-rw-r--r-- | modules-available/roomplanner/page.inc.php | 45 | ||||
-rw-r--r-- | modules-available/roomplanner/permissions/permissions.json | 11 | ||||
-rw-r--r-- | modules-available/roomplanner/style.css | 3 | ||||
-rw-r--r-- | modules-available/roomplanner/templates/footer.html | 59 | ||||
-rw-r--r-- | modules-available/roomplanner/templates/header.html | 49 | ||||
-rw-r--r-- | modules-available/roomplanner/templates/item-selector.html | 314 | ||||
-rw-r--r-- | modules-available/roomplanner/templates/main-roomplan.html | 18 | ||||
-rw-r--r-- | modules-available/roomplanner/templates/page.html | 369 |
12 files changed, 534 insertions, 432 deletions
diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php index 08f9b518..0a6fdb10 100644 --- a/modules-available/locations/page.inc.php +++ b/modules-available/locations/page.inc.php @@ -495,9 +495,7 @@ class Page_Locations extends Page { $locationId = Request::any('locationid', 0, 'integer'); - if (!User::hasPermission("location.view", $locationId)) { - die('Permission denied'); - } + User::assertPermission("location.view", $locationId); $loc = Database::queryFirst('SELECT locationid, parentlocationid, locationname FROM location WHERE locationid = :lid', array('lid' => $locationId)); diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html index 9db75f0b..db94be0a 100644 --- a/modules-available/locations/templates/location-subnets.html +++ b/modules-available/locations/templates/location-subnets.html @@ -75,9 +75,11 @@ </div> <div class="col-md-4 text-center"> {{#roomplanner}} - <a class="btn btn-default {{perms.roomplanner.edit.disabled}}" href="?do=roomplanner&locationid={{locationid}}" target="_blank" + <a class="btn btn-default" href="?do=roomplanner&locationid={{locationid}}" target="_blank" onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false"> - <span class="glyphicon glyphicon-move"></span> {{lang_editRoomplan}} + <span class="glyphicon glyphicon-move"></span> + {{^perms.roomplanner.edit.disabled}}{{lang_editRoomplan}}{{/perms.roomplanner.edit.disabled}} + {{#perms.roomplanner.edit.disabled}}{{lang_showRoomplan}}{{/perms.roomplanner.edit.disabled}} </a> {{/roomplanner}} </div> diff --git a/modules-available/roomplanner/hooks/runmode/config.json b/modules-available/roomplanner/hooks/runmode/config.json index 27c601fd..3cbf4a6c 100644 --- a/modules-available/roomplanner/hooks/runmode/config.json +++ b/modules-available/roomplanner/hooks/runmode/config.json @@ -3,5 +3,6 @@ "isClient": false, "configHook": "PvsGenerator::runmodeConfigHook", "allowGenericEditor": false, - "deleteUrlSnippet": "locationid=" + "deleteUrlSnippet": "locationid=", + "permission": ".roomplanner.edit" }
\ No newline at end of file diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js index 466e42aa..ced76678 100644 --- a/modules-available/roomplanner/js/grid.js +++ b/modules-available/roomplanner/js/grid.js @@ -1,5 +1,9 @@ +var $gridInner = $('#draw-element-area'); +var $gridFrame = $('#drawpanel'); +var $grid = $('#drawarea'); + if (!roomplanner) var roomplanner = { - + getScaleFactor: function() { return this.settings.scale/100; }, @@ -280,7 +284,7 @@ if (!roomplanner) var roomplanner = { "computers": [] }; - var furniture = $('#draw-element-area div[itemtype="furniture"]'); + var furniture = $gridInner.find('div[itemtype="furniture"]'); furniture.each(function(idx,el) { objects.furniture.push({ "gridRow" : $(el).attr('gridRow'), @@ -291,7 +295,7 @@ if (!roomplanner) var roomplanner = { }); }); - var computers = $('#draw-element-area div[itemtype="pc"]'); + var computers = $gridInner.find('div[itemtype="pc"]'); computers.each(function(idx,el) { var object = { @@ -326,7 +330,7 @@ if (!roomplanner) var roomplanner = { var objects = object; } - $('#draw-element-area').html(''); + $gridInner.html(''); function itemToHtml(item, itemtype, obstacle) { var html = '<div itemtype="'+itemtype+'" style="position:absolute;" '; @@ -335,15 +339,18 @@ if (!roomplanner) var roomplanner = { html += prop+'="'+item[prop]+'" '; } html += 'class="draggable ui-draggable'; - html+= '"></div>'; - return html; + if (PLANNER_READ_ONLY) { + html += ' disabled'; + } + html += '"></div>'; + return html; } if (objects.furniture) { var furniture = objects.furniture; for (var piece in furniture) { var item = itemToHtml(furniture[piece], "furniture", true); - $('#draw-element-area').append(item); + $gridInner.append(item); } } @@ -353,51 +360,53 @@ if (!roomplanner) var roomplanner = { var computers = objects.computers; for (var piece in computers) { var item = itemToHtml(computers[piece], "pc", false); - $('#draw-element-area').append(item); + $gridInner.append(item); } } - $('#draw-element-area .draggable').each(function(idx,el) { + $gridInner.find('.draggable').each(function(idx,el) { roomplanner.initDraggable(el); roomplanner.initResizable(el); - roomplanner.initTooltip(el); - roomplanner.initRotation(el); - roomplanner.initDelete(el); - roomplanner.initTutor(el); + if (!PLANNER_READ_ONLY) { + roomplanner.initTooltip(el); + roomplanner.initRotation(el); + roomplanner.initDelete(el); + roomplanner.initTutor(el); + } }); roomplanner.grid.scale(roomplanner.settings.scale); roomplanner.fitContent(); }, clear: function() { - $('#draw-element-area').html(''); + $gridInner.html(''); } }; roomplanner.grid = (function() { var grid = { resize: function() { - var w = Math.max($('#drawpanel .panel-body').width(),roomplanner.settings.room.width*roomplanner.settings.scale) - var h = Math.max($('#drawpanel .panel-body').height(),roomplanner.settings.room.height*roomplanner.settings.scale) - $('#drawarea').width(w); - $('#drawarea').height(h); + var w = Math.max($gridFrame.find('.panel-body').width(),roomplanner.settings.room.width*roomplanner.settings.scale) + var h = Math.max($gridFrame.find('.panel-body').height(),roomplanner.settings.room.height*roomplanner.settings.scale) + $grid.width(w); + $grid.height(h); }, scale: function(num) { - var area_left = parseInt($('#drawarea').css('left')) - $('#drawpanel .panel-body').width()/2 ; - var area_top = parseInt($('#drawarea').css('top')) - $('#drawpanel .panel-body').height()/2; + var area_left = parseInt($grid.css('left')) - $gridFrame.find('.panel-body').width()/2 ; + var area_top = parseInt($grid.css('top')) - $gridFrame.find('.panel-body').height()/2; var opts = { - left: ((parseInt(area_left) * num / roomplanner.settings.scale ) + $('#drawpanel .panel-body').width()/2)+ "px" , - top: ((parseInt(area_top) * num / roomplanner.settings.scale ) + $('#drawpanel .panel-body').height()/2)+ "px" + left: ((parseInt(area_left) * num / roomplanner.settings.scale ) + $gridFrame.find('.panel-body').width()/2)+ "px" , + top: ((parseInt(area_top) * num / roomplanner.settings.scale ) + $gridFrame.find('.panel-body').height()/2)+ "px" }; - $('#drawarea').css(opts); + $grid.css(opts); - $('#drawarea').css('background-size',num); + $grid.css('background-size',num); roomplanner.settings.scale = num; - $('#draw-element-area .ui-draggable').each(function(idx,item) { + $gridInner.find('.ui-draggable').each(function(idx,item) { var $item = $(item); var h = $item.attr('data-height') * roomplanner.getScaleFactor(); var w = $item.attr('data-width') * roomplanner.getScaleFactor(); @@ -431,7 +440,7 @@ roomplanner.fitContent = function() { var minY = 99999; var maxX = -99999; var maxY = -99999; - $('#draw-element-area .ui-draggable').each(function(idx,item) { + $gridInner.find('.ui-draggable').each(function(idx,item) { var $item = $(item); var l = parseInt($item.attr('gridcol')) * roomplanner.settings.cellsize; @@ -446,8 +455,8 @@ roomplanner.fitContent = function() { }); if (minX > maxX) return; - var width = (maxX - minX) / $('#drawpanel .panel-body').width(); - var height = (maxY - minY) / $('#drawpanel .panel-body').height(); + var width = (maxX - minX) / $gridFrame.find('.panel-body').width(); + var height = (maxY - minY) / $gridFrame.find('.panel-body').height(); var scale; if (width > height) { scale = Math.floor(100 / width); @@ -461,7 +470,7 @@ roomplanner.fitContent = function() { top: -(minY * (scale / 100)) + "px" }; - $('#drawarea').css(opts); + $grid.css(opts); }; $(document).ready(function(){ @@ -480,12 +489,12 @@ $(document).ready(function(){ change: update, slide: update, stop: function(e, ui) { - $('#drawarea').trigger('checkposition'); + $grid.trigger('checkposition'); } }); - $('#drawarea').bind('checkposition', function() { + $grid.bind('checkposition', function() { if ($(this).offset().left > 0) { $(this).css('left',0); } @@ -502,7 +511,7 @@ $(document).ready(function(){ } }); - $('#drawarea').draggable({ + $grid.draggable({ stop: function() { $(this).trigger('checkposition'); } @@ -512,7 +521,7 @@ $(document).ready(function(){ * adds droppable functionality to the draw area for the elements. * drop event is only fired for elements added to the board from the toolbar. */ - $('#draw-element-area').droppable({ + $gridInner.droppable({ accept: ".draggable", drop: function(event, ui) { @@ -528,8 +537,8 @@ $(document).ready(function(){ if (ui.helper != ui.draggable) { - var leftPos = parseInt($(el).css('left'))-parseInt($('#drawarea').css('left'))-$('#drawpanel').offset().left; - var topPos = parseInt($(el).css('top'))-parseInt($('#drawarea').css('top'))-($('#drawpanel').offset().top + $('#drawpanel .panel-heading').height()); + var leftPos = parseInt($(el).css('left'))-parseInt($grid.css('left'))-$gridFrame.offset().left; + var topPos = parseInt($(el).css('top'))-parseInt($grid.css('top'))-($gridFrame.offset().top + $gridFrame.find('.panel-heading').height()); var cp = roomplanner.getCellPositionFromPixels(leftPos,topPos); leftPos = cp[0]; topPos = cp[1]; @@ -575,8 +584,8 @@ $(document).ready(function(){ $(el).css('opacity',1); if (ui.helper != ui.draggable) { - var l = parseInt($(el).css('left'))-parseInt($('#drawarea').css('left'))-$('#drawpanel').offset().left; - var t = parseInt($(el).css('top'))-parseInt($('#drawarea').css('top'))-($('#drawpanel').offset().top + $('#drawpanel .panel-heading').height()); + var l = parseInt($(el).css('left'))-parseInt($grid.css('left'))-$gridFrame.offset().left; + var t = parseInt($(el).css('top'))-parseInt($grid.css('top'))-($gridFrame.offset().top + $gridFrame.find('.panel-heading').height()); var cp = roomplanner.getCellPositionFromPixels(l,t); $(el).css('left',cp[0]); $(el).css('top',cp[1]); @@ -596,7 +605,7 @@ $(document).ready(function(){ if ($(el).attr('itemtype') == "pc") { var uuids = []; - var computers = $('#draw-element-area div[itemtype="pc"]'); + var computers = $gridInner.find('div[itemtype="pc"]'); computers.each(function(idx,el) { if ($(el).attr('muuid')) { uuids.push($(el).attr('muuid')); diff --git a/modules-available/roomplanner/page.inc.php b/modules-available/roomplanner/page.inc.php index 764d5cdb..2712560a 100644 --- a/modules-available/roomplanner/page.inc.php +++ b/modules-available/roomplanner/page.inc.php @@ -30,7 +30,7 @@ class Page_Roomplanner extends Page { User::load(); - if (!User::hasPermission('superadmin')) { + if (!User::isLoggedIn()) { Message::addError('main.no-permission'); Util::redirect('?do=Main'); } @@ -79,13 +79,22 @@ class Page_Roomplanner extends Page $subnetMachines = $this->getPotentialMachines(); $machinesOnPlan = $this->getMachinesOnPlan($config['tutoruuid']); $roomConfig = array_merge($furniture, $machinesOnPlan); - Render::addTemplate('page', [ + $canEdit = User::hasPermission('edit', $this->locationid); + $params = [ 'location' => $this->location, 'managerip' => $managerIp, 'dediMgrChecked' => $dediMgr, 'subnetMachines' => json_encode($subnetMachines), 'locationid' => $this->locationid, - 'roomConfiguration' => json_encode($roomConfig)]); + 'roomConfiguration' => json_encode($roomConfig), + 'edit_disabled' => $canEdit ? '' : 'disabled' + ]; + Render::addTemplate('header', $params); + if ($canEdit) { + Render::addTemplate('item-selector', $params); + } + Render::addTemplate('main-roomplan', $params); + Render::addTemplate('footer', $params); } else { Message::addError('main.invalid-action', $this->action); } @@ -97,16 +106,30 @@ class Page_Roomplanner extends Page $this->action = Request::any('action', false, 'string'); if ($this->action === 'getmachines') { + + $locations = User::getAllowedLocations('edit'); + if (empty($locations)) { + die('{"machines":[]}'); + } + $query = Request::get('query', false, 'string'); $aquery = preg_replace('/[^\x01-\x7f]+/', '%', $query); + if (strlen(str_replace('%', '', $aquery)) < 2) { + $aquery = $query; + } + + $condition = 'locationid IN (:locations)'; + if (in_array(0, $locations)) { + $condition .= ' OR locationid IS NULL'; + } - $result = Database::simpleQuery('SELECT machineuuid, macaddr, clientip, hostname, fixedlocationid ' - . 'FROM machine ' - . 'WHERE machineuuid LIKE :aquery ' - . ' OR macaddr LIKE :aquery ' - . ' OR clientip LIKE :aquery ' - . ' OR hostname LIKE :query ' - . ' LIMIT 100', ['query' => "%$query%", 'aquery' => "%$aquery%"]); + $result = Database::simpleQuery("SELECT machineuuid, macaddr, clientip, hostname, fixedlocationid + FROM machine + WHERE ($condition) AND machineuuid LIKE :aquery + OR macaddr LIKE :aquery + OR clientip LIKE :aquery + OR hostname LIKE :query + LIMIT 100", ['query' => "%$query%", 'aquery' => "%$aquery%", 'locations' => $locations]); $returnObject = ['machines' => []]; @@ -134,7 +157,7 @@ class Page_Roomplanner extends Page private function handleSaveRequest($isAjax) { - /* save */ + User::assertPermission('edit', $this->locationid); $machinesOnPlan = $this->getMachinesOnPlan('invalid'); $config = Request::post('serializedRoom', null, 'string'); $config = json_decode($config, true); diff --git a/modules-available/roomplanner/permissions/permissions.json b/modules-available/roomplanner/permissions/permissions.json index f7bc3479..6a520a89 100644 --- a/modules-available/roomplanner/permissions/permissions.json +++ b/modules-available/roomplanner/permissions/permissions.json @@ -1,10 +1,5 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "sourceMap": true - }, - "exclude": [ - "node_modules" - ] + "edit": { + "location-aware": true + } }
\ No newline at end of file diff --git a/modules-available/roomplanner/style.css b/modules-available/roomplanner/style.css index 6a68a444..9359f82b 100644 --- a/modules-available/roomplanner/style.css +++ b/modules-available/roomplanner/style.css @@ -715,6 +715,9 @@ div.draggable:hover .deleteHandle { display:inline; cursor: pointer;} +.draggable.disabled { + pointer-events: none; +} [itemtype="furniture"], [itemtype="furniture_drag"] { z-index: 99; diff --git a/modules-available/roomplanner/templates/footer.html b/modules-available/roomplanner/templates/footer.html new file mode 100644 index 00000000..6e4e0783 --- /dev/null +++ b/modules-available/roomplanner/templates/footer.html @@ -0,0 +1,59 @@ +<div class="pull-left"> + <div class="input-group" style="width:1px"> + <div class="input-group-addon">{{lang_managerIp}}</div> + <input class="form-control" type="text" id="manager-ip" value="{{managerip}}" placeholder="1.2.3.4" + style="width:120px" {{edit_disabled}}> + <div class="input-group-addon checkbox"> + <input id="dedi-mgr" type="checkbox" {{dediMgrChecked}} {{edit_disabled}}> + <label for="dedi-mgr">{{lang_dedicatedManager}}</label> + </div> + </div> +</div> +<div class="pull-right"> + <button class="btn btn-default" onclick="triggerCancel()">{{lang_cancel}}</button> + <button id="saveBtn" class="btn btn-primary" {{edit_disabled}}>{{lang_save}}</button> +</div> +<div class="clearfix"></div> + + +<script type="application/javascript"><!-- +var locationId = '{{locationid}}'; +var subnetMachines, roomConfiguration; +var plannerLoadState = 'invalid'; +const PLANNER_READ_ONLY = '{{edit_disabled}}'.length !== 0; +document.addEventListener("DOMContentLoaded", function () { + + subnetMachines = makeCombinedField({{{subnetMachines}}}); + roomConfiguration = {{{roomConfiguration}}}; + + $.when( + $.getScript("modules/roomplanner/js/lib/jquery-collision.js"), + $.getScript("modules/roomplanner/js/lib/jquery-ui-draggable-collision.js"), + $.getScript("modules/roomplanner/js/grid.js"), + $.Deferred(function( deferred ){ + $( deferred.resolve ); + }) + ).done(function() { + $.getScript("modules/roomplanner/js/init.js", function() { + initRoomplanner(); + loadRoom(); + }); + }); +}); + +function loadRoom() { + roomplanner.load(roomConfiguration); // TODO: Filter invalid PCs, they're currently invisible and cannot be removed + plannerLoadState = roomplanner.serialize(); +} + +function triggerCancel() { + if (roomplanner.serialize() !== plannerLoadState) { + if (!confirm('{{lang_confirmDiscardChanges}}')) + return; + } + window.close(); + // In case this page wasn't opened via JS, it will not close on modern browsers, so let's reset + loadRoom(); +} + +// --></script> diff --git a/modules-available/roomplanner/templates/header.html b/modules-available/roomplanner/templates/header.html new file mode 100644 index 00000000..5706c970 --- /dev/null +++ b/modules-available/roomplanner/templates/header.html @@ -0,0 +1,49 @@ +<!-- Modal --> +<div class="modal fade" id="selectMachineModal" role="dialog"> + <div class="modal-dialog"> + + <!-- Modal content--> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h4>{{lang_titleAddMachine}}</h4> + </div> + <div class="modal-body"> + <ul class="nav nav-tabs"> + <li class="active"><a data-toggle="tab" href="#subnet">{{lang_titleBySubnet}}</a></li> + <li><a data-toggle="tab" href="#search">{{lang_titleBySearch}}</a></li> + </ul> + <div class="tab-content"> + <div id="subnet" class="tab-pane fade in active"> + <br/> + <p> + {{lang_descriptionBySubnet}} + </p> + <label for="subnetBox">{{lang_labelBySubnet}}</label> + <input id="subnetBox" class="form-control"/> + </div> + <div id="search" class="tab-pane fade"> + <br/> + <p> {{lang_descriptionBySearch}}</p> + <label for="machineSearchBox">{{lang_labelBySearch}}</label> + <input id="machineSearchBox" class="form-control"/> + </div> + + </div> + + + </div> + <div class="modal-footer"> + <button class="btn btn-default pull-left" data-dismiss="modal">{{lang_cancel}}</button> + <button class="btn btn-primary" id="selectMachineButton" {{edit_disabled}}>{{lang_select}}</button> + </div> + </div> + </div> +</div> + +<!-- berryous raumplaner --> +<h1>{{lang_roomplanner}} – {{location.locationname}}</h1> + +<div class="alert alert-danger" style="display:none" id="error-msg"></div> +<div class="alert alert-success" style="display:none" id="success-msg">{{lang_planSuccessfullySaved}}</div> +<div class="alert alert-info" style="display:none" id="saving-msg">{{lang_planBeingSaved}}</div>
\ No newline at end of file diff --git a/modules-available/roomplanner/templates/item-selector.html b/modules-available/roomplanner/templates/item-selector.html new file mode 100644 index 00000000..72607e7c --- /dev/null +++ b/modules-available/roomplanner/templates/item-selector.html @@ -0,0 +1,314 @@ +<div id="toolpanel" class="panel panel-default" style="z-index:200;"> + <div class="panel-body"> + <ul role="tablist" class="nav nav-tabs"> + <li role="presentation" class="active"><a href="#computers" + aria-controls="computers" role="tab" + data-toggle="tab">{{lang_catComputers}}</a></li> + <li role="presentation"><a href="#walls" + aria-controls="walls" role="tab" data-toggle="tab">{{lang_catWalls}}</a></li> + <li role="presentation"><a href="#electricaldevices" + aria-controls="electricaldevices" role="tab" + data-toggle="tab">{{lang_catElectricalDevices}}</a></li> + <li role="presentation"><a href="#tables" + aria-controls="tables" role="tab" data-toggle="tab">{{lang_catTables}}</a></li> + <li role="presentation"><a href="#chairs" + aria-controls="chairs" role="tab" data-toggle="tab">{{lang_catChairs}}</a></li> + <li role="presentation"><a href="#furniture" + aria-controls="furniture" role="tab" data-toggle="tab">{{lang_catFurniture}}</a> + </li> + <li role="presentation"><a href="#officesupply" + aria-controls="officesupply" role="tab" + data-toggle="tab">{{lang_catOfficeSupply}}</a></li> + <li role="presentation"><a href="#plants" + aria-controls="plants" role="tab" data-toggle="tab">{{lang_catPlants}}</a></li> + <li role="presentation"><a href="#misc" + aria-controls="misc" role="tab" data-toggle="tab">{{lang_catMisc}}</a></li> + </ul> + <div class="tab-content"> + <div role="tabpanel" class="tab-pane" id="walls"> + <ul class="toollist"> + <li> + <div itemtype="furniture" scalable="h" itemlook="wall-horizontal" class="draggable" + style="width:100px; height:25px;" data-height="25" data-width="100" + title="Wand (horizontal)"></div> + </li> + <li> + <div itemtype="furniture" scalable="v" itemlook="wall-vertical" class="draggable" + style="width:25px; height:100px;" data-height="100" data-width="25" title="Wand (vertial)"></div> + </li> + <li> + <div itemtype="furniture" scalable="h" itemlook="window-horizontal" class="draggable" + style="width:50px; height:25px;" data-height="25" data-width="50" title="Fenster"></div> + </li> + <li> + <div itemtype="furniture" scalable="v" itemlook="window-vertical" class="draggable" + style="width:25px; height:50px;" data-height="50" data-width="25" title="Fenster"></div> + </li> + + + <li> + <div itemtype="furniture" itemlook="door-nw" class="draggable" style="width:50px; height:100px;" + data-height="100" data-width="50" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-ne" class="draggable" style="width:50px; height:100px;" + data-height="100" data-width="50" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-sw" class="draggable" style="width:50px; height:100px;" + data-height="100" data-width="50" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-se" class="draggable" style="width:50px; height:100px;" + data-height="100" data-width="50" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-wn" class="draggable" style="width:100px; height:50px;" + data-height="50" data-width="100" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-ws" class="draggable" style="width:100px; height:50px;" + data-height="50" data-width="100" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-en" class="draggable" style="width:100px; height:50px;" + data-height="50" data-width="100" title="{{lang_door}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="door-es" class="draggable" style="width:100px; height:50px;" + data-height="50" data-width="100" title="{{lang_door}}"></div> + </li> + + </ul> + </div> + + + <div role="tabpanel" class="tab-pane active" id="computers"> + <ul class="toollist"> + <li> + <div itemtype="pc" itemlook="pc-south" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="PC" noresize=1></div> + </li> + <li> + <div itemtype="pc" itemlook="copier" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_photocopier}}" noresize=1></div> + </li> + <li> + <div itemtype="pc" itemlook="printer" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_printer}}" noresize=1></div> + </li> + <li> + <div itemtype="pc" itemlook="telephone" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_telephone}}" noresize=1></div> + </li> + </ul> + </div> + + <div role="tabpanel" class="tab-pane" id="electricaldevices"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="flatscreen" class="draggable" style="width:75px; height:100px;" + data-height="100" data-width="75" title="{{lang_flatscreen}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="lamp" class="draggable" style="width:125px; height:50px;" + data-height="50" data-width="125" title="{{lang_deskLamp}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="tvcamera" class="draggable" style="width:125px; height:50px;" + data-height="50" data-width="125" title="{{lang_projector}}"></div> + </li> + </ul> + </div> + + <div role="tabpanel" class="tab-pane" id="tables"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="4chairs1squaretable" class="draggable" + style="width:100px; height:100px;" data-height="100" data-width="100" + title="{{lang_4chairs1squaretable}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="6chairs1table-horizontal" class="draggable" + style="width:100px; height:75px;" data-height="75" data-width="100" + title="{{lang_6chairs1table}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="8chairs1conferencetable-horizontal" class="draggable" + style="width:175px; height:100px;" data-height="100" data-width="175" + title="{{lang_8chairs1conferencetable}}"></div> + </li> + + <li> + <div itemtype="furniture" itemlook="classroomdesk-north" class="draggable" + style="width:275px; height:100px;" data-height="100" data-width="275" + title="{{lang_classroomdesk}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="classroomdeskchair-north" class="draggable" + style="width:175px; height:100px;" data-height="100" data-width="175" + title="{{lang_classroomdeskchair}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="classroomtable-east" class="draggable" + style="width:75px; height:100px;" data-height="100" data-width="75" + title="{{lang_classroomtable}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="classroomtablechair-north" class="draggable" + style="width:75px; height:100px;" data-height="100" data-width="75" + title="{{lang_classroomdeskchair}}"></div> + </li> + + <li> + <div itemtype="furniture" itemlook="conferencetable-horizontal" class="draggable" + style="width:200px; height:100px;" data-height="100" data-width="200" + title="{{lang_conferencetable}}"></div> + </li> + + + <li> + <div itemtype="furniture" itemlook="podium-north" class="draggable" style="width:200px; height:100px;" + data-height="100" data-width="200" title="{{lang_podium}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="roundeddesk-east" class="draggable" + style="width:75px; height:100px;" data-height="100" data-width="75" + title="{{lang_roundeddesk}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="roundtable" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_roundtable}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="semicirculartable-north" class="draggable" + style="width:200px; height:100px;" data-height="100" data-width="200" + title="{{lang_semicirculartable}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="squaretable" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_squaretable}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="studentdesk-north" class="draggable" + style="width:150px; height:100px;" data-height="100" data-width="150" + title="{{lang_studentdesk}}"></div> + </li> + + + </ul> + + </div> + + <div role="tabpanel" class="tab-pane" id="chairs"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="armchair-south" class="draggable" + style="width:100px; height:100px;" data-height="100" data-width="100" + title="{{lang_armchair}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="chair-south" class="draggable" style="width:125px; height:100px;" + data-height="100" data-width="125" title="{{lang_chair}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="chair2-south" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_chair}}"></div> + </li> + + + <li> + <div itemtype="furniture" itemlook="couch-south" class="draggable" style="width:100px; height:100px;" + data-height="100" data-width="100" title="{{lang_couch}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="greenchair-south" class="draggable" + style="width:125px; height:100px;" data-height="100" data-width="125" + title="{{lang_greenchair}}"></div> + </li> + + <li> + <div itemtype="furniture" itemlook="studentdeskchair-north" class="draggable" + style="width:100px; height:100px;" data-height="100" data-width="100" + title="{{lang_studentdeskchair}}"></div> + </li> + </ul> + </div> + + <div role="tabpanel" class="tab-pane" id="furniture"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="locker-east" class="draggable" style="width:100px; height:75px;" + data-height="75" data-width="100" title="{{lang_locker}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="locker-north" class="draggable" style="width:75px; height:100px;" + data-height="100" data-width="75" title="{{lang_locker}}"></div> + </li> + + <li> + <div itemtype="furniture" itemlook="coatrack-east" class="draggable" style="width:25px; height:150px;" + data-height="150" data-width="25" title="{{lang_coatrack}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="coatrack-north" class="draggable" + style="width:150px; height:25px;" data-height="25" data-width="150" + title="{{lang_coatrack}}"></div> + </li> + + + <li> + <div itemtype="furniture" itemlook="lecturetheaterrow" class="draggable" + style="width:725px; height:100px;" data-height="100" data-width="725" + title="{{lang_lecturetheaterrow}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="lecturetheaterrowseats" class="draggable" + style="width:725px; height:50px;" data-height="50" data-width="725" + title="{{lang_lecturetheaterrow}}"></div> + </li> + + </ul> + </div> + + <div role="tabpanel" class="tab-pane" id="officesupply"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="papertray" class="draggable" style="width:25px; height:50px;" + data-height="50" data-width="25" title="{{lang_papertray}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="wastecan" class="draggable" style="width:50px; height:50px;" + data-height="50" data-width="50" title="{{lang_wastecan}}"></div> + </li> + + </ul> + </div> + <div role="tabpanel" class="tab-pane" id="plants"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="plant" class="draggable" style="width:75px; height:75px;" + data-height="75" data-width="75" title="{{lang_plant}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="plant2" class="draggable" style="width:75px; height:75px;" + data-height="75" data-width="75" title="{{lang_plant}}"></div> + </li> + <li> + <div itemtype="furniture" itemlook="plant3" class="draggable" style="width:75px; height:75px;" + data-height="75" data-width="75" title="{{lang_plant}}"></div> + </li> + </ul> + </div> + <div role="tabpanel" class="tab-pane" id="misc"> + <ul class="toollist"> + <li> + <div itemtype="furniture" itemlook="projectionscreen" class="draggable" + style="width:525px; height:25px;" data-height="25" data-width="525" title="{{lang_plant}}"></div> + </li> + </ul> + </div> + + </div> + </div> +</div>
\ No newline at end of file diff --git a/modules-available/roomplanner/templates/main-roomplan.html b/modules-available/roomplanner/templates/main-roomplan.html new file mode 100644 index 00000000..1fc49bea --- /dev/null +++ b/modules-available/roomplanner/templates/main-roomplan.html @@ -0,0 +1,18 @@ +<div class="panel panel-default" id="drawpanel"> + <div class="panel-heading"> + <h3 class="panel-title">{{lang_roomplan}}</h3> + </div> + <div class="panel-body"> + <div id="drawarea" style="top:0px; left:0px;"> + <div id="draw-element-area" style="width:100%; height:100%;"></div> + </div> + <div id="scaleContainer"> + <span id="zoom-fit" class="glyphicon glyphicon-move" aria-hidden="true"></span> + <div> + <div id="scaleslider"></div> + <span id="zoom-out" class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span> + <span id="zoom-in" class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span> + </div> + </div> + </div> +</div>
\ No newline at end of file diff --git a/modules-available/roomplanner/templates/page.html b/modules-available/roomplanner/templates/page.html deleted file mode 100644 index e8544ce8..00000000 --- a/modules-available/roomplanner/templates/page.html +++ /dev/null @@ -1,369 +0,0 @@ -<!-- Modal --> -<div class="modal fade" id="selectMachineModal" role="dialog"> - <div class="modal-dialog"> - - <!-- Modal content--> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal">×</button> - <h4>{{lang_titleAddMachine}}</h4> - </div> - <div class="modal-body"> - <ul class="nav nav-tabs"> - <li class="active"><a data-toggle="tab" href="#subnet">{{lang_titleBySubnet}}</a></li> - <li><a data-toggle="tab" href="#search">{{lang_titleBySearch}}</a></li> - </ul> - <div class="tab-content"> - <div id="subnet" class="tab-pane fade in active"> - <br/> - <p> - {{lang_descriptionBySubnet}} - </p> - <label for="subnetBox">{{lang_labelBySubnet}}</label> - <input id="subnetBox" class="form-control"/> - </div> - <div id="search" class="tab-pane fade"> - <br/> - <p> {{lang_descriptionBySearch}}</p> - <label for="machineSearchBox">{{lang_labelBySearch}}</label> - <input id="machineSearchBox" class="form-control" /> - </div> - - </div> - - - </div> - <div class="modal-footer"> - <button class="btn btn-default pull-left" data-dismiss="modal" >{{lang_cancel}}</button> - <button class="btn btn-primary" id="selectMachineButton">{{lang_select}}</button> - </div> - </div> - </div> -</div> - -<!-- berryous raumplaner --> -<h1>{{lang_roomplanner}} – {{location.locationname}}</h1> - -<div class="alert alert-danger" style="display:none" id="error-msg"></div> -<div class="alert alert-success" style="display:none" id="success-msg">{{lang_planSuccessfullySaved}}</div> -<div class="alert alert-info" style="display:none" id="saving-msg">{{lang_planBeingSaved}}</div> - - <div id="toolpanel" class="panel panel-default" style="z-index:200;"> - <div class="panel-body"> - <ul role="tablist" class="nav nav-tabs"> - <li role="presentation" class="active"><a href="#computers" - aria-controls="computers" role="tab" data-toggle="tab">{{lang_catComputers}}</a></li> - <li role="presentation"><a href="#walls" - aria-controls="walls" role="tab" data-toggle="tab">{{lang_catWalls}}</a></li> - <li role="presentation"><a href="#electricaldevices" - aria-controls="electricaldevices" role="tab" data-toggle="tab">{{lang_catElectricalDevices}}</a></li> - <li role="presentation"><a href="#tables" - aria-controls="tables" role="tab" data-toggle="tab">{{lang_catTables}}</a></li> - <li role="presentation"><a href="#chairs" - aria-controls="chairs" role="tab" data-toggle="tab">{{lang_catChairs}}</a></li> - <li role="presentation"><a href="#furniture" - aria-controls="furniture" role="tab" data-toggle="tab">{{lang_catFurniture}}</a></li> - <li role="presentation"><a href="#officesupply" - aria-controls="officesupply" role="tab" data-toggle="tab">{{lang_catOfficeSupply}}</a></li> - <li role="presentation"><a href="#plants" - aria-controls="plants" role="tab" data-toggle="tab">{{lang_catPlants}}</a></li> - <li role="presentation"><a href="#misc" - aria-controls="misc" role="tab" data-toggle="tab">{{lang_catMisc}}</a></li> - </ul> - <div class="tab-content"> - <div role="tabpanel" class="tab-pane" id="walls"> - <ul class="toollist"> - <li> - <div itemtype="furniture" scalable="h" itemlook="wall-horizontal" class="draggable" style="width:100px; height:25px;" data-height="25" data-width="100" title="Wand (horizontal)"></div> - </li> - <li> - <div itemtype="furniture" scalable="v" itemlook="wall-vertical" class="draggable" style="width:25px; height:100px;" data-height="100" data-width="25" title="Wand (vertial)"></div> - </li> - <li> - <div itemtype="furniture" scalable="h" itemlook="window-horizontal" class="draggable" style="width:50px; height:25px;" data-height="25" data-width="50" title="Fenster"></div> - </li> - <li> - <div itemtype="furniture" scalable="v" itemlook="window-vertical" class="draggable" style="width:25px; height:50px;" data-height="50" data-width="25" title="Fenster"></div> - </li> - - - <li> - <div itemtype="furniture" itemlook="door-nw" class="draggable" style="width:50px; height:100px;" data-height="100" data-width="50" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-ne" class="draggable" style="width:50px; height:100px;" data-height="100" data-width="50" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-sw" class="draggable" style="width:50px; height:100px;" data-height="100" data-width="50" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-se" class="draggable" style="width:50px; height:100px;" data-height="100" data-width="50" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-wn" class="draggable" style="width:100px; height:50px;" data-height="50" data-width="100" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-ws" class="draggable" style="width:100px; height:50px;" data-height="50" data-width="100" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-en" class="draggable" style="width:100px; height:50px;" data-height="50" data-width="100" title="{{lang_door}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="door-es" class="draggable" style="width:100px; height:50px;" data-height="50" data-width="100" title="{{lang_door}}"></div> - </li> - - </ul> - </div> - - - <div role="tabpanel" class="tab-pane active" id="computers"> - <ul class="toollist"> - <li> - <div itemtype="pc" itemlook="pc-south" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="PC" noresize=1></div> - </li> - <li> - <div itemtype="pc" itemlook="copier" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_photocopier}}" noresize=1></div> - </li> - <li> - <div itemtype="pc" itemlook="printer" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_printer}}" noresize=1></div> - </li> - <li> - <div itemtype="pc" itemlook="telephone" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_telephone}}" noresize=1></div> - </li> - </ul> - </div> - - <div role="tabpanel" class="tab-pane" id="electricaldevices"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="flatscreen" class="draggable" style="width:75px; height:100px;" data-height="100" data-width="75" title="{{lang_flatscreen}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="lamp" class="draggable" style="width:125px; height:50px;" data-height="50" data-width="125" title="{{lang_deskLamp}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="tvcamera" class="draggable" style="width:125px; height:50px;" data-height="50" data-width="125" title="{{lang_projector}}"></div> - </li> - </ul> - </div> - - <div role="tabpanel" class="tab-pane" id="tables"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="4chairs1squaretable" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_4chairs1squaretable}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="6chairs1table-horizontal" class="draggable" style="width:100px; height:75px;" data-height="75" data-width="100" title="{{lang_6chairs1table}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="8chairs1conferencetable-horizontal" class="draggable" style="width:175px; height:100px;" data-height="100" data-width="175" title="{{lang_8chairs1conferencetable}}"></div> - </li> - - <li> - <div itemtype="furniture" itemlook="classroomdesk-north" class="draggable" style="width:275px; height:100px;" data-height="100" data-width="275" title="{{lang_classroomdesk}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="classroomdeskchair-north" class="draggable" style="width:175px; height:100px;" data-height="100" data-width="175" title="{{lang_classroomdeskchair}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="classroomtable-east" class="draggable" style="width:75px; height:100px;" data-height="100" data-width="75" title="{{lang_classroomtable}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="classroomtablechair-north" class="draggable" style="width:75px; height:100px;" data-height="100" data-width="75" title="{{lang_classroomdeskchair}}"></div> - </li> - - <li> - <div itemtype="furniture" itemlook="conferencetable-horizontal" class="draggable" style="width:200px; height:100px;" data-height="100" data-width="200" title="{{lang_conferencetable}}"></div> - </li> - - - <li> - <div itemtype="furniture" itemlook="podium-north" class="draggable" style="width:200px; height:100px;" data-height="100" data-width="200" title="{{lang_podium}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="roundeddesk-east" class="draggable" style="width:75px; height:100px;" data-height="100" data-width="75" title="{{lang_roundeddesk}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="roundtable" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_roundtable}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="semicirculartable-north" class="draggable" style="width:200px; height:100px;" data-height="100" data-width="200" title="{{lang_semicirculartable}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="squaretable" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_squaretable}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="studentdesk-north" class="draggable" style="width:150px; height:100px;" data-height="100" data-width="150" title="{{lang_studentdesk}}"></div> - </li> - - - </ul> - - </div> - - <div role="tabpanel" class="tab-pane" id="chairs"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="armchair-south" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_armchair}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="chair-south" class="draggable" style="width:125px; height:100px;" data-height="100" data-width="125" title="{{lang_chair}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="chair2-south" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_chair}}"></div> - </li> - - - <li> - <div itemtype="furniture" itemlook="couch-south" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_couch}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="greenchair-south" class="draggable" style="width:125px; height:100px;" data-height="100" data-width="125" title="{{lang_greenchair}}"></div> - </li> - - <li> - <div itemtype="furniture" itemlook="studentdeskchair-north" class="draggable" style="width:100px; height:100px;" data-height="100" data-width="100" title="{{lang_studentdeskchair}}"></div> - </li> - </ul> - </div> - - <div role="tabpanel" class="tab-pane" id="furniture"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="locker-east" class="draggable" style="width:100px; height:75px;" data-height="75" data-width="100" title="{{lang_locker}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="locker-north" class="draggable" style="width:75px; height:100px;" data-height="100" data-width="75" title="{{lang_locker}}"></div> - </li> - - <li> - <div itemtype="furniture" itemlook="coatrack-east" class="draggable" style="width:25px; height:150px;" data-height="150" data-width="25" title="{{lang_coatrack}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="coatrack-north" class="draggable" style="width:150px; height:25px;" data-height="25" data-width="150" title="{{lang_coatrack}}"></div> - </li> - - - <li> - <div itemtype="furniture" itemlook="lecturetheaterrow" class="draggable" style="width:725px; height:100px;" data-height="100" data-width="725" title="{{lang_lecturetheaterrow}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="lecturetheaterrowseats" class="draggable" style="width:725px; height:50px;" data-height="50" data-width="725" title="{{lang_lecturetheaterrow}}"></div> - </li> - - </ul> - </div> - - <div role="tabpanel" class="tab-pane" id="officesupply"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="papertray" class="draggable" style="width:25px; height:50px;" data-height="50" data-width="25" title="{{lang_papertray}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="wastecan" class="draggable" style="width:50px; height:50px;" data-height="50" data-width="50" title="{{lang_wastecan}}"></div> - </li> - - </ul> - </div> - <div role="tabpanel" class="tab-pane" id="plants"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="plant" class="draggable" style="width:75px; height:75px;" data-height="75" data-width="75" title="{{lang_plant}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="plant2" class="draggable" style="width:75px; height:75px;" data-height="75" data-width="75" title="{{lang_plant}}"></div> - </li> - <li> - <div itemtype="furniture" itemlook="plant3" class="draggable" style="width:75px; height:75px;" data-height="75" data-width="75" title="{{lang_plant}}"></div> - </li> - </ul> - </div> - <div role="tabpanel" class="tab-pane" id="misc"> - <ul class="toollist"> - <li> - <div itemtype="furniture" itemlook="projectionscreen" class="draggable" style="width:525px; height:25px;" data-height="25" data-width="525" title="{{lang_plant}}"></div> - </li> - </ul> - </div> - - </div> - </div> - </div> - - - - <div class="panel panel-default" id="drawpanel"> - <div class="panel-heading"> - <h3 class="panel-title">{{lang_roomplan}}</h3> - </div> - <div class="panel-body"> - <div id="drawarea" style="top:0px; left:0px;"> - <div id="draw-element-area" style="width:100%; height:100%;"></div> - </div> - <div id="scaleContainer"> - <span id="zoom-fit" class="glyphicon glyphicon-move" aria-hidden="true"></span> - <div> - <div id="scaleslider"></div> - <span id="zoom-out" class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span> - <span id="zoom-in" class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span> - </div> - </div> - </div> - - - </div> - -<div class="pull-left"> - <div class="input-group" style="width:1px"> - <div class="input-group-addon">{{lang_managerIp}}</div> - <input class="form-control" type="text" id="manager-ip" value="{{managerip}}" placeholder="1.2.3.4" style="width:120px"> - <div class="input-group-addon checkbox"><input id="dedi-mgr" type="checkbox" {{dediMgrChecked}}> <label for="dedi-mgr">{{lang_dedicatedManager}}</label></div> - </div> -</div> -<div class="pull-right"> - <button class="btn btn-default" onclick="triggerCancel()">{{lang_cancel}}</button> - <button id="saveBtn" class="btn btn-primary">{{lang_save}}</button> -</div> -<div class="clearfix"></div> - - -<script type="application/javascript"><!-- -var locationId = '{{locationid}}'; -var subnetMachines, roomConfiguration; -var plannerLoadState = 'invalid'; -document.addEventListener("DOMContentLoaded", function () { - - subnetMachines = makeCombinedField({{{subnetMachines}}}); - roomConfiguration = {{{roomConfiguration}}}; - - $.when( - $.getScript("modules/roomplanner/js/lib/jquery-collision.js"), - $.getScript("modules/roomplanner/js/lib/jquery-ui-draggable-collision.js"), - $.getScript("modules/roomplanner/js/grid.js"), - $.Deferred(function( deferred ){ - $( deferred.resolve ); - }) - ).done(function() { - $.getScript("modules/roomplanner/js/init.js", function() { - initRoomplanner(); - loadRoom(); - }); - }); -}); - -function loadRoom() { - roomplanner.load(roomConfiguration); // TODO: Filter invalid PCs, they're currently invisible and cannot be removed - plannerLoadState = roomplanner.serialize(); -} - -function triggerCancel() { - if (roomplanner.serialize() !== plannerLoadState) { - if (!confirm('{{lang_confirmDiscardChanges}}')) - return; - } - window.close(); - // In case this page wasn't opened via JS, it will not close on modern browsers, so let's reset - loadRoom(); -} - -// --></script> |