Compare commits

...

7 Commits

11 changed files with 36 additions and 52 deletions

View File

@ -67,10 +67,7 @@ class ThemeController extends Controller
$logo=$request->query->get('logo');
if(!empty($logo)) $session->set('logo',"bundles/cadolescore/themes/$themename/".$logo);
$fgheader=$request->query->get('fgheader');
if(!empty($fgheader)) $session->set('fgheader',boolval($fgheader));
$header=$request->query->get('header');
if(!empty($header)) $session->set('header',"bundles/cadolescore/themes/$themename/".$header);

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -14,7 +14,6 @@
render(url("cadoles_core_theme_setconfig",
{
'logo':logo,
'fgheader':fgheader,
'header': header,
'heightheader': heightheader,
'colormain': colormain,

View File

@ -285,7 +285,7 @@ class ApiController extends Controller
$ret_str=$ret_str."<categorie>";
$ret_str=$ret_str."<nom>Mes Ressources</nom>";
$ret_str=$ret_str."<indice>-1</indice>";
$ret_str=$ret_str."<icone>fa-user-circle</icone>";
$ret_str=$ret_str."<icone>fa-star</icone>";
$ret_str=$ret_str."</categorie>";
}
@ -376,7 +376,8 @@ EOL
return new Response(json_encode($output), 400);
}
$weburl="https://".$this->getParameter("weburl")."/".$this->getParameter("alias")."/";
# fixe #31884 "https://" => "//"
$weburl="//".$this->getParameter("weburl")."/".$this->getParameter("alias")."/";
$serializer = new Serializer(array(new DateTimeNormalizer()));
if ($action == null) {
@ -407,7 +408,6 @@ EOL
}
$categorielabel="";
if ($compteur==0) {
if ($alert->getAlertcategory()->getLabel()!="sans categorie")
if ($flag=="") {
$categorielabel="<div style='float:left;width: 102.5%;padding: 4px;padding-left: 4px;color:white;background-color: #$bgcolor;position:relative;top: -16px;left: -11px;'><img src='$iconeurl' width='24em'>&nbsp;".$alert->getAlertcategory()->getLabel()."</div></br>";
$tmp["message"] = "$categorielabel<h4>".$alert->getTitle()."</h4>".$alert->getContent();
@ -415,7 +415,6 @@ EOL
}
else
{
if ($alert->getAlertcategory()->getLabel()!="sans categorie")
if ($flag=="") {
$categorielabel="<img src='$iconeurl' width='16em' ><span style='font-weight: bold'> ".$alert->getAlertcategory()->getLabel()."</span> : ";
$tmp["message"] = $categorielabel.$alert->getTitle()."".$alert->getContent();
@ -779,9 +778,9 @@ $api('$id',data);";
$debug = ob_get_clean();
//$debug=json_encode($request->query);
//return new Response(json_encode($output), 400);
if(is_null($token)||is_null($libelle)||is_null($icon)||is_null($favurl)||is_null($nom)||is_null($categorie)||is_null($callback)||is_null($action)||is_null($callbackid)){
$output["error"]="missing parameter : token - id - libelle - icon - favurl - nom - categorie - callback - action - callbackid";
return new Response(json_encode($output), 400);
}
$em = $this->getDoctrine()->getManager();
@ -789,15 +788,13 @@ $api('$id',data);";
$datasource = $em->getRepository('CadolesEdispatcherBundle:Datasource')->findOneBy(["token"=>$token]);
if (!$datasource) {
$output["error"]="no datasource session found for token = $token";
return new Response(json_encode($output), 400);
}
$login = $datasource->getUsername();
// Récupérer l'utilisateur
$user=$em->getRepository('CadolesCoreBundle:User')->findOneBy(["username"=>$login]);
if(!$user) {
$output["error"]="user not exist";
return new Response(json_encode($output), 400);
$output["error"]="user does not exist";
}
// chercher l'item
@ -805,8 +802,7 @@ $api('$id',data);";
if(!$item) {
$altitem=$em->getRepository('CadolesPortalBundle:Item')->findOneBy(["url"=>$favurl."?gestion_edispatcher=locale"]);
if(!$altitem) {
$output["error"]="item with url=$favurl(?gestion_edispatcher=locale) not exist";
return new Response(json_encode($output), 400);
$output["error"]="item with url=$favurl(?gestion_edispatcher=locale) not found";
} else {
$item = $altitem;
}
@ -814,11 +810,16 @@ $api('$id',data);";
$bookmark = $em->getRepository('CadolesPortalBundle:Bookmark')->findOneBy(["user"=>$user,"item"=>$item]);
$title="";
$subtitle="";
$output="";
if(!$bookmark) {
if ($action=="BOOKMARK_ADD") {
$subtitle="";
$message="";
if (isset($output["error"])) {
$message=$output["error"];
$success=0;
} else {
$output="";
if(!$bookmark) {
if ($action=="BOOKMARK_ADD") {
$bookmark = new Bookmark();
$bookmark->setTitle($item->getTitle());
$title=$item->getTitle();
@ -832,34 +833,30 @@ $api('$id',data);";
$bookmark->setUser($user);
$em->persist($bookmark);
$em->flush();
$success=1;
$output="<html><body>
<form id='form2submit' name='form2submit' method='POST' action='$callback'>
<input name='action' id='action' type='hidden' value='$action' />
<input name='message' id='message' type='hidden' value='$title : $subtitle a &eacute;t&eacute; ajout&eacute; &agrave; vos favoris' />
<input name='success' id='success' type='hidden' value='1' />
<input name='id' id='id' type='hidden' value='$id' />
<input name='callbackid' id='callbackid' type='hidden' value='$callbackid' />
</form>
<script>
document.form2submit.submit();
</script>
</body></html>
";
} else $success=0; // item pas en favori, mais ce n'est pas une demande d'ajout
} else {
if ($action=="BOOKMARK_DEL") {
$success=1;
$message="$title : $subtitle a &eacute;t&eacute; ajout&eacute; &agrave; vos favoris";
} else {
$success=0;
$message="item introuvable en favori mais action=DEL (retrait)";
}
} else {
if ($action=="BOOKMARK_DEL") {
$em->remove($bookmark);
$em->flush();
$success=1;
$success=1;
$message="item supprimé de vos favoris";
} else {
$success=0;
$message="item deja en favori mais action=ADD (ajout)";
}
}
}
$output="<html><body>
<form id='form2submit' name='form2submit' method='POST' action='$callback'>
<input name='action' id='action' type='hidden' value='$action' />
<input name='message' id='message' type='hidden' value='item supprimé de vos favoris' />
<input name='success' id='success' type='hidden' value='1' />
<input name='message' id='message' type='hidden' value='$message' />
<input name='success' id='success' type='hidden' value='$success' />
<input name='id' id='id' type='hidden' value='$id' />
<input name='callbackid' id='callbackid' type='hidden' value='$callbackid' />
</form>
@ -869,8 +866,7 @@ document.form2submit.submit();
</body></html>
";
} else $success=0; // item deja en favori mais demande d'ajout
}
$reponse = new Response();
$reponse->setContent($output);