• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Workflow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Workflow的典型用法代码示例。如果您正苦于以下问题:PHP Workflow类的具体用法?PHP Workflow怎么用?PHP Workflow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Workflow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: insert

 public function insert()
 {
     $id = parent::insert(true);
     import("@.Workflow.Workflow");
     $workflow = new Workflow($this->workflowAlias);
     $rs = $workflow->doNext($id, null, false, false);
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:7,代码来源:FinanceReceivePlanAction.class.php


示例2: updateReview

 public function updateReview(DB $db, APIRequest $request, APIResponse $response)
 {
     $this->vars->review = new PerformanceReview();
     $this->vars->review->loadById($db, $request->get('reviewId'));
     //validate?
     foreach ($request->post('questions') as $questionId => $answerPost) {
         $answer = new ReviewAnswer();
         if (!$answer->loadOneWhere($db, 'question_id = ? and review_id = ?', [$questionId, $this->vars->review->id])) {
             $answer->questionId = $questionId;
             $answer->reviewId = $this->vars->review->id;
         }
         $answer->text = $answerPost['text'];
         $answer->scale = $answerPost['scale'];
         $answer->store($db);
     }
     if ($_POST['action'] == 'submit') {
         $this->vars->review->submitted = 'yes';
         $this->vars->review->submittedYmdt = gmdate('Y-m-d H:i:s');
         $this->vars->review->submit($db);
         $updater = new WorkflowUpdater();
         $workflow = new Workflow();
         $workflow->loadOneWhere($db, 'table_row_id = ? and type = ?', [$this->vars->review->id, 'review']);
         $updater->complete($db, $workflow);
     }
     $response->success();
 }
开发者ID:jlesueur,项目名称:service-examples,代码行数:26,代码来源:ReviewAPI.php


示例3: newWorkflow

 public static function newWorkflow($type)
 {
     $wf = new Workflow();
     $wf->ui_type = $type;
     $wf->save();
     return $wf;
 }
开发者ID:miguel502,项目名称:SocialNetworkIS,代码行数:7,代码来源:Workflow.php


示例4: run

 public function run()
 {
     $bomModel = D("ProduceBoms");
     $stockoutModel = D("Stockout");
     $stockoutDetailModel = D("StockoutDetail");
     $theBoms = $bomModel->where("plan_id=" . $this->mainrowId)->select();
     $stockoutModel->startTrans();
     $theStockout = array("bill_id" => makeBillCode("CK"), "source_id" => $this->mainrowId, "source_model" => "ProducePlan", "dateline" => CTS, "total_num" => 0, "stock_manager" => 0, "shipment_id" => 0, "status" => 0, "memo" => "ProducePlan #" . $this->mainrowId);
     $stockoutId = $stockoutModel->add($theStockout);
     if (!$stockoutId) {
         Log::write("SQL Error:" . $stockoutModel->getLastSql(), Log::SQL);
         $stockoutModel->rollback();
         $this->response(array("type" => "message", "msg" => "Server Error.", "error" => 1));
     }
     $totalNum = 0;
     foreach ($theBoms as $k => $v) {
         $totalNum += $v["num"];
         $theDetail = array("stockout_id" => $stockoutId, "factory_code_all" => $v["factory_code_all"], "goods_id" => $v["goods_id"], "stock_id" => 0, "num" => $v["num"]);
         if (!$stockoutDetailModel->add($theDetail)) {
             //@todo
             Log::write("SQL Error:" . $stockoutModel->getLastSql(), Log::SQL);
             $stockoutModel->rollback();
             $this->response(array("type" => "message", "msg" => "Server Error.", "error" => 1));
         }
     }
     $stockoutModel->where("id=" . $stockoutId)->save(array("total_num" => $totalNum));
     //        echo $stockoutModel->getLastSql();exit;
     $stockoutModel->commit();
     $workflow = new Workflow("stockout");
     $workflow->doNext($stockoutId, false, true, false);
     //        print_r($theBoms);exit;
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:32,代码来源:MakeStockout.class.php


示例5: select

 public function select($options = array())
 {
     $data = parent::select($options);
     if (!$data) {
         return $data;
     }
     foreach ($data as $k => $v) {
         if ($v["stock_manager"]) {
             $data[$k]["stock_manager_name"] = toTruename($v["stock_manager"]);
         } else {
             $data[$k]["stock_manager_name"] = "";
         }
         $data[$k]["sponsor"] = toTruename($v["user_id"]);
         $ids[] = $v["id"];
     }
     //        print_r($data);exit;
     if ($this->workflowAlias) {
         import("@.Workflow.Workflow");
         $workflow = new Workflow($this->workflowAlias);
         $processData = $workflow->getListProcess($ids);
         foreach ($data as $k => $v) {
             $data[$k]["processes"] = $processData[$v[$this->workflowMainRowField]];
         }
     }
     return $data;
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:26,代码来源:StockinViewModel.class.php


示例6: newPlan

 public function newPlan($data)
 {
     $rows = $data["rows"];
     unset($data["rows"]);
     $this->startTrans();
     $id = $this->add($data);
     if (!$id) {
         Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
         $this->rollback();
         return false;
     }
     $detailModel = D("ProducePlanDetail");
     foreach ($rows as $row) {
         $row["plan_id"] = $id;
         $rs = $detailModel->add($row);
         if (!$rs) {
             Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
             $this->rollback();
             return false;
         }
     }
     $this->commit();
     $workflow = new Workflow($this->workflowAlias);
     $workflow->doNext($id, "", true);
     return $id;
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:26,代码来源:ProducePlanModel.class.php


示例7: newBill

 public function newBill($data)
 {
     if (!$data["rows"]) {
         return;
     }
     if (!$this->checkFactoryCodeAll($data["rows"])) {
         $this->error = "factory_code_not_full";
         return false;
     }
     $this->startTrans();
     $purchaseId = $this->add($data);
     if (!$purchaseId) {
         $this->error = "insert purchase bill failed";
         Log::write("SQL Error:" . $this->getLastSql(), Log::SQL);
         $this->rollback();
         return false;
     }
     $detailModel = D("PurchaseDetail");
     foreach ($data["rows"] as $row) {
         $row["purchase_id"] = $purchaseId;
         $row["price"] = $row["amount"];
         if (!$detailModel->add($row)) {
             $this->error = "insert purchase bill detail failed";
             Log::write("SQL Error:" . $detailModel->getLastSql(), Log::SQL);
             $this->rollback();
             return false;
         }
     }
     $this->commit();
     $workflow = new Workflow($this->workflowAlias);
     $workflow->doNext($purchaseId, "", true);
     return $purchaseId;
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:33,代码来源:PurchaseModel.class.php


示例8: run

 public function run()
 {
     DB::table('workflow')->delete();
     $flow = new Workflow();
     $flow->id = '1';
     $flow->workFlowName = 'Small Value Procurement (Below P50,000)';
     $flow->totalDays = '45';
     $flow->save();
     $flow = new Workflow();
     $flow->id = '2';
     $flow->workFlowName = 'Small Value Procurement (Above P50,000 Below P500,000)';
     $flow->totalDays = '120';
     $flow->save();
     $flow = new Workflow();
     $flow->id = '3';
     $flow->workFlowName = 'Bidding (Above P500,000)';
     $flow->totalDays = '200';
     $flow->save();
     $flow = new Workflow();
     $flow->id = '4';
     $flow->workFlowName = 'Pakyaw';
     $flow->totalDays = '200';
     $flow->save();
     $flow = new Workflow();
     $flow->id = '5';
     $flow->workFlowName = 'Direct Contracting';
     $flow->totalDays = '200';
     $flow->save();
 }
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:29,代码来源:WorkflowSeeder.php


示例9: read

 public function read()
 {
     $mainrowId = $_GET["id"];
     $workflowAlias = $_GET["workflowAlias"];
     $modelName = ucfirst($workflowAlias);
     $model = D($modelName);
     $workflow = new Workflow($workflowAlias);
     $process = $workflow->getItemProcesses($modelName, $mainrowId, $model->relationModels);
     $this->response($process);
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:10,代码来源:WorkflowProcessAction.class.php


示例10: makeStepsAndProgressBarViewFromWorkflow

 /**
  * @param Workflow $workflow
  * @return  ByTimeWorkflowStepsAndProgressBarForWizardView|
  *          OnSaveWorkflowStepsAndProgressBarForWizardView
  * @throws NotSupportedException
  */
 public static function makeStepsAndProgressBarViewFromWorkflow(Workflow $workflow)
 {
     $type = $workflow->getType();
     if ($type == Workflow::TYPE_BY_TIME) {
         return new ByTimeWorkflowStepsAndProgressBarForWizardView();
     } elseif ($type == Workflow::TYPE_ON_SAVE) {
         return new OnSaveWorkflowStepsAndProgressBarForWizardView();
     } else {
         throw new NotSupportedException();
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:17,代码来源:WorkflowWizardViewFactory.php


示例11: run

 public function run()
 {
     $stockin = D("Stockin");
     $stockin->where("id=" . $this->mainrowId)->save(array("status" => 2));
     $theStockin = $stockin->find($this->mainrowId);
     if ($theStockin["source_model"]) {
         //若外部生成,走外部下一流程
         $workflow = new Workflow(lcfirst($theStockin["source_model"]), $this->action);
         $workflow->doNext($theStockin["source_id"], "", true, 3);
     }
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:11,代码来源:CompleteProcess.class.php


示例12: run

 public function run()
 {
     $model = D("Stockout");
     $theStockout = $model->find($this->mainrowId);
     $model->where("id=" . $this->mainrowId)->save(array("status" => 2));
     if ($this->context["sourceModel"]) {
         $sourceNode = $this->getNodeByAlias(lcfirst($this->context["sourceModel"]), "Complete");
         $workflow = new Workflow($this->context["sourceWorkflow"], $this->context);
         $workflow->doNext($theStockout["source_id"], $sourceNode["id"], true, 3);
     }
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:11,代码来源:Complete.class.php


示例13: record

 public function record($data)
 {
     $data["create_dateline"] = CTS;
     $data["status"] = 0;
     $data["user_id"] = getCurrentUid();
     $lastId = $this->add($data);
     if (!$lastId) {
         Log::write($this->getLastSql(), Log::SQL);
         return false;
     }
     $workflow = new Workflow("financePay");
     $workflow->doNext($lastId, "", true);
     return $lastId;
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:14,代码来源:FinancePayPlanModel.class.php


示例14: index

 public function index()
 {
     //获取所有节点
     if (!$_GET["mainrow_id"]) {
         return parent::index();
     }
     //仅获取当前数据的下一ID
     //        $map = array();
     //        $this->_filter($map);
     import("@.Workflow.Workflow");
     $workflow = new Workflow($_GET["workflow_alias"]);
     $process = $workflow->getCurrentProcess($_GET["mainrow_id"]);
     $this->response(reIndex($process["nextNode"]));
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:14,代码来源:WorkflowNodeAction.class.php


示例15: run

 public function run()
 {
     $stockout = D("Stockout");
     $stockoutId = $stockout->makeStockoutPaper("Orders", $this->mainrowId, "saler_id", "order_id");
     //流程上下文
     $this->context = array("sourceModel" => "Orders", "sourceWorkflow" => "orders", "sourceId" => $this->mainrowId, "sourceMainrowField" => "order_id");
     $this->updateStatus("Orders", $this->mainrowId, 1);
     //        $orderModel = D("Orders");
     //        $orderModel->where("id=".$this->mainrowId)->save(array("status" => 1));
     //        print_r($this->context);exit;
     //新建出库工作流
     import("@.Workflow.Workflow");
     $workflow = new Workflow("stockout", $this->context);
     $workflow->doNext($stockoutId, "", true, true);
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:15,代码来源:MakeStockoutPaper.class.php


示例16: __construct

 public function __construct(Tracker_RulesManager $global_rules_manager, Tracker_Workflow_Trigger_RulesManager $trigger_rules_manager, WorkflowBackendLogger $logger, $tracker_id)
 {
     $workflow_id = 0;
     $field_id = 0;
     $is_used = false;
     parent::__construct($global_rules_manager, $trigger_rules_manager, $logger, $workflow_id, $tracker_id, $field_id, $is_used);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:WorkflowWithoutTransition.class.php


示例17: generar_arbol_descendientes_sobre_grafo

 function generar_arbol_descendientes_sobre_grafo($grafo)
 {
     if (is_null($this->siguiente_caso_true) || is_null($this->siguiente_caso_false)) {
         throw new Exception("Error al dibujar arbol, este choice node no tiene siguientes!.");
     }
     $nombre_partida = "{$this->name}\\n({$this->accion})";
     if (!empty($this->siguiente_caso_true)) {
         $siguiente_caso_true = Workflow::obtener_nodo($this->siguiente_caso_true);
         $nombre_llegada_true = "{$siguiente_caso_true->name}\\n({$siguiente_caso_true->accion})";
     } else {
         $nombre_llegada_true = 'Ejecución Terminada';
     }
     if (!empty($this->siguiente_caso_false)) {
         $siguiente_caso_false = Workflow::obtener_nodo($this->siguiente_caso_false);
         $nombre_llegada_false = "{$siguiente_caso_false->name}\\n({$siguiente_caso_false->accion})";
     } else {
         $nombre_llegada_false = 'Ejecución Terminada';
     }
     $nombre_partida = "{$this->name}\\n({$this->accion})";
     $grafo->agregar($nombre_partida, $nombre_llegada_true, "VERDADERO", '#9ac836', 'octagon', 'ne');
     $grafo->agregar($nombre_partida, $nombre_llegada_false, "FALSO", '#ff9c00', 'octagon', 'se');
     if (!$grafo->existe_nodo_salida($nombre_llegada_true)) {
         $siguiente_caso_true->generar_arbol_descendientes_sobre_grafo($grafo);
     }
     if (!$grafo->existe_nodo_salida($nombre_llegada_false)) {
         $siguiente_caso_false->generar_arbol_descendientes_sobre_grafo($grafo);
     }
 }
开发者ID:dinhquyet92,项目名称:sugarcrm_advanced_workflows,代码行数:28,代码来源:ChoiceNode.php


示例18: init

 public static function init($query = null)
 {
     self::$query = $query;
     $dataDir = $_SERVER['HOME'] . '/Library/Application Support/Alfred 2/Workflow Data/' . self::BUNDLE;
     if (!is_dir($dataDir)) {
         mkdir($dataDir);
     }
     self::$fileCookies = $dataDir . '/cookies';
     $fileDb = $dataDir . '/db.sqlite';
     $exists = file_exists($fileDb);
     self::$db = new PDO('sqlite:' . $fileDb, null, null, array(PDO::ATTR_PERSISTENT => true));
     if (!$exists) {
         self::$db->exec('
             CREATE TABLE config (
                 key TEXT PRIMARY KEY,
                 value TEXT
             )
         ');
         self::$db->exec('
             CREATE TABLE request_cache (
                 url TEXT PRIMARY KEY,
                 timestamp INTEGER,
                 etag TEXT,
                 content TEXT,
                 refresh INTEGER
             )
         ');
     }
     register_shutdown_function(array(__CLASS__, 'shutdown'));
 }
开发者ID:jesseflorig,项目名称:config,代码行数:30,代码来源:workflow.php


示例19: add

 /**
  * Adds an email to the outgoing mail queue.
  *
  * @param   string $recipient The recipient of this email
  * @param   array $headers The list of headers that should be sent with this email
  * @param   string $body The body of the message
  * @param   integer $save_email_copy Whether to send a copy of this email to a configurable address or not (eventum_sent@)
  * @param   integer $issue_id The ID of the issue. If false, email will not be associated with issue.
  * @param   string $type The type of message this is.
  * @param   integer $sender_usr_id The id of the user sending this email.
  * @param   integer $type_id The ID of the event that triggered this notification (issue_id, sup_id, not_id, etc)
  * @return  true, or a PEAR_Error object
  */
 public static function add($recipient, $headers, $body, $save_email_copy = 0, $issue_id = false, $type = '', $sender_usr_id = false, $type_id = false)
 {
     Workflow::modifyMailQueue(Auth::getCurrentProject(false), $recipient, $headers, $body, $issue_id, $type, $sender_usr_id, $type_id);
     // avoid sending emails out to users with inactive status
     $recipient_email = Mail_Helper::getEmailAddress($recipient);
     $usr_id = User::getUserIDByEmail($recipient_email);
     if (!empty($usr_id)) {
         $user_status = User::getStatusByEmail($recipient_email);
         // if user is not set to an active status, then silently ignore
         if (!User::isActiveStatus($user_status) && !User::isPendingStatus($user_status)) {
             return false;
         }
     }
     $to_usr_id = User::getUserIDByEmail($recipient_email);
     $recipient = Mail_Helper::fixAddressQuoting($recipient);
     $reminder_addresses = Reminder::_getReminderAlertAddresses();
     // add specialized headers
     if (!empty($issue_id) && (!empty($to_usr_id) && User::getRoleByUser($to_usr_id, Issue::getProjectID($issue_id)) != User::getRoleID('Customer')) || @in_array(Mail_Helper::getEmailAddress($recipient), $reminder_addresses)) {
         $headers += Mail_Helper::getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id);
     }
     // try to prevent triggering absence auto responders
     $headers['precedence'] = 'bulk';
     // the 'classic' way, works with e.g. the unix 'vacation' tool
     $headers['Auto-submitted'] = 'auto-generated';
     // the RFC 3834 way
     if (empty($issue_id)) {
         $issue_id = 'null';
     }
     // if the Date: header is missing, add it.
     if (empty($headers['Date'])) {
         $headers['Date'] = Mime_Helper::encode(date('D, j M Y H:i:s O'));
     }
     if (!empty($headers['To'])) {
         $headers['To'] = Mail_Helper::fixAddressQuoting($headers['To']);
     }
     // encode headers and add special mime headers
     $headers = Mime_Helper::encodeHeaders($headers);
     $res = Mail_Helper::prepareHeaders($headers);
     if (Misc::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return $res;
     }
     // convert array of headers into text headers
     list(, $text_headers) = $res;
     $params = array('maq_save_copy' => $save_email_copy, 'maq_queued_date' => Date_Helper::getCurrentDateGMT(), 'maq_sender_ip_address' => !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'maq_recipient' => $recipient, 'maq_headers' => $text_headers, 'maq_body' => $body, 'maq_iss_id' => $issue_id, 'maq_subject' => $headers['Subject'], 'maq_type' => $type);
     if ($sender_usr_id) {
         $params['maq_usr_id'] = $sender_usr_id;
     }
     if ($type_id) {
         $params['maq_type_id'] = $type_id;
     }
     $stmt = 'INSERT INTO {{%mail_queue}} SET ' . DB_Helper::buildSet($params);
     try {
         DB_Helper::getInstance()->query($stmt, $params);
     } catch (DbException $e) {
         return $res;
     }
     return true;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:72,代码来源:class.mail_queue.php


示例20: renderNonEditableModuleStringContent

 /**
  * @param $moduleClassName
  * @return null | string
  */
 public static function renderNonEditableModuleStringContent($moduleClassName)
 {
     assert('is_string($moduleClassName)');
     $modulesAndLabels = Workflow::getWorkflowSupportedModulesAndLabelsForCurrentUser();
     if (isset($modulesAndLabels[$moduleClassName])) {
         return $modulesAndLabels[$moduleClassName];
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:WorkflowUtil.php



注:本文中的Workflow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Writer类代码示例发布时间:2022-05-23
下一篇:
PHP Worker类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap