return $sources;
}
+ function source_has_groupe($id_source, $id_groupe){
+ $sgbd = $this->sgbd();
+ $HAS_THIS_GROUP = 0;
+ try{
+ $sql =
+ "SELECT count(*) as n FROM #--sml_sources_authors"
+ ." WHERE id_source=".$this->eq($id_source)
+ ." AND id_author=".$this->eq($id_groupe);
+ $rst = $sgbd->query($sql);
+ if($v_rst = $sgbd->fetch_assoc($rst)) $HAS_THIS_GROUP = $v_rst["n"];
+ $sgbd->free_result($rst);
+ }
+ catch(Exception $e) { $HAS_THIS_GROUP = false; }
+ return $HAS_THIS_GROUP;
+ }
+
function add_source_groupe($id_source, $id_groupe, $id_groupe_status)
{ $sgbd = $this->sgbd();
try{
function get_editor_groupes($groupes){
$editor_groupes = array();
- if(is_array($groupes)) foreach($groupes as $source_groupe)
- { if(
+ if(is_array($groupes)) foreach($groupes as $source_groupe){
+ if(
$source_groupe["id_groupe_status"] == $this->id_groupe_status_admin()
|| $source_groupe["id_groupe_status"] == $this->id_groupe_status_editeur()
){
return $permissions;
}
+// --------------------------------------------------------------------
+
+ function sources_invitations($groupes, $id_user){
+ $groupes_in = "";
+ foreach($groupes as $id_groupe => $groupe) $groupes_in .= ($groupes_in ? "," : "").$id_groupe;
+ return $this->list_sml_sources_invitations(
+ array(
+ "index_name" => "id",
+ "where"=> ($groupes_in ? "id_author IN(".$groupes_in.") OR " : "")."id_user=".$id_user,
+ "order_by" => "date_invitation",
+ "order" => "DESC"
+ )
+ );
+ }
+
}
?>
\ No newline at end of file