-
bescott53
Post
by bescott53 » 2018-06-28 13:57
gimblefritz, where would i put this, in the dv part of table hook?
Code: Select all
$j(function(){
// set "disabled" fields
var fieldlist='#type, #description, #unit, #buy_price, #sell_price, #suggested_price';
$j(fieldlist).prop('readonly', true);
$j(fieldlist).prop('tabIndex', -1);
$j(fieldlist).prop('style', 'cursor: not-allowed; background-color: #EEE;');
$j(fieldlist).mousedown(function(){return false;});
});
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-06-28 14:58
Hi,
can you try to put the code at the end of the function. Also can you share the complete function to see if the happen any modification to the field.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-06-28 15:20
ok, here is the code as it stands, not made the latest amendments
Code: Select all
function commission_approvals_dv($selectedID, $memberInfo, &$html, &$args){
/* current user is not an admin? */
if($memberinfo['group'] != 'Admins'){
$html .= <<<EOC
<script>
\$j(function(){
\$j('#approvedby_so').prop('disabled', true);
})
</script>
EOC;
}
/* if this is the print preview, don't modify the detail view */
if(isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<div id="form-tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#claimants-details" data-toggle="tab">Enter Claimants Details</a></li>
<li><a href="#claim-details" data-toggle="tab">Enter Claim Details</a></li>
<li><a href="#product-info" data-toggle="tab">Enter Product Details</a></li>
<li><a href="#sales-engineers" data-toggle="tab">SE Details</a></li>
<li><a href="#claim-checks" data-toggle="tab">Check Details</a></li>
<li><a href="#approver-details" data-toggle="tab">Enter Approvals</a></li>
<li><a href="#pull-through" data-toggle="tab">Pull Through Claim</a></li>
</ul>
<ul class="tab-content">
<div class="tab-pane active form-horizontal" id="claimants-details"></div>
<div class="tab-pane form-horizontal" id="claim-details"></div>
<div class="tab-pane form-horizontal" id="product-info"><div class="AMcAUpdate2"><label><h4>Product Details Come From Salesforce</H4)</label></div></div>
<div class="tab-pane form-horizontal" id="sales-engineers"></div>
<div class="tab-pane form-inline" id="claim-checks">
<div class="AMcAUpdate"><label><h2>Evidence Submitted</H2)</label></div></div>
<div class="tab-pane form-horizontal" id="approver-details"></div>
<div class="tab-pane form-inline" id="pull-through"></div>
</ul>
</div>
<style>
#form-tabs .nav-tabs a{ display: block !important; }
@media (min-width: 768px){
.form-inline .form-group{
width: 48%;
margin-bottom: 0.75em;
vertical-align: top;
}
}
</style>
<script>
$j(function(){
$j('#form-tabs').appendTo('#customers_dv_form');
$j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');
/* Fix for a bug with lookup drop-downs to set their correct width */
$j('.select2-container').addClass('option_list').css({ 'max-width': 'unset', 'width': 'unset' }).parents('.row').css({ 'width': '100%' });
/* fields to move to the Claimants Details tab */
$j('#refnum').parents('.form-group').appendTo('#claimants-details');
$j('#claimants_name').parents('.form-group').appendTo('#claimants-details');
$j('#line_manager_name').parents('.form-group').appendTo('#claimants-details');
$j('#involvedpercentage').parents('.form-group').appendTo('#claimants-details');
/* fields to move to the Claim tab */
$j('#AccountName').parents('.form-group').appendTo('#claim-details');
$j('#claimsf').parents('.form-group').appendTo('#claim-details');
$j('#claim_ges_system').parents('.form-group').appendTo('#claim-details');
$j('#GESDeal_IncPS').parents('.form-group').appendTo('#claim-details');
$j('#deal_type').parents('.form-group').appendTo('#claim-details');
$j('#deal_term').parents('.form-group').appendTo('#claim-details');
$j('#payment_month').parents('.form-group').appendTo('#claim-details');
$j('#Updates').parents('.form-group').appendTo('#claim-details');
$j('#Uploads').parents('.form-group').appendTo('#claim-details');
$j('#Uploads2').parents('.form-group').appendTo('#claim-details');
$j('#Uploads3').parents('.form-group').appendTo('#claim-details');
/* fields to move to the Products tab */
$j('#product_1').parents('.form-group').appendTo('#product-info');
$j('#Product_1_ICV').parents('.form-group').appendTo('#product-info');
$j('#product_1_margin').parents('.form-group').appendTo('#product-info');
$j('#Product_1_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product1Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_1_Term').parents('.form-group').appendTo('#product-info');
$j('#product_2').parents('.form-group').appendTo('#product-info');
$j('#Product_2_ICV').parents('.form-group').appendTo('#product-info');
$j('#product_2_margin').parents('.form-group').appendTo('#product-info');
$j('#Product_2_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product2Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_2_Term').parents('.form-group').appendTo('#product-info');
$j('#product_3').parents('.form-group').appendTo('#product-info');
$j('#Product_3_ICV').parents('.form-group').appendTo('#product-info');
$j('#product_3_margin').parents('.form-group').appendTo('#product-info');
$j('#Product_3_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product3Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_3_Term').parents('.form-group').appendTo('#product-info');
$j('#product_4').parents('.form-group').appendTo('#product-info');
$j('#Product_4_ICV').parents('.form-group').appendTo('#product-info');
$j('#product_4_margin').parents('.form-group').appendTo('#product-info');
$j('#Product_4_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product4Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_4_Term').parents('.form-group').appendTo('#product-info');
$j('#product_5').parents('.form-group').appendTo('#product-info');
$j('#Product_5_ICV').parents('.form-group').appendTo('#product-info');
$j('#product_5_margin').parents('.form-group').appendTo('#product-info');
$j('#Product_5_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product5Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_5_Term').parents('.form-group').appendTo('#product-info');
$j('#Product_6').parents('.form-group').appendTo('#product-info');
$j('#Product_6_ICV').parents('.form-group').appendTo('#product-info');
$j('#Product_6_Margin').parents('.form-group').appendTo('#product-info');
$j('#Product_6_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product6Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_6_Term').parents('.form-group').appendTo('#product-info');
$j('#Product_7').parents('.form-group').appendTo('#product-info');
$j('#Product_7_ICV').parents('.form-group').appendTo('#product-info');
$j('#Product_7_Margin').parents('.form-group').appendTo('#product-info');
$j('#Product_7_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product7Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_7_Term').parents('.form-group').appendTo('#product-info');
$j('#Product_8').parents('.form-group').appendTo('#product-info');
$j('#Product_8_ICV').parents('.form-group').appendTo('#product-info');
$j('#Product_8_Margin').parents('.form-group').appendTo('#product-info');
$j('#Product_8_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product8Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_8_Term').parents('.form-group').appendTo('#product-info');
$j('#Product_9').parents('.form-group').appendTo('#product-info');
$j('#Product_9_ICV').parents('.form-group').appendTo('#product-info');
$j('#Product_9_Margin').parents('.form-group').appendTo('#product-info');
$j('#Product_9_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product9Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_9_Term').parents('.form-group').appendTo('#product-info');
$j('#Product_10').parents('.form-group').appendTo('#product-info');
$j('#Product_10_ICV').parents('.form-group').appendTo('#product-info');
$j('#Product_10_Margin').parents('.form-group').appendTo('#product-info');
$j('#Product_10_Margin_Adjusted').parents('.form-group').appendTo('#product-info');
$j('#Product10Vendor').parents('.form-group').appendTo('#product-info');
$j('#Product_10_Term').parents('.form-group').appendTo('#product-info');
/* fields to move to the Sales Engineer Details tab */
$j('#SalesEngineer1').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer1Allocation').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer2').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer2Allocation').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer3').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer3Allocation').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer4').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer4Allocation').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer5').parents('.form-group').appendTo('#sales-engineers');
$j('#SalesEngineer5Allocation').parents('.form-group').appendTo('#sales-engineers');
/* fields to move to the claim check Details tab */
$j('#SpecialistInSalesTeamonSF').parents('.form-group').appendTo('#claim-checks');
$j('#SecurityProductOnSF').parents('.form-group').appendTo('#claim-checks');
$j('#TechnicalDesignDocument').parents('.form-group').appendTo('#claim-checks');
$j('#TechDesignDocNotes').parents('.form-group').appendTo('#claim-checks');
$j('#BidFinancials').parents('.form-group').appendTo('#claim-checks');
$j('#BidFinancialsNotes').parents('.form-group').appendTo('#claim-checks');
$j('#SignedContractPOonSF').parents('.form-group').appendTo('#claim-checks');
$j('#SignedContractPOonSFNotes').parents('.form-group').appendTo('#claim-checks');
$j('#POValueMatchesSignedContract').parents('.form-group').appendTo('#claim-checks');
$j('#POValueMatchesSignedContractNotes').parents('.form-group').appendTo('#claim-checks');
$j('#CheckTermMatchesClaim').parents('.form-group').appendTo('#claim-checks');
$j('#CheckTermMatchesClaimNotes').parents('.form-group').appendTo('#claim-checks');
$j('#ProductsMatchSubmittedClaimContract').parents('.form-group').appendTo('#claim-checks');
$j('#ProductsMatchSubmittedClaimContractNotes').parents('.form-group').appendTo('#claim-checks');
$j('#ContractSignatureShownMatch').parents('.form-group').appendTo('#claim-checks');
$j('#ContractSignatureShownMatchNotes').parents('.form-group').appendTo('#claim-checks');
$j('#SOVICVMatchesClaim').parents('.form-group').appendTo('#claim-checks');
$j('#SOVICVMatchesClaimNotes').parents('.form-group').appendTo('#claim-checks');
$j('#AudiosCalls').parents('.form-group').appendTo('#claim-checks');
$j('#AudiosCallsNotes').parents('.form-group').appendTo('#claim-checks');
$j('#Meetings').parents('.form-group').appendTo('#claim-checks');
$j('#MeetingsNotes').parents('.form-group').appendTo('#claim-checks');
$j('#Emails').parents('.form-group').appendTo('#claim-checks');
$j('#EmailsNotes').parents('.form-group').appendTo('#claim-checks');
$j('#Quotes').parents('.form-group').appendTo('#claim-checks');
$j('#QuotesNotes').parents('.form-group').appendTo('#claim-checks');
$j('#Proposal').parents('.form-group').appendTo('#claim-checks');
$j('#ProposalNotes').parents('.form-group').appendTo('#claim-checks');
$j('#ContributionTowardsSale').parents('.form-group').appendTo('#claim-checks');
$j('#CommissionShareAgreeByLM').parents('.form-group').appendTo('#claim-checks');
$j('#BonusPaidPreviously').parents('.form-group').appendTo('#claim-checks');
$j('#SubmittedWithin8WeeksofClosure').parents('.form-group').appendTo('#claim-checks');
/* fields to move to the Approvers tab */
$j('#commission').parents('.form-group').appendTo('#approver-details');
$j('#stage1').parents('.form-group').appendTo('#approver-details');
$j('#bank').parents('.form-group').appendTo('#approver-details');
$j('#BigDealOverlay').parents('.form-group').appendTo('#approver-details');
$j('#approvedby_line_manager').parents('.form-group').appendTo('#approver-details');
$j('#approvedby_so').parents('.form-group').appendTo('#approver-details');
$j('#approvedby_ges_coo').parents('.form-group').appendTo('#approver-details');
$j('#approvedby_ges_finance').parents('.form-group').appendTo('#approver-details');
$j('#SalesCommisionPaymentMonth').parents('.form-group').appendTo('#approver-details');
$j('#HouseAccount').parents('.form-group').appendTo('#approver-details');
$j('#HOSICV').parents('.form-group').appendTo('#approver-details');
$j('#HOSMargin').parents('.form-group').appendTo('#approver-details');
/* fields to move to the pull through tab */
$j('#PTClaimant1').parents('.form-group').appendTo('#pull-through');
$j('#PTClaimant1Percentage').parents('.form-group').appendTo('#pull-through');
$j('#PTClaimant2').parents('.form-group').appendTo('#pull-through');
$j('#PTClaimant2Percentage').parents('.form-group').appendTo('#pull-through');
$j('#PTClaimant3').parents('.form-group').appendTo('#pull-through');
$j('#PTClaimant3Percentage').parents('.form-group').appendTo('#pull-through');
$j('#PullThroughClaim').parents('.form-group').appendTo('#pull-through');
})
</script>
<?php
$tabs = ob_get_contents();
ob_end_clean();
$html .= $tabs;
}
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-06-28 16:06
ok, a small correction. it should be $memberInfo instead of $memberinfo.
Can you call in the console
$j('#approvedby_so').prop('disabled', true);
and
$j('#approvedby_so').prop('disabled', false);
and see if the field is being set to read-only and back to read-write.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-06-28 16:24
pböttcher, this didn't seem to make any changes.
SnipImage.JPG
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-06-28 16:47
ok, (I didn't expect it to work
, but it was wrong anyways)
I cannot see your SnipImage. Can you attach again? Did you check via the console command?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-06-28 17:30
sorry, here you go
- SnipImage.JPG (44.3 KiB) Viewed 8332 times
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-06-28 17:39
ok, thanks. Can you please also post the snapshot showing the field in the dom explorer (last time you showed the select-drop which is different from the field itself. It should show the "approvedby_so" tag.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-06-29 16:07
its still the same, does not show approvedby_so
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-06-29 18:28
Hi,
can you please post the result of the command
in the console.
Also an image like this would be helpful.
- select.JPG (72.67 KiB) Viewed 8321 times
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-03 20:45
apologies pböttcher, been away for a couple of days. I attach the screen shot now
- SnipImage.JPG (115.5 KiB) Viewed 8296 times
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-04 07:27
Hi,
thanks
can you please post the result of the command
$j('[id]')
in the console.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-04 08:43
it would help if i read the question properly, apologies!
- SnipImage1.JPG (40.72 KiB) Viewed 8291 times
- SnipImage2.JPG (35.7 KiB) Viewed 8291 times
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-05 07:12
ok, lets give it another try
.
Can you put
Code: Select all
$j('#approvedby_so *').prop('disabled', true);
instead.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-06 00:29
Still no joy, totally lost with this not sure why it won’t work
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-06 05:09
did you check for the last try, it would not disable the dropdown, but the ability to select any choice
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
grimblefritz
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Post
by grimblefritz » 2018-07-06 05:18
Just out of curiosity, have you tried the code I suggested in the table's .dv file?
I don't recall if I ever tested it with a select control, but then again I might have
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-06 06:24
one more try
Code: Select all
$j('#approvedby_so').select2('disable')
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-06 08:27
Success pböttcher! i don't know what this community would do without your help!!!!
thank you so much, final code below. it is in the hooks file in the dv function
Code: Select all
/* current user is not an admin? */
if($memberInfo['group'] != 'Admins'){
$html .= <<<EOC
<script>
\$j(function(){
\$j('#approvedby_so').select2('disable')
})
</script>
EOC;
}
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-06 09:03
great to see a solution working. Maybe you can post what browser you are using, as I guess it is IE but not sure which version. And I think the issue is only with IE. Others should work fine with the solution posted earlier.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-06 09:42
sure here you go
- SnipImage1.JPG (40.72 KiB) Viewed 8239 times
-
pbottcher
- AppGini Super Hero
- Posts: 1638
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2018-07-06 09:45
I thinks that was not the browser, that is the console output
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
bescott53
Post
by bescott53 » 2018-07-06 09:47
sorry about that, i should have renamed it
- SnipImage.JPG (19.34 KiB) Viewed 8239 times
-
grimblefritz
- AppGini Super Hero
- Posts: 336
- Joined: 2015-12-23 16:52
Post
by grimblefritz » 2018-07-06 14:03
I'm not sure if it impacts the select2 library, but I'd check your results. With a normal select (or input field, etc) field, if you disable the field and then save the form you will have empty fields stored to your database. I'd recommend testing whether this is also true of select2().