From b3c68f19351738b91fa85c8f2a9fc8c0165531b7 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 31 May 2014 09:28:06 -0500 Subject: [PATCH 1/2] Clarify config labels (Fix #29) --- .../language/en-GB/en-GB.com_patchtester.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.ini b/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.ini index 1693596..3310fba 100644 --- a/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.ini +++ b/administrator/components/com_patchtester/language/en-GB/en-GB.com_patchtester.ini @@ -21,12 +21,12 @@ COM_PATCHTESTER_FIELD_GH_PASSWORD_LABEL="GitHub Account Password" COM_PATCHTESTER_FIELD_GH_PASSWORD_DESC="Password for the account entered in the "_QQ_"GitHub Account"_QQ_" field. Note that accounts using Two Factor Authentication will not work with this component." COM_PATCHTESTER_FIELD_GH_TOKEN_DESC="Use this field to input a GitHub API Token in place of your username and password. Note that this is required if your account has Two Factor Authentication enabled." COM_PATCHTESTER_FIELD_GH_TOKEN_LABEL="GitHub Token" -COM_PATCHTESTER_FIELD_GH_USER_LABEL="GitHub Account" +COM_PATCHTESTER_FIELD_GH_USER_LABEL="GitHub Account Username" COM_PATCHTESTER_FIELD_GH_USER_DESC="Name of account on GitHub of which to authenticate to the API with" -COM_PATCHTESTER_FIELD_ORG_LABEL="GitHub Username" -COM_PATCHTESTER_FIELD_ORG_DESC="Name of account on GitHub of which to monitor pull requests" -COM_PATCHTESTER_FIELD_REPO_LABEL="GitHub Repository" -COM_PATCHTESTER_FIELD_REPO_DESC="Name of repository on GitHub of which to monitor pull requests" +COM_PATCHTESTER_FIELD_ORG_LABEL="GitHub Project Owner" +COM_PATCHTESTER_FIELD_ORG_DESC="A username or organization on GitHub of which to monitor pull requests" +COM_PATCHTESTER_FIELD_REPO_LABEL="GitHub Project Repository" +COM_PATCHTESTER_FIELD_REPO_DESC="Name of a repository on GitHub of which to monitor pull requests" COM_PATCHTESTER_FILE_DELETED_DOES_NOT_EXIST_S="The file marked for deletion does not exist: %s" COM_PATCHTESTER_FILE_MODIFIED_DOES_NOT_EXIST_S="The file marked for modification does not exist: %s" COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION="Filter the list by title or ID." From ed0ccf0c5f9c20441e8f4add92bb55aca678d7fa Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 31 May 2014 10:25:13 -0500 Subject: [PATCH 2/2] Refactor search filter (Fix #30) --- .../components/com_patchtester/models/pulls.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/administrator/components/com_patchtester/models/pulls.php b/administrator/components/com_patchtester/models/pulls.php index 34517a6..55233fe 100644 --- a/administrator/components/com_patchtester/models/pulls.php +++ b/administrator/components/com_patchtester/models/pulls.php @@ -122,15 +122,12 @@ class PatchtesterModelPulls extends JModelList if (!empty($search)) { - if (stripos($search, 'id:') === 0) - { - $query->where($db->quoteName('a.pull_id') . ' = ' . (int) substr($search, 3)); - } - else - { - $search = $db->quote('%' . $db->escape($search, true) . '%'); - $query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ')'); - } + $search = $db->quote('%' . $db->escape($search, true) . '%'); + $query->where( + '(' . $db->quoteName('a.title') . ' LIKE ' . $search . ') OR ' . + '(' . $db->quoteName('a.pull_id') . ' LIKE ' . $search . ') OR ' . + '(' . $db->quoteName('a.joomlacode_id') . ' LIKE ' . $search . ')' + ); } // Handle the list ordering.