Nouvelle classe Membre, différente. D'autres modifs....
This commit is contained in:
+358
@@ -0,0 +1,358 @@
|
||||
<?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ées, on donne des données !!!';
|
||||
exit;
|
||||
}
|
||||
$version = new Version($_GET['v']);
|
||||
if(!$version->exists()){
|
||||
header ( 'Location:projets.php');
|
||||
$_SESSION ['current_error'] = 'Je vais avoir du mal à afficher les donées de la version né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\'être ici ...<br/> DEGAGEZ !!!';
|
||||
exit;
|
||||
}
|
||||
$su = $me?$version->getProject()->haveRights($me):FALSE OR $me?$me->isAdminLevelGreaterThan(12):FALSE;
|
||||
$ssu = $me?$me->getID() == $version->getProject()->getOwner()->getID():FALSE OR $me?$me->isAdminLevelGreaterThan(13):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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=jar&v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
|
||||
<img class="project_option_img<?php if(!($version->isJarPublic() OR $su)){echo(" disabeled");} ?>" alt="Télécharger le jar" title="Télé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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=java&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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=java&v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
|
||||
<img class="project_option_img<?php if(!($version->isJavaPublic() OR $su)){echo(" disabeled");} ?>" alt="Télécharger la source" title="Télé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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=javadoc&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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=javadoc&v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
|
||||
<img class="project_option_img<?php if(!($version->isJavadocPublic() OR $su)){echo(" disabeled");} ?>" alt="Télecharger la doc" title="Té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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=xlsm&v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
|
||||
<img class="project_option_img<?php if(!($version->isXlsmPublic() OR $su)){echo(" disabeled");} ?>" alt="Télécharger le xlsm" title="Télé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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=vb&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( '"http://megabernard.alwaysdata.net/megaDownload.php?t=vb&v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>>
|
||||
<img class="project_option_img<?php if(!($version->isVbPublic() OR $su)){echo(" disabeled");} ?>" alt="Télécharger la source" title="Télécharger la source" src="pictures/download_vb.png"/>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<script>
|
||||
var projectID = <?php echo $version->getProject()->getID(); ?>;
|
||||
var versionID = <?php echo $version->getID(); ?>;
|
||||
</script>
|
||||
|
||||
<?php if($ssu){ ?>
|
||||
|
||||
<br/>
|
||||
<br/><button id="editVersionButton">Editer la version</button>
|
||||
<br/><button id="deleteVersionButton">Supprimer la version</button>
|
||||
|
||||
<div class="fullscreen absent big-background-semi-opaque" id="editVersionPanel">
|
||||
<div class="screen-vertical-centered">
|
||||
<div class="screen-horizontal-centered" id="editVersionPan">
|
||||
<form id="eVersionForm">
|
||||
<label for="nVersionName">Nom de la version</label>
|
||||
<input type="text" id="nVersionName"><?php echo $version->getName(); ?></input><br/>
|
||||
<label for="languageSelect">Langage :</label>
|
||||
<select id="languageSelect">
|
||||
<option value="Java" <?php if($version->getLanguage() == Langage::$java)echo 'selected=""'; ?>>Java</option>
|
||||
<option value="VBA"<?php if($version->getLanguage() == Langage::$vba)echo 'selected=""'; ?>>VBA</option>
|
||||
</select><br/>
|
||||
<label for="VAlphaCheck">Alpha : </label>
|
||||
<input type="checkbox" id="VAlphaCheck" value="alpha" <?php if($version->isAlpha())echo 'checked=""'; ?>/><br/>
|
||||
<label for="VBetaCheck">Beta : </label>
|
||||
<input type="checkbox" id="VBetaCheck" value="beta" <?php if($version->isBeta())echo 'checked=""'; ?>/><br/>
|
||||
<label for="VReleaseCheck">Release : </label>
|
||||
<input type="checkbox" id="VReleaseCheck" value="release" <?php if($version->isRelease())echo 'checked=""'; ?>/><br/>
|
||||
<label for="VBuggedCheck">Bogué : </label>
|
||||
<input type="checkbox" id="VBuggedCheck" value="bugged" <?php if($version->isBugged())echo 'checked=""'; ?>/><br/>
|
||||
</form><br/>
|
||||
<ul class="gray-bordered fast-full-width gone-puce">
|
||||
Mise a jour de la liste
|
||||
</ul>
|
||||
<button id="editVersionDone">Modifier la version</button><br/>
|
||||
<button id="editVersionAbort">En fait ... non</button>
|
||||
<script>
|
||||
$('#nVersionName').on('input',updateVersionName);
|
||||
$('#newVersionPan form').bind('submit',function() {return false;});
|
||||
$('#editVersionDone').click(sendEditingRequest);
|
||||
$('#editVersionAbort').click(function(){
|
||||
$('#editVersionPanel').fadeOut(600);
|
||||
});
|
||||
var askVersionUpdate = function(){
|
||||
$.post('executor.php?action=getVersionList&p='+projectID,{},answerVersionList);
|
||||
};
|
||||
|
||||
|
||||
var answerVersionList = function(newList){
|
||||
var list = eval(newList);
|
||||
$('#newVersionPan ul').empty();
|
||||
$('#newVersionPan ul').append($('<li>‌</li>').attr('id',"versionAbsPotentialPos-1").addClass('potentialPos'));
|
||||
list.forEach(function(item,index){
|
||||
if(item['id'] != versionID){
|
||||
var element = $('<li></li>');
|
||||
element.text(item['name']);
|
||||
element.data('versionAbs',item['versionAbs']);
|
||||
element.addClass('hoverable');
|
||||
$('#newVersionPan ul').append(element);
|
||||
$('#newVersionPan ul').append($('<li>‌</li>').attr('id',"versionAbsPotentialPos" + index).addClass('potentialPos').css('display','none'));
|
||||
}else{
|
||||
window.currentIndex = $('#newVersionPan ul > li.hoverable').length - 1;
|
||||
window.savedCurrentIndex = currentIndex;
|
||||
}
|
||||
});
|
||||
$('#newVersionPan ul li.hoverable').mousemove(function(e){
|
||||
var itemIndex = $('#newVersionPan ul > li.hoverable').index(this);
|
||||
var index = (currentIndex < itemIndex)?itemIndex:itemIndex-1;
|
||||
if(currentIndex != index){
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','none');
|
||||
currentIndex = index;
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','block');
|
||||
}
|
||||
});
|
||||
$('#newVersionPan ul').click(function(){
|
||||
savedCurrentIndex = currentIndex;
|
||||
});
|
||||
$('#newVersionPan ul').hover(null,function(){
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','none');
|
||||
currentIndex = savedCurrentIndex;
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','block');
|
||||
});
|
||||
};
|
||||
function updateVersionName(){
|
||||
var name = $('#nVersionName').val();
|
||||
var pp = $('#newVersionPan ul li.potentialPos');
|
||||
(name.match(/^\s*$/))?pp.html('‌'):pp.text(name);
|
||||
}
|
||||
|
||||
function sendEditingRequest(){
|
||||
var name = $('#nVersionName').val();
|
||||
var langage = $('#languageSelect').val();
|
||||
var tags = new Array();
|
||||
$("#eVersionForm input:checked").each(function(){
|
||||
tags.push($( this ).val());
|
||||
});
|
||||
var insertIndex = savedCurrentIndex;
|
||||
|
||||
$.post('executor.php?action=editVersion&v='+versionID,{name:name,langage:langage,tags:tags.join(' '),insertIndex:insertIndex},answerEditionRequest);
|
||||
}
|
||||
|
||||
function answerEditionRequest(data){
|
||||
if(data.startsWith('Error')){
|
||||
console.log(data);//TODO la jolie boite de dialogue
|
||||
}else
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#deleteVersionButton').click(function(){
|
||||
$('#messagePan').addClass('redMessage').html('Voulez vous vraiment supprimer cette version ? Les fichiers seront supprimés automatiquement et seront irrécupérables et toutes les informations additionelles seront aussi supprimées et ce, définitivement !<br/><button>C\'est ainsi que version nous quitte ...</button><button>NONNNNNNN !!!!! NE MEURS PAS VERSIOOOOOOOON !!!!</button>');
|
||||
$('#messagePan button:nth-of-type(1)').click(function(){
|
||||
$.post('executor.php?action=delVersion&v='+versionID,{},function(data){
|
||||
if(data == 'ok')window.location.replace('projet.php?p='+projectID);
|
||||
});
|
||||
});
|
||||
$('#messagePan button:nth-of-type(2)').click(function(){
|
||||
$('#messagePanel').fadeOut(600);
|
||||
});
|
||||
$('#messagePanel').fadeIn(600);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#editVersionButton').click(function(){
|
||||
askVersionUpdate();
|
||||
updateVersionName();
|
||||
$('#editVersionPanel').fadeIn(600);
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php } if($su) { ?>
|
||||
|
||||
<br/><button id="manageFilesButton">Gérer les fichiers</button>
|
||||
|
||||
|
||||
<div class="fullscreen absent big-background-semi-opaque" id="newVersionPanel">
|
||||
<div class="screen-vertical-centered">
|
||||
<div class="screen-horizontal-centered" id="newVersionPan">
|
||||
<form id="nVersionForm">
|
||||
<label for="nVersionName">Nom de la version</label>
|
||||
<input type="text" id="nVersionName" /><br/>
|
||||
<label for="languageSelect">Langage :</label>
|
||||
<select id="languageSelect">
|
||||
<option value="Java">Java</option>
|
||||
<option value="VBA">VBA</option>
|
||||
</select><br/>
|
||||
<label for="nVAlphaCheck">Alpha : </label>
|
||||
<input type="checkbox" id="nVAlphaCheck" value="alpha"/><br/>
|
||||
<label for="nVBetaCheck">Beta : </label>
|
||||
<input type="checkbox" id="nVBetaCheck" value="beta"/><br/>
|
||||
<label for="nVReleaseCheck">Release : </label>
|
||||
<input type="checkbox" id="nVReleaseCheck" value="release"/><br/>
|
||||
<label for="nVBuggedCheck">Bogué : </label>
|
||||
<input type="checkbox" id="nVBuggedCheck" value="bugged"/><br/>
|
||||
</form><br/>
|
||||
<ul class="gray-bordered fast-full-width gone-puce">
|
||||
Mise a jour de la liste
|
||||
</ul>
|
||||
<button id="createVersionDone">Créer la version</button><br/>
|
||||
<button id="createVersionAbort">En fait ... non</button>
|
||||
<script>
|
||||
$('#nVersionName').on('input',updateVersionName);
|
||||
$('#newVersionPan form').bind('submit',function() {return false;});
|
||||
$('#createVersionDone').click(sendCreationRequest);
|
||||
$('#createVersionAbort').click(function(){
|
||||
$('#newVersionPanel').fadeOut(600);
|
||||
});
|
||||
var askVersionUpdate = function(){
|
||||
$.post('executor.php?action=getVersionList&p='+projectID,{},answerVersionList);
|
||||
};
|
||||
|
||||
|
||||
var answerVersionList = function(newList){
|
||||
var list = eval(newList);
|
||||
$('#newVersionPan ul').empty();
|
||||
$('#newVersionPan ul').append($('<li>‌</li>').attr('id',"versionAbsPotentialPos-1").addClass('potentialPos'));
|
||||
list.forEach(function(item,index){
|
||||
var element = $('<li></li>');
|
||||
element.text(item['name']);
|
||||
element.data('versionAbs',item['versionAbs']);
|
||||
element.addClass('hoverable');
|
||||
$('#newVersionPan ul').append(element);
|
||||
$('#newVersionPan ul').append($('<li>‌</li>').attr('id',"versionAbsPotentialPos" + index).addClass('potentialPos').css('display','none'));
|
||||
});
|
||||
window.currentIndex = $('#newVersionPan ul > li.hoverable').length - 1;
|
||||
window.savedCurrentIndex = currentIndex;
|
||||
$('#newVersionPan ul li.hoverable').mousemove(function(e){
|
||||
var itemIndex = $('#newVersionPan ul > li.hoverable').index(this);
|
||||
var index = (currentIndex < itemIndex)?itemIndex:itemIndex-1;
|
||||
if(currentIndex != index){
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','none');
|
||||
currentIndex = index;
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','block');
|
||||
}
|
||||
});
|
||||
$('#newVersionPan ul').click(function(){
|
||||
savedCurrentIndex = currentIndex;
|
||||
});
|
||||
$('#newVersionPan ul').hover(null,function(){
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','none');
|
||||
currentIndex = savedCurrentIndex;
|
||||
$("#versionAbsPotentialPos"+currentIndex).css('display','block');
|
||||
});
|
||||
};
|
||||
function updateVersionName(){
|
||||
var name = $('#nVersionName').val();
|
||||
var pp = $('#newVersionPan ul li.potentialPos');
|
||||
(name.match(/^\s*$/))?pp.html('‌'):pp.text(name);
|
||||
}
|
||||
|
||||
function sendCreationRequest(){
|
||||
var name = $('#nVersionName').val();
|
||||
var langage = $('#languageSelect').val();
|
||||
var tags = new Array();
|
||||
$("#nVersionForm input:checked").each(function(){
|
||||
tags.push($( this ).val());
|
||||
});
|
||||
var insertIndex = savedCurrentIndex;
|
||||
|
||||
$.post('executor.php?action=createVersion&p='+projectID,{name:name,langage:langage,tags:tags.join(' '),insertIndex:insertIndex},answerCreationRequest);
|
||||
}
|
||||
|
||||
function answerCreationRequest(data){
|
||||
if(!data.startsWith('www.bernard.890m.com')){
|
||||
console.log(data);//TODO la jolie boite de dialogue
|
||||
}else
|
||||
window.location.replace(data);
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fullscreen absent big-background-semi-opaque" id="messagePanel">
|
||||
<div class="screen-vertical-centered">
|
||||
<div class="screen-horizontal-centered" id="messagePan">
|
||||
<!-- Progamically filled -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#newVersionButton').click(function(){
|
||||
askVersionUpdate();
|
||||
$('#newVersionPanel').fadeIn(600);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?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 = "version.php?v=<?php echo $writingVersion->getID();?>"><?php echo $writingVersion->getName(); ?></a></td></tr>
|
||||
<?php }}?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php }?>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
<?php include 'includes/footer.php'; ?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user