Alexander Nicolaysen Sørnes : objectManager: Retrieve Common replies from the database
Alexander Nicolaysen Sørnes
asornes at winehq.org
Sun Apr 24 05:55:14 CDT 2011
Module: appdb
Branch: master
Commit: 852768f9770ff268355ce3308196a3e9ee7b4e2f
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=852768f9770ff268355ce3308196a3e9ee7b4e2f
Author: Alexander Nicolaysen Sørnes <alexsornes at gmail.com>
Date: Sun Apr 24 12:54:48 2011 +0200
objectManager: Retrieve Common replies from the database
---
include/objectManager.php | 45 +++++++++++++++------------------------------
1 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/include/objectManager.php b/include/objectManager.php
index 864845e..00c7251 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -26,10 +26,6 @@ class ObjectManager
where we first run the object's getOutputEditorValues()
and then objectManager's delete_entry(). */
- // an array of common responses used when replying to
- // queued entries
- private $aCommonResponses;
-
/* Remove the cached object of the class we are working with, useful in cases where we
modify the object in such a way that it needs to be reloaded */
private function flushCachedObject()
@@ -140,27 +136,6 @@ class ObjectManager
$this->oTableRow = new OMTableRow(null);
$this->sState = 'accepted';
$this->oFilters = null; // We only fill this when needed, as it can be quite slow
-
- // initialize the common responses array
- $this->aCommonResponses = array();
- $this->aCommonResponses[] = "Thank you for your submission.";
- $this->aCommonResponses[] = "Please consider filing a bug for the ".
- "problem you have with this app, if there are not bugs filed already".
- " at http://bugs.winehq.org. If you want some advice or guidance on".
- " this, please visit http://forum.winehq.org";
- $this->aCommonResponses[] = "Please do not paste debug output in the AppDB,".
- " it belongs only as an attachment on bugzilla.";
- $this->aCommonResponses[] = "We appreciate your submission but it".
- " needs to be more detailed before it will be most useful to other users of".
- " the Application Database.".
- " Please try to improve the entry and resubmit.";
- $this->aCommonResponses[] = "We appreciate your submission but it".
- " requires improvement to its grammar and/or spelling".
- " before it will be most useful to other users of".
- " the Application Database.".
- " Please try to improve the entry and resubmit.";
- $this->aCommonResponses[] = "Please do not copy large amount of text from".
- " the program's website";
}
/* Check whether the associated class has the given method */
@@ -459,16 +434,26 @@ class ObjectManager
{
/////////////////////////////////////////////////
// output radio buttons for some common responses
+
+ $oTag = new TagCommonReply(null, null, "_show_for_{$this->sClass}");
+ $aReplies = $oTag->getTaggedEntries();
+
+ if(!sizeof($aReplies))
+ $sHelp = 'There are no common replies for processing this type of entries';
+ else
+ $sHelp = 'Clicking on a reply will copy it to the E-mail text field';
+
echo '<tr valign=top><td class="color0"></td><td class="color0">'.
- '<b>Common replies</b><br> Clicking on a reply will copy it to the E-mail text field.<br> '.
+ '<b>Common replies</b><br> '.$sHelp.'.<br> '.
'Email <a href="mailto:'.APPDB_OWNER_EMAIL.'">'.
APPDB_OWNER_EMAIL.'</a> if you want to suggest a new common reply.</td></tr>',"\n";
- foreach($this->aCommonResponses as $iIndex => $sReply)
+ foreach($aReplies as $oReply)
{
- echo '<tr valign=top><td class="color0"></td>',"\n";
- echo '<td class="color0"><a onClick="document.forms[\'sQform\'][\'sReplyText\'].innerHTML += \''.$sReply.' \';">'.$sReply.'</a></td>',"\n";
- echo '</tr>',"\n";
+ $sReply = $oReply->getReply();
+ echo '<tr valign=top><td class="color0"></td>',"\n";
+ echo '<td class="color0"><a onClick="document.forms[\'sQform\'][\'sReplyText\'].innerHTML += \''.$sReply.' \';">'.$sReply.'</a></td>',"\n";
+ echo '</tr>',"\n";
}
// end output radio buttons for common responses
/////////////////////////////////////////////////
More information about the wine-cvs
mailing list