diff --git a/.gitignore b/.gitignore index 96a48f3d..c8f0403b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ web/App_Themes/style.totem.css web/Web.Debug.config web/Web.Release.config web/Web.Lua.config +web/Web.LuaDebug.config web/Web.TotemPre.config web/Web.Totemprod.config .nuget diff --git a/ChangeLog b/ChangeLog index 34b1c396..fc6a58e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-12-30 Paul Schneider + + * .gitignore: ignore ma config LuaDebug + 2015-12-24 Paul Schneider * Makefile: diff --git a/NpgsqlMRPProviders/ChangeLog b/NpgsqlMRPProviders/ChangeLog index 52e97a71..f7f94295 100644 --- a/NpgsqlMRPProviders/ChangeLog +++ b/NpgsqlMRPProviders/ChangeLog @@ -1,3 +1,9 @@ +2015-12-30 Paul Schneider + + * NpgsqlMembershipProvider.cs: ne pas crasher à la lecture en + base de la question de + recupération du mot de passe quand elle est nulle. + 2015-12-24 Paul Schneider * NpgsqlMRPProviders.csproj: ajout d'une configuration de diff --git a/NpgsqlMRPProviders/NpgsqlMembershipProvider.cs b/NpgsqlMRPProviders/NpgsqlMembershipProvider.cs index 049883de..22b100d9 100644 --- a/NpgsqlMRPProviders/NpgsqlMembershipProvider.cs +++ b/NpgsqlMRPProviders/NpgsqlMembershipProvider.cs @@ -633,8 +633,10 @@ namespace Npgsql.Web if (reader.GetBoolean (2)) throw new MembershipPasswordException ("The supplied user is locked out."); - password = reader.GetString (0); - passwordAnswer = reader.GetString (1); + if (!reader.IsDBNull(0)) + password = reader.GetString (0); + if (!reader.IsDBNull(1)) + passwordAnswer = reader.GetString (1); } else { throw new MembershipPasswordException ("The supplied user name is not found."); } diff --git a/web/ApiControllers/BasketController.cs b/web/ApiControllers/BasketController.cs index bf70c086..5d3ca550 100644 --- a/web/ApiControllers/BasketController.cs +++ b/web/ApiControllers/BasketController.cs @@ -42,7 +42,7 @@ namespace Yavsc.ApiControllers /// /// Create the specified basket item using specified command parameters. /// - public long Create() + public CommandRegistration Create() { return YavscHelpers.CreateCommandFromRequest (); } diff --git a/web/App_Code/Global.asax.cs b/web/App_Code/Global.asax.cs index 6d0d4545..2880261e 100644 --- a/web/App_Code/Global.asax.cs +++ b/web/App_Code/Global.asax.cs @@ -31,6 +31,8 @@ namespace Yavsc routes.IgnoreRoute ("{resource}.axd/{*pathInfo}"); // not used routes.IgnoreRoute ("Scripts/{*pathInfo}"); // web user side scripts routes.IgnoreRoute ("App_Theme/{*pathInfo}"); // sites themes + routes.IgnoreRoute ("App_Data/{*pathInfo}"); // sites themes + routes.IgnoreRoute ("App_Code/{*pathInfo}"); // sites themes routes.IgnoreRoute ("users/{*pathInfo}"); // user's files routes.IgnoreRoute ("avatars/{*pathInfo}"); // user's avatar routes.IgnoreRoute ("bfiles/{*pathInfo}"); // Blog files diff --git a/web/App_Code/Sql/instdbws.sql b/web/App_Code/Sql/instdbws.sql index 647ab8d6..c55571d0 100644 --- a/web/App_Code/Sql/instdbws.sql +++ b/web/App_Code/Sql/instdbws.sql @@ -214,10 +214,11 @@ CREATE TABLE commandes id bigserial NOT NULL, -- Identifiant unique de commande e, cours validation date, -- Date de validation prdref character varying(255) NOT NULL, -- Product reference from the unique valid catalog at the validation date - creation timestamp with time zone NOT NULL, -- creation date + creation timestamp with time zone NOT NULL DEFAULT now(), -- creation date clientname character varying(255), -- user who created the command, client of this command applicationname character varying(255), -- application concerned by this command - params json, + class character varying(512), -- Classe de commande:... + params jsonb, CONSTRAINT commandes_pkey PRIMARY KEY (id), CONSTRAINT commforeignuser FOREIGN KEY (clientname, applicationname) REFERENCES users (username, applicationname) MATCH SIMPLE @@ -226,13 +227,19 @@ CREATE TABLE commandes WITH ( OIDS=FALSE ); - +ALTER TABLE commandes + OWNER TO yavscdev; COMMENT ON COLUMN commandes.id IS 'Identifiant unique de commande e, cours'; COMMENT ON COLUMN commandes.validation IS 'Date de validation'; COMMENT ON COLUMN commandes.prdref IS 'Product reference from the unique valid catalog at the validation date'; COMMENT ON COLUMN commandes.creation IS 'creation date'; COMMENT ON COLUMN commandes.clientname IS 'user who created the command, client of this command'; COMMENT ON COLUMN commandes.applicationname IS 'application concerned by this command'; +COMMENT ON COLUMN commandes.class IS 'Classe de commande: +Utilisé pour l''instanciation de l''objet du SI, +le nom du contrôle Html, et +determiner les fournisseurs du Workflow +à mettre en oeuvre pour traiter la commande.'; -- Index: fki_commforeignuser diff --git a/web/RegistrationMail.txt b/web/App_Data/RegistrationMail.txt similarity index 74% rename from web/RegistrationMail.txt rename to web/App_Data/RegistrationMail.txt index 90e5bec0..ce0c44ae 100644 --- a/web/RegistrationMail.txt +++ b/web/App_Data/RegistrationMail.txt @@ -7,3 +7,7 @@ Pour l'activer, veuillez suivre le lien suivant : <%UserActivatonUrl%> Merci d'avoir créé un compte utilisateur. + +Puissiez-vous avoir beaucoup de fun. +-- +L'équipe d'administration \ No newline at end of file diff --git a/web/App_Data/ResetPassword.txt b/web/App_Data/ResetPassword.txt new file mode 100644 index 00000000..6958e3dc --- /dev/null +++ b/web/App_Data/ResetPassword.txt @@ -0,0 +1,15 @@ + +Une demande de mise à jour de votre mot de passe <%SiteName%> a été faite en ligne. + +Vous pouvez changer votre mot de passe en suivant le lien suivant : + +<%UserActivatonUrl%> + +Si vous n'êtes pas à l'origine de cette demande, qu'elle est indésirée, + veuillez nous excuser pour la gêne occasionnée, et nous en avertir +par retour de ce courrier. + +Que le fun avec vous soit. +-- +l'administration +<%SiteName%> \ No newline at end of file diff --git a/web/App_Themes/base/style.css b/web/App_Themes/base/style.css new file mode 100644 index 00000000..e02abfc9 --- /dev/null +++ b/web/App_Themes/base/style.css @@ -0,0 +1 @@ + diff --git a/web/ChangeLog b/web/ChangeLog index e2508e08..ba9816a2 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,87 @@ +2015-12-30 Paul Schneider + + * ResetPassword.txt: Un message pour le mot de passe oublié + + * style.css: fixe un 404 + + * UpdatePassword.aspx: Implémente le formulaire de mise à jour + du mot de passe, + accessible depuis l'e-mail. + + * Contact.aspx: implémente la page de contact préstataire + + * BasketController.cs: renvoie l'objet décrivant la prise de + commande + + * Global.asax.cs: ignorer les routes vers App_Data et App_Code + + * instdbws.sql: passage du type json à jsonb pour les + paramètres de la commande + + * RegistrationMail.txt: un piti message à l'enregistrement + + * AccountController.cs: Envoi du message du mot de passe + oublié, + methode de changemnet du mot de passe. + + * AdminController.cs: xmldoc + refabrication helper Notify + + * HomeController.cs: + * BlogsController.cs: + * GoogleController.cs: refabrication helper Notify + + * FrontOfficeController.cs: Refabrication: Utilisation du + nouvel enregistrement de commande. + + refabrication helper Notify + + * YavscHelpers.cs: implémente la methode d'envoi du message de + mot de passe oublié + + refabrication helper Notify + + * App.master: Corrige la notification Html + + * AppAdmin.master: Le lien vers la page de contact était + associé + à tort à la classe css "thanks" + + * yavsc.js: message plus parlant en cas de requête Ajax mal + formée. + + * Login.aspx: Implémente le lien vers le formulaire de + recupération du mot de passe + + * UserPost.aspx: . + + * Booking.aspx: format du code + + * Performer.ascx: l'e-mail préstataire ne sera jamais fourni + par l'application, + aussi, on parlera de "prendre contact", d'échanger ... mais + pas de donner l'adresse e-mail. + L'information "son email" n'est donc pas disponible meme à + l'utilisateur autorisé. + La prise de contact, ou autre fux de comunication le sont. + + * Performers.aspx: affiche la notification à l'envoi de la + demande de devis + + * Product.aspx: + * Service.aspx: les periodes du catalogue et du calendrier + sont fondue. + + * Contact.aspx: traduction en français + + * Web.config: * la procédure de recupération du mot de passe + est activée + * l'e-message envoyé est construit à partir d'un modèle, un + fichier texte trouvé dans /App_Data, et indiqué à + l'application + par le paramêtre applicatif "LostPasswordMessage" + + * Yavsc.csproj: reference les nouveaux fichiers + + * OtherWebException.aspx: page obsolete + 2015-12-24 Paul Schneider * App.master: traductions diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index ff417245..90e57317 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -18,6 +18,7 @@ using System.Net; using System.Configuration; using Yavsc.Model; using Yavsc.Model.WorkFlow; +using Yavsc.Model.Messaging; namespace Yavsc.Controllers { @@ -62,7 +63,7 @@ namespace Yavsc.Controllers /// The login. /// Model. /// Return URL. - [HttpPost,ValidateAntiForgeryToken] + [HttpPost,ValidateAntiForgeryToken] public ActionResult Login (LoginModel model, string returnUrl) { if (ModelState.IsValid) { @@ -362,7 +363,7 @@ namespace Yavsc.Controllers FormsAuthentication.SetAuthCookie (model.NewUserName, model.RememberMe); model.UserName = model.NewUserName; } - YavscHelpers.Notify(ViewData, "Profile enregistré"+((editsTheUserName)?", nom public inclu.":"")); + ViewData.Notify( "Profile enregistré"+((editsTheUserName)?", nom public inclu.":"")); } SetMEACodeViewData (model); SetUIThemeViewData (model); @@ -404,8 +405,10 @@ namespace Yavsc.Controllers foreach (string key in errors.Keys) ModelState.AddModelError (key, errors [key]); - if (user != null && ModelState.IsValid) - Url.SendActivationMessage (user); + if (user != null && ModelState.IsValid) { + YavscHelpers.SendNewPasswordMessage (user); + ViewData.Notify ( new Notification () { body = LocalizedText.NewPasswordMessageSent } ); + } } return View (model); } @@ -420,22 +423,69 @@ namespace Yavsc.Controllers { MembershipUser u = Membership.GetUser (id, false); if (u == null) { - YavscHelpers.Notify( ViewData, + ViewData.Notify( string.Format ("Cet utilisateur n'existe pas ({0})", id)); } else if (u.ProviderUserKey.ToString () == key) { if (u.IsApproved) { - YavscHelpers.Notify( ViewData, + ViewData.Notify( string.Format ("Votre compte ({0}) est déjà validé.", id)); } else { u.IsApproved = true; Membership.UpdateUser (u); - YavscHelpers.Notify( ViewData, + ViewData.Notify( string.Format ("La création de votre compte ({0}) est validée.", id)); } } else - YavscHelpers.Notify( ViewData, "La clé utilisée pour valider ce compte est incorrecte" ); + ViewData.Notify( "La clé utilisée pour valider ce compte est incorrecte" ); return View (); } + /// + /// Updates the password. + /// + /// The password. + /// Identifier. + /// Key. + [HttpGet] + public ActionResult UpdatePassword (string id, string key) + { + MembershipUser u = Membership.GetUser (id, false); + if (u == null) { + return Content( + string.Format("Cet utilisateur n'existe pas ({0})", id)); + } + if (u.ProviderUserKey.ToString () != key) { + return Content("Clé invalide"); + } + ViewData["UserName"] = id; + ViewData["UserKey"] = key; + return View (); + } + + /// + /// Updates the password. + /// + /// The password. + /// Model. + [HttpPost] + public ActionResult UpdatePassword (UpdatePassword model) + { + if (ModelState.IsValid) { + if (model.Password == model.ConfirmPassword) { + MembershipUser u = Membership.GetUser (model.UserName, false); + if (u == null) { + return Content( + string.Format("Cet utilisateur n'existe pas ({0})", model.UserName)); + } + if (u.ProviderUserKey.ToString () != model.UserKey) { + return Content("Clé invalide"); + } + u.ChangePassword(u.GetPassword (),model.Password); + ViewData.Notify( "La mise à jour du mot de passe a été effectuée."); + return View("Index"); + } + } + return View(); + } } } diff --git a/web/Controllers/AdminController.cs b/web/Controllers/AdminController.cs index 8a137198..433f03a5 100644 --- a/web/Controllers/AdminController.cs +++ b/web/Controllers/AdminController.cs @@ -27,7 +27,7 @@ namespace Yavsc.Controllers // FIXME do this in a new installation script. if (!Roles.RoleExists (_adminRoleName)) { Roles.CreateRole (_adminRoleName); - YavscHelpers.Notify (ViewData, _adminRoleName + " " + LocalizedText.role_created); + ViewData.Notify( _adminRoleName + " " + LocalizedText.role_created); } return View (); } @@ -159,6 +159,13 @@ namespace Yavsc.Controllers return Redirect(returnUrl); } + /// + /// Adds the user to role. + /// + /// The user to role. + /// Username. + /// Rolename. + /// Return URL. [Authorize(Roles="Admin")] public ActionResult AddUserToRole(string username, string rolename, string returnUrl) { @@ -178,7 +185,7 @@ namespace Yavsc.Controllers ViewData ["usertoremove"] = username; if (submitbutton == "Supprimer") { Membership.DeleteUser (username); - YavscHelpers.Notify(ViewData, string.Format("utilisateur \"{0}\" supprimé",username)); + ViewData.Notify( string.Format("utilisateur \"{0}\" supprimé",username)); ViewData ["usertoremove"] = null; } return View (); @@ -273,7 +280,7 @@ namespace Yavsc.Controllers public ActionResult AddRole (string rolename) { Roles.CreateRole(rolename); - YavscHelpers.Notify(ViewData, LocalizedText.role_created+ " : "+rolename); + ViewData.Notify(LocalizedText.role_created+ " : "+rolename); return View (); } @@ -310,7 +317,7 @@ namespace Yavsc.Controllers ViewData ["useritems"] = users; if (ModelState.IsValid) { Roles.AddUserToRole (model.UserName, _adminRoleName); - YavscHelpers.Notify(ViewData, model.UserName + " "+LocalizedText.was_added_to_the_role+" '" + _adminRoleName + "'"); + ViewData.Notify(model.UserName + " "+LocalizedText.was_added_to_the_role+" '" + _adminRoleName + "'"); } else { if (admins.Length > 0) { if (! admins.Contains (Membership.GetUser ().UserName)) { @@ -321,7 +328,7 @@ namespace Yavsc.Controllers // No admin, gives the Admin Role to the current user Roles.AddUserToRole (currentUser, _adminRoleName); admins = new string[] { currentUser }; - YavscHelpers.Notify(ViewData, string.Format ( + ViewData.Notify( string.Format ( LocalizedText.was_added_to_the_empty_role, currentUser, _adminRoleName)); } diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index c13b1f47..816e02f4 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -289,11 +289,11 @@ namespace Yavsc.Controllers // ensures rights to update BlogManager.GetForEditing (model.Id, true); BlogManager.UpdatePost (model.Id, model.Title, model.Content, model.Visible, model.AllowedCircles); - YavscHelpers.Notify (ViewData, LocalizedText.BillUpdated); + ViewData.Notify( LocalizedText.BillUpdated); } else { model.Id = BlogManager.Post (model.Author, model.Title, model.Content, model.Visible, model.AllowedCircles); - YavscHelpers.Notify (ViewData, LocalizedText.BillCreated); + ViewData.Notify( LocalizedText.BillCreated); } BlogManager.UpdatePostPhoto (model.Id, model.Photo); } diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index 81c78dbf..72f1517f 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -207,7 +207,7 @@ namespace Yavsc.Controllers ViewData ["ProdRef"] = pref; Catalog cat = CatalogManager.GetCatalog (); if (cat == null) { - YavscHelpers.Notify (ViewData, "Catalog introuvable"); + ViewData.Notify( "Catalog introuvable"); ViewData ["RefType"] = "Catalog"; return View ("ReferenceNotFound"); } @@ -257,10 +257,12 @@ namespace Yavsc.Controllers // * Make the workflow register this command // * Render the resulting basket - long cmdid = YavscHelpers.CreateCommandFromRequest (); + NominativeCommandRegistration cmdreg = YavscHelpers.CreateCommandFromRequest () + as NominativeCommandRegistration; var basket = WorkFlowManager.GetCommands (User.Identity.Name); - ViewData["Commanded"] = basket[cmdid]; - YavscHelpers.Notify (ViewData, + ViewData["Commanded"] = basket[cmdreg.CommandId]; + ViewData["CommandResult"] = cmdreg ; + ViewData.Notify( LocalizedText.Item_added_to_basket); return View ("Basket",basket); } catch (Exception e) { @@ -315,7 +317,7 @@ namespace Yavsc.Controllers /// /// Activities the specified search and toPower. /// - /// Search. + /// Activity identifier. /// If set to true to power. public ActionResult Activities (string id, bool toPower = false) { @@ -329,7 +331,7 @@ namespace Yavsc.Controllers /// /// Activity at the specified id. /// - /// Identifier. + /// Identifier. public ActionResult Activity (string MEACode) { return View (WorkFlowManager.GetActivity (MEACode)); @@ -356,7 +358,7 @@ namespace Yavsc.Controllers // That filters the view in order to only edit the given fieldset if (mea == "none") - YavscHelpers.Notify (ViewData, "Vous devez choisir une activité avant de pouvoir déclarer vos compétences " + + ViewData.Notify( "Vous devez choisir une activité avant de pouvoir déclarer vos compétences " + "(Editez la rubrique Informations publiques votre profile)"); @@ -398,7 +400,7 @@ namespace Yavsc.Controllers response = reader.ReadToEnd (); stream.Close (); } - YavscHelpers.Notify (ViewData, + ViewData.Notify( string.Format ( "Google calendar API exception {0} : {1}
{2}
", ex.Status.ToString (), @@ -498,7 +500,7 @@ namespace Yavsc.Controllers stream.Dispose (); } - YavscHelpers.Notify (ViewData, + ViewData.Notify( string.Format ( "{3} exception {0} : {1}
{2}
", ex.Status.ToString (), diff --git a/web/Controllers/GoogleController.cs b/web/Controllers/GoogleController.cs index a75b552b..9f88653c 100644 --- a/web/Controllers/GoogleController.cs +++ b/web/Controllers/GoogleController.cs @@ -109,7 +109,7 @@ namespace Yavsc.Controllers OAuth2 oa = GoogleHelpers.CreateOAuth2 (CalendarGRU); AuthToken gat = oa.GetToken (Request, (string) Session ["state"], out msg); if (gat == null) { - YavscHelpers.Notify(ViewData, msg); + ViewData.Notify( msg); return View ("Auth"); } SaveToken (HttpContext.Profile,gat); @@ -147,7 +147,7 @@ namespace Yavsc.Controllers OAuth2 oa = GoogleHelpers.CreateOAuth2 (AuthGRU); AuthToken gat = oa.GetToken (Request, (string)Session ["state"], out msg); if (gat == null) { - YavscHelpers.Notify(ViewData, msg); + ViewData.Notify(msg); return View (); } string returnUrl = (string)Session ["returnUrl"]; diff --git a/web/Controllers/HomeController.cs b/web/Controllers/HomeController.cs index 2ea70861..cc0d847c 100644 --- a/web/Controllers/HomeController.cs +++ b/web/Controllers/HomeController.cs @@ -151,7 +151,7 @@ namespace Yavsc.Controllers using (System.Net.Mail.SmtpClient sc = new SmtpClient()) { sc.Send (msg); - YavscHelpers.Notify(ViewData, LocalizedText.Message_sent); + ViewData.Notify(LocalizedText.Message_sent); return View (new { email=email, reason="", body="" }); } } diff --git a/web/Helpers/YavscHelpers.cs b/web/Helpers/YavscHelpers.cs index 9595d2d9..adfcdbe6 100644 --- a/web/Helpers/YavscHelpers.cs +++ b/web/Helpers/YavscHelpers.cs @@ -20,6 +20,7 @@ using System.Linq; using System.Reflection; using System.Web.Routing; using Yavsc.Model.FrontOffice; +using Yavsc.Model.WorkFlow; namespace Yavsc.Helpers { @@ -51,21 +52,23 @@ namespace Yavsc.Helpers "APPL_PHYSICAL_PATH", "CERT_SECRETKEYSIZE", "CERT_SERVER_ISSUER", "INSTANCE_META_PATH", "SERVER_PORT_SECURE", "CERT_SERVER_SUBJECT", "HTTPS_SECRETKEYSIZE", "HTTPS_SERVER_ISSUER", - "HTTP_CONTENT_LENGTH", "HTTPS_SERVER_SUBJECT", "HTTP_ACCEPT_ENCODING", "HTTP_ACCEPT_LANGUAGE" + "HTTP_CONTENT_LENGTH", "HTTPS_SERVER_SUBJECT", "HTTP_ACCEPT_ENCODING", "HTTP_ACCEPT_LANGUAGE", + "HTTP_CACHE_CONTROL", "__RequestVerificationToken" }; - public static long CreateCommandFromRequest() + public static CommandRegistration CreateCommandFromRequest() { var keys = HttpContext.Current.Request.Params.AllKeys.Where ( x => !YavscHelpers.FilteredKeys.Contains (x)).ToArray(); var prms = new Dictionary (); - + CommandRegistration cmdreg; foreach (var key in keys) { prms.Add (key, HttpContext.Current.Request.Params [key]); } - Command cmd = Command.CreateCommand( + Command.CreateCommand( prms, - HttpContext.Current.Request.Files); - return cmd.Id; + HttpContext.Current.Request.Files, + out cmdreg); + return cmdreg; } private static string siteName = null; @@ -115,7 +118,8 @@ namespace Yavsc.Helpers { SendActivationMessage ( string.Format("{2}://{3}/Account/Validate/{1}?key={0}", - user.ProviderUserKey.ToString(), user.UserName , + user.ProviderUserKey.ToString(), + HttpUtility.UrlEncode(user.UserName), helper.RequestContext.HttpContext.Request.Url.Scheme, helper.RequestContext.HttpContext.Request.Url.Authority ) @@ -123,13 +127,30 @@ namespace Yavsc.Helpers user); } + public static void SendNewPasswordMessage(MembershipUser user) + { + SendActivationMessage ( + string.Format("{2}://{3}/Account/UpdatePassword/{1}?key={0}", + user.ProviderUserKey.ToString(), + HttpUtility.UrlEncode(user.UserName), + HttpContext.Current.Request.Url.Scheme, + HttpContext.Current.Request.Url.Authority + ) + , WebConfigurationManager.AppSettings ["LostPasswordMessage"], + user, + "Mot de passe {0} perdu" + ); + } + + /// /// Sends the activation message. /// /// Validation URL. /// Registration message. /// User. - public static void SendActivationMessage(string validationUrl, string registrationMessage, MembershipUser user) { + public static void SendActivationMessage(string validationUrl, + string registrationMessage, MembershipUser user,string title = "Validation de votre compte {0}") { FileInfo fi = new FileInfo ( HttpContext.Current.Server.MapPath (registrationMessage)); if (!fi.Exists) { @@ -148,7 +169,7 @@ namespace Yavsc.Helpers using (MailMessage msg = new MailMessage ( Admail, user.Email, - string.Format ("Validation de votre compte {0}", YavscHelpers.SiteName), + string.Format (title, YavscHelpers.SiteName), body)) { using (SmtpClient sc = new SmtpClient ()) { sc.Send (msg); @@ -166,6 +187,7 @@ namespace Yavsc.Helpers /// User. public static void ValidatePasswordReset(LostPasswordModel model, out StringDictionary errors, out MembershipUser user) { + MembershipUser user1 = null; MembershipUserCollection users = null; errors = new StringDictionary (); user = null; @@ -180,23 +202,26 @@ namespace Yavsc.Helpers errors.Add ("UserName", "Found more than one user!(sic)"); return ; } + foreach (var u in users) user1 = u as MembershipUser; } - if (!string.IsNullOrEmpty (model.Email)) { - users = - Membership.FindUsersByEmail (model.Email); + if (string.IsNullOrEmpty (model.Email)) + errors.Add ("Email", "Please, specify an e-mail"); + else { + users = Membership.FindUsersByEmail (model.Email); if (users.Count < 1) { - errors.Add ( "Email", "Email not found"); - return ; + errors.Add ("Email", "Email not found"); + return; } if (users.Count != 1) { errors.Add ("Email", "Found more than one user!(sic)"); return ; } } - if (users==null) - return; - // Assert users.Count == 1 - foreach (MembershipUser u in users) user = u; + MembershipUser user2 = null; + foreach (var u in users) user2 = u as MembershipUser; + if (user1.UserName != user2.UserName) + errors.Add("UserName", "This user is not registered with this e-mail"); + user = user1; } /// /// Avatars the URL. @@ -267,12 +292,13 @@ namespace Yavsc.Helpers return serializer.Serialize(obj); } - public static void Notify(ViewDataDictionary ViewData, string message, string click_action=null, string clickActionName="Ok") { + public static void Notify(this ViewDataDictionary ViewData, string message, string click_action=null, string clickActionName="Ok") { Notify(ViewData, new Notification { body = YavscAjaxHelper.QuoteJavascriptString(message), click_action = click_action, click_action_name = YavscAjaxHelper.QuoteJavascriptString(clickActionName)} ) ; } - public static void Notify(ViewDataDictionary ViewData, Notification note) { + public static void Notify(this ViewDataDictionary ViewData, Notification note) { + if (ViewData ["Notifications"] == null) ViewData ["Notifications"] = new List (); (ViewData ["Notifications"] as List).Add ( diff --git a/web/Models/App.master b/web/Models/App.master index b73f5e29..dcf793ec 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -49,7 +49,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>'; diff --git a/web/Views/FrontOffice/Contact.aspx b/web/Views/FrontOffice/Contact.aspx new file mode 100644 index 00000000..a36131c0 --- /dev/null +++ b/web/Views/FrontOffice/Contact.aspx @@ -0,0 +1,30 @@ +<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> + + +
+

+<%= Html.Translate("ContactThisPerformer") %> +

+<% using (Html.BeginForm("Contact", "Home")) { %> +
+Message +

+<%= Html.Label("email",LocalizedText.email) %>: +<%= Html.ValidationMessage("email") %>
+<%= Html.TextBox("email") %> +

+

+<%= Html.Label("reason",LocalizedText.reason) %>: +<%= Html.ValidationMessage("reason") %>
+<%= Html.TextBox("reason") %> +

+

+<%= Html.Label("body",LocalizedText.body) %>: +<%= Html.ValidationMessage("body") %>
+<%= Html.TextArea("body",new {@rows="25"}) %> +

+
+"> +<% } %> +
+
\ No newline at end of file diff --git a/web/Views/FrontOffice/Performer.ascx b/web/Views/FrontOffice/Performer.ascx index c0aa20dc..f2f2692b 100644 --- a/web/Views/FrontOffice/Performer.ascx +++ b/web/Views/FrontOffice/Performer.ascx @@ -20,7 +20,7 @@ data-roles="<%=string.Join (" ",Roles.GetRolesForUser (Model.UserName)) %>" <% } else { %> <%=Html.LabelFor(m => m.EMail)%>: - <%= Html.Translate("AuthenticatedOnly") %> + <%= Html.Translate("OnlyAuthorizedMayContact") %> <% }%> diff --git a/web/Views/FrontOffice/Performers.aspx b/web/Views/FrontOffice/Performers.aspx index a000f20e..03037713 100644 --- a/web/Views/FrontOffice/Performers.aspx +++ b/web/Views/FrontOffice/Performers.aspx @@ -1,9 +1,7 @@ <%@ Page Language="C#" Title="Performers" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage>" %> - - @@ -11,33 +9,64 @@
<%= Html.Partial("Performer", available.Profile ) %>
-<% if (available.DateAvailable) { %> + +<% if (available.DateAvailable) { %>

<%= Html.Translate("ThisPerformerGivesAccessToHisCalendarAndSeemsToBeAvailableThis") %> -<%= available.PerformanceDate.ToString("D") %> -<% } else if (available.Profile.HasCalendar()) { %> +<%= available.PerformanceDate.ToString("D") %>.

+<% } else if (available.Profile.HasCalendar()) { %>

<%= Html.Translate("ThisPerformerGivesAccessToHisCalendarAndItAppearsHeShouldNotBeAvailableThis") %> -<%= available.PerformanceDate.ToString("D") %> -<% } else {%> -<%= Html.Translate("ThisPerformerDoesntGiveAccessToHisCalendar") %> +<%= available.PerformanceDate.ToString("D") %>.

+<% } else {%>

+<%= Html.Translate("ThisPerformerDoesntGiveAccessToHisCalendar") %>

<% } %> -
-
+<% if (User.Identity!=null && User.Identity.IsAuthenticated) { %> + + - + -"> +">
+
+ +<% } else { %> +

<%= Html.Translate("YouNeedToBeAuthenticatedIOToContact") %>

+

+" class="link" accesskey = "C"> + Connexion +

+ +<% } %>
<% } %> diff --git a/web/Views/FrontOffice/Product.aspx b/web/Views/FrontOffice/Product.aspx index 0182890f..70d8077d 100644 --- a/web/Views/FrontOffice/Product.aspx +++ b/web/Views/FrontOffice/Product.aspx @@ -25,8 +25,8 @@ Prix unitaire : <%= Html.Encode(Model.UnitaryPrice.Quantity.ToString())%> <%= Html.CommandForm(Model,"Ajouter au panier") %> <% if (Model.CommandValidityDates!=null) { %> -Offre valable du <%= Model.CommandValidityDates.StartDate.ToString("dd/MM/yyyy") %> au -<%= Model.CommandValidityDates.EndDate.ToString("dd/MM/yyyy") %>. +Offre valable du <%= Model.CommandValidityDates.Start.ToString("dd/MM/yyyy") %> au +<%= Model.CommandValidityDates.End.ToString("dd/MM/yyyy") %>. <% } %> diff --git a/web/Views/FrontOffice/Service.aspx b/web/Views/FrontOffice/Service.aspx index 2f5a4c23..33700ce2 100644 --- a/web/Views/FrontOffice/Service.aspx +++ b/web/Views/FrontOffice/Service.aspx @@ -23,8 +23,8 @@ Prix horaire de la prestation : <%= Html.CommandForm(Model,"Ajouter au panier") %> <% if (Model.CommandValidityDates!=null) { %> -Offre valable du <%= Model.CommandValidityDates.StartDate.ToString("dd/MM/yyyy") %> au -<%= Model.CommandValidityDates.EndDate.ToString("dd/MM/yyyy") %>. +Offre valable du <%= Model.CommandValidityDates.Start.ToString("dd/MM/yyyy") %> au +<%= Model.CommandValidityDates.End.ToString("dd/MM/yyyy") %>. <% } %> diff --git a/web/Views/Google/OtherWebException.aspx b/web/Views/Google/OtherWebException.aspx deleted file mode 100644 index 985fa792..00000000 --- a/web/Views/Google/OtherWebException.aspx +++ /dev/null @@ -1,9 +0,0 @@ -<%@ Page Title="Google error message" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> - -

<%= Html.Encode(Model.Title)%>

-
- 
- <%= Html.Encode(Model.Content) %>
- 
-
- diff --git a/web/Views/Home/Contact.aspx b/web/Views/Home/Contact.aspx index a8e6d5c8..3f5960af 100644 --- a/web/Views/Home/Contact.aspx +++ b/web/Views/Home/Contact.aspx @@ -15,23 +15,22 @@ Activité Principalement Exercée (APE) : 5829C Édition de logiciels applicatif
Message

-<%= Html.Label("email") %>: +<%= Html.Label("email",LocalizedText.email) %>: <%= Html.ValidationMessage("email") %>
<%= Html.TextBox("email") %>

-<%= Html.Label("reason") %>: +<%= Html.Label("reason",LocalizedText.reason) %>: <%= Html.ValidationMessage("reason") %>
<%= Html.TextBox("reason") %>

-<%= Html.Label("body") %>: +<%= Html.Label("body",LocalizedText.body) %>: <%= Html.ValidationMessage("body") %>
<%= Html.TextArea("body",new {@rows="25"}) %>

"> - <% } %>
\ No newline at end of file diff --git a/web/Web.config b/web/Web.config index 841bf4a8..0f260bf8 100644 --- a/web/Web.config +++ b/web/Web.config @@ -268,16 +268,16 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - - - + + + + diff --git a/web/Yavsc.csproj b/web/Yavsc.csproj index dd252658..5f8830f0 100644 --- a/web/Yavsc.csproj +++ b/web/Yavsc.csproj @@ -285,7 +285,6 @@ - @@ -479,7 +478,6 @@ - @@ -781,6 +779,11 @@ + + + + + @@ -819,10 +822,10 @@ - + diff --git a/yavscModel/ChangeLog b/yavscModel/ChangeLog index 12f20578..d91af018 100644 --- a/yavscModel/ChangeLog +++ b/yavscModel/ChangeLog @@ -1,3 +1,36 @@ +2015-12-30 Paul Schneider + + * UpdatePassword.cs: modèle de la modification de mot de passe + au + jeton de securité (qui est encore un fake en l'état) + + * CommandRegistration.cs: un enregistrement de commande + + * NominativeCommandRegistration.cs: un enregistrement de + commande nominative + + * Product.cs: utilise la période du calendrier + + * Commande.cs: renvoie un objet à la prise de commande, + indiquant l'identifiant de commande, et les messages envoyés + en cas de commande nominative. + + * GoogleHelpers.cs: icone à la notification mobile + + * LocalizedText.resx: + * LocalizedText.fr.resx: + * LocalizedText.Designer.cs: + * LocalizedText.fr.Designer.cs: traductions + + * UserNameBase.cs: fixe la dé-sérialisation + + * WorkFlowManager.cs: refabrication de la prise de commande + + * YavscModel.csproj: nouveaux objets du modèle + + * Period.cs: fondre la période: celle du catalogue disparait, + au profit de celle du calendrier. + 2015-12-24 Paul Schneider * NominativeEventPub.cs: implémentation du nom de préstataire diff --git a/yavscModel/FrontOffice/Catalog/Period.cs b/yavscModel/FrontOffice/Catalog/Period.cs deleted file mode 100644 index 852e172d..00000000 --- a/yavscModel/FrontOffice/Catalog/Period.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace Yavsc.Model.FrontOffice.Catalog -{ - /// - /// Period. - /// - public class Period - { - /// - /// Initializes a new instance of the class. - /// - public Period () - { - } - /// - /// Gets or sets the start date. - /// - /// The start date. - public DateTime StartDate { get; set; } - /// - /// Gets or sets the end date. - /// - /// The end date. - public DateTime EndDate { get; set; } - - } -} - diff --git a/yavscModel/FrontOffice/Catalog/Product.cs b/yavscModel/FrontOffice/Catalog/Product.cs index 6b444cae..a170cd1c 100644 --- a/yavscModel/FrontOffice/Catalog/Product.cs +++ b/yavscModel/FrontOffice/Catalog/Product.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Yavsc.Model.Calendar; namespace Yavsc.Model.FrontOffice.Catalog { diff --git a/yavscModel/FrontOffice/Commande.cs b/yavscModel/FrontOffice/Commande.cs index 53a1c393..5c6857cc 100644 --- a/yavscModel/FrontOffice/Commande.cs +++ b/yavscModel/FrontOffice/Commande.cs @@ -7,6 +7,7 @@ using System.Web; using System.Collections.Generic; using System.IO; using System.Reflection; +using Yavsc.Model.WorkFlow; namespace Yavsc.Model.FrontOffice { @@ -62,6 +63,11 @@ namespace Yavsc.Model.FrontOffice public Command() { } + + /// + /// Sets the parameters. + /// + /// Collection. public void SetParameters(Dictionary collection) { Parameters.Clear (); @@ -88,7 +94,7 @@ namespace Yavsc.Model.FrontOffice ///
/// Collection. /// Files. - private void FromPost(Dictionary collection, NameObjectCollectionBase files) + private CommandRegistration FromPost(Dictionary collection, NameObjectCollectionBase files) { // string catref=collection["catref"]; // Catalog Url from which formdata has been built ProductRef = collection ["productref"]; @@ -104,13 +110,16 @@ namespace Yavsc.Model.FrontOffice Status = CommandStatus.Inserted; // stores the parameters: SetParameters(collection); - WorkFlowManager.RegisterCommand (this); // gives a value to this.Id + var registration = WorkFlowManager.RegisterCommand (this); // gives a value to this.Id UserFileSystemManager.Put(Path.Combine("commandes",Id.ToString ()),files); + return registration; } /// /// Creates a command using the specified collection - /// as command parameters, handles the files upload. + /// as command parameters, handles the files upload, + /// ans register the command in db, positionning the + /// command id. /// /// Required values in the command parameters : /// @@ -118,21 +127,27 @@ namespace Yavsc.Model.FrontOffice /// * type: the command concrete class name. /// /// + /// The command. /// Collection. /// Files. - public static Command CreateCommand (Dictionary collection, NameObjectCollectionBase files) + /// Cmdreg. + public static Command CreateCommand ( + Dictionary collection, + NameObjectCollectionBase files, + out CommandRegistration cmdreg) { string type = collection ["type"]; if (type == null) throw new InvalidOperationException ( "A command type cannot be blank"); var cmd = CreateCommand (type); - cmd.FromPost (collection, files); + cmdreg = cmd.FromPost (collection, files); return cmd; } /// - /// Creates the command. + /// Creates the command, for deserialisation, + /// do not register it in database. /// /// The command. /// Class name. @@ -152,6 +167,11 @@ namespace Yavsc.Model.FrontOffice var cmd = ci.Invoke (new object[]{ }); return cmd as Command; } + + /// + /// Gets the command textual description. + /// + /// The description. public abstract string GetDescription (); } } diff --git a/yavscModel/Google/Api/GoogleHelpers.cs b/yavscModel/Google/Api/GoogleHelpers.cs index 07d778f5..3229e084 100644 --- a/yavscModel/Google/Api/GoogleHelpers.cs +++ b/yavscModel/Google/Api/GoogleHelpers.cs @@ -153,7 +153,7 @@ namespace Yavsc.Model.Google.Api if (regid == null) throw new NotImplementedException ("Notification via e-mail"); var msg = new MessageWithPayload () { - notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "event" }, + notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "icon" }, data = evpub, registration_ids = new string[] { regid } }; return r.Invoke (msg); } diff --git a/yavscModel/LocalizedText.Designer.cs b/yavscModel/LocalizedText.Designer.cs index 7db8ba20..26cad0f9 100644 --- a/yavscModel/LocalizedText.Designer.cs +++ b/yavscModel/LocalizedText.Designer.cs @@ -46,6 +46,12 @@ namespace Yavsc.Model { } } + public static string Private_circle { + get { + return ResourceManager.GetString("Private_circle", resourceCulture); + } + } + public static string Comment { get { return ResourceManager.GetString("Comment", resourceCulture); @@ -106,9 +112,9 @@ namespace Yavsc.Model { } } - public static string Welcome { + public static string User_name { get { - return ResourceManager.GetString("Welcome", resourceCulture); + return ResourceManager.GetString("User_name", resourceCulture); } } @@ -124,6 +130,12 @@ namespace Yavsc.Model { } } + public static string YourNeed { + get { + return ResourceManager.GetString("YourNeed", resourceCulture); + } + } + public static string ExistantDB { get { return ResourceManager.GetString("ExistantDB", resourceCulture); @@ -202,12 +214,30 @@ namespace Yavsc.Model { } } + public static string email { + get { + return ResourceManager.GetString("email", resourceCulture); + } + } + public static string EndDate { get { return ResourceManager.GetString("EndDate", resourceCulture); } } + public static string body { + get { + return ResourceManager.GetString("body", resourceCulture); + } + } + + public static string ResetPassword { + get { + return ResourceManager.GetString("ResetPassword", resourceCulture); + } + } + public static string DoSpecifyCircles { get { return ResourceManager.GetString("DoSpecifyCircles", resourceCulture); @@ -292,6 +322,12 @@ namespace Yavsc.Model { } } + public static string YouNeedToBeAuthenticatedIOToContact { + get { + return ResourceManager.GetString("YouNeedToBeAuthenticatedIOToContact", resourceCulture); + } + } + public static string Unitary_cost { get { return ResourceManager.GetString("Unitary_cost", resourceCulture); @@ -412,9 +448,15 @@ namespace Yavsc.Model { } } - public static string YourNeed { + public static string Description { get { - return ResourceManager.GetString("YourNeed", resourceCulture); + return ResourceManager.GetString("Description", resourceCulture); + } + } + + public static string was_added_to_the_role { + get { + return ResourceManager.GetString("was_added_to_the_role", resourceCulture); } } @@ -436,9 +478,15 @@ namespace Yavsc.Model { } } - public static string Private_circle { + public static string ContactThisPerformer { get { - return ResourceManager.GetString("Private_circle", resourceCulture); + return ResourceManager.GetString("ContactThisPerformer", resourceCulture); + } + } + + public static string OnlyAuthorizedMayContact { + get { + return ResourceManager.GetString("OnlyAuthorizedMayContact", resourceCulture); } } @@ -520,12 +568,6 @@ namespace Yavsc.Model { } } - public static string User_name { - get { - return ResourceManager.GetString("User_name", resourceCulture); - } - } - public static string Item_added_to_basket { get { return ResourceManager.GetString("Item_added_to_basket", resourceCulture); @@ -538,6 +580,12 @@ namespace Yavsc.Model { } } + public static string Welcome { + get { + return ResourceManager.GetString("Welcome", resourceCulture); + } + } + public static string YourEstimates { get { return ResourceManager.GetString("YourEstimates", resourceCulture); @@ -580,9 +628,9 @@ namespace Yavsc.Model { } } - public static string YourMEACode { + public static string PhotoUpdated { get { - return ResourceManager.GetString("YourMEACode", resourceCulture); + return ResourceManager.GetString("PhotoUpdated", resourceCulture); } } @@ -706,18 +754,6 @@ namespace Yavsc.Model { } } - public static string PhotoUpdated { - get { - return ResourceManager.GetString("PhotoUpdated", resourceCulture); - } - } - - public static string Description { - get { - return ResourceManager.GetString("Description", resourceCulture); - } - } - public static string from { get { return ResourceManager.GetString("from", resourceCulture); @@ -814,9 +850,9 @@ namespace Yavsc.Model { } } - public static string was_added_to_the_role { + public static string reason { get { - return ResourceManager.GetString("was_added_to_the_role", resourceCulture); + return ResourceManager.GetString("reason", resourceCulture); } } @@ -826,6 +862,12 @@ namespace Yavsc.Model { } } + public static string YourMEACode { + get { + return ResourceManager.GetString("YourMEACode", resourceCulture); + } + } + public static string ReadMore { get { return ResourceManager.GetString("ReadMore", resourceCulture); @@ -898,6 +940,12 @@ namespace Yavsc.Model { } } + public static string NewPasswordMessageSent { + get { + return ResourceManager.GetString("NewPasswordMessageSent", resourceCulture); + } + } + public static string SiteSkills { get { return ResourceManager.GetString("SiteSkills", resourceCulture); diff --git a/yavscModel/LocalizedText.fr.Designer.cs b/yavscModel/LocalizedText.fr.Designer.cs index b4d451b8..3d69fc13 100644 --- a/yavscModel/LocalizedText.fr.Designer.cs +++ b/yavscModel/LocalizedText.fr.Designer.cs @@ -118,6 +118,12 @@ namespace Yavsc.Model { } } + public static string YourNeed { + get { + return ResourceManager.GetString("YourNeed", resourceCulture); + } + } + public static string ExistantDB { get { return ResourceManager.GetString("ExistantDB", resourceCulture); @@ -196,12 +202,30 @@ namespace Yavsc.Model { } } + public static string email { + get { + return ResourceManager.GetString("email", resourceCulture); + } + } + public static string EndDate { get { return ResourceManager.GetString("EndDate", resourceCulture); } } + public static string body { + get { + return ResourceManager.GetString("body", resourceCulture); + } + } + + public static string ResetPassword { + get { + return ResourceManager.GetString("ResetPassword", resourceCulture); + } + } + public static string DoSpecifyCircles { get { return ResourceManager.GetString("DoSpecifyCircles", resourceCulture); @@ -292,6 +316,12 @@ namespace Yavsc.Model { } } + public static string YouNeedToBeAuthenticatedIOToContact { + get { + return ResourceManager.GetString("YouNeedToBeAuthenticatedIOToContact", resourceCulture); + } + } + public static string Unitary_cost { get { return ResourceManager.GetString("Unitary_cost", resourceCulture); @@ -406,9 +436,15 @@ namespace Yavsc.Model { } } - public static string YourNeed { + public static string Description { get { - return ResourceManager.GetString("YourNeed", resourceCulture); + return ResourceManager.GetString("Description", resourceCulture); + } + } + + public static string was_added_to_the_role { + get { + return ResourceManager.GetString("was_added_to_the_role", resourceCulture); } } @@ -436,6 +472,18 @@ namespace Yavsc.Model { } } + public static string ContactThisPerformer { + get { + return ResourceManager.GetString("ContactThisPerformer", resourceCulture); + } + } + + public static string OnlyAuthorizedMayContact { + get { + return ResourceManager.GetString("OnlyAuthorizedMayContact", resourceCulture); + } + } + public static string AnIMessageHasbeenSent { get { return ResourceManager.GetString("AnIMessageHasbeenSent", resourceCulture); @@ -574,9 +622,9 @@ namespace Yavsc.Model { } } - public static string YourMEACode { + public static string PhotoUpdated { get { - return ResourceManager.GetString("YourMEACode", resourceCulture); + return ResourceManager.GetString("PhotoUpdated", resourceCulture); } } @@ -694,18 +742,6 @@ namespace Yavsc.Model { } } - public static string PhotoUpdated { - get { - return ResourceManager.GetString("PhotoUpdated", resourceCulture); - } - } - - public static string Description { - get { - return ResourceManager.GetString("Description", resourceCulture); - } - } - public static string from { get { return ResourceManager.GetString("from", resourceCulture); @@ -808,9 +844,15 @@ namespace Yavsc.Model { } } - public static string was_added_to_the_role { + public static string reason { get { - return ResourceManager.GetString("was_added_to_the_role", resourceCulture); + return ResourceManager.GetString("reason", resourceCulture); + } + } + + public static string YourMEACode { + get { + return ResourceManager.GetString("YourMEACode", resourceCulture); } } @@ -886,6 +928,12 @@ namespace Yavsc.Model { } } + public static string NewPasswordMessageSent { + get { + return ResourceManager.GetString("NewPasswordMessageSent", resourceCulture); + } + } + public static string SiteSkills { get { return ResourceManager.GetString("SiteSkills", resourceCulture); diff --git a/yavscModel/LocalizedText.fr.resx b/yavscModel/LocalizedText.fr.resx index 4871c124..00737901 100644 --- a/yavscModel/LocalizedText.fr.resx +++ b/yavscModel/LocalizedText.fr.resx @@ -24,12 +24,13 @@ disponible Seuls les utilisateurs authentifiés peuvent accèder à cette information. Panier - Édition d'un billet - Suppression d'un billet - Contrôle d'accès au Billet - Billet créé - Code source du billet - Billet mis à jour + Édition d'un article + Suppression d'un article + Contrôle d'accès à l'article + Article créé + Code source de l'article + Article mis à jour + corps de texte Reserver les services d'un artiste Reserver les services d'un éditeur de logiciel Catalogue @@ -38,8 +39,9 @@ S'il vous plait, choisissez une date dans le futur Chiffre Cercles - Consultant Commentaire + Consultant + Contactez ce préstataire Nombre Créer Demande de rendez-vous @@ -58,6 +60,7 @@ Editer les compétences associées Date de fin Heure de fin + e-mail entrées Devis non trouvé Page web de l'événement @@ -67,7 +70,7 @@ Agenda Google Erreur Google : {0} Identifiant d'enregistrement Google - Cacher le texte source du billet + Cacher le texte source de l'article Accueil Cacher caché @@ -92,14 +95,17 @@ Besoins Besoin Nouveau Tag + Un e-mail vient de vous être envoyé, il contient le lien à suivre + pour pouvoir mettre à jour votre mot de passe. pas de contenu - Aucune compétence n'a été enregistrée par aucun préstataire pour cette activité + Aucune compétence n'a été enregistrée par aucun préstataire pour cette activité. aucun(e) Non existent user Non approuvé Le préstataire n'a pas de calendrier associé. Hors ligne En ligne + Seuls les utilisateurs authorisés peuvent contacter un préstataire par courrier. Version Pdf Date de la prestation Perstataires @@ -112,6 +118,7 @@ Édition du profile Référence produit Lire la suite ... + réson Rôle prestation Identifiant du fournisseur @@ -119,12 +126,13 @@ Enregistez-vous Se souvenir du mot de passe Supprimer + Ré-initialiser votre mot de passe Rôle créé Chercher Talents/Compétences/Spécialités gérés sur ce site Compétence Talents/Compétences/Spécialités - {0} would want you to establish an estimate concerning {1} + {0} désirerait un devis concernant {1} Date de début La date de fin doit être postérieure à la date de début. Heure de début @@ -143,19 +151,21 @@ Liste des utilisateurs assumant le rôle "{0}" Talents/compétences/spécialités utilisateur Le rôle demandé n'est pas assumé par ce préstataire - Voir le texte source du billet + Voir le texte source de l'article a été ajouté au rôle Il n'y avait pas d'utilisateur dans le rôle "{1}". Vous ({0}) avez été ajouté au rôle "{1}". Bienvenue {0} à été notifié de votre demande, vous devriez être contacté rapidement Au vu de son calendrier, {0} devrait être disponible pour ce rendez-vous + Vous devez vous authentifier pour pouvoir demander un devis + à un préstataire. Vous n'êtes pas administrateur Vos Devis Votre activité Votre besoin Votre demande a été transmise Vos talents, vos spécialités, le domaine de vos activités - Vos posts + Vos publications Votre profile diff --git a/yavscModel/LocalizedText.resx b/yavscModel/LocalizedText.resx index b88df60f..53f7c26e 100644 --- a/yavscModel/LocalizedText.resx +++ b/yavscModel/LocalizedText.resx @@ -31,10 +31,12 @@ Bill created Bill source code Bill updated + body Book an artiste Book a software editor Catalog Create + Contact this performer Count Please, choose a description Please, choose a title @@ -61,6 +63,7 @@ Edit related skills End hour End date + e-mail entries Estimate not found Event Web page @@ -96,6 +99,8 @@ Needs Need New Tag + A message had been sent, containing a link to follow in order + to update your password. no content No skill was informed by any performer for this activity none @@ -103,6 +108,7 @@ Not Approuved No calendar was associated to this user. Online + Only authorized users may contact a performer by mail. Offline Pdf version Performance Date @@ -119,9 +125,11 @@ Provider name Product_reference Read more ... + reason Register Remember me Remove + Reset your password Role role created Search @@ -155,6 +163,7 @@ {0} has been notified of your query, you should be fast contacted regarding his calendar, {0} should be available for this booking + You need to be authenticated in order to contact a performer You're not administrator Your estimates Your activity diff --git a/yavscModel/RolesAndMembers/UpdatePassword.cs b/yavscModel/RolesAndMembers/UpdatePassword.cs new file mode 100644 index 00000000..75f0ab7f --- /dev/null +++ b/yavscModel/RolesAndMembers/UpdatePassword.cs @@ -0,0 +1,41 @@ +// +// UpdatePassword.cs +// +// Author: +// Paul Schneider +// +// 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 . +using System; +using System.ComponentModel; + +namespace Yavsc.Model.RolesAndMembers +{ + public class UpdatePassword: UserNameBase + { + public string UserKey {get; set; } + + [DisplayName("Mot de passe")] + public string Password {get; set; } + + /// + /// Gets or sets the confirm password. + /// + /// The confirm password. + [DisplayName("Confirmation du mot de passe")] + public string ConfirmPassword { get; set; } + } +} + diff --git a/yavscModel/RolesAndMembers/UserNameBase.cs b/yavscModel/RolesAndMembers/UserNameBase.cs index 01fb2ef4..ccb8969b 100644 --- a/yavscModel/RolesAndMembers/UserNameBase.cs +++ b/yavscModel/RolesAndMembers/UserNameBase.cs @@ -47,7 +47,7 @@ namespace Yavsc.Model.RolesAndMembers return UserName; } set { - throw new NotImplementedException (); + UserName = value; } } #endregion diff --git a/yavscModel/WorkFlow/CommandRegistration.cs b/yavscModel/WorkFlow/CommandRegistration.cs new file mode 100644 index 00000000..6445482c --- /dev/null +++ b/yavscModel/WorkFlow/CommandRegistration.cs @@ -0,0 +1,46 @@ +// +// CommandRegistration.cs +// +// Author: +// Paul Schneider +// +// 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 . + +using System; +using Yavsc.Model.WorkFlow; +using System.Configuration; +using System.Collections.Specialized; +using Yavsc.Model.FrontOffice; +using System.Configuration.Provider; +using Yavsc.Model.FrontOffice.Catalog; +using System.Collections.Generic; +using Yavsc.Model.Skill; +using System.Linq; +using Yavsc.Model.Calendar; +using Yavsc.Model.Google.Api; +using System.Net.Mail; +using System.Web.Security; +using System.Web.Configuration; +using System.Net; +using System.IO; + +namespace Yavsc.Model.WorkFlow +{ + public class CommandRegistration { + public long CommandId {get; set; } + } + +} diff --git a/yavscModel/WorkFlow/NominativeCommandRegistration.cs b/yavscModel/WorkFlow/NominativeCommandRegistration.cs new file mode 100644 index 00000000..6aed4e37 --- /dev/null +++ b/yavscModel/WorkFlow/NominativeCommandRegistration.cs @@ -0,0 +1,48 @@ +// +// NominativeCommandRegistration.cs +// +// Author: +// Paul Schneider +// +// 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 . + +using System; +using Yavsc.Model.WorkFlow; +using System.Configuration; +using System.Collections.Specialized; +using Yavsc.Model.FrontOffice; +using System.Configuration.Provider; +using Yavsc.Model.FrontOffice.Catalog; +using System.Collections.Generic; +using Yavsc.Model.Skill; +using System.Linq; +using Yavsc.Model.Calendar; +using Yavsc.Model.Google.Api; +using System.Net.Mail; +using System.Web.Security; +using System.Web.Configuration; +using System.Net; +using System.IO; + +namespace Yavsc.Model.WorkFlow +{ + + public class NominativeCommandRegistration : CommandRegistration { + public bool NotifiedOnMobile { get; set; } + public bool EmailSent { get; set; } + } + +} diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs index 0b58724a..c417dbc4 100644 --- a/yavscModel/WorkFlow/WorkFlowManager.cs +++ b/yavscModel/WorkFlow/WorkFlowManager.cs @@ -18,7 +18,8 @@ using System.IO; namespace Yavsc.Model.WorkFlow { - + + /// /// Work flow manager. /// It takes orders store them and raise some events for modules @@ -75,16 +76,20 @@ namespace Yavsc.Model.WorkFlow /// The catalog. public static Catalog Catalog { get; set; } + + /// /// Registers the command. /// /// The command. /// COM. - public static long RegisterCommand (Command com) + public static CommandRegistration RegisterCommand (Command com) { long cmdid = DefaultProvider.RegisterCommand (com); string errorMsgGCM=null; if (com.GetType ().GetInterface ("INominative") != null) { + var result = new NominativeCommandRegistration (); + result.CommandId = cmdid; INominative cmdn = com as INominative; NominativeEventPub ev = new NominativeEventPub (); ev.PerformerName = cmdn.PerformerName; @@ -92,9 +97,13 @@ namespace Yavsc.Model.WorkFlow ev.Description = desc; // TODO send a location try { + var gnresponse = GoogleHelpers.NotifyEvent (ev); - } - catch (WebException ex) { + if (gnresponse.failure > 0 || gnresponse.success <=0) + result.NotifiedOnMobile = false; + else result.NotifiedOnMobile = true; + + } catch (WebException ex) { using (var respstream = ex.Response.GetResponseStream ()) { using (StreamReader rdr = new StreamReader (respstream)) { @@ -103,30 +112,32 @@ namespace Yavsc.Model.WorkFlow } respstream.Close (); } - if (errorMsgGCM==null) - errorMsgGCM = "No response"; + if (errorMsgGCM == null) + throw; - throw new Exception (errorMsgGCM); + throw new Exception (errorMsgGCM,ex); } string errorEMail = null; try { - var pref = Membership.GetUser (cmdn.PerformerName); - using (System.Net.Mail.MailMessage msg = - new MailMessage ( - WebConfigurationManager.AppSettings.Get ("OwnerEMail"), - pref.Email, - "[Demande de devis] " + com.ClientName, - desc)) { - using (System.Net.Mail.SmtpClient sc = new SmtpClient ()) { - sc.Send (msg); + var pref = Membership.GetUser (cmdn.PerformerName); + using (System.Net.Mail.MailMessage msg = + new MailMessage ( + WebConfigurationManager.AppSettings.Get ("OwnerEMail"), + pref.Email, + "[Demande de devis] " + com.ClientName, + desc)) { + using (System.Net.Mail.SmtpClient sc = new SmtpClient ()) { + sc.Send (msg); + result.EmailSent = true; + } } - } - } - catch (Exception ex) { + } catch (Exception ex) { errorEMail = ex.Message; + result.EmailSent = false; } - } - return cmdid; + return result; + } else + throw new NotImplementedException (); } /// diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj index c6c6bedc..a37d4762 100644 --- a/yavscModel/YavscModel.csproj +++ b/yavscModel/YavscModel.csproj @@ -129,7 +129,6 @@ - @@ -253,6 +252,9 @@ + + +