diff --git a/layouts/v7/modules/Products/QuantityUpdate.tpl b/layouts/v7/modules/Products/QuantityUpdate.tpl index 79a64d6f03ce78160962c47254c55d8817018bef..dee48e2035121ce5de06fb698ac2bdd007893500 100644 --- a/layouts/v7/modules/Products/QuantityUpdate.tpl +++ b/layouts/v7/modules/Products/QuantityUpdate.tpl @@ -8,21 +8,23 @@ ************************************************************************************} {* modules/Products/views/SubProductQuantityUpdate.php *} -<div id="quantityUpdateContainer" class = "modal-dialog modal-sm"> - <div class = "modal-content"> - {include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE={vtranslate('LBL_EDIT_QUANTITY', $MODULE)}} - <form class="form-horizontal" id="quantityUpdate" method="post" action="index.php"> - <input type="hidden" name="module" value="{$MODULE}" /> - <input type="hidden" name="action" value="RelationAjax" /> - <input type="hidden" name="src_record" value="{$RECORD_ID}" /> - <input type="hidden" name="relid" value="{$REL_ID}" /> - <div class="modal-body"> - <div class="form-inline"> - <label for ="quantityEdit">{vtranslate('LBL_EDIT_QUANTITY', $MODULE)}</label> - <input id="quantityEdit" data-rule-positiveExcludingZero=true data-rule-positive=true class="form-control" type="text" name="quantity" value="{$CURRENT_QTY}"> - </div> - </div> - {include file='ModalFooter.tpl'|@vtemplate_path:$MODULE} - </form> - </div> +<div id="quantityUpdateContainer" class="modal-dialog modal-sm"> + <div class="modal-content"> + {include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE={vtranslate('LBL_EDIT_QUANTITY', $MODULE)}} + <form class="form-horizontal" id="quantityUpdate" method="post" action="index.php"> + <input type="hidden" name="module" value="{$MODULE}" /> + <input type="hidden" name="action" value="RelationAjax" /> + <input type="hidden" name="src_record" value="{$RECORD_ID}" /> + <input type="hidden" name="relid" value="{$REL_ID}"/> + <div class="modal-body"> + <div class="row"> + <span class="col-lg-6"><label for="quantityEdit" class="pull-right" style="margin-top: 5px;">{vtranslate('LBL_EDIT_QUANTITY', $MODULE)}</label></span> + <span class="col-lg-6"> + <input id="quantityEdit" data-rule-positiveExcludingZero=true data-rule-positive=true class="form-control" type="text" name="quantity" value="{$CURRENT_QTY}"> + </span> + </div> + </div> + {include file='ModalFooter.tpl'|@vtemplate_path:$MODULE} + </form> + </div> </div> \ No newline at end of file diff --git a/layouts/v7/modules/Products/resources/RelatedList.js b/layouts/v7/modules/Products/resources/RelatedList.js index 0f173f122af7c0b7ea344589e0eee957930b5a90..8eb19aefefb33c440d34597a5425699572c3a49b 100644 --- a/layouts/v7/modules/Products/resources/RelatedList.js +++ b/layouts/v7/modules/Products/resources/RelatedList.js @@ -101,27 +101,27 @@ PriceBooks_RelatedList_Js("Products_RelatedList_Js", {}, { /** * Function to trigger related record actions */ - triggerRelationAdditionalActions: function() { - var thisInstance = this; - var sourceModuleName = thisInstance.parentModuleName; - var relatedModuleName = thisInstance.relatedModulename; + triggerRelationAdditionalActions: function() { + var thisInstance = this; + var sourceModuleName = thisInstance.parentModuleName; + var relatedModuleName = thisInstance.relatedModulename; - var tabLabel = thisInstance.getSelectedTabElement().data('label-key'); - if (sourceModuleName == relatedModuleName && tabLabel == 'Product Bundles') { - var params = { - 'module': sourceModuleName, - 'relatedModule': relatedModuleName, - 'record': thisInstance.parentRecordId, - 'tabLabel': tabLabel, - 'view': 'Detail', - 'mode': 'showBundleTotalCostView' - } - app.request.post({data: params}).then( - function(err, data) { - jQuery('.bundleCostContainer').html(data); - }); - } - }, + var tabLabel = thisInstance.getSelectedTabElement().data('label-key'); + if (sourceModuleName == relatedModuleName && tabLabel == 'Product Bundles') { + var params = { + 'module' : sourceModuleName, + 'relatedModule' : relatedModuleName, + 'record' : thisInstance.parentRecordId, + 'tabLabel' : tabLabel, + 'view' : 'Detail', + 'mode' : 'showBundleTotalCostView' + } + app.request.post({data: params}).then(function(err, data) { + jQuery('.bundleCostContainer').html(data); + app.event.trigger('popover.click.event'); + }); + } + }, /** * Function to handle Sort @@ -198,32 +198,4 @@ PriceBooks_RelatedList_Js("Products_RelatedList_Js", {}, { }); }, - /** - * Function to trigger related record actions - */ - triggerRelationAdditionalActions : function() { - var thisInstance = this; - var sourceModuleName = thisInstance.parentModuleName; - var relatedModuleName = thisInstance.relatedModulename; - - var tabLabel = thisInstance.getSelectedTabElement().data('label-key'); - if (sourceModuleName == relatedModuleName && tabLabel == 'Product Bundles') { - var params = { - 'module' : sourceModuleName, - 'relatedModule' : relatedModuleName, - 'record' : thisInstance.parentRecordId, - 'tabLabel' : tabLabel, - 'view' : 'Detail', - 'mode' : 'showBundleTotalCostView' - } - - app.request.post({data: params}).then( - function(error, data) { - jQuery('.bundleCostContainer').html(data); - app.event.trigger('popover.click.event'); - } - ); - } - }, - }) \ No newline at end of file diff --git a/layouts/v7/modules/Vtiger/RelatedList.tpl b/layouts/v7/modules/Vtiger/RelatedList.tpl index eb81218a7df2b53e31099a3c1a427aa29ae3f1a7..25aa07cc4c3010356c2f38feec17788a6281dff4 100644 --- a/layouts/v7/modules/Vtiger/RelatedList.tpl +++ b/layouts/v7/modules/Vtiger/RelatedList.tpl @@ -95,19 +95,24 @@ {/if}> <td class="related-list-actions"> <span class="actionImages"> - {if $RELATED_MODULE_NAME eq 'PriceBooks' AND (!empty($RELATED_HEADERS['listprice']) || !empty($RELATED_HEADERS['unit_price']))} - {if !empty($RELATED_HEADERS['listprice'])} - {assign var="LISTPRICE" value=CurrencyField::convertToUserFormat($RELATED_RECORD->get('listprice'), null, true)} - {/if} - {/if} - {if $RELATED_MODULE_NAME eq 'PriceBooks'} - <a data-url="index.php?module=PriceBooks&view=ListPriceUpdate&record={$PARENT_RECORD->getId()}&relid={$RELATED_RECORD->getId()}¤tPrice={$LISTPRICE}" - class="editListPrice cursorPointer" data-related-recordid='{$RELATED_RECORD->getId()}' data-list-price={$LISTPRICE}> - <i class="fa fa-pencil" title="{vtranslate('LBL_EDIT', $MODULE)}"></i> - </a> - {/if} {if $IS_EDITABLE && $RELATED_RECORD->isEditable()} - <a name="relationEdit" data-url="{$RELATED_RECORD->getEditViewUrl()}"><i title="{vtranslate('LBL_EDIT', $MODULE)}" class="fa fa-pencil"></i></a> + {if $RELATED_MODULE_NAME eq 'PriceBooks' AND (!empty($RELATED_HEADERS['listprice']) || !empty($RELATED_HEADERS['unit_price']))} + {if !empty($RELATED_HEADERS['listprice'])} + {assign var="LISTPRICE" value=CurrencyField::convertToUserFormat($RELATED_RECORD->get('listprice'), null, true)} + {/if} + {/if} + {if $RELATED_MODULE_NAME eq 'PriceBooks'} + <a data-url="index.php?module=PriceBooks&view=ListPriceUpdate&record={$PARENT_RECORD->getId()}&relid={$RELATED_RECORD->getId()}¤tPrice={$LISTPRICE}" + class="editListPrice cursorPointer" data-related-recordid='{$RELATED_RECORD->getId()}' data-list-price={$LISTPRICE} + {else if $MODULE eq 'Products' && $RELATED_MODULE_NAME eq 'Products' && $TAB_LABEL === 'Product Bundles' && $RELATED_LIST_LINKS && $PARENT_RECORD->isBundle()} + {assign var=quantity value=$RELATED_RECORD->get($RELATION_FIELD->getName())} + <a class="quantityEdit" + data-url="index.php?module=Products&view=SubProductQuantityUpdate&record={$PARENT_RECORD->getId()}&relid={$RELATED_RECORD->getId()}¤tQty={$quantity}" + onclick ="Products_Detail_Js.triggerEditQuantity('index.php?module=Products&view=SubProductQuantityUpdate&record={$PARENT_RECORD->getId()}&relid={$RELATED_RECORD->getId()}¤tQty={$quantity}');if(event.stopPropagation){ldelim}event.stopPropagation();{rdelim}else{ldelim}event.cancelBubble=true;{rdelim}" + {else} + <a name="relationEdit" data-url="{$RELATED_RECORD->getEditViewUrl()}" + {/if} + ><i class="fa fa-pencil" title="{vtranslate('LBL_EDIT', $MODULE)}"></i></a> {/if} {if $IS_DELETABLE}