Yet more work on Positions
This commit is contained in:
+117
@@ -69,6 +69,24 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Secretary General Assistant.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_CeoAssistant_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_CeoAssistant_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Secretary General Assistants.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_CeoAssistant_Nonprofit_Plural {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_CeoAssistant_Nonprofit_Plural", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to CEO Assistants.
|
||||
/// </summary>
|
||||
@@ -87,6 +105,24 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Financial Assistant.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_CfoAssistant_Nonprofict {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_CfoAssistant_Nonprofict", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Financial Assistants.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_CfoAssistant_Nonprofit_Plural {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_CfoAssistant_Nonprofit_Plural", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to CFO Assistants.
|
||||
/// </summary>
|
||||
@@ -105,6 +141,15 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Secretary General.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_ChiefExecutiveOfficer_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_ChiefExecutiveOfficer_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Financial Officer.
|
||||
/// </summary>
|
||||
@@ -114,6 +159,15 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Treasurer.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_ChiefFinancialOfficer_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_ChiefFinancialOfficer_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Human Resources Officer.
|
||||
/// </summary>
|
||||
@@ -123,6 +177,15 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Community Officer.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_ChiefHrOfficer_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_ChiefHrOfficer_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Information Officer.
|
||||
/// </summary>
|
||||
@@ -141,6 +204,15 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Outreach Officer.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_ChiefMarketingOfficer_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_ChiefMarketingOfficer_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Operations Officer.
|
||||
/// </summary>
|
||||
@@ -150,6 +222,15 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief Activism Officer.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_ChiefOperationsOfficer_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_ChiefOperationsOfficer_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chief of Staff.
|
||||
/// </summary>
|
||||
@@ -177,6 +258,24 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Community Assistant.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_HrAssistant_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_HrAssistant_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Community Assistants.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_HrAssistant_Nonprofit_Plural {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_HrAssistant_Nonprofit_Plural", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Human Resources Assistants.
|
||||
/// </summary>
|
||||
@@ -195,6 +294,24 @@ namespace Swarmops.Logic.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Outreach Assistant.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_MarketingAssistant_Nonprofit {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_MarketingAssistant_Nonprofit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Outreach Assistants.
|
||||
/// </summary>
|
||||
internal static string Position_Executive_MarketingAssistant_Nonprofit_Plural {
|
||||
get {
|
||||
return ResourceManager.GetString("Position_Executive_MarketingAssistant_Nonprofit_Plural", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Marketing Assistants.
|
||||
/// </summary>
|
||||
|
||||
@@ -120,33 +120,60 @@
|
||||
<data name="Position_Executive_CeoAssistant" xml:space="preserve">
|
||||
<value>CEO Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CeoAssistant_Nonprofit" xml:space="preserve">
|
||||
<value>Secretary General Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CeoAssistant_Nonprofit_Plural" xml:space="preserve">
|
||||
<value>Secretary General Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CeoAssistant_Plural" xml:space="preserve">
|
||||
<value>CEO Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CfoAssistant" xml:space="preserve">
|
||||
<value>CFO Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CfoAssistant_Nonprofict" xml:space="preserve">
|
||||
<value>Financial Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CfoAssistant_Nonprofit_Plural" xml:space="preserve">
|
||||
<value>Financial Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_CfoAssistant_Plural" xml:space="preserve">
|
||||
<value>CFO Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefExecutiveOfficer" xml:space="preserve">
|
||||
<value>Chief Executive Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefExecutiveOfficer_Nonprofit" xml:space="preserve">
|
||||
<value>Secretary General</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefFinancialOfficer" xml:space="preserve">
|
||||
<value>Chief Financial Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefFinancialOfficer_Nonprofit" xml:space="preserve">
|
||||
<value>Treasurer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefHrOfficer" xml:space="preserve">
|
||||
<value>Chief Human Resources Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefHrOfficer_Nonprofit" xml:space="preserve">
|
||||
<value>Chief Community Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefInformationOfficer" xml:space="preserve">
|
||||
<value>Chief Information Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefMarketingOfficer" xml:space="preserve">
|
||||
<value>Chief Marketing Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefMarketingOfficer_Nonprofit" xml:space="preserve">
|
||||
<value>Chief Outreach Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefOperationsOfficer" xml:space="preserve">
|
||||
<value>Chief Operations Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefOperationsOfficer_Nonprofit" xml:space="preserve">
|
||||
<value>Chief Activism Officer</value>
|
||||
</data>
|
||||
<data name="Position_Executive_ChiefStaff" xml:space="preserve">
|
||||
<value>Chief of Staff</value>
|
||||
</data>
|
||||
@@ -156,12 +183,24 @@
|
||||
<data name="Position_Executive_HrAssistant" xml:space="preserve">
|
||||
<value>Human Resources Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_HrAssistant_Nonprofit" xml:space="preserve">
|
||||
<value>Community Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_HrAssistant_Nonprofit_Plural" xml:space="preserve">
|
||||
<value>Community Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_HrAssistant_Plural" xml:space="preserve">
|
||||
<value>Human Resources Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_MarketingAssistant" xml:space="preserve">
|
||||
<value>Marketing Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_MarketingAssistant_Nonprofit" xml:space="preserve">
|
||||
<value>Outreach Assistant</value>
|
||||
</data>
|
||||
<data name="Position_Executive_MarketingAssistant_Nonprofit_Plural" xml:space="preserve">
|
||||
<value>Outreach Assistants</value>
|
||||
</data>
|
||||
<data name="Position_Executive_MarketingAssistant_Plural" xml:space="preserve">
|
||||
<value>Marketing Assistants</value>
|
||||
</data>
|
||||
|
||||
+3
-12
@@ -89,25 +89,16 @@ namespace Swarmops.Logic.Swarm
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PositionAssignment Assign (Person person, Organization organization, Geography geography,
|
||||
Person assignedByPerson, Position assignedByPosition, string assignmentNotes, DateTime? expiresUtc)
|
||||
public PositionAssignment Assign(Person person, Geography geography, Person assignedByPerson, Position assignedByPosition, string assignmentNotes, DateTime? expiresUtc)
|
||||
{
|
||||
return PositionAssignment.Create (organization, geography, this, person, assignedByPerson,
|
||||
assignedByPosition, expiresUtc, assignmentNotes);
|
||||
}
|
||||
|
||||
public PositionAssignment Assign(Person person, Geography geography, Person assignedByPerson, Position assignedByPosition,
|
||||
string assignmentNotes, DateTime? expiresUtc)
|
||||
{
|
||||
return PositionAssignment.Create(this.Organization, geography, this, person, assignedByPerson,
|
||||
return PositionAssignment.Create (this, geography, person, assignedByPerson,
|
||||
assignedByPosition, expiresUtc, assignmentNotes);
|
||||
}
|
||||
|
||||
public PositionAssignment Assign(Person person, Person assignedByPerson, Position assignedByPosition,
|
||||
string assignmentNotes, DateTime? expiresUtc)
|
||||
{
|
||||
return PositionAssignment.Create(this.Organization, this.Geography, this, person, assignedByPerson,
|
||||
return PositionAssignment.Create(this, null, person, assignedByPerson,
|
||||
assignedByPosition, expiresUtc, assignmentNotes);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,27 +51,10 @@ namespace Swarmops.Logic.Swarm
|
||||
get { return Position.FromIdentity (base.PositionId); }
|
||||
}
|
||||
|
||||
public static PositionAssignment Create (Organization organization, Geography geography, Position position,
|
||||
public static PositionAssignment Create(Position position, Geography geography,
|
||||
Person person, Person createdByPerson, Position createdByPosition, DateTime? expiresDateTimeUtc,
|
||||
string assignmentNotes)
|
||||
{
|
||||
int organizationId = 0;
|
||||
|
||||
if (position.PositionLevel != PositionLevel.OrganizationWideDefaultUnused &&
|
||||
position.PositionLevel != PositionLevel.SystemWide)
|
||||
{
|
||||
organizationId = organization.Identity; // can't be null in these cases
|
||||
}
|
||||
else
|
||||
{
|
||||
if (organization != null)
|
||||
{
|
||||
// MUST be null in these cases
|
||||
|
||||
throw new ArgumentException ("Organization cannot be defined when position is systemwide");
|
||||
}
|
||||
}
|
||||
|
||||
int geographyId = 0;
|
||||
|
||||
if (position.PositionLevel == PositionLevel.Geography)
|
||||
@@ -92,7 +75,7 @@ namespace Swarmops.Logic.Swarm
|
||||
// TODO: Verify constraints of max/min counts for position
|
||||
|
||||
int positionAssignmentId = SwarmDb.GetDatabaseForWriting()
|
||||
.CreatePositionAssignment (organizationId, geographyId, position.Identity, person.Identity,
|
||||
.CreatePositionAssignment (position.OrganizationId, geographyId, position.Identity, person.Identity,
|
||||
createdByPersonId, createdByPositionId,
|
||||
expiresDateTimeUtc == null ? DateTime.MaxValue : (DateTime) expiresDateTimeUtc, assignmentNotes);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace Swarmops.Logic.Swarm
|
||||
PositionType.Geographic_Deputy, titleType, true, false, localLeader, null, 1, 0);
|
||||
|
||||
/*Position localAssistants =*/ Position.Create(organization, PositionLevel.GeographyDefault, null, null,
|
||||
PositionType.Geographic_Assistant, titleType, false, false, localLeader, null, 1, 0);
|
||||
PositionType.Geographic_Assistant, titleType, false, false, localLeader, null, 0, 0);
|
||||
|
||||
Position localOutreachLead = Position.Create(organization, PositionLevel.GeographyDefault, null, null,
|
||||
PositionType.Geographic_OutreachLeader, titleType, true, true, localLeader, cmo, 0, 1);
|
||||
|
||||
@@ -187,4 +187,10 @@
|
||||
<data name="Positions_TerminateYes" xml:space="preserve">
|
||||
<value>Terminate Assignment</value>
|
||||
</data>
|
||||
<data name="Positions_AssignElsewhere" xml:space="preserve">
|
||||
<value>(assign under My Organization)</value>
|
||||
</data>
|
||||
<data name="Positions_CreatePosition" xml:space="preserve">
|
||||
<value>Create new position...</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -200,6 +200,23 @@
|
||||
<data name="EditOrganization_VanityDomain" xml:space="preserve">
|
||||
<value>Organization Vanity Domain</value>
|
||||
</data>
|
||||
<data name="OrgStaffing_Header_ExecutivePositions" xml:space="preserve">
|
||||
<value>Executive Positions For {0}</value>
|
||||
<comment>The {0} is the org name.</comment>
|
||||
</data>
|
||||
<data name="OrgStaffing_Header_LocalDefaultPositions" xml:space="preserve">
|
||||
<value>Local Builder Positions (At Every Geography)</value>
|
||||
</data>
|
||||
<data name="OrgStaffing_Header_Payroll" xml:space="preserve">
|
||||
<value>Staff Payroll</value>
|
||||
</data>
|
||||
<data name="OrgStaffing_Header_StrategicPositions" xml:space="preserve">
|
||||
<value>Strategic Positions For {0}</value>
|
||||
<comment>The {0} is the org name.</comment>
|
||||
</data>
|
||||
<data name="OrgStaffing_Header_WaitingVolunteers" xml:space="preserve">
|
||||
<value>Volunteers Awating Response</value>
|
||||
</data>
|
||||
<data name="SystemSettings_AdminAddress" xml:space="preserve">
|
||||
<value>Admin Notifications From Address</value>
|
||||
</data>
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Globalization;
|
||||
using Swarmops.Common.Enums;
|
||||
using Swarmops.Common.Generics;
|
||||
using Swarmops.Logic.Financial;
|
||||
using Swarmops.Logic.Security;
|
||||
using Swarmops.Logic.Structure;
|
||||
using Swarmops.Logic.Swarm;
|
||||
|
||||
@@ -25,6 +26,12 @@ namespace Swarmops.Frontend.Automation
|
||||
if (level == PositionLevel.SystemWide)
|
||||
{
|
||||
Tree<Position> systemPositions = Positions.ForSystem().Tree;
|
||||
|
||||
if (CurrentAuthority.HasSystemAccess())
|
||||
{
|
||||
_assignable = true;
|
||||
}
|
||||
|
||||
Response.Output.WriteLine (RecursePositionTree (systemPositions.RootNodes));
|
||||
Response.End();
|
||||
return;
|
||||
@@ -42,6 +49,11 @@ namespace Swarmops.Frontend.Automation
|
||||
throw new InvalidOperationException("Positions are not initialized or are missing.");
|
||||
}
|
||||
|
||||
if (CurrentAuthority.HasAccess (new Access (CurrentOrganization, AccessAspect.Administration)))
|
||||
{
|
||||
_assignable = true;
|
||||
}
|
||||
|
||||
Response.Output.WriteLine(RecursePositionTree(orgStrategicPositions.Tree.RootNodes));
|
||||
}
|
||||
|
||||
@@ -55,6 +67,12 @@ namespace Swarmops.Frontend.Automation
|
||||
throw new InvalidOperationException("Positions are not initialized or are missing.");
|
||||
}
|
||||
|
||||
if (CurrentAuthority.HasAccess(new Access(CurrentOrganization, AccessAspect.Administration)) ||
|
||||
CurrentAuthority.HasAccess (new Access (CurrentOrganization, Geography.Root, AccessAspect.Administration)))
|
||||
{
|
||||
_assignable = true;
|
||||
}
|
||||
|
||||
Response.Output.WriteLine(RecursePositionTree(orgExecutivePositions.Tree.RootNodes));
|
||||
|
||||
}
|
||||
@@ -92,7 +110,17 @@ namespace Swarmops.Frontend.Automation
|
||||
|
||||
string expires = string.Empty;
|
||||
string action = string.Empty;
|
||||
string assignedName = string.Format("<a positionId='{3}' positionName='{4}' class='{1} LocalAssignPerson'>{2}</a> {0}", Resources.Controls.Swarm.Positions_Vacant, _customCookieClass, Resources.Controls.Swarm.Positions_AssignFirstPerson, position.Identity, JavascriptEscape(position.Localized()));
|
||||
string assignedName = Resources.Controls.Swarm.Positions_Vacant;
|
||||
|
||||
if (_assignable)
|
||||
{
|
||||
assignedName =
|
||||
string.Format (
|
||||
"<a positionId='{3}' positionName='{4}' class='{1} LocalAssignPerson'>{2}</a> {0}",
|
||||
Resources.Controls.Swarm.Positions_Vacant, _customCookieClass,
|
||||
Resources.Controls.Swarm.Positions_AssignFirstPerson, position.Identity,
|
||||
JavascriptEscape (position.Localized()));
|
||||
}
|
||||
|
||||
if (localizedPositionName == null)
|
||||
{
|
||||
@@ -107,7 +135,14 @@ namespace Swarmops.Frontend.Automation
|
||||
{
|
||||
expires = assignments[0].ExpiresDateTimeUtc.ToString("yyyy-MMM-dd");
|
||||
}
|
||||
action = String.Format("<img class='LocalIconTerminate {1}' height='18' width='24' {2} assignmentId='{0}' />", assignments[0].Identity, _customCookieClass, assignments[0].PersonId == CurrentUser.Identity? "self='true'": string.Empty);
|
||||
if (_assignable)
|
||||
{
|
||||
action =
|
||||
String.Format (
|
||||
"<img class='LocalIconTerminate {1}' height='18' width='24' {2} assignmentId='{0}' />",
|
||||
assignments[0].Identity, _customCookieClass,
|
||||
assignments[0].PersonId == CurrentUser.Identity ? "self='true'" : string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
string element = string.Format("\"id\":\"{0}-1\",\"positionTitle\":\"{1}\",\"assignedName\":\"{2}\",\"expires\":\"{3}\",\"minMax\":\"{4} / {5}\",\"iconType\":\"{6}\",\"actions\":\"{7}\"",
|
||||
@@ -127,7 +162,14 @@ namespace Swarmops.Frontend.Automation
|
||||
elements.Add ("{" + element + "}");
|
||||
|
||||
expires = string.Empty;
|
||||
action = String.Format("<img class='LocalIconTerminate {1}' height='18' width='24' {2} assignmentId='{0}' />", assignments[assignmentCount].Identity, _customCookieClass, assignments[0].PersonId == CurrentUser.Identity ? "self='true'" : string.Empty);
|
||||
if (_assignable)
|
||||
{
|
||||
action =
|
||||
String.Format (
|
||||
"<img class='LocalIconTerminate {1}' height='18' width='24' {2} assignmentId='{0}' />",
|
||||
assignments[assignmentCount].Identity, _customCookieClass,
|
||||
assignments[0].PersonId == CurrentUser.Identity ? "self='true'" : string.Empty);
|
||||
}
|
||||
|
||||
int expireYear = assignments[assignmentCount].ExpiresDateTimeUtc.Year;
|
||||
if (expireYear > 2000 && expireYear < 3000) // as in, "is defined"
|
||||
@@ -142,9 +184,9 @@ namespace Swarmops.Frontend.Automation
|
||||
assignmentCount++;
|
||||
}
|
||||
|
||||
if (assignmentCount < position.MaxCount || (position.MaxCount == 0 && position.Assignments.Count > 0))
|
||||
if (_assignable && (assignmentCount < position.MaxCount || (position.MaxCount == 0 && position.Assignments.Count > 0)))
|
||||
{
|
||||
// finally, if the assigned count is less than max count, add a "assign another person" link
|
||||
// finally, if the assigned count is less than max count, add a "assign another person" link if _assignable is true
|
||||
|
||||
int count = position.Assignments.Count;
|
||||
if (count > 6)
|
||||
@@ -187,12 +229,9 @@ namespace Swarmops.Frontend.Automation
|
||||
return "[" + String.Join(",", elements.ToArray()) + "]";
|
||||
}
|
||||
|
||||
private bool HasHiringFiringPrivileges (Position position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private string _customCookieClass;
|
||||
private bool _assignable = false; // TODO: Maybe make this more dynamic later
|
||||
|
||||
|
||||
private class JsonPosition
|
||||
{
|
||||
|
||||
@@ -21,12 +21,11 @@ namespace Swarmops.Frontend.Automation
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public static AjaxCallResult AssignPosition (int personId, int positionId, int durationMonths, int organizationId, int geographyId)
|
||||
public static AjaxCallResult AssignPosition (int personId, int positionId, int durationMonths, int geographyId)
|
||||
{
|
||||
AuthenticationData authData = GetAuthenticationDataAndCulture();
|
||||
Position position = Position.FromIdentity (positionId);
|
||||
Person person = Person.FromIdentity (personId);
|
||||
Organization organization = (organizationId == 0 ? null : Organization.FromIdentity (organizationId));
|
||||
Geography geography = (geographyId == 0 ? null : Geography.FromIdentity (geographyId));
|
||||
|
||||
if ((position.OrganizationId > 0 && authData.CurrentOrganization.Identity != position.OrganizationId) || person.Identity < 0)
|
||||
@@ -59,7 +58,7 @@ namespace Swarmops.Frontend.Automation
|
||||
|
||||
try
|
||||
{
|
||||
PositionAssignment.Create (organization, geography, position, person, authData.CurrentUser, currentUserPosition,
|
||||
PositionAssignment.Create (position, geography, person, authData.CurrentUser, currentUserPosition,
|
||||
expiresUtc, string.Empty);
|
||||
}
|
||||
catch (DatabaseConcurrencyException)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
onLoadSuccess: function () {
|
||||
$('.LocalAssignPerson.LocalPosition<%=this.Cookie%>').click(function () {
|
||||
currentPositionId = $(this).attr("positionId");
|
||||
current<%=this.Cookie%>PositionId = $(this).attr("positionId");
|
||||
$('#<%= this.ClientID %>_modalPositionName').text(decodeURIComponent($(this).attr("positionName")));
|
||||
<%= this.DropPerson.ClientID%>_clear();
|
||||
$('#<%= this.DropDuration.ClientID%>').val("12"); // reset to 12-month default
|
||||
@@ -78,7 +78,7 @@
|
||||
$.proxy(function(response) {
|
||||
if (response) {
|
||||
// user clicked the GREEN button, which is "confirm termination"
|
||||
onConfirmTermination($(this).attr("assignmentId"));
|
||||
onConfirmTermination<%=this.ClientID%>($(this).attr("assignmentId"));
|
||||
} else {
|
||||
// if cancel termination, restore icon from loader to action icon again
|
||||
$(this).attr("src", "/Images/Icons/iconshock-balloon-no-128x96px.png");
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
SwarmopsJS.ajaxCall(
|
||||
"/Automation/SwarmFunctions.aspx/AssignPosition",
|
||||
{ personId: personId, positionId: currentPositionId, durationMonths: $('#<%= this.DropDuration.ClientID%>').val(), organizationId: 0, geographyId: 0 },
|
||||
{ personId: personId, positionId: current<%=this.Cookie%>PositionId, durationMonths: $('#<%= this.DropDuration.ClientID%>').val(), geographyId: 0 },
|
||||
function (result) {
|
||||
// Close modal and reload grid regardless of success or not
|
||||
// (the only failure here should be a concurrency error, in which case
|
||||
@@ -138,11 +138,12 @@
|
||||
|
||||
});
|
||||
|
||||
function onConfirmTermination(assignmentId) {
|
||||
function onConfirmTermination<%=this.ClientID%> (assignmentId) {
|
||||
SwarmopsJS.ajaxCall("/Automation/SwarmFunctions.aspx/TerminatePositionAssignment",
|
||||
{ assignmentId: assignmentId },
|
||||
function(result) {
|
||||
function (result) {
|
||||
if (result.Success) {
|
||||
<%= this.DialogAdd.ClientID %>_close();
|
||||
$('#<%=this.ClientID%>_tablePositions').treegrid('reload');
|
||||
} else {
|
||||
alertify.error(result.DisplayMessage);
|
||||
@@ -150,7 +151,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var currentPositionId = '';
|
||||
var current<%=this.Cookie%>PositionId = '';
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -18,17 +18,25 @@
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
<div id="divTabs" class="easyui-tabs" data-options="tabWidth:70,tabHeight:70">
|
||||
<div title="<img src='/Images/Icons/iconshock-group-diversified-64px.png' />">
|
||||
<div title="<img src='/Images/Icons/iconshock-general-128px.png' width='64' height='64' />">
|
||||
<h2><asp:Label ID="LabelHeaderStrategic" runat="server" /></h2>
|
||||
<Swarmops5:TreePositions ID="TreePositionsStrategic" Level="OrganizationStrategic" runat="server" />
|
||||
<Swarmops5:TreePositions ID="TreePositionsStrategic" Level="OrganizationStrategic" Cookie="Strategic" runat="server" />
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-group-diversified-64px.png' />">
|
||||
<div title="<img src='/Images/Icons/iconshock-executive-128px.png' width='64' height='64' />">
|
||||
<h2><asp:Label ID="LabelHeaderExecutive" runat="server" /></h2>
|
||||
<Swarmops5:TreePositions ID="TreePositionsExecutive" Level="OrganizationExecutive" runat="server" />
|
||||
<Swarmops5:TreePositions ID="TreePositionsExecutive" Level="OrganizationExecutive" Cookie="Executive" runat="server" />
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-group-diversified-64px.png' />">
|
||||
<div title="<img src='/Images/Icons/iconshock-foreman-128px.png' width='64' height='64' />">
|
||||
<h2><asp:Label ID="LabelHeaderGeographicDefault" runat="server" /></h2>
|
||||
<Swarmops5:TreePositions ID="TreePositionsGeographic" Level="GeographyDefault" runat="server" />
|
||||
<Swarmops5:TreePositions ID="TreePositionsGeographic" Level="GeographyDefault" Cookie="Local" runat="server" />
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-redshirt-128px.png' width='64' height='64' />">
|
||||
<h2><asp:Label ID="LabelHeaderVolunteers" runat="server" /></h2>
|
||||
|
||||
</div>
|
||||
<div title="<img src='/Images/Icons/iconshock-soldier-128px.png' width='64' height='64' />">
|
||||
<h2><asp:Label ID="LabelHeaderPayroll" runat="server" /></h2>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
@@ -77,7 +77,11 @@ namespace Swarmops.Frontend.Pages.v5.Admin
|
||||
|
||||
private void Localize()
|
||||
{
|
||||
// TODO
|
||||
this.LabelHeaderStrategic.Text = String.Format(Resources.Pages.Admin.OrgStaffing_Header_StrategicPositions, CurrentOrganization.Name);
|
||||
this.LabelHeaderExecutive.Text = String.Format(Resources.Pages.Admin.OrgStaffing_Header_ExecutivePositions, CurrentOrganization.Name);
|
||||
this.LabelHeaderGeographicDefault.Text = Resources.Pages.Admin.OrgStaffing_Header_LocalDefaultPositions;
|
||||
this.LabelHeaderVolunteers.Text = Resources.Pages.Admin.OrgStaffing_Header_WaitingVolunteers;
|
||||
this.LabelHeaderPayroll.Text = Resources.Pages.Admin.OrgStaffing_Header_Payroll;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user