bcom/projet.php
Mysaa 38ec48c9fc Maintenant, tout dans le executor.php. Fin de tempPreMega.
Ajout d'un super simulateur de tours de Monoï dans la page 404.
2021-06-06 12:48:11 +02:00

104 lines
6.0 KiB
PHP

<?php session_start(); ?>
<?php include_once 'clazz/Zincluder.php';?>
<!DOCTYPE html>
<html>
<head>
<?php include 'includes/meta.php'; ?>
</head>
<body>
<?php include 'includes/header.php'; ?>
<?php
//TODO re la fonction exiting
$me = Membre::me();
if(!isset($_GET['v'])){
header ( 'Location:projets.php');
$_SESSION ['current_error'] = 'Quand on demande des donn&eacute;es, on donne des donn&eacute;es !!!';
exit;
}
$version = new Version($_GET['v']);
if(!$version->exists()){
header ( 'Location:projets.php');
$_SESSION ['current_error'] = 'Je vais avoir du mal &agrave; afficher les don&eacute;es de la version n&eacute;ant ...';
exit;
}
if(count($version->getPublicFiles())<=0 && $me?$me->isAdminLevelLowerThan(12):FALSE && !$version->getProject()->haveRights()){
header ( 'Location:projets.php');
$_SESSION ['current_error'] = 'Vous n\'avez pas le droit d\'&ecirc;tre ici ...<br/> DEGAGEZ !!!';
exit;
}
$su = $me?$version->getProject()->haveRights($me):FALSE OR $me?$me->isAdminLevelHigherThan(12):FALSE;
?>
<h1>Le projet <?php echo($version->getProject()->getName()) ?> en version <?php echo($version->getName()) ?></h1>
<br/>
<?php if($version->getLanguage()->isJarAvalivable()){?>
<a class="project_option" href=<?php if($version->isJarPublic() OR $su){ echo( '"megaProcess/downloadJar.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isJarPublic() OR $su)){echo(" disabeled");} ?>" alt="T&eacute;l&eacute;charger le jar" title="T&eacute;l&eacute;charger le jar" src="pictures/download_jar.png"/>
</a>
<?php }if($version->getLanguage()->isJavaAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isJavaPublic() OR $su){ echo( '"megaProcess/viewJavaSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isJavaPublic() OR $su)){echo(" disabeled");} ?>" alt="Voir la source" title="Voir la source" src="pictures/view_code.png"/>
</a>
<?php }if($version->getLanguage()->isJavaAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isJavaPublic() OR $su){ echo( '"megaProcess/downloadJavaSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isJavaPublic() OR $su)){echo(" disabeled");} ?>" alt="T&eacute;l&eacute;charger la source" title="T&eacute;l&eacute;charger la source" src="pictures/download_code.png"/>
</a>
<?php }if($version->getLanguage()->isJavadocAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isJavadocPublic() OR $su){ echo( '"megaProcess/viewJavadoc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isJavadocPublic() OR $su)){echo(" disabeled");} ?>" alt="Voir la doc" title="Voir la doc" src="pictures/view_javadoc.png"/>
</a>
<?php }if($version->getLanguage()->isJavadocAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isJavadocPublic() OR $su){ echo( '"megaProcess/downloadJavadoc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isJavadocPublic() OR $su)){echo(" disabeled");} ?>" alt="T&eacute;lecharger la doc" title="T&eacute;lecharger la doc" src="pictures/download_javadoc.png"/>
</a>
<?php }if($version->getLanguage()->isXlsmAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isXlsmPublic() OR $su){ echo( '"megaProcess/downloadXlsm.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isXlsmPublic() OR $su)){echo(" disabeled");} ?>" alt="T&eacute;l&eacute;charger le xlsm" title="T&eacute;l&eacute;charger le xlsm" src="pictures/download_xlsm.png"/>
</a>
<?php }if($version->getLanguage()->isVbAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isVbPublic() OR $su){ echo( '"megaProcess/viewVbSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isVbPublic() OR $su)){echo(" disabeled");} ?>" alt="Voir la source" title="Voir la source" src="pictures/voir_vb.png"/>
</a>
<?php }if($version->getLanguage()->isVbAvalivable()){ ?>
<a class="project_option" href=<?php if($version->isVbPublic() OR $su){ echo( '"megaProcess/downloadVbSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
<img class="project_option_img<?php if(!($version->isVbPublic() OR $su)){echo(" disabeled");} ?>" alt="T&eacute;l&eacute;charger la source" title="T&eacute;l&eacute;charger la source" src="pictures/download_vb.png"/>
</a>
<?php } ?>
<br/>
<br/>
<?php $versions = Version::getFromProject($version->getProject()); ?>
<?php if(is_array($versions)){/* = if count(versions>1) */ ?>
<?php $languages = Langage::getLanguagesFromVersions($versions); ?>
<h3>Toutes les versions :</h3>
<br/>
<?php foreach($languages as $language){ ?>
<table class="versionTable">
<tr>
<th><?php echo $language->getName(); ?></th>
</tr>
<?php foreach (Utility::arrayIfNot($versions) as $writingVersion){if($writingVersion->getLanguage() == $language){ ?>
<tr><td><a href = "projet.php?v=<?php echo $writingVersion->getID();?>"><?php echo $writingVersion->getName(); ?></a></td></tr>
<?php }}?>
</table>
<?php } ?>
<?php }?>
<br/>
<br/>
<?php if($me?$version->getProject()->haveRights($me):FALSE){ ?>
<a href="newVersion.php?id=<?php echo $_GET['id'];?>">Nouvelle version</a><br/>
<a href="editVersion.php?id=<?php echo $_GET['id'];?>&amp;v=<?php echo $_GET['v'];?>">Modifier la version</a><br/>
<a href="delVersion.php?id=<?php echo $_GET['id'];?>&amp;v=<?php echo $_GET['v'];?>">Supprimer la version</a><br/>
<a href="editProject.php?id=<?php echo $_GET['id'];?>">Modifier le projet</a><br/>
<a href="delProject.php?id=<?php echo $_GET['id'];?>">Supprimer le projet</a><br/>
<?php } ?>
<br/>
<?php include 'includes/footer.php'; ?>
</body>
</html>