cvs diff: Diffing .
Index: signup.date.js
===================================================================
RCS file: signup.date.js
diff -N signup.date.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ signup.date.js 23 Oct 2008 18:41:15 -0000
@@ -0,0 +1,24 @@
+/* $Id$ */
+
+/**
+ * On a node type settings form, if the "Allow signups" radios are
+ * not set to 0 ('Disabled'), then show the date field selection,
+ * otherwise, hide it.
+ */
+Drupal.signupShowDateFieldAutoAttach = function () {
+ $('div.signup-node-default-state-radios input[@type=radio]').click(function () {
+ if (this.value == 'disabled') {
+ $('div.signup-date-field-setting').hide();
+ }
+ else {
+ $('div.signup-date-field-setting').show();
+ }
+ });
+};
+
+// Global killswitch.
+if (Drupal.jsEnabled) {
+ $(function() {
+ Drupal.signupShowDateFieldAutoAttach();
+ });
+}
Index: signup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup.module,v
retrieving revision 1.158
diff -u -p -r1.158 signup.module
--- signup.module 18 Oct 2008 05:20:15 -0000 1.158
+++ signup.module 23 Oct 2008 18:41:17 -0000
@@ -38,10 +38,13 @@ function signup_cron() {
* @see _signup_build_query()
*/
function _signup_cron_send_reminders() {
+ $reminder_sql = array();
if (function_exists('signup_reminder_sql')) {
- $reminder_sql = signup_reminder_sql();
+ foreach (signup_content_type_fields() as $field) {
+ $reminder_sql[] = signup_reminder_sql($field);
+ }
}
- if (empty($reminder_sql)) {
+ if (empty($reminder_sql[0])) {
// The backend doesn't support reminder emails, so bail out now.
return;
}
@@ -97,9 +100,11 @@ function _signup_cron_send_reminders() {
*/
function _signup_cron_autoclose() {
if (function_exists('signup_autoclose_sql')) {
- $autoclose_sql = signup_autoclose_sql();
+ foreach (signup_content_type_fields() as $type) {
+ $autoclose_sql[] = signup_autoclose_sql($type);
+ }
}
- if (empty($autoclose_sql)) {
+ if (empty($autoclose_sql[0])) {
// The backend doesn't support auto-closing events, so bail out now.
return;
}
@@ -145,31 +150,50 @@ function _signup_cron_autoclose() {
* Complete SQL statement based on the given query fragments.
*/
function _signup_build_query($common_sql, $backend_sql) {
+ // Combine all the backend_sql values into a single array.
+ $fields = array();
+ $joins = array();
+ $where = array();
+ $group_by = array();
+ foreach ($backend_sql as $sql) {
+ $fields = array_merge($fields, (!empty($sql['fields']) ? $sql['fields'] : array()));
+ $joins = array_merge($joins, (!empty($sql['joins']) ? $sql['joins'] : array()));
+ $where = array_merge($where, (!empty($sql['where']) ? $sql['where'] : array()));
+ $group_by = array_merge($group_by, (!empty($sql['group_by']) ? $sql['group_by'] : array()));
+ }
+ // Combine backend sql with common_sql.
$fields = array_merge(
(!empty($common_sql['fields']) ? $common_sql['fields'] : array()),
- (!empty($backend_sql['fields']) ? $backend_sql['fields'] : array())
+ (!empty($fields) ? $fields : array())
);
$joins = array_merge(
(!empty($common_sql['joins']) ? $common_sql['joins'] : array()),
- (!empty($backend_sql['joins']) ? $backend_sql['joins'] : array())
- );
- $where = array_merge(
- (!empty($common_sql['where']) ? $common_sql['where'] : array()),
- (!empty($backend_sql['where']) ? $backend_sql['where'] : array())
+ (!empty($joins) ? $joins : array())
);
$group_by = array_merge(
(!empty($common_sql['group_by']) ? $common_sql['group_by'] : array()),
- (!empty($backend_sql['group_by']) ? $backend_sql['group_by'] : array())
+ (!empty($group_by) ? $group_by : array())
);
+ // Combine each of the backend_sql content type 'where' criteria with the common 'where'
+ // criteria to create the OR where clause.
+ if (!empty($where)) {
+ foreach ($where as $criteria) {
+ $where_or[] = implode(' AND ', array_merge($common_sql['where'], array($criteria)));
+ }
+ }
+ elseif (!empty($common_sql['where'])) {
+ $where_or = $common_sql['where'];
+ }
+
$sql = 'SELECT '. implode(', ', $fields);
$sql .= ' FROM '. $common_sql['primary'] .' ';
if (!empty($joins)) {
$sql .= implode(' ', $joins);
}
- if (!empty($where)) {
- $sql .= ' WHERE '. implode(' AND ', $where);
+ if (!empty($where_or)) {
+ $sql .= ' WHERE ('. implode(') OR (', $where_or) .')';
}
if (!empty($group_by)) {
$sql .= ' GROUP BY '. implode(', ', $group_by);
@@ -289,6 +313,13 @@ function signup_menu($may_cache) {
return $items;
}
+/**
+ * Loads relevant backend event backend code based on which modules
+ * exists and which version is loaded. Currently, checks for the
+ * event modules first, then the date module, and doesn't allow for
+ * either event or date to be used if both modules are present.
+ * @ingroup signup_core
+ */
function _signup_initialize_event_backend() {
define('SIGNUP_PATH', drupal_get_path('module', 'signup'));
if (defined('EVENT_API') && EVENT_API == '5.2') {
@@ -297,10 +328,13 @@ function _signup_initialize_event_backen
else if (module_exists('event')) {
include_once(SIGNUP_PATH .'/signup_event_5.x-1.inc');
}
+ else if (variable_get('date_api_version', 0) == '5.2') {
+ include_once(SIGNUP_PATH .'/signup_date.inc');
+ include_once(SIGNUP_PATH .'/signup_date_5.x-2.inc');
+ }
else if (module_exists('date')) {
- // include_once(SIGNUP_PATH .'/signup_date.inc');
- // Until date.module support exists, fall back to the no event case.
- include_once(SIGNUP_PATH .'/signup_event_none.inc');
+ include_once(SIGNUP_PATH .'/signup_date.inc');
+ include_once(SIGNUP_PATH .'/signup_date_5.x-1.inc');
}
else {
include_once(SIGNUP_PATH .'/signup_event_none.inc');
@@ -376,6 +410,11 @@ function signup_form_alter($form_id, &$f
case $form['type']['#value'] .'_node_form':
signup_alter_node_form($form_id, $form);
break;
+ case '_content_admin_field':
+ if (function_exists('signup_date_form_alter')) {
+ signup_date_form_alter($form_id, $form);
+ }
+ break;
}
}
@@ -396,6 +435,10 @@ function signup_alter_node_type_form($fo
'#default_value' => variable_get('signup_node_default_state_'. $type, 'disabled'),
'#description' => t('If %disabled is selected, signups will not be possible for this content type. If %allowed_off is selected, signups will be off by default, but users with the %admin_all_signups permission will be able to allow signups for specific posts of this content type. If %enabled_on is selected, users will be allowed to signup for this content type unless an administrator disbles signups on specific posts.', array('%disabled' => t('Disabled'), '%allowed_off' => t('Allowed (off by default)'), '%enabled_on' => t('Enabled (on by default)'), '%admin_all_signups' => t('administer all signups'))),
);
+
+ if (function_exists('_signup_date_alter_node_type_form')) {
+ _signup_date_alter_node_type_form($form_id, $form);
+ }
}
/**
@@ -1248,11 +1294,11 @@ function signup_admin_form_sql() {
}
// Get the right query elements from the currently installed backend
+ $admin_sql = array();
if (function_exists('signup_admin_sql')) {
- $admin_sql = signup_admin_sql();
- }
- else {
- $admin_sql = array();
+ foreach (signup_content_type_fields() as $field) {
+ $admin_sql[] = signup_admin_sql($field);
+ }
}
// Build the main query.
@@ -1606,17 +1652,34 @@ function signup_list_user_signups($uid)
// We don't want to return anything for anon users.
if ($uid != 0) {
- $sql = signup_list_user_signups_sql();
- // Pull all open signup nodes for this user.
- $result = db_query(db_rewrite_sql($sql), $uid);
- while ($node = db_fetch_array($result)) {
- $titles[$node['nid']] = l($node['title'], 'node/'. $node['nid']);
+ foreach (signup_content_types() as $type) {
+ $sql = signup_list_user_signups_sql($type);
+ if ($sql) {
+ // Pull all open signup nodes for this user.
+ $result = db_query(db_rewrite_sql($sql), $uid);
+ while ($node = db_fetch_array($result)) {
+ $titles[$node['nid']] = l($node['title'], 'node/'. $node['nid']);
+ }
+ }
}
}
return $titles;
}
/**
+ * Returns a list of content types that have signups enabled
+ */
+function signup_content_types() {
+ $signup_content_types = array();
+ foreach (node_get_types('names') as $content_type => $content_name) {
+ if (variable_get('signup_node_default_state_'. $content_type, 'disabled') != 'disabled') {
+ $signup_content_types[] = $content_type;
+ }
+ }
+ return $signup_content_types;
+}
+
+/**
* Signs up a user to a node.
*
* NOTE: other modules can call this function. To do so, $signup_form
Index: signup_date.inc
===================================================================
RCS file: signup_date.inc
diff -N signup_date.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ signup_date.inc 23 Oct 2008 18:41:18 -0000
@@ -0,0 +1,209 @@
+ array('n.type', $content_type_field['database']['columns']['value']['column']),
+ 'joins' => array('LEFT JOIN {'. $content_type_field['database']['table'] .'} ON {'. $content_type_field['database']['table'] .'}.nid = n.nid'),
+ );
+}
+
+function signup_admin_form_header() {
+ // TODO: Not sure if we can sort date fields, since they might be coming
+ // from different tables so for now 'field' is NULL to disable sorting on
+ // the date field
+ return array('data' => t('Start'), 'field' => NULL);
+}
+
+function signup_admin_form_extra($signup_event) {
+ return array(
+ '#type' => 'markup',
+ '#value' => signup_format_date($signup_event)
+ );
+}
+
+function signup_field_names($content_type = NULL) {
+ $fields = array();
+ $content_type_info = _content_type_info();
+ if ($content_type_info['content types'][$content_type]) {
+ foreach ($content_type_info['content types'][$content_type]['fields'] as $field) {
+ if (in_array($field['type'], array('date', 'datestamp'))) {
+ $fields[$field['field_name']] = $field['widget']['label'];
+ }
+ }
+ }
+ return $fields;
+}
+
+function signup_extra_tokens() {
+ return array('%time');
+}
+
+function signup_date_field($content_type) {
+ $field_name = variable_get('signup_date_field_'. $content_type, 0);
+ if ($field_name == 0) {
+ return FALSE;
+ }
+ $field = content_fields($field_name, $content_type);
+ if (empty($field)) {
+ return array();
+ }
+ $field['database'] = content_database_info($field);
+ return $field;
+}
+
+function theme_signup_event_dates($node) {
+ return signup_format_date($node, TRUE);
+}
+
+/**
+ * Returns a list of all cck fields that have been set for use in signups
+ */
+function signup_content_type_fields() {
+ $fields = array();
+ foreach (signup_content_types() as $content_type) {
+ if ($field = signup_date_field($content_type)) {
+ $fields[] = $field;
+ }
+ }
+ return $fields;
+}
+
+/**
+ * Does this site have any date-enabled content?
+ *
+ * @return Bool: Always return TRUE in this backend
+ */
+function signup_site_has_dates() {
+ return TRUE;
+}
+
+/**
+ * @return Bool: Is this node type date-enabled?
+ */
+function signup_node_type_has_date($type) {
+ return variable_get('signup_date_field_'. $type, 0) != 0;
+}
+
+/**
+ * @return Bool: Is this specific node date-enabled?
+ */
+function signup_node_has_date($node) {
+ if (signup_node_type_has_date($node->type)) {
+ $field = signup_date_field($node->type);
+ return isset($node->{$field['field_name']});
+ }
+ return FALSE;
+}
+
+/**
+ * Alters the form for configuring CCK date fields on node types.
+ *
+ * Hooks into CCK Date fields to provide an option to use the current
+ * field as the Signup date field (for autoclose and reminder emails).
+ *
+ * @see signup_form_alter()
+ */
+function signup_date_form_alter($form_id, &$form) {
+ $type = $form['type_name']['#value'];
+ if (in_array($form['field_type']['#value'], array('date', 'datestamp')) && variable_get('signup_node_default_state_'. $type, 'disabled') != 'disabled') {
+ $form['signup'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Signup settings'),
+ '#description' => t('Select the date field of this content type to use with signup. Select "%none" to not use a date field with signup at all.', array('%none' => t('None'))),
+ '#collapsible' => TRUE,
+ '#weight' => 1,
+ );
+ $form['signup']['signup_date_field'] = array(
+ '#type' => 'select',
+ '#title' => t('Date field to use with signup'),
+ '#options' => _signup_get_date_field_options($type),
+ '#default_value' => variable_get('signup_date_field_'. $type, 0),
+ );
+ $form['#submit']['signup_date_field_form_submit'] = array();
+ // Make sure the submit button comes after the signup settings fieldset.
+ $form['submit']['#weight'] = 50;
+ }
+}
+
+function signup_date_field_form_submit($form_id, $form_values) {
+ $type = $form_values['type_name'];
+ if (empty($form_values['signup_date_field'])) {
+ variable_del('signup_date_field_'. $type);
+ }
+ else {
+ variable_set('signup_date_field_'. $type, $form_values['signup_date_field']);
+ }
+}
+
+/**
+ *
+ */
+function _signup_date_alter_node_type_form($form_id, &$form) {
+ drupal_add_js(drupal_get_path('module', 'signup') .'/signup.date.js');
+ drupal_add_css(drupal_get_path('module', 'signup') .'/signup.css');
+
+ $type = $form['old_type']['#value'];
+ $default_signup_state = variable_get('signup_node_default_state_'. $type, 'disabled');
+
+ // Add a div to the 'Signup options' radios for signup.date.js.
+ $form['workflow']['signup_node_default_state']['#prefix'] = '
';
+ $form['workflow']['signup_node_default_state']['#suffix'] = '
';
+
+ // Figure out if we should hide the date field selector by default.
+ $class = 'signup-date-field-setting';
+ if ($default_signup_state == 'disabled') {
+ $class .= ' js-hide';
+ }
+
+ $form['workflow']['signup_date_field'] = array(
+ '#type' => 'select',
+ '#title' => t('Date field to use with signup'),
+ '#options' => _signup_get_date_field_options($type),
+ '#default_value' => variable_get('signup_date_field_'. $type, 0),
+ '#description' => t('Select the date field of this content type to use with signup. Select "%none" to not use a date field with signup at all.', array('%none' => t('None'))),
+ '#prefix' => '',
+ '#suffix' => '
',
+ );
+
+ if ($default_signup_state != 'disabled') {
+ if (signup_field_names($type)) {
+ if (signup_date_field($type) == 0) {
+ drupal_set_message('You have enabled this content type for signup, and have added one or more date fields, but have not selected a date field for use with signup.');
+ }
+ }
+ else {
+ drupal_set_message('You have enabled this content type for signup but have not added a date field.');
+ }
+ }
+}
+
+/**
+ * Helper function for the date field select to build its options.
+ *
+ * @param $type
+ * Content type whose date fields should be listed.
+ *
+ * @return
+ * Associative array with all date fields of the given content type plus
+ * 'None' and an optional 'Not specified' if the user never selected a
+ * value.
+ */
+function _signup_get_date_field_options($type) {
+ $options = signup_field_names($type);
+ // Add "Not specified" if the user never selected a field.
+ if (variable_get('signup_date_field_'. $type, 0) == 0) {
+ $options = array_merge(array(0 => t('')), $options);
+ }
+ // Always add 'None' as the final choice.
+ return array_merge($options, array('none' => t('')));
+}
Index: signup_date_5.x-1.inc
===================================================================
RCS file: signup_date_5.x-1.inc
diff -N signup_date_5.x-1.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ signup_date_5.x-1.inc 23 Oct 2008 18:41:18 -0000
@@ -0,0 +1,93 @@
+ ". date_sql('DATE', $content_type_field['database']['columns']['value']['column'], 'iso'));
+ break;
+ case 'pgsql':
+ $where = array("NOW() + INTERVAL s.reminder_days_before days > ". date_sql('DATE', $content_type_field['database']['columns']['value']['column'], 'iso'));
+ break;
+ }
+ return array(
+ 'fields' => array('n.type', $content_type_field['database']['columns']['value']['column']),
+ 'joins' => array('LEFT JOIN {'. $content_type_field['database']['table'] .'} ON {'. $content_type_field['database']['table'] .'}.nid = n.nid'),
+ 'where' => $where,
+ );
+}
+
+/**
+ * @return Array of SQL clauses for cron auto-close query builder.
+ */
+function signup_autoclose_sql($content_type_field = NULL) {
+ return array(
+ 'fields' => array($content_type_field['database']['columns']['value']['column']),
+ 'joins' => array('LEFT JOIN {'. $content_type_field['database']['table'] .'} ON {'. $content_type_field['database']['table'] .'}.nid = s.nid'),
+ 'where' => array( date_sql('DATE', $content_type_field['database']['columns']['value']['column'], 'iso') ." < '". date('Y-m-d H:i:s', time() + variable_get('signup_close_early', 1) * 3600) ."'"),
+ );
+}
+
+/**
+ * @return SQL for listing signups a user has signed up for
+ */
+function signup_list_user_signups_sql($content_type = NULL) {
+ $field = signup_date_field($content_type);
+ if ($field) {
+ return 'SELECT n.nid, n.title, '. $field['database']['columns']['value']['column'] .' FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid LEFT JOIN '. $field['database']['table'] .' c ON c.nid = n.nid WHERE s_l.uid = %d AND ('. date_sql('NOW', $field['database']['columns']['value']['column'], 'iso') .' >= NOW() OR '. $field['database']['columns']['value']['column'] .' IS NULL) ORDER BY '. $field['database']['columns']['value']['column'];
+ }
+ else {
+ return FALSE;
+ }
+}
+
+/**
+ * Returns TRUE if the given node is event-enabled, and the start time
+ * has already passed the "Close x hours before" setting.
+ */
+function _signup_event_completed($node) {
+ if (is_numeric($node)) {
+ $node = node_load($node);
+ }
+ $field = signup_date_field($node->type);
+ if ($field && isset($node->{$field['field_name']})) {
+ $closing_time = time() + (variable_get('signup_close_early', 1) * 3600);
+ if (date_iso2unix($node->{$field['field_name']}[0]['value']) < $closing_time) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+function signup_format_date($node, $include_to_date = FALSE) {
+ $field = signup_date_field($node->type);
+ if (!$field) {
+ return '';
+ }
+ if (isset($node->{$field['field_name']})) {
+ $date_value = $node->{$field['field_name']}[0]['value'];
+ }
+ else {
+ $date_value = $node->{$field['database']['columns']['value']['column']};
+ }
+ $date = date_show_date(date_make_date($date_value), $field['output_format_date'], 'db');
+
+ if ($include_to_date) {
+ if (isset($node->{$field['field_name']})) {
+ $date_value = $node->{$field['field_name']}[0]['value2'];
+ }
+ else {
+ $date_value = $node->{$field['database']['columns']['value2']['column']};
+ }
+ if ($date_value) {
+ $date .= t(' to ') . date_show_date(date_make_date($date_value), $field['output_format_date'], 'db');
+ }
+ }
+
+ return $date;
+}
Index: signup_date_5.x-2.inc
===================================================================
RCS file: signup_date_5.x-2.inc
diff -N signup_date_5.x-2.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ signup_date_5.x-2.inc 23 Oct 2008 18:41:18 -0000
@@ -0,0 +1,99 @@
+ ". $handler->sql_extract('DATE', $content_type_field['database']['columns']['value']['column']));
+ break;
+ case 'pgsql':
+ $where = array("NOW() + INTERVAL s.reminder_days_before days > ". $handler->sql_extract('DATE', $content_type_field['database']['columns']['value']['column']));
+ break;
+ }
+ return array(
+ 'fields' => array('n.type', $content_type_field['database']['columns']['value']['column']),
+ 'joins' => array('LEFT JOIN {'. $content_type_field['database']['table'] .'} ON {'. $content_type_field['database']['table'] .'}.nid = n.nid'),
+ 'where' => $where,
+ );
+}
+
+/**
+ * @return Array of SQL clauses for cron auto-close query builder.
+ */
+function signup_autoclose_sql($content_type_field = NULL) {
+ require_once(drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
+ $handler = new date_sql_handler();
+ return array(
+ 'fields' => array($content_type_field['database']['columns']['value']['column']),
+ 'joins' => array('LEFT JOIN {'. $content_type_field['database']['table'] .'} ON {'. $content_type_field['database']['table'] .'}.nid = s.nid'),
+ 'where' => array( $handler->sql_extract('DATE', $content_type_field['database']['columns']['value']['column']) ." < '". date('Y-m-d\TH:i:s', time() + variable_get('signup_close_early', 1) * 3600) ."'"),
+ );
+}
+
+/**
+ * @return SQL for listing signups a user has signed up for
+ */
+function signup_list_user_signups_sql($content_type = NULL) {
+ require_once(drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
+ $handler = new date_sql_handler();
+ $field = signup_date_field($content_type);
+ if ($field) {
+ return 'SELECT n.nid, n.title, '. $field['database']['columns']['value']['column'] .' FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid LEFT JOIN '. $field['database']['table'] .' c ON c.nid = n.nid WHERE s_l.uid = %d AND ('. $handler->sql_extract('NOW', $field['database']['columns']['value']['column'], 'iso') .' >= NOW() OR '. $field['database']['columns']['value']['column'] .' IS NULL) ORDER BY '. $field['database']['columns']['value']['column'];
+ }
+ else {
+ return FALSE;
+ }
+}
+
+/**
+ * Returns TRUE if the given node is event-enabled, and the start time
+ * has already passed the "Close x hours before" setting.
+ */
+function _signup_event_completed($node) {
+ if (is_numeric($node)) {
+ $node = node_load($node);
+ }
+ $field = signup_date_field($node->type);
+ if ($field && isset($node->{$field['field_name']})) {
+ $closing_time = time() + (variable_get('signup_close_early', 1) * 3600);
+ if (strtotime($node->{$field['field_name']}[0]['value']) < $closing_time) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+function signup_format_date($node, $include_to_date = FALSE) {
+ $field = signup_date_field($node->type);
+ if (!$field) {
+ return '';
+ }
+ if (isset($node->{$field['field_name']})) {
+ $date_value = $node->{$field['field_name']}[0]['value'];
+ }
+ else {
+ $date_value = $node->{$field['database']['columns']['value']['column']};
+ }
+ $date = date_format_date(date_make_date($date_value), 'custom', $field['output_format_date']);
+
+ if ($include_to_date) {
+ if (isset($node->{$field['field_name']})) {
+ $date_value = $node->{$field['field_name']}[0]['value2'];
+ }
+ else {
+ $date_value = $node->{$field['database']['columns']['value2']['column']};
+ }
+ if ($date_value) {
+ $date .= t(' to ') . date_format_date(date_make_date($date_value), 'custom', $field['output_format_date']);
+ }
+ }
+
+ return $date;
+}
Index: signup_event_5.x-1.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup_event_5.x-1.inc,v
retrieving revision 1.8
diff -u -p -r1.8 signup_event_5.x-1.inc
--- signup_event_5.x-1.inc 18 Oct 2008 06:18:33 -0000 1.8
+++ signup_event_5.x-1.inc 23 Oct 2008 18:41:18 -0000
@@ -4,7 +4,7 @@
/**
* @return Array of SQL clauses for cron reminder email query builder.
*/
-function signup_reminder_sql() {
+function signup_reminder_sql($content_type = NULL) {
// We must manually include this here as the event module doesn't
// include timezone support on all page requests.
include_once(drupal_get_path('module', 'event') .'/event_timezones.inc');
@@ -18,7 +18,7 @@ function signup_reminder_sql() {
/**
* @return Array of SQL clauses for cron auto-close query builder.
*/
-function signup_autoclose_sql() {
+function signup_autoclose_sql($content_type = NULL) {
// We must manually include this here as the event module doesn't
// include timezone support on all page requests.
include_once(drupal_get_path('module', 'event') .'/event_timezones.inc');
@@ -32,7 +32,7 @@ function signup_autoclose_sql() {
/**
* @return Array of SQL clauses for admin overview page query builder.
*/
-function signup_admin_sql() {
+function signup_admin_sql($content_type = NULL) {
$fields = array('e.event_start', 'e.timezone');
return array(
'fields' => $fields,
@@ -53,7 +53,7 @@ function signup_admin_form_extra($signup
);
}
-function signup_list_user_signups_sql() {
+function signup_list_user_signups_sql($content_type = NULL) {
return "SELECT n.nid, n.title, e.event_start FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid LEFT JOIN {event} e ON e.nid = n.nid WHERE s_l.uid = %d AND (e.event_start >= ". time() ." OR e.event_start IS NULL) ORDER BY e.event_start";
}
Index: signup_event_5.x-2.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup_event_5.x-2.inc,v
retrieving revision 1.7
diff -u -p -r1.7 signup_event_5.x-2.inc
--- signup_event_5.x-2.inc 10 Oct 2008 22:01:27 -0000 1.7
+++ signup_event_5.x-2.inc 23 Oct 2008 18:41:18 -0000
@@ -4,7 +4,7 @@
/**
* @return Array of SQL clauses for cron reminder email query builder.
*/
-function signup_reminder_sql() {
+function signup_reminder_sql($content_type = NULL) {
global $db_type;
event_include_files();
switch ($db_type) {
@@ -25,7 +25,7 @@ function signup_reminder_sql() {
/**
* @return Array of SQL clauses for cron auto-close query builder.
*/
-function signup_autoclose_sql() {
+function signup_autoclose_sql($content_type = NULL) {
event_include_files();
return array(
'fields' => array(event_select(), 'e.timezone'),
@@ -37,7 +37,7 @@ function signup_autoclose_sql() {
/**
* @return Array of SQL clauses for admin overview page query builder.
*/
-function signup_admin_sql() {
+function signup_admin_sql($content_type = NULL) {
return array(
'fields' => array(event_select(), 'e.timezone'),
'group_by' => array('event_start', 'e.timezone'),
@@ -56,7 +56,7 @@ function signup_admin_form_extra($signup
);
}
-function signup_list_user_signups_sql() {
+function signup_list_user_signups_sql($content_type = NULL) {
return 'SELECT n.nid, n.title, '. event_select() .' FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid '. event_join('n', 'LEFT') .' WHERE s_l.uid = %d AND ('. event_where() ." >= '". event_implode_date(_event_user_time()) ."' OR e.event_start IS NULL) ORDER BY event_start";
}
@@ -94,6 +94,10 @@ function signup_site_has_dates() {
return TRUE;
}
+function signup_content_type_fields() {
+ return array('Event');
+}
+
/**
* @return Bool: Is this node type date-enabled?
*/
Index: signup_event_none.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup_event_none.inc,v
retrieving revision 1.3
diff -u -p -r1.3 signup_event_none.inc
--- signup_event_none.inc 6 Aug 2008 08:12:13 -0000 1.3
+++ signup_event_none.inc 23 Oct 2008 18:41:18 -0000
@@ -12,7 +12,7 @@
*
* The call site assumes the one and only %d in this query is the user's uid.
*/
-function signup_list_user_signups_sql() {
+function signup_list_user_signups_sql($content_type = NULL) {
return "SELECT n.nid, n.title FROM {node} n INNER JOIN {signup_log} s_l ON n.nid = s_l.nid WHERE s_l.uid = %d ORDER BY n.nid";
}
cvs diff: Diffing contrib
cvs diff: Diffing contrib/signup_conflicts
cvs diff: Diffing contrib/signup_default_views
cvs diff: Diffing contrib/signup_ecommerce
cvs diff: Diffing po