function configure()
 {
     parent::configure();
     $this->useFields(array('id'));
     $this->embedRelation('Member', 'MemberRightsForm');
     $this->addSaveManyToMany(array('Member'), array('group_list' => 'Group'));
     foreach ($this['Member'] as $key => $value) {
         $this->widgetSchema['Member'][$key]->setLabel(false);
     }
     $this->widgetSchema['Member']->setLabel('Member rights');
 }
 function adminaddAction()
 {
     $this->view->title = "Add New Campaign";
     $form = new CampaignForm();
     $campaign_db = new Campaign();
     $form->submit->setLabel($this->view->translate('Add'));
     $this->view->form = $form;
     $currentTime = date("Y-m-d H:i:s");
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         if ($form->isValid($formData)) {
             $campaign = new Campaign();
             $row = $campaign->createRow();
             $row->name = $form->getValue('name');
             $row->company = $form->getValue('company');
             $row->i2_survey_id = $form->getValue("i2_survey_id");
             $row->expire_date = $form->getValue("expire_date");
             $row->pre_campaign_survey = $form->getValue("pre_campaign_survey");
             $row->post_campaign_survey = $form->getValue("post_campaign_survey");
             $row->i2_survey_id_en = $form->getValue("i2_survey_id");
             $row->pre_campaign_survey_en = $form->getValue("pre_campaign_survey");
             $row->post_campaign_survey_en = $form->getValue("post_campaign_survey");
             $row->product_name = $form->getValue('product_name');
             $row->product_name_en = $form->getValue('product_name');
             $row->simple_description = $form->getValue('simple_description');
             $row->simple_description_en = $form->getValue('simple_description');
             $row->invitation_description = $form->getValue("invitation_description");
             $row->invitation_description_en = $form->getValue("invitation_description");
             $row->invitation_image_name = $form->getValue('invitation_image_name');
             $row->invitation_description2 = $form->getValue('invitation_description2');
             $row->invitation_description2_en = $form->getValue('invitation_description2');
             $row->pre_campaign_intro = $form->getValue('pre_campaign_intro');
             $row->pre_campaign_intro_en = $form->getValue('pre_campaign_intro');
             $row->thanks_for_post_campaign_survey = $form->getValue("thanks_for_post_campaign_survey");
             $row->thanks_for_post_campaign_survey_en = $form->getValue("thanks_for_post_campaign_survey");
             $row->thanks_for_post_campaign_survey_content = $form->getValue("thanks_for_post_campaign_survey_content");
             $row->thanks_for_post_campaign_survey_content_en = $form->getValue("thanks_for_post_campaign_survey_content");
             $row->post_survey_notice = $form->getValue("post_survey_notice");
             $row->post_survey_notice_en = $form->getValue("post_survey_notice");
             $row->pre_campaign_info = $form->getValue("pre_campaign_info");
             $row->pre_campaign_info_en = $form->getValue("pre_campaign_info");
             $row->pre_campaign_thankyou = $form->getValue('pre_campaign_thankyou');
             $row->pre_campaign_thankyou_en = $form->getValue('pre_campaign_thankyou');
             $row->pre_campaign_friends = $form->getValue('pre_campaign_friends');
             $row->pre_campaign_friends_en = $form->getValue('pre_campaign_friends');
             $row->create_date = $currentTime;
             $row->save();
             $id = $row->id;
             $fileName_1 = "campaign_" . $id . "_01.jpg";
             $fileName_2 = "campaign_" . $id . "_02.jpg";
             $fileName_3 = "campaign_" . $id . "_03.jpg";
             $fileName_4 = "campaign_" . $id . "_04.jpg";
             $fileName_5 = "campaign_" . $id . "_side.jpg";
             $fileName_6 = "campaign_invitation_tab_en_" . $id . ".jpg";
             $config = Zend_Registry::get('config');
             $form->photo_one->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_1, 'overwrite' => true));
             $form->photo_two->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_2, 'overwrite' => true));
             $form->photo_three->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_3, 'overwrite' => true));
             $form->photo_four->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_4, 'overwrite' => true));
             $form->photo_five->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_5, 'overwrite' => true));
             $form->photo_six->addFilter('Rename', array('target' => PUBLIC_PATH . '/images/campaign/' . $fileName_6, 'overwrite' => true));
             $form->getValue("photo_one");
             $form->getValue("photo_two");
             $form->getValue("photo_three");
             $form->getValue("photo_four");
             $form->getValue("photo_five");
             $form->getValue("photo_six");
             $this->_redirect('campaign/adminindex');
         } else {
             $form->populate($formData);
         }
     }
     $this->_helper->layout->setLayout("layout_admin");
 }
 public function configure()
 {
     parent::configure();
     unset($this['sf_guard_user_list'], $this['data_owner_id']);
 }
 public function configure()
 {
     parent::configure();
     unset($this['data_owner_id']);
 }