Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
* Update common core code from recent changes to Commit-Digest.
Browse files Browse the repository at this point in the history
* Remove survey functionality and map images generation (now done dynamically in frontend browser).
  • Loading branch information
dannya committed Jan 4, 2014
1 parent 6749399 commit c4b934f
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 67 deletions.
5 changes: 3 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Enzyme
------
A project-independent (and eventually SCM-agnostic) tool for creating regular project reports
and assisting interesting statistical analysis.
A project-independent and source-code-control-system-agnostic tool for creating regular project reports and assisting interesting statistical analysis.

See http://enzyme-project.org/

Powers the KDE Commit-Digest (http://commit-digest.org/).


Installation
------------
Expand Down
15 changes: 8 additions & 7 deletions src/classes/shared/developer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*-------------------------------------------------------+
| Enzyme
| Copyright 2010-2011 Danny Allen <[email protected]>
| Copyright 2010-2013 Danny Allen <[email protected]>
| http://www.enzyme-project.org/
+--------------------------------------------------------+
| This program is released as free software under the
Expand All @@ -19,9 +19,8 @@ class Developer {
public $data = null;
public $privacy = null;
public $access = null;
public $surveyDone = false;

public static $fieldSections = array('core' => array('account', 'name', 'email', 'nickname', 'dob', 'gender', 'motivation', 'employer', 'colour'),
public static $fieldSections = array('core' => array('account', 'name', 'email', 'nickname', 'dob', 'gender', 'nationality', 'motivation', 'employer', 'colour'),
'geographic' => array('continent', 'country', 'location', 'latitude', 'longitude'),
'social' => array('homepage', 'blog', 'lastfm', 'microblog_type', 'microblog_user'),
'system' => array('access_ip', 'access_code', 'access_timeout'));
Expand Down Expand Up @@ -54,6 +53,10 @@ class Developer {
'display' => 'all',
'editable' => true,
'privacy' => 'gender'),
'nationality' => array('type' => 'string',
'display' => 'all',
'editable' => true,
'privacy' => 'nationality'),
'motivation' => array('type' => 'enum',
'display' => 'all',
'editable' => true,
Expand Down Expand Up @@ -171,9 +174,6 @@ public function load($value = null, $field = 'account', $createBuffer = false) {

// load developer data
if ($this->data = Db::load('developers', array('account' => $privacy['account']), 1)) {
// check if survey has been completed
$this->surveyDone = Db::exists('developer_survey', array('account' => $privacy['account']));

// set privacy settings to each data value
foreach (self::$fields as $id => $spec) {
if (!isset($spec['privacy'])) {
Expand Down Expand Up @@ -335,9 +335,10 @@ public static function getFieldStrings() {
'nickname' => _('Nickname'),
'dob' => _('Date of Birth'),
'gender' => _('Gender'),
'nationality' => _('Nationality'),
'motivation' => _('Motivation'),
'employer' => _('Employer'),
'colour' => _('Colour'),
'colour' => _('Favourite colour'),

'continent' => _('Continent'),
'country' => _('Country'),
Expand Down
72 changes: 40 additions & 32 deletions src/classes/shared/digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,33 +525,33 @@ public static function getTypes() {

public static function getLanguages() {
return array('en_US' => _('English'),
'de_DE' => _('Deutsch (German)'),
'fr_FR' => _('Français (French)'),
'es_ES' => _('Español (Spanish)'),
'nl_NL' => _('Nederlands (Dutch)'),
'it_IT' => _('Italiano (Italian)'),
'ru_RU' => _('Ру��кий �зык (Russian)'),
'pl_PL' => _('Polski (Polish)'),
'pt_PT' => _('Português (Portuguese)'),
'pt_BR' => _('Português Brasileiro (Brazilian Portuguese)'),
'hu_HU' => _('Magyar (Hungarian)'),
'uk_UA' => _('Ukrainian (Ukrainian)'),
'cs_CZ' => _('Czech (Čeština)'),
'nds' => _('Low Saxon (Low Saxon)'));
'de_DE' => _('Deutsch'),
'fr_FR' => _('Français'),
'es_ES' => _('Español'),
'nl_NL' => _('Nederlands'),
'it_IT' => _('Italiano'),
'ru_RU' => _('Pyccĸий'),
'pl_PL' => _('Polski'),
'pt_PT' => _('Português'),
'pt_BR' => _('Português Brasileiro'),
'hu_HU' => _('Magyar'),
'uk_UA' => _('Українська'),
'cs_CZ' => _('Čeština'),
'nds' => _('Low Saxon'));

// not yet ready for inclusion, here for translation purposes
return array('sv_SE' => _('Svenska (Swedish)'));
return array('sv_SE' => _('Svenska'));
}


public static function getStatuses() {
return array('idea' => _('1. Idea'),
'contacting' => _('2. Contacting'),
'more-info' => _('3. More information needed'),
return array('idea' => '1.' . _('Idea'),
'contacting' => '2.' . _('Contacting'),
'more-info' => '3.' . _('More information needed'),
'' => '--------',
'proofread' => _('4. Needs proofreading'),
'ready' => _('5. Ready for selection'),
'selected' => _('6. Selected'));
'proofread' => '4.' . _('Needs proofreading'),
'ready' => '5.' . _('Ready for selection'),
'selected' => '6.' . _('Selected'));
}


Expand Down Expand Up @@ -589,10 +589,12 @@ public static function drawCommit($commit, $issueDate, $showDiffs = true) {
$revision = Digest::getShortGitRevision($commit['revision']);
}

$buf .= ' <span class="d">' .
self::drawDiffs($commit, $issueDate) .
' </span>
<a class="r n" href="' . BASE_URL . '/issues/' . $issueDate . '/moreinfo/' . $commit['revision'] . '/">' .
$diffs = self::drawDiffs($commit, $issueDate);
if (!empty($diffs)) {
$buf .= ' <span class="d">' . $diffs . '</span>';
}

$buf .= ' <a class="r n" href="' . BASE_URL . '/issues/' . $issueDate . '/moreinfo/' . $commit['revision'] . '/">' .
sprintf(_('Revision %s'), $revision) .
' </a>';
}
Expand All @@ -608,15 +610,24 @@ public static function drawCommit($commit, $issueDate, $showDiffs = true) {


public static function getCommitTitle($commit) {
if (empty($commit['format']) || ($commit['format'] == 'svn')) {
$title = sprintf(_('%s committed changes in %s:'),
'<a class="n" href="http://cia.vc/stats/author/' . $commit['developer'] . '/" target="_blank">' . $commit['name'] . '</a>',
Enzyme::drawBasePath($commit['basepath']));
if (empty($commit['format']) || ($commit['format'] == 'svn')) {
// TODO: remove CIA.vc until we replace with internal author pages
// $title = sprintf(_('%s committed changes in %s:'),
// '<a class="n" href="http://cia.vc/stats/author/' . $commit['developer'] . '/" target="_blank">' . $commit['name'] . '</a>',
// Enzyme::drawBasePath($commit['basepath']));
$title = sprintf(
_('%s committed changes in %s:'),
$commit['name'],
Enzyme::drawBasePath($commit['basepath'])
);

} else if ($commit['format'] == 'git') {
// do we have the name of the committer?
if (!empty($commit['name'])) {
$committer = '<a class="n" href="http://cia.vc/stats/author/' . $commit['developer'] . '/" target="_blank">' . $commit['name'] . '</a>';
// TODO: remove CIA.vc until we replace with internal author pages
// $committer = '<a class="n" href="http://cia.vc/stats/author/' . $commit['developer'] . '/" target="_blank">' . $commit['name'] . '</a>';
$committer = $commit['name'];

} else {
$committer = Ui::displayEmailAddress($commit['developer']);
}
Expand Down Expand Up @@ -651,9 +662,6 @@ public static function drawBugs($commit, $class = 'b') {

} else {
$fixTime = 0;

// log the error
Log::error('Invalid date for ' . $bug['bug']);
}

$buf .= '<div class="bug">
Expand Down
17 changes: 3 additions & 14 deletions src/classes/shared/enzyme.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*-------------------------------------------------------+
| Enzyme
| Copyright 2010-2012 Danny Allen <[email protected]>
| Copyright 2010-2013 Danny Allen <[email protected]>
| http://www.enzyme-project.org/
+--------------------------------------------------------+
| This program is released as free software under the
Expand Down Expand Up @@ -220,16 +220,7 @@ public static function getAvailableSettings() {
'valid' => null,
'default' => 0.1,
'example' => null);
$tmp['SURVEY_ACTIVE'] = array('title' => _('Survey Active'),
'valid' => array('0' => _('No'),
'1' => _('Yes')),
'default' => '0',
'example' => null);

$tmp['GENERATE_MAPS'] = array('title' => _('Map Generation Service URL'),
'valid' => null,
'default' => 'http://grafin.enzyme-project.org/index.php',
'example' => 'http://grafin.enzyme-project.org/index.php');
$tmp['RECENT_COMMITS'] = array('title' => _('Recent Commits RSS URL'),
'valid' => null,
'default' => null,
Expand Down Expand Up @@ -309,12 +300,10 @@ public static function getGroupedSettings() {
'SMTP' => $tmp['SMTP'],
'SHOW_INSERT' => $tmp['SHOW_INSERT'],
'AUTO_REVIEW_COMMITS' => $tmp['AUTO_REVIEW_COMMITS'],
'DATA_TERMS_VERSION' => $tmp['DATA_TERMS_VERSION'],
'SURVEY_ACTIVE' => $tmp['SURVEY_ACTIVE']));
'DATA_TERMS_VERSION' => $tmp['DATA_TERMS_VERSION']));

$settings[] = array('title' => _('Data Locations'),
'settings' => array('GENERATE_MAPS' => $tmp['GENERATE_MAPS'],
'RECENT_COMMITS' => $tmp['RECENT_COMMITS'],
'settings' => array('RECENT_COMMITS' => $tmp['RECENT_COMMITS'],
'WEBSVN' => $tmp['WEBSVN'],
'WEBBUG' => $tmp['WEBBUG'],
'WEBBUG_XML' => $tmp['WEBBUG_XML'],
Expand Down
2 changes: 1 addition & 1 deletion src/classes/shared/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static function draw($media) {
// show link?
if ($media['size']) {
$link = '<div class="link">
<a href="' . BASE_URL . $media['file'] . '" title="' . strip_tags($string) . '">' .
<a href="' . BASE_URL . $media['file'] . '" title="' . strip_tags($media['name']) . '">' .
sprintf(_('Download <b>%s</b> video (%s, %s)'), $media['name'], $media['size'], $media['ext']) .
' </a>
</div>';
Expand Down
6 changes: 3 additions & 3 deletions src/classes/shared/ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*-------------------------------------------------------+
| PHPzy (Web Application Framework)
| Copyright 2010-2011 Danny Allen <[email protected]>
| Copyright 2010-2013 Danny Allen <[email protected]>
| http://www.dannya.com/
+--------------------------------------------------------+
| This program is released as free software under the
Expand All @@ -21,7 +21,7 @@ public static function redirect($page) {
header('Location: ' . BASE_URL . $page);

} else{
echo '<script type="text/javascript">top.location="', BASE_URL, $page, '";</script>';
echo '<script>top.location.href="', BASE_URL, $page, '";</script>';
}

exit;
Expand Down Expand Up @@ -57,7 +57,7 @@ public static function drawHtmlPageStart($title = null, array $css = array(),

if ($js) {
foreach ($js as $file) {
$script .= '<script type="text/javascript" src="' . BASE_URL . $file . '"></script>' . "\n";
$script .= '<script src="' . BASE_URL . $file . '"></script>' . "\n";
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/classes/specific/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*-------------------------------------------------------+
| Enzyme
| Copyright 2010-2011 Danny Allen <[email protected]>
| Copyright 2010-2014 Danny Allen <[email protected]>
| http://www.enzyme-project.org/
+--------------------------------------------------------+
| This program is released as free software under the
Expand All @@ -16,13 +16,13 @@


final class Config {
public static $framework = array('version' => '20120710');
public static $framework = array('version' => '20140104');


// define app constants
public static $app = array('id' => 'enzyme',
'name' => 'Enzyme',
'version' => '1.23');
'version' => '1.30');


// define meta information
Expand Down Expand Up @@ -54,7 +54,6 @@ final class Config {
'data_terms',
'developers',
'developer_privacy',
'developer_survey',
'digests',
'digest_intro_people',
'digest_intro_sections',
Expand All @@ -77,7 +76,7 @@ final class Config {


// define settings information
private static $settings = null;
private static $settings = null;


public static function getSetting() {
Expand Down
5 changes: 2 additions & 3 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
$ui = new EnzymeUi();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en" lang="en">
<!DOCTYPE html>
<html lang="en">
<head id="head">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
Expand Down

0 comments on commit c4b934f

Please sign in to comment.