diff --git a/Site5/App_Code/DataV5Base.cs b/Site5/App_Code/DataV5Base.cs index 96563af5..48c14920 100644 --- a/Site5/App_Code/DataV5Base.cs +++ b/Site5/App_Code/DataV5Base.cs @@ -155,4 +155,9 @@ public class DataV5Base : Page { return input.Replace ("\"", "\\\"").Replace (" ", " ").Trim(); } + + public string JavascriptEscape(string input) + { + return CommonV5.JavascriptEscape(input); + } } \ No newline at end of file diff --git a/Site5/App_GlobalResources/Controls.Swarm.resx b/Site5/App_GlobalResources/Controls.Swarm.resx new file mode 100644 index 00000000..8378319c --- /dev/null +++ b/Site5/App_GlobalResources/Controls.Swarm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Assignment duration (extendable) + + + Expires + The date a position assignment autoterminates + + + Assign one more person... + To an existing position that accepts multiple people (like "assistants") + + + Assign person... + + + Assign this person to position + + + Assign person as <span id='{0}_modalPositionName'>...</span> + Header for new assignment dialog + + + (vacant) + For unassigned positions + + \ No newline at end of file diff --git a/Site5/App_GlobalResources/Global.resx b/Site5/App_GlobalResources/Global.resx index e67f9461..bd507fe0 100644 --- a/Site5/App_GlobalResources/Global.resx +++ b/Site5/App_GlobalResources/Global.resx @@ -572,10 +572,6 @@ Year {0} As in "the year X". - - (vacant) - For unassigned positions - define to enable shown as watermark on some edit boxes @@ -681,17 +677,6 @@ Assigned Person - - Expires - The date a position assignment autoterminates - - - Assign one more person... - To an existing position that accepts multiple people (like "assistants") - - - Assign person... - Position diff --git a/Site5/Automation/Json-PositionsTree.aspx.cs b/Site5/Automation/Json-PositionsTree.aspx.cs index b7321884..a4d1e879 100644 --- a/Site5/Automation/Json-PositionsTree.aspx.cs +++ b/Site5/Automation/Json-PositionsTree.aspx.cs @@ -18,6 +18,7 @@ namespace Swarmops.Frontend.Automation // If level if system-wide, execute this block. Also, move the data to the real place, please JsonPositions rootPositions = new JsonPositions(); + _customCookieClass = Request["CustomCookie"]; // may be null and that's ok Tree systemPositions = Positions.ForSystem().Tree; @@ -42,7 +43,7 @@ namespace Swarmops.Frontend.Automation PositionAssignments assignments = position.Assignments; string expires = string.Empty; - string assignedName = Resources.Global.Swarm_Vacant + " " + Resources.Global.Swarm_AssignPerson + "" ; + string assignedName = string.Format("{0} {2}", Resources.Controls.Swarm.Positions_Vacant, _customCookieClass, Resources.Controls.Swarm.Positions_AssignPerson, position.Identity, JavascriptEscape(position.Localized())); if (assignments.Count > 0) { @@ -86,8 +87,11 @@ namespace Swarmops.Frontend.Automation // finally, if the assigned count is less than max count, add a "assign another person" link elements.Add ("{" + element + "}"); - string addPerson = "" + - Resources.Global.Swarm_AssignMorePerson + ""; + string addPerson = + string.Format ( + "{0}", + Resources.Controls.Swarm.Positions_AssignMorePerson, position.Identity, + JavascriptEscape (position.Localized()), _customCookieClass); element = String.Format( @@ -107,6 +111,8 @@ namespace Swarmops.Frontend.Automation return "[" + String.Join(",", elements.ToArray()) + "]"; } + private string _customCookieClass; + private class JsonPosition { public JsonPosition() diff --git a/Site5/Controls/v5/Swarm/ComboPeople.ascx b/Site5/Controls/v5/Swarm/ComboPeople.ascx index 0bfff9af..658c3cea 100644 --- a/Site5/Controls/v5/Swarm/ComboPeople.ascx +++ b/Site5/Controls/v5/Swarm/ComboPeople.ascx @@ -116,6 +116,10 @@ $('span#<%= this.ClientID %>_SpanPeople span input.textbox-text').animate({ backgroundColor: "#FFFFFF" }, 250); } + function <%=this.ClientID %>_clear() { + <%=this.ClientID%>_val(''); + <%=this.ClientID%>_avatarUrl(''); + } diff --git a/Site5/Controls/v5/Swarm/TreePositions.ascx b/Site5/Controls/v5/Swarm/TreePositions.ascx index 899ac35f..bf11a987 100644 --- a/Site5/Controls/v5/Swarm/TreePositions.ascx +++ b/Site5/Controls/v5/Swarm/TreePositions.ascx @@ -10,14 +10,23 @@ onLoadSuccess: function () { $('.LocalAssignPerson').click(function () { - <%= this.DropPerson.ClientID%>_val(''); + currentPosition = $(this).attr("positionId"); + $('#<%= this.ClientID %>_modalPositionName').text(decodeURIComponent($(this).attr("positionName"))); + <%= this.DropPerson.ClientID%>_clear(); <%= this.DialogAdd.ClientID %>_open(); }); } + + // TODO: RowStyler }); + $('#<%=this.ClientID%>_buttonAssign').click(function() { + alert("foo!"); + }); + }); + var currentPosition = ''; @@ -41,15 +50,15 @@ -

Assigning to ASDSADASDASDASD

+

​
​
- +
\ No newline at end of file diff --git a/Site5/Controls/v5/Swarm/TreePositions.ascx.cs b/Site5/Controls/v5/Swarm/TreePositions.ascx.cs index 6d29668b..1f9d39b1 100644 --- a/Site5/Controls/v5/Swarm/TreePositions.ascx.cs +++ b/Site5/Controls/v5/Swarm/TreePositions.ascx.cs @@ -27,9 +27,13 @@ namespace Swarmops.Frontend.Controls.v5.Swarm this.LiteralHeaderAction.Text = Resources.Global.Global_Action; this.LiteralHeaderName.Text = Resources.Global.Swarm_AssignedPerson; this.LiteralHeaderPosition.Text = Resources.Global.Swarm_Position; - this.LiteralHeaderExpires.Text = Resources.Global.Swarm_AssignmentExpires; + this.LiteralHeaderExpires.Text = Resources.Controls.Swarm.Positions_AssignmentExpires; this.LiteralHeaderMinMax.Text = Resources.Global.Global_MinMax; + this.LabelAssignPersonTo.Text = Resources.Controls.Swarm.Positions_AssignPersonToPosition; + this.LabelAssignmentDuration.Text = Resources.Controls.Swarm.Positions_AssignmentDuration; + this.LabelModalHeader.Text = String.Format (Resources.Controls.Swarm.Positions_ModalHeader, this.ClientID); + this.DropDuration.Items.Add (new ListItem(Resources.Global.Timespan_Selection_OneMonth, "1")); this.DropDuration.Items.Add(new ListItem(Resources.Global.Timespan_Selection_TwoMonths, "2")); this.DropDuration.Items.Add(new ListItem(Resources.Global.Timespan_Selection_ThreeMonths, "3"));