Bug #5713 [Opn]: license should be a drop down

From: Date: Tue, 18 Oct 2005 18:54:20 +0000
Subject: Bug #5713 [Opn]: license should be a drop down
References: 1  Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-4511@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=5713&edit=1 ID: 5713 Updated by: mj@php.net Reported By: lsmith at php dot net Status: Open Id: 5713 Type: Bug -Package: PEPr +Package: Web Site Operating System: irrelevant PHP Version: Irrelevant -Assigned To: +Assigned To: mj New Comment: As a start, the packages table on pear.php.net has been altered so that the license field now takes up to 50 characters. Previous Comments: ------------------------------------------------------------------------ [2005-10-18 12:16:10] lsmith at php dot net alternatively: http://pooteeweet.org/pearweb/pearweb_license.diff ------------------------------------------------------------------------ [2005-10-18 12:12:41] lsmith at php dot net Since I am still a pearweb n00b .. with no local pearweb running .. here goes a diff .. Index: public_html/package-edit.php =================================================================== RCS file: /repository/pearweb/public_html/package-edit.php,v retrieving revision 1.35 diff -w -b -r1.35 package-edit.php 216c216,225 < <?php $form->displayText('license', $row['license'], 50, 20); ?> --- > <?php > $sth = $dbh->query('SELECT name FROM licenses ORDER BY name'); > > while ($license_row = $sth->fetchRow(DB_FETCHMODE_ASSOC)) { > $rows[$license_row['name']] = $license_row['name']; > } > $form->displaySelect("license", $rows, (int)$row['license']); > ?> > > <?php $form->displayText('license', $row['license'], 50, 50); > ?> Index: public_html/package-new.php =================================================================== RCS file: /repository/pearweb/public_html/package-new.php,v retrieving revision 1.35 diff -w -b -r1.35 package-new.php 120a121 > $licenses = $dbh->getAssoc("SELECT name AS id,name FROM licenses ORDER BY name"); 128c129,131 < $bb->horizHeadRow("License", $form->returnText("license", get("license"), 20)); --- > $lics = $form->returnSelect("license", $licenses, get("license"), 1, > "--Select License--"); > $bb->horizHeadRow("License", $lics); Index: sql/packages.sql =================================================================== RCS file: /repository/pearweb/sql/packages.sql,v retrieving revision 1.17 diff -w -b -r1.17 packages.sql 11c11 < license varchar(20) default NULL, --- > license varchar(50) default NULL, Index: include/pear-format-html.php =================================================================== RCS file: /repository/pearweb/include/pear-format-html.php,v retrieving revision 1.176 diff -w -b -r1.176 pear-format-html.php 701,721c701,702 < switch ($license) { < < case 'PHP License' : < case 'PHP 2.02' : < $link = 'http://www.php.net/license/2_02.txt'; < break; < < case 'GPL' : < case 'GNU General Public License' : < $link = 'http://www.gnu.org/licenses/gpl.html'; < break; < < case 'LGPL' : < case 'GNU Lesser General Public License' : < $link = 'http://www.gnu.org/licenses/lgpl.html'; < break; < < default : < $link = ''; < break; < } --- > global $dbh; > $link = $dbh->getOne("SELECT link FROM licenses WHERE name = ?", array($license)); ------------------------------------------------------------------------ [2005-10-18 11:21:48] lsmith at php dot net I should add that this fix is somewhat pressing .. as the form currently is too short to add "APACHE LICENSE VERSION 2.0" for example .. ------------------------------------------------------------------------ [2005-10-18 06:27:59] lsmith at php dot net Description: ------------ The license field should be a drop down with all allowed choices. Also there should be a note somewhere on pearweb that the license listed on the package choice is irrelevant if the license headers in the actual source code is different. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=5713&edit=1

« previous php.pear.webmaster (#4511) next »