[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10440] property: testing
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10440] property: testing |
Date: |
Fri, 02 Nov 2012 15:16:52 +0000 |
Revision: 10440
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10440
Author: sigurdne
Date: 2012-11-02 15:16:51 +0000 (Fri, 02 Nov 2012)
Log Message:
-----------
property: testing
Modified Paths:
--------------
trunk/property/inc/class.uicondition_survey.inc.php
trunk/property/js/portico/condition_survey_edit.js
Added Paths:
-----------
trunk/property/templates/base/condition_survey.xsl
Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-11-02 14:31:46 UTC
(rev 10439)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-11-02 15:16:51 UTC
(rev 10440)
@@ -285,6 +285,9 @@
phpgwapi_jquery::load_widget('core');
self::add_javascript('property', 'portico',
'condition_survey_edit.js');
+ self::add_javascript('phpgwapi', 'yui3',
'yui/yui-min.js');
+ self::add_javascript('phpgwapi', 'yui3',
'gallery-formvalidator.js/gallery-formvalidator-min.js');
+
self::render_template_xsl(array('condition_survey'),
$data);
}
Modified: trunk/property/js/portico/condition_survey_edit.js
===================================================================
--- trunk/property/js/portico/condition_survey_edit.js 2012-11-02 14:31:46 UTC
(rev 10439)
+++ trunk/property/js/portico/condition_survey_edit.js 2012-11-02 15:16:51 UTC
(rev 10440)
@@ -1,3 +1,56 @@
+ YUI().use(
+ 'gallery-formvalidator',
+ function(Y){
+
+var loader = new Y.Loader({
+ //Don't combine the files
+ combine: true,
+ //Ignore things that are already loaded (in this process)
+ ignoreRegistered: true,
+ //Set the base path
+ base: 'http://localhost/~sn5607/savannah_trunk/phpgwapi/js/yui3/',
+ //And the root
+ root: '.',
+ //Require your deps
+ require: [ 'node', 'yql' ]
+});
+
+var out = loader.resolve(true);
+
+//This will be an object of js and css files needed to complete this request.
+//console.log(out);
+
+
+ Y.on("domready", function () {
+
+ var form = new Y.Validator(
+ {
+ form:'basicExample1',
+ defaultIncorrectIndicatorCss:'validator',
+ defaultCorrectIndicatorCss:'indicator',
+ createCorrectIndicator:true,
+ createIncorrectIndicator:true
+ }
+ );
+
+ var form2 = new Y.Validator(
+ {
+ form:'basicExample2',
+ defaultIndicatorDomType:'DIV',
+ defaultIncorrectIndicatorCss:'validator',
+ defaultCorrectIndicatorCss:'indicator',
+ createCorrectIndicator:true,
+ createIncorrectIndicator:true,
+ correctIndicatorText:'<span
class="indicator"> </span>',
+ incorrectIndicatorText:'<span
class="validator"> </span>'
+ }
+ );
+
Y.Event.attach('click',function(){form.clear();},'#clearButton');
+
Y.Event.attach('click',function(){form2.clear();},'#clearButton2');
+ });
+ });
+
+
$(document).ready(function(){
$("#form").submit(function(e){
Added: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl
(rev 0)
+++ trunk/property/templates/base/condition_survey.xsl 2012-11-02 15:16:51 UTC
(rev 10440)
@@ -0,0 +1,229 @@
+<!-- $Id:$ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl">
+
+<!--<xsl:call-template name="yui_phpgw_i18n"/>-->
+<div class="yui-navset yui-navset-top">
+
+ <h1>
+ <xsl:value-of select="php:function('lang', 'condition
survey')" />
+ </h1>
+
+ <div id="project_details" class="content-wrp">
+ <div id="details">
+ <xsl:variable name="action_url">
+ <xsl:value-of
select="php:function('get_phpgw_link', '/index.php',
'menuaction:property.uicondition_survey.save')" />
+ </xsl:variable>
+ <form name="form" id="form" action="{$action_url}"
method="post" ENCTYPE="multipart/form-data">
+ <input type="hidden" name="id" value =
"{value_id}">
+ </input>
+ <dl class="proplist-col">
+ <dt>
+ <label for="name"><xsl:value-of
select="php:function('lang','title')" /></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable = 1">
+ <xsl:if
test="project/error_msg_array/name != ''">
+ <xsl:variable
name="error_msg"><xsl:value-of select="project/error_msg_array/name"
/></xsl:variable>
+ <div
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)"
/></div>
+ </xsl:if>
+ <div
style="margin-left:0; margin-bottom: 3px;" class="help_text line">Angi
startdato for aktiviteten</div>
+ <input class =
"required" type="text" name="name" id="name" value="{project/name}" size="100"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="project/name" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label
for="project_type"><xsl:value-of select="php:function('lang','Project_type')"
/></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable = 1">
+ <xsl:if
test="project/error_msg_array/project_type_id != ''">
+ <xsl:variable
name="error_msg"><xsl:value-of select="project/error_msg_array/project_type_id"
/></xsl:variable>
+ <div
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)"
/></div>
+ </xsl:if>
+ <div
style="margin-left:0; margin-bottom: 3px;" class="help_text line">Angi
startdato for aktiviteten</div>
+ <select class =
"required" id="project_type_id" name="project_type_id">
+
<xsl:apply-templates select="categories/options"/>
+ </select>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="project/project_type_label" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ <dt>
+ <label
for="description"><xsl:value-of select="php:function('lang', 'Description')"
/></label>
+ </dt>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="editable = 1">
+ <xsl:if
test="project/error_msg_array/description != ''">
+ <xsl:variable
name="error_msg"><xsl:value-of select="project/error_msg_array/description"
/></xsl:variable>
+ <div
class='input_error_msg'><xsl:value-of select="php:function('lang', $error_msg)"
/></div>
+ </xsl:if>
+ <div
style="margin-left:0; margin-bottom: 3px;" class="help_text line">Angi
startdato for aktiviteten</div>
+ <textarea
id="description" name="description" rows="5" cols="60"><xsl:value-of
select="project/description" disable-output-escaping="yes"/></textarea>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of
select="project/description" disable-output-escaping="yes"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ </dl>
+
+ <div class="form-buttons">
+ <xsl:choose>
+ <xsl:when test="editable = 1">
+ <xsl:variable
name="lang_save"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
+ <xsl:variable
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')"
/></xsl:variable>
+ <input type="submit"
name="save_project" value="{$lang_save}" title = "{$lang_save}" />
+ <input type="submit"
name="cancel_project" value="{$lang_cancel}" title = "{$lang_cancel}" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')"
/></xsl:variable>
+ <xsl:variable
name="lang_new_activity"><xsl:value-of select="php:function('lang',
't_new_activity')" /></xsl:variable>
+ <input type="submit"
name="edit_project" value="{$lang_edit}" title = "{$lang_edit}" />
+ <input type="submit"
name="new_activity" value="{$lang_new_activity}" title = "{$lang_new_activity}"
/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
+
+ <div class="mainContainer">
+ <form id="basicExample1" action="formPost.html">
+ <div class="formBody">
+ <h2>Simple Dynamic Validators</h2>
+ <div class="info">
+ This shows the bare minimum needed in order to
+ get the form validator working with your existing form.
+ The form validator will insert indicators and
validators
+ for your inputs.
+ </div>
+ <div class="row">
+ <div class="column1Backing"></div>
+ <div class="column2Backing"></div>
+ <div class="label">First Name:</div>
+ <div class="value">
+ <input id="firstName" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:Type="TextBaseField" />
+ </div>
+ <div class="label">Last Name:</div>
+ <div class="value">
+ <input id="lastName" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:Type="TextBaseField" />
+ </div>
+ <div class="clearDiv"></div>
+ </div>
+ <div class="row">
+ <div class="column1Backing"></div>
+ <div class="column2Backing"></div>
+ <div class="label">Age:</div>
+ <div class="value">
+ <input id="age" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:type="IntegerField"
+ formvalidator:max="100"
+ formvalidator:min="10"/>
+ </div>
+ <div class="label">Income ($):</div>
+ <div class="value">
+ <input id="income" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:type="DoubleField"
+ formvalidator:maxDecimalPlaces="2"
+ formvalidator:max="40000"
+ formvalidator:maxInclusive="true"/>
+ </div>
+ <div class="clearDiv"></div>
+ </div>
+ <div class="buttonRow">
+ <input type="submit" id="save" class="button"
value="Save" />
+ <input type="button" id="clearButton" class="button"
value="Clear" />
+ <input type="reset" class="button" value="Reset" />
+ <input type="button" class="button" value="Cancel" />
+ </div>
+ </div>
+ </form>
+ <form id="basicExample2" action="formPost.html">
+ <div class="formBody">
+ <h2>Advanced Dynamic Validators</h2>
+ <div class="info">
+ This will show you how to get creative with the form
+ validator and do more than the basics, while still not
+ changing your HTML very much.
+ </div>
+ <div class="row">
+ <div class="column1Backing"></div>
+ <div class="column2Backing"></div>
+ <div class="label">First Name:</div>
+ <div class="value">
+ <input id="firstName2" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:Type="TextBaseField"/>
+ </div>
+ <div class="label">Last Name:</div>
+ <div class="value">
+ <input id="lastName2" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:Type="TextBaseField"/>
+ </div>
+ <div class="clearDiv"></div>
+ </div>
+ <div class="row">
+ <div class="column1Backing"></div>
+ <div class="column2Backing"></div>
+ <div class="label">Age:</div>
+ <div class="value">
+ <input id="age2" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:type="IntegerField"
+ formvalidator:max="100"
+ formvalidator:min="10"/>
+ </div>
+ <div class="label">Income ($):</div>
+ <div class="value">
+ <input id="income2" type="text"
+ formvalidator:FormField="yes"
+ formvalidator:type="DoubleField"
+ formvalidator:maxDecimalPlaces="2"
+ formvalidator:max="40000"
+ formvalidator:maxInclusive="true"/>
+ </div>
+ <div class="clearDiv"></div>
+ </div>
+ <div class="buttonRow">
+ <input type="submit" class="button" value="Save" />
+ <input type="button" id="clearButton2" class="button"
value="Clear" />
+ <input type="reset" class="button" value="Reset" />
+ <input type="button" class="button" value="Cancel" />
+ </div>
+ </div>
+ </form>
+ </div>
+
+<script type="text/javascript">
+ var lang = <xsl:value-of select="php:function('js_lang', 'please choose
from list', 'please enter a value', 'please choose an entry')"/>;
+</script>
+
+
+</xsl:template>
+
+<xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected = 'selected'">
+ <xsl:attribute name="selected" value="selected" />
+ </xsl:if>
+ <xsl:attribute name="title" value="description" />
+ <xsl:value-of disable-output-escaping="yes" select="name"/>
+ </option>
+</xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10440] property: testing,
Sigurd Nes <=