From 7cfcaeb9d7d6d89c2d9e66e496cbe6f073a7d449 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Sat, 4 Mar 2023 14:55:07 +0100 Subject: [PATCH] Refactored asset and location --- asset.php | 176 ++++++++++++++++++++++++++++- assetadd.php | 36 ------ assetclass.php | 2 +- assetdel.php | 31 ----- assetedit.php | 33 ------ assetview.php | 41 ------- config.php-sample | 9 ++ includes.php | 6 +- install/mysql.sql | 2 + location.php | 244 +++++++++++++++++++++++++++++++++++++++- submit.php | 24 ++-- tpl/assetadd.tpl | 5 +- tpl/assetclassgroup.tpl | 2 +- tpl/assetdel.tpl | 9 +- tpl/assetedit.tpl | 8 +- tpl/assetview.tpl | 6 +- tpl/location.tpl | 2 +- tpl/locationadd.tpl | 5 +- tpl/locationdel.tpl | 57 +++++----- tpl/locationedit.tpl | 7 +- tpl/locationview.tpl | 8 +- 21 files changed, 494 insertions(+), 219 deletions(-) delete mode 100644 assetadd.php delete mode 100644 assetdel.php delete mode 100644 assetedit.php delete mode 100644 assetview.php diff --git a/asset.php b/asset.php index 2f43754..131849a 100644 --- a/asset.php +++ b/asset.php @@ -8,9 +8,78 @@ SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ include("includes.php"); - + +if (isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id'] or $id = 0; +} + +// ========== ACTIONS START =================================================== +switch ($submit = form_get_action()) { + + case NULL: break; + + case 'add': $action = ACT_ADD; break; + case 'view': $action = ACT_VIEW; break; + case 'edit': $action = ACT_EDIT; break; + case 'del': $action = ACT_DELETE; break; + + case 'insert': + $name = sanitize($_POST['asset_name']); + $hostname = sanitize($_POST['asset_hostname']); + $assetclass_id = sanitize($_POST['assetclass_id']); + $info = sanitize($_POST['asset_info']); + $intf = sanitize($_POST['asset_intf']); + $asset_type = sanitize($_POST['asset_type']); + + $sql = "INSERT INTO asset + (asset_name, asset_hostname, assetclass_id, asset_info, + asset_intf, asset_type) + VALUE + (?, ?, ?, ?, ?, ?)"; + $sth = $dbh->prepare($sql); + $sth->execute([$name, $hostname, $assetclass_id, $info, $intf, $asset_type]); + $id = $dbh->lastInsertId(); + $action = ACT_VIEW; + break; + + case 'update': + $asset_name = sanitize($_POST['asset_name']); + $asset_info = sanitize($_POST['asset_info']); + $asset_intf = sanitize($_POST['asset_intf']); + $asset_hostname = sanitize($_POST['asset_hostname']); + $assetclass_id = sanitize($_POST['assetclass_id']); + $asset_type = sanitize($_POST['asset_type']); + + $sql = "UPDATE asset SET + asset_name=?, asset_info=?, asset_hostname=?, + assetclass_id=?, asset_intf=?, asset_type=? + WHERE asset_id=?"; + $sth = $dbh->prepare($sql); + $sth->execute([$asset_name, $asset_info, $asset_hostname, + $assetclass_id, $asset_intf, $asset_type, + $id]); + $action = ACT_VIEW; + break; + + case 'delete': + $sth = $dbh->prepare("DELETE FROM asset WHERE asset_id=?"); + $sth->execute([$id]); + $sth = $dbh->prepare("DELETE FROM node WHERE asset_id=?"); + $sth->execute([$id]); + $action = ACT_DEFAULT; + break; + + default: + $g_error->Add(submit_error($submit)); + $valid = FALSE; +} + +// ========== ACTIONS END ===================================================== + include("header.php"); - + +if ($action == ACT_DEFAULT): +// ========== VARIANT: default behavior ======================================= // create letter links $sql = "SELECT DISTINCT SUBSTRING(UPPER(asset_name),1,1) AS asset_letter @@ -43,5 +112,106 @@ $smarty->assign("assets", $sth->fetchAll()); $smarty->display("asset.tpl"); -include("footer.php"); +elseif ($action == ACT_ADD): +// ========== VARIANT: add record ============================================= + +if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = ""); +$smarty->assign("assetclass_id", $assetclass_id); + +$sql = "SELECT assetclass_id, assetclass_name + FROM assetclass + ORDER BY assetclass_name"; +$sth = $dbh->query($sql); + +$types = db_load_enum('asset','asset_type'); + +$smarty->assign("type_ids", $types); +$smarty->assign("type_names", $types); +$smarty->assign("type_selected", $types[0]); + +$assetclass_options = array(); +foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) { + $assetclass_options[$rec[0]] = $rec[1]; +} +$smarty->assign("assetclass_options", $assetclass_options); + +$smarty->display("assetadd.tpl"); + +elseif ($action == ACT_VIEW): +// ========== VARIANT: view single record ===================================== + +$sql = "SELECT a.asset_id, a.asset_name, a.asset_hostname, a.asset_info, + a.asset_intf, a.asset_type, c.assetclass_id, c.assetclass_name + FROM asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) + WHERE a.asset_id=?"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$asset = $sth->fetch(PDO::FETCH_OBJ); +$smarty->assign("asset", $asset); + +$sql = "SELECT node_id, node_ip, + CONCAT(LEFT(node_info, 40), IF(CHAR_LENGTH(node_info)>40,'...','')) AS node_info + FROM node + WHERE asset_id=? + ORDER BY INET_ATON(node_ip)"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC)); + +// external systems +// extlink_id +// asset_id +// Type: enum('cdb','zabbix','topdesk', osticket +// ID: extlink_refid int +// extlink_uid string + +// $sql = "SELECT extlink_id, extlink_type, extlink_refid, extlink_uid FROM extline WHERE extlink_asset_id=?"; + +$smarty->display("assetview.tpl"); + +elseif ($action == ACT_EDIT): +// ========== VARIANT: edit single record ===================================== + +$sql = "SELECT asset_id, asset_name, asset_hostname, asset_info, asset_intf, + assetclass_id, asset_type + FROM asset + WHERE asset_id=?"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$smarty->assign("asset", $sth->fetch(PDO::FETCH_OBJ)); + +// Type selection +$smarty->assign("type_ids", ['active', 'passive']); +$smarty->assign("type_names", ['Active', 'Passive']); + +$smarty->assign("assetclass_options", db_get_options_assetclass()); + +$smarty->display("assetedit.tpl"); + +elseif ($action == ACT_DELETE): +// ========== VARIANT: delete record ========================================== + +// asset to delete +$sth = $dbh->prepare("SELECT asset_name FROM asset WHERE asset_id=?"); +$sth->execute([$id]); +$smarty->assign("asset_id", $id); +$smarty->assign("asset_name", $sth->fetchColumn()); + +// nodes to delete +$sql = "SELECT node_id, node_ip FROM node WHERE asset_id=? ORDER BY INET_ATON(node_ip)"; +$sth = $dbh->prepare($sql); +$sth->execute([$asset_id]); +$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC)); + +$smarty->display("assetdel.tpl"); + +else: +// ========== ERROR UNKNOWN VARIANT =========================================== + +echo "

Unknown function call: Please report to system development!

\n"; + +endif; // $action == ... +// ========== END OF VARIANTS ================================================= + +$smarty->display('footer.tpl'); ?> diff --git a/assetadd.php b/assetadd.php deleted file mode 100644 index d411f44..0000000 --- a/assetadd.php +++ /dev/null @@ -1,36 +0,0 @@ -query($sql); - -$types = db_load_enum('asset','asset_type'); - -$smarty->assign("type_ids", $types); -$smarty->assign("type_names", $types); -$smarty->assign("type_selected", $types[0]); - -$assetclass_options = array(); -foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) { - $assetclass_options[$rec[0]] = $rec[1]; -} - -$smarty->assign("assetclass_options", $assetclass_options); -$smarty->display("assetadd.tpl"); - -include("footer.php"); -?> \ No newline at end of file diff --git a/assetclass.php b/assetclass.php index 606c9af..bd59bd9 100644 --- a/assetclass.php +++ b/assetclass.php @@ -114,7 +114,7 @@ $sql = "SELECT asset_id, asset_name, WHERE assetclass_id=? ORDER BY asset_name"; $sth = $dbh->prepare($sql); -$sth->execute([$assetclass_id]); +$sth->execute([$id]); $smarty->assign("assets", $sth->fetchAll(PDO::FETCH_ASSOC)); $smarty->display("assetclassview.tpl"); diff --git a/assetdel.php b/assetdel.php deleted file mode 100644 index 4b63a10..0000000 --- a/assetdel.php +++ /dev/null @@ -1,31 +0,0 @@ -prepare("SELECT asset_name FROM asset WHERE asset_id=?"); -$sth->execute([$asset_id]); -$smarty->assign("asset_id", $asset_id); -$smarty->assign("asset_name", $sth->fetchColumn()); - -// nodes to delete -$sql = "SELECT node_id, node_ip FROM node WHERE asset_id=? ORDER BY INET_ATON(node_ip)"; -$sth = $dbh->prepare($sql); -$sth->execute([$asset_id]); -$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC)); - -$smarty->display("assetdel.tpl"); - -include("footer.php"); -?> diff --git a/assetedit.php b/assetedit.php deleted file mode 100644 index f5c0e8b..0000000 --- a/assetedit.php +++ /dev/null @@ -1,33 +0,0 @@ -prepare($sql); -$sth->execute([$asset_id]); -$smarty->assign("asset", $sth->fetch(PDO::FETCH_OBJ)); - -// Type selection -$smarty->assign("type_ids", ['active', 'passive']); -$smarty->assign("type_names", ['Active', 'Passive']); - -$smarty->assign("assetclass_options", db_get_options_assetclass()); - -$smarty->display("assetedit.tpl"); - -include("footer.php"); -?> diff --git a/assetview.php b/assetview.php deleted file mode 100644 index 55ed18d..0000000 --- a/assetview.php +++ /dev/null @@ -1,41 +0,0 @@ -prepare($sql); -$sth->execute([$asset_id]); -$asset = $sth->fetch(PDO::FETCH_OBJ); -$smarty->assign("asset", $asset); - -$sql = "SELECT node_id, node_ip, - CONCAT(LEFT(node_info, 40), IF(CHAR_LENGTH(node_info)>40,'...','')) AS node_info - FROM node - WHERE asset_id=? - ORDER BY INET_ATON(node_ip)"; -$sth = $dbh->prepare($sql); -$sth->execute([$asset_id]); -$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC)); - -$smarty->display("assetview.tpl"); - -include("footer.php"); -?> diff --git a/config.php-sample b/config.php-sample index 1978cef..916bced 100644 --- a/config.php-sample +++ b/config.php-sample @@ -33,4 +33,13 @@ $config_ldap_login_attr = 'uid'; $config_ldap_bind_dn = 'cn=dummy,ou=organizationalunit,dc=example,dc=com'; $config_ldap_bind_pass = 'secret'; +// external systems +$config_ext[] = [ + 'zabbix' => ['enabled' => false, + 'host' => 'localhost', + 'db' => 'zabbix', + 'user' => 'ipreg', + 'pass' => 'topsecret'] + ]; + ?> diff --git a/includes.php b/includes.php index 2b175e7..880f88e 100644 --- a/includes.php +++ b/includes.php @@ -16,7 +16,11 @@ if (empty($_SESSION['suser_id'])) { header("Location: login.php"); exit; } - + +// required config vars, may be overwritten later +$config_auth_ldap = false; +$config_ext = array(); + include("config.php"); // connect to database diff --git a/install/mysql.sql b/install/mysql.sql index e4f9966..054d482 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -53,10 +53,12 @@ CREATE TABLE cablevlan ( -- WIP -- Reference to external systems +-- class 1=asset; per ext type different class-ids possible CREATE TABLE extlink ( extlink_id int(10) NOT NULL AUTO_INCREMENT, asset_id int(10) NOT NULL, extlink_type enum('cdb','zabbix', 'topdesk') NOT NULL DEFAULT 'cdb', + extlink_class tinyint(4) NOT NULL DEFAULT 1, extlink_refid int(10) DEFAULT NULL, extlink_uid varchar(65) DEFAULT NULL, PRIMARY KEY (extlink_id), diff --git a/location.php b/location.php index 611705d..d317ef3 100644 --- a/location.php +++ b/location.php @@ -8,9 +8,100 @@ SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ include("includes.php"); - + +if (isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id'] or $id = 0; +} + +// look for parents +// function to look for parents and create a new array for every child +function location($parents, $parent = 0) { + // loop array to check + foreach($parents[$parent] as $child) { + if(isset($parents[$child])) { + // element has children + $children[$child] = location($parents, $child); + } else { + // no children, set NULL + $children[$child] = NULL; + } + } + + // and again... + return $children; +} + +// recursive children check to template +function checkchildren($locations, $level) { + global $location_options; + global $location_names; + global $location_parent; + + foreach ($locations as $parent=>$child) { + $row = str_repeat("-  ", $level) . $location_names[$parent]; + $location_options[$parent] = $row; + if (isset($child)) { + checkchildren($child, $level+1); + } + } +} + +// ========== ACTIONS START =================================================== +switch ($submit = form_get_action()) { + + case NULL: break; + + case 'add': $action = ACT_ADD; break; + case 'view': $action = ACT_VIEW; break; + case 'edit': $action = ACT_EDIT; break; + case 'del': $action = ACT_DELETE; break; + + case 'insert': + $name = sanitize($_POST['location_name']); + $parent = sanitize($_POST['location_parent']); + $info = sanitize($_POST['location_info']); + + $sql = "INSERT INTO location ( + location_name, location_parent, location_info + ) + VALUE (?, ?, ?)"; + $sth = $dbh->prepare($sql); + $sth->execute([$name, $parent, $info]); + + $id = $dbh->lastInsertId(); + $action = ACT_VIEW; + break; + + case 'update': + $location_name = sanitize($_POST['location_name']); + $location_info = sanitize($_POST['location_info']); + $parentlocation_id = sanitize($_POST['parentlocation_id']); + $sql = "UPDATE location SET + location_name=?, location_parent=?, location_info=? + WHERE location_id=?"; + $sth = $dbh->prepare($sql); + $sth->execute([$location_name, $parentlocation_id, $location_info, $id]); + $action = ACT_VIEW; + break; + + case 'delete': + $sth = $dbh->prepare("DELETE FROM location WHERE location_id=?"); + $sth->execute([$id]); + $action = ACT_DEFAULT; + break; + + default: + $g_error->Add(submit_error($submit)); + $valid = FALSE; +} + +// ========== ACTIONS END ===================================================== + include("header.php"); - + +if ($action == ACT_DEFAULT): +// ========== VARIANT: default behavior ======================================= + $sql = "SELECT location_id AS id, location_name AS value, location_parent AS parent_id FROM location ORDER BY location_parent, location_sort, location_name"; @@ -39,5 +130,152 @@ $smarty->assign("locations", $tree); $smarty->display("location.tpl"); -include("footer.php"); +elseif ($action == ACT_ADD): +// ========== VARIANT: add record ============================================= + +$sql = "SELECT location_id AS id, location_name AS name, + location_parent AS parent, location_sort AS sort + FROM location + ORDER BY location_parent, location_sort, location_name"; +$sth = $dbh->query($sql); +$locations = $sth->fetchAll(); + +if (count($locations) > 0) { + foreach ($locations AS $location) { + $location_names[$location['id']] = $location['name']; + $parents[$location['parent']][] = $location['id']; + } +} + +$tree = location($parents); + +// create tree option list +$location_options = array(0 => '-'); +checkchildren($tree, 0); + +$smarty->assign("location_options", $location_options); + +$location_parent = sanitize($_GET['parent']); +$smarty->assign("location_parent", $location_parent); + +$smarty->display("locationadd.tpl"); + +elseif ($action == ACT_VIEW): +// ========== VARIANT: view single record ===================================== + +// base location +$sql = "SELECT location_id AS id, location_name AS name, + location_parent AS parent_id, location_info AS info, + CONCAT('locationview.php?location_id=', location_id) AS url + FROM location + WHERE location_id=?"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$location = $sth->fetch(PDO::FETCH_OBJ); +$smarty->assign("location", $location); + +// crumbs +$crumbs[] = $location; +$sql = "SELECT location_id AS id, location_name AS name, + location_parent AS parent_id, + CONCAT('locationview.php?location_id=', location_id) AS url + FROM location + WHERE location_id=?"; +$sth = $dbh->prepare($sql); +while ($crumbs[0]->parent_id != 0) { + $sth->execute([$crumbs[0]->parent_id]); + $result = $sth->fetch(PDO::FETCH_OBJ); + array_unshift($crumbs, $result); +} +$smarty->assign("crumbs", $crumbs); + +// sublocations +$sql = "SELECT location_id AS sublocation_id, location_name AS sublocation_name, + LEFT(location_info, 40) AS info_short, + CHAR_LENGTH(location_info) AS info_length + FROM location + WHERE location_parent=? + ORDER BY location_name"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$smarty->assign("sublocations", $sth->fetchAll()); + +// subnets +$sql = "SELECT s.subnet_id, s.subnet_address, s.subnet_mask + FROM subnet AS s LEFT JOIN subnetlocation AS l USING (subnet_id) + WHERE l.location_id=? + ORDER BY INET_ATON(s.subnet_address)"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$smarty->assign("subnets", $sth->fetchAll()); + +$smarty->display("locationview.tpl"); + +elseif ($action == ACT_EDIT): +// ========== VARIANT: edit single record ===================================== + +// TODO implement sorting with location_sort + +// location +$sql = "SELECT location_id AS id, location_name AS name, location_parent AS parent, + location_info AS info, location_sort AS sort + FROM location + WHERE location_id=?"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$location = $sth->fetch(PDO::FETCH_OBJ); + +$location_parent = $location->parent; + +$smarty->assign("location", $location); + +// parent location +$sql = "SELECT location_id, location_name, location_parent + FROM location + WHERE location_id != ? + ORDER BY location_name"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); + +$locations = $sth->fetchAll(); + +$location_counter = count($locations); + +$smarty->assign("location_counter", $location_counter); + +// any loactions? +if ($location_counter>0) { + foreach($locations AS $location) { + $location_names[$location['location_id']] = $location['location_name']; + $parents[$location['location_parent']][] = $location['location_id']; + } +} + +$tree = location($parents); +$location_options = array(0 => '-'); +checkchildren($tree, 0); +$smarty->assign("location_options", $location_options); +$smarty->assign("location_parent", $location_parent); + +$smarty->display("locationedit.tpl"); + +elseif ($action == ACT_DELETE): +// ========== VARIANT: delete record ========================================== + +$sql = "SELECT location_id AS id, location_name AS name FROM location WHERE location_id=?"; +$sth = $dbh->prepare($sql); +$sth->execute([$id]); +$smarty->assign("location", $sth->fetch(PDO::FETCH_OBJ)); + +$smarty->display("locationdel.tpl"); + +else: +// ========== ERROR UNKNOWN VARIANT =========================================== + +echo "

Unknown function call: Please report to system development!

\n"; + +endif; // $action == ... +// ========== END OF VARIANTS ================================================= + +$smarty->display('footer.tpl'); ?> diff --git a/submit.php b/submit.php index 1397421..6b40a08 100644 --- a/submit.php +++ b/submit.php @@ -101,7 +101,7 @@ if (isset($_POST['redirect'])) { if (isset($_POST['add'])) { switch ($_POST['add']) { - case ("asset") : +/* case ("asset") : $name = sanitize($_POST['asset_name']); $hostname = sanitize($_POST['asset_hostname']); $assetclass_id = sanitize($_POST['assetclass_id']); @@ -119,7 +119,7 @@ if (isset($_POST['add'])) { header_location("assetview.php?asset_id=" . $dbh->lastInsertId()); break; -/* + case ("assetclass") : $name = sanitize($_POST['assetclass_name']); $description = sanitize($_POST['assetclass_description']); @@ -199,7 +199,7 @@ if (isset($_POST['add'])) { header_location("subnetview.php?subnet_id=" . $subnet_id); break; - case ("location") : +/* case ("location") : $name = sanitize($_POST['location_name']); $parent = sanitize($_POST['location_parent']); $info = sanitize($_POST['location_info']); @@ -212,7 +212,7 @@ if (isset($_POST['add'])) { $sth->execute([$name, $parent, $info]); header_location("locationview.php?location_id=" . $dbh->lastInsertId()); - break; + break; */ case ("locationsubnet") : $location_id = sanitize($_POST['location_id']); @@ -386,7 +386,7 @@ if (isset($_POST['add'])) { if (isset($_POST['del'])) { switch ($_POST['del']) { - +/* case ("asset") : $asset_id = sanitize($_POST['asset_id']); @@ -398,7 +398,7 @@ if (isset($_POST['del'])) { header_location("asset.php"); break; -/* + case ("assetclass") : $assetclass_id = sanitize($_POST['assetclass_id']); @@ -415,7 +415,7 @@ if (isset($_POST['del'])) { $sth->execute([$assetclassgroup_id]); header_location("assetclassgroup.php"); - break; */ + break; case ("location") : $location_id = sanitize($_POST['location_id']); @@ -424,7 +424,7 @@ if (isset($_POST['del'])) { $sth->execute([$location_id]); header_location("location.php"); - break; + break; */ case ("locationsubnet") : $location_id = sanitize($_POST['location_id']); @@ -528,7 +528,7 @@ if (isset($_POST['del'])) { if (isset($_POST['edit'])) { switch ($_POST['edit']) { - +/* case ("asset") : $asset_id = sanitize($_POST['asset_id']); $asset_name = sanitize($_POST['asset_name']); @@ -548,7 +548,7 @@ if (isset($_POST['edit'])) { $asset_id]); header_location("assetview.php?asset_id=" . $asset_id); -/* + case ("assetclass") : $id = sanitize($_POST['assetclass_id']); $name = sanitize($_POST['assetclass_name']); @@ -563,7 +563,7 @@ if (isset($_POST['edit'])) { $sth->execute([$name, $description, $group_id, $id]); header_location("assetclassview.php?assetclass_id=" . $id); - break; */ + break; case ("assetclassgroup") : $acg_id = sanitize($_POST['acg_id']); @@ -593,7 +593,7 @@ if (isset($_POST['edit'])) { $sth->execute([$location_name, $parentlocation_id, $location_info, $location_id]); header_location("locationview.php?location_id=" . $location_id); - break; + break; */ case ("node") : $node_id = sanitize($_POST['node_id']); diff --git a/tpl/assetadd.tpl b/tpl/assetadd.tpl index c61f8a2..2a31d73 100644 --- a/tpl/assetadd.tpl +++ b/tpl/assetadd.tpl @@ -1,5 +1,4 @@ -
- + @@ -8,7 +7,7 @@
{$lang_cancel} - +
diff --git a/tpl/assetclassgroup.tpl b/tpl/assetclassgroup.tpl index 8218472..4e9158a 100644 --- a/tpl/assetclassgroup.tpl +++ b/tpl/assetclassgroup.tpl @@ -28,7 +28,7 @@ #{$acg.color} - {$acg.name} + {$acg.name} {$acg.description} diff --git a/tpl/assetdel.tpl b/tpl/assetdel.tpl index c561b2b..494bb96 100644 --- a/tpl/assetdel.tpl +++ b/tpl/assetdel.tpl @@ -1,6 +1,5 @@ - - - + + @@ -9,7 +8,7 @@
{$lang_cancel} - +
@@ -29,7 +28,7 @@ {$lang_asset_name} - {$asset_name} + {$asset_name} diff --git a/tpl/assetedit.tpl b/tpl/assetedit.tpl index dcea3d6..e2696ee 100644 --- a/tpl/assetedit.tpl +++ b/tpl/assetedit.tpl @@ -1,7 +1,5 @@ - - - - + + @@ -11,7 +9,7 @@
{$lang_cancel} - +
diff --git a/tpl/assetview.tpl b/tpl/assetview.tpl index e7a1a4d..ccace93 100644 --- a/tpl/assetview.tpl +++ b/tpl/assetview.tpl @@ -9,10 +9,10 @@ {$lang_assignnodetoasset} {/if} {if $suser_edit} - {$lang_asset_edit} + {$lang_asset_edit} {/if} {if $suser_delete} - {$lang_asset_edit} + {$lang_asset_edit} {/if} @@ -32,7 +32,7 @@ {$lang_asset_name} - {$asset->asset_name} + {$asset->asset_name} diff --git a/tpl/location.tpl b/tpl/location.tpl index 091434c..38a076a 100644 --- a/tpl/location.tpl +++ b/tpl/location.tpl @@ -6,7 +6,7 @@ {if $suser_add || $suser_admin} - {$lang_location_add} + {$lang_location_add} {/if} diff --git a/tpl/locationadd.tpl b/tpl/locationadd.tpl index 324c955..ed571ef 100644 --- a/tpl/locationadd.tpl +++ b/tpl/locationadd.tpl @@ -1,5 +1,4 @@ - - + @@ -9,7 +8,7 @@
{$lang_cancel} - +
diff --git a/tpl/locationdel.tpl b/tpl/locationdel.tpl index c10cb30..77cc011 100644 --- a/tpl/locationdel.tpl +++ b/tpl/locationdel.tpl @@ -1,39 +1,38 @@ - - - + + - - - - + + + +
- - {$location_name} - - {$lang_cancel} - -
+ + {$location->name} + + {$lang_cancel} + +

- - - - - - - - + + + + + + + +
- {$lang_location_del} - -   -
- {$lang_location_name} - - {$location->name} -
+ {$lang_location_del} + +   +
+ {$lang_location_name} + + {$location->name} +

diff --git a/tpl/locationedit.tpl b/tpl/locationedit.tpl index 06a90f1..2d85e32 100644 --- a/tpl/locationedit.tpl +++ b/tpl/locationedit.tpl @@ -1,6 +1,5 @@ -
- - + + @@ -10,7 +9,7 @@
{$lang_cancel} - +
diff --git a/tpl/locationview.tpl b/tpl/locationview.tpl index 50c32c9..f4f3b17 100644 --- a/tpl/locationview.tpl +++ b/tpl/locationview.tpl @@ -6,13 +6,13 @@ {if $suser_add} - {$lang_sublocation_add} + {$lang_sublocation_add} {/if} {if $suser_edit} - {$lang_location_edit} + {$lang_location_edit} {/if} {if $suser_delete} - {$lang_location_del} + {$lang_location_del} {/if} @@ -64,7 +64,7 @@ {foreach item=sublocation from=$sublocations} - {$sublocation.sublocation_name} + {$sublocation.sublocation_name} {$sublocation.info_short}{if $sublocation.info_length>40}…{/if}
{/foreach}