<?php
ob_start();
if(!(is_readable(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc'))) {
	die('Error - Could not open or read file '.realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');
} else {
	include_once(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');
}

$cn = db_connect();
if (getSetting('portal','useRights',0) == 1){
        $contlng = 'lang='.db_getLanguageShortByID($cn, $_SESSION['user_idlanguagecontent']);
	$contlngid = $_SESSION['user_idlanguagecontent'];
} else {
        exit;
}
session_write_close();

$id = 0;

if (!isset($_REQUEST['skbranch']) || !isset($_REQUEST['oguid']) || !isset($_REQUEST['rguid'])) {
        //нет всех параметров 
        exit;
}
$version = db_getObjectFullVersion($cn, $_REQUEST['oguid'], $_REQUEST['skbranch'], $contlngid);
$versiondescription = db_getObjectVersionDescription($cn, $_REQUEST['oguid'], $_REQUEST['skbranch'], $contlngid);
if (isset($version) && strlen($version) > 0) {
?>
        <div id="box-frame-objectversion-cover">
                <div id="box-frame-objectversion" class="clearfix">
                        <div id="box-frame-header-left">        
                                <div>
                                        <div class="objectversion-float-left"><?php echo $version ?></div> 
                                        <div id="showversiondescription" class="objectversion-float-right objectversion-description-button-show objectversion-description-button"><img id="objectversion-description-button-icon" src="img/arrow-up.png"></div>
                                </div>
                                <div id="box-frame-description-title"><?php getResource("title.pollobjectanswer.objectversion");?>:</div>
                                <div id="box-frame-description-versiondescription" class="objectversion-description">
                                <?php echo $versiondescription; ?>
                                </div>
                        </div>
                </div>
        </div>
<?php
}

db_disconnect($cn);
ob_end_flush(); ?>