ec_recurring.module

Version

1.1.2.17.2.19.2.61 (checked in on 2008/03/26 at 22:32:10 by sime)

Description

@author Sammy Spets (thanks to Synerger Pty Ltd, Australia) @author eC Dev Team ec_recurring.module Enables recurring product support in Drupal e-Commerce.

@todo: Test that renewals in the old system are entered correctly during the upgrade @todo: Add support for GET parameters for expiry date and workflow status into ec_recurring_ui_products_active(). @todo: Add more UI code to the system. @todo: Combine the numunits and unit form elements into one element (type=time_interval). @todo: Create a hook for calculation of the start_time and improve ec_recurring_start_time() @todo: Provide some way for administrators to change the product vid of an item in the ec_transaction_product table. User's subscription page displays a list for limiting display to All, Expired, Renewed, Active. Admin user can see all that plus click an edit link. Through that interface the admin can change the vid and possibly set an expiry date.

Constants

Namesort iconDescription
ECMAIL_TYPE_REMINDER
ECRECURRING_ATEXPIRY_NUMUNITS
ECRECURRING_ATEXPIRY_UNITS
ECRECURRING_EXPIRY_HOUR
ECRECURRING_LAST_CYCLE
ECRECURRING_MAP_PRODUCTS_ACTIVE
ECRECURRING_MAP_PRODUCTS_TO_EXPIRE
ECRECURRING_MAP_PRODUCT_BY_SID
ECRECURRING_MAP_REMINDERS_TO_EXPIRE
ECRECURRING_MAP_REMINDER_BY_RID
ECRECURRING_MAXCYCLES
ECRECURRING_MAXINTERVAL
ECRECURRING_NAMELEN
ECRECURRING_NORENEWAL
ECRECURRING_STATUS_ACTIVE
ECRECURRING_STATUS_EXPIRED
ECRECURRING_STATUS_RENEWED
ECRECURRING_UNLIMITED

Functions

Namesort iconDescription
ec_recurring_adjust_cycleAdjusts the cycles on a cycle-limited expiration entry. This function should be used rather than hard-coding in case the encoding method changes.
ec_recurring_blockImplementation of the hook_block().
ec_recurring_build_entryAdds both the product and reminder values that are used in the expirations table to the given node as $node->recurring['expiration_entries']. This function also sets the $node->recurring['prevpurchase'] to the schedule entry...
ec_recurring_cronImplementation of hook_cron().
ec_recurring_cron_settings
ec_recurring_ecommerceapiImplementation of hook_ecommerceapi.
ec_recurring_ec_transactionapiImplementation of hook_ec_transactionapi()
ec_recurring_expirations_show
ec_recurring_expiration_entry_validateValidates the entry given to ensure all fields are supplied and non-zero (except the status field, of course). If this function finds an error exit() is called. The purpose of this function is to prevent programmatic errors. Don't use this...
ec_recurring_expiration_mapExecutes the given function (map function) on each row of the query result of the selected query. The query to perform is identified by $mapid. This can either be one of the queries implemented in this function or one specified by the caller. In that...
ec_recurring_expiration_mapfn_insert_reminderImplementation of a schedule map function
ec_recurring_expiration_mapfn_update_reminderImplementation of a schedule map function
ec_recurring_feature_ec_checkout_validate_itemImplementation of e-Commerce hook_feature_ec_checkout_validate_item()
ec_recurring_feature_infoImplementation of hook_feature_info()
ec_recurring_feature_insertImplementation hook_feature_insert()
ec_recurring_feature_loadImplementation of hook_feature_load()
ec_recurring_feature_updateImplementation hook_feature_update()
ec_recurring_mail_resetImplementation of hook_mail_reset() from ec_mail module.
ec_recurring_mail_typesImplementation of hook_mail_types() from ec_mail module.
ec_recurring_mapfn_active_product_display
ec_recurring_mapfn_product_display
ec_recurring_mapfn_schedule_update_allUpdates expiry timestamp of the given product entry and all reminders associated with it have their start_time and expiry time updated.
ec_recurring_menuImplementation of hook_menu().
ec_recurring_nodeapiImplementation of hook_nodeapi().
ec_recurring_num_product_activeReturns the number of active product expiration entries in the system.
ec_recurring_on_expiryProcesses a product expiration for the product node given. This function expects the ec_recurring_expiration row to be in the expired_schedule member of the given node.
ec_recurring_permImplementation of hook_perm().
ec_recurring_process_expiriesProcesses expiry of entries in the ec_recurring_expiration table.
ec_recurring_product_allowed_in_cartThis function checks that it is the first entry of that product being added to the cart. It'll return FALSE if the product has already been added.
ec_recurring_product_delete
ec_recurring_product_form_alterImplementation of hook_product_form_alter(). TODO: test change to hook_product_form_alter.
ec_recurring_product_get_expiryReturns the expiry date for the given product version and transaction.
ec_recurring_product_has_unexpiredReturns the number of unexpired products for the given node version.
ec_recurring_product_paymentCreates expiration entries for the product and reminders. This function must be called only when the payment status is set to paid. Usually this is called in an 'on payment completion' handler.
ec_recurring_product_saveUpdates an association between a product version and a recurring schedule
ec_recurring_product_validateValidates the node given. If errors are encountered they are flagged via form_set_error().
ec_recurring_recurringapiImplementation of hook_recurringapi().
ec_recurring_reminder_deleteDeletes the reminder given by rid. Also deletes reminders already scheduled in ec_reminder_schedule including those that have expired (been sent).
ec_recurring_reminder_delete_form
ec_recurring_reminder_delete_form_submit
ec_recurring_renewals_remaining
ec_recurring_renew_itemRenew the node given for the user given.
ec_recurring_rowfn_schedules
ec_recurring_save_reminder
ec_recurring_schedule_delete_form
ec_recurring_schedule_delete_form_submit
ec_recurring_schedule_formForm API code for displaying the schedule add/update form.
ec_recurring_schedule_form_submitCommits schedule fields supplied by the user.
ec_recurring_schedule_form_validateValidates the schedule add/edit form.
ec_recurring_schedule_has_unexpiredReturns the number of unexpired products for the given schedule.
ec_recurring_set_cycleSets the correct value for the cycle.
ec_recurring_start_timeThis function returns the start_time for a renewed entry.
ec_recurring_tableDisplays a table of schedules currently stored in the system.
ec_recurring_token_list
ec_recurring_token_values
ec_recurring_ui_productsList of recurring products on the system and include links to manipulate them
ec_recurring_ui_products_active
ec_recurring_unit_stringReturns the string representation of the given unit. The return value is localized. Providing the count is optional with the default to be one. The count is only returned in the string when $show_number is TRUE.
ec_recurring_userImplementation of hook_user().
ec_recurring_user_subscriptionsThe correct format for renewal links is: cart/renew/nid/txnid
theme_recurring_dateThemes the timestamp to give a human readable date.
theme_recurring_scheduleReturns the HTML representation of the recurring schedule supplied. This function distinguishes between an expiry schedule and reminder schedule by the presence of the 'cycles' key. Expiry schedules have a cycles key and reminder schedules...
theme_recurring_statusReturns human readable text for expiration status stored in ec_recurring_expiration.
_ec_recurring_expirations_update_allUpdates all entries in ec_recurring_expiration with the given schedule ID.
_ec_recurring_expiration_updateUpdates the given entry into the ec_recurring_expiration table
_ec_recurring_get_default_valueReturns the default value for the given field depending on the conditions given.
_ec_recurring_get_sid
_ec_recurring_get_units
_ec_recurring_int_to_hour
_ec_recurring_is_schedule_selected
_ec_recurring_load_scheduleLoads the given schedule from the database. This function returns reminder email schedules as well. The function returns 'expiry' timestamps for the schedule and reminder email schedules.
_ec_recurring_load_schedule_vidLoads the expiry schedule attached to the product with version ID $vid.
_ec_recurring_schedule_deleteDelete schedule
_ec_recurring_schedule_saveSaves the given schedule to ec_recurring schedule table.
__ec_recurring_reminder_formIts just a virtual function because D5 dont support include files. Its useless on D6.
__ec_recurring_reminder_form_submitIts just a virtual function because D5 dont support include files. Its useless on D6.
__ec_recurring_reminder_form_validateIts just a virtual function because D5 dont support include files. Its useless on D6.