コード例 #1
0
ファイル: Cron.php プロジェクト: par-orillonsoft/magento_work
 /**
  * Run cron jobs
  * @return
  */
 public function process()
 {
     if (!self::$isRun) {
         self::$isCronSession = 1;
         if (!self::cleanState()) {
             self::processTodaySubscriptions();
         }
         self::processAlerts();
         self::markExpiredSubscriptions();
         self::$isRun = 1;
         self::$isCronSession = 0;
     }
 }
コード例 #2
0
 public function payAction()
 {
     $subscriptionId = $this->getRequest()->getParam('id');
     $sequenceId = $this->getRequest()->getParam('seq');
     $subscription = Mage::getModel('sarp/subscription')->load($subscriptionId);
     $sequence = Mage::getModel('sarp/sequence')->load($sequenceId);
     AW_Sarp_Model_Cron::$isCronSession = 1;
     try {
         $subscription->payBySequence($sequence);
     } catch (Exception $e) {
         Mage::getSingleton('adminhtml/session')->addError($this->__('Sequence can not be paid: %s', $e->getMessage()));
     }
     AW_Sarp_Model_Cron::$isCronSession = 0;
     $this->_redirectReferer();
 }
コード例 #3
0
 public function payAction()
 {
     $subscriptionId = $this->getRequest()->getParam('id');
     $sequenceId = $this->getRequest()->getParam('seq');
     $subscription = Mage::getModel('sarp/subscription')->load($subscriptionId);
     $sequence = Mage::getModel('sarp/sequence')->load($sequenceId);
     $dateForPay = new Zend_Date($sequence->getDate(), AW_Sarp_Model_Subscription::DB_DATE_FORMAT);
     $dateForPayLoc = Mage::app()->getLocale()->date($dateForPay);
     $diff = (int) $dateForPayLoc->toString('X');
     $dateForPay->subSecond($diff);
     AW_Sarp_Model_Cron::$isCronSession = 1;
     $subscription->payForDate($dateForPay);
     AW_Sarp_Model_Cron::$isCronSession = 0;
     $this->_redirectReferer();
 }