예제 #1
0
 function save($module)
 {
     global $app_strings;
     global $product_seqprefix;
     if ($this->column_fields['productcode'] == $app_strings["AUTO_GEN_CODE"] || $this->column_fields['productcode'] == '') {
         $this->column_fields['productcode'] = $product_seqprefix . $this->get_next_id();
     }
     if (isset($_SESSION['import_overwrite2']) && $_SESSION['import_overwrite2'] == 1) {
         if (!empty($this->column_fields['productcode'])) {
             $where_clause = " and ec_products.productcode='" . trim($this->column_fields['productcode']) . "' ";
             $query = "SELECT ec_products.productid FROM ec_products where ec_products.deleted=0 {$where_clause}";
             $result =& $this->db->query($query, false, "Retrieving record {$where_clause}");
             if ($this->db->getRowCount($result) >= 1) {
                 /*$productid = $this->db->query_result($result,0,"productid");
                 		$this->id = $productid;
                 		$this->mode = 'edit';
                 		CRMEntity::save($module);*/
             } else {
                 $this->id = "";
                 $this->mode = '';
                 CRMEntity::save($module);
             }
         }
     } else {
         $this->id = "";
         $this->mode = '';
         CRMEntity::save($module);
     }
     $this->ClearColumnFields();
 }
예제 #2
0
 function save($module)
 {
     $this->id = "";
     $this->mode = '';
     CRMEntity::save($module);
 }
예제 #3
0
 function save($module)
 {
     global $adb;
     if ($this->mode == 'edit') {
         $rs = $adb->pquery('select sales_stage from vtiger_potential where potentialid = ?', array($this->id));
         $this->sales_stage = $adb->query_result($rs, 0, 'sales_stage');
     }
     parent::save($module);
 }