Plugin Directory

Changeset 964112


Ignore:
Timestamp:
08/11/2014 08:51:28 PM (12 years ago)
Author:
tickerator
Message:

bug fixes

Location:
bugerator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bugerator/trunk/bugerator.php

    r847902 r964112  
    55  Plugin URI: http://www.tickerator.org/bugerator
    66  Description: A bug tracking / issue tracking plugin
    7   Version: 1.1.6
     7  Version: 1.1.7
    88  Author: David Whipple
    99  Author URI: http://www.tickerator.org
     
    3333// version info
    3434global $bugerator_version;
    35 $bugerator_version = "1.1.6";
     35$bugerator_version = "1.1.7";
    3636
    3737
     
    174174
    175175
    176     date_default_timezone_set('America/Denver');
     176    date_default_timezone_set(get_option('timezone_string'));
    177177    global $bugerator_project_id;
    178178    // if there is a shortcode in the project then take away the option to change it.
     
    588588                else
    589589                    $next_date = "";
    590             }
    591             else
     590            } else
    592591                $next_date = "";
    593592            // get admin list
     
    14231422            } else {
    14241423                // reduce the current version if we eliminated older versions
    1425                 if($project_info->current_version > $x)
     1424                if ($project_info->current_version > $x)
    14261425                    $project_info->current_version --;
    14271426            }
     
    19531952                $version = intval($_POST['project_version']);
    19541953            else {
    1955                 if(isset($options['default_version']))
     1954                if (isset($options['default_version']))
    19561955                    $version = $options['default_version'];
    19571956                else
     
    19951994                    $error = $file[1];
    19961995                    $data['filename'] = 0;
    1997                 }
    1998                 else
     1996                } else
    19991997                    $data['filename'] = $file;
    20001998            } else {
     
    20032001            }
    20042002
    2005 
    2006             // I should probably insert the wordpress way. Here it is. I need the ID anyway.
    2007             $wpdb->insert($bugerator_issue_table, $data);
    2008             $issue_id = $wpdb->insert_id;
    2009 
     2003            // check and make sure this isn't a duplicate refresh
     2004            $sql = $wpdb->prepare("SELECT * FROM $bugerator_issue_table where title = '%s' and description = '" .
     2005                    "%s' and status = 0",$data['title'],$data['description']);
     2006            $result = $wpdb->get_results($sql);
     2007
     2008            if (count($result) == 0) {
     2009
     2010                // I should probably insert the wordpress way. Here it is. I need the ID anyway.
     2011                $wpdb->insert($bugerator_issue_table, $data);
     2012                $issue_id = $wpdb->insert_id;
     2013            } else {
     2014                $issue_id = $result[0]->id;
     2015            }
    20102016            // subscribe the user to the project
    20112017            if (true == is_user_logged_in())
     
    24912497                    $log_output .= "Assigned to $thisuser->display_name from $olduser->display_name.\r\n";
    24922498                $options = BugeratorMenu::get_options();
    2493                 if("true" == $options['email_on_assignment']) {
     2499                if ("true" == $options['email_on_assignment']) {
    24942500                    $project_name = $wpdb->get_var("Select name from $bugerator_project_table where id = '$bugerator_project_id'");
    24952501                    $name = $thisuser->data->user_nicename;
     
    24992505                        $name .= $thisuser->data->user_email;
    25002506                    // send email
    2501                    
     2507
    25022508                    $mailsubject = $project_name . " issue assigned.";
    25032509                    $mailmessage = "You have been assigned an issue in $project_name.\r\n\r\ndetails:\r\n" .
    2504                 "Issue id: " . $issue_id . "\r\nIssue title: ".stripslashes($row['title'])."\r\nIssue description: " . stripslashes($row['description']) . "\r\n".
     2510                            "Issue id: " . $issue_id . "\r\nIssue title: " . stripslashes($row['title']) . "\r\nIssue description: " . stripslashes($row['description']) . "\r\n" .
    25052511                            "Issue link: " . BugeratorMenu::my_get_page_link() .
    2506                             "&bugerator_nav=display&bug_project=$bugerator_project_id&issue=$issue_id" . 
     2512                            "&bugerator_nav=display&bug_project=$bugerator_project_id&issue=$issue_id" .
    25072513                            "\r\n\r\nThank you for being a part of our project.";
    2508                    
     2514
    25092515                    wp_mail($name, $mailsubject, $mailmessage);
    25102516                }
     
    32903296        $all_users = array();
    32913297
    3292         // quickie helper function to start building the users
    3293         function return_users($table, $field) {
    3294             global $wpdb;
    3295             $sql = "SELECT $field FROM $table group by $field";
    3296             $results = $wpdb->get_results($sql, ARRAY_N);
    3297             $users = array();
    3298             foreach ($results as $result) {
    3299                 $users[] = $result['0'];
    3300             }
    3301             return $users;
    3302         }
    33033298
    33043299        // start with issues table
    3305         $user_array = return_users($bugerator_issue_table, "submitter");
     3300        $user_array = $this->return_users($bugerator_issue_table, "submitter");
    33063301        if (is_array($user_array))
    33073302            $all_users = array_merge($all_users, $user_array);
    3308         $user_array = return_users($bugerator_issue_table, "assigned");
     3303        $user_array = $this->return_users($bugerator_issue_table, "assigned");
    33093304        if (is_array($user_array))
    33103305            $all_users = array_merge($all_users, $user_array);
    33113306        // subscribers table
    3312         $user_array = return_users($bugerator_subscriptions, "user");
     3307        $user_array = $this->return_users($bugerator_subscriptions, "user");
    33133308        if (is_array($user_array))
    33143309            $all_users = array_merge($all_users, $user_array);
    33153310
    33163311        // now the notes table
    3317         $user_array = return_users($bugerator_notes_table, "user");
     3312        $user_array = $this->return_users($bugerator_notes_table, "user");
    33183313        if (is_array($user_array))
    33193314            $all_users = array_merge($all_users, $user_array);
    33203315        // now the projects table
    3321         $user_array = return_users($bugerator_project_table, "owner");
     3316        $user_array = $this->return_users($bugerator_project_table, "owner");
    33223317        if (is_array($user_array))
    33233318            $all_users = array_merge($all_users, $user_array);
    3324         $user_array = return_users($bugerator_project_table, "admins");
     3319        $user_array = $this->return_users($bugerator_project_table, "admins");
    33253320        // admins are comma dilimeted
    33263321        foreach ($user_array as $subscribers) {
     
    33293324                $all_users = array_merge($all_users, $new_array);
    33303325        }
    3331         $user_array = return_users($bugerator_project_table, "developers");
     3326        $user_array = $this->return_users($bugerator_project_table, "developers");
    33323327        // developers are comma dilimeted
    33333328        foreach ($user_array as $subscribers) {
     
    33963391
    33973392        return array($main_msg, $error_msg, $message);
     3393    }
     3394
     3395    // quickie helper function to start building the users
     3396    function return_users($table, $field) {
     3397        global $wpdb;
     3398        $sql = "SELECT $field FROM $table group by $field";
     3399        $results = $wpdb->get_results($sql, ARRAY_N);
     3400        $users = array();
     3401        foreach ($results as $result) {
     3402            $users[] = $result['0'];
     3403        }
     3404        return $users;
    33983405    }
    33993406
     
    38693876            }
    38703877
    3871             // now iterate through the issues and set up the issue sibscruber emails
     3878            // now iterate through the issues and set up the issue subscriber emails
    38723879            foreach ($single_emails as $issues) {
    38733880                $issue_id = $issues['issue_id'];
     
    38753882                $issue_subscriber = $wpdb->get_results($sql);
    38763883                foreach ($issue_subscriber as $subscriber) {
    3877                     if (true == is_array($project_person) and false === array_search($subscriber->user, $project_person)) {
     3884                    if (true == isset($project_person) and true == is_array($project_person) and false === array_search($subscriber->user, $project_person)) {
    38783885                        $array['user'] = $subscriber->user;
    38793886                        $array['visited'] = $subscriber->visited;
     
    47234730            }
    47244731            update_option("bugerator_project_display", $bugerator_project_display);
    4725         }
    4726         else
     4732        } else
    47274733            $error_msg = "Database failed to add project.";
    47284734        return array($success_msg, $error_msg);
     
    48944900                if ($deleteme <= $_POST['current_version']) {
    48954901                    if ($_POST['current_version'] > 0)
    4896                         $_POST['current_version']--;
     4902                        $_POST['current_version'] --;
    48974903                }
    48984904                // rebuild the array with the element extracted
     
    51945200                    ",filesize|" . $options['filesize'] . ",navtabsize|" . $options['navtabsize'] .
    51955201                    ",anonymous_comments|" . $options['anonymous_comments'] .
    5196                     ",default_priority|" . $options['default_priority'] . ",default_status|" . $options['default_status'];
     5202                    ",default_priority|" . $options['default_priority'] . ",default_status|" . $options['default_status'] .
     5203                    ",email_on_assignment|" . $options['email_on_assignment'];
    51975204            update_option('bugerator_options', $option_string);
    51985205            $content = "<h2>Options updated.</h2>\r\n";
     
    58665873        // list of users who want to get an email about every single update they've subscribed to
    58675874        add_option('bugerator_subscribers_all_email', '', '', 'no');
    5868 
    58695875    }
    58705876
     
    59165922
    59175923            // upgrade to 1.1.6
    5918             if(false == strpos($options, "email_on_assignment")) {
     5924            if (false == strpos($options, "email_on_assignment")) {
    59195925                $options .= ",email_on_assignment|true";
    5920                 update_option('bugerator_options', $options);               
     5926                update_option('bugerator_options', $options);
    59215927            }
    59225928
  • bugerator/trunk/readme.txt

    r847902 r964112  
    44Tags: issue tracking, bug tracking, project tracking, submit bugs, issues, bug tracker
    55Requires at least: 3.4.1
    6 Tested up to: 3.8.1
    7 Stable tag: 1.1.6
     6Tested up to: 3.9.2
     7Stable tag: 1.1.7
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Changelog ==
    6969
     70= 1.1.7 =
     71
     72* Couple minor bug fixes
     73
    7074= 1.1.6 =
    7175
     
    168172== Upgrade Notice ==
    169173
     174= 1.1.7 =
     175
     176Backup bugerator.css file before updating if you customized it.  Couple bug fixes.
     177
    170178= 1.1.6 =
    171179
Note: See TracChangeset for help on using the changeset viewer.