Show if a project is public and then disable sharing

This commit is contained in:
Eike Foken
2011-09-28 21:08:12 +02:00
parent 67730d4557
commit c86a4e5c3e
2 changed files with 29 additions and 8 deletions

View File

@@ -5,7 +5,17 @@
<div class="title"> <div class="title">
<h2> <h2>
<?=anchor('projects', _('Projects'));?> &raquo; <?=$project['name'];?> <?=anchor('projects', _('Projects'));?> &raquo; <?=$project['name'];?>
<?php
if ($project['public'] == 1):
?>
<a class="share" href="<?=site_url('projects/shares/' . $project['id']);?>"><?=_('Public for all');?></a>
<?php
else:
?>
<a class="share" href="<?=site_url('projects/shares/' . $project['id']);?>"><?=_(sprintf('Shared with %s people', count($shares)));?></a> <a class="share" href="<?=site_url('projects/shares/' . $project['id']);?>"><?=_(sprintf('Shared with %s people', count($shares)));?></a>
<?php
endif;
?>
</h2> </h2>
</div> </div>

View File

@@ -7,6 +7,14 @@
</div> </div>
<div class="box"> <div class="box">
<h3><?=_('Edit shares');?></h3>
<?php
if ($project['public'] == 1):
?>
<p><?=_('This project is public for all');?></p>
<?php
else:
?>
<form method="post" name="updateShares" action="?action=update"> <form method="post" name="updateShares" action="?action=update">
<table class="tableList"> <table class="tableList">
<thead> <thead>
@@ -39,8 +47,9 @@
</tbody> </tbody>
</table> </table>
</form> </form>
<p>
<p><a class="button save" href="javascript:void(0);" onclick="$('form[name=updateShares]').submit();"><?=_('Save and back');?></a></p> <a class="button save" href="javascript:void(0);" onclick="$('form[name=updateShares]').submit();"><?=_('Save and back');?></a>
</p>
<h3><?=_('Share with someone');?></h3> <h3><?=_('Share with someone');?></h3>
<form method="post" name="addShare" action="?action=add"> <form method="post" name="addShare" action="?action=add">
@@ -50,9 +59,8 @@
<select name="user_id" id="user_id" class="drop"> <select name="user_id" id="user_id" class="drop">
<?php <?php
foreach ($this->user->getAll() as $user): foreach ($this->user->getAll() as $user):
// don't list the user himself // don't list the user himself
if($user['id'] === $this->access->profile()->id || $user['id'] === $project['owner']) if ($user['id'] === $this->access->profile()->id || $user['id'] === $project['owner'])
continue; continue;
?> ?>
<option value="<?=$user['id'];?>"><?=$user['firstname'];?> <?=$user['lastname'];?></option> <option value="<?=$user['id'];?>"><?=$user['firstname'];?> <?=$user['lastname'];?></option>
@@ -67,6 +75,9 @@
</ul> </ul>
</form> </form>
</div> </div>
<?php
endif;
?>
</div> </div>