| @@ -1,5 +1,5 @@ | |||||
| <div class="table-responsive"> | <div class="table-responsive"> | ||||
| <label style="margin-left: 15px">von:<input type="date" style="margin-left: 12px;margin-right: 5px;" class="dateStart" name="search-start" value="<%= strFrom %>"></label> | |||||
| <label style="margin-left: 15px">Zeitraum von:<input type="date" style="margin-left: 12px;margin-right: 5px;" class="dateStart" name="search-start" value="<%= strFrom %>"></label> | |||||
| <label>bis:<input type="date" style="margin-left: 12px;margin-right: 5px;"class="dateEnd" name="search-end" value="<%= strTo %>"></label> | <label>bis:<input type="date" style="margin-left: 12px;margin-right: 5px;"class="dateEnd" name="search-end" value="<%= strTo %>"></label> | ||||
| <table class="table table-striped table-bordered table-hover datatable" > | <table class="table table-striped table-bordered table-hover datatable" > | ||||
| <thead> | <thead> | ||||
| @@ -52,33 +52,48 @@ | |||||
| <td class="text-center"><%= _nf ( apps[ ai ].getPriceFactor(), 2 ) %></td> | <td class="text-center"><%= _nf ( apps[ ai ].getPriceFactor(), 2 ) %></td> | ||||
| <td class="text-center"><%= apps[ ai ].getNumAcceptedAttendees() %></td> | <td class="text-center"><%= apps[ ai ].getNumAcceptedAttendees() %></td> | ||||
| <td class="text-center"> | <td class="text-center"> | ||||
| <button type="button" | |||||
| data-type="btn-edit-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-pencil-square-o"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-detail-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-search"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-attendees-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-users"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-chat-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-comments-o"></i> | |||||
| </button> | |||||
| <div class="button-group"> | |||||
| <button type="button" | |||||
| data-type="btn-edit-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-pencil-square-o"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-detail-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-search"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-attendees-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-users"></i> | |||||
| </button> | |||||
| <button type="button" | |||||
| data-type="btn-chat-appointment" | |||||
| data-appointment-id="<%= apps[ ai ].id %>" | |||||
| class="btn btn-sm btn-primary"> | |||||
| <i class="fa fa-comments-o"></i> | |||||
| </button> | |||||
| </div> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| <% } %> | <% } %> | ||||
| </tbody> | </tbody> | ||||
| </table> | </table> | ||||
| </div> | |||||
| </div> | |||||
| /* todo: refactoring into css file */ | |||||
| <style> | |||||
| /* spawntree */ | |||||
| .button-group { | |||||
| display: flex; | |||||
| flex-wrap: nowrap; | |||||
| } | |||||
| .button-group .btn { | |||||
| margin: 0 1px; | |||||
| } | |||||
| </style> | |||||
| @@ -15,31 +15,33 @@ | |||||
| </thead> | </thead> | ||||
| <tbody> | <tbody> | ||||
| <% for ( let i = 0; i < ui.length; i++ ) { %> | <% for ( let i = 0; i < ui.length; i++ ) { %> | ||||
| <tr data-type="memberChargeItem" | |||||
| class="clickable" | |||||
| data-member-id="<%= ui[ i ].member ? ui[ i ].member.id : '' %>"> | |||||
| <td> | |||||
| <%= ui[ i ].member ? ui[ i ].member.id : '-' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member ? ui[ i ].member.getName() : '[gelöscht - nicht mehr Mitglied der Gruppe]' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member && ui[ i ].member.street ? ui[ i ].member.street : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member && ui[ i ].member.zip ? ui[ i ].member.zip : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member && ui[ i ].member.city ? ui[ i ].member.city : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].count %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].hasActiveContract ? 'ja' : 'nein' %> | |||||
| </td> | |||||
| </tr> | |||||
| <% if ( ui[ i ].member ) { %> | |||||
| <tr data-type="memberChargeItem" | |||||
| class="clickable" | |||||
| data-member-id="<%= ui[ i ].member ? ui[ i ].member.id : '' %>"> | |||||
| <td> | |||||
| <%= ui[ i ].member.id %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member.getName() %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member.street ? ui[ i ].member.street : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member.zip ? ui[ i ].member.zip : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].member.city ? ui[ i ].member.city : '---' %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].count %> | |||||
| </td> | |||||
| <td> | |||||
| <%= ui[ i ].hasActiveContract ? 'ja' : 'nein' %> | |||||
| </td> | |||||
| </tr> | |||||
| <% } %> | |||||
| <% } %> | <% } %> | ||||
| </tbody> | </tbody> | ||||
| </table> | </table> | ||||
| @@ -908,7 +908,7 @@ class TB_Server_Control_Appointment { | |||||
| if ( $filter === 'all' ) | if ( $filter === 'all' ) | ||||
| { | { | ||||
| $filter = array(); | $filter = array(); | ||||
| $filter[ 'previous' ] = true; | |||||
| $filter[ 'all' ] = true; | |||||
| $filter[ 'appointmentCategoryIds' ] = array(); | $filter[ 'appointmentCategoryIds' ] = array(); | ||||
| foreach( $teamIds as $teamId ) | foreach( $teamIds as $teamId ) | ||||
| { | { | ||||
| @@ -220,7 +220,9 @@ class TB_Shared_Ent_TeamData_Appointment extends Francis_Db_Row | |||||
| public static function getAllForTeamIds( array $teamIds, $filter = NULL ) | public static function getAllForTeamIds( array $teamIds, $filter = NULL ) | ||||
| { | { | ||||
| $appointments = array(); | $appointments = array(); | ||||
| $filterGetOld = ( is_array( $filter ) && array_key_exists( 'previous', $filter ) ) ? $filter[ 'previous' ] : false; | |||||
| $filterGetAll = ( is_array( $filter ) && array_key_exists( 'all', $filter ) ) ? $filter[ 'all' ] : false; | |||||
| $filterGetPrevious = ( is_array( $filter ) && array_key_exists( 'previous', $filter ) ) ? $filter[ 'previous' ] : false; | |||||
| $filterCategories = isset( $filter ) && isset( $filter[ 'appointmentCategoryIds' ] ) ? $filter[ 'appointmentCategoryIds' ] : []; | $filterCategories = isset( $filter ) && isset( $filter[ 'appointmentCategoryIds' ] ) ? $filter[ 'appointmentCategoryIds' ] : []; | ||||
| if ( 0 === count( $teamIds ) || 0 === count( $filterCategories ) ) return $appointments; | if ( 0 === count( $teamIds ) || 0 === count( $filterCategories ) ) return $appointments; | ||||
| @@ -247,12 +249,18 @@ class TB_Shared_Ent_TeamData_Appointment extends Francis_Db_Row | |||||
| $inCategories = str_repeat( '?,', count( $filterCategories ) - 1 ) . '?'; | $inCategories = str_repeat( '?,', count( $filterCategories ) - 1 ) . '?'; | ||||
| $sql .= "AND COALESCE( category_id, -1 ) IN ( $inCategories ) "; | $sql .= "AND COALESCE( category_id, -1 ) IN ( $inCategories ) "; | ||||
| */ | */ | ||||
| if ( false === $filterGetOld ) | |||||
| { | |||||
| $sql .= "AND end_dt > UTC_TIMESTAMP() "; | |||||
| } else { | |||||
| $sql .= "AND end_dt > UTC_TIMESTAMP() - INTERVAL 1 MONTH "; | |||||
| if ( false === $filterGetAll ) { | |||||
| // if not get all appointments | |||||
| if ( true === $filterGetPrevious ) { | |||||
| // get future appointments and some previous within limited date span | |||||
| $sql .= "AND end_dt > UTC_TIMESTAMP() - INTERVAL 1 MONTH "; | |||||
| } else { | |||||
| // future appointments only | |||||
| $sql .= "AND end_dt > UTC_TIMESTAMP() "; | |||||
| } | |||||
| } | } | ||||
| $sql .= "ORDER BY start_dt ASC"; | $sql .= "ORDER BY start_dt ASC"; | ||||
| $stmt = $dbh->prepare( $sql ); | $stmt = $dbh->prepare( $sql ); | ||||
| $stmt->execute( array_merge( $teamIds ) ); | $stmt->execute( array_merge( $teamIds ) ); | ||||