Пример #1
0
 public function testCfg()
 {
     // System / Configuration
     // general
     $this->assertTrue(is_bool(Praxigento_LoginAs_Config::cfgGeneralEnabled()));
     $this->assertTrue(is_bool(Praxigento_LoginAs_Config::cfgGeneralLogEvents()));
     // UI
     $this->assertTrue(is_bool(Praxigento_LoginAs_Config::cfgUiCustomersGridActionEnabled()));
     $this->assertTrue(is_bool(Praxigento_LoginAs_Config::cfgUiOrdersGridColumnEnabled()));
 }
Пример #2
0
 /**
  * Add new column to orders grid.
  * @param Mage_Adminhtml_Block_Sales_Order_Grid $grid
  */
 private function doOrderGridColumnAdd(Mage_Adminhtml_Block_Sales_Order_Grid $grid)
 {
     /** validate availability & permissions */
     if (Praxigento_LoginAs_Config::cfgUiOrdersGridColumnEnabled() && Praxigento_LoginAs_Config::canAccessCreatedBy()) {
         /** define position for the column */
         $pos = Praxigento_LoginAs_Config::cfgUiOrdersGridColumnPosition();
         $curr = 0;
         $after = $grid->getLastColumnId();
         foreach ($grid->getColumns() as $key => $value) {
             $after = $key;
             if (++$curr >= $pos) {
                 break;
             }
         }
         /** add new column to grid */
         $grid->addColumnAfter(Praxigento_LoginAs_Config::ATTR_ORDER_CREATED_BY, array('header' => Praxigento_LoginAs_Config::helper()->__('Created by'), 'index' => Praxigento_LoginAs_Config::ATTR_ORDER_CREATED_BY, 'type' => 'text'), $after);
         $grid->sortColumnsByOrder();
     }
 }