Skip to content

Commit e963243

Browse files
committed
Merge branch 'release/1.5.0'
2 parents 0b7ff0e + 88da256 commit e963243

37 files changed

+1694
-610
lines changed

.atoum.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
$tests_dir = __DIR__ . '/tests/';
4+
$coverage_dir = $tests_dir . 'code-coverage/';
5+
6+
if (!file_exists($coverage_dir)) {
7+
mkdir($coverage_dir);
8+
}
9+
10+
$coverageField = new atoum\report\fields\runner\coverage\html(
11+
'GLPI Fields Plugin',
12+
$coverage_dir
13+
);
14+
$coverageField->setRootUrl('file://' . realpath($coverage_dir));
15+
16+
$script
17+
->addDefaultReport()
18+
->addField($coverageField);
19+
20+
$script
21+
->noCodeCoverageForClasses('CommonGLPI')
22+
->noCodeCoverageForClasses('CommonDBTM');
23+

.travis.yml

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,40 @@
11
language: php
2+
php:
3+
- 5.4
4+
- 5.5
5+
- 5.6
6+
- 7.0
7+
- 7.1
8+
- nightly
29

310
env:
4-
- DB=mysql
11+
global:
12+
- DB=mysql
13+
matrix:
14+
#- GLPIVER=9.1.2 ==> not released yet!
15+
- GLPIVER=9.1/bugfixes
16+
- GLPIVER=master
517

618
before_script:
719
- composer self-update
20+
- git clone --depth=1 https://github.com/glpi-project/glpi -b $GLPIVER ../glpi && cd ../glpi
21+
- composer install --no-dev
22+
- mysql -u root -e 'create database glpitest;'
23+
- php tools/cliinstall.php --db=glpi-test --user=travis --tests
24+
- mv ../fields plugins/fields
25+
- cd plugins/fields
826
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.4" ]]; then sed -e "s|.*"consolidation/robo".*$||" -i composer.json && composer update; fi
927
- composer install -o
10-
# - mysql -u root -e 'create database glpitest;'
11-
# - php tools/cliinstall.php --lang=en_US --db=glpitest --user=root --tests
12-
- pear install pear/PHP_CodeSniffer
13-
- phpenv rehash
1428

1529
script:
16-
# - mysql -u root -e 'select version();'
17-
# - phpunit --verbose
18-
- phpcs -p --ignore=vendor --ignore=js --standard=tools/phpcs-rules.xml .
30+
- mysql -u root -e 'select version();'
31+
- vendor/bin/phpcs -p --ignore=vendor --ignore=js --ignore=css --standard=vendor/glpi-project/coding-standard/GlpiStandard/ .
32+
- ./vendor/bin/atoum -bf tests/bootstrap.php -d tests/units/
1933

2034
matrix:
21-
include:
35+
exclude:
2236
- php: 5.4
23-
addons:
24-
mariadb: 5.5
25-
- php: 5.5
26-
addons:
27-
mariadb: 5.5
28-
# - php: 5.6
29-
# addons:
30-
# mariadb: 5.5
31-
# - php: 5.6
32-
# addons:
33-
# mariadb: 10.0
34-
- php: 5.6
35-
addons:
36-
mariadb: 10.1
37-
# - php: 7.0
38-
# addons:
39-
# mariadb: 10.0
40-
- php: 7.0
41-
addons:
42-
mariadb: 10.1
43-
# - php: 7.1
44-
# addons:
45-
# mariadb: 10.0
46-
- php: 7.1
47-
addons:
48-
mariadb: 10.1
49-
- php: nightly
50-
addons:
51-
mariadb: 10.1
37+
env: GLPIVER=master
5238
allow_failures:
5339
- php: nightly
5440

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.5.0] - 2017-01-27
9+
10+
**Compatible with GLPI 9.1.2 and above**
11+
12+
- Use post_item_form hook instead of javascript to display fields
13+
- Fix (and limit) dom tab possibilities
14+
815
## [1.4.5] - 2017-01-13
916
- Set minimal PHP version to 5.4
1017
- Prevent values to be kept from a new ticket to another
@@ -41,7 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4148
- Fix adding bloc for specific tab
4249
- Fix dropdown pagination links
4350
- Fix validation issue creating new tickets
44-
- Fix checks consistancy
51+
- Fix checks consistency
4552
- Ensure we target only the first tab
4653

4754
## [1.4.0] - 2016-12-13

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Fields GLPi plugin
1+
# Fields GLPI plugin
22

33
The fields plugin allows you to add custom fields on glpi types : tickets, computers, users...
44

55
Addionnal data can be added :
66
* In object tab
7-
* In main form of object (above save button)
8-
* In form of a tab (Warning, this feature is experimental)
7+
* In main form of object, above save button
8+
* In form of a tab, above save button
99

1010
Possible fields type are :
1111
* Header (title bloc)
@@ -19,10 +19,6 @@ Possible fields type are :
1919
* Date / Hour
2020
* Glpi User list
2121

22-
There is a [migration script](https://github.com/pluginsGLPI/customfields/blob/master/scripts/migrate-to-fields.php) from "customfields" plugin.
23-
**WARNING : this one is experimental and deserved to be more tested. We strongly advise you to backup your data before using it**
24-
25-
2622
## Documentation
2723

2824
http://glpi-plugins.rtfd.io/en/latest/fields/index.html

RoboFilePlugin.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class RoboFilePlugin extends \Robo\Tasks
1111
*
1212
* @return void
1313
*/
14-
public function minify()
15-
{
14+
public function minify() {
1615
$this->minifyCSS()
1716
->minifyJS();
1817
}
@@ -22,11 +21,10 @@ public function minify()
2221
*
2322
* @return void
2423
*/
25-
public function minifyCSS()
26-
{
24+
public function minifyCSS() {
2725
$css_dir = __DIR__ . '/css';
2826
if (is_dir($css_dir)) {
29-
foreach(glob("$css_dir/*.css") as $css_file) {
27+
foreach (glob("$css_dir/*.css") as $css_file) {
3028
if (!$this->endsWith($css_file, 'min.css')) {
3129
$this->taskMinify($css_file)
3230
->to(str_replace('.css', '.min.css', $css_file))
@@ -43,11 +41,10 @@ public function minifyCSS()
4341
*
4442
* @return void
4543
*/
46-
public function minifyJS()
47-
{
44+
public function minifyJS() {
4845
$js_dir = __DIR__ . '/js';
4946
if (is_dir($js_dir)) {
50-
foreach(glob("$js_dir/*.js") as $js_file) {
47+
foreach (glob("$js_dir/*.js") as $js_file) {
5148
if (!$this->endsWith($js_file, 'min.js')) {
5249
$this->taskMinify($js_file)
5350
->to(str_replace('.js', '.min.js', $js_file))
@@ -64,8 +61,7 @@ public function minifyJS()
6461
*
6562
* @return void
6663
*/
67-
public function localesExtract()
68-
{
64+
public function localesExtract() {
6965
$this->_exec('tools/extract_template.sh');
7066
return $this;
7167
}
@@ -75,19 +71,19 @@ public function localesExtract()
7571
*
7672
* @return void
7773
*/
78-
public function localesPush()
79-
{
74+
public function localesPush() {
8075
$this->_exec('tx push -s');
8176
return $this;
8277
}
8378

8479
/**
8580
* Pull locales from transifex.
8681
*
82+
* @param integer $percent Completeness percentage, defaults to 70
83+
*
8784
* @return void
8885
*/
89-
public function localesPull($percent = 70)
90-
{
86+
public function localesPull($percent = 70) {
9187
$this->_exec('tx pull -a --minimum-perc=' .$percent);
9288
return $this;
9389
}
@@ -97,8 +93,7 @@ public function localesPull($percent = 70)
9793
*
9894
* @return void
9995
*/
100-
public function localesMo()
101-
{
96+
public function localesMo() {
10297
$this->_exec('./tools/release --compile-mo');
10398
return $this;
10499
}
@@ -108,8 +103,7 @@ public function localesMo()
108103
*
109104
* @return void
110105
*/
111-
public function localesSend()
112-
{
106+
public function localesSend() {
113107
$this->localesExtract()
114108
->localesPush();
115109
return $this;
@@ -118,6 +112,8 @@ public function localesSend()
118112
/**
119113
* Retrieve locales and generate mo files
120114
*
115+
* @param integer $percent Completeness percentage, defaults to 70
116+
*
121117
* @return void
122118
*/
123119
public function localesGenerate($percent = 70) {

ajax/container_subtype_dropdown.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22
include ("../../../inc/includes.php");
33

4-
PluginFieldsContainer::showFormSubtype($_REQUEST);
4+
PluginFieldsContainer::showFormSubtype($_REQUEST, true);

ajax/load_dom_fields.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

ajax/reorder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$id_item = $first['id'];
1313

1414
// Réorganisation de tout les champs
15-
if($_POST['old_order'] < $_POST['new_order']) {
15+
if ($_POST['old_order'] < $_POST['new_order']) {
1616
$DB->query("UPDATE $table SET
1717
`ranking` = `ranking`-1
1818
WHERE plugin_fields_containers_id = {$_POST['container_id']}

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"require-dev": {
33
"consolidation/robo": "dev-master@dev",
44
"patchwork/jsqueeze": "~1.0",
5-
"natxet/CssMin": "~3.0"
5+
"natxet/CssMin": "~3.0",
6+
"glpi-project/coding-standard": "0.5",
7+
"atoum/atoum": "^2.8"
8+
},
9+
"scripts": {
10+
"post-install-cmd": "patch -d vendor/atoum/atoum -p1 < tools/atoum-php71.patch"
611
}
712
}

0 commit comments

Comments
 (0)