From c4b934fb9efb513fe13bada566d11902f79b0ed7 Mon Sep 17 00:00:00 2001 From: Danny Allen Date: Sat, 4 Jan 2014 21:18:47 +0000 Subject: [PATCH] * Update common core code from recent changes to Commit-Digest. * Remove survey functionality and map images generation (now done dynamically in frontend browser). --- README | 5 ++- src/classes/shared/developer.php | 15 +++---- src/classes/shared/digest.php | 72 ++++++++++++++++++-------------- src/classes/shared/enzyme.php | 17 ++------ src/classes/shared/media.php | 2 +- src/classes/shared/ui.php | 6 +-- src/classes/specific/config.php | 9 ++-- src/index.php | 5 +-- 8 files changed, 64 insertions(+), 67 deletions(-) diff --git a/README b/README index 6fe915f..431fe96 100644 --- a/README +++ b/README @@ -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 ------------ diff --git a/src/classes/shared/developer.php b/src/classes/shared/developer.php index 61d2f77..65017dd 100644 --- a/src/classes/shared/developer.php +++ b/src/classes/shared/developer.php @@ -2,7 +2,7 @@ /*-------------------------------------------------------+ | Enzyme - | Copyright 2010-2011 Danny Allen + | Copyright 2010-2013 Danny Allen | http://www.enzyme-project.org/ +--------------------------------------------------------+ | This program is released as free software under the @@ -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')); @@ -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, @@ -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'])) { @@ -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'), diff --git a/src/classes/shared/digest.php b/src/classes/shared/digest.php index bdac808..f86290d 100644 --- a/src/classes/shared/digest.php +++ b/src/classes/shared/digest.php @@ -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')); } @@ -589,10 +589,12 @@ public static function drawCommit($commit, $issueDate, $showDiffs = true) { $revision = Digest::getShortGitRevision($commit['revision']); } - $buf .= ' ' . - self::drawDiffs($commit, $issueDate) . - ' - ' . + $diffs = self::drawDiffs($commit, $issueDate); + if (!empty($diffs)) { + $buf .= ' ' . $diffs . ''; + } + + $buf .= ' ' . sprintf(_('Revision %s'), $revision) . ' '; } @@ -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:'), - '' . $commit['name'] . '', - 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:'), +// '' . $commit['name'] . '', +// 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 = '' . $commit['name'] . ''; + // TODO: remove CIA.vc until we replace with internal author pages +// $committer = '' . $commit['name'] . ''; + $committer = $commit['name']; + } else { $committer = Ui::displayEmailAddress($commit['developer']); } @@ -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 .= '
diff --git a/src/classes/shared/enzyme.php b/src/classes/shared/enzyme.php index 7798708..5825f6e 100644 --- a/src/classes/shared/enzyme.php +++ b/src/classes/shared/enzyme.php @@ -2,7 +2,7 @@ /*-------------------------------------------------------+ | Enzyme - | Copyright 2010-2012 Danny Allen + | Copyright 2010-2013 Danny Allen | http://www.enzyme-project.org/ +--------------------------------------------------------+ | This program is released as free software under the @@ -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, @@ -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'], diff --git a/src/classes/shared/media.php b/src/classes/shared/media.php index 255b52e..1551c8c 100644 --- a/src/classes/shared/media.php +++ b/src/classes/shared/media.php @@ -205,7 +205,7 @@ public static function draw($media) { // show link? if ($media['size']) { $link = ''; diff --git a/src/classes/shared/ui.php b/src/classes/shared/ui.php index 2281687..080e042 100644 --- a/src/classes/shared/ui.php +++ b/src/classes/shared/ui.php @@ -2,7 +2,7 @@ /*-------------------------------------------------------+ | PHPzy (Web Application Framework) - | Copyright 2010-2011 Danny Allen + | Copyright 2010-2013 Danny Allen | http://www.dannya.com/ +--------------------------------------------------------+ | This program is released as free software under the @@ -21,7 +21,7 @@ public static function redirect($page) { header('Location: ' . BASE_URL . $page); } else{ - echo ''; + echo ''; } exit; @@ -57,7 +57,7 @@ public static function drawHtmlPageStart($title = null, array $css = array(), if ($js) { foreach ($js as $file) { - $script .= '' . "\n"; + $script .= '' . "\n"; } } diff --git a/src/classes/specific/config.php b/src/classes/specific/config.php index 68ea1b4..34f1e2b 100644 --- a/src/classes/specific/config.php +++ b/src/classes/specific/config.php @@ -2,7 +2,7 @@ /*-------------------------------------------------------+ | Enzyme - | Copyright 2010-2011 Danny Allen + | Copyright 2010-2014 Danny Allen | http://www.enzyme-project.org/ +--------------------------------------------------------+ | This program is released as free software under the @@ -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 @@ -54,7 +54,6 @@ final class Config { 'data_terms', 'developers', 'developer_privacy', - 'developer_survey', 'digests', 'digest_intro_people', 'digest_intro_sections', @@ -77,7 +76,7 @@ final class Config { // define settings information - private static $settings = null; + private static $settings = null; public static function getSetting() { diff --git a/src/index.php b/src/index.php index 5f5d7e7..f750255 100644 --- a/src/index.php +++ b/src/index.php @@ -22,9 +22,8 @@ $ui = new EnzymeUi(); ?> - - + +