/** * Checks whether plugin.tx_seminars.currency is not empty and a valid ISO * 4217 alpha 3. * * @return void */ public function checkCurrency() { $this->checkIfSingleInSetNotEmpty('currency', FALSE, '', 'The specified currency setting is either empty or not a valid ' . 'ISO 4217 alpha 3 code. Please correct the value of <strong>' . $this->getTSSetupPath() . 'currency</strong>.', tx_oelib_db::selectColumnForMultiple('cu_iso_3', 'static_currencies')); }
/** * Limits the bag to events which have a price higher or equal to the given * minimum price. * * @param int $minimumPrice * the minimum price an event is allowed to cost, must * be >= 0 * * @return void */ public function limitToMinimumPrice($minimumPrice) { if ($minimumPrice == 0) { return; } $now = $GLOBALS['SIM_EXEC_TIME']; $whereClause = '(object_type = ' . tx_seminars_Model_Event::TYPE_TOPIC . ' OR ' . 'object_type = ' . tx_seminars_Model_Event::TYPE_COMPLETE . ') AND (' . '(deadline_early_bird < ' . $now . ' ' . 'AND (price_regular >= ' . $minimumPrice . ' ' . 'OR price_special >= ' . $minimumPrice . ')' . ') OR (deadline_early_bird > ' . $now . ' ' . 'AND ((' . '(price_regular_early = 0 ' . 'AND price_regular >= ' . $minimumPrice . ') ' . 'OR (price_special_early = 0 ' . 'AND price_special >= ' . $minimumPrice . ')) ' . 'OR (price_regular_early >= ' . $minimumPrice . ' ' . 'OR price_special_early >= ' . $minimumPrice . ') ' . ')) ' . 'OR price_regular_board >= ' . $minimumPrice . ' ' . 'OR price_special_board >= ' . $minimumPrice . ') ' . tx_oelib_db::enableFields('tx_seminars_seminars'); $foundUids = implode(',', tx_oelib_db::selectColumnForMultiple('uid', 'tx_seminars_seminars', $whereClause)); if ($foundUids == '') { $this->whereClauseParts['maximumPrice'] = '(0 = 1)'; } else { $this->whereClauseParts['maximumPrice'] = '((object_type = ' . tx_seminars_Model_Event::TYPE_COMPLETE . ' ' . 'AND tx_seminars_seminars.uid IN (' . $foundUids . ')) OR ' . '(object_type = ' . tx_seminars_Model_Event::TYPE_DATE . ' AND ' . 'topic IN (' . $foundUids . ')))'; } }