public function isValid() { $bb = $this->getPlugin()->getBookingBuilder(); if (!$bb->get('email') && is_user_logged_in()) { global $current_user; get_currentuserinfo(); $values = array('firstname' => $current_user->user_firstname, 'lastname' => $current_user->user_lastname, 'email' => $current_user->user_email, 'phone' => get_user_meta($current_user->ID, '_sln_phone', true), 'address' => get_user_meta($current_user->ID, '_sln_address', true)); $this->bindValues($values); } return parent::isValid(); }
public function render() { $bb = $this->getPlugin()->getBookingBuilder(); if ($bb->getLastBooking()) { $data = $this->getViewData(); $this->redirect(add_query_arg(array('submit_' . $this->getStep() => 1), $data['formAction'])); } elseif (!$bb->getServices()) { $this->redirect(add_query_arg(array('sln_step_page' => 'services'))); } else { return parent::render(); } }
public function isValid() { $tmp = $this->getAttendants(); return !empty($tmp) && parent::isValid(); }
public function getViewData() { $ret = parent::getViewData(); $formAction = $ret['formAction']; return array_merge($ret, array('formAction' => $formAction, 'booking' => $this->getPlugin()->getBookingBuilder()->getLastBooking(), 'laterUrl' => add_query_arg(array('mode' => 'later', 'submit_' . $this->getStep() => 1), $formAction), 'paypalUrl' => add_query_arg(array('mode' => 'paypal', 'submit_' . $this->getStep() => 1), $formAction), 'paypalOp' => $this->op)); }
public function isValid() { $tmp = $this->getServices(); return !empty($tmp) && parent::isValid(); }