[thirdparty-commits] jpeeler: mantis/trunk r63 - in /mantis/trunk: ./ core/

SVN commits to the Digium third-party software repository thirdparty-commits at lists.digium.com
Tue Mar 10 12:24:55 CDT 2009


Author: jpeeler
Date: Tue Mar 10 12:24:52 2009
New Revision: 63

URL: http://svn.digium.com/svn-view/thirdparty?view=rev&rev=63
Log:
add a page for those with legal privileges to be able to see all the rejected licenses information

Added:
    mantis/trunk/license_rejected.php   (with props)
Modified:
    mantis/trunk/core/html_api.php
    mantis/trunk/core/license_api.php

Modified: mantis/trunk/core/html_api.php
URL: http://svn.digium.com/svn-view/thirdparty/mantis/trunk/core/html_api.php?view=diff&rev=63&r1=62&r2=63
==============================================================================
--- mantis/trunk/core/html_api.php (original)
+++ mantis/trunk/core/html_api.php Tue Mar 10 12:24:52 2009
@@ -558,6 +558,9 @@
  
  				if ( access_has_project_level( config_get( 'view_pending_threshold' ) ) )
  					$t_menu_options[] = '<a href="license_pending.php">Pending Licenses</a>';
+
+				if ( access_has_project_level( config_get( 'manage_pending_threshold' ) ) )
+ 					$t_menu_options[] = '<a href="license_rejected.php">Rejected Licenses</a>';
  
  				# Changelog Page -- Disabled
  				/*if ( access_has_project_level( config_get( 'view_changelog_threshold' ) ) ) {

Modified: mantis/trunk/core/license_api.php
URL: http://svn.digium.com/svn-view/thirdparty/mantis/trunk/core/license_api.php?view=diff&rev=63&r1=62&r2=63
==============================================================================
--- mantis/trunk/core/license_api.php (original)
+++ mantis/trunk/core/license_api.php Tue Mar 10 12:24:52 2009
@@ -201,10 +201,13 @@
 		return $results;
 	}
 
-	function get_rejected_licenses( $p_id ) {
+	function get_rejected_licenses( $p_id = NULL ) {
 		$results = array();
 
-		$sql = sprintf("SELECT * FROM mantis_license_table WHERE user_id = %d AND length(reject_reason)", $p_id);
+		if ($p_id)
+			$sql = sprintf("SELECT * FROM mantis_license_table WHERE user_id = %d AND length(reject_reason)", $p_id);
+		else
+			$sql = "SELECT * FROM mantis_license_table WHERE length(reject_reason)";
 
 		$result = db_query($sql);
 
@@ -217,6 +220,16 @@
 	function get_license_columns() {
 		# this has to be hard coded because db_fetch_array is returning both the associative and numeric array together
 		return array("id", "user_id", "name", "dob", "company", "job_title", "address_city", "address_country", "nationality_country", "email", "date_signed", "license_ver");
+	}
+
+
+	function get_rejected_license_columns() {
+		# this has to be hard coded because db_fetch_array is returning both the associative and numeric array together
+		return array("id", "user_id", "name", "dob", "company", "job_title", "address_city", "address_country", "nationality_country", "email", "date_signed", "date_expired", "license_ver", "reject_reason");
+	}
+	function get_rejected_license_columns_pretty() {
+		# should match get_rejected_license_columns above, just prettier
+		return array("ID", "Username", "Real name", "DOB", "Company", "Job title", "City", "Country", "Nationality", "E-mail", "Date signed", "Date expired", "Version", "Reject reason");
 	}
 
 	function get_all_licenses() {

Added: mantis/trunk/license_rejected.php
URL: http://svn.digium.com/svn-view/thirdparty/mantis/trunk/license_rejected.php?view=auto&rev=63
==============================================================================
--- mantis/trunk/license_rejected.php (added)
+++ mantis/trunk/license_rejected.php Tue Mar 10 12:24:52 2009
@@ -1,0 +1,56 @@
+<?php
+	require_once("core.php");
+
+	$t_core_path = config_get("core_path");
+
+	require_once( $t_core_path . "current_user_api.php" );
+	require_once( $t_core_path . "license_api.php" );
+
+	access_ensure_global_level( config_get( 'manage_pending_threshold' ) );
+
+	html_page_top1();
+	html_page_top2();
+
+	echo "<br />\n";
+	//print_bracket_link( 'license_csv.php', 'CSV export of all license information' );
+	//echo "<br /><br />\n";
+	echo "<table class=\"width100\" cellspacing=\"1\" cellpadding=\"1\">\n";
+
+	$p_rejected_licenses = get_rejected_licenses();
+
+	if ($p_rejected_licenses) {
+		$columns = get_rejected_license_columns_pretty();
+
+		echo "  <tr>\n";
+
+		foreach($columns as $col)
+			echo "    <td class=\"form-title\">{$col}</td>\n";
+
+		echo "  </tr>\n";
+
+		foreach($p_rejected_licenses as $c_result) {
+			echo "  <tr " . helper_alternate_class() . ">\n";
+
+			$c_result["date_signed"] = date("F jS, Y, g:i:s a", strtotime($c_result["date_signed"]));
+			$c_result["date_expired"] = date("F jS, Y, g:i:s a", strtotime($c_result["date_signed"]));
+			$c_user_id = $c_result["user_id"];
+			$c_result["email"] = user_get_email($c_result["user_id"]);
+			$c_result["user_id"] = user_get_name($c_result["user_id"]);
+
+
+			foreach(get_rejected_license_columns() as $k) {
+				echo "  <td>{$c_result[$k]}</td>\n";
+			}
+
+			echo "  </tr>\n";
+		}
+	} else {
+		echo "  <tr>\n";
+		echo "    <td class=\"form-title\">No rejected licenses found!</td>\n";
+		echo "  </tr>\n";
+	}
+
+	echo "</table>\n";
+
+	html_page_bottom1( __FILE__ );
+?>

Propchange: mantis/trunk/license_rejected.php
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: mantis/trunk/license_rejected.php
------------------------------------------------------------------------------
    svn:executable = *

Propchange: mantis/trunk/license_rejected.php
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: mantis/trunk/license_rejected.php
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the thirdparty-commits mailing list