當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Workflow::get_by_alias方法代碼示例

本文整理匯總了PHP中Workflow::get_by_alias方法的典型用法代碼示例。如果您正苦於以下問題:PHP Workflow::get_by_alias方法的具體用法?PHP Workflow::get_by_alias怎麽用?PHP Workflow::get_by_alias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Workflow的用法示例。


在下文中一共展示了Workflow::get_by_alias方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: end

 public function end($type, $order_id)
 {
     parent::load('model', 'work');
     parent::load('model', 'order');
     import('system/share/network/redirect');
     $smarty = parent::load('smarty');
     $work = OrderWork::get_by_order($order_id, $type);
     $workflow = Workflow::get_by_alias($this->available_next_type[$type]);
     if (!$work) {
         $message = sprintf('此訂單的 %s 工作還沒開始', $type);
         HTTPRedirect::flash_to('order/list/' . $workflow->id, $message, $smarty);
     }
     $work->process = 100;
     $work->save();
     Order::set_workflow($order_id, $workflow);
     $message = '此工作已經完成, 將轉入下一工作流程';
     HTTPRedirect::flash_to('order/list/' . $workflow->id, $message, $smarty);
 }
開發者ID:uwitec,項目名稱:mgoa,代碼行數:18,代碼來源:WorkController.php

示例2: publish

 public function publish($order_id)
 {
     AuthPlugins::required($this, '售後經理');
     $workflow = Workflow::get_by_alias('已經上線');
     Order::set_workflow($order_id, $workflow);
     $message = '網站已成功上線, 訂單流程完成';
     HTTPRedirect::flash_to('order/list/' . $workflow->id, $message, $this->smarty);
 }
開發者ID:uwitec,項目名稱:mgoa,代碼行數:8,代碼來源:OrderController.php

示例3: decide_programe

 public function decide_programe($order_id)
 {
     $workflow = Workflow::get_by_alias('程序驗收完成');
     import('system/share/io/filesystem');
     FileSystem::init();
     $http_path = FileSystem::Upload($_FILES['attachment']);
     if (!$_FILES['attachment'] || !$http_path) {
         HTTPRedirect::flash_to('customer', '請您上傳首頁確認書的掃描件', $this->smarty, 'cus_flash_to');
     }
     $order = Order::get_by_id($order_id);
     $order->programe_decide_attachment = $http_path;
     $order->save();
     Order::set_workflow($order_id, $workflow);
     $smarty = parent::load('smarty');
     import('system/share/network/redirect');
     $message = '程序驗收完成,等待客戶付尾款即可上線';
     $flash_to = $userinfo['role']['0']['alias'] == '技術經理' ? 'order/list/' . $workflow->id : 'customer';
     $template = $userinfo['role']['0']['alias'] == '技術經理' ? 'flash_to' : 'cus_flash_to';
     HTTPRedirect::flash_to($flash_to, $message, $smarty, $template);
 }
開發者ID:uwitec,項目名稱:mgoa,代碼行數:20,代碼來源:CustomerController.php

示例4: add_customer

 public function add_customer()
 {
     AuthPlugins::required($this, '客服');
     $smarty = parent::load('smarty');
     $smarty->assign('page_title', '新增訂單');
     if ($this->is_post()) {
         unset($_POST['CSRF_TOKEN']);
         unset($_POST['sub4']);
         $model = parent::load('model', 'order');
         $time_str = sprintf('%s %s:%s', $_POST['subscribe_time'], $_POST['book_hour'], $_POST['book_minu']);
         $_POST['subscribe_time'] = date('Y-m-d H:i', strtotime($time_str));
         try {
             $customer = new Customer();
             $order = new Order();
             foreach ($_POST as $k => $v) {
                 if (isset($customer->{$k})) {
                     $customer->{$k} = trim(htmlspecialchars($v));
                 } else {
                     if (isset($order->{$k})) {
                         $order->{$k} = trim(htmlspecialchars($v));
                     }
                 }
             }
             /*
              * 客戶提供資料
              */
             if ($_FILES['cus_docs']) {
                 import('system/share/io/filesystem');
                 FileSystem::init();
                 $http_path = FileSystem::Upload($_FILES['cus_docs'], false);
                 $customer->docs = $http_path;
             }
             /*
              * 保存客戶信息
              */
             $customer->save();
             /*
              * 取得工作流程ID(訂單狀態)
              */
             $workflow = Workflow::get_by_alias('新增訂單管理');
             /*
              * 新建訂單, 並寫入當前的訂單初始信息
              */
             $order->Customer = $customer;
             $order->Workflow = $workflow;
             /*
              * 客服
              */
             $order->CustomerService = User::current();
             $order->save();
             import('system/share/network/redirect');
             $message = '訂單信息錄入成功, 轉入新增訂單管理頁麵';
             /*
              * 清除訂單列表緩存
              */
             //                $smarty->clearCache('order/list');
             $smarty->clearAllCache();
             HTTPRedirect::flash_to($workflow['action'], $message, $smarty);
         } catch (Doctrine_Query_Exception $e) {
             $smarty->raise('system');
         }
     } else {
         parent::load('form', 'NewCustomer');
         $smarty->display('customer/add');
     }
 }
開發者ID:uwitec,項目名稱:mgoa,代碼行數:66,代碼來源:CustomerController.php


注:本文中的Workflow::get_by_alias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。