r1197: - Fixing the API so we don't have verification errors; we only need to check...
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 28 Sep 2006 01:34:07 +0000 (01:34 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 28 Sep 2006 01:34:07 +0000 (01:34 +0000)
- Add an upgrade task that updates the help text for newreply

includes/api_userhelp.php
install/upgrade5.php

index 2bf72a73c4a64d6a42467207e949a80db1ee511b..1ecf45b5a71bfbeb6b257de45bb4602db06e2e85 100644 (file)
@@ -40,7 +40,7 @@ class UserHelpAPI extends API
        * @access       private
        */
        var $fields = array(
-               'keystring'     => array(TYPE_STR,              REQ_YES,        ':self'),
+               'keystring'     => array(TYPE_STR,              REQ_AUTO),
                'title'         => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
                'body'          => array(TYPE_STR,              REQ_YES)
        );
@@ -87,6 +87,20 @@ class UserHelpAPI extends API
                );
        }
        
+       // ###################################################################
+       /**
+       * Pre-insert
+       *
+       * @access       private
+       */
+       function pre_insert()
+       {
+               if (($err = $this->verify_keystring()) !== true)
+               {
+                       $this->error($err);     
+               }
+       }
+       
        // ###################################################################
        /**
        * Post-insert
index 2457c0ca3f2b3901c2309507812363a1f3e8ec8a..806ca52f6c50de66dd85ddad0113413dbed4aca2 100644 (file)
@@ -60,6 +60,19 @@ if ($bugsys->in['mark'] == 1)
        
        build_automations();
        echo "Rebuilding the automations cahce<br />\n";
+       
+       $topic = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'");
+       if (md5($topic['body']) == '7e1154340454ca6d8f8ba47aab057c23')
+       {
+               $topic = $db->query("UPDATE " . TABLE_PREFIX . "fieldhelp SET body = 'Here you can specify additional comments. If you do not change any fields, this will merely attach a comment.
+
+The \"Automation\" drop-down next to this box (which may be hidden) will allow you to perform a common task. These administrator-defined tasks can change any of the bug fields automatically and then add an automatic reply. If you change a field that will be altered by the action, the action\'s change will take precedence. Also, if you enter a comment and the action specifies a comment, the automatic comment will be attached to yours.' WHERE keystring = 'newreply'");
+               echo "Updating user help topic on new replies<br />\n";
+       }
+       else
+       {
+               echo "<strong>ALERT:</strong> You have modified your user help topic for <em>newreply</em> which means that the help item was not updated for the renaming of 'Automatic Action' to 'Automation'<br />\n";
+       }
 }
 
 // ###################################################################