[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14474] fixing forms
From: |
Saul |
Subject: |
[Fmsystem-commits] [14474] fixing forms |
Date: |
Wed, 25 Nov 2015 00:16:59 +0000 |
Revision: 14474
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14474
Author: psaul
Date: 2015-11-25 00:16:59 +0000 (Wed, 25 Nov 2015)
Log Message:
-----------
fixing forms
Modified Paths:
--------------
branches/dev-syncromind/bookingfrontend/inc/class.uisystem_message.inc.php
branches/dev-syncromind/bookingfrontend/js/bookingfrontend/application.js
branches/dev-syncromind/bookingfrontend/js/bookingfrontend/booking.js
branches/dev-syncromind/bookingfrontend/js/bookingfrontend/event.js
branches/dev-syncromind/bookingfrontend/templates/base/application_edit.xsl
branches/dev-syncromind/bookingfrontend/templates/base/application_new.xsl
branches/dev-syncromind/bookingfrontend/templates/base/booking_edit.xsl
branches/dev-syncromind/bookingfrontend/templates/base/booking_massupdate.xsl
branches/dev-syncromind/bookingfrontend/templates/base/booking_new.xsl
branches/dev-syncromind/bookingfrontend/templates/base/event_edit.xsl
branches/dev-syncromind/bookingfrontend/templates/base/group_edit.xsl
branches/dev-syncromind/bookingfrontend/templates/base/organization_edit.xsl
branches/dev-syncromind/bookingfrontend/templates/base/system_message.xsl
Modified:
branches/dev-syncromind/bookingfrontend/inc/class.uisystem_message.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/inc/class.uisystem_message.inc.php
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/inc/class.uisystem_message.inc.php
2015-11-25 00:16:59 UTC (rev 14474)
@@ -60,9 +60,10 @@
$this->flash_form_errors($errors);
phpgwapi_jquery::init_ckeditor('field-message');
+
+ phpgwapi_jquery::formvalidator_generate(array('location', 'date',
'security', 'file'));
// $this->use_yui_editor();
self::render_template('system_message',
array('system_message' => $system_message));
}
}
-
Modified:
branches/dev-syncromind/bookingfrontend/js/bookingfrontend/application.js
===================================================================
--- branches/dev-syncromind/bookingfrontend/js/bookingfrontend/application.js
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/js/bookingfrontend/application.js
2015-11-25 00:16:59 UTC (rev 14474)
@@ -156,6 +156,22 @@
errorMessage: 'Number of participants is required',
errorMessageKey: ''
});
+
+ $.formUtils.addValidator({
+ name: 'application_resources',
+ validatorFunction: function(value, $el, config, language, $form) {
+ var n = 0;
+ $('#resources_container table
input[name="resources[]"]').each(function(){
+ if ($(this).is(':checked')) {
+ n++;
+ }
+ });
+ var v = (n > 0) ? true : false;
+ return v;
+ },
+ errorMessage: 'Please choose at least 1 resource',
+ errorMessageKey: 'application_resources'
+ });
$.formUtils.addValidator({
name: 'customer_identifier',
@@ -218,7 +234,7 @@
var oArgs = {menuaction: 'bookingfrontend.uiresource.index_json',
sort:'name', filter_building_id: building_id, sub_activity_id:
$("#field_activity").val()};
var url = phpGWLink('bookingfrontend/', oArgs, true);
var container = 'resources_container';
- var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'},{name:
'class', value: 'chkRegulations'},{name: 'data-validation', value:
'checkbox_group'},{name: 'data-validation-qty', value: 'min1'},{name:
'data-validation-error-msg', value: 'Please choose at least 1 resource'}]}],
value: 'id', checked: selection},{key: 'name', label: lang['Name']}, {key:
'type', label: lang['Resource Type']}];
+ var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'},{name:
'class', value: 'chkRegulations'}]}], value: 'id', checked: selection},{key:
'name', label: lang['Name']}, {key: 'type', label: lang['Resource Type']}];
populateTableResources(url, container, colDefsResources);
}
Modified: branches/dev-syncromind/bookingfrontend/js/bookingfrontend/booking.js
===================================================================
--- branches/dev-syncromind/bookingfrontend/js/bookingfrontend/booking.js
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/js/bookingfrontend/booking.js
2015-11-25 00:16:59 UTC (rev 14474)
@@ -105,6 +105,22 @@
errorMessage: 'Number of participants is required',
errorMessageKey: ''
});
+
+ $.formUtils.addValidator({
+ name: 'application_resources',
+ validatorFunction: function(value, $el, config, language, $form) {
+ var n = 0;
+ $('#resources_container table
input[name="resources[]"]').each(function(){
+ if ($(this).is(':checked')) {
+ n++;
+ }
+ });
+ var v = (n > 0) ? true : false;
+ return v;
+ },
+ errorMessage: 'Please choose at least 1 resource',
+ errorMessageKey: 'application_resources'
+ });
}
function populateTableChk (url, container, colDefs) {
@@ -114,7 +130,7 @@
function populateTableChkResources (building_id, selection) {
var url = phpGWLink('bookingfrontend/', {menuaction:
'bookingfrontend.uiresource.index_json', sort: 'name', filter_building_id:
building_id}, true);
var container = "resources_container";
- var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'},{name:
'data-validation', value: 'checkbox_group'},{name: 'data-validation-qty',
value: 'min1'},{name: 'data-validation-error-msg', value: 'Please choose at
least 1 resource'}]}], value: 'id', checked: selection},{key: 'name', label:
lang['Name']},{key: 'type', label: lang['Resource Type']}];
+ var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'}]}],
value: 'id', checked: selection},{key: 'name', label: lang['Name']},{key:
'type', label: lang['Resource Type']}];
populateTableChk(url, container, colDefsResources);
}
Modified: branches/dev-syncromind/bookingfrontend/js/bookingfrontend/event.js
===================================================================
--- branches/dev-syncromind/bookingfrontend/js/bookingfrontend/event.js
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/js/bookingfrontend/event.js
2015-11-25 00:16:59 UTC (rev 14474)
@@ -96,6 +96,22 @@
errorMessage: 'Number of participants is required',
errorMessageKey: ''
});
+
+ $.formUtils.addValidator({
+ name: 'application_resources',
+ validatorFunction: function(value, $el, config, language, $form) {
+ var n = 0;
+ $('#resources_container table
input[name="resources[]"]').each(function(){
+ if ($(this).is(':checked')) {
+ n++;
+ }
+ });
+ var v = (n > 0) ? true : false;
+ return v;
+ },
+ errorMessage: 'Please choose at least 1 resource',
+ errorMessageKey: 'application_resources'
+ });
$.formUtils.addValidator({
name: 'customer_identifier',
@@ -147,7 +163,7 @@
function populateTableChkResources (building_id, selection) {
var url = phpGWLink('bookingfrontend/', {menuaction:
'booking.uiresource.index', sort: 'name', filter_building_id: building_id},
true);
var container = 'resources_container';
- var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'},{name:
'data-validation', value: 'checkbox_group'},{name: 'data-validation-qty',
value: 'min1'},{name: 'data-validation-error-msg', value: 'Please choose at
least 1 resource'}]}], value: 'id', checked: selection},{key: 'name', label:
lang['Name']}, {key: 'type', label: lang['Resource Type']}];
+ var colDefsResources = [{label: '', object: [{type: 'input', attrs:
[{name: 'type', value: 'checkbox'},{name: 'name', value: 'resources[]'}]}],
value: 'id', checked: selection},{key: 'name', label: lang['Name']}, {key:
'type', label: lang['Resource Type']}];
populateTableChk(url, container, colDefsResources);
}
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/application_edit.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/application_edit.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/application_edit.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -41,6 +41,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -59,6 +62,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a description')" />
+ </xsl:attribute>
<xsl:value-of select="application/description"/>
</textarea>
</dd>
@@ -75,11 +81,20 @@
<div class="autocomplete">
<input id="field_building_id" name="building_id"
type="hidden">
<xsl:attribute name="value"><xsl:value-of
select="application/building_id"/></xsl:attribute>
+ <xsl:attribute name="data-validation">
+ <xsl:text>required</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building name')" />
+ </xsl:attribute>
</input>
<input id="field_building_name"
name="building_name" type="text">
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building name')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="application/building_name"/></xsl:attribute>
</input>
<div id="building_container"/>
@@ -87,6 +102,11 @@
</dd>
<dt><label for="field_resources"><xsl:value-of
select="php:function('lang', 'Resources')" /></label></dt>
<dd>
+ <input type="hidden"
data-validation="application_resources">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 resource')" />
+ </xsl:attribute>
+ </input>
<div id="resources_container"><span
class="select_first_text"><xsl:value-of select="php:function('lang', 'Select a
building first')" /></span></div>
</dd>
</dl>
@@ -112,7 +132,11 @@
<dl class="form-col">
<div class="heading">3. <xsl:value-of
select="php:function('lang', 'When?')" /></div>
<div id="dates-container">
- <input type="hidden"
data-validation="application_dates" />
+ <input type="hidden"
data-validation="application_dates">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Invalid date')" />
+ </xsl:attribute>
+ </input>
<xsl:for-each select="application/dates">
<xsl:variable name="index" select="position()-2"/>
<xsl:choose>
@@ -169,7 +193,11 @@
<div class="heading">4. <xsl:value-of
select="php:function('lang', 'Who?')" /></div>
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Target audience')" /></label></dt>
<dd>
- <input type="hidden" data-validation="target_audience"
/>
+ <input type="hidden" data-validation="target_audience">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id="audience">
<xsl:for-each select="audience">
<li>
@@ -186,7 +214,11 @@
</dd>
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Number of participants')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup" class="pure-table
pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
@@ -225,6 +257,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a contact name')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="application/contact_name"/></xsl:attribute>
</input>
</dd>
@@ -234,6 +269,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a contact email')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="application/contact_email"/></xsl:attribute>
</input>
</dd>
@@ -255,7 +293,11 @@
<dl class="form-col">
<div class="heading"><xsl:value-of
select="php:function('lang', 'Terms and conditions')" /></div>
<br/>
- <input type="hidden"
data-validation="regulations_documents" />
+ <input type="hidden"
data-validation="regulations_documents">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang', 'You
must accept to follow all terms and conditions of lease first')" />
+ </xsl:attribute>
+ </input>
<div id='regulation_documents'/>
</dl>
</div>
@@ -281,6 +323,6 @@
var initialSelection = <xsl:value-of
select="application/resources_json"/>;
var initialAudience = <xsl:value-of
select="application/audience_json"/>;
var lang = <xsl:value-of select="php:function('js_lang',
'From', 'To', 'Resource Type', 'Name', 'Accepted', 'Document', 'You must accept
to follow all terms and conditions of lease first.')"/>;
-
$('#field_customer_identifier_type').attr("data-validation","customer_identifier");
+
$('#field_customer_identifier_type').attr("data-validation","customer_identifier").attr("data-validation-error-msg",
"<xsl:value-of select="php:function('lang', 'Customer identifier type is
required')" />");
</script>
</xsl:template>
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/application_new.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/application_new.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/application_new.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -29,6 +29,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -54,6 +57,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a descripction')" />
+ </xsl:attribute>
<xsl:value-of select="application/description"/>
</textarea>
</dd>
@@ -79,7 +85,11 @@
</xsl:if-->
<dt><label for="field_activity"><xsl:value-of
select="php:function('lang', 'Estimated number of participants')"
/></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup" class="pure-table
pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
@@ -125,18 +135,32 @@
<div class="autocomplete">
<input id="field_building_id" name="building_id"
type="hidden">
<xsl:attribute name="value"><xsl:value-of
select="application/building_id"/></xsl:attribute>
+ <xsl:attribute name="data-validation">
+ <xsl:text>required</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building name')" />
+ </xsl:attribute>
</input>
<input id="field_building_name"
name="building_name" type="text">
<xsl:attribute name="value"><xsl:value-of
select="application/building_name"/></xsl:attribute>
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building name')" />
+ </xsl:attribute>
</input>
<div id="building_container"/>
</div>
</dd>
<dt><label for="field_resources"><xsl:value-of
select="php:function('lang', 'Resources')" /></label></dt>
<dd>
+ <input type="hidden"
data-validation="application_resources">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 resource')" />
+ </xsl:attribute>
+ </input>
<div id="resources_container"><span
class="select_first_text"><xsl:value-of select="php:function('lang', 'Select a
building first')" /></span></div>
</dd>
</dl>
@@ -150,7 +174,11 @@
</p>
</xsl:if-->
<div id="dates-container">
- <input type="hidden"
data-validation="application_dates" />
+ <input type="hidden"
data-validation="application_dates">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Invalid date')" />
+ </xsl:attribute>
+ </input>
<xsl:for-each select="application/dates">
<xsl:variable name="index" select="position()-2" />
<xsl:choose>
@@ -213,7 +241,11 @@
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Target audience')" /></label></dt>
<dd>
<!--div id="audience_container"> </div-->
- <input type="hidden" data-validation="target_audience"
/>
+ <input type="hidden" data-validation="target_audience">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id= "audience"
style="list-style:none;padding-left:10px;">
<xsl:for-each select="audience">
<li>
@@ -249,6 +281,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a contact name')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of
select="application/contact_name"/>
</xsl:attribute>
@@ -260,6 +295,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a contact email')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of
select="application/contact_email"/>
</xsl:attribute>
@@ -275,7 +313,7 @@
<xsl:text>contact_email</xsl:text>
</xsl:attribute>
<xsl:attribute name="data-validation-error-msg">
- <xsl:text>The e-mail addresses you entered do
not match</xsl:text>
+ <xsl:value-of select="php:function('lang',
'The e-mail addresses you entered do not match')" />
</xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="application/contact_email2"/></xsl:attribute>
</input>
@@ -308,7 +346,11 @@
<div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<dl class="form-col">
<div class="heading">8. <xsl:value-of
select="php:function('lang', 'Terms and conditions')" /></div>
- <input type="hidden"
data-validation="regulations_documents" />
+ <input type="hidden"
data-validation="regulations_documents">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang', 'You
must accept to follow all terms and conditions of lease first')" />
+ </xsl:attribute>
+ </input>
<xsl:if test="config/application_terms">
<p>
<xsl:value-of select="config/application_terms"/>
@@ -345,6 +387,6 @@
var initialSelection = <xsl:value-of
select="application/resources_json"/>;
var initialAudience = <xsl:value-of
select="application/audience_json"/>;
var lang = <xsl:value-of select="php:function('js_lang',
'From', 'To', 'Resource Type', 'Name', 'Accepted', 'Document', 'You must accept
to follow all terms and conditions of lease first.')"/>;
-
$('#field_customer_identifier_type').attr("data-validation","customer_identifier");
+
$('#field_customer_identifier_type').attr("data-validation","customer_identifier").attr("data-validation-error-msg",
"<xsl:value-of select="php:function('lang', 'Customer identifier type is
required')" />");
</script>
</xsl:template>
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/booking_edit.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/booking_edit.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/booking_edit.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -39,6 +39,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -63,6 +66,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building')" />
+ </xsl:attribute>
</input>
<xsl:value-of select="booking/building_name"/>
</dd>
@@ -70,6 +76,11 @@
<dl class="form-col">
<dt><label for="field_resources"><xsl:value-of
select="php:function('lang', 'Resources')"/></label></dt>
<dd>
+ <input type="hidden"
data-validation="application_resources">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 resource')" />
+ </xsl:attribute>
+ </input>
<div id="resources_container"><span
class="select_first_text"><xsl:value-of select="php:function('lang', 'Select a
building first')" /></span></div>
</dd>
</dl>
@@ -82,6 +93,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter an organization')" />
+ </xsl:attribute>
</input>
<xsl:value-of select="booking/organization_name"/>
</dd>
@@ -93,6 +107,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select a group')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', 'Select a group')"/></option>
<xsl:for-each select="groups">
<option value="{id}">
@@ -112,6 +129,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a from date')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="booking/from_" />
</xsl:attribute>
@@ -130,6 +150,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter an end date')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="booking/to_"/>
</xsl:attribute>
@@ -177,7 +200,11 @@
<dl class="form-col">
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Target audience')" /></label></dt>
<dd>
- <input type="hidden" data-validation="target_audience"
/>
+ <input type="hidden" data-validation="target_audience">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id="audience"
style="list-style:none;padding-left:10px;">
<xsl:for-each select="audience">
<li>
@@ -196,7 +223,11 @@
<dl class="form-col">
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Number of participants')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup" class="pure-table
pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/booking_massupdate.xsl
===================================================================
---
branches/dev-syncromind/bookingfrontend/templates/base/booking_massupdate.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++
branches/dev-syncromind/bookingfrontend/templates/base/booking_massupdate.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -55,6 +55,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option
value=""><xsl:value-of select="php:function('lang', '-- select an activity
--')" /></option>
<xsl:for-each
select="activities">
<option>
@@ -73,6 +76,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select a group')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', 'Select a group')"/></option>
<xsl:for-each
select="groups">
<option
value="{id}">
@@ -88,7 +94,11 @@
<dl class="form-col">
<dt><label
for="field_from"><xsl:value-of select="php:function('lang', 'Target audience')"
/></label></dt>
<dd>
- <input type="hidden"
data-validation="target_audience" />
+ <input type="hidden"
data-validation="target_audience">
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id="audience"
style="list-style:none;padding-left:10px;">
<xsl:for-each
select="audience">
<li>
@@ -107,7 +117,11 @@
<dl class="form-col">
<dt><label
for="field_from"><xsl:value-of select="php:function('lang', 'Number of
participants')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup"
class="pure-table pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
Modified: branches/dev-syncromind/bookingfrontend/templates/base/booking_new.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/booking_new.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/booking_new.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -20,6 +20,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -45,6 +48,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a building name')" />
+ </xsl:attribute>
</input>
<xsl:value-of select="booking/building_name" />
</dd>
@@ -52,6 +58,11 @@
<dl class="form-col">
<dt><label for="field_resources"><xsl:value-of
select="php:function('lang', 'Resources')"/></label></dt>
<dd>
+ <input type="hidden"
data-validation="application_resources">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 resource')" />
+ </xsl:attribute>
+ </input>
<div id="resources_container"><span
class="select_first_text"><xsl:value-of select="php:function('lang', 'Select a
building first')" /></span></div>
</dd>
</dl>
@@ -71,6 +82,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select a group')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', 'Select a group')"/></option>
<xsl:for-each select="groups">
<option value="{id}">
@@ -97,6 +111,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a from date')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="booking/from_" />
</xsl:attribute>
@@ -116,6 +133,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter an end date')" />
+ </xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="booking/to_" />
</xsl:attribute>
@@ -194,7 +214,11 @@
<dl class="form-col">
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Target audience')" /></label></dt>
<dd>
- <input type="hidden" data-validation="target_audience"
/>
+ <input type="hidden" data-validation="target_audience">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id="audience">
<xsl:for-each select="audience">
<li>
@@ -213,7 +237,11 @@
<dl class="form-col">
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Number of participants')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup" class="pure-table
pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
Modified: branches/dev-syncromind/bookingfrontend/templates/base/event_edit.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/event_edit.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/event_edit.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -18,6 +18,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -57,6 +60,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a description')" />
+ </xsl:attribute>
<xsl:value-of select="event/description"/>
</textarea>
</dd>
@@ -74,12 +80,18 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter a building')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="event/building_id"/></xsl:attribute>
</input>
<input id="field_building_name"
name="building_name" type="text">
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter a building')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="event/building_name"/></xsl:attribute>
</input>
<div id="building_container"/>
@@ -87,6 +99,11 @@
</dd>
<dt><label for="field_resources"><xsl:value-of
select="php:function('lang', 'Resources')" /></label></dt>
<dd>
+ <input type="hidden"
data-validation="application_resources">
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 resource')" />
+ </xsl:attribute>
+ </input>
<div id="resources_container"><span
class="select_first_text"><xsl:value-of select="php:function('lang', 'Select a
building first')" /></span></div>
</dd>
</dl>
@@ -107,6 +124,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a from date')" />
+ </xsl:attribute>
<xsl:if test="event/from_ != ''">
<xsl:attribute name="value"><xsl:value-of
select="event/from_2" /></xsl:attribute>
</xsl:if>
@@ -125,6 +145,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter an end date')" />
+ </xsl:attribute>
<xsl:if test="event/to_ != ''">
<xsl:attribute name="value"><xsl:value-of
select="event/to_2" /></xsl:attribute>
</xsl:if>
@@ -137,7 +160,11 @@
<dt class="heading"><xsl:value-of
select="php:function('lang', 'Who')" /></dt>
<dt><label><xsl:value-of select="php:function('lang',
'Target audience')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="target_audience" />
+ <input type="hidden"
data-validation="target_audience">
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please choose at least 1 target audience')" />
+ </xsl:attribute>
+ </input>
<ul id="audience">
<xsl:for-each select="audience">
<li>
@@ -154,7 +181,11 @@
</dd>
<dt><label for="field_from"><xsl:value-of
select="php:function('lang', 'Number of participants')" /></label></dt>
<dd>
- <input type="hidden"
data-validation="number_participants" />
+ <input type="hidden"
data-validation="number_participants">
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Number of participants is required')" />
+ </xsl:attribute>
+ </input>
<table id="agegroup" class="pure-table
pure-table-bordered">
<thead>
<tr><th/><th><xsl:value-of
select="php:function('lang', 'Male')" /></th>
@@ -195,6 +226,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a contact name')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="event/contact_name"/></xsl:attribute>
</input>
</dd>
@@ -216,6 +250,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a cost')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="event/cost"/></xsl:attribute>
</input>
</dd>
Modified: branches/dev-syncromind/bookingfrontend/templates/base/group_edit.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/group_edit.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/group_edit.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -23,7 +23,7 @@
<xsl:call-template name="msgbox"/>
<!--xsl:call-template name="yui_booking_i18n"/-->
- <form action="" method="POST">
+ <form action="" method="POST" id="form" name="form">
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-3">
<dl class="form-col">
@@ -33,6 +33,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a group')" />
+ </xsl:attribute>
</input>
</dd>
<dt><label for="field_shortname"><xsl:value-of
select="php:function('lang', 'Group shortname')" /></label></dt>
@@ -44,11 +47,17 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter an organization')" />
+ </xsl:attribute>
</input>
<input name="organization_name" type="text"
id="field_organization_name" value="{group/organization_name}">
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter an organization')" />
+ </xsl:attribute>
<xsl:if test="group/organization_id">
<xsl:attribute
name='disabled'>disabled</xsl:attribute>
</xsl:if>
@@ -217,4 +226,3 @@
]]>
</script-->
</xsl:template>
-
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/organization_edit.xsl
===================================================================
---
branches/dev-syncromind/bookingfrontend/templates/base/organization_edit.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++
branches/dev-syncromind/bookingfrontend/templates/base/organization_edit.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -35,7 +35,7 @@
<xsl:call-template name="msgbox"/>
<!--xsl:call-template name="yui_booking_i18n"/-->
- <form action="" method="POST">
+ <form action="" method="POST" id="form" name="form">
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-3">
<dl class="form-col">
@@ -46,6 +46,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter an organization')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="organization/name"/></xsl:attribute>
</input>
</xsl:if>
@@ -54,6 +57,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of
select="php:function('lang', 'Please enter an organization')" />
+ </xsl:attribute>
<xsl:attribute name="value"><xsl:value-of
select="organization/name"/></xsl:attribute>
</input>
</xsl:if>
@@ -193,6 +199,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute
name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please select an activity')" />
+ </xsl:attribute>
<option value=""><xsl:value-of
select="php:function('lang', '-- select an activity --')" /></option>
<xsl:for-each select="activities">
<option>
@@ -304,5 +313,3 @@
</div>
</xsl:template>
-
-
Modified:
branches/dev-syncromind/bookingfrontend/templates/base/system_message.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/system_message.xsl
2015-11-25 00:02:03 UTC (rev 14473)
+++ branches/dev-syncromind/bookingfrontend/templates/base/system_message.xsl
2015-11-25 00:16:59 UTC (rev 14474)
@@ -15,7 +15,7 @@
<xsl:call-template name="msgbox"/>
<!--xsl:call-template name="yui_booking_i18n"/-->
- <form action="" method="POST">
+ <form action="" method="POST" id="form" name="form">
<div class="pure-g">
<div class="pure-u-1">
<dl class="form-col">
@@ -25,6 +25,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a title')" />
+ </xsl:attribute>
</input>
</dd>
</dl>
@@ -40,6 +43,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a message')" />
+ </xsl:attribute>
<xsl:value-of select="system_message/message"/>
</textarea>
</dd>
@@ -56,6 +62,9 @@
<xsl:attribute name="data-validation">
<xsl:text>required</xsl:text>
</xsl:attribute>
+ <xsl:attribute name="data-validation-error-msg">
+ <xsl:value-of select="php:function('lang',
'Please enter a name')" />
+ </xsl:attribute>
</input>
</dd>
<dt><label for="field_phone"><xsl:value-of
select="php:function('lang', 'Phone')" /></label></dt>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14474] fixing forms,
Saul <=