function datepickerAction() { ob_clean(); $unitID = $this->_getParam('unit_id', null); $unitModel = new RM_Units(); $unit = $unitModel->get($unitID); $reservationModel = new RM_Reservations(); $reservations = $reservationModel->fetchAllForUnitCalendar($unit); $config = new RM_Config(); $RMdate = new RM_Date(); $jsonDisabledPeriods = new stdClass(); $jsonDisabledPeriods->start = array(); $jsonDisabledPeriods->end = array(); foreach ($reservations as $period) { $jsonPeriod = new stdClass(); $jsonPeriod->start = $config->convertDates($period->start_datetime, RM_Config::JS_DATEFORMAT, RM_Config::PHP_DATEFORMAT); $jsonPeriod->end = $config->convertDates($period->end_datetime, RM_Config::JS_DATEFORMAT, RM_Config::PHP_DATEFORMAT); // store the start date picker blocked periods $jsonDisabledPeriods->start[] = clone $jsonPeriod; $jsonPeriod->start = $RMdate->dateAdd($config->convertDates($period->start_datetime, RM_Config::JS_DATEFORMAT, RM_Config::PHP_DATEFORMAT), 1); $jsonPeriod->end = $RMdate->dateAdd($config->convertDates($period->end_datetime, RM_Config::JS_DATEFORMAT, RM_Config::PHP_DATEFORMAT), 1); $jsonDisabledPeriods->end[] = clone $jsonPeriod; } $json = Zend_Json::encode($jsonDisabledPeriods); $this->view->calendardata = $json; $this->view->unit_id = $unitID; echo $this->view->render('DailyPrices/datepicker.phtml'); die; }
public function pingJsonAction() { // get the reservation count $model = new RM_Reservations(); $UnReadCount = $model->getUnreadCount(); if ($UnReadCount > 0) { $UnReadCount = " <span class='RM_Menu_Badge_Count'><div class='RM_Menu_Badge_Count_text'>" . $UnReadCount . "</div></span><span class='RM_Menu_Badge_Count_right'></span>"; } else { $UnReadCount = ""; } // return the JSON Data return array('data' => array('success' => true, 'time' => time(), 'count' => $UnReadCount, 'encoded' => true)); }
/** * this returns the saved price information for a reservation * * @param string $reservationID * @return object a complete price breakdown. */ public function getPrice($reservationID) { // TODO: we will need to add code to dynamically check modules and plugins that // have code that adds prices/charges in order to dynamcially check any saved // prices that have been charged to customers if (!isset($reservationID)) { return false; } $reservationModel = new RM_Reservations(); $reservation = $reservationModel->find($reservationID)->current(); $priceObj = new stdClass(); $priceObj->tax = RM_Environment::getInstance()->getTaxSystem()->getTotalTaxes($reservation); $priceObj->total = $reservation->getTotalPrice(); $priceObj->subtotal = $priceObj->total - $priceObj->tax; return $priceObj; }
protected function _assign(Dwoo_Data $data) { $details = $this->_eventData->getAllDetails(); $reservationID = $this->_eventData->getReservationID(); $reservationModel = new RM_Reservations(); $reservation = $reservationModel->find($reservationID)->current(); $arrayDetails = array(); foreach ($details as $detail) { $arrayDetails[] = array('unit' => $detail->getUnit()->toArray(), 'period' => (array) $detail->getPeriod(), 'periodtime' => (array) $detail->getPeriod(true), 'persons' => $detail->getPersons(), 'total' => $detail->getTotal()); } // total paid and total due $billing = new RM_Billing(); $priceCharges = $billing->getPrice($reservationID); $billingArray['tax'] = $priceCharges->tax; $billingArray['paid'] = $billing->getPaymentsTotal($reservation); $billingArray['due'] = $priceCharges->total; $billingArray['confirmed'] = $reservation->confirmed ? $translate->_('MessageYes') : $translate->_('MessageNo'); $data->assign('details', $arrayDetails); $data->assign('reservation_id', $this->_eventData->getReservationID()); return $data; }
protected function _assign(Dwoo_Data $data) { $translate = RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_MAIN); $locationsDAO = new RM_Locations(); $reservationID = $this->_eventData->getReservationID(); $reservationModel = new RM_Reservations(); $reservation = $reservationModel->find($reservationID)->current(); // reservation details $details = $this->_eventData->getAllDetails(); $arrayDetails = array(); foreach ($details as $detail) { $unit = $detail->getUnit()->toArray(); $period = $detail->getPeriod()->toArray(); $periodWithTime = $detail->getPeriod()->toArray(true); $location = $locationsDAO->fetchByUnit($unit['id'])->toArray(); $extrasForTemplate = array(); $extras = $detail->getExtras(); foreach ($extras as $extra) { $extrasForTemplate[] = $extra->toArray(); } $arrayDetails[] = array('unit' => $unit, 'locationInfo' => isset($location[0]) ? $location[0] : '', 'period' => $period, 'periodtime' => $periodWithTime, 'persons' => $detail->getPersons()->getAll(), 'total' => $detail->getTotal(), 'extras' => $extrasForTemplate); } // total paid and total due $billing = new RM_Billing(); $priceCharges = $billing->getPrice($reservationID); $billingArray['tax'] = $priceCharges->tax; $billingArray['paid'] = $billing->getPaymentsTotal($reservation); $billingArray['due'] = $priceCharges->total; $billingArray['confirmed'] = $reservation->confirmed ? $translate->_('MessageYes') : $translate->_('MessageNo'); // return the data to the template $data->assign('extras', $extrasForTemplate); $data->assign('details', $arrayDetails); $data->assign('user', $this->_eventData->getUser()->toArray()); $data->assign('reservation_id', $reservationID); $data->assign('billing', $billingArray); return $data; }
/** * Gets the calendar Data * * @return JSON */ private function _getdata($startRange = false, $endRange = false) { if (!$startRange || !$endRange) { $startRange = date("Y-m-d"); $endRange = date("Y-m-d"); } $unitModel = new RM_Units(); $units = $unitModel->getAll(new RM_Unit_Search_Criteria()); $unitModel = new RM_Units(); $reservationModel = new RM_Reservations(); $config = new RM_Config(); $evtsArray = array(); // add 6 months to either side of the reservation $RMDate = new RM_Date(); $start = $RMDate->dateSub($startRange, 180); $end = $RMDate->dateAdd($endRange, 180); $filter = array(); $filter['data']['type'] = 'date'; $filter['field'] = 'start_datetime'; $filter['data']['comparison'] = 'gt'; $filter['data']['value'] = $start; $filterArray[] = $filter; $filter = array(); $filter['data']['type'] = 'date'; $filter['field'] = 'end_datetime'; $filter['data']['comparison'] = 'lt'; $filter['data']['value'] = $end; $filterArray[] = $filter; $filter = array(); $filter['data']['type'] = 'numeric'; $filter['field'] = 'in_progress'; $filter['data']['comparison'] = 'eq'; $filter['data']['value'] = 0; $filterArray[] = $filter; foreach ($units as $unit) { $unit = $unitModel->get($unit->id); $reservations = $reservationModel->fetchAllByUnit($unit, $filterArray); foreach ($reservations as $period) { $idArray = explode("-", $period->id); $id = (int) $idArray[1]; // check time $ad = true; // all day $starttime = explode(" ", $period->start_datetime); if ($starttime[1] !== "00:00:00") { $ad = false; } $endtime = explode(" ", $period->end_datetime); if ($endtime[1] !== "23:30:00") { $ad = false; } $evtsArray[] = array("id" => $id, "cid" => $unit->id, "uid" => (int) $period->user_id, "title" => "<span style='text-align:center;width:70%;'>" . $period->id . " " . $unit->name . "(" . $unit->id . ")</span>", "start" => $period->start_datetime, "end" => $period->end_datetime, "ad" => $ad); } } return array("success" => true, "message" => RM_Environment::getInstance()->getTranslation(RM_Environment::TRANSLATE_MAIN)->_('Admin.Reservation.Edit', "LoadedData"), "data" => $evtsArray); }
public function listresJsonAction() { $id = $this->_getParam('id'); $config = new RM_Config(); // used for date conversion $model = new RM_Reservations(); $Users_Reservation_Total = $model->fetchAllByUserID($id)->count(); $Users_Reservation_Info = $model->fetchAllByUserID($id)->toArray(); $jsonReservations = array(); $reservationDetailsModel = new RM_ReservationDetails(); foreach ($Users_Reservation_Info as $reservation) { $tempVal->reservation_id = $reservation['reservation_id']; $tempVal->unit_id = $reservation['unit_id']; //TODO: We need to convert this to a meaningful word ie: unitname (ID:X) $tempVal->start_date = $config->convertDates($reservation['start_datetime'], RM_Config::MYSQL_DATEFORMAT, RM_Config::JS_DATEFORMAT); $tempVal->end_date = $config->convertDates($reservation['end_datetime'], RM_Config::MYSQL_DATEFORMAT, RM_Config::JS_DATEFORMAT); $jsonReservations[] = clone $tempVal; } $ret = array("data" => '{"total": ' . $Users_Reservation_Total . ', "data" : ' . Zend_Json::encode($jsonReservations) . '}', 'encoded' => true); return $ret; }
public function reservationsJsonAction() { $unitID = $this->_getParam('unit_id', null); $startdate = $this->_getParam('startdate', null); $enddate = $this->_getParam('enddate', null); // unit dao $unitsDAO = new RM_Units(); $unitObject = $unitsDAO->find($unitID)->current(); $filter[] = array('field' => 'start_datetime', 'data' => array('type' => 'date', 'value' => $startdate, 'comparison' => 'gt')); $filter[] = array('field' => 'end_datetime', 'data' => array('type' => 'date', 'value' => $enddate, 'comparison' => 'lt')); $filters[] = array('field' => 'confirmed', 'data' => array('type' => 'numeric', 'value' => 1, 'comparison' => 'eq')); // reservation data $reservationsDAO = new RM_Reservations(); $reservations = $reservationsDAO->fetchAllByUnit($unitObject, $filter); foreach ($reservations as $reservation) { $detailJson = new stdClass(); $detailJson->Id = $reservation->id; $detailJson->ResourceId = $unitID; $detailJson->StartDate = $reservation->start_datetime; $detailJson->Color = 'red'; $detailJson->EndDate = $reservation->end_datetime; $detailsJson[] = $detailJson; } return array('data' => $detailsJson); }
public function listhtmlJsonAction() { $reservationID = $this->_getParam('id', null); if ($reservationID == null) { return array('data' => array('success' => false)); } $reservationModel = new RM_Reservations(); $reservation = $reservationModel->find($reservationID)->current(); if ($reservation == null) { return array('data' => array('success' => false)); } $unitModel = new RM_Units(); $reservationDetails = $reservation->getDetails(); $reservationDetailsJson = array(); foreach ($reservationDetails as $reservationDetail) { $unit = $reservationDetail->findUnit(); $extrasModel = new RM_Extras(); $extras = $extrasModel->getByUnit($unit); if ($extras->count() == 0) { continue; } $config = new RM_Config(); $currencySymbol = $config->getValue('rm_config_currency_symbol'); // tax $taxSystem = RM_Environment::getInstance()->getTaxSystem(); $taxes = $taxSystem->getAllTaxes($unit); // we need to create a new reservation details object so that the tax can be calculated $periodObj = new RM_Reservation_Period(new RM_Date(strtotime($reservationDetail->start_datetime)), new RM_Date(strtotime($reservationDetail->end_datetime))); $persons = new RM_Reservation_Persons(array("adults" => $reservationDetail->adults, "children" => $reservationDetail->children, "infants" => $reservationDetail->infants)); $fullReservationDetails = new RM_Reservation_Details($unit, $periodObj, $persons, array()); $summaryModel = new RM_ReservationSummary(); $extrasJson = array(); foreach ($extras as $extra) { // calculate the tax due on the extra... $extraSubTotal = $extra->calculate($reservationDetail); $taxTotal = 0; foreach ($taxes as $tax) { $taxTotal = $taxTotal + $tax->calculate($extraSubTotal, $fullReservationDetails); } $extraSubTotal = $extraSubTotal + $taxTotal; $extraJson = new stdClass(); $extraJson->id = $extra->id; $extraJson->name = $extra->getName(RM_Environment::getInstance()->getLocale()); $extraJson->min = (int) $extra->min; $extraJson->max = (int) $extra->max; $extraJson->type = RM_Environment::getInstance()->getTranslation()->_('Admin.Extras.Type', ucfirst($extra->type)); $extraJson->price = $currencySymbol . $extraSubTotal; $reservationDetailsExtra = $summaryModel->getByDetail($reservationDetail, RM_Module_Extras::SUMMARY_TYPE, $extra->id); if ($reservationDetailsExtra == null) { $extraJson->saved_price = $currencySymbol . '0'; $extraJson->value = 0; } else { $extraJson->saved_price = $currencySymbol . $reservationDetailsExtra->total_amount; $extraJson->value = (int) $reservationDetailsExtra->value; } $extrasJson[] = $extraJson; } $unit = $unitModel->get($reservationDetail->unit_id); if ($unit == null) { $unitName = "DELETED"; } else { $unitName = $unit->name; } $priceSystem = RM_Prices_Manager::getInstance()->getRealPriceSystem($unit); $reservationDetailJson = new stdClass(); $reservationDetailJson->id = $reservationDetail->id; $reservationDetailJson->extras = $extrasJson; $reservationDetailJson->unit_id = $reservationDetail->unit_id; $reservationDetailJson->unit_name = $unitName; $reservationDetailJson->start = $reservationDetail->getStartDatetime($priceSystem->getDateformat(true)); $reservationDetailJson->end = $reservationDetail->getEndDatetime($priceSystem->getDateformat(true)); $reservationDetailJson->subtotal = $reservationDetail->total_price; $reservationDetailsJson[] = $reservationDetailJson; } $json = new stdClass(); $json->details = $reservationDetailsJson; return array('data' => $json); }
public function ipnAction() { $this->_withoutView(); $provider = new RM_Plugin_PayPal(); $provider->validateIPN(); RM_Log::toLog("PayPal ipnAction Called"); if ($provider->ipnData['payment_status'] == "Completed" || $provider->ipnData['payment_status'] == "Pending") { RM_Log::toLog("PayPal payment status: " . $provider->ipnData['payment_status']); if (str_word_count($provider->ipnData['invoice'], 0, "RM-") > 0) { $bookingref = ltrim($provider->ipnData['invoice'], "RM-"); } else { $bookingref = $provider->ipnData['invoice']; } RM_Log::toLog("Booking ref passed back from PayPal: " . $bookingref); $model = new RM_Reservations(); $reservation = $model->find($bookingref)->current(); RM_Log::toLog("Reservation Record ID: " . $reservation->id); $model->confirm($reservation); RM_Log::toLog("Confirmed Updated"); $model->inProgressComplete($reservation); RM_Log::toLog("InProgress Marker Updated"); // save the total // we have a problem here, when this action is called it is called // from the paypal.com server. The session is not the same so saving to it // is impossible. I think we need to pass to PayPal the 'custom' parameter // this could contain something like the session id, however I am not // sure if it's possible to update the data in a session with a session // id? //$manager = RM_Reservation_Manager::getInstance(); $total_paid = $provider->ipnData['mc_gross']; RM_Log::toLog("Total Passed back from PayPal: " . $total_paid); //$manager->setPaymentTotal($total_paid); // save the total incase we need it later. //if (!$total_paid) $this->_redirect('Reservations', 'notcomplete'); // this handles if the total amount is null'd $billingModel = new RM_Billing(); $billingRow = $billingModel->createRow(); $billingRow->reservation_id = $bookingref; $billingRow->total_paid = $total_paid; $billingID = $billingRow->save(); RM_Log::toLog("Billing Updated"); // TODO: I can't get thsi working.. // save the payment information $billingPaymentsModel = new RM_BillingPayments(); $billingPaymentRow = $billingPaymentsModel->createRow(); $billingPaymentRow->id = $billingID; $billingPaymentRow->provider = "PayPal"; $billingPaymentRow->transaction_id = $provider->ipnData['txn_id']; $billingPaymentRow->status = $provider->ipnData['payment_status']; $billingPaymentRow->total = $provider->ipnData['mc_gross']; $billingPaymentRow->transaction_date = Date("Y-m-d"); $billingPaymentRow->save(); RM_Log::toLog("Billing Payments Updated"); // TODO: if the IPN is successful then we need to set the in_progress flag to 0 // this is also done in the reservation controller on success we have to do it here also // as it is possible the customer may not return to the site via the payment provider // return URL in this case the in_progress flag will never be updated that's why we // need to do this here also // I need to ask Valentin about a standard method for this. // TODO: we should also record other information such as the transaction id // however this can be added later. } }
public function getreservationsJsonAction() { $unit_id = $this->_getParam('unitid'); $date = $this->_getParam('date'); // TODO: add admin selected language here:- $lang = RM_Environment::getInstance()->getLocale(); $reservations = new RM_Reservations(); $reservationDetails = $reservations->fetchAllByUnitDate($unit_id, $date, $lang); $jsonReservations = array(); $config = new RM_Config(); $usersObj = new RM_Users(); foreach ($reservationDetails as $reservation) { $jsonData = new stdClass(); $jsonData->reservation_id = $reservation->reservation_id; $jsonData->unit_id = $reservation->unit_id; $jsonData->start_date = $config->convertDates($reservation->start_datetime, RM_Config::PHP_DATEFORMAT, RM_Config::JS_DATEFORMAT); $jsonData->end_date = $config->convertDates($reservation->end_datetime, RM_Config::PHP_DATEFORMAT, RM_Config::JS_DATEFORMAT); $jsonData->total_price = $reservation->total_price; $jsonData->unit_name = $reservation->name; $jsonData->user_id = $reservation->user_id; if ($reservation->confirmed) { $confirmed = "<img src='" . RM_Environment::getConnector()->getRootURL() . "/RM/userdata/images/system/small/reservation_confirmed.png' border='0'>"; } else { $confirmed = "<img src='" . RM_Environment::getConnector()->getRootURL() . "/RM/userdata/images/system/small/reservation_unconfirmed.png' border='0'>"; } $jsonData->confirmed = $confirmed; $titleArray = str_replace(chr(39), chr(34), $this->_translate->_('Common.JSON', 'Titles')); $title = $usersObj->userTitle((int) $reservation->title, $titleArray); $jsonData->title = $title; $jsonData->first_name = $reservation->first_name; $jsonData->last_name = $reservation->last_name; $jsonReservations[] = clone $jsonData; } if (empty($jsonReservations)) { return array('data' => array('success' => false)); } $json = "{\n data : " . Zend_Json::encode($jsonReservations) . "\n }"; return array('data' => $json, 'encoded' => true); }
public function editJsonAction() { $json = new stdClass(); $id = $this->_getParam('id'); $iso = $this->_getParam('iso', RM_Environment::getInstance()->getLocale()); $unitModel = new RM_Units(); $unit = $unitModel->get($id, $iso); $config = new RM_UnitConfig(); $fields = $config->getEditFormByUnit($unit); $config = new RM_Config(); // view_preferences_1 provides non html editors, just raw editors foreach ($fields as $field) { if ($config->getValue('rm_config_editor') == "text" && $field->view_preferences_1 !== "") { $jsonFields[] = $field->view_preferences_1; } else { $jsonFields[] = $field->view_preferences; } } $reservationModel = new RM_Reservations(); $reservations = $reservationModel->fetchAllByUnit($unit); $jsonReservations = array(); /* * the reservation information required to add events to the calendar must include * the start and end date but also the unit color. */ foreach ($reservations as $reservation) { $jsonReservation = new stdClass(); $jsonReservation->start_date = $config->convertDates($reservation->start_datetime, RM_Config::MYSQL_DATEFORMAT, RM_Config::MYSQL_DATEFORMAT_SHORT); $jsonReservation->end_date = $config->convertDates($reservation->end_datetime, RM_Config::MYSQL_DATEFORMAT, RM_Config::MYSQL_DATEFORMAT_SHORT); $jsonReservation->color = $unit->color; // unit color $jsonReservations[] = $jsonReservation; } $priceSystems = RM_Environment::getInstance()->getPriceSystem()->getAllPriceSystems(); $jsonPriceSystems = array(); foreach ($priceSystems as $system) { $jsonPriceSystems[] = $system->name; } $priceSystem = RM_Environment::getInstance()->getPriceSystem()->getRealPriceSystem($unit); // group handling (only used when the groups is enabled) $isGroupTemplate = 0; if ($unit->isTemplateUnit() === (int) $unit->id) { $isGroupTemplate = 1; } elseif ($unit->isTemplateUnit() === null || $unit->isTemplateUnit() === 0) { // if this unit is not in a group then we set the isGroupTemplate true // as this is really the same as a template for the GUI $isGroupTemplate = 1; } $json = "{ unit : " . Zend_Json::encode($unitModel->convertToGUI($unit->toArray())) . ", isgrouptemplate: '" . $isGroupTemplate . "', fields : [" . implode(',', $jsonFields) . "], periods: " . Zend_Json::encode($jsonReservations) . ", language: '" . $iso . "', price: '" . $priceSystem->name . "', prices: " . Zend_Json::encode($jsonPriceSystems) . "}"; return array('data' => $json, 'encoded' => true); }
private function _default() { $model = new RM_Reservations(); $UnReadCount = $model->getUnreadCount(); if ($UnReadCount > 0) { $UnReadCount = " <span class='RM_Menu_Badge_Count'><div class='RM_Menu_Badge_Count_text'>" . $UnReadCount . "</div></span><span class='RM_Menu_Badge_Count_right'></span>"; } else { $UnReadCount = ""; } $home = array(); $console = new stdClass(); $console->text = $this->_translate->_('Home'); $console->id = 'Index_HomepageJson'; $console->leaf = 'false'; $console->iconCls = 'RM_home_icon'; $home[] = $console; $reservations = new stdClass(); $reservations->text = $this->_translate->_('Reservations') . $UnReadCount; $reservations->id = 'Reservations_ListJson_NoAjax'; $reservations->leaf = 'true'; $reservations->iconCls = 'RM_reservations_root_icon'; $home[] = $reservations; $customers = new stdClass(); $customers->text = $this->_translate->_('Users'); $customers->id = 'Users_ListJson_NoAjax'; $customers->leaf = 'true'; $customers->iconCls = "RM_users_root_icon"; $home[] = $customers; // units $config = new RM_Config(); $showUnitsOnMenu = $config->getValue("rm_config_enable_units_on_treemenu"); $units = new stdClass(); $units->text = $this->_translate->_('Units'); $units->id = 'Units_ListJson_NoAjax'; $unitRows = $this->_getUnits(); if (count($unitRows) > 0 && $showUnitsOnMenu === "1") { $units->expanded = false; $units->children = $unitRows; } else { $units->leaf = true; } $units->iconCls = "RM_units_default_root_icon"; $home[] = $units; $system = new stdClass(); $system->text = $this->_translate->_('System'); $system->id = 'system'; $system->disabled = true; $system->expanded = 'true'; $system->iconCls = "RM_system_root_icon"; $system->children = array(); $home[] = $system; $mediaManager = new stdClass(); $mediaManager->text = $this->_translate->_('MediaManager'); $mediaManager->id = 'System_MediaManagerJson'; $mediaManager->leaf = 'true'; $mediaManager->iconCls = "RM_system_mediamanager_icon"; $system->children[] = $mediaManager; $modules = new stdClass(); $modules->text = $this->_translate->_('Modules'); $modules->disabled = true; $modules->id = 'Modules_InfoJson'; $modulesEnabled = $this->_getModules(); if (count($modulesEnabled) > 0) { $modules->expanded = 'true'; $modules->children = $modulesEnabled; } else { $modules->leaf = 'true'; } $modules->iconCls = "RM_config_modules_icon"; $home[] = $modules; $plugins = new stdClass(); $plugins->text = $this->_translate->_('Plugins'); $plugins->disabled = true; $plugins->id = 'Plugins_InfoJson'; $pluginsEnabled = $this->_getPlugins(); if (count($pluginsEnabled) > 0) { $plugins->expanded = 'true'; $plugins->children = $pluginsEnabled; } else { $plugins->leaf = 'true'; } $plugins->iconCls = "RM_config_plugins_icon"; $home[] = $plugins; $misc = new stdClass(); $misc->text = $this->_translate->_('Misc'); $misc->id = 'misc'; $misc->iconCls = "RM_misc_root_icon"; $misc->expanded = 'true'; $misc->children = array(); $configuration = new stdClass(); $configuration->text = $this->_translate->_('Configuration'); $configuration->id = 'Config_EditJson'; $configuration->expanded = 'true'; $configuration->iconCls = "RM_config_root_icon"; $configuration->children = array(); $languages = new stdClass(); $languages->text = $this->_translate->_('Languages'); $languages->id = 'Language_ListJson_NoAjax'; $languages->leaf = 'true'; $languages->iconCls = "RM_config_languages_icon"; $configuration->children[] = $languages; $pagesList = array(); $page = new stdClass(); $page->text = $this->_translate->_('Common.Invoice', 'Invoice'); $page->id = 'Pages_EditJson_admin.scripts.templates.invoice'; $page->leaf = 'true'; $page->iconCls = "RM_config_pages_leaf_icon"; $pagesList[] = $page; $pages = new stdClass(); $pages->text = $this->_translate->_('Pages'); $pages->disabled = true; $pages->expanded = true; $pages->children = $pagesList; $pages->iconCls = "RM_config_pages_icon"; $configuration->children[] = $pages; $templatesList = $this->_getTemplates(); $templates = new stdClass(); $templates->text = $this->_translate->_('Templates'); $templates->disabled = true; if (count($pluginsEnabled) > 0) { $templates->expanded = true; $templates->children = $templatesList; } else { $plugins->leaf = true; } $templates->iconCls = "RM_config_templates_icon"; $configuration->children[] = $templates; $modules = new stdClass(); $modules->text = $this->_translate->_('Modules'); $modules->id = 'Modules_ListJson_NoAjax'; $modulesEnabled = $this->_getModulesConfig(); if (count($modulesEnabled) > 0) { $modules->expanded = 'true'; $modules->children = $modulesEnabled; } else { $modules->leaf = 'true'; } $modules->iconCls = "RM_config_modules_icon"; $configuration->children[] = $modules; $plugins = new stdClass(); $plugins->text = $this->_translate->_('Plugins'); $plugins->id = 'Plugins_ListJson_NoAjax'; $pluginsEnabled = $this->_getPluginsConfig(); if (count($pluginsEnabled) > 0) { $plugins->expanded = 'true'; $plugins->children = $pluginsEnabled; } else { $plugins->leaf = 'true'; } $plugins->iconCls = "RM_config_plugins_icon"; $configuration->children[] = $plugins; $home[] = $configuration; $upgrade = new stdClass(); $upgrade->text = $this->_translate->_('Upgrade'); $upgrade->id = 'System_UpgradeJson_NoAjax'; $upgrade->leaf = 'true'; $upgrade->iconCls = "RM_config_upgrade_icon"; $configuration->children[] = $upgrade; $help = new stdClass(); $help->text = $this->_translate->_('Help'); $help->id = 'help'; $help->disabled = true; $help->expanded = 'true'; $help->iconCls = "RM_help_root_icon"; $help->children = array(); $documentation = new stdClass(); $documentation->text = $this->_translate->_('Documentation'); $documentation->id = 'documenatation'; $documentation->external = true; $documentation->leaf = 'true'; $documentation->url = 'http://docs.resmania.com/'; $documentation->iconCls = "RM_help_docs_icon"; $help->children[] = $documentation; $systemLog = new stdClass(); $systemLog->text = $this->_translate->_('SystemLog'); $systemLog->id = 'system_log'; $systemLog->external = true; $systemLog->leaf = 'true'; $systemLog->url = '../RM/userdata/logs/system_log.txt'; $systemLog->iconCls = "RM_help_docs_icon"; $help->children[] = $systemLog; $licensing = new stdClass(); $licensing->text = $this->_translate->_('License'); $licensing->id = 'license'; $licensing->external = true; $licensing->leaf = 'true'; $licensing->url = 'http://resmania.com/gnu-gpl-license'; $licensing->iconCls = 'RM_help_license_icon'; $help->children[] = $licensing; $home[] = $help; return array('data' => $home); }
/** * Reset every information that user select during reservation process. * * @return RM_Reservation_Manager */ public function reset() { $methods = get_class_methods(get_class($this)); foreach ($methods as $method) { if (strpos($method, 'reset') === 0 && $method != 'reset' && $method != 'resetFormErrors' && $method != 'resetUser') { // We don't need to reset user in the same session $this->{$method}(); } } $this->_setReservationID(RM_Reservations::createReservationID()); return $this; }
/** * Inserts a new row. * * @param array $data Column-value pairs. * @return mixed The primary key of the row inserted. */ public function insert(array $data) { if (isset($data['id']) == false) { $data['id'] = RM_Reservations::createReservationID(); } return parent::insert($data); }