/** * Initial setup of default jobs services * * @return boolean */ protected function setupServices() { $database = \App::get('db'); $objS = new Service($database); $now = Date::toSql(); $default1 = array('id' => 0, 'title' => Lang::txt('COM_SERVICES_BASIC_SERVICE_TITLE'), 'category' => strtolower(Lang::txt('COM_SERVICES_JOBS')), 'alias' => 'employer_basic', 'status' => 1, 'description' => Lang::txt('COM_SERVICES_BASIC_SERVICE_DESC'), 'unitprice' => '0.00', 'pointprice' => 0, 'currency' => '$', 'maxunits' => 6, 'minunits' => 1, 'unitsize' => 1, 'unitmeasure' => strtolower(Lang::txt('month')), 'changed' => $now, 'params' => "promo=" . Lang::txt('COM_SERVICES_BASIC_SERVICE_PROMO') . "\npromomaxunits=3\nmaxads=1"); $default2 = array('id' => 0, 'title' => Lang::txt('COM_SERVICES_PREMIUM_SERVICE_TITLE'), 'category' => strtolower(Lang::txt('COM_SERVICES_JOBS')), 'alias' => 'employer_premium', 'status' => 0, 'description' => Lang::txt('COM_SERVICES_PREMIUM_SERVICE_DESC'), 'unitprice' => '500.00', 'pointprice' => 0, 'currency' => '$', 'maxunits' => 6, 'minunits' => 1, 'unitsize' => 1, 'unitmeasure' => strtolower(Lang::txt('month')), 'changed' => $now, 'params' => "promo=\npromomaxunits=\nmaxads=3"); if (!$objS->bind($default1)) { $this->setError($objS->getError()); return false; } if (!$objS->store()) { $this->setError($objS->getError()); return false; } if (!$objS->bind($default2)) { $this->setError($objS->getError()); return false; } if (!$objS->store()) { $this->setError($objS->getError()); return false; } }
/** * Initial setup of default services * * @return boolean False if errors, true otherwise */ protected function _setupServices() { $objS = new Service($this->database); $now = Date::toSql(); $default1 = array('id' => 0, 'title' => Lang::txt('Employer Service, Basic'), 'category' => strtolower(Lang::txt('jobs')), 'alias' => Lang::txt('employer_basic'), 'status' => 1, 'description' => Lang::txt('Allows to search member resumes and post one job ad'), 'unitprice' => '0.00', 'pointprice' => 0, 'currency' => '$', 'maxunits' => 6, 'minunits' => 1, 'unitsize' => 1, 'unitmeasure' => strtolower(Lang::txt('month')), 'changed' => $now, 'params' => "promo=First 3 months FREE\npromomaxunits=3\nmaxads=1"); $default2 = array('id' => 0, 'title' => Lang::txt('Employer Service, Premium'), 'category' => strtolower(Lang::txt('jobs')), 'alias' => Lang::txt('employer_premium'), 'status' => 0, 'description' => Lang::txt('Allows to search member resumes and post up to 3 job ads'), 'unitprice' => '500.00', 'pointprice' => 0, 'currency' => '$', 'maxunits' => 6, 'minunits' => 1, 'unitsize' => 1, 'unitmeasure' => strtolower(Lang::txt('month')), 'changed' => $now, 'params' => "promo=\npromomaxunits=\nmaxads=3"); if (!$objS->bind($default1)) { App::redirect(Route::url('index.php?option=com_jobs'), $objS->getError(), 'error'); } if (!$objS->store()) { App::redirect(Route::url('index.php?option=com_jobs'), $objS->getError(), 'error'); } if (!$objS->bind($default2)) { App::redirect(Route::url('index.php?option=com_jobs'), $objS->getError(), 'error'); } if (!$objS->store()) { App::redirect(Route::url('index.php?option=com_jobs'), $objS->getError(), 'error'); } return true; }