Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
6e3e1062
Commit
6e3e1062
authored
Apr 10, 2018
by
chenith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated subscription button visibility if plan changed/not.
parent
fb13c0f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
12 deletions
+71
-12
Company.java
cmsWebApp/src/performa/orm/Company.java
+20
-1
common.css
cmsWebApp/webroot/css/common.css
+11
-0
manage_plan.jsp
cmsWebApp/webroot/extensions/adminportal/manage_plan.jsp
+40
-11
No files found.
cmsWebApp/src/performa/orm/Company.java
View file @
6e3e1062
...
...
@@ -2,10 +2,10 @@ package performa.orm;
import
com.stripe.model.Card
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.BaseBusinessClass
;
import
oneit.objstore.ObjectStatus
;
import
oneit.objstore.ValidationContext
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.objstore.rdbms.filters.IsNotNullFilter
;
import
oneit.security.SecUser
;
import
oneit.utils.CollectionUtils
;
import
oneit.utils.StringUtils
;
...
...
@@ -166,4 +166,22 @@ public class Company extends BaseCompany
return
card
!=
null
?
String
.
format
(
"%02d"
,
card
.
getExpMonth
())
+
" / "
+
(
card
.
getExpYear
()
%
100
)
:
""
;
}
public
Boolean
isSubscriptionChanged
()
{
PaymentPlan
selectedPaymentPlan
=
getSelectedPaymentPlan
();
if
(
selectedPaymentPlan
!=
null
)
{
Company
earliestBackup
=
(
Company
)
getEarliestBackup
();
if
(!
CollectionUtils
.
equals
(
earliestBackup
.
getPaymentPlan
(),
selectedPaymentPlan
))
{
return
Boolean
.
TRUE
;
}
}
return
Boolean
.
FALSE
;
}
}
\ No newline at end of file
cmsWebApp/webroot/css/common.css
View file @
6e3e1062
...
...
@@ -6185,4 +6185,14 @@ input{
overflow
:
hidden
;
color
:
#7d7f82
;
font-size
:
10px
;
}
.subscr-change.disabled
button
{
background-color
:
#939393
!important
;
border-color
:
#939393
!important
;
}
.footer-note
a
{
color
:
#03A0E7
;
text-decoration
:
underline
;
}
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/manage_plan.jsp
View file @
6e3e1062
...
...
@@ -46,17 +46,37 @@
validate();
$('input').on('change keyup', function() { validate() });
addPostRecalcHandler(function ($fieldThatChanged) {
if (! $fieldThatChanged) {
return;
}
var name = $fieldThatChanged.attr('name');
if (typeof name !== typeof undefined && name !== false) {
if ( name.indexOf('PaymentJobCount') >= 0 ) {
validate();
}
}
});
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
}
});
if (empty) {
// var empty = false;
// $('input[required]').each(function() {
// if ($( this ).val() == '') {
// empty = true;
// }
// });
//
// if (empty) {
// $('.save-btn').attr('disabled', 'disabled');
// } else {
// $('.save-btn').removeAttr('disabled');
// }
if ($('.subscr-change').hasClass('disabled')) {
$('.save-btn').attr('disabled', 'disabled');
} else {
$('.save-btn').removeAttr('disabled');
...
...
@@ -64,6 +84,12 @@
}
</script>
<style>
.subscr-change button{
background-color: grey;
}
</style>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
...
...
@@ -196,15 +222,18 @@
</div>
</oneit:recalcClass>
</div>
<div class="a-label-row text-center pay-subsc-btn-row">
<oneit:button value="Update Subscription" name="saveCompany" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
<oneit:recalcClass htmlTag="div" classScript="company.isSubscriptionChanged() ? 'subscr-change enabled': 'subscr-change disabled'" company="<%= company %>">
<oneit:button value="Update Subscription" name="saveCompany" cssClass="btn btn-primary largeBtn btn-green save-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("Company", company)
.mapEntry ("IsPayment", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Company"))
.toMap() %>" />
</oneit:recalcClass>
</div>
<div class="line-break"></div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment