Index: project.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/project.inc,v retrieving revision 1.106 diff -u -u -p -r1.106 project.inc --- project.inc 19 Jun 2007 23:21:52 -0000 1.106 +++ project.inc 8 Jul 2007 14:59:20 -0000 @@ -1,6 +1,6 @@ uri, null, 'categories=support&states=all', null); - $links[] = l(t('View pending support requests'), 'project/issues/'. $node->uri, null, 'categories=support', null); - $links[] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, null, 'categories=bug', null); - $links[] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, null, 'categories=feature', null); + $links[] = l(t('View all support requests'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'categories=support&states=all', 'fragment' => null)); + $links[] = l(t('View pending support requests'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'categories=support', 'fragment' => null)); + $links[] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'categories=bug', 'fragment' => null)); + $links[] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'categories=feature', 'fragment' => null)); } if ($make_issues) { $links[] = l(t('Request support'), 'node/add/project_issue/'. $node->uri .'/support'); @@ -344,8 +344,8 @@ function project_project_view($node, $te // Developer section $links = array(); if ($view_issues) { - $links[] = l(t('View pending patches'), 'project/issues/'. $node->uri, null, 'states=8,13,14', null); - $links[] = l(t('View available tasks'), 'project/issues/'. $node->uri, null, 'categories=task', null); + $links[] = l(t('View pending patches'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'states=8', 'fragment' => 13, 'absolute' => TRUE, 'html' => TRUE)); + $links[] = l(t('View available tasks'), 'project/issues/'. $node->uri, array('attributes' => null, 'query' => 'categories=task', 'fragment' => null)); $links[] = l(t('View all pending issues'), 'project/issues/'. $node->uri); } Index: project.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/project.info,v retrieving revision 1.2 diff -u -u -p -r1.2 project.info --- project.info 13 Jun 2007 19:33:16 -0000 1.2 +++ project.info 8 Jul 2007 14:59:20 -0000 @@ -2,3 +2,4 @@ name = Project description = Provides a project node type and browsing of projects. package = Project +core = 6.x Index: project.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/project.install,v retrieving revision 1.12 diff -u -u -p -r1.12 project.install --- project.install 28 Jan 2007 18:48:53 -0000 1.12 +++ project.install 8 Jul 2007 14:59:20 -0000 @@ -1,6 +1,6 @@ nid; } if (!empty($nids)) { - $res = update_sql("DELETE FROM $table WHERE nid IN (" . implode(',', $nids) . ')'); + $res = update_sql("DELETE FROM $table WHERE nid IN (". implode(',', $nids) .')'); $ret[] = $res; - } + } } if ($res['success']) { $num = db_affected_rows(); @@ -192,7 +192,7 @@ function project_update_4() { $val = variable_get("project_$varname", NULL); if (isset($val)) { variable_set("project_issue_$varname", $val); - $ret[] = update_sql("DELETE FROM {variable} WHERE name = 'project_" . $varname . "'"); + $ret[] = update_sql("DELETE FROM {variable} WHERE name = 'project_". $varname ."'"); } } Index: project.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/project.module,v retrieving revision 1.274 diff -u -u -p -r1.274 project.module --- project.module 20 Jun 2007 21:54:46 -0000 1.274 +++ project.module 8 Jul 2007 14:59:20 -0000 @@ -1,14 +1,14 @@
  • Select one of the first-level terms (%types) as the project type.
  • Then choose one or more categories below this term to classify your project. For example, for %type, you would choose from the various %type types: %categories, and so on.
  • - ', array('%types' => implode (', ', $types), '%type' => $types[0], '%categories' => implode (', ', $categories))); + ', array('%types' => implode(', ', $types), '%type' => $types[0], '%categories' => implode(', ', $categories))); } } $help .= variable_get('project_help_node_add', ''); @@ -38,7 +38,7 @@ function project_help($section) { return t('

    The project module makes special use of the taxonomy (category) system. A special vocabulary, %vocabulary_name, has been created automatically.

    To take full advantage of project categorization, add at least two levels of terms to this vocabulary. The first level will be the basic project types, e.g., "modules", "themes", "translations".

    Subterms of each of these types will be the categories that users can select to classify the projects. For example, "modules" might have sub-terms including "mail" and "XML".

    -

    Use the vocabulary admin page to view and add terms.

    ', array('!taxonomy-admin' => url('admin/content/taxonomy/' . $vid), '%vocabulary_name' => $vocabulary->name)); +

    Use the vocabulary admin page to view and add terms.

    ', array('!taxonomy-admin' => url('admin/content/taxonomy/'. $vid), '%vocabulary_name' => $vocabulary->name)); } break; } @@ -100,14 +100,14 @@ function project_settings_form() { $form['sort_methods'] = array( '#type' => 'fieldset', '#title' => t('Enabled sorting options'), - '#description' => t('Each type of project on your site will have its own project browsing page at %link. Each browsing page can be configured for different browsing options (by name, by date, etc). The settings below determine which browsing methods are available for each project type.', array('%link' => url('project', NULL, NULL, TRUE) . '/[type]')), + '#description' => t('Each type of project on your site will have its own project browsing page at %link. Each browsing page can be configured for different browsing options (by name, by date, etc). The settings below determine which browsing methods are available for each project type.', array('%link' => url('project', array('absolute' => TRUE)) .'/[type]')), ); $tree = taxonomy_get_tree(_project_get_vid(), 0 , -1, 1); foreach ($tree as $term) { - $form['sort_methods']['project_sort_method_used_' . $term->tid] = array( + $form['sort_methods']['project_sort_method_used_'. $term->tid] = array( '#type' => 'checkboxes', '#title' => $term->name, - '#default_value' => variable_get('project_sort_method_used_' . $term->tid, array_keys($sort_methods)), + '#default_value' => variable_get('project_sort_method_used_'. $term->tid, array_keys($sort_methods)), '#options' => $sort_methods, ); } @@ -120,13 +120,13 @@ function project_settings_form() { ); // Custom submit handler - $form['#submit']['project_settings_form_extra_submit'] = array(); + $form['#submit'][] = 'project_settings_form_extra_submit'; // system_settings_form() doesn't add the default if #submit already exists. - $form['#submit']['system_settings_form_submit'] = array(); +//$form['#submit'][] = 'system_settings_form_submit'; return system_settings_form($form); } -function project_settings_form_extra_submit($form_id, $form_values) { +function project_settings_form_extra_submit($form, &$form_state) { // If the project_sort_method setting has changed, the menu will // need to be rebuilt. menu_rebuild(); @@ -187,8 +187,8 @@ function project_term_path($term) { // The path must include the first-level term name for this term. $tree = taxonomy_get_tree(_project_get_vid()); $parents = taxonomy_get_parents_all($term->tid); - foreach($parents as $parent) { - $ancestors[] = $parent->tid; + foreach ($parents as $parent) { + $ancestors[] = $parent->tid; } foreach ($tree as $t) { if (in_array($t->tid, $ancestors) && $t->depth == 0) { @@ -218,91 +218,99 @@ function project_menu($may_cache) { $items = array(); global $user; - if ($may_cache) { - // User pages: - $access = user_access('access projects'); - - $items[] = array('path' => 'project', - 'title' => t('Projects'), - 'callback' => 'project_page_overview', - 'access' => $access, - 'type' => MENU_NORMAL_ITEM); - - $items[] = array('path' => 'project/autocomplete', - 'title' => t('Autocomplete project'), - 'callback' => 'project_autocomplete', - 'access' => $access, - 'type' => MENU_CALLBACK); - - // Project browsing pages - if (project_use_taxonomy()) { - $sort_methods = module_invoke_all('project_sort_methods', 'methods'); - $terms = taxonomy_get_tree(_project_get_vid()); - $releases = variable_get('project_release_browse_versions', 0); - foreach ($terms as $i => $term) { - // Only use the first-level terms. - if ($term->depth == 0) { - $items[] = array('path' => 'project/'. $term->name, - 'title' => $term->name, - 'access' => $access, - 'type' => MENU_NORMAL_ITEM, - 'weight' => $term->weight, - 'callback arguments' => array($term->name)); - $j = 0; - $term_methods = array_filter(variable_get('project_sort_method_used_' . $term->tid, $sort_methods)); - foreach ($term_methods as $sort_method) { - $items[] = array('path' => 'project/' . $term->name . '/'. $sort_method, - 'title' => t('Browse by !sort_method', array('!sort_method' => $sort_method)), - 'access' => $access, - 'type' => (($sort_method == variable_get('project_sort_method', 'category') || (($j == 0) && !in_array(variable_get('project_sort_method', 'category'), $term_methods))) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK), - 'weight' => ($sort_method == variable_get('project_sort_method', 'category')) ? -10 : $j, - 'callback arguments' => array($term->name, $sort_method)); - $j++; - } + // User pages: + + $items['project'] = array( + 'title' => 'Projects', + 'page callback' => 'project_page_overview', + 'access arguments' => array('access projects'), + 'type' => MENU_NORMAL_ITEM); + + $items['project/autocomplete'] = array( + 'title' => 'Autocomplete project', + 'page callback' => 'project_autocomplete', + 'access arguments' => array('access projects'), + 'type' => MENU_CALLBACK); + + // Project browsing pages + if (project_use_taxonomy()) { + $sort_methods = module_invoke_all('project_sort_methods', 'methods'); + $terms = taxonomy_get_tree(_project_get_vid()); + $releases = variable_get('project_release_browse_versions', 0); + foreach ($terms as $i => $term) { + // Only use the first-level terms. + if ($term->depth == 0) { + $items['project/'. $term->name] = array( + 'title' => $term->name, + 'access arguments' => array('access projects'), + 'type' => MENU_NORMAL_ITEM, + 'weight' => $term->weight, + 'page arguments' => array($term->name)); + $j = 0; + $term_methods = array_filter(variable_get('project_sort_method_used_'. $term->tid, $sort_methods)); + foreach ($term_methods as $sort_method) { + $items['project/'. $term->name .'/'. $sort_method] = array( + 'title' => t('Browse by !sort_method', array('!sort_method' => $sort_method)), + 'access arguments' => array('access projects'), + 'type' => (($sort_method == variable_get('project_sort_method', 'category') || (($j == 0) && !in_array(variable_get('project_sort_method', 'category'), $term_methods))) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK), + 'weight' => ($sort_method == variable_get('project_sort_method', 'category')) ? -10 : $j, + 'page arguments' => array($term->name, $sort_method)); + $j++; } } } + } - // Developers - $items[] = array('path' => 'project/developers', 'title' => t('Developers'), 'callback' => 'project_developers', 'access' => $access, 'type' => MENU_CALLBACK); + // Developers + $items['project/developers'] = array( + 'title' => 'Developers', + 'page callback' => 'project_developers', + 'access arguments' => array('access projects'), + 'type' => MENU_CALLBACK + ); - // CVS messages: - $items[] = array('path' => 'project/cvs', 'title' => t('CVS'), 'callback' => 'project_cvs', 'access' => $access, 'type' => MENU_CALLBACK); + // CVS messages: + $items['project/cvs'] =array( + 'title' => 'CVS', + 'page callback' => 'project_cvs', + 'access arguments' => array('access projects'), + 'type' => MENU_CALLBACK + ); - // Administration pages - $items[] = array( - 'path' => 'admin/project', - 'title' => t('Project administration'), - 'description' => t('Administrative interface for project management and related modules.'), - 'callback' => 'system_admin_menu_block_page', - 'access' => user_access('administer projects'), - 'type' => MENU_NORMAL_ITEM, - ); - $items[] = array( - 'path' => 'admin/project/project-settings', - 'title' => t('Project settings'), - 'description' => t('Configure the behavior and appearance of the project browsing pages and other settings for the Project module.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('project_settings_form'), - 'access' => user_access('administer projects'), - 'type' => MENU_NORMAL_ITEM, - ); - } - else { - drupal_add_css(drupal_get_path('module', 'project') .'/project.css'); - if (arg(0) == 'node' && is_numeric(arg(1))) { - $node = node_load(arg(1)); - if ($node->type == 'project_project' && node_access('update', $node) && - (module_exists('project_issue') || module_exists('project_release'))) { - $items[] = array( - 'path' => 'node/'. arg(1) .'/edit/project', - 'title' => t('Project'), - 'callback' => 'node_page', - 'weight' => -5, 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - } + // Administration pages + $items['admin/project'] = array( + 'title' => 'Project administration', + 'description' => 'Administrative interface for project management and related modules.', + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('administer projects'), + 'type' => MENU_NORMAL_ITEM, + ); + $items['admin/project/project-settings'] = array( + 'title' => 'Project settings', + 'description' => 'Configure the behavior and appearance of the project browsing pages and other settings for the Project module.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('project_settings_form'), + 'access arguments' => array('administer projects'), + 'type' => MENU_NORMAL_ITEM, + ); + + drupal_add_css(drupal_get_path('module', 'project') .'/project.css'); +/* + if (arg(0) == 'node' && is_numeric(arg(1))) { + $node = node_load(arg(1)); + if ($node->type == 'project_project' && node_access('update', $node) && + (module_exists('project_issue') || module_exists('project_release'))) { + $items['node/%/edit/project'] = array( + 'title' => 'Project', + 'page callback' => 'node_page', + 'map arguments' => array('node_load', 1, array()), + 'weight' => -5, + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); } } +*/ + return $items; } @@ -336,29 +344,29 @@ function project_check_admin_access($pro * taxonomy.module's form_alter() so we can do our own taxonomy * selection. */ -function project_form_alter($form_id, &$form) { +function project_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'project_project_node_form') { $vid = _project_get_vid(); - if (isset($form['taxonomy'][$vid])) { - unset($form['taxonomy'][$vid]); + if (isset($form_state['values']['taxonomy'][$vid])) { + unset($form_state['values']['taxonomy'][$vid]); } // If there are no children elements, we should unset the entire // thing so we don't end up with an empty fieldset. - if (!element_children($form['taxonomy'])) { - unset($form['taxonomy']); + if (!element_children($form_state['values']['taxonomy'])) { + unset($form_state['values']['taxonomy']); } // If the form has an element for specifying a URL alias, we want // to alter it, since we're just going to automatically override // the specified value. - if (isset($form['path'])) { - $url_alias = $form['path']['path']['#default_value']; + if (isset($form_state['values']['path'])) { + $url_alias = $form_state['values']['path']['path']['#default_value']; if (empty($url_alias)) { - unset($form['path']); + unset($form_state['values']['path']); } else { - unset($form['path']['path']); - $form['path']['value'] = array('#value' => t('Automatically generated path alias: %url', array('%url' => $url_alias))); + unset($form_state['values']['path']['path']); + $form_state['values']['path']['value'] = array('#value' => t('Automatically generated path alias: %url', array('%url' => $url_alias))); } } } @@ -409,12 +417,12 @@ function project_page_overview($termname $type = db_fetch_object(db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND t.name = '%s'", 't', 'tid'), $vid, $termname)); if (!$sort_method) { // For the default, we use the overall default if enabled for this term, and if not we use the first enabled method. - $term_methods = array_filter(variable_get('project_sort_method_used_' . $type->tid, array_keys($sort_methods))); + $term_methods = array_filter(variable_get('project_sort_method_used_'. $type->tid, array_keys($sort_methods))); $sort_method = in_array(variable_get('project_sort_method', 'category'), $term_methods) ? variable_get('project_sort_method', 'category') : array_shift($term_methods); } if ($type->description) { - $output .= '

    ' . filter_xss($type->description) . '

    '; + $output .= '

    '. filter_xss($type->description) .'

    '; } $module = $sort_methods[$sort_method]; @@ -581,7 +589,7 @@ function project_page_overview($termname // Merge in $sql_elements if (is_array($sql_settings)) { - foreach(array_keys($sql_settings) as $key) { + foreach (array_keys($sql_settings) as $key) { $sql_elements[$key]['pieces'] = array_merge($sql_elements[$key]['pieces'], $sql_settings[$key]); $sql_elements[$key]['pieces'] = array_unique($sql_elements[$key]['pieces']); } @@ -595,7 +603,7 @@ function project_page_overview($termname if ($pager) { $first_field = array_shift($sql_elements['fields']['pieces']); if (count($sql_elements['group_bys']['pieces'])) { - $first_field = 'DISTINCT(' . $sql_elements['group_bys']['pieces'][0] . ')'; + $first_field = 'DISTINCT('. $sql_elements['group_bys']['pieces'][0] .')'; $sql_elements['group_bys']['pieces'] = array(); } $sql_elements['fields']['pieces'] = array("COUNT($first_field)"); @@ -704,7 +712,7 @@ function project_page_overview($termname $class = $project->class; } - $output .= '
    ' . $projects . '
    '; + $output .= '
    '. $projects .'
    '; if ($pager) { $output .= theme('pager', NULL, variable_get('project_browse_nodes', 30)); @@ -884,9 +892,9 @@ function project_quick_navigate_form() { return $form; } -function project_quick_navigate_form_submit($form_id, $form_values) { - if (!empty($form_values['project_goto']) && (string)$form_values['project_goto'] != '0') { - drupal_goto($form_values['project_goto']); +function project_quick_navigate_form_submit($form, &$form_state) { + if (!empty($form_state['values']['project_goto']) && (string)$form_state['values']['project_goto'] != '0') { + drupal_goto($form_state['values']['project_goto']); } } @@ -897,7 +905,7 @@ function theme_project_term_list($terms, $output = "\n\n"; return $output; @@ -915,10 +923,10 @@ function theme_project_term_list($terms, * - links: Array of links */ function theme_project_summary($project) { - $output = '
    '; + $output = '
    '; $output .= '

    '. l($project->title, "node/$project->nid") .'

    '; if ($project->changed) { - $output .= '

    ' . t('Last changed: !interval ago', array('!interval' => format_interval(time() - $project->changed, 2))) . '

    '; + $output .= '

    '. t('Last changed: !interval ago', array('!interval' => format_interval(time() - $project->changed, 2))) .'

    '; } $output .= $project->body; $output .= theme('links', $project->links); @@ -940,7 +948,7 @@ function theme_project_type($term) { $link = l($term->name, check_url('project/'. $term->name)); $output = "
    $link
    \n"; if ($term->description) { - $output .= '

    ' . filter_xss($term->description) . '

    '; + $output .= '

    '. filter_xss($term->description) .'

    '; } return $output; } @@ -982,3 +990,11 @@ function project_autocomplete($string) { function project_use_taxonomy() { return module_exists('taxonomy') && taxonomy_get_tree(_project_get_vid()); } + +function project_theme() { + return array( + 'project_term_list' => array('arguments' => array('terms', 'path')), + 'project_summary' => array('arguments' => array('project')), + 'project_type' => array('arguments' => array('term')), + ); +} Index: release/package-release-nodes.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/release/package-release-nodes.php,v retrieving revision 1.17 diff -u -u -p -r1.17 package-release-nodes.php --- release/package-release-nodes.php 30 Jun 2007 05:55:25 -0000 1.17 +++ release/package-release-nodes.php 8 Jul 2007 14:59:20 -0000 @@ -2,7 +2,7 @@ $project_id)), l(t('view'), 'node/' . $project_id)); + wd_msg(t("Starting to package snapshot releases for project id: @project_id.", array('@project_id' => $project_id)), l(t('view'), 'node/'. $project_id)); } } else { @@ -184,7 +184,7 @@ function package_releases($type, $projec $args[] = $project_id; } - $query = db_query("SELECT pp.uri, prn.nid, prn.tag, prn.version, c.directory, c.rid FROM {project_release_nodes} prn $rel_node_join INNER JOIN {project_projects} pp ON prn.pid = pp.nid INNER JOIN {node} np ON prn.pid = np.nid INNER JOIN {project_release_projects} prp ON prp.nid = prn.pid INNER JOIN {cvs_projects} c ON prn.pid = c.nid WHERE np.status = 1 AND prp.releases = 1" . $where . ' ORDER BY pp.uri', $args); + $query = db_query("SELECT pp.uri, prn.nid, prn.tag, prn.version, c.directory, c.rid FROM {project_release_nodes} prn $rel_node_join INNER JOIN {project_projects} pp ON prn.pid = pp.nid INNER JOIN {node} np ON prn.pid = np.nid INNER JOIN {project_release_projects} prp ON prp.nid = prn.pid INNER JOIN {cvs_projects} c ON prn.pid = c.nid WHERE np.status = 1 AND prp.releases = 1". $where .' ORDER BY pp.uri', $args); $num_built = 0; $num_considered = 0; @@ -228,11 +228,11 @@ function package_release_core($nid, $uri return false; } - $id = $uri . '-' . $version; - $view_link = l(t('view'), 'node/' . $nid); - $file_name = $id . '.tar.gz'; - $file_path = $dest_rel . '/' . $file_name; - $full_dest = $dest_root . '/' . $file_path; + $id = $uri .'-'. $version; + $view_link = l(t('view'), 'node/'. $nid); + $file_name = $id .'.tar.gz'; + $file_path = $dest_rel .'/'. $file_name; + $full_dest = $dest_root .'/'. $file_path; // Don't use drupal_exec or return if this fails, we expect it to be empty. exec("$rm -rf $tmp_dir/$id"); @@ -289,13 +289,13 @@ function package_release_contrib($nid, $ // specific directory (same as uri) $uri = $parts[2]; - $id = $uri . '-' . $version; - $view_link = l(t('view'), 'node/' . $nid); - $basedir = $repositories[$rid]['modules'] . '/' . $contrib_type; - $fulldir = $basedir . '/' . $uri; - $file_name = $id . '.tar.gz'; - $file_path = $dest_rel . '/' . $file_name; - $full_dest = $dest_root . '/' . $file_path; + $id = $uri .'-'. $version; + $view_link = l(t('view'), 'node/'. $nid); + $basedir = $repositories[$rid]['modules'] .'/'. $contrib_type; + $fulldir = $basedir .'/'. $uri; + $file_name = $id .'.tar.gz'; + $file_path = $dest_rel .'/'. $file_name; + $full_dest = $dest_root .'/'. $file_path; if (!drupal_chdir($tmp_dir)) { return false; @@ -435,9 +435,9 @@ function verify_packages($task, $project $valid_date = TRUE; $num_considered++; $nid = $release->nid; - $view_link = l(t('view'), 'node/' . $nid); + $view_link = l(t('view'), 'node/'. $nid); $file_path = $release->file_path; - $full_path = $dest_root . '/' . $file_path; + $full_path = $dest_root .'/'. $file_path; $db_date = (int)$release->file_date; $db_hash = $release->file_hash; @@ -514,7 +514,7 @@ function verify_packages($task, $project } else { $num_vars['@project_id'] = $project_id; - wd_check(t('Done checking releases for project id @project_id: !num_need_repair need repairing, !num_wrong_date invalid dates, !num_wrong_hash invalid md5 hashes, !num_considered considered.', $num_vars), l(t('view'), 'node/' . $project_id)); + wd_check(t('Done checking releases for project id @project_id: !num_need_repair need repairing, !num_wrong_date invalid dates, !num_wrong_hash invalid md5 hashes, !num_considered considered.', $num_vars), l(t('view'), 'node/'. $project_id)); } } } @@ -534,7 +534,7 @@ function drupal_exec($cmd) { // Made sure we grab stderr, too... exec("$cmd 2>&1", $output, $rval); if ($rval) { - wd_err(t("ERROR: %cmd failed with status !rval", array('%cmd' => $cmd, '!rval' => $rval)) . '
    ' . implode("\n", array_map('htmlspecialchars', $output)));
    +    wd_err(t("ERROR: %cmd failed with status !rval", array('%cmd' => $cmd, '!rval' => $rval)) .'
    '. implode("\n", array_map('htmlspecialchars', $output)));
         return false;
       }
       return true;
    @@ -555,7 +555,7 @@ function drupal_chdir($dir) {
     
     /// TODO: remove this before the final script goes live -- debugging only.
     function wprint($var) {
    -  watchdog('package_debug', '
    ' . var_export($var, TRUE));
    +  watchdog('package_debug', '
    '. var_export($var, TRUE));
     }
     
     /**
    @@ -564,7 +564,7 @@ function wprint($var) {
      */
     function wd_msg($msg, $link = NULL) {
       global $task;
    -  watchdog('package_' . $task, $msg, WATCHDOG_NOTICE, $link);
    +  watchdog('package_'. $task, $msg, WATCHDOG_NOTICE, $link);
     }
     
     /**
    @@ -597,7 +597,7 @@ function initialize_tmp_dir($task) {
         exit(1);
       }
     
    -  $tmp_dir = $tmp_root . '/' . $task;
    +  $tmp_dir = $tmp_root .'/'. $task;
       if (is_dir($tmp_dir)) {
         // Make sure we start with a clean slate
         drupal_exec("$rm -rf $tmp_dir/*");
    @@ -628,7 +628,7 @@ function initialize_repository_info() {
     function fix_info_file_version($file, $uri, $version) {
       global $site_name;
     
    -  $info = "\n; Information added by $site_name packaging script on " . date('Y-m-d') . "\n";
    +  $info = "\n; Information added by $site_name packaging script on ". date('Y-m-d') ."\n";
       $info .= "version = \"$version\"\n";
       // .info files started with 5.x, so we don't have to worry about version
       // strings like "4.7.x-1.0" in this regular expression. If we can't parse
    @@ -651,7 +651,7 @@ function fix_info_file_version($file, $u
         return false;
       }
       if (!fwrite($info_fd, $info)) { 
    -    wd_err(t("ERROR: fwrite(@file) failed", array('@file' => $file)) . '
    ' . $info);
    +    wd_err(t("ERROR: fwrite(@file) failed", array('@file' => $file)) .'
    '. $info);
         return false;
       }
       return true;
    @@ -663,7 +663,7 @@ function fix_info_file_version($file, $u
      */
     function package_release_update_node($nid, $file_path) {
       global $dest_root, $task;
    -  $full_path = $dest_root . '/' . $file_path;
    +  $full_path = $dest_root .'/'. $file_path;
     
       // PHP will cache the results of stat() and give us stale answers
       // here, unless we manually tell it otherwise!
    @@ -739,7 +739,7 @@ function translation_status($dir, $versi
           $translations[$dir][$version] = "100% (complete)";
         }
         else {
    -      $translations[$dir][$version] = "". $percentage ."% (". ($number_of_strings - $words[0]). " missing)";
    +      $translations[$dir][$version] = "". $percentage ."% (". ($number_of_strings - $words[0]) ." missing)";
         }
       }
       else {
    Index: release/project-release-history.php
    ===================================================================
    RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project-release-history.php,v
    retrieving revision 1.2
    diff -u -u -p -r1.2 project-release-history.php
    --- release/project-release-history.php	16 Jun 2007 18:38:32 -0000	1.2
    +++ release/project-release-history.php	8 Jul 2007 14:59:20 -0000
    @@ -2,7 +2,7 @@
     \n";
       $xml .= ''. check_plain($project->title) ."\n";
       $xml .= ''. check_plain($project->uri) ."\n";
    -  $xml .= ''. url("node/$project->nid", NULL, NULL, TRUE) ."\n";
    +  $xml .= ''. url("node/$project->nid", array('query' => array('absolute' => TRUE))) ."\n";
       $xml .= ''. check_plain($api_version) ."\n";
       $xml .= "$project->major\n";
       $xml .= "\n";
    @@ -179,7 +179,7 @@ function project_release_history_generat
         if ($release->status) {
           // Published,  so we should include the links.
           $xml .= "  published\n";
    -      $xml .= '  '. url("node/$release->nid", NULL, NULL, TRUE) ."\n";
    +      $xml .= '  '. url("node/$release->nid", array('query' => array('absolute' => TRUE))) ."\n";
           if (!empty($release->file_path)) {
             $download_link = project_release_download_link($release->file_path, NULL, TRUE);
             $xml .= '  '. $download_link['href'] ."\n";
    @@ -252,7 +252,7 @@ function project_release_history_write_x
         return FALSE;
       }
       if (!fwrite($hist_fd, $xml)) { 
    -    wd_err(t("ERROR: fwrite(@file) failed", array('@file' => $tmp_filename)) . '
    ' . check_plain($xml));
    +    wd_err(t("ERROR: fwrite(@file) failed", array('@file' => $tmp_filename)) .'
    '. check_plain($xml));
         return FALSE;
       }
       // We have to close this handle before we can rename().
    Index: release/project_release.info
    ===================================================================
    RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project_release.info,v
    retrieving revision 1.2
    diff -u -u -p -r1.2 project_release.info
    --- release/project_release.info	13 Jun 2007 19:33:16 -0000	1.2
    +++ release/project_release.info	8 Jul 2007 14:59:20 -0000
    @@ -3,3 +3,4 @@ name = Project releases
     description = Provides a release node type to represent releases of projects.
     package = Project
     dependencies = project
    +core = 6.x
    Index: release/project_release.install
    ===================================================================
    RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project_release.install,v
    retrieving revision 1.6
    diff -u -u -p -r1.6 project_release.install
    --- release/project_release.install	7 May 2007 19:39:23 -0000	1.6
    +++ release/project_release.install	8 Jul 2007 14:59:20 -0000
    @@ -1,6 +1,6 @@
      'Configure the default version string for releases and other settings for the Project release module.',
    +    'title' => 'Project release settings',
    +    'page callback' => 'drupal_get_form',
    +    'page arguments' => 'project_release_settings_form',
    +    'access arguments' => array('administer projects'),
    +    'weight' => 1,
    +    'type' => MENU_NORMAL_ITEM,
    +  );
    +/*
         if (arg(0) == 'node' && is_numeric(arg(1))) {
           $node = node_load(arg(1));
           if ($node->type == 'project_project') {
    @@ -71,19 +80,7 @@ function project_release_menu($may_cache
         }
         drupal_add_css(drupal_get_path('module', 'project_release') .'/project_release.css');
         project_release_get_api_taxonomy();
    -  }
    -  else {    // $may_cache
    -    $items[] = array(
    -      'path' => 'admin/project/project-release-settings',
    -      'description' => t('Configure the default version string for releases and other settings for the Project release module.'),
    -      'title' => t('Project release settings'),
    -      'callback' => 'drupal_get_form',
    -      'callback arguments' => 'project_release_settings_form',
    -      'access' => user_access('administer projects'),
    -      'weight' => 1,
    -      'type' => MENU_NORMAL_ITEM,
    -    );
    -  }
    +*/
       return $items;
     }
     
    @@ -261,8 +258,8 @@ function project_release_data($project =
             'version_minor' => $release->version_minor,
             'version_patch' => $release->version_patch,
             'version_extra' => $release->version_extra,
    -        'link' => url("node/$release->pid", NULL, NULL, TRUE),
    -        'release' => url("node/$release->release_nid", NULL, NULL, TRUE),
    +        'link' => url("node/$release->pid", array('query' => array('absolute' => TRUE))),
    +        'release' => url("node/$release->release_nid", array('query' => array('absolute' => TRUE))),
             'download' => project_release_download_link($release->file_path, NULL, 'url'),
             'date' => $release->file_date,
             'md5hash' => $release->file_hash,
    @@ -367,22 +364,22 @@ function project_release_settings_form()
       return system_settings_form($form);
     }
     
    -function project_release_settings_form_validate($form_id, $form_values, $form) {
    -  if (!empty($form_values['project_release_directory'])) {
    +function project_release_settings_form_validate($form, &$form_state) {
    +  if (!empty($form_state['values']['project_release_directory'])) {
         form_set_error('project_release_directory', t('Release directory setting has been deprecated.'));
       }
    -  $tids = $form_values['project_release_active_compatibility_tids'];
    -  $default_tid = $form_values['project_release_overview'];
    +  $tids = $form_state['values']['project_release_active_compatibility_tids'];
    +  $default_tid = $form_state['values']['project_release_overview'];
       if ($default_tid != -1 && !$tids[$default_tid]) {
         $vocab = taxonomy_get_vocabulary(_project_release_get_api_vid());
         form_set_error('project_release_overview', t('Project release overview must be one of the active @vocab terms', array('@vocab' => $vocab->name)));
       }
     
       // Make sure the default version format has no bad characters.
    -  _project_release_validate_format_string($form_values, 'project_release_default_version_format');
    +  _project_release_validate_format_string($form_state['values'], 'project_release_default_version_format');
     
       // If set, the project_release_download_base must end with a '/'
    -  if (!empty($form_values['project_release_download_base'])) {
    +  if (!empty($form_state['values']['project_release_download_base'])) {
         if (substr($form_values['project_release_download_base'], -1) != '/') {
            form_set_error('project_release_download_base', t('The %download_base_setting should end with a slash.', array('%download_base_setting' => t('Download link base URL'))));
         }
    @@ -678,17 +675,16 @@ function project_release_validate(&$edit
         }
       }
     
    -  if ($file = file_check_upload('file')) {
    -    $file = file_save_upload('file', file_directory_path());
    -    if ($file) {
    -      $filepath = file_create_path($file->filepath);
    -      form_set_value($form['file']['file_path'], $file->filepath);
    -      form_set_value($form['file']['file_date'], filemtime($filepath));
    -      form_set_value($form['file']['file_hash'], md5_file($filepath));
    -    }
    -    else {
    -      form_set_error('file', t('There was a problem uploading the specified file.'));
    -    }
    +  // @TODO: what are the validators?
    +  $validators = array();
    +  if ($file = file_save_upload('file', file_directory_path(), $validators)) {
    +    $filepath = file_create_path($file->filepath);
    +    form_set_value($form['file']['file_path'], $file->filepath);
    +    form_set_value($form['file']['file_date'], filemtime($filepath));
    +    form_set_value($form['file']['file_hash'], md5_file($filepath));
    +  }
    +  else {
    +    form_set_error('file', t('There was a problem uploading the specified file.'));
       }
       if (project_release_get_api_taxonomy()) {
         $vid = _project_release_get_api_vid();
    @@ -1093,24 +1089,24 @@ function project_release_version_filter_
           );
           $register = '';
           if (variable_get('user_register', 1)) {
    -        $register = ' or ' . l(t('register'), 'user/register', array(), $destination) .' ';
    +        $register = ' or ' . l(t('register'), 'user/register', array('attributes' => array('query' => $destination))) .' ';
           }
    -      $form['version_login'] = array('#value' => l(t('Login'), 'user/login', array(), $destination) . $register . t('to modify the filter.'));
    +      $form['version_login'] = array('#value' => l(t('Login'), 'user/login', array('attributes' => array('query' => $destination))) . $register . t('to modify the filter.'));
         }
         $form['#redirect'] = FALSE;
       }
       return isset($form) ? $form : '';
     }
     
    -function project_release_version_filter_form_submit($form_id, $form_values) {
    -  if (isset($form_values['version_tid'])) {
    -    $_SESSION['project_version'] = $form_values['version_tid'];
    +function project_release_version_filter_form_submit($form, &$form_state) {
    +  if (isset($form['values']['version_tid'])) {
    +    $_SESSION['project_version'] = $form['values']['version_tid'];
       }
     }
     
    -function project_release_version_filter_form_validate($form_id, $form_values, $form) {
    +function project_release_version_filter_form_validate($form, &$form_state) {
       global $user;
    -  if (!$user->uid && $form_values['version_tid'] != variable_get('project_release_overview', -1)) {
    +  if (!$user->uid && $form_state['values']['version_tid'] != variable_get('project_release_overview', -1)) {
         $vocab = taxonomy_get_vocabulary(_project_release_get_api_vid());
         form_set_error('version_tid', t('You must login or register to modify the @vocab filter.', array('@vocab' => $vocab->name)));
       }
    @@ -1247,7 +1243,8 @@ function project_release_project_edit_fo
             '#maxlength' => 255,
             '#description' => t('Customize the format of the version strings for releases of this project.') .' '. PROJECT_RELEASE_VERSION_FORMAT_HELP .' '. t('If blank, this project will use the site-wide default (currently set to: %default)', array('%default' => variable_get('project_release_default_version_format', PROJECT_RELEASE_DEFAULT_VERSION_FORMAT))),
           );
    -      $form['#validate'] = array_merge($form['#validate'], array('project_release_project_edit_form_validate' => array()));
    +      // @TODO: test this
    +      $form['#validate'][] = 'project_release_project_edit_form_validate';
         }
         $vocab = taxonomy_get_vocabulary(_project_release_get_api_vid());
         $vocab = isset($vocab) ? theme('placeholder', $vocab->name) : t('version');
    @@ -1309,9 +1306,9 @@ function theme_project_release_project_e
      * @ingroup project_release_fapi
      * @see project_release_project_edit_releases
      */
    -function project_release_project_edit_form_validate($form_id, $form_values, $form) {
    -  if (!empty($form_values['version_format'])) {
    -    _project_release_validate_format_string($form_values, 'version_format');
    +function project_release_project_edit_form_validate($form, &$form_state) {
    +  if (!empty($form_state['values']['version_format'])) {
    +    _project_release_validate_format_string($form_state['values'], 'version_format');
       }
     }
     
    @@ -1320,22 +1317,22 @@ function project_release_project_edit_fo
      * @ingroup project_release_fapi
      * @see project_release_project_edit_releases
      */
    -function project_release_project_edit_form_submit($form_id, $form_values) {
    -  db_query("UPDATE {project_release_projects} SET releases = %d, snapshot_table = %d, version_format = '%s' WHERE nid = %d", $form_values['releases'], $form_values['snapshot_table'], $form_values['version_format'], $form_values['nid']);
    +function project_release_project_edit_form_submit($form, &$form_state) {
    +  db_query("UPDATE {project_release_projects} SET releases = %d, snapshot_table = %d, version_format = '%s' WHERE nid = %d", $form['values']['releases'], $form['values']['snapshot_table'], $form['values']['version_format'], $form['values']['nid']);
     
    -  if (!empty($form_values['default_versions'])) {
    -    foreach ($form_values['default_versions'] as $tid => $values) {
    -      if ($obj = db_fetch_object(db_query("SELECT * FROM {project_release_default_versions} WHERE nid = %d AND tid = %d", $form_values['nid'], $tid))) {
    +  if (!empty($form['values']['default_versions'])) {
    +    foreach ($form['values']['default_versions'] as $tid => $values) {
    +      if ($obj = db_fetch_object(db_query("SELECT * FROM {project_release_default_versions} WHERE nid = %d AND tid = %d", $form['values']['nid'], $tid))) {
             if ($obj->major != $values['major']) {
    -          db_query("UPDATE {project_release_default_versions} SET major = %d WHERE nid = %d AND tid = %d", $values['major'], $form_values['nid'], $tid);
    +          db_query("UPDATE {project_release_default_versions} SET major = %d WHERE nid = %d AND tid = %d", $values['major'], $form['values']['nid'], $tid);
             }
           }
           else {
    -        db_query("INSERT INTO {project_release_default_versions} (nid, tid, major) VALUES (%d, %d, %d)", $form_values['nid'], $tid, $values['major']);
    +        db_query("INSERT INTO {project_release_default_versions} (nid, tid, major) VALUES (%d, %d, %d)", $form['values']['nid'], $tid, $values['major']);
           }
         }
       }
    -  db_query("UPDATE {node} SET changed = %d WHERE nid = %d", time(), $form_values['nid']);
    +  db_query("UPDATE {node} SET changed = %d WHERE nid = %d", time(), $form['values']['nid']);
       drupal_set_message(t('Release settings have been saved.'));
     }
     
    Index: release/project_release_scan.inc
    ===================================================================
    RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project_release_scan.inc,v
    retrieving revision 1.3
    diff -u -u -p -r1.3 project_release_scan.inc
    --- release/project_release_scan.inc	18 Dec 2006 09:02:39 -0000	1.3
    +++ release/project_release_scan.inc	8 Jul 2007 14:59:22 -0000
    @@ -1,6 +1,6 @@
      'admin/settings/project/reload', 'title' => t('scan for releases'), 'callback' => 'project_release_scan', 'access' => $access, 'type' => MENU_NORMAL_ITEM);
    -    }
    +  if (variable_get('project_release_directory', '')) {
    +    $items['admin/settings/project/reload'] = array(
    +      'title' => 'scan for releases',
    +      'page callback' => 'project_release_scan',
    +      'access arguments' => array('administer projects'),
    +      'type' => MENU_NORMAL_ITEM
    +    );
       }
     }
     
    Index: release/project_release_update.php
    ===================================================================
    RCS file: /cvs/drupal-contrib/contributions/modules/project/release/project_release_update.php,v
    retrieving revision 1.4
    diff -u -u -p -r1.4 project_release_update.php
    --- release/project_release_update.php	22 Dec 2006 23:53:20 -0000	1.4
    +++ release/project_release_update.php	8 Jul 2007 14:59:22 -0000
    @@ -1,6 +1,6 @@
     version_major . '-';
    +  $tag .= $node->version_major .'-';
       if (isset($node->version_minor)) {
    -    $tag .= $node->version_minor . '-';
    +    $tag .= $node->version_minor .'-';
       }
       $tag .= $node->version_patch;
       if (!empty($node->version_extra)) {
    -    $tag .= '-' . strtoupper(preg_replace('/(.+)(\d+)/', '\1-\2', $node->version_extra));
    +    $tag .= '-'. strtoupper(preg_replace('/(.+)(\d+)/', '\1-\2', $node->version_extra));
       }
       return $tag;
     } 
    @@ -41,7 +41,7 @@ function populate_project_release_projec
       $num_prp = db_result(db_query("SELECT count(nid) FROM {project_release_projects}"));
       $num_projects = db_result(db_query("SELECT count(nid) FROM {project_projects}"));
       if ($num_prp == $num_projects) {
    -    print("The {project_release_projects} table is already full
    "); + print("The {project_release_projects} table is already full
    "); return; } // First, insert a record with the right nid for all projects @@ -82,7 +82,7 @@ function populate_project_release_projec list($usec, $sec) = explode(' ', microtime()); $stop = (float)$usec + (float)$sec; $diff = round(($stop - $start) * 1000, 2); - print t('Added %num records to the {project_release_projects} table in %ms ms
    ', array('%num' => $num_prp, '%ms' => $diff)); + print t('Added %num records to the {project_release_projects} table in %ms ms
    ', array('%num' => $num_prp, '%ms' => $diff)); } /** @@ -119,7 +119,7 @@ function convert_all_releases() { $num_considered++; } - print t('Considered %num_considered releases, converted %num_converted into nodes in %interval
    ', array('%num_considered' => $num_considered, '%num_converted' => $num_converted, '%interval' => format_interval(time() - $start_time))); + print t('Considered %num_considered releases, converted %num_converted into nodes in %interval
    ', array('%num_considered' => $num_considered, '%num_converted' => $num_converted, '%interval' => format_interval(time() - $start_time))); } /** @@ -191,7 +191,7 @@ function convert_release($old_release) { $target_api = "$matches[1].$matches[2].x"; } else { - print("ERROR: release $old_release->rid of $old_release->project_title has malformed version ($old_release->version)
    "); + print("ERROR: release $old_release->rid of $old_release->project_title has malformed version ($old_release->version)
    "); return false; } } @@ -205,13 +205,13 @@ function convert_release($old_release) { // Nightly tarball from a specific branch. preg_match('/^(\d+)\.(\d+)\.(\d+)$/', $old_release->version, $matches); if ($matches[3] != 0) { - print("warning: release $old_release->rid of $old_release->project_title has unexpected patch-level version ($matches[3])
    "); + print("warning: release $old_release->rid of $old_release->project_title has unexpected patch-level version ($matches[3])
    "); } $target_api = "$matches[1].$matches[2].x"; $node->version_major = 1; $node->version_patch = 'x'; $node->version_extra = 'dev'; - $node->tag = 'DRUPAL-' . $matches[1] . '-' . $matches[2]; + $node->tag = 'DRUPAL-'. $matches[1] .'-'. $matches[2]; $node->rebuild = 1; } @@ -324,9 +324,9 @@ function convert_issue_followups() { db_query("UPDATE {project_comments} SET data = '%s' WHERE cid = %d", serialize($data), $comment->cid); $num++; } - print t('Converted %num issue followups in %interval', array('%num' => $num, '%interval' => format_interval(time() - $start_time))) . '
    '; + print t('Converted %num issue followups in %interval', array('%num' => $num, '%interval' => format_interval(time() - $start_time))) .'
    '; if ($errors) { - print '' . t('ERROR: problem during conversion of %num issue followups', array('%num' => $errors)) . '
    '; + print ''. t('ERROR: problem during conversion of %num issue followups', array('%num' => $errors)) .'
    '; } } @@ -441,7 +441,7 @@ if (!ini_get('safe_mode')) { } if (!module_exists('project_release')) { - print '' . t('ERROR: project_release_update.php requires that you first install the project_release.module') . ''; + print ''. t('ERROR: project_release_update.php requires that you first install the project_release.module') .''; exit(1); }