Compare commits

...

3 Commits

Author SHA1 Message Date
Thomas Hooge c13c7494bf Preselect subnet in options if defined 1 year ago
Thomas Hooge a4ecd1bff7 Fix PHP warnings and notices 1 year ago
Thomas Hooge be9610cd98 Fix styles and scripts in header 1 year ago
  1. 1
      assignnodetoasset.php
  2. 3
      lib.php
  3. 22
      lib/functions.php
  4. 3
      node.php
  5. 1
      nodeadd.php
  6. 2
      tpl/assignnodetoasset.tpl
  7. 4
      tpl/header.tpl
  8. 2
      tpl/node.tpl
  9. 2
      tpl/nodeadd.tpl

@ -17,6 +17,7 @@ include("header.php");
$smarty->assign("node_ip", $node_ip);
$smarty->assign("asset_id", $asset_id);
$smarty->assign("subnet_id", $subnet_id);
$query = "SELECT
asset_id,

@ -26,6 +26,7 @@ $smarty = new Smarty();
$smarty->template_dir = 'tpl';
$smarty->compile_dir = 'tpl_c';
$smarty->registerPlugin('function', 'treelist', 'print_tree');
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']);
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips'] ?? 'off');
?>

@ -1,23 +1,10 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2007-2009 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
Copyright (C) 2011-2023 Thomas Hooge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
For more information, visit http://sourceforge.net/projects/ipreg,
or contact me at wietsew@users.sourceforge.net
SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
// strip mac address to 12 char string
@ -154,7 +141,8 @@
return $output;
}
function print_tree ($params, &$smarty) {
//function print_tree($params, &$smarty) {
function print_tree($params, Smarty_Internal_Template $template) {
if (empty($params['level'])) {
$level = 0;
} else {

@ -15,7 +15,8 @@ if(isset($_GET['subnet_id'])) {
$subnet_view = "WHERE node.subnet_id=" . $subnet_id;
$smarty->assign("subnet_id", $subnet_id);
} else {
$smarty->assign("subnet_id", "");
$smarty->assign("subnet_id", '');
$subnet_view = '';
}
$query = "SELECT

@ -17,6 +17,7 @@ include("header.php");
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']);
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
$smarty->assign("node_ip", $node_ip);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_options", $db->options_subnet());
$smarty->assign("assetclass_options", $db->options_assetclass());

@ -97,7 +97,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
{html_options name=subnet_id options=$subnet_options}
{html_options name=subnet_id options=$subnet_options selected=$subnet_id}
</td>
</tr>
</table>

@ -6,12 +6,16 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="images/shield.ico">
<link rel="stylesheet" href="tpl/style.css" type="text/css">
{if isset($styles)}
{foreach item=style from=$styles}
<link rel="stylesheet" href="css/{$style[0]}" type="text/css" media="{$style[1]}" />
{/foreach}
{/if}
{if isset($scripts)}
{foreach item=script from=$scripts}
<script type="text/javascript" src="lib/{$script}"></script>
{/foreach}
{/if}
</head>
<body>

@ -2,7 +2,7 @@
<tr>
<td class="header">
<img class="icon" src="images/network-ethernet.png" alt="" />
{$lang_nodes} ({$node|@count})
{$lang_nodes} ({$nodes|@count})
</td>
<td align="right">
<a href="nodeadd.php?subnet_id={$subnet_id}"><img src="image.php?icon=add" alt="{$lang_node_add}"></a>

@ -125,7 +125,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
{html_options name=subnet_id options=$subnet_options}
{html_options name=subnet_id options=$subnet_options selected=$subnet_id}
</td>
</tr>
</table>