Эх сурвалжийг харах

Add links to certain column text in a list view - integrated click on list rows to Edit items, as well. Misc bug fixes.

Nate Jones 11 жил өмнө
parent
commit
3a79ce7039

+ 41 - 9
core/apps/apps.php

@@ -81,30 +81,52 @@ require_once "resources/paging.php";
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 	echo "<tr>\n";
 	echo "	<th>".$text['label-name']."</th>\n";
 	echo "	<th>".$text['label-category']."</th>\n";
 	echo "	<th>".$text['label-subcategory']."</th>\n";
 	echo "	<th>".$text['label-version']."</th>\n";
 	echo "	<th>".$text['label-description']."</th>\n";
-	//echo "<td align='right' width='42'>\n";
-	//echo "	<a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-	//echo "</td>\n";
+	/*
+	echo "<td class='list_control_icons'>\n";
+	if (permission_exists('app_add')) {
+		echo "	<a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
+	}
+	echo "</td>\n";
+	*/
 	echo "<tr>\n";
 
 	foreach($apps as $row) {
 		if ($row['uuid'] != "d8704214-75a0-e52f-1336-f0780e29fef8") {
-			echo "<tr >\n";
-			echo "	<td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>".$row['name']."&nbsp;</td>\n";
+			/*
+			$tr_link = (permission_exists('app_edit')) ? " onclick=\"document.location.href='apps_edit.php?id=".$row['uuid']."';\"" : null;
+			*/
+			echo "<tr ".$tr_link.">\n";
+			echo "	<td valign='top' class='".$row_style[$c]."' nowrap='nowrap'>";
+			/*
+			if (permission_exists('app_edit')) {
+				echo "	<a href='apps_edit.php?id=".$row['uuid']."'>".$row['name']."</a>";
+			}
+			else {
+			*/
+				echo $row['name'];
+			/*
+			}
+			*/
+			echo "	</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['category']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['subcategory']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['version']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."' width='35%'>".$row['description']['en-us']."&nbsp;</td>\n";
 			/*  // temporarily disabled
-			echo "	<td valign='top' align='left' nowrap='nowrap' width='42'>\n";
-			echo "		&nbsp;<a href='apps_edit.php?id=".$row['uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
-			echo "		<a href='apps_delete.php?id=".$row['uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
+			echo "	<td class='list_control_icons'>";
+			if (permission_exists('app_edit')) {
+				echo "	<a href='apps_edit.php?id=".$row['uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
+			}
+			if (permission_exists('app_delete')) {
+				echo "	<a href='apps_delete.php?id=".$row['uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
+			}
 			echo "	</td>\n";
 			*/
 			echo "</tr>\n";
@@ -113,6 +135,16 @@ require_once "resources/paging.php";
 	} //end foreach
 	unset($sql, $result, $row_count);
 
+	echo "<tr>\n";
+	echo "	<td colspan='5'>&nbsp;</td>\n";
+	/*
+	echo "<td class='list_control_icons'>\n";
+	if (permission_exists('app_add')) {
+		echo "	<a href='apps_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
+	}
+	echo "</td>\n";
+	*/
+	echo "</tr>";
 	echo "</table>";
 	echo "</div>";
 	echo "<br /><br />";

+ 4 - 3
core/databases/databases.php

@@ -106,7 +106,7 @@ require_once "resources/paging.php";
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 
 	echo "<tr>\n";
 	echo th_order_by('database_driver', $text['label-driver'], $order_by, $order);
@@ -124,12 +124,13 @@ require_once "resources/paging.php";
 
 	if ($result_count > 0) {
 		foreach($result as $row) {
-			echo "<tr >\n";
+			$tr_link = " onclick=\"document.location.href='database_edit.php?id=".$row['database_uuid']."';\"";
+			echo "<tr ".$tr_link.">\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_driver']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_type']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_host']."&nbsp;</td>\n";
 			//echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_port']."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_name']."&nbsp;</td>\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'><a href='database_edit.php?id=".$row['database_uuid']."'>".$row['database_name']."</a>&nbsp;</td>\n";
 			//echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_username']."&nbsp;</td>\n";
 			//echo "	<td valign='top' class='".$row_style[$c]."'>".$row['database_path']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='row_stylebg'>".$row['database_description']."&nbsp;</td>\n";

+ 1 - 1
core/default_settings/default_setting_edit.php

@@ -213,7 +213,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 	echo "</tr>\n";
 
 	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
+	echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
 	echo "	".$text['label-subcategory'].":\n";
 	echo "</td>\n";
 	echo "<td class='vtable' align='left'>\n";

+ 12 - 5
core/default_settings/default_settings.php

@@ -111,7 +111,7 @@ require_once "resources/paging.php";
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 
 	if ($result_count > 0) {
 		$previous_category = '';
@@ -148,9 +148,16 @@ require_once "resources/paging.php";
 				echo "</td>\n";
 				echo "</tr>\n";
 			}
-			echo "<tr >\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['default_setting_subcategory']."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['default_setting_name']."&nbsp;</td>\n";
+			$tr_link = (permission_exists('default_setting_edit')) ? " onclick=\"document.location.href='default_setting_edit.php?id=".$row['default_setting_uuid']."';\"" : null;
+			echo "<tr ".$tr_link.">\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>";
+			if (permission_exists('default_setting_edit')) {
+				echo "<a href='default_setting_edit.php?id=".$row['default_setting_uuid']."'>".$row['default_setting_subcategory']."</a>";
+			}
+			else {
+				echo $row['default_setting_subcategory'];
+			}
+			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['default_setting_name']."</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>\n";
 
 			$category = $row['default_setting_category'];
@@ -176,7 +183,7 @@ require_once "resources/paging.php";
 			}
 			echo "		&nbsp;\n";
 			echo "	</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['default_setting_enabled']."&nbsp;</td>\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>".ucwords($row['default_setting_enabled'])."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['default_setting_description']."&nbsp;</td>\n";
 			echo "	<td class='list_control_icons'>";
 			if (permission_exists('default_setting_edit')) {

+ 21 - 10
core/domain_settings/domain_settings.php

@@ -106,16 +106,19 @@ require_once "resources/paging.php";
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 
 	if ($result_count > 0) {
 		$previous_category = '';
 		foreach($result as $row) {
 			if ($previous_category != $row['domain_setting_category']) {
-				echo "<tr><td colspan='4' align='left'>\n";
-				echo "	<br />\n";
-				echo "	<br />\n";
-				echo "	<b>".ucfirst($row['domain_setting_category'])."</b>&nbsp;</td></tr>\n";
+				echo "<tr>";
+				echo "	<td colspan='4' align='left'>\n";
+				echo "		<br />\n";
+				echo "		<br />\n";
+				echo "		<b>".ucfirst($row['domain_setting_category'])."</b>&nbsp;\n";
+				echo "	</td>\n";
+				echo "</tr>\n";
 				echo "<tr>\n";
 				echo th_order_by('domain_setting_subcategory', $text['label-category'], $order_by, $order);
 				echo th_order_by('domain_setting_name', $text['label-type'], $order_by, $order);
@@ -129,8 +132,16 @@ require_once "resources/paging.php";
 				echo "</td>\n";
 				echo "</tr>\n";
 			}
-			echo "<tr >\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_subcategory']."&nbsp;</td>\n";
+			$tr_link = (permission_exists('domain_setting_edit')) ? " onclick=\"document.location.href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."';\"" : null;
+			echo "<tr ".$tr_link.">\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>";
+			if (permission_exists('domain_setting_edit')) {
+				echo 	"<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."'>".$row['domain_setting_subcategory']."</a>";
+			}
+			else {
+				echo $row['domain_setting_subcategory'];
+			}
+			echo "	</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_name']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>\n";
 
@@ -158,14 +169,14 @@ require_once "resources/paging.php";
 			}
 			echo "		&nbsp;\n";
 			echo "	</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_enabled']."&nbsp;</td>\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>".ucwords($row['domain_setting_enabled'])."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_description']."&nbsp;</td>\n";
 			echo "	<td class='list_control_icons'>";
 			if (permission_exists('domain_setting_edit')) {
-			echo 		"<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
+				echo 	"<a href='domain_setting_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
 			}
 			if (permission_exists('domain_setting_delete')) {
-			echo 		"<a href='domain_setting_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
+				echo 	"<a href='domain_setting_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
 			}
 			echo "	</td>\n";
 			echo "</tr>\n";

+ 11 - 3
core/domain_settings/domains.php

@@ -164,7 +164,7 @@ else {
 	$row_style["1"] = "row_style1";
 
 	echo "<div align='center'>\n";
-	echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 	echo "<tr>\n";
 	echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
 	echo th_order_by('domain_description', $text['label-description'], $order_by, $order);
@@ -177,8 +177,16 @@ else {
 
 	if ($result_count > 0) {
 		foreach($result as $row) {
-			echo "<tr >\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_name']."&nbsp;</td>\n";
+			$tr_link = (permission_exists('domain_edit')) ? " onclick=\"document.location.href='domain_edit.php?id=".$row['domain_uuid']."';\"" : null;
+			echo "<tr ".$tr_link.">\n";
+			echo "	<td valign='top' class='".$row_style[$c]."'>";
+			if (permission_exists('domain_edit')) {
+				echo "<a href='domain_edit.php?id=".$row['domain_uuid']."'>".$row['domain_name']."</a>";
+			}
+			else {
+				echo $row['domain_name'];
+			}
+			echo "	</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['domain_description']."&nbsp;</td>\n";
 			echo "	<td class='list_control_icons'>";
 			if (permission_exists('domain_edit')) {

+ 25 - 4
core/users/groups.php

@@ -85,7 +85,7 @@ else {
 	$row_style["0"] = "row_style0";
 	$row_style["1"] = "row_style1";
 
-	$strlist = "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
+	$strlist = "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
 	$strlist .= "<tr class='border'>\n";
 	$strlist .= "	<th nowrap>".$text['label-group_name']."</th>\n";
 	$strlist .= "	<th nowrap>".$text['label-group_description']."</th>\n";
@@ -113,8 +113,22 @@ else {
 			//hide the superadmin group from non superadmin's
 		}
 		else {
-			$strlist .= "<tr>";
-			$strlist .= "<td class='".$row_style[$c]."' nowrap>".$group_name."</td>\n";
+			/*
+			$tr_link = (permission_exists('group_edit')) ? " onclick=\"document.location.href='groupedit.php?id=".$group_uuid."';\"" : null;
+			*/
+			$strlist .= "<tr ".$tr_link.">\n";
+			$strlist .= "<td class='".$row_style[$c]."' nowrap>";
+			/*
+			if (permission_exists('group_edit')) {
+				$strlist .= "<a href='groupedit.php?id=".$group_uuid."'>".$group_name."</a>";
+			}
+			else {
+			*/
+				$strlist .= $group_name;
+			/*
+			}
+			*/
+			$strlist .= "</td>\n";
 			$strlist .= "<td class='".$row_style[$c]."' nowrap>".$group_description."</td>\n";
 			$strlist .= "<td class='".$row_style[$c]."' nowrap>\n";
 			if (permission_exists('group_add') || if_group("superadmin")) {
@@ -133,7 +147,14 @@ else {
 			}
 			$strlist .= "</td>\n";
 			$strlist .= "<td class='list_control_icons' style='width: 25px;'>";
-			$strlist .= "<a href='groupdelete.php?id=$group_uuid' onclick=\"return confirm('".$text['confirm-delete']."')\" alt='".$text['button-delete']."'>$v_link_label_delete</a>";
+			/*
+			if (permission_exists('group_edit')) {
+				$strlist .= "<a href='groupedit.php?id=$group_uuid' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
+			}
+			*/
+			if (permission_exists('group_delete')) {
+				$strlist .= "<a href='groupdelete.php?id=$group_uuid' onclick=\"return confirm('".$text['confirm-delete']."')\" alt='".$text['button-delete']."'>$v_link_label_delete</a>";
+			}
 			$strlist .= "</td>\n";
 			$strlist .= "</tr>\n";
 		}