Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
517
Issue boards
Milestones
Wiki
Code
Merge requests
83
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
vtiger
vtigercrm
Commits
1cd2bb67
Commit
1cd2bb67
authored
7 years ago
by
Satish
Browse files
Options
Downloads
Patches
Plain Diff
Fixes #511 - Percentage field 0.000 default value
parent
98b85388
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!188
Fixes #510, #511
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
layouts/v7/modules/Vtiger/uitypes/Percentage.tpl
+25
-26
25 additions, 26 deletions
layouts/v7/modules/Vtiger/uitypes/Percentage.tpl
modules/Vtiger/uitypes/Percentage.php
+10
-1
10 additions, 1 deletion
modules/Vtiger/uitypes/Percentage.php
with
35 additions
and
27 deletions
layouts/v7/modules/Vtiger/uitypes/Percentage.tpl
+
25
−
26
View file @
1cd2bb67
{*<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->*}
{*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*************************************************************************************}
{
strip
}
{
assign
var
=
"FIELD_INFO"
value
=
$FIELD_MODEL
->
getFieldInfo
()
}
{
assign
var
=
"SPECIAL_VALIDATOR"
value
=
$FIELD_MODEL
->
getValidator
()
}
{
if
(!
$FIELD_NAME
)
}
{
assign
var
=
"FIELD_NAME"
value
=
$FIELD_MODEL
->
getFieldName
()
}
{/
if
}
<div
class=
"input-group inputElement"
>
<input
id=
"
{
$MODULE
}
_editView_fieldName_
{
$FIELD_NAME
}
"
type=
"text"
class=
"form-control"
name=
"
{
$FIELD_NAME
}
"
value=
"
{
$FIELD_MODEL
->
get
(
'fieldvalue'
)
}
"
{
if
!
empty
(
$SPECIAL_VALIDATOR
)
}
data-validator=
'
{
Zend_Json
::
encode
(
$SPECIAL_VALIDATOR
)
}
'
{/
if
}
step=
"any"
{
if
$FIELD_INFO
[
"mandatory"
]
eq
true
}
data-rule-required=
"true"
{/
if
}
{
if
count
(
$FIELD_INFO
[
'validator'
])
}
data-specific-rules=
'
{
ZEND_JSON
::
encode
(
$FIELD_INFO
[
"validator"
])
}
'
{/
if
}
/>
<span
class=
"input-group-addon"
>
%
</span>
</div>
{
assign
var
=
"FIELD_INFO"
value
=
$FIELD_MODEL
->
getFieldInfo
()
}
{
assign
var
=
"SPECIAL_VALIDATOR"
value
=
$FIELD_MODEL
->
getValidator
()
}
{
if
(!
$FIELD_NAME
)
}
{
assign
var
=
"FIELD_NAME"
value
=
$FIELD_MODEL
->
getFieldName
()
}
{/
if
}
{
assign
var
=
"FIELD_VALUE"
value
=
$FIELD_MODEL
->
get
(
'fieldvalue'
)
}
<div
class=
"input-group inputElement"
>
<input
id=
"
{
$MODULE
}
_editView_fieldName_
{
$FIELD_NAME
}
"
type=
"text"
class=
"form-control"
data-field-id=
"
{
$FIELD_MODEL
->
get
(
'id'
)
}
"
name=
"
{
$FIELD_NAME
}
"
value=
"
{
if
!
empty
(
$FIELD_VALUE
)
or
$FIELD_VALUE
neq
NULL
}{
$FIELD_MODEL
->
getEditViewDisplayValue
(
$FIELD_VALUE
)
}{/
if
}
"
{
if
!
empty
(
$SPECIAL_VALIDATOR
)
}
data-validator=
"
{
Zend_Json
::
encode
(
$SPECIAL_VALIDATOR
)
}
"
{/
if
}
step=
"any"
{
if
$FIELD_INFO
[
"mandatory"
]
eq
true
}
data-rule-required=
"true"
{/
if
}
{
if
count
(
$FIELD_INFO
[
'validator'
])
}
data-specific-rules=
"
{
ZEND_JSON
::
encode
(
$FIELD_INFO
[
"validator"
])
}
"
{/
if
}
/>
<span
class=
"input-group-addon"
>
%
</span>
</div>
{/
strip
}
This diff is collapsed.
Click to expand it.
modules/Vtiger/uitypes/Percentage.php
+
10
−
1
View file @
1cd2bb67
...
...
@@ -18,4 +18,13 @@ class Vtiger_Percentage_UIType extends Vtiger_Base_UIType {
return
'uitypes/Percentage.tpl'
;
}
}
\ No newline at end of file
public
function
getDisplayValue
(
$value
,
$record
=
false
,
$recordInstance
=
false
)
{
$fldvalue
=
str_replace
(
","
,
"."
,
$value
);
$value
=
(
is_numeric
(
$fldvalue
))
?
$fldvalue
:
null
;
return
CurrencyField
::
convertToUserFormat
(
$value
,
null
,
true
);
}
public
function
getEditViewDisplayValue
(
$value
)
{
return
$this
->
getDisplayValue
(
$value
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment