<?php
include_once("c_personal_person.php");
class c_page_cab_personal_person_docs extends c_page_cab_personal_person
{
  public $h1='Карточка сотрудника - документы' ;

 function select_obj_info()
 {  parent::select_obj_info() ;
    if ($this->filter['doc_id']) $this->rec_doc=DOCS()->get_doc_by_id($this->filter['doc_id']) ;
 }

 function get_cur_page_meta_tags()
 {
   if ($this->rec_personal['pkey']) $this->h1='Документы '.$this->rec_personal['obj_name'] ;
   if ($this->rec_doc['pkey']) $this->h1='Документ "'.$this->rec_doc['obj_name'].'"' ;
    //$this->h1='Документы '.$this->rec_personal['obj_name'] ;
 }

 function second_menu_config()
 { $this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/docs/']=array('title'=>'Документы','class'=>'fa fa-user-md') ;
   $this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/docs/new/']=array('title'=>'Новый документ','class'=>'fa fa-user-md') ;
   //$this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/scan/']=array('title'=>'Сканы','class'=>'fa fa-user-md') ;
   //$this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/scan/upload/']=array('title'=>'Загрузить скан','class'=>'fa fa-user-md') ;
   //if (defined('_CUR_ID2')) $this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/scan/working/'._CUR_ID2.'/']=array('title'=>'Обработать скан','class'=>'fa fa-user-md') ;
   if ($this->rec_doc['pkey']) $this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/docs/[doc_id='.$this->rec_doc['pkey'].']/']=array('title'=>$this->rec_doc['obj_name'],'class'=>'fa fa-user-md') ;
   //$this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/db/evt/']=array('title'=>'Лог событий','class'=>'fa fa-user-md') ;
   //$this->second_menu['/cab/personal/person/'.$this->rec_personal['pkey'].'/db/check/']=array('title'=>'Проверки','class'=>'fa fa-user-md') ;
 }

 function block_main()
 { $this->page_title() ;
   if ($this->rec_doc['pkey']) $this->panel_doc_view() ;
   else $this->panel_report() ;
 }

 function panel_report()
 {  include_once(_DIR_EXT.'/docs/report_docs.php') ;
     $report_obj=new report_docs() ;
     $report_obj->no_view_title=1 ;
     $report_obj->view_panel_info=0 ;
     $report_obj->filter['personal_id']=$this->rec_personal['pkey'] ;
     $report_obj->view_as_HTML(array('no_view_person'=>1,'doc_url_template'=>'/cab/personal/person/'.$this->rec_personal['pkey'].'/docs/[doc_id=***]/')) ;
 }

}



?>
