Skip to content
Snippets Groups Projects
Commit e6853871 authored by Prasad's avatar Prasad
Browse files

Merge branch 'master' of http://code.vtiger.com/vtiger/vtigercrm

parents 3ae9e36a 8f422ce8
No related branches found
No related tags found
No related merge requests found
......@@ -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>
&nbsp;&nbsp;<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
......@@ -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
......@@ -95,19 +95,24 @@
{/if}>
<td class="related-list-actions">
<span class="actionImages">&nbsp;&nbsp;&nbsp;
{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()}&currentPrice={$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> &nbsp;&nbsp;
{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()}&currentPrice={$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()}&currentQty={$quantity}"
onclick ="Products_Detail_Js.triggerEditQuantity('index.php?module=Products&view=SubProductQuantityUpdate&record={$PARENT_RECORD->getId()}&relid={$RELATED_RECORD->getId()}&currentQty={$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> &nbsp;&nbsp;
{/if}
{if $IS_DELETABLE}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment