Commit ee7c7878 authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Update JS dependencies

- Update moment.js from 2.19.3 to 2.22.2
- Update lodash.js from 4.17.4 to 4.17.11
- Update TinyMCE from 4.7.13 to 4.9.0
- Update prism.js from 1.5.1 to 1.15.0
- Update leaflet.js from 1.2.0 to 1.3.4
- Update leaflet.markercluster.js from 1.2.0 to 1.4.1
- Update FontAwesome from 5.4.1 to 5.5.0
- Update jQuery from 1.10.2 to 1.12.4
- Update jQuery FullCalendar from 3.6.1 to 3.9.0
- Update jQuery File-Upload from 5.34.0 to 9.28.0
- Update jQuery Timepicker Addon from 1.5.0 to 1.6.3
- Update jQuery jstree from 3.3.4 to 3.3.7
- Load not minified file in debug mode if file exists
- Update dependencies versions in README file
parent ec9d9d64
......@@ -105,19 +105,19 @@ We are working on a [markdown version](https://github.com/glpi-project/doc)
* [Chartist.js v0.10.1](https://github.com/gionkunz/chartist-js) MIT/WTFPL
* [chartist-plugin-legend v0.6.0](https://github.com/CodeYellowBV/chartist-plugin-legend) ISC
* [chartist-plugin-tooltip v0.0.17](https://github.com/tmmdata/chartist-plugin-tooltip) MIT
* [Font-Awesome v4.7.0](https://github.com/FortAwesome/Font-Awesome) MIT
* [Font-Awesome v5.5.0](https://github.com/FortAwesome/Font-Awesome) MIT
* [fuzzy v0.1.3](https://github.com/mattyork/fuzzy) MIT
* [gridstack.js v unknow-dev](https://github.com/gridstack/gridstack.js) MIT
* [htmLawed v1.2.4](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) LGPL3/GPL2+
* [jQuery v1.10.2](https://github.com/jquery/jquery) MIT
* [jQuery v1.12.4](https://github.com/jquery/jquery) MIT
* [jQuery UI v1.10.4](https://github.com/jquery/jquery-ui) MIT
* jQuery plugins *
* [Leaflet v1.2.0](https://github.com/Leaflet/Leaflet) BSD2S
* [PrismJS v](https://github.com/PrismJS/prism) MIT
* [Leaflet v1.3.4](https://github.com/Leaflet/Leaflet) BSD2S
* [PrismJS v1.15.0](https://github.com/PrismJS/prism) MIT
* [spin.js v2.3.2](https://github.com/fgnass/spin.js) MIT
* [TinyMCE v4.7.1](https://github.com/tinymce/tinymce) LGPL2.1
* [TinyMCE v4.9.0](https://github.com/tinymce/tinymce) LGPL2.1
* [Underscore.js v1.8.3](https://github.com/jashkenas/underscore) MIT
* [Lodash v unknown](https://github.com/lodash/lodash) MIT
* [Lodash v4.17.11](https://github.com/lodash/lodash) MIT
## Support
......
......@@ -104,12 +104,26 @@ class GLPIUploadHandler extends UploadHandler {
return __('Image requires a minimum height');
break;
case 'accept_file_types':
return __('Filetype not allowed');
break;
case 'abort':
return __('File upload aborted');
break;
case 'image_resize':
return __('Failed to resize image');
break;
}
return false;
}
static function uploadFiles($params = []) {
global $DB;
$default_params = [
'name' => '',
'showfilesize' => false,
......@@ -123,18 +137,48 @@ class GLPIUploadHandler extends UploadHandler {
$name = $rand_name . $name;
}
$valid_type_iterator = $DB->request([
'FROM' => 'glpi_documenttypes',
'WHERE' => [
'is_uploadable' => 1
]
]);
$valid_ext_patterns = [];
foreach ($valid_type_iterator as $valid_type) {
$valid_ext = $valid_type['ext'];
if (preg_match('/\/.+\//', $valid_ext)) {
// Filename matches pattern
// Remove surrounding '/' as it will be included in a larger pattern
// and protect by surrounding parenthesis to prevent conflict with other patterns
$valid_ext_patterns[] = '(' . substr($valid_ext, 1, -1) . ')';
} else {
// Filename ends with allowed ext
$valid_ext_patterns[] = '\.' . preg_quote($valid_type['ext'], '/') . '$';
}
}
$upload_dir = GLPI_TMP_DIR.'/';
$upload_handler = new self(['upload_dir' => $upload_dir,
'param_name' => $pname,
'orient_image' => false,
'image_versions' => []],
false);
$upload_handler = new self(
[
'accept_file_types' => '/(' . implode('|', $valid_ext_patterns) . ')/i',
'image_versions' => [
'auto_orient' => false,
],
'param_name' => $pname,
'replace_dots_in_filenames' => false,
'upload_dir' => $upload_dir,
],
false
);
$response = $upload_handler->post(false);
// clean compute display filesize
if (isset($response[$pname]) && is_array($response[$pname])) {
foreach ($response[$pname] as $key => &$val) {
if (Document::isValidDoc(addslashes($val->name))) {
foreach ($response[$pname] as &$val) {
if (isset($val->error) && file_exists($upload_dir.$val->name)) {
unlink($upload_dir.$val->name);
} else {
$val->prefix = $rand_name;
if (isset($val->name)) {
$val->display = str_replace($rand_name, '', $val->name);
......@@ -145,12 +189,6 @@ class GLPIUploadHandler extends UploadHandler {
$val->display = sprintf('%1$s %2$s', $val->display, $val->filesize);
}
}
} else {
// Unlink file
$val->error = __('Filetype not allowed');
if (file_exists($upload_dir.$val->name)) {
unlink($upload_dir.$val->name);
}
}
$val->id = 'doc'.$params['name'].mt_rand();
}
......@@ -159,4 +197,20 @@ class GLPIUploadHandler extends UploadHandler {
// send answer
return $upload_handler->generate_response($response, $params['print_response']);
}
protected function get_upload_data($id) {
return array_key_exists($id, $_FILES) ? $_FILES[$id] : null;
}
protected function get_post_param($id) {
return array_key_exists($id, $_POST) ? $_POST[$id] : null;
}
protected function get_query_param($id) {
return array_key_exists($id, $_GET) ? $_GET[$id] : null;
}
protected function get_server_var($id) {
return array_key_exists($id, $_SERVER) ? $_SERVER[$id] : null;
}
}
......@@ -1183,7 +1183,7 @@ class Html {
echo Html::css('css/jstree-glpi.css');
echo Html::css('lib/jqueryplugins/select2/css/select2.css');
echo Html::css('lib/jqueryplugins/qtip2/jquery.qtip.css');
echo Html::css('lib/font-awesome-5.4.1/css/all.min.css');
echo Html::css('lib/font-awesome/css/all.css');
if (isset($CFG_GLPI['notifications_ajax']) && $CFG_GLPI['notifications_ajax']) {
Html::requireJs('notifications_ajax');
......@@ -1231,7 +1231,7 @@ class Html {
}
if (in_array('colorpicker', $jslibs)) {
echo Html::css('lib/jqueryplugins/spectrum-colorpicker/spectrum.min.css');
echo Html::css('lib/jqueryplugins/spectrum-colorpicker/spectrum.css');
Html::requireJs('colorpicker');
}
......@@ -1315,7 +1315,7 @@ class Html {
}
// AJAX library
echo Html::script('lib/jquery/js/jquery-1.10.2.js');
echo Html::script('lib/jquery/js/jquery.js');
echo Html::script('lib/jquery/js/jquery-ui-1.10.4.custom.js');
// PLugins jquery
......
......@@ -189,7 +189,7 @@ class KnowbaseItem_Revision extends CommonDBTM {
}
echo Html::script("lib/jqueryplugins/prettytextdiff/diff_match_patch.js");
echo Html::script("lib/jqueryplugins/prettytextdiff/jquery.pretty-text-diff.min.js");
echo Html::script("lib/jqueryplugins/prettytextdiff/jquery.pretty-text-diff.js");
echo "<script type='text/javascript'>
$(function() {
$('.restore').on('click', function(e) {
......
......@@ -85,9 +85,9 @@ if (!file_exists(GLPI_CONFIG_DIR . "/config_db.php")) {
// Appel CSS
echo Html::scss('main_styles');
// font awesome icons
echo Html::css('lib/font-awesome-5.4.1/css/all.min.css');
echo Html::css('lib/font-awesome/css/all.css');
echo Html::script('lib/jquery/js/jquery-1.10.2.js');
echo Html::script('lib/jquery/js/jquery.js');
echo Html::script('lib/jqueryplugins/select2/js/select2.full.js');
echo Html::css('lib/jqueryplugins/select2/css/select2.css');
echo Html::script('js/common.js');
......
......@@ -55,13 +55,13 @@ function header_html($etape) {
echo "<title>Setup GLPI</title>";
// LIBS
echo Html::script("lib/jquery/js/jquery-1.10.2.min.js");
echo Html::script('lib/jquery/js/jquery-ui-1.10.4.custom.min.js');
echo Html::script("lib/jquery/js/jquery.js");
echo Html::script('lib/jquery/js/jquery-ui-1.10.4.custom.js');
echo Html::script("lib/jqueryplugins/select2/js/select2.js");
// CSS
echo Html::css('lib/jquery/css/smoothness/jquery-ui-1.10.4.custom.min.css');
echo Html::css("lib/jqueryplugins/select2/css/select2.min.css");
echo Html::css('lib/jquery/css/smoothness/jquery-ui-1.10.4.custom.css');
echo Html::css("lib/jqueryplugins/select2/css/select2.css");
echo Html::css("css/style_install.css");
echo "</head>";
echo "<body>";
......
......@@ -515,7 +515,7 @@ echo "<meta http-equiv='Content-Script-Type' content='text/javascript'>";
echo "<meta http-equiv='Content-Style-Type' content='text/css'>";
echo "<title>Setup GLPI</title>";
//JS
echo Html::script("../lib/jquery/js/jquery-1.10.2.min.js");
echo Html::script("lib/jquery/js/jquery.js");
echo Html::script('lib/jquery/js/jquery-ui-1.10.4.custom.js');
// CSS
echo "<link rel='stylesheet' href='../css/style_install.css' type='text/css' media='screen' >";
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ Font Awesome Free License
Font Awesome Free is free, open source, and GPL friendly. You can use it for
commercial projects, open source projects, or really almost whatever you want.
Full Font Awesome Free license: https://fontawesome.com/license.
Full Font Awesome Free license: https://fontawesome.com/license/free.
# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
......@@ -24,7 +24,7 @@ attribution, so you shouldn't need to do anything additional when using these
files normally.
We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
to remove them from files, especially code. They're a great way for folks to
learn about Font Awesome.
# Brand Icons
......
/*!
* Font Awesome Free 5.4.1 by @fontawesome - https://fontawesome.com
* Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
.fa,
......@@ -167,7 +167,7 @@
line-height: 2em;
position: relative;
vertical-align: middle;
width: 2em; }
width: 2.5em; }
.fa-stack-1x,
.fa-stack-2x {
......@@ -874,12 +874,27 @@ readers do not read off random characters that represent icons */
.fa-cloud-download-alt:before {
content: "\f381"; }
.fa-cloud-meatball:before {
content: "\f73b"; }
.fa-cloud-moon:before {
content: "\f6c3"; }
.fa-cloud-moon-rain:before {
content: "\f73c"; }
.fa-cloud-rain:before {
content: "\f73d"; }
.fa-cloud-showers-heavy:before {
content: "\f740"; }
.fa-cloud-sun:before {
content: "\f6c4"; }
.fa-cloud-sun-rain:before {
content: "\f743"; }
.fa-cloud-upload-alt:before {
content: "\f382"; }
......@@ -1066,6 +1081,9 @@ readers do not read off random characters that represent icons */
.fa-d-and-d:before {
content: "\f38d"; }
.fa-d-and-d-beyond:before {
content: "\f6ca"; }
.fa-dashcube:before {
content: "\f210"; }
......@@ -1078,6 +1096,9 @@ readers do not read off random characters that represent icons */
.fa-delicious:before {
content: "\f1a5"; }
.fa-democrat:before {
content: "\f747"; }
.fa-deploydog:before {
content: "\f38e"; }
......@@ -1486,6 +1507,9 @@ readers do not read off random characters that represent icons */
.fa-flag-checkered:before {
content: "\f11e"; }
.fa-flag-usa:before {
content: "\f74d"; }
.fa-flask:before {
content: "\f0c3"; }
......@@ -2329,6 +2353,9 @@ readers do not read off random characters that represent icons */
.fa-mercury:before {
content: "\f223"; }
.fa-meteor:before {
content: "\f753"; }
.fa-microchip:before {
content: "\f2db"; }
......@@ -2605,6 +2632,9 @@ readers do not read off random characters that represent icons */
.fa-periscope:before {
content: "\f3da"; }
.fa-person-booth:before {
content: "\f756"; }
.fa-phabricator:before {
content: "\f3db"; }
......@@ -2701,6 +2731,9 @@ readers do not read off random characters that represent icons */
.fa-poo:before {
content: "\f2fe"; }
.fa-poo-storm:before {
content: "\f75a"; }
.fa-poop:before {
content: "\f619"; }
......@@ -2782,6 +2815,9 @@ readers do not read off random characters that represent icons */
.fa-r-project:before {
content: "\f4f7"; }
.fa-rainbow:before {
content: "\f75b"; }
.fa-random:before {
content: "\f074"; }
......@@ -2791,6 +2827,9 @@ readers do not read off random characters that represent icons */
.fa-react:before {
content: "\f41b"; }
.fa-reacteurope:before {
content: "\f75d"; }
.fa-readme:before {
content: "\f4d5"; }
......@@ -2824,9 +2863,6 @@ readers do not read off random characters that represent icons */
.fa-registered:before {
content: "\f25d"; }
.fa-rendact:before {
content: "\f3e4"; }
.fa-renren:before {
content: "\f18b"; }
......@@ -2839,6 +2875,9 @@ readers do not read off random characters that represent icons */
.fa-replyd:before {
content: "\f3e6"; }
.fa-republican:before {
content: "\f75e"; }
.fa-researchgate:before {
content: "\f4f8"; }
......@@ -3082,6 +3121,9 @@ readers do not read off random characters that represent icons */
.fa-smile-wink:before {
content: "\f4da"; }
.fa-smog:before {
content: "\f75f"; }
.fa-smoking:before {
content: "\f48d"; }
......@@ -3367,6 +3409,12 @@ readers do not read off random characters that represent icons */
.fa-telegram-plane:before {
content: "\f3fe"; }
.fa-temperature-high:before {
content: "\f769"; }
.fa-temperature-low:before {
content: "\f76b"; }
.fa-tencent-weibo:before {
content: "\f1d5"; }
......@@ -3418,6 +3466,9 @@ readers do not read off random characters that represent icons */
.fa-thermometer-three-quarters:before {
content: "\f2c8"; }
.fa-think-peaks:before {
content: "\f731"; }
.fa-thumbs-down:before {
content: "\f165"; }
......@@ -3754,6 +3805,12 @@ readers do not read off random characters that represent icons */
.fa-volume-up:before {
content: "\f028"; }
.fa-vote-yea:before {
content: "\f772"; }
.fa-vr-cardboard:before {
content: "\f729"; }
.fa-vuejs:before {
content: "\f41f"; }
......@@ -3766,6 +3823,9 @@ readers do not read off random characters that represent icons */
.fa-warehouse:before {
content: "\f494"; }
.fa-water:before {
content: "\f773"; }
.fa-weebly:before {
content: "\f5cc"; }
......@@ -3853,6 +3913,9 @@ readers do not read off random characters that represent icons */
.fa-wpforms:before {
content: "\f298"; }
.fa-wpressr:before {
content: "\f3e4"; }
.fa-wrench:before {
content: "\f0ad"; }
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
v3.9.0 (2018-03-04)
-------------------
- Bootstrap 4 support (#4032, #4065, thx @GeekJosh)
- add OptionsInput to the fullcalendar.d.ts exports (#4040, #4006)
- columnHeaderFormat/columnHeaderHtml/columnHeaderText in .d.ts file (#4061, #4085)
- list-view auto-height not working (#3346, #4071, thx @WhatTheBuild)
- bump momentjs minimum version to 2.20.1, for locale fixes (#4014)
- swedish week header translation fix (#4082)
- dutch year translation (#4069)
v3.8.2 (2018-01-30)
-------------------
Bugfixes:
- Fix TypeScript definitions file with strictNullChecks (#4035)
v3.8.1 (2018-01-28)
-------------------
Bugfixes:
- TypeScript definition file not compatible with noImplicitAny (#4017)
- ES6 classes are not supported for grid class (#3437)
- day numbers in month view should be localized (#3339)
- select helper is resizable, causes js error (#3764)
- selecting over existing select helper causes js error (#4031)
- eventOrder doesn't work on custom fields (#3950)
- aria label on button icons (#4023)
- dynamic option changes to select/overlap/allow doesn't cause rerender
Locales:
- added Georgian (#3994)
- added Bosnian (#4029)
v3.8.0 (2017-12-18)
-------------------
- new settings for month/agenda/basic views (#3078):
- `columnHeaderFormat` (renamed from `columnFormat`)
- `columnHeaderText`
- `columnHeaderHtml`
- TypeScript definition file (fullcalendar.d.ts) included in npm package (#3889)
- codebase using SASS, though not taking advantage of it yet (#3463)
- codebase fully ported to TypeScript / Webpack
- Afrikaans locale fix (#3862)
v3.7.0 (2017-11-13)
-------------------
Bugfixes:
- `render` method does not re-adjust calendar dimension (#3893)
- when custom view navigates completely into hidden weekends, JS error ([scheduler-375])
Other:
- in themes.html demo, fixed broken Bootswatch themes (#3917)
- moved JavaScript codebase over to TypeScript
(same external API; embedded typedefs coming soon)
[scheduler-375]: https://github.com/fullcalendar/fullcalendar-scheduler/issues/375
v3.6.2 (2017-10-23)
-------------------
Bugfixes:
- Google Calendar event sources not calling `loading` callback (#3884)
- `eventDataTransform` w/ eventConstraint shouldn't be called during event resizing (#3859)
- `navLinks` would go to the previously navigated date (#3869)
- `nowIndicator` arrow would repeatedly render (#3872)
- fc-content-skeleton DOM element would repeatedly render on navigation in agenda view
v3.6.1 (2017-10-11)
-------------------
......@@ -1024,7 +1099,7 @@ v1.4.3 (2009-12-22)
- added destroy method
- Google Calendar event pages respect currentTimezone
- caching now handled by jQuery's ajax
- caching now handled by jQuery's ajax
- protection from setting aspectRatio to zero
- bugfixes
- parseISO8601 and DST caused certain events to display day before
......
/*!
* FullCalendar v3.6.1 Print Stylesheet
* FullCalendar v3.9.0
* Docs & License: https://fullcalendar.io/
* (c) 2017 Adam Shaw
* (c) 2018 Adam Shaw
*//*!
* FullCalendar v3.9.0 Print Stylesheet
* Docs & License: https://fullcalendar.io/
* (c) 2018 Adam Shaw
*/.fc-bg,.fc-bgevent-container,.fc-bgevent-skeleton,.fc-business-container,.fc-event .fc-resizer,.fc-helper-container,.fc-helper-skeleton,.fc-highlight-container,.fc-highlight-skeleton{display:none}.fc tbody .fc-row,.fc-time-grid{min-height:0!important}.fc-time-grid .fc-event.fc-not-end:after,.fc-time-grid .fc-event.fc-not-start:before{content:"..."}.fc{max-width:100%!important}.fc-event{background:#fff!important;color:#000!important;page-break-inside:avoid}.fc hr,.fc tbody,.fc td,.fc th,.fc thead,.fc-row{border-color:#ccc!important;background:#fff!important}.fc tbody .fc-row{height:auto!important}.fc tbody .fc-row .fc-content-skeleton{position:static;padding-bottom:0!important}.fc tbody .fc-row .fc-content-skeleton tbody tr:last-child td{padding-bottom:1em}.fc tbody .fc-row .fc-content-skeleton table{height:1em}.fc-more,.fc-more-cell{display:none!important}.fc tr.fc-limited{display:table-row!important}.fc td.fc-limited{display:table-cell!important}.fc-agenda-view .fc-axis,.fc-popover{display:none}.fc-slats,.fc-time-grid hr{display:none!important}.fc button,.fc-button-group,.fc-time-grid .fc-event .fc-time span{display:none}.fc-time-grid .fc-content-skeleton{position:static}.fc-time-grid .fc-content-skeleton table{height:4em}.fc-time-grid .fc-event-container{margin:0!important}.fc-time-grid .fc-event{position:static!important;margin:3px 2px!important}.fc-time-grid .fc-event.fc-not-end{border-bottom-width:1px!important}.fc-time-grid .fc-event.fc-not-start{border-top-width:1px!important}.fc-time-grid .fc-event .fc-time{white-space:normal!important}.fc-time-grid .fc-event .fc-time:after{content:attr(data-full)}.fc-day-grid-container,.fc-scroller,.fc-time-grid-container{overflow:visible!important;height:auto!important}.fc-row{border:0!important;margin:0!important}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("moment"),require("fullcalendar")):"function"==typeof define&&define.amd?define(["moment","fullcalendar"],a):"object"==typeof exports?a(require("moment"),require("fullcalendar")):a(e.moment,e.FullCalendar)}("undefined"!=typeof self?self:this,function(e,a){return function(e){function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}var t={};return a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},a.p="",a(a.s=83)}({0:function(a,t){a.exports=e},1:function(e,t){e.exports=a},83:function(e,a,t){Object.defineProperty(a,"__esModule",{value:!0}),t(84);var r=t(1);r.datepickerLocale("bs","bs",{closeText:"Zatvori",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"Danas",monthNames:["Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novmbar","Decembar"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayNamesMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Sed",dateFormat:"dd.mm.yy.",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),r.locale("bs",{buttonText:{prev:"Prošli",next:"Sljedeći",month:"Mjesec",week:"Sedmica",day:"Dan",list:"Raspored"},allDayText:"Cijeli dan",eventLimitText:function(e){return"+ još "+e},noEventsMessage:"Nema događaja za prikazivanje"})},84:function(e,a,t){!function(e,a){a(t(0))}(0,function(e){function a(e,a,t){var r=e