Commit 1fca8ccc authored by Mathias Schreiber's avatar Mathias Schreiber
Browse files

Initial Commit

parents
2016-02-23 Mathias Schreiber <mathias.schreiber@typo3.org>
* Initial code generated with kickstarter
Feel free to add some documentation or simply add a link to the online manual.
<h3>Charts</h3>
<div id="charts" style="height: 300px;"></div>
<div class="b-tabs">
<ul class="tabs lite-tabs">
<f:for each="{majors}" as="majorsTabs" key="keyTab" iteration="tabIteratorTabs">
<li class="{f:if(condition: tabIteratorTabs.isFirst, then: 'act')}"><a href="#{ceUid}_{keyTab}">{majorsTabs.title}</a></li>
</f:for>
</ul>
<div class="tab-panes">
<f:for each="{majors}" as="major" key="key" iteration="tabIterator">
<a id="{ceUid}_{keyTab}"></a>
<div class="tab-content {f:if(condition: tabIterator.isFirst, then: 'lite-tab-panes-black show-tab', else: 'hide-tab')}">
<f:format.html>{major.bodytext}</f:format.html>
</div>
<h3>Releases</h3>
<table class="contenttable-0">
<thead>
<tr>
<th scope="col">Version</th>
<th scope="col">Primary Focus</th>
<th scope="col">Estimated Release</th>
</tr>
</thead>
<tbody>
<f:for each="{major.minorversions}" as="minor">
<tr>
<td>{minor.version}</td>
<td>{minor.focus}</td>
<td>{minor.released}</td>
</tr>
</f:for>
</tbody>
</table>
</f:for>
</div>
</div>
<h3>PHP Compatibility Chart</h3>
<f:format.html>{phpTable}</f:format.html>
a:4:{s:4:"save";a:3:{s:13:"extension_key";s:13:"typo3_roadmap";s:18:"print_wop_comments";s:1:"0";s:15:"overwrite_files";a:15:{s:9:"ChangeLog";s:1:"1";s:10:"README.txt";s:1:"1";s:12:"ext_icon.gif";s:1:"1";s:17:"ext_localconf.php";s:1:"1";s:14:"ext_tables.php";s:1:"1";s:14:"ext_tables.sql";s:1:"1";s:37:"icon_tx_typo3roadmap_majorversion.gif";s:1:"1";s:37:"icon_tx_typo3roadmap_minorversion.gif";s:1:"1";s:35:"icon_tx_typo3roadmap_phpversion.gif";s:1:"1";s:16:"locallang_db.xml";s:1:"1";s:7:"tca.php";s:1:"1";s:19:"doc/wizard_form.dat";s:1:"1";s:20:"doc/wizard_form.html";s:1:"1";s:33:"pi1/class.tx_typo3roadmap_pi1.php";s:1:"1";s:17:"pi1/locallang.xml";s:1:"1";}}s:6:"emconf";a:1:{i:1;a:7:{s:5:"title";s:13:"TYPO3 Roadmap";s:11:"description";s:41:"Roadmap and Chart Generator for TYPO3.org";s:8:"category";s:6:"plugin";s:5:"state";s:4:"beta";s:12:"dependencies";s:0:"";s:6:"author";s:17:"Mathias Schreiber";s:12:"author_email";s:27:"mathias.schreiber@typo3.org";}}s:6:"tables";a:3:{i:1;a:19:{s:9:"tablename";s:12:"majorversion";s:5:"title";s:21:"Roadmap Major Version";s:11:"add_deleted";s:1:"1";s:10:"add_hidden";s:1:"1";s:13:"add_starttime";s:1:"1";s:11:"add_endtime";s:1:"1";s:10:"add_access";s:1:"0";s:12:"localization";s:1:"0";s:10:"versioning";s:1:"0";s:7:"sorting";s:1:"1";s:13:"sorting_field";s:6:"crdate";s:12:"sorting_desc";s:1:"0";s:10:"type_field";s:1:"0";s:12:"header_field";s:5:"title";s:7:"defIcon";s:11:"default.gif";s:14:"allow_on_pages";s:1:"0";s:23:"allow_ce_insert_records";s:1:"0";s:12:"save_and_new";s:1:"1";s:6:"fields";a:6:{i:1;a:9:{s:9:"fieldname";s:5:"title";s:5:"title";s:5:"Title";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"1";s:12:"conf_varchar";s:1:"1";}i:2;a:7:{s:9:"fieldname";s:8:"bodytext";s:5:"title";s:11:"Description";s:4:"type";s:12:"textarea_rte";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:8:"conf_rte";s:10:"tt_content";s:19:"conf_rte_fullscreen";s:1:"1";}i:3;a:5:{s:9:"fieldname";s:14:"regularsupport";s:5:"title";s:20:"Regular Support ends";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:4;a:5:{s:9:"fieldname";s:15:"prioritysupport";s:5:"title";s:21:"Priority Support Ends";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:5;a:5:{s:9:"fieldname";s:15:"extendedsupport";s:5:"title";s:21:"Extended Support Ends";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:6;a:14:{s:9:"fieldname";s:11:"phpversions";s:5:"title";s:22:"Supported PHP Versions";s:4:"type";s:3:"rel";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:14:"conf_rel_table";s:26:"tx_typo3roadmap_phpversion";s:13:"conf_rel_type";s:6:"select";s:18:"conf_rel_dummyitem";s:1:"0";s:14:"conf_relations";s:2:"10";s:22:"conf_relations_selsize";s:2:"10";s:17:"conf_relations_mm";s:1:"1";s:15:"conf_wiz_addrec";s:1:"0";s:16:"conf_wiz_listrec";s:1:"0";s:16:"conf_wiz_editrec";s:1:"0";}}}i:2;a:19:{s:9:"tablename";s:12:"minorversion";s:5:"title";s:21:"Roadmap Minor Version";s:11:"add_deleted";s:1:"1";s:10:"add_hidden";s:1:"1";s:13:"add_starttime";s:1:"0";s:11:"add_endtime";s:1:"0";s:10:"add_access";s:1:"0";s:12:"localization";s:1:"0";s:10:"versioning";s:1:"0";s:7:"sorting";s:1:"1";s:13:"sorting_field";s:6:"crdate";s:12:"sorting_desc";s:1:"0";s:10:"type_field";s:1:"0";s:12:"header_field";s:9:"versionno";s:7:"defIcon";s:17:"default_gray4.gif";s:14:"allow_on_pages";s:1:"0";s:23:"allow_ce_insert_records";s:1:"0";s:12:"save_and_new";s:1:"1";s:6:"fields";a:6:{i:1;a:9:{s:9:"fieldname";s:7:"version";s:5:"title";s:11:"Version No.";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"1";s:12:"conf_varchar";s:1:"1";}i:2;a:17:{s:9:"fieldname";s:4:"link";s:5:"title";s:21:"Link to release notes";s:4:"type";s:6:"input+";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"0";s:12:"conf_varchar";s:1:"1";s:10:"conf_check";s:1:"0";s:9:"conf_eval";s:0:"";s:15:"conf_stripspace";s:1:"0";s:9:"conf_pass";s:1:"0";s:8:"conf_md5";s:1:"0";s:11:"conf_unique";s:0:"";s:14:"conf_wiz_color";s:1:"0";s:13:"conf_wiz_link";s:1:"1";}i:3;a:9:{s:9:"fieldname";s:5:"focus";s:5:"title";s:5:"Focus";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"1";s:12:"conf_varchar";s:1:"1";}i:4;a:5:{s:9:"fieldname";s:9:"estimated";s:5:"title";s:17:"Estimated Release";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:5;a:5:{s:9:"fieldname";s:8:"released";s:5:"title";s:11:"Released on";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:6;a:5:{s:9:"fieldname";s:6:"parent";s:5:"title";s:6:"parent";s:4:"type";s:7:"integer";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}}}i:3;a:19:{s:9:"tablename";s:10:"phpversion";s:5:"title";s:19:"Roadmap PHP Version";s:11:"add_deleted";s:1:"1";s:10:"add_hidden";s:1:"1";s:13:"add_starttime";s:1:"0";s:11:"add_endtime";s:1:"0";s:10:"add_access";s:1:"0";s:12:"localization";s:1:"0";s:10:"versioning";s:1:"0";s:7:"sorting";s:1:"1";s:13:"sorting_field";s:6:"crdate";s:12:"sorting_desc";s:1:"0";s:10:"type_field";s:1:"0";s:12:"header_field";s:1:"0";s:7:"defIcon";s:18:"default_yellow.gif";s:14:"allow_on_pages";s:1:"0";s:23:"allow_ce_insert_records";s:1:"0";s:12:"save_and_new";s:1:"1";s:6:"fields";a:3:{i:1;a:9:{s:9:"fieldname";s:7:"version";s:5:"title";s:11:"Version No.";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"0";s:12:"conf_varchar";s:1:"0";}i:2;a:5:{s:9:"fieldname";s:13:"activesupport";s:5:"title";s:19:"Active Support Ends";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}i:3;a:5:{s:9:"fieldname";s:15:"securitysupport";s:5:"title";s:21:"Security Support Ends";s:4:"type";s:4:"date";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";}}}}s:2:"pi";a:1:{i:1;a:11:{s:5:"title";s:13:"TYPO3 Roadmap";s:13:"plus_user_obj";s:1:"0";s:23:"plus_not_staticTemplate";s:1:"0";s:7:"addType";s:9:"list_type";s:8:"plus_wiz";s:1:"0";s:20:"plus_wiz_description";s:13:"TYPO3 Roadmap";s:12:"list_default";s:1:"0";s:21:"list_default_listmode";s:1:"0";s:23:"list_default_singlemode";s:1:"0";s:8:"tag_name";s:0:"";s:12:"plus_user_ex";s:1:"0";}}}
\ No newline at end of file
This diff is collapsed.
<?php
/***************************************************************
* Extension Manager/Repository config file for ext "typo3_roadmap".
*
* Auto generated 23-02-2016 10:46
*
* Manual updates:
* Only the data in the array - everything else is removed by next
* writing. "version" and "dependencies" must not be touched!
***************************************************************/
if (!isset($_EXTKEY)) {
$_EXTKEY = 'typo3_roadmap';
}
$EM_CONF[$_EXTKEY] = array(
'title' => 'TYPO3 Roadmap',
'description' => 'Roadmap and Chart Generator for TYPO3.org',
'category' => 'plugin',
'author' => 'Mathias Schreiber',
'author_email' => 'mathias.schreiber@typo3.org',
'shy' => '',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => 'beta',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'author_company' => '',
'version' => '0.0.0',
'constraints' => array(
'depends' => array(
),
'conflicts' => array(
),
'suggests' => array(
),
),
'_md5_values_when_last_written' => 'a:15:{s:9:"ChangeLog";s:4:"79fe";s:12:"ext_icon.gif";s:4:"1bdc";s:17:"ext_localconf.php";s:4:"d5f6";s:14:"ext_tables.php";s:4:"cf62";s:14:"ext_tables.sql";s:4:"3809";s:37:"icon_tx_typo3roadmap_majorversion.gif";s:4:"475a";s:37:"icon_tx_typo3roadmap_minorversion.gif";s:4:"a25c";s:35:"icon_tx_typo3roadmap_phpversion.gif";s:4:"401f";s:16:"locallang_db.xml";s:4:"7a43";s:10:"README.txt";s:4:"ee2d";s:7:"tca.php";s:4:"0926";s:19:"doc/wizard_form.dat";s:4:"d3cd";s:20:"doc/wizard_form.html";s:4:"2d73";s:33:"pi1/class.tx_typo3roadmap_pi1.php";s:4:"a503";s:17:"pi1/locallang.xml";s:4:"576f";}',
);
ext_icon.gif

124 Bytes

<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
if (!isset($_EXTKEY)) {
$_EXTKEY = 'typo3_roadmap';
}
t3lib_extMgm::addUserTSConfig('
options.saveDocNew.tx_typo3roadmap_majorversion=1
');
t3lib_extMgm::addUserTSConfig('
options.saveDocNew.tx_typo3roadmap_minorversion=1
');
t3lib_extMgm::addUserTSConfig('
options.saveDocNew.tx_typo3roadmap_phpversion=1
');
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_typo3roadmap_pi1.php', '_pi1', 'list_type', 1);
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
if (!isset($_EXTKEY)) {
$_EXTKEY = 'typo3_roadmap';
}
$TCA['tx_typo3roadmap_majorversion'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:typo3_roadmap/locallang_db.xml:tx_typo3roadmap_majorversion',
'label' => 'title',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'sortby' => 'sorting',
'delete' => 'deleted',
'dividers2tabs' => 1,
'enablecolumns' => array(
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_typo3roadmap_majorversion.gif',
),
);
$TCA['tx_typo3roadmap_minorversion'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:typo3_roadmap/locallang_db.xml:tx_typo3roadmap_minorversion',
'label' => 'version',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'sortby' => 'sorting',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_typo3roadmap_minorversion.gif',
),
);
$TCA['tx_typo3roadmap_phpversion'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:typo3_roadmap/locallang_db.xml:tx_typo3roadmap_phpversion',
'label' => 'version',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'sortby' => 'sorting',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_typo3roadmap_phpversion.gif',
),
);
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1'] = 'layout,select_key,pages';
t3lib_extMgm::addPlugin(array(
'LLL:EXT:typo3_roadmap/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY . '_pi1',
t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif'
),'list_type');
#
# Table structure for table 'tx_typo3roadmap_majorversion_phpversions_mm'
#
#
CREATE TABLE tx_typo3roadmap_majorversion_phpversions_mm (
uid_local int(11) DEFAULT '0' NOT NULL,
uid_foreign int(11) DEFAULT '0' NOT NULL,
tablenames varchar(30) DEFAULT '' NOT NULL,
sorting int(11) DEFAULT '0' NOT NULL,
KEY uid_local (uid_local),
KEY uid_foreign (uid_foreign)
);
#
# Table structure for table 'tx_typo3roadmap_majorversion'
#
CREATE TABLE tx_typo3roadmap_majorversion (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
starttime int(11) DEFAULT '0' NOT NULL,
endtime int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
bodytext text,
developmentstart int(11) DEFAULT '0' NOT NULL,
regularsupport int(11) DEFAULT '0' NOT NULL,
prioritysupport int(11) DEFAULT '0' NOT NULL,
extendedsupport int(11) DEFAULT '0' NOT NULL,
phpversions int(11) DEFAULT '0' NOT NULL,
minorversions int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
) ENGINE=InnoDB;
#
# Table structure for table 'tx_typo3roadmap_minorversion'
#
CREATE TABLE tx_typo3roadmap_minorversion (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
version varchar(255) DEFAULT '' NOT NULL,
link varchar(255) DEFAULT '' NOT NULL,
focus varchar(255) DEFAULT '' NOT NULL,
estimated int(11) DEFAULT '0' NOT NULL,
released int(11) DEFAULT '0' NOT NULL,
parent int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
) ENGINE=InnoDB;
#
# Table structure for table 'tx_typo3roadmap_phpversion'
#
CREATE TABLE tx_typo3roadmap_phpversion (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
version tinytext,
activesupport int(11) DEFAULT '0' NOT NULL,
securitysupport int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
) ENGINE=InnoDB;
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>database</type>
<description>Language labels for database tables/fields belonging to extension 'typo3_roadmap'</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="tx_typo3roadmap_majorversion">Roadmap Major Version</label>
<label index="tx_typo3roadmap_majorversion.title">Title</label>
<label index="tx_typo3roadmap_majorversion.bodytext">Description</label>
<label index="tx_typo3roadmap_majorversion.regularsupport">Regular Support ends</label>
<label index="tx_typo3roadmap_majorversion.prioritysupport">Priority Support Ends</label>
<label index="tx_typo3roadmap_majorversion.extendedsupport">Extended Support Ends</label>
<label index="tx_typo3roadmap_majorversion.phpversions">Supported PHP Versions</label>
<label index="tx_typo3roadmap_minorversion">Roadmap Minor Version</label>
<label index="tx_typo3roadmap_minorversion.version">Version No.</label>
<label index="tx_typo3roadmap_minorversion.link">Link to release notes</label>
<label index="tx_typo3roadmap_minorversion.focus">Focus</label>
<label index="tx_typo3roadmap_minorversion.estimated">Estimated Release</label>
<label index="tx_typo3roadmap_minorversion.released">Released on</label>
<label index="tx_typo3roadmap_minorversion.parent">parent</label>
<label index="tx_typo3roadmap_phpversion">Roadmap PHP Version</label>
<label index="tx_typo3roadmap_phpversion.version">Version No.</label>
<label index="tx_typo3roadmap_phpversion.activesupport">Active Support Ends</label>
<label index="tx_typo3roadmap_phpversion.securitysupport">Security Support Ends</label>
<label index="tt_content.list_type_pi1">TYPO3 Roadmap</label>
</languageKey>
</data>
</T3locallang>
\ No newline at end of file
<?php
/***************************************************************
* Copyright notice
*
* (c) 2016 Mathias Schreiber <mathias.schreiber@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Plugin 'TYPO3 Roadmap' for the 'typo3_roadmap' extension.
*
* @author Mathias Schreiber <mathias.schreiber@typo3.org>
* @package TYPO3
* @subpackage tx_typo3roadmap
*/
class tx_typo3roadmap_pi1 extends tslib_pibase
{
public $prefixId = 'tx_typo3roadmap_pi1'; // Same as class name
public $scriptRelPath = 'pi1/class.tx_typo3roadmap_pi1.php'; // Path to this script relative to the extension dir.
public $extKey = 'typo3_roadmap'; // The extension key.
public $pi_checkCHash = true;
/**
* @var Tx_Fluid_View_StandaloneView
*/
protected $view;
/**
* Color Codes for the charts
*
* @var array
*/
protected $colors = [
'regular' => '#69A550',
'security' => '#FF8700',
'elts' => '#ffb767',
'sprint' => '#8C8C8C',
'stabilization' => '#bc0000'
];
/**
* @var t3lib_DB
*/
protected $db;
/**
* @var t3lib_PageRenderer
*/
protected $pageRenderer;
/**
* The main method of the Plugin.
*
* @param string $content The Plugin content
* @param array $conf The Plugin configuration
*
* @return string The content that is displayed on the website
*/
public function main($content = '', array $conf)
{
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->initializeView();
$this->db = $GLOBALS['TYPO3_DB'];
$this->pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
$majorVersions = $this->getMajorVersions();
$this->renderCharts($majorVersions);
$this->view->assign('majors', $majorVersions);
$this->view->assign('ceUid', $this->cObj->data['uid']);
$this->view->assign('phpTable', $this->renderPHPCompatibilityMatrix($this->getAllAvailablePHPVersions(), $majorVersions));
$content .= $this->view->render();
return $content;
}
/**
* Initialize the Fluid StandAlone View and set the template
*/
protected function initializeView()
{
$this->view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
$this->view->setTemplatePathAndFilename(t3lib_extMgm::extPath($this->extKey) .
'/Resources/Private/Templates/Roadmap.html');
}
/**
* Fetches all major versions from the database
*
* @return array|NULL
*/
protected function getMajorVersions()
{
$rows = $this->db->exec_SELECTgetRows(
'*',
'tx_typo3roadmap_majorversion',
'1 = 1 ' . $this->cObj->enableFields('tx_typo3roadmap_majorversion'),
'sorting'
);
foreach ($rows as $index => $singleRow) {
$rows[$index]['minorversions'] = $this->getMinorVersions($singleRow['uid']);
$rows[$index]['phpVersions'] = $this->getSupportedPHPVersions($singleRow['uid']);
}
return $rows;
}
/**
* Fetches the minor versions of a given major version
*
* @param int $majorVersion The major version uid to fetch the minors for
*
* @return array|NULL
*/
protected function getMinorVersions($majorVersion)
{
$rows = $this->db->exec_SELECTgetRows(
'*',
'tx_typo3roadmap_minorversion',
'parent = ' . (int)$majorVersion . '' . $this->cObj->enableFields('tx_typo3roadmap_minorversion'),
'sorting'
);
return $rows;
}
protected function getSupportedPHPVersions($majorVersion)
{
$rows = $this->db->exec_SELECTgetRows(
'uid, version',
'tx_typo3roadmap_majorversion_phpversions_mm
INNER JOIN tx_typo3roadmap_phpversion ON tx_typo3roadmap_phpversion.uid = tx_typo3roadmap_majorversion_phpversions_mm.uid_foreign',
'tx_typo3roadmap_majorversion_phpversions_mm.uid_local = '.(int)$majorVersion . $this->cObj->enableFields('tx_typo3roadmap_phpversion'),
'',
'',
'',
'uid'
);
return $rows;
}
/**
* @return array|NULL
*/
protected function getAllAvailablePHPVersions()
{
$rows = $this->db->exec_SELECTgetRows(
'uid, version',
'tx_typo3roadmap_phpversion',
'1 = 1 ' . $this->cObj->enableFields('tx_typo3roadmap_phpversion'),
'',
'version ASC',
'',
'uid'
);
if($rows === null) {
return [];
}
return $rows;
}
/**
* Renders the LTS charts
*
* @param array $majorVersions
*/
protected function renderCharts(array $majorVersions)
{
$this->pageRenderer->addJsLibrary('amcharts', 'https://www.amcharts.com/lib/3/amcharts.js');
$this->pageRenderer->addJsLibrary('amcharts_serial', 'https://www.amcharts.com/lib/3/serial.js');
$this->pageRenderer->addJsLibrary('amcharts_gantt', 'https://www.amcharts.com/lib/3/gantt.js');
$this->pageRenderer->addJsLibrary('amcharts_lightheme', 'https://www.amcharts.com/lib/3/themes/light.js');
$this->pageRenderer->addJsLibrary('amcharts_export', 'https://www.amcharts.com/lib/3/plugins/export/export.js');
$this->pageRenderer->addCssFile('https://www.amcharts.com/lib/3/plugins/export/export.css');
$data = $this->generateChartArray($majorVersions);
$this->view->assign('data', $data);
$chartJs = '
AmCharts.useUTC = true;
var chart = AmCharts.makeChart("charts", {
"type": "gantt",
"theme": "light",
"marginRight": 70,
"period": "YYYY",
"dataDateFormat": "YYYY-MM-DD",
"columnWidth": 0.65,
"precision": 1,
"valueAxis": {
"type": "date",
"autoGridCount": false,
"gridCount": 24
},
"graph": {
"fillAlphas": 1,
"balloonText": "<b>[[task]]</b>: [[open]]-[[value]]"
},
"rotate": true,
"categoryField": "version",
"segmentsField": "segments",
"colorField": "color",
"startDateField": "start",
"endDateField": "end",
"dataProvider": ' . json_encode($data) . ',
"valueScrollbar": {
"autoGridCount": true
},
"chartCursor": {
"cursorColor": "#55bb76",
"valueBalloonsEnabled": false,
"cursorAlpha": 0,
"valueLineAlpha": 0.5,
"valueLineBalloonEnabled": true,
"valueLineEnabled": true,
"zoomable": false,
"valueZoomable": true
},
"export": {
"enabled": true
}
});
';
$this->pageRenderer->addJsFooterInlineCode('ltsChart', $chartJs);
}
/**
* Central date formatter
*
* @param int $timeStamp
*
* @return bool|string
*/
protected function dateFromTimestamp($timeStamp = 0)
{
return date('Y-m-d', $timeStamp);
}
/**
* Creates the raw JSON data for the chart
* This is rather complex so take your time
*
* @param array $majorVersions
*
* @return array
*/
protected function generateChartArray(array $majorVersions)
{
$data = [];
foreach ($majorVersions as $index => $majorVersion) {
$firstStart = (int)$majorVersion['developmentstart'];
$data[$index]['version'] = $majorVersion['title'];
foreach ($majorVersion['minorversions'] as $minorIndex => $minorVersion) {
$realDate = (int)$minorVersion['estimated'];
if ((int)$minorVersion['released'] >= (int)$minorVersion['estimated']) {
$realDate = (int)$minorVersion['released'];
}
// Check if we are in the first loop