NOUVELLE VERSION !!! Des nouvelles classes de partout, et des supers procédures SQL.
This commit is contained in:
+35
-42
@@ -1,53 +1,44 @@
|
||||
<?php session_start(); ?>
|
||||
<?php include_once 'clazz/Zincluder.php';?>
|
||||
<?php
|
||||
session_start();
|
||||
include_once 'clazz/Zincluder.php';
|
||||
|
||||
try{
|
||||
|
||||
$projet = Projet::showProject($_SESSION['session_id'] ?? NULL,$_SESSION['session_mdp'] ?? NULL,$_GET['p'] ?? NULL);
|
||||
|
||||
|
||||
}catch(SQLProcessingException $e){
|
||||
error_log($e);
|
||||
echo $e->getHtmlMessage();
|
||||
$_SESSION ['current_error'] = $e->getHtmlMessage();
|
||||
header ( 'Location:' . $e->getPreferredRedirection() ?? 'others.php' );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<?php include 'includes/meta.php'; ?>
|
||||
<script>
|
||||
var projectID = <?php echo $_GET['p']; ?>;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php include 'includes/header.php'; ?>
|
||||
<?php
|
||||
//TODO re la fonction exiting
|
||||
$me = Membre::me();
|
||||
if(!isset($_GET['p'])){
|
||||
header ( 'Location:projets.php');
|
||||
$_SESSION ['current_error'] = 'Quand on demande des données, on donne des données !!!';
|
||||
exit;
|
||||
}
|
||||
$projet = new Projet($_GET['p']);
|
||||
if(!$projet->exists()){
|
||||
header ( 'Location:projets.php');
|
||||
$_SESSION ['current_error'] = 'Je vais avoir du mal à afficher les donées du projet néant ...';
|
||||
exit;
|
||||
}
|
||||
if(!($projet->isPublic() or $me?$me->isAdminLevelGreaterThan(12):FALSE or $me?$projet->haveRights($me):FALSE)){
|
||||
header ( 'Location:projets.php');
|
||||
$_SESSION ['current_error'] = 'Vous n\'avez pas le droit d\'être ici ...<br/> DEGAGEZ !!!';
|
||||
exit;
|
||||
}
|
||||
|
||||
$su = $me?$projet->haveRights($me):FALSE OR $me?$me->isAdminLevelGreaterThan(12):FALSE;
|
||||
$ssu = $me?$me->getID() == $projet->getOwner()->getID():FALSE OR $me?$me->isAdminLevelGreaterThan(13):FALSE;
|
||||
?>
|
||||
|
||||
<h1>Mes projets</h1>
|
||||
<script>
|
||||
var projectPublic = <?php echo $projet->isPublic()?'true':'false'; ?>;
|
||||
var projectPublic = <?php echo $projet['public']?'true':'false'; ?>;
|
||||
</script>
|
||||
<h1>Le projet <?php echo($projet->getName()); ?></h1>
|
||||
<h1>Le projet <?php echo($projet['name']); ?></h1>
|
||||
<br/>
|
||||
|
||||
<?php
|
||||
$ssu = $projet['ownerID'] == ($_POST['session_id'] ?? -1);
|
||||
$couple = Utility::getHierarchicCouple();
|
||||
echo $couple[0] . ' : ' . $projet->getOwner()->getPseudo() . '<br/>';
|
||||
echo $couple[0] . ' : ' . $projet['ownerPseudo'] . '<br/>';
|
||||
$str = $couple[1] . ' : ';
|
||||
foreach($projet->getSecondaryOwners() as $sowner)
|
||||
$str .= $sowner->getPseudo() . ', ';//TODO add link to membre.php
|
||||
if(count($projet->getSecondaryOwners()) > 0)
|
||||
foreach($projet['sowners'] as $sowner)
|
||||
$str .= $sowner['pseudo'] . ', ';//TODO add link to membre.php
|
||||
if(count($projet['sowners']) > 0)
|
||||
echo '<span id="sOwnersText">'.substr($str,0,-2).'</span>';
|
||||
?>
|
||||
|
||||
@@ -295,7 +286,7 @@
|
||||
}
|
||||
|
||||
function answerCreationRequest(data){
|
||||
if(!data.startsWith('www.bernard.890m.com')){
|
||||
if(data != 'ok'){
|
||||
console.log(data);//TODO la jolie boite de dialogue
|
||||
}else
|
||||
window.location.replace(data);
|
||||
@@ -335,18 +326,20 @@
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<?php $versions = Version::getFromProject($projet); ?>
|
||||
<?php if(is_array($versions)){/* = if count(versions>1) */ ?>
|
||||
<?php $languages = Langage::getLanguagesFromVersions($versions); ?>
|
||||
<?php if(count($projet['versions']) > 0){ ?>
|
||||
<?php $languages = array();
|
||||
foreach($projet['versions'] AS $version)
|
||||
array_push($languages,$version['language']);
|
||||
$languages = array_unique($languages,SORT_REGULAR); ?>
|
||||
<h3>Toutes les versions :</h3>
|
||||
<br/>
|
||||
<?php foreach($languages as $language){ ?>
|
||||
<table class="versionTable">
|
||||
<tr>
|
||||
<th><?php echo $language->getName(); ?></th>
|
||||
<th><?php echo Langage::getFromId($language)->getName(); ?></th>
|
||||
</tr>
|
||||
<?php foreach (Utility::arrayIfNot($versions) as $writingVersion){if($writingVersion->getLanguage() == $language){ ?>
|
||||
<tr><td><a href = "version.php?v=<?php echo $writingVersion->getID();?>"><?php echo $writingVersion->getName(); ?></a></td></tr>
|
||||
<?php foreach ($projet['versions'] as $writingVersion){if($writingVersion['language'] == $language){ ?>
|
||||
<tr><td><a href = "version.php?v=<?php echo $writingVersion['ID'];?>"><?php echo $writingVersion['name']; ?></a></td></tr>
|
||||
<?php }}?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user