diff --git a/trunk/app/Resources/views/admin.html.twig b/trunk/app/Resources/views/admin.html.twig index 38222870..494e9911 100644 --- a/trunk/app/Resources/views/admin.html.twig +++ b/trunk/app/Resources/views/admin.html.twig @@ -34,6 +34,12 @@ %} {% endstylesheets %} + {% stylesheets + 'bundles/app/css/daterangepicker.css' + filter='cssrewrite' + %} + + {% endstylesheets %} {# TODO Move to custom.css #} {% endblock stylesheets %} @@ -42,6 +48,7 @@ + @@ -110,13 +117,14 @@ {#TODO ausmisten und im gleichen zuge das CSS für den Datepicker einfügen#} {% block javascripts %} {% javascripts - '@AppBundle/Resources/public/js/jquery-3.1.1.js' '@AppBundle/Resources/public/js/jquery-ui-1.12.1.js' '@AppBundle/Resources/public/js/bootstrap-3.3.7.js' '@AppBundle/Resources/public/js/jquery.prettyPhoto-3.1.6.js' '@AppBundle/Resources/public/js/parallax.js' '@AppBundle/Resources/public/js/owl.carousel-2.2.0.js' '@AppBundle/Resources/public/js/bootstrap-select-1.12.0.js' + '@AppBundle/Resources/public/vendor/daterangepicker/moment.min.js' + '@AppBundle/Resources/public/vendor/daterangepicker/daterangepicker.js' '@AppBundle/Resources/public/js/custom.js' %} diff --git a/trunk/app/Resources/views/default/admin/lodgingsEdit.html.twig b/trunk/app/Resources/views/default/admin/lodgingsEdit.html.twig index ea9a673f..81f75972 100644 --- a/trunk/app/Resources/views/default/admin/lodgingsEdit.html.twig +++ b/trunk/app/Resources/views/default/admin/lodgingsEdit.html.twig @@ -14,133 +14,6 @@
- {{ form_row(form.name, {'label': 'Name'}) }} - {{ form_row(form.group, {'label': 'Gruppe'}) }} - {{ form_row(form.type, {'label': 'Typ'}) }} - {{ form_row(form.description, {'label': 'Beschreibung'}) }} - {{ form_row(form.equipment, {'label': 'Ausstattung'}) }} - {{ form_row(form.adress1, {'label': 'Adresse 1'}) }} - {{ form_row(form.adress2, {'label': 'Adresse 2'}) }} - {{ form_row(form.zipCode, {'label': 'PLZ'}) }} - {{ form_row(form.city, {'label': 'Ort'}) }} - {{ form_row(form.maximumPersons, {'label': 'Maximale Personenanzahl'}) }} - {{ form_row(form.deposit, {'label': 'Kaution'}) }} - - {# -
- {{ form_widget(form.calendarVisible) }} - - {{ form_errors(form.calendarVisible) }} -
- #} - -

- -

Bilder

- {% if lodging.images is not empty %} - - - - - - - - - - - - {% for image in lodging.images %} - - - - - - - - {% endfor %} - -
BildPosNameBeschreibung
{{ image.description }}{{ image.pos }}{{ image.fileName }}{{ image.description }} - - Bearbeiten - - - Löschen - -
- {% else %} -

Keine Bilder vorhanden

- {% endif %} - - - Hinzufügen - - - Mehrere Bilder hochladen - - -

- -

Saisons (Preise)

- - {% if lodging.prices is not empty %} - - - - - - - - - - - - - - {% for lodgingPrice in lodging.prices %} - - - - - - - - - - {% endfor %} - -
NameVonBisMindestbelegungPreis pro NachtService-Gebühr
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d.m.y') }}{{ lodgingPrice.season.toDate|date('d.m.y') }}{{ lodgingPrice.season.minimumStay }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }} - - Bearbeiten - - - Löschen - -
- {% else %} -

Keine Saisons vorhanden

- {% endif %} - - - Hinzufügen - - -

-

Reservierungen

{% if lodging.reservations is not empty %} @@ -216,6 +89,11 @@ {% include 'default/admin/lodgingsEditCalendar.html.twig' %} -
+

+ +

Saisons (Preise)

+ + {% if lodging.prices is not empty %} + + + + + + + + + + + + + + {% for lodgingPrice in lodging.prices %} + {% if lodgingPrice.season is not empty %} + + + + + + + + + + + {% endif %} + + {% endfor %} + +
NameVonBisMindestbelegungPreis pro NachtService-Gebühr
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d.m.y') }}{{ lodgingPrice.season.toDate|date('d.m.y') }}{{ lodgingPrice.season.minimumStay }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }} + + Bearbeiten + + + Löschen + +
+ {% else %} +

Keine Saisons vorhanden

+ {% endif %} + + + Hinzufügen + +
+ +

+ + {{ form_row(form.name, {'label': 'Name'}) }} + {{ form_row(form.group, {'label': 'Gruppe'}) }} + {{ form_row(form.type, {'label': 'Typ'}) }} + {{ form_row(form.description, {'label': 'Beschreibung'}) }} + {{ form_row(form.equipment, {'label': 'Ausstattung'}) }} + {{ form_row(form.adress1, {'label': 'Adresse 1'}) }} + {{ form_row(form.adress2, {'label': 'Adresse 2'}) }} + {{ form_row(form.zipCode, {'label': 'PLZ'}) }} + {{ form_row(form.city, {'label': 'Ort'}) }} + {{ form_row(form.maximumPersons, {'label': 'Maximale Personenanzahl'}) }} + {{ form_row(form.deposit, {'label': 'Kaution'}) }} + + {# +
+ {{ form_widget(form.calendarVisible) }} + + {{ form_errors(form.calendarVisible) }} +
+ #} +
+

+ + + +

Bilder

+ {% if lodging.images is not empty %} + + + + + + + + + + + + {% for image in lodging.images %} + + + + + + + + {% endfor %} + +
BildPosNameBeschreibung
{{ image.description }}{{ image.pos }}{{ image.fileName }}{{ image.description }} + + Bearbeiten + + + Löschen + +
+ {% else %} +

Keine Bilder vorhanden

+ {% endif %} + + + Hinzufügen + + + Mehrere Bilder hochladen + + +

+ + +
{{ form_rest(form) }} diff --git a/trunk/app/Resources/views/default/admin/lodgingsEditCalendar.html.twig b/trunk/app/Resources/views/default/admin/lodgingsEditCalendar.html.twig index 7975f0a8..d26f857d 100644 --- a/trunk/app/Resources/views/default/admin/lodgingsEditCalendar.html.twig +++ b/trunk/app/Resources/views/default/admin/lodgingsEditCalendar.html.twig @@ -1,61 +1,73 @@ - -{% for calendar_month in calendar %} - - - - - - - - - - - - - - - - {% for weekIndex in 0..5 %} - - {% for dayIndex in 0..6 %} - {# @var dayState \AppBundle\Util\CalendarDayState #} - {% set dayState = calendar_month['data'][(weekIndex * 7) + dayIndex] %} - {% set is_past_date = dayState.date is not empty and date(dayState.date) < date('now') %} + {% set counter = 0 %} + {% for calendar_month in calendar %} + {% set counter = counter + 1 %} + {% if counter%2 != 0 %} +
+ {% endif %} - {# Set cell class #} +
+
- {{ calendar_month['monthName'] }} {{ calendar_month['year'] }} -
MoDiMiDoFrSaSo
+ + + + + + + + + + + + + + + + {% for weekIndex in 0..5 %} + + {% for dayIndex in 0..6 %} + {# @var dayState \AppBundle\Util\CalendarDayState #} + {% set dayState = calendar_month['data'][(weekIndex * 7) + dayIndex] %} - - {% endfor %} + {# Set cell class #} + + + {% endfor %} + + + {% endfor %} + +
+ {{ calendar_month['monthName'] }} {{ calendar_month['year'] }} +
MoDiMiDoFrSaSo
- {% if dayState.isReserved or dayState.isReservationBegin %} - {% if dayState.reservation.id is defined %} - - {{ dayState.day }} - - {% else %} - ID - {% endif %} + {% set is_past_date = dayState.date is not empty and date(dayState.date) < date('now') %} - {% elseif dayState.isBookable and not is_past_date %} - - {{ dayState.day }} - - {% elseif dayState.day == 0 %} -   - {% else %} - {% if dayState.isPastDate %} - {{ dayState.day }} - {% else %} - {{ dayState.day }} - {% endif %} - {% endif %} - + {% if dayState.isReserved or dayState.isReservationBegin %} + {% if dayState.reservation.id is defined %} + + {{ dayState.day }} + + {% else %} + ID + {% endif %} + + {% elseif dayState.isBookable and not is_past_date %} + + {{ dayState.day }} + + {% elseif dayState.day == 0 %} +   + {% else %} + {% if dayState.isPastDate %} + {{ dayState.day }} + {% else %} + {{ dayState.day }} + {% endif %} + {% endif %} +
+ + {% if counter%2 == 0 %} + + {% endif %} - {% endfor %} - - {% endfor %} - - diff --git a/trunk/app/Resources/views/default/admin/reservationsEdit.html.twig b/trunk/app/Resources/views/default/admin/reservationsEdit.html.twig index a22af117..4de98975 100644 --- a/trunk/app/Resources/views/default/admin/reservationsEdit.html.twig +++ b/trunk/app/Resources/views/default/admin/reservationsEdit.html.twig @@ -6,31 +6,6 @@

Reservierung bearbeiten für {{ lodging.name }}

-

Mögliche Saisons

- - - - - - - - - - - - - {% for lodgingPrice in lodging.prices %} - - - - - - - - {% endfor %} - -
NameVonBisPreis pro NachtService-Gebühr
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d-m-y') }}{{ lodgingPrice.season.toDate|date('d-m-y') }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }}
-

Reservierung

@@ -41,8 +16,16 @@
{{ form_row(form.lodging, {label: 'Objekt'}) }} - {{ form_row(form.fromDate , {label: 'Von'}) }} - {{ form_row(form.toDate, {label: 'Bis'}) }} + +
+ +
+ {{ form_widget(form.fromDate) }} + bis + {{ form_widget(form.toDate) }} +
+
+ {{ form_row(form.status, {label: 'Status'}) }} {#{{ form_row(form.type, {label: 'Typ'}) }}#} @@ -68,6 +51,127 @@ > Löschen + +
+

Mögliche Saisons

+ + + + + + + + + + + + + {% for lodgingPrice in lodging.prices %} + {% if lodgingPrice.season is not empty %} + + + + + + + + {% endif %} + {% endfor %} + +
NameVonBisPreis pro NachtService-Gebühr
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d-m-y') }}{{ lodgingPrice.season.toDate|date('d-m-y') }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }}
+ +
-{% endblock body %} \ No newline at end of file + + + +{% endblock body %} + diff --git a/trunk/app/Resources/views/default/admin/reservationsNew.html.twig b/trunk/app/Resources/views/default/admin/reservationsNew.html.twig index 42308401..68f4bb9a 100644 --- a/trunk/app/Resources/views/default/admin/reservationsNew.html.twig +++ b/trunk/app/Resources/views/default/admin/reservationsNew.html.twig @@ -6,31 +6,6 @@

Neue Reservierung anlegen für {{ lodging.name }}

-

Mögliche Saisons

- - - - - - - - - - - - - {% for lodgingPrice in lodging.prices %} - - - - - - - - {% endfor %} - -
NameVonBisPreis pro NachtService-Gebühr
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d-m-y') }}{{ lodgingPrice.season.toDate|date('d-m-y') }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }}
-

Reservierung

@@ -41,8 +16,16 @@
{{ form_row(form.lodging, {label: 'Objekt'}) }} - {{ form_row(form.fromDate , {label: 'Von'}) }} - {{ form_row(form.toDate, {label: 'Bis'}) }} + +
+ +
+ {{ form_widget(form.fromDate) }} + bis + {{ form_widget(form.toDate) }} +
+
+ {{ form_row(form.status, {label: 'Status'}) }} {#{{ form_row(form.type, {label: 'Typ'}) }}#} @@ -62,6 +45,126 @@ > Zurück +
+

Mögliche Saisons

+ + + + + + + + + + + + + + {% for lodgingPrice in lodging.prices %} + {% if lodgingPrice.season is not empty %} + + + + + + + + + {% endif %} + {% endfor %} + +
NameVonBisPreis pro NachtService-GebührMindestbelegung
{{ lodgingPrice.season.name }}{{ lodgingPrice.season.fromDate|date('d-m-y') }}{{ lodgingPrice.season.toDate|date('d-m-y') }}{{ lodgingPrice.perNight }}{{ lodgingPrice.flatPrice }}{{ lodgingPrice.season.minimumStay }}
+ +
+ + {% endblock body %} \ No newline at end of file diff --git a/trunk/app/Resources/views/default/form/theme.html.twig b/trunk/app/Resources/views/default/form/theme.html.twig index ec47e3f2..32122235 100644 --- a/trunk/app/Resources/views/default/form/theme.html.twig +++ b/trunk/app/Resources/views/default/form/theme.html.twig @@ -17,11 +17,22 @@ {%- endblock %} {% block date_widget -%} + {% set range = 0 %} + {% for attrname, attrvalue in attr %} + {% if attrname == 'data-range' %} + {% set range = 1 %} + {% endif %} + {% endfor %} + + {% if range == 1 -%} + {{- parent() -}} + {%- else -%} {% set attr = attr|merge({class: (attr.class|default('') ~ ' datepicker')|trim}) -%} -
+
{{ parent() -}}
+ {%- endif -%} {%- endblock %} {% block st_plain_date_widget -%} diff --git a/trunk/app/Resources/views/default/pages/cms/fewoTravelProgram.html.twig b/trunk/app/Resources/views/default/pages/cms/fewoTravelProgram.html.twig index 4a99d752..89401d4f 100644 --- a/trunk/app/Resources/views/default/pages/cms/fewoTravelProgram.html.twig +++ b/trunk/app/Resources/views/default/pages/cms/fewoTravelProgram.html.twig @@ -219,6 +219,11 @@

Bitte klicken Sie einen Anreisetermin (grüne Zahl), um zur Buchungsmaske zu gelagen.

+ + + + + diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/drp.png b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/drp.png new file mode 100755 index 00000000..a76bdf35 Binary files /dev/null and b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/drp.png differ diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/index.html b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/index.html new file mode 100755 index 00000000..533c94ed --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/index.html @@ -0,0 +1,210 @@ + + + + + A date range picker for Bootstrap + + + + + + +
+ +

Configuration Builder

+ +
+ + +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ +
+

Your Date Range Picker

+ + +
+ +
+

Configuration

+ +
+ +
+
+ +
+ +
+ + + + + diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/main.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/main.js new file mode 100755 index 00000000..5c0f99a2 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/main.js @@ -0,0 +1,141 @@ +requirejs.config({ + "paths": { + "jquery": "https://code.jquery.com/jquery-1.11.3.min", + "moment": "../../moment", + "daterangepicker": "../../daterangepicker" + } +}); + +requirejs(['jquery', 'moment', 'daterangepicker'] , function ($, moment) { +$(document).ready(function() { + + $('#config-text').keyup(function() { + eval($(this).val()); + }); + + $('.configurator input, .configurator select').change(function() { + updateConfig(); + }); + + $('.demo i').click(function() { + $(this).parent().find('input').click(); + }); + + $('#startDate').daterangepicker({ + singleDatePicker: true, + startDate: moment().subtract(6, 'days') + }); + + $('#endDate').daterangepicker({ + singleDatePicker: true, + startDate: moment() + }); + + updateConfig(); + + function updateConfig() { + var options = {}; + + if ($('#singleDatePicker').is(':checked')) + options.singleDatePicker = true; + + if ($('#showDropdowns').is(':checked')) + options.showDropdowns = true; + + if ($('#showWeekNumbers').is(':checked')) + options.showWeekNumbers = true; + + if ($('#showISOWeekNumbers').is(':checked')) + options.showISOWeekNumbers = true; + + if ($('#timePicker').is(':checked')) + options.timePicker = true; + + if ($('#timePicker24Hour').is(':checked')) + options.timePicker24Hour = true; + + if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) + options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); + + if ($('#timePickerSeconds').is(':checked')) + options.timePickerSeconds = true; + + if ($('#autoApply').is(':checked')) + options.autoApply = true; + + if ($('#dateLimit').is(':checked')) + options.dateLimit = { days: 7 }; + + if ($('#ranges').is(':checked')) { + options.ranges = { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + }; + } + + if ($('#locale').is(':checked')) { + options.locale = { + format: 'MM/DD/YYYY HH:mm', + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + fromLabel: 'From', + toLabel: 'To', + customRangeLabel: 'Custom', + daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], + monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + firstDay: 1 + }; + } + + if (!$('#linkedCalendars').is(':checked')) + options.linkedCalendars = false; + + if (!$('#autoUpdateInput').is(':checked')) + options.autoUpdateInput = false; + + if ($('#alwaysShowCalendars').is(':checked')) + options.alwaysShowCalendars = true; + + if ($('#parentEl').val().length) + options.parentEl = $('#parentEl').val(); + + if ($('#startDate').val().length) + options.startDate = $('#startDate').val(); + + if ($('#endDate').val().length) + options.endDate = $('#endDate').val(); + + if ($('#minDate').val().length) + options.minDate = $('#minDate').val(); + + if ($('#maxDate').val().length) + options.maxDate = $('#maxDate').val(); + + if ($('#opens').val().length && $('#opens').val() != 'right') + options.opens = $('#opens').val(); + + if ($('#drops').val().length && $('#drops').val() != 'down') + options.drops = $('#drops').val(); + + if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') + options.buttonClasses = $('#buttonClasses').val(); + + if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success') + options.applyClass = $('#applyClass').val(); + + if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default') + options.cancelClass = $('#cancelClass').val(); + + $('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});"); + + $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); + + } + +}); +}); diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/require.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/require.js new file mode 100755 index 00000000..857eb5b7 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/amd/require.js @@ -0,0 +1,36 @@ +/* + RequireJS 2.2.0 Copyright jQuery Foundation and other contributors. + Released under MIT license, http://github.com/requirejs/requirejs/LICENSE +*/ +var requirejs,require,define; +(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!== +ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c); +this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})|| +""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0=== +a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a, +b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id); +b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b= +a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&& +(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs", +"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){}, +0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&& +(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this); diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/README.md b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/README.md new file mode 100755 index 00000000..123b093c --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/README.md @@ -0,0 +1,11 @@ +# Browserify example + +Two steps need to be done for this to work + +In the project root + + npm install + +In this folder + + ../../node_modules/.bin/browserify main.js -o bundle.js diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/bundle.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/bundle.js new file mode 100755 index 00000000..e69de29b diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/index.html b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/index.html new file mode 100755 index 00000000..bdce82e8 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/index.html @@ -0,0 +1,209 @@ + + + + + A date range picker for Bootstrap + + + + + + +
+ +

Configuration Builder

+ +
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ +
+ +
+ +
+

Your Date Range Picker

+ + +
+ +
+

Configuration

+ +
+ +
+
+ +
+ +
+ + + + diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/main.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/main.js new file mode 100755 index 00000000..30e92d49 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/example/browserify/main.js @@ -0,0 +1,135 @@ +require('../../daterangepicker.js'); +var $ = require('jquery'), + moment = require('moment'); + +$(document).ready(function() { + + $('#config-text').keyup(function() { + eval($(this).val()); + }); + + $('.configurator input, .configurator select').change(function() { + updateConfig(); + }); + + $('.demo i').click(function() { + $(this).parent().find('input').click(); + }); + + $('#startDate').daterangepicker({ + singleDatePicker: true, + startDate: moment().subtract(6, 'days') + }); + + $('#endDate').daterangepicker({ + singleDatePicker: true, + startDate: moment() + }); + + updateConfig(); + + function updateConfig() { + var options = {}; + + if ($('#singleDatePicker').is(':checked')) + options.singleDatePicker = true; + + if ($('#showDropdowns').is(':checked')) + options.showDropdowns = true; + + if ($('#showWeekNumbers').is(':checked')) + options.showWeekNumbers = true; + + if ($('#showISOWeekNumbers').is(':checked')) + options.showISOWeekNumbers = true; + + if ($('#timePicker').is(':checked')) + options.timePicker = true; + + if ($('#timePicker24Hour').is(':checked')) + options.timePicker24Hour = true; + + if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) + options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); + + if ($('#timePickerSeconds').is(':checked')) + options.timePickerSeconds = true; + + if ($('#autoApply').is(':checked')) + options.autoApply = true; + + if ($('#dateLimit').is(':checked')) + options.dateLimit = { days: 7 }; + + if ($('#ranges').is(':checked')) { + options.ranges = { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + }; + } + + if ($('#locale').is(':checked')) { + options.locale = { + format: 'MM/DD/YYYY HH:mm', + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + fromLabel: 'From', + toLabel: 'To', + customRangeLabel: 'Custom', + daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], + monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + firstDay: 1 + }; + } + + if (!$('#linkedCalendars').is(':checked')) + options.linkedCalendars = false; + + if (!$('#autoUpdateInput').is(':checked')) + options.autoUpdateInput = false; + + if ($('#alwaysShowCalendars').is(':checked')) + options.alwaysShowCalendars = true; + + if ($('#parentEl').val().length) + options.parentEl = $('#parentEl').val(); + + if ($('#startDate').val().length) + options.startDate = $('#startDate').val(); + + if ($('#endDate').val().length) + options.endDate = $('#endDate').val(); + + if ($('#minDate').val().length) + options.minDate = $('#minDate').val(); + + if ($('#maxDate').val().length) + options.maxDate = $('#maxDate').val(); + + if ($('#opens').val().length && $('#opens').val() != 'right') + options.opens = $('#opens').val(); + + if ($('#drops').val().length && $('#drops').val() != 'down') + options.drops = $('#drops').val(); + + if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') + options.buttonClasses = $('#buttonClasses').val(); + + if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success') + options.applyClass = $('#applyClass').val(); + + if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default') + options.cancelClass = $('#cancelClass').val(); + + $('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});"); + + $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); + + } + +}); diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/moment.min.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/moment.min.js new file mode 100755 index 00000000..57427d24 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/moment.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n>>0,s=0;sDe(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11Pe(n[me],n[_e])?ye:n[ge]<0||24Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;tn.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0 daterangepicker.css", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangrossman/daterangepicker.git" + }, + "author": { + "name": "Dan Grossman", + "email": "dan@dangrossman.info", + "url": "http://www.dangrossman.info" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/dangrossman/daterangepicker/issues" + }, + "homepage": "https://github.com/dangrossman/daterangepicker", + "dependencies": { + "jquery": ">=1.10", + "moment": "^2.9.0" + }, + "devDependencies": { + "node-sass": "^3.4.2" + } +} diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/index.html b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/index.html new file mode 100755 index 00000000..d8b6829e --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/index.html @@ -0,0 +1,744 @@ + + + + + + + + Date Range Picker — JavaScript Date & Time Picker Library + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Date Range Picker

+

+ A JavaScript component for choosing date ranges, + dates and times. +

+ +
+
+ + + +
+ + + + + +
+ +
+
+
+
+ +
+
+
+ + +
+ + + + +
+ +
+
+ +

Originally created for reports at Improvely, the Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".

+ + + +

Getting Started

+ +

+ To get started, include jQuery, Moment.js and Date Range Picker's files in your webpage: +

+ + + +

+ Then attach a date range picker to whatever you want to trigger it: +

+ +
+
+ + +
+
+ + + +
+
+ +

+ You can customize Date Range Picker with options, and get notified when the user chooses new dates by providing a callback function. +

+ +

Examples

+ + +

Simple Date Range Picker With a Callback

+
+
+
+ + +
+
+ + + + +
+
+
+ + +

Date Range Picker With Times

+
+
+
+ + +
+
+ + + + +
+
+
+ + +

Single Date Picker

+
+
+
+ + +
+
+ + + + +
+
+
+ + +

Predefined Date Ranges

+
+
+
+ + +
+
+ + +
+   + +
+ + + +
+
+
+ + +

Input Initially Empty

+
+
+
+ + +
+
+ + + + +
+
+
+ +

Options

+ +
    +
  • + startDate (Date or string) The beginning date of the initially selected date range. If you provide a string, it must match the date format string set in your locale setting. +
  • +
  • + endDate: (Date or string) The end date of the initially selected date range. +
  • +
  • + minDate: (Date or string) The earliest date a user may select. +
  • +
  • + maxDate: (Date or string) The latest date a user may select. +
  • +
  • + maxSpan: (object) The maximum span between the selected start and end dates. Check off maxSpan in the configuration generator for an example of how to use this. You can provide any object the moment library would let you add to a date. +
  • +
  • + showDropdowns: (true/false) Show year and month select boxes above calendars to jump to a specific month and year. +
  • +
  • + minYear: (number) The minimum year shown in the dropdowns when showDropdowns is set to true. +
  • +
  • + maxYear: (number) The maximum year shown in the dropdowns when showDropdowns is set to true. +
  • +
  • + showWeekNumbers: (true/false) Show localized week numbers at the start of each week on the calendars. +
  • +
  • + showISOWeekNumbers: (true/false) Show ISO week numbers at the start of each week on the calendars. +
  • +
  • + timePicker: (true/false) Adds select boxes to choose times in addition to dates. +
  • +
  • + timePickerIncrement: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30). +
  • +
  • + timePicker24Hour: (true/false) Use 24-hour instead of 12-hour times, removing the AM/PM selection. +
  • +
  • + timePickerSeconds: (true/false) Show seconds in the timePicker. +
  • +
  • + ranges: (object) Set predefined date ranges the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range. Click ranges in the configuration generator for examples. +
  • +
  • + showCustomRangeLabel: (true/false) Displays "Custom Range" at + the end of the list of predefined ranges, when the ranges option is used. + This option will be highlighted whenever the current date range selection does not match one of the predefined ranges. Clicking it will display the calendars to select a new range. +
  • +
  • + alwaysShowCalendars: (true/false) Normally, if you use the ranges option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range". When this option is set to true, the calendars for choosing a custom date range are always shown instead. +
  • +
  • + opens: ('left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to. +
  • +
  • + drops: ('down'/'up') Whether the picker appears below (default) or above the HTML element it's attached to. +
  • +
  • + buttonClasses: (string) CSS class names that will be added to both the apply and cancel buttons. +
  • +
  • + applyButtonClasses: (string) CSS class names that will be added only to the apply button. +
  • +
  • + cancelButtonClasses: (string) CSS class names that will be added only to the cancel button. +
  • +
  • + locale: (object) Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars. + Check off locale in the configuration generator to see how + to customize these options. +
  • +
  • + singleDatePicker: (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and end dates provided to your callback will be the same single date chosen. +
  • +
  • + autoApply: (true/false) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates are clicked. +
  • +
  • + linkedCalendars: (true/false) When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars. When disabled, the two calendars can be individually advanced and display any month/year. +
  • +
  • + isInvalidDate: (function) A function that is passed each date in the two + calendars before they are displayed, and may return true or false to indicate whether + that date should be available for selection or not. +
  • +
  • + isCustomDate: (function) A function that is passed each date in the two + calendars before they are displayed, and may return a string or array of CSS class names + to apply to that date's calendar cell. +
  • +
  • + autoUpdateInput: (true/false) Indicates whether the date range picker should + automatically update the value of the <input> element it's attached to at initialization and when the selected dates change. +
  • +
  • + parentEl: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body' +
  • +
+ +

Methods

+ +

+ You can programmatically update the startDate and endDate + in the picker using the setStartDate and setEndDate methods. + You can access the Date Range Picker object and its functions and properties through + data properties of the element you attached it to. +

+ + + +
+ +
    +
  • + setStartDate(Date or string): Sets the date range picker's currently selected start date to the provided date +
  • +
  • + setEndDate(Date or string): Sets the date range picker's currently selected end date to the provided date +
  • +
+ +

Example usage:

+ + + +

Events

+ +

+ Several events are triggered on the element you attach the picker to, which you can listen for. +

+ +
    +
  • + show.daterangepicker: Triggered when the picker is shown +
  • +
  • + hide.daterangepicker: Triggered when the picker is hidden +
  • +
  • + showCalendar.daterangepicker: Triggered when the calendar(s) are shown +
  • +
  • + hideCalendar.daterangepicker: Triggered when the calendar(s) are hidden +
  • +
  • + apply.daterangepicker: Triggered when the apply button is clicked, + or when a predefined range is clicked +
  • +
  • + cancel.daterangepicker: Triggered when the cancel button is clicked +
  • +
+ +

+ Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by changing the button label and watching for the cancel event: +

+ + + +
+ +

+ While passing in a callback to the constructor is the easiest way to listen for changes in the selected date range, you can also do something every time the apply button is clicked even if the selection hasn't changed: +

+ + + +

Configuration Generator

+ +
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+

Your Date Range Picker

+ +
+
+ +
+

Your Configuration to Copy

+ +
+ +
+
+ +
+ + + +

License

+ +

The MIT License (MIT)

+ +

Copyright (c) 2012-2018 Dan Grossman

+ +

+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +

+ +

+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +

+ +

+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

+ +

Comments

+ +
+ + + +
+
+
+ + + + + + + + + + + diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.css b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.css new file mode 100755 index 00000000..d325155a --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.css @@ -0,0 +1,152 @@ +body { + font-size: 15px; + line-height: 1.6em; + position: relative; + margin: 0; +} + +.navbar .nav-item { + padding: 8px 0 8px 20px; +} + +.navbar .nav-link { + font-weight: bold; + font-size: 14px; + padding: 0; +} + +.navbar-expand-sm .navbar-nav .nav-link { + padding: 0; +} + +.well { + background: #f5f5f5; + border-radius: 4px; + padding: 20px; +} + +h1 { + font-size: 20px; + margin-bottom: 1em; + padding-bottom: 5px; + border-bottom: 1px dotted #08c; +} + +h1:before { + content: '#'; + color: #666; + position: relative; + padding-right: 5px; +} + +h2 { + padding: 0; + margin: 20px 0 0 0; + font-size: 18px; +} + +h2 a { + color: #444; + display: block; + background: #eee; + padding: 8px 12px; + margin-bottom: 0; + cursor: default; + text-decoration: none; +} + +input.form-control { + font-size: 14px; +} + +.collapsable { + border: 1px solid #eee; + padding: 12px; + display: block; +} + +label { + font-size: 13px; + font-weight: bold; +} + +.gist { + overflow: auto; +} + +.gist .blob-wrapper.data { + max-height: 350px; + overflow: auto; +} + +.list-group-item { + padding: 4px 0; + border: 0; + font-size: 16px; +} + +.leftcol { + position: absolute; + top: 180px; +} + +.rightcol { + max-width: 950px; +} + +.container { + max-width: 1300px; +} + +@media (min-width: 980px) { + .rightcol { + margin-left: 320px; + } +} + +p, pre { + margin-bottom: 2em; +} + +ul.nobullets { + margin: 0; + padding: 0; + list-style: none; +} +ul.nobullets li { + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px dotted #ddd; +} + +input[type="text"] { + padding: 6px; + width: 100%; + border-radius: 4px; +} + +#footer { + background: #222; + margin-top: 80px; + padding: 10px; + color: #fff; + text-align: center; +} +#footer a:link, #footer a:visited { + color: #fff; + border-bottom: 1px dotted #fff; +} +#jumbo { + background: #c1deef; + color: #000; + padding: 20px 0; + margin-bottom: 20px; +} + +#jumbo h1 { + font-size: 28px; +} +#jumbo .btn { + border-radius: 0; + font-size: 16px; +} \ No newline at end of file diff --git a/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.js b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.js new file mode 100755 index 00000000..e2179941 --- /dev/null +++ b/trunk/src/AppBundle/Resources/public/vendor/daterangepicker/website/website.js @@ -0,0 +1,179 @@ +$(document).ready(function() { + + $('#config-text').keyup(function() { + eval($(this).val()); + }); + + $('.configurator input, .configurator select').change(function() { + updateConfig(); + }); + + $('.demo i').click(function() { + $(this).parent().find('input').click(); + }); + + $('#startDate').daterangepicker({ + singleDatePicker: true, + startDate: moment().subtract(6, 'days') + }); + + $('#endDate').daterangepicker({ + singleDatePicker: true, + startDate: moment() + }); + + //updateConfig(); + + function updateConfig() { + var options = {}; + + if ($('#singleDatePicker').is(':checked')) + options.singleDatePicker = true; + + if ($('#showDropdowns').is(':checked')) + options.showDropdowns = true; + + if ($('#minYear').val().length && $('#minYear').val() != 1) + options.minYear = parseInt($('#minYear').val(), 10); + + if ($('#maxYear').val().length && $('#maxYear').val() != 1) + options.maxYear = parseInt($('#maxYear').val(), 10); + + if ($('#showWeekNumbers').is(':checked')) + options.showWeekNumbers = true; + + if ($('#showISOWeekNumbers').is(':checked')) + options.showISOWeekNumbers = true; + + if ($('#timePicker').is(':checked')) + options.timePicker = true; + + if ($('#timePicker24Hour').is(':checked')) + options.timePicker24Hour = true; + + if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1) + options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10); + + if ($('#timePickerSeconds').is(':checked')) + options.timePickerSeconds = true; + + if ($('#autoApply').is(':checked')) + options.autoApply = true; + + if ($('#maxSpan').is(':checked')) + options.maxSpan = { days: 7 }; + + if ($('#ranges').is(':checked')) { + options.ranges = { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + }; + } + + if ($('#locale').is(':checked')) { + options.locale = { + format: 'MM/DD/YYYY', + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + fromLabel: 'From', + toLabel: 'To', + customRangeLabel: 'Custom', + weekLabel: 'W', + daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'], + monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + firstDay: 1 + }; + } + + if (!$('#linkedCalendars').is(':checked')) + options.linkedCalendars = false; + + if (!$('#autoUpdateInput').is(':checked')) + options.autoUpdateInput = false; + + if (!$('#showCustomRangeLabel').is(':checked')) + options.showCustomRangeLabel = false; + + if ($('#alwaysShowCalendars').is(':checked')) + options.alwaysShowCalendars = true; + + if ($('#parentEl').val().length) + options.parentEl = $('#parentEl').val(); + + if ($('#startDate').val().length) + options.startDate = $('#startDate').val(); + + if ($('#endDate').val().length) + options.endDate = $('#endDate').val(); + + if ($('#minDate').val().length) + options.minDate = $('#minDate').val(); + + if ($('#maxDate').val().length) + options.maxDate = $('#maxDate').val(); + + if ($('#opens').val().length && $('#opens').val() != 'right') + options.opens = $('#opens').val(); + + if ($('#drops').val().length && $('#drops').val() != 'down') + options.drops = $('#drops').val(); + + if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm') + options.buttonClasses = $('#buttonClasses').val(); + + if ($('#applyButtonClasses').val().length && $('#applyButtonClasses').val() != 'btn-primary') + options.applyButtonClasses = $('#applyButtonClasses').val(); + + if ($('#cancelButtonClasses').val().length && $('#cancelButtonClasses').val() != 'btn-default') + options.cancelClass = $('#cancelButtonClasses').val(); + + $('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }); + + if (typeof options.ranges !== 'undefined') { + options.ranges = {}; + } + + var option_text = JSON.stringify(options, null, ' '); + + var replacement = "ranges: {\n" + + " 'Today': [moment(), moment()],\n" + + " 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n" + + " 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n" + + " 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n" + + " 'This Month': [moment().startOf('month'), moment().endOf('month')],\n" + + " 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n" + + " }"; + option_text = option_text.replace(new RegExp('"ranges"\: \{\}', 'g'), replacement); + + $('#config-text').val("$('#demo').daterangepicker(" + option_text + ", function(start, end, label) {\n console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');\n});"); + + } + + $(window).scroll(function (event) { + var scroll = $(window).scrollTop(); + if (scroll > 180) { + $('.leftcol').css('position', 'fixed'); + $('.leftcol').css('top', '10px'); + } else { + $('.leftcol').css('position', 'absolute'); + $('.leftcol').css('top', '180px'); + } + }); + + var bg = new Trianglify({ + x_colors: ["#e1f3fd", "#eeeeee", "#407dbf"], + y_colors: 'match_x', + width: document.body.clientWidth, + height: 150, + stroke_width: 0, + cell_size: 20 + }); + + $('#jumbo').css('background-image', 'url(' + bg.png() + ')'); + +}); diff --git a/trunk/src/AppBundle/Util/CalendarDayState.php b/trunk/src/AppBundle/Util/CalendarDayState.php index d89cf762..1ece4151 100644 --- a/trunk/src/AppBundle/Util/CalendarDayState.php +++ b/trunk/src/AppBundle/Util/CalendarDayState.php @@ -245,6 +245,7 @@ class CalendarDayState public function getCssClass(){ $ret = ""; + if($this->getIsPastDate()){ $ret .= 'calendar-light '; } @@ -268,7 +269,6 @@ class CalendarDayState return $ret; } if($this->getIsReservationEnd() && $this->getIsBookable()){ - $ret .= ' calendar-day-disabled-half-booked'; return $ret; } @@ -277,6 +277,13 @@ class CalendarDayState return $ret; } + if($this->getIsEmpty()){ + return $ret; + } + if($this->getIsBookable()){ + return $ret; + } + $ret = "normal"; return $ret; diff --git a/trunk/src/AppBundle/Validator/Constraints/FewoReservationValidator.php b/trunk/src/AppBundle/Validator/Constraints/FewoReservationValidator.php index 779e7684..03fa56be 100644 --- a/trunk/src/AppBundle/Validator/Constraints/FewoReservationValidator.php +++ b/trunk/src/AppBundle/Validator/Constraints/FewoReservationValidator.php @@ -35,6 +35,7 @@ class FewoReservationValidator extends ConstraintValidator */ public function validate($reservation, Constraint $constraint) { + $fromDate = $reservation->getFromDate(); $toDate = $reservation->getToDate(); @@ -43,23 +44,28 @@ class FewoReservationValidator extends ConstraintValidator $reservations = $lodging->getReservations(); $seasons = $lodging->getSeasons(); - $withinAnySeason = false; + $withinAnySeason = true; $alreadyReserved = false; - for($i = 0; $i < count($seasons); $i++) + /* for($i = 0; $i < count($seasons); $i++) { + if(!isset($seasons[$i])){ + continue; + } if($reservation->getFromDate() >= $seasons[$i]->getFromDate() && $reservation->getToDate() <= $seasons[$i]->getToDate()) { - $withinAnySeason = true; + // $withinAnySeason = true; } - } + }*/ - foreach($reservations as $reservation) + foreach($reservations as $other_reservation) { - $reservationFromDate = $reservation->getFromDate(); - $reservationToDate = $reservation->getToDate(); - + if($other_reservation->getId() == $reservation->getId()){ + continue; + } + $reservationFromDate = $other_reservation->getFromDate(); + $reservationToDate = $other_reservation->getToDate(); if($this->alreadyReserved($fromDate, $toDate, $reservationFromDate, $reservationToDate)) {