Skip to content

Commit

Permalink
Allow membership committee to specify the GNOME userid for each
Browse files Browse the repository at this point in the history
	foundation member.
	* docs/sql/foundationmembers.sql:
	* lib/foundationmember.php:
	* www/new_foundationmember.php:
	* www/new_foundationmember.xsl:
	* www/update_foundationmember.php:
	* www/update_foundationmember.xsl:


svn path=/trunk/; revision=156
  • Loading branch information
Olav Vitters committed May 23, 2008
1 parent 89c7399 commit e4e0d95
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2008-05-23 Olav Vitters <[email protected]>

Allow membership committee to specify the GNOME userid for each
foundation member.

* docs/sql/foundationmembers.sql:
* lib/foundationmember.php:
* www/new_foundationmember.php:
* www/new_foundationmember.xsl:
* www/update_foundationmember.php:
* www/update_foundationmember.xsl:

2008-05-22 Olav Vitters <[email protected]>

* www/update_user.php: Allow changing of membership committee.
Expand Down
1 change: 1 addition & 0 deletions docs/sql/foundationmembers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CREATE TABLE `foundationmembers` (
`firstname` varchar(50) default NULL,
`lastname` varchar(50) default NULL,
`email` varchar(50) default NULL,
`userid` varchar(15) default NULL,
`comments` text,
`first_added` date NOT NULL,
`last_renewed_on` timestamp NOT NULL,
Expand Down
13 changes: 11 additions & 2 deletions lib/foundationmember.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ class FoundationMember {
var $firstname;
var $lastname;
var $email;
var $userid; // GNOME userid
var $comments;
var $renew; // denotes that member's membership is renewed.
var $first_added;
var $need_to_renew;
var $last_renewed_on;
var $last_update;
var $last_update;
var $resigned_on; // denotes time when a member retired

function absorb($record) {
Expand All @@ -26,6 +27,7 @@ function absorb($record) {
$member->lastname = $record->lastname;
$member->email = $record->email;
$member->comments = $record->comments;
$member->userid = $record->userid;
$member->renew = false;
$member->first_added = DateField::from_sql($record->first_added);
$member->last_renewed_on = DateField::from_sql($record->last_renewed_on);
Expand Down Expand Up @@ -91,12 +93,13 @@ function addmember() {

// Prepare query
$query = "INSERT INTO foundationmembers (";
$query .= "firstname, lastname, email, comments, first_added, last_renewed_on, last_update";
$query .= "firstname, lastname, email, comments, userid, first_added, last_renewed_on, last_update";
$query .= ") VALUES (";
$query .= MySQLUtil::escape_string($this->firstname).", ";
$query .= MySQLUtil::escape_string($this->lastname).", ";
$query .= MySQLUtil::escape_string($this->email).", ";
$query .= MySQLUtil::escape_string($this->comments).", ";
$query .= MySQLUtil::escape_string($this->userid).", ";
$query .= MySQLUtil::escape_date($aboutnow).", ";
$query .= MySQLUtil::escape_date($this->last_renewed_on).", ";
$query .= MySQLUtil::escape_date($aboutnow);
Expand Down Expand Up @@ -169,6 +172,10 @@ function update() {
$sql .= ", comments = ".MySQLUtil::escape_string($this->comments);
$changes[] = "comments";
}
if($oldrec->userid != $this->userid) {
$sql .= ", userid = ".MySQLUtil::escape_string($this->userid);
$changes[] = "userid";
}
if($oldrec->last_renewed_on != $this->last_renewed_on) {
$sql .= ", last_renewed_on = ".MySQLUtil::escape_date($this->last_renewed_on);
$changes[] = "last_renewed_on";
Expand Down Expand Up @@ -214,6 +221,8 @@ function add_to_node(&$dom, &$formnode) {
$node->appendChild($dom->createTextNode($this->email));
$node = $formnode->appendChild($dom->createElement("comments"));
$node->appendChild($dom->createTextNode($this->comments));
$node = $formnode->appendChild($dom->createElement("userid"));
$node->appendChild($dom->createTextNode($this->userid));
DateField::add_to($dom, $formnode, "first_added", $this->first_added);
DateField::add_to($dom, $formnode, "last_renewed_on", $this->last_renewed_on);
if ($this->resigned_on == null) {
Expand Down
1 change: 1 addition & 0 deletions www/new_foundationmember.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function readform() {
$this->foundationmember->firstname = $_POST['firstname'];
$this->foundationmember->lastname = $_POST['lastname'];
$this->foundationmember->email = $_POST['email'];
$this->foundationmember->userid = $_POST['userid'];
$this->foundationmember->comments = $_POST['comments'];
$this->foundationmember->last_renewed_on = time();
$this->foundationmember->need_to_renew = false;
Expand Down
11 changes: 11 additions & 0 deletions www/new_foundationmember.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
<input type="text" name="firstname" value="{firstname}" size="40"/>
</td>
</tr>
<tr>
<th>
<xsl:if test="boolean(formerror[@type='userid'])">
<xsl:attribute name="class">formerror</xsl:attribute>
</xsl:if>
GNOME userid
</th>
<td>
<input type="text" name="userid" value="{userid}" size="15"/>
</td>
</tr>
<tr>
<th>
<xsl:if test="boolean(formerror[@type='email'])">
Expand Down
1 change: 1 addition & 0 deletions www/update_foundationmember.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function readform() {
$this->foundationmember->lastname = $_POST['lastname'];
$this->foundationmember->email = $_POST['email'];
$this->foundationmember->comments = $_POST['comments'];
$this->foundationmember->userid = $_POST['userid'];
if (isset($_POST['renew']) && $_POST['renew'] == "on") {
$this->foundationmember->renew = true;
$this->foundationmember->last_renewed_on = time();
Expand Down
14 changes: 14 additions & 0 deletions www/update_foundationmember.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
<input type="text" name="firstname" value="{firstname}" size="40"/>
</td>
</tr>
<tr>
<th>
<xsl:if test="boolean(formerror[@type='userid'])">
<xsl:attribute name="class">formerror</xsl:attribute>
</xsl:if>
GNOME userid
</th>
<td>
<input type="text" name="userid" value="{userid}" size="15"/>
</td>
</tr>
<tr>
<th>
<xsl:if test="boolean(formerror[@type='email'])">
Expand Down Expand Up @@ -93,6 +104,9 @@
<xsl:when test="@id='email'">
<p>E-mail address updated</p>
</xsl:when>
<xsl:when test="@id='userid'">
<p></p>GNOME userid updated</p>
</xsl:when>
<xsl:when test="@id='last_renewed_on'">
<p>Last Renewal updated</p>
</xsl:when>
Expand Down

0 comments on commit e4e0d95

Please sign in to comment.