Пример #1
0
 * All rights reserved.
 *
 * ATTENTION: This commercial software is intended for exclusive use with SkaDate Dating Software (http://www.skadate.com) and is licensed under SkaDate Exclusive License by Skalfa LLC.
 *
 * Full text of this license can be found at http://www.skadate.com/sel.pdf
 */
Updater::getLanguageService()->importPrefixFromZip(dirname(dirname(dirname(__FILE__))) . DS . 'langs.zip', 'matchmaking');
$example = new OW_Example();
$example->andFieldEqual('name', 'about_my_match');
$matchSection = BOL_QuestionSectionDao::getInstance()->findObjectByExample($example);
if (empty($matchSection)) {
    $matchSection = new BOL_QuestionSection();
    $matchSection->name = 'about_my_match';
    $matchSection->sortOrder = 1;
    $matchSection->isHidden = 0;
    BOL_QuestionSectionDao::getInstance()->save($matchSection);
}
$dbPrefix = OW_DB_PREFIX;
try {
    $sql = "UPDATE `{$dbPrefix}base_question` SET `onJoin` = '1', `required` = '1' WHERE `name` = 'match_age' OR `name`='birthdate'";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "UPDATE `{$dbPrefix}base_question` SET `sectionName` = 'about_my_match', `onEdit` = 0, `onJoin` = 0 WHERE `name` <> 'match_age' AND `name`<>'match_sex' AND `parent` <> '' AND `parent` IS NOT NULL";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "SELECT *  FROM `{$dbPrefix}base_question_section` WHERE `sortOrder` = 0";
    $sectionData = Updater::getDbo()->queryForRow($sql);
Пример #2
0
 public function findBaseSignUpQuestions()
 {
     $sql = " SELECT `question`.* FROM `" . $this->getTableName() . "` as `question`\n\n                    LEFT JOIN  `" . BOL_QuestionSectionDao::getInstance()->getTableName() . "` as `section`\n                            ON ( `question`.`sectionName` = `section`.`name` AND `question`.`sectionName` != '' AND `question`.`sectionName` IS NOT NULL )\n\n                    WHERE `question`.`base` = 1 AND `question`.`onJoin` = '1' AND ( `section`.isHidden IS NULL OR `section`.isHidden = 0 )\n                    ORDER BY IF( `section`.`name` IS NULL, 0, 1 ),  `section`.`sortOrder`, `question`.`sortOrder` ";
     return $this->dbo->queryForList($sql);
 }
Пример #3
0
 public function findMatchQuestionsForUser($userId)
 {
     if ($userId === null) {
         return array();
     }
     if (!OW::getPluginManager()->isPluginActive('skadate')) {
         return array();
     }
     $genderAccTypes = SKADATE_BOL_AccountTypeToGenderService::getInstance()->findAll();
     $lookingForValue = BOL_QuestionService::getInstance()->getQuestionData(array($userId), array('match_sex'));
     $lookingForValues = array();
     foreach ($genderAccTypes as $type) {
         if ($lookingForValue[$userId]['match_sex'] & $type->genderValue) {
             $lookingForValues[] = $type->genderValue;
         }
     }
     if (empty($lookingForValues)) {
         return array();
     }
     $lookingForValues = $this->dbo->mergeInClause($lookingForValues);
     $sql = " SELECT DISTINCT `question`.* FROM `" . BOL_QuestionDao::getInstance()->getTableName() . "` as `question`\n\n                    LEFT JOIN  `" . BOL_QuestionSectionDao::getInstance()->getTableName() . "` as `section`\n                            ON ( `question`.`sectionName` = `section`.`name` AND `question`.`sectionName` != '' AND `question`.`sectionName` IS NOT NULL )\n\n                    LEFT JOIN " . BOL_QuestionToAccountTypeDao::getInstance()->getTableName() . " as `qta` ON ( `question`.`parent` = `qta`.`questionName` )\n\n                    LEFT JOIN `" . SKADATE_BOL_AccountTypeToGenderDao::getInstance()->getTableName() . "` as `atg` ON (`qta`.`accountType` = `atg`.`accountType`)\n\n                    WHERE `question`.`sectionName`='about_my_match' AND `atg`.`genderValue` IN ( {$lookingForValues} )\n\n                    ORDER BY IF( `section`.`name` IS NULL, 0, 1 ),  `section`.`sortOrder`, `question`.`sortOrder` ";
     return $this->dbo->queryForList($sql);
 }
 /**
  * Constructor.
  *
  */
 private function __construct()
 {
     $this->questionsBOL['base'] = array();
     $this->questionsBOL['notBase'] = array();
     $this->questionDao = BOL_QuestionDao::getInstance();
     $this->valueDao = BOL_QuestionValueDao::getInstance();
     $this->dataDao = BOL_QuestionDataDao::getInstance();
     $this->sectionDao = BOL_QuestionSectionDao::getInstance();
     $this->accountDao = BOL_QuestionAccountTypeDao::getInstance();
     $this->accountToQuestionDao = BOL_QuestionToAccountTypeDao::getInstance();
     $this->userService = BOL_UserService::getInstance();
     $this->questionConfigDao = BOL_QuestionConfigDao::getInstance();
     // all available presentations are hardcoded here
     $this->presentations = array(self::QUESTION_PRESENTATION_TEXT => self::QUESTION_VALUE_TYPE_TEXT, self::QUESTION_PRESENTATION_SELECT => self::QUESTION_VALUE_TYPE_SELECT, self::QUESTION_PRESENTATION_TEXTAREA => self::QUESTION_VALUE_TYPE_TEXT, self::QUESTION_PRESENTATION_CHECKBOX => self::QUESTION_VALUE_TYPE_BOOLEAN, self::QUESTION_PRESENTATION_RADIO => self::QUESTION_VALUE_TYPE_SELECT, self::QUESTION_PRESENTATION_MULTICHECKBOX => self::QUESTION_VALUE_TYPE_MULTISELECT, self::QUESTION_PRESENTATION_DATE => self::QUESTION_VALUE_TYPE_DATETIME, self::QUESTION_PRESENTATION_BIRTHDATE => self::QUESTION_VALUE_TYPE_DATETIME, self::QUESTION_PRESENTATION_AGE => self::QUESTION_VALUE_TYPE_DATETIME, self::QUESTION_PRESENTATION_RANGE => self::QUESTION_VALUE_TYPE_TEXT, self::QUESTION_PRESENTATION_URL => self::QUESTION_VALUE_TYPE_TEXT, self::QUESTION_PRESENTATION_PASSWORD => self::QUESTION_VALUE_TYPE_TEXT);
 }