Exemplo n.º 1
0
 /**
  *
  * @param PMSEObservable $subject
  * @return type
  */
 public function update($subject)
 {
     if (method_exists($subject, 'getProcessDefinition')) {
         $this->logger->debug("Trigger update of a Related Relationship for a Process Definitions update");
         $processDefinition = $subject->getProcessDefinition();
         $processDefinitionData = $processDefinition->fetched_row;
         $fields = array('id', 'rel_element_type');
         $relatedDependency = $this->getRelatedDependencyBean();
         $this->sugarQuery->select($fields);
         $this->sugarQuery->from($relatedDependency);
         $this->sugarQuery->where()->queryAnd()->addRaw("pro_id='{$processDefinitionData['id']}' AND prj_id='{$processDefinitionData['prj_id']}' AND deleted=0");
         $result = $this->sugarQuery->compileSql();
         $this->logger->debug("Retrieve dependencies query: {$result}");
         $rows = $this->sugarQuery->execute();
         foreach ($rows as $row) {
             $bean = $this->getRelatedDependencyBean($row['id']);
             $bean->pro_status = $processDefinitionData['pro_status'];
             $bean->pro_locked_variables = $processDefinitionData['pro_locked_variables'];
             $bean->pro_terminate_variables = $processDefinitionData['pro_terminate_variables'];
             if ($bean->pro_module !== $processDefinitionData['pro_module'] && $row['rel_element_type'] == 'TERMINATE') {
                 $bean->deleted = true;
             }
             $bean->save();
         }
         $this->processRelatedDependencies($processDefinitionData);
         $depNumber = count($rows);
         $this->logger->debug("Updating {$depNumber} dependencies");
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  *
  * @access public
  * @since unknown
  * @param type $value
  * @return type 
  */
 public function findByPrimaryKey($value)
 {
     $this->daoMetadata->select($this->getFields());
     $this->daoMetadata->from($this->getTableName());
     $this->daoMetadata->like('s_site', $value, 'both');
     $result = $this->daoMetadata->get();
     if ($result == false) {
         return array();
     }
     return $result->row();
 }
Exemplo n.º 3
0
 /**
  * Method to validate whether a case been claimed
  * @param $casID
  * @param $casIndex
  * @return object
  */
 public function validateReclaimCase($casID, $casIndex)
 {
     //TODO Review functionality
     $res = array();
     //new stdClass();
     $res['success'] = true;
     $res['result'] = false;
     //$caseBean = new BpmInbox();
     $caseBean = $this->getInboxBean();
     $this->sugarQueryObject->select(array('a.cas_id'));
     $this->sugarQueryObject->from($caseBean, array('alias' => 'a'));
     $this->sugarQueryObject->joinRaw("LEFT JOIN pmse_bpm_flow b ON (a.cas_id = b.cas_id)", array('alias' => 'b'));
     $this->sugarQueryObject->where()->queryAnd()->addRaw("b.cas_id = {$casID} and a.cas_index = {$casIndex}");
     $rows = $this->sugarQueryObject->execute();
     $caseData = $rows[0];
     $res['message'] = translate('LBL_PMSE_LABEL_ERROR_INVALIDCLAIM', 'pmse_Project');
     if ($caseData['cas_start_date'] == '') {
         $res['result'] = true;
     }
     return $res;
 }
Exemplo n.º 4
0
 /**
  * 获取主题分页数据
  * @param type $dtparser datatable类库
  */
 public function theme_page_data($dtparser)
 {
     $cols = array('`theme`.`id`', '`theme`.`name`', '`theme`.`status`', 'IF(`gift_book`.`id`IS NULL,0,COUNT(DISTINCT(`gift_book`.`id`))) AS `num`', '`theme`.`remark`');
     $sort_cols = array('4' => '`num`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_theme_tb);
     $dtparser->join('`gift_management`.`gift_book`', 'gift_book.theme_id=theme.id', 'left');
     $group = array('`theme`.`id`');
     //条件
     $cwhere = $this->get_theme_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count_group($group, $cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get_group($group, $cwhere);
         $arr = $query->result_array();
         $this->ajax_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 5
0
 /**
  * 获取商品分页数据
  * @param type $dtparser datatable类库
  */
 public function giftbook_page_data($dtparser)
 {
     $cols = $this->_giftbook_page_cols();
     $sort_cols = array('7' => '`goods_num`');
     $filter_cols = array();
     $goup_by = array('`gift_book`.`id`');
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_giftbook_tb);
     $dtparser->join('`gift_management`.`theme`', 'theme.id=gift_book.theme_id', 'left');
     $dtparser->join('`gift_management`.`set`', 'set.id=gift_book.set_id', 'left');
     $dtparser->join('`gift_management`.`book_goods_mapping`', 'book_goods_mapping.gift_book_id=gift_book.id', 'left');
     //条件
     $cwhere = $this->get_giftbook_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count_group($goup_by, $cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get_group($goup_by, $cwhere);
         $arr = $query->result_array();
         $this->ajax_giftbook_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 6
0
 /**
  * 获取商品分页数据
  * @param type $dtparser datatable类库
  */
 public function goods_page_data($dtparser)
 {
     $cols = $this->_goods_page_cols();
     $sort_cols = array('0' => '`gift`.`ctime`', '4' => '`gift`.`store_num`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_goods_tb);
     $dtparser->join('`gift_management`.`gift_brand`', 'gift_brand.id=gift.brand_id', 'left');
     $dtparser->join('`gift_management`.`gift_classify`', 'gift_classify.id=gift.classify_id', 'left');
     $dtparser->join('`gift_management`.`gift_supply`', 'gift_supply.id=gift.supply_id', 'left');
     //条件
     $cwhere = $this->get_goods_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count($cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get($cwhere);
         $arr = $query->result_array();
         $this->ajax_goods_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 7
0
 /**
  * 礼品卡开卡列表
  * @param type $dtparser
  * @return type
  */
 public function giftcard_order_list_page_data($dtparser)
 {
     $cols = array('`card_order`.`id`', '`card_order`.`trade_date`', '`user`.`nick_name` as `sales`', '`customer`.`name` as `customer`', '`card_order`.`contact_person`', '`card_order`.`order_name`', '`card_order`.`price`', '`card_order`.`pay_status`', '`card_order`.`pay_remark`', '`card_order`.`remark`', '`card_order`.`trade_date`', '`card_order`.`wechat_id`', '`card_order`.`custom_id`', '`card_order`.`sales_id`', '`card_order`.`end_user`', '`card_order`.`modify_user`');
     $sort_cols = array('6' => '`price`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_card_order_tb);
     $dtparser->join('`gift_management`.`user`', 'user.id=card_order.sales_id', 'left');
     $dtparser->join('`gift_management`.`customer`', 'customer.id=card_order.custom_id', 'left');
     //条件
     $cwhere = $this->get_giftcard_order_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count($cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get($cwhere);
         $arr = $query->result_array();
         $this->ajax_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 8
0
 /**
  * 获取客户分页数据
  * @param type $dtparser datatable类库
  */
 public function wechat_page_data($dtparser)
 {
     $cols = array('`wechat`.`id`', '`wechat`.`name`', '`wechat`.`style`', '`wechat`.`status`', '`wechat`.`vedio_id`', '`wechat`.`pic_id`', '`wechat`.`audio_id`', '`wechat`.`sender`', '`wechat`.`reciver`', '`wechat`.`remark`', '`wechat`.`copywriter`');
     $sort_cols = array('4' => '`wechat`.`status`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_wechat_tb);
     //条件
     $cwhere = $this->get_wechat_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count($cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get($cwhere);
         $arr = $query->result_array();
         $this->ajax_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 9
0
 /**
  * 获取客户分页数据
  * @param type $dtparser datatable类库
  */
 public function website_page_data($dtparser)
 {
     $cols = array('`website`.`id`', '`website`.`name`', '`website`.`status`', '`website`.`type`', '`website`.`hotline`', '`website`.`qq`', '`website`.`expire_date`', '`website`.`domain`');
     $sort_cols = array('4' => '`website`.`status`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_website_tb);
     //条件
     $cwhere = $this->get_website_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count($cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get($cwhere);
         $arr = $query->result_array();
         $this->ajax_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }
Exemplo n.º 10
0
 /**
  * 获取客户分页数据
  * @param type $dtparser datatable类库
  */
 public function customer_page_data($dtparser)
 {
     $cols = array('`customer`.`id`', '`customer`.`name`', '`customer`.`status`', '`customer`.`type`', '`customer`.`contact_person`', '`customer`.`phone`', '`customer`.`address`', '`customer`.`status`');
     $sort_cols = array('4' => '`customer`.`status`');
     $filter_cols = array();
     //查询主表
     $dtparser->select($cols, $sort_cols, $filter_cols, FALSE);
     $dtparser->from($this->_customer_tb);
     //条件
     $cwhere = $this->get_customer_page_where();
     $d['code'] = 0;
     $d['iTotal'] = 0;
     $d['iFilteredTotal'] = 0;
     $d['aaData'] = array();
     if ($d['code'] == 0) {
         $d['iTotal'] = $dtparser->count($cwhere);
         $d['iFilteredTotal'] = $d['iTotal'];
         $query = $dtparser->get($cwhere);
         $arr = $query->result_array();
         $this->ajax_list_table_data($arr);
         $d['aaData'] = $arr;
     }
     return $d;
 }