本文整理汇总了PHP中projects::getProjectByOfferId方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::getProjectByOfferId方法的具体用法?PHP projects::getProjectByOfferId怎么用?PHP projects::getProjectByOfferId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::getProjectByOfferId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionNewProjectOrder
/**
* Cоздание заказа на базе проекта.
*/
public function actionNewProjectOrder()
{
//@todo: на период разработки резерва заказов
if (!tservices_helper::isAllowOrderReserve()) {
$this->missingAction(null);
}
$offer_id = __paramInit('int', 'offer_id', 'offer_id', null);
$projects = new projects();
$projectData = $projects->getProjectByOfferId($offer_id, $this->uid);
if (!$projectData) {
$this->missingAction(null);
}
$freelancer = new freelancer();
$freelancer->GetUserByUID($projectData['frl_id']);
if ($freelancer->uid <= 0) {
$this->missingAction(null);
}
$form = new NewOrderForm();
$form->setDefaults(array('title' => addslashes(htmlspecialchars_decode($projectData['name'], ENT_QUOTES)), 'description' => addslashes(htmlspecialchars_decode($projectData['descr'], ENT_QUOTES)), 'order_price' => $projectData['currency'] == 2 ? $projectData['cost'] : ''));
if (isset($_POST) && sizeof($_POST) > 0 && $form->isValid($_POST)) {
$data = $form->getValues();
$data['frl_id'] = $freelancer->uid;
$data['emp_id'] = $this->uid;
$data['tu_id'] = $projectData['id'];
if ($order = $this->order_model->createFromProject($data)) {
$projects->SetExecutor($projectData['id'], $projectData['frl_id'], $projectData['user_id']);
$tservices_smail = new tservices_smail();
$tservices_smail->newOrder($order);
$this->redirect(sprintf(tservices_helper::url('order_card_url'), $order['id']));
}
}
//Выводим в сайдбар виджет индикатор статуса заказа
$this->getClips()->add('sidebar', $this->widget('OrderStatusIndicator', array(), true));
$this->render('new-order-form', array('title' => 'Новый заказ по проекту', 'submit_title' => 'Выбрать исполнителем и предложить заказ', 'cansel_url' => getFriendlyURL('project', $projectData), 'form' => $form, 'freelancer' => $freelancer));
}