title: how to change a bool value in prestashop 1.6 back end by icon click
body: <p>I want to change my printing status ,I am able to place the icon to change the status but the change is not occurring when I click the Print status icon shown in the image I have placed the callback as changePrintStatus </p>
  
  <p>the code is reaching  initProcess() when the change status icon is clicked,But after that what exactly must happen ??Or do i need to call any other function/override function ? (I want to do the same as in customers list where we change active status of customers ,similarly I  want to do here for my custom module)</p>
  
  <p><a href="https://i.stack.imgur.com/DlS2g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DlS2g.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?php
  
      require_once(_PS_MODULE_DIR_.'eticketprinting/eticketprinting.php');
      require_once(_PS_MODULE_DIR_.'eticketprinting/classes/Eticket.php');
  
      class EticketController extends ModuleAdminController
      {
              public $module;
              public $html;
              public $tabName = 'renderForm';
  
          public function __construct()
          {
              $this-&gt;tab = 'eticket';
              $this-&gt;module = new eticketprinting();
                   $this-&gt;addRowAction('edit');
              //$this-&gt;addRowAction('edit');
            //  $this-&gt;addRowAction('view'); // to display the view 
              //$this-&gt;addRowAction('delete');
              $this-&gt;explicitSelect = false;
              $this-&gt;context = Context::getContext();
              $this-&gt;id_lang = $this-&gt;context-&gt;language-&gt;id;
              $this-&gt;lang = false;
              $this-&gt;ajax = 1;
              $this-&gt;path = _MODULE_DIR_.'eticketprinting';
              $this-&gt;default_form_language = $this-&gt;context-&gt;language-&gt;id;
              $this-&gt;table = _DB_KITS_PREFIX_.'print_eticket';
              $this-&gt;className = 'Eticket';
              $this-&gt;identifier = 'id_print_eticket';
              $this-&gt;allow_export = true;
              $this-&gt;_select = '
              id_print_eticket,
              ticket_id,
              ticket_no,
              product_id,
              print_status,
              date_add,
              date_upd
              ';
              $this-&gt;name = 'EticketController';
              $this-&gt;bootstrap = true;
              $this-&gt;initTabModuleList();
              $this-&gt;initToolbar();
              $this-&gt;initPageHeaderToolbar();
             // $this-&gt;initFieldList();
  
              //$this-&gt;initContent();
              parent::__construct();
              $this-&gt;fields_list = 
              array(
              'id_print_eticket' =&gt; array(
              'title' =&gt; $this-&gt;l('E-Ticket Print ID'),
              'width' =&gt; 25,
              'type' =&gt; 'text',
              ),
              'ticket_id' =&gt; array(
              'title' =&gt; $this-&gt;l('Ticket- ID'),
              'width' =&gt; 140,
              'type' =&gt; 'text',
              ),
              'ticket_no' =&gt; array(
              'title' =&gt; $this-&gt;l('Ticket No'),
              'width' =&gt; 140,
              'type' =&gt; 'text',
              ),
              'product_id' =&gt; array(
              'title' =&gt; $this-&gt;l('Product ID'),
              'width' =&gt; 100,
              'type' =&gt; 'text',       
              ),
              'print_status' =&gt; array(
              'title' =&gt; $this-&gt;l('Print Status'),
              'align' =&gt; 'center',
              'type' =&gt; 'bool',
              'callback' =&gt; 'changePrintStatus',              
              'orderby' =&gt; false,     
              ),
              'date_add' =&gt; array(
              'title' =&gt; $this-&gt;l('Date Add'),
              'width' =&gt; 140,
              'type' =&gt; 'text',
              ),
              'date_upd' =&gt; array(
              'title' =&gt; $this-&gt;l('Date Update'),
              'width' =&gt; 140,
              'type' =&gt; 'text',
              ),
          );
  
          }
  
         public function changePrintStatus($value, $eticket)
          {
          return '&lt;a class="list-action-enable '.($value ? 'action-enabled' : 'action-disabled').'" href="index.php?'.htmlspecialchars('tab=Eticket&amp;id_print_eticket='
          .(int)$eticket['id_print_eticket'].'&amp;changePrintVal&amp;token='.Tools::getAdminTokenLite('Eticket')).'"&gt;
          '.($value ? '&lt;i class="icon-check"&gt;&lt;/i&gt;' : '&lt;i class="icon-remove"&gt;&lt;/i&gt;').
          '&lt;/a&gt;';
          }
  
  
          public function initProcess()
          {
          parent::initProcess();
          //d($this-&gt;id_object);
          if (Tools::isSubmit('changePrintVal') &amp;&amp; $this-&gt;id_object) {
                  if ($this-&gt;tabAccess['edit'] === '1') {
                      //d("reached here");
                      $this-&gt;action = 'change_print_val';
                  } else {
                      $this-&gt;errors[] = Tools::displayError('You do not have permission to change this.');
                  }
  
              }
          }
  
          public function postProcess()
          {
              //When generate pdf  button is clicked 
          if (Tools::isSubmit('submitAddeticket')) {
                  if (!Validate::isDate(Tools::getValue('date_from'))) {
                      $this-&gt;errors[] = $this-&gt;l('Invalid "From" date');
                  }
  
                  if (!Validate::isDate(Tools::getValue('date_to'))) {
                      $this-&gt;errors[] = $this-&gt;l('Invalid "To" date');
                  }
                  if (!Validate::isInt(Tools::getValue('id_product')) || Tools::getValue('id_product')=='' ) {
                      $this-&gt;errors[] = $this-&gt;l('Invalid Product/select a product ');
                  }
  
                  if (!count($this-&gt;errors)) {
                      if (count(Ticket::getByProductNDateInterval(Tools::getValue('id_product'),Tools::getValue('date_from'), Tools::getValue('date_to')))) {
  
                          //d($this-&gt;context-&gt;link-&gt;getAdminLink('AdminPdf'));
       Tools::redirectAdmin($this-&gt;context-&gt;link-&gt;getAdminLink('AdminPdf').'&amp;submitAction=generateEticketPDF&amp;id_product='.urlencode(Tools::getValue('id_product')).'&amp;date_from='.urlencode(Tools::getValue('date_from')).'&amp;date_to='.urlencode(Tools::getValue('date_to')));
                      }
  
                      $this-&gt;errors[] = $this-&gt;l('No tickets has been found or Ticket Generated Already for this period for Product ID:'.Tools::getValue('id_product').' (Change the Print Status generate the E-Ticket Again)');
                  }
              } else {
                  parent::postProcess();
              }
  
          } 
  
  
  
  
  
  
  
  
  
  
      }
  </code></pre>