cvs diff: Diffing . Index: issue.inc =================================================================== RCS file: /Users/wright/drupal/local_repo/contributions/modules/project_issue/issue.inc,v retrieving revision 1.352 diff -u -p -r1.352 issue.inc --- issue.inc 14 Jun 2009 22:06:00 -0000 1.352 +++ issue.inc 14 Jun 2009 22:36:34 -0000 @@ -2,98 +2,6 @@ // $Id: issue.inc,v 1.352 2009/06/14 22:06:00 wright Exp $ -/** - * JS callback method to return updated elements on the issue form. - * This function is called when someone changes the "Project" selector. - */ -function project_issue_update_project() { - $form_state = array('storage' => NULL, 'submitted' => FALSE, 'rebuild' => TRUE); - $form_build_id = $_POST['form_build_id']; - $form = form_get_cache($form_build_id, $form_state); - $args = $form['#parameters']; - $form_id = array_shift($args); - $form_state['post'] = $form['#post'] = $_POST; - $form['#programmed'] = $form['#redirect'] = FALSE; - - drupal_process_form($form_id, $form, $form_state); - - // Rebuild the form and cache it again. - $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id); - - // These used to be path arguments. Now they arrive via form element. - $issue_nid = $form['nid']['#value']; - $pid = $form_state['values']['project_info']['pid']; - $rid = isset($form_state['values']['project_info']['rid']) ? $form_state['values']['project_info']['rid'] : 0; - $cid = $form_state['values']['cid']; - $assigned_uid = $form_state['values']['project_info']['assigned']; - - $project_info = $form['original_issue']['project_info']; - - // Only generate release stuff if the project_release module is enabled. - if (module_exists('project_release')) { - - $project->nid = $pid; - if ($releases = project_release_get_releases($project, 0)) { - $old_version = db_result(db_query("SELECT version FROM {project_release_nodes} WHERE nid = %d", $rid)); - $releases = array(t('')) + $releases; - // Since the value of releases is by nid, try to match release - // based on the label instead. - $default = 0; - foreach ($releases as $key => $label) { - if ($old_version == $label) { - $default = $key; - } - } - // Element is tree'd here to match the original form layout. - $project_info['#tree'] = TRUE; - $project_info['rid']['#options'] = $releases; - $project_info['rid']['#disabled'] = FALSE; - if (!empty($default)) { - $project_info['rid']['#value'] = $default; - $project_info['rid']['#default_value'] = $default; - } - } - else { - $project_info['rid']['#disabled'] = TRUE; - $project_info['rid']['#options'] = array(); - } - } - - // Assigned. - if (is_numeric($issue_nid)) { - $issue = node_load(array('nid' => $issue_nid, 'type' => 'project_issue')); - } - else { - // @TODO: This case should not ever be hit until - // http://drupal.org/node/197281 lands. - $issue = new stdClass; - } - $issue->project_issue['pid'] = $pid; - $assigned_choices = project_issue_assigned_choices($issue); - - $project_info['assigned']['#default_value'] = $assigned_uid; - $project_info['assigned']['#options'] = $assigned_choices; - - // Components. - $project = db_fetch_object(db_query('SELECT * FROM {project_issue_projects} WHERE nid = %d', $pid)); - $components = array(); - if ($project->components) { - $components = array(t('')); - foreach (unserialize($project->components) as $component) { - $component = check_plain($component); - $components[$component] = $component; - } - } - - $project_info['component']['#default_value'] = $cid; - $project_info['component']['#options'] = $components; - - // Build the HTML output for the component select. - $output = theme('status_messages') . drupal_render($project_info); - drupal_json(array('status' => TRUE, 'data' => $output)); - exit; -} - function project_issue_pick_project_page() { drupal_set_title(t('Submit @name', array('@name' => node_get_types('name', 'project_issue')))); return drupal_get_form('project_issue_pick_project_form'); Index: project_issue.module =================================================================== RCS file: /Users/wright/drupal/local_repo/contributions/modules/project_issue/project_issue.module,v retrieving revision 1.169 diff -u -p -r1.169 project_issue.module --- project_issue.module 14 Jun 2009 22:02:03 -0000 1.169 +++ project_issue.module 14 Jun 2009 22:37:08 -0000 @@ -35,6 +35,7 @@ function project_issue_menu() { 'access callback' => 'project_issue_menu_access', 'access arguments' => array('any'), 'type' => MENU_CALLBACK, + 'file' => 'includes/comment.inc', ); $items['project/issues/statistics'] = array( 'title' => 'Statistics', cvs diff: Diffing generate cvs diff: Diffing includes Index: includes/comment.inc =================================================================== RCS file: includes/comment.inc diff -N includes/comment.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/comment.inc 14 Jun 2009 22:18:10 -0000 @@ -0,0 +1,95 @@ + NULL, 'submitted' => FALSE, 'rebuild' => TRUE); + $form_build_id = $_POST['form_build_id']; + $form = form_get_cache($form_build_id, $form_state); + $args = $form['#parameters']; + $form_id = array_shift($args); + $form_state['post'] = $form['#post'] = $_POST; + $form['#programmed'] = $form['#redirect'] = FALSE; + + drupal_process_form($form_id, $form, $form_state); + + // Rebuild the form and cache it again. + $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id); + + // These used to be path arguments. Now they arrive via form element. + $issue_nid = $form['nid']['#value']; + $pid = $form_state['values']['project_info']['pid']; + $rid = isset($form_state['values']['project_info']['rid']) ? $form_state['values']['project_info']['rid'] : 0; + $cid = $form_state['values']['cid']; + $assigned_uid = $form_state['values']['project_info']['assigned']; + + $project_info = $form['original_issue']['project_info']; + + // Only generate release stuff if the project_release module is enabled. + if (module_exists('project_release')) { + + $project->nid = $pid; + if ($releases = project_release_get_releases($project, 0)) { + $old_version = db_result(db_query("SELECT version FROM {project_release_nodes} WHERE nid = %d", $rid)); + $releases = array(t('')) + $releases; + // Since the value of releases is by nid, try to match release + // based on the label instead. + $default = 0; + foreach ($releases as $key => $label) { + if ($old_version == $label) { + $default = $key; + } + } + // Element is tree'd here to match the original form layout. + $project_info['#tree'] = TRUE; + $project_info['rid']['#options'] = $releases; + $project_info['rid']['#disabled'] = FALSE; + if (!empty($default)) { + $project_info['rid']['#value'] = $default; + $project_info['rid']['#default_value'] = $default; + } + } + else { + $project_info['rid']['#disabled'] = TRUE; + $project_info['rid']['#options'] = array(); + } + } + + // Assigned. + if (is_numeric($issue_nid)) { + $issue = node_load(array('nid' => $issue_nid, 'type' => 'project_issue')); + } + else { + // @TODO: This case should not ever be hit until + // http://drupal.org/node/197281 lands. + $issue = new stdClass; + } + $issue->project_issue['pid'] = $pid; + $assigned_choices = project_issue_assigned_choices($issue); + + $project_info['assigned']['#default_value'] = $assigned_uid; + $project_info['assigned']['#options'] = $assigned_choices; + + // Components. + $project = db_fetch_object(db_query('SELECT * FROM {project_issue_projects} WHERE nid = %d', $pid)); + $components = array(); + if ($project->components) { + $components = array(t('')); + foreach (unserialize($project->components) as $component) { + $component = check_plain($component); + $components[$component] = $component; + } + } + + $project_info['component']['#default_value'] = $cid; + $project_info['component']['#options'] = $components; + + // Build the HTML output for the component select. + $output = theme('status_messages') . drupal_render($project_info); + drupal_json(array('status' => TRUE, 'data' => $output)); + exit; +} + cvs diff: Diffing scripts cvs diff: Diffing search_index cvs diff: Diffing theme cvs diff: Diffing translations cvs diff: Diffing views cvs diff: Diffing views/handlers cvs diff: Diffing views/plugins