Update of /cvsroot/phpwebsite-comm/modules/article/class
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7828/class
Modified Files:
AM_Actions.php AM_Lists.php Article.php
Log Message:
Users' Displaynames are now stored&shown instead of their system usernames
Search Menu now matches on Users' Displaynames, not their Usernames
Index: AM_Lists.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Lists.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AM_Lists.php 17 Oct 2007 04:35:30 -0000 1.15
--- AM_Lists.php 22 Jan 2008 04:55:04 -0000 1.16
***************
*** 29,33 ****
break;
case 2: // "Articles Belonging To:"
! $db->addWhere('created_username', $s_arr['owner_name']);
break;
default: // "All Articles"
--- 29,44 ----
break;
case 2: // "Articles Belonging To:"
! // Search for userids belonging to this name fragment
! $db1 = new PHPWS_DB('users');
! $db1->addColumn('id');
! // Not sure if we want this $db1->addWhere('display_name', '%'.$s_arr['owner_name'].'%', 'LIKE');
! $db1->addWhere('display_name', $s_arr['owner_name']);
! $result = $db1->select('col');
! if (!PHPWS_Error::logIfError($result) && !empty($result)) {
! if (count($result)==1)
! $db->addWhere('created_id', $result[0]);
! else
! $db->addWhere('created_id', $result, 'IN');
! }
break;
default: // "All Articles"
Index: AM_Actions.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Actions.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** AM_Actions.php 26 Oct 2007 07:25:35 -0000 1.11
--- AM_Actions.php 22 Jan 2008 04:55:04 -0000 1.12
***************
*** 58,63 ****
//$new_article->is_new_article = true;
! if (Current_User::getUsername()) {
! $new_article->created_username = $new_article->updated_username = Current_User::getUsername();
$new_article->created_id = $new_article->updated_id = Current_User::getId();
}
--- 58,63 ----
//$new_article->is_new_article = true;
! if (Current_User::getDisplayName()) {
! $new_article->created_username = $new_article->updated_username = Current_User::getDisplayName();
$new_article->created_id = $new_article->updated_id = Current_User::getId();
}
Index: Article.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** Article.php 17 Dec 2007 02:24:52 -0000 1.50
--- Article.php 22 Jan 2008 04:55:04 -0000 1.51
***************
*** 101,106 ****
{
// Load Default values.
! if (Current_User::getUsername()) {
! $this->created_username = $this->updated_username = Current_User::getUsername();
$this->created_id = $this->updated_id = Current_User::getId();
}
--- 101,106 ----
{
// Load Default values.
! if (Current_User::getDisplayName()) {
! $this->created_username = $this->updated_username = Current_User::getDisplayName();
$this->created_id = $this->updated_id = Current_User::getId();
}
***************
*** 882,886 ****
$message =
sprintf(dgettext('article', 'This article is currently being edited by %1$s. Try again in about %2$s minutes'
! , Current_User::getUsername($this->edituser), floor($timeleft / 60)));
PHPWS_User::disallow($message);
return false;
--- 882,886 ----
$message =
sprintf(dgettext('article', 'This article is currently being edited by %1$s. Try again in about %2$s minutes'
! , Current_User::getDisplayName($this->edituser), floor($timeleft / 60)));
PHPWS_User::disallow($message);
return false;
|