View | Details | Raw Unified | Return to bug 220977
Collapse All | Expand All

(-)components/portal/project_committer/project_committer.class.php (-33 / +8 lines)
Lines 17-23 Link Here
17
	public $reason;
17
	public $reason;
18
	
18
	
19
	public $nominate_search_fields;
19
	public $nominate_search_fields;
20
	public $submit_iplog_fields;
21
	
20
	
22
	public $website_url;
21
	public $website_url;
23
	public $wiki_url;
22
	public $wiki_url;
Lines 68-78 Link Here
68
				"to read and understand thus you should not use ephemeral urls (such as bugzilla queries); please ".
67
				"to read and understand thus you should not use ephemeral urls (such as bugzilla queries); please ".
69
				"use fixed urls to newsgroups, mailing lists, and bugs (or bug NNN or [NNN]). " ,'check'=>'req noquery')
68
				"use fixed urls to newsgroups, mailing lists, and bugs (or bug NNN or [NNN]). " ,'check'=>'req noquery')
70
		);
69
		);
71
		$this->submit_iplog_fields = array (
72
			'projectid' => array( 'key' => 'projectid', 'type' => 'hidden' ),
73
			array( 'key' => 'reason', 'label' => 'Reason (incl project release number)', 
74
				'type' => 'textarea', 'check' => 'req' )
75
			);
76
//		$this->initialize_cq_fields();
70
//		$this->initialize_cq_fields();
77
71
78
		$this->nominate_search_fields = array(
72
		$this->nominate_search_fields = array(
Lines 195-206 Link Here
195
				<li>
189
				<li>
196
					<a href="<?= $this->context->getActionLink("manage", $this) ?>">[manage]</a>
190
					<a href="<?= $this->context->getActionLink("manage", $this) ?>">[manage]</a>
197
					inactive committers on the project
191
					inactive committers on the project
198
			<?php if( isset($_GET['iplogurl']) ) { ?> 
199
				<li>
192
				<li>
200
					<a href="<?= $this->context->getActionLink("submitip", $this, $_GET['iplogurl']) ?>">[submit]</a>
193
					<a href="<?= $this->context->getActionLink("submitip", $this) ?>">[submit]</a>
201
					ip log to Eclipse Legal for release review
194
					ip log to Eclipse Legal for release review
202
			<?php
203
			} ?>
204
			</ul>
195
			</ul>
205
			<br/>
196
			<br/>
206
			<?php
197
			<?php
Lines 212-240 Link Here
212
	}
203
	}
213
204
214
/* SUBMIT IP LOG ------------------------------------------------------------------------------ */
205
/* SUBMIT IP LOG ------------------------------------------------------------------------------ */
215
	public function submitip_action( $context, $param ) {
206
	public function submitip_action() {
216
		$this->margin_action_html('back');
207
		$clzname = 'ipzilla';
217
		echo "<b>Submit IP Log to Eclipse Legal</b><br>
208
		require_once( $GLOBALS['COMPONENTS_DIRECTORY'] . "portal/$clzname/factory.php" );
218
		Submit the current 
209
		$factoryName = $clzname."_Factory";
219
		<a href='http://www.eclipse.org/projects/ip_log.php?projectid=$param' target=_new>automatic IP log</a>
210
		$factory = new $factoryName();
220
		for project<?= strpos($param,',') !== false ? 's' : '' ?> <u>$param</u> to Eclipse Legal.
211
		$object = $factory->getObjectForId('submit_ip_log', $this->projectid, $this->context);
221
		Legal will respond by email, either with additional questions, or with approval 
212
		$this->signal_replace_component($object);
222
		to hold the Release Review.
223
		";
224
		$this->html_edit_fields($this->submit_iplog_fields, 'submit');
225
	}
226
	
227
	public function submit_action() {
228
		$errors = $this->html_save_fields($this->submit_iplog_fields);
229
		if( $errors ) {
230
			$this->submitip_action( $this->context, $this->projectid );
231
		} else {
232
			send_immediate_email ( $this->context, "portal/project_committer", "send_iplog_to_legal", 
233
				$this->context->theuser->user_email_name(), $this->projectid, $this->reason, null );
234
235
			$this->margin_action_html('back');
236
			echo "The IP Log has been submitted to Eclipse Legal.";
237
		}
238
	}
213
	}
239
214
240
/* NOMINATE COMMITTERS ------------------------------------------------------------------------------ */
215
/* NOMINATE COMMITTERS ------------------------------------------------------------------------------ */
(-)components/portal/ipzilla/factory.php (-46 / +20 lines)
Lines 17-69 Link Here
17
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "abstractfactory.class.php" );
17
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "abstractfactory.class.php" );
18
18
19
class ipzilla_Factory extends abstractfactory implements IFactory {
19
class ipzilla_Factory extends abstractfactory implements IFactory {
20
21
  private function create_submit_ip_objects( $id, $context , &$rtrn){
22
    /*
23
     * Manage and submit IP log
24
     */
25
    if( $id != null && $context->user()->has_committer_role( $id ) ) {
26
		require_once( $GLOBALS['COMPONENTS_DIRECTORY'] . "portal/ipzilla/submit_ip_log.class.php" );
27
	    $rtrn[] = new submit_ip_log( $context, $id );
28
    }
29
    return $rtrn;
30
  }
31
20
    public function getObjects( $classname, $id, $context ) {
32
    public function getObjects( $classname, $id, $context ) {
21
    	return array();
33
  		$rtrn = array();
22
    	
34
  	  	switch( $classname ) {
23
    	if($id === null){
35
  	  		case 'submit_ip_log': return	$this->create_submit_ip_objects( $id, $context, $rtrn );
24
	        //*****************************************
36
  	  		
25
	    	//TODO UNTIL THIS IS FIXED
37
  	  		case null:
26
	    	//*****************************************
38
				$this->create_submit_ip_objects( null, $context, $rtrn );
27
			/*
39
				return $rtrn;
28
	        # [198541]
40
  		}
29
	
30
			$rtrn = array();
31
			if( true) return $rtrn;//disable until it is tested, verified, and needed again
32
	
33
	        // all projects the user is a committer or project lead, PMC member or PMC lead for
34
	   		$projects = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
35
						FROM PeopleProjects WHERE PersonID = '" . $context->theuser->getFoundationID() . "'
36
	   					 AND Relation IN ('CM','PL')
37
	   					 AND InactiveDate IS NULL"));
38
	    	// plus all projects and sub-projects the user is a PMC member or lead for
39
	   		$tops = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
40
						FROM PeopleProjects WHERE PersonID = '" . $context->theuser->getFoundationID() . "'
41
	   					 AND Relation IN ('PM','PD')
42
	   					 AND InactiveDate IS NULL"));
43
	   		$tops = "'" . implode("','", $tops) . "'";
44
	   		$tmp = array_of_it(foundation_sql("SELECT DISTINCT(ProjectID) as it
45
	   					FROM Projects WHERE ParentProjectID IN ($tops) AND IsComponent = 0"));
46
	   		$projects = array_merge($projects, $tmp);
47
			// create components for projects that have pending ipzilla entries
48
		   	$result2 = ipzilla_sql("SELECT distinct(name) as ProjectID
49
	       		FROM bugs, components
50
	       			WHERE components.id = bugs.component_id
51
	       			AND bug_status != 'RESOLVED'
52
	       			AND components.name IN ('" . implode('\',\'', $projects) . "')" );
53
	
54
		   	while( $row = mysql_fetch_assoc( $result2 )){
55
		   		$rtrn[] = new ipzilla( $context, $row['ProjectID'] );
56
		   	}
57
	        return $rtrn;
58
		  */  		
59
    	}else{
60
	        if( $classname != "ipzilla")
61
	            return null;
62
			// We are not checking permissions because this is public information anyway
63
			//include("ipzilla.class.php");
64
			//return new ipzilla( $context, $id);
65
        }
66
    	
67
    }
41
    }
68
42
69
	public function getActiveObjects( $context ) {
43
	public function getActiveObjects( $context ) {
(-)components/portal/ipzilla/submit_ip_log.class.php (+84 lines)
Added Link Here
1
<?php
2
/*******************************************************************************
3
 * Copyright (c) 2006-2008 Eclipse Foundation
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Bjorn Freeman-Benson - initial API and implementation
11
 *    Ward Cunningham - initial API and implementation
12
 *    Karl Matthias - initial API and implementation
13
 * 	  Gabe O'Brien - refactoring
14
 *******************************************************************************/
15
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "abstractcomponent.class.php" );
16
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "functions.php" );
17
require_once( $GLOBALS['CLASSES_DIRECTORY'] . "webapi-functions.php" );
18
19
class submit_ip_log extends AbstractComponent {
20
21
    public $context;
22
    public $projectid;
23
24
    public function submit_ip_log ($context, $projectid) {
25
        $this->context = $context;
26
        $this->projectid = $projectid;
27
    }
28
29
    public function id() {
30
        return "portal/ipzilla.submit_ip_log." . $this->projectid;
31
    }
32
33
    public function title() {
34
        return "Manage &amp; Submit IP Log - " . $this->projectid;
35
    }
36
	public function initial_height() {
37
		return 10;
38
	}
39
40
    public function inner_html() {
41
	$this->margin_action_html('back');
42
    /*
43
     * Get the latest version of the data
44
     */
45
	$webapi_method = $this->context->get( "webapi-connection-function" );		
46
	if(function_exists($webapi_method)) {
47
		$errors = $webapi_method ( 
48
			"http://www.eclipse.org/projects/web-api/ip_log_data.php?projectid=" . $this->projectid, 
49
			$this->context, $str );
50
		if( $errors ) return $errors;
51
	} else {
52
		file_lock_error("ERROR: Invalid webapi method defined ($webapi_method) or correct file not sourced due to an error\n");
53
		$str = '';
54
	}
55
    $data = unserialize( trim($str) );
56
    
57
    ?><table><?php
58
    foreach( $data[5] as $committer ) {
59
    	?><tr><td><?= $committer[PID] ?></td>
60
    	<td><?= $committer[FName] . ' ' . $committer[LName] ?></td>
61
    	<td>[remove]</td>
62
    	</tr><tr><td style="border-bottom: thin solid black"></td>
63
    	<td style="border-bottom: thin solid black"><?= $committer[Name1] ?></td>
64
    	<td style="border-bottom: thin solid black">[comment]</td>
65
    	</tr><?php
66
    }
67
    ?></table><?php
68
69
    }
70
71
	public function back_action(){
72
		require_once( $GLOBALS['COMPONENTS_DIRECTORY'] . "portal/project_committer/project_committer.class.php" );
73
		$clzname = "project_committer";
74
		$project_committer = new $clzname($this->projectid,$this->context);
75
		$this->signal_replace_component($project_committer);
76
	}
77
78
  public function sort_order() {
79
  	return 70;
80
  }
81
82
}
83
84
?>

Return to bug 220977