Changeset 964112
- Timestamp:
- 08/11/2014 08:51:28 PM (12 years ago)
- Location:
- bugerator/trunk
- Files:
-
- 2 edited
-
bugerator.php (modified) (20 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bugerator/trunk/bugerator.php
r847902 r964112 5 5 Plugin URI: http://www.tickerator.org/bugerator 6 6 Description: A bug tracking / issue tracking plugin 7 Version: 1.1. 67 Version: 1.1.7 8 8 Author: David Whipple 9 9 Author URI: http://www.tickerator.org … … 33 33 // version info 34 34 global $bugerator_version; 35 $bugerator_version = "1.1. 6";35 $bugerator_version = "1.1.7"; 36 36 37 37 … … 174 174 175 175 176 date_default_timezone_set( 'America/Denver');176 date_default_timezone_set(get_option('timezone_string')); 177 177 global $bugerator_project_id; 178 178 // if there is a shortcode in the project then take away the option to change it. … … 588 588 else 589 589 $next_date = ""; 590 } 591 else 590 } else 592 591 $next_date = ""; 593 592 // get admin list … … 1423 1422 } else { 1424 1423 // reduce the current version if we eliminated older versions 1425 if ($project_info->current_version > $x)1424 if ($project_info->current_version > $x) 1426 1425 $project_info->current_version --; 1427 1426 } … … 1953 1952 $version = intval($_POST['project_version']); 1954 1953 else { 1955 if (isset($options['default_version']))1954 if (isset($options['default_version'])) 1956 1955 $version = $options['default_version']; 1957 1956 else … … 1995 1994 $error = $file[1]; 1996 1995 $data['filename'] = 0; 1997 } 1998 else 1996 } else 1999 1997 $data['filename'] = $file; 2000 1998 } else { … … 2003 2001 } 2004 2002 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 } 2010 2016 // subscribe the user to the project 2011 2017 if (true == is_user_logged_in()) … … 2491 2497 $log_output .= "Assigned to $thisuser->display_name from $olduser->display_name.\r\n"; 2492 2498 $options = BugeratorMenu::get_options(); 2493 if ("true" == $options['email_on_assignment']) {2499 if ("true" == $options['email_on_assignment']) { 2494 2500 $project_name = $wpdb->get_var("Select name from $bugerator_project_table where id = '$bugerator_project_id'"); 2495 2501 $name = $thisuser->data->user_nicename; … … 2499 2505 $name .= $thisuser->data->user_email; 2500 2506 // send email 2501 2507 2502 2508 $mailsubject = $project_name . " issue assigned."; 2503 2509 $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" . 2505 2511 "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" . 2507 2513 "\r\n\r\nThank you for being a part of our project."; 2508 2514 2509 2515 wp_mail($name, $mailsubject, $mailmessage); 2510 2516 } … … 3290 3296 $all_users = array(); 3291 3297 3292 // quickie helper function to start building the users3293 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 }3303 3298 3304 3299 // start with issues table 3305 $user_array = return_users($bugerator_issue_table, "submitter");3300 $user_array = $this->return_users($bugerator_issue_table, "submitter"); 3306 3301 if (is_array($user_array)) 3307 3302 $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"); 3309 3304 if (is_array($user_array)) 3310 3305 $all_users = array_merge($all_users, $user_array); 3311 3306 // subscribers table 3312 $user_array = return_users($bugerator_subscriptions, "user");3307 $user_array = $this->return_users($bugerator_subscriptions, "user"); 3313 3308 if (is_array($user_array)) 3314 3309 $all_users = array_merge($all_users, $user_array); 3315 3310 3316 3311 // now the notes table 3317 $user_array = return_users($bugerator_notes_table, "user");3312 $user_array = $this->return_users($bugerator_notes_table, "user"); 3318 3313 if (is_array($user_array)) 3319 3314 $all_users = array_merge($all_users, $user_array); 3320 3315 // now the projects table 3321 $user_array = return_users($bugerator_project_table, "owner");3316 $user_array = $this->return_users($bugerator_project_table, "owner"); 3322 3317 if (is_array($user_array)) 3323 3318 $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"); 3325 3320 // admins are comma dilimeted 3326 3321 foreach ($user_array as $subscribers) { … … 3329 3324 $all_users = array_merge($all_users, $new_array); 3330 3325 } 3331 $user_array = return_users($bugerator_project_table, "developers");3326 $user_array = $this->return_users($bugerator_project_table, "developers"); 3332 3327 // developers are comma dilimeted 3333 3328 foreach ($user_array as $subscribers) { … … 3396 3391 3397 3392 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; 3398 3405 } 3399 3406 … … 3869 3876 } 3870 3877 3871 // now iterate through the issues and set up the issue s ibscruber emails3878 // now iterate through the issues and set up the issue subscriber emails 3872 3879 foreach ($single_emails as $issues) { 3873 3880 $issue_id = $issues['issue_id']; … … 3875 3882 $issue_subscriber = $wpdb->get_results($sql); 3876 3883 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)) { 3878 3885 $array['user'] = $subscriber->user; 3879 3886 $array['visited'] = $subscriber->visited; … … 4723 4730 } 4724 4731 update_option("bugerator_project_display", $bugerator_project_display); 4725 } 4726 else 4732 } else 4727 4733 $error_msg = "Database failed to add project."; 4728 4734 return array($success_msg, $error_msg); … … 4894 4900 if ($deleteme <= $_POST['current_version']) { 4895 4901 if ($_POST['current_version'] > 0) 4896 $_POST['current_version'] --;4902 $_POST['current_version'] --; 4897 4903 } 4898 4904 // rebuild the array with the element extracted … … 5194 5200 ",filesize|" . $options['filesize'] . ",navtabsize|" . $options['navtabsize'] . 5195 5201 ",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']; 5197 5204 update_option('bugerator_options', $option_string); 5198 5205 $content = "<h2>Options updated.</h2>\r\n"; … … 5866 5873 // list of users who want to get an email about every single update they've subscribed to 5867 5874 add_option('bugerator_subscribers_all_email', '', '', 'no'); 5868 5869 5875 } 5870 5876 … … 5916 5922 5917 5923 // upgrade to 1.1.6 5918 if (false == strpos($options, "email_on_assignment")) {5924 if (false == strpos($options, "email_on_assignment")) { 5919 5925 $options .= ",email_on_assignment|true"; 5920 update_option('bugerator_options', $options); 5926 update_option('bugerator_options', $options); 5921 5927 } 5922 5928 -
bugerator/trunk/readme.txt
r847902 r964112 4 4 Tags: issue tracking, bug tracking, project tracking, submit bugs, issues, bug tracker 5 5 Requires at least: 3.4.1 6 Tested up to: 3. 8.17 Stable tag: 1.1. 66 Tested up to: 3.9.2 7 Stable tag: 1.1.7 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 68 68 == Changelog == 69 69 70 = 1.1.7 = 71 72 * Couple minor bug fixes 73 70 74 = 1.1.6 = 71 75 … … 168 172 == Upgrade Notice == 169 173 174 = 1.1.7 = 175 176 Backup bugerator.css file before updating if you customized it. Couple bug fixes. 177 170 178 = 1.1.6 = 171 179
Note: See TracChangeset
for help on using the changeset viewer.