Applies an action to the selected products
977685
protected function actionListProduct()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $id) {

            if ($action === 'status' && $this->access('product_edit')) {
                $updated += (int) $this->product->update($id, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('product_delete')) {
                $deleted += (int) $this->product->delete($id);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
1317726
function () {
            var self = this;
            base._create.apply(self, arguments);

            if (self.options.actions.listAction) {
                self._adaptListActionforAbp();
            }

            if (self.options.actions.createAction) {
                self._adaptCreateActionforAbp();
            }

            if (self.options.actions.updateAction) {
                self._adaptUpdateActionforAbp();
            }

            if (self.options.actions.deleteAction) {
                self._adaptDeleteActionforAbp();
            }
        }
247600
protected function _process()
	{
		$this->_msg('Adding product selection performance data', 0);


		$this->_txBegin();

		$selProducts = $this->_getSelectionProductIds();

		$this->_txCommit();


		$productTypeItem = $this->_getTypeItem( 'product/type', 'product', 'default' );
		$listTypeItem = $this->_getTypeItem( 'product/list/type', 'product', 'default' );


		$productListManager = MShop_Factory::createManager( $this->_getContext(), 'product/list' );

		$listItem = $productListManager->createItem();
		$listItem->setTypeId( $listTypeItem->getId() );
		$listItem->setDomain( 'product' );


		$productManager = MShop_Factory::createManager( $this->_getContext(), 'product' );

		$search = $productManager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.typeid', $productTypeItem->getId() ) );
		$search->setSortations( array( $search->sort( '-', 'product.id' ) ) );


		$this->_txBegin();

		$selCount = count( $selProducts );
		$selPrices = array();
		$start = $num = 0;

		do
		{
			$result = $productManager->searchItems( $search, array( 'price' ) );

			foreach( $result as $id => $product )
			{
				$pos = (int) ( ($num / 9) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );


				$pos = (int) ( ($num / 9 + 1) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );


				$pos = (int) ( ($num / 9 + 2) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );

				$num++;
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$listTypeItem = $this->_getTypeItem( 'product/list/type', 'price', 'default' );

		$listItem->setTypeId( $listTypeItem->getId() );
		$listItem->setDomain( 'price' );

		$this->_txBegin();

		foreach( $selPrices as $pos => $priceItem )
		{
			$listItem->setId( null );
			$listItem->setRefId( $priceItem->getId() );
			$listItem->setParentId( $selProducts[$pos] );
			$productListManager->saveItem( $listItem, false );
		}

		$this->_txCommit();


		$this->_status( 'done' );
	}
123504
@Override
	public void actionPerformed(ActionEvent e) {
		invokeOriginalAction(e);
		
		int row = table.getSelectedRow();
		int column = table.getSelectedColumn();
		
		if (table.isCellEditable(row, column)) {
			table.editCellAt(row, column, e);
		}
	}
477016
def filter_products(self, desired_prods):
        """"""

        self.filter_prods = True
        self.desired_prods = set(desired_prods)
303559
def do_actions(self, target_filename, dry_run=False):
        
        for rule in self.action_rules:
            target_filename = rule.do_action(target_filename, dry_run)

        raise StopProcessingException
789527
public function applySort()
    {
        parent::applySort();

        if ($this->getSortBy() && $this->itemCreate) {
            //Remove previous click handler to Add new Item button and attach new one using sort argument.
            $this->container->js(true, $this->itemCreate->js()->off('click.atk_CRUD'));
            $this->container->js(true,
                                 $this->itemCreate->js()->on('click.atk_CRUD',
                                 new jsFunction([
                                     new jsModal('Add new', $this->pageCreate, [$this->name.'_sort' => $this->getSortBy()]),
                                 ]))
            );
        }
    }
522092
function addClickHandler() {
  $('.transaction-list-item').click(function() {
    var index = $('.transaction-list-item').index(this);
    dataView.selectedTransaction = dataView.transactions[index];
    render();
  });
}
273690
def _set_selected_action(self, action):
        """"""
        assert action in self._action_sets

        if self._selected_action is not None:
            raise ValueError("The action has already been selected.")
        self._selected_action = action
989875
def setup_common_actions(self):
        """"""
        self.collapse_all_action = create_action(self,
                                     text=_('Collapse all'),
                                     icon=ima.icon('collapse'),
                                     triggered=self.collapseAll)
        self.expand_all_action = create_action(self,
                                     text=_('Expand all'),
                                     icon=ima.icon('expand'),
                                     triggered=self.expandAll)
        self.restore_action = create_action(self,
                                     text=_('Restore'),
                                     tip=_('Restore original tree layout'),
                                     icon=ima.icon('restore'),
                                     triggered=self.restore)
        self.collapse_selection_action = create_action(self,
                                     text=_('Collapse selection'),
                                     icon=ima.icon('collapse_selection'),
                                     triggered=self.collapse_selection)
        self.expand_selection_action = create_action(self,
                                     text=_('Expand selection'),
                                     icon=ima.icon('expand_selection'),
                                     triggered=self.expand_selection)
        return [self.collapse_all_action, self.expand_all_action,
                self.restore_action, None,
                self.collapse_selection_action, self.expand_selection_action]
19356
def addAction(self, action, checked=None, autoBuild=True):
        
        # clear the holder
        actions = self._actionGroup.actions()
        if actions and actions[0].objectName() == 'place_holder':
            self._actionGroup.removeAction(actions[0])
            actions[0].deleteLater()
        
        # create an action from the name
        if not isinstance(action, QAction):
            action_name = nativestring(action)
            action = QAction(action_name, self)
            action.setObjectName(action_name)
            action.setCheckable(self.isCheckable())
            
            # auto-check the first option
            if checked or (not self._actionGroup.actions() and checked is None):
                action.setChecked(True)
        
        elif self.isCheckable():
            action.setCheckable(True)
            if not self.currentAction():
                action.setChecked(True)
        
        self._actionGroup.addAction(action)
        
        if autoBuild:
            self.rebuild()
        
        return action
406323
function action() {
    var self = Thng.resourceConstructor.call(this, this.id);
    return self.action.apply(self, arguments);
  }
104166
public function apply()
	{
		if (!$this->isActive()) return;
		
		foreach ($this->getInfo() as $f)
		{
			switch($f['filter_type']) 
			{
				case self::TYPE_NUMERIC:
				case self::TYPE_NUMERIC_SLIDER:
					if ($this->submittedValue($f['name'].'_min') !== null)
					{
						$this->iterator->where( $this->generateField($f['field']).' >= '.(float)$this->submittedValue($f['name'].'_min') );
					}
					if ($this->submittedValue($f['name'].'_max') !== null && $this->submittedValue($f['name'].'_max'))
					{
						$this->iterator->where( $this->generateField($f['field']).' <= '.(float)$this->submittedValue($f['name'].'_max') );
					}	
					break;
				case self::TYPE_RADIO:
				case self::TYPE_DROPDOWN:
					if ($this->submittedValue($f['name']) !== null) {
						$this->iterator->where( $this->generateField($f['field']).' = :'.$f['name'] )
									   ->setParameter($f['name'], $this->submittedValue($f['name']));
					}				
					break;
				case self::TYPE_CHECKBOX:
					if ($this->submittedValue($f['name']) !== null) {
						if (is_array($this->submittedValue($f['name']))) {
							$a = array();
							foreach ($this->submittedValue($f['name']) as $value => $dummy) {
								$a[] = '"'.$value.'"';
							}
							$this->iterator->where( $this->generateField($f['field']).' IN ('.implode(',',$a).')' );
						}
						else {
							if ($this->submittedValue($f['name'])) {
								$this->iterator->where( $this->generateField($f['field']).' > 0' );
							}
						}
					}
					break;
				case self::TYPE_DROPDOWN_MULTIPLE:
					if ($this->submittedValue($f['name']) !== null) {
						if (is_array($this->submittedValue($f['name']))) {
							$this->iterator->where( $this->generateField($f['field']).' IN ("'.implode('","',$this->submittedValue($f['name'])).'")' );
						}
					}
					break;                    
				case self::TYPE_DATE_INTERVAL:
					if ($f['value_min']) {
						$this->iterator->where( $this->generateField($f['field']).' >= STR_TO_DATE(:'.$f['name'].'_min,"%Y-%m-%d")' )
									   ->setParameter($f['name'].'_min', $f['value_min']);						
					}
					if ($f['value_max']) {
						$this->iterator->where( $this->generateField($f['field']).' <= DATE_ADD(STR_TO_DATE(:'.$f['name'].'_max,"%Y-%m-%d"), INTERVAL 1 DAY)' )
									   ->setParameter($f['name'].'_max', $f['value_max']);						
					}
					break;
				case self::TYPE_DATE:
					if ($f['value']) {
						$this->iterator->where( 'DATE_FORMAT('.$this->generateField($f['field']).',"%Y-%m-%d") = :'.$f['name'] )
									   ->setParameter($f['name'], $f['value']);						
					}				
					break;
				case self::TYPE_TEXT:
					if ($f['value']) {
						$this->iterator->where( $this->generateField($f['field']).' LIKE :'.$f['name'] )
									   ->setParameter($f['name'], '%'.$f['value'].'%');						
					}					
					break;
			}
		}
		$this->iterator->groupBy('main.id');
	}
885705
protected function updateProductClass()
    {
        $this->controlAccess('product_class_edit');

        if ($this->product_class->update($this->data_product_class['product_class_id'], $this->getSubmitted())) {
            $this->redirect('admin/content/product-class', $this->text('Product class has been updated'), 'success');
        }

        $this->redirect('', $this->text('Product class has not been updated'), 'warning');
    }
1303300
public function indexAction()
    {
        $this->html->h2($this->getTopicTitle());

        $displayColumns = array('link'     => '',
                                'context'  => $this->_('Context'),
                                'maxLevel' => $this->_('Max level'),
                                'level'    => $this->_('Level'));

        foreach($this->_upgrades->getUpgradesInfo() as $row) {
            $menuItem = $this->menu->findAllowedController($this->_getParam('controller'), 'show');
            if ($menuItem) {
                $row['link'] = $menuItem->toActionLinkLower($this->getRequest(), $row);
            }
            $data[] = $row;
        }
        $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser table', 'columns', $displayColumns);
        $this->html->br();
        $this->compatibilityReportAction();
    }
209543
private void applyEnableAction(final WComponent target, final boolean enabled) {
		// Found Disableable component
		if (target instanceof Disableable) {
			target.setValidate(enabled);
			((Disableable) target).setDisabled(!enabled);
		} else if (target instanceof Container) {  // Apply to any Disableable children
			Container cont = (Container) target;
			final int size = cont.getChildCount();

			for (int i = 0; i < size; i++) {
				WComponent child = cont.getChildAt(i);
				applyEnableAction(child, enabled);
			}
		}
	}
195884
def select_action(self, next_action_arr, next_q_arr):
        '''
        
        '''
        key_arr = self.select_action_key(next_action_arr, next_q_arr)
        return next_action_arr[key_arr], next_q_arr[key_arr]