### Eclipse Workspace Patch 1.0
#P myfoundation
Index: components/portal/project_committer/project_committer.class.php
===================================================================
RCS file: /cvsroot/foundation/myfoundation/components/portal/project_committer/project_committer.class.php,v
retrieving revision 1.21
diff -u -r1.21 project_committer.class.php
--- components/portal/project_committer/project_committer.class.php 30 May 2008 17:32:25 -0000 1.21
+++ components/portal/project_committer/project_committer.class.php 4 Jun 2008 04:57:57 -0000
@@ -17,7 +17,6 @@
public $reason;
public $nominate_search_fields;
- public $submit_iplog_fields;
public $website_url;
public $wiki_url;
@@ -68,11 +67,6 @@
"to read and understand thus you should not use ephemeral urls (such as bugzilla queries); please ".
"use fixed urls to newsgroups, mailing lists, and bugs (or bug NNN or [NNN]). " ,'check'=>'req noquery')
);
- $this->submit_iplog_fields = array (
- 'projectid' => array( 'key' => 'projectid', 'type' => 'hidden' ),
- array( 'key' => 'reason', 'label' => 'Reason (incl project release number)',
- 'type' => 'textarea', 'check' => 'req' )
- );
// $this->initialize_cq_fields();
$this->nominate_search_fields = array(
@@ -195,12 +189,9 @@
">[manage]
inactive committers on the project
-
- ">[submit]
+ ">[submit]
ip log to Eclipse Legal for release review
-
margin_action_html('back');
- echo "Submit IP Log to Eclipse Legal
- Submit the current
- automatic IP log
- for project= strpos($param,',') !== false ? 's' : '' ?> $param to Eclipse Legal.
- Legal will respond by email, either with additional questions, or with approval
- to hold the Release Review.
- ";
- $this->html_edit_fields($this->submit_iplog_fields, 'submit');
- }
-
- public function submit_action() {
- $errors = $this->html_save_fields($this->submit_iplog_fields);
- if( $errors ) {
- $this->submitip_action( $this->context, $this->projectid );
- } else {
- send_immediate_email ( $this->context, "portal/project_committer", "send_iplog_to_legal",
- $this->context->theuser->user_email_name(), $this->projectid, $this->reason, null );
-
- $this->margin_action_html('back');
- echo "The IP Log has been submitted to Eclipse Legal.";
- }
+ public function submitip_action() {
+ $clzname = 'ipzilla';
+ require_once( $GLOBALS['COMPONENTS_DIRECTORY'] . "portal/$clzname/factory.php" );
+ $factoryName = $clzname."_Factory";
+ $factory = new $factoryName();
+ $object = $factory->getObjectForId('submit_ip_log', $this->projectid, $this->context);
+ $this->signal_replace_component($object);
}
/* NOMINATE COMMITTERS ------------------------------------------------------------------------------ */
Index: components/portal/ipzilla/factory.php
===================================================================
RCS file: /cvsroot/foundation/myfoundation/components/portal/ipzilla/factory.php,v
retrieving revision 1.4
diff -u -r1.4 factory.php
--- components/portal/ipzilla/factory.php 30 Apr 2008 21:17:42 -0000 1.4
+++ components/portal/ipzilla/factory.php 4 Jun 2008 04:57:57 -0000
@@ -17,53 +17,27 @@
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "abstractfactory.class.php" );
class ipzilla_Factory extends abstractfactory implements IFactory {
+
+ private function create_submit_ip_objects( $id, $context , &$rtrn){
+ /*
+ * Manage and submit IP log
+ */
+ if( $id != null && $context->user()->has_committer_role( $id ) ) {
+ require_once( $GLOBALS['COMPONENTS_DIRECTORY'] . "portal/ipzilla/submit_ip_log.class.php" );
+ $rtrn[] = new submit_ip_log( $context, $id );
+ }
+ return $rtrn;
+ }
+
public function getObjects( $classname, $id, $context ) {
- return array();
-
- if($id === null){
- //*****************************************
- //TODO UNTIL THIS IS FIXED
- //*****************************************
- /*
- # [198541]
-
- $rtrn = array();
- if( true) return $rtrn;//disable until it is tested, verified, and needed again
-
- // all projects the user is a committer or project lead, PMC member or PMC lead for
- $projects = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
- FROM PeopleProjects WHERE PersonID = '" . $context->theuser->getFoundationID() . "'
- AND Relation IN ('CM','PL')
- AND InactiveDate IS NULL"));
- // plus all projects and sub-projects the user is a PMC member or lead for
- $tops = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
- FROM PeopleProjects WHERE PersonID = '" . $context->theuser->getFoundationID() . "'
- AND Relation IN ('PM','PD')
- AND InactiveDate IS NULL"));
- $tops = "'" . implode("','", $tops) . "'";
- $tmp = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
- FROM Projects WHERE ParentProjectID IN ($tops) AND IsComponent = 0"));
- $projects = array_merge($projects, $tmp);
- // create components for projects that have pending ipzilla entries
- $result2 = ipzilla_sql("SELECT distinct(name) as ProjectID
- FROM bugs, components
- WHERE components.id = bugs.component_id
- AND bug_status != 'RESOLVED'
- AND components.name IN ('" . implode('\',\'', $projects) . "')" );
-
- while( $row = mysql_fetch_assoc( $result2 )){
- $rtrn[] = new ipzilla( $context, $row['ProjectID'] );
- }
- return $rtrn;
- */
- }else{
- if( $classname != "ipzilla")
- return null;
- // We are not checking permissions because this is public information anyway
- //include("ipzilla.class.php");
- //return new ipzilla( $context, $id);
- }
-
+ $rtrn = array();
+ switch( $classname ) {
+ case 'submit_ip_log': return $this->create_submit_ip_objects( $id, $context, $rtrn );
+
+ case null:
+ $this->create_submit_ip_objects( null, $context, $rtrn );
+ return $rtrn;
+ }
}
public function getActiveObjects( $context ) {
Index: components/portal/ipzilla/submit_ip_log.class.php
===================================================================
RCS file: components/portal/ipzilla/submit_ip_log.class.php
diff -N components/portal/ipzilla/submit_ip_log.class.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ components/portal/ipzilla/submit_ip_log.class.php 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,84 @@
+context = $context;
+ $this->projectid = $projectid;
+ }
+
+ public function id() {
+ return "portal/ipzilla.submit_ip_log." . $this->projectid;
+ }
+
+ public function title() {
+ return "Manage & Submit IP Log - " . $this->projectid;
+ }
+ public function initial_height() {
+ return 10;
+ }
+
+ public function inner_html() {
+ $this->margin_action_html('back');
+ /*
+ * Get the latest version of the data
+ */
+ $webapi_method = $this->context->get( "webapi-connection-function" );
+ if(function_exists($webapi_method)) {
+ $errors = $webapi_method (
+ "http://www.eclipse.org/projects/web-api/ip_log_data.php?projectid=" . $this->projectid,
+ $this->context, $str );
+ if( $errors ) return $errors;
+ } else {
+ file_lock_error("ERROR: Invalid webapi method defined ($webapi_method) or correct file not sourced due to an error\n");
+ $str = '';
+ }
+ $data = unserialize( trim($str) );
+
+ ?>= $committer[PID] ?> |
+ = $committer[FName] . ' ' . $committer[LName] ?> |
+ [remove] |
+
|
+ = $committer[Name1] ?> |
+ [comment] |
+
projectid,$this->context);
+ $this->signal_replace_component($project_committer);
+ }
+
+ public function sort_order() {
+ return 70;
+ }
+
+}
+
+?>