|
@@ -106,28 +106,6 @@
|
|
<select id="eventPros" name="proUid" xprovider-search
|
|
<select id="eventPros" name="proUid" xprovider-search
|
|
class="form-control form-control-sm flex-grow-1" multiple
|
|
class="form-control form-control-sm flex-grow-1" multiple
|
|
v-model="proIds">
|
|
v-model="proIds">
|
|
- <?php
|
|
|
|
- $proIndex = 0;
|
|
|
|
- $proMeta = [];
|
|
|
|
- ?>
|
|
|
|
- @foreach($pros as $iPro)
|
|
|
|
- <option value="{{$iPro->id}}"
|
|
|
|
- data-bc="{{$palette[$proIndex]["bc"]}}"
|
|
|
|
- data-fc="{{$palette[$proIndex]["fc"]}}"
|
|
|
|
- data-initials="{{$iPro->initials()}}">
|
|
|
|
- {{$iPro->displayName()}}
|
|
|
|
- </option>
|
|
|
|
- <?php
|
|
|
|
- $proMeta[$iPro->uid] = [
|
|
|
|
- "bc" => $palette[$proIndex]["bc"],
|
|
|
|
- "fc" => $palette[$proIndex]["fc"],
|
|
|
|
- "ac" => $palette[$proIndex]["ac"],
|
|
|
|
- "initials" => $iPro->initials()
|
|
|
|
- ];
|
|
|
|
- $proIndex++;
|
|
|
|
- if($proIndex >= count($palette)) $proIndex = 0;
|
|
|
|
- ?>
|
|
|
|
- @endforeach
|
|
|
|
</select>
|
|
</select>
|
|
</form>
|
|
</form>
|
|
<hr class="my-2">
|
|
<hr class="my-2">
|
|
@@ -367,6 +345,9 @@
|
|
<script>
|
|
<script>
|
|
(function() {
|
|
(function() {
|
|
|
|
|
|
|
|
+ var palette = {!! json_encode($palette) !!};
|
|
|
|
+ var lastUsedColor = -1;
|
|
|
|
+
|
|
<?php
|
|
<?php
|
|
$patient->nameStr = $patient->displayName();
|
|
$patient->nameStr = $patient->displayName();
|
|
$clientObject = json_encode($patient);
|
|
$clientObject = json_encode($patient);
|
|
@@ -379,7 +360,7 @@
|
|
client: {!! json_encode($patient) !!},
|
|
client: {!! json_encode($patient) !!},
|
|
eventTypes: '{{ $currentAppointment ? 'BOTH_ALL' : 'BOTH' }}',
|
|
eventTypes: '{{ $currentAppointment ? 'BOTH_ALL' : 'BOTH' }}',
|
|
calendar: null,
|
|
calendar: null,
|
|
- proMeta: {!! json_encode($proMeta) !!},
|
|
|
|
|
|
+ proMeta: {},
|
|
proIds: ['{{ $currentAppointment ? $currentAppointment->pro_id : $pro->id }}'],
|
|
proIds: ['{{ $currentAppointment ? $currentAppointment->pro_id : $pro->id }}'],
|
|
timezone: '{{ $currentAppointment ? $currentAppointment->timezone : 'EASTERN' }}',
|
|
timezone: '{{ $currentAppointment ? $currentAppointment->timezone : 'EASTERN' }}',
|
|
today: new Date('{{ date('Y-m-d 00:00:00') }}'),
|
|
today: new Date('{{ date('Y-m-d 00:00:00') }}'),
|
|
@@ -444,32 +425,62 @@
|
|
.select2({
|
|
.select2({
|
|
closeOnSelect: false,
|
|
closeOnSelect: false,
|
|
|
|
|
|
|
|
+ ajax: {
|
|
|
|
+ url: "/pro-suggest/json",
|
|
|
|
+ type: "get",
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ delay: 250,
|
|
|
|
+ data: function (params) {
|
|
|
|
+ return {
|
|
|
|
+ term: params.term // search term
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ processResults: function (response) {
|
|
|
|
+ return {
|
|
|
|
+ results: response
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ cache: true
|
|
|
|
+ },
|
|
|
|
+
|
|
// dropdown options
|
|
// dropdown options
|
|
templateResult: function(_state) {
|
|
templateResult: function(_state) {
|
|
- let element = _state.element;
|
|
|
|
- if(!element || !element.value) {
|
|
|
|
|
|
+ if(!_state.id) {
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
}
|
|
}
|
|
- element = $(element);
|
|
|
|
|
|
+
|
|
|
|
+ if(!self.proMeta[_state.uid]) {
|
|
|
|
+ lastUsedColor++;
|
|
|
|
+ if(lastUsedColor > 23) lastUsedColor = 0;
|
|
|
|
+ _state.ag = palette[lastUsedColor].ac;
|
|
|
|
+ _state.bg = palette[lastUsedColor].bc;
|
|
|
|
+ _state.fg = palette[lastUsedColor].fc;
|
|
|
|
+ self.proMeta[_state.uid] = {
|
|
|
|
+ ac: _state.ag,
|
|
|
|
+ bc: _state.bg,
|
|
|
|
+ fc: _state.fg,
|
|
|
|
+ initials: _state.initials
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
return $('<span class="mcp-theme-1 pro-option" ' +
|
|
return $('<span class="mcp-theme-1 pro-option" ' +
|
|
- 'data-initials="' + element.attr('data-initials') + '" ' +
|
|
|
|
- 'data-bc="' + element.attr('data-bc') + '" ' +
|
|
|
|
- 'data-fc="' + element.attr('data-fc') + '"><span>' +
|
|
|
|
|
|
+ 'data-initials="' + _state.initials + '" ' +
|
|
|
|
+ 'data-bc="' + _state.bg + '" ' +
|
|
|
|
+ 'data-fc="' + _state.fg + '"><span>' +
|
|
'<span class="pro-option-initials" ' +
|
|
'<span class="pro-option-initials" ' +
|
|
- 'style="background: ' + element.attr('data-bc') + '; color: ' + element.attr('data-fc') + '">' +
|
|
|
|
- element.attr('data-initials') + '</span>' +
|
|
|
|
|
|
+ 'style="background: ' + _state.bg + '; color: ' + _state.fg + '">' +
|
|
|
|
+ _state.initials + '</span>' +
|
|
_state.text +
|
|
_state.text +
|
|
'</span></span>');
|
|
'</span></span>');
|
|
},
|
|
},
|
|
|
|
|
|
// selected items
|
|
// selected items
|
|
templateSelection: function(_state) {
|
|
templateSelection: function(_state) {
|
|
- let element = _state.element;
|
|
|
|
- if(!element || !element.value) {
|
|
|
|
|
|
+ if(!_state.id) {
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
}
|
|
}
|
|
- element = $(element);
|
|
|
|
- return $('<span class="pro-selection" style="background: ' + element.attr('data-bc') + '; color: ' + element.attr('data-fc') + '">' +
|
|
|
|
|
|
+ return $('<span class="pro-selection" ' +
|
|
|
|
+ 'style="background: ' + _state.bg + '; color: ' + _state.fg + '">' +
|
|
_state.text + '</span>');
|
|
_state.text + '</span>');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -481,6 +492,26 @@
|
|
$('#addApptPro')
|
|
$('#addApptPro')
|
|
.select2({
|
|
.select2({
|
|
width: '100%',
|
|
width: '100%',
|
|
|
|
+ ajax: {
|
|
|
|
+ url: "/pro-suggest/json",
|
|
|
|
+ type: "get",
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ delay: 250,
|
|
|
|
+ data: function (params) {
|
|
|
|
+ return {
|
|
|
|
+ term: params.term // search term
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ processResults: function (response) {
|
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
|
+ response[i].id = response[i].uid;
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ results: response
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ cache: true
|
|
|
|
+ },
|
|
templateResult: function(_state) {
|
|
templateResult: function(_state) {
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
},
|
|
},
|
|
@@ -492,6 +523,26 @@
|
|
$('#editApptPro')
|
|
$('#editApptPro')
|
|
.select2({
|
|
.select2({
|
|
width: '100%',
|
|
width: '100%',
|
|
|
|
+ ajax: {
|
|
|
|
+ url: "/pro-suggest/json",
|
|
|
|
+ type: "get",
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ delay: 250,
|
|
|
|
+ data: function (params) {
|
|
|
|
+ return {
|
|
|
|
+ term: params.term // search term
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ processResults: function (response) {
|
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
|
+ response[i].id = response[i].uid;
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ results: response
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ cache: true
|
|
|
|
+ },
|
|
templateResult: function(_state) {
|
|
templateResult: function(_state) {
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
|
|
},
|
|
},
|