<?php
$__functions['init'][]='_daily_briefing_admin_vars' ;
$__functions['boot_admin'][]='_daily_briefing_admin_boot' ;
$__functions['install'][]='_daily_briefing_install_modul' ;

function _daily_briefing_admin_vars()
{
    $_SESSION['descr_clss'][269]['name']='Ежедневные инструктажи' ;
    $_SESSION['descr_clss'][269]['parent']=0 ;
    $_SESSION['descr_clss'][269]['fields']['account_create_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][269]['fields']['group_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][269]['fields']['briefing_type']=array('type'=>'varchar(64)') ;
    $_SESSION['descr_clss'][269]['fields']['enabled']=array('type'=>'int(1)','default'=>1) ;
    $_SESSION['descr_clss'][269]['index']['account_create_id']='account_create_id' ;
    $_SESSION['descr_clss'][269]['index']['group_id']='group_id' ;
    $_SESSION['descr_clss'][269]['index']['briefing_type']='briefing_type' ;
    $_SESSION['descr_clss'][269]['index']['enabled']='enabled' ;

    $_SESSION['descr_clss'][270]['name']='Прохождение ежедневных инструктажей' ;
    $_SESSION['descr_clss'][270]['parent']=0 ;
    $_SESSION['descr_clss'][270]['fields']['briefing_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['personal_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['propusk']=array('type'=>'varchar(64)') ;
    $_SESSION['descr_clss'][270]['fields']['status']=array('type'=>'int(1)','default'=>1) ;
    $_SESSION['descr_clss'][270]['fields']['account_arrive_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['arrive_time']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['account_sign_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['sign_time']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['fields']['sign_fname']=array('type'=>'varchar(255)') ;
    $_SESSION['descr_clss'][270]['fields']['sign_data_fname']=array('type'=>'varchar(255)') ;
    $_SESSION['descr_clss'][270]['fields']['group_id']=array('type'=>'int(11)') ;
    $_SESSION['descr_clss'][270]['index']['briefing_id']='briefing_id' ;
    $_SESSION['descr_clss'][270]['index']['personal_id']='personal_id' ;
    $_SESSION['descr_clss'][270]['index']['status']='status' ;
    $_SESSION['descr_clss'][270]['index']['arrive_time']='arrive_time' ;
    $_SESSION['descr_clss'][270]['index']['sign_time']='sign_time' ;
    $_SESSION['descr_clss'][270]['index']['group_id']='group_id' ;
}

function _daily_briefing_admin_boot($options)
{
    create_system_modul_obj('daily_briefing',$options) ;
}

function _daily_briefing_install_modul($DOT_root)
{
    SETUP()->reg_rol(9,'Техник инструктажа','/cab/daily_briefing/') ;

    $pattern=array() ;
    $pattern['table_title']='Ежедневные инструктажи' ;
    $pattern['use_clss']='269' ;
    $pattern['table_name']='daily_briefing_list' ;
    $pattern['table_clss']='101' ;
    $pattern['table_parent']=$DOT_root;
    create_table_by_pattern($pattern) ;

    $pattern=array() ;
    $pattern['table_title']='Прохождение ежедневных инструктажей' ;
    $pattern['use_clss']='270' ;
    $pattern['table_name']='daily_briefing_pass' ;
    $pattern['table_clss']='101' ;
    $pattern['table_parent']=$DOT_root;
    create_table_by_pattern($pattern) ;

    create_dir('/public/daily_briefing_sign') ;
    create_dir('/public/daily_briefing_sign_data') ;

    SETUP()->reg_report('Ежедневные инструктажи','daily_briefing/report_daily_briefing_journal.php') ;         ////
}
?>
