Les activités

* BackOfficeController.cs: Impléménte un accès à l'API back office
  pour l'envoi d'une notification aux mobiles des cercles séléctionné
  de l'utilisateur

* NotifyEvent.aspx: Implemente un formulaire d'envoi d'une
  notification mobile

* NotifyEventResponse.aspx: initie une page de resultat à la
  notification mobile

* NpgsqlContentProvider.cs: reccupère la photo activité en base de
  données

* BlogsController.cs: En attendant mieux, les billets de blog sont
  noté par leur auteur, ou un admin.

* CalendarController.cs: Les fontions de notification GCM et de
  declaration d'enregistrement GCM
partent dans le controlleur back office.

* activity.sql: ajoute la photo activité dans la definition du modèle
  de données Npgsql

* style.css: La fonte de caractère "Open Sans" (Google fonts) pour le
  thème "clear"

* style.css: La fonte de caractère "Open Sans" (Google fonts) pour le
  thème "dark" aussi

* style.css: pas de fonte de caractère dans la feuille de style
  basique.

* BackOfficeController.cs: Impléménte un accès web back office pour
  l'envoi d'une notification aux mobiles des cercles séléctionné de
  l'utilisateur

* BlogsController.cs: Fixe la page de garde du blogspot en cas
  d'absence
de billet à publier publiquement.

* FrontOfficeController.cs: la fontion booking est maintenant censée
  conerner uniquement une activité,
dont le code APE est donné en dernière partie de la route de l'Url, ou
  en argument `id`.

* HomeController.cs: La page d'accueil présente maintenant les
  activités mises en oeuvre par au moins un utilisateur enregistré,
  validé et non vérouillé.
Le titre de l'activité est un lien vers la methode de reservation
  simple.

* GoogleHelpers.cs: recoit l'implementation de la methode de
  notification mobile

* SimpleJsonPostMethod.cs: Fixe l'envoi en UTF-8

* App.master: fonte de caractère pour le lien vers "Vos billets"

* parallax.js: fixe la différence de traitement entre l'horizontale et
  la verticale

* Profile.aspx: ajoute le sommaire de la validation

* Index.aspx: initie un index pour le back office

* Activities.aspx: nettoye la console de log javascript

* Booking.aspx: ajoute le champ caché au formulaire de resa

* Index.aspx: affiche les services fournis sur le site, par des
  utilisateur enregistrés validés non bloqué.

* Web.config: rends l'id Google d'enregistrement GCM accessible au
  utilisateurs anonymes,
qui voudraient commander ou interagir avec l'application, sans avoir à
  créer de compte sur le site.

* Web.csproj: ajoute le contrôleur du back office, et le formulaire de
  notification mobile

* EventPub.cs:
* BaseEvent.cs: internationalise l'évennement (la base d'une
  notification)

* YaEvent.cs: les champs fournisseur d'une notification ne sont pas
  requis. On peut en avoir de la part du site lui même, qui ne soient
  pas à l'origine d'un evennement tiers du workflow. Dans tous les
  autres cas, ils devraient être renseignés ... à suivre.

* Circle.cs:
* CircleBase.cs: ajoute une methode de construition des destinataires
  à partir d'un tableau d'identifiants de cercles.

* Activity.cs: implémente la photo activité dans le modèle

* SimpleBookingQuery.cs: refabriqué

* MessageWithPayLoad.cs: accuse aussi le champ `to` en cas d'absence
  de destinataire.

* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: internationalisation
main
Paul Schneider 10 years ago
parent 2fcaa1ded4
commit 948fc64ce1
40 changed files with 504 additions and 129 deletions

@ -1,3 +1,8 @@
2015-11-26 Paul Schneider <paul@pschneider.fr>
* NpgsqlContentProvider.cs: reccupère la photo activité en
base de données
2015-11-25 Paul Schneider <paul@pschneider.fr>
* NpgsqlContentProvider.cs: implemente la gestion des

@ -32,7 +32,7 @@ namespace Yavsc
using (NpgsqlConnection cnx = CreateConnection ()) {
cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText = @"select meacode, title, cmnt
cmd.CommandText = @"select meacode, title, cmnt, photo
from activity where meacode = :code and applicationname = :app";
cmd.Parameters.AddWithValue ("code", MEACode);
cmd.Parameters.AddWithValue ("app", applicationName);
@ -42,7 +42,8 @@ namespace Yavsc
result = new Activity () {
Id = rdr.GetString (0),
Title = rdr.GetString (1),
Comment = rdr.GetString (2)
Comment = rdr.GetString (2),
Photo = rdr.GetString (3)
};
}
}
@ -65,7 +66,7 @@ namespace Yavsc
cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
cmd.CommandText = (exerted) ?
@"SELECT a.meacode, a.title, a.cmnt
@"SELECT a.meacode, a.title, a.cmnt, a.photo
FROM activity a, profiledata d, profiles p, users u
WHERE u.username = p.username
AND u.applicationname = p.applicationname
@ -75,7 +76,7 @@ namespace Yavsc
AND u.islockedout = FALSE
AND a.title like :pat
ORDER BY a.meacode " :
@"SELECT meacode, title, cmnt
@"SELECT meacode, title, cmnt, photo
FROM activity
WHERE title LIKE :pat
ORDER BY meacode ";
@ -88,7 +89,8 @@ namespace Yavsc
acties.Add (new Activity () {
Id = rdr.GetString (0),
Title = rdr.GetString (1),
Comment = rdr.GetString (2)
Comment = rdr.GetString (2),
Photo = rdr.GetString (3)
});
}
}

@ -0,0 +1,66 @@
//
// BackOfficeController.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Model.Google;
using Yavsc.Model.Calendar;
using Yavsc.Helpers;
using Yavsc.Model.Circles;
using System.Collections.Generic;
using System.Web.Profile;
using Yavsc.Helpers.Google;
using System.Web.Security;
namespace Yavsc.ApiControllers
{
/// <summary>
/// Back office controller.
/// </summary>
public class BackOfficeController: YavscController
{
/// <summary>
/// Notifies the event.
/// </summary>
/// <param name="evpub">Evpub.</param>
[Authorize(Roles="BackOffice")]
public MessageWithPayloadResponse NotifyEvent(EventPub evpub) {
return GoogleHelpers.NotifyEvent(evpub);
}
/// <summary>
/// Sets the registration identifier.
/// </summary>
/// <param name="registrationId">Registration identifier.</param>
[Authorize]
public void SetRegistrationId(string registrationId)
{
// TODO set registration id
setRegistrationId (User.Identity.Name, registrationId);
}
private void setRegistrationId(string username, string regid) {
ProfileBase pr = ProfileBase.Create(username);
pr.SetPropertyValue ("gregid", regid);
pr.Save ();
}
}
}

@ -14,9 +14,6 @@ using System.Diagnostics;
using Yavsc.Formatters;
using Yavsc.Model;
namespace Yavsc.ApiControllers
{
/// <summary>
@ -183,6 +180,7 @@ namespace Yavsc.ApiControllers
if (model.Rate < 0 || model.Rate > 100)
ModelState.AddModelError ("Rate", "0<=Rate<=100");
else {
BlogManager.GetForEditing (model.Id);
BlogManager.Rate (model.Id, model.Rate);
}
}
@ -205,6 +203,7 @@ namespace Yavsc.ApiControllers
[Authorize, HttpPost, ValidateAjaxAttribute]
public void SetPhoto(long id, [FromBody] string photo)
{
BlogManager.GetForEditing (id);
BlogManager.UpdatePostPhoto (id, photo);
}

@ -28,6 +28,7 @@ using System.Web.Profile;
using Yavsc.Model.Circles;
using Yavsc.Model.Calendar;
using System.Web.Http.Routing;
using System.Collections.Generic;
namespace Yavsc.ApiControllers
@ -168,36 +169,7 @@ namespace Yavsc.ApiControllers
}
}
/// <summary>
/// Sets the registration identifier.
/// </summary>
/// <param name="registrationId">Registration identifier.</param>
[Authorize]
public void SetRegistrationId(string registrationId)
{
// TODO set registration id
setRegistrationId (Membership.GetUser ().UserName, registrationId);
}
private void setRegistrationId(string username, string regid) {
ProfileBase pr = ProfileBase.Create(username);
pr.SetPropertyValue ("gregid", regid);
}
/// <summary>
/// Notifies the event.
/// </summary>
/// <param name="evpub">Evpub.</param>
public MessageWithPayloadResponse NotifyEvent(EventPub evpub) {
SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse> r =
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse>(
"https://gcm-http.googleapis.com/gcm/send");
using (r) {
var msg = new MessageWithPayload<YaEvent> () { data = new YaEvent[] { (YaEvent)evpub } };
msg.to = string.Join (" ", Circle.Union (evpub.Circles));
return r.Invoke (msg);
}
}
}
}

@ -4,19 +4,19 @@
CREATE TABLE activity
(
meacode character varying(512) NOT NULL, -- Identifiant de l'activité, à terme, il faudrait ajouter un champ à cette id: le code pays....
title character varying(2048) NOT NULL, -- Description textuelle du code APE
applicationname character varying(255) NOT NULL,
cmnt character varying, -- a long description for this activity
CONSTRAINT activity_pkey PRIMARY KEY (meacode, applicationname)
meacode character varying(512) NOT NULL, -- Identifiant de l'activité, à terme, il faudrait ajouter un champ à cette id: le code pays....
photo character varying(512) -- a photo url, as a front image for this activity
)
WITH (
OIDS=FALSE
);
ALTER TABLE activity
OWNER TO yavscdev;
COMMENT ON TABLE activity
IS 'Activités prises en charge par l''application désignée';
COMMENT ON COLUMN activity.title IS 'Description textuelle du code APE';
COMMENT ON COLUMN activity.cmnt IS 'a long description for this activity';
COMMENT ON COLUMN activity.meacode IS 'Identifiant de l''activité, à terme, il faudrait ajouter un champ à cette id: le code pays.
Definition francaise:
@ -25,6 +25,5 @@ une lettre en cinquième position.
Exemple: ''71.12B'' => "Ingénierie, études techniques"
';
COMMENT ON COLUMN activity.title IS 'Description textuelle du code APE';
COMMENT ON COLUMN activity.cmnt IS 'a long description for this activity';
COMMENT ON COLUMN activity.photo IS 'a photo url, as a front image for this activity';

@ -1,7 +1,9 @@
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700);
body {
background-color: grey;
color: #303030;
font-family: 'Open Sans', sans-serif;
}
.tagname { color: #D0FFD0; }
.tagname:hover { background-color: red; }

@ -6,7 +6,7 @@
}
body {
font-family: 'Arial', cursive;
font-family: 'Open Sans', sans-serif;
background-color: black;
color: #D0FFD0;
}

@ -1,6 +1,5 @@
body {
font-family: 'Arial', cursive;
padding: 0;
margin: 0;
}
@ -175,7 +174,6 @@ content: ")";
.usertitleref {
border-radius: 1em;
font-family: 'Arial', cursive;
padding: 1em;
}
.editable {
@ -239,7 +237,6 @@ legend {
border-style: solid;
border-width:1px;
cursor: pointer;
font-family: 'Arial', cursive;
padding: 1em;
}
@ -247,7 +244,6 @@ input, select, textarea {
border-radius:1em;
border-style: solid;
border-width:1px;
font-family: 'Arial', cursive;
}
.code {

@ -1,3 +1,84 @@
2015-11-26 Paul Schneider <paul@pschneider.fr>
* BackOfficeController.cs: Impléménte un accès à l'API back
office pour l'envoi d'une notification aux mobiles des cercles
séléctionné de l'utilisateur
* NotifyEvent.aspx: Implemente un formulaire d'envoi d'une
notification mobile
* NotifyEventResponse.aspx: initie une page de resultat à la
notification mobile
* BlogsController.cs: En attendant mieux, les billets de blog
sont noté par leur auteur, ou un admin.
* CalendarController.cs: Les fontions de notification GCM et
de declaration d'enregistrement GCM
partent dans le controlleur back office.
* activity.sql: ajoute la photo activité dans la definition du
modèle de données Npgsql
* style.css: La fonte de caractère "Open Sans" (Google fonts)
pour le thème "clear"
* style.css: La fonte de caractère "Open Sans" (Google fonts)
pour le thème "dark" aussi
* style.css: pas de fonte de caractère dans la feuille de
style basique.
* BackOfficeController.cs: Impléménte un accès web back office
pour l'envoi d'une notification aux mobiles des cercles
séléctionné de l'utilisateur
* BlogsController.cs: Fixe la page de garde du blogspot en cas
d'absence
de billet à publier publiquement.
* FrontOfficeController.cs: la fontion booking est maintenant
censée conerner uniquement une activité,
dont le code APE est donné en dernière partie de la route de
l'Url, ou en argument `id`.
* HomeController.cs: La page d'accueil présente maintenant les
activités mises en oeuvre par au moins un utilisateur
enregistré, validé et non vérouillé.
Le titre de l'activité est un lien vers la methode de
reservation simple.
* GoogleHelpers.cs: recoit l'implementation de la methode de
notification mobile
* SimpleJsonPostMethod.cs: Fixe l'envoi en UTF-8
* App.master: fonte de caractère pour le lien vers "Vos
billets"
* parallax.js: fixe la différence de traitement entre
l'horizontale et la verticale
* Profile.aspx: ajoute le sommaire de la validation
* Index.aspx: initie un index pour le back office
* Activities.aspx: nettoye la console de log javascript
* Booking.aspx: ajoute le champ caché au formulaire de resa
* Index.aspx: affiche les services fournis sur le site, par
des utilisateur enregistrés validés non bloqué.
* Web.config: rends l'id Google d'enregistrement GCM
accessible au utilisateurs anonymes,
qui voudraient commander ou interagir avec l'application, sans
avoir à créer de compte sur le site.
* Web.csproj: ajoute le contrôleur du back office, et le
formulaire de notification mobile
2015-11-25 Paul Schneider <paul@pschneider.fr>
* Activities.aspx: implémente la vue Html de la liste éditable

@ -4,6 +4,10 @@ using System.Linq;
using System.Web;
using System.Web.Mvc;
using Yavsc.Admin;
using Yavsc.Model.Calendar;
using Yavsc.Helpers.Google;
using Yavsc.Model.Circles;
using System.Web.Security;
namespace Yavsc.Controllers
@ -21,5 +25,26 @@ namespace Yavsc.Controllers
{
return View ();
}
/// <summary>
/// Notifies the event.
/// </summary>
/// <returns>The event.</returns>
/// <param name="evpub">Evpub.</param>
public ActionResult NotifyEvent(EventPub evpub)
{
if (ModelState.IsValid) {
ViewData ["NotifyEvent"] = evpub;
return View ("NotifyEventResponse", GoogleHelpers.NotifyEvent (evpub));
}
ViewData["CircleIds"] = CircleManager.DefaultProvider.List (
Membership.GetUser ().UserName).Select (x => new SelectListItem {
Value = x.Id.ToString(),
Text = x.Title,
Selected = (evpub.CircleIds==null) ? false : evpub.CircleIds.Contains (x.Id)
});
return View (evpub);
}
}
}

@ -104,6 +104,8 @@ namespace Yavsc.Controllers
[HttpGet]
public ActionResult UserPosts (string user, string title=null, int pageIndex = 0, int pageSize = 10)
{
if (user == null)
return Index (title, pageSize, pageIndex);
if (title != null) return UserPost (user, title, pageIndex, pageSize);
int recordcount=0;
MembershipUser u = Membership.GetUser ();
@ -118,8 +120,6 @@ namespace Yavsc.Controllers
if (u.UserName == user || Roles.IsUserInRole ("Admin"))
sf |= FindBlogEntryFlags.MatchInvisible;
readersName = u.UserName;
if (user == null)
user = u.UserName;
}
// find entries
BlogEntryCollection c =
@ -128,11 +128,10 @@ namespace Yavsc.Controllers
var pr = ProfileBase.Create (user);
if (pr != null) {
Profile bupr = new Profile (pr);
// listing meta data
ViewData ["BlogUserProfile"] = bupr;
// Inform of listing meta data
ViewData ["BlogTitle"] = bupr.BlogTitle;
ViewData ["Avatar"] = bupr.avatar;
ViewData ["BlogTitle"] = bupr.BlogTitle;
ViewData ["Avatar"] = bupr.avatar;
}
UUBlogEntryCollection uuc = new UUBlogEntryCollection (user, c);
ViewData ["ResultCount"] = recordcount;

@ -43,7 +43,7 @@ namespace Yavsc.Controllers
return View (model);
}
/// <summary>
/// Estimates this instance.
/// Estimates released to this client
/// </summary>
[Authorize]
public ActionResult Estimates (string client)
@ -68,15 +68,15 @@ namespace Yavsc.Controllers
/// <summary>
/// Estimate the specified id.
/// Estimate wearing the specified id.
/// </summary>
/// <param name="id">Identifier.</param>
public ActionResult Get (long estimid)
/// <param name="id">Estim Identifier.</param>
public ActionResult Get (long id)
{
Estimate f = WorkFlowManager.GetEstimate (estimid);
Estimate f = WorkFlowManager.GetEstimate (id);
if (f == null) {
ModelState.AddModelError ("Id", "Wrong Id");
return View (new Estimate () { Id=estimid } );
return View (new Estimate () { Id=id } );
}
return View (f);
}
@ -182,14 +182,14 @@ namespace Yavsc.Controllers
/// <summary>
/// Product the specified id, pc and pref.
/// </summary>
/// <param name="id">Identifier.</param>
/// <param name="pc">Pc.</param>
/// <param name="id">Brand Identifier.</param>
/// <param name="pc">Production catalog reference.</param>
/// <param name="pref">Preference.</param>
[AcceptVerbs ("GET")]
public ActionResult Product (string brandid, string pc, string pref)
public ActionResult Product (string id, string pc, string pref)
{
Product p = null;
ViewData ["BrandName"] = brandid;
ViewData ["BrandName"] = id;
ViewData ["ProdCatRef"] = pc;
ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog ();
@ -198,7 +198,7 @@ namespace Yavsc.Controllers
ViewData ["RefType"] = "Catalog";
return View ("ReferenceNotFound");
}
Brand b = cat.GetBrand (brandid);
Brand b = cat.GetBrand (id);
if (b == null) {
ViewData ["RefType"] = "Brand";
return View ("ReferenceNotFound");
@ -266,6 +266,11 @@ namespace Yavsc.Controllers
return View (skills);
}
/// <summary>
/// Activities the specified search and toPower.
/// </summary>
/// <param name="search">Search.</param>
/// <param name="toPower">If set to <c>true</c> to power.</param>
public ActionResult Activities (string search, bool toPower = false)
{
if (search == null)
@ -274,6 +279,10 @@ namespace Yavsc.Controllers
return View (activities);
}
/// <summary>
/// Activity at the specified id.
/// </summary>
/// <param name="id">Identifier.</param>
public ActionResult Activity(string id)
{
return View(WorkFlowManager.GetActivity (id));
@ -283,7 +292,7 @@ namespace Yavsc.Controllers
/// offer Ajax edition of
/// user's skills.
/// </summary>
/// <param name="usp">the User Skills Profile.</param>
/// <param name="id">the User name.</param>
[Authorize()]
public ActionResult UserSkills (string id)
{
@ -302,10 +311,11 @@ namespace Yavsc.Controllers
/// Booking the specified model.
/// </summary>
/// <param name="model">Model.</param>
public ActionResult Booking (SimpleBookingQuery model)
public ActionResult Booking (string id, SimpleBookingQuery model)
{
if (model.Needs == null)
model.Needs = SkillManager.FindSkill ("%");
model.MAECode = id;
return View (model);
}
}

@ -14,6 +14,7 @@ using Yavsc.Helpers;
using Yavsc;
using System.Web.Mvc;
using Yavsc.Model.Blogs;
using Yavsc.Model.WorkFlow;
namespace Yavsc.Controllers
{
@ -83,7 +84,7 @@ namespace Yavsc.Controllers
/// <summary>
/// Index this instance.
/// </summary>
public ActionResult Index ()
public ActionResult Index (string id)
{
foreach (string tagname in new string[] {"Accueil","Yavsc","Événements","Mentions légales"})
{
@ -91,7 +92,9 @@ namespace Yavsc.Controllers
// TODO specialyze BlogEntry creating a PhotoEntry
ViewData [tagname] = ti;
}
if (id == null)
id = "%";
ViewData["Activities"] = WorkFlowManager.FindActivity(id,true);
return View ();
}
/// <summary>

@ -23,6 +23,10 @@ using Yavsc.Model.Google;
using System.Web.Profile;
using System.Configuration;
using System.Web;
using Yavsc.Model.Calendar;
using Yavsc.Model.Circles;
using System.Collections.Generic;
using System.Web.Security;
namespace Yavsc.Helpers.Google
{
@ -93,6 +97,41 @@ namespace Yavsc.Helpers.Google
{
return new OAuth2 (callBack,clientId,clientSecret);
}
/// <summary>
/// Notifies the event.
/// </summary>
/// <returns>The event.</returns>
/// <param name="evpub">Evpub.</param>
public static MessageWithPayloadResponse NotifyEvent(EventPub evpub) {
using (SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse> r =
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse>(
"https://gcm-http.googleapis.com/gcm/send")) {
var users = Circle.Union (evpub.CircleIds);
var regids = new List<string> ();
var to = new List<string> ();
foreach (var u in users) {
var p = ProfileBase.Create (u);
if (p != null) {
var regid = p.GetPropertyValue("gregid");
if (regid == null) {
var muser = Membership.GetUser (u);
to.Add (muser.Email);
}
else regids.Add ((string)regid);
}
}
if (regids.Count == 0)
throw new InvalidOperationException
("No recipient where found for this circle list");
var msg = new MessageWithPayload<YaEvent> () {
notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "event" },
data = new YaEvent[] { (YaEvent)evpub }, registration_ids = regids.ToArray() };
return r.Invoke (msg);
}
}
}
}

@ -66,6 +66,7 @@ namespace Yavsc.Helpers
Request.Method = "POST";
Request.Accept = "application/json";
Request.ContentType = "application/json";
Request.SendChunked = true;
Request.TransferEncoding = "UTF-8";
}
/// <summary>

@ -61,9 +61,9 @@ else {%> Yavsc.notice(<%=note.body%>, <%=note.click_action%>, <%=note.click_acti
<i class="fa fa-sign-in">Connexion</i>
</a>
<% } else { %>
<a href="<%=Url.RouteUrl("Blogs", new { user = HttpContext.Current.User.Identity.Name } )%>" accesskey = "B" class="menuitem" >
<img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="vos billets" class="iconsmall" />
<span class="hint">Vos billets</span>
<a href="<%=Url.RouteUrl("Blogs", new { user = HttpContext.Current.User.Identity.Name } )%>" accesskey = "B" class="menuitem fa" >
<img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="" class="iconsmall" />
Vos billets
</a>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Profile", id = HttpContext.Current.User.Identity.Name} ) %>" accesskey="P" class="menuitem fa fa-user">
<%= HttpContext.Current.User.Identity.Name %>
@ -83,16 +83,14 @@ else {%> Yavsc.notice(<%=note.body%>, <%=note.click_action%>, <%=note.click_acti
</asp:ContentPlaceHolder>
</main>
<footer data-type="background" data-speed="5" >
<%= Html.ActionLink("Formulaire de contact","Contact","Home",null, new { @class="thanks" }) %>
<div id="copyr">
<a href="http://yavsc.pschneider.fr/Blogs/UserPost/paul/License">© 2015 GNU GENERAL PUBLIC LICENSE <i>Version 3, 29 June 2007</i></a>
<a href="http://yavsc.pschneider.fr/Blogs/UserPost/paul/License">
<%=Html.Encode("© 2015 GNU GENERAL PUBLIC LICENSE")%> <i>Version 3, 29 June 2007</i></a>
</div>
<%= Html.ActionLink("Formulaire de contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( Link link in Html.Thanks()) { %>
<a class="thanks" href="<%=link.Url%>"><% if (link.Image !=null) {
%><img src="<%= link.Image %>" alt="<%= link.Text %>"/></a>
<% } else { %>
<a class="thanks" href="<%=link.Url%>"><%= link.Text %></a>
<% }} %>
</footer><div class="modal"></div>
</body>
</html>

@ -23,7 +23,7 @@
$(document).ready(function(){
var $window = $(window);
var $stwidth = $(window).width();
var $stheight = $(window).width();
var $stheight = $(window).height();
var onPos = function (bgobj,ax,ay) {
var speed = bgobj.data('speed');

@ -26,7 +26,7 @@
<%= Html.ValidationSummary() %>
<% using(Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
<% { %>
<%= Html.ValidationSummary() %>
<%= Html.Hidden("UserName",ViewData["ProfileUserName"]) %>
<fieldset><legend>Informations publiques</legend>

@ -1,9 +1,7 @@
<%@ Page Title="Back office" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<ul><li>
<%= Html.ActionLink("Catalog","Catalog","FrontOffice" ) %>
</li>
<li><%= Html.ActionLink(LocalizedText.Skill,"Skills","FrontOffice" ) %></li>
<ul>
<li><%= Html.ActionLink("Notifier des cercles d'un évennement","NotifyEvent","BackOffice" ) %></li>
</ul>
</asp:Content>

@ -0,0 +1,22 @@
<%@ Page Title="Notify" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<EventPub>" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<% using( Html.BeginForm("NotifyEvent")) { %>
<%= Html.ValidationSummary() %>
<%= Html.LabelFor(model => model.Title) %>
<%= Html.TextBox("Title") %>
<%= Html.ValidationMessage("Title", "*") %><br>
<%= Html.LabelFor(model => model.Description) %>
<%= Html.TextArea("Description") %>
<%= Html.ValidationMessage("Description", "*") %><br>
<%= Html.LabelFor(model => model.CircleIds) %>
<%= Html.ListBox("CircleIds") %>
<%= Html.ValidationMessage("CircleIds", "*") %>
<input type="submit">
<% } %>
</asp:Content>

@ -0,0 +1,4 @@
<%@ Page Title="Notify response" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>

@ -25,7 +25,6 @@
Id: $('#meacode').val(),
Comment: $('#comment').val(),
};
console.log(Yavsc.dumpprops(activity));
Yavsc.ajax( 'FrontOffice/RegisterActivity', activity,
function() {
var na = $('<p></p>').addClass('activity');

@ -11,7 +11,7 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% using ( Html.BeginForm("Booking") ) { %>
<%= Html.Hidden("MAECode") %>
<fieldset>
<legend>Préferences musicales</legend>
<%= Html.LabelFor(model=>model.Needs) %>:

@ -8,6 +8,18 @@
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div id="activities">
<% foreach (var a in ((Activity[])(ViewData["Activities"]))) { %>
<div>
<div data-type="background" data-speed="10" style="width:100%; height:10em; background: url(<%=Ajax.JString(a.Photo)%>) 50% 50% repeat fixed;" >
</div>
<h1><a href="<%= Url.RouteUrl("Default", new { controller="FrontOffice", action="Booking", id=a.Id }) %>"><%=Html.Encode(a.Title)%></a></h1>
<i>(<%=Html.Encode(a.Id)%>)</i>
<p>
<%=Html.Markdown(a.Comment)%>
</p></div>
<% } %>
</div>
<%= Html.Partial("TagPanel",ViewData["Accueil"]) %>
</asp:Content>

@ -147,7 +147,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="gtokenexpir" type="System.DateTime" defaultValue="2008-01-01 1:00:00Z" />
<add name="gcalapi" type="System.Boolean" defaultValue="false" />
<add name="gcalid" />
<add name="gregid" />
<add name="gregid" allowAnonymous="true" />
<add name="allowcookies" type="System.Boolean" allowAnonymous="true" defaultValue="false" />
<add name="UITheme" allowAnonymous="true" defaultValue="dark" />
</properties>

@ -215,6 +215,7 @@
<Compile Include="AuthorizeAttribute.cs" />
<Compile Include="ApiControllers\SkillController.cs" />
<Compile Include="Controllers\PayPalController.cs" />
<Compile Include="ApiControllers\BackOfficeController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
@ -518,6 +519,8 @@
<Content Include="App_Themes\clear\style.css" />
<Content Include="Views\FrontOffice\Activities.aspx" />
<Content Include="Views\FrontOffice\Activity.ascx" />
<Content Include="Views\BackOffice\NotifyEventResponse.aspx" />
<Content Include="Views\BackOffice\NotifyEvent.aspx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

@ -34,26 +34,24 @@ namespace Yavsc.Model.Calendar
/// <summary>
/// The title.
/// </summary>
[Required(ErrorMessage="Please, choose a .")]
[Required(ErrorMessageResourceName="ChooseATitle",ErrorMessageResourceType=typeof(LocalizedText))]
[Display(ResourceType=typeof(LocalizedText),Name="Title")]
public string Title { get; set; }
/// <summary>
/// The description.
/// </summary>
[Required(ErrorMessage="Please, choose a Description.")]
[Required(ErrorMessageResourceName="ChooseADescription",ErrorMessageResourceType=typeof(LocalizedText))]
[Display(ResourceType=typeof(LocalizedText),Name="Description")]
public string Description { get; set; }
/// <summary>
/// The location.
/// </summary>
[Required(ErrorMessage="Please, choose a Location.")]
[Display(ResourceType=typeof(LocalizedText),Name="Location")]
public Position Location { get; set; }
/// <summary>
/// The start date.
/// </summary>
[Required(ErrorMessage="Please, choose a Start Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="StartDate")]
public DateTime StartDate { get; set; }
@ -61,7 +59,6 @@ namespace Yavsc.Model.Calendar
/// Gets or sets the end date.
/// </summary>
/// <value>The end date.</value>
[Required(ErrorMessage="Please, choose an End Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="EndDate")]
public DateTime EndDate { get; set; }

@ -36,8 +36,10 @@ namespace Yavsc.Model.Calendar
/// Gets or sets the circles.
/// </summary>
/// <value>The circles.</value>
[Display(ResourceType=typeof(LocalizedText),Name="Circles")]
public Circle[] Circles { get; set; }
[Required(ErrorMessageResourceName="DoSpecifyCircles",ErrorMessageResourceType=typeof(LocalizedText)),
Display(ResourceType=typeof(LocalizedText),Name="Circles")]
public long [] CircleIds { get; set; }
}
}

@ -34,13 +34,11 @@ namespace Yavsc.Model.Calendar
/// <summary>
/// The name of the NF provider.
/// </summary>
[Required(ErrorMessage="Please, choose a Provider Name.")]
[Display(ResourceType=typeof(LocalizedText),Name="ProviderName")]
public string ProviderName { get; set; }
/// <summary>
/// The NF provider identifier.
/// </summary>
[Required(ErrorMessage="Please, choose a Provider Identifier.")]
[Display(ResourceType=typeof(LocalizedText),Name="ProviderId")]
public string ProviderId { get; set; }
/// <summary>

@ -1,3 +1,31 @@
2015-11-26 Paul Schneider <paul@pschneider.fr>
* EventPub.cs:
* BaseEvent.cs: internationalise l'évennement (la base d'une
notification)
* YaEvent.cs: les champs fournisseur d'une notification ne
sont pas requis. On peut en avoir de la part du site lui même,
qui ne soient pas à l'origine d'un evennement tiers du
workflow. Dans tous les autres cas, ils devraient être
renseignés ... à suivre.
* Circle.cs:
* CircleBase.cs: ajoute une methode de construition des
destinataires à partir d'un tableau d'identifiants de cercles.
* Activity.cs: implémente la photo activité dans le modèle
* SimpleBookingQuery.cs: refabriqué
* MessageWithPayLoad.cs: accuse aussi le champ `to` en cas
d'absence de destinataire.
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: internationalisation
2015-11-25 Paul Schneider <paul@pschneider.fr>
* BlogManager.cs: refactorisation

@ -52,6 +52,20 @@ namespace Yavsc.Model.Circles
}
return content.ToArray ();
}
/// <summary>
/// Union the specified thoseIds.
/// </summary>
/// <param name="thoseIds">Those identifiers.</param>
public static string [] Union (long [] thoseIds)
{
List<string> content = new List<string>();
foreach (long cid in thoseIds)
foreach (string user_name in
CircleManager.DefaultProvider.GetMembers(cid).Members)
if (!content.Contains (user_name))
content.Add (user_name);
return content.ToArray ();
}
}
}

@ -51,7 +51,18 @@ namespace Yavsc.Model.Circles
/// </summary>
/// <value>The title.</value>
public string Title { get; set; }
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Yavsc.Model.Circles.CircleBase"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Yavsc.Model.Circles.CircleBase"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Yavsc.Model.Circles.CircleBase"/>; otherwise, <c>false</c>.</returns>
public override bool Equals (object obj)
{
if (base.Equals (obj))
return true;
return Id == ((CircleBase)obj).Id;
}
}
}

@ -66,6 +66,9 @@ namespace Yavsc.Model.FrontOffice
get;
set;
}
public string Photo { get; set; }
/// <summary>
/// The activity object has a static value during the
/// most of the application life,

@ -38,8 +38,17 @@ namespace Yavsc.Model.FrontOffice
[Display(ResourceType=typeof(LocalizedText),Name="PreferedDate")]
public DateTime PreferedDate { get; set; }
public string Activity { get; set; }
/// <summary>
/// Gets or sets the MAE code.
/// </summary>
/// <value>The MAE code.</value>
public string MAECode { get; set; }
/// <summary>
/// Gets or sets the needs.
/// </summary>
/// <value>The needs.</value>
[Display(ResourceType=typeof(LocalizedText),Name="Needs")]
public SkillEntity[] Needs { get; set; }
}

@ -80,6 +80,7 @@ namespace Yavsc.Model.Google
if (to==null && registration_ids == null) {
modelState.AddModelError ("to", "One of \"to\" or \"registration_ids\" parameters must be specified");
modelState.AddModelError ("registration_ids", "*");
modelState.AddModelError ("to", "*");
}
if (notification == null && data == null) {
modelState.AddModelError ("notification", "At least one of \"notification\" or \"data\" parameters must be specified");

@ -76,18 +76,36 @@ namespace Yavsc.Model {
}
}
public static string Message_sent {
get {
return ResourceManager.GetString("Message_sent", resourceCulture);
}
}
public static string DuplicateEmail {
get {
return ResourceManager.GetString("DuplicateEmail", resourceCulture);
}
}
public static string Photo {
get {
return ResourceManager.GetString("Photo", resourceCulture);
}
}
public static string Preview {
get {
return ResourceManager.GetString("Preview", resourceCulture);
}
}
public static string Remove {
get {
return ResourceManager.GetString("Remove", resourceCulture);
}
}
public static string DisplayName {
get {
return ResourceManager.GetString("DisplayName", resourceCulture);
@ -100,6 +118,12 @@ namespace Yavsc.Model {
}
}
public static string DoSpecifyCircles {
get {
return ResourceManager.GetString("DoSpecifyCircles", resourceCulture);
}
}
public static string My_Estimates {
get {
return ResourceManager.GetString("My_Estimates", resourceCulture);
@ -256,9 +280,9 @@ namespace Yavsc.Model {
}
}
public static string Remove {
public static string ChooseATitle {
get {
return ResourceManager.GetString("Remove", resourceCulture);
return ResourceManager.GetString("ChooseATitle", resourceCulture);
}
}
@ -382,9 +406,9 @@ namespace Yavsc.Model {
}
}
public static string Message_sent {
public static string ChooseADescription {
get {
return ResourceManager.GetString("Message_sent", resourceCulture);
return ResourceManager.GetString("ChooseADescription", resourceCulture);
}
}
@ -454,6 +478,12 @@ namespace Yavsc.Model {
}
}
public static string Needs {
get {
return ResourceManager.GetString("Needs", resourceCulture);
}
}
public static string Role {
get {
return ResourceManager.GetString("Role", resourceCulture);

@ -70,9 +70,21 @@ namespace Yavsc.Model {
}
}
public static string Circles {
public static string access_denied {
get {
return ResourceManager.GetString("Circles", resourceCulture);
return ResourceManager.GetString("access_denied", resourceCulture);
}
}
public static string Message_sent {
get {
return ResourceManager.GetString("Message_sent", resourceCulture);
}
}
public static string Photo {
get {
return ResourceManager.GetString("Photo", resourceCulture);
}
}
@ -82,15 +94,27 @@ namespace Yavsc.Model {
}
}
public static string Remove {
get {
return ResourceManager.GetString("Remove", resourceCulture);
}
}
public static string DisplayName {
get {
return ResourceManager.GetString("DisplayName", resourceCulture);
}
}
public static string none {
public static string Circles {
get {
return ResourceManager.GetString("none", resourceCulture);
return ResourceManager.GetString("Circles", resourceCulture);
}
}
public static string DoSpecifyCircles {
get {
return ResourceManager.GetString("DoSpecifyCircles", resourceCulture);
}
}
@ -178,12 +202,6 @@ namespace Yavsc.Model {
}
}
public static string access_denied {
get {
return ResourceManager.GetString("access_denied", resourceCulture);
}
}
public static string Ciffer {
get {
return ResourceManager.GetString("Ciffer", resourceCulture);
@ -208,6 +226,12 @@ namespace Yavsc.Model {
}
}
public static string none {
get {
return ResourceManager.GetString("none", resourceCulture);
}
}
public static string entries {
get {
return ResourceManager.GetString("entries", resourceCulture);
@ -250,9 +274,9 @@ namespace Yavsc.Model {
}
}
public static string Remove {
public static string ChooseATitle {
get {
return ResourceManager.GetString("Remove", resourceCulture);
return ResourceManager.GetString("ChooseATitle", resourceCulture);
}
}
@ -304,6 +328,12 @@ namespace Yavsc.Model {
}
}
public static string PhotoUpdated {
get {
return ResourceManager.GetString("PhotoUpdated", resourceCulture);
}
}
public static string PreferedDate {
get {
return ResourceManager.GetString("PreferedDate", resourceCulture);
@ -346,9 +376,9 @@ namespace Yavsc.Model {
}
}
public static string AnIMessageHasbeenSent {
public static string DoTag {
get {
return ResourceManager.GetString("AnIMessageHasbeenSent", resourceCulture);
return ResourceManager.GetString("DoTag", resourceCulture);
}
}
@ -364,9 +394,9 @@ namespace Yavsc.Model {
}
}
public static string Message_sent {
public static string ChooseADescription {
get {
return ResourceManager.GetString("Message_sent", resourceCulture);
return ResourceManager.GetString("ChooseADescription", resourceCulture);
}
}
@ -436,6 +466,12 @@ namespace Yavsc.Model {
}
}
public static string Needs {
get {
return ResourceManager.GetString("Needs", resourceCulture);
}
}
public static string Role {
get {
return ResourceManager.GetString("Role", resourceCulture);
@ -502,9 +538,9 @@ namespace Yavsc.Model {
}
}
public static string DoTag {
public static string Hide_source {
get {
return ResourceManager.GetString("DoTag", resourceCulture);
return ResourceManager.GetString("Hide_source", resourceCulture);
}
}
@ -568,12 +604,6 @@ namespace Yavsc.Model {
}
}
public static string Hide_source {
get {
return ResourceManager.GetString("Hide_source", resourceCulture);
}
}
public static string UsersInRole {
get {
return ResourceManager.GetString("UsersInRole", resourceCulture);
@ -586,6 +616,12 @@ namespace Yavsc.Model {
}
}
public static string AnIMessageHasbeenSent {
get {
return ResourceManager.GetString("AnIMessageHasbeenSent", resourceCulture);
}
}
public static string Profile_edition {
get {
return ResourceManager.GetString("Profile_edition", resourceCulture);

@ -23,12 +23,15 @@
<data name="BillUpdated"><value>Billet mis à jour</value></data>
<data name="Consultant"><value>Consultant</value></data>
<data name="Count"><value>Nombre</value></data>
<data name="ChooseADescription"><value>S'il vous plait, choisissez une description.</value></data>
<data name="ChooseATitle"><value>S'il vous plait, choisissez un titre.</value></data>
<data name="Ciffer"><value>Chiffre</value></data>
<data name="Circles"><value>Cercles</value></data>
<data name="Comment"><value>Commentaire</value></data>
<data name="DB"><value>Base de données</value></data>
<data name="DoComment"><value>Commenter</value></data>
<data name="DoNotPublishMyActivity"><value>Ne pas publier mon activité</value></data>
<data name="DoSpecifyCircles"><value>S'il vous plait, spécifiez ceux de vos cercles à qui est destiné ce contenu</value></data>
<data name="Create"><value>Créer</value></data>
<data name="Date_search"><value>Demande de rendez-vous</value></data>
<data name="DocTemplateException"><value>Une erreur est survenue à la génération de votre document</value></data>
@ -62,6 +65,7 @@
<data name="MinDate"><value>Date minimale du rendez-vous</value></data>
<data name="Modify"><value>Modifier</value></data>
<data name="My_Estimates"><value>Mes estimations</value></data>
<data name="Needs"><value>Besoin</value></data>
<data name="New_Tag"><value>Nouveau Tag</value></data>
<data name="no_content"><value>pas de contenu</value></data>
<data name="none"><value>aucun(e)</value></data>
@ -72,6 +76,8 @@
<data name="Online"><value>En ligne</value></data>
<data name="Pdf_version"><value>Version Pdf</value></data>
<data name="Person"><value>Personne</value></data>
<data name="Photo"><value>Photo</value></data>
<data name="PhotoUpdated"><value>Photo mise à jour</value></data>
<data name="PreferedDate"><value>Date souhaitée</value></data>
<data name="Preview"><value>Prévisualiser</value><comment>Prévisualiser le document</comment></data>
<data name="Profile_edition"><value>Édition du profile</value></data>

@ -21,9 +21,10 @@
<data name="Bill_removal"><value>Bill removal</value></data>
<data name="BillCreated"><value>Bill created</value></data>
<data name="BillUpdated"><value>Bill updated</value></data>
<data name="PhotoUpdated"><value>Photo updated</value></data>
<data name="Create"><value>Create</value></data>
<data name="Count"><value>Count</value></data>
<data name="ChooseADescription"><value>Please, choose a description</value></data>
<data name="ChooseATitle"><value>Please, choose a title</value></data>
<data name="Ciffer"><value>Ciffer</value></data>
<data name="Circles"><value>Circles</value></data>
<data name="Consultant"><value>Consultant</value></data>
@ -35,6 +36,7 @@
<data name="DisplayName"><value>Display Name</value></data>
<data name="DocTemplateException"><value>Exception occured when rendering your document</value></data>
<data name="DoNotPublishMyActivity"><value>Do Not Publish My Activity</value></data>
<data name="DoSpecifyCircles"><value>Please, specify circles for audiance</value></data>
<data name="DoTag"><value>Tag</value></data>
<data name="DuplicateEmail"><value>This email adress is already used ({0}).</value></data>
<data name="DuplicateUserName"><value>This user name is already used ({0}).</value></data>
@ -65,6 +67,7 @@
<data name="MinDate"><value>Minimal date for the rendez-vous</value></data>
<data name="Modify"><value>Modify</value></data>
<data name="My_Estimates"><value>My estimates</value></data>
<data name="Needs"><value>Needs</value></data>
<data name="New_Tag"><value>New Tag</value></data>
<data name="no_content"><value>no content</value></data>
<data name="none"><value>none</value></data>
@ -75,6 +78,8 @@
<data name="Offline"><value>Offline</value></data>
<data name="Pdf_version"><value>Pdf version</value></data>
<data name="Person"><value>Person</value></data>
<data name="Photo"><value>Photo</value></data>
<data name="PhotoUpdated"><value>Photo updated</value></data>
<data name="PreferedDate"><value>Prefered date</value></data>
<data name="Preview"><value>Preview</value><comment>comment on preview</comment></data>
<data name="Private_circle"><value>Private circle</value></data>

Loading…