Page MenuHomeIn-Portal Phabricator

in-link
No OneTemporary

File Metadata

Created
Mon, Feb 24, 11:53 AM
Index: branches/5.3.x/units/links/links_event_handler.php
===================================================================
--- branches/5.3.x/units/links/links_event_handler.php (revision 15671)
+++ branches/5.3.x/units/links/links_event_handler.php (revision 15672)
@@ -1,612 +1,612 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class LinksEventHandler extends kCatDBEventHandler {
/**
* Allows to override standard permission mapping
*
* @return void
* @access protected
* @see kEventHandler::$permMapping
*/
protected function mapPermissions()
{
parent::mapPermissions();
$permissions = Array (
'OnContactFormSubmit' => Array ('self' => true),
'OnProcessReciprocalLinks' => Array ('self' => true),
'OnSetGrouping' => Array ('self' => 'view'),
'OnStoreSelected' => Array ('self' => 'view'),
'OnMerge' => Array ('self' => 'edit'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @return void
* @access protected
* @see kDBEventHandler::OnListBuild()
*/
protected function SetCustomQuery(kEvent $event)
{
parent::SetCustomQuery($event);
$object = $event->getObject();
/* @var $object kDBList */
if ( !$this->Application->isAdminUser ) {
$object->addFilter('expire_filter', '(Expire > ' . adodb_mktime() . ' OR Expire IS NULL)');
}
if ( substr($event->Special, 0, 10) == 'duplicates' ) {
$object->removeFilter('category_filter');
$link_helper = $this->Application->recallObject('LinkHelper');
/* @var $link_helper LinkHelper */
$grouping = $link_helper->getGrouping($event->getPrefixSpecial());
switch ($event->Special) {
case 'duplicates':
foreach ($grouping as $group_field) {
$object->AddGroupByField($object->TableName . '.' . $group_field);
}
$object->addFilter('has_dupes_filter', 'DupeCount > 1', kDBList::AGGREGATE_FILTER);
break;
case 'duplicates-sub':
$main_object = $this->Application->recallObject($event->Prefix . '.duplicates');
/* @var $main_object kDBItem */
foreach ($grouping as $field_index => $group_field) {
$object->addFilter('dupe_filter_' . $field_index, '%1$s.`' . $group_field . '` = ' . $this->Conn->qstr($main_object->GetDBField($group_field)));
}
break;
}
$object->addFilter('primary_filter', TABLE_PREFIX . 'CategoryItems.PrimaryCat = 1');
}
}
/**
* Set groping fields for link duplicate checker
*
* @param kEvent $event
*/
function OnSetGrouping($event)
{
$this->Application->LinkVar($event->getPrefixSpecial(true).'_dupe_fields', $event->getPrefixSpecial().'_dupe_fields');
}
/**
* Merge duplicate links together (only categories) & delete duplicates
*
* @param kEvent $event
*/
function OnMerge($event)
{
$link_helper = $this->Application->recallObject('LinkHelper');
/* @var $link_helper LinkHelper */
$grouping = $link_helper->getGrouping($event->getPrefixSpecial());
$ids = $this->StoreSelectedIDs($event);
if ( !$ids ) {
return;
}
// check, that user has not selected multiple links from same group
$primary_links = Array ();
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'SELECT *
FROM ' . $table_name . '
WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ')';
$links = $this->Conn->Query($sql, $id_field);
$groping_error = false;
foreach ($links as $link_data) {
$group_key = '';
foreach ($grouping as $grouping_field) {
$group_key .= 'main_table.`' . $grouping_field . '` = ' . $this->Conn->qstr($link_data[$grouping_field]) . ' AND ';
}
$group_key = substr($group_key, 0, -5);
if ( isset($primary_links[$group_key]) ) {
$groping_error = true;
break;
}
else {
$primary_links[$group_key] = $link_data['ResourceId'];
}
}
if ( !$groping_error ) {
$temp_handler = $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$categories_sql = ' SELECT main_table.ResourceId, ci.CategoryId, main_table.' . $id_field . '
FROM ' . $table_name . ' main_table
LEFT JOIN ' . TABLE_PREFIX . 'CategoryItems ci ON main_table.ResourceId = ci.ItemResourceId
WHERE %s';
foreach ($primary_links as $group_key => $primary_resource_id) {
$categories = Array ();
$group_links = Array ();
$group_categories = $this->Conn->Query(sprintf($categories_sql, $group_key));
foreach ($group_categories as $category_data) {
$group_links[$category_data['ResourceId']] = $category_data[$id_field];
$categories[$category_data['ResourceId'] == $primary_resource_id ? 'remove' : 'add'][] = $category_data['CategoryId'];
}
unset($group_links[$primary_resource_id]);
$categories = array_unique(array_diff($categories['add'], $categories['remove']));
if ( $categories ) {
// add link to other link categories
$values_sql = '';
foreach ($categories as $category_id) {
$values_sql .= '(' . $category_id . ',' . $primary_resource_id . ',0),';
}
$values_sql = substr($values_sql, 0, -1);
$insert_sql = 'INSERT INTO ' . TABLE_PREFIX . 'CategoryItems (CategoryId,ItemResourceId,PrimaryCat) VALUES ' . $values_sql;
$this->Conn->Query($insert_sql);
}
// delete all links from group except primary
$temp_handler->DeleteItems($event->Prefix, $event->Special, array_values($group_links));
}
}
else {
$event->status = kEvent::erFAIL;
$event->redirect = false;
$this->Application->SetVar($event->getPrefixSpecial().'_error', 1);
}
}
/**
* Stores ids, that were selected in duplicate checker
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnStoreSelected(kEvent $event)
{
$this->StoreSelectedIDs($event);
$event->SetRedirectParam('pass', 'm,' . $event->getPrefixSpecial());
}
/**
* Allows to enhance link after creation
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnCreate(kEvent $event)
{
parent::OnCreate($event);
if ( $event->status != kEvent::erSUCCESS ) {
return;
}
$object = $event->getObject();
/* @var $object kDBItem */
// replace 0 id in post with actual created id (used in enhancement process)
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
kUtil::array_rename_key($items_info, 0, $object->GetID());
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
// listing was created -> enhance it right away
$enhancement_event = new kEvent('ls:OnRequestEnhancement');
$this->Application->HandleEvent($enhancement_event);
if ( ($enhancement_event->status == kEvent::erSUCCESS) && strlen($enhancement_event->redirect) ) {
$event->SetRedirectParam('next_template', $event->redirect);
$event->redirect = $enhancement_event->redirect;
}
}
/**
* Adds free listing option to listing type selection
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterConfigRead(kEvent $event)
{
parent::OnAfterConfigRead($event);
if (defined('IS_INSTALL') && IS_INSTALL) {
return ;
}
$free_listings = $this->Application->ConfigValue('Link_AllowFreeListings');
$virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
$virtual_fields['ListingTypeId']['options'] = $free_listings ? Array (0 => 'lu_free_listing') : Array ();
$language_id = $this->Application->GetVar('m_lang');
$duplicate_options = array_flip($virtual_fields['DuplicateCheckFields']['options']);
$duplicate_options['NAME'] = 'l' . $language_id . '_Name';
$virtual_fields['DuplicateCheckFields']['options'] = array_flip($duplicate_options);
$default = $virtual_fields['DuplicateCheckFields']['default'];
$virtual_fields['DuplicateCheckFields']['default'] = str_replace('|Name|', '|l' . $language_id . '_Name|', $default);
$this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
if (!$this->Application->isAdminUser) {
// for now only on Front-End
$this->Application->setUnitOption($event->Prefix, 'PopulateMlFields', true);
}
}
/**
* contact us form submitted on link details page
*
* @param kEvent $event
*/
function OnContactFormSubmit($event)
{
$fields = Array (
'ContactFormFullName', 'ContactFormEmail', 'ContactFormSubject', 'ContactFormBody', 'ContactFormCaptcha'
);
// reset errors var
$this->Application->SetVar('ContactForm_HasErrors', '');
// 1. validate form fields
$required_fields = $this->Application->GetVar('FormRequiredFields');
foreach ($fields as $field_name) {
$field_value = trim($this->Application->GetVar($field_name));
if (in_array($field_name, $required_fields)) {
// custom captcha validation
if ($field_name == 'ContactFormCaptcha') {
if (!strlen($field_value) || ($field_value != $this->Application->RecallVar($event->Prefix . '_captcha_code'))) {
$this->Application->SetVar('error_'.$field_name, 1);
$captcha_helper = $this->Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
$this->Application->StoreVar($event->Prefix . '_captcha_code', $captcha_helper->GenerateCaptchaCode());
$event->status = kEvent::erFAIL;
$event->redirect = false;
}
}
// email validation
elseif (!strlen($field_value) || ($field_name == 'ContactFormEmail' && !preg_match('/'.REGEX_EMAIL_USER.'@'.REGEX_EMAIL_DOMAIN.'/', $field_value))) {
$this->Application->SetVar('error_'.$field_name, 1);
$event->status = kEvent::erFAIL;
$event->redirect = false;
}
}
}
if ($event->status != kEvent::erSUCCESS) {
// set errors var
$this->Application->SetVar('ContactForm_HasErrors', 1);
return ;
}
$object = $event->getObject(); // get link object
/* @var $object kDBItem */
$send_params = Array(
'from_name' => $this->Application->GetVar('ContactFormFullName'),
'from_email' => $this->Application->GetVar('ContactFormEmail'),
'from_subject' => $this->Application->GetVar('ContactFormSubject'),
'message' => $this->Application->GetVar('ContactFormBody'),
'to_linkname' => $object->GetField('Name'),
);
- $email_sent = $this->Application->EmailEventUser('LINK.CONTACTFORM', $object->GetDBField('CreatedById'), $send_params);
+ $email_sent = $this->Application->emailUser('LINK.CONTACTFORM', $object->GetDBField('CreatedById'), $send_params);
if ( $email_sent ) {
$event->redirect = $this->Application->GetVar('success_template');
$redirect_params = Array (
'opener' => 's',
'pass' => 'all',
'thankyou_header' => $this->Application->GetVar('success_label_header'),
'thankyou_text' => $this->Application->GetVar('success_label_body')
);
$event->setRedirectParams($redirect_params);
- $this->Application->EmailEventAdmin('LINK.CONTACTFORM', null, $send_params);
+ $this->Application->emailAdmin('LINK.CONTACTFORM', null, $send_params);
}
else {
$this->Application->SetVar('error_ContactFormEmail', 1);
$event->status = kEvent::erFAIL;
$event->redirect = false;
}
}
/**
* Makes reciprocal check on link, when it is created
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemCreate(kEvent $event)
{
parent::OnBeforeItemCreate($event);
$this->_checkLink($event);
}
/**
* Makes reciprocal check on link, when it is updated
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemUpdate(kEvent $event)
{
parent::OnBeforeItemUpdate($event);
$this->_checkLink($event);
}
/**
* Makes reciprocal check on link & saves results
*
* @param kEvent $event
*/
function _checkLink($event)
{
if (!$this->Application->ConfigValue('ReciprocalLinkChecking')) {
return ;
}
$object = $event->getObject();
/* @var $object kDBItem */
if ($object->GetDBField('Url') != $object->GetOriginalField('Url')) {
// check only when url was changed
$link_helper = $this->Application->recallObject('LinkHelper');
/* @var $link_helper LinkHelper */
$link_checked = $link_helper->CheckReciprocalURL($object->GetDBField('Url'));
$object->SetDBField('ReciprocalLinkFound', $link_checked ? LINK_IS_RECIPROCAL : LINK_IS_NOT_RECIPROCAL);
if (!$link_checked) {
- $this->Application->EmailEventAdmin('LINK.RECIPROCAL.CHECK.FAILED');
+ $this->Application->emailAdmin('LINK.RECIPROCAL.CHECK.FAILED');
}
}
}
/**
* Update links status by their reciprocal status
*
* @param kEvent $event
*/
function OnProcessReciprocalLinks($event)
{
if ( !$this->Application->ConfigValue('ReciprocalLinkChecking') ) {
return;
}
$object = $event->getObject( Array('skip_autoload' => true) );
/* @var $object kCatDBItem */
$link_helper = $this->Application->recallObject('LinkHelper');
/* @var $link_helper LinkHelper */
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
// 1. verify all links, that were not verified previously
$sql = 'SELECT ' . $id_field . '
FROM ' . $table_name . '
WHERE (ReciprocalLinkFound = 0)';
$not_checked_links = $this->Conn->GetCol($sql);
foreach ($not_checked_links as $link_id) {
$object->Load($link_id);
$link_checked = $link_helper->CheckReciprocalURL($object->GetDBField('Url'));
$object->SetDBField('ReciprocalLinkFound', $link_checked ? LINK_IS_RECIPROCAL : LINK_IS_NOT_RECIPROCAL);
$object->Update();
if ( $link_checked ) {
$object->ApproveChanges();
}
else {
$object->DeclineChanges();
- $this->Application->EmailEventAdmin('LINK.RECIPROCAL.CHECK.FAILED');
+ $this->Application->emailAdmin('LINK.RECIPROCAL.CHECK.FAILED');
}
}
// 2. approve all links, that have succeeded in reciprocal check (during adding/changing on front-end)
$sql = 'SELECT ' . $id_field . '
FROM ' . $table_name . '
WHERE (ReciprocalLinkFound = ' . LINK_IS_RECIPROCAL . ') AND (Status <> ' . STATUS_ACTIVE . ')';
$verified_links = $this->Conn->GetCol($sql);
foreach ($verified_links as $link_id) {
$object->Load($link_id);
$object->ApproveChanges();
}
// 3. decline all links, that failed in reciprocal check (during adding/changing on front-end)
$sql = 'SELECT ' . $id_field . '
FROM ' . $table_name . '
WHERE (ReciprocalLinkFound = ' . LINK_IS_NOT_RECIPROCAL . ') AND (Status <> ' . STATUS_DISABLED . ')';
$not_verified_links = $this->Conn->GetCol($sql);
foreach ($not_verified_links as $link_id) {
$object->Load($link_id);
$object->DeclineChanges();
}
}
/**
* Allows to load duplicate link by special id
*
* @param kEvent $event
* @return int
* @access public
*/
public function getPassedID(kEvent $event)
{
$id = parent::getPassedID($event);
if ( ($event->Special == 'duplicates') && !is_numeric($id) ) {
$load_keys = unserialize(base64_decode($id));
// can't return $load_keys as $id, because "kCatDBItem::GetKeyClause" will ignore them
foreach ($load_keys as $field => $value) {
$load_keys[$field] = $field . ' = ' . $this->Conn->qstr($value);
}
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE (' . implode(') AND (', $load_keys) . ')';
$id = $this->Conn->GetOne($sql);
}
return $id;
}
/**
* Returns events, that require item-based (not just event-name based) permission check
*
* @return Array
*/
function _getMassPermissionEvents()
{
$events = parent::_getMassPermissionEvents();
$events[] = 'OnMerge';
return $events;
}
/**
* [HOOK] Allows to add cloned subitem to given prefix
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnCloneSubItem(kEvent $event)
{
parent::OnCloneSubItem($event);
if ( $event->MasterEvent->Prefix == 'rev' ) {
$clones = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Clones');
$subitem_prefix = $event->Prefix . '-' . $event->MasterEvent->Prefix;
$clones[$subitem_prefix]['ConfigMapping'] = Array (
'PerPage' => 'Perpage_LinkReviews',
'ShortListPerPage' => 'Perpage_LinkReviews_Short',
'DefaultSorting1Field' => 'Link_ReviewsSort',
'DefaultSorting2Field' => 'Link_ReviewsSort2',
'DefaultSorting1Dir' => 'Link_ReviewsOrder',
'DefaultSorting2Dir' => 'Link_ReviewsOrder2',
'ReviewDelayInterval' => 'link_ReviewDelay_Interval',
'ReviewDelayValue' => 'link_ReviewDelay_Value',
);
$this->Application->setUnitOption($event->MasterEvent->Prefix, 'Clones', $clones);
}
}
/**
* Occurs before original item of item in pending editing got deleted (for hooking only)
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeDeleteOriginal(kEvent $event)
{
parent::OnBeforeDeleteOriginal($event);
$object = $event->getObject();
/* @var $object kDBItem */
$link_id = $event->getEventParam('original_id');
$new_resource_id = $object->GetDBField('ResourceId');
$sql = 'SELECT ResourceId
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '=' . $link_id;
$old_resource_id = $this->Conn->GetOne($sql);
$this->Application->SetVar('original_resource_id', $old_resource_id);
$this->changeResourceId('rel', 'TargetId', $old_resource_id, $new_resource_id);
}
/**
* Occurs after original item of item in pending editing got deleted
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterDeleteOriginal(kEvent $event)
{
parent::OnAfterDeleteOriginal($event);
$object = $event->getObject();
/* @var $object kDBItem */
$old_resource_id = $this->Application->GetVar('original_resource_id');
$new_resource_id = $object->GetDBField('ResourceId');
$this->changeResourceId('ls', 'ItemResourceId', $old_resource_id, $new_resource_id);
}
/**
* Changes item resource id in one field
*
* @param string $prefix
* @param string $field
* @param string $old_resource_id
* @param string $new_resource_id
* @return void
* @access protected
*/
protected function changeResourceId($prefix, $field, $old_resource_id, $new_resource_id)
{
$fields_hash = Array ($field => $new_resource_id);
$table_name = $this->Application->getUnitOption($prefix, 'TableName');
$this->Conn->doUpdate($fields_hash, $table_name, $field . ' = ' . $old_resource_id);
}
}
\ No newline at end of file
Index: branches/5.3.x/units/links/links_config.php
===================================================================
--- branches/5.3.x/units/links/links_config.php (revision 15671)
+++ branches/5.3.x/units/links/links_config.php (revision 15672)
@@ -1,654 +1,652 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'l',
'ItemClass' => Array ('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'LinkTagProcessor', 'file' => 'link_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'ConfigPriority' => 0,
'RewritePriority' => 101,
'RewriteListener' => 'CategoryItemRewrite:RewriteListener',
'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => 'cdata',
'DoSpecial' => '*',
'DoEvent' => 'OnDefineCustomFields',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => '#file',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'rev',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'fav',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'rel',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'img',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'ci',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnCloneSubItem',
),
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => '',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => 'captcha',
'DoSpecial' => '*',
'DoEvent' => 'OnPrepareCaptcha',
),
),
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'PerPage',
4 => 'event',
5 => 'mode',
),
'AggregateTags' => Array (
Array (
'AggregateTo' => 'l',
'AggregatedTagName' => 'ListLinks',
'LocalTagName' => 'PrintList2',
),
),
'CatalogItem' => true,
'AdminTemplatePath' => 'links',
'AdminTemplatePrefix' => 'links_',
'SearchConfigPostfix' => 'links',
'IDField' => 'LinkId',
'StatusField' => Array ('Status'), // field, that is affected by Approve/Decline events
'ItemType' => 4,
'StatisticsInfo' => Array (
'pending' => Array (
'icon' => 'icon16_link_pending.png',
'label' => 'la_Text_Links',
'js_url' => '#url#',
'url' => Array ('t' => 'catalog/advanced_view', 'SetTab' => 'l', 'pass' => 'm,l.showall', 'l.showall_event' => 'OnSetFilterPattern', 'l.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
'status' => STATUS_PENDING,
),
),
'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list
'ViewMenuPhrase' => 'la_title_Links',
'CatalogTabIcon' => 'in-link:icon16_links.png',
'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions
'CatalogSelectorName' => 'linklist', // used in old catalog section
'ItemPropertyMappings' => Array (
'NewDays' => 'Link_NewDays', // number of days item to be NEW
'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP
'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP
'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items
'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table
'ClickField' => 'Hits', // item click count is stored here (in item table)
),
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('l' => '!la_title_AddingLink!'),
'edit_status_labels' => Array ('l' => '!la_title_EditingLink!'),
'new_titlefield' => Array ('l' => '!la_title_NewLink!'),
),
'links_edit' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'link_list' => Array (
'prefixes' => Array ('c_List', 'l_List'),
'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links!",
'toolbar_buttons' => Array (),
),
'links_categories' => Array (
'prefixes' => Array ('l', 'l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'delete', 'setprimary',),
),
'links_relations' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'),
),
'links_images' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'move_up', 'move_down', 'setprimary', 'view', 'dbl-click'),
),
'links_files' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Files!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'view', 'dbl-click'),
),
'links_reviews' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'approve', 'decline', 'move_up', 'move_down', 'view', 'dbl-click'),
),
'links_custom' => Array (
'prefixes' => Array ('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'images_edit' => Array (
'prefixes' => Array ('l', 'l-img'),
'new_status_labels' => Array ('l-img' => '!la_title_Adding_Image!'),
'edit_status_labels' => Array ('l-img' => '!la_title_Editing_Image!'),
'new_titlefield' => Array ('l-img' => '!la_title_New_Image!'),
'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'file_edit' => Array (
'prefixes' => Array ('l', 'l-file'),
'new_status_labels' => Array ('l-file' => "!la_title_AddingFile!"),
'edit_status_labels' => Array ('l-file' => '!la_title_EditingFile!'),
'new_titlefield' => Array ('l-file' => '!la_title_NewFile!'),
'format' => "#l_status# '#l_titlefield#' - #l-file_status# '#l-file_titlefield#'",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'reviews_edit' => Array (
'prefixes' => Array ('l', 'l-rev'),
'new_status_labels' => Array ('l-rev' =>"!la_title_Adding_Review! '!la_title_New_Review!'"),
'edit_status_labels' => Array ('l-rev' => '!la_title_Editing_Review!'),
'format' => "#l_status# '#l_titlefield#' - #l-rev_status#",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'relations_edit' => Array (
'prefixes' => Array ('l', 'l-rel'),
'new_status_labels' => Array ('l-rel' =>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
'edit_status_labels' => Array ('l-rel' => '!la_title_Editing_Relationship!'),
'format' => "#l_status# '#l_titlefield#' - #l-rel_status#",
'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'),
),
'links_export' => Array ('format' => '!la_title_LinksExport!'),
'links_import' => Array ('format' => '!la_title_ImportLinks!'),
'duplicate_links' => Array (
'prefixes' => Array ('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! - %s",
'toolbar_buttons' => Array ('edit', 'view', 'dbl-click'),
),
'duplicate_links_view' => Array (
'prefixes' => Array ('l.duplicates-sub_List'), 'format' => "!la_title_Links!",
'toolbar_buttons' => Array ('cancel', 'edit', 'delete', 'merge_links', 'view', 'dbl-click'),
),
'tree_in-link' => Array ('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-link/links/links_edit', 'priority' => 1),
'categories' => Array ('title' => 'la_tab_Categories', 't' => 'in-link/links/links_categories', 'priority' => 2),
'relations' => Array ('title' => 'la_tab_Relations', 't' => 'in-link/links/links_relations', 'priority' => 3),
'images' => Array ('title' => 'la_tab_Images', 't' => 'in-link/links/links_images', 'priority' => 4),
'files' => Array ('title' => 'la_tab_Files', 't' => 'in-link/links/links_files', 'priority' => 5),
'reviews' => Array ('title' => 'la_tab_Reviews', 't' => 'in-link/links/links_reviews', 'priority' => 6),
'custom' => Array ('title' => 'la_tab_Custom', 't' => 'in-link/links/links_custom', 'priority' => 7),
),
),
'PermItemPrefix' => 'LINK',
'PermTabText' => 'In-Link',
'PermSection' => Array ('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'custom' => 'in-link:configuration_custom'),
'Sections' => Array (
'in-link' => Array (
'parent' => 'in-portal:root',
'icon' => 'settings_in-link',
'label' => 'la_title_In-Link',
'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2.3,
'container' => true,
'type' => stTREE,
),
'in-link:links' => Array (
'parent' => 'in-portal:site',
'icon' => 'links',
'label' => 'la_tab_Links',
'url' => Array ('t' => 'catalog/advanced_view', 'anchor' => 'tab-l.showall', 'pass' => 'm'),
'onclick' => 'setCatalogTab(\'l.showall\')',
'permissions' => Array ('view'),
'priority' => 3.1,
'type' => stTREE,
),
'in-link:duplicate_checker' => Array (
'parent' => 'in-link',
'icon' => 'duplicate_checker',
'label' => 'la_tab_DuplicateChecker',
'url' => Array ('t' => 'in-link/duplicate_checker', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 2,
'type' => stTREE,
),
// link settings
'in-link:setting_folder' => Array (
'parent' => 'in-portal:system',
'icon' => 'conf_directory',
'label' => 'la_title_In-Link',
'use_parent_header' => 1,
'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 3.3,
'container' => true,
'type' => stTREE,
),
/*'in-link:inlink_general' => Array (
'parent' => 'in-link:setting_folder',
'icon' => 'core:settings_general',
'label' => 'la_tab_GeneralSettings',
'url' => Array ('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit'),
'priority' => 0.9,
'type' => stTREE,
),*/
'in-link:configuration_output' => Array (
'parent' => 'in-link:setting_folder',
'icon' => 'core:conf_output',
'label' => 'la_tab_ConfigOutput',
'url' => Array ('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit'),
'priority' => 1,
'type' => stTREE,
),
'in-link:configuration_search' => Array (
'parent' => 'in-link:setting_folder',
'icon' => 'core:conf_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array ('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 2,
'type' => stTREE,
),
'in-link:configuration_custom' => Array (
'parent' => 'in-link:setting_folder',
'icon' => 'core:conf_customfields',
'label' => 'la_tab_ConfigCustom',
'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
),
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => kDBList::HAVING_FILTER),
Array ('mode' => 'AND', 'filters' => Array ('show_hot'), 'type' => kDBList::HAVING_FILTER),
Array ('mode' => 'AND', 'filters' => Array ('show_pop'), 'type' => kDBList::HAVING_FILTER),
Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => kDBList::WHERE_FILTER),
),
'Filters' => Array (
'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
'show_hot' => Array ('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
'show_pop' => Array ('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
),
),
'TableName' => TABLE_PREFIX.'Link',
'CustomDataTableName' => TABLE_PREFIX . 'LinkCustomData',
'CalculatedFields' => Array (
'' => Array (
- 'UserName' => 'IF (ISNULL(u.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Username)',
+ 'UserName' => 'IF (ISNULL(u.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', "root", IF (%1$s.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(u.Username = "", u.Email, u.Username))',
'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
'CategoryFilename' => TABLE_PREFIX.'Categories.NamedParentPath',
'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
'ParentPath' => TABLE_PREFIX.'Categories.ParentPath',
'AltName' => 'img.AltName',
'SameImages' => 'img.SameImages',
'LocalThumb' => 'img.LocalThumb',
'ThumbPath' => 'img.ThumbPath',
'ThumbUrl' => 'img.ThumbUrl',
'LocalImage' => 'img.LocalImage',
'LocalPath' => 'img.LocalPath',
'FullUrl' => 'img.Url',
),
),
'CacheModRewrite' => true,
'AggregatedCalculatedFields' => Array (
'duplicates' => Array (
'DupeCount' => 'COUNT(*)',
),
),
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'CategoryPermissionsCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId',
),
'ListSortings' => Array (
'' => Array (
'ForcedSorting' => Array ('EditorsPick' => 'desc', 'Priority' => 'desc'),
'Sorting' => Array ('Name' => 'asc', 'Description' => 'desc'),
)
),
'ItemSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Categories ON '.TABLE_PREFIX.'Categories.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCatalogImages img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
LEFT JOIN '.TABLE_PREFIX.'Users u ON %1$s.CreatedById = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'
),
'SubItems' => Array ('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata', 'l-fav', 'l-file'),
'Fields' => Array (
'LinkId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
'Name' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'max_len' => 255, 'default' => ''),
'AutomaticFilename' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'Description' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null),
'Url' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'Expire' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'Hits' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
'CachedRating' => Array ('type' => 'string', 'not_null' => 1, 'formatter' => 'kFormatter', 'default' => 0),
'CachedVotesQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'not_null' => 1, 'default' => 0),
'CachedReviewsQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'CreatedById' => Array (
'type' => 'int',
'formatter' => 'kLEFTFormatter',
'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),
- 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users
- WHERE `%s` = \'%s\'',
- 'left_key_field' => 'PortalUserId',
- 'left_title_field' => 'Username',
+ 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s',
+ 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD,
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
'sample_value' => 'Guest', 'required' => 1, 'default' => NULL,
),
- 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Username', 'default' => NULL),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'default' => NULL),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 2,
),
'EditorsPick' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0,
),
'ResourceId' => Array ('type' => 'int', 'default' => null),
'HotItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'NewItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'OrgId' => Array ('type' => 'int', 'default' => null),
'CustomTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
'MetaKeywords' => Array ('type' => 'string', 'default' => null),
'MetaDescription' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
'ReciprocalLinkFound' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_NotChecked', 1 => 'la_Yes', 2 => 'la_No'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
),
'VirtualFields' => Array (
'Relevance' => Array ('type' => 'float', 'default' => 0),
'UserName' => Array ('type' => 'string', 'default' => ''),
'DupeCount' => Array ('type' => 'string', 'default' => ''),
'ListingTypeId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %1$s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_title_field' => 'Name', 'option_key_field' => 'ListingTypeId', 'default' => 0),
'MoreCategories' => Array ('type' => 'string', 'default' => ''),
// export related fields: begin
'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
'ExportFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'CSV', /*2 => 'XML'*/), 'default' => 1),
'ExportFilename' => Array ('type' => 'string', 'default' => ''),
'FieldsSeparatedBy' => Array ('type' => 'string', 'default' => ', '),
'FieldsEnclosedBy' => Array ('type' => 'string', 'default' => '"'),
'LineEndings' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Windows', 2 => 'UNIX'), 'default' => 1),
'LineEndingsInside' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'CRLF', 2 => 'LF'), 'default' => 2),
'IncludeFieldTitles' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_No', 1 => 'la_Yes'),
'use_phrases' => 1, 'default' => 1,
),
'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''),
'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''),
'CategoryFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1),
'CategorySeparator' => Array ('type' => 'string', 'error_field' => 'CategoryFormat', 'default' => ':'),
'IsBaseCategory' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_No', 1 => 'la_Yes'),
'use_phrases' => 1, 'default' => 0,
),
// export related fields: end
// import related fields: begin
'FieldTitles' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Automatic', 2 => 'la_Manual'), 'use_phrases' => 1, 'default' => 1),
'ImportSource' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Upload', 2 => 'la_Local'), 'use_phrases' => 1, 'default' => 2),
'ImportFilename' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => EXPORT_BASE_PATH . '/', 'default' => ''),
'ImportLocalFilename' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''),
'CheckDuplicatesMethod' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_IDField', 2 => 'la_OtherFields'), 'use_phrases' => 1, 'default' => 1),
'ReplaceDuplicates' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0),
'DuplicateCheckFields' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'),
'SkipFirstRow' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 1),
// import related fields: end
'ThumbnailImage' => Array ('type' => 'string', 'default' => ''),
'FullImage' => Array ('type' => 'string', 'default' => ''),
'ImageAlt' => Array ('type' => 'string', 'default' => ''),
'Filename' => Array ('type' => 'string', 'default' => ''),
'CategoryFilename' => Array ('type' => 'string', 'default' => ''),
'PrimaryCat' => Array ('type' => 'int', 'default' => 0),
'IsHot' => Array ('type' => 'int', 'default' => 0),
'IsNew' => Array ('type' => 'int', 'default' => 0),
'IsPop' => Array ('type' => 'int', 'default' => 0),
'CachedNavbar' => Array ('type' => 'string', 'default' => ''),
'ParentPath' => Array ('type' => 'string', 'default' => ''),
// for primary image
'AltName' => Array ('type' => 'string', 'default' => ''),
'SameImages' => Array ('type' => 'string', 'default' => ''),
'LocalThumb' => Array ('type' => 'string', 'default' => ''),
'ThumbPath' => Array ('type' => 'string', 'default' => ''),
'ThumbUrl' => Array ('type' => 'string', 'default' => ''),
'LocalImage' => Array ('type' => 'string', 'default' => ''),
'LocalPath' => Array ('type' => 'string', 'default' => ''),
'FullUrl' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
0 => 'icon16_link_disabled.png',
1 => 'icon16_link.png',
2 => 'icon16_link_pending.png',
'NEW' => 'icon16_link_new.png',
),
'Fields' => Array (
'LinkId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array ('title' => 'column:la_fld_LinkName', 'data_block' => 'grid_catitem_td', 'width' => 200, ),
'Priority' => Array ('filter_block' => 'grid_range_filter', 'width' => 65),
'Url' => Array ('title' => 'la_col_LinkUrl', 'width' => 200, ),
'Description' => Array ('first_chars' => 100, 'width' => 100, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Modified' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'Hits' => Array ('filter_block' => 'grid_range_filter', 'width' => 60, ),
'CachedRating' => Array ('title' => 'column:la_fld_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'CachedReviewsQty' => Array ('title' => 'la_col_ReviewCount', 'filter_block' => 'grid_range_filter', 'width' => 85, ),
),
),
'Radio' => Array (
'Icons' => Array (
0 => 'icon16_link_disabled.png',
1 => 'icon16_link.png',
2 => 'icon16_link_pending.png',
'NEW' => 'icon16_link_new.png',
),
'Selector' => 'radio',
'Fields' => Array (
'LinkId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'Name' => Array ('title' => 'column:la_fld_LinkName', 'data_block' => 'grid_catitem_td', 'width' => 200, ),
'Priority' => Array ('filter_block' => 'grid_range_filter', 'width' => 65),
'Url' => Array ('title' => 'la_col_LinkUrl', 'width' => 200, ),
'Description' => Array ('first_chars' => 100, 'width' => 100, ),
'CreatedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Modified' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 70, ),
'Hits' => Array ('filter_block' => 'grid_range_filter', 'width' => 60, ),
'CachedRating' => Array ('title' => 'column:la_fld_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'CachedReviewsQty' => Array ('title' => 'la_col_ReviewCount', 'filter_block' => 'grid_range_filter', 'width' => 85, ),
),
),
'Duplicates' => Array (
'Icons' => Array (
0 => 'icon16_link_disabled.png',
1 => 'icon16_link.png',
2 => 'icon16_link_pending.png',
'NEW' => 'icon16_link_new.png',
),
'Fields' => Array (
'Name' => Array ('title' => 'column:la_fld_LinkName', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'Url' => Array ('title' => 'la_col_LinkUrl', 'filter_block' => 'grid_like_filter', 'width' => 300, ),
'DupeCount' => Array ('title' => 'la_col_DupeCount', 'filter_block' => 'grid_range_filter', 'width' => 100, ),
),
),
),
'ConfigMapping' => Array (
'PerPage' => 'Perpage_Links',
'ShortListPerPage' => 'Perpage_Links_Short',
'ForceEditorPick' => 'Link_ShowPick',
'DefaultSorting1Field' => 'Link_SortField',
'DefaultSorting2Field' => 'Link_SortField2',
'DefaultSorting1Dir' => 'Link_SortOrder',
'DefaultSorting2Dir' => 'Link_SortOrder2',
'RatingDelayValue' => 'link_RatingDelay_Value',
'RatingDelayInterval' => 'link_RatingDelay_Interval',
),
);
\ No newline at end of file
Index: branches/5.3.x/units/link_validation/link_validation_eh.php
===================================================================
--- branches/5.3.x/units/link_validation/link_validation_eh.php (revision 15671)
+++ branches/5.3.x/units/link_validation/link_validation_eh.php (revision 15672)
@@ -1,571 +1,571 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class LinkValidationEventHandler extends kDBEventHandler {
/**
* Allows to override standard permission mapping
*
* @return void
* @access protected
* @see kEventHandler::$permMapping
*/
protected function mapPermissions()
{
parent::mapPermissions();
$permissions = Array (
'OnResetValidationStatus' => Array ('self' => 'advanced:reset',),
'OnRestartValidation' => Array ('self' => 'advanced:restart',),
'OnContinueValidation' => Array ('self' => 'advanced:continue',),
'OnValidateSelected' => Array ('self' => 'advanced:validate',),
'OnValidateProgress' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',),
'OnCancelValidation' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',),
'OnCronValidation' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Define alternative event processing method names
*
* @return void
* @see kEventHandler::$eventMethods
* @access protected
*/
protected function mapEvents()
{
parent::mapEvents();
$events_map = Array (
'OnApproveLinks' => 'iterateItems',
'OnDeclineLinks' => 'iterateItems',
);
$this->eventMethods = array_merge($this->eventMethods, $events_map);
}
/**
* Checks user permission to execute given $event
*
* @param kEvent $event
* @return bool
* @access public
*/
public function CheckPermission(kEvent $event)
{
$check_events = Array ('OnApproveLinks', 'OnDeclineLinks', 'OnDeleteLinks');
if ( in_array($event->Name, $check_events) ) {
$ids = $this->_getSelectedIds($event);
$perm_value = true;
if ( $ids ) {
$perm_helper = $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
$items = $perm_helper->GetCategoryItemData('l', $ids);
$check_method = $event->Name == 'OnDeleteLinks' ? 'DeleteCheckPermission' : 'ModifyCheckPermission';
foreach ($items as $item_id => $item_data) {
if ( $perm_helper->$check_method($item_data['CreatedById'], $item_data['CategoryId'], 'l') == 0 ) {
// one of items selected has no permission
$perm_value = false;
break;
}
}
if ( !$perm_value ) {
$event->status = kEvent::erPERM_FAIL;
}
}
return $perm_value;
}
return parent::CheckPermission($event);
}
/**
* Adds calculates fields for category name
*
* @param kDBItem|kDBList $object
* @param kEvent $event
* @return void
* @access protected
*/
protected function prepareObject(&$object, kEvent $event)
{
parent::prepareObject($object, $event);
$object->addCalculatedField('CachedNavbar', 'c.l' . $this->Application->GetVar('m_lang') . '_CachedNavbar');
}
/**
* Allows to show only invalid links
*
* @param kEvent $event
* @return void
* @access protected
* @see kDBEventHandler::OnListBuild()
*/
protected function SetCustomQuery(kEvent $event)
{
parent::SetCustomQuery($event);
$object = $event->getObject();
/* @var $object kDBList */
$object->addFilter('primary_category_filter', 'ci.PrimaryCat = 1');
if ( $event->Special == 'invalid' ) {
$object->addFilter('status_filter', '%1$s.ValidationStatus = ' . LINK_VALIDATION_INVALID);
}
}
/**
* Restarts link validation process
*
* @param kEvent $event
*/
function OnRestartValidation($event)
{
$this->_resetValidation($event);
$this->OnContinueValidation($event);
}
/**
* Restarts link validation process
*
* @param kEvent $event
*/
function _resetValidation($event)
{
// 1. delete previous validation results
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName');
$ids = $this->Conn->GetCol($sql);
if ($ids) {
$temp_handler = $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$temp_handler->DeleteItems($event->Prefix, $event->Special, $ids);
}
}
/**
* Validates only selected links
*
* @param kEvent $event
*/
function OnValidateSelected($event)
{
$link_ids = $this->_getSelectedIds($event);
if (!$link_ids) {
return ;
}
$validation_data = Array (
'processed' => 0,
'total' => count($link_ids),
'items' => $link_ids,
);
$this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data));
$event->redirect = $this->Application->GetVar('progress_template');
}
/**
* Validates only links, that were not previously validated
*
* @param kEvent $event
*/
function OnContinueValidation($event)
{
$have_data = $this->_prepareValidation($event);
if ($have_data) {
$event->redirect = $this->Application->GetVar('progress_template');
}
}
/**
* Performs validation
*
* @param kEvent $event
* @param bool $from_ajax
*/
function _validate($event, $from_ajax = true)
{
$validation_data = unserialize( $this->Application->RecallVar($event->Prefix . '_status') );
$i = 0;
$link_ids = $validation_data['items'];
$per_page = count($link_ids) >= LINK_VALIDATION_PER_PAGE ? LINK_VALIDATION_PER_PAGE : count($link_ids);
while ($i < $per_page) {
$this->_validateLink($link_ids[$i]);
$i++;
}
// remove processed links from array
array_splice($link_ids, 0, LINK_VALIDATION_PER_PAGE);
// store validation progress
$validation_data['processed'] += $i;
$validation_data['items'] = $link_ids;
if ($validation_data['processed'] >= $validation_data['total']) {
// finished
- $this->Application->EmailEventAdmin('LINK.VALIDATION.RESULTS');
+ $this->Application->emailAdmin('LINK.VALIDATION.RESULTS');
$this->Application->RemoveVar($event->Prefix . '_status');
return true;
}
// show progress, proceed to next step
$this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data));
if ($from_ajax) {
echo $validation_data['processed'] / $validation_data['total'] * 100;
$event->status = kEvent::erSTOP;
}
return false;
}
/**
* Performs validation of links (called from AjaxProgressBar)
*
* @param kEvent $event
*/
function OnValidateProgress($event)
{
$done = $this->_validate($event, true);
if ($done) {
$this->Application->Redirect( $this->Application->GetVar('finish_template') );
}
}
/**
* Returns categories, that are located inside recycle bin category
*
* @return Array
*/
function _getRecycleBinCategories()
{
$recycle_bin = $this->Application->ConfigValue('RecycleBinFolder');
if (!is_numeric($recycle_bin)) {
return Array ();
}
$recycle_categories = $this->Application->RecallVar('recycle_categories');
if ($recycle_categories === false) {
$tree_indexes = $this->Application->getTreeIndex($recycle_bin);
$sql = 'SELECT ' . $this->Application->getUnitOption('c', 'IDField') . '
FROM ' . $this->Application->getUnitOption('c', 'TableName') . '
WHERE TreeLeft BETWEEN ' . $tree_indexes['TreeLeft'] . ' AND ' . $tree_indexes['TreeRight'];
$recycle_categories = serialize( $this->Conn->GetCol($sql) );
// store recycle bin categories in session to prevent query below happening on each link validation step
$this->Application->StoreVar('recycle_categories', $recycle_categories);
}
return unserialize($recycle_categories);
}
/**
* Checks, that link is located in one of RecycleBin subcategories
*
* @param unknown_type $resource_id
* @return unknown
*/
function _inRecycleBin($resource_id)
{
static $recycle_bin = null;
if (!isset($recycle_bin)) {
$recycle_bin = $this->_getRecycleBinCategories();
}
if (!$recycle_bin) {
// Recycle Bin not used in system -> link is 100% not there
return false;
}
$sql = 'SELECT CategoryId
FROM ' . $this->Application->getUnitOption('l-ci', 'TableName') . '
WHERE ItemResourceId = ' . $resource_id . ' AND PrimaryCat = 1';
return in_array( $this->Conn->GetOne($sql), $recycle_bin);
}
function _validateLink($link_id)
{
$curl_helper = $this->Application->recallObject('CurlHelper');
/* @var $curl_helper kCurlHelper */
$sql = 'SELECT Url, ResourceId
FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE ' . $this->Application->getUnitOption('l', 'IDField') . ' = ' . $link_id;
$link_data = $this->Conn->GetRow($sql);
if (!preg_match('/^(http|https):\/\/(.*)/U', $link_data['Url']) || $this->_inRecycleBin($link_data['ResourceId'])) {
return ;
}
$curl_helper->timeout = LINK_VALIDATION_TIMEOUT;
$result = $curl_helper->Send($link_data['Url']);
if ($result === false || $curl_helper->lastErrorMsg != '') {
$curl_helper->lastErrorCode = 500;
}
$link_validation = $this->Application->recallObject($this->Prefix . '.-item', null, Array ('skip_autoload' => true));
/* @var $link_validation kDBItem */
$link_validation->Load($link_id, 'LinkId');
$now = adodb_mktime();
$fields_hash = Array (
'LinkId' => $link_id,
'ValidationTime_date' => $now,
'ValidationTime_time' => $now,
'ValidationCode' => $curl_helper->lastHTTPCode,
'ValidationStatus' => $curl_helper->lastHTTPCode < 400 ? LINK_VALIDATION_VALID : LINK_VALIDATION_INVALID,
);
$link_validation->SetDBFieldsFromHash($fields_hash);
return $link_validation->isLoaded() ? $link_validation->Update() : $link_validation->Create();
}
/**
* Cancels validation (from validation progress bar)
*
* @param kEvent $event
*/
function OnCancelValidation($event)
{
$this->Application->RemoveVar($event->Prefix . '_status');
}
/**
* Resets validation status for selected
*
* @param kEvent $event
*/
function OnResetValidationStatus($event)
{
$ids = $this->_getSelectedIds($event, true);
if (!$ids) {
return ;
}
$temp_handler = $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$temp_handler->DeleteItems($event->Prefix, $event->Special, $ids);
}
/**
* Returns ids, that user has checked in grid
*
* @param kEvent $event
* @param bool $transform convert link ids to link validation ids
* @return Array
*/
function _getSelectedIds($event, $transform = false)
{
$ids = Array();
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
foreach ($items_info as $id => $field_values) {
if ( getArrayValue($field_values, 'ForeignLinkId') ) {
// we are not gathering ids by unit idfield here!
array_push($ids, $id);
}
}
}
if ($transform && $ids) {
$sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . '
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE LinkId IN (' . implode(',', $ids) . ')';
$ids = $this->Conn->GetCol($sql);
}
return $ids;
}
/**
* Approves/declines selected links
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function iterateItems(kEvent $event)
{
if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) {
$event->status = kEvent::erFAIL;
return;
}
$ids = $this->_getSelectedIds($event);
if ( !$ids ) {
return;
}
$object = $this->Application->recallObject('l.-item', null, Array ('skip_autoload' => true));
/* @var $object kCatDBItem */
foreach ($ids as $id) {
$ret = true;
$object->Load($id);
switch ( $event->Name ) {
case 'OnApproveLinks':
$ret = $object->ApproveChanges();
break;
case 'OnDeclineLinks':
$ret = $object->DeclineChanges();
break;
}
if ( !$ret ) {
$event->status = kEvent::erFAIL;
$event->redirect = false;
break;
}
}
}
/**
* Deletes selected links
*
* @param kEvent $event
*/
function OnDeleteLinks($event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
$event->status = kEvent::erFAIL;
return;
}
$ids = $this->_getSelectedIds($event);
if (!$ids) {
return ;
}
$temp_handler = $this->Application->recallObject('l_TempHandler', 'kTempTablesHandler');
/* @var $temp_handler kTempTablesHandler */
$temp_handler->DeleteItems('l', '', $ids);
}
/**
* [HOOK] Allows to edit links, used in selected link validation records
*
* @param kEvent $event
*/
function OnPrepareLinkEditing($event)
{
// hook to OnAfterConfigRead instead of OnEdit, because fake ids should be available in CheckPermission
if ($this->Application->GetVar('l_event') != 'OnEdit') {
return ;
}
$ids = $this->_getSelectedIds($event);
$id_field = $this->Application->getUnitOption('l', 'IDField');
$items_info = Array ();
foreach ($ids as $id) {
$items_info[$id][$id_field] = 'on';
}
$this->Application->SetVar('l', $items_info);
}
/**
* Gets all links, that are not yet validated and prepare data
*
* @param kEvent $event
*
* @return bool
*/
function _prepareValidation($event)
{
// 2. get ids of all links and put them into validation queue
$id_field = $this->Application->getUnitOption('l', 'IDField');
$sql = 'SELECT ' . $id_field . '
FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE LinkId NOT IN (SELECT LinkId FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ')';
$link_ids = $this->Conn->GetCol($sql);
if ($link_ids) {
$validation_data = Array (
'processed' => 0,
'total' => count($link_ids),
'items' => $link_ids,
);
$this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data)); // 4K links will be 78KB serialized
return true;
}
return false;
}
/**
* [SCHEDULED TASK] Performs link validation through cron
*
* @param kEvent $event
*/
function OnCronValidation($event)
{
$this->_resetValidation($event); // remove this for continuing to non validated before links
$have_data = $this->_prepareValidation($event);
if ($have_data) {
do {
$done = $this->_validate($event, false);
} while (!$done);
}
}
/**
* Makes calculated fields to go to multilingual link fields
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterConfigRead(kEvent $event)
{
parent::OnAfterConfigRead($event);
$calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields');
$calculated_fields['']['LinkName'] = 'l.l' . $this->Application->GetVar('m_lang') . '_Name';
$this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields);
}
}
\ No newline at end of file
Index: branches/5.3.x/units/listings/listings_event_handler.php
===================================================================
--- branches/5.3.x/units/listings/listings_event_handler.php (revision 15671)
+++ branches/5.3.x/units/listings/listings_event_handler.php (revision 15672)
@@ -1,846 +1,846 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class ListingsEventHandler extends kDBEventHandler {
/**
* Allows to override standard permission mapping
*
* @return void
* @access protected
* @see kEventHandler::$permMapping
*/
protected function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// front
'OnRequestEnhancement' => Array ('self' => true),
'OnCancelEnhancement' => Array ('self' => true),
'OnExtendEnhancement' => Array ('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Adds selected link to listing
*
* @param kEvent $event
*/
function OnProcessSelected($event)
{
$object = $event->getObject();
$selected_ids = $this->Application->GetVar('selected_ids');
if ($selected_ids['l']) {
$link_id = $selected_ids['l'];
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id;
$object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql));
$object->IgnoreValidation = true;
// $this->RemoveRequiredFields($object);
$object->Update();
}
$this->finalizePopup($event);
}
function OnPreSaveListing($event)
{
$event->redirect=false;
$object = $event->getObject( Array('skip_autoload' => true) );
$object->IgnoreValidation = true;
// $this->RemoveRequiredFields($object);
$event->CallSubEvent('OnPreSave');
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId());
return;
}
/**
* Occurs before updating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemUpdate(kEvent $event)
{
$object = $event->getObject();
/* @var $object kDBItem */
if ( $object->IgnoreValidation ) {
$object->UpdateFormattersMasterFields();
}
}
/**
* Occurs before creating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeItemCreate(kEvent $event)
{
parent::OnBeforeItemCreate($event);
$object = $event->getObject();
/* @var $object kDBItem */
if ( $object->IgnoreValidation ) {
$object->UpdateFormattersMasterFields();
}
}
/**
* Occurs before an item is deleted from live table when copying from temp
* (temp handler deleted all items from live and then copy over all items from temp)
* Id of item being deleted is passed as event' 'id' param
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnBeforeDeleteFromLive(kEvent $event)
{
parent::OnBeforeDeleteFromLive($event);
$object = $event->getObject();
/* @var $object kDBItem */
$sql = 'SELECT *
FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE ListingId = ' . $object->GetId();
$original_values = $this->Conn->GetRow($sql);
$type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']);
$link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']);
$status_modified = ($object->GetDBField('Status') != $original_values['Status']);
if ( $status_modified ) {
$email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.DENY';
$sql = 'SELECT CreatedById
FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE ResourceId = ' . $object->GetDBField('ItemResourceId');
$user_id = $this->Conn->GetOne($sql);
- $this->Application->EmailEventUser($email_event, $user_id);
- $this->Application->EmailEventAdmin($email_event);
+ $this->Application->emailUser($email_event, $user_id);
+ $this->Application->emailAdmin($email_event);
}
if ( $type_modified || $link_modified ) {
$this->ResetLink($original_values);
}
if ( $status_modified || $type_modified || $link_modified ) {
$this->EnhanceLink($object, $original_values);
}
if ( $status_modified && !($type_modified || $link_modified) ) {
$this->ResetLink($original_values);
}
}
function EnhanceLink(&$object, $original_values)
{
if ($object->GetDBField('Status') != STATUS_ACTIVE) {
return false;
}
if ($object->GetDBField('ExpiresOn') < adodb_mktime()) {
$object->SetDBField('Status', STATUS_PENDING);
$object->Update();
$this->ResetLink($original_values);
return false;
}
$this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId'));
$listtype_object = $this->Application->recallObject('lst');
if ( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') )
{
$link_object = $this->Application->recallObject('l');
$add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat');
$sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').'
WHERE CategoryId = '.$add_to_cat.'
AND ItemResourceId = '.$link_object->GetDBField('ResourceId').'
AND PrimaryCat = 0';
$this->Conn->Query($sql);
$sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').'
(CategoryId, ItemResourceId, PrimaryCat)
VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)';
$this->Conn->Query($sql);
}
}
function ResetLink($original_values)
{
static $has_been_reset = Array();
if( $original_values['Status'] != STATUS_ACTIVE ||
getArrayValue($has_been_reset, $original_values['ListingId']) )
{
return;
}
$has_been_reset[$original_values['ListingId']] = 1;
$this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']);
$listtype_object = $this->Application->recallObject('lst');
if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') )
{
$remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat');
$sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').'
WHERE ItemResourceId = '.$original_values['ItemResourceId'].'
AND CategoryId = '.$remove_from_cat.'
AND PrimaryCat = 0';
$this->Conn->Query($sql);
}
}
function UpdateLink($action_prefix, $resource_id, $listtype_id)
{
$link_object = $this->Application->recallObject('l', null, Array('skip_autoload' => true));
$link_object->Load($resource_id, 'ResourceId');
// "-item", because can be called as regular after event, and just "lst" recalls list instead
$listtype_object = $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true));
$listtype_object->Load($listtype_id);
$action_fields = Array( 'EdPick' => 'EditorsPick',
'New' => 'NewItem',
'Hot' => 'HotItem',
'Pop' => 'PopItem',
'Status' => 'Status',
'CustomTemplate' => 'CustomTemplate',
);
// $action_prefix = 'OnPurchase';
foreach($action_fields as $action => $field)
{
$action_value = $listtype_object->GetDBField($action_prefix.$action);
if( $action_value != 3 )
{
$link_object->SetDBField($field, $action_value);
}
}
$priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue');
switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') )
{
case 1: // equal
$link_object->SetDBField('Priority', $priority_value);
break;
case 2: // increase
$original_priority = $link_object->GetDBField('Priority');
$link_object->SetDBField('Priority', $original_priority + $priority_value);
break;
case 3: // decrease
$original_priority = $link_object->GetDBField('Priority');
$link_object->SetDBField('Priority', $original_priority - $priority_value);
break;
default:
}
$link_object->Update();
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnRequestEnhancement($event)
{
if ($this->Application->isModuleEnabled('In-Commerce')) {
$l_info = $this->Application->GetVar('l');
if (!$l_info) {
return false;
}
list ($link_id, $link_info) = each($l_info);
$listing_type_id = $link_info['ListingTypeId'];
$listing_type = $this->Application->recallObject('lst', null, Array('skip_autoload' => true));
$listing_type->Load($listing_type_id);
if ($listing_type->GetDBField('EnableBuying')) {
$add_to_cart_event = new kEvent('ord:OnAddVirtualProductToCart');
$this->Application->HandleEvent($add_to_cart_event);
if ($add_to_cart_event->redirect) {
$event->SetRedirectParam('pass', 'm');
$event->redirect = $add_to_cart_event->redirect;
}
return true;
}
}
$event->CallSubEvent('OnListingCreate');
}
/**
* Create listing or extend existing listing period
*
* @param kEvent $event
*/
function OnListingCreate($event)
{
$new_processing = false;
$link_id = $listing_type_id = 0;
$object = $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
switch ($event->Name) {
case 'EnhanceLinkAfterOrderApprove':
case 'EnhancedLinkOnCompleteOrder':
// when order with listing virtual product is approved
$fields = $event->getEventParam('field_values');
$item_data = unserialize($fields['ItemData']);
$listing_type_id = $item_data['ListingTypeId'];
$link_id = $item_data['LinkId'];
$new_processing = getArrayValue($item_data, 'HasNewProcessing');
break;
case 'OnListingCreate':
// when requesting enhancement from front (and not via in-commerce)
$links_info = $this->Application->GetVar('l');
if (!$links_info) return false;
$event->redirect = false;
list($link_id, $link_info) = each($links_info);
$listing_type_id = $link_info['ListingTypeId'];
$new_processing = false;
break;
}
if (!$listing_type_id) {
// free or invalid listing type selected
return false;
}
// get resource_id of link beeing enhanced
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE LinkId = '.$link_id;
$resource_id = $this->Conn->GetOne($sql);
// get listing by link's resource_id
$object->Load($resource_id, 'ItemResourceId');
if ($object->isLoaded()) {
$original_values = $object->GetFieldValues();
}
else {
// set initial fields to listing
$object->SetDBField('ListingTypeId', $listing_type_id);
$object->SetDBField('ItemResourceId', $resource_id);
if ($event->Name == 'OnListingCreate' || $new_processing) {
$item_status = STATUS_PENDING;
}
else {
$item_status = STATUS_ACTIVE;
}
$object->SetDBField('Status', $item_status);
}
// set date of purchase for new listings
$purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn'));
if (!$object->isLoaded()) {
$object->SetDBField('PurchasedOn_date', $purchased_on);
$object->SetDBField('PurchasedOn_time', $purchased_on);
}
// set expiration time for listing
$listing_type = $this->Application->recallObject('lst', null, Array('skip_autoload' => true));
$listing_type->Load($listing_type_id);
$dur_type_mapping = Array( 1 => 1,
2 => 60,
3 => 3600,
4 => 3600*24,
5 => 3600*24*7,
6 => 3600*24*365/12,
7 => 3600*24*365
);
$duration = $listing_type->GetDBField('Duration');
$duration_type = $listing_type->GetDBField('DurationType');
$expiration_interval = $duration * $dur_type_mapping[$duration_type];
$expiration_date = $purchased_on + $expiration_interval;
$object->SetDBField('ExpiresOn_date', $expiration_date);
$object->SetDBField('ExpiresOn_time', $expiration_date);
// when extending enhancement mark listing as non-received renewal reminder
$object->SetDBField('RenewalReminderSent', 0);
$action = $object->isLoaded() ? 'Update' : 'Create';
if ($object->$action()) {
$event->status = kEvent::erSUCCESS;
switch ($event->Name) {
case 'EnhanceLinkAfterOrderApprove':
case 'EnhancedLinkOnCompleteOrder':
// when order with listing virtual product is approved
if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) {
$this->EnhanceLink($object, Array());
}
break;
case 'OnListingCreate':
// when requesting enhancement from front (and not via in-commerce)
$event->redirect = $this->Application->GetVar('success_template');
$sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE ResourceId = '.$object->GetDBField('ItemResourceId');
- $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql));
- $this->Application->EmailEventAdmin('LINK.ENHANCE');
+ $this->Application->emailUser('LINK.ENHANCE', $this->Conn->GetOne($sql));
+ $this->Application->emailAdmin('LINK.ENHANCE');
break;
}
}
else {
$event->status = kEvent::erFAIL;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function EnhancedLinkOnCompleteOrder($event)
{
// create enhancement, but pending
$this->OnListingCreate($event);
// save created listing_id back to itemdata
$object = $event->getObject( Array('skip_autoload' => true) );
$fields = $event->getEventParam('field_values');
$item_data = unserialize($fields['ItemData']);
unset($item_data['ListingTypeId']);
$item_data['ListingId'] = $object->GetID();
$orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField');
$orditems_table = $this->Application->getUnitOption('orditems', 'TableName');
$this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] );
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function EnhanceLinkAfterOrderApprove($event)
{
$object = $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
$fields = $event->getEventParam('field_values');
$item_data = unserialize($fields['ItemData']);
if ( getArrayValue($item_data, 'HasNewProcessing') ) {
// new processing: just approve created listing here
$listing_id = $item_data['ListingId'];
$object->Load($listing_id);
// moved enhancement period to time admin approved enhancement
$time_diff = adodb_mktime() - $object->GetDBField('PurchasedOn');
$object->SetDBField('PurchasedOn_date', $object->GetDBField('PurchasedOn_date') + $time_diff);
$object->SetDBField('PurchasedOn_time', $object->GetDBField('PurchasedOn_time') + $time_diff);
$object->SetDBField('ExpiresOn_date', $object->GetDBField('ExpiresOn_date') + $time_diff);
$object->SetDBField('ExpiresOn_time', $object->GetDBField('ExpiresOn_time') + $time_diff);
$object->SetDBField('Status', STATUS_ACTIVE);
$object->Update();
$this->EnhanceLink($object, Array());
return true;
}
else {
// create listing & approve it at the same time
$this->OnListingCreate($event);
}
}
/**
* Delete listing
*
* @param kEvent $event
*/
function EnhanceLinkAfterOrderDeny($event)
{
$object = $event->getObject( Array('skip_autoload' => true) );
$fields = $event->getEventParam('field_values');
$item_data = unserialize($fields['ItemData']);
$listing_id = $item_data['ListingId'];
$temp_handler = $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler');
$temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id));
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function ExpireLink($event)
{
$object = $event->getObject(Array ('skip_autoload' => true));
/* @var $object kDBItem */
$fields = $event->getEventParam('field_values');
$item_data = unserialize($fields['ItemData']);
$sql = 'SELECT ListingId FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . '
WHERE ItemResourceId = ' . $item_data['LinkId'];
$listing_id = $this->Conn->GetOne($sql);
$object->Load($listing_id);
$original_values = $object->GetFieldValues();
$object->SetDBField('Status', 2);
if ( $object->Update() ) {
$event->status = kEvent::erSUCCESS;
$this->ResetLink($original_values);
}
else {
$event->status = kEvent::erFAIL;
}
}
/**
* Apply same processing to each item being selected in grid
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function iterateItems(kEvent $event)
{
$object = $event->getObject(Array ('skip_autoload' => true));
/* @var $object kDBItem */
$ids = $this->StoreSelectedIDs($event);
if ( $event->Name == 'OnMassApprove' ) {
foreach ($ids as $id) {
$object->Load($id);
if ( $object->GetDBField('Status') != STATUS_ACTIVE ) {
$original_values = $object->GetFieldValues();
$object->SetDBField('Status', STATUS_ACTIVE);
$this->EnhanceLink($object, $original_values);
}
}
}
if ( $event->Name == 'OnMassDecline' ) {
foreach ($ids as $id) {
$object->Load($id);
if ( $object->GetDBField('Status') == STATUS_ACTIVE ) {
$original_values = $object->GetFieldValues();
$this->ResetLink($original_values);
$sql = 'SELECT CreatedById
FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE ResourceId = ' . $object->GetDBField('ItemResourceId');
- $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql));
- $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY');
+ $this->Application->emailUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql));
+ $this->Application->emailAdmin('LINK.ENHANCE.DENY');
}
}
}
parent::iterateItems($event);
// extend period for pending/renewal links (if owner has agreed)
if ( $event->Name == 'OnMassApprove' ) {
$lst_object = $this->Application->recallObject('lst', null, Array ('skip_autoload' => true));
/* @var $lst_object kDBItem */
foreach ($ids as $id) {
$object->Load($id);
$sql = 'SELECT CreatedById
FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE ResourceId = ' . $object->GetDBField('ItemResourceId');
$owner_id = $this->Conn->GetOne($sql);
if ( $object->GetDBField('PendingRenewal') == 1 ) {
$lst_object->Load( $object->GetDBField('ListingTypeId') );
$dur_type_mapping = Array (
1 => 1, 2 => 60, 3 => 3600, 4 => 3600 * 24, 5 => 3600 * 24 * 7,
6 => 3600 * 24 * 365 / 12, 7 => 3600 * 24 * 365
);
$duration = $lst_object->GetDBField('Duration');
$duration_type = $lst_object->GetDBField('DurationType');
$expiration_interval = $duration * $dur_type_mapping[$duration_type];
$renewal_begins = max(adodb_mktime(), $object->GetDBField('ExpiresOn'));
$expiration_date = $renewal_begins + $expiration_interval;
$object->SetDBField('ExpiresOn_date', $expiration_date);
$object->SetDBField('ExpiresOn_time', $expiration_date);
$object->SetDBField('RenewalReminderSent', 0);
$object->SetDBField('PendingRenewal', 0);
if ( $object->Update() ) {
$event->status = kEvent::erSUCCESS;
$event->SetRedirectParam('opener', 's');
- $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id);
- $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW');
+ $this->Application->emailUser('LINK.ENHANCE.RENEW', $owner_id);
+ $this->Application->emailAdmin('LINK.ENHANCE.RENEW');
}
else {
$event->status = kEvent::erFAIL;
$event->redirect = false;
break;
}
}
else {
- $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id);
- $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE');
+ $this->Application->emailUser('LINK.ENHANCE.APPROVE', $owner_id);
+ $this->Application->emailAdmin('LINK.ENHANCE.APPROVE');
}
}
}
}
/**
* Redirects to cancel template on front-end
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnCancel(kEvent $event)
{
parent::OnCancel($event);
if ( !$this->Application->isAdmin ) {
$event->SetRedirectParam('opener', 's');
$event->redirect = $this->Application->GetVar('cancel_template');
}
}
/**
* Checks that user is owner of link & returns listing id if permissions are ok
*
* @param kEvent $event
* @return mixed
*/
function verifyListingOwner($event)
{
$link_id = $this->Application->GetVar('l_id');
$user_id = $this->Application->RecallVar('user_id');
$sql = 'SELECT ResourceId
FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE (LinkId = '.$link_id.') AND (CreatedById = '.$user_id.')';
$resource_id = $this->Conn->GetOne($sql);
if (!$resource_id) {
$event->status = kEvent::erFAIL;
return false;
}
$sql = 'SELECT ListingId
FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE ItemResourceId = '.$resource_id;
return $this->Conn->GetOne($sql);
}
function OnExtendEnhancement($event)
{
$listing_id = $this->verifyListingOwner($event);
if (!$listing_id) {
return ;
}
$object = $event->getObject( Array('skip_autoload' => true) );
$object->Load($listing_id);
$object->SetDBField('PendingRenewal', 1);
$object->Update();
$event->redirect = $this->Application->GetVar('success_template');
$sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE ResourceId = '.$object->GetDBField('ItemResourceId');
- $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql));
- $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND');
+ $this->Application->emailUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql));
+ $this->Application->emailAdmin('LINK.ENHANCE.EXTEND');
}
/**
* Cancels enhancement
*
* @param kEvent $event
*/
function OnCancelEnhancement($event)
{
$listing_id = $this->verifyListingOwner($event);
if ( !$listing_id ) {
return;
}
$object = $event->getObject(Array ('skip_autoload' => true));
/* @var $object kDBItem */
$object->Load($listing_id);
$original_values = $object->GetFieldValues();
$original_values['Status'] = 1;
$this->ResetLink($original_values);
$sql = 'SELECT CreatedById FROM ' . $this->Application->getUnitOption('l', 'TableName') . '
WHERE ResourceId = ' . $object->GetDBField('ItemResourceId');
- $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql));
- $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL');
+ $this->Application->emailUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql));
+ $this->Application->emailAdmin('LINK.ENHANCE.CANCEL');
$object->Delete();
$event->redirect = $this->Application->GetVar('success_template');
}
/**
* Checks expired paid listings
*
* @param kEvent $event
*/
function OnCheckExpiredPaidListings($event)
{
$sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1';
$expired_listings = $this->Conn->GetCol($sql);
if(is_array($expired_listings) && count($expired_listings) > 0)
{
$object = $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true));
/* @var $object kDBItem */
foreach($expired_listings as $listing_id)
{
$object->Load($listing_id);
$original_values = $object->GetFieldValues();
$this->ResetLink($original_values);
$object->SetDBField('Status', 2);
$object->Update();
$sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').'
WHERE ResourceId = '.$object->GetDBField('ItemResourceId');
- $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql));
- $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE');
+ $this->Application->emailUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql));
+ $this->Application->emailAdmin('LINK.ENHANCE.EXPIRE');
}
}
$sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls
LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst
ON ls.ListingTypeId = lst.ListingTypeId
LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l
ON ls.ItemResourceId = l.ResourceId
WHERE ls.Status = 1
AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24
AND ls.RenewalReminderSent = 0';
$res = $this->Conn->Query($sql);
if(is_array($res) && count($res) > 0)
{
$listing_ids = Array();
foreach($res as $record)
{
- $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']);
- $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE');
+ $this->Application->emailUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']);
+ $this->Application->emailAdmin('LINK.ENHANCE.RENEWAL.NOTICE');
$listing_ids[] = $record['ListingId'];
}
$sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
SET RenewalReminderSent = 1
WHERE ListingId IN ('.implode(',', $listing_ids).')';
$this->Conn->Query($sql);
}
}
/**
* Removes enhancements on listing delete
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnMassDelete(kEvent $event)
{
$object = $event->getObject(Array ('skip_autoload' => true));
/* @var $object kDBItem */
$ids = $this->StoreSelectedIDs($event);
foreach ($ids as $id) {
$object->Load($id);
if ( $object->GetDBField('Status') == STATUS_ACTIVE ) {
$this->ResetLink( $object->GetFieldValues() );
}
}
parent::OnMassDelete($event);
}
/**
* Moves enhancement from original link to it's pending copy, that is going to be approved
*
* @param kEvent $event
*/
function OnMoveEnhancement($event)
{
$id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField');
$item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName');
$pending_id = $event->MasterEvent->getEventParam('id');
$original_id = $event->MasterEvent->getEventParam('original_id');
$sql = 'SELECT ResourceId, '.$id_field.'
FROM '.$item_table_name.'
WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')';
$resource_ids = $this->Conn->GetCol($sql, $id_field);
$table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
$sql = 'UPDATE '.$table_name.'
SET ItemResourceId = '.$resource_ids[$pending_id].'
WHERE ItemResourceId = '.$resource_ids[$original_id];
$this->Conn->Query($sql);
}
/**
* Makes calculated fields to go to multilingual link fields
*
* @param kEvent $event
* @return void
* @access protected
*/
protected function OnAfterConfigRead(kEvent $event)
{
parent::OnAfterConfigRead($event);
$language_id = $this->Application->GetVar('m_lang');
$calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields');
$calculated_fields['']['LinkName'] = 'CONCAT(item_table.l' . $language_id . '_Name, " (", item_table.Url, ")")';
$this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields);
}
}
\ No newline at end of file
Index: branches/5.3.x/units/listings/listings_config.php
===================================================================
--- branches/5.3.x/units/listings/listings_config.php (revision 15671)
+++ branches/5.3.x/units/listings/listings_config.php (revision 15672)
@@ -1,175 +1,175 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'ls',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ListingsEventHandler', 'file' => 'listings_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'ListingsTagProcessor', 'file' => 'listings_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array (
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'l',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnBeforeDeleteOriginal'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnMoveEnhancement',
),
),
'QueryString' => Array (
1 => 'id',
2 => 'Page',
3 => 'PerPage',
4 => 'event',
5 => 'mode',
),
'ScheduledTasks' => Array (
'listings_expiration' => Array ('EventName' => 'OnCheckExpiredPaidListings', 'RunSchedule' => '*/30 * * * *'),
),
'IDField' => 'ListingId',
'StatusField' => Array ('Status', 'PendingRenewal'),
'TitleField' => 'LinkName',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('ls' => '!la_title_AddingListing!'),
'edit_status_labels' => Array ('ls' => '!la_title_EditingListing!'),
'new_titlefield' => Array ('ls' => '!la_title_NewListing!'),
),
'listing_list' => Array ('prefixes' => Array ('ls_List'), 'format' => "!la_title_PaidListings!",),
'listing_edit' => Array ('prefixes' => Array ('ls'), 'format' => "#ls_status# '#ls_titlefield#' - !la_title_General!",),
),
'PermSection' => Array ('main' => 'in-link:paid_listings'),
'Sections' => Array (
'in-link:paid_listings_folder' => Array (
'parent' => 'in-link',
'icon' => 'paid_listings',
'label' => 'la_tab_PaidListings',
'use_parent_header' => 1,
'permissions' => Array (),
'priority' => 1,
'type' => stTREE,
),
'in-link:paid_listings' => Array (
'parent' => 'in-link:paid_listings_folder',
'icon' => 'paid_listings',
'label' => 'la_tab_Listings',
'url' => Array ('t' => 'in-link/paid_listings/paid_listings_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 1.1, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'Listings',
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Link item_table ON item_table.ResourceId = %1$s.ItemResourceId
LEFT JOIN '.TABLE_PREFIX.'Users u ON u.PortalUserId = item_table.CreatedById'
),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('PurchasedOn' => 'desc'),
)
),
'CalculatedFields' => Array (
'' => Array (
'LinkName' => 'CONCAT(item_table.Name, " (", item_table.Url, ")")',
- 'LinkOwner' => 'IF (ISNULL(u.Username), IF (item_table.CreatedById = ' . USER_ROOT . ', "root", IF (item_table.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), u.Username)',
+ 'LinkOwner' => 'IF (ISNULL(u.Username), IF (item_table.CreatedById = ' . USER_ROOT . ', "root", IF (item_table.CreatedById = ' . USER_GUEST . ', "Guest", "n/a")), IF(u.Username = "", u.Email, u.Username))',
),
),
'Fields' => Array (
'ListingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
'ListingTypeId' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options_sql' => 'SELECT %s
FROM '.TABLE_PREFIX.'ListingTypes
ORDER BY Name',
'option_key_field' => 'ListingTypeId', 'option_title_field' => 'Name',
'default' => 0,
),
'ItemResourceId' => Array (
'type' => 'int',
'required' => 1, 'unique' => Array ('ItemResourceId'), 'default' => null,
'error_field' => 'LinkName',
),
'PurchasedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'ExpiresOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'required' =>1),
'Status' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 2,
),
'PendingRenewal' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => Array (0 => 'la_NotPendingRenewal', 1 => 'la_PendingRenewal'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0,
),
'RenewalReminderSent' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array (
'LinkName' => Array ('type' => 'string', 'default' => ''),
'LinkOwner' => Array ('type' => 'string', 'default' => ''),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
'1_0' => 'icon16_link.png',
'0_0' => 'icon16_link_disabled.png',
'2_0' => 'icon16_link_pending.png',
'1_1' => 'icon16_link_pending.png',
'0_1' => 'icon16_link_disabled.png',
'2_1' => 'icon16_link_pending.png'
),
'module' => 'core',
'Fields' => Array (
'ListingId' => Array ( 'title' => 'column:la_fld_Id' , 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'LinkName' => Array ('data_block' => 'link_td', 'filter_block' => 'grid_like_filter', 'width' => 170, ),
'ListingTypeId' => Array ( 'title' => 'column:la_fld_ListingTypeName' , 'data_block' => 'listing_type_td', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'LinkOwner' => Array ('filter_block' => 'grid_like_filter', 'width' => 115, ),
'PendingRenewal' => Array ('filter_block' => 'grid_options_filter', 'width' => 143, ),
'PurchasedOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'ExpiresOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'Status' => Array ('filter_block' => 'grid_options_filter'),
),
),
),
);
\ No newline at end of file
Index: branches/5.3.x/admin_templates/links/file_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/links/file_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/links/file_edit.tpl (revision 15672)
@@ -1,66 +1,68 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
+
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="file_edit"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('l-file','<inp2:l-file_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l-file','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('l-file', '<inp2:l-file_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('l-file', '<inp2:l-file_NextId/>');
}
));
a_toolbar.Render();
<inp2:m_if check="l-file_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="l-file_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="l-file_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:l-file_SaveWarning name="grid_save_warning"/>
<inp2:l-file_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="l-file" fields="ResourceId,FileName,FilePath,Status" title="la_section_File"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-file" field="ResourceId"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-file" field="FileName" title="la_fld_Name" size="50" />
<inp2:m_RenderElement name="inp_edit_upload" prefix="l-file" field="FilePath" title="la_fld_FilePath" />
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l-file" field="Status" title="la_fld_Enabled" onchange="check_primary()" />
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/links/links_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/links/links_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/links/links_edit.tpl (revision 15672)
@@ -1,122 +1,122 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="links_edit" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('l','<inp2:l_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('l', '<inp2:l_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('l', '<inp2:l_NextId/>');
}
) );
//a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.Render();
<inp2:m_if check="l_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="l_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="l_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="ml_selector" prefix="l"/>
</tr>
</tbody>
</table>
<inp2:l_SaveWarning name="grid_save_warning"/>
<inp2:l_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="l" fields="LinkId,Name,Description,Url,ReciprocalLinkFound,CreatedById,AutomaticFilename,Filename,CustomTemplate,CategoryId" title="la_section_Link" original_title="la_section_OriginalValues" display_original="1"/>
<inp2:m_RenderElement name="inp_id_label" prefix="l" field="LinkId" title="la_fld_Id" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box_ml" prefix="l" field="Name" title="la_fld_Name" size="60" display_original="1"/>
- <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="l" field="Description" title="la_fld_Description" cols="60" rows="5" display_original="1"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="l" field="Description" title="la_fld_Description" allow_html="1" cols="60" rows="5" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="Url" title="la_fld_Url" size="60" display_original="1"/>
<inp2:m_RenderElement name="inp_label" prefix="l" field="ReciprocalLinkFound" title="la_fld_ReciprocalLinkFound"/>
<inp2:m_RenderElement name="inp_edit_user" prefix="l" field="CreatedById" title="la_fld_LinkOwner" size="30" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l" field="AutomaticFilename" title="la_fld_AutomaticFilename" onchange="reflect_filename()" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="Filename" title="la_fld_Filename" size="60" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="CustomTemplate" title="la_fld_CustomTemplate" size="60" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="l" field="CategoryId" title="la_fld_ParentSection" display_original="1"/>
<inp2:m_RenderElement name="subsection" prefix="l" fields="Status,NewItem,HotItem,PopItem,EditorPick,PriorityCreatedOn,Expire,MetaKeywords,MetaDescription" title="la_section_Properties" original_title="la_section_OriginalValues" display_original="1"/>
<inp2:m_if check="l_DisplayOriginal" display_original="1">
<inp2:m_RenderElement design="form_row" prefix="l" field="Status" title="la_fld_Status">
<td class="control-cell">
<inp2:m_Phrase label="la_UseGridToApproveDecline" />
</td>
</inp2:m_RenderElement>
<inp2:m_else/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l" field="Status" title="la_fld_Status" display_original="1"/>
</inp2:m_if>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l" field="NewItem" title="la_fld_New" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l" field="HotItem" title="la_fld_Hot" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l" field="PopItem" title="la_fld_Pop" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l" field="EditorsPick" title="la_fld_EditorsPick" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="Priority" title="la_fld_Priority" size="4" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="l" field="CreatedOn" title="la_fld_CreatedOn" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="l" field="Expire" title="la_fld_Expire" size="12" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="MetaKeywords" title="la_fld_MetaKeywords" size="60"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="l" field="MetaDescription" title="la_fld_MetaDescription" cols="60" rows="5"/>
<inp2:m_RenderElement name="subsection" prefix="l" fields="CachedRating,CachedVotesQty,Hits" title="la_section_Counters" original_title="la_section_OriginalValues" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="CachedRating" title="la_fld_Rating" hint_label="la_prompt_RatingLimits" size="4" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="CachedVotesQty" title="la_fld_Votes" hint_label="la_prompt_VoteLimits" size="4" display_original="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l" field="Hits" title="la_fld_Hits" hint_label="la_prompt_HitLimits" size="4" display_original="1"/>
<!-- custom fields: begin -->
<inp2:m_include t="incs/custom_blocks"/>
<inp2:cf.general_PrintList render_as="cv_row_block" SourcePrefix="l" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
<!-- custom fields: end -->
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<input type="hidden" name="Hits_original" id="Hits_original" value="<inp2:l_Field name='Hits' db='db' />" />
<script type="text/javascript">
$(document).ready(reflect_filename);
disable_categories('<inp2:l_InputName name="CategoryId"/>', <inp2:l_AllowedCategoriesJSON/>);
function reflect_filename() {
var $checked = document.getElementById('_cb_<inp2:l_InputName field="AutomaticFilename"/>').checked;
document.getElementById('<inp2:l_InputName field="Filename"/>').readOnly = $checked;
}
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/links/relations_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/links/relations_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/links/relations_edit.tpl (revision 15672)
@@ -1,74 +1,76 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
+
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="relations_edit"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('l-rel','<inp2:l-rel_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l-rel','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('l-rel', '<inp2:l-rel_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('l-rel', '<inp2:l-rel_NextId/>');
}
));
a_toolbar.Render();
-
+
<inp2:m_if check="l-rel_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="l-rel_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="l-rel_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="categories/ci_blocks"/>
<inp2:l-rel_SaveWarning name="grid_save_warning"/>
<inp2:l-rel_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="l-rel" fields="SourceId,SourceType,TargetId,TargetType,RelationshipId,TargetId,Type,Enabled,Priority" title="la_section_Relation"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-rel" field="SourceId"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-rel" field="SourceType"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-rel" field="TargetId"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-rel" field="TargetType"/>
<inp2:m_RenderElement name="inp_id_label" prefix="l-rel" field="RelationshipId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_relation" prefix="l-rel" field="TargetId" title="la_fld_TargetId"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l-rel" field="Type" title="la_fld_RelationshipType"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l-rel" field="Enabled" title="la_fld_Enabled"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-rel" field="Priority" title="la_fld_Priority" size="4"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/links/review_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/links/review_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/links/review_edit.tpl (revision 15672)
@@ -1,76 +1,78 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
+
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="reviews_edit"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('l-rev','<inp2:l-rev_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l-rev','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('l-rev', '<inp2:l-rev_PrevId/>');
}
));
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('l-rev', '<inp2:l-rev_NextId/>');
}
));
a_toolbar.Render();
<inp2:m_if check="l-rev_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="l-rev_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="l-rev_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:l-rev_SaveWarning name="grid_save_warning"/>
<inp2:l-rev_ErrorWarning name="form_error_warning"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-rev" field="ItemId"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="l-rev" fields="ItemId,TextFormat,ReviewId,CreatedById,ReviewText,Rating" title="la_Text_Review"/>
<inp2:m_RenderElement name="inp_edit_checkbox_allow_html" prefix="l-rev" field="TextFormat"/>
<inp2:m_RenderElement name="inp_id_label" prefix="l-rev" field="ReviewId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_user" prefix="l-rev" field="CreatedById" title="la_fld_CreatedById" class="text"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="l-rev" field="ReviewText" title="la_fld_ReviewText" cols="70" rows="8"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="l-rev" field="Rating" title="la_fld_Rating" class="text"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-rev" field="HelpfulCount" title="la_fld_HelpfulCount" style="width: 50px;"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-rev" field="NotHelpfulCount" title="la_fld_NotHelpfulCount" style="width: 50px;"/>
<inp2:m_RenderElement name="subsection" prefix="l-rev" fields="Status,Priority,CreatedOn" title="la_Text_General"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l-rev" field="Status" title="la_fld_Status"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-rev" field="Priority" title="la_fld_Priority" size="3" class="text"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="l-rev" field="CreatedOn" title="la_fld_CreatedOn" size="20" class="text"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/links/images_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/links/images_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/links/images_edit.tpl (revision 15672)
@@ -1,85 +1,87 @@
+<inp2:adm_SetPopupSize width="750" height="670"/>
+
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="images_edit"/>
<inp2:m_include t="incs/image_blocks"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('l-img','<inp2:l-img_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l-img','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('l-img', '<inp2:l-img_PrevId/>');
}
));
-
+
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('l-img', '<inp2:l-img_NextId/>');
}
));
-
+
a_toolbar.Render();
-
+
<inp2:m_if check="l-img_IsSingle">
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="l-img_IsLast">
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="l-img_IsFirst">
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:l-img_SaveWarning name="grid_save_warning"/>
<inp2:l-img_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="l-img" fields="ResourceId,ImageId,Name,AltName,Enabled,DefaultImg,Priority" title="la_section_Image"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="l-img" field="ResourceId"/>
<inp2:m_RenderElement name="inp_label" prefix="l-img" field="ImageId" title="la_fld_Id"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-img" field="Name" title="la_fld_Name" size="40"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l-img" field="AltName" title="la_fld_AltValue" size="40"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l-img" field="Enabled" title="la_fld_Enabled" onchange="check_primary()" />
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l-img" field="DefaultImg" title="la_fld_Primary" onchange="check_status()" />
<inp2:m_RenderElement name="inp_edit_box" prefix="l-img" field="Priority" title="la_fld_Priority" size="5"/>
<inp2:m_RenderElement name="subsection" title="la_section_ThumbnailImage"/>
<inp2:m_RenderElement name="thumbnail_section" prefix="l-img"/>
<inp2:m_RenderElement name="subsection" prefix="l-img" fields="SameImages" title="la_section_FullSizeImage"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l-img" field="SameImages" title="la_fld_SameAsThumb" onchange="toggle_fullsize()"/>
<inp2:m_RenderElement name="fullsize_section" prefix="l-img"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<script type="text/javascript">
<inp2:m_RenderElement name="images_edit_js" prefix="l-img"/>
toggle_fullsize();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/paid_listings/paid_listing_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/paid_listings/paid_listing_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/paid_listings/paid_listing_edit.tpl (revision 15672)
@@ -1,109 +1,111 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
+
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="ls" section="in-link:paid_listings" title_preset="listing_edit"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('ls','<inp2:ls_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('ls','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('ls', '<inp2:ls_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('ls', '<inp2:ls_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.Render();
<inp2:m_if check="ls_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="ls_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="ls_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:ls_SaveWarning name="grid_save_warning"/>
<inp2:ls_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="la_Text_PaidListing"/>
<inp2:m_RenderElement name="inp_label" prefix="ls" field="ListingId" title="la_fld_ListingId"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="ls" field="ListingTypeId" title="la_fld_ListingType" onchange="set_exp_date()" />
<inp2:m_RenderElement design="form_row" prefix="ls" field="LinkName" title="la_fld_LinkName">
<td class="control-cell">
<inp2:ls_Field name="LinkName" />
<a href="javascript:select_link();"><img src="<inp2:m_TemplatesBase module='in-link'/>/img/link_arrow.gif" border="0"></a>
</td>
</inp2:m_RenderElement>
<inp2:m_RenderElement name="inp_edit_radio" prefix="ls" field="Status" title="la_fld_Status"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="ls" field="PendingRenewal" title="la_fld_PendingRenewal"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="ls" field="PurchasedOn" title="la_fld_PurchasedOn"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="ls" field="ExpiresOn" title="la_fld_ExpiresOn"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<script type="text/javascript">
function select_link()
{
openSelector('ls', '<inp2:adm_SelectorLink prefix="ls" selection_mode="single" tab_prefixes="l"/>', 'ItemResourceId', null, 'OnPreSaveListing');
}
function set_exp_date()
{
exp_date = exp_dates[document.getElementById('<inp2:ls_InputName field="ListingTypeId" />').value];
exp_time = exp_times[document.getElementById('<inp2:ls_InputName field="ListingTypeId" />').value];
if (typeof(exp_date) != 'undefined') {
document.getElementById('<inp2:ls_InputName field="ExpiresOn_date" />').value = exp_date;
document.getElementById('<inp2:ls_InputName field="ExpiresOn_time" />').value = exp_time;
}
}
var exp_dates = new Array();
var exp_times = new Array();
<inp2:m_DefineElement name="exp_date_elem" >
exp_dates[<inp2:Field name="ListingTypeId" />] = "<inp2:ls_ExpirationDate />";
exp_times[<inp2:Field name="ListingTypeId" />] = "<inp2:ls_ExpirationTime />";
</inp2:m_DefineElement>
<inp2:lst_PrintList block="exp_date_elem" />
<inp2:m_if check="m_getequals" param="ls_event" value="OnPreCreate">
set_exp_date();
</inp2:m_if>
</script>
<input type="hidden" name="main_prefix" id="main_prefix" value="ls">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/paid_listings/paid_listing_type_edit.tpl
===================================================================
--- branches/5.3.x/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 15671)
+++ branches/5.3.x/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 15672)
@@ -1,299 +1,299 @@
<inp2:adm_SetPopupSize width="790" height="440"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="lst" section="in-link:listing_types" title_preset="listing_type_edit" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lst','<inp2:lst_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lst','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('lst', '<inp2:lst_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lst', '<inp2:lst_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="lst_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lst_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lst_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:lst_SaveWarning name="grid_save_warning"/>
<inp2:lst_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="la_Text_PaidListingType"/>
<inp2:m_RenderElement name="inp_id_label" prefix="lst" field="ListingTypeId" title="la_fld_ListingTypeId"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="lst" field="Name" title="la_fld_ListingTypeName" size="20"/>
- <inp2:m_RenderElement name="inp_edit_textarea" prefix="lst" field="Description" title="la_fld_ListingTypeDescription" rows="10" cols="40"/>
+ <inp2:m_RenderElement name="inp_edit_textarea" prefix="lst" field="Description" title="la_fld_ListingTypeDescription" allow_html="1" rows="10" cols="40"/>
<inp2:m_RenderElement design="form_row" prefix="lst" field="Duration" title="la_fld_Duration">
<td class="control-cell">
<input type="text" name="<inp2:lst_InputName field="Duration" />" id="<inp2:lst_InputName field="Duration" />" value="<inp2:lst_Field name="Duration" />" tabindex="<inp2:m_get param="tab_index"/>" size="5">
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:lst_InputName field="DurationType"/>" id="<inp2:lst_InputName field="DurationType"/>">
<inp2:lst_PredefinedOptions field="DurationType" block="inp_option_phrase" selected="selected" prefix="lst" />
</select>
</td>
</inp2:m_RenderElement>
<inp2:m_RenderElement design="form_row" prefix="lst" field="RenewalReminder" title="la_fld_RenewalReminder">
<td class="control-cell">
<input type="text" name="<inp2:lst_InputName field="RenewalReminder"/>" id="<inp2:lst_InputName field="RenewalReminder" />" value="<inp2:lst_Field field="RenewalReminder" />" tabindex="<inp2:m_get param="tab_index"/>" size="5">
<inp2:m_Phrase label="la_days" />
</td>
</inp2:m_RenderElement>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell">&nbsp;</td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px; text-align: center;">
<strong><inp2:m_phrase label="la_ActionsUponPurchase" /></strong>
</td>
<td style="width: 300px; text-align: center;">
<strong><inp2:m_phrase label="la_ActionsUponExpire" /></strong>
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_EditorsPick"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnPurchaseEdPick" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnExpireEdPick" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_LinkStatus"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnPurchaseStatus" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnExpireStatus" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_New"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnPurchaseNew" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnExpireNew" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_Pop"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnPurchasePop" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnExpirePop" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_Hot"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnPurchaseHot" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
<td style="width: 300px;">
<inp2:lst_PredefinedOptions field="OnExpireHot" block="inp_radio_phrase" selected="checked" prefix="lst" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_Priority"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:lst_InputName field="OnPurchasePriorityAction"/>" id="<inp2:lst_InputName field="OnPurchasePriorityAction" />" onchange="check_priority('<inp2:lst_InputName field="OnPurchasePriorityAction" />', '<inp2:lst_InputName field="OnPurchasePriorityValue" />')">
<inp2:lst_PredefinedOptions field="OnPurchasePriorityAction" block="inp_option_phrase" selected="selected" prefix="lst" />
</select>
<input type="text" name="<inp2:lst_InputName field="OnPurchasePriorityValue" />" id="<inp2:lst_InputName field="OnPurchasePriorityValue" />" value="<inp2:lst_Field field="OnPurchasePriorityValue" />" tabindex="<inp2:m_get param="tab_index"/>" size="5">
</td>
<td style="width: 300px;">
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:lst_InputName field="OnExpirePriorityAction"/>" id="<inp2:lst_InputName field="OnExpirePriorityAction" />" onchange="check_priority('<inp2:lst_InputName field="OnExpirePriorityAction" />', '<inp2:lst_InputName field="OnExpirePriorityValue" />')">
<inp2:lst_PredefinedOptions field="OnExpirePriorityAction" block="inp_option_phrase" selected="selected" prefix="lst" />
</select>
<input type="text" name="<inp2:lst_InputName field="OnExpirePriorityValue" />" id="<inp2:lst_InputName field="OnExpirePriorityValue" />" value="<inp2:lst_Field field="OnExpirePriorityValue" />" tabindex="<inp2:m_get param="tab_index"/>" size="5">
</td>
</tr>
</table>
</td>
</tr>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_CustomDetailTemplate"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<input type="text" name="<inp2:lst_InputName field="OnPurchaseCustomTemplate" />" id="<inp2:lst_InputName field="OnPurchaseCustomTemplate" />" value="<inp2:lst_Field field="OnPurchaseCustomTemplate" />" tabindex="<inp2:m_get param="tab_index"/>" size="40">
</td>
<td style="width: 300px;">
<input type="text" name="<inp2:lst_InputName field="OnExpireCustomTemplate" />" id="<inp2:lst_InputName field="OnExpireCustomTemplate" />" value="<inp2:lst_Field field="OnExpireCustomTemplate" />" tabindex="<inp2:m_get param="tab_index"/>" size="40">
</td>
</tr>
</table>
</td>
</tr>
<inp2:m_DefineElement name="config_edit_cat" >
<input type="hidden" name="<inp2:lst_InputName field="{$field}"/>" value="<inp2:lst_Field field="{$field}" />" />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="category_selector">
<a href="<inp2:adm_SelectorLink prefix='lst' selection_mode='single' tab_prefixes='none'/>" onclick="openSelector('lst', this.href, '<inp2:m_param name="field"/>', null, 'OnPreSaveListingType'); return false;"><img src="img/icons/icon24_cat.gif" border="0" align="absmiddle" /></a>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="category_caption" >
<inp2:m_param name="separator"/><inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="root_cat_caption" >
<inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell"><inp2:m_phrase label="la_fld_AdditionalSection"/></td>
<td class="control-mid">&nbsp;</td>
<td class="control-cell">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 300px;">
<input type="hidden" id="<inp2:lst_InputName field="OnPurchaseAddToCatEnabled"/>" name="<inp2:lst_InputName field="OnPurchaseAddToCatEnabled"/>" value="<inp2:lst_Field field="OnPurchaseAddToCatEnabled" db="db"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:lst_InputName field="OnPurchaseAddToCatEnabled"/>" name="_cb_<inp2:lst_InputName field="OnPurchaseAddToCatEnabled"/>" <inp2:lst_Field field="OnPurchaseAddToCatEnabled" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:lst_InputName field="OnPurchaseAddToCatEnabled"/>'))">
<inp2:m_phrase label="la_AddTo" />
<strong>
<inp2:lst_CategoryPath separator=" &gt; " root_cat_render_as="root_cat_caption" render_as="category_caption" module="In-Link" field="OnPurchaseAddToCat" /></strong>
<inp2:m_RenderElement name="config_edit_cat" field="OnPurchaseAddToCat" />
<inp2:m_RenderElement name="category_selector" field="OnPurchaseAddToCat" />
</td>
<td style="width: 300px;">
<input type="hidden" id="<inp2:lst_InputName field="OnExpireRemoveFromCatEnabled"/>" name="<inp2:lst_InputName field="OnExpireRemoveFromCatEnabled"/>" value="<inp2:lst_Field field="OnExpireRemoveFromCatEnabled" db="db"/>">
<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:lst_InputName field="OnExpireRemoveFromCatEnabled"/>" name="_cb_<inp2:lst_InputName field="OnExpireRemoveFromCatEnabled"/>" <inp2:lst_Field field="OnExpireRemoveFromCatEnabled" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:lst_InputName field="OnExpireRemoveFromCatEnabled"/>'))">
<inp2:m_phrase label="la_RemoveFrom" />
<strong>
<inp2:lst_CategoryPath separator=" &gt; " root_cat_render_as="root_cat_caption" render_as="category_caption" module="In-Link" field="OnExpireRemoveFromCat" /></strong>
<inp2:m_RenderElement name="config_edit_cat" field="OnExpireRemoveFromCat" />
<inp2:m_RenderElement name="category_selector" field="OnExpireRemoveFromCat" />
</td>
</tr>
</table>
</td>
</tr>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<input type="hidden" name="main_prefix" id="main_prefix" value="lst">
<script type="text/javascript">
function check_priority(option_field, value_field)
{
if(document.getElementById(option_field).value == 0)
{
document.getElementById(value_field).disabled = true;
}
else
{
document.getElementById(value_field).disabled = false;
}
}
check_priority('<inp2:lst_InputName field="OnPurchasePriorityAction" />', '<inp2:lst_InputName field="OnPurchasePriorityValue" />');
check_priority('<inp2:lst_InputName field="OnExpirePriorityAction" />', '<inp2:lst_InputName field="OnExpirePriorityValue" />')
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.3.x/admin_templates/img/toolbar/toolbar-sprite.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/5.3.x/install/upgrades.php
===================================================================
--- branches/5.3.x/install/upgrades.php (revision 15671)
+++ branches/5.3.x/install/upgrades.php (revision 15672)
@@ -1,179 +1,180 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$upgrade_class = 'InLinkUpgrades';
/**
* Class, that holds all upgrade scripts for "In-Link" module
*
*/
class InLinkUpgrades extends kUpgradeHelper {
public function __construct()
{
parent::__construct();
$this->dependencies = Array (
'4.3.9' => Array ('Core' => '4.3.9'),
'5.0.0' => Array ('Core' => '5.0.0'),
'5.0.1' => Array ('Core' => '5.0.1'),
'5.0.2-B1' => Array ('Core' => '5.0.2-B1'),
'5.0.2-B2' => Array ('Core' => '5.0.2-B2'),
'5.0.2-RC1' => Array ('Core' => '5.0.2-RC1'),
'5.0.2' => Array ('Core' => '5.0.2'),
'5.0.3-B1' => Array ('Core' => '5.0.3-B1'),
'5.0.3-B2' => Array ('Core' => '5.0.3-B2'),
'5.0.3-RC1' => Array ('Core' => '5.0.3-RC1'),
'5.0.3' => Array ('Core' => '5.0.3'),
'5.0.4-B1' => Array ('Core' => '5.0.4-B1'),
'5.0.4-B2' => Array ('Core' => '5.0.4-B2'),
'5.0.4' => Array ('Core' => '5.0.4'),
'5.1.0-B1' => Array ('Core' => '5.1.0-B1'),
'5.1.0-RC1' => Array ('Core' => '5.1.0-RC1'),
'5.1.0' => Array ('Core' => '5.1.0'),
'5.1.1-B1' => Array ('Core' => '5.1.1-B1'),
'5.1.1-B2' => Array ('Core' => '5.1.1-B2'),
'5.1.1-RC1' => Array ('Core' => '5.1.1-RC1'),
'5.1.1' => Array ('Core' => '5.1.1'),
'5.1.2-B1' => Array ('Core' => '5.1.2-B1'),
'5.1.2-RC1' => Array ('Core' => '5.1.2-RC1'),
'5.1.2' => Array ('Core' => '5.1.2'),
'5.1.3-B1' => Array ('Core' => '5.1.3-B2'),
'5.1.3-RC1' => Array ('Core' => '5.1.3-RC1'),
'5.1.3-RC2' => Array ('Core' => '5.1.3-RC2'),
'5.1.3' => Array ('Core' => '5.1.3'),
'5.2.0-B1' => Array ('Core' => '5.2.0-B1'),
'5.2.0-B2' => Array ('Core' => '5.2.0-B2'),
'5.2.0-B3' => Array ('Core' => '5.2.0-B3'),
'5.2.0-RC1' => Array ('Core' => '5.2.0-RC1'),
'5.2.0' => Array ('Core' => '5.2.0'),
+ '5.2.1-B1' => Array ('Core' => '5.2.1-B1'),
);
}
/**
* Changes table structure, where multilingual fields of TEXT type are present
*
* @param string $mode when called mode {before, after)
*/
function Upgrade_5_0_0($mode)
{
if ($mode == 'after') {
$root_category = $this->Application->findModule('Name', 'In-Link', 'RootCat');
$sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . '
SET UseMenuIconUrl = 1, MenuIconUrl = "in-link/img/menu_links.gif"
WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category;
$this->Conn->Query($sql);
$this->_updateDetailTemplate('l', 'inlink/detail', 'in-link/designs/detail');
// copy link name and description to their multilingual equivalents
$this->_copyToMultilingual();
}
}
/**
* Copy link values from normal fields to multilingual
*
*/
function _copyToMultilingual()
{
$fields = Array ('Name', 'Description');
$primary_language = $this->Application->GetDefaultLanguageId();
$set_clause = Array ();
foreach ($fields as $field) {
$set_clause[] = 'l' . $primary_language . '_' . $field . ' = ' . $field;
}
$sql = 'UPDATE ' . TABLE_PREFIX . 'Link
SET ' . implode(', ', $set_clause);
$this->Conn->Query($sql);
}
/**
* Update to 5.0.1
*
* @param string $mode when called mode {before, after)
*/
function Upgrade_5_0_1($mode)
{
if ($mode == 'after') {
$this->_updateDetailTemplate('l', 'in-link/designs/detail', 'in-link/links/link_detail');
// delete old events
$events_to_delete = Array ( 'LINK.OWNER.MODIFY.PENDING', 'LINK.OWNER.MODIFY' );
$sql = 'SELECT EventId FROM ' . TABLE_PREFIX . 'Events
WHERE Event IN ("' . implode('","', $events_to_delete) . '")';
$event_ids = $this->Conn->GetCol($sql);
if ($event_ids) {
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'EmailMessage
WHERE EventId IN (' . implode(',', $event_ids) . ')';
$this->Conn->Query($sql);
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'Events
WHERE EventId IN (' . implode(',', $event_ids) . ')';
$this->Conn->Query($sql);
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'Phrase
WHERE Phrase IN ("la_event_link.owner.modify", "la_event_link.owner.modify.pending")';
$this->Conn->Query($sql);
}
}
}
/**
* Update to 5.0.4-B1
*
* @param string $mode when called mode {before, after)
*/
function Upgrade_5_0_4_B1($mode)
{
if ($mode == 'after') {
// check in-link custom fields if need to add to search config
$custom_fields = Array (
'LinkAddress' => "('CustomField', 'LinkAddress', 1, 1, 'la_fld_LinkAddress', 'lu_fld_LinkAddress', 'In-Link', 'la_section_BusinessLocation', 1, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
'LinkCity' => "('CustomField', 'LinkCity', 1, 1, 'la_fld_LinkCity', 'lu_fld_LinkCity', 'In-Link', 'la_section_BusinessLocation', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
'LinkState' => "('CustomField', 'LinkState', 1, 1, 'la_fld_LinkState', 'lu_fld_LinkState', 'In-Link', 'la_section_BusinessLocation', 3, DEFAULT, 0, 'select', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
'LinkZipCode' => "('CustomField', 'LinkZipCode', 1, 1, 'la_fld_LinkZipCode', 'lu_fld_LinkZipCode', 'In-Link', 'la_section_BusinessLocation', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
'LinkCountry' => "('CustomField', 'LinkCountry', 1, 1, 'la_fld_LinkCountry', 'lu_fld_LinkCountry', 'In-Link', 'la_section_BusinessLocation', 5, DEFAULT, 0, 'select', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
'LinkPhone' => "('CustomField', 'LinkPhone', 1, 1, 'la_fld_LinkPhone', 'lu_fld_LinkPhone', 'In-Link', 'la_section_BusinessLocation', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, {CUSTOM_FIELD_ID})",
);
// get all in-link custom fields ides at once
$sql = 'SELECT CustomFieldId, FieldName
FROM ' . TABLE_PREFIX . 'CustomField
WHERE Type = 4 AND IsSystem = 0';
$custom_field_ids = $this->Conn->GetCol($sql, 'FieldName');
foreach ($custom_fields as $field_name => $custom_field_sql) {
$sql = 'SELECT FieldName
FROM ' . TABLE_PREFIX . 'SearchConfig
WHERE (FieldName = ' . $this->Conn->qstr($field_name) . ') AND (LOWER(ModuleName) = "in-link")';
$found = $this->Conn->GetOne($sql);
if (!$found) {
// replace sql and insert new search config record
$sql = str_replace('{CUSTOM_FIELD_ID}', $custom_field_ids[$field_name], $custom_field_sql);
$sql = 'INSERT INTO ' . TABLE_PREFIX . 'SearchConfig VALUES ' . $sql;
$this->Conn->Query($sql);
}
}
}
}
}
\ No newline at end of file
Index: branches/5.3.x/install/upgrades.sql
===================================================================
--- branches/5.3.x/install/upgrades.sql (revision 15671)
+++ branches/5.3.x/install/upgrades.sql (revision 15672)
@@ -1,196 +1,198 @@
# ===== v 4.3.9 =====
INSERT INTO Events VALUES (DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, 'In-Link', 'la_event_link.validation.results', 1);
INSERT INTO ImportScripts VALUES (DEFAULT, 'Links from CSV file [In-Link]', '', 'l', 'In-Link', '', 'CSV', '1');
UPDATE CustomField
SET ValueList = '=+||<SQL>SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM <PREFIX>StdDestinations WHERE DestType = 2 AND (DestParentId = 225 OR DestParentId = 38) ORDER BY DestParentId DESC, DestAbbr ASC</SQL>'
WHERE FieldName = 'LinkState';
UPDATE CustomField
SET ValueList = '=+||<SQL>SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM <PREFIX>StdDestinations WHERE DestType = 1 ORDER BY DestAbbr ASC</SQL>'
WHERE FieldName = 'LinkCountry';
# ===== v 5.0.0 =====
INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|');
UPDATE Category SET Template = '/in-link/designs/section' WHERE Template = 'inlink/index';
UPDATE Category SET CachedTemplate = '/in-link/designs/section' WHERE CachedTemplate = 'inlink/index';
UPDATE ConfigurationValues SET VariableValue = '/in-link/designs/section' WHERE VariableName = 'l_CategoryTemplate';
UPDATE ConfigurationValues SET VariableValue = 'in-link/designs/detail' WHERE VariableName = 'l_ItemTemplate';
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:links.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:setting_folder.view', 11, 1, 1, 0);
DELETE FROM Permissions WHERE Permission LIKE 'in-link:inlink_general.%';
UPDATE Events SET Description = 'la_event_link.owner.modify' WHERE Description = 'la_event_link.modify.modify';
UPDATE Events SET Description = 'la_event_link.owner.modify.pending' WHERE Description = 'la_event_link.modify.modify.pending';
UPDATE Phrase SET Module = 'In-Link' WHERE ((Phrase LIKE '%Links%' OR Phrase LIKE '%Listing%') AND (Module = 'Core') AND Phrase NOT IN ('la_section_QuickLinks'));
UPDATE Phrase SET Module = 'In-Link', PhraseType = 1 WHERE ( (Phrase LIKE '%Validation%' OR Phrase LIKE 'la_title_In-Link') AND (Module = 'Core') AND Phrase NOT IN ('la_ValidationEmail', 'la_prompt_validation'));
# ===== v 5.0.1 =====
UPDATE ConfigurationValues SET VariableValue = 'in-link/links/link_detail' WHERE VariableName = 'l_ItemTemplate';
UPDATE ConfigurationAdmin SET ValueList = 'ReviewText=la_opt_CommentText,CreatedOn=la_opt_CreatedOn'
WHERE VariableName IN ('Link_ReviewsSort', 'Link_ReviewsSort2');
UPDATE ConfigurationAdmin SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
WHERE VariableName IN ('Link_ReviewsOrder', 'Link_ReviewsOrder2');
UPDATE ConfigurationAdmin SET ValueList = 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_opt_CreatedOn,Hits=la_Link_Hits,CachedRating=la_opt_Rating,<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomField WHERE (Type = 4) AND (IsSystem = 0)</SQL>'
WHERE VariableName IN ('Link_SortField', 'Link_SortField2');
UPDATE ConfigurationAdmin
SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year'
WHERE VariableName IN ('link_ReviewDelay_Interval', 'link_RatingDelay_Interval');
UPDATE CustomField SET FieldLabel = 'la_fld_cust_l_ItemTemplate', Prompt = 'la_fld_cust_l_ItemTemplate' WHERE FieldName = 'l_ItemTemplate';
INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 1);
UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('link_ReviewDelay_Value', 'link_RatingDelay_Value');
# ===== v 5.0.2-B1 =====
ALTER TABLE ListingTypes CHANGE Description Description text NULL;
ALTER TABLE LinkValidation CHANGE ValidationTime ValidationTime INT NULL DEFAULT NULL;
ALTER TABLE LinkVisits CHANGE VisitTimestamp VisitTimestamp INT(11) NULL DEFAULT NULL;
# ===== v 5.0.2-B2 =====
# ===== v 5.0.2-RC1 =====
# ===== v 5.0.2 =====
# ===== v 5.0.3-B1 =====
UPDATE Phrase
SET Module = 'In-Link'
WHERE Phrase IN (
'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Delete_desc',
'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Owner.Delete_desc',
'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Rate_desc',
'lu_PermName_Link.Review_Pending_desc', 'lu_PermName_Link.View_desc'
);
# ===== v 5.0.3-B2 =====
# ===== v 5.0.3-RC1 =====
# ===== v 5.0.3 =====
# ===== v 5.0.4-B1 =====
# ===== v 5.0.4-B2 =====
# ===== v 5.0.4 =====
# ===== v 5.1.0-B1 =====
UPDATE Modules SET Path = 'modules/in-link/' WHERE `Name` = 'In-Link';
DELETE FROM ConfigurationValues WHERE VariableName IN ('StartValidationTime', 'LastExpirationTime', 'Link_Root');
UPDATE CustomField
SET ValueList = '=+||<SQL+>SELECT IsoCode AS OptionValue, l%3$s_Name AS OptionName FROM <PREFIX>CountryStates WHERE Type = 2 ORDER BY StateCountryId DESC, IsoCode ASC</SQL>'
WHERE ValueList = '=+||<SQL>SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM <PREFIX>StdDestinations WHERE DestType = 2 AND (DestParentId = 225 OR DestParentId = 38) ORDER BY DestParentId DESC, DestAbbr ASC</SQL>';
UPDATE CustomField
SET ValueList = '=+||<SQL+>SELECT IsoCode AS OptionValue, l%3$s_Name AS OptionName FROM <PREFIX>CountryStates WHERE Type = 1 ORDER BY IsoCode ASC</SQL>'
WHERE ValueList = '=+||<SQL>SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM <PREFIX>StdDestinations WHERE DestType = 1 ORDER BY DestAbbr ASC</SQL>';
DELETE FROM Permissions WHERE Permission LIKE 'in-link:configuration_email%';
# ===== v 5.1.0-RC1 =====
# ===== v 5.1.0 =====
# ===== v 5.1.1-B1 =====
ALTER TABLE Link
CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL ,
CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL;
# ===== v 5.1.1-B2 =====
UPDATE Events
SET l<%PRIMARY_LANGUAGE%>_Body = REPLACE(l<%PRIMARY_LANGUAGE%>_Body, '<inp2:<inp2:', '<inp2:')
WHERE Event LIKE 'LINK.ADD.PENDING' AND `Type` = 1;
# ===== v 5.1.1-RC1 =====
# ===== v 5.1.1 =====
# ===== v 5.1.2-B1 =====
# ===== v 5.1.2-RC1 =====
# ===== v 5.1.2 =====
# ===== v 5.1.3-B1 =====
# ===== v 5.1.3-RC1 =====
UPDATE ConfigurationValues
SET VariableValue = 'in-link/links/link_detail'
WHERE VariableName = 'l_ItemTemplate' AND VariableValue = 'in-link/designs/detail';
# ===== v 5.1.3-RC2 =====
# ===== v 5.1.3 =====
UPDATE Phrase
SET `Module` = 'Core'
WHERE PhraseKey IN ('LA_FLD_LISTINGID', 'LA_FLD_LISTINGTYPE');
# ===== v 5.2.0-B1 =====
UPDATE SearchConfig
SET ForeignField = 'PortalUser.Username'
WHERE ForeignField = 'PortalUser.Login' AND ModuleName = 'In-Link';
UPDATE SearchConfig
SET DisplayName = REPLACE(DisplayName, 'lu_', 'lc_')
WHERE DisplayName IN ('lu_field_linkid', 'lu_field_url');
UPDATE SystemSettings
SET Section = 'in-portal:configure_advanced', ModuleOwner = 'In-Portal', Heading = 'la_section_Settings3rdPartyAPI', DisplayOrder = 80.02
WHERE VariableName = 'l_GoogleMapsAPIKey';
UPDATE SystemSettings
SET DisplayOrder = DisplayOrder - 0.01
WHERE VariableName IN ('l_EnableLinkContactForm', 'ReciprocalLinkChecking');
UPDATE LanguageLabels
SET Module = 'In-Link'
WHERE PhraseKey IN ('LA_LINK_CREATEDON', 'LA_LINK_DESCRIPTION', 'LA_LINK_HITS', 'LA_LINK_NAME', 'LA_LINK_URL');
DELETE FROM LanguageLabels
WHERE PhraseKey IN (
'LA_LINK_URLSTATUS_PROMPT', 'LA_TEXT_LINK_SEARCH', 'LA_LINK_CATCHEDRATING',
'LA_LINK_CATCHEDREVIEWSQTY', 'LA_LINK_CATCHEDVOTESQTY'
);
DELETE FROM SystemSettings
WHERE VariableName IN (
'Link_Highlight_OpenTag', 'Link_Highlight_CloseTag', 'Link_RatingToPop', 'Link_UrlStatus',
'Search_Link_CatchedRating', 'Search_Link_CatchedReviewsQty', 'Search_Link_CatchedVotesQty',
'Search_Link_CreatedOn', 'Search_Link_Description', 'Search_Link_EditorsPick', 'Search_Link_Hits',
'Search_Link_HotItem', 'Search_Link_LinkId', 'Search_Link_Name', 'Search_Link_NewItem', 'Search_Link_PopItem',
'Search_Link_Priority', 'Search_Link_ResourceId', 'Search_Link_ReviewById', 'Search_Link_Status', 'Search_Link_Url'
);
UPDATE SystemSettings
SET DisplayOrder = DisplayOrder - 0.01
WHERE VariableName IN (
'link_ReviewDelay_Value', 'link_ReviewDelay_Interval', 'link_RatingDelay_Value', 'link_RatingDelay_Interval',
'l_MaxCategories', 'l_EnableGoogleMaps', 'l_EnableLinkContactForm', 'ReciprocalLinkChecking'
);
UPDATE SearchConfig
SET ForeignField = 'Users.Username'
WHERE ForeignField = 'PortalUser.Username' AND ModuleName = 'In-Link';
# ===== v 5.2.0-B2 =====
UPDATE Link main_table
SET main_table.CachedReviewsQty = (SELECT COUNT(*) FROM <%TABLE_PREFIX%>CatalogReviews review_table WHERE review_table.ItemId = main_table.ResourceId);
# ===== v 5.2.0-B3 =====
# ===== v 5.2.0-RC1 =====
# ===== v 5.2.0 =====
INSERT INTO Permissions VALUES(DEFAULT, 'in-link:configuration_output.add', 11, 1, 1, 0);
+
+# ===== v 5.2.1-B1 =====
Index: branches/5.3.x/install/install_data.sql
===================================================================
--- branches/5.3.x/install/install_data.sql (revision 15671)
+++ branches/5.3.x/install/install_data.sql (revision 15672)
@@ -1,226 +1,226 @@
# Section "in-link:configuration_output":
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name||Description=la_Link_Description||Url=la_Link_URL||CreatedOn=la_opt_CreatedOn||Hits=la_Link_Hits||CachedRating=la_opt_Rating||<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomFields WHERE (Type = 4) AND (IsSystem = 0)</SQL>', 10.01, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending||desc=la_common_descending', 10.01, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name||Description=la_Link_Description||Url=la_Link_URL||CreatedOn=la_opt_CreatedOn||Hits=la_Link_Hits||CachedRating=la_opt_Rating||<SQL>SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM <PREFIX>CustomFields WHERE (Type = 4) AND (IsSystem = 0)</SQL>', 10.02, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending||desc=la_common_descending', 10.02, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', 'style="width: 50px;"', 10.12, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_opt_Sec||60=la_opt_Min||3600=la_opt_Hour||86400=la_opt_Day||604800=la_opt_Week||2419200=la_opt_Month||29030400=la_opt_Year', 10.12, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', 'style="width: 50px;"', 10.13, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_opt_Sec||60=la_opt_Min||3600=la_opt_Hour||86400=la_opt_Day||604800=la_opt_Week||2419200=la_opt_Month||29030400=la_opt_Year', 10.13, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_MaxCategories', '3', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_fld_MaxCategories', 'text', NULL, NULL, 10.14, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_EnableGoogleMaps', '0', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_fld_LinkEnableGoogleMaps', 'checkbox', NULL, NULL, 10.15, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_EnableLinkContactForm', '1', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_config_EnableLinkContactForm', 'checkbox', NULL, NULL, 10.16, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'ReciprocalLinkChecking', '0', 'In-Link', 'in-link:configuration_output', 'la_Text_Links', 'la_config_ReciprocalLinkChecking', 'checkbox', NULL, NULL, 10.17, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_opt_CommentText||CreatedOn=la_opt_CreatedOn', 20.01, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_Ascending||desc=la_common_Descending', 20.01, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_opt_CommentText||CreatedOn=la_opt_CreatedOn', 20.02, 1, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_Ascending||desc=la_common_Descending', 20.02, 2, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output', 'la_Text_Reviews', 'la_review_perpage_short_prompt', 'text', NULL, NULL, 20.04, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_CategoryTemplate', '/in-link/designs/section', 'In-Link', 'in-link:configuration_output', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_ItemTemplate', 'in-link/links/link_detail', 'In-Link', 'in-link:configuration_output', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_MaxImageCount', '5', 'In-Link', 'in-link:configuration_output', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 40.01, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_ThumbnailImageWidth', '120', 'In-Link', 'in-link:configuration_output', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 40.02, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_ThumbnailImageHeight', '120', 'In-Link', 'in-link:configuration_output', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 40.03, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_FullImageWidth', '450', 'In-Link', 'in-link:configuration_output', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 40.04, 0, 0, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'l_FullImageHeight', '450', 'In-Link', 'in-link:configuration_output', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 40.05, 0, 0, NULL);
# Section "in-link:configuration_search":
INSERT INTO SystemSettings VALUES(DEFAULT, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1, NULL);
INSERT INTO SystemSettings VALUES(DEFAULT, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1, NULL);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, 'In-Link', 'Add Link', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, 'In-Link', 'Add Link', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Add Pending Link', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, 'In-Link', 'Add Pending Link', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, 'In-Link', 'Modify Link', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, 'In-Link', 'Modify Link', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, 'In-Link', 'Link Modification Pending', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, 'In-Link', 'Link Modification Pending', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, 'In-Link', 'Approve Link Modification', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, 'In-Link', 'Decline link modification', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, 'In-Link', 'Approve Pending Link', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, 'In-Link', 'Deny Link', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, 'In-Link', 'Link Comment Added', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, 'In-Link', 'Link Comment Added', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Link Comment Pending', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Link Comment Pending', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, 'In-Link', 'Link Comment Approved', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, 'In-Link', 'Link Comment Declined', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'Link enhancement submitted', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'Link enhancement submitted', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, 'In-Link', 'Link enhancement approved', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, 'In-Link', 'Link enhancement approved', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, 'In-Link', 'Link enhancement denied', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, 'In-Link', 'Link enhancement denied', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'Link enhancement expired', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'Link enhancement expired', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'Link enhancement renewal submitted', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'Link enhancement renewal submitted', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, 'In-Link', 'Link enhancement extended', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, 'In-Link', 'Link enhancement extended', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'Link enhancement renewal failed', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'Link enhancement renewal failed', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'Link enhancement cancelled', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'Link enhancement cancelled', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'Link enhancement is about to expire', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'Link enhancement is about to expire', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, 'In-Link', 'Link Contact Form', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, 'In-Link', 'Link Contact Form', 0, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, 'In-Link', 'Reciprocal Check Failed', 1, 1, 1);
-INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, 'In-Link', 'Link Validation Results', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, 'In-Link', 'Add Link', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, 'In-Link', 'Add Link', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Add Pending Link', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, 'In-Link', 'Add Pending Link', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, 'In-Link', 'Modify Link', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, 'In-Link', 'Modify Link', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, 'In-Link', 'Link Modification Pending', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, 'In-Link', 'Link Modification Pending', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, 'In-Link', 'Approve Link Modification', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, 'In-Link', 'Decline link modification', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, 'In-Link', 'Approve Pending Link', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, 'In-Link', 'Deny Link', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, 'In-Link', 'Link Comment Added', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, 'In-Link', 'Link Comment Added', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Link Comment Pending', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, 'In-Link', 'Link Comment Pending', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, 'In-Link', 'Link Comment Approved', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, 'In-Link', 'Link Comment Declined', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'Link enhancement submitted', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'Link enhancement submitted', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, 'In-Link', 'Link enhancement approved', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, 'In-Link', 'Link enhancement approved', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, 'In-Link', 'Link enhancement denied', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, 'In-Link', 'Link enhancement denied', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'Link enhancement expired', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'Link enhancement expired', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'Link enhancement renewal submitted', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'Link enhancement renewal submitted', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, 'In-Link', 'Link enhancement extended', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, 'In-Link', 'Link enhancement extended', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'Link enhancement renewal failed', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'Link enhancement renewal failed', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'Link enhancement cancelled', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'Link enhancement cancelled', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'Link enhancement is about to expire', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'Link enhancement is about to expire', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, 'In-Link', 'Link Contact Form', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, 'In-Link', 'Link Contact Form', 0, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, 'In-Link', 'Reciprocal Check Failed', 1, 1, 1);
+INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, 'In-Link', 'Link Validation Results', 1, 1, 1);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkAddress', 'lu_fld_LinkAddress', 0, 'la_section_BusinessLocation', 'la_fld_LinkAddress', 'text', 'size="40"', '', 1, 1, 0, 0);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkCity', 'lu_fld_LinkCity', 0, 'la_section_BusinessLocation', 'la_fld_LinkCity', 'text', 'size="40"', '', 2, 1, 0, 0);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkZipCode', 'lu_fld_LinkZipCode', 0, 'la_section_BusinessLocation', 'la_fld_LinkZipCode', 'text', NULL, '', 4, 1, 0, 0);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkState', 'lu_fld_LinkState', 0, 'la_section_BusinessLocation', 'la_fld_LinkState', 'select', '=+||<SQL+>SELECT IsoCode AS OptionValue, l%3$s_Name AS OptionName FROM <PREFIX>CountryStates WHERE Type = 2 ORDER BY StateCountryId DESC, IsoCode ASC</SQL>', '', 3, 1, 0, 0);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkCountry', 'lu_fld_LinkCountry', 0, 'la_section_BusinessLocation', 'la_fld_LinkCountry', 'select', '=+||<SQL+>SELECT IsoCode AS OptionValue, l%3$s_Name AS OptionName FROM <PREFIX>CountryStates WHERE Type = 1 ORDER BY IsoCode ASC</SQL>', '', 5, 1, 0, 0);
INSERT INTO CustomFields VALUES (DEFAULT, 4, 'LinkPhone', 'lu_fld_LinkPhone', 0, 'la_section_BusinessLocation', 'la_fld_LinkPhone', 'text', NULL, '', 6, 1, 0, 0);
INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link');
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.ADD', 'la_PermName_Link.Add_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.VIEW', 'la_PermName_Link.View_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.ADD.PENDING', 'la_PermName_Link.Add.Pending_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.MODIFY', 'la_PermName_Link.Modify_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.DELETE', 'la_PermName_Link.Delete_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.RATE', 'la_PermName_Link.Rate_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.REVIEW', 'la_PermName_Link.Review_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 'la_PermName_Link.Review_Pending_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 'la_PermName_Link.Modify.Pending_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 'la_PermName_Link.Owner.Modify_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 'la_PermName_Link.Owner.Modify.Pending_desc', 'In-Link', 1);
INSERT INTO CategoryPermissionsConfig VALUES (DEFAULT, 'LINK.OWNER.DELETE', 'la_PermName_Link.Owner.Delete_desc', 'In-Link', 1);
INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lc_field_orgid', 'In-Link', 'la_text_link', 19, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lc_field_newitem', 'In-Link', 'la_text_link', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lc_field_popitem', 'In-Link', 'la_text_link', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lc_field_hotitem', 'In-Link', 'la_text_link', 16, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lc_field_resourceid', 'In-Link', 'la_text_link', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lc_field_EditorsPick', 'In-Link', 'la_text_link', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lc_field_status', 'In-Link', 'la_text_link', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lc_field_priority', 'In-Link', 'la_text_link', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lc_field_modifiedbyid', 'In-Link', 'la_text_link', 11, DEFAULT, 0, 'text', 'Users.Username', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lc_field_createdbyid', 'In-Link', 'la_text_link', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lc_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lc_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lc_field_linkid', 'In-Link', 'la_text_link', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lc_field_name', 'In-Link', 'la_text_link', 1, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lc_field_description', 'In-Link', 'la_text_link', 2, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lc_field_url', 'In-Link', 'la_text_link', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lc_field_createdon', 'In-Link', 'la_text_link', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lc_field_modified', 'In-Link', 'la_text_link', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lc_field_hits', 'In-Link', 'la_text_link', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lc_field_cachedrating', 'In-Link', 'la_text_link', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkAddress', 1, 1, 'la_fld_LinkAddress', 'lu_fld_LinkAddress', 'In-Link', 'la_section_BusinessLocation', 1, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkCity', 1, 1, 'la_fld_LinkCity', 'lu_fld_LinkCity', 'In-Link', 'la_section_BusinessLocation', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkState', 1, 1, 'la_fld_LinkState', 'lu_fld_LinkState', 'In-Link', 'la_section_BusinessLocation', 3, DEFAULT, 0, 'select', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkZipCode', 1, 1, 'la_fld_LinkZipCode', 'lu_fld_LinkZipCode', 'In-Link', 'la_section_BusinessLocation', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkCountry', 1, 1, 'la_fld_LinkCountry', 'lu_fld_LinkCountry', 'In-Link', 'la_section_BusinessLocation', 5, DEFAULT, 0, 'select', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('CustomFields', 'LinkPhone', 1, 1, 'la_fld_LinkPhone', 'lu_fld_LinkPhone', 'In-Link', 'la_section_BusinessLocation', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2);
INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>CatalogReviews WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 14, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 11, 1, 0, {LinkCatId});
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 15, 0, 0, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:links.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:setting_folder.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:approve', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:decline', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:continue', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:restart', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:validate', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:reset', 11, 1, 1, 0);
INSERT INTO ImportScripts VALUES (DEFAULT, 'Links from CSV file [In-Link]', '', 'l', 'In-Link', '', 'CSV', '1');
INSERT INTO CustomFields VALUES (DEFAULT, 1, 'l_ItemTemplate', 'la_fld_cust_l_ItemTemplate ', 0, 'la_title_SystemCF', 'la_fld_cust_l_ItemTemplate ', 'text', NULL, '', 0, 0, 1, 0);
INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|');
INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL, NULL);
Index: branches/5.3.x
===================================================================
--- branches/5.3.x (revision 15671)
+++ branches/5.3.x (revision 15672)
Property changes on: branches/5.3.x
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+.idea
+atlassian-ide-plugin.xml
Modified: svn:mergeinfo
## -0,0 +0,2 ##
Merged /modules/in-link/branches/5.2.x:r15486-15627
Merged /modules/in-link/releases/5.2.1-B1:r15628-15671

Event Timeline