<?php
include_once('c_mo.php') ;
class c_page_cab_mo_doc extends c_page_cab_mo
{
 public $h1='Документ по МО' ;
 public $rec_doc=array();

 function block_main()
 { if ($this->filter['doc_code']) $this->rec_doc=$this->docs[$this->filter['doc_code']]['doc'] ;
   if ($this->filter['doc_id']) $this->rec_doc=DOCS()->get_doc_by_id($this->filter['doc_id']) ;

   if ($this->rec_doc['pkey'])
   { if (!$this->rec_doc['edit'])
     {  //damp_array($this->rec_doc) ;
     $options=array() ;
     $options['after_delete_doc_go_url']='/cab/mo/'.$this->rec_mo['pkey'].'/' ;
     $options['after_sign_doc_go_url']='/cab/mo/'.$this->rec_mo['pkey'].'/doc/[doc_id='.$this->rec_doc['pkey'].']/' ;
     $options['doc_sign_page']='/cab/mo/'.$this->rec_mo['pkey'].'/sign_doc/[doc_id='.$this->rec_doc['pkey'].']/' ;
     $options['sign_before_print']=1 ;
     $this->panel_doc_view($options) ;
     }
     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_mo['pkey'];
         $report_obj->content_edit() ;
     }
     //$this->generate_PDF() ;

   }
 }

}

?>






























