Réorganisations.

La page de reservation par défaut est maintenant la reservation dite simple.

Fonctionnalités en cours de développement:

1) la reservation dite simple
2) la notification à la reservation
3) l'activité principale exercée
4) l'integration d'un premier thème clair

* MEA.sql: définit la valeur MEA du profile (Main Exerted Activity)
  dans la base de donnée

* Booking.aspx: Imlémente la vue du formulaire de reservation simple,
c'etait avant la reservation classique, sur une période plutôt qu'un
  jour.
La reservation classique est renomée `EavyBooking`.

* SimpleBookingQuery.cs: Implémente une simple commande de
  rendez-vous,
en tant que commande du workflow.

* .gitignore: ignorer les configuration des pré et prod totem.

* SkillEntity.cs:
* SkillManager.cs:
* Skills.aspx:
* SkillProvider.cs:
* SkillController.cs:
* UserSkills.aspx:
* NpgsqlSkillProvider.cs: refactorisation (-Skill+SkillEntity)

* NpgsqlProfileProvider.cs: Fixe un bug introduit avec
  l'implementation des profiles anonymes.

* FrontOfficeController.cs: definit l'interface de cotation des
  compétences attendues

* UserCard.ascx: Imlémente une carte utilisateur.

* Web.config: déclare le code activité principale exercée parmis les
  valeurs du profile authentifié.

* Web.csproj: ajoute les nouveaux formulaire de reservation au projet.

* PerformerProfile.cs: S'assure d'avoir une valeur pour le nom
  d'utilisateur à la création.

* LocalizedText.resx:
* LocalizedText.Designer.cs: "date préférée" en anglais

* LocalizedText.fr.resx:
* LocalizedText.fr.Designer.cs: "date préférée" en français

* Profile.cs: à la creation d'un profile, on doit avoir un nom
  d'utilisateur,
même dans le cas où le profile est anonyme (dans ce cas,
on l'appelle identifiant anonyme).
Sinon, on lève une exception.

* YavscModel.csproj: * refactorisation: le nom `Skill` est celui de
  l'espace,
celui de la classe devient `SkillEntity`.
* Creation de la requête dite simple d'un rendez-vous (pour
  prestation)
à une date donnée (sans heure), concernant simplement une activité.

* EavyBooking.aspx: Implémente la reservation lourde
vnext
Paul Schneider 9 years ago
parent 439759cb16
commit fe97f14831
29 changed files with 319 additions and 77 deletions

3
.gitignore vendored

@ -15,7 +15,8 @@ web/App_Themes/style.totem.css
web/Web.Debug.config web/Web.Debug.config
web/Web.Release.config web/Web.Release.config
web/Web.Lua.config web/Web.Lua.config
web/Web.TotemPre.config
web/Web.TotemProd.config
.nuget .nuget
.gitignore .gitignore

@ -1,3 +1,7 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* .gitignore: ignorer les configuration des pré et prod totem.
2015-11-21 Paul Schneider <paul@pschneider.fr> 2015-11-21 Paul Schneider <paul@pschneider.fr>
* Makefile: retour au débuggage de la copie de travaille, et * Makefile: retour au débuggage de la copie de travaille, et

@ -1,3 +1,7 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* NpgsqlSkillProvider.cs: refactorisation (-Skill+SkillEntity)
2015-11-19 Paul Schneider <paul@pschneider.fr> 2015-11-19 Paul Schneider <paul@pschneider.fr>
* NpgsqlContentProvider.csproj: adds a build target named * NpgsqlContentProvider.csproj: adds a build target named

@ -25,6 +25,7 @@ using System.Collections.Specialized;
using System.Collections.Generic; using System.Collections.Generic;
using Npgsql; using Npgsql;
using NpgsqlTypes; using NpgsqlTypes;
using Yavsc.Model.FrontOffice;
namespace WorkFlowProvider namespace WorkFlowProvider
{ {
@ -110,7 +111,7 @@ namespace WorkFlowProvider
/// Create the specified skill. /// Create the specified skill.
/// </summary> /// </summary>
/// <param name="skill">skill.</param> /// <param name="skill">skill.</param>
public override long Declare (Skill skill) public override long Declare (SkillEntity skill)
{ {
long res = 0; long res = 0;
using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) { using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) {
@ -258,9 +259,9 @@ namespace WorkFlowProvider
/// </summary> /// </summary>
/// <returns>The skill identifier.</returns> /// <returns>The skill identifier.</returns>
/// <param name="pattern">Pattern.</param> /// <param name="pattern">Pattern.</param>
public override Skill[] FindSkill (string pattern) public override SkillEntity[] FindSkill (string pattern)
{ {
List<Skill> skills = new List<Skill> (); List<SkillEntity> skills = new List<SkillEntity> ();
using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) { using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) {
cnx.Open (); cnx.Open ();
using (NpgsqlCommand cmd = cnx.CreateCommand ()) { using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
@ -269,7 +270,7 @@ namespace WorkFlowProvider
cmd.Prepare (); cmd.Prepare ();
using (var rdr = cmd.ExecuteReader ()) { using (var rdr = cmd.ExecuteReader ()) {
if (rdr.HasRows) while (rdr.Read ()) { if (rdr.HasRows) while (rdr.Read ()) {
skills.Add (new Skill () { skills.Add (new SkillEntity () {
Id = (long)rdr.GetInt64 (0), Id = (long)rdr.GetInt64 (0),
Name = (string)rdr.GetString (1), Name = (string)rdr.GetString (1),
Rate = (int) rdr.GetInt32(2) Rate = (int) rdr.GetInt32(2)

@ -1,3 +1,8 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* NpgsqlProfileProvider.cs: Fixe un bug introduit avec
l'implementation des profiles anonymes.
2015-11-19 Paul Schneider <paul@pschneider.fr> 2015-11-19 Paul Schneider <paul@pschneider.fr>
* NpgsqlMRPProviders.csproj: adds a build target named "Lua" * NpgsqlMRPProviders.csproj: adds a build target named "Lua"

@ -260,6 +260,7 @@ namespace Npgsql.Web
return; return;
long puid = 0; long puid = 0;
string username = (string) context ["UserName"]; string username = (string) context ["UserName"];
bool needsAProfileDataRecord = false;
// This user is either a authentified username, or an anonymous asp user id // This user is either a authentified username, or an anonymous asp user id
// He's anonymous when he's got no associated record in the "users" table // He's anonymous when he's got no associated record in the "users" table
// But, as long as our membership provider creates a mandatory (by db constraint) associated // But, as long as our membership provider creates a mandatory (by db constraint) associated
@ -269,37 +270,44 @@ namespace Npgsql.Web
cnx.Open (); cnx.Open ();
using (NpgsqlCommand cmdpi = cnx.CreateCommand ()) { using (NpgsqlCommand cmdpi = cnx.CreateCommand ()) {
cmdpi.CommandText = "select count(uniqueid) " + cmdpi.CommandText = "select count(uniqueid) " +
"from profiles where username = @username " + "from profiles where username = :username " +
"and applicationname = @appname"; "and applicationname = :appname";
cmdpi.Parameters.AddWithValue ("@username", username); cmdpi.Parameters.AddWithValue ("username", username);
cmdpi.Parameters.AddWithValue ("@appname", applicationName); cmdpi.Parameters.AddWithValue ("appname", applicationName);
long c = (long)cmdpi.ExecuteScalar (); long c = (long)cmdpi.ExecuteScalar ();
if (c == 0) { if (c == 0) {
// This is a new anonymous profile. // This is a new anonymous profile.
// the `isanonymous` field should be specified true by default in the ddl // the `isanonymous` field should be specified true by default in the ddl
cmdpi.CommandText = "insert into profiles (username,applicationname) " + cmdpi.CommandText = "insert into profiles (username,applicationname) " +
"values ( @username, @appname ) " + "values ( :username, :appname ) " +
"returning uniqueid"; "returning uniqueid";
puid = (long) cmdpi.ExecuteScalar (); puid = (long) cmdpi.ExecuteScalar ();
needsAProfileDataRecord = true;
using (NpgsqlCommand cmdpdins = cnx.CreateCommand ()) {
cmdpdins.CommandText = "insert into profiledata (uniqueid) values (@puid)";
cmdpdins.Parameters.AddWithValue ("@puid", puid);
cmdpdins.ExecuteNonQuery ();
}
} else { } else {
// here we're roughly sure to get the id // here we're roughly sure to get the id
cmdpi.CommandText = "select uniqueid from profiles where username = @username " + cmdpi.CommandText = "select uniqueid from profiles where username = :username " +
"and applicationname = @appname"; "and applicationname = :appname";
puid = (long)cmdpi.ExecuteScalar (); puid = (long) cmdpi.ExecuteScalar ();
// but still no data
using (NpgsqlCommand cmdgetdataprid = cnx.CreateCommand ()) {
cmdgetdataprid.CommandText = "select count(uniqueid) from profiledata where uniqueid = :puid";
cmdgetdataprid.Parameters.AddWithValue ("puid", puid);
long cd = (long) cmdgetdataprid.ExecuteScalar ();
if (cd == 0) {
needsAProfileDataRecord = true;
}
}
} }
} }
if (needsAProfileDataRecord) using (NpgsqlCommand cmdpdins = cnx.CreateCommand ()) {
cmdpdins.CommandText = "insert into profiledata (uniqueid) values (:puid)";
cmdpdins.Parameters.AddWithValue ("puid", puid);
cmdpdins.ExecuteNonQuery ();
}
foreach (SettingsPropertyValue s in collection) { foreach (SettingsPropertyValue s in collection) {
if (s.UsingDefaultValue) { if (s.UsingDefaultValue) {
//TODO Drop the property in the profile //TODO ? Drop the property in the profile
} else { } else {
// update the property value // update the property value
// TODO update to null values (included to avoid Not Implemented columns in profiledata // TODO update to null values (included to avoid Not Implemented columns in profiledata

@ -14,6 +14,7 @@ using Yavsc.Model.RolesAndMembers;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.IO; using System.IO;
using Yavsc.Model.FrontOffice.Catalog; using Yavsc.Model.FrontOffice.Catalog;
using Yavsc.Model.Skill;
namespace Yavsc.ApiControllers namespace Yavsc.ApiControllers
{ {
@ -108,7 +109,6 @@ namespace Yavsc.ApiControllers
if (!prcli.IsBillable) if (!prcli.IsBillable)
throw new TemplateException ("NotBillable:" + e.Client); throw new TemplateException ("NotBillable:" + e.Client);
tmpe.Session.Add ("from", prpro); tmpe.Session.Add ("from", prpro);
tmpe.Session.Add ("to", prcli); tmpe.Session.Add ("to", prcli);
tmpe.Session.Add ("efrom", Membership.GetUser (e.Responsible).Email); tmpe.Session.Add ("efrom", Membership.GetUser (e.Responsible).Email);
@ -176,6 +176,16 @@ namespace Yavsc.ApiControllers
return result; return result;
} }
/// <summary>
/// Rates the skill, this is a client action to profile its needs.
/// </summary>
/// <param name="rate">Skill rating.</param>
[Authorize()]
public void RateSkill (SkillRating rate) {
throw new NotImplementedException ();
}
} }
} }

@ -35,7 +35,7 @@ namespace Yavsc.ApiControllers
/// </summary> /// </summary>
/// <param name="s">the Skill objet.</param> /// <param name="s">the Skill objet.</param>
[ValidateAjaxAttribute,Authorize(Roles="Profiler")] [ValidateAjaxAttribute,Authorize(Roles="Profiler")]
public long DeclareSkill (Skill s) { public long DeclareSkill (SkillEntity s) {
if (ModelState.IsValid) { if (ModelState.IsValid) {
SkillManager.DeclareSkill (s); SkillManager.DeclareSkill (s);
} }
@ -83,7 +83,7 @@ namespace Yavsc.ApiControllers
/// </summary> /// </summary>
/// <returns>The skill identifier.</returns> /// <returns>The skill identifier.</returns>
/// <param name="pattern">Pattern.</param> /// <param name="pattern">Pattern.</param>
public Skill [] FindSkill (string pattern){ public SkillEntity [] FindSkill (string pattern){
return SkillManager.FindSkill(pattern); return SkillManager.FindSkill(pattern);
} }

@ -0,0 +1,5 @@

ALTER TABLE profiledata ADD COLUMN meacode character varying(256);
COMMENT ON COLUMN profiledata.meacode IS 'Code d''activité principale éxercée.';

@ -1,3 +1,31 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* MEA.sql: définit la valeur MEA du profile (Main Exerted
Activity) dans la base de donnée
* Booking.aspx: Imlémente la vue du formulaire de reservation
simple,
c'etait avant la reservation classique, sur une période plutôt
qu'un jour.
La reservation classique est renomée `EavyBooking`.
* FrontOfficeController.cs: definit l'interface de cotation
des compétences attendues
* Skills.aspx:
* SkillController.cs:
* UserSkills.aspx: refactorisation (-Skill+SkillEntity)
* UserCard.ascx: Imlémente une carte utilisateur.
* Web.config: déclare le code activité principale exercée
parmis les valeurs du profile authentifié.
* Web.csproj: ajoute les nouveaux formulaire de reservation au
projet.
* EavyBooking.aspx: Implémente la reservation lourde
2015-11-22 Paul Schneider <paul@pschneider.fr> 2015-11-22 Paul Schneider <paul@pschneider.fr>
* BasketController.cs: * BasketController.cs:

@ -0,0 +1,56 @@
<%@ Page Title="Booking" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<SimpleBookingQuery>" %>
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
<link rel="stylesheet" type="text/css" href="/App_Themes/jquery.timepicker.css" />
<script type="text/javascript" src="/Scripts/globalize/globalize.js"></script>
<script type="text/javascript" src="/Scripts/jquery.mousewheel.js"></script>
<script type="text/javascript" src="/Scripts/globalize/cultures/globalize.culture.fr.js"></script>
<script type="text/javascript" src="/Scripts/datepicker-fr.js"></script>
<script type="text/javascript" src="/Scripts/datepicker-en-GB.js"></script>
<script type="text/javascript" src="/Scripts/jquery.timepicker.min.js"></script>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% using ( Html.BeginForm("Booking") ) { %>
<fieldset>
<legend>Préferences musicales</legend>
<%= Html.LabelFor(model=>model.Needs) %>:
<ul>
<% foreach (var need in Model.Needs) { %>
<li><%= need.Name %> <%= Html.Partial("RateSkillControl",need)%></li>
<% } %>
</ul>
<%= Html.ValidationMessageFor(model=>model.Needs) %>
</fieldset>
<fieldset>
<legend>Date de l'événement</legend>
Intervention souhaitée le
<input type="text" id="PreferedDate" name="PreferedDate" class="start date" value="<%=Model.PreferedDate.ToString("yyyy/MM/dd")%>">
<%= Html.ValidationMessageFor( model=>model.PreferedDate ) %>
</fieldset>
<script>
$(document).ready(function(){
$('[data-type="rate-site-skill"]').rate({target: 'FrontOffice/RateSkill'});
var tpconfig = {
'timeFormat': 'H:i',
'showDuration': true,
'disableTimeRanges': [
['17:01pm', '24:01pm'],
['0am', '9am']
]};
$.datepicker.setDefaults($.datepicker.regional[ "fr" ] );
var dpconfig = {
'format': 'yy/mm/dd',
'autoclose': true } ;
// $('#PreferedHour').timepicker(tpconfig);
$('#PreferedDate').datepicker(dpconfig);
});
</script>
<input type="submit">
<% } %>
</asp:Content>

@ -1,4 +1,4 @@
<%@ Page Title="Booking" Language="C#" Inherits="System.Web.Mvc.ViewPage<BookQuery>" MasterPageFile="~/Models/App.master" %> <%@ Page Title="Booking" Language="C#" Inherits="System.Web.Mvc.ViewPage<BookingQuery>" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server"> <asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
<link rel="stylesheet" type="text/css" href="/App_Themes/jquery.timepicker.css" /> <link rel="stylesheet" type="text/css" href="/App_Themes/jquery.timepicker.css" />
<script type="text/javascript" src="/Scripts/globalize/globalize.js"></script> <script type="text/javascript" src="/Scripts/globalize/globalize.js"></script>
@ -32,13 +32,9 @@ et le
</div> </div>
<fieldset> <fieldset>
<legend>Intervenant</legend> <legend>Intervenant</legend>
<%= Html.LabelFor(model=>model.Role) %>: <%= Html.LabelFor(model=>model.Roles) %>:
<%= Html.TextBoxFor(model=>model.Role) %> <%= Html.TextBoxFor(model=>model.Roles) %>
<%= Html.ValidationMessageFor(model=>model.Role) %> <%= Html.ValidationMessageFor(model=>model.Roles) %>
<br>
<%= Html.LabelFor(model=>model.Person) %>:
<%= Html.TextBoxFor(model=>model.Person) %>
<%= Html.ValidationMessageFor(model=>model.Person) %>
</fieldset> </fieldset>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){

@ -1,4 +1,4 @@
<%@ Page Title="Skills" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Skill>>" %> <%@ Page Title="Skills" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SkillEntity>>" %>
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server"> <asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
<script src="<%=Url.Content("~/Scripts/yavsc.skills.js")%>"></script> <script src="<%=Url.Content("~/Scripts/yavsc.skills.js")%>"></script>
@ -10,8 +10,6 @@
</asp:Content> </asp:Content>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<aside class="control"> <aside class="control">
<form method="post" action="DeclareSkill"> <form method="post" action="DeclareSkill">
<fieldset> <fieldset>

@ -1,2 +1,14 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PerformerProfile>" %>
<img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="avatar" class="iconsmall" />
<%=Html.Encode(Model.UserName)%> <%= Html.Partial("RateControl",Model) %>
<ul>
<% foreach (var skill in Model.Skills) { %>
<li>
<%=Html.Encode(skill.SkillName)%> <%= Html.Partial("RateControl",skill) %>
<%=Html.Encode(skill.Comment)%>
</li>
<% } %>
</ul>
<% if (Model.HasCalendar()) { %>
<i class="fa fa-check">Calendrier Google Disponible</i>
<% } %>

@ -17,7 +17,7 @@
<div id="Err_skillId" class="field-validation-error"></div> <div id="Err_skillId" class="field-validation-error"></div>
<h2> <h2>
<select id="SkillId" > <select id="SkillId" >
<% foreach (var skill in (Skill[]) ViewData["SiteSkills"]) { <% foreach (var skill in (SkillEntity[]) ViewData["SiteSkills"]) {
if (Model.HasSkill(skill.Id)) {%> if (Model.HasSkill(skill.Id)) {%>
<option value="<%=skill.Id%>" disabled> <option value="<%=skill.Id%>" disabled>
<%=skill.Name%></option> <%=skill.Name%></option>
@ -52,5 +52,4 @@ if (Model.HasSkill(skill.Id)) {%>
</li> </li>
<% } %> <% } %>
</ul> </ul>
</asp:Content> </asp:Content>

@ -98,31 +98,25 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<roleManager enabled="true" defaultProvider="NpgsqlRoleProvider"> <roleManager enabled="true" defaultProvider="NpgsqlRoleProvider">
<providers> <providers>
<clear /> <clear />
<add name="NpgsqlRoleProvider" connectionStringName="yavsc" <add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" />
applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders"
autogenerateschema="false" />
</providers> </providers>
</roleManager> </roleManager>
<userNameManager defaultProvider="NpsqlUserNameProvider"> <userNameManager defaultProvider="NpsqlUserNameProvider">
<providers> <providers>
<add name="NpsqlUserNameProvider" connectionStringName="yavsc" <add name="NpsqlUserNameProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.RolesAndMembers.NpgsqlUserNameProvider, NpgsqlMRPProviders" autogenerateschema="false">
applicationName="/" type="Npgsql.Web.RolesAndMembers.NpgsqlUserNameProvider, NpgsqlMRPProviders"
autogenerateschema="false">
</add> </add>
</providers> </providers>
</userNameManager> </userNameManager>
<workflow defaultProvider="ITProvider"> <workflow defaultProvider="ITProvider">
<providers> <providers>
<clear /> <clear />
<add name="ITProvider" type="Yavsc.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" <add name="ITProvider" type="Yavsc.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc" />
connectionStringName="yavsc" />
</providers> </providers>
</workflow> </workflow>
<profile defaultProvider="NpgsqlProfileProvider"> <profile defaultProvider="NpgsqlProfileProvider">
<providers> <providers>
<clear /> <clear />
<add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" <add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" />
connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" />
</providers> </providers>
<properties> <properties>
<add name="Name" /> <add name="Name" />
@ -145,7 +139,8 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="gtoken" /> <add name="gtoken" />
<add name="grefreshtoken" /> <add name="grefreshtoken" />
<add name="gtokentype" /> <add name="gtokentype" />
<add name="gtokenexpir" type="System.DateTime" defaultValue="2008-05-01 7:34:42Z" /> <add name="MEACode" />
<add name="gtokenexpir" type="System.DateTime" defaultValue="2008-01-01 1:00:00Z" />
<add name="gcalapi" type="System.Boolean" defaultValue="false" /> <add name="gcalapi" type="System.Boolean" defaultValue="false" />
<add name="gcalid" /> <add name="gcalid" />
<add name="gregid" /> <add name="gregid" />
@ -216,6 +211,11 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
be allowed in shared hosting environments. --> be allowed in shared hosting environments. -->
<!--<servicePointManager checkCertificateRevocationList="true"/>--> <!--<servicePointManager checkCertificateRevocationList="true"/>-->
</settings> </settings>
<mailSettings>
<smtp deliveryMethod="network" from="paulschneider@free.fr">
<network host="[YOUR_SMTP_HOST]" port="25" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net> </system.net>
<uri> <uri>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names), <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
@ -225,8 +225,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<iriParsing enabled="true" /> <iriParsing enabled="true" />
</uri> </uri>
<authentication mode="Forms"> <authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="30" name=".ASPXFORM$" path="/" <forms loginUrl="~/Account/Login" timeout="30" name=".ASPXFORM$" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Index.aspx" enableCrossAppRedirects="false" />
requireSSL="false" slidingExpiration="true" defaultUrl="Index.aspx" enableCrossAppRedirects="false" />
</authentication> </authentication>
<!-- PayPal SDK settings --> <!-- PayPal SDK settings -->
<paypal> <paypal>

@ -451,7 +451,6 @@
<Content Include="App_Themes\images\ui-icons_ffffff_256x240.png" /> <Content Include="App_Themes\images\ui-icons_ffffff_256x240.png" />
<Content Include="Views\Google\Auth.aspx" /> <Content Include="Views\Google\Auth.aspx" />
<Content Include="Views\Google\ChooseCalendar.aspx" /> <Content Include="Views\Google\ChooseCalendar.aspx" />
<Content Include="Views\Google\Book.aspx" />
<Content Include="Views\Google\ChooseADate.aspx" /> <Content Include="Views\Google\ChooseADate.aspx" />
<Content Include="Views\Google\OtherWebException.aspx" /> <Content Include="Views\Google\OtherWebException.aspx" />
<Content Include="Models\AppAdmin.master" /> <Content Include="Models\AppAdmin.master" />
@ -508,6 +507,8 @@
<Content Include="Views\Account\RestrictedArea.aspx" /> <Content Include="Views\Account\RestrictedArea.aspx" />
<Content Include="Web.TotemProd.config" /> <Content Include="Web.TotemProd.config" />
<Content Include="Web.TotemPre.config" /> <Content Include="Web.TotemPre.config" />
<Content Include="Views\FrontOffice\Booking.aspx" />
<Content Include="Views\FrontOffice\EavyBooking.aspx" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
@ -539,6 +540,7 @@
<None Include="App_Code\Sql\Skills.sql" /> <None Include="App_Code\Sql\Skills.sql" />
<None Include="WebDeploy.targets" /> <None Include="WebDeploy.targets" />
<None Include="WebTasks.dll" /> <None Include="WebTasks.dll" />
<None Include="App_Code\Sql\MEA.sql" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj"> <ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj">

@ -1,3 +1,36 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* SimpleBookingQuery.cs: Implémente une simple commande de
rendez-vous,
en tant que commande du workflow.
* PerformerProfile.cs: S'assure d'avoir une valeur pour le nom
d'utilisateur à la création.
* LocalizedText.resx:
* LocalizedText.Designer.cs: "date préférée" en anglais
* LocalizedText.fr.resx:
* LocalizedText.fr.Designer.cs: "date préférée" en français
* Profile.cs: à la creation d'un profile, on doit avoir un nom
d'utilisateur,
même dans le cas où le profile est anonyme (dans ce cas,
on l'appelle identifiant anonyme).
Sinon, on lève une exception.
* SkillEntity.cs:
* SkillManager.cs:
* SkillProvider.cs: refactorisation (-Skill+SkillEntity)
* YavscModel.csproj: * refactorisation: le nom `Skill` est
celui de l'espace,
celui de la classe devient `SkillEntity`.
* Creation de la requête dite simple d'un rendez-vous (pour
prestation)
à une date donnée (sans heure), concernant simplement une
activité.
2015-11-22 Paul Schneider <paul@pschneider.fr> 2015-11-22 Paul Schneider <paul@pschneider.fr>
* YavscModel.csproj: * YavscModel.csproj:

@ -29,12 +29,12 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
namespace Yavsc.Model.Skill namespace Yavsc.Model.FrontOffice
{ {
/// <summary> /// <summary>
/// Performer profile. /// Performer profile.
/// </summary> /// </summary>
public class PerformerProfile: IRating, IIdentified public class PerformerProfile: UserNameBase, IRating, IIdentified
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Skill.PerformerProfile"/> class. /// Initializes a new instance of the <see cref="Yavsc.Model.Skill.PerformerProfile"/> class.
@ -44,12 +44,9 @@ namespace Yavsc.Model.Skill
} }
/// <summary> /// <summary>
/// Gets or sets the name of the user. /// Gets or sets the identifier.
/// </summary> /// </summary>
/// <value>The name of the user.</value> /// <value>The identifier.</value>
[Localizable(true), Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur")
,Display(ResourceType=typeof(LocalizedText),Name="User_name"),RegularExpression("([a-z]|[A-Z]|[0-9] )+")]
public string UserName { get; set; }
public long Id { get; set; } public long Id { get; set; }
/// <summary> /// <summary>
/// Gets or sets the skills. /// Gets or sets the skills.
@ -57,7 +54,7 @@ namespace Yavsc.Model.Skill
/// <value>The skills.</value> /// <value>The skills.</value>
public virtual IEnumerable<UserSkill> Skills { get; set; } public virtual IEnumerable<UserSkill> Skills { get; set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Yavsc.FrontOffice.PerformerProfile"/> class. /// Initializes a new instance of the <see cref="Yavsc.Model.Skill.PerformerProfile"/> class.
/// </summary> /// </summary>
/// <param name="username">Username.</param> /// <param name="username">Username.</param>
public PerformerProfile(string username) public PerformerProfile(string username)
@ -76,13 +73,16 @@ namespace Yavsc.Model.Skill
private Profile yavscCLientProfile = null; private Profile yavscCLientProfile = null;
/// <summary> /// <summary>
/// Gets the yavsc C lient profile. /// Gets the yavsc Client profile.
/// </summary> /// </summary>
/// <value>The yavsc C lient profile.</value> /// <value>The yavsc Client profile.</value>
public Profile YavscCLientProfile public Profile YavscClientProfile
{ {
get { get {
if (yavscCLientProfile == null) if (yavscCLientProfile == null)
if (UserName == null)
throw new Exception ("UserName not set");
else
yavscCLientProfile = new Profile ( yavscCLientProfile = new Profile (
ProfileBase.Create (UserName)); ProfileBase.Create (UserName));
return yavscCLientProfile; return yavscCLientProfile;
@ -105,6 +105,21 @@ namespace Yavsc.Model.Skill
{ {
return Skills.Any (x => x.SkillId == skillId); return Skills.Any (x => x.SkillId == skillId);
} }
/// <summary>
/// Gets the avatar.
/// </summary>
/// <value>The avatar.</value>
public string Avatar {
get {
return YavscClientProfile.avatar;
}
}
public bool HasCalendar ()
{
return (YavscClientProfile.GoogleCalendar != null);
}
} }
} }

@ -0,0 +1,47 @@
//
// SimpleBookingQuery.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 System.ComponentModel.DataAnnotations;
using Yavsc.Model.Skill;
namespace Yavsc.Model.FrontOffice
{
public class SimpleBookingQuery: Command
{
public SimpleBookingQuery ()
{
}
/// <summary>
/// Gets or sets the prefered date.
/// </summary>
/// <value>The prefered date.</value>
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)]
[Display(ResourceType=typeof(LocalizedText),Name="PreferedDate")]
public DateTime PreferedDate { get; set; }
public string Activity { get; set; }
public SkillEntity[] Needs { get; set; }
}
}

@ -298,9 +298,9 @@ namespace Yavsc.Model {
} }
} }
public static string Register { public static string PreferedDate {
get { get {
return ResourceManager.GetString("Register", resourceCulture); return ResourceManager.GetString("PreferedDate", resourceCulture);
} }
} }
@ -364,6 +364,12 @@ namespace Yavsc.Model {
} }
} }
public static string Register {
get {
return ResourceManager.GetString("Register", resourceCulture);
}
}
public static string Logout { public static string Logout {
get { get {
return ResourceManager.GetString("Logout", resourceCulture); return ResourceManager.GetString("Logout", resourceCulture);

@ -286,9 +286,9 @@ namespace Yavsc.Model {
} }
} }
public static string Register { public static string PreferedDate {
get { get {
return ResourceManager.GetString("Register", resourceCulture); return ResourceManager.GetString("PreferedDate", resourceCulture);
} }
} }
@ -346,6 +346,12 @@ namespace Yavsc.Model {
} }
} }
public static string Register {
get {
return ResourceManager.GetString("Register", resourceCulture);
}
}
public static string Logout { public static string Logout {
get { get {
return ResourceManager.GetString("Logout", resourceCulture); return ResourceManager.GetString("Logout", resourceCulture);

@ -70,6 +70,7 @@
<data name="Online"><value>En ligne</value></data> <data name="Online"><value>En ligne</value></data>
<data name="Pdf_version"><value>Version Pdf</value></data> <data name="Pdf_version"><value>Version Pdf</value></data>
<data name="Person"><value>Personne</value></data> <data name="Person"><value>Personne</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="Preview"><value>Prévisualiser</value><comment>Prévisualiser le document</comment></data>
<data name="Profile_edition"><value>Édition du profile</value></data> <data name="Profile_edition"><value>Édition du profile</value></data>
<data name="Product_reference"><value>Référence produit</value></data> <data name="Product_reference"><value>Référence produit</value></data>

@ -73,6 +73,7 @@
<data name="Offline"><value>Offline</value></data> <data name="Offline"><value>Offline</value></data>
<data name="Pdf_version"><value>Pdf version</value></data> <data name="Pdf_version"><value>Pdf version</value></data>
<data name="Person"><value>Person</value></data> <data name="Person"><value>Person</value></data>
<data name="PreferedDate"><value>Prefered date</value></data>
<data name="Preview"><value>Preview</value><comment>comment on preview</comment></data> <data name="Preview"><value>Preview</value><comment>comment on preview</comment></data>
<data name="Private_circle"><value>Private circle</value></data> <data name="Private_circle"><value>Private circle</value></data>
<data name="Profile_edition"><value>Profile edition</value></data> <data name="Profile_edition"><value>Profile edition</value></data>

@ -249,8 +249,10 @@ namespace Yavsc.Model.RolesAndMembers
public Profile (ProfileBase profile) public Profile (ProfileBase profile)
{ {
if (profile == null) throw new Exception ("No profile"); if (profile == null) throw new Exception ("No profile");
userName = profile.UserName; if (profile.UserName == null) throw new Exception ("UserName not set");
UITheme = (string) profile.GetPropertyValue ("UITheme"); UITheme = (string) profile.GetPropertyValue ("UITheme");
userName = profile.UserName;
if (profile.IsAnonymous) return;
BlogVisible = (bool) profile.GetPropertyValue ("BlogVisible"); BlogVisible = (bool) profile.GetPropertyValue ("BlogVisible");
BlogTitle = (string) profile.GetPropertyValue ("BlogTitle"); BlogTitle = (string) profile.GetPropertyValue ("BlogTitle");
avatar = (string) profile.GetPropertyValue ("Avatar"); avatar = (string) profile.GetPropertyValue ("Avatar");

@ -30,7 +30,7 @@ namespace Yavsc.Model.Skill
/// <summary> /// <summary>
/// Skill. /// Skill.
/// </summary> /// </summary>
public class Skill : IRating { public class SkillEntity : IRating {
/// <summary> /// <summary>
/// Gets or sets the identifier. /// Gets or sets the identifier.

@ -22,6 +22,7 @@ using System;
using System.Configuration; using System.Configuration;
using System.Reflection; using System.Reflection;
using System.Configuration.Provider; using System.Configuration.Provider;
using Yavsc.Model.FrontOffice;
namespace Yavsc.Model.Skill namespace Yavsc.Model.Skill
{ {
@ -49,7 +50,7 @@ namespace Yavsc.Model.Skill
/// Create or modifies the specified skill. /// Create or modifies the specified skill.
/// </summary> /// </summary>
/// <param name="skill">the skill.</param> /// <param name="skill">the skill.</param>
public static long DeclareSkill(Skill skill) { public static long DeclareSkill(SkillEntity skill) {
Provider.Declare(skill); Provider.Declare(skill);
return skill.Id; return skill.Id;
} }
@ -85,7 +86,7 @@ namespace Yavsc.Model.Skill
/// </summary> /// </summary>
/// <returns>The skill identifier.</returns> /// <returns>The skill identifier.</returns>
/// <param name="pattern">Pattern.</param> /// <param name="pattern">Pattern.</param>
public static Skill [] FindSkill(string pattern){ public static SkillEntity [] FindSkill(string pattern){
return Provider.FindSkill(pattern); return Provider.FindSkill(pattern);
} }

@ -20,6 +20,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using System; using System;
using System.Configuration.Provider; using System.Configuration.Provider;
using Yavsc.Model.FrontOffice;
namespace Yavsc.Model.Skill namespace Yavsc.Model.Skill
{ {
@ -32,7 +33,7 @@ namespace Yavsc.Model.Skill
/// Declare the specified skill. /// Declare the specified skill.
/// </summary> /// </summary>
/// <param name="skill">Skill.</param> /// <param name="skill">Skill.</param>
public abstract long Declare(Skill skill) ; public abstract long Declare(SkillEntity skill) ;
/// <summary> /// <summary>
/// Declare the specified user skill. /// Declare the specified user skill.
@ -57,7 +58,7 @@ namespace Yavsc.Model.Skill
/// </summary> /// </summary>
/// <returns>The skill identifier.</returns> /// <returns>The skill identifier.</returns>
/// <param name="pattern">Pattern.</param> /// <param name="pattern">Pattern.</param>
public abstract Skill [] FindSkill(string pattern); public abstract SkillEntity [] FindSkill(string pattern);
/// <summary> /// <summary>
/// Gets the user skills. /// Gets the user skills.

@ -188,7 +188,6 @@
<Compile Include="Skill\SkillProvider.cs" /> <Compile Include="Skill\SkillProvider.cs" />
<Compile Include="Skill\SkillManager.cs" /> <Compile Include="Skill\SkillManager.cs" />
<Compile Include="Manager.cs" /> <Compile Include="Manager.cs" />
<Compile Include="Skill\Skill.cs" />
<Compile Include="Skill\UserSkill.cs" /> <Compile Include="Skill\UserSkill.cs" />
<Compile Include="Skill\UserSkillComment.cs" /> <Compile Include="Skill\UserSkillComment.cs" />
<Compile Include="Skill\UserSkillDeclaration.cs" /> <Compile Include="Skill\UserSkillDeclaration.cs" />
@ -198,8 +197,10 @@
<Compile Include="IIdentified.cs" /> <Compile Include="IIdentified.cs" />
<Compile Include="IRating.cs" /> <Compile Include="IRating.cs" />
<Compile Include="IAuthorized.cs" /> <Compile Include="IAuthorized.cs" />
<Compile Include="Skill\PerformerProfile.cs" />
<Compile Include="FileSystem\UserFileSystemManager.cs" /> <Compile Include="FileSystem\UserFileSystemManager.cs" />
<Compile Include="FrontOffice\PerformerProfile.cs" />
<Compile Include="FrontOffice\SimpleBookingQuery.cs" />
<Compile Include="Skill\SkillEntity.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

Loading…