Implémente un formulaire simple

de réservation d'un préstataire

* p8-av4.xxs.jpg:
* p8-av4.xxs.png: inutile

* NoLogin.master:
* Entity.cs:
* OAuth2.cs:
* ApiClient.cs:
* PeopleApi.cs:
* MapTracks.cs:
* SkillManager.cs:
* Skills.aspx:
* EntityQuery.cs:
* CalendarApi.cs:
* SimpleJsonPostMethod.cs:
* GoogleHelpers.cs:
* EventPub.aspx:
* GoogleController.cs:
* Notification.cs:
* UserSkills.aspx:
* BackOfficeController.cs:
* BackOfficeController.cs:
* Notification.cs:
* MessageWithPayLoad.cs:
* MessageWithPayloadResponse.cs: refabrication

* IContentProvider.cs:
* NpgsqlBlogProvider.cs: xml doc

* NpgsqlContentProvider.cs: implemente un listing des prestataire du
  code APE en base.

* NpgsqlSkillProvider.cs: implemente un listing des domaines de
  compétence du préstataire en base.

* XmlCatalogProvider.cs: Le catalogue de vente implémente mainenant
  l'interface d'un fournisseur de donnée comme les autres.
Il pourrait par exemple vouloir définir des activité et des
  compétences.
Pour l'instant, il n'est pas activé par la configuration, et reste le
  fournisseur du catalogue legacy (voir </FrontOffice/Catalog> ).

* FrontOfficeController.cs: format du code

* Global.asax.cs: Une route customisée pour le Front Office : /do
  (genre, ici, ça bouge.)

* activity.sql: implémente en base de donnée le modèle des activités
  et compétences,
ajoute aussi deux activités : l'edition logicielle et "Artiste"

* style.css: changement de mes images de fond ... tombées du camion de
  Xavier et onlinehome.us

* p8-av4.s.jpg: changement de taille

* AccountController.cs: Met le code MEA à "none" quand il est spécifié
  non disponible.

* BlogsController.cs: fixe un bug de l'edition d'un billet

* FrontOfficeController.cs: implemente le contrôle booking simple

* HomeController.cs: ajoute l'assemblage du catalog dans le listing
  dédié

* YavscAjaxHelper.cs: Implemente un outil de representation JSon des
  objets côté serveur

* parallax.js: deux fois plus de mouvement autout de x dans le
  parallax

* yavsc.rate.js: imlemente un callback JS pour le rating

* Activities.aspx: Des labels au formulaire de déclaration des
  activités

* Activity.ascx: un panneau activité descent

* Booking.aspx: implemente l'UI web du booking simple.

* EavyBooking.aspx: refabrication du booking lourd

* Index.aspx: supprime le panneau du tag Accueil, affiche les
  activités en cours du site (avec au moins un préstataire valide pour
  cette activité)

* Web.config: Implemente une cote utilisateur, par une nouvelle valeur
  de son profile (Rate).

* Yavsc.csproj: refabrique du code API Google, qui part dans le model.

* MarkdownDeep.dll: le tag <p> ne convenait pas, le remplacer par le
  tag <span> non plus.
Maintenant ça devrait être correct, c'est un div, mais que en cas de
  tag englobant non défini.

* BookingQuery.cs: Le booking lourd devient une commande basée sur des
  activités concernée par l'intervention

* ChangeLog: nettoyage

* CatalogProvider.cs: implemente l'interface d'un fournissseur de
  contenu

* PerformerProfile.cs: implemente le profile prestataire

* SimpleBookingQuery.cs: Les besoin sont exprimé sous forme d'un
  tableau de valeur du parametrage de la commande

* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: internationalisation

* Profile.cs: implemente un accès à l'id d'enregistrement Google GCM

* SkillEntity.cs: La compétence appartient à un domaine d'activité, on
  lui associe un et un seul code APE

* SkillProvider.cs: Fait chercher les compétences à partir d'un code
  activité

* WorkFlowManager.cs: implemente l'accès à la liste des préstataires
de telle activité

* YavscModel.csproj: refabrications

* Skills.sql: vient de passer dans activity.Sql

* T.cs: la traduction est faite plus simple à appeler (sans cast vers
  `string`).
This commit is contained in:
Paul Schneider 2015-11-28 18:34:52 +01:00
commit a99232ba2b
68 changed files with 1402 additions and 1534 deletions

View file

@ -25,8 +25,9 @@ using Yavsc.Helpers;
using Yavsc.Model.Circles;
using System.Collections.Generic;
using System.Web.Profile;
using Yavsc.Helpers.Google;
using System.Web.Security;
using Yavsc.Model.Google.Api;
using Yavsc.Model.Google.Api.Messaging;
namespace Yavsc.ApiControllers
{

View file

@ -205,8 +205,6 @@ namespace Yavsc.ApiControllers
public void RateSkill (SkillRating rate) {
throw new NotImplementedException ();
}
}
}

View file

@ -40,6 +40,13 @@ namespace Yavsc
routes.IgnoreRoute ("favicon.ico"); // favorite icon
routes.IgnoreRoute ("favicon.png"); // favorite icon
routes.IgnoreRoute ("robots.txt"); // for search engine robots
routes.MapRoute (
"FrontOffice",
"do/{action}/{MEACode}/{Id}",
new { controller = "FrontOffice", action = "Index", MEACode = UrlParameter.Optional, Id = UrlParameter.Optional }
);
routes.MapRoute (
"Titles",
"title/{title}",

View file

@ -1,68 +0,0 @@

-- Table: skill
-- DROP TABLE skill;
CREATE TABLE skill
(
_id bigserial NOT NULL,
name character varying(2024) NOT NULL,
rate integer NOT NULL DEFAULT 50,
CONSTRAINT skill_pkey PRIMARY KEY (_id),
CONSTRAINT skill_name_key UNIQUE (name)
)
WITH (
OIDS=FALSE
);
-- Table: userskills
-- DROP TABLE userskills;
CREATE TABLE userskills
(
applicationname character varying(512) NOT NULL,
username character varying(512) NOT NULL,
comment character varying,
skillid bigint NOT NULL, -- Skill identifier
rate integer NOT NULL,
_id bigserial NOT NULL, -- The id ...
CONSTRAINT userskills_pkey PRIMARY KEY (applicationname, username, skillid),
CONSTRAINT userskills_applicationname_fkey FOREIGN KEY (applicationname, username)
REFERENCES users (applicationname, username) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT userskills_skillid_fkey FOREIGN KEY (skillid)
REFERENCES skill (_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT userskills__id_key UNIQUE (_id)
)
WITH (
OIDS=FALSE
);
COMMENT ON COLUMN userskills.skillid IS 'Skill identifier';
COMMENT ON COLUMN userskills._id IS 'The id ...';
-- Table: satisfaction
-- DROP TABLE satisfaction;
CREATE TABLE satisfaction
(
_id bigserial NOT NULL,
userskillid bigint, -- the user's skill reference
rate integer, -- The satisfaction rating associated by a client to an user's skill
comnt character varying(8192), -- The satisfaction textual comment associated by a client to an user's skill, it could be formatted ala Markdown
CONSTRAINT satisfaction_pkey PRIMARY KEY (_id),
CONSTRAINT satisfaction_userskillid_fkey FOREIGN KEY (userskillid)
REFERENCES userskills (_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
COMMENT ON COLUMN satisfaction.userskillid IS 'the user''s skill reference';
COMMENT ON COLUMN satisfaction.rate IS 'The satisfaction rating associated by a client to an user''s skill';
COMMENT ON COLUMN satisfaction.comnt IS 'The satisfaction textual comment associated by a client to an user''s skill, it could be formatted ala Markdown';

View file

@ -1,6 +1,9 @@
-- Table: activity
DROP TABLE satisfaction;
DROP TABLE userskills;
DROP TABLE skill;
DROP TABLE activity;
-- DROP TABLE activity;
CREATE TABLE activity
(
@ -8,7 +11,8 @@ CREATE TABLE activity
applicationname character varying(255) NOT NULL,
cmnt character varying, -- a long description for this activity
meacode character varying(512) NOT NULL, -- Identifiant de l'activité, à terme, il faudrait ajouter un champ à cette id: le code pays....
photo character varying(512) -- a photo url, as a front image for this activity
photo character varying(512) NOT NULL DEFAULT 'none'::character varying, -- a photo url, as a front image for this activity
CONSTRAINT activity_pkey PRIMARY KEY (meacode, applicationname)
)
WITH (
OIDS=FALSE
@ -27,3 +31,113 @@ Exemple: ''71.12B'' => "Ingénierie, études techniques"
';
COMMENT ON COLUMN activity.photo IS 'a photo url, as a front image for this activity';
INSERT INTO activity(
title, applicationname, cmnt, meacode, photo)
VALUES (
'Édition de logiciels applicatifs',
'/',
'Vente d''applications logicielles',
'6829C',
'http://www.janua.fr/wp-content/uploads/2014/02/born2code-xavier-niel-developpeurs-formation.jpg'
);
INSERT INTO activity(
title, applicationname, cmnt, meacode, photo)
VALUES (
'Artiste',
'/',
'Anime votre mariage, un anniversaire ou autre événnement.',
'Artiste',
'http://www.dancefair.tv/wp-content/uploads/2015/05/How-to-secure-DJ-gig.jpg'
);
-- Table: skill
-- DROP TABLE skill;
CREATE TABLE skill
(
_id bigserial NOT NULL,
name character varying(2024) NOT NULL,
rate integer NOT NULL DEFAULT 50,
meacode character varying(256) NOT NULL,
applicationname character varying(255),
CONSTRAINT skill_pkey PRIMARY KEY (_id),
CONSTRAINT skill_app FOREIGN KEY (applicationname, meacode)
REFERENCES activity (applicationname, meacode) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT skill_name_meacode_applicationname_key UNIQUE (name, meacode, applicationname)
)
WITH (
OIDS=FALSE
);
-- Index: fki_skill_app
-- DROP INDEX fki_skill_app;
CREATE INDEX fki_skill_app
ON skill
USING btree
(applicationname COLLATE pg_catalog."default", meacode COLLATE pg_catalog."default");
-- Table: userskills
-- DROP TABLE userskills;
CREATE TABLE userskills
(
applicationname character varying(512) NOT NULL,
username character varying(512) NOT NULL,
comment character varying,
skillid bigint NOT NULL, -- Skill identifier
rate integer NOT NULL,
_id bigserial NOT NULL, -- The id ...
CONSTRAINT userskills_pkey PRIMARY KEY (applicationname, username, skillid),
CONSTRAINT userskills_applicationname_fkey FOREIGN KEY (applicationname, username)
REFERENCES users (applicationname, username) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT userskills_skillid_fkey FOREIGN KEY (skillid)
REFERENCES skill (_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT userskills__id_key UNIQUE (_id)
)
WITH (
OIDS=FALSE
);
COMMENT ON COLUMN userskills.skillid IS 'Skill identifier';
COMMENT ON COLUMN userskills._id IS 'The id ...';
-- Table: satisfaction
-- DROP TABLE satisfaction;
CREATE TABLE satisfaction
(
_id bigserial NOT NULL,
userskillid bigint, -- the user's skill reference
rate integer, -- The satisfaction rating associated by a client to an user's skill
comnt character varying(8192), -- The satisfaction textual comment associated by a client to an user's skill, it could be formatted ala Markdown
CONSTRAINT satisfaction_pkey PRIMARY KEY (_id),
CONSTRAINT satisfaction_userskillid_fkey FOREIGN KEY (userskillid)
REFERENCES userskills (_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
WITH (
OIDS=FALSE
);
COMMENT ON COLUMN satisfaction.userskillid IS 'the user''s skill reference';
COMMENT ON COLUMN satisfaction.rate IS 'The satisfaction rating associated by a client to an user''s skill';
COMMENT ON COLUMN satisfaction.comnt IS 'The satisfaction textual comment associated by a client to an user''s skill, it could be formatted ala Markdown';
ALTER TABLE satisfaction OWNER TO lua;
ALTER TABLE userskills OWNER TO lua;
ALTER TABLE skill OWNER TO lua;
ALTER TABLE activity OWNER TO lua;

View file

@ -26,7 +26,7 @@ input, textarea, checkbox {
}
header {
background: url("/App_Themes/images/star-939235_1280.jpg") -3em -3em no-repeat fixed;
background: url("http://s448140597.onlinehome.us/wp-content/uploads/2014/12/project-management1.jpg") -20em -20em repeat fixed;
}
header h1, header a {
@ -38,7 +38,7 @@ nav {
}
main {
background: url("/App_Themes/images/p8-av4.png") 50% 20em no-repeat fixed ;
background: url("/App_Themes/images/p8-av4.l.jpg") 50% 50% no-repeat fixed ;
}
footer {
@ -138,7 +138,6 @@ input:hover, textarea:hover {
header {
padding-top:1em;
padding-bottom:1em;
background: url("/App_Themes/images/star-939235_1280.s.jpg") 0 0 no-repeat fixed;
}
#avatar {
@ -155,7 +154,7 @@ header h1, header a , .actionlink, .menuitem, a { padding:.5em;}
main {
margin: 1em;
padding: 1em;
background: url("/App_Themes/images/p8-av4.s.jpg") 50% 20em no-repeat fixed ;
background: url("/App_Themes/images/p8-av4.jpg") 50% 50% no-repeat fixed ;
}
footer {
background: url("/App_Themes/images/helix-nebula-1400x1400.s.jpg") 50% 90% repeat fixed ;
@ -194,7 +193,6 @@ header h1, header a , .actionlink, .menuitem, a { padding:.5em;}
header {
padding-top:.5em;
padding-bottom:.5em;
background: url("/App_Themes/images/star-939235_1280.xxs.jpg") 0 0 no-repeat fixed;
}
header h1, header a { padding:.2em;}
@ -207,7 +205,7 @@ header h1, header a { padding:.2em;}
main {
margin: .5em;
padding: .5em;
background: url("/App_Themes/images/p8-av4.xxs.jpg") 50% 20em repeat fixed ;
background: url("/App_Themes/images/p8-av4.s.jpg") 50% 50% no-repeat fixed ;
}
footer {
background: url("/App_Themes/images/helix-nebula-1400x1400.xxs.jpg") 50% 10% repeat fixed ;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

View file

@ -1,3 +1,91 @@
2015-11-28 Paul Schneider <paul@pschneider.fr>
* p8-av4.xxs.jpg:
* p8-av4.xxs.png: inutile
* NoLogin.master:
* Entity.cs:
* OAuth2.cs:
* ApiClient.cs:
* PeopleApi.cs:
* MapTracks.cs:
* Skills.aspx:
* CalendarApi.cs:
* EntityQuery.cs:
* GoogleHelpers.cs:
* EventPub.aspx:
* GoogleController.cs:
* SimpleJsonPostMethod.cs:
* UserSkills.aspx:
* BackOfficeController.cs:
* BackOfficeController.cs: refabrication
* FrontOfficeController.cs: format du code
* Global.asax.cs: Une route customisée pour le Front Office :
/do (genre, ici, ça bouge.)
* activity.sql: implémente en base de donnée le modèle des
activités et compétences,
ajoute aussi deux activités : l'edition logicielle et
"Artiste"
* style.css: changement de mes images de fond ... tombées du
camion de Xavier et onlinehome.us
* p8-av4.s.jpg: changement de taille
* AccountController.cs: Met le code MEA à "none" quand il est
spécifié non disponible.
* BlogsController.cs: fixe un bug de l'edition d'un billet
* FrontOfficeController.cs: implemente le contrôle booking
simple
* HomeController.cs: ajoute l'assemblage du catalog dans le
listing dédié
* YavscAjaxHelper.cs: Implemente un outil de representation
JSon des objets côté serveur
* parallax.js: deux fois plus de mouvement autout de x dans le
parallax
* yavsc.rate.js: imlemente un callback JS pour le rating
* Activities.aspx: Des labels au formulaire de déclaration des
activités
* Activity.ascx: un panneau activité descent
* Booking.aspx: implemente l'UI web du booking simple.
* EavyBooking.aspx: refabrication du booking lourd
* Index.aspx: supprime le panneau du tag Accueil, affiche les
activités en cours du site (avec au moins un préstataire
valide pour cette activité)
* Web.config: Implemente une cote utilisateur, par une
nouvelle valeur de son profile (Rate).
* Yavsc.csproj: refabrique du code API Google, qui part dans
le model.
* MarkdownDeep.dll: le tag <p> ne convenait pas, le remplacer
par le tag <span> non plus.
Maintenant ça devrait être correct, c'est un div, mais que en
cas de tag englobant non défini.
* Skills.sql: vient de passer dans activity.Sql
* T.cs: la traduction est faite plus simple à appeler (sans
cast vers `string`).
2015-11-26 Paul Schneider <paul@pschneider.fr>
* Yavsc.csproj: nouvelles configurations de

View file

@ -262,7 +262,7 @@ namespace Yavsc.Controllers
private void SetMEACodeViewData(Profile model) {
var activities = WorkFlowManager.FindActivity ("%", false);
var items = new List<SelectListItem> ();
items.Add (new SelectListItem () { Selected = model.MEACode == null, Text = LocalizedText.DoNotPublishMyActivity, Value=null });
items.Add (new SelectListItem () { Selected = model.MEACode == null, Text = LocalizedText.DoNotPublishMyActivity, Value="none" });
foreach (var a in activities) {
items.Add(new SelectListItem() { Selected = model.MEACode == a.Id,
Text = string.Format("{1} : {0}",a.Title,a.Id),
@ -271,7 +271,6 @@ namespace Yavsc.Controllers
ViewData ["MEACode"] = items;
}
/// <summary>
/// Profile the specified id, model and AvatarFile.
/// </summary>

View file

@ -5,9 +5,9 @@ using System.Web;
using System.Web.Mvc;
using Yavsc.Admin;
using Yavsc.Model.Calendar;
using Yavsc.Helpers.Google;
using Yavsc.Model.Circles;
using System.Web.Security;
using Yavsc.Model.Google.Api;
namespace Yavsc.Controllers

View file

@ -302,7 +302,7 @@ namespace Yavsc.Controllers
Membership.GetUser ().UserName).Select (x => new SelectListItem {
Value = x.Id.ToString(),
Text = x.Title,
Selected = model.AllowedCircles.Contains (x.Id)
Selected = (model.AllowedCircles==null)? false : model.AllowedCircles.Contains (x.Id)
});
return View ("Edit", model);
}

View file

@ -17,6 +17,10 @@ using System.Configuration;
using Yavsc.Helpers;
using Yavsc.Model.FrontOffice.Catalog;
using Yavsc.Model.Skill;
using System.Web.Profile;
using Yavsc.Model.Google.Api;
using System.Net;
using System.Linq;
namespace Yavsc.Controllers
{
@ -33,6 +37,7 @@ namespace Yavsc.Controllers
{
return View ();
}
/// <summary>
/// Pub the Event
/// </summary>
@ -42,6 +47,7 @@ namespace Yavsc.Controllers
{
return View (model);
}
/// <summary>
/// Estimates released to this client
/// </summary>
@ -53,7 +59,7 @@ namespace Yavsc.Controllers
throw new ConfigurationErrorsException ("no redirection to any login page");
string username = u.UserName;
Estimate [] estims = WorkFlowManager.GetUserEstimates (username);
Estimate[] estims = WorkFlowManager.GetUserEstimates (username);
ViewData ["UserName"] = username;
ViewData ["ResponsibleCount"] =
Array.FindAll (
@ -61,8 +67,8 @@ namespace Yavsc.Controllers
x => x.Responsible == username).Length;
ViewData ["ClientCount"] =
Array.FindAll (
estims,
x => x.Client == username).Length;
estims,
x => x.Client == username).Length;
return View (estims);
}
@ -76,7 +82,7 @@ namespace Yavsc.Controllers
Estimate f = WorkFlowManager.GetEstimate (id);
if (f == null) {
ModelState.AddModelError ("Id", "Wrong Id");
return View (new Estimate () { Id=id } );
return View (new Estimate () { Id = id });
}
return View (f);
}
@ -89,9 +95,9 @@ namespace Yavsc.Controllers
[Authorize]
public ActionResult Estimate (Estimate model, string submit)
{
string username = Membership.GetUser().UserName;
string username = Membership.GetUser ().UserName;
// Obsolete, set in master page
ViewData ["WebApiBase"] = Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative);
ViewData ["WebApiBase"] = Url.Content (Yavsc.WebApiConfig.UrlPrefixRelative);
ViewData ["WABASEWF"] = ViewData ["WebApiBase"] + "/WorkFlow";
if (submit == null) {
if (model.Id > 0) {
@ -107,7 +113,7 @@ namespace Yavsc.Controllers
&& !Roles.IsUserInRole ("FrontOffice"))
throw new UnauthorizedAccessException ("You're not allowed to view this estimate");
} else if (model.Id == 0) {
if (string.IsNullOrWhiteSpace(model.Responsible))
if (string.IsNullOrWhiteSpace (model.Responsible))
model.Responsible = username;
}
} else {
@ -116,7 +122,7 @@ namespace Yavsc.Controllers
if (string.IsNullOrWhiteSpace (model.Responsible))
model.Responsible = username;
if (username != model.Responsible
&& !Roles.IsUserInRole ("FrontOffice"))
&& !Roles.IsUserInRole ("FrontOffice"))
throw new UnauthorizedAccessException ("You're not allowed to modify this estimate");
if (ModelState.IsValid) {
@ -172,7 +178,7 @@ namespace Yavsc.Controllers
throw new Exception ("No catalog");
var brand = cat.GetBrand (brandid);
if (brand == null)
throw new Exception ("Not a brand id: "+brandid);
throw new Exception ("Not a brand id: " + brandid);
var pcat = brand.GetProductCategory (pcid);
if (pcat == null)
throw new Exception ("Not a product category id in this brand: " + pcid);
@ -194,7 +200,7 @@ namespace Yavsc.Controllers
ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog ();
if (cat == null) {
YavscHelpers.Notify(ViewData, "Catalog introuvable");
YavscHelpers.Notify (ViewData, "Catalog introuvable");
ViewData ["RefType"] = "Catalog";
return View ("ReferenceNotFound");
}
@ -236,11 +242,11 @@ namespace Yavsc.Controllers
try {
// Add specified product command to the basket,
// saves it in db
new Command(collection,HttpContext.Request.Files);
YavscHelpers.Notify(ViewData, LocalizedText.Item_added_to_basket);
new Command (collection, HttpContext.Request.Files);
YavscHelpers.Notify (ViewData, LocalizedText.Item_added_to_basket);
return View (collection);
} catch (Exception e) {
YavscHelpers.Notify(ViewData,"Exception:" + e.Message);
YavscHelpers.Notify (ViewData, "Exception:" + e.Message);
return View (collection);
}
}
@ -257,7 +263,7 @@ namespace Yavsc.Controllers
/// <summary>
/// Skills the specified model.
/// </summary>
[Authorize(Roles="Admin")]
[Authorize (Roles = "Admin")]
public ActionResult Skills (string search)
{
if (search == null)
@ -266,16 +272,28 @@ namespace Yavsc.Controllers
return View (skills);
}
/// <summary>
/// Performers on this MEA.
/// fr
/// Liste des prestataires dont
/// l'activité principale est celle spécifiée
/// </summary>
/// <param name="id">Identifiant APE de l'activité.</param>
public ActionResult Performers (string id)
{
throw new NotImplementedException ();
}
/// <summary>
/// Activities the specified search and toPower.
/// </summary>
/// <param name="search">Search.</param>
/// <param name="toPower">If set to <c>true</c> to power.</param>
public ActionResult Activities (string search, bool toPower = false)
public ActionResult Activities (string id, bool toPower = false)
{
if (search == null)
search = "%";
var activities = WorkFlowManager.FindActivity(search,!toPower);
if (id == null)
id = "%";
var activities = WorkFlowManager.FindActivity (id, !toPower);
return View (activities);
}
@ -283,21 +301,22 @@ namespace Yavsc.Controllers
/// Activity at the specified id.
/// </summary>
/// <param name="id">Identifier.</param>
public ActionResult Activity(string id)
public ActionResult Activity (string id)
{
return View(WorkFlowManager.GetActivity (id));
return View (WorkFlowManager.GetActivity (id));
}
/// <summary>
/// Display and should
/// offer Ajax edition of
/// user's skills.
/// </summary>
/// <param name="id">the User name.</param>
[Authorize()]
[Authorize ()]
public ActionResult UserSkills (string id)
{
if (id == null)
id = User.Identity.Name ;
if (id == null)
id = User.Identity.Name;
// TODO or not to do, handle a skills profile update,
// actually performed via the Web API :-°
// else if (ModelState.IsValid) {}
@ -308,15 +327,131 @@ namespace Yavsc.Controllers
}
/// <summary>
/// Booking the specified model.
/// Dates the query.
/// </summary>
/// <returns>The query.</returns>
/// <param name="model">Model.</param>
public ActionResult Booking (string id, SimpleBookingQuery model)
[Authorize,HttpPost]
public ActionResult Book (BookingQuery model)
{
if (model.Needs == null)
model.Needs = SkillManager.FindSkill ("%");
model.MAECode = id;
DateTime mindate = DateTime.Now;
if (model.StartDate.Date < mindate.Date) {
ModelState.AddModelError ("StartDate", LocalizedText.FillInAFutureDate);
}
if (model.EndDate < model.StartDate)
ModelState.AddModelError ("EndDate", LocalizedText.StartDateAfterEndDate);
if (ModelState.IsValid) {
var result = new List<PerformerProfile> ();
foreach (string meacode in model.MEACodes) {
foreach (PerformerProfile profile in WorkFlowManager.FindPerformer(meacode)) {
try {
var events = ProfileBase.Create (profile.UserName).GetEvents (model.StartDate, model.EndDate);
if (events.items.Length == 0)
result.Add (profile);
} catch (WebException ex) {
string response;
using (var stream = ex.Response.GetResponseStream ()) {
using (var reader = new StreamReader (stream)) {
response = reader.ReadToEnd ();
stream.Close ();
}
YavscHelpers.Notify (ViewData,
string.Format (
"Google calendar API exception {0} : {1}<br><pre>{2}</pre>",
ex.Status.ToString (),
ex.Message,
response));
}
}
}
}
return View ("Performers", result.ToArray ());
}
return View (model);
}
/// <summary>
/// Booking the specified model.
/// </summary>
/// <param name="MEACode">MEA Code.</param>
/// <param name="model">Model.</param>
public ActionResult Booking (SimpleBookingQuery model)
{
// In order to present this form
// with no need selected and without
// validation error display,
// we only check the need here, not at validation time.
// Although, the need is indeed cruxial requirement,
// but we already have got a MEA code
if (ModelState.IsValid)
if (model.Needs != null) {
var result = new List<PerformerAvailability> ();
foreach (PerformerProfile profile in WorkFlowManager.FindPerformer(model.MEACode)) {
if (profile.HasCalendar ()) {
try {
var events = ProfileBase.Create (profile.UserName)
.GetEvents (
model.PreferedDate.Date,
model.PreferedDate.AddDays (1).Date);
// TODO replace (events.items.Length == 0)
// with a descent computing of dates and times claims, calendar,
// AND performer preferences, perhaps also client preferences
result.Add (profile.CreateAvailability (model.PreferedDate, (events.items.Length == 0)));
} catch (WebException ex) {
HandleWebException (ex, "Google Calendar Api");
}
} else
result.Add (profile.CreateAvailability (model.PreferedDate, false));
}
return View ("Performers", result.ToArray ());
} else {
// A first Get
var needs = SkillManager.FindSkill ("%", model.MEACode);
ViewData ["Needs"] = needs;
model.Needs = needs.Select (
x => string.Format ("{0}:{1}", x.Id, x.Rate)).ToArray ();
}
var activity = WorkFlowManager.GetActivity (model.MEACode);
ViewData ["Activity"] = activity;
ViewData ["Title"] = activity.Title;
ViewData ["Comment"] = activity.Comment;
ViewData ["Photo"] = activity.Photo;
if (model.PreferedDate < DateTime.Now)
model.PreferedDate = DateTime.Now;
return View (model);
}
private void HandleWebException (WebException ex, string context)
{
string response = "";
using (var stream = ex.Response.GetResponseStream ()) {
if (stream.CanRead) {
var reader = new StreamReader (stream);
response = reader.ReadToEnd ();
reader.Close ();
reader.DiscardBufferedData ();
reader.Dispose ();
}
stream.Close ();
stream.Dispose ();
}
YavscHelpers.Notify (ViewData,
string.Format (
"{3} exception {0} : {1}<br><pre>{2}</pre>",
ex.Status.ToString (),
ex.Message,
response,
context
));
}
}
}

View file

@ -15,9 +15,12 @@ using Newtonsoft.Json;
using Yavsc.Model;
using Yavsc.Model.Google;
using Yavsc.Model.RolesAndMembers;
using Yavsc.Helpers.Google;
using Yavsc.Model.Calendar;
using Yavsc.Helpers;
using Yavsc.Model.WorkFlow;
using Yavsc.Model.FrontOffice;
using Yavsc.Model.Google.Api;
using Yavsc.Model.Skill;
namespace Yavsc.Controllers
{
@ -303,44 +306,10 @@ namespace Yavsc.Controllers
return View (model);
}
/// <summary>
/// Dates the query.
/// </summary>
/// <returns>The query.</returns>
/// <param name="model">Model.</param>
[Authorize,HttpPost]
public ActionResult Book (BookingQuery model)
public ActionResult Book (SimpleBookingQuery model)
{
DateTime mindate = DateTime.Now;
if (model.StartDate.Date < mindate.Date){
ModelState.AddModelError ("StartDate", LocalizedText.FillInAFutureDate);
}
if (model.EndDate < model.StartDate)
ModelState.AddModelError ("EndDate", LocalizedText.StartDateAfterEndDate);
if (ModelState.IsValid) {
foreach (string rolename in model.Roles) {
foreach (string username in Roles.GetUsersInRole(rolename)) {
try {
var pr = ProfileBase.Create(username);
var events = pr.GetEvents(model.StartDate,model.EndDate);
} catch (WebException ex) {
string response;
using (var stream = ex.Response.GetResponseStream())
using (var reader = new StreamReader(stream))
{
response = reader.ReadToEnd();
}
YavscHelpers.Notify (ViewData,
string.Format(
"Google calendar API exception {0} : {1}<br><pre>{2}</pre>",
ex.Status.ToString(),
ex.Message,
response));
}
}
}
}
return View (model);
}
}

View file

@ -15,6 +15,8 @@ using Yavsc;
using System.Web.Mvc;
using Yavsc.Model.Blogs;
using Yavsc.Model.WorkFlow;
using Yavsc.WebControls;
using SalesCatalog.XmlImplementation;
namespace Yavsc.Controllers
{
@ -47,10 +49,13 @@ namespace Yavsc.Controllers
{
Assembly[] aslist = {
GetType ().Assembly,
typeof(BlogsController).Assembly,
typeof(ITCPNpgsqlProvider).Assembly,
typeof(NpgsqlMembershipProvider).Assembly,
typeof(NpgsqlContentProvider).Assembly,
typeof(NpgsqlBlogProvider).Assembly
typeof(NpgsqlBlogProvider).Assembly,
typeof(InputUserName).Assembly,
typeof(XmlCatalog).Assembly
};
List <AssemblyName> asnlist = new List<AssemblyName> ();

View file

@ -1,78 +0,0 @@
//
// Manager.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Google;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google base API client.
/// This class implements the identification values for a Google Api,
/// and provides some scope values.
/// </summary>
public class ApiClient
{
/// <summary>
/// The CLIENT Id.
/// </summary>
public static string CLIENT_ID { get ; set ; }
/// <summary>
/// The CLIENt SECREt
/// </summary>
public static string CLIENT_SECRET { get ; set ; }
/// <summary>
/// The API KEY.
/// </summary>
public static string API_KEY { get ; set ; }
/* // to use in descendence
*
protected static string getPeopleUri = "https://www.googleapis.com/plus/v1/people";
private static string authUri = "https://accounts.google.com/o/oauth2/auth";
*/
/// <summary>
/// The Map tracks scope .
/// </summary>
protected static string scopeTracks = "https://www.googleapis.com/auth/tracks";
/// <summary>
/// The calendar scope.
/// </summary>
protected static string scopeCalendar = "https://www.googleapis.com/auth/calendar";
/// <summary>
/// The scope openid.
/// </summary>
protected static string[] scopeOpenid = {
"openid",
"profile",
"email"
};
}
}

View file

@ -1,134 +0,0 @@
//
// Calendar.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Google;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
using System.Web;
using System.Runtime.Serialization.Json;
using Yavsc.Model;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google Calendar API client.
/// </summary>
public class CalendarApi : ApiClient
{
public CalendarApi(string apiKey)
{
API_KEY = apiKey;
}
/// <summary>
/// The get cal list URI.
/// </summary>
protected static string getCalListUri = "https://www.googleapis.com/calendar/v3/users/me/calendarList";
/// <summary>
/// The get cal entries URI.
/// </summary>
protected static string getCalEntriesUri = "https://www.googleapis.com/calendar/v3/calendars/{0}/events";
/// <summary>
/// The date format.
/// </summary>
private static string dateFormat = "yyyy-MM-ddTHH:mm:ss";
/// <summary>
/// The time zone. TODO Fixme with machine time zone
/// </summary>
private string timeZone = "+01:00";
/// <summary>
/// Gets the calendar list.
/// </summary>
/// <returns>The calendars.</returns>
/// <param name="cred">Cred.</param>
public CalendarList GetCalendars (string cred)
{
CalendarList res = null;
HttpWebRequest webreq = WebRequest.CreateHttp (getCalListUri);
webreq.Headers.Add (HttpRequestHeader.Authorization, cred);
webreq.Method = "GET";
webreq.ContentType = "application/http";
using (WebResponse resp = webreq.GetResponse ()) {
using (Stream respstream = resp.GetResponseStream ()) {
res = (CalendarList) new DataContractJsonSerializer(typeof(CalendarList)).ReadObject (respstream);
}
resp.Close ();
}
webreq.Abort ();
return res;
}
/// <summary>
/// Gets a calendar.
/// </summary>
/// <returns>The calendar.</returns>
/// <param name="calid">Calid.</param>
/// <param name="mindate">Mindate.</param>
/// <param name="maxdate">Maxdate.</param>
/// <param name="upr">Upr.</param>
public CalendarEventList GetCalendar (string calid, DateTime mindate, DateTime maxdate,string cred)
{
if (string.IsNullOrWhiteSpace (calid))
throw new Exception ("the calendar identifier is not specified");
string uri = string.Format (
getCalEntriesUri, HttpUtility.UrlEncode (calid)) +
string.Format ("?orderBy=startTime&singleEvents=true&timeMin={0}&timeMax={1}&key=" + API_KEY,
HttpUtility.UrlEncode (mindate.ToString (dateFormat) + timeZone),
HttpUtility.UrlEncode (maxdate.ToString (dateFormat) + timeZone));
HttpWebRequest webreq = WebRequest.CreateHttp (uri);
webreq.Headers.Add (HttpRequestHeader.Authorization, cred);
webreq.Method = "GET";
webreq.ContentType = "application/http";
CalendarEventList res = null;
try {
using (WebResponse resp = webreq.GetResponse ()) {
using (Stream respstream = resp.GetResponseStream ()) {
try {
res = (CalendarEventList) new DataContractJsonSerializer(typeof(CalendarEventList)).ReadObject (respstream);
} catch (Exception ) {
respstream.Close ();
resp.Close ();
webreq.Abort ();
throw ;
}
}
resp.Close ();
}
} catch (WebException ) {
webreq.Abort ();
throw;
}
webreq.Abort ();
return res;
}
}
}

View file

@ -1,56 +0,0 @@
//
// Entity.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Google;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Entity.
/// </summary>
public class Entity
{
/// <summary>
/// The I.
/// </summary>
public string ID;
/// <summary>
/// The name.
/// </summary>
public string Name;
/// <summary>
/// The type: AUTOMOBILE: A car or passenger vehicle.
/// * TRUCK: A truck or cargo vehicle.
/// * WATERCRAFT: A boat or other waterborne vehicle.
/// * PERSON: A person.
/// </summary>
public string Type;
}
}

View file

@ -1,46 +0,0 @@
//
// EntityQuery.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Google;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Entity query.
/// </summary>
public class EntityQuery {
/// <summary>
/// The entity identifiers.
/// </summary>
public string [] EntityIds;
/// <summary>
/// The minimum identifier.
/// </summary>
public string MinId;
}
}

View file

@ -1,137 +0,0 @@
//
// GoogleHelpers.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Model.Google;
using System.Web.Profile;
using System.Configuration;
using System.Web;
using Yavsc.Model.Calendar;
using Yavsc.Model.Circles;
using System.Collections.Generic;
using System.Web.Security;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google helpers.
/// </summary>
public static class GoogleHelpers
{
/// <summary>
/// Gets the events.
/// </summary>
/// <returns>The events.</returns>
/// <param name="profile">Profile.</param>
/// <param name="mindate">Mindate.</param>
/// <param name="maxdate">Maxdate.</param>
public static CalendarEventList GetEvents(this ProfileBase profile, DateTime mindate, DateTime maxdate)
{
string gcalid = (string) profile.GetPropertyValue ("gcalid");
if (string.IsNullOrWhiteSpace (gcalid))
throw new ArgumentException ("NULL gcalid");
CalendarApi c = new CalendarApi (clientApiKey);
string creds = OAuth2.GetFreshGoogleCredential (profile);
return c.GetCalendar (gcalid, mindate, maxdate, creds);
}
/// <summary>
/// Gets the calendars.
/// </summary>
/// <returns>The calendars.</returns>
/// <param name="profile">Profile.</param>
public static CalendarList GetCalendars (this ProfileBase profile)
{
string cred = OAuth2.GetFreshGoogleCredential (profile);
CalendarApi c = new CalendarApi (clientApiKey);
return c.GetCalendars (cred);
}
private static string clientId = ConfigurationManager.AppSettings ["GOOGLE_CLIENT_ID"];
private static string clientSecret = ConfigurationManager.AppSettings ["GOOGLE_CLIENT_SECRET"];
private static string clientApiKey = ConfigurationManager.AppSettings ["GOOGLE_API_KEY"];
/// <summary>
/// Login the specified response, state and callBack.
/// </summary>
/// <param name="response">Response.</param>
/// <param name="state">State.</param>
/// <param name="callBack">Call back.</param>
public static void Login(this HttpResponseBase response, string state, string callBack)
{
OAuth2 oa = new OAuth2 (callBack, clientId,clientSecret);
oa.Login (response, state);
}
/// <summary>
/// Cals the login.
/// </summary>
/// <param name="response">Response.</param>
/// <param name="state">State.</param>
/// <param name="callBack">Call back.</param>
public static void CalLogin(this HttpResponseBase response, string state, string callBack)
{
OAuth2 oa = new OAuth2 (callBack,clientId,clientSecret);
oa.GetCalendarScope (response, state);
}
/// <summary>
/// Creates the O auth2.
/// </summary>
/// <returns>The O auth2.</returns>
/// <param name="callBack">Call back.</param>
public static OAuth2 CreateOAuth2(string callBack)
{
return new OAuth2 (callBack,clientId,clientSecret);
}
/// <summary>
/// Notifies the event.
/// </summary>
/// <returns>The event.</returns>
/// <param name="evpub">Evpub.</param>
public static MessageWithPayloadResponse NotifyEvent(EventPub evpub) {
using (SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse> r =
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse>(
"https://gcm-http.googleapis.com/gcm/send")) {
var users = Circle.Union (evpub.CircleIds);
var regids = new List<string> ();
var to = new List<string> ();
foreach (var u in users) {
var p = ProfileBase.Create (u);
if (p != null) {
var regid = p.GetPropertyValue("gregid");
if (regid == null) {
var muser = Membership.GetUser (u);
to.Add (muser.Email);
}
else regids.Add ((string)regid);
}
}
if (regids.Count == 0)
throw new InvalidOperationException
("No recipient where found for this circle list");
var msg = new MessageWithPayload<YaEvent> () {
notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "event" },
data = new YaEvent[] { (YaEvent)evpub }, registration_ids = regids.ToArray() };
return r.Invoke (msg);
}
}
}
}

View file

@ -1,81 +0,0 @@
//
// Google.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Google;
using System.Net;
using System.IO;
using System.Text;
using Newtonsoft.Json;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google Map tracks Api client.
/// </summary>
public class MapTracks:ApiClient {
/// <summary>
/// The google map tracks path (uri of the service).
/// </summary>
protected static string googleMapTracksPath = "https://www.googleapis.com/tracks/v1/";
// entities/[create|list|delete]
// collections/[list|create|[add|remove]entities|delete]
// crumbs/[record|getrecent|gethistory|report|summarize|getlocationinfo|delete
// entities/[create|list|delete]
// collections/[list|create|[add|remove]entities|delete]
// crumbs/[record|getrecent|gethistory|report|summarize|getlocationinfo|delete
/// <summary>
/// Creates the entity.
/// </summary>
/// <returns>The entity.</returns>
/// <param name="entities">Entities.</param>
public static string [] CreateEntity( Entity[] entities ) {
string [] ans = null;
using (SimpleJsonPostMethod< Entity[] ,string []> wr =
new SimpleJsonPostMethod< Entity[] ,string[]> (googleMapTracksPath + "entities/create"))
{
ans = wr.Invoke (entities);
}
return ans;
}
/// <summary>
/// Lists the entities.
/// </summary>
/// <returns>The entities.</returns>
/// <param name="eq">Eq.</param>
static Entity[] ListEntities (EntityQuery eq)
{
Entity [] ans = null;
using (SimpleJsonPostMethod<EntityQuery,Entity[]> wr =
new SimpleJsonPostMethod<EntityQuery,Entity[]> (googleMapTracksPath + "entities/create"))
{
ans = wr.Invoke (eq);
}
return ans;
}
}
}

View file

@ -1,252 +0,0 @@
//
// OAuth2.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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.IO;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using Yavsc.Model.Google;
using System.Web.Profile;
using System.Web;
using Yavsc.Model;
using System.Runtime.Serialization.Json;
using Yavsc.Helpers.Google;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google O auth2 client.
/// </summary>
public class OAuth2 : ApiClient
{
/// <summary>
/// The URI used to get tokens.
/// </summary>
protected static string tokenUri = "https://accounts.google.com/o/oauth2/token";
/// <summary>
/// The URI used to get authorized to.
/// </summary>
protected static string authUri = "https://accounts.google.com/o/oauth2/auth";
/// <summary>
/// Gets or sets the redirect URI sent to Google.
/// </summary>
/// <value>The redirect URI.</value>
public string RedirectUri { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Helpers.Google.OAuth2"/> class.
/// </summary>
/// <param name="redirectUri">Redirect URI.</param>
/// <param name="clientId">Client identifier.</param>
/// <param name="clientSecret">Client secret.</param>
public OAuth2 (string redirectUri, string clientId, string clientSecret)
{
RedirectUri = redirectUri;
CLIENT_ID = clientId;
CLIENT_SECRET = clientSecret;
}
/// <summary>
/// Login with Google
/// by redirecting the specified http web response bresp,
/// and using the specified session state.
/// </summary>
/// <param name="bresp">Bresp.</param>
/// <param name="state">State.</param>
public void Login (HttpResponseBase bresp, string state)
{
string scope = string.Join ("%20", scopeOpenid);
string prms = String.Format ("response_type=code&client_id={0}&redirect_uri={1}&scope={2}&state={3}&include_granted_scopes=false&approval_prompt=force",
CLIENT_ID, RedirectUri, scope, state);
GetAuthResponse (bresp, prms);
}
/// <summary>
/// Gets the cal authorization.
/// </summary>
/// <param name="bresp">Bresp.</param>
/// <param name="state">State.</param>
public void GetCalendarScope (HttpResponseBase bresp, string state)
{
string prms = String.Format ("response_type=code&client_id={0}&redirect_uri={1}&scope={2}&state={3}&include_granted_scopes=true&access_type=offline&approval_prompt=force",
CLIENT_ID, RedirectUri, scopeCalendar, state);
GetAuthResponse (bresp, prms);
}
private void GetAuthResponse (HttpResponseBase bresp, string prms)
{
string cont = null;
WebRequest wr = WebRequest.Create (authUri + "?" + prms);
wr.Method = "GET";
using (WebResponse response = wr.GetResponse ()) {
string resQuery = response.ResponseUri.Query;
cont = HttpUtility.ParseQueryString (resQuery) ["continue"];
response.Close ();
}
wr.Abort ();
bresp.Redirect (cont);
}
/// <summary>
/// Builds the post data, from code given
/// by Google in the request parameters,
/// and using the given <c>redirectUri</c>.
/// This request body is used to get a new
/// OAuth2 token from Google, it is Url encoded.
/// </summary>
/// <returns>The post data from code.</returns>
/// <param name="redirectUri">Redirect URI.</param>
/// <param name="code">Code.</param>
public static string TokenPostDataFromCode (string redirectUri, string code)
{
string postdata =
string.Format (
"redirect_uri={0}&client_id={1}&client_secret={2}&code={3}&grant_type=authorization_code",
HttpUtility.UrlEncode (redirectUri),
HttpUtility.UrlEncode (CLIENT_ID),
HttpUtility.UrlEncode (CLIENT_SECRET),
HttpUtility.UrlEncode (code));
return postdata;
}
/// <summary>
/// Gets the Google Authorization token.
/// </summary>
/// <returns>The token.</returns>
/// <param name="rq">Rq.</param>
/// <param name="state">State.</param>
/// <param name="message">Message.</param>
public AuthToken GetToken (HttpRequestBase rq, string state, out string message)
{
string code = OAuth2.GetCodeFromRequest (rq, state, out message);
string postdata = OAuth2.TokenPostDataFromCode (RedirectUri, code);
return GetTokenPosting (postdata);
}
internal static AuthToken GetTokenPosting (string postdata)
{
HttpWebRequest webreq = WebRequest.CreateHttp (tokenUri);
webreq.Method = "POST";
webreq.Accept = "application/json";
webreq.ContentType = "application/x-www-form-urlencoded";
Byte[] bytes = System.Text.Encoding.UTF8.GetBytes (postdata);
webreq.ContentLength = bytes.Length;
using (Stream dataStream = webreq.GetRequestStream ()) {
dataStream.Write (bytes, 0, bytes.Length);
dataStream.Close ();
}
AuthToken gat = null;
using (WebResponse response = webreq.GetResponse ()) {
using (Stream responseStream = response.GetResponseStream ()) {
gat = (AuthToken)new DataContractJsonSerializer (typeof(AuthToken)).ReadObject (responseStream);
responseStream.Close ();
}
response.Close ();
}
webreq.Abort ();
return gat;
}
/// <summary>
/// Gets the code from the Google request.
/// </summary>
/// <returns>The code from request.</returns>
/// <param name="rq">Rq.</param>
/// <param name="state">State.</param>
/// <param name="message">Message.</param>
public static string GetCodeFromRequest (HttpRequestBase rq, string state, out string message)
{
message = "";
string code = rq.Params ["code"];
string error = rq.Params ["error"];
if (error != null) {
message =
string.Format (LocalizedText.Google_error,
LocalizedText.ResourceManager.GetString (error));
return null;
}
string rqstate = rq.Params ["state"];
if (state != null && string.Compare (rqstate, state) != 0) {
message =
LocalizedText.ResourceManager.GetString ("invalid request state");
return null;
}
return code;
}
/// <summary>
/// Invalid O auth2 refresh token.
/// </summary>
public class InvalidOAuth2RefreshToken: Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Helpers.Google.OAuth2.InvalidOAuth2RefreshToken"/> class.
/// </summary>
/// <param name="message">Message.</param>
public InvalidOAuth2RefreshToken(string message):base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Helpers.Google.OAuth2.InvalidOAuth2RefreshToken"/> class.
/// </summary>
/// <param name="message">Message.</param>
/// <param name="innerException">Inner exception.</param>
public InvalidOAuth2RefreshToken(string message,Exception innerException):base(message,innerException)
{
}
}
/// <summary>
/// Gets fresh google credential.
/// </summary>
/// <returns>The fresh google credential.</returns>
/// <param name="pr">Pr.</param>
public static string GetFreshGoogleCredential (ProfileBase pr)
{
string token = (string)pr.GetPropertyValue ("gtoken");
string token_type = (string) pr.GetPropertyValue ("gtokentype");
DateTime token_exp = (DateTime) pr.GetPropertyValue ("gtokenexpir");
if (token_exp < DateTime.Now) {
object ort = pr.GetPropertyValue ("grefreshtoken");
if (ort is DBNull || string.IsNullOrWhiteSpace((string)ort)) {
throw new InvalidOAuth2RefreshToken ("Google");
}
string refresh_token = ort as string;
AuthToken gat = OAuth2.GetTokenPosting (
string.Format ("grant_type=refresh_token&client_id={0}&client_secret={1}&refresh_token={2}",
CLIENT_ID, CLIENT_SECRET, refresh_token));
token = gat.access_token;
pr.SetPropertyValue ("gtoken", token);
pr.Save ();
// ASSERT gat.token_type == pr.GetPropertyValue("gtokentype")
}
return token_type + " " + token;
}
}
}

View file

@ -1,68 +0,0 @@
//
// PeopleApi.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.IO;
using System.Net;
using System.Text;
using Newtonsoft.Json;
using Yavsc.Model.Google;
using System.Web.Profile;
using System.Web;
using Yavsc.Model;
using System.Runtime.Serialization.Json;
using Yavsc.Helpers.Google;
namespace Yavsc.Helpers.Google
{
/// <summary>
/// Google People API.
/// </summary>
public class PeopleApi: ApiClient
{
private static string getPeopleUri = "https://www.googleapis.com/plus/v1/people";
/// <summary>
/// Gets the People object associated to the given Google Access Token
/// </summary>
/// <returns>The me.</returns>
/// <param name="gat">The Google Access Token object <see cref="AuthToken"/> class.</param>
public static People GetMe (AuthToken gat)
{
People me;
DataContractJsonSerializer ppser = new DataContractJsonSerializer (typeof(People));
HttpWebRequest webreppro = WebRequest.CreateHttp (getPeopleUri + "/me");
webreppro.ContentType = "application/http";
webreppro.Headers.Add (HttpRequestHeader.Authorization, gat.token_type + " " + gat.access_token);
webreppro.Method = "GET";
using (WebResponse proresp = webreppro.GetResponse ()) {
using (Stream prresponseStream = proresp.GetResponseStream ()) {
me = (People)ppser.ReadObject (prresponseStream);
prresponseStream.Close ();
}
proresp.Close ();
}
webreppro.Abort ();
return me;
}
}
}

View file

@ -1,108 +0,0 @@
//
// PostJson.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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.Net;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Json;
namespace Yavsc.Helpers
{
/// <summary>
/// Simple json post method.
/// </summary>
public class SimpleJsonPostMethod<TQuery,TAnswer>: IDisposable
{
internal HttpWebRequest request = null;
internal HttpWebRequest Request { get { return request; } }
string CharSet {
get { return Request.TransferEncoding; }
set { Request.TransferEncoding=value;}
}
string Method { get { return Request.Method; } }
/// <summary>
/// Gets the path.
/// </summary>
/// <value>The path.</value>
public string Path {
get{ return Request.RequestUri.ToString(); }
}
/// <summary>
/// Sets the credential.
/// </summary>
/// <param name="cred">Cred.</param>
public void SetCredential(string cred) {
Request.Headers.Set(HttpRequestHeader.Authorization,cred);
}
/// <summary>
/// Initializes a new instance of the Yavsc.Helpers.SimpleJsonPostMethod class.
/// </summary>
/// <param name="pathToMethod">Path to method.</param>
public SimpleJsonPostMethod (string pathToMethod)
{
// ASSERT Request == null
request = WebRequest.CreateHttp (pathToMethod);
Request.Method = "POST";
Request.Accept = "application/json";
Request.ContentType = "application/json";
Request.SendChunked = true;
Request.TransferEncoding = "UTF-8";
}
/// <summary>
/// Invoke the specified query.
/// </summary>
/// <param name="query">Query.</param>
public TAnswer Invoke(TQuery query)
{
DataContractJsonSerializer serquery = new DataContractJsonSerializer (typeof(TQuery));
DataContractJsonSerializer seransw = new DataContractJsonSerializer (typeof(TAnswer));
using (MemoryStream streamQuery = new MemoryStream ()) {
serquery.WriteObject (streamQuery, query);
}
TAnswer ans = default (TAnswer);
using (WebResponse response = Request.GetResponse ()) {
using (Stream responseStream = response.GetResponseStream ()) {
ans = (TAnswer) seransw.ReadObject(responseStream);
}
response.Close();
}
return ans;
}
#region IDisposable implementation
/// <summary>
/// Releases all resource used by the Yavsc.Helpers.SimpleJsonPostMethod object.
/// </summary>
public void Dispose ()
{
if (Request != null) Request.Abort ();
}
#endregion
}
}

View file

@ -33,10 +33,10 @@ namespace Yavsc.Helpers
/// </summary>
/// <param name="helper">Helper.</param>
/// <param name="text">Text.</param>
public static IHtmlString Translate(this HtmlHelper helper, string text)
public static IHtmlString Translate(this HtmlHelper helper, object text)
{
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
return new MvcHtmlString(helper.Encode(GetString(text)));
return new MvcHtmlString(helper.Encode(GetString((string)text)));
}
}

View file

@ -22,6 +22,9 @@ using System;
using System.Web.Mvc;
using System.Collections.Generic;
using Yavsc.Model.Messaging;
using System.Runtime.Serialization.Json;
using System.IO;
using System.Text;
namespace Yavsc.Helpers
{
@ -61,10 +64,36 @@ namespace Yavsc.Helpers
return "\"" + tmpstr + "\"";
return "'" + tmpstr + "'";
}
public static string JString(this AjaxHelper helper, object str)
/// <summary>
/// Js the son string.
/// </summary>
/// <returns>The son string.</returns>
/// <param name="helper">Helper.</param>
/// <param name="obj">Object.</param>
public static string JSonString(this AjaxHelper helper, object obj)
{
return QuoteJavascriptString (str);
string result = null;
DataContractJsonSerializer ser = new DataContractJsonSerializer (obj.GetType());
var e = Encoding.UTF8;
using (MemoryStream streamQuery = new MemoryStream ()) {
ser.WriteObject (streamQuery, obj);
streamQuery.Seek (0, SeekOrigin.Begin);
using (StreamReader sr = new StreamReader (streamQuery)) {
result = sr.ReadToEnd ();
}
}
return result;
}
/// <summary>
/// Js the string.
/// </summary>
/// <returns>The string.</returns>
/// <param name="helper">Helper.</param>
/// <param name="text">Text.</param>
public static string JString(this AjaxHelper helper, object text)
{
return QuoteJavascriptString ((string)text);
}
}
}

View file

@ -24,7 +24,7 @@ Page.StyleSheetTheme = (string) Profile.UITheme; %>
<script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
$(document).ready(function(){
$('[data-type="rate-bill"]').rate({target: 'Blogs/Rate'});
$('[data-type="rate-bill"]').rate({webTarget: 'Blogs/Rate'});
});
</script>
<%=Ajax.GlobalizationScript()%>

View file

@ -85,7 +85,7 @@ $(document).ready(function(){
if ($stwidth>320 && $stheight>320) {
window.addEventListener('deviceorientation', function(event) {
tiltLR = $stwidth*Math.sin(event.gamma*Math.PI/180);
titleFB = $stheight*Math.sin(event.beta*Math.PI/180);
titleFB = $stheight*Math.sin(event.beta*Math.PI/90);
onPos($bgobj,tiltLR,titleFB);
},false); }
$(window).mousemove(function(e) {

View file

@ -2,11 +2,16 @@
(function(jQuery) {
return jQuery.widget('Yavsc.rate', {
options: {
target: null,
webTarget: null,
jsTarget: null,
disabled: false
},
sendRate: function (rating,callback) {
Yavsc.ajax(this.options.target+'/Rate', rating, callback);
if (this.options.webTarget)
Yavsc.ajax(this.options.webTarget+'/Rate', rating, callback);
if (this.options.jsTarget)
if (this.options.jsTarget(rating))
if (callback) callback();
},
_create: function() {
var $ratectl = $(this.element);

View file

@ -11,9 +11,12 @@
<aside class="control">
<form method="post" action="DeclareActivity">
<fieldset>
<input type="text" name="meacode" id="meacode" >
<input type="text" name="activityname" id="activityname" >
<input type="text" name="comment" id="comment" >
<%= Html.Translate("MEACode")%>:
<input type="text" name="meacode" id="meacode" ><br>
<%= Html.Translate("Title")%>:
<input type="text" name="activityname" id="activityname" ><br>
<%= Html.Translate("Comment")%>:
<textarea name="comment" id="comment" class="fullwidth" ></textarea><br>
<input type="button" value="Créer l'activité" id="btncreate" >
</fieldset>
</form>

View file

@ -1,9 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Activity>" %>
<h1 class="activity">
<%=Html.Icon("act"+Model.Id)%>
<%=Html.Markdown(Model.Title)%></h1>
<i>(<%=Html.Markdown(Model.Id)%>)</i>
<div>
<div data-type="background" data-speed="10" style="width:100%; height:10em; background: url(<%=Ajax.JString(Model.Photo)%>) 50% 50% repeat fixed;" >
</div>
<h1><a href="<%= Url.RouteUrl("Default", new { controller="FrontOffice", action="Booking", id=Model.Id }) %>">
<%=Html.Encode(Model.Title)%></a></h1>
<i>(<%=Html.Translate("MEACode")%>: <%=Html.Encode(Model.Id)%>)</i>
<p>
<%=Html.Markdown(Model.Comment)%>
</p>
</p></div>

View file

@ -1,4 +1,19 @@
<%@ Page Title="Booking" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<SimpleBookingQuery>" %>
<asp:Content ContentPlaceHolderID="init" ID="init1" runat="server">
<% Title = Html.Translate("BookingTitle"+Model.MEACode) + " - " + YavscHelpers.SiteName; %>
</asp:Content>
<asp:Content ContentPlaceHolderID="overHeaderOne" ID="header1" runat="server">
<h1>
<a href="<%=Url.RouteUrl("FrontOffice",new {action="Booking", MEACode=Model.MEACode })%>">
<img href="<%= ViewData["Photo"] %>" alt="">
<%=Html.Translate("BookingTitle"+Model.MEACode)%>
</a>
- <a href="<%= Url.RouteUrl("Default",new {controller="Home" }) %>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:Content>
<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>
@ -10,28 +25,39 @@
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% using ( Html.BeginForm("Booking") ) { %>
<%= Html.Hidden("MAECode") %>
<% using ( Html.BeginForm( "Booking", "FrontOffice", new { MEACode = Model.MEACode }) ) { %>
<%= Html.ValidationSummary() %>
<%= Html.Hidden("MEACode") %>
<fieldset>
<legend>Préferences musicales</legend>
<%= Html.LabelFor(model=>model.Needs) %>:
<legend><%= Html.Translate("YourNeed") %></legend>
<input type="hidden" name="Needs" id="Needs" value="">
<ul>
<% foreach (var need in Model.Needs) { %>
<li><%= need.Name %> <%= Html.Partial("RateSkillControl",need)%></li>
<% foreach (var need in (SkillEntity[])(ViewData["Needs"])) { %>
<li><%= need.Name %> <%= Html.Partial("RateSkillControl", need)%></li>
<% } %>
</ul>
<%= Html.ValidationMessageFor(model=>model.Needs) %>
</fieldset>
<fieldset>
<legend>Date de l'événement</legend>
<legend><%= Html.Translate("PerformanceDate") %></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 needs = <%= Ajax.JSonString((SkillEntity[])(ViewData["Needs"])) %>;
var fneeds = needs.map( function (need) {
return need.Id+' '+need.Rate; } );
fneeds.forEach(function(elt) { console.log(Yavsc.dumpprops(elt)) } );
$('#Needs').val(fneeds);
$('[data-type="rate-site-skill"]').rate({jsTarget: function (rating)
{
// console.log(Yavsc.dumpprops(rating));
return true;
}
});
var tpconfig = {
'timeFormat': 'H:i',
'showDuration': true,

View file

@ -31,10 +31,8 @@ et le
<%= Html.ValidationMessageFor(model=>model.EndHour) %>
</div>
<fieldset>
<legend>Intervenant</legend>
<%= Html.LabelFor(model=>model.Roles) %>:
<%= Html.TextBoxFor(model=>model.Roles) %>
<%= Html.ValidationMessageFor(model=>model.Roles) %>
<legend>Services concernés</legend>
<%= Html.ListBox("MEACodes") %>
</fieldset>
<script>
$(document).ready(function(){

View file

@ -9,7 +9,7 @@
<%= Html.LabelFor(model => model.Location) %>: <%=Model.Location%> <br/>
<%= Html.LabelFor(model => model.StartDate) %>: <%=Model.StartDate%> <br/>
<%= Html.LabelFor(model => model.EndDate) %>: <%=Model.EndDate%> <br/>
<%= Html.LabelFor(model => model.Circles) %>: <%=Model.Circles%> <br/>
<%= Html.LabelFor(model => model.CircleIds) %>: <%=Model.CircleIds%> <br/>
<%= Html.LabelFor(model => model.EventWebPage) %>: <%=Model.EventWebPage%> <br/>
<%= Html.LabelFor(model => model.ProviderName) %>: <%=Model.ProviderName%> <br/>
<%= Html.LabelFor(model => model.Comment) %>: <%=Model.Comment%> <br/>

View file

@ -4,7 +4,7 @@
<script src="<%=Url.Content("~/Scripts/yavsc.skills.js")%>"></script>
<script>
$(document).ready(function(){
$('[data-type="rate-site-skill"]').rate({target: 'Skill/RateSkill'});
$('[data-type="rate-site-skill"]').rate({webTarget: 'Skill/RateSkill'});
});
</script>
</asp:Content>

View file

@ -4,7 +4,7 @@
<script src="<%=Url.Content("~/Scripts/yavsc.skills.js")%>"></script>
<script>
$(document).ready(function(){
$('[data-type="rate-user-skill"]').rate({target: 'Skill/RateUserSkill'});
$('[data-type="rate-user-skill"]').rate({webTarget: 'Skill/RateUserSkill'});
});
</script>
</asp:Content>

View file

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

View file

@ -150,6 +150,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="gregid" allowAnonymous="true" />
<add name="allowcookies" type="System.Boolean" allowAnonymous="true" defaultValue="false" />
<add name="UITheme" allowAnonymous="true" defaultValue="dark" />
<add name="Rate" type="System.Int32" defaultValue="100" />
</properties>
</profile>
<blog defaultProvider="NpgsqlBlogProvider">

View file

@ -30,7 +30,6 @@
</CustomCommands>
<DocumentationFile>bin\Yavsc.xml</DocumentationFile>
<Externalconsole>true</Externalconsole>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@ -40,13 +39,11 @@
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<DocumentationFile>bin\Yavsc.xml</DocumentationFile>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Lua|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<WarningLevel>4</WarningLevel>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'TotemPre|AnyCPU' ">
<Optimize>false</Optimize>
@ -155,7 +152,6 @@
<Folder Include="Formatters\" />
<Folder Include="htmldoc\" />
<Folder Include="Helpers\" />
<Folder Include="Helpers\Google\" />
<Folder Include="lib\" />
<Folder Include="Models\" />
<Folder Include="Settings\" />
@ -203,16 +199,9 @@
<Compile Include="Settings\ModulesConfigurationSection.cs" />
<Compile Include="Settings\ModuleConfigurationElementCollection.cs" />
<Compile Include="Settings\ModuleConfigurationElement.cs" />
<Compile Include="Helpers\SimpleJsonPostMethod.cs" />
<Compile Include="Helpers\Google\Entity.cs" />
<Compile Include="Helpers\Google\MapTracks.cs" />
<Compile Include="Helpers\Google\EntityQuery.cs" />
<Compile Include="Helpers\Google\ApiClient.cs" />
<Compile Include="Helpers\Google\CalendarApi.cs" />
<Compile Include="Formatters\ErrorHtmlFormatter.cs" />
<Compile Include="Formatters\RssFeedsFormatter.cs" />
<Compile Include="Formatters\TexToPdfFormatter.cs" />
<Compile Include="WebApiConfig.cs" />
<Compile Include="Formatters\EstimToPdfFormatter.MSAN.cs" />
<Compile Include="Helpers\TemplateException.cs" />
<Compile Include="Formatters\FormatterException.cs" />
@ -228,17 +217,15 @@
<Compile Include="Web References\sms.diamondcard.us\Reference.cs">
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="Helpers\Google\OAuth2.cs" />
<Compile Include="Helpers\Google\PeopleApi.cs" />
<Compile Include="ApiControllers\PaypalController.cs" />
<Compile Include="ApiControllers\AuthorizationDenied.cs" />
<Compile Include="ApiControllers\YavscController.cs" />
<Compile Include="Helpers\YavscAjaxHelper.cs" />
<Compile Include="Helpers\Google\GoogleHelpers.cs" />
<Compile Include="AuthorizeAttribute.cs" />
<Compile Include="ApiControllers\SkillController.cs" />
<Compile Include="Controllers\PayPalController.cs" />
<Compile Include="ApiControllers\BackOfficeController.cs" />
<Compile Include="WebApiConfig.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
@ -497,7 +484,6 @@
<Content Include="App_Themes\images\Mono-powered.png" />
<Content Include="App_Themes\images\noavatar.png" />
<Content Include="App_Themes\images\p8-av4.s.jpg" />
<Content Include="App_Themes\images\p8-av4.xxs.jpg" />
<Content Include="App_Themes\images\pgsql.png" />
<Content Include="App_Themes\images\sign-in-with-google.png" />
<Content Include="App_Themes\images\sign-in-with-google-s.png" />
@ -519,13 +505,10 @@
<Content Include="App_Code\Global.asax.cs" />
<Content Include="Views\FrontOffice\RateSkillControl.ascx" />
<Content Include="Views\FrontOffice\RateUserSkillControl.ascx" />
<Content Include="Web.Release.config" />
<Content Include="Views\PayPal\Index.aspx" />
<Content Include="Views\PayPal\Abort.aspx" />
<Content Include="Views\PayPal\Commit.aspx" />
<Content Include="Views\PayPal\IPN.aspx" />
<Content Include="Web.Debug.config" />
<Content Include="Web.Lua.config" />
<Content Include="Scripts\yavsc.admin.js" />
<Content Include="Views\FrontOffice\RestrictedArea.aspx" />
<Content Include="Views\Admin\RestrictedArea.aspx" />
@ -534,8 +517,6 @@
<Content Include="Views\FileSystem\RestrictedArea.aspx" />
<Content Include="Views\BackOffice\RestrictedArea.aspx" />
<Content Include="Views\Account\RestrictedArea.aspx" />
<Content Include="Web.TotemProd.config" />
<Content Include="Web.TotemPre.config" />
<Content Include="Views\FrontOffice\Booking.aspx" />
<Content Include="Views\FrontOffice\EavyBooking.aspx" />
<Content Include="App_Themes\blue\style.tablesorter.css" />
@ -544,6 +525,12 @@
<Content Include="Views\FrontOffice\Activity.ascx" />
<Content Include="Views\BackOffice\NotifyEventResponse.aspx" />
<Content Include="Views\BackOffice\NotifyEvent.aspx" />
<Content Include="Views\FrontOffice\Performer.ascx" />
<Content Include="App_Themes\images\p8-av4.jpg" />
<Content Include="App_Themes\images\p8-av4.xs.jpg" />
<Content Include="App_Themes\images\p8-av4.l.jpg" />
<Content Include="Views\Home\Activity.ascx" />
<Content Include="Views\FrontOffice\Performers.aspx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
@ -572,11 +559,17 @@
</None>
<None Include="fonts\fontawesome-webfont.woff2" />
<None Include="lib\MarkdownDeep.dll" />
<None Include="App_Code\Sql\Skills.sql" />
<None Include="WebDeploy.targets" />
<None Include="WebTasks.dll" />
<None Include="App_Code\Sql\MEA.sql" />
<None Include="App_Code\Sql\activity.sql" />
<None Include="Web.Debug.config">
<Gettext-ScanForTranslations>False</Gettext-ScanForTranslations>
</None>
<None Include="Web.Lua.config" />
<None Include="Web.Release.config" />
<None Include="Web.TotemPre.config" />
<None Include="Web.TotemProd.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj">

Binary file not shown.