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 @@
|
+ <%= a.hasProfileIdAttended( attendee.getId(), childProfile ? childProfile.id : null ) ? 'checked="checked"' : '' %>
/>
|
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;