Index: branches/5.1.x/core/units/helpers/mod_rewrite_helper.php =================================================================== diff -u -N -r13454 -r13470 --- branches/5.1.x/core/units/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 13454) +++ branches/5.1.x/core/units/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 13470) @@ -1,6 +1,6 @@ Application->RewriteListeners) == 0) { + // not inited OR mod-rewrite url with missing config cache return ; } Index: branches/5.1.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r13454 -r13470 --- branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 13454) +++ branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 13470) @@ -1,6 +1,6 @@ Get('_mod_rw_url_'); if ($this->Application->RewriteURLs() || $rewrite_url) { + // maybe call onafterconfigread here + if (defined('DEBUG_MODE') && $this->Application->isDebugMode()) { $this->Application->Debugger->profileStart('url_parsing', 'Parsing MOD_REWRITE url'); $this->processRewriteURL(); @@ -386,7 +388,9 @@ $module_params['editing_mode'] = ''; } - $env = $this->Application->BuildEnv( $this->Get('t'), $module_params, $passed, false, false ); + $module_params['__URLENCODE__'] = 1; + + $env = $this->Application->BuildEnv( $this->Get('t'), $module_params, $passed, false, false); $this->Set(ENV_VAR_NAME, $env); $_REQUEST['env'] = $_GET['env'] = $env; // for capability with old in-portal code } Index: branches/5.1.x/core/kernel/kbase.php =================================================================== diff -u -N -r13168 -r13470 --- branches/5.1.x/core/kernel/kbase.php (.../kbase.php) (revision 13168) +++ branches/5.1.x/core/kernel/kbase.php (.../kbase.php) (revision 13470) @@ -1,6 +1,6 @@ Application->GetVar('m_lang'); + // don't use GetVar('m_lang') since it's always equals to default language on editing form in admin + $current_language_id = $this->Application->Phrases->LanguageId; + $primary_language_id = $this->Application->GetDefaultLanguageId(); $field_options =& $this->Fields[$field_name]; foreach ($field_option_names as $option_name) { - $field_options[$option_name] = str_replace('%2$s', $language_id, $field_options[$option_name]); + $field_options[$option_name] = str_replace('%2$s', $current_language_id, $field_options[$option_name]); + $field_options[$option_name] = str_replace('%3$s', $primary_language_id, $field_options[$option_name]); } } Index: branches/5.1.x/core/install/upgrades.php =================================================================== diff -u -N -r13393 -r13470 --- branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 13393) +++ branches/5.1.x/core/install/upgrades.php (.../upgrades.php) (revision 13470) @@ -1,6 +1,6 @@ Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + $ml_helper->createFields('phrases'); $ml_helper->createFields('emailevents'); @@ -1428,6 +1430,76 @@ $this->Conn->Query('DROP TABLE IF EXISTS ' . TABLE_PREFIX . 'Phrase'); $this->Conn->Query('RENAME TABLE ' . $temp_table . ' TO ' . TABLE_PREFIX . 'Phrase'); + // refactor StdDestinations table + $sql = 'RENAME TABLE ' . TABLE_PREFIX . 'StdDestinations TO ' . TABLE_PREFIX . 'CountryStates'; + $this->Conn->Query($sql); + + $sql = 'ALTER TABLE ' . TABLE_PREFIX . 'CountryStates + CHANGE DestId CountryStateId INT(11) NOT NULL AUTO_INCREMENT, + CHANGE DestType Type INT(11) NOT NULL DEFAULT \'1\', + CHANGE DestParentId StateCountryId INT(11) NULL DEFAULT NULL, + CHANGE DestAbbr IsoCode CHAR(3) NOT NULL DEFAULT \'\', + CHANGE DestAbbr2 ShortIsoCode CHAR(2) NULL DEFAULT NULL, + DROP INDEX DestType, + DROP INDEX DestParentId, + ADD INDEX (`Type`), + ADD INDEX (StateCountryId)'; + $this->Conn->Query($sql); + + // move country/state translations from Phrase to CountryStates table + $ml_helper->createFields('country-state'); + + for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) { + if (!$ml_helper->LanguageFound($language_id)) { + continue; + } + + $sub_select = ' SELECT l' . $language_id . '_Translation + FROM ' . TABLE_PREFIX . 'Phrase + WHERE Phrase = DestName'; + + $sql = 'UPDATE ' . TABLE_PREFIX . 'CountryStates + SET l' . $language_id . '_Name = (' . $sub_select . ')'; + $this->Conn->Query($sql); + } + + $sql = 'ALTER TABLE ' . TABLE_PREFIX . 'CountryStates + DROP DestName'; + $this->Conn->Query($sql); + + $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Phrase + WHERE Phrase LIKE ' . $this->Conn->qstr('la_country_%') . ' OR Phrase LIKE ' . $this->Conn->qstr('la_state_%'); + $this->Conn->Query($sql); + + // makes configuration values dropdowns use "||" as separator + $custom_field_helper =& $this->Application->recallObject('InpCustomFieldsHelper'); + /* @var $custom_field_helper InpCustomFieldsHelper */ + + $sql = 'SELECT ValueList, VariableName + FROM ' . TABLE_PREFIX . 'ConfigurationAdmin + WHERE ValueList LIKE "%,%"'; + $variables = $this->Conn->GetCol($sql, 'VariableName'); + + foreach ($variables as $variable_name => $value_list) { + $ret = Array (); + $options = $custom_field_helper->GetValuesHash($value_list, ',', false); + + foreach ($options as $option_key => $option_title) { + if (substr($option_key, 0, 3) == 'SQL') { + $ret[] = $option_title; + } + else { + $ret[] = $option_key . '=' . $option_title; + } + } + + $fields_hash = Array ( + 'ValueList' => implode(VALUE_LIST_SEPARATOR, $ret), + ); + + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'ConfigurationAdmin', 'VariableName = ' . $this->Conn->qstr($variable_name)); + } + // save "config.php" in php format, not ini format as before $this->_toolkit->SaveConfig(); } Index: branches/5.1.x/core/units/helpers/language_import_helper.php =================================================================== diff -u -N -r13453 -r13470 --- branches/5.1.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 13453) +++ branches/5.1.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 13470) @@ -1,6 +1,6 @@ _languages as $language_id) { $this->_performUpgrade($language_id, 'phrases', 'PhraseKey', Array ('l%s_Translation')); $this->_performUpgrade($language_id, 'emailevents', 'EventId', Array ('l%s_Subject', 'Headers', 'MessageType', 'l%s_Body')); + $this->_performUpgrade($language_id, 'country-state', 'CountryStateId', Array ('l%s_Name')); } $this->_initImportTables(true); @@ -214,9 +215,7 @@ $phrase_types = explode('|', substr($phrase_types, 1, -1) ); $module_ids = explode('|', substr($module_ids, 1, -1) ); - $phrase_tpl = "\t\t\t".'%s'."\n"; - $event_tpl = "\t\t\t".'%s'."\n"; - $ret = ''."\n"; + $ret = '' . "\n"; $export_fields = $this->_getExportFields(); @@ -263,11 +262,35 @@ } $sql = 'SELECT * - FROM ' . $this->Application->getUnitOption('emailevents','TableName') . ' + FROM ' . $this->Application->getUnitOption('emailevents', 'TableName') . ' WHERE ' . substr($module_sql, 0, -4) . ' AND ' . $limit_where . ' ORDER BY `Event`, `Type`'; $events = $this->Conn->Query($sql, 'EventId'); + // countries + $sql = 'SELECT * + FROM ' . $this->Application->getUnitOption('country-state', 'TableName') . ' + WHERE Type = ' . DESTINATION_TYPE_COUNTRY . ' + ORDER BY `IsoCode`'; + $countries = $this->Conn->Query($sql, 'CountryStateId'); + + // states + $sql = 'SELECT * + FROM ' . $this->Application->getUnitOption('country-state', 'TableName') . ' + WHERE Type = ' . DESTINATION_TYPE_STATE . ' + ORDER BY `IsoCode`'; + $states = $this->Conn->Query($sql, 'CountryStateId'); + + foreach ($states as $state_id => $state_data) { + $country_id = $state_data['StateCountryId']; + + if (!array_key_exists('States', $countries[$country_id])) { + $countries[$country_id]['States'] = Array (); + } + + $countries[$country_id]['States'][] = $state_id; + } + foreach ($languages as $language_id => $language_info) { // language $ret .= "\t" . ''; $replacements = $language_info['FilenameReplacements']; - $ret .= $this->_exportEncoding == 'base64' ? base64_encode($replacements) : ''; - $ret .= '' . "\n"; + if ($replacements) { + $ret .= "\t\t" . ''; + $ret .= $this->_exportEncoding == 'base64' ? base64_encode($replacements) : ''; + $ret .= '' . "\n"; + } + // phrases if ($phrases) { $ret .= "\t\t" . '' . "\n"; @@ -296,8 +322,9 @@ } $data = $this->_exportEncoding == 'base64' ? base64_encode($translation) : ''; - $ret .= sprintf($phrase_tpl, $phrase['Phrase'], $phrase['Module'], $phrase['PhraseType'], $data); + $ret .= "\t\t\t" . '' . $data . '' . "\n"; } + $ret .= "\t\t" . '' . "\n"; } @@ -320,12 +347,49 @@ } $data = $this->_exportEncoding == 'base64' ? base64_encode($template) : ''; - $ret .= sprintf($event_tpl, $event['MessageType'], $event['Event'], $event['Type'], $data); + $ret .= "\t\t\t" . '' . $data . ''."\n"; } $ret .= "\t\t" . '' . "\n"; } + if ($countries) { + $ret .= "\t\t" . '' . "\n"; + foreach ($countries as $country_id => $country_data) { + $translation = $country_data['l' . $language_id . '_Name']; + + if (!$translation) { + // country is not translated on given language + continue; + } + + $data = $this->_exportEncoding == 'base64' ? base64_encode($translation) : $translation; + + if (array_key_exists('States', $country_data)) { + $ret .= "\t\t\t" . '' . "\n"; + + foreach ($country_data['States'] as $state_id) { + $translation = $states[$state_id]['l' . $language_id . '_Name']; + + if (!$translation) { + // state is not translated on given language + continue; + } + + $data = $this->_exportEncoding == 'base64' ? base64_encode($translation) : $translation; + $ret .= "\t\t\t\t" . '' . "\n"; + } + + $ret .= "\t\t\t" . '' . "\n"; + } + else { + $ret .= "\t\t\t" . '' . "\n"; + } + } + + $ret .= "\t\t" . '' . "\n"; + } + $ret .= "\t" . '' . "\n"; } @@ -515,6 +579,7 @@ { $this->_tables['phrases'] = $this->_prepareTempTable('phrases', $drop_only); $this->_tables['emailevents'] = $this->_prepareTempTable('emailevents', $drop_only); + $this->_tables['country-state'] = $this->_prepareTempTable('country-state', $drop_only); } /** @@ -538,7 +603,24 @@ $sql = 'ALTER TABLE %1$s CHANGE %2$s %2$s INT(11) NOT NULL DEFAULT "0"'; $this->Conn->Query( sprintf($sql, $temp_table, $idfield) ); - $unique_field = $prefix == 'phrases' ? 'PhraseKey' : 'EventId'; + switch ($prefix) { + case 'phrases': + $unique_field = 'PhraseKey'; + break; + + case 'emailevents': + $unique_field = 'EventId'; + break; + + case 'country-state': + $unique_field = 'CountryStateId'; + break; + + default: + trigger_error('Unknown prefix "' . $prefix . '" during language pack import', E_USER_ERROR); + break; + } + $sql = 'ALTER TABLE ' . $temp_table . ' ADD UNIQUE (' . $unique_field . ')'; $this->Conn->Query($sql); } @@ -661,6 +743,16 @@ } break; + case 'COUNTRIES': + if ($sub_node->Children) { + if (!$language_id) { + $language_id = $this->_processLanguage($fields_hash); + } + + $this->_processCountries($sub_node->firstChild, $language_id, $fields_hash['Encoding']); + } + break; + case 'REPLACEMENTS': // added since v2 $replacements = $sub_node->Data; @@ -805,6 +897,58 @@ } /** + * Performs country_state translation import + * + * @param kXMLNode $country_state_node + * @param int $language_id + * @param string $language_encoding + */ + function _processCountries(&$country_state_node, $language_id, $language_encoding, $process_states = false) + { + static $other_translations = Array (); + + do { + if ($process_states) { + $country_state_id = $this->_getStateId($country_state_node->Parent->Attributes['ISO'], $country_state_node->Attributes['ISO']); + } + else { + $country_state_id = $this->_getCountryId($country_state_node->Attributes['ISO']); + } + + if ($country_state_id) { + if ($language_encoding == 'plain') { + $translation = rtrim($country_state_node->Attributes['TRANSLATION']); + } + else { + $translation = base64_decode($country_state_node->Attributes['TRANSLATION']); + } + + $fields_hash = Array ( + 'CountryStateId' => $country_state_id, + ); + + if (array_key_exists($country_state_id, $other_translations)) { + $other_translations[$country_state_id]['l' . $language_id . '_Name'] = $translation; + } + else { + $other_translations[$country_state_id] = Array ( + 'l' . $language_id . '_Name' => $translation, + ); + } + + $fields_hash = array_merge($fields_hash, $other_translations[$country_state_id]); + $this->Conn->doInsert($fields_hash, $this->_tables['country-state'], 'REPLACE', false); + + if (!$process_states && $country_state_node->Children) { + $this->_processCountries($country_state_node->firstChild, $language_id, $language_encoding, true); + } + } + } while (($country_state_node =& $country_state_node->NextSibling())); + + $this->Conn->doInsert($fields_hash, $this->_tables['country-state'], 'REPLACE'); + } + + /** * Creates/updates language based on given fields and returns it's id * * @param Array $fields_hash @@ -864,4 +1008,47 @@ return array_key_exists($cache_key, $this->events_hash) ? $this->events_hash[$cache_key] : 0; } + + /** + * Returns country id based on it's 3letter ISO code + * + * @param string $iso + * @return int + */ + function _getCountryId($iso) + { + static $cache = null; + + if (!isset($cache)) { + $sql = 'SELECT CountryStateId, IsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE Type = ' . DESTINATION_TYPE_COUNTRY; + $cache = $this->Conn->GetCol($sql, 'IsoCode'); + } + + return array_key_exists($iso, $cache) ? $cache[$iso] : false; + } + + /** + * Returns state id based on 3letter country ISO code and 2letter state ISO code + * + * @param string $country_iso + * @param string $state_iso + * @return int + */ + function _getStateId($country_iso, $state_iso) + { + static $cache = null; + + if (!isset($cache)) { + $sql = 'SELECT CountryStateId, CONCAT(StateCountryId, "-", IsoCode) AS IsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE Type = ' . DESTINATION_TYPE_STATE; + $cache = $this->Conn->GetCol($sql, 'IsoCode'); + } + + $country_id = $this->_getCountryId($country_iso); + + return array_key_exists($country_id . '-' . $state_iso, $cache) ? $cache[$country_id . '-' . $state_iso] : false; + } } \ No newline at end of file Index: branches/5.1.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r13451 -r13470 --- branches/5.1.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 13451) +++ branches/5.1.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 13470) @@ -1,6 +1,6 @@ getList($params); // maybe we should use $this->GetList($params) instead @@ -738,6 +745,13 @@ return $this->Application->HREF($t, '', $params); } + /** + * Depricated + * + * @param array $params + * @return int + * @deprecated Parameter "column_width" of "PrintList" tag does that + */ function ColumnWidth($params) { $columns = $this->Application->Parser->GetParam('columns'); @@ -985,6 +999,13 @@ $object->SetDBField($dst_field, $src_object->GetDBField($src_field)); } + /** + * Depricated + * + * @param Array $params + * @return string + * @deprecated parameter "as_label" of "Field" tag does the same + */ function PhraseField($params) { $field_label = $this->Field($params); @@ -1906,7 +1927,7 @@ } else { // used for configuration - $field_options['options'] = $helper->GetValuesHash($object->GetDBField($params['value_list_field']), ','); + $field_options['options'] = $helper->GetValuesHash( $object->GetDBField($params['value_list_field']) ); } $object->SetFieldOptions($field, $field_options); Index: branches/5.1.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r13462 -r13470 --- branches/5.1.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 13462) +++ branches/5.1.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 13470) @@ -1,6 +1,6 @@ Application->recallObject('CountryStatesHelper'); - $cs_helper->PopulateStates($event, 'State', 'Country'); - - $object =& $event->getObject(); - - if( $object->isRequired('Country') && $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->setRequired('State', true); - $object->setLogin(); - } - - /** * Redirects user after succesfull registration to confirmation template (on Front only) * * @param kEvent $event @@ -685,26 +668,32 @@ * Enter description here... * * @param kEvent $event + * @param bool $dry_run * @return bool */ - function isSubscriberOnly(&$event) + function isSubscriberOnly(&$event, $dry_run = false) { $event->CallSubEvent('OnSubstituteSubscriber'); - $is_subscriber = false; - if( $event->getEventParam('is_subscriber_only') ) - { - $is_subscriber = true; + $is_subscriber = $event->getEventParam('is_subscriber_only'); + + if ($dry_run) { + return $is_subscriber; + } + + if ($is_subscriber) { $object =& $event->getObject( Array('skip_autoload' => true) ); $this->OnUpdate($event); - if($event->status == erSUCCESS) - { + + if ($event->status == erSUCCESS) { $this->OnAfterItemCreate($event); $object->SendEmailEvents(); - if (!$this->Application->isAdmin && ($event->status == erSUCCESS) && $event->redirect) { + + if (!$this->Application->isAdmin && $event->redirect) { $this->autoLoginUser($event); } } } + return $is_subscriber; } @@ -720,9 +709,6 @@ } if (!$this->isSubscriberOnly($event)) { - $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); - $cs_helper->CheckStateField($event, 'State', 'Country'); - $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ if ($this->Application->ConfigValue('User_Password_Auto')) { @@ -786,18 +772,33 @@ */ function OnBeforeItemCreate(&$event) { + parent::OnBeforeItemCreate($event); + + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + + if (!$this->isSubscriberOnly($event, true)) { + $cs_helper->CheckStateField($event, 'State', 'Country'); + } + $this->_makePasswordRequired($event); + $cs_helper->PopulateStates($event, 'State', 'Country'); - $email_as_login = $this->Application->ConfigValue('Email_As_Login'); $object =& $event->getObject(); + /* @var $object kDBItem */ + + if ( $this->Application->ConfigValue('Email_As_Login') ) { + $field_options = $object->GetFieldOptions('Email'); + $field_options['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist'); + $object->SetFieldOptions('Email', $field_options); + } + + $object->setLogin(); + if (!$this->checkBanRules($object)) { $event->status = erFAIL; - return false; + return ; } - if ($email_as_login) { - $object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist'); - } - } /** @@ -885,15 +886,23 @@ $object =& $event->getObject( Array('skip_autoload' => true) ); $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if($items_info) - { - list($id,$field_values) = each($items_info); - if($id > 0) $object->Load($id); + + if ($items_info) { + list ($id, $field_values) = each($items_info); + if ($id > 0) { + $object->Load($id); + } + $object->SetFieldsFromHash($field_values); $object->setID($id); $object->Validate(); } + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + + $cs_helper->PopulateStates($event, 'State', 'Country'); + $event->redirect = false; } @@ -1190,12 +1199,30 @@ function OnUpdate(&$event) { + parent::OnUpdate($event); + + $this->setNextTemplate($event); + } + + /** + * Checks state against country + * + * @param kEvent $event + */ + function OnBeforeItemUpdate(&$event) + { + parent::OnBeforeItemUpdate($event); + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + $cs_helper->CheckStateField($event, 'State', 'Country'); + $cs_helper->PopulateStates($event, 'State', 'Country'); - parent::OnUpdate($event); + $object =& $event->getObject(); + /* @var $object UsersItem */ - $this->setNextTemplate($event); + $object->setLogin(); } /** @@ -1609,7 +1636,7 @@ if ($first_country) { // update user country dropdown sql $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); - $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); + $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (CountryStateId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); } @@ -1795,6 +1822,11 @@ /* @var $object kDBItem */ $image_helper->LoadItemImages($object); + + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + + $cs_helper->PopulateStates($event, 'State', 'Country'); } /** Index: branches/5.1.x/core/units/custom_data/custom_data_event_handler.php =================================================================== diff -u -N -r13313 -r13470 --- branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13313) +++ branches/5.1.x/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 13470) @@ -1,6 +1,6 @@ Application->recallObject('kMultiLanguage'); /* @var $ml_formatter kMultiLanguage */ + $is_install = defined('IS_INSTALL') && IS_INSTALL; + foreach ($custom_fields as $custom_id => $custom_params) { $custom_name = $custom_params['FieldName']; $field_options = Array('type' => 'string', 'not_null' => 1, 'default' => $custom_params['DefaultValue']); @@ -170,7 +172,8 @@ case 'multiselect': case 'radio': if ($custom_params['ValueList']) { - $field_options['options'] = $cf_helper->GetValuesHash($custom_params['ValueList']); + // $is_install check prevents 335 bad phrase sql errors on upgrade to 5.1.0 + $field_options['options'] = $is_install ? Array () : $cf_helper->GetValuesHash($custom_params['ValueList']); $field_options['formatter'] = 'kOptionsFormatter'; $field_options['multiple'] = $custom_params['ElementType'] == 'multiselect'; } Index: branches/5.1.x/core/admin_templates/country_states/country_state_list.tpl =================================================================== diff -u -N --- branches/5.1.x/core/admin_templates/country_states/country_state_list.tpl (revision 0) +++ branches/5.1.x/core/admin_templates/country_states/country_state_list.tpl (revision 13470) @@ -0,0 +1,48 @@ + + + + + + + + + + + +
+ +
+ + + + Index: branches/5.1.x/core/install/install_schema.sql =================================================================== diff -u -N -r13444 -r13470 --- branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 13444) +++ branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 13470) @@ -366,16 +366,21 @@ KEY Cached (Cached) ); -CREATE TABLE StdDestinations ( - DestId int(11) NOT NULL auto_increment, - DestType int(11) NOT NULL default '0', - DestParentId int(11) default NULL, - DestName varchar(255) NOT NULL default '', - DestAbbr char(3) NOT NULL default '', - DestAbbr2 char(2) default NULL, - PRIMARY KEY (DestId), - KEY DestType (DestType), - KEY DestParentId (DestParentId) +CREATE TABLE CountryStates ( + CountryStateId int(11) NOT NULL AUTO_INCREMENT, + `Type` int(11) NOT NULL DEFAULT '1', + StateCountryId int(11) DEFAULT NULL, + l1_Name varchar(255) NOT NULL, + l2_Name varchar(255) NOT NULL, + l3_Name varchar(255) NOT NULL, + l4_Name varchar(255) NOT NULL, + l5_Name varchar(255) NOT NULL, + IsoCode char(3) NOT NULL DEFAULT '', + ShortIsoCode char(2) DEFAULT NULL, + PRIMARY KEY (CountryStateId), + KEY `Type` (`Type`), + KEY StateCountryId (StateCountryId), + KEY l1_Name (l1_Name(5)) ); CREATE TABLE Category ( Index: branches/5.1.x/core/units/country_states/country_states_config.php =================================================================== diff -u -N --- branches/5.1.x/core/units/country_states/country_states_config.php (revision 0) +++ branches/5.1.x/core/units/country_states/country_states_config.php (revision 13470) @@ -0,0 +1,133 @@ + 'country-state', + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'CountryStateEventHandler', 'file' => 'country_state_eh.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), + + 'AutoLoad' => true, + + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), + + 'IDField' => 'CountryStateId', + + 'TableName' => TABLE_PREFIX . 'CountryStates', + + 'TitleField' => 'Translation', + + 'TitlePresets' => Array ( + 'default' => Array ( + 'new_status_labels' => Array ('country-state' => '!la_title_AddingCountryState!'), + 'edit_status_labels' => Array ('country-state' => '!la_title_EditingCountryState!'), + ), + + 'country_state_list' => Array ( + 'prefixes' => Array ('country-state_List'), 'format' => "!la_title_CountryStates!", + 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'), + ), + + 'country_state_edit' => Array ( + 'prefixes' => Array ('country-state'), 'format' => "#country-state_status# '#country-state_titlefield#'", + 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), + ), + ), + + 'PermSection' => Array('main' => 'in-portal:country_states'), + + 'Sections' => Array ( + 'in-portal:country_states' => Array ( + 'parent' => 'in-portal:website_setting_folder', + 'icon' => 'conf_country_states', + 'label' => 'la_title_CountryStates', + 'url' => Array('t' => 'country_states/country_state_list', 'pass' => 'm'), + 'permissions' => Array('view', 'add', 'edit', 'delete'), + 'priority' => 10, + 'type' => stTREE, + ), + ), + + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s FROM %1$s', + ), + + 'ListSortings' => Array ( + '' => Array ( + 'Sorting' => Array ('Type' => 'asc', 'Translation' => 'asc'), + ) + ), + + 'CalculatedFields' => Array ( + '' => Array ( + 'Translation' => 'l%2$s_Name', + ), + ), + + 'Fields' => Array ( + 'CountryStateId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + + 'Type' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Country', 2 => 'la_opt_State'), 'use_phrases' => 1, + 'not_null' => 1, 'required' => 1, 'default' => 1 + ), + + 'StateCountryId' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', + 'options_sql' => ' SELECT IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE Type = ' . DESTINATION_TYPE_COUNTRY . ' + ORDER BY Name', + 'option_key_field' => 'CountryStateId', 'option_title_field' => 'Name', + 'default' => NULL + ), + + 'Name' => Array ( + 'type' => 'string', 'max_len' => 255, + 'formatter' => 'kMultiLanguage', 'db_type' => 'varchar(255)', + 'not_null' => 1, 'required' => 1, 'default' => '' + ), + + 'IsoCode' => Array ('type' => 'string', 'max_len' => 3, 'not_null' => 1, 'unique' => Array ('Type', 'StateCountryId'), 'required' => 1, 'default' => ''), + 'ShortIsoCode' => Array ('type' => 'string', 'max_len' => 2, 'default' => NULL), + ), + + 'VirtualFields' => Array ( + 'Translation' => Array ('type' => 'string', 'default' => ''), + ), + + 'Grids' => Array ( + 'Default' => Array ( + 'Icons' => Array ('default' => 'icon16_item.png'), + 'Fields' => Array ( + 'CountryStateId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'Name' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'IsoCode' => Array ('title' => 'la_col_IsoCode', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'Type' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ), + 'StateCountryId' => Array ('title' => 'la_col_StateCountry', 'filter_block' => 'grid_options_filter', 'width' => 200, ), + 'ShortIsoCode' => Array ('title' => 'la_col_ShortIsoCode', 'filter_block' => 'grid_like_filter', 'width' => 125, ), + ), + ), + ), + ); Index: branches/5.1.x/core/install/english.lang =================================================================== diff -u -N -r13454 -r13470 --- branches/5.1.x/core/install/english.lang (.../english.lang) (revision 13454) +++ branches/5.1.x/core/install/english.lang (.../english.lang) (revision 13470) @@ -1,5 +1,5 @@ - - m/d/Yg:i Am/d/Yg:i:s A.,utf-8http://docs.in-portal.org/eng/index.php2 + + QWN0aXZl QWRk @@ -176,8 +176,10 @@ U2Vzc2lvbiBFbmQ= U2Vzc2lvbiBMb2cgSUQ= U2Vzc2lvbiBTdGFydA== + U2hvcnQgSVNPIENvZGU= TmFtZQ== U29ydCBieQ== + U3RhdGUgQ291bnRyeQ== U3RhdHVz U3RvcCBXb3Jk U3ViamVjdA== @@ -274,246 +276,6 @@ WWFob28gQXBwbGljYXRpb25JZA== QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSBzZWxlY3RlZCBFeHBvcnQgUHJlc2V0Pw== VGhlIHNlY3Rpb24gdHJlZSBtdXN0IGJlIHVwZGF0ZWQgdG8gcmVmbGVjdCB0aGUgbGF0ZXN0IGNoYW5nZXM= - QXJ1YmE= - QWZnaGFuaXN0YW4= - QW5nb2xh - QW5ndWlsbGE= - QWxiYW5pYQ== - QW5kb3JyYQ== - TmV0aGVybGFuZHMgQW50aWxsZXM= - VW5pdGVkIEFyYWIgRW1pcmF0ZXM= - QXJnZW50aW5h - QXJtZW5pYQ== - QW1lcmljYW4gc2Ftb2E= - QW50YXJjdGljYQ== - RnJlbmNoIFNvdXRoZXJuIFRlcnJpdG9yaWVz - QW50aWd1YSBhbmQgYmFyYnVkYQ== - QXVzdHJhbGlh - QXVzdHJpYQ== - QXplcmJhaWphbg== - QnVydW5kaQ== - QmVsZ2l1bQ== - QmVuaW4= - QnVya2luYSBGYXNv - QmFuZ2xhZGVzaA== - QnVsZ2FyaWE= - QmFocmFpbg== - QmFoYW1hcw== - Qm9zbmlhIGFuZCBIZXJ6ZWdvd2luYQ== - QmVsYXJ1cw== - QmVsaXpl - QmVybXVkYQ== - Qm9saXZpYQ== - QnJhemls - QmFyYmFkb3M= - QnJ1bmVpIERhcnVzc2FsYW0= - Qmh1dGFu - Qm91dmV0IElzbGFuZA== - Qm90c3dhbmE= - Q2VudHJhbCBBZnJpY2FuIFJlcHVibGlj - Q2FuYWRh - Q29jb3MgKEtlZWxpbmcpIElzbGFuZHM= - U3dpdHplcmxhbmQ= - Q2hpbGU= - Q2hpbmE= - Q290ZSBkJ0l2b2lyZQ== - Q2FtZXJvb24= - Q29uZ28sIERlbW9jcmF0aWMgUmVwdWJsaWMgb2YgKFdhcyBaYWlyZSk= - Q29uZ28sIFBlb3BsZSdzIFJlcHVibGljIG9m - Q29vayBJc2xhbmRz - Q29sb21iaWE= - Q29tb3Jvcw== - Q2FwZSBWZXJkZQ== - Q29zdGEgUmljYQ== - Q3ViYQ== - Q2hyaXN0bWFzIElzbGFuZA== - Q2F5bWFuIElzbGFuZHM= - Q3lwcnVz - Q3plY2ggUmVwdWJsaWM= - R2VybWFueQ== - RGppYm91dGk= - RG9taW5pY2E= - RGVubWFyaw== - RG9taW5pY2FuIFJlcHVibGlj - QWxnZXJpYQ== - RWN1YWRvcg== - RWd5cHQ= - RXJpdHJlYQ== - V2VzdGVybiBTYWhhcmE= - U3BhaW4= - RXN0b25pYQ== - RXRoaW9waWE= - RmlubGFuZA== - RmlqaQ== - RmFsa2xhbmQgSXNsYW5kcyAoTWFsdmluYXMp - RnJhbmNl - RmFyb2UgSXNsYW5kcw== - TWljcm9uZXNpYSwgRmVkZXJhdGVkIFN0YXRlcyBvZg== - RnJhbmNlLCBNZXRyb3BvbGl0YW4= - R2Fib24= - VW5pdGVkIEtpbmdkb20= - R2VvcmdpYQ== - R2hhbmE= - R2licmFsdGFy - R3VpbmVh - R3VhZGVsb3VwZQ== - R2FtYmlh - R3VpbmVhLUJpc3NhdQ== - RXF1YXRvcmlhbCBHdWluZWE= - R3JlZWNl - R3JlbmFkYQ== - R3JlZW5sYW5k - R3VhdGVtYWxh - RnJlbmNoIEd1aWFuYQ== - R3VhbQ== - R3V5YW5h - SG9uZyBrb25n - SGVhcmQgYW5kIE1jIERvbmFsZCBJc2xhbmRz - SG9uZHVyYXM= - Q3JvYXRpYSAobG9jYWwgbmFtZTogSHJ2YXRza2Ep - SGFpdGk= - SHVuZ2FyeQ== - SW5kb25lc2lh - SW5kaWE= - QnJpdGlzaCBJbmRpYW4gT2NlYW4gVGVycml0b3J5 - SXJlbGFuZA== - SXJhbiAoSXNsYW1pYyBSZXB1YmxpYyBvZik= - SXJhcQ== - SWNlbGFuZA== - SXNyYWVs - SXRhbHk= - SmFtYWljYQ== - Sm9yZGFu - SmFwYW4= - S2F6YWtoc3Rhbg== - S2VueWE= - S3lyZ3l6c3Rhbg== - Q2FtYm9kaWE= - S2lyaWJhdGk= - U2FpbnQgS2l0dHMgYW5kIE5ldmlz - S29yZWEsIFJlcHVibGljIG9m - S3V3YWl0 - TGFvIFBlb3BsZSdzIERlbW9jcmF0aWMgUmVwdWJsaWM= - TGViYW5vbg== - TGliZXJpYQ== - TGlieWFuIEFyYWIgSmFtYWhpcml5YQ== - U2FpbnQgTHVjaWE= - TGllY2h0ZW5zdGVpbg== - U3JpIGxhbmth - TGVzb3Robw== - TGl0aHVhbmlh - THV4ZW1ib3VyZw== - TGF0dmlh - TWFjYXU= - TW9yb2Njbw== - TW9uYWNv - TW9sZG92YSwgUmVwdWJsaWMgb2Y= - TWFkYWdhc2Nhcg== - TWFsZGl2ZXM= - TWV4aWNv - TWFyc2hhbGwgSXNsYW5kcw== - TWFjZWRvbmlh - TWFsaQ== - TWFsdGE= - TXlhbm1hcg== - TW9uZ29saWE= - Tm9ydGhlcm4gTWFyaWFuYSBJc2xhbmRz - TW96YW1iaXF1ZQ== - TWF1cml0YW5pYQ== - TW9udHNlcnJhdA== - TWFydGluaXF1ZQ== - TWF1cml0aXVz - TWFsYXdp - TWFsYXlzaWE= - TWF5b3R0ZQ== - TmFtaWJpYQ== - TmV3IENhbGVkb25pYQ== - TmlnZXI= - Tm9yZm9sayBJc2xhbmQ= - TmlnZXJpYQ== - TmljYXJhZ3Vh - Tml1ZQ== - TmV0aGVybGFuZHM= - Tm9yd2F5 - TmVwYWw= - TmF1cnU= - TmV3IFplYWxhbmQ= - T21hbg== - UGFraXN0YW4= - UGFuYW1h - UGl0Y2Fpcm4= - UGVydQ== - UGhpbGlwcGluZXM= - UGFsYXU= - UGFwdWEgTmV3IEd1aW5lYQ== - UG9sYW5k - UHVlcnRvIFJpY28= - S29yZWEsIERlbW9jcmF0aWMgUGVvcGxlJ3MgUmVwdWJsaWMgb2Y= - UG9ydHVnYWw= - UGFyYWd1YXk= - UGFsZXN0aW5pYW4gVGVycml0b3J5LCBPY2N1cGllZA== - RnJlbmNoIFBvbHluZXNpYQ== - UWF0YXI= - UmV1bmlvbg== - Um9tYW5pYQ== - UnVzc2lhbiBGZWRlcmF0aW9u - UndhbmRh - U2F1ZGkgQXJhYmlh - U3VkYW4= - U2VuZWdhbA== - U2luZ2Fwb3Jl - U291dGggR2VvcmdpYSBhbmQgVGhlIFNvdXRoIFNhbmR3aWNoIElzbGFuZHM= - U3QuIGhlbGVuYQ== - U3ZhbGJhcmQgYW5kIEphbiBNYXllbiBJc2xhbmRz - U29sb21vbiBJc2xhbmRz - U2llcnJhIExlb25l - RWwgU2FsdmFkb3I= - U2FuIE1hcmlubw== - U29tYWxpYQ== - U3QuIFBpZXJyZSBhbmQgTWlxdWVsb24= - U2FvIFRvbWUgYW5kIFByaW5jaXBl - U3VyaW5hbWU= - U2xvdmFraWEgKFNsb3ZhayBSZXB1YmxpYyk= - U2xvdmVuaWE= - U3dlZGVu - U3dhemlsYW5k - U2V5Y2hlbGxlcw== - U3lyaWFuIEFyYWIgUmVwdWJsaWM= - VHVya3MgYW5kIENhaWNvcyBJc2xhbmRz - Q2hhZA== - VG9nbw== - VGhhaWxhbmQ= - VGFqaWtpc3Rhbg== - VG9rZWxhdQ== - VHVya21lbmlzdGFu - RWFzdCBUaW1vcg== - VG9uZ2E= - VHJpbmlkYWQgYW5kIFRvYmFnbw== - VHVuaXNpYQ== - VHVya2V5 - VHV2YWx1 - VGFpd2Fu - VGFuemFuaWEsIFVuaXRlZCBSZXB1YmxpYyBvZg== - VWdhbmRh - VWtyYWluZQ== - VW5pdGVkIFN0YXRlcyBNaW5vciBPdXRseWluZyBJc2xhbmRz - VXJ1Z3VheQ== - VW5pdGVkIFN0YXRlcw== - VXpiZWtpc3Rhbg== - VmF0aWNhbiBDaXR5IFN0YXRlIChIb2x5IFNlZSk= - U2FpbnQgVmluY2VudCBhbmQgVGhlIEdyZW5hZGluZXM= - VmVuZXp1ZWxh - VmlyZ2luIElzbGFuZHMgKEJyaXRpc2gp - VmlyZ2luIElzbGFuZHMgKFUuUy4p - VmlldG5hbQ== - VmFudWF0dQ== - V2FsbGlzIGFuZCBGdXR1bmEgSXNsYW5kcw== - U2Ftb2E= - WWVtZW4= - WXVnb3NsYXZpYQ== - U291dGggQWZyaWNh - WmFtYmlh - WmltYmFid2U= RGF0YSBHcmlkcw== RGF0YSBHcmlkcyAy ZGF5cw== @@ -812,11 +574,13 @@ U2VudA== U2VydmVy U2Vzc2lvbiBMb2cgSUQ= + U2hvcnQgSVNPIENvZGU= U2ltcGxlIFNlYXJjaA== TmFtZQ== U2tpcCBGaXJzdCBSb3c= U29ydCBWYWx1ZXM= U3RhdGU= + U3RhdGUgQ291bnRyeQ== U3RhdHVz U3RvcCBXb3Jk U3R5bGVzaGVldCBJRA== @@ -944,6 +708,7 @@ Q29sb24= Q29tbWE= Q29tbWVudCBUZXh0 + Q291bnRyeQ== Q3JlYXRlZCBPbg== ZGF5KHMp RGVueQ== @@ -1210,71 +975,6 @@ U2hvdw== QWZmZWN0ZWQgcm93cw== RXhlY3V0ZWQgaW46 - QWxiZXJ0YQ== - QWxhc2th - QWxhYmFtYQ== - QXJrYW5zYXM= - QXJpem9uYQ== - QnJpdGlzaCBDb2x1bWJpYQ== - Q2FsaWZvcm5pYQ== - Q29sb3JhZG8= - Q29ubmVjdGljdXQ= - RGlzdHJpY3Qgb2YgQ29sdW1iaWE= - RGVsYXdhcmU= - RmxvcmlkYQ== - R2VvcmdpYQ== - SGF3YWlp - SW93YQ== - SWRhaG8= - SWxsaW5vaXM= - SW5kaWFuYQ== - S2Fuc2Fz - S2VudHVja3k= - TG91aXNpYW5h - TWFzc2FjaHVzZXR0cw== - TWFuaXRvYmE= - TWFyeWxhbmQ= - TWFpbmU= - TWljaGlnYW4= - TWlubmVzb3Rh - TWlzc291cmk= - TWlzc2lzc2lwcGk= - TW9udGFuYQ== - TmV3IEJydW5zd2ljaw== - Tm9ydGggQ2Fyb2xpbmE= - Tm9ydGggRGFrb3Rh - TmVicmFza2E= - TmV3IEhhbXBzaGlyZQ== - TmV3IEplcnNleQ== - TmV3Zm91bmRsYW5kIGFuZCBMYWJyYWRvcg== - TmV3IE1leGljbw== - Tm92YSBTY290aWE= - Tm9ydGh3ZXN0IFRlcnJpdG9yaWVz - TnVuYXZ1dA== - TmV2YWRh - TmV3IFlvcms= - T2hpbw== - T2tsYWhvbWE= - T250YXJpbw== - T3JlZ29u - UGVubnN5bHZhbmlh - UHJpbmNlIEVkd2FyZCBJc2xhbmQ= - UHVlcnRvIFJpY28= - UXVlYmVj - UmhvZGUgSXNsYW5k - U291dGggQ2Fyb2xpbmE= - U291dGggRGFrb3Rh - U2Fza2F0Y2hld2Fu - VGVubmVzc2Vl - VGV4YXM= - VXRhaA== - VmlyZ2luaWE= - VmVybW9udA== - V2FzaGluZ3Rvbg== - V2lzY29uc2lu - V2VzdCBWaXJnaW5pYQ== - V3lvbWluZw== - WXVrb24= U3RlcA== RGVmaW5pdGlvbg== UHJldmlldw== @@ -1412,6 +1112,7 @@ Vmlldw== QWRkaW5nIEFnZW50 QWRkaW5nIEJhbiBSdWxl + QWRkaW5nIENvdW50cnkvU3RhdGU= QWRkaW5nIEN1c3RvbSBGaWVsZA== QWRkaW5nIEZpbGU= QWRkaW5nIE1haWxpbmcgTGlzdA== @@ -1451,12 +1152,14 @@ Q29sdW1uIFBpY2tlcg== Q29uZmlndXJhdGlvbg== Q29udGFjdCBJbmZvcm1hdGlvbg== + Q291bnRyaWVzICYgU3RhdGVz Q1NWIEV4cG9ydA== Q3VzdG9t Q3VzdG9tIEZpZWxkcw== RWRpdGluZyBBZ2VudA== RWRpdGluZyBCYW4gUnVsZQ== RWRpdGluZyBDaGFuZ2VzIExvZw== + RWRpdGluZyBDb3VudHJ5L1N0YXRl RWRpdGluZyBFbWFpbCBFdmVudA== RWRpdGluZyBGaWxl RWRpdGluZyBNZW1iZXJzaGlw @@ -1586,6 +1289,7 @@ TmV3IEFnZW50 TmV3IEJhc2UgU3R5bGU= TmV3IEJsb2NrIFN0eWxl + TmV3IENvdW50cnkvU3RhdGU= TmV3IEdyb3Vw TmV3IGxhYmVs TmV3IExhbmd1YWdl @@ -1771,5 +1475,314 @@ U3ViamVjdDogVXNlciBSZWdpc3RyYXRpb24gaXMgVmFsaWRhdGVkCgpXZWxjb21lIHRvIEluLXBvcnRhbCE8YnIvPjxici8+DQoNCllvdXIgdXNlciByZWdpc3RyYXRpb24gaGFzIGJlZW4gYXBwcm92ZWQuIFlvdSBjYW4gbG9naW4gbm93IDxhIGhyZWY9IjxpbnAyOm1fQmFzZVVybC8+Ij48aW5wMjptX0Jhc2VVcmwvPjwvYT4gdXNpbmcgdGhlIGZvbGxvd2luZyBpbmZvcm1hdGlvbjo8YnIvPjxici8+DQoNCj09PT09PT09PT09PT09PT09PTxici8+DQpVc2VybmFtZTogIjxpbnAyOnVfRmllbGQgbmFtZT0iTG9naW4iLz4iPGJyLz4NClBhc3N3b3JkOiAiPGlucDI6dV9GaWVsZCBuYW1lPSJQYXNzd29yZF9wbGFpbiIvPiI8YnIvPg0KPT09PT09PT09PT09PT09PT09PGJyLz48YnIvPg0K U3ViamVjdDogTmV3IFVzZXIgUmVnaXN0cmF0aW9uIGlzIFZhbGlkYXRlZAoKVXNlciAiPGlucDI6dV9GaWVsZCBuYW1lPSJMb2dpbiIvPiIgaGFzIGJlZW4gdmFsaWRhdGVkLg== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: branches/5.1.x/core/install/install_data.sql =================================================================== diff -u -N -r13454 -r13470 --- branches/5.1.x/core/install/install_data.sql (.../install_data.sql) (revision 13454) +++ branches/5.1.x/core/install/install_data.sql (.../install_data.sql) (revision 13470) @@ -1,8 +1,8 @@ # Section "in-portal:configure_categories": -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortfield', 'Name', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield_prompt', 'select', '', 'Name=la_opt_Title,Description=la_opt_Description,CreatedOn=la_opt_CreatedOn,EditorsPick=la_opt_EditorsPick,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)', 10.01, 1, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortorder', 'asc', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.01, 2, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortfield2', 'Description', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield2_prompt', 'select', '', 'Name=la_opt_Title,Description=la_opt_Description,CreatedOn=la_opt_CreatedOn,EditorsPick=la_opt_EditorsPick,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)', 10.02, 1, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortorder2', 'asc', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield2_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.02, 2, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortfield', 'Name', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield_prompt', 'select', '', 'Name=la_opt_Title||Description=la_opt_Description||CreatedOn=la_opt_CreatedOn||EditorsPick=la_opt_EditorsPick||SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)', 10.01, 1, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortorder', 'asc', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield_prompt', 'select', '', 'asc=la_common_Ascending||desc=la_common_Descending', 10.01, 2, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortfield2', 'Description', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield2_prompt', 'select', '', 'Name=la_opt_Title||Description=la_opt_Description||CreatedOn=la_opt_CreatedOn||EditorsPick=la_opt_EditorsPick||SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 1) AND (IsSystem = 0)', 10.02, 1, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_Sortorder2', 'asc', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_sortfield2_prompt', 'select', '', 'asc=la_common_Ascending||desc=la_common_Descending', 10.02, 2, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Perpage_Category', '20', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_perpage_prompt', 'text', '', '', 10.03, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Perpage_Category_Short', '3', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_perpage__short_prompt', 'text', '', '', 10.04, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_DaysNew', '8', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_category_daysnew_prompt', 'text', '', '', 10.05, 0, 1, NULL); @@ -13,20 +13,20 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Catalog_PreselectModuleTab', '1', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_CatalogPreselectModuleTab', 'checkbox', NULL, NULL, 10.1, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RecycleBinFolder', '', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_RecycleBinFolder', 'text', NULL, NULL, 10.11, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'QuickCategoryPermissionRebuild', '1', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_QuickCategoryPermissionRebuild', 'checkbox', NULL, NULL, 10.12, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'FilenameSpecialCharReplacement', '-', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_FilenameSpecialCharReplacement', 'select', NULL, '_=+_,-=+-', 10.13, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'FilenameSpecialCharReplacement', '-', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_FilenameSpecialCharReplacement', 'select', NULL, '_=+_||-=+-', 10.13, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'YahooApplicationId', '', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_YahooApplicationId', 'text', NULL, NULL, 10.14, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Search_MinKeyword_Length', '3', 'In-Portal', 'in-portal:configure_categories', 'la_title_General', 'la_config_Search_MinKeyword_Length', 'text', NULL, NULL, 10.15, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_MetaKey', '', 'In-Portal', 'in-portal:configure_categories', 'la_Text_MetaInfo', 'la_category_metakey', 'textarea', '', '', 20.01, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Category_MetaDesc', '', 'In-Portal', 'in-portal:configure_categories', 'la_Text_MetaInfo', 'la_category_metadesc', 'textarea', '', '', 20.02, 0, 1, NULL); # Section "in-portal:configure_general": INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Site_Name', 'In-Portal CMS', 'In-Portal', 'in-portal:configure_general', 'la_section_SettingsWebsite', 'la_config_website_name', 'text', '', '', 10.01, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'FirstDayOfWeek', '1', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_first_day_of_week', 'select', '', '0=la_sunday,1=la_monday', 20.01, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Config_Server_Time', '14', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_time_server', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.02, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Config_Site_Time', '14', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_site_zone', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 20.03, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'FirstDayOfWeek', '1', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_first_day_of_week', 'select', '', '0=la_sunday||1=la_monday', 20.01, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Config_Server_Time', '14', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_time_server', 'select', '', '1=la_m12||2=la_m11||3=la_m10||5=la_m9||6=la_m8||7=la_m7||8=la_m6||9=la_m5||10=la_m4||11=la_m3||12=la_m2||13=la_m1||14=la_m0||15=la_p1||16=la_p2||17=la_p3||18=la_p4||19=la_p5||20=la_p6||21=la_p7||22=la_p8||23=la_p9||24=la_p10||25=la_p11||26=la_p12||27=la_p13', 20.02, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Config_Site_Time', '14', 'In-Portal', 'in-portal:configure_general', 'la_Text_Date_Time_Settings', 'la_config_site_zone', 'select', '', '1=la_m12||2=la_m11||3=la_m10||5=la_m9||6=la_m8||7=la_m7||8=la_m6||9=la_m5||10=la_m4||11=la_m3||12=la_m2||13=la_m1||14=la_m0||15=la_p1||16=la_p2||17=la_p3||18=la_p4||19=la_p5||20=la_p6||21=la_p7||22=la_p8||23=la_p9||24=la_p10||25=la_p11||26=la_p12||27=la_p13', 20.03, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_AdminMailFrom', 'portal@user.domain.name', 'In-Portal', 'in-portal:configure_general', 'la_section_SettingsMailling', 'la_prompt_AdminMailFrom', 'text', NULL, 'size="40"', 30.01, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionTimeout', '3600', 'In-Portal', 'in-portal:configure_general', 'la_section_SettingsSession', 'la_prompt_session_timeout', 'text', 'a:3:{s:4:"type";s:3:"int";s:13:"min_value_inc";i:1;s:8:"required";i:1;}', '', 40.01, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdminConsoleInterface', 'simple', 'In-Portal', 'in-portal:configure_general', 'la_section_SettingsAdmin', 'la_config_AdminConsoleInterface', 'select', '', 'simple=+simple,advanced=+advanced,custom=+custom', 50.01, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdminConsoleInterface', 'simple', 'In-Portal', 'in-portal:configure_general', 'la_section_SettingsAdmin', 'la_config_AdminConsoleInterface', 'select', '', 'simple=+simple||advanced=+advanced||custom=+custom', 50.01, 0, 1, NULL); # Section "in-portal:configure_advanced": INSERT INTO ConfigurationValues VALUES(DEFAULT, 'PageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', '', '', '', NULL, NULL, 0, 0, 0, NULL); @@ -41,7 +41,7 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceImageMagickResize', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceImageMagickResize', 'checkbox', '', '', 10.07, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CheckStopWords', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_CheckStopWords', 'checkbox', '', '', 10.08, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseVisitorTracking', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseVisitorTracking', 'checkbox', '', '', 10.09, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CookieSessions', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_prompt_session_management', 'select', NULL, '0=lu_opt_QueryString,1=lu_opt_Cookies,2=lu_opt_AutoDetect', 20.01, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CookieSessions', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_prompt_session_management', 'select', NULL, '0=lu_opt_QueryString||1=lu_opt_Cookies||2=lu_opt_AutoDetect', 20.01, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionCookieName', 'sid', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_prompt_session_cookie_name', 'text', '', '', 20.02, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'KeepSessionOnBrowserClose', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_config_KeepSessionOnBrowserClose', 'checkbox', '', '', 20.03, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionBrowserSignatureCheck', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_config_SessionBrowserSignatureCheck', 'checkbox', NULL, NULL, 20.04, 0, 1, NULL); @@ -58,8 +58,8 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseToolbarLabels', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseToolbarLabels', 'checkbox', NULL, NULL, 40.03, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseSmallHeader', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseSmallHeader', 'checkbox', '', '', 40.04, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseColumnFreezer', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseColumnFreezer', 'checkbox', '', '', 40.05, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UsePopups', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UsePopups', 'select', '', '0=la_opt_SameWindow,1=la_opt_PopupWindow,2=la_opt_ModalWindow', 40.06, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseDoubleSorting', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseDoubleSorting', 'radio', '', '1=la_Yes,0=la_No', 40.07, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UsePopups', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UsePopups', 'select', '', '0=la_opt_SameWindow||1=la_opt_PopupWindow||2=la_opt_ModalWindow', 40.06, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseDoubleSorting', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseDoubleSorting', 'radio', '', '1=la_Yes||0=la_No', 40.07, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MenuFrameWidth', '200', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_prompt_MenuFrameWidth', 'text', NULL, NULL, 40.08, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ResizableFrames', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_ResizableFrames', 'checkbox', '', '', 40.09, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_AutoRefreshIntervals', 'text', '', '', 40.1, 0, 0, NULL); @@ -75,7 +75,7 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_User', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_smtp_user', 'text', NULL, NULL, 50.04, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Pass', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_smtp_pass', 'text', NULL, NULL, 50.05, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_DefaultHeaders', 'X-Mailer: In-Portal', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_smtpheaders', 'textarea', NULL, 'COLS=40 ROWS=5', 50.06, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MailFunctionHeaderSeparator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux,2=la_Windows', 50.07, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MailFunctionHeaderSeparator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_MailFunctionHeaderSeparator', 'radio', NULL, '1=la_Linux||2=la_Windows', 50.07, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MailingListQueuePerStep', '10', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_MailingListQueuePerStep', 'text', NULL, NULL, 50.08, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MailingListSendPerStep', '10', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_MailingListSendPerStep', 'text', NULL, NULL, 50.09, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseOutputCompression', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_UseOutputCompression', 'checkbox', '', '', 60.01, 0, 1, NULL); @@ -87,15 +87,15 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Backup_Path', '/home/alex/web/in-portal.rc/system/backupdata', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_config_backup_path', 'text', '', '', 60.07, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SystemTagCache', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 60.08, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SocketBlockingMode', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSystem', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 60.09, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportDelimiter', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportDelimiter', 'select', NULL, '0=la_opt_Tab,1=la_opt_Comma,2=la_opt_Semicolon,3=la_opt_Space,4=la_opt_Colon', 70.01, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEnclosure', 'radio', NULL, '0=la_Doublequotes,1=la_Quotes', 70.02, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux,1=la_Windows', 70.03, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode,1=la_Regular', 70.04, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportDelimiter', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportDelimiter', 'select', NULL, '0=la_opt_Tab||1=la_opt_Comma||2=la_opt_Semicolon||3=la_opt_Space||4=la_opt_Colon', 70.01, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEnclosure', 'radio', NULL, '0=la_Doublequotes||1=la_Quotes', 70.02, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux||1=la_Windows', 70.03, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode||1=la_Regular', 70.04, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MemcacheServers', 'localhost:11211', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCaching', 'la_config_MemcacheServers', 'text', NULL, '', 80.01, 0, 0, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CacheHandler', 'Fake', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None,Memcache=+Memcached,Apc=+Alternative PHP Cache,XCache=+XCache', 80.02, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CacheHandler', 'Fake', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCaching', 'la_config_CacheHandler', 'select', NULL, 'Fake=la_None||Memcache=+Memcached||Apc=+Alternative PHP Cache||XCache=+XCache', 80.02, 0, 0, NULL); # Section "in-portal:configure_users": -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration,2=la_opt_UserNotAllowedRegistration,3=la_opt_UserUponApprovalRegistration,4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration||2=la_opt_UserNotAllowedRegistration||3=la_opt_UserUponApprovalRegistration||4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdvancedUserManagement', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_AdvancedUserManagement', 'checkbox', NULL, NULL, 10.011, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Email_As_Login', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_use_emails_as_login', 'checkbox', NULL, NULL, 10.02, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RegistrationCaptcha', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_registration_captcha', 'checkbox', NULL, NULL, 10.025, 0, 0, NULL); @@ -104,11 +104,11 @@ INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Users_AllowReset', '180', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_allow_reset', 'text', NULL, NULL, 10.05, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Password_Auto', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_password_auto', 'checkbox', '', '', 10.06, 0, 1, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_MembershipExpirationReminder', '10', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_MembershipExpirationReminder', 'text', NULL, '', 10.07, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_new_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.08, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_LoggedInGroup', '15', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_assign_all_to', 'select', NULL, '0=lu_none,SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.09, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_GuestGroup', '14', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_guest_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.1, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_SubscriberGroup', '12', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.11, 0, 1, NULL); -INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Default_Registration_Country', NULL, 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_DefaultRegistrationCountry', 'select', NULL, '=+,SELECT DestName AS OptionName, DestId AS OptionValue FROM StdDestinations WHERE COALESCE(DestParentId, 0) = 0 ORDER BY OptionName', 10.12, 0, 0, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_new_group', 'select', NULL, '0=lu_none||SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.08, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_LoggedInGroup', '15', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_assign_all_to', 'select', NULL, '0=lu_none||SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.09, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_GuestGroup', '14', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_guest_group', 'select', NULL, '0=lu_none||SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.1, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_SubscriberGroup', '12', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none||SELECT GroupId as OptionValue, Name as OptionName FROM PortalGroup WHERE Enabled=1 AND Personal=0', 10.11, 0, 1, NULL); +INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Default_Registration_Country', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_DefaultRegistrationCountry', 'select', NULL, '=+||SELECT l%3$s_Name AS OptionName, CountryStateId AS OptionValue FROM CountryStates WHERE Type = 1 ORDER BY OptionName', 10.12, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AllowSelectGroupOnFront', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_AllowSelectGroupOnFront', 'checkbox', NULL, NULL, 10.13, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DefaultSettingsUserId', '-1', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_DefaultUserId', 'text', NULL, NULL, 10.14, 0, 0, NULL); INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Votes_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users', 'la_Text_Restrictions', 'la_users_votes_deny', 'text', '', '', 20.01, 0, 1, NULL); @@ -174,311 +174,312 @@ INSERT INTO PortalGroup VALUES (14, 'Guest', 'Guest User', '0', 1, 0, 1, 0); INSERT INTO PortalGroup VALUES (11, 'admin', '', '1054738405', 0, 0, 1, 0); -INSERT INTO StdDestinations VALUES (1, 1, DEFAULT, 'la_country_AFG', 'AFG', 'AF'); -INSERT INTO StdDestinations VALUES (2, 1, DEFAULT, 'la_country_ALB', 'ALB', 'AL'); -INSERT INTO StdDestinations VALUES (3, 1, DEFAULT, 'la_country_DZA', 'DZA', 'DZ'); -INSERT INTO StdDestinations VALUES (4, 1, DEFAULT, 'la_country_ASM', 'ASM', 'AS'); -INSERT INTO StdDestinations VALUES (5, 1, DEFAULT, 'la_country_AND', 'AND', 'AD'); -INSERT INTO StdDestinations VALUES (6, 1, DEFAULT, 'la_country_AGO', 'AGO', 'AO'); -INSERT INTO StdDestinations VALUES (7, 1, DEFAULT, 'la_country_AIA', 'AIA', 'AI'); -INSERT INTO StdDestinations VALUES (8, 1, DEFAULT, 'la_country_ATA', 'ATA', 'AQ'); -INSERT INTO StdDestinations VALUES (9, 1, DEFAULT, 'la_country_ATG', 'ATG', 'AG'); -INSERT INTO StdDestinations VALUES (10, 1, DEFAULT, 'la_country_ARG', 'ARG', 'AR'); -INSERT INTO StdDestinations VALUES (11, 1, DEFAULT, 'la_country_ARM', 'ARM', 'AM'); -INSERT INTO StdDestinations VALUES (12, 1, DEFAULT, 'la_country_ABW', 'ABW', 'AW'); -INSERT INTO StdDestinations VALUES (13, 1, DEFAULT, 'la_country_AUS', 'AUS', 'AU'); -INSERT INTO StdDestinations VALUES (14, 1, DEFAULT, 'la_country_AUT', 'AUT', 'AT'); -INSERT INTO StdDestinations VALUES (15, 1, DEFAULT, 'la_country_AZE', 'AZE', 'AZ'); -INSERT INTO StdDestinations VALUES (16, 1, DEFAULT, 'la_country_BHS', 'BHS', 'BS'); -INSERT INTO StdDestinations VALUES (17, 1, DEFAULT, 'la_country_BHR', 'BHR', 'BH'); -INSERT INTO StdDestinations VALUES (18, 1, DEFAULT, 'la_country_BGD', 'BGD', 'BD'); -INSERT INTO StdDestinations VALUES (19, 1, DEFAULT, 'la_country_BRB', 'BRB', 'BB'); -INSERT INTO StdDestinations VALUES (20, 1, DEFAULT, 'la_country_BLR', 'BLR', 'BY'); -INSERT INTO StdDestinations VALUES (21, 1, DEFAULT, 'la_country_BEL', 'BEL', 'BE'); -INSERT INTO StdDestinations VALUES (22, 1, DEFAULT, 'la_country_BLZ', 'BLZ', 'BZ'); -INSERT INTO StdDestinations VALUES (23, 1, DEFAULT, 'la_country_BEN', 'BEN', 'BJ'); -INSERT INTO StdDestinations VALUES (24, 1, DEFAULT, 'la_country_BMU', 'BMU', 'BM'); -INSERT INTO StdDestinations VALUES (25, 1, DEFAULT, 'la_country_BTN', 'BTN', 'BT'); -INSERT INTO StdDestinations VALUES (26, 1, DEFAULT, 'la_country_BOL', 'BOL', 'BO'); -INSERT INTO StdDestinations VALUES (27, 1, DEFAULT, 'la_country_BIH', 'BIH', 'BA'); -INSERT INTO StdDestinations VALUES (28, 1, DEFAULT, 'la_country_BWA', 'BWA', 'BW'); -INSERT INTO StdDestinations VALUES (29, 1, DEFAULT, 'la_country_BVT', 'BVT', 'BV'); -INSERT INTO StdDestinations VALUES (30, 1, DEFAULT, 'la_country_BRA', 'BRA', 'BR'); -INSERT INTO StdDestinations VALUES (31, 1, DEFAULT, 'la_country_IOT', 'IOT', 'IO'); -INSERT INTO StdDestinations VALUES (32, 1, DEFAULT, 'la_country_BRN', 'BRN', 'BN'); -INSERT INTO StdDestinations VALUES (33, 1, DEFAULT, 'la_country_BGR', 'BGR', 'BG'); -INSERT INTO StdDestinations VALUES (34, 1, DEFAULT, 'la_country_BFA', 'BFA', 'BF'); -INSERT INTO StdDestinations VALUES (35, 1, DEFAULT, 'la_country_BDI', 'BDI', 'BI'); -INSERT INTO StdDestinations VALUES (36, 1, DEFAULT, 'la_country_KHM', 'KHM', 'KH'); -INSERT INTO StdDestinations VALUES (37, 1, DEFAULT, 'la_country_CMR', 'CMR', 'CM'); -INSERT INTO StdDestinations VALUES (38, 1, DEFAULT, 'la_country_CAN', 'CAN', 'CA'); -INSERT INTO StdDestinations VALUES (39, 1, DEFAULT, 'la_country_CPV', 'CPV', 'CV'); -INSERT INTO StdDestinations VALUES (40, 1, DEFAULT, 'la_country_CYM', 'CYM', 'KY'); -INSERT INTO StdDestinations VALUES (41, 1, DEFAULT, 'la_country_CAF', 'CAF', 'CF'); -INSERT INTO StdDestinations VALUES (42, 1, DEFAULT, 'la_country_TCD', 'TCD', 'TD'); -INSERT INTO StdDestinations VALUES (43, 1, DEFAULT, 'la_country_CHL', 'CHL', 'CL'); -INSERT INTO StdDestinations VALUES (44, 1, DEFAULT, 'la_country_CHN', 'CHN', 'CN'); -INSERT INTO StdDestinations VALUES (45, 1, DEFAULT, 'la_country_CXR', 'CXR', 'CX'); -INSERT INTO StdDestinations VALUES (46, 1, DEFAULT, 'la_country_CCK', 'CCK', 'CC'); -INSERT INTO StdDestinations VALUES (47, 1, DEFAULT, 'la_country_COL', 'COL', 'CO'); -INSERT INTO StdDestinations VALUES (48, 1, DEFAULT, 'la_country_COM', 'COM', 'KM'); -INSERT INTO StdDestinations VALUES (49, 1, DEFAULT, 'la_country_COD', 'COD', 'CD'); -INSERT INTO StdDestinations VALUES (50, 1, DEFAULT, 'la_country_COG', 'COG', 'CG'); -INSERT INTO StdDestinations VALUES (51, 1, DEFAULT, 'la_country_COK', 'COK', 'CK'); -INSERT INTO StdDestinations VALUES (52, 1, DEFAULT, 'la_country_CRI', 'CRI', 'CR'); -INSERT INTO StdDestinations VALUES (53, 1, DEFAULT, 'la_country_CIV', 'CIV', 'CI'); -INSERT INTO StdDestinations VALUES (54, 1, DEFAULT, 'la_country_HRV', 'HRV', 'HR'); -INSERT INTO StdDestinations VALUES (55, 1, DEFAULT, 'la_country_CUB', 'CUB', 'CU'); -INSERT INTO StdDestinations VALUES (56, 1, DEFAULT, 'la_country_CYP', 'CYP', 'CY'); -INSERT INTO StdDestinations VALUES (57, 1, DEFAULT, 'la_country_CZE', 'CZE', 'CZ'); -INSERT INTO StdDestinations VALUES (58, 1, DEFAULT, 'la_country_DNK', 'DNK', 'DK'); -INSERT INTO StdDestinations VALUES (59, 1, DEFAULT, 'la_country_DJI', 'DJI', 'DJ'); -INSERT INTO StdDestinations VALUES (60, 1, DEFAULT, 'la_country_DMA', 'DMA', 'DM'); -INSERT INTO StdDestinations VALUES (61, 1, DEFAULT, 'la_country_DOM', 'DOM', 'DO'); -INSERT INTO StdDestinations VALUES (62, 1, DEFAULT, 'la_country_TLS', 'TLS', 'TL'); -INSERT INTO StdDestinations VALUES (63, 1, DEFAULT, 'la_country_ECU', 'ECU', 'EC'); -INSERT INTO StdDestinations VALUES (64, 1, DEFAULT, 'la_country_EGY', 'EGY', 'EG'); -INSERT INTO StdDestinations VALUES (65, 1, DEFAULT, 'la_country_SLV', 'SLV', 'SV'); -INSERT INTO StdDestinations VALUES (66, 1, DEFAULT, 'la_country_GNQ', 'GNQ', 'GQ'); -INSERT INTO StdDestinations VALUES (67, 1, DEFAULT, 'la_country_ERI', 'ERI', 'ER'); -INSERT INTO StdDestinations VALUES (68, 1, DEFAULT, 'la_country_EST', 'EST', 'EE'); -INSERT INTO StdDestinations VALUES (69, 1, DEFAULT, 'la_country_ETH', 'ETH', 'ET'); -INSERT INTO StdDestinations VALUES (70, 1, DEFAULT, 'la_country_FLK', 'FLK', 'FK'); -INSERT INTO StdDestinations VALUES (71, 1, DEFAULT, 'la_country_FRO', 'FRO', 'FO'); -INSERT INTO StdDestinations VALUES (72, 1, DEFAULT, 'la_country_FJI', 'FJI', 'FJ'); -INSERT INTO StdDestinations VALUES (73, 1, DEFAULT, 'la_country_FIN', 'FIN', 'FI'); -INSERT INTO StdDestinations VALUES (74, 1, DEFAULT, 'la_country_FRA', 'FRA', 'FR'); -INSERT INTO StdDestinations VALUES (75, 1, DEFAULT, 'la_country_FXX', 'FXX', 'FX'); -INSERT INTO StdDestinations VALUES (76, 1, DEFAULT, 'la_country_GUF', 'GUF', 'GF'); -INSERT INTO StdDestinations VALUES (77, 1, DEFAULT, 'la_country_PYF', 'PYF', 'PF'); -INSERT INTO StdDestinations VALUES (78, 1, DEFAULT, 'la_country_ATF', 'ATF', 'TF'); -INSERT INTO StdDestinations VALUES (79, 1, DEFAULT, 'la_country_GAB', 'GAB', 'GA'); -INSERT INTO StdDestinations VALUES (80, 1, DEFAULT, 'la_country_GMB', 'GMB', 'GM'); -INSERT INTO StdDestinations VALUES (81, 1, DEFAULT, 'la_country_GEO', 'GEO', 'GE'); -INSERT INTO StdDestinations VALUES (82, 1, DEFAULT, 'la_country_DEU', 'DEU', 'DE'); -INSERT INTO StdDestinations VALUES (83, 1, DEFAULT, 'la_country_GHA', 'GHA', 'GH'); -INSERT INTO StdDestinations VALUES (84, 1, DEFAULT, 'la_country_GIB', 'GIB', 'GI'); -INSERT INTO StdDestinations VALUES (85, 1, DEFAULT, 'la_country_GRC', 'GRC', 'GR'); -INSERT INTO StdDestinations VALUES (86, 1, DEFAULT, 'la_country_GRL', 'GRL', 'GL'); -INSERT INTO StdDestinations VALUES (87, 1, DEFAULT, 'la_country_GRD', 'GRD', 'GD'); -INSERT INTO StdDestinations VALUES (88, 1, DEFAULT, 'la_country_GLP', 'GLP', 'GP'); -INSERT INTO StdDestinations VALUES (89, 1, DEFAULT, 'la_country_GUM', 'GUM', 'GU'); -INSERT INTO StdDestinations VALUES (90, 1, DEFAULT, 'la_country_GTM', 'GTM', 'GT'); -INSERT INTO StdDestinations VALUES (91, 1, DEFAULT, 'la_country_GIN', 'GIN', 'GN'); -INSERT INTO StdDestinations VALUES (92, 1, DEFAULT, 'la_country_GNB', 'GNB', 'GW'); -INSERT INTO StdDestinations VALUES (93, 1, DEFAULT, 'la_country_GUY', 'GUY', 'GY'); -INSERT INTO StdDestinations VALUES (94, 1, DEFAULT, 'la_country_HTI', 'HTI', 'HT'); -INSERT INTO StdDestinations VALUES (95, 1, DEFAULT, 'la_country_HMD', 'HMD', 'HM'); -INSERT INTO StdDestinations VALUES (96, 1, DEFAULT, 'la_country_HND', 'HND', 'HN'); -INSERT INTO StdDestinations VALUES (97, 1, DEFAULT, 'la_country_HKG', 'HKG', 'HK'); -INSERT INTO StdDestinations VALUES (98, 1, DEFAULT, 'la_country_HUN', 'HUN', 'HU'); -INSERT INTO StdDestinations VALUES (99, 1, DEFAULT, 'la_country_ISL', 'ISL', 'IS'); -INSERT INTO StdDestinations VALUES (100, 1, DEFAULT, 'la_country_IND', 'IND', 'IN'); -INSERT INTO StdDestinations VALUES (101, 1, DEFAULT, 'la_country_IDN', 'IDN', 'ID'); -INSERT INTO StdDestinations VALUES (102, 1, DEFAULT, 'la_country_IRN', 'IRN', 'IR'); -INSERT INTO StdDestinations VALUES (103, 1, DEFAULT, 'la_country_IRQ', 'IRQ', 'IQ'); -INSERT INTO StdDestinations VALUES (104, 1, DEFAULT, 'la_country_IRL', 'IRL', 'IE'); -INSERT INTO StdDestinations VALUES (105, 1, DEFAULT, 'la_country_ISR', 'ISR', 'IL'); -INSERT INTO StdDestinations VALUES (106, 1, DEFAULT, 'la_country_ITA', 'ITA', 'IT'); -INSERT INTO StdDestinations VALUES (107, 1, DEFAULT, 'la_country_JAM', 'JAM', 'JM'); -INSERT INTO StdDestinations VALUES (108, 1, DEFAULT, 'la_country_JPN', 'JPN', 'JP'); -INSERT INTO StdDestinations VALUES (109, 1, DEFAULT, 'la_country_JOR', 'JOR', 'JO'); -INSERT INTO StdDestinations VALUES (110, 1, DEFAULT, 'la_country_KAZ', 'KAZ', 'KZ'); -INSERT INTO StdDestinations VALUES (111, 1, DEFAULT, 'la_country_KEN', 'KEN', 'KE'); -INSERT INTO StdDestinations VALUES (112, 1, DEFAULT, 'la_country_KIR', 'KIR', 'KI'); -INSERT INTO StdDestinations VALUES (113, 1, DEFAULT, 'la_country_PRK', 'PRK', 'KP'); -INSERT INTO StdDestinations VALUES (114, 1, DEFAULT, 'la_country_KOR', 'KOR', 'KR'); -INSERT INTO StdDestinations VALUES (115, 1, DEFAULT, 'la_country_KWT', 'KWT', 'KW'); -INSERT INTO StdDestinations VALUES (116, 1, DEFAULT, 'la_country_KGZ', 'KGZ', 'KG'); -INSERT INTO StdDestinations VALUES (117, 1, DEFAULT, 'la_country_LAO', 'LAO', 'LA'); -INSERT INTO StdDestinations VALUES (118, 1, DEFAULT, 'la_country_LVA', 'LVA', 'LV'); -INSERT INTO StdDestinations VALUES (119, 1, DEFAULT, 'la_country_LBN', 'LBN', 'LB'); -INSERT INTO StdDestinations VALUES (120, 1, DEFAULT, 'la_country_LSO', 'LSO', 'LS'); -INSERT INTO StdDestinations VALUES (121, 1, DEFAULT, 'la_country_LBR', 'LBR', 'LR'); -INSERT INTO StdDestinations VALUES (122, 1, DEFAULT, 'la_country_LBY', 'LBY', 'LY'); -INSERT INTO StdDestinations VALUES (123, 1, DEFAULT, 'la_country_LIE', 'LIE', 'LI'); -INSERT INTO StdDestinations VALUES (124, 1, DEFAULT, 'la_country_LTU', 'LTU', 'LT'); -INSERT INTO StdDestinations VALUES (125, 1, DEFAULT, 'la_country_LUX', 'LUX', 'LU'); -INSERT INTO StdDestinations VALUES (126, 1, DEFAULT, 'la_country_MAC', 'MAC', 'MO'); -INSERT INTO StdDestinations VALUES (127, 1, DEFAULT, 'la_country_MKD', 'MKD', 'MK'); -INSERT INTO StdDestinations VALUES (128, 1, DEFAULT, 'la_country_MDG', 'MDG', 'MG'); -INSERT INTO StdDestinations VALUES (129, 1, DEFAULT, 'la_country_MWI', 'MWI', 'MW'); -INSERT INTO StdDestinations VALUES (130, 1, DEFAULT, 'la_country_MYS', 'MYS', 'MY'); -INSERT INTO StdDestinations VALUES (131, 1, DEFAULT, 'la_country_MDV', 'MDV', 'MV'); -INSERT INTO StdDestinations VALUES (132, 1, DEFAULT, 'la_country_MLI', 'MLI', 'ML'); -INSERT INTO StdDestinations VALUES (133, 1, DEFAULT, 'la_country_MLT', 'MLT', 'MT'); -INSERT INTO StdDestinations VALUES (134, 1, DEFAULT, 'la_country_MHL', 'MHL', 'MH'); -INSERT INTO StdDestinations VALUES (135, 1, DEFAULT, 'la_country_MTQ', 'MTQ', 'MQ'); -INSERT INTO StdDestinations VALUES (136, 1, DEFAULT, 'la_country_MRT', 'MRT', 'MR'); -INSERT INTO StdDestinations VALUES (137, 1, DEFAULT, 'la_country_MUS', 'MUS', 'MU'); -INSERT INTO StdDestinations VALUES (138, 1, DEFAULT, 'la_country_MYT', 'MYT', 'YT'); -INSERT INTO StdDestinations VALUES (139, 1, DEFAULT, 'la_country_MEX', 'MEX', 'MX'); -INSERT INTO StdDestinations VALUES (140, 1, DEFAULT, 'la_country_FSM', 'FSM', 'FM'); -INSERT INTO StdDestinations VALUES (141, 1, DEFAULT, 'la_country_MDA', 'MDA', 'MD'); -INSERT INTO StdDestinations VALUES (142, 1, DEFAULT, 'la_country_MCO', 'MCO', 'MC'); -INSERT INTO StdDestinations VALUES (143, 1, DEFAULT, 'la_country_MNG', 'MNG', 'MN'); -INSERT INTO StdDestinations VALUES (144, 1, DEFAULT, 'la_country_MSR', 'MSR', 'MS'); -INSERT INTO StdDestinations VALUES (145, 1, DEFAULT, 'la_country_MAR', 'MAR', 'MA'); -INSERT INTO StdDestinations VALUES (146, 1, DEFAULT, 'la_country_MOZ', 'MOZ', 'MZ'); -INSERT INTO StdDestinations VALUES (147, 1, DEFAULT, 'la_country_MMR', 'MMR', 'MM'); -INSERT INTO StdDestinations VALUES (148, 1, DEFAULT, 'la_country_NAM', 'NAM', 'NA'); -INSERT INTO StdDestinations VALUES (149, 1, DEFAULT, 'la_country_NRU', 'NRU', 'NR'); -INSERT INTO StdDestinations VALUES (150, 1, DEFAULT, 'la_country_NPL', 'NPL', 'NP'); -INSERT INTO StdDestinations VALUES (151, 1, DEFAULT, 'la_country_NLD', 'NLD', 'NL'); -INSERT INTO StdDestinations VALUES (152, 1, DEFAULT, 'la_country_ANT', 'ANT', 'AN'); -INSERT INTO StdDestinations VALUES (153, 1, DEFAULT, 'la_country_NCL', 'NCL', 'NC'); -INSERT INTO StdDestinations VALUES (154, 1, DEFAULT, 'la_country_NZL', 'NZL', 'NZ'); -INSERT INTO StdDestinations VALUES (155, 1, DEFAULT, 'la_country_NIC', 'NIC', 'NI'); -INSERT INTO StdDestinations VALUES (156, 1, DEFAULT, 'la_country_NER', 'NER', 'NE'); -INSERT INTO StdDestinations VALUES (157, 1, DEFAULT, 'la_country_NGA', 'NGA', 'NG'); -INSERT INTO StdDestinations VALUES (158, 1, DEFAULT, 'la_country_NIU', 'NIU', 'NU'); -INSERT INTO StdDestinations VALUES (159, 1, DEFAULT, 'la_country_NFK', 'NFK', 'NF'); -INSERT INTO StdDestinations VALUES (160, 1, DEFAULT, 'la_country_MNP', 'MNP', 'MP'); -INSERT INTO StdDestinations VALUES (161, 1, DEFAULT, 'la_country_NOR', 'NOR', 'NO'); -INSERT INTO StdDestinations VALUES (162, 1, DEFAULT, 'la_country_OMN', 'OMN', 'OM'); -INSERT INTO StdDestinations VALUES (163, 1, DEFAULT, 'la_country_PAK', 'PAK', 'PK'); -INSERT INTO StdDestinations VALUES (164, 1, DEFAULT, 'la_country_PLW', 'PLW', 'PW'); -INSERT INTO StdDestinations VALUES (165, 1, DEFAULT, 'la_country_PSE', 'PSE', 'PS'); -INSERT INTO StdDestinations VALUES (166, 1, DEFAULT, 'la_country_PAN', 'PAN', 'PA'); -INSERT INTO StdDestinations VALUES (167, 1, DEFAULT, 'la_country_PNG', 'PNG', 'PG'); -INSERT INTO StdDestinations VALUES (168, 1, DEFAULT, 'la_country_PRY', 'PRY', 'PY'); -INSERT INTO StdDestinations VALUES (169, 1, DEFAULT, 'la_country_PER', 'PER', 'PE'); -INSERT INTO StdDestinations VALUES (170, 1, DEFAULT, 'la_country_PHL', 'PHL', 'PH'); -INSERT INTO StdDestinations VALUES (171, 1, DEFAULT, 'la_country_PCN', 'PCN', 'PN'); -INSERT INTO StdDestinations VALUES (172, 1, DEFAULT, 'la_country_POL', 'POL', 'PL'); -INSERT INTO StdDestinations VALUES (173, 1, DEFAULT, 'la_country_PRT', 'PRT', 'PT'); -INSERT INTO StdDestinations VALUES (174, 1, DEFAULT, 'la_country_PRI', 'PRI', 'PR'); -INSERT INTO StdDestinations VALUES (175, 1, DEFAULT, 'la_country_QAT', 'QAT', 'QA'); -INSERT INTO StdDestinations VALUES (176, 1, DEFAULT, 'la_country_REU', 'REU', 'RE'); -INSERT INTO StdDestinations VALUES (177, 1, DEFAULT, 'la_country_ROU', 'ROU', 'RO'); -INSERT INTO StdDestinations VALUES (178, 1, DEFAULT, 'la_country_RUS', 'RUS', 'RU'); -INSERT INTO StdDestinations VALUES (179, 1, DEFAULT, 'la_country_RWA', 'RWA', 'RW'); -INSERT INTO StdDestinations VALUES (180, 1, DEFAULT, 'la_country_KNA', 'KNA', 'KN'); -INSERT INTO StdDestinations VALUES (181, 1, DEFAULT, 'la_country_LCA', 'LCA', 'LC'); -INSERT INTO StdDestinations VALUES (182, 1, DEFAULT, 'la_country_VCT', 'VCT', 'VC'); -INSERT INTO StdDestinations VALUES (183, 1, DEFAULT, 'la_country_WSM', 'WSM', 'WS'); -INSERT INTO StdDestinations VALUES (184, 1, DEFAULT, 'la_country_SMR', 'SMR', 'SM'); -INSERT INTO StdDestinations VALUES (185, 1, DEFAULT, 'la_country_STP', 'STP', 'ST'); -INSERT INTO StdDestinations VALUES (186, 1, DEFAULT, 'la_country_SAU', 'SAU', 'SA'); -INSERT INTO StdDestinations VALUES (187, 1, DEFAULT, 'la_country_SEN', 'SEN', 'SN'); -INSERT INTO StdDestinations VALUES (188, 1, DEFAULT, 'la_country_SYC', 'SYC', 'SC'); -INSERT INTO StdDestinations VALUES (189, 1, DEFAULT, 'la_country_SLE', 'SLE', 'SL'); -INSERT INTO StdDestinations VALUES (190, 1, DEFAULT, 'la_country_SGP', 'SGP', 'SG'); -INSERT INTO StdDestinations VALUES (191, 1, DEFAULT, 'la_country_SVK', 'SVK', 'SK'); -INSERT INTO StdDestinations VALUES (192, 1, DEFAULT, 'la_country_SVN', 'SVN', 'SI'); -INSERT INTO StdDestinations VALUES (193, 1, DEFAULT, 'la_country_SLB', 'SLB', 'SB'); -INSERT INTO StdDestinations VALUES (194, 1, DEFAULT, 'la_country_SOM', 'SOM', 'SO'); -INSERT INTO StdDestinations VALUES (195, 1, DEFAULT, 'la_country_ZAF', 'ZAF', 'ZA'); -INSERT INTO StdDestinations VALUES (196, 1, DEFAULT, 'la_country_SGS', 'SGS', 'GS'); -INSERT INTO StdDestinations VALUES (197, 1, DEFAULT, 'la_country_ESP', 'ESP', 'ES'); -INSERT INTO StdDestinations VALUES (198, 1, DEFAULT, 'la_country_LKA', 'LKA', 'LK'); -INSERT INTO StdDestinations VALUES (199, 1, DEFAULT, 'la_country_SHN', 'SHN', 'SH'); -INSERT INTO StdDestinations VALUES (200, 1, DEFAULT, 'la_country_SPM', 'SPM', 'PM'); -INSERT INTO StdDestinations VALUES (201, 1, DEFAULT, 'la_country_SDN', 'SDN', 'SD'); -INSERT INTO StdDestinations VALUES (202, 1, DEFAULT, 'la_country_SUR', 'SUR', 'SR'); -INSERT INTO StdDestinations VALUES (203, 1, DEFAULT, 'la_country_SJM', 'SJM', 'SJ'); -INSERT INTO StdDestinations VALUES (204, 1, DEFAULT, 'la_country_SWZ', 'SWZ', 'SZ'); -INSERT INTO StdDestinations VALUES (205, 1, DEFAULT, 'la_country_SWE', 'SWE', 'SE'); -INSERT INTO StdDestinations VALUES (206, 1, DEFAULT, 'la_country_CHE', 'CHE', 'CH'); -INSERT INTO StdDestinations VALUES (207, 1, DEFAULT, 'la_country_SYR', 'SYR', 'SY'); -INSERT INTO StdDestinations VALUES (208, 1, DEFAULT, 'la_country_TWN', 'TWN', 'TW'); -INSERT INTO StdDestinations VALUES (209, 1, DEFAULT, 'la_country_TJK', 'TJK', 'TJ'); -INSERT INTO StdDestinations VALUES (210, 1, DEFAULT, 'la_country_TZA', 'TZA', 'TZ'); -INSERT INTO StdDestinations VALUES (211, 1, DEFAULT, 'la_country_THA', 'THA', 'TH'); -INSERT INTO StdDestinations VALUES (212, 1, DEFAULT, 'la_country_TGO', 'TGO', 'TG'); -INSERT INTO StdDestinations VALUES (213, 1, DEFAULT, 'la_country_TKL', 'TKL', 'TK'); -INSERT INTO StdDestinations VALUES (214, 1, DEFAULT, 'la_country_TON', 'TON', 'TO'); -INSERT INTO StdDestinations VALUES (215, 1, DEFAULT, 'la_country_TTO', 'TTO', 'TT'); -INSERT INTO StdDestinations VALUES (216, 1, DEFAULT, 'la_country_TUN', 'TUN', 'TN'); -INSERT INTO StdDestinations VALUES (217, 1, DEFAULT, 'la_country_TUR', 'TUR', 'TR'); -INSERT INTO StdDestinations VALUES (218, 1, DEFAULT, 'la_country_TKM', 'TKM', 'TM'); -INSERT INTO StdDestinations VALUES (219, 1, DEFAULT, 'la_country_TCA', 'TCA', 'TC'); -INSERT INTO StdDestinations VALUES (220, 1, DEFAULT, 'la_country_TUV', 'TUV', 'TV'); -INSERT INTO StdDestinations VALUES (221, 1, DEFAULT, 'la_country_UGA', 'UGA', 'UG'); -INSERT INTO StdDestinations VALUES (222, 1, DEFAULT, 'la_country_UKR', 'UKR', 'UA'); -INSERT INTO StdDestinations VALUES (223, 1, DEFAULT, 'la_country_ARE', 'ARE', 'AE'); -INSERT INTO StdDestinations VALUES (224, 1, DEFAULT, 'la_country_GBR', 'GBR', 'GB'); -INSERT INTO StdDestinations VALUES (225, 1, DEFAULT, 'la_country_USA', 'USA', 'US'); -INSERT INTO StdDestinations VALUES (226, 1, DEFAULT, 'la_country_UMI', 'UMI', 'UM'); -INSERT INTO StdDestinations VALUES (227, 1, DEFAULT, 'la_country_URY', 'URY', 'UY'); -INSERT INTO StdDestinations VALUES (228, 1, DEFAULT, 'la_country_UZB', 'UZB', 'UZ'); -INSERT INTO StdDestinations VALUES (229, 1, DEFAULT, 'la_country_VUT', 'VUT', 'VU'); -INSERT INTO StdDestinations VALUES (230, 1, DEFAULT, 'la_country_VAT', 'VAT', 'VA'); -INSERT INTO StdDestinations VALUES (231, 1, DEFAULT, 'la_country_VEN', 'VEN', 'VE'); -INSERT INTO StdDestinations VALUES (232, 1, DEFAULT, 'la_country_VNM', 'VNM', 'VN'); -INSERT INTO StdDestinations VALUES (233, 1, DEFAULT, 'la_country_VGB', 'VGB', 'VG'); -INSERT INTO StdDestinations VALUES (234, 1, DEFAULT, 'la_country_VIR', 'VIR', 'VI'); -INSERT INTO StdDestinations VALUES (235, 1, DEFAULT, 'la_country_WLF', 'WLF', 'WF'); -INSERT INTO StdDestinations VALUES (236, 1, DEFAULT, 'la_country_ESH', 'ESH', 'EH'); -INSERT INTO StdDestinations VALUES (237, 1, DEFAULT, 'la_country_YEM', 'YEM', 'YE'); -INSERT INTO StdDestinations VALUES (238, 1, DEFAULT, 'la_country_YUG', 'YUG', 'YU'); -INSERT INTO StdDestinations VALUES (239, 1, DEFAULT, 'la_country_ZMB', 'ZMB', 'ZM'); -INSERT INTO StdDestinations VALUES (240, 1, DEFAULT, 'la_country_ZWE', 'ZWE', 'ZW'); -INSERT INTO StdDestinations VALUES (370, 2, 38, 'la_state_YT', 'YT', DEFAULT); -INSERT INTO StdDestinations VALUES (369, 2, 38, 'la_state_SK', 'SK', DEFAULT); -INSERT INTO StdDestinations VALUES (368, 2, 38, 'la_state_QC', 'QC', DEFAULT); -INSERT INTO StdDestinations VALUES (367, 2, 38, 'la_state_PE', 'PE', DEFAULT); -INSERT INTO StdDestinations VALUES (366, 2, 38, 'la_state_ON', 'ON', DEFAULT); -INSERT INTO StdDestinations VALUES (365, 2, 38, 'la_state_NU', 'NU', DEFAULT); -INSERT INTO StdDestinations VALUES (364, 2, 38, 'la_state_NS', 'NS', DEFAULT); -INSERT INTO StdDestinations VALUES (363, 2, 38, 'la_state_NT', 'NT', DEFAULT); -INSERT INTO StdDestinations VALUES (362, 2, 38, 'la_state_NL', 'NL', DEFAULT); -INSERT INTO StdDestinations VALUES (361, 2, 38, 'la_state_NB', 'NB', DEFAULT); -INSERT INTO StdDestinations VALUES (360, 2, 38, 'la_state_MB', 'MB', DEFAULT); -INSERT INTO StdDestinations VALUES (359, 2, 38, 'la_state_BC', 'BC', DEFAULT); -INSERT INTO StdDestinations VALUES (358, 2, 38, 'la_state_AB', 'AB', DEFAULT); -INSERT INTO StdDestinations VALUES (357, 2, 225, 'la_state_DC', 'DC', DEFAULT); -INSERT INTO StdDestinations VALUES (356, 2, 225, 'la_state_WY', 'WY', DEFAULT); -INSERT INTO StdDestinations VALUES (355, 2, 225, 'la_state_WI', 'WI', DEFAULT); -INSERT INTO StdDestinations VALUES (354, 2, 225, 'la_state_WV', 'WV', DEFAULT); -INSERT INTO StdDestinations VALUES (353, 2, 225, 'la_state_WA', 'WA', DEFAULT); -INSERT INTO StdDestinations VALUES (352, 2, 225, 'la_state_VA', 'VA', DEFAULT); -INSERT INTO StdDestinations VALUES (351, 2, 225, 'la_state_VT', 'VT', DEFAULT); -INSERT INTO StdDestinations VALUES (350, 2, 225, 'la_state_UT', 'UT', DEFAULT); -INSERT INTO StdDestinations VALUES (349, 2, 225, 'la_state_TX', 'TX', DEFAULT); -INSERT INTO StdDestinations VALUES (348, 2, 225, 'la_state_TN', 'TN', DEFAULT); -INSERT INTO StdDestinations VALUES (347, 2, 225, 'la_state_SD', 'SD', DEFAULT); -INSERT INTO StdDestinations VALUES (346, 2, 225, 'la_state_SC', 'SC', DEFAULT); -INSERT INTO StdDestinations VALUES (345, 2, 225, 'la_state_RI', 'RI', DEFAULT); -INSERT INTO StdDestinations VALUES (344, 2, 225, 'la_state_PR', 'PR', DEFAULT); -INSERT INTO StdDestinations VALUES (343, 2, 225, 'la_state_PA', 'PA', DEFAULT); -INSERT INTO StdDestinations VALUES (342, 2, 225, 'la_state_OR', 'OR', DEFAULT); -INSERT INTO StdDestinations VALUES (341, 2, 225, 'la_state_OK', 'OK', DEFAULT); -INSERT INTO StdDestinations VALUES (340, 2, 225, 'la_state_OH', 'OH', DEFAULT); -INSERT INTO StdDestinations VALUES (339, 2, 225, 'la_state_ND', 'ND', DEFAULT); -INSERT INTO StdDestinations VALUES (338, 2, 225, 'la_state_NC', 'NC', DEFAULT); -INSERT INTO StdDestinations VALUES (337, 2, 225, 'la_state_NY', 'NY', DEFAULT); -INSERT INTO StdDestinations VALUES (336, 2, 225, 'la_state_NM', 'NM', DEFAULT); -INSERT INTO StdDestinations VALUES (335, 2, 225, 'la_state_NJ', 'NJ', DEFAULT); -INSERT INTO StdDestinations VALUES (334, 2, 225, 'la_state_NH', 'NH', DEFAULT); -INSERT INTO StdDestinations VALUES (333, 2, 225, 'la_state_NV', 'NV', DEFAULT); -INSERT INTO StdDestinations VALUES (332, 2, 225, 'la_state_NE', 'NE', DEFAULT); -INSERT INTO StdDestinations VALUES (331, 2, 225, 'la_state_MT', 'MT', DEFAULT); -INSERT INTO StdDestinations VALUES (330, 2, 225, 'la_state_MO', 'MO', DEFAULT); -INSERT INTO StdDestinations VALUES (329, 2, 225, 'la_state_MS', 'MS', DEFAULT); -INSERT INTO StdDestinations VALUES (328, 2, 225, 'la_state_MN', 'MN', DEFAULT); -INSERT INTO StdDestinations VALUES (327, 2, 225, 'la_state_MI', 'MI', DEFAULT); -INSERT INTO StdDestinations VALUES (326, 2, 225, 'la_state_MA', 'MA', DEFAULT); -INSERT INTO StdDestinations VALUES (325, 2, 225, 'la_state_MD', 'MD', DEFAULT); -INSERT INTO StdDestinations VALUES (324, 2, 225, 'la_state_ME', 'ME', DEFAULT); -INSERT INTO StdDestinations VALUES (323, 2, 225, 'la_state_LA', 'LA', DEFAULT); -INSERT INTO StdDestinations VALUES (322, 2, 225, 'la_state_KY', 'KY', DEFAULT); -INSERT INTO StdDestinations VALUES (321, 2, 225, 'la_state_KS', 'KS', DEFAULT); -INSERT INTO StdDestinations VALUES (320, 2, 225, 'la_state_IA', 'IA', DEFAULT); -INSERT INTO StdDestinations VALUES (319, 2, 225, 'la_state_IN', 'IN', DEFAULT); -INSERT INTO StdDestinations VALUES (318, 2, 225, 'la_state_IL', 'IL', DEFAULT); -INSERT INTO StdDestinations VALUES (317, 2, 225, 'la_state_ID', 'ID', DEFAULT); -INSERT INTO StdDestinations VALUES (316, 2, 225, 'la_state_HI', 'HI', DEFAULT); -INSERT INTO StdDestinations VALUES (315, 2, 225, 'la_state_GA', 'GA', DEFAULT); -INSERT INTO StdDestinations VALUES (314, 2, 225, 'la_state_FL', 'FL', DEFAULT); -INSERT INTO StdDestinations VALUES (313, 2, 225, 'la_state_DE', 'DE', DEFAULT); -INSERT INTO StdDestinations VALUES (312, 2, 225, 'la_state_CT', 'CT', DEFAULT); -INSERT INTO StdDestinations VALUES (311, 2, 225, 'la_state_CO', 'CO', DEFAULT); -INSERT INTO StdDestinations VALUES (310, 2, 225, 'la_state_CA', 'CA', DEFAULT); -INSERT INTO StdDestinations VALUES (309, 2, 225, 'la_state_AR', 'AR', DEFAULT); -INSERT INTO StdDestinations VALUES (308, 2, 225, 'la_state_AZ', 'AZ', DEFAULT); -INSERT INTO StdDestinations VALUES (307, 2, 225, 'la_state_AK', 'AK', DEFAULT); -INSERT INTO StdDestinations VALUES (306, 2, 225, 'la_state_AL', 'AL', DEFAULT); +INSERT INTO CountryStates (CountryStateId, Type, StateCountryId, IsoCode, ShortIsoCode) VALUES +(1, 1, NULL, 'AFG', 'AF'), +(2, 1, NULL, 'ALB', 'AL'), +(3, 1, NULL, 'DZA', 'DZ'), +(4, 1, NULL, 'ASM', 'AS'), +(5, 1, NULL, 'AND', 'AD'), +(6, 1, NULL, 'AGO', 'AO'), +(7, 1, NULL, 'AIA', 'AI'), +(8, 1, NULL, 'ATA', 'AQ'), +(9, 1, NULL, 'ATG', 'AG'), +(10, 1, NULL, 'ARG', 'AR'), +(11, 1, NULL, 'ARM', 'AM'), +(12, 1, NULL, 'ABW', 'AW'), +(13, 1, NULL, 'AUS', 'AU'), +(14, 1, NULL, 'AUT', 'AT'), +(15, 1, NULL, 'AZE', 'AZ'), +(16, 1, NULL, 'BHS', 'BS'), +(17, 1, NULL, 'BHR', 'BH'), +(18, 1, NULL, 'BGD', 'BD'), +(19, 1, NULL, 'BRB', 'BB'), +(20, 1, NULL, 'BLR', 'BY'), +(21, 1, NULL, 'BEL', 'BE'), +(22, 1, NULL, 'BLZ', 'BZ'), +(23, 1, NULL, 'BEN', 'BJ'), +(24, 1, NULL, 'BMU', 'BM'), +(25, 1, NULL, 'BTN', 'BT'), +(26, 1, NULL, 'BOL', 'BO'), +(27, 1, NULL, 'BIH', 'BA'), +(28, 1, NULL, 'BWA', 'BW'), +(29, 1, NULL, 'BVT', 'BV'), +(30, 1, NULL, 'BRA', 'BR'), +(31, 1, NULL, 'IOT', 'IO'), +(32, 1, NULL, 'BRN', 'BN'), +(33, 1, NULL, 'BGR', 'BG'), +(34, 1, NULL, 'BFA', 'BF'), +(35, 1, NULL, 'BDI', 'BI'), +(36, 1, NULL, 'KHM', 'KH'), +(37, 1, NULL, 'CMR', 'CM'), +(38, 1, NULL, 'CAN', 'CA'), +(39, 1, NULL, 'CPV', 'CV'), +(40, 1, NULL, 'CYM', 'KY'), +(41, 1, NULL, 'CAF', 'CF'), +(42, 1, NULL, 'TCD', 'TD'), +(43, 1, NULL, 'CHL', 'CL'), +(44, 1, NULL, 'CHN', 'CN'), +(45, 1, NULL, 'CXR', 'CX'), +(46, 1, NULL, 'CCK', 'CC'), +(47, 1, NULL, 'COL', 'CO'), +(48, 1, NULL, 'COM', 'KM'), +(49, 1, NULL, 'COD', 'CD'), +(50, 1, NULL, 'COG', 'CG'), +(51, 1, NULL, 'COK', 'CK'), +(52, 1, NULL, 'CRI', 'CR'), +(53, 1, NULL, 'CIV', 'CI'), +(54, 1, NULL, 'HRV', 'HR'), +(55, 1, NULL, 'CUB', 'CU'), +(56, 1, NULL, 'CYP', 'CY'), +(57, 1, NULL, 'CZE', 'CZ'), +(58, 1, NULL, 'DNK', 'DK'), +(59, 1, NULL, 'DJI', 'DJ'), +(60, 1, NULL, 'DMA', 'DM'), +(61, 1, NULL, 'DOM', 'DO'), +(62, 1, NULL, 'TLS', 'TL'), +(63, 1, NULL, 'ECU', 'EC'), +(64, 1, NULL, 'EGY', 'EG'), +(65, 1, NULL, 'SLV', 'SV'), +(66, 1, NULL, 'GNQ', 'GQ'), +(67, 1, NULL, 'ERI', 'ER'), +(68, 1, NULL, 'EST', 'EE'), +(69, 1, NULL, 'ETH', 'ET'), +(70, 1, NULL, 'FLK', 'FK'), +(71, 1, NULL, 'FRO', 'FO'), +(72, 1, NULL, 'FJI', 'FJ'), +(73, 1, NULL, 'FIN', 'FI'), +(74, 1, NULL, 'FRA', 'FR'), +(75, 1, NULL, 'FXX', 'FX'), +(76, 1, NULL, 'GUF', 'GF'), +(77, 1, NULL, 'PYF', 'PF'), +(78, 1, NULL, 'ATF', 'TF'), +(79, 1, NULL, 'GAB', 'GA'), +(80, 1, NULL, 'GMB', 'GM'), +(81, 1, NULL, 'GEO', 'GE'), +(82, 1, NULL, 'DEU', 'DE'), +(83, 1, NULL, 'GHA', 'GH'), +(84, 1, NULL, 'GIB', 'GI'), +(85, 1, NULL, 'GRC', 'GR'), +(86, 1, NULL, 'GRL', 'GL'), +(87, 1, NULL, 'GRD', 'GD'), +(88, 1, NULL, 'GLP', 'GP'), +(89, 1, NULL, 'GUM', 'GU'), +(90, 1, NULL, 'GTM', 'GT'), +(91, 1, NULL, 'GIN', 'GN'), +(92, 1, NULL, 'GNB', 'GW'), +(93, 1, NULL, 'GUY', 'GY'), +(94, 1, NULL, 'HTI', 'HT'), +(95, 1, NULL, 'HMD', 'HM'), +(96, 1, NULL, 'HND', 'HN'), +(97, 1, NULL, 'HKG', 'HK'), +(98, 1, NULL, 'HUN', 'HU'), +(99, 1, NULL, 'ISL', 'IS'), +(100, 1, NULL, 'IND', 'IN'), +(101, 1, NULL, 'IDN', 'ID'), +(102, 1, NULL, 'IRN', 'IR'), +(103, 1, NULL, 'IRQ', 'IQ'), +(104, 1, NULL, 'IRL', 'IE'), +(105, 1, NULL, 'ISR', 'IL'), +(106, 1, NULL, 'ITA', 'IT'), +(107, 1, NULL, 'JAM', 'JM'), +(108, 1, NULL, 'JPN', 'JP'), +(109, 1, NULL, 'JOR', 'JO'), +(110, 1, NULL, 'KAZ', 'KZ'), +(111, 1, NULL, 'KEN', 'KE'), +(112, 1, NULL, 'KIR', 'KI'), +(113, 1, NULL, 'PRK', 'KP'), +(114, 1, NULL, 'KOR', 'KR'), +(115, 1, NULL, 'KWT', 'KW'), +(116, 1, NULL, 'KGZ', 'KG'), +(117, 1, NULL, 'LAO', 'LA'), +(118, 1, NULL, 'LVA', 'LV'), +(119, 1, NULL, 'LBN', 'LB'), +(120, 1, NULL, 'LSO', 'LS'), +(121, 1, NULL, 'LBR', 'LR'), +(122, 1, NULL, 'LBY', 'LY'), +(123, 1, NULL, 'LIE', 'LI'), +(124, 1, NULL, 'LTU', 'LT'), +(125, 1, NULL, 'LUX', 'LU'), +(126, 1, NULL, 'MAC', 'MO'), +(127, 1, NULL, 'MKD', 'MK'), +(128, 1, NULL, 'MDG', 'MG'), +(129, 1, NULL, 'MWI', 'MW'), +(130, 1, NULL, 'MYS', 'MY'), +(131, 1, NULL, 'MDV', 'MV'), +(132, 1, NULL, 'MLI', 'ML'), +(133, 1, NULL, 'MLT', 'MT'), +(134, 1, NULL, 'MHL', 'MH'), +(135, 1, NULL, 'MTQ', 'MQ'), +(136, 1, NULL, 'MRT', 'MR'), +(137, 1, NULL, 'MUS', 'MU'), +(138, 1, NULL, 'MYT', 'YT'), +(139, 1, NULL, 'MEX', 'MX'), +(140, 1, NULL, 'FSM', 'FM'), +(141, 1, NULL, 'MDA', 'MD'), +(142, 1, NULL, 'MCO', 'MC'), +(143, 1, NULL, 'MNG', 'MN'), +(144, 1, NULL, 'MSR', 'MS'), +(145, 1, NULL, 'MAR', 'MA'), +(146, 1, NULL, 'MOZ', 'MZ'), +(147, 1, NULL, 'MMR', 'MM'), +(148, 1, NULL, 'NAM', 'NA'), +(149, 1, NULL, 'NRU', 'NR'), +(150, 1, NULL, 'NPL', 'NP'), +(151, 1, NULL, 'NLD', 'NL'), +(152, 1, NULL, 'ANT', 'AN'), +(153, 1, NULL, 'NCL', 'NC'), +(154, 1, NULL, 'NZL', 'NZ'), +(155, 1, NULL, 'NIC', 'NI'), +(156, 1, NULL, 'NER', 'NE'), +(157, 1, NULL, 'NGA', 'NG'), +(158, 1, NULL, 'NIU', 'NU'), +(159, 1, NULL, 'NFK', 'NF'), +(160, 1, NULL, 'MNP', 'MP'), +(161, 1, NULL, 'NOR', 'NO'), +(162, 1, NULL, 'OMN', 'OM'), +(163, 1, NULL, 'PAK', 'PK'), +(164, 1, NULL, 'PLW', 'PW'), +(165, 1, NULL, 'PSE', 'PS'), +(166, 1, NULL, 'PAN', 'PA'), +(167, 1, NULL, 'PNG', 'PG'), +(168, 1, NULL, 'PRY', 'PY'), +(169, 1, NULL, 'PER', 'PE'), +(170, 1, NULL, 'PHL', 'PH'), +(171, 1, NULL, 'PCN', 'PN'), +(172, 1, NULL, 'POL', 'PL'), +(173, 1, NULL, 'PRT', 'PT'), +(174, 1, NULL, 'PRI', 'PR'), +(175, 1, NULL, 'QAT', 'QA'), +(176, 1, NULL, 'REU', 'RE'), +(177, 1, NULL, 'ROU', 'RO'), +(178, 1, NULL, 'RUS', 'RU'), +(179, 1, NULL, 'RWA', 'RW'), +(180, 1, NULL, 'KNA', 'KN'), +(181, 1, NULL, 'LCA', 'LC'), +(182, 1, NULL, 'VCT', 'VC'), +(183, 1, NULL, 'WSM', 'WS'), +(184, 1, NULL, 'SMR', 'SM'), +(185, 1, NULL, 'STP', 'ST'), +(186, 1, NULL, 'SAU', 'SA'), +(187, 1, NULL, 'SEN', 'SN'), +(188, 1, NULL, 'SYC', 'SC'), +(189, 1, NULL, 'SLE', 'SL'), +(190, 1, NULL, 'SGP', 'SG'), +(191, 1, NULL, 'SVK', 'SK'), +(192, 1, NULL, 'SVN', 'SI'), +(193, 1, NULL, 'SLB', 'SB'), +(194, 1, NULL, 'SOM', 'SO'), +(195, 1, NULL, 'ZAF', 'ZA'), +(196, 1, NULL, 'SGS', 'GS'), +(197, 1, NULL, 'ESP', 'ES'), +(198, 1, NULL, 'LKA', 'LK'), +(199, 1, NULL, 'SHN', 'SH'), +(200, 1, NULL, 'SPM', 'PM'), +(201, 1, NULL, 'SDN', 'SD'), +(202, 1, NULL, 'SUR', 'SR'), +(203, 1, NULL, 'SJM', 'SJ'), +(204, 1, NULL, 'SWZ', 'SZ'), +(205, 1, NULL, 'SWE', 'SE'), +(206, 1, NULL, 'CHE', 'CH'), +(207, 1, NULL, 'SYR', 'SY'), +(208, 1, NULL, 'TWN', 'TW'), +(209, 1, NULL, 'TJK', 'TJ'), +(210, 1, NULL, 'TZA', 'TZ'), +(211, 1, NULL, 'THA', 'TH'), +(212, 1, NULL, 'TGO', 'TG'), +(213, 1, NULL, 'TKL', 'TK'), +(214, 1, NULL, 'TON', 'TO'), +(215, 1, NULL, 'TTO', 'TT'), +(216, 1, NULL, 'TUN', 'TN'), +(217, 1, NULL, 'TUR', 'TR'), +(218, 1, NULL, 'TKM', 'TM'), +(219, 1, NULL, 'TCA', 'TC'), +(220, 1, NULL, 'TUV', 'TV'), +(221, 1, NULL, 'UGA', 'UG'), +(222, 1, NULL, 'UKR', 'UA'), +(223, 1, NULL, 'ARE', 'AE'), +(224, 1, NULL, 'GBR', 'GB'), +(225, 1, NULL, 'USA', 'US'), +(226, 1, NULL, 'UMI', 'UM'), +(227, 1, NULL, 'URY', 'UY'), +(228, 1, NULL, 'UZB', 'UZ'), +(229, 1, NULL, 'VUT', 'VU'), +(230, 1, NULL, 'VAT', 'VA'), +(231, 1, NULL, 'VEN', 'VE'), +(232, 1, NULL, 'VNM', 'VN'), +(233, 1, NULL, 'VGB', 'VG'), +(234, 1, NULL, 'VIR', 'VI'), +(235, 1, NULL, 'WLF', 'WF'), +(236, 1, NULL, 'ESH', 'EH'), +(237, 1, NULL, 'YEM', 'YE'), +(238, 1, NULL, 'YUG', 'YU'), +(239, 1, NULL, 'ZMB', 'ZM'), +(240, 1, NULL, 'ZWE', 'ZW'), +(370, 2, 38, 'YT', NULL), +(369, 2, 38, 'SK', NULL), +(368, 2, 38, 'QC', NULL), +(367, 2, 38, 'PE', NULL), +(366, 2, 38, 'ON', NULL), +(365, 2, 38, 'NU', NULL), +(364, 2, 38, 'NS', NULL), +(363, 2, 38, 'NT', NULL), +(362, 2, 38, 'NL', NULL), +(361, 2, 38, 'NB', NULL), +(360, 2, 38, 'MB', NULL), +(359, 2, 38, 'BC', NULL), +(358, 2, 38, 'AB', NULL), +(357, 2, 225, 'DC', NULL), +(356, 2, 225, 'WY', NULL), +(355, 2, 225, 'WI', NULL), +(354, 2, 225, 'WV', NULL), +(353, 2, 225, 'WA', NULL), +(352, 2, 225, 'VA', NULL), +(351, 2, 225, 'VT', NULL), +(350, 2, 225, 'UT', NULL), +(349, 2, 225, 'TX', NULL), +(348, 2, 225, 'TN', NULL), +(347, 2, 225, 'SD', NULL), +(346, 2, 225, 'SC', NULL), +(345, 2, 225, 'RI', NULL), +(344, 2, 225, 'PR', NULL), +(343, 2, 225, 'PA', NULL), +(342, 2, 225, 'OR', NULL), +(341, 2, 225, 'OK', NULL), +(340, 2, 225, 'OH', NULL), +(339, 2, 225, 'ND', NULL), +(338, 2, 225, 'NC', NULL), +(337, 2, 225, 'NY', NULL), +(336, 2, 225, 'NM', NULL), +(335, 2, 225, 'NJ', NULL), +(334, 2, 225, 'NH', NULL), +(333, 2, 225, 'NV', NULL), +(332, 2, 225, 'NE', NULL), +(331, 2, 225, 'MT', NULL), +(330, 2, 225, 'MO', NULL), +(329, 2, 225, 'MS', NULL), +(328, 2, 225, 'MN', NULL), +(327, 2, 225, 'MI', NULL), +(326, 2, 225, 'MA', NULL), +(325, 2, 225, 'MD', NULL), +(324, 2, 225, 'ME', NULL), +(323, 2, 225, 'LA', NULL), +(322, 2, 225, 'KY', NULL), +(321, 2, 225, 'KS', NULL), +(320, 2, 225, 'IA', NULL), +(319, 2, 225, 'IN', NULL), +(318, 2, 225, 'IL', NULL), +(317, 2, 225, 'ID', NULL), +(316, 2, 225, 'HI', NULL), +(315, 2, 225, 'GA', NULL), +(314, 2, 225, 'FL', NULL), +(313, 2, 225, 'DE', NULL), +(312, 2, 225, 'CT', NULL), +(311, 2, 225, 'CO', NULL), +(310, 2, 225, 'CA', NULL), +(309, 2, 225, 'AR', NULL), +(308, 2, 225, 'AZ', NULL), +(307, 2, 225, 'AK', NULL), +(306, 2, 225, 'AL', NULL); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.VIEW', 'lu_PermName_Category.View_desc', 'lu_PermName_Category.View_error', 'In-Portal'); INSERT INTO PermissionConfig VALUES (DEFAULT, 'CATEGORY.ADD', 'lu_PermName_Category.Add_desc', 'lu_PermName_Category.Add_error', 'In-Portal'); Index: branches/5.1.x/core/admin_templates/country_states/country_state_edit.tpl =================================================================== diff -u -N --- branches/5.1.x/core/admin_templates/country_states/country_state_edit.tpl (revision 0) +++ branches/5.1.x/core/admin_templates/country_states/country_state_edit.tpl (revision 13470) @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + + + + + + +
+
+ + + + Index: branches/5.1.x/core/units/helpers/country_states_helper.php =================================================================== diff -u -N -r13151 -r13470 --- branches/5.1.x/core/units/helpers/country_states_helper.php (.../country_states_helper.php) (revision 13151) +++ branches/5.1.x/core/units/helpers/country_states_helper.php (.../country_states_helper.php) (revision 13470) @@ -1,6 +1,6 @@ Application->getUnitOption('country-state', 'TableName'); + + $sql = 'SELECT DISTINCT cname.IsoCode, cid.StateCountryId + FROM ' . $table_name . ' cid + JOIN ' . $table_name . ' cname ON cname.CountryStateId = cid.StateCountryId + WHERE cid.StateCountryId IS NOT NULL'; + $cache = $this->Conn->GetCol($sql, 'StateCountryId'); + } + + return $cache; + } + + /** + * Checks, that country with given 3symbol ISO code has states + * + * @param string $country_code + * @return bool + */ function CountryHasStates($country_code) { - return !$country_code ? false : in_array($country_code,$this->CountriesWithStates); + return $country_code ? in_array($country_code, $this->getCountriesWithStates()) : false; } /** @@ -32,93 +58,139 @@ */ function PopulateStates(&$event, $state_field, $country_field) { - static $country_states = Array (); + static $cache = Array (); $object =& $event->getObject(); - $country_abbr = $object->GetDBField($country_field); + /* @var $object kDBItem */ - if (!$country_abbr) { + $country_iso = $object->GetDBField($country_field); + + if (!$country_iso) { return ; } - if (!array_key_exists($country_abbr, $country_states)) { - $sql = 'SELECT DestId - FROM '.TABLE_PREFIX.'StdDestinations - WHERE DestType = 1 AND DestAbbr = '.$this->Conn->qstr($country_abbr); - $country_id = $this->Conn->GetOne($sql); + if (!array_key_exists($country_iso, $cache)) { + $country_id = $this->getCountryStateId($country_iso, DESTINATION_TYPE_COUNTRY); + if (!$country_id) { return ; } - $language_id = $this->Application->GetVar('m_lang'); + // don't use GetVar('m_lang') since it's always equals to default language on editing form in admin + $current_language = $this->Application->Phrases->LanguageId; + $primary_language = $this->Application->GetDefaultLanguageId(); - $sql = 'SELECT p.l' . $language_id . '_Translation as DestName, sd.DestAbbr - FROM ' . TABLE_PREFIX . 'StdDestinations AS sd - LEFT JOIN ' . TABLE_PREFIX . 'Phrase AS p ON p.Phrase = sd.DestName - WHERE DestType = 2 AND DestParentId = ' . $country_id . ' - ORDER BY l' . $language_id . '_Translation'; - $country_states[$country_abbr] = $this->Conn->GetCol($sql, 'DestAbbr'); + $sql = 'SELECT IF(l' . $current_language . '_Name = "", l' . $primary_language . '_Name, l' . $current_language . '_Name) AS Name, IsoCode + FROM ' . $this->Application->getUnitOption('country-state', 'TableName') . ' + WHERE (Type = ' . DESTINATION_TYPE_STATE . ') AND (StateCountryId = ' . $country_id . ') + ORDER BY Name ASC'; + $cache[$country_iso] = $this->Conn->GetCol($sql, 'IsoCode'); } - $object->Fields[$state_field]['options'] = $country_states[$country_abbr]; - $object->Fields[$state_field]['options'][''] = ''; + $field_options = $object->GetFieldOptions($state_field); + + $field_options['options'] = $cache[$country_iso]; + $field_options['options'][''] = ''; + + $object->SetFieldOptions($state_field, $field_options); } /** - * Returns valid state code for state name and country code passed + * Returns valid state ISO code for state name and country code passed * * @param string $state_name - * @param string $country_code + * @param string $country_iso * @return string */ - function CheckState($state_name, $country_code) + function getStateIso($state_name, $country_iso) { - if (!$this->CountryHasStates($country_code)) { + if (!$this->CountryHasStates($country_iso)) { return $state_name; } - $sql = 'SELECT sdStates.DestAbbr - FROM '.TABLE_PREFIX.'StdDestinations AS sdStates - LEFT JOIN '.TABLE_PREFIX.'Phrase AS p ON p.Phrase = sdStates.DestName - LEFT JOIN '.TABLE_PREFIX.'StdDestinations AS sdCountries ON sdStates.DestParentId = sdCountries.DestId - WHERE (sdStates.DestType = 2) AND - (sdStates.DestParentId = sdCountries.DestId) AND - (sdCountries.DestAbbr = %2$s) AND - ( - (LOWER(sdStates.DestAbbr) = %3$s) OR (LOWER(sdStates.DestAbbr2) = %3$s) OR (LOWER(sdStates.DestName) = %3$s) OR (LOWER(p.l%1$s_Translation) = %3$s) - )'; + $table_name = $this->Application->getUnitOption('country-state', 'TableName'); + $country_id = $this->getCountryStateId($country_iso, DESTINATION_TYPE_COUNTRY); - $state_name = trim( mb_strtolower($state_name) ); + // don't use GetVar('m_lang') since it's always equals to default language on editing form in admin + $current_language = $this->Application->Phrases->LanguageId; + $primary_language = $this->Application->GetDefaultLanguageId(); - $sql = sprintf($sql, (int)$this->Application->GetVar('m_lang'), $this->Conn->qstr($country_code), $this->Conn->qstr($state_name) ); + $sql = 'SELECT IsoCode + FROM ' . $table_name . ' + WHERE (Type = ' . DESTINATION_TYPE_STATE . ') AND (StateCountryId = %1$s) AND + ( + (IsoCode = %2$s) OR (UPPER(l%3$s_Name) = %2$s) OR (UPPER(l%4$s_Name) = %2$s) + )'; + $state_name = trim( mb_strtoupper($state_name) ); + $sql = sprintf($sql, $country_id, $this->Conn->qstr($state_name), $current_language, $primary_language); + return $this->Conn->GetOne($sql); } - function CheckStateField(&$event, $state_field, $country_field) + function CheckStateField(&$event, $state_field, $country_field, $auto_required = true) { + $object =& $event->getObject(); + /* @var $object kDBItem */ - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if($items_info) - { - list($id, $field_values) = each($items_info); - if( isset($field_values[$state_field]) && isset($field_values[$country_field]) ) - { - $user_state = getArrayValue($field_values,$state_field); - $valid_state = $this->CheckState($user_state, getArrayValue($field_values,$country_field) ); - if($valid_state !== false) - { - $field_values[$state_field] = $valid_state; - $items_info[$id] = $field_values; - $this->Application->SetVar( $event->getPrefixSpecial(true), $items_info); - } - else - { - $object =& $event->getObject(); - $object->Fields[$state_field]['options'][$user_state] = $user_state; - $object->SetError($state_field, 'invalid_state', 'la_invalid_state'); - } + $country_iso = $object->GetDBField($country_field); + + if ($auto_required) { + $object->setRequired($state_field, $this->CountryHasStates($country_iso)); + } + + $state = $object->GetDBField($state_field); + + if ($country_iso && $state) { + $state_iso = $this->getStateIso($state, $country_iso); + + if ($state_iso !== false) { + // replace state name with it's ISO code + $object->SetDBField($state_field, $state_iso); } + else { + // state not found by name -> report error + $object->SetError($state_field, 'invalid_state', 'la_invalid_state'); + } } } + + /** + * Returns country/state id based on given iso code and it's type + * + * @param string $iso_code + * @param int $type + * @return int + */ + function getCountryStateId($iso_code, $type) + { + $sql = 'SELECT ' . $this->Application->getUnitOption('country-state', 'IDField') . ' + FROM ' . $this->Application->getUnitOption('country-state', 'TableName') . ' + WHERE (Type = ' . $type . ') AND (IsoCode = ' . $this->Conn->qstr($iso_code) . ')'; + + return (int)$this->Conn->GetOne($sql); + } + + /** + * Returns 3 symbols ISO code from 2 symbols ISO code or otherwise, when $from_short parameter is used + * + * @param string $iso_code + * @param bool $from_short + * @return string + */ + function getCountryIso($iso_code, $from_short = false) + { + if ($from_short) { + $sql = 'SELECT IsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE ShortIsoCode = ' . $this->Conn->qstr($iso_code) . ' AND `Type` = ' . DESTINATION_TYPE_COUNTRY; + } + else { + $sql = 'SELECT ShortIsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE IsoCode = ' . $this->Conn->qstr($iso_code) . ' AND `Type` = ' . DESTINATION_TYPE_COUNTRY; + } + + return $this->Conn->GetOne($sql); + } } \ No newline at end of file Index: branches/5.1.x/core/kernel/constants.php =================================================================== diff -u -N -r13390 -r13470 --- branches/5.1.x/core/kernel/constants.php (.../constants.php) (revision 13390) +++ branches/5.1.x/core/kernel/constants.php (.../constants.php) (revision 13470) @@ -1,6 +1,6 @@ 0, 'Hooks' => Array ( Array ( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'u', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnPrepareStates', - ), - - Array ( 'Mode' => hBEFORE, 'Conditional' => false, 'HookToPrefix' => 'affil', @@ -374,12 +363,11 @@ 'Country' => Array( 'type' => 'string', 'formatter' => 'kOptionsFormatter', - 'options_sql' => ' SELECT %1$s - FROM '.TABLE_PREFIX.'StdDestinations - LEFT JOIN '.TABLE_PREFIX.'Phrase ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName - WHERE DestType = 1 - ORDER BY l%2$s_Translation', - 'option_key_field' => 'DestAbbr', 'option_title_field' => 'l%2$s_Translation', + 'options_sql' => ' SELECT IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode + FROM ' . TABLE_PREFIX . 'CountryStates + WHERE Type = ' . DESTINATION_TYPE_COUNTRY . ' + ORDER BY Name', + 'option_key_field' => 'IsoCode', 'option_title_field' => 'Name', 'not_null' => 1, 'default' => '' ), 'ResourceId' => Array('type' => 'int','not_null' => 1, 'default' => 0), Index: branches/5.1.x/core/install/upgrades.sql =================================================================== diff -u -N -r13454 -r13470 --- branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13454) +++ branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13470) @@ -1712,6 +1712,10 @@ DROP TABLE ConfigurationAdmin; +UPDATE ConfigurationValues +SET ValueList = '=+||SELECT l%3$s_Name AS OptionName, CountryStateId AS OptionValue FROM CountryStates WHERE Type = 1 ORDER BY OptionName' +WHERE ValueList = '=+||SELECT DestName AS OptionName, DestId AS OptionValue FROM StdDestinations WHERE COALESCE(DestParentId, 0) = 0 ORDER BY OptionName'; + ALTER TABLE Forms ADD RequireLogin TINYINT NOT NULL DEFAULT '0', ADD INDEX (RequireLogin), Index: branches/5.1.x/core/install/remove_schema.sql =================================================================== diff -u -N -r13390 -r13470 --- branches/5.1.x/core/install/remove_schema.sql (.../remove_schema.sql) (revision 13390) +++ branches/5.1.x/core/install/remove_schema.sql (.../remove_schema.sql) (revision 13470) @@ -21,7 +21,7 @@ DROP TABLE UserSession; DROP TABLE EmailLog; DROP TABLE Cache; -DROP TABLE StdDestinations; +DROP TABLE CountryStates; DROP TABLE Category; DROP TABLE CategoryCustomData; DROP TABLE CategoryItems; Index: branches/5.1.x/core/units/country_states/country_state_eh.php =================================================================== diff -u -N --- branches/5.1.x/core/units/country_states/country_state_eh.php (revision 0) +++ branches/5.1.x/core/units/country_states/country_state_eh.php (revision 13470) @@ -0,0 +1,110 @@ +getObject(); + /* @var $object kDBList */ + + if (($event->Special == 'selected') || ($event->Special == 'available')) { + $edit_picker_helper =& $this->Application->recallObject('EditPickerHelper'); + /* @var $edit_picker_helper EditPickerHelper */ + + $edit_picker_helper->applyFilter($event, 'Countries'); + + // only countries + $object->addFilter('type_filter', '%1$s.Type = ' . DESTINATION_TYPE_COUNTRY); + } + } + + /** + * Makes sure, that state country is always specified + * + * @param kEvent $event + */ + function OnBeforeItemCreate(&$event) + { + parent::OnBeforeItemCreate($event); + + $this->_setRequired($event); + } + + /** + * Makes sure, that state country is always specified + * + * @param kEvent $event + */ + function OnBeforeItemUpdate(&$event) + { + parent::OnBeforeItemUpdate($event); + + $this->_setRequired($event); + } + + /** + * Makes sure, that state country is always specified + * + * @param kEvent $event + */ + function _setRequired(&$event) + { + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $field_options = $object->GetFieldOptions('IsoCode'); + + if ($object->GetDBField('Type') == DESTINATION_TYPE_STATE) { + $object->setRequired('StateCountryId'); + $field_options['unique'] = Array ('Type', 'StateCountryId'); + } + else { + $object->setRequired('StateCountryId', false); + $field_options['unique'] = Array ('Type'); + } + + $object->SetFieldOptions('IsoCode', $field_options); + } + + /** + * Don't allow to delete countries, that have states + * + * @param kEvent $event + */ + function OnBeforeItemDelete(&$event) + { + parent::OnBeforeItemDelete($event); + + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + + if ($cs_helper->CountryHasStates( $object->GetDBField('IsoCode') )) { + $event->status = erFAIL; + return ; + } + } + } Index: branches/5.1.x/core/admin_templates/users/users_edit.tpl =================================================================== diff -u -N -r12657 -r13470 --- branches/5.1.x/core/admin_templates/users/users_edit.tpl (.../users_edit.tpl) (revision 12657) +++ branches/5.1.x/core/admin_templates/users/users_edit.tpl (.../users_edit.tpl) (revision 13470) @@ -80,7 +80,7 @@ - + Index: branches/5.1.x/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r13212 -r13470 --- branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 13212) +++ branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 13470) @@ -1,6 +1,6 @@ Application->recallObject('CountryStatesHelper'); - $state_iso = $cs_helper->CheckState($check_state, $check_country); + /* @var $cs_helper kCountryStatesHelper */ + + $state_iso = $cs_helper->getStateIso($check_state, $check_country); + if ($state_iso !== false) { $object->SetDBField('VariableValue', $state_iso); }