").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/web/uninstdb.sql b/web/uninstdb.sql
deleted file mode 100644
index 8537c0c0..00000000
--- a/web/uninstdb.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-
- DROP TABLE hr;
- DROP TABLE taskdeps;
- DROP TABLE tasks;
- DROP TABLE projet;
-
diff --git a/yavscModel/Google/AuthToken.cs b/yavscModel/Google/AuthToken.cs
new file mode 100644
index 00000000..7df2e9c9
--- /dev/null
+++ b/yavscModel/Google/AuthToken.cs
@@ -0,0 +1,64 @@
+//
+// GoogleAuthToken.cs
+//
+// Author:
+// Paul Schneider
+//
+// Copyright (c) 2014 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 .
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Threading;
+using System.Web.Mvc;
+using System.Configuration;
+using System.Threading.Tasks;
+using System.Text;
+using System.Net;
+using System.IO;
+using Yavsc.Model;
+
+namespace Yavsc.Model.Google
+{
+ /*
+ "url": "https://plus.google.com/111395572362177872801",
+ "image": {
+ "url": "https://lh6.googleusercontent.com/-JqDVMPqafdA/AAAAAAAAAAI/AAAAAAAAADY/FamseW6_nl4/photo.jpg?sz=50",
+ "isDefault": false
+ },
+ "placesLived": [
+ {
+ "value": "Suresnes, France",
+ "primary": true
+ }
+ ],
+ "isPlusUser": true,
+ "language": "fr",
+ "circledByCount": 0,
+ "verified": false
+}
+*/
+
+ public class AuthToken {
+ public string access_token { get; set; }
+ public string id_token { get; set; }
+ public int expires_in { get; set; }
+ public string token_type { get; set ; }
+ public string refresh_token { get; set; }
+ }
+
+}
diff --git a/yavscModel/Google/People.cs b/yavscModel/Google/People.cs
new file mode 100644
index 00000000..0064c674
--- /dev/null
+++ b/yavscModel/Google/People.cs
@@ -0,0 +1,70 @@
+//
+// People.cs
+//
+// Author:
+// Paul Schneider
+//
+// Copyright (c) 2014 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 .
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Threading;
+using System.Web.Mvc;
+using System.Configuration;
+using System.Threading.Tasks;
+using System.Text;
+using System.Net;
+using System.IO;
+using Yavsc.Model;
+
+namespace Yavsc.Model.Google
+{
+ public class People {
+ public string kind { get; set; }
+ public string etag { get; set; }
+ public string gender { get; set; }
+ public class EMail{
+ public string value { get; set; }
+ public string type { get; set; }
+ }
+ public EMail[] emails { get; set; }
+ public string objectType { get; set; }
+ public string id { get; set; }
+ public string displayName { get; set; }
+ public class Name {
+ public string familyName { get; set; }
+ public string givenName { get; set; }
+ }
+ public Name name { get; set;}
+ public string url { get; set; }
+ public class Image {
+ public string url { get; set; }
+ public bool isDefault { get; set; }
+ }
+ public Image image { get; set; }
+ public class Place {
+ public string value { get; set; }
+ public bool primary { get; set; }
+ }
+ public Place[] placesLived { get; set; }
+ public bool isPlusUser { get; set; }
+ public string language { get; set; }
+ public int circledByCount { get; set; }
+ public bool verified { get; set; }
+ }
+}
diff --git a/yavscModel/Google/SignIn.cs b/yavscModel/Google/SignIn.cs
new file mode 100644
index 00000000..e16f417f
--- /dev/null
+++ b/yavscModel/Google/SignIn.cs
@@ -0,0 +1,35 @@
+//
+// SignIn.cs
+//
+// Author:
+// Paul Schneider
+//
+// Copyright (c) 2014 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 .
+using System;
+
+namespace Yavsc.Model.Google
+{
+ public class SignIn
+ {
+ public string UserName { get; set; }
+ public string Email { get; set; }
+
+ public SignIn ()
+ {
+ }
+ }
+}
+
diff --git a/yavscModel/IModule.cs b/yavscModel/IModule.cs
index 56bb83cc..926b71b4 100644
--- a/yavscModel/IModule.cs
+++ b/yavscModel/IModule.cs
@@ -2,6 +2,7 @@
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
+using System.Web.Mvc;
namespace Yavsc.Model
{
@@ -19,18 +20,14 @@ namespace Yavsc.Model
/// Cnx.
/// If set to true remove config.
void Uninstall(IDbConnection cnx,bool removeConfig);
- ConfigurationSection DefaultConfig (string appName, string cnxStr);
- ///
- /// Gets or sets a value indicating whether this is active.
- ///
- /// true if active; otherwise, false.
- bool Active { get; set; }
- ///
- /// Gets or sets the name of the application.
- ///
- /// The name of the application.
- string ApplicationName { get; set; }
void Initialize (string name, NameValueCollection config);
}
+ public interface IRenderer {
+ // Should set ViewData["Message|Author|Body"]
+ object Get(Controller c);
+ string Template { get; }
+ string Name { get; set; }
+ }
+
}
diff --git a/yavscModel/LocalizedText.Designer.cs b/yavscModel/LocalizedText.Designer.cs
index b7e8e7c4..baa89e11 100644
--- a/yavscModel/LocalizedText.Designer.cs
+++ b/yavscModel/LocalizedText.Designer.cs
@@ -112,6 +112,12 @@ namespace Yavsc.Model {
}
}
+ public static string UserName {
+ get {
+ return ResourceManager.GetString("UserName", resourceCulture);
+ }
+ }
+
public static string Offline {
get {
return ResourceManager.GetString("Offline", resourceCulture);
diff --git a/yavscModel/LocalizedText.fr.resx b/yavscModel/LocalizedText.fr.resx
index 285ce6c5..69136599 100644
--- a/yavscModel/LocalizedText.fr.resx
+++ b/yavscModel/LocalizedText.fr.resx
@@ -32,4 +32,5 @@
Nom d'utilisateurErreur Google : {0}Accès refusé
+ Nom d'utilisateur
diff --git a/yavscModel/LocalizedText.resx b/yavscModel/LocalizedText.resx
index 9cd9d28a..8a5c9a34 100644
--- a/yavscModel/LocalizedText.resx
+++ b/yavscModel/LocalizedText.resx
@@ -32,4 +32,5 @@
User nameGoogle error : {0}Access denied
+ User name
diff --git a/yavscModel/RolesAndMemebers/Profile.cs b/yavscModel/RolesAndMemebers/Profile.cs
index 68a56652..01d29488 100644
--- a/yavscModel/RolesAndMemebers/Profile.cs
+++ b/yavscModel/RolesAndMemebers/Profile.cs
@@ -12,6 +12,9 @@ namespace Yavsc.Model.RolesAndMembers
[StringLength (1024)]
public string Name { get; set; }
+ [DisplayName("Avatar")]
+ public string avatar { get; set; }
+
[DisplayName ("Adresse")]
[StringLength (2047)]
public string Address { get; set; }
@@ -75,6 +78,9 @@ namespace Yavsc.Model.RolesAndMembers
[DisplayName ("Clé RIB")]
public int BankedKey { get; set; }
+ [Display(Name="Google Calendar")]
+ public string GoogleCalendar { get; set; }
+
public bool IsBankable { get {
return IsBillable
&& !string.IsNullOrWhiteSpace (BankCode)
@@ -108,6 +114,9 @@ namespace Yavsc.Model.RolesAndMembers
object s = profile.GetPropertyValue ("BlogTitle");
BlogTitle = (s is DBNull) ? null : (string)s;
+
+ s = profile.GetPropertyValue ("avatar");
+ avatar = (s is DBNull) ? null : (string)s;
s = profile.GetPropertyValue ("Address");
Address = (s is DBNull) ? null : (string)s;
diff --git a/yavscModel/RolesAndMemebers/RegisterViewModel.cs b/yavscModel/RolesAndMemebers/RegisterViewModel.cs
index 2bb37193..004d1030 100644
--- a/yavscModel/RolesAndMemebers/RegisterViewModel.cs
+++ b/yavscModel/RolesAndMemebers/RegisterViewModel.cs
@@ -7,7 +7,6 @@ namespace Yavsc.Model.RolesAndMembers
public class RegisterViewModel
{
[Localizable(true)]
- [Display(Name="User name")]
[Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur")]
public string UserName { get; set; }
diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs
index 21448b37..b5f2a550 100644
--- a/yavscModel/WorkFlow/WorkFlowManager.cs
+++ b/yavscModel/WorkFlow/WorkFlowManager.cs
@@ -12,44 +12,41 @@ namespace Yavsc.Model.WorkFlow
/// It takes orders store them and raise some events for modules
/// It publishes estimates and invoices
///
- public static class WorkFlowManager
+ public class WorkFlowManager
{
public static Catalog Catalog { get; set; }
-
- public static void UpdateEstimate (Estimate estim)
+ public void UpdateEstimate (Estimate estim)
{
ContentProvider.UpdateEstimate (estim);
}
- public static event EventHandler NewOrder;
-
- public static Estimate GetEstimate (long estid)
+ public Estimate GetEstimate (long estid)
{
return ContentProvider.GetEstimate (estid);
}
- public static Estimate [] GetEstimates (string client)
+ public Estimate [] GetEstimates (string client)
{
return ContentProvider.GetEstimates (client);
}
- public static void UpdateWritting (Writting wr)
+ public void UpdateWritting (Writting wr)
{
ContentProvider.UpdateWritting (wr);
}
- public static void DropWritting (long wrid)
+ public void DropWritting (long wrid)
{
ContentProvider.DropWritting (wrid);
}
- public static void DropEstimate (long estid)
+ public void DropEstimate (long estid)
{
ContentProvider.DropEstimate(estid);
}
- static IContentProvider contentProvider;
+ IContentProvider contentProvider;
- public static IContentProvider ContentProvider {
+ public IContentProvider ContentProvider {
get {
WorkflowConfiguration c = (WorkflowConfiguration) ConfigurationManager.GetSection ("system.web/workflow");
if (c == null)
@@ -75,8 +72,6 @@ namespace Yavsc.Model.WorkFlow
System.Reflection.ConstructorInfo ci =cpt.GetConstructor (System.Type.EmptyTypes);
contentProvider = (IContentProvider)ci.Invoke (System.Type.EmptyTypes);
}
-
- contentProvider.ApplicationName = confprov.ApplicationName;
NameValueCollection config = new NameValueCollection ();
config.Add ("name", confprov.Name);
@@ -96,15 +91,13 @@ namespace Yavsc.Model.WorkFlow
/// The estimate identifier.
/// Title.
- public static Estimate CreateEstimate(string responsible, string client, string title, string description)
+ public Estimate CreateEstimate(string responsible, string client, string title, string description)
{
Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
- if (NewOrder != null)
- NewOrder.Invoke(ContentProvider, new NewEstimateEvenArgs(created));
return created;
}
- public static long Write(long estid, string desc, decimal ucost, int count, string productid)
+ public long Write(long estid, string desc, decimal ucost, int count, string productid)
{
if (!string.IsNullOrWhiteSpace(productid)) {
if (Catalog == null)
@@ -112,12 +105,14 @@ namespace Yavsc.Model.WorkFlow
if (Catalog == null)
throw new Exception ("No catalog");
Product p = Catalog.FindProduct (productid);
+ if (p == null)
+ throw new Exception ("Product not found");
// TODO new EstimateChange Event
}
return ContentProvider.Write(estid, desc, ucost, count, productid);
}
- public static void SetEstimateStatus(long estid, int status, string username)
+ public void SetEstimateStatus(long estid, int status, string username)
{
ContentProvider.SetEstimateStatus (estid, status, username);
}
diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj
index 4ca0b192..4feebf2d 100644
--- a/yavscModel/YavscModel.csproj
+++ b/yavscModel/YavscModel.csproj
@@ -9,6 +9,7 @@
LibraryYavsc.ModelYavscModel
+ v4.5true
@@ -32,10 +33,10 @@
-
+
@@ -84,6 +85,9 @@
LocalizedText.resx
+
+
+
@@ -92,6 +96,7 @@
+
diff --git a/yavscclient/YavscClient.csproj b/yavscclient/YavscClient.csproj
index eb79ad88..7be9a7e8 100644
--- a/yavscclient/YavscClient.csproj
+++ b/yavscclient/YavscClient.csproj
@@ -37,7 +37,6 @@
..\..\..\..\..\usr\lib\mono\4.5\System.Net.Http.Formatting.dll
- False