<?php
include_once(_DIR_TO_CLASS."/c_page.php");
class c_page_cab_docs_pdf extends c_page
{
  public $h1='Документ' ;
  public $rec_doc=array() ;
  public $filter=array() ;
  public $use_datepicker=1 ;
  public $body_class='printSelected' ;
  //  public $page_type='window' ;
  //public $page_type='window' ;
  
  function select_obj_info()
  { if (_CUR_ID)
    { $this->rec_doc=DOCS()->get_doc_by_id(_CUR_ID) ;
      if ($this->rec_doc['pkey'])
      { $this->h1=$this->rec_doc['obj_name'] ;
        $this->no_panel_smena_is_out=1 ;
      }
      else $this->result=404 ;
    }
	if (_CUR_ROOT_DIR_NAME=='window')  $this->page_type='window' ;
  }

  function menu_config()
  { // вкладки для сотрудника
      if (_CUR_ROOT_DIR_NAME=='cab') parent::menu_config() ;
      elseif($this->rec_doc['pkey'])
       { $this->menu[$this->rec_doc['__href_window']]='Карточка документа' ;
         if (!$this->rec_doc['sign'] and !$this->rec_doc['edit']) $this->menu[$this->rec_doc['__href_window'].'sign/']='Подписать документ' ;
         if ($this->rec_doc['sign']) $this->menu[$this->rec_doc['__href_window'].'ecp/']='ЭЦП документа' ;
         //$this->menu[$this->rec_mo['__href'].'log/']='Журнал событий' ;
         if (function_exists('EVENTS') and stripos($this->rec_doc['source_obj'],'event_docs')!==false) $this->menu[$this->rec_doc['__href'].'events/']='Контроль сдачи' ;
         $this->menu[$this->rec_doc['__href'].'db/']='Исходные данные' ;
       }
  }

 function second_menu_config()
 { if ($this->rec_doc['pkey'] and _CUR_ROOT_DIR_NAME=='cab')
   { $this->second_menu[$this->rec_doc['__href_cab']]='Карточка документа' ;
     if (!$this->rec_doc['sign']) $this->second_menu[$this->rec_doc['__href_cab'].'sign/']='Подписать документ' ;
     if ($this->rec_doc['sign']) $this->second_menu[$this->rec_doc['__href_cab'].'ecp/']='ЭЦП документа' ;
     $this->second_menu[$this->rec_doc['__href_cab'].'events/']='Мероприятия' ;
     $this->second_menu[$this->rec_doc['__href_cab'].'db/']='Исходные данные' ;
   }
 }



 //function menu_config() {$this->menu=array() ;}


 function block_main()
 { if ($this->rec_doc['pkey'])
   { if (!$this->rec_doc['edit'])
 { $this->page_title() ;
      	$this->panel_doc_view(array('after_sign_doc_go_url'=>_CUR_PAGE_DIR)) ;
     }
     else
     {
	     $this->page_title('Редактирование документа "'.$this->rec_doc['obj_name'].'"') ;
	     $report_obj=REPORTS()->get_report_obj_by_code($this->rec_doc['report_code']) ;
	     $report_obj->filter['doc_id']=$this->rec_doc['pkey'];
	     $report_obj->filter['mo_id']=$this->rec_doc['mo_id'];
	     $report_obj->content_edit() ;
     }
   }


 }



}



?>