Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773521
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 2, 2:51 PM
Size
4 KB
Mime Type
text/x-diff
Expires
Tue, Feb 4, 2:51 PM (2 h, 12 m)
Engine
blob
Format
Raw Data
Handle
556737
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php (revision 1369)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php (revision 1370)
@@ -1,108 +1,108 @@
<?php
class ConfigSearchEventHandler extends InpDBEventHandler {
/**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
* @access protected
* @see OnListBuild
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
$module_owner=$this->Application->GetVar('module');
if ($module_owner===false) {
$module_owner=$this->myUrlDecode($this->Application->GetVar('confs_module'));
$this->Application->SetVar("module", $module_owner);
}
$section=$this->Application->GetVar('section');
if ($section===false){
$section=$this->myUrlDecode($this->Application->GetVar('confs_section'));
$this->Application->SetVar("section", $section);
}
$object->addFilter('module_filter', '%1$s.ModuleName = "'.$module_owner.'"');
$object->AddOrderField('DisplayOrder', 'ASC');
}
function OnUpdate(&$event)
{
parent::OnUpdate($event);
$module_owner=$this->Application->GetVar('module');
$module_section=$this->Application->GetVar('section');
$conf_update = new kEvent( );
$conf_update->Init('conf');
$conf_update->Name = 'OnUpdate';
$conf_update->redirect = false;
$this->Application->HandleEvent($conf_update);
$event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay!
}
function OnCancel(&$event)
{
parent::OnCancel($event);
$module_owner=$this->Application->GetVar('module');
$module_section=$this->Application->GetVar('section');
$event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay!
}
function myUrlDecode($str){
$str=str_replace(';',':', $str);
$str=str_replace('!','-', $str);
return $str;
}
function myUrlEncode($str){
$str=str_replace('-', '!', $str);
$str=str_replace(':', ';', $str);
return $str;
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnCreateCustomField(&$event)
{
$cf_object =& $event->MasterEvent->getObject();
$item_id = $this->getPassedID($event->MasterEvent);
if($item_id == '')
{
// only when creating new custom field
$cf_search = array();
$cf_search['CustomFieldId'] = $cf_object->FieldValues['CustomFieldId'];
$cf_search['DisplayOrder'] = $cf_object->FieldValues['DisplayOrder'];
$cf_search['ElementType'] = $cf_object->FieldValues['ElementType'];
$cf_search['DisplayName'] = $cf_object->FieldValues['FieldLabel'];
$cf_search['FieldName'] = $cf_object->FieldValues['FieldName'];
$cf_search['Description'] = $cf_object->FieldValues['Prompt'];
$cf_search['TableName'] = "CustomField";
$cf_search['ModuleName'] = "In-Commerce";
$cf_search['ForeignField'] = "CustomMetaData.Value";
- $cf_search['JoinClause'] = "(inp_CustomMetaData.ResourceId={Table}.ResourceId)";
+ $cf_search['JoinClause'] = "{ForeignTable}.ResourceId={LocalTable}.ResourceId";
$this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
$cf_item = $event->getObject();
$cf_item->SetFieldsFromHash($cf_search);
$cf_item->Create();
}
}
}
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Event Timeline
Log In to Comment