| @@ -520,7 +520,7 @@ app.model.Appointment = function( appData, attendees, attendeeProfiles ) | |||||
| { | { | ||||
| if ( attendees[ ai ].has_attended == "attended" ) | if ( attendees[ ai ].has_attended == "attended" ) | ||||
| { | { | ||||
| attendeesAttended.push( attendees[ ai ].profile_id ); | |||||
| attendeesAttended.push( attendees[ ai ]); | |||||
| } | } | ||||
| } | } | ||||
| @@ -537,7 +537,8 @@ app.model.Appointment = function( appData, attendees, attendeeProfiles ) | |||||
| attendees[ ai ].has_attended == "declined" ) | attendees[ ai ].has_attended == "declined" ) | ||||
| { | { | ||||
| //attendeesNotAttended.push( this.getProfileById( attendees[ ai ].profile_id ) ); | //attendeesNotAttended.push( this.getProfileById( attendees[ ai ].profile_id ) ); | ||||
| attendeesNotAttended.push( attendees[ ai ].profile_id ); | |||||
| //attendeesNotAttended.push( attendees[ ai ].profile_id ); | |||||
| attendeesNotAttended.push( attendees[ ai ] ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -637,13 +638,13 @@ app.model.Appointment = function( appData, attendees, attendeeProfiles ) | |||||
| * @param profileId | * @param profileId | ||||
| * @returns {*} | * @returns {*} | ||||
| */ | */ | ||||
| this.getAttendeeHasAttendedValueForProfileId = function( profileId ) | |||||
| this.getAttendeeHasAttendedValueForProfileId = function( profileId, profileChildId = null ) | |||||
| { | { | ||||
| var ha = null; | var ha = null; | ||||
| for ( var ai = 0; ai < attendees.length; ai++ ) | for ( var ai = 0; ai < attendees.length; ai++ ) | ||||
| { | { | ||||
| if ( attendees[ ai ].profile_id == profileId ) | |||||
| if ( attendees[ ai ].profile_id == profileId && profileChildId == attendees[ ai ].profile_child_id ) | |||||
| { | { | ||||
| ha = attendees[ ai ].has_attended; | ha = attendees[ ai ].has_attended; | ||||
| break; | break; | ||||
| @@ -16,7 +16,7 @@ | |||||
| <div class="appointment-original-status"> | <div class="appointment-original-status"> | ||||
| <small> | <small> | ||||
| <%= _lc( 'ATTENDANCE' ) %> | <%= _lc( 'ATTENDANCE' ) %> | ||||
| <% if ( 'accepted' === a.getAttendeeStatusForProfileId( at.getId() ) ) { %> | |||||
| <% if ( 'accepted' === a.getAttendeeStatusForProfileId( at.getId(), childProfile ? childProfile.id : null ) ) { %> | |||||
| (<%= _lc( 'WITH_ACCEPTED_FEEDBACK' ) %>) | (<%= _lc( 'WITH_ACCEPTED_FEEDBACK' ) %>) | ||||
| <% } else { %> | <% } else { %> | ||||
| (<%= _lc( 'WITHOUT_ACCEPTED_FEEDBACK' ) %>) | (<%= _lc( 'WITHOUT_ACCEPTED_FEEDBACK' ) %>) | ||||
| @@ -20,7 +20,7 @@ | |||||
| <table class="table table-profiles"> | <table class="table table-profiles"> | ||||
| <tbody> | <tbody> | ||||
| <% for ( var aai = 0; aai < attendeesAttended.length; aai++ ) { %> | <% for ( var aai = 0; aai < attendeesAttended.length; aai++ ) { %> | ||||
| <% prfl = a.getProfileById( attendeesAttended[ aai ] ); %> | |||||
| <% prfl = a.getProfileById( attendeesAttended[ aai ].profile_id ); %> | |||||
| <%=raw app.core.View.getTemplate( 'appointment-detail-attendee-row', { a: a, at :prfl, g : g, childProfile : prfl.getChildProfileById( attendeesAttended[ aai ].profile_child_id ) } ) %> | <%=raw app.core.View.getTemplate( 'appointment-detail-attendee-row', { a: a, at :prfl, g : g, childProfile : prfl.getChildProfileById( attendeesAttended[ aai ].profile_child_id ) } ) %> | ||||
| <% } %> | <% } %> | ||||
| </tbody> | </tbody> | ||||
| @@ -46,17 +46,17 @@ | |||||
| <td class="text-center"> | <td class="text-center"> | ||||
| <div class="custom-control custom-checkbox"> | <div class="custom-control custom-checkbox"> | ||||
| <input type="checkbox" | <input type="checkbox" | ||||
| id="attendee-final-status-<%= attendee.getId() %>" | |||||
| id="attendee-final-status-<%= attendee.getId() %><%= childProfile ? '-' + childProfile.id : '' %>" | |||||
| data-type="checkbox-attendee-final-status" | data-type="checkbox-attendee-final-status" | ||||
| data-appointment-id="<%= a.getId() %>" | data-appointment-id="<%= a.getId() %>" | ||||
| data-profile-id="<%= attendee.getId() %>" | data-profile-id="<%= attendee.getId() %>" | ||||
| data-child-profile-id="<%= childProfile ? childProfile.id : '0' %>" | data-child-profile-id="<%= childProfile ? childProfile.id : '0' %>" | ||||
| data-orig-status="<%= a.hasProfileIdAttended( attendee.getId() ) ? 'checked' : 'not-checked' %>" | |||||
| data-orig-status="<%= a.hasProfileIdAttended( attendee.getId(), childProfile ? childProfile.id : null ) ? 'checked' : 'not-checked' %>" | |||||
| class="custom-control-input" | class="custom-control-input" | ||||
| <%= a.hasProfileIdAttended( attendee.getId() ) ? 'checked="checked"' : '' %> | |||||
| <%= a.hasProfileIdAttended( attendee.getId(), childProfile ? childProfile.id : null ) ? 'checked="checked"' : '' %> | |||||
| /> | /> | ||||
| <label class="custom-control-label" | <label class="custom-control-label" | ||||
| for="attendee-final-status-<%= attendee.getId() %>" | |||||
| for="attendee-final-status-<%= attendee.getId() %><%= childProfile ? '-' + childProfile.id : '' %>" | |||||
| style="vertical-align: top;"></label> | style="vertical-align: top;"></label> | ||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| @@ -1126,6 +1126,7 @@ class TB_Server_Control_Appointment { | |||||
| $attendee = new TB_Shared_Ent_TeamData_Attendee(); | $attendee = new TB_Shared_Ent_TeamData_Attendee(); | ||||
| $attendee->appointment_id = $appointment->id; | $attendee->appointment_id = $appointment->id; | ||||
| $attendee->profile_id = $profileToUpdate->id; | $attendee->profile_id = $profileToUpdate->id; | ||||
| $attendee->status = TB_Shared_Ent_TeamData_Attendee::STATUS_DECLINED; | |||||
| if ( $profileChildId > 0 ) | if ( $profileChildId > 0 ) | ||||
| { | { | ||||
| $attendee->profile_child_id = $profileChildId; | $attendee->profile_child_id = $profileChildId; | ||||