new version including a few important fixes

This commit is contained in:
espie 2008-10-25 14:27:42 +00:00
parent 9b26028c69
commit 437ae693b2
6 changed files with 36 additions and 74 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.8 2008/09/24 15:30:54 espie Exp $
# $OpenBSD: Makefile,v 1.9 2008/10/25 14:27:42 espie Exp $
COMMENT = webform
DISTNAME = webform-5.x-2.1.3
PKGNAME = drupal5-webform-2.1.3p0
DISTNAME = webform-5.x-2.3
PKGNAME = drupal5-webform-2.3
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (drupal5/webform-5.x-2.1.3.tar.gz) = hIViyEiAM9wPJQSIe1dnPg==
RMD160 (drupal5/webform-5.x-2.1.3.tar.gz) = JJ+wAkVEdUSwhP2rvO7bigMjHZ0=
SHA1 (drupal5/webform-5.x-2.1.3.tar.gz) = BjoctyPFH7g7/Jh9Z7C+Yv6Hcmk=
SHA256 (drupal5/webform-5.x-2.1.3.tar.gz) = 54iKoZVSq5S7/fCXvf8+jrgTiE3haUDC22xYpWnabzw=
SIZE (drupal5/webform-5.x-2.1.3.tar.gz) = 169386
MD5 (drupal5/webform-5.x-2.3.tar.gz) = /+RR/WJjCNUZnXKI/LtZAQ==
RMD160 (drupal5/webform-5.x-2.3.tar.gz) = UWBgvpAArBZCxzywfW4GCbvMP5k=
SHA1 (drupal5/webform-5.x-2.3.tar.gz) = cCsFD2qCJqCGlHNyLNm772mj1cA=
SHA256 (drupal5/webform-5.x-2.3.tar.gz) = ONiss3fkhCX8SWl76fAQIB/2UGW45QuDzgWIE7G19LY=
SIZE (drupal5/webform-5.x-2.3.tar.gz) = 177239

View File

@ -1,56 +1,19 @@
$OpenBSD: patch-components_grid_inc,v 1.2 2008/09/24 15:30:54 espie Exp $
--- components/grid.inc.orig Wed Sep 24 17:17:29 2008
+++ components/grid.inc Wed Sep 24 17:17:36 2008
@@ -63,10 +63,26 @@ function _webform_render_grid($component, $random = tr
$options = _webform_grid_options($component['extra']['options']);
if ($component['extra']['optrand'] && $random) {
- shuffle($options);
+ // This maneuver shuffles the array keys, then uses them as
+ // the basis for ordering the options.
+ $aux = array();
+ $keys = array_keys($options);
+ shuffle($keys);
+ foreach($keys as $key) {
+ $aux[$key] = $options[$key];
+ unset($options[$key]);
+ }
+ $options = $aux;
}
if ($component['extra']['qrand'] && $random) {
- shuffle($questions);
+ $aux = array();
+ $keys = array_keys($questions);
+ shuffle($keys);
+ foreach($keys as $key) {
+ $aux[$key] = $questions[$key];
+ unset($questions[$key]);
+ }
+ $questions = $aux;
}
foreach ($questions as $question) {
if ($question != '') {
@@ -119,7 +135,8 @@ function _webform_submission_display_grid($data, $comp
* Nothing
**/
function _webform_submit_grid(&$data, $component) {
- $options = drupal_map_assoc(array_flip(_webform_select_options($component['extra']['items'])));
+ $options = drupal_map_assoc(array_flip(_webform_select_options($component['extra']['options'])));
+ $questions = drupal_map_assoc(array_flip(_webform_select_options($component['extra']['questions'])));
if (is_array($data)) {
foreach ($data as $key => $value) {
@@ -131,6 +148,13 @@ function _webform_submit_grid(&$data, $component) {
elseif (!empty($data)) {
$data = $options[$data];
}
+
+ // Put the form in the original option order before saving.
+ $order = $questions;
+ foreach ($data as $key => $value) {
+ $order[$key] = $value;
+ }
+ $data = $order;
}
/**
* Format the output of emailed data for this component.
$OpenBSD: patch-components_grid_inc,v 1.3 2008/10/25 14:27:42 espie Exp $
--- components/grid.inc.orig Sat Oct 25 15:47:03 2008
+++ components/grid.inc Sat Oct 25 15:48:17 2008
@@ -41,6 +41,7 @@ function _webform_edit_grid($currfield) {
'#rows' => 5,
'#weight' => -3,
'#required' => TRUE,
+ '#noMCE' => TRUE,
);
$edit_fields['extra']['questions'] = array(
'#type' => 'textarea',
@@ -51,6 +52,7 @@ function _webform_edit_grid($currfield) {
'#rows' => 5,
'#weight' => -2,
'#required' => TRUE,
+ '#noMCE' => TRUE,
);
$edit_fields['extra']['optrand'] = array(
'#type' => 'checkbox',

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-components_select_inc,v 1.1 2008/02/17 14:34:14 espie Exp $
--- components/select.inc.orig Sun Feb 10 07:26:40 2008
+++ components/select.inc Sun Feb 17 15:31:57 2008
@@ -20,6 +20,7 @@ function _webform_edit_select($currfield) {
$OpenBSD: patch-components_select_inc,v 1.2 2008/10/25 14:27:42 espie Exp $
--- components/select.inc.orig Sat Oct 25 15:48:23 2008
+++ components/select.inc Sat Oct 25 15:48:41 2008
@@ -43,6 +43,7 @@ function _webform_edit_select($currfield) {
'#rows' => 5,
'#weight' => -2,
'#required' => TRUE,

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-webform_components_inc,v 1.1 2008/09/24 15:30:54 espie Exp $
--- webform_components.inc.orig Wed Sep 24 17:13:36 2008
+++ webform_components.inc Wed Sep 24 17:13:49 2008
$OpenBSD: patch-webform_components_inc,v 1.2 2008/10/25 14:27:42 espie Exp $
--- webform_components.inc.orig Sat Oct 25 15:48:56 2008
+++ webform_components.inc Sat Oct 25 15:49:13 2008
@@ -284,7 +284,7 @@ function webform_component_edit_form(&$node, $componen
'#default_value' => $component['name'],
'#title' => t("Label"),

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.4 2008/07/10 14:21:38 espie Exp $
@comment $OpenBSD: PLIST,v 1.5 2008/10/25 14:27:42 espie Exp $
@owner ${DRUPAL_OWNER}
@group ${DRUPAL_GROUP}
${DRUPAL_MODS}/webform/
@ -13,12 +13,10 @@ ${DRUPAL_MODS}/webform/components/email.inc
${DRUPAL_MODS}/webform/components/fieldset.inc
${DRUPAL_MODS}/webform/components/file.inc
${DRUPAL_MODS}/webform/components/grid.inc
@comment ${DRUPAL_MODS}/webform/components/grid.inc.orig
${DRUPAL_MODS}/webform/components/hidden.inc
${DRUPAL_MODS}/webform/components/markup.inc
${DRUPAL_MODS}/webform/components/pagebreak.inc
${DRUPAL_MODS}/webform/components/select.inc
@comment ${DRUPAL_MODS}/webform/components/select.inc.orig
${DRUPAL_MODS}/webform/components/textarea.inc
${DRUPAL_MODS}/webform/components/textfield.inc
${DRUPAL_MODS}/webform/components/time.inc
@ -41,5 +39,6 @@ ${DRUPAL_MODS}/webform/webform.install
${DRUPAL_MODS}/webform/webform.js
${DRUPAL_MODS}/webform/webform.module
${DRUPAL_MODS}/webform/webform_components.inc
${DRUPAL_MODS}/webform/webform_export.inc
${DRUPAL_MODS}/webform/webform_report.inc
${DRUPAL_MODS}/webform/webform_submissions.inc