| <?php |
| /******************************************************************************* |
| * Copyright (c) 2011,2012 Eclipse Foundation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Wayne Beaton (Eclipse Foundation)- initial API and implementation |
| *******************************************************************************/ |
| |
| /* |
| * Note that this file is experimental. It will likely move or be modified. |
| */ |
| |
| require_once(dirname(__FILE__) . "/ProjectSummary.class.php"); |
| require_once(dirname(__FILE__) . "/debug.php"); |
| trace_file_info(__FILE__); |
| |
| /** |
| * Returns a chunk of HTML that includes an image of the project's |
| * commit record with a link to the project's information in Dash. |
| * |
| * @param string $id The project id. |
| * @param int $width (Optional) The desired width of the image. |
| * @param int $height (Optional) The desired height of the image. |
| * @return string HTML to be included on a project web page. |
| */ |
| function getCommitsActivityHtml($id, $width=150, $height=100) { |
| $summary = new ProjectSummary(getProject($id)); |
| return $summary->getCommitsActivityHtml($width, $height); |
| } |
| |
| /** |
| * Return HTML that provides a "company commit activity" pie chart |
| * using the Google Chart APIs. Note that calling this method will |
| * automatically add the necessary JavaScript libraries to the page. |
| * |
| * Only the last three months of activity is reported. |
| * |
| * @param string $id The project id. |
| * @param int $width (Optional) The desired width of the image. |
| * @param int $height (Optional) The desired height of the image. |
| * @return string HTML to be included on a project web page. |
| */ |
| function getOrganizationCommitActivityHtml($id, $width=150, $height=100) { |
| $summary = new ProjectSummary(getProject($id)); |
| return $summary->getCompanyCommitActivityHtml($width, $height); |
| } |
| |
| /** |
| * Return HTML that provides a "individual commit activity" pie chart |
| * using the Google Chart APIs. Note that calling this method will |
| * automatically add the necessary JavaScript libraries to the page. |
| * |
| * Only the last three months of activity is reported. |
| * |
| * @param string $id The project id. |
| * @param int $width (Optional) The desired width of the image. |
| * @param int $height (Optional) The desired height of the image. |
| * @return string HTML to be included on a project web page. |
| */ |
| function getIndividualCommitActivityHtml($id, $width=150, $height=100) { |
| $summary = new ProjectSummary(getProject($id)); |
| return $summary->getCompanyCommitActivityHtml($width, $height); |
| } |
| ?> |