[Fusionforge-commits] r8860 - in trunk/gforge/plugins/contribtracker: common lib www

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Feb 24 13:52:41 CET 2010


Author: lolando
Date: 2010-02-24 13:52:40 +0100 (Wed, 24 Feb 2010)
New Revision: 8860

Modified:
   trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php
   trunk/gforge/plugins/contribtracker/lib/contribtracker-init.sql
   trunk/gforge/plugins/contribtracker/www/global_admin.php
   trunk/gforge/plugins/contribtracker/www/index.php
Log:
Switch actor's address field to an URL, and make it clickable on the actor details page

Modified: trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php
===================================================================
--- trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2010-02-24 01:03:42 UTC (rev 8859)
+++ trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2010-02-24 12:52:40 UTC (rev 8860)
@@ -505,16 +505,16 @@
 		return true ;
 	}
 
-	function create ($name, $address, $email, $description, $logo, $structure) {
+	function create ($name, $url, $email, $description, $logo, $structure) {
 		if ($this->getId ()) {
 			$this->setError(_('Object already exists')) ;
 			return false ;
 		}
 
 		db_begin () ;
-		$res = db_query_params ('INSERT INTO plugin_contribtracker_actor (name,address,email,description,logo,struct_id) VALUES ($1,$2,$3,$4,$5,$6)',
+		$res = db_query_params ('INSERT INTO plugin_contribtracker_actor (name,url,email,description,logo,struct_id) VALUES ($1,$2,$3,$4,$5,$6)',
 					array ($name,
-					       $address,
+					       $url,
 					       $email,
 					       $description,
 					       base64_encode ($logo),
@@ -538,7 +538,7 @@
 		return $this->fetchData ($id) ;
 	}
 
-	function update ($name, $address, $email, $description, $logo, $structure) {
+	function update ($name, $url, $email, $description, $logo, $structure) {
 		if (! $this->getId ()) {
 			$this->setError(_('Object does not exist')) ;
 			return false ;
@@ -547,9 +547,9 @@
 		$id = $this->getId () ;
 
 		db_begin () ;
-		$res = db_query_params ('UPDATE plugin_contribtracker_actor SET (name,address,email,description,logo,struct_id) = ($1,$2,$3,$4,$5,$6) WHERE actor_id = $7',
+		$res = db_query_params ('UPDATE plugin_contribtracker_actor SET (name,url,email,description,logo,struct_id) = ($1,$2,$3,$4,$5,$6) WHERE actor_id = $7',
 					array ($name,
-					       $address,
+					       $url,
 					       $email,
 					       $description,
 					       base64_encode ($logo),
@@ -594,7 +594,7 @@
 		}
 	}
 	function getName () { return $this->data_array['name'] ; }
-	function getAddress () { return $this->data_array['address'] ; }
+	function getUrl () { return $this->data_array['url'] ; }
 	function getEmail () { return $this->data_array['email'] ; }
 	function getDescription () { return $this->data_array['description'] ; }
 	function getLegalStructure () {

Modified: trunk/gforge/plugins/contribtracker/lib/contribtracker-init.sql
===================================================================
--- trunk/gforge/plugins/contribtracker/lib/contribtracker-init.sql	2010-02-24 01:03:42 UTC (rev 8859)
+++ trunk/gforge/plugins/contribtracker/lib/contribtracker-init.sql	2010-02-24 12:52:40 UTC (rev 8860)
@@ -15,7 +15,7 @@
 CREATE TABLE plugin_contribtracker_actor (
        actor_id integer DEFAULT nextval('plugin_contribtracker_actor_pk_seq') PRIMARY KEY,
        name text UNIQUE NOT NULL,
-       address text DEFAULT '' NOT NULL,
+       url text DEFAULT '' NOT NULL,
        email text DEFAULT '' NOT NULL,
        description text DEFAULT '' NOT NULL,
        logo text DEFAULT '' NOT NULL,

Modified: trunk/gforge/plugins/contribtracker/www/global_admin.php
===================================================================
--- trunk/gforge/plugins/contribtracker/www/global_admin.php	2010-02-24 01:03:42 UTC (rev 8859)
+++ trunk/gforge/plugins/contribtracker/www/global_admin.php	2010-02-24 12:52:40 UTC (rev 8860)
@@ -121,7 +121,7 @@
 	break ;
 case 'post_add_actor':
 	$name = getStringFromRequest ('actor_name') ;
-	$address = getStringFromRequest ('actor_address') ;
+	$url = getStringFromRequest ('actor_url') ;
 	$email = getStringFromRequest ('actor_email') ;
 	$desc = getStringFromRequest ('actor_desc') ;
 	$logoarr = getUploadedFile ('actor_logo') ;
@@ -138,7 +138,7 @@
 	$actor_id = getIntFromRequest ('actor_id') ;
 	check_actor_id ($actor_id) ;
 	$name = getStringFromRequest ('actor_name') ;
-	$address = getStringFromRequest ('actor_address') ;
+	$url = getStringFromRequest ('actor_url') ;
 	$email = getStringFromRequest ('actor_email') ;
 	$desc = getStringFromRequest ('actor_desc') ;
 	$logoarr = getUploadedFile ('actor_logo') ;
@@ -193,7 +193,7 @@
 case 'post_add_actor':
 	$actor = new ContribTrackerActor () ;
 	$structure = new ContribTrackerLegalStructure ($structure_id) ;
-	if (!$actor->create ($name, $address, $email, $desc, $logo, $structure)) {
+	if (!$actor->create ($name, $url, $email, $desc, $logo, $structure)) {
 		exit_error ($actor->getErrorMessage()) ;
 	}
 	$actor_id = $actor->getId() ;
@@ -207,7 +207,7 @@
 case 'post_edit_actor':
 	$actor = new ContribTrackerActor ($actor_id) ;
 	$structure = new ContribTrackerLegalStructure ($structure_id) ;
-	$actor->update ($name, $address, $email, $desc, $logo, $structure) ;
+	$actor->update ($name, $url, $email, $desc, $logo, $structure) ;
 	$action = 'display' ;
 	break ;
 }
@@ -222,7 +222,7 @@
 		print '<table><thead><tr>' ;
 		print '<td><strong>'._('Logo').'</strong></td>' ;
 		print '<td><strong>'._('Short name').'</strong></td>' ;
-		print '<td><strong>'._('Postal address').'</strong></td>' ;
+		print '<td><strong>'._('URL').'</strong></td>' ;
 		print '<td><strong>'._('Email').'</strong></td>' ;
 		print '<td><strong>'._('Description').'</strong></td>' ;
 		print '<td><strong>'._('Legal structure').'</strong></td>' ;
@@ -236,7 +236,7 @@
 			}
 			print '</td>' ;
 			print '<td>'.htmlspecialchars($a->getName()).'</td>' ;
-			print '<td>'.htmlspecialchars($a->getAddress()).'</td>' ;
+			print '<td>'.htmlspecialchars($a->getUrl()).'</td>' ;
 			print '<td>'.htmlspecialchars($a->getEmail()).'</td>' ;
 			print '<td>'.htmlspecialchars($a->getDescription()).'</td>' ;
 			print '<td>'.htmlspecialchars($a->getLegalStructure()->getName()).'</td>' ;
@@ -413,7 +413,7 @@
 		<form action="<?php echo util_make_url ('/plugins/'.$plugin->name.'/global_admin.php') ?>" method="post" enctype="multipart/form-data">
 			 <input type="hidden" name="action" value="post_add_actor" />
 			 <?php echo _('Actor name:') ?> <input type="text" name="actor_name" size="20" /><br />
-			 <?php echo _('Actor address:') ?> <input type="text" name="actor_address" size="20" /><br />
+			 <?php echo _('Actor URL:') ?> <input type="text" name="actor_url" size="20" /><br />
 			 <?php echo _('Actor email:') ?> <input type="text" name="actor_email" size="20" /><br />
 			 <?php echo _('Actor description:') ?><br />
 			 <textarea name="actor_desc" rows="20" cols="80"></textarea><br />
@@ -443,7 +443,7 @@
 			 <input type="hidden" name="action" value="post_edit_actor" />
 			 <input type="hidden" name="actor_id" value="<?php echo $actor->getId() ?>" />
 			 <?php echo _('Actor name:') ?> <input type="text" name="actor_name" size="20" value="<?php echo htmlspecialchars ($actor->getName()) ?>" /><br />
-			 <?php echo _('Actor address:') ?> <input type="text" name="actor_address" size="20" value="<?php echo htmlspecialchars ($actor->getAddress()) ?>" /><br />
+			 <?php echo _('Actor URL:') ?> <input type="text" name="actor_url" size="20" value="<?php echo htmlspecialchars ($actor->getUrl()) ?>" /><br />
 			 <?php echo _('Actor email:') ?> <input type="text" name="actor_email" size="20" value="<?php echo htmlspecialchars ($actor->getEmail()) ?>" /><br />
 			 <?php echo _('Actor description:') ?><br />
 			 <textarea name="actor_desc" rows="20" cols="80"><?php echo htmlspecialchars ($actor->getDescription()) ?></textarea><br />

Modified: trunk/gforge/plugins/contribtracker/www/index.php
===================================================================
--- trunk/gforge/plugins/contribtracker/www/index.php	2010-02-24 01:03:42 UTC (rev 8859)
+++ trunk/gforge/plugins/contribtracker/www/index.php	2010-02-24 12:52:40 UTC (rev 8860)
@@ -125,7 +125,7 @@
 			     htmlspecialchars($actor->getName())).'</h1>' ;
 	print '<ul>' ;
 	print '<li><strong>'._('Name:').'</strong> '.htmlspecialchars($actor->getName()).'</li>' ;
-	print '<li><strong>'._('Address:').'</strong> '.htmlspecialchars($actor->getAddress()).'</li>' ;
+	print '<li><strong>'._('URL:').'</strong> <a href="'.htmlspecialchars($actor->getUrl()).'">'.htmlspecialchars($actor->getUrl()).'</a></li>' ;
 	print '<li><strong>'._('Email:').'</strong> '.htmlspecialchars($actor->getEmail()).'</li>' ;
 	print '<li><strong>'._('Legal structure:').'</strong> '.htmlspecialchars($actor->getLegalStructure()->getName()).'</li>' ;
 	print '<li><strong>'._('Description:').'</strong> '.htmlspecialchars($actor->getDescription()).'</li>' ;




More information about the Fusionforge-commits mailing list