r1157: Throw an error if there aren't any products on search.php and newreport.php
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 17 Sep 2006 17:55:22 +0000 (17:55 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 17 Sep 2006 17:55:22 +0000 (17:55 +0000)
docs/changes.txt
newreport.php
search.php

index 53d5779cdda4b040dc7a2fd70a8e41e61f14a872..3082a2bd43622d5641b53afc8970dcf8440efb21 100644 (file)
@@ -6,6 +6,7 @@
 - Fix the correct stylevar for language codes
 - Fixed another can_perform() product-based permissions check [search.php]
 - More changes to syndicate.php to increase performance
+- Add checks to newreport.php and search.php to see if there are products, if there aren't, then throw a message about needing them to be setup
 
 1.1.0 Beta 2
 ===============================
index b843910160267f0a4ddea53ed042c3660f8c9cb7..d60868f8da0e649dbca437c5f147b76128335bc7 100755 (executable)
@@ -143,6 +143,11 @@ if ($_POST['do'] == 'insert')
 
 if ($_REQUEST['do'] == 'add')
 {
+       if (!is_array($bugsys->datastore['product']))
+       {
+               $message->error(_('No products have been setup, therefore no bugs can be added.'));
+       }
+       
        $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity']));
 
        $show['changestatus'] = ((can_perform('canchangestatus')) ? true : false);
index 711c49b130e664e2b712bfd580dd5af73e1e48f9..7a9f641cd5e57bbce711e1bb3d65913b89461d46 100644 (file)
@@ -322,6 +322,11 @@ if ($_REQUEST['do'] == 'search')
        
        if ($newsearch)
        {
+               if (!is_array($bugsys->datastore['product']))
+               {
+                       $message->error(_('No products are setup, therefore there can be no bugs and thus search cannot function.'));
+               }
+               
                $pcv_select = construct_pcv_select();
                
                // -------------------------------------------------------------------