);
}
+ function groupes(){
+ $env = $this->env();
+ if(
+ !($sources_invitations_controller = $env->get_controller("users/sources_invitations"))
+ || !$sources_invitations_controller->validate()
+ ){
+ $env->erreur("impossible de valider le controleur users/sources_invitations");
+ return;
+ }
+ $sources_invitations_controller->source_groupes();
+ }
+
}
?>
\ No newline at end of file
);
}
+ function groupes(){
+ $env = $this->env();
+ if(
+ !($sources_invitations_controller = $env->get_controller("users/sources_invitations"))
+ || !$sources_invitations_controller->validate()
+ ){
+ $env->erreur("impossible de valider le controleur users/sources_invitations");
+ return;
+ }
+ $sources_invitations_controller->source_groupes();
+ }
+
}
?>
\ No newline at end of file
);
}
+ function groupes(){
+ $env = $this->env();
+ if(
+ !($sources_invitations_controller = $env->get_controller("users/sources_invitations"))
+ || !$sources_invitations_controller->validate()
+ ){
+ $env->erreur("impossible de valider le controleur users/sources_invitations");
+ return;
+ }
+ $sources_invitations_controller->source_groupes();
+ }
+
}
?>
\ No newline at end of file
return true;
}
- function del_source_groupe($id)
- { $sgbd = $this->sgbd();
+ function del_source_groupe($id_source, $id_author){
+ $sgbd = $this->sgbd();
try{
- $sql = "DELETE FROM #--sml_sources_authors WHERE id=".$this->eq($id);
+ $sql =
+ "DELETE FROM #--sml_sources_authors"
+ ." WHERE id_source=".$this->eq($id_source)
+ ." AND id_author=".$this->eq($id_author);
$sgbd->query($sql);
}
catch(Exception $e) { return false; }
.source_groupes .access{
color: #666666;
padding-left: 20px;
-}
\ No newline at end of file
+}
+
+/* ------------------------ invitations -------------------- */
+
+.invitation_title{
+ border-bottom: solid 1px #e5e5e5;
+}
+
+.invitation_date{
+ text-align: right;
+ font-size: 0.8em;
+}
<albums page="compte.php" content="views/users/albums/list.php">
<add content="views/users/albums/add.php" />
<edit content="views/users/albums/edit.php" />
+ <groupes content="views/users/albums/groupes.php" />
</albums>
<morceaux page="compte.php" content="views/users/morceaux/list.php">
<add content="views/users/morceaux/add.php" />
<edit content="views/users/morceaux/edit.php" />
+ <groupes content="views/users/morceaux/groupes.php" />
</morceaux>
<pistes page="compte.php" content="views/users/pistes/list.php">
<add content="views/users/pistes/add.php" />
<add_source content="views/users/pistes/add_source.php" />
<edit content="views/users/pistes/edit.php" />
+ <groupes content="views/users/pistes/groupes.php" />
</pistes>
+ <sources_invitations page="compte.php" content="views/users/sources_invitations/list.php">
+ <index content="views/users/sources_invitations/list.php" />
+ </sources_invitations>
</users>
</layout>
\ No newline at end of file
</li>
<?php endforeach; ?>
</ul>
-
+<div class="clear"><!-- --></div>
<?php $items = "groupes"; $legend = "groupes"; require $this->out_file("views/navig.php"); ?>
<?php endif; ?>
</ul>
-<!-- ul class="buttons">
- <li><a href="<?php echo $this->url("users/albums/groupes") ?>">Editer les groupes de l'album</a></li>
-</ul -->
+<?php if($this->out["album"]["permissions"]["admin"]) : ?>
+<ul class="buttons">
+ <li><a href="<?php echo $this->url("users/albums/groupes", array("id" => $this->out["album"]["id"])) ?>">Editer les groupes de l'album</a></li>
+</ul>
+<?php endif; ?>
<ul class="form">
</ul>
-<!-- ul class="buttons">
- <li><a href="<?php echo $this->url("users/morceaux/groupes") ?>">Editer les groupes du morceau</a></li>
-</ul -->
+<?php if($this->out["morceau"]["permissions"]["admin"]) : ?>
+<ul class="buttons">
+ <li><a href="<?php echo $this->url("users/morceaux/groupes", array("id" => $this->out["morceau"]["id"])) ?>">Editer les groupes du morceau</a></li>
+</ul>
+<?php endif; ?>
<ul>
-<?php require $this->out_file("views/tinymce.init.js.php"); $data = $this->data(); ?>
-
-<h2>Modifier les groupes d'un morceau</h2>
-
-<script type="text/javascript">
+<h2>Les groupes pour le morceau <?php echo $this->out["source"]["titre"]; ?></h2>
<ul class="buttons">
- <li><a href="<?php echo $this->url("users/morceaux/edit", array("id" => $this->out["morceau"]["id"])) ?>">Retour au morceau</a></li>
+ <li><a href="<?php echo $this->url("users/morceaux/edit", array("id" => $this->out["source"]["id"])) ?>">Retour au morceau</a></li>
<li><a href="<?php echo $this->url("users/morceaux") ?>">Retour à la liste des morceaux</a></li>
</ul>
-<form action="<?php echo $this->url("users/morceaux/groupes", array("id" => $this->out["morceau"]["id"])) ?>" method="post">
- <fieldset>
- <table class="admin">
- <tr>
- <th>groupe</th>
- <th>accès</th>
- <th align="center">enlever</th>
- </tr>
- <?php foreach($this->out["morceaux"]["groupes"] as $id_groupe => $groupe) : ?>
- <tr class="hl">
- <td>
- <?php echo $groupe["nom"]; ?>
- </td>
- <td>
- <select name="source_access_<?php echo $id_groupe; ?>" id="source_access_<?php echo $id_groupe; ?>">
- <?php foreach($this->out["sources_access"]["list"] as $id_source_access => $source_access) : ?>
- <option value="<?php echo $id_source_access ?>"<?php echo $groupe["id_groupe_status"] == $id_source_access ? " selected" : ""><?php echo $source_access["intitule"] ?></option>
- <?php endforeach; ?>
- </select>
- </td>
- <td class="action">
- <a href="<?php echo $this->url("users/morceaux/del_groupe", array("morceau" => $id_morceau, "groupe" => $id_groupe)) ?>"
- class="admin_link"
- title="enlever ce groupe"><img src="<?php echo $this->out_url("icons/del.gif") ?>"
- onclick="return confirm('enlever ce groupe ?')"/></a>
- </td>
- </tr>
- <?php endforeach; ?>
- </table>
- <ul class="form">
- <li class="buttons">
- <div class="form_buttons">
- <input type="submit" value="Enregistrer les accès" />
- </div>
- </li>
- </ul>
- </fieldset>
-</form>
-
-<?php if($this->out["groupes"]["total"] > 0) : ?>
-
-<h3>Ajouter un groupe</h3>
-
-<form name="morceau_form" action="<?php echo $this->url("users/morceaux/add_groupe", array("morceau" => $id_morceau, "groupe" => $id_groupe)) ?>" method="post">
- <fieldset>
- <ul class="form">
- <li>
- <label for="id_groupe">groupe</label>
- <div class="form_input">
- <select name="id_groupe" id="id_groupe">
- <?php foreach($this->out["groupes"]["list"] as $id_groupe => $groupe) : ?>
- <option value="<?php echo $id_groupe ?>"><?php echo $groupe["nom"] ?></option>
- <?php endforeach; ?>
- </select>
- </div>
- </li>
- <li>
- <label for="source_access_<?php echo $id_groupe; ?>">Accès</label>
- <div class="form_input">
- <select name="source_access_<?php echo $id_groupe; ?>" id="source_access_<?php echo $id_groupe; ?>">
- <?php foreach($this->out["sources_access"]["list"] as $id_source_access => $source_access) : ?>
- <option value="<?php echo $id_source_access ?>"><?php echo $source_access["intitule"] ?></option>
- <?php endforeach; ?>
- </select>
- </div>
- </li>
- <li class="buttons">
- <div class="form_buttons">
- <input type="submit" value="Ajouter" />
- </div>
- </li>
- </ul>
- </fieldset>
-</form>
-
-<?php endif; ?>
+<?php require $this->out_file("views/users/source_groupes_form.php"); ?>
</ul>
-<!-- ul class="buttons">
- <li><a href="<?php echo $this->url("users/pistes/groupes") ?>">Editer les groupes de la piste</a></li>
-</ul -->
+<?php if($this->out["piste"]["permissions"]["admin"]) : ?>
+<ul class="buttons">
+ <li><a href="<?php echo $this->url("users/pistes/groupes", array("id" => $this->out["piste"]["id"])) ?>">Editer les groupes de la piste</a></li>
+</ul>
+<?php endif; ?>
<ul>
$env->set_link("users/albums", $env->url("users/albums"), "Albums", 31);
$env->set_link("users/morceaux", $env->url("users/morceaux"), "Morceaux", 32);
$env->set_link("users/pistes", $env->url("users/pistes"), "Sources", 33);
+ $env->set_link("users/sources_invitations", $env->url("users/sources_invitations"), "Invitations", 34);
$env->set_link("menu_top/groupes", $env->url("sources/groupe"), "Groupes", 10);
$env->set_link("menu_top/albums", $env->url("sources/album"), "Albums", 11);
.") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
$sgbd->query($sql);
+ $sql =
+ "CREATE TABLE `#--sml_sources_invitations`("
+ ." `id` INT(11) NOT NULL AUTO_INCREMENT,"
+ ." `id_user` INT(11) NOT NULL,"
+ ." `id_source` INT(11) NOT NULL,"
+ ." `id_author` INT(11) NOT NULL,"
+ ." `id_sources_access` INT(11) NOT NULL,"
+ ." PRIMARY KEY (`id`)"
+ .")";
+ $sgbd->query($sql);
+
}
catch(Exception $e){
return "imposible de creer les tables en base";
catch(Exception $e){
return "impossible de supprimer la table #--sml_source_documents";
}
+ try{
+ $sgbd->query("DROP TABLE #--sml_sources_invitations");
+ }
+ catch(Exception $e){
+ return "impossible de supprimer la table #--sml_sources_invitations";
+ }
return true;
}