projects
/
mw_sourceml
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52f8463
)
algo data groupes_sources
author
dj3c1t
<dj3c1t@free.fr>
Fri, 9 May 2014 15:41:33 +0000
(17:41 +0200)
committer
dj3c1t
<dj3c1t@free.fr>
Fri, 9 May 2014 15:41:33 +0000
(17:41 +0200)
app/data/modules/xml/sml_data_source_groupes.php
patch
|
blob
|
history
diff --git
a/app/data/modules/xml/sml_data_source_groupes.php
b/app/data/modules/xml/sml_data_source_groupes.php
index
cc21ed9
..
fead1be
100644
(file)
--- a/
app/data/modules/xml/sml_data_source_groupes.php
+++ b/
app/data/modules/xml/sml_data_source_groupes.php
@@
-32,7
+32,7
@@
{ $groupes[$v_rst["id"]] = $v_rst;
$groupes[$v_rst["id"]]["id_groupe_status"] = $groupes_status[$v_rst["id"]];
$groupes[$v_rst["id"]]["image_uri"] =
{ $groupes[$v_rst["id"]] = $v_rst;
$groupes[$v_rst["id"]]["id_groupe_status"] = $groupes_status[$v_rst["id"]];
$groupes[$v_rst["id"]]["image_uri"] =
- ( $v_rst["image"] ?
+ (
isset($v_rst["image"]) &&
$v_rst["image"] ?
$env->path("content")."uploads/".$v_rst["image"]
: ""
);
$env->path("content")."uploads/".$v_rst["image"]
: ""
);
@@
-75,9
+75,9
@@
$author_ids = array();
foreach($groupes as $i => $groupe) $author_ids[$groupe["id"]] = true;
$sgbd = $this->sgbd();
$author_ids = array();
foreach($groupes as $i => $groupe) $author_ids[$groupe["id"]] = true;
$sgbd = $this->sgbd();
- $
_source
s = array();
+ $
author
s = array();
if($rst = $sgbd->open_data("sml_sources_authors")){
if($rst = $sgbd->open_data("sml_sources_authors")){
- while(($
_source
s !== false) && $v_rst = $sgbd->fetch_data($rst)){
+ while(($
author
s !== false) && $v_rst = $sgbd->fetch_data($rst)){
if(isset($v_rst)){
if(
isset($v_rst["id"])
if(isset($v_rst)){
if(
isset($v_rst["id"])
@@
-89,29
+89,26
@@
isset($source_access_ids[$v_rst["id_sources_access"]])
&& isset($author_ids[$v_rst["id_author"]])
){
isset($source_access_ids[$v_rst["id_sources_access"]])
&& isset($author_ids[$v_rst["id_author"]])
){
- $_sources[$v_rst["id_source"]] = array(
- "id_source" => $v_rst["id_source"],
- "id_author" => $v_rst["id_author"],
-
)
;
+ if(!isset($authors[$v_rst["id_source"]])){
+ $authors[$v_rst["id_source"]] = array();
+ }
+
$authors[$v_rst["id_source"]][] = $v_rst["id_author"]
;
}
}
}
}
}
}
- else $
_source
s = false;
+ else $
author
s = false;
}
$sgbd->close_data($rst);
}
}
$sgbd->close_data($rst);
}
- else $
_source
s = false;
- if($
_source
s === false) return false;
+ else $
author
s = false;
+ if($
author
s === false) return false;
if($rst = $sgbd->open_data("sml_sources")){
while(($sources !== false) && $v_rst = $sgbd->fetch_data($rst)){
if(isset($v_rst) && isset($v_rst["id"])){
if($rst = $sgbd->open_data("sml_sources")){
while(($sources !== false) && $v_rst = $sgbd->fetch_data($rst)){
if(isset($v_rst) && isset($v_rst["id"])){
- if(isset($
_source
s[$v_rst["id"]])){
+ if(isset($
author
s[$v_rst["id"]])){
if(!isset($params["id_class"]) || (isset($v_rst["id_class"]) && ($v_rst["id_class"] == $params["id_class"]))){
if(!isset($params["id_class"]) || (isset($v_rst["id_class"]) && ($v_rst["id_class"] == $params["id_class"]))){
- if(!isset($sources[$v_rst["id"]])){
- $sources[$v_rst["id"]] = $v_rst;
- $sources[$v_rst["id"]]["authors"] = array();
- }
- $sources[$v_rst["id"]]["authors"][] = $_sources[$v_rst["id"]]["id_author"];
+ $sources[$v_rst["id"]] = $v_rst;
+ $sources[$v_rst["id"]]["authors"] = $authors[$v_rst["id"]];
}
}
}
}
}
}
@@
-120,7
+117,7
@@
$sgbd->close_data($rst);
}
else $sources = false;
$sgbd->close_data($rst);
}
else $sources = false;
- if($
_
sources === false) return false;
+ if($sources === false) return false;
foreach($sources as $id_source => $source){
if($satisfy_all_groupes_access){
if(count($source["authors"]) < count($groupes)){
foreach($sources as $id_source => $source){
if($satisfy_all_groupes_access){
if(count($source["authors"]) < count($groupes)){