? node_agreement-642806.patch
Index: node_agreement.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_agreement/node_agreement.module,v
retrieving revision 1.1
diff -u -p -r1.1 node_agreement.module
--- node_agreement.module	2 Nov 2009 00:28:55 -0000	1.1
+++ node_agreement.module	25 Nov 2009 18:56:06 -0000
@@ -8,7 +8,8 @@ function node_agreement_nodeapi(&$node, 
   global $user;
   if ($op == 'view' && isset($node->agreement) && !$node->agreement['signed']) {
     if ($a4) { // page?
-      drupal_goto('node/agreement/' . $node->nid);
+      $path = module_exists('path') ? drupal_get_path_alias('node/agreement/' . $node->nid) : 'node/agreement/' . $node->nid;
+      drupal_goto($path);
     } 
     else {
       $node->content = array(
@@ -95,6 +96,17 @@ function node_agreement_form($form_state
     '#options' => $agreements,
     '#default_value' => $node->agreement['aid'],
   );
+  if (module_exists('path')) {
+    $form['agreement_alias'] = array(
+      '#type' => 'textfield',
+      '#title' => t('URL Alias'),
+      '#description' => t("Optionally specify an alternative URL by which this node can be accessed. For example, type \"about\" when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work."),
+      '#default_value' => (drupal_get_path_alias('node/agreement/' . $node->nid)) ? drupal_get_path_alias('node/agreement/' . $node->nid) : 'node/agreement/' . $node->nid,
+      '#size' => 60,
+      '#maxlength' => 128,
+      '#required' => FALSE,
+    );
+  }
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Submit'),
@@ -109,6 +121,9 @@ function node_agreement_form_submit($for
     $record = array('nid' => $form_state['values']['nid'], 'aid' => $form_state['values']['agreement']);
     drupal_write_record('node_agreement', $record);
   }
+  if ($form_state['values']['agreement_alias']) {
+    path_set_alias('node/agreement/' . $form_state['values']['nid'], $form_state['values']['agreement_alias']);
+  }
 }
 
 function node_agreement_settings($form_state) {
