public function manage_column($column, $post_id) { switch ($column) { case 'booking_status': echo SLN_Enum_BookingStatus::getLabel(get_post_meta($post_id, '_sln_booking_status', true)); break; case 'service_duration': $time = SLN_Func::filter(get_post_meta($post_id, '_sln_service_duration', true), 'time'); echo $time ? $time : '-'; break; case 'service_price': echo $this->getPlugin()->format()->money(get_post_meta($post_id, '_sln_service_price', true)); break; } }
<ul> <li><span class="pull-left event event-warning"></span><?php echo SLN_Enum_BookingStatus::getLabel(SLN_Enum_BookingStatus::PENDING); ?> </li> <li><span class="pull-left event event-success"></span><?php echo SLN_Enum_BookingStatus::getLabel(SLN_Enum_BookingStatus::PAID); ?> <?php _e('or', 'sln'); ?> <?php echo SLN_Enum_BookingStatus::getLabel(SLN_Enum_BookingStatus::CONFIRMED); ?> </li> <li><span class="pull-left event event-info"></span><?php echo SLN_Enum_BookingStatus::getLabel(SLN_Enum_BookingStatus::PAY_LATER); ?> </li> <li><span class="pull-left event event-danger"></span><?php echo SLN_Enum_BookingStatus::getLabel(SLN_Enum_BookingStatus::CANCELED); ?> </li> </ul> <div class="clearfix"></div> </div> </div> </div> <div class="clearfix"></div>
function tpl_summary_details($booking, $plugin) { ?> <table width="502" border="0" align="left" cellpadding="0" cellspacing="0"> <tbody><tr> <td width="157" align="center" valign="top" style="border-right:2px solid #f2f2f2;"><table width="112" border="0" align="center" cellpadding="0" cellspacing="0"> <tbody><tr> <td align="left" valign="top"> </td> </tr> <tr> <td height="25" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php _e('Date', 'sln'); ?> </td> </tr> <tr> <td height="36" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#666666; font-weight:bold;"><?php echo $plugin->format()->date($booking->getDate()); ?> </td> </tr> <tr> <td height="25" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php echo _e('Time', 'sln'); ?> </td> </tr> <tr> <td align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#666666; font-weight:bold;"> <?php echo $plugin->format()->time($booking->getTime()); ?> </td> </tr> <?php if ($attendant = $booking->getAttendant()) { ?> <tr> <td height="25" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php echo _e('Attendant', 'sln'); ?> </td> </tr> <tr> <td align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#666666; font-weight:bold;"> <?php echo $attendant->getName(); ?> </td> </tr> <?php } ?> <tr> <td align="left" valign="top"> </td> </tr> </tbody></table></td> <td width="194" align="center" valign="top" style="border-right:2px solid #f2f2f2;"><table width="155" border="0" cellspacing="0" cellpadding="0"> <tbody><tr> <td align="left" valign="top"> </td> </tr> <tr> <td height="30" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php _e('Services'); ?> </td> </tr> <?php foreach ($plugin->getServices() as $service) { ?> <?php if ($booking->hasService($service)) { ?> <tr> <td height="20" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#666666; font-weight:bold;"><?php echo $service->getName(); ?> </td> </tr> <?php } ?> <?php } ?> <tr> <td align="left" valign="top"> </td> </tr> </tbody></table></td> <td width="147" align="center" valign="top"><table width="112" border="0" align="center" cellpadding="0" cellspacing="0"> <tbody><tr> <td align="left" valign="top"> </td> </tr> <tr> <td height="25" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php _e('Total amount', 'sln'); ?> </td> </tr> <tr> <td height="36" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#666666; font-weight:bold;"> <?php echo $plugin->format()->money($booking->getAmount()); ?> </td> </tr> <tr> <td height="28" align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#cc3333; font-weight:normal;"><?php _e('Status', 'sln'); ?> </td> </tr> <tr> <td align="left" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#666666; font-weight:bold;"><?php echo SLN_Enum_BookingStatus::getLabel($booking->getStatus()); ?> </td> </tr> <tr> <td align="left" valign="top"> </td> </tr> </tbody></table></td> </tr> </tbody></table> <?php }
SLN_Form::fieldDate($helper->getFieldName($postType, 'date'), $booking->getDate()); ?> <?php SLN_Form::fieldTime($helper->getFieldName($postType, 'time'), $booking->getTime()); ?> </label> </div> </div> <div class="col-md-6 col-sm-4"> <div class="form-group sln_meta_field "> <label><?php _e('Status', 'sln'); ?> </label> <?php SLN_Form::fieldSelect($helper->getFieldName($postType, 'status'), SLN_Enum_BookingStatus::toArray(), $booking->getStatus(), array('map' => true)); ?> </div> </div> </div> <div class="sln-separator"></div> <div class="form-group sln_meta_field"> <label><?php _e('Attendant', 'sln'); ?> </label><br/> <?php foreach ($plugin->getAttendants() as $attendant) { ?> <div class="row"> <div class="col-md-1 col-sm-1 col-xs-2">
private function wrapBooking($booking) { return array("id" => $booking->getId(), "title" => $this->getTitle($booking), "url" => get_edit_post_link($booking->getId()), "class" => "event-" . SLN_Enum_BookingStatus::getColor($booking->getStatus()), "start" => $booking->getStartsAt()->format('U') * 1000, "end" => $booking->getEndsAt()->format('U') * 1000, "event_html" => $this->getEventHtml($booking)); }
<td height="105" align="center" valign="middle" bgcolor="#f2f2f2" style="border-bottom:2px solid #fff;"><table width="191" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="55" align="left" valign="top"><a href="#"><img src="<?php echo SLN_PLUGIN_URL; ?> /img/summary.png" width="40" height="41" alt="img1" border="0" align="left"></a></td> <td align="left" valign="top"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td height="20" align="left" valign="bottom" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#cccccc; font-weight:bold;"><?php _e('Booking ID', 'sln'); ?> <b style="color:#666666;"><?php echo $booking->getId(); ?> </b></td> </tr> <tr> <td height="25" align="left" valign="bottom" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#cccccc; font-weight:bold;"><?php _e('Status', 'sln'); ?> <b style="color:#666666;"><?php echo SLN_Enum_BookingStatus::getLabel($booking->getStatus()); ?> </b></td> </tr> </table></td> </tr> </table></td> </tr>
public function bulkPostStates() { global $post; $arg = get_query_var('post_status'); if ($post->post_type == SLN_Plugin::POST_TYPE_BOOKING) { foreach (SLN_Enum_BookingStatus::toArray() as $k => $v) { if ($arg != $k) { if ($post->post_status == $k) { return array($v); } } } } return null; }
public static function init() { self::$labels = array(self::ERROR => __('ERROR', 'sln'), self::PENDING => __('Pending', 'sln'), self::PAID => __('Paid', 'sln'), self::PAY_LATER => __('Pay later', 'sln'), self::CANCELED => __('Canceled', 'sln'), self::CONFIRMED => __('Confirmed', 'sln')); }