Commit a6bf441a authored by Feu's avatar Feu
Browse files

fix

parent bd4eb53a
......@@ -303,180 +303,7 @@ if ( $photo->is_valid() )
$site->end_page ();
exit();
}
/*
$phasso = new asso($site->db);
if ( $photo->meta_id_asso )
$phasso->load_by_id($photo->meta_id_asso);
$cts = new contents($path);
$imgcts = new contents();
$imgcts->add(new image($photo->id,"images.php?/".$photo->id.".diapo.jpg"));
$cts->add($imgcts,false,true,"sasimg");
if ( $metacat->is_valid() )
$exdata="meta_id_catph=".$metacat->id."&";
else
$exdata="";
$subcts = new contents();
$subcts->puts("<div id=\"sasnav\">");
if ( $idx != 0 )
{
$subcts->puts("<div id=\"back\">");
$subcts->puts("<a href=\"".$self."id_photo=".$photos[$idx-1]."\">");
$subcts->puts("<img src=\"images.php?/".$photos[$idx-1].".vignette.jpg\" alt=\"Precedent\" class=\"mininav\" />");
$subcts->puts("<img src=\"".$wwwtopdir."images/to_prev.png\" alt=\"Precedent\" class=\"mininavbtn\" />");
$subcts->puts("</a>");
$subcts->puts("</div>");
}
if ( $idx != $count-1 )
{
$subcts->puts("<div id=\"next\">");
$subcts->puts("<a href=\"".$self."id_photo=".$photos[$idx+1]."\">");
$subcts->puts("<img src=\"images.php?/".$photos[$idx+1].".vignette.jpg\" alt=\"Suivant\" class=\"mininav\" />");
$subcts->puts("<img src=\"".$wwwtopdir."images/to_next.png\" alt=\"Suivant\" class=\"mininavbtn\" />");
$subcts->puts("</a>");
$subcts->puts("</div>");
}
$subcts->puts("</div>");
if ( $Message )
{
$subcts->add_title(2,"Opération réussie");
$subcts->add_paragraph($Message);
}
$subcts->add_title(2,"Informations");
if ( !is_null($photo->date_prise_vue) && $photo->date_prise_vue > 3600 )
$subcts->add_paragraph(date("d/m/Y H:i:s",$photo->date_prise_vue));
if ( $phasso->is_valid() )
$subcts->add_paragraph(classlink($phasso));
if ( $photo->is_admin($site->user) && $photo->id_utilisateur_moderateur )
{
$modo = new utilisateur($site->db);
$modo->load_by_id($photo->id_utilisateur_moderateur);
$subcts->add_paragraph("Modéré par: ".classlink($modo));
}
if ( $photo->is_admin($site->user) && $photo->id_utilisateur )
{
$contrib = new utilisateur($site->db);
$contrib->load_by_id($photo->id_utilisateur);
$subcts->add_paragraph("Proposé par: ".classlink($contrib));
}
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"IF(utl_etu_utbm.surnom_utbm!='' AND utl_etu_utbm.surnom_utbm IS NOT NULL,utl_etu_utbm.surnom_utbm, CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`)) as `nom_utilisateur` " .
"FROM `sas_personnes_photos` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`sas_personnes_photos`.`id_utilisateur` " .
"LEFT JOIN `utl_etu_utbm` ON `utl_etu_utbm`.`id_utilisateur`=`utilisateurs`.`id_utilisateur` ".
"WHERE `sas_personnes_photos`.`id_photo`='".$photo->id."' " .
"ORDER BY `nom_utilisateur`");
if ( $can_comment )
{
$frm = new form("setcomment",$self."id_photo=".$photo->id,false,"POST","Commentaires");
$frm->add_hidden("action","setcomment");
$frm->add_text_area("commentaire","",$photo->commentaire,25,4);
$frm->add_submit("valid","Enregistrer");
$subcts->add($frm,true);
}
elseif ( $photo->commentaire != "")
{
$subcts->add_title(2,"Commentaires");
$subcts->add_paragraph(htmlentities($photo->commentaire,ENT_NOQUOTES,"UTF-8"));
}
$subcts->add(new sqltable(
"listper",
"Personnes", $req, $self."id_photo=".$photo->id,
"id_utilisateur",
array("nom_utilisateur"=>"Utilisateur"),
$can_write?array("delete"=>"Supprimer"):array(),
array(),
array( )
),true);
if ( $can_write )
{
$frm = new form("addpersonne",$self."id_photo=".$photo->id,false,"POST","Ajouter une personne");
if ( $ErrorPersonne )
$frm->error($ErrorPersonne);
$frm->add_hidden("action","addpersonne");
$frm->add_user_fieldv2("id_utilisateur","");
$frm->add_submit("valid","Ajouter");
$subcts->add($frm,true);
if ( $photo->incomplet )
{
$frm = new form("setfull","photos.php?id_photo=".$photo->id,false,"POST","Liste complète");
$frm->add_hidden("action","setfull");
$frm->add_info("Toutes les personnes étant sur la photo (au premier plan) sont dans la liste.");
if ( $req->lines==0 )
$frm->add_info("ou il n'y a personnes sur cette photo (de reconaissable).");
$frm->add_submit("valid","Oui");
$subcts->add($frm,true);
}
$subcts->add_title(2,"Outils");
$subcts->add_paragraph("<a href=\"".$self."id_photo=".$photo->id."&amp;page=edit\">Editer</a>");
$subcts->add_paragraph("<a href=\"".$self."id_photo=".$photo->id."&amp;action=delete\">Supprimer</a>");
}
else
{
if ( $photo->incomplet )
{
$frm = new form("suggestpersonne",$self."id_photo=".$photo->id,false,"POST","Ajouter une personne");
$frm->add_hidden("action","suggestpersonne");
if ( $ErrorSuggest )
$frm->error($ErrorSuggest);
$frm->add_info("Vous pouvez ajouter une personne se trouvant sur cette photo. Votre propositon sera cependant soumise à modération.");
$frm->add_user_fieldv2("id_utilisateur","");
$frm->add_submit("valid","Ajouter");
$subcts->add($frm,true);
}
$subcts->add_title(2,"Outils");
}
$subcts->add_paragraph("<a href=\"images.php?/".$photo->id.".jpg\">Version HD</a>");
$subcts->add_paragraph("<a href=\"".$self."id_photo=".$photo->id."&amp;page=askdelete\">Demander le retrait</a>");
$cts->add($subcts,false,true,"photoinfo");
$cts->puts("<div class=\"clearboth\"></div>");
if ( $_REQUEST["fetch"] == "cts1" )
{
echo "<h1>".$cts->title."</h1>\n";
if ( $cts->toolbox )
{
echo "<div class=\"toolbox\">\n";
echo $cts->toolbox->html_render()."\n";
echo "</div>\n";
}
echo $cts->html_render();
exit();
}
$site->start_page(CMS_PREFIX."sas","Photos",true);
$site->add_contents($cts);
$site->end_page ();*/
$cts = new sasphoto ( $path, "photos.php", $cat, $photo, $site->user, $Message, $metacat );
if ( $_REQUEST["fetch"] == "photocts" )
......
......@@ -56,13 +56,13 @@ class stdentity
*/
function get_display_name()
{
if ( isset($this->nom) )
if ( !empty($this->nom) )
return $this->nom;
if ( isset($this->titre) )
if ( !empty($this->titre) )
return $this->titre;
if ( isset($this->num) )
if ( !empty($this->num) )
return "n°".$this->num;
return "n°".$this->id;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment