Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

3.0 compat continuation #37

Merged
merged 13 commits into from

2 participants

@stojg
Owner

There are still outstanding issues and not everything has been thoroughly tested, but these changes should at least get the userforms module going.

Notice 1: I could have rebased all changes into one commit, but they are pretty random.
Notice 2: The submission tab will show all submission until a core framework issue has been solved involving the PaginatedList.

@wilr
Owner

@stojg I see that the PaginatedList has been solved, want to reenable that functionality

@stojg
Owner

Yup, I'll rebase this tomorrow and test it out.

@stojg
Owner

I've update this with
1. Enabling the PaginatedList and a quick hack to get the pagination working.
2. A submitted file could not be downloaded
3. Adding a .gitignore

@wilr
Owner

Good effort, any known issues still outstanding for this pull request? I'll fetch and test it out tonight but let me know if this is still another work in progress :)

@stojg
Owner

No bigger ones. The navigation and the submission page looks a bit ugly. There are some weird behavior when reloading a page and suddently the javascript Ajax events stops working. If clicking to the page via a site tree it works fine.

@stojg
Owner

The javascript could probably use some love, since I'm not really fluid with the power of entwine and how to use it properly, but it's more of refactoring issue.

@wilr wilr merged commit 9d9db9b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
6 UPGRADE.md
@@ -0,0 +1,6 @@
+# Upgrade to SilverStripe 3.0 compatible version
+
+## EditableCountryDropdownField
+
+EditableCountryDropdownField is gone since the CountryDropdownField and GeoIP code has been removed from the SS framework.
+
View
22 code/formfields/SubmittedFormReportField.php
@@ -18,23 +18,20 @@ public function Field($properties = array()) {
*
* @return PaginatedList
*/
- public function getSubmissions($start = 0) {
+ public function getSubmissions($page = 1) {
$record = $this->form->getRecord();
$submissions = $record->getComponents('Submissions', null, "\"Created\" DESC");
- $query = DB::query(sprintf("
- SELECT COUNT(*) AS \"CountRows\"
- FROM \"SubmittedForm\"
- WHERE \"ParentID\" = '%d'", $record->ID
- ));
-
- foreach($query as $r) $totalCount = $r['CountRows'];
+ $query = DB::query(sprintf("SELECT COUNT(*) AS \"CountRows\" FROM \"SubmittedForm\" WHERE \"ParentID\" = '%d'", $record->ID));
+ $totalCount = 0;
+ foreach($query as $r) {
+ $totalCount = $r['CountRows'];
+ }
$list = new PaginatedList($submissions);
- $list->setPageStart($start);
+ $list->setCurrentPage($page);
$list->setPageLength(10);
$list->setTotalItems($totalCount);
-
return $list;
}
@@ -42,10 +39,9 @@ public function getSubmissions($start = 0) {
* @return string
*/
public function getMoreSubmissions() {
- $start = ($start = $this->request->getVar('start')) ? (int) $start : 0;
-
+ $page = ($page = $this->request->getVar('page')) ? (int)$page : 1;
return $this->customise(new ArrayData(array(
- 'Submissions' => $this->getSubmissions($start)
+ 'Submissions' => $this->getSubmissions($page)
)))->renderWith(array('SubmittedFormReportField'));
}
View
14 code/model/UserDefinedForm.php
@@ -660,7 +660,7 @@ public function process($data, $form) {
}
if(Session::get("FormInfo.{$form->FormName()}.errors")){
- Director::redirectBack();
+ Controller::curr()->redirectBack();
return;
}
@@ -701,8 +701,14 @@ public function process($data, $form) {
$upload = new Upload();
$file = new File();
$file->ShowInSearch = 0;
-
- $upload->loadIntoFile($_FILES[$field->Name], $file);
+ try {
+ $upload->loadIntoFile($_FILES[$field->Name], $file);
+ } catch( ValidationException $e ) {
+ $validationResult = $e->getResult();
+ $form->addErrorMessage($field->Name, $validationResult->message(), 'bad');
+ Controller::curr()->redirectBack();
+ return;
+ }
// write file to form field
$submittedField->UploadedFileID = $file->ID;
@@ -734,7 +740,7 @@ public function process($data, $form) {
if($attachments){
foreach($attachments as $file){
if($file->ID != 0) {
- $email->attachFile($file->Filename,$file->Filename, HTTP::getMimeType($file->Filename));
+ $email->attachFile($file->Filename, $file->Filename, HTTP::get_mime_type($file->Filename));
}
}
}
View
28 code/model/formfields/EditableCountryDropdownField.php
@@ -1,28 +0,0 @@
-<?php
-
-/**
- * A dropdown field which allows the user to select a country
- *
- * @package userforms
- */
-class EditableCountryDropdownField extends EditableFormField {
-
- static $singular_name = 'Country Dropdown';
-
- static $plural_name = 'Country Dropdowns';
-
- public function getFormField() {
- return new CountryDropdownField($this->Name, $this->Title);
- }
-
- public function getValueFromData($data) {
- if(isset($data[$this->Name])) {
-
- return Geoip::countryCode2name($data[$this->Name]);
- }
- }
-
- public function getIcon() {
- return 'userforms/images/editabledropdown.png';
- }
-}
View
29 code/model/formfields/EditableDateField.php
@@ -33,33 +33,14 @@ public function populateFromPostData($data) {
}
/**
- * Return the form field.
+ * Return the form field
*
- * @todo Make a jQuery safe form field. The current CalendarDropDown
- * breaks on the front end.
*/
public function getFormField() {
- // scripts for jquery date picker
- Requirements::javascript(THIRDPARTY_DIR .'/jquery-ui/jquery.ui.core.js');
- Requirements::javascript(THIRDPARTY_DIR .'/jquery-ui/jquery.ui.datepicker.js');
-
- $dateFormat = DateField_View_JQuery::convert_iso_to_jquery_format(i18n::get_date_format());
-
- Requirements::customScript(<<<JS
- (function(jQuery) {
- $(document).ready(function() {
- $('input[name^=EditableDateField]').attr('autocomplete', 'off').datepicker({ dateFormat: '$dateFormat' });
- });
- })(jQuery);
-JS
-, 'UserFormsDate');
-
- // css for jquery date picker
- Requirements::css(THIRDPARTY_DIR .'/jquery-ui-themes/smoothness/jquery-ui-1.8rc3.custom.css');
-
- $default = ($this->getSetting('DefaultToToday')) ? date('d/m/Y') : $this->Default;
-
- return new DateField( $this->Name, $this->Title, $default);
+ $defaultValue = ($this->getSetting('DefaultToToday')) ? date('Y-m-d') : $this->Default;
+ $field = new DateField( $this->Name, $this->Title, $defaultValue);
+ $field->setConfig('showcalendar', true);
+ return $field;
}
/**
View
4 code/model/formfields/EditableMemberListField.php
@@ -15,7 +15,7 @@ public function getFieldConfiguration() {
$groupID = ($this->getSetting('GroupID')) ? $this->getSetting('GroupID') : 0;
$groups = DataObject::get("Group");
- if($groups) $groups = $groups->toDropdownMap('ID', 'Title');
+ if($groups) $groups = $groups->map('ID', 'Title');
$fields = new FieldList(
new DropdownField("Fields[$this->ID][CustomSettings][GroupID]", _t('EditableFormField.GROUP', 'Group'), $groups, $groupID)
@@ -26,7 +26,7 @@ public function getFieldConfiguration() {
public function getFormField() {
if ($this->getSetting('GroupID')) {
- $members = Member::mapInGroups($this->getSetting('GroupID'));
+ $members = Member::map_in_groups($this->getSetting('GroupID'));
return new DropdownField($this->Name, $this->Title, $members);
}
View
16 code/model/submissions/SubmittedFileField.php
@@ -19,11 +19,12 @@ class SubmittedFileField extends SubmittedFormField {
* @return string
*/
public function getFormattedValue() {
+ $name = $this->getName();
$link = $this->getLink();
$title = _t('SubmittedFileField.DOWNLOADFILE', 'Download File');
if($link) {
- return sprintf('<a href="%s">%s</a>', $link, $title);
+ return sprintf('%s - <a href="%s" target="_blank">%s</a>', $name, $link, $title);
}
return false;
@@ -49,5 +50,16 @@ public function getLink() {
return $this->UploadedFile()->URL;
}
}
- }
+ }
+
+ /**
+ * Return the name of the file, if present
+ *
+ * @return string
+ */
+ public function getName() {
+ if($this->UploadedFile()) {
+ return $this->UploadedFile()->Name;
+ }
+ }
}
View
6 code/model/submissions/SubmittedForm.php
@@ -7,15 +7,15 @@
class SubmittedForm extends DataObject {
- static $has_one = array(
+ public static $has_one = array(
"SubmittedBy" => "Member",
"Parent" => "UserDefinedForm",
);
- static $has_many = array(
+ public static $has_many = array(
"Values" => "SubmittedFormField"
);
-
+
/**
* Before we delete this form make sure we delete all the
* field values so that we don't leave old data round
View
5 css/FieldEditor.css
@@ -10,7 +10,6 @@
border: 1px solid #ddd;
background: #f4f4f4;
overflow: hidden;
- padding: 4px 0;
width: 100%;
}
.MenuHolder h2 {
@@ -21,13 +20,13 @@
.MenuHolder select {
float: left;
width: 240px;
- margin: 7px 0 0 8px;
+ margin: 18px 0 0 8px;
font-size: 11px;
}
.MenuHolder .action {
float: left;
- margin: 7px 0 0 4px;
+ margin: 14px 0 0 4px;
font-size: 11px;
}
View
405 javascript/UserForm.js
@@ -100,62 +100,54 @@
userforms.update();
- /*--------------------- SUBMISSIONS ------------------------ */
-
- /**
- * Delete a given Submission from the form
- */
- $("#userforms-submissions .deleteSubmission").live('click', function(event) {
- event.preventDefault();
+ $.entwine('udf', function($){
- var deletedSubmission = $(this);
- $.post($(this).attr('href'), function(data) {
- deletedSubmission.parents('div.userform-submission').fadeOut();
+ /*--------------------- SUBMISSIONS ------------------------ */
+
+ /**
+ * Delete a given Submission from the form
+ */
+ $("#userforms-submissions .deleteSubmission").live('click', function(event) {
+ event.preventDefault();
+ var deletedSubmission = $(this);
+ $.post($(this).attr('href'), function(data) {
+ deletedSubmission.parents('div.userform-submission').slideUp(function(){$(this).remove()});
+ });
});
- return false;
- });
-
- /**
- * Delete all submissions and fade them out if successful
- */
- $("#userforms-submissions .deleteAllSubmissions").live('click', function(event) {
- event.preventDefault();
-
- if(!confirm(userforms.message('CONFIRM_DELETE_ALL_SUBMISSIONS'))) {
- return false;
- }
+ /**
+ * Delete all submissions and fade them out if successful
+ */
+ $("#userforms-submissions .deleteAllSubmissions").live('click', function(event) {
+ event.preventDefault();
+ if(!confirm(userforms.message('CONFIRM_DELETE_ALL_SUBMISSIONS'))) {
+ return;
+ }
+ var self = this;
+ $.post($(this).attr('href'), function(data) {
+ $(self).parents('#userforms-submissions').children().slideUp(function(){$(this).remove()})
+ });
- var self = this;
- $.post($(this).attr('href'), function(data) {
- $(self).parents('#userforms-submissions').children().fadeOut();
});
-
- return false;
- });
-
- /*-------------------- FIELD EDITOR ----------------------- */
-
- /**
- * Create a new instance of a field in the current form
- * area. the type information should all be on this object
- */
-
- $.entwine('udf', function($){
+
+ /*-------------------- FIELD EDITOR ----------------------- */
+
+ /**
+ * Create a new instance of a field in the current form
+ * area. the type information should all be on this object
+ */
$('div.FieldEditor .MenuHolder .action').entwine({
onclick: function(e) {
+ e.preventDefault();
if($("#Fields").hasClass('readonly')) {
- e.preventDefault();
return;
}
- statusMessage(userforms.message('ADDING_FIELD'));
// variables
var $form = $("#Form_EditForm");
var length = $(".FieldInfo").length + 1;
- var securityID = ($("#SecurityID").length > 0) ? '&SecurityID='+$("#SecurityID").attr("value") : '';
var fieldType = $(this).siblings("select").val();
- var formData = $form.serialize()+'NewID='+ length +"&Type="+ fieldType + securityID;
+ var formData = $form.serialize()+'NewID='+ length +"&Type="+ fieldType;
var $fieldEditor = $(this.closest('.FieldEditor'));
// Due to some very weird behaviout of jquery.metadata, the url have to be double quoted
var addURL = $fieldEditor.attr('data-add-url').substr(1,$fieldEditor.attr('data-add-url').length-2);
@@ -174,184 +166,207 @@
alert(ss.i18n._t('GRIDFIELD.ERRORINTRANSACTION', 'An error occured while fetching data from the server\n Please try again later.'));
}
});
- e.preventDefault();
$("#Fields_fields").sortable('refresh');
}
});
- });
-
- /**
- * Upon renaming a field we should go through and rename all the
- * fields in the select fields to use this new field title. We can
- * just worry about the title text - don't mess around with the keys
- */
- $('.EditableFormField .fieldInfo .text').live('change', function() {
- var value = $(this).val();
- var name = $(this).parents("li").attr("id").split(' ');
- $("#Fields_fields select.fieldOption option").each(function(i, domElement) {
- if($(domElement).val() === name[2]) {
- $(domElement).text(value);
+ /**
+ * Delete a field from the user defined form
+ */
+ $(".EditableFormField .delete").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+
+ var text = $(this).parents("li").find(".fieldInfo .text").val();
+
+ // Remove all the rules with relate to this field
+ $("#Fields_fields .customRules select.fieldOption option").each(function(i, element) {
+ if($(element).text() === text) {
+ // check to see if this is selected. If it is then just remove the whole rule
+ if($(element).parent('select.customRuleField').val() === $(element).val()) {
+ $(element).parents('li.customRule').remove();
+ } else {
+ // otherwise remove the option
+ $(element).remove();
+ }
+ }
+ });
+ $(this).parents(".EditableFormField").slideUp(function(){$(this).remove()})
}
});
- });
-
- /**
- * Show the more options popdown. Or hide it if we
- * currently have it open
- */
- $(".EditableFormField .moreOptions").live('click',function() {
- var parentID = $(this).parents(".EditableFormField");
- if(parentID) {
- var extraOptions = parentID.children(".extraOptions");
- if(extraOptions) {
- if(extraOptions.hasClass('hidden')) {
- $(this).html(userforms.message('HIDE_OPTIONS'));
- $(this).addClass("showing");
- extraOptions.removeClass('hidden').show();
- }
- else {
- $(this).html(userforms.message('SHOW_OPTIONS'));
- $(this).removeClass("showing");
- extraOptions.addClass('hidden').hide();
- }
+
+ /**
+ * Upon renaming a field we should go through and rename all the
+ * fields in the select fields to use this new field title. We can
+ * just worry about the title text - don't mess around with the keys
+ */
+ $('.EditableFormField .fieldInfo .text').entwine({
+ onchange: function(e) {
+ var value = $(this).val();
+ var name = $(this).parents("li").attr("id").split(' ');
+ $("#Fields_fields select.fieldOption option").each(function(i, domElement) {
+ if($(domElement).val() === name[2]) {
+ $(domElement).text(value);
+ }
+ });
}
- }
- return false;
- });
-
- /**
- * Delete a field from the user defined form
- */
- $(".EditableFormField .delete").live('click', function() {
- // remove all the rules with relate to this field
- var text = $(this).parents("li").find(".fieldInfo .text").val();
+ });
- $("#Fields_fields .customRules select.fieldOption option").each(function(i, ele) {
- if($(ele).text() === text) {
+ /**
+ * Show the more options popdown. Or hide it if we currently have it open
+ */
+ $(".EditableFormField .moreOptions").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+
+ var parent = $(this).parents(".EditableFormField");
+ if(!parent) {
+ return;
+ }
- // check to see if this is selected. If it is then just remove the whole rule
- if($(ele).parent('select.customRuleField').val() === $(ele).val()) {
- $(ele).parents('li.customRule').remove();
+ var extraOptions = parent.children(".extraOptions");
+ if(!extraOptions) {
+ return;
}
- else {
- // otherwise remove the option
- $(ele).remove();
+
+ if(extraOptions.hasClass('hidden')) {
+ $(this).addClass("showing");
+ $(this).html('Hide options');
+ extraOptions.removeClass('hidden');
+ } else {
+ $(this).removeClass("showing");
+ $(this).html('Show options');
+ extraOptions.addClass('hidden');
}
}
});
- $(this).parents(".EditableFormField").remove();
-
- return false;
- });
-
- /**
- * Add a suboption to a radio field or to a dropdown box
- * for example
- */
- $(".EditableFormField .addableOption").live('click', function() {
-
- // Give the user some feedback
- statusMessage(userforms.message('ADDING_OPTION'));
-
- // variables
- var options = $(this).parent("li");
- var action = $("#Form_EditForm").attr("action") + '/field/Fields/addoptionfield';
- var parent = $(this).attr("rel");
-
- // send ajax request to the page
- $.ajax({
- type: "GET",
- url: action,
- data: 'Parent='+ parent,
-
- // create a new field
- success: function(msg){
- options.before(msg);
- statusMessage(userforms.message('ADDED_OPTION'));
- },
-
- // error creating new field
- error: function(request, text, error) {
- statusMessage(userforms.message('ERROR_CREATING_OPTION'));
- }
+ /**
+ * Add a suboption to a radio field or to a dropdown box for example
+ */
+ $(".EditableFormField .addableOption").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+
+ // Give the user some feedback
+ statusMessage(userforms.message('ADDING_OPTION'));
+
+ // variables
+ var options = $(this).parent("li");
+ var action = $("#Form_EditForm").attr("action") + '/field/Fields/addoptionfield';
+ var parent = $(this).attr("rel");
+
+ // send ajax request to the page
+ $.ajax({
+ type: "GET",
+ url: action,
+ data: 'Parent='+ parent,
+
+ // create a new field
+ success: function(msg){
+ options.before(msg);
+ statusMessage(userforms.message('ADDED_OPTION'));
+ },
+
+ // error creating new field
+ error: function(request, text, error) {
+ statusMessage(userforms.message('ERROR_CREATING_OPTION'));
+ }
+ });
+
+ }
});
- return false;
- });
-
- /**
- * Delete a suboption such as an dropdown option or a
- * checkbox field
- */
- $(".EditableFormField .deleteOption").live('click', function() {
- // pass the deleted status onto the element
- $(this).parent("li").children("[type=text]").attr("value", "field-node-deleted");
- $(this).parent("li").hide();
-
- // Give the user some feedback
- statusMessage(userforms.message('REMOVED_OPTION'));
- return false;
- });
+ /**
+ * Delete a suboption such as an dropdown option or a
+ * checkbox field
+ */
+ $(".EditableFormField .deleteOption").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+
+ // pass the deleted status onto the element
+ $(this).parent("li").children("[type=text]").attr("value", "field-node-deleted");
+ $(this).parent("li").hide();
- /**
- * Custom Rules Interface
- */
- $("body").delegate("select.conditionOption", 'change', function() {
- var valueInput = $(this).siblings(".ruleValue");
-
- if($(this).val() && $(this).val() !== "IsBlank" && $(this).val() !== "IsNotBlank") {
- valueInput.removeClass("hidden");
- }
- else {
- valueInput.addClass("hidden");
- }
- });
-
- /**
- * Delete a custom rule
- */
- $(".customRules .deleteCondition").live('click', function() {
- $(this).parent("li").fadeOut().remove();
-
- return false;
- });
-
- /**
- * Adding a custom rule to a given form
- */
- $(".customRules .addCondition").live('click', function() {
- // Give the user some feedback
- statusMessage(userforms.message('ADDING_RULE'));
+ // Give the user some feedback
+ statusMessage(userforms.message('REMOVED_OPTION'));
+ }
+ });
- // get the fields li which to duplicate
- var currentRules = $(this).parent("li").parent("ul");
- var defaultRule = currentRules.children("li.hidden:first");
- var newRule = defaultRule.clone();
+ /**
+ * Custom Rules Interface
+ *
+ * Hides the input text field if the conditionOption is 'IsBlank' or 'IsNotBlank'
+ */
+ $("select.conditionOption").entwine({
+ onchange: function() {
+ var valueInput = $(this).siblings(".ruleValue");
+ if($(this).val() && $(this).val() !== "IsBlank" && $(this).val() !== "IsNotBlank") {
+ valueInput.removeClass("hidden");
+ } else {
+ valueInput.addClass("hidden");
+ }
+ }
+ });
- newRule.children(".customRuleField").each(function(i, domElement) {
- var currentName = domElement.name.split("][");
- currentName[3] = currentName[2];
- currentName[2] = currentRules.children().size() + 1;
- domElement.name = currentName.join("][");
+ /**
+ * Delete a custom rule
+ */
+ $(".customRules .deleteCondition").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+ $(this).parent("li").fadeOut().remove();
+ }
});
- // remove hidden tag
- newRule.removeClass("hidden");
-
- // update the fields dropdown
- newRule.children("select.fieldOption").empty();
+ /**
+ * Adding a custom rule to a given form
+ */
+ $(".customRules .addCondition").entwine({
+ onclick: function(e) {
+ e.preventDefault();
+
+ // Give the user some feedback
+ statusMessage(userforms.message('ADDING_RULE'));
+
+ // get the fields li which to duplicate
+ var currentRules = $(this).parent("li").parent("ul");
+ var defaultRule = currentRules.children("li.hidden:first");
+ var newRule = defaultRule.clone();
+
+ newRule.children(".customRuleField").each(function(i, domElement) {
+ var currentName = domElement.name.split("][");
+ currentName[3] = currentName[2];
+ currentName[2] = currentRules.children().size() + 1;
+ domElement.name = currentName.join("][");
+ });
+
+ // remove hidden tag
+ newRule.removeClass("hidden");
- $("#Fields_fields li.EditableFormField").each(function (i, domElement) {
- var name = $(domElement).attr("id").split(' ');
- newRule.children("select.fieldOption").append("<option value='"+ name[2] + "'>"+ $(domElement).find(".text").val() + "</option>");
+ // update the fields dropdown
+ newRule.children("select.fieldOption").empty();
+
+ $("#Fields_fields li.EditableFormField").each(function (i, domElement) {
+ var name = $(domElement).attr("id").split(' ');
+ newRule.children("select.fieldOption").append("<option value='"+ name[2] + "'>"+ $(domElement).find(".text").val() + "</option>");
+ });
+
+ // append to the list
+ currentRules.append(newRule);
+ }
});
- // append to the list
- currentRules.append(newRule);
-
- return false;
+ $('.userforms-submissions-pagination a').entwine({
+ onclick: function(e) {
+ e.preventDefault();
+ $.get($(this).attr('href'), function(data) {
+ $('#userforms-submissions').replaceWith(data);
+ });
+ this._super();
+ }
+ })
});
});
})(jQuery);
View
4 templates/EditableOption.ss
@@ -4,8 +4,8 @@
<input type="hidden" class="sortOptionHidden hidden" name="{$FieldName}[Sort]" value="$Sort" />
<% if canEdit %>
- <a href="$ID" class="deleteOption"><img src="$ModulePath(cms)/images/delete.gif" alt="<% _t('DELETE', 'Remove this option') %>" /></a>
+ <a href="$ID" class="deleteOption"><img src="$ModulePath(framework)/images/delete.gif" alt="<% _t('DELETE', 'Remove this option') %>" /></a>
<% else %>
- <img src="$ModulePath(cms)/images/locked.gif" alt="<% _t('LOCKED', 'These fields cannot be modified') %>" />
+ <img src="cms/images/locked.gif" alt="<% _t('LOCKED', 'These fields cannot be modified') %>" />
<% end_if %>
</li>
View
25 templates/FieldEditor.ss
@@ -10,20 +10,21 @@
<% end_control %>
</ul>
</div>
-
+
<% if canEdit %>
- <div class="MenuHolder">
- <h2><% _t('ADD', 'Add') %></h2>
-
- <select name="AddUserFormField" id="AddUserFormField">
- <option value=""><% _t('SELECTAFIELD', 'Select a Field') %></option>
+ <div class="MenuHolder">
+ <h2><% _t('ADD', 'Add') %></h2>
+
+ <select name="AddUserFormField" id="AddUserFormField">
+ <option value=""><% _t('SELECTAFIELD', 'Select a Field') %></option>
- <% control CreatableFields %>
- <option value="$ClassName">$Title</option>
- <% end_control %>
- </select>
+ <% control CreatableFields %>
+ <option value="$ClassName">$Title</option>
+ <% end_control %>
+ </select>
- <input type="submit" class="action" value="<% _t('ADD', 'Add') %>" />
- </div>
+ <input type="submit" class="action" value="<% _t('ADD', 'Add') %>" />
+ </div>
<% end_if %>
+
</div>
View
47 templates/SubmittedFormReportField.ss
@@ -8,33 +8,36 @@
<% loop Submissions %>
<div class="userform-submission">
- <h4><% _t('SUBMITTED', 'Submitted at') %> $Created.Nice. <a href="{$Top.Link}/deletesubmission/?id={$ID}" class="deleteSubmission"><% _t('DELETESUBMISSION', 'Delete Submission') %></a></h4>
-
- <table>
+ <h5><% _t('SUBMITTED', 'Submitted at') %> {$Created.Nice} <a href="{$Top.Link}/deletesubmission/?id={$ID}" class="deleteSubmission"><% _t('DELETESUBMISSION', 'Delete Submission') %></a></h5>
<% loop Values %>
- <tr>
- <td class="field">$Title</td>
- <td class="value">$FormattedValue</td>
- </tr>
+ <div id="Text_readonly" class="field readonly text">
+ <label class="left" for="Form_EditForm_Text_readonly">$Title</label>
+ <div class="middleColumn">
+ <span id="Form_EditForm_Text_readonly" class="readonly text">$FormattedValue</span>
+ </div>
+
+ </div>
<% end_loop %>
- </table>
</div>
<% end_loop %>
- <% if Submissions.MoreThanOnePage %>
- <div class="userforms-submissions-pagination">
-
- <% if Submissions.NotFirstPage %>
- <a class="prev" href="javascript:void(0)" onclick="jQuery('#userforms-submissions').parent().load(jQuery('base').get(0).href+'/{$Top.Link}/getMoreSubmissions/?start={$Submissions.PrevStart}');" title="View the previous page">Previous page</a>
- <% end_if %>
-
- <span>Viewing rows $Submissions.Start - $Submissions.StartPlusOffset of $Submissions.TotalCount rows</span>
-
- <% if Submissions.NotLastPage %>
- <a class="next" href="javascript:void(0)" onclick="jQuery('#userforms-submissions').parent().load(jQuery('base').get(0).href+'/{$Top.Link}/getMoreSubmissions/?start={$Submissions.NextStart}');" title="View the next page">Next page</a>
- <% end_if %>
- </div>
- <% end_if %>
+ <% if Submissions.MoreThanOnePage %>
+ <div class="userforms-submissions-pagination">
+ <span>Pages: </span>
+ <% loop Submissions.Pages() %>
+ <% if CurrentBool %>
+ $PageNum
+ <% else %>
+ <% if Link %>
+ <a href="{$Top.Link(getMoreSubmissions)}?page=$PageNum">$PageNum</a>
+ <% else %>
+ ...
+ <% end_if %>
+ <% end_if %>
+ <% end_loop %>
+ </div>
+ <% end_if %>
+
<% else %>
<p class="userforms-nosubmissions" <% if Submissions %>style="display: none"<% end_if %>><% _t('NOSUBMISSIONS', 'No Submissions') %></p>
<% end_if %>
Something went wrong with that request. Please try again.