summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSander Toonen2013-02-22 14:56:28 (GMT)
committer Sander Toonen2013-02-22 14:56:28 (GMT)
commitd37e638c1545ed33d909ff30ff3480b7b237b1a1 (patch)
treea855fddb73ebe5027449f4cdaad58e8875bfc27a
parent95b17a3d31ea22395398cee95b25f2df2719380b (diff)
Add configuration form for #1890700. Cleanup variables on uninstall.HEAD7.x-1.x
-rw-r--r--commerce_quotes.admin.inc18
-rw-r--r--commerce_quotes.install10
-rw-r--r--commerce_quotes.module16
-rw-r--r--commerce_quotes.views.inc15
4 files changed, 52 insertions, 7 deletions
diff --git a/commerce_quotes.admin.inc b/commerce_quotes.admin.inc
index f8fdce7..5234644 100644
--- a/commerce_quotes.admin.inc
+++ b/commerce_quotes.admin.inc
@@ -1,7 +1,7 @@
<?php
/**
* @file
- * Page callback and helper function for responding to quotation requests.
+ * Administrative callbacks and form builder functions for Commerce Quotes.
*/
/**
@@ -42,3 +42,19 @@ function commerce_quotes_edit_order_set_title() {
drupal_set_breadcrumb($breadcrumb);
}
+
+/**
+ * Commerce Stock admin form.
+ */
+function commerce_quotes_admin_form($form, &$form_state) {
+ $form = array();
+
+ $form['commerce_quotes_quote_from_cart'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Quote from cart'),
+ '#default_value' => variable_get('commerce_quotes_quote_from_cart', FALSE),
+ '#description' => t("Force users to request a quote from the cart page and prevent continuing to checkout."),
+ );
+
+ return system_settings_form($form);
+}
diff --git a/commerce_quotes.install b/commerce_quotes.install
new file mode 100644
index 0000000..4a873f9
--- /dev/null
+++ b/commerce_quotes.install
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @file
+ * Install file for the commerce_quotes module.
+ */
+
+function commerce_quotes_uninstall() {
+ variable_del('commerce_quotes_quote_from_cart');
+}
diff --git a/commerce_quotes.module b/commerce_quotes.module
index d051735..9e855bc 100644
--- a/commerce_quotes.module
+++ b/commerce_quotes.module
@@ -20,6 +20,10 @@ function commerce_quotes_permission() {
'title' => t('Send request'),
'description' => t('Request a quote during the checkout process.'),
),
+ 'commerce_quotes response' => array(
+ 'title' => t('Send response'),
+ 'description' => t('Response to a quote requestd.'),
+ ),
);
return $permissions;
@@ -38,6 +42,8 @@ function commerce_quotes_views_api() {
* Implements hook_menu().
*/
function commerce_quotes_menu() {
+ $items = array();
+
$items['quote/%commerce_order/edit'] = array(
'page callback' => 'commerce_quotes_edit_quote',
'page arguments' => array(1),
@@ -46,6 +52,16 @@ function commerce_quotes_menu() {
'file' => 'commerce_quotes.admin.inc',
);
+ $items['admin/commerce/config/quotes'] = array(
+ 'title' => 'Quotes',
+ 'description' => 'Configure quote workflow.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('commerce_quotes_admin_form'),
+ 'access arguments' => array('commerce_quotes administer'),
+ 'file' => 'commerce_quotes.admin.inc',
+ 'type' => MENU_NORMAL_ITEM,
+ );
+
return $items;
}
diff --git a/commerce_quotes.views.inc b/commerce_quotes.views.inc
index f0019f9..b1e556a 100644
--- a/commerce_quotes.views.inc
+++ b/commerce_quotes.views.inc
@@ -190,6 +190,7 @@ function commerce_quotes_views_default_views() {
$handler->display->display_options['filters']['status']['value'] = array(
'request_for_quotation' => 'request_for_quotation',
'quotation_response' => 'quotation_response',
+ 'canceled_quote' => 'canceled_quote',
);
/* Filter: Commerce order: Order number */
$handler->display->display_options['filters']['order_number']['id'] = 'order_number';
@@ -454,12 +455,14 @@ function commerce_quotes_views_default_views() {
$handler->display->display_options['arguments']['uid_1']['validate_options']['roles'] = array(
3 => '3',
);
- /* Filter: Commerce order: Order state */
- $handler->display->display_options['filters']['state']['id'] = 'state';
- $handler->display->display_options['filters']['state']['table'] = 'commerce_order';
- $handler->display->display_options['filters']['state']['field'] = 'state';
- $handler->display->display_options['filters']['state']['value'] = array(
- 'quote' => 'quote',
+ /* Filtercriterium: Commerce-bestelling: Bestelstatus */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'commerce_order';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = array(
+ 'request_for_quotation' => 'request_for_quotation',
+ 'quotation_response' => 'quotation_response',
+ 'canceled_quote' => 'canceled_quote',
);
/* Display: User quotes */