diff --git a/src/client/app/js/app/model/Appointment.js b/src/client/app/js/app/model/Appointment.js index 2671011..d3cb4ae 100644 --- a/src/client/app/js/app/model/Appointment.js +++ b/src/client/app/js/app/model/Appointment.js @@ -520,7 +520,7 @@ app.model.Appointment = function( appData, attendees, attendeeProfiles ) { 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" ) { //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 * @returns {*} */ - this.getAttendeeHasAttendedValueForProfileId = function( profileId ) + this.getAttendeeHasAttendedValueForProfileId = function( profileId, profileChildId = null ) { var ha = null; 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; break; diff --git a/src/client/app/tmpl/appointment-detail-attendee-row.html b/src/client/app/tmpl/appointment-detail-attendee-row.html index cede583..75a26c6 100644 --- a/src/client/app/tmpl/appointment-detail-attendee-row.html +++ b/src/client/app/tmpl/appointment-detail-attendee-row.html @@ -16,7 +16,7 @@
<%= _lc( 'ATTENDANCE' ) %> - <% if ( 'accepted' === a.getAttendeeStatusForProfileId( at.getId() ) ) { %> + <% if ( 'accepted' === a.getAttendeeStatusForProfileId( at.getId(), childProfile ? childProfile.id : null ) ) { %> (<%= _lc( 'WITH_ACCEPTED_FEEDBACK' ) %>) <% } else { %> (<%= _lc( 'WITHOUT_ACCEPTED_FEEDBACK' ) %>) diff --git a/src/client/app/tmpl/appointment-detail-attendee.html b/src/client/app/tmpl/appointment-detail-attendee.html index 3f90058..5f33614 100644 --- a/src/client/app/tmpl/appointment-detail-attendee.html +++ b/src/client/app/tmpl/appointment-detail-attendee.html @@ -20,7 +20,7 @@ <% 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 ) } ) %> <% } %> diff --git a/src/client/app/tmpl/appointment-edit-attendee-row.html b/src/client/app/tmpl/appointment-edit-attendee-row.html index 77825a7..aa2fd6b 100644 --- a/src/client/app/tmpl/appointment-edit-attendee-row.html +++ b/src/client/app/tmpl/appointment-edit-attendee-row.html @@ -46,17 +46,17 @@ diff --git a/src/server/server/control/TB_Server_Control_Appointment.php b/src/server/server/control/TB_Server_Control_Appointment.php index 808ec46..31058d0 100644 --- a/src/server/server/control/TB_Server_Control_Appointment.php +++ b/src/server/server/control/TB_Server_Control_Appointment.php @@ -1126,6 +1126,7 @@ class TB_Server_Control_Appointment { $attendee = new TB_Shared_Ent_TeamData_Attendee(); $attendee->appointment_id = $appointment->id; $attendee->profile_id = $profileToUpdate->id; + $attendee->status = TB_Shared_Ent_TeamData_Attendee::STATUS_DECLINED; if ( $profileChildId > 0 ) { $attendee->profile_child_id = $profileChildId;
+ <%= a.hasProfileIdAttended( attendee.getId(), childProfile ? childProfile.id : null ) ? 'checked="checked"' : '' %> />