Application->RecallVar('CoupLastCloneCount'); if (!$clone_count){ $clone_count = 1; } return $clone_count; } function DefaultExpDate($params) { $object = &$this->Application->recallObject($this->getPrefixSpecial()); $formatter =& $this->Application->makeClass('kDateFormatter'); return $formatter->Format( adodb_mktime() + $this->Application->ConfigValue('Comm_DefaultCouponDuration') * 3600 * 24, 'Expiration_date', $object); } function DefaultExpTime($params) { $object = &$this->Application->recallObject($this->getPrefixSpecial()); $formatter =& $this->Application->makeClass('kDateFormatter'); return $formatter->Format( adodb_mktime() + $this->Application->ConfigValue('Comm_DefaultCouponDuration') * 3600 * 24, 'Expiration_time', $object); } function HasOrder($params) { if ($this->IsNewItem($params)) { return 0; } $object =& $this->getObject($params); $sql = 'SELECT COUNT(OrderId) FROM '.TABLE_PREFIX.'Orders WHERE GiftCertificateId = '.$object->GetID(); return $this->Conn->GetOne($sql); } /** * Print link for gift certificate (admin only) * * @param Array $params */ function PrintLink($params) { $params[$this->getPrefixSpecial().'_id'] = $this->Application->RecallVar('print_certificate_id'); $this->Application->RemoveVar('print_certificate_id'); $main_processor =& $this->Application->recallTagProcessor('m'); /* @var $main_processor kMainTagProcessor */ return $main_processor->Link($params); } } ?>