[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
Xataface Forums • View topic - Sort related records

Sort related records

A place for users and developers of the Xataface to discuss and receive support.

Sort related records

Postby mhassl » Wed Jan 23, 2013 8:20 pm

I need a way to have the contact log table which is the child of the contact logs table to have a sort other than the primary key of the logs table. I have tried the addition to the relationships.ini file:

[contact_log]
contact_log.contact_id = "$Contact_Id"
metafields: order = log_date desc

as well as the ApplicationDelegate.php:

<?php
class conf_ApplicationDelegate {
function getPermissions(&$record){
// $record is a Dataface_Record object
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user ) return Dataface_PermissionsTool::ALL();
else return Dataface_PermissionsTool::NO_ACCESS();
}
function beforeHandleRequest(){
//$query =& Dataface_Application::getInstance()->getQuery();
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();

//if ( $query['-table'] == 'tbl_jobs' and !@$query['-sort'] and !$_POST ){
// $query['-sort'] = 'job_id desc';
//}
if( !$_POST and $query['-table'] == 'contacts' and !isset($query['-sort']) ){
$query['-sort'] = 'Last_Name asc, First_Name asc';
}
if( !$_POST and $query['-table'] == 'contact_log' and !isset($query['-sort']) ){
$query['-sort'] = 'log_date desc';
}

}
}

Neither works. What is the correct technique? This should be a common and simple task.

Thanks,
Mike
mhassl
 
Posts: 2
Joined: Wed Jan 23, 2013 8:04 pm

Re: Sort related records

Postby shannah » Thu Jan 24, 2013 9:48 am

--
Steve Hannah
(on twitter)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Sort related records

Postby mhassl » Sun Feb 03, 2013 4:34 pm

Steve,

Thanks the sort works but I get the following error at the top of the screen upon login:

Notice: Undefined index: -relationship in C:\Program Files (x86)\EasyPHP-5.3.9\www\habitat\conf\ApplicationDelegate.php on line 17

The file contains the following:

<?php
class conf_ApplicationDelegate {
function getPermissions(&$record){
// $record is a Dataface_Record object
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user ) return Dataface_PermissionsTool::ALL();
else return Dataface_PermissionsTool::NO_ACCESS();
}
function beforeHandleRequest(){
//$query =& Dataface_Application::getInstance()->getQuery();
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
if( !$_POST and $query['-table'] == 'contacts' and !isset($query['-sort']) ){
$query['-sort'] = 'Last_Name asc, First_Name asc';
}
if ( !@$_POST and $query['-table'] == 'contacts' and $query['-relationship'] == 'contact_log' and !@$query['-related:sort'] ){
$query['-related:sort'] = 'log_date desc';
}
}
}

The log_date and all the other required indices exist. So what does the error mean, and how do I fix it?

Here is the relationship.ini for contacts table:

[contact_log]
contact_log.contact_id = "$Contact_Id"

[contact_info]
contact_info.contact_id = "$Contact_Id"

Thanks,
Mike
mhassl
 
Posts: 2
Joined: Wed Jan 23, 2013 8:04 pm

Re: Sort related records

Postby shannah » Mon Feb 04, 2013 9:48 am

--
Steve Hannah
(on twitter)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved