Пример #1
0
 protected function initModels()
 {
     $this->Offer = new ecommerce_offer();
     $this->Offer_Group = new ecommerce_offer_group();
     $this->Taxonomy = new common_taxonomy();
     $this->Price = new ecommerce_price();
     $this->conf = ecommerce_offer::initConfiguration();
 }
Пример #2
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //dropdowns
     $Offer_Group = new ecommerce_offer_group();
     $Taxonomy = new common_taxonomy();
     $conf = ecommerce_offer::initConfiguration();
     $groups_in_progress = $Offer_Group->listing("schedule_start <= NOW() AND (schedule_end IS NULL OR schedule_end >= NOW())", "id DESC");
     $groups_scheduled = $Offer_Group->listing("schedule_start > NOW()", "id DESC");
     $groups_past = $Offer_Group->listing("(schedule_start < NOW() OR schedule_start IS NULL) AND schedule_end IS NOT NULL AND schedule_end < NOW()", "id DESC");
     $campaign_categories = $Taxonomy->getChildren($conf['campaign_category_parent_id']);
     $roundel_categories = $Taxonomy->getChildren($conf['roundel_category_parent_id']);
     $this->parseOffersSelectGroup($groups_in_progress, 'In Progress', $this->node_data['component']['offer_group_id']);
     $this->parseOffersSelectGroup($groups_scheduled, 'Scheduled', $this->node_data['component']['offer_group_id']);
     $this->parseOffersSelectGroup($groups_past, 'Past', $this->node_data['component']['offer_group_id']);
     $this->parseCategorySelect($campaign_categories, $this->node_data['component']['campaign_category_id'], 'campaign_category_item');
     $this->parseCategorySelect($roundel_categories, $this->node_data['component']['roundel_category_id'], 'roundel_category_item');
     $this->parseTemplatesSelect($this->node_data['component']['template']);
 }