{extends file=$smarty.const.SMARTY_LAYOUT_MAIN_GENERAL_PAGINATED_LISTING}

{block name="js" append}
	<script type="text/javascript">
		MVC.scheduleOnLoad(function(){
			MVC.listing.prototype.unmarkDuplicateItemsWithConfirmation = function(button){
				MVC.callbackWithConfirmation(
					"{$lang['unmarkDuplicate']['title']}",
					"{$lang['unmarkDuplicate']['confirmation']}",
					this.backend_callUpdateOperation.bind(this, 'unmarkDuplicate', {
						'listing[selection][add][]':	MVC.listing.installedHandlers.listing.getItemId(button),
						'listing[selection][clear]' :	'all'
					})
				);
			}

			MVC.listing.prototype.sendEmailWithConfirmation = function(buton){
				MVC.callbackWithConfirmation(
					"{$lang['sendAlert']['title']}",
					"{$lang['sendAlert']['confirmation']}",
					this.backend_callUpdateOperation.bind(this, 'sendAlert', {
						'listing[selection][add][]': MVC.listing.installedHandlers.listing.getItemId(buton),
						'listing[selection][clear]': 'all'
					})
				);
			}


			// unlock one item
			MVC.listing.prototype.unlockCurrent = function(element) {
				this.backend_callUpdateOperation('unlock', {
					'listing[selection][add][]' :	this.getItemId(element),
					'listing[selection][clear]' :	'all'
				})
			}
		});
	</script>
{/block}

