public function manage_column($column, $post_id) { switch ($column) { case 'ID': echo edit_post_link($post_id, '<p>', '</p>', $post_id); break; case 'myauthor': $obj = new SLN_Wrapper_Booking($post_id); echo edit_post_link($obj->getDisplayName(), null, null, $post_id); break; case 'booking_status': echo SLN_Enum_BookingStatus::getLabel(get_post_status($post_id)); break; case 'booking_date': echo $this->getPlugin()->format()->datetime(get_post_meta($post_id, '_sln_booking_date', true) . ' ' . get_post_meta($post_id, '_sln_booking_time', true)); break; case 'booking_price': echo $this->getPlugin()->format()->money(get_post_meta($post_id, '_sln_booking_amount', true)); break; case 'booking_attendant': if ($attendant = $this->getPlugin()->createBooking($post_id)->getAttendant()) { echo $attendant->getName(); } else { echo "-"; } break; } }
public function save_post($post_id, $post) { if (isset($_POST['emailto']) && isset($_POST['emailto_submit']) && !empty($_POST['emailto'])) { $booking = new SLN_Wrapper_Booking($post_id); $to = $_POST['emailto']; $this->getPlugin()->sendMail('mail/summary', compact('booking', 'to')); } parent::save_post($post_id, $post); $booking = new SLN_Wrapper_Booking($post_id); $booking->evalDuration(); }