1
0
mirror of https://github.com/IRPTeam/IRP.git synced 2025-09-16 08:56:27 +02:00

#SDR-394 improvements (#2830)

This commit is contained in:
Dmitry Kinash
2025-07-14 17:24:37 +03:00
committed by GitHub
parent 4c35674c3d
commit a2f7295c4e
26 changed files with 1075 additions and 373 deletions

View File

@@ -463,6 +463,20 @@
<dataHistory>Use</dataHistory>
<fullTextSearch>Use</fullTextSearch>
</attributes>
<attributes uuid="66b2e957-a8f3-46b6-b4b6-235e50270c2f">
<name>AutoExecuteOnStartup</name>
<synonym>
<key>en</key>
<value>Auto-execute</value>
</synonym>
<type>
<types>Boolean</types>
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<dataHistory>Use</dataHistory>
<fullTextSearch>Use</fullTextSearch>
</attributes>
</tabularSections>
<forms uuid="d1bab740-fb0c-4ee5-bffa-159ea8c976d1">
<name>ItemForm</name>

View File

@@ -468,11 +468,20 @@
<id>118</id>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<readOnly>true</readOnly>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<visible>true</visible>
<enabled>true</enabled>
@@ -577,9 +586,6 @@
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:LabelFieldExtInfo">
<autoMaxHeight>true</autoMaxHeight>
<border xsi:type="core:BorderDef">
<width>1</width>
</border>
</extInfo>
</items>
<visible>true</visible>
@@ -897,6 +903,7 @@
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<items xsi:type="form:Table">
<name>StagesTasks</name>
@@ -1075,6 +1082,39 @@
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>StagesTasksAutoExecuteOnStartup</name>
<id>180</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.StagesTasks.AutoExecuteOnStartup</segments>
</dataPath>
<extendedTooltip>
<name>StagesTasksAutoExecuteOnStartupExtendedTooltip</name>
<id>182</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>StagesTasksAutoExecuteOnStartupContextMenu</name>
<id>181</id>
<autoFill>true</autoFill>
</contextMenu>
<type>CheckBoxField</type>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:CheckBoxFieldExtInfo"/>
</items>
<autoCommandBar>
<name>StagesTasksCommandBar</name>
<id>144</id>
@@ -1190,6 +1230,7 @@
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<visible>true</visible>
<enabled>true</enabled>
@@ -1333,14 +1374,14 @@
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<handlers>
<event>NotificationProcessing</event>
<name>NotificationProcessing</name>
</handlers>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<saveWindowSettings>true</saveWindowSettings>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>

View File

@@ -1,12 +1,13 @@
Procedure PresentationGetProcessing(Data, Presentation, StandardProcessing)
StandardProcessing = False;
Presentation = String(Data["Description_" + LocalizationReuse.GetLocalizationCode()]);
Presentation = StrTemplate("%1 (%2)", String(Data["Description_" + LocalizationReuse.GetLocalizationCode()]), Data.Number);
EndProcedure
Procedure PresentationFieldsGetProcessing(Fields, StandardProcessing)
StandardProcessing = False;
Fields = New Array();
Fields.Add("Number");
For Each DescriptionName In LocalizationServer.AllDescription() Do
Fields.Add(DescriptionName);
EndDo;
@@ -32,7 +33,11 @@ Function GetExecutionFlowchart(ProcessRef) Export
Result.Put(HeaderArea);
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLastStatus(ProcessRef);
Query = New Query;
Query.SetParameter("Ref", ProcessRef);
Query.Text =
"SELECT
| Stages.StageID AS StageID,
@@ -54,110 +59,100 @@ Function GetExecutionFlowchart(ProcessRef) Export
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| tmpProcess.StageID,
| tmpProcess.StageID AS StageID,
| tmpProcess.TaskID,
| MAX(ExecutorTasks.IterationNumber) AS IterationNumber
|INTO tmpTasks
|FROM
| tmpProcess AS tmpProcess
| INNER JOIN Task.ExecutorTasks AS ExecutorTasks
| ON tmpProcess.TaskID = ExecutorTasks.TaskID
| AND ExecutorTasks.BusinessProcess = &Ref
|GROUP BY
| tmpProcess.StageID,
| tmpProcess.TaskID
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| tmpProcess.StageID,
| tmpProcess.StageLineNumber AS StageLineNumber,
| tmpProcess.StageDescription,
| tmpProcess.TaskID,
| tmpProcess.StageDescription AS StageDescription,
| tmpProcess.TaskLineNumber AS TaskLineNumber,
| tmpProcess.TaskDescription,
| tmpProcess.TaskDescription AS TaskDescription,
| tmpProcess.TaskType,
| ExecutorTasks.Ref AS TaskRef,
| ExecutorTasks.CurrentExecutor,
| ISNULL(ExecutorTasks.Ref, VALUE(Task.ExecutorTasks.EmptyRef)) AS TaskRef,
| ISNULL(ExecutorTasks.IterationNumber, 0) AS IterationNumber,
| ISNULL(ExecutorTasks.CurrentExecutor, VALUE(Catalog.Users.EmptyRef)) AS CurrentExecutor,
| ISNULL(ExecutorTasks.ExecutionDate, DATETIME(1, 1, 1)) AS ExecutionDate,
| ISNULL(ExecutorTasks.Executed, FALSE) AS Executed,
| ISNULL(ExecutorTasks.Canceled, FALSE) AS Canceled,
| ISNULL(ExecutorTasks.Comment, """") AS Comment,
| NOT ExecutionProcessStatusSliceLast.ExecutionProcess IS NULL AS CurrentTask
| ISNULL(ExecutorTasks.Comment, """") AS Comment
|FROM
| tmpProcess AS tmpProcess
| LEFT JOIN tmpTasks AS tmpTasks
| LEFT JOIN Task.ExecutorTasks AS ExecutorTasks
| ON tmpTasks.TaskID = ExecutorTasks.TaskID
| AND tmpTasks.IterationNumber = ExecutorTasks.IterationNumber
| AND ExecutorTasks.BusinessProcess = &Ref
| LEFT JOIN InformationRegister.ExecutionProcessStatus.SliceLast AS ExecutionProcessStatusSliceLast
| ON tmpTasks.StageID = ExecutionProcessStatusSliceLast.CurrentStage
| AND tmpTasks.IterationNumber = ExecutionProcessStatusSliceLast.IterationNumber
| AND ExecutionProcessStatusSliceLast.ExecutionProcess = &Ref
| AND (ExecutionProcessStatusSliceLast.CurrentTask = tmpTasks.TaskID
| OR ExecutionProcessStatusSliceLast.CurrentTask = &EmptyID)
| ON tmpProcess.StageID = tmpTasks.StageID
| AND tmpProcess.TaskID = tmpTasks.TaskID
| LEFT JOIN Task.ExecutorTasks AS ExecutorTasks
| ON tmpProcess.TaskID = ExecutorTasks.TaskID
| AND ExecutorTasks.BusinessProcess = &Ref
|
|ORDER BY
| StageLineNumber,
| TaskLineNumber,
| IterationNumber
|TOTALS
| MAX(StageDescription) AS StageDescription,
| MAX(TaskDescription) AS TaskDescription
|BY
| StageLineNumber,
| TaskLineNumber";
Query.SetParameter("Ref", ProcessRef);
Query.SetParameter("EmptyID", New UUID("00000000-0000-0000-0000-000000000000"));
LocalizationEvents.ReplaceDescriptionLocalizationPrefix(Query.Text, "Stages");
LocalizationEvents.ReplaceDescriptionLocalizationPrefix(Query.Text, "Tasks");
QuerySelection = Query.Execute().Select();
StageSelection = Query.Execute().Select(QueryResultIteration.ByGroups);
CurrentStage = Undefined;
TaskNumber = 0;
While QuerySelection.Next() Do
If QuerySelection.StageID <> CurrentStage Then
TaskNumber = 0;
CurrentStage = QuerySelection.StageID;
StageArea = Template.GetArea("Stage");
StageArea.Parameters.Number = QuerySelection.StageLineNumber;
StageArea.Parameters.StageName = QuerySelection.StageDescription;
Result.Put(StageArea);
EndIf;
While StageSelection.Next() Do
StageArea = Template.GetArea("Stage");
StageArea.Parameters.Number = StageSelection.StageLineNumber;
StageArea.Parameters.StageName = StageSelection.StageDescription;
Result.Put(StageArea);
If QuerySelection.TaskLineNumber > 0 Then
TaskNumber = 0;
TaskSelection = StageSelection.Select(QueryResultIteration.ByGroups);
While TaskSelection.Next() Do
TaskNumber = TaskNumber + 1;
TaskArea = Template.GetArea("Task");
TaskArea.Parameters.Number = StrTemplate("%1.%2", QuerySelection.StageLineNumber, TaskNumber);
TaskArea.Parameters.TaskName = QuerySelection.TaskDescription;
TaskArea.Parameters.Executor = QuerySelection.CurrentExecutor;
TaskArea.Parameters.Comment = QuerySelection.Comment;
TaskArea.Parameters.Date =
?(QuerySelection.ExecutionDate=Date(1,1,1), "", Format(QuerySelection.ExecutionDate, "DF='dd.MM.yyyy hh:mm';"));
TaskArea.Parameters.Number = StrTemplate("%1.%2", TaskSelection.StageLineNumber, TaskNumber);
TaskArea.Parameters.TaskName = TaskSelection.TaskDescription;
TaskArea.Parameters.Result =
?(QuerySelection.Canceled, Enums.TaskResults.Canceled,
?(Not QuerySelection.Executed, Enums.TaskResults.EmptyRef(),
?(QuerySelection.TaskType = Enums.TaskTypes.Execution, Enums.TaskResults.Executed,
?(QuerySelection.TaskType = Enums.TaskTypes.Verification, Enums.TaskResults.Verified,
?(QuerySelection.TaskType = Enums.TaskTypes.Confirmation, Enums.TaskResults.Confirmed,
Enums.TaskResults.EmptyRef())))));
If QuerySelection.Canceled Then
TaskArea.Area(1, 2, 1, 2).TextColor = WebColors.Red;
ElsIf Not QuerySelection.Executed Then
If QuerySelection.CurrentTask Then
TaskArea.Area(1, 2, 1, 2).TextColor = WebColors.Green;
Else
TaskArea.Area(1, 2, 1, 2).TextColor = WebColors.Gray;
TaskArea.Area(1, 2, 1, 2).Font = New Font(TaskArea.Area(1, 2, 1, 2).Font, , , , True);
EndIf;
If TaskSelection.StageID = StatusRecord.CurrentStage
AND (TaskSelection.TaskID = StatusRecord.CurrentTask
OR Not ValueIsFilled(StatusRecord.CurrentTask)) Then
TaskArea.Area(1, 1, 1, 2).TextColor = WebColors.Green;
EndIf;
Result.Put(TaskArea);
EndIf;
ExecutorSelection = TaskSelection.Select();
While ExecutorSelection.Next() Do
ExecutorArea = Template.GetArea("Executor");
ExecutorArea.Parameters.Number = StrTemplate("%1.%2.%3",
ExecutorSelection.StageLineNumber, TaskNumber, ExecutorSelection.IterationNumber);
ExecutorArea.Parameters.ExecutorName = ExecutorSelection.CurrentExecutor;
ExecutorArea.Parameters.Comment = ExecutorSelection.Comment;
ExecutorArea.Parameters.Date =
?(ExecutorSelection.ExecutionDate = Date(1,1,1), "",
Format(ExecutorSelection.ExecutionDate, "DF='dd.MM.yyyy hh:mm';"));
ExecutorArea.Parameters.Result =
?(ExecutorSelection.Canceled, Enums.TaskResults.Canceled,
?(Not ExecutorSelection.Executed, Enums.TaskResults.EmptyRef(),
?(ExecutorSelection.TaskType = Enums.TaskTypes.Execution, Enums.TaskResults.Executed,
?(ExecutorSelection.TaskType = Enums.TaskTypes.Verification, Enums.TaskResults.Verified,
?(ExecutorSelection.TaskType = Enums.TaskTypes.Confirmation, Enums.TaskResults.Confirmed,
Enums.TaskResults.EmptyRef())))));
If ExecutorSelection.Canceled Then
ExecutorArea.Area(1, 1, 1, 2).TextColor = WebColors.Red;
ElsIf Not ExecutorSelection.Executed Then
If ExecutorSelection.StageID = StatusRecord.CurrentStage
AND (ExecutorSelection.TaskID = StatusRecord.CurrentTask
OR Not ValueIsFilled(StatusRecord.CurrentTask)) Then
ExecutorArea.Area(1, 1, 1, 2).TextColor = WebColors.Green;
Else
ExecutorArea.Area(1, 1, 1, 2).TextColor = WebColors.Gray;
ExecutorArea.Area(1, 1, 1, 2).Font = New Font(ExecutorArea.Area(1, 2, 1, 2).Font, , , , True);
EndIf;
EndIf;
Result.Put(ExecutorArea);
EndDo;
EndDo;
EndDo;
Return Result;

View File

@@ -64,7 +64,7 @@ Procedure CompleteTasksBeforeCreateTasks(RoutePoint, TasksBeingFormed, StandardP
StandardProcessing = False;
EmptyUUID = New UUID("00000000-0000-0000-0000-000000000000");
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLast(, New Structure("ExecutionProcess", ThisObject.Ref)); // InformationRegisterRecordManager.ExecutionProcessStatus
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLastStatus(ThisObject.Ref);
If StatusRecord.CurrentStage = EmptyUUID Then
Return;
EndIf;
@@ -81,12 +81,14 @@ Procedure CompleteTasksBeforeCreateTasks(RoutePoint, TasksBeingFormed, StandardP
If StageRow.TasksStartTogether Then
For Each TaskRow In TaskRows Do
CreateTask(TaskRow, RoutePoint, StatusRecord.IterationNumber, TasksBeingFormed);
CreateTask(TasksBeingFormed, TaskRow, RoutePoint, StatusRecord.IterationNumber, False,
(TaskRow.AutoExecuteOnStartup And StatusRecord.IterationNumber = 1));
EndDo;
Else
TaskRow = ThisObject.StagesTasks.Find(StatusRecord.CurrentTask, "TaskID");
If TaskRow <> Undefined Then
CreateTask(TaskRow, RoutePoint, StatusRecord.IterationNumber, TasksBeingFormed);
CreateTask(TasksBeingFormed, TaskRow, RoutePoint, StatusRecord.IterationNumber,
(TaskRow.AutoExecuteOnStartup And StatusRecord.IterationNumber = 1), False);
EndIf;
EndIf;
@@ -97,7 +99,7 @@ Procedure CheckTasksCompletedConditionCheck(RoutePoint, ProcessFinish)
ProcessFinish = True;
EmptyUUID = New UUID("00000000-0000-0000-0000-000000000000");
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLast(, New Structure("ExecutionProcess", ThisObject.Ref)); // InformationRegisterRecordManager.ExecutionProcessStatus
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLastStatus(ThisObject.Ref);
If StatusRecord.CurrentStage = EmptyUUID Then
Return;
EndIf;
@@ -118,6 +120,10 @@ Procedure CheckTasksCompletedConditionCheck(RoutePoint, ProcessFinish)
EndDo;
Query = New Query;
Query.SetParameter("TaskIDs", TaskIDs);
Query.SetParameter("BusinessProcess", ThisObject.Ref);
Query.SetParameter("IterationNumber", StatusRecord.IterationNumber);
Query.Text =
"SELECT
| ExecutorTasks.Ref
@@ -127,15 +133,39 @@ Procedure CheckTasksCompletedConditionCheck(RoutePoint, ProcessFinish)
| ExecutorTasks.TaskID IN (&TaskIDs)
| AND ExecutorTasks.BusinessProcess = &BusinessProcess
| AND ExecutorTasks.IterationNumber = &IterationNumber
| AND ExecutorTasks.Executed
| AND ExecutorTasks.Canceled";
Query.SetParameter("TaskIDs", TaskIDs);
Query.SetParameter("BusinessProcess", ThisObject.Ref);
Query.SetParameter("IterationNumber", StatusRecord.IterationNumber);
QuerySelection = Query.Execute().Select();
TasksFailed = QuerySelection.Next();
If StageRow.TasksStartTogether Then
Query.Text =
"SELECT
| ExecutorTasks.Ref AS Ref
|FROM
| Task.ExecutorTasks AS ExecutorTasks
|WHERE
| ExecutorTasks.TaskID IN(&TaskIDs)
| AND ExecutorTasks.BusinessProcess = &BusinessProcess
| AND ExecutorTasks.IterationNumber = &IterationNumber
| AND NOT ExecutorTasks.Executed
| AND NOT ExecutorTasks.DeletionMark";
QuerySelection = Query.Execute().Select();
If QuerySelection.Count() > 0 Then
If TasksFailed Then
While QuerySelection.Next() Do
TaskObj = QuerySelection.Ref.GetObject();
TaskObj.DeletionMark = True;
TaskObj.Write();
EndDo;
Else
ProcessFinish = False;
Return;
EndIf;
EndIf;
EndIf;
If TasksFailed Then
If StageRow.TasksFailAction = Enums.TaskFailActions.RestartStage Then
ProcessFinish = False;
@@ -147,7 +177,6 @@ Procedure CheckTasksCompletedConditionCheck(RoutePoint, ProcessFinish)
Canceled = True;
Return;
EndIf;
EndIf;
StageFinish = True;
@@ -156,7 +185,7 @@ Procedure CheckTasksCompletedConditionCheck(RoutePoint, ProcessFinish)
If StageRow.TasksStartTogether Then
If StageRow.LineNumber < ThisObject.ExecutionStages.Count() Then
NextStage = ThisObject.ExecutionStages[StageRow.LineNumber].StageID;
SaveNewStageStatus(NextStage, EmptyUUID);
SaveNewStageStatus(NextStage, GetFirstTask(NextStage));
ProcessFinish = False;
EndIf;
Else
@@ -185,38 +214,42 @@ Procedure CompletionOnComplete(RoutePoint, Cancel)
CompletionDate = CommonFunctionsServer.GetCurrentSessionDate();
StatusRecord = InformationRegisters.ExecutionProcessStatus.GetLastStatus(ThisObject.Ref);
Query = New Query;
Query.SetParameter("ExecutionProcess", ThisObject.Ref);
Query.SetParameter("IterationNumber", StatusRecord.IterationNumber);
Query.SetParameter("CurrentStage", StatusRecord.CurrentStage);
Query.SetParameter("CurrentTask", StatusRecord.CurrentTask);
Query.SetParameter("AllTasks", Not ValueIsFilled(StatusRecord.CurrentTask));
Query.Text =
"SELECT
| ExecutionProcessStatus.ExecutionProcess,
| ExecutionProcessStatus.IterationNumber,
| StagesTasks.TaskID
| &ExecutionProcess AS ExecutionProcess,
| &IterationNumber AS IterationNumber,
| StagesTasks.TaskID AS TaskID
|INTO tmpData
|FROM
| InformationRegister.ExecutionProcessStatus.SliceLast AS ExecutionProcessStatus
| INNER JOIN BusinessProcess.ExecutionProcesses.StagesTasks AS StagesTasks
| ON ExecutionProcessStatus.ExecutionProcess = StagesTasks.Ref
| AND ExecutionProcessStatus.CurrentStage = StagesTasks.StageID
| AND (ExecutionProcessStatus.CurrentTask = StagesTasks.TaskID
| OR ExecutionProcessStatus.CurrentTask = &EmptyID)
| BusinessProcess.ExecutionProcesses.StagesTasks AS StagesTasks
|WHERE
| ExecutionProcessStatus.ExecutionProcess = &ExecutionProcess
| StagesTasks.Ref = &ExecutionProcess
| AND StagesTasks.StageID = &CurrentStage
| AND (StagesTasks.TaskID = &CurrentTask
| OR &AllTasks)
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| ExecutorTasks.Ref
| ExecutorTasks.Ref AS Ref
|FROM
| tmpData AS tmpData
| INNER JOIN Task.ExecutorTasks AS ExecutorTasks
| ON tmpData.ExecutionProcess = ExecutorTasks.BusinessProcess
| AND tmpData.IterationNumber = ExecutorTasks.IterationNumber
| AND tmpData.TaskID = ExecutorTasks.TaskID
| ON tmpData.TaskID = ExecutorTasks.TaskID
|WHERE
| ExecutorTasks.Canceled = TRUE";
Query.SetParameter("ExecutionProcess", ThisObject.Ref);
Query.SetParameter("EmptyID", New UUID("00000000-0000-0000-0000-000000000000"));
| ExecutorTasks.Canceled = TRUE
| AND ExecutorTasks.BusinessProcess = &ExecutionProcess
| AND ExecutorTasks.IterationNumber = &IterationNumber
| AND NOT ExecutorTasks.DeletionMark";
QuerySelection = Query.Execute().Select();
If QuerySelection.Next() Then
@@ -284,8 +317,9 @@ EndFunction
// TaskRow - BusinessProcessTabularSectionRow.ExecutionProcesses.StagesTasks - Task row
// RoutePoint - BusinessProcessRoutePointRef.ExecutionProcesses - Route point
// IterationNumber - Number - Iteration number
// AutoExecute - Boolean - Auto execute
// TasksBeingFormed - Structure, Array of Arbitrary - Tasks being formed
Procedure CreateTask(TaskRow, RoutePoint, IterationNumber, TasksBeingFormed)
Procedure CreateTask(TasksBeingFormed, TaskRow, RoutePoint, IterationNumber, AutoExecute, Executed)
NewTask = Tasks.ExecutorTasks.CreateTask();
FillPropertyValues(NewTask, TaskRow);
@@ -296,6 +330,8 @@ Procedure CreateTask(TaskRow, RoutePoint, IterationNumber, TasksBeingFormed)
NewTask.BusinessProcess = ThisObject.Ref;
NewTask.RoutePoint = RoutePoint;
NewTask.IterationNumber = IterationNumber;
NewTask.AutoExecute = AutoExecute;
NewTask.Executed = Executed;
TasksBeingFormed.Add(NewTask);
@@ -360,6 +396,7 @@ EndProcedure
// NewTask - UUID - New task
Procedure SaveNewStageStatus(NewStage, NewTask)
StatusRecord = InformationRegisters.ExecutionProcessStatus.CreateRecordManager();
StatusRecord.StatusTime = CurrentUniversalDateInMilliseconds();
StatusRecord.ExecutionProcess = ThisObject.Ref;
StatusRecord.CurrentStage = NewStage;
StatusRecord.CurrentTask = NewTask;

View File

@@ -33,9 +33,14 @@
<code>HASH</code>
<description>HASH</description>
</languageInfo>
<languageInfo>
<id>en_EN</id>
<code>EnglishSDR</code>
<description>English SDR</description>
</languageInfo>
</languageSettings>
<columns>
<size>6</size>
<size>5</size>
<columnsItem>
<index>0</index>
<column>
@@ -55,24 +60,18 @@
</column>
</columnsItem>
<columnsItem>
<index>3</index>
<index>4</index>
<column>
<formatIndex>4</formatIndex>
</column>
</columnsItem>
<columnsItem>
<index>5</index>
<column>
<formatIndex>5</formatIndex>
</column>
</columnsItem>
</columns>
<rowsItem>
<index>0</index>
<row>
<c>
<c>
<f>6</f>
<f>5</f>
<parameter>Name</parameter>
</c>
</c>
@@ -83,7 +82,7 @@
<row>
<c>
<c>
<f>7</f>
<f>6</f>
<parameter>Comment</parameter>
</c>
</c>
@@ -100,7 +99,7 @@
<row>
<c>
<c>
<f>8</f>
<f>7</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
@@ -109,31 +108,20 @@
</tl>
</c>
</c>
<c>
<c>
<f>7</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
<v8:content>Stages / Tasks / Executor</v8:content>
</v8:item>
</tl>
</c>
</c>
<c>
<c>
<f>8</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
<v8:content>Stages / Tasks</v8:content>
</v8:item>
</tl>
</c>
</c>
<c>
<c>
<f>9</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
<v8:content>Executor</v8:content>
</v8:item>
</tl>
</c>
</c>
<c>
<c>
<f>9</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
@@ -144,7 +132,7 @@
</c>
<c>
<c>
<f>9</f>
<f>8</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
@@ -155,7 +143,7 @@
</c>
<c>
<c>
<f>9</f>
<f>8</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
@@ -171,16 +159,21 @@
<row>
<c>
<c>
<f>10</f>
<f>9</f>
<parameter>Number</parameter>
</c>
</c>
<c>
<c>
<f>11</f>
<f>10</f>
<parameter>StageName</parameter>
</c>
</c>
<c>
<c>
<f>11</f>
</c>
</c>
<c>
<c>
<f>12</f>
@@ -191,20 +184,27 @@
<f>13</f>
</c>
</c>
</row>
</rowsItem>
<rowsItem>
<index>5</index>
<row>
<c>
<c>
<f>14</f>
<parameter>Number</parameter>
</c>
</c>
<c>
<c>
<f>15</f>
<parameter>TaskName</parameter>
</c>
</c>
</row>
</rowsItem>
<rowsItem>
<index>5</index>
<index>6</index>
<row>
<c>
<c>
@@ -215,30 +215,24 @@
<c>
<c>
<f>17</f>
<parameter>TaskName</parameter>
<parameter>ExecutorName</parameter>
</c>
</c>
<c>
<c>
<f>18</f>
<parameter>Executor</parameter>
</c>
</c>
<c>
<c>
<f>19</f>
<parameter>Date</parameter>
</c>
</c>
<c>
<c>
<f>20</f>
<f>19</f>
<parameter>Result</parameter>
</c>
</c>
<c>
<c>
<f>17</f>
<f>20</f>
<parameter>Comment</parameter>
</c>
</c>
@@ -246,23 +240,38 @@
</rowsItem>
<templateMode>true</templateMode>
<defaultFormatIndex>21</defaultFormatIndex>
<height>6</height>
<vgRows>6</vgRows>
<height>7</height>
<vgRows>7</vgRows>
<merge>
<r>0</r>
<c>0</c>
<w>5</w>
<w>4</w>
</merge>
<merge>
<r>1</r>
<c>0</c>
<w>5</w>
<w>4</w>
</merge>
<merge>
<r>4</r>
<c>1</c>
<w>4</w>
<w>3</w>
</merge>
<merge>
<r>5</r>
<c>1</c>
<w>3</w>
</merge>
<namedItem xsi:type="NamedItemCells">
<name>Executor</name>
<area>
<type>Rows</type>
<beginRow>6</beginRow>
<endRow>6</endRow>
<beginColumn>-1</beginColumn>
<endColumn>-1</endColumn>
</area>
</namedItem>
<namedItem xsi:type="NamedItemCells">
<name>Header</name>
<area>
@@ -303,16 +312,13 @@
<width>43</width>
</format>
<format>
<width>282</width>
</format>
<format>
<width>202</width>
<width>363</width>
</format>
<format>
<width>97</width>
</format>
<format>
<width>238</width>
<width>279</width>
</format>
<format>
<font>0</font>
@@ -349,11 +355,7 @@
<width>282</width>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
<indent>3</indent>
</format>
<format>
<font>2</font>
<width>202</width>
<indent>0</indent>
</format>
<format>
<font>2</font>
@@ -373,15 +375,24 @@
<fillType>Parameter</fillType>
</format>
<format>
<border>0</border>
<leftBorder>0</leftBorder>
<topBorder>0</topBorder>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
<indent>2</indent>
</format>
<format>
<border>0</border>
<width>43</width>
<horizontalAlignment>Center</horizontalAlignment>
<fillType>Parameter</fillType>
</format>
<format>
<border>0</border>
<width>202</width>
<width>282</width>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
<indent>4</indent>
</format>
<format>
<border>0</border>
@@ -390,6 +401,13 @@
</format>
<format>
<border>0</border>
<width>72</width>
<fillType>Parameter</fillType>
</format>
<format>
<border>0</border>
<width>238</width>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
</format>
<format>

View File

@@ -2,16 +2,16 @@
<Settings xmlns="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core">
<filter>
<viewMode>Normal</viewMode>
<userSettingID>a6666e18-d2e2-495f-a117-139eb5ec0a49</userSettingID>
<userSettingID>dfcece9d-5077-440b-b6b3-45a5cb4538eb</userSettingID>
</filter>
<order>
<viewMode>Normal</viewMode>
<userSettingID>6ad4243c-0f6d-4187-98d1-a302d0b80134</userSettingID>
<userSettingID>88619765-ccb3-46c6-ac52-38e9c992ebd4</userSettingID>
</order>
<conditionalAppearance>
<viewMode>Normal</viewMode>
<userSettingID>72311d4c-0253-4907-b1fa-68e84a84e074</userSettingID>
<userSettingID>b75fecce-942b-4aed-abc9-e6a02e460fb3</userSettingID>
</conditionalAppearance>
<itemsViewMode>Normal</itemsViewMode>
<itemsUserSettingID>71dbda63-a0ee-431b-9977-1aa83ba9870c</itemsUserSettingID>
<itemsUserSettingID>911b6018-f537-43e8-a417-da56b22f9aec</itemsUserSettingID>
</Settings>

View File

@@ -0,0 +1,32 @@
Function GetAttributeNamesByObject(Object) Export
Result = New Structure;
Result.Insert("Attributes", New Map);
Result.Insert("Tables", New Map);
MetaObject = Object.Ref.Metadata();
For Each AttributItem In Metadata.CommonAttributes Do
If Not CommonFunctionsServer.isCommonAttributeUseForMetadata(AttributItem.Name, MetaObject) Then
Continue;
EndIf;
Result.Attributes.Insert(AttributItem.Name, AttributItem.Synonym);
EndDo;
For Each AttributItem In MetaObject.Attributes Do
Result.Attributes.Insert(AttributItem.Name, AttributItem.Synonym);
EndDo;
For Each TabularItem In MetaObject.TabularSections Do
TableStructure = New Structure;
TableStructure.Insert("Synonym", TabularItem.Synonym);
TableStructure.Insert("Attributes", New Map);
For Each AttributItem In TabularItem.Attributes Do
TableStructure.Attributes.Insert(AttributItem.Name, AttributItem.Synonym);
EndDo;
Result.Tables.Insert(TabularItem.Name, TableStructure);
EndDo;
Return Result;
EndFunction

View File

@@ -405,6 +405,20 @@
<dataHistory>Use</dataHistory>
<fullTextSearch>Use</fullTextSearch>
</attributes>
<attributes uuid="9513bbf0-1353-4ebb-96b8-799abdf95209">
<name>AutoExecuteOnStartup</name>
<synonym>
<key>en</key>
<value>Auto-execute</value>
</synonym>
<type>
<types>Boolean</types>
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<dataHistory>Use</dataHistory>
<fullTextSearch>Use</fullTextSearch>
</attributes>
</tabularSections>
<tabularSections uuid="5d970430-5dbf-48eb-88fb-66f7d6391fb6">
<producedTypes>

View File

@@ -158,14 +158,14 @@
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<handlers>
<event>NotificationProcessing</event>
<name>NotificationProcessing</name>
</handlers>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<saveWindowSettings>true</saveWindowSettings>
<autoTitle>true</autoTitle>

View File

@@ -257,9 +257,6 @@
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:LabelFieldExtInfo">
<autoMaxHeight>true</autoMaxHeight>
<border xsi:type="core:BorderDef">
<width>1</width>
</border>
</extInfo>
</items>
<visible>true</visible>
@@ -535,6 +532,7 @@
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<visible>true</visible>
<enabled>true</enabled>
@@ -850,6 +848,7 @@
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<items xsi:type="form:Table">
<name>StagesTasks</name>
@@ -1027,6 +1026,39 @@
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>StagesTasksAutoExecuteOnStartup</name>
<id>152</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.StagesTasks.AutoExecuteOnStartup</segments>
</dataPath>
<extendedTooltip>
<name>StagesTasksAutoExecuteOnStartupExtendedTooltip</name>
<id>154</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>StagesTasksAutoExecuteOnStartupContextMenu</name>
<id>153</id>
<autoFill>true</autoFill>
</contextMenu>
<type>CheckBoxField</type>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:CheckBoxFieldExtInfo"/>
</items>
<autoCommandBar>
<name>StagesTasksCommandBar</name>
<id>85</id>
@@ -1144,6 +1176,7 @@
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<visible>true</visible>
<enabled>true</enabled>
@@ -1204,14 +1237,14 @@
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<handlers>
<event>NotificationProcessing</event>
<name>NotificationProcessing</name>
</handlers>
<handlers>
<event>OnCreateAtServer</event>
<name>OnCreateAtServer</name>
</handlers>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<saveWindowSettings>true</saveWindowSettings>
<autoTitle>true</autoTitle>
@@ -1265,13 +1298,13 @@
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:CatalogFormExtInfo">
<handlers>
<event>BeforeWriteAtServer</event>
<name>BeforeWriteAtServer</name>
</handlers>
<handlers>
<event>OnReadAtServer</event>
<name>OnReadAtServer</name>
</handlers>
<handlers>
<event>BeforeWriteAtServer</event>
<name>BeforeWriteAtServer</name>
</handlers>
</extInfo>
</form:Form>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonPicture xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="6582d145-8d67-4f5c-9e43-764f5411c304">
<name>IconCollection10_Tasks</name>
<synonym>
<key>en</key>
<value>Icon collection10 (tasks)</value>
</synonym>
<transparentPixel>
<x>30</x>
<y>9</y>
</transparentPixel>
</mdclass:CommonPicture>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -179,6 +179,7 @@
<commonPictures>CommonPicture.IconCollection7</commonPictures>
<commonPictures>CommonPicture.IconCollection8</commonPictures>
<commonPictures>CommonPicture.IconCollection9</commonPictures>
<commonPictures>CommonPicture.IconCollection10_Tasks</commonPictures>
<commonPictures>CommonPicture.Iconoir_Add</commonPictures>
<commonPictures>CommonPicture.Iconoir_AddPhoto</commonPictures>
<commonPictures>CommonPicture.Iconoir_AddVideo</commonPictures>

View File

@@ -25,4 +25,24 @@
</dcscor:item>
</appearance>
</item>
<item>
<selection>
<item>
<field>HistoryVersionTable</field>
</item>
</selection>
<filter>
<item xsi:type="FilterItemComparison">
<left xsi:type="dcscor:Field">HistoryVersionTable.IsImportant</left>
<comparisonType>Equal</comparisonType>
<right xsi:type="xs:boolean">true</right>
</item>
</filter>
<appearance>
<dcscor:item xsi:type="SettingsParameterValue">
<dcscor:parameter>TextColor</dcscor:parameter>
<dcscor:value xsi:type="v8ui:Color">style:SpecialTextColor</dcscor:value>
</dcscor:item>
</appearance>
</item>
</ConditionalAppearance>

View File

@@ -558,7 +558,6 @@
<extInfo xsi:type="form:ImageFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<horizontalStretch>true</horizontalStretch>
<verticalStretch>true</verticalStretch>
<valuesPicture xsi:type="core:PictureRef">
<picture>StdPicture.UserWithAuthentication</picture>
@@ -570,6 +569,53 @@
<fileDragMode>AsFileRef</fileDragMode>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>DocumentListTaskIcon</name>
<id>224</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>DocumentList.TaskIcon</segments>
</dataPath>
<extendedTooltip>
<name>DocumentListTaskIconExtendedTooltip</name>
<id>226</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DocumentListTaskIconContextMenu</name>
<id>225</id>
<autoFill>true</autoFill>
</contextMenu>
<type>PictureField</type>
<editMode>Enter</editMode>
<headerPicture xsi:type="core:PictureRef">
<picture>StdPicture.Task</picture>
</headerPicture>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:ImageFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<verticalStretch>true</verticalStretch>
<valuesPicture xsi:type="core:PictureRef">
<picture>CommonPicture.IconCollection10_Tasks</picture>
</valuesPicture>
<border xsi:type="core:BorderDef">
<style>Single</style>
<width>1</width>
</border>
<fileDragMode>AsFileRef</fileDragMode>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>DocumentListDocument</name>
<id>88</id>
@@ -1738,6 +1784,9 @@
<extInfo xsi:type="form:PageGroupExtInfo">
<group>HorizontalIfPossible</group>
<showTitle>true</showTitle>
<titleDataPath xsi:type="form:DataPath">
<segments>FilesCount</segments>
</titleDataPath>
</extInfo>
</items>
<items xsi:type="form:FormGroup">
@@ -2079,6 +2128,9 @@
<extInfo xsi:type="form:PageGroupExtInfo">
<group>Vertical</group>
<showTitle>true</showTitle>
<titleDataPath xsi:type="form:DataPath">
<segments>ChatCount</segments>
</titleDataPath>
</extInfo>
</items>
<items xsi:type="form:FormGroup">
@@ -2447,6 +2499,9 @@
<extInfo xsi:type="form:PageGroupExtInfo">
<group>Vertical</group>
<showTitle>true</showTitle>
<titleDataPath xsi:type="form:DataPath">
<segments>HistoryCount</segments>
</titleDataPath>
</extInfo>
</items>
<visible>true</visible>
@@ -2688,19 +2743,34 @@
</notDefaultUseAlwaysAttributes>
<extInfo xsi:type="form:DynamicListExtInfo">
<queryText>SELECT
Registry.Document,
Registry.Date,
Registry.Number,
JournalEntry.Company,
JournalEntry.LedgerType,
Registry.CreateDate,
Registry.ModifyDate,
Registry.Author,
Registry.Editor,
Registry.Document AS Document,
Registry.Date AS Date,
Registry.Number AS Number,
JournalEntry.Company AS Company,
JournalEntry.LedgerType AS LedgerType,
Registry.CreateDate AS CreateDate,
Registry.ModifyDate AS ModifyDate,
Registry.Author AS Author,
Registry.Editor AS Editor,
MAX(NOT AuditLock.Document IS NULL) AS Locked,
MAX(AttachedFiles.File IS NULL) AS FileNotExist,
COUNT(DISTINCT AttachedFiles.File) AS Files,
MAX(ISNULL(JournalEntry.Ref, UNDEFINED)) AS JournalEntry
MAX(ISNULL(JournalEntry.Ref, UNDEFINED)) AS JournalEntry,
MAX(NOT DocTasks.ExecutionObject IS NULL) AS hasTasks,
ISNULL(DocTasks.MyTask, FALSE) AS isMyTask,
ISNULL(DocTasks.RepeatTask, FALSE) AS isRepeatTask,
CASE
WHEN MAX(ISNULL(DocTasks.RepeatTask, FALSE))
AND MAX(ISNULL(DocTasks.MyTask, FALSE))
THEN 3
WHEN MAX(ISNULL(DocTasks.MyTask, FALSE))
THEN 0
WHEN MAX(NOT DocTasks.ExecutionObject IS NULL)
THEN 2
WHEN MAX(NOT ExecutedTasks.ExecutionObject IS NULL)
THEN 1
ELSE -1
END AS TaskIcon
FROM
InformationRegister.PostedDocumentsRegistry AS Registry
LEFT JOIN InformationRegister.AttachedFiles AS AttachedFiles
@@ -2709,37 +2779,38 @@ FROM
ON Registry.Document = AuditLock.Document
LEFT JOIN Document.JournalEntry AS JournalEntry
ON Registry.Document = JournalEntry.Basis
AND NOT JournalEntry.DeletionMark
LEFT JOIN (SELECT DISTINCT
ExecutorTasks.ExecutionObject,
ExecutorTasks.CurrentExecutor = &amp;CurrentUser
OR NOT Addressing.Executor IS NULL AS MyTask
AND (NOT JournalEntry.DeletionMark)
LEFT JOIN (SELECT
ExecutorTasks.ExecutionObject AS ExecutionObject,
MAX(ExecutorTasks.CurrentExecutor = &amp;CurrentUser
OR NOT TasksByExecutive.Ref IS NULL) AS MyTask,
MAX(NOT OldTasks.Ref IS NULL) AS RepeatTask
FROM
Task.ExecutorTasks AS ExecutorTasks
LEFT JOIN (SELECT
TaskExecutors.Executor,
TaskExecutors.UserGroup,
TaskExecutors.Position,
TaskExecutors.Branch,
TaskExecutors.ProfitLossCenter
FROM
InformationRegister.TaskExecutors AS TaskExecutors
WHERE
TaskExecutors.Executor = &amp;CurrentUser) AS Addressing
ON ExecutorTasks.CurrentExecutor = VALUE(Catalog.Users.EmptyRef)
AND (ExecutorTasks.UserGroup = Addressing.UserGroup
OR ExecutorTasks.UserGroup = VALUE(Catalog.UserGroups.EmptyRef))
AND (ExecutorTasks.Position = Addressing.Position
OR ExecutorTasks.Position = VALUE(Catalog.EmployeePositions.EmptyRef))
AND (ExecutorTasks.Branch = Addressing.Branch
OR ExecutorTasks.Branch = VALUE(Catalog.BusinessUnits.EmptyRef))
AND (ExecutorTasks.ProfitLossCenter = Addressing.ProfitLossCenter
OR ExecutorTasks.ProfitLossCenter = VALUE(Catalog.BusinessUnits.EmptyRef))
LEFT JOIN Task.ExecutorTasks AS OldTasks
ON ExecutorTasks.ExecutionObject = OldTasks.ExecutionObject
AND ExecutorTasks.CurrentExecutor = OldTasks.CurrentExecutor
AND ExecutorTasks.Ref &lt;> OldTasks.Ref
AND (NOT OldTasks.DeletionMark)
LEFT JOIN Task.ExecutorTasks.TasksByExecutive(&amp;CurrentUser, ) AS TasksByExecutive
ON ExecutorTasks.Ref = TasksByExecutive.Ref
WHERE
NOT ExecutorTasks.Executed) AS DocTasks
NOT ExecutorTasks.Executed
GROUP BY
ExecutorTasks.ExecutionObject) AS DocTasks
ON Registry.Document = DocTasks.ExecutionObject
LEFT JOIN (SELECT DISTINCT
ExecutorTasks.ExecutionObject AS ExecutionObject
FROM
Task.ExecutorTasks AS ExecutorTasks
WHERE
NOT ExecutorTasks.DeletionMark
AND ExecutorTasks.Executed) AS ExecutedTasks
ON Registry.Document = ExecutedTasks.ExecutionObject
WHERE
FALSE
GROUP BY
Registry.Document,
Registry.Date,
@@ -2749,24 +2820,98 @@ GROUP BY
Registry.Author,
Registry.Editor,
JournalEntry.Company,
JournalEntry.LedgerType</queryText>
JournalEntry.LedgerType,
ISNULL(DocTasks.MyTask, FALSE),
ISNULL(DocTasks.RepeatTask, FALSE)</queryText>
<mainTable>InformationRegister.PostedDocumentsRegistry</mainTable>
<autoFillAvailableFields>true</autoFillAvailableFields>
<customQuery>true</customQuery>
<autoSaveUserSettings>true</autoSaveUserSettings>
<getInvisibleFieldPresentations>true</getInvisibleFieldPresentations>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Files</dataPath>
<field>Files</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Files</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>ManualMovementsEdit</dataPath>
<field>ManualMovementsEdit</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>RepeatTask</dataPath>
<field>RepeatTask</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Repeat task</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Document</dataPath>
<field>Document</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>hasTasks</dataPath>
<field>hasTasks</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Has tasks</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Date</dataPath>
<field>Date</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>isMyTask</dataPath>
<field>isMyTask</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Is my task</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>JournalEntry</dataPath>
<field>JournalEntry</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Journal entry</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Number</dataPath>
<field>Number</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Company</dataPath>
<field>Company</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>LedgerType</dataPath>
<field>LedgerType</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>CreateDate</dataPath>
<field>CreateDate</field>
@@ -2775,14 +2920,14 @@ GROUP BY
<dataPath>ModifyDate</dataPath>
<field>ModifyDate</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Author</dataPath>
<field>Author</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Editor</dataPath>
<field>Editor</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Author</dataPath>
<field>Author</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Locked</dataPath>
<field>Locked</field>
@@ -2795,18 +2940,6 @@ GROUP BY
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Files</dataPath>
<field>Files</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Files</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>FileNotExist</dataPath>
<field>FileNotExist</field>
@@ -2820,41 +2953,33 @@ GROUP BY
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>JournalEntry</dataPath>
<field>JournalEntry</field>
<dataPath>isRepeatTask</dataPath>
<field>isRepeatTask</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Is repeat task</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Company</dataPath>
<field>Company</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>LedgerType</dataPath>
<field>LedgerType</field>
<dataPath>TaskIcon</dataPath>
<field>TaskIcon</field>
<title>
<localValue>
<content>
<key>en</key>
<value>Task icon</value>
</content>
</localValue>
</title>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>ExecutionObject</dataPath>
<field>ExecutionObject</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Executor</dataPath>
<field>Executor</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>UserGroup</dataPath>
<field>UserGroup</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Position</dataPath>
<field>Position</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Branch</dataPath>
<field>Branch</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>ProfitLossCenter</dataPath>
<field>ProfitLossCenter</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>MyTask</dataPath>
<field>MyTask</field>
@@ -2875,10 +3000,6 @@ GROUP BY
<dataPath>Active</dataPath>
<field>Active</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>ManualMovementsEdit</dataPath>
<field>ManualMovementsEdit</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>Recorder</dataPath>
<field>Recorder</field>
@@ -2899,6 +3020,21 @@ GROUP BY
<values xsi:type="core:UndefinedValue"/>
<useRestriction>true</useRestriction>
</parameters>
<parameters>
<name>Performer</name>
<title>
<localValue>
<content>
<key>en</key>
<value>Performer</value>
</content>
</localValue>
</title>
<valueType>
<types>CatalogRef.Users</types>
</valueType>
<values xsi:type="core:UndefinedValue"/>
</parameters>
</extInfo>
</attributes>
<attributes>
@@ -3245,6 +3381,23 @@ GROUP BY
<common>true</common>
</edit>
</columns>
<columns>
<name>IsImportant</name>
<title>
<key>en</key>
<value>Is important</value>
</title>
<id>32</id>
<valueType>
<types>Boolean</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</columns>
</attributes>
<attributes>
<name>HistoryReport</name>
@@ -3286,6 +3439,83 @@ GROUP BY
</edit>
<functionalOptions>FunctionalOption.UseBusinessProcess</functionalOptions>
</attributes>
<attributes>
<name>FilesCount</name>
<title>
<key>en</key>
<value>Files count</value>
</title>
<id>29</id>
<valueType>
<types>Number</types>
<numberQualifiers>
<precision>10</precision>
</numberQualifiers>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<attributes>
<name>ChatCount</name>
<title>
<key>en</key>
<value>Chat count</value>
</title>
<id>30</id>
<valueType>
<types>Number</types>
<numberQualifiers>
<precision>10</precision>
</numberQualifiers>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<attributes>
<name>HistoryCount</name>
<title>
<key>en</key>
<value>History count</value>
</title>
<id>31</id>
<valueType>
<types>Number</types>
<numberQualifiers>
<precision>10</precision>
</numberQualifiers>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<attributes>
<name>ShowExchangeError</name>
<title>
<key>en</key>
<value>Show exchange error</value>
</title>
<id>33</id>
<valueType>
<types>Boolean</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<formCommands>
<name>FindDocuments</name>
<title>

View File

@@ -24,7 +24,7 @@ EndProcedure
#EndRegion
#Region Commands
#Region FormCommandsEventHandlers
&AtClient
Procedure FindDocuments(Command)
@@ -169,6 +169,7 @@ EndProcedure
&AtServer
Procedure SetVisible()
VisibleSettings = DataProcessors.AccountantAutomatedWorkplace.GetSettings();
Items.LedgerType.Visible = VisibleSettings.Filter_LedgerType;
@@ -181,6 +182,9 @@ Procedure SetVisible()
Items.GroupFiles.Visible = VisibleSettings.Panel_GroupFiles;
Items.GroupChat.Visible = VisibleSettings.Panel_GroupChat;
Items.GroupHistory.Visible = VisibleSettings.Panel_GroupHistory;
Items.DocumentListTaskIcon.Visible = VisibleSettings.Filter_TasksType;
EndProcedure
&AtServer
@@ -214,7 +218,7 @@ Procedure SetListFilterAtServer()
If TasksType = 1 Then
DynamicListAPI.AddFilter(QuerySchemaAPI, "Not DocTasks.ExecutionObject IS NULL");
ElsIf TasksType = 2 Then
DynamicListAPI.AddFilter(QuerySchemaAPI, "Not DocTasks.ExecutionObject IS NULL And DocTasks.MyTask = TRUE");
DynamicListAPI.AddFilter(QuerySchemaAPI, "DocTasks.MyTask = TRUE");
EndIf;
DynamicListAPI.Set(QuerySchemaAPI);
@@ -324,6 +328,7 @@ EndProcedure
Procedure RefreshFilesAtServer(DocumentRef)
FileTable.Clear();
FilesCount = 0;
Items.PagesFiles.CurrentPage = Items.FirstPage;
@@ -375,6 +380,7 @@ Procedure RefreshFilesAtServer(DocumentRef)
FileRecord.isPDF = False;
EndIf;
EndDo;
FilesCount = FileTable.Count();
If FileTable.Count() = 0 Then
Items.NoFileLabel.Visible = True;
@@ -417,6 +423,7 @@ Procedure RefreshHistoryAtServer(DocumentRef)
HistoryVersionTable.Clear();
HistoryReport.Clear();
HistoryCount = 0;
If Not ValueIsFilled(DocumentRef) Then
Return;
@@ -425,14 +432,18 @@ Procedure RefreshHistoryAtServer(DocumentRef)
DataHistory.UpdateHistory();
HistoryTable = DataHistory.SelectVersions(New Structure("Data", DocumentRef),, "VersionNumber");
For Each HistoryRow In HistoryTable Do
FillPropertyValues(HistoryVersionTable.Add(), HistoryRow);
NewVersion = HistoryVersionTable.Add();
FillPropertyValues(NewVersion, HistoryRow);
EndDo;
HistoryCount = HistoryVersionTable.Count();
EndProcedure
&AtServer
Procedure RefreshChatAtServer(DocumentRef)
ChatCount = 0;
Query = New Query;
Query.SetParameter("Basis", DocumentRef);
Query.SetParameter("CurrentUser", SessionParameters.CurrentUser);
@@ -456,6 +467,7 @@ Procedure RefreshChatAtServer(DocumentRef)
| Logger.TimeStamp";
ChatMessages = Query.Execute().Unload();
Data = CommonFunctionsServer.TableToStructure(ChatMessages);
ChatCount = Data.Count();
Query.Text =
"SELECT
@@ -704,8 +716,10 @@ EndFunction
Procedure ReadVersionDifference(VersionNumber)
HistoryReport.Clear();
Attributes = New Structure;
Tables = New Structure;
Attributes = New Structure;
AttributeNames = Catalogs.ConfigurationMetadata.GetAttributeNamesByObject(CurrentDocument);
VersionDifference = DataHistory.GetVersionDifferences(CurrentDocument, VersionNumber);
For Each VersionDifferenceItem In VersionDifference Do
@@ -721,25 +735,40 @@ Procedure ReadVersionDifference(VersionNumber)
If Attributes.Count() Then
HistoryReport.Put(Template.GetArea("AttributeHeader"));
For Each AttributKeyValue In Attributes Do
AttributeName = AttributeNames.Attributes.Get(AttributKeyValue.Key);
If AttributeName = Undefined or AttributeName = "" Then
AttributeName = AttributKeyValue.Key;
EndIf;
AttributeValueNew = AttributKeyValue.Value.ValueAfterChange;
If TypeOf(AttributKeyValue.Value.ValueAfterChange) = Type("FixedStructure") Then
RowValue = Undefined;
AttributeValueNew = Undefined;
If AttributKeyValue.Value.ValueAfterChange.Property("Presentation") Then
RowValue = AttributKeyValue.Value.ValueAfterChange.Presentation;
AttributeValueNew = AttributKeyValue.Value.ValueAfterChange.Presentation;
ElsIf AttributKeyValue.Value.ValueAfterChange.Property("Ref") Then
RowValue = AttributKeyValue.Value.ValueAfterChange.Ref;
AttributeValueNew = AttributKeyValue.Value.ValueAfterChange.Ref;
EndIf;
If RowValue <> Undefined Then
Row = Template.GetArea("AttributeRow");
Row.Parameters.Name = AttributKeyValue.Key;
Row.Parameters.Value = RowValue;
HistoryReport.Put(Row);
EndIf;
If AttributKeyValue.Value.Property("ValueBeforeChange") Then
AttributeValueOld = AttributKeyValue.Value.ValueBeforeChange;
If TypeOf(AttributKeyValue.Value.ValueBeforeChange) = Type("FixedStructure") Then
AttributeValueOld = Undefined;
If AttributKeyValue.Value.ValueBeforeChange.Property("Presentation") Then
AttributeValueOld = AttributKeyValue.Value.ValueBeforeChange.Presentation;
ElsIf AttributKeyValue.Value.ValueBeforeChange.Property("Ref") Then
AttributeValueOld = AttributKeyValue.Value.ValueBeforeChange.Ref;
EndIf;
EndIf;
Else
Row = Template.GetArea("AttributeRow");
Row.Parameters.Name = AttributKeyValue.Key;
Row.Parameters.Value = AttributKeyValue.Value.ValueAfterChange;
HistoryReport.Put(Row);
AttributeValueOld = Undefined;
EndIf;
Row = Template.GetArea("AttributeRow");
Row.Parameters.Name = AttributeName;
Row.Parameters.ValueBefore = AttributeValueOld;
Row.Parameters.ValueAfter = AttributeValueNew;
HistoryReport.Put(Row);
EndDo;
EndIf;
@@ -748,15 +777,29 @@ Procedure ReadVersionDifference(VersionNumber)
Continue;
EndIf;
TableAttributeNames = AttributeNames.Tables.Get(TableKeyValue.Key);
If TableAttributeNames = Undefined Then
TableAttributeNames = New Structure("Synonym, Attributes", "", New Map);
EndIf;
TableName = TableAttributeNames.Synonym;
If TableName = "" Then
TableName = TableKeyValue.Key;
EndIf;
TableHeader = Template.GetArea("TableHeader");
TableHeader.Parameters.TableName = TableKeyValue.Key;
TableHeader.Parameters.TableName = TableName;
HistoryReport.Put(TableHeader);
TableHeader = New SpreadsheetDocument;
TableHeader.Put(Template.GetArea("NumberHeader"));
For Each FieldKeyValue In TableKeyValue.Value[0].Fields Do
AttributeName = TableAttributeNames.Attributes.Get(FieldKeyValue.Key);
If AttributeName = Undefined or AttributeName = "" Then
AttributeName = FieldKeyValue.Key;
EndIf;
FieldHeader = Template.GetArea("FieldHeader");
FieldHeader.Parameters.FieldName = FieldKeyValue.Key;
FieldHeader.Parameters.FieldName = AttributeName;
TableHeader.Join(FieldHeader);
EndDo;
HistoryReport.Put(TableHeader);
@@ -768,6 +811,7 @@ Procedure ReadVersionDifference(VersionNumber)
NumberRow.Parameters.Number = TableRecord.LineNumberAfterVersionChange;
TableRow.Put(NumberRow);
For Each FieldKeyValue In TableRecord.Fields Do
FieldValueOld = Undefined;
FieldValue = FieldKeyValue.Value;
If TypeOf(FieldValue) = Type("FixedStructure") Then
If FieldValue.Property("Presentation") Then
@@ -775,7 +819,8 @@ Procedure ReadVersionDifference(VersionNumber)
ElsIf FieldValue.Property("Ref") Then
FieldValue = FieldValue.Ref;
ElsIf FieldValue.Property("ValueAfterChange") Then
FieldValue = FieldValue.ValueAfterChange;
FieldValuesAll = FieldValue;
FieldValue = FieldValuesAll.ValueAfterChange;
If TypeOf(FieldValue) = Type("FixedStructure") Then
If FieldValue.Property("Presentation") Then
FieldValue = FieldValue.Presentation;
@@ -783,11 +828,22 @@ Procedure ReadVersionDifference(VersionNumber)
FieldValue = FieldValue.Ref;
EndIf;
EndIf;
If FieldValuesAll.Property("ValueBeforeChange") Then
FieldValueOld = FieldValuesAll.ValueBeforeChange;
If TypeOf(FieldValueOld) = Type("FixedStructure") Then
If FieldValueOld.Property("Presentation") Then
FieldValueOld = FieldValueOld.Presentation;
ElsIf FieldValueOld.Property("Ref") Then
FieldValueOld = FieldValueOld.Ref;
EndIf;
EndIf;
EndIf;
EndIf;
EndIf;
FieldRow = Template.GetArea("FieldRow");
FieldRow.Parameters.FieldValue = FieldValue;
FieldRow.Parameters.ValueBefore = FieldValueOld;
FieldRow.Parameters.ValueAfter = FieldValue;
TableRow.Join(FieldRow);
EndDo;
@@ -795,6 +851,12 @@ Procedure ReadVersionDifference(VersionNumber)
EndDo;
EndDo;
For ColumnNumber = 5 to HistoryReport.TableWidth Do
If HistoryReport.Area(1, ColumnNumber).ColumnWidth < 20 Then
HistoryReport.Area(1, ColumnNumber).ColumnWidth = 20;
EndIf;
EndDo;
EndProcedure
#EndRegion

View File

@@ -33,9 +33,14 @@
<code>HASH</code>
<description>HASH</description>
</languageInfo>
<languageInfo>
<id>en_EN</id>
<code>EnglishSDR</code>
<description>English SDR</description>
</languageInfo>
</languageSettings>
<columns>
<size>3</size>
<size>4</size>
<columnsItem>
<index>0</index>
<column>
@@ -54,6 +59,12 @@
<formatIndex>2</formatIndex>
</column>
</columnsItem>
<columnsItem>
<index>3</index>
<column>
<formatIndex>2</formatIndex>
</column>
</columnsItem>
</columns>
<rowsItem>
<index>0</index>
@@ -92,17 +103,26 @@
</c>
</c>
<c>
<i>2</i>
<c>
<f>5</f>
</c>
</c>
<c>
<c>
<f>6</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
<v8:content>Value</v8:content>
<v8:content>Value (before / after)</v8:content>
</v8:item>
</tl>
</c>
</c>
<c>
<c>
<f>5</f>
</c>
</c>
</row>
</rowsItem>
<rowsItem>
@@ -110,15 +130,25 @@
<row>
<c>
<c>
<f>6</f>
<f>7</f>
<parameter>Name</parameter>
</c>
</c>
<c>
<i>2</i>
<c>
<f>7</f>
<parameter>Value</parameter>
<f>5</f>
</c>
</c>
<c>
<c>
<f>8</f>
<parameter>ValueBefore</parameter>
</c>
</c>
<c>
<c>
<f>9</f>
<parameter>ValueAfter</parameter>
</c>
</c>
</row>
@@ -134,7 +164,7 @@
<row>
<c>
<c>
<f>8</f>
<f>10</f>
<parameter>TableName</parameter>
</c>
</c>
@@ -145,7 +175,7 @@
<row>
<c>
<c>
<f>9</f>
<f>6</f>
<tl>
<v8:item>
<v8:lang>en</v8:lang>
@@ -156,7 +186,7 @@
</c>
<c>
<c>
<f>10</f>
<f>11</f>
<parameter>FieldName</parameter>
</c>
</c>
@@ -167,20 +197,26 @@
<row>
<c>
<c>
<f>7</f>
<f>12</f>
<parameter>Number</parameter>
</c>
</c>
<c>
<c>
<f>7</f>
<parameter>FieldValue</parameter>
<f>8</f>
<parameter>ValueBefore</parameter>
</c>
</c>
<c>
<c>
<f>13</f>
<parameter>ValueAfter</parameter>
</c>
</c>
</row>
</rowsItem>
<templateMode>true</templateMode>
<defaultFormatIndex>11</defaultFormatIndex>
<defaultFormatIndex>14</defaultFormatIndex>
<height>8</height>
<vgRows>8</vgRows>
<merge>
@@ -188,11 +224,21 @@
<c>0</c>
<w>1</w>
</merge>
<merge>
<r>2</r>
<c>2</c>
<w>1</w>
</merge>
<merge>
<r>3</r>
<c>0</c>
<w>1</w>
</merge>
<merge>
<r>6</r>
<c>1</c>
<w>1</w>
</merge>
<namedItem xsi:type="NamedItemCells">
<name>AttributeHeader</name>
<area>
@@ -220,7 +266,7 @@
<beginRow>6</beginRow>
<endRow>6</endRow>
<beginColumn>1</beginColumn>
<endColumn>1</endColumn>
<endColumn>2</endColumn>
</area>
</namedItem>
<namedItem xsi:type="NamedItemCells">
@@ -230,7 +276,7 @@
<beginRow>7</beginRow>
<endRow>7</endRow>
<beginColumn>1</beginColumn>
<endColumn>1</endColumn>
<endColumn>2</endColumn>
</area>
</namedItem>
<namedItem xsi:type="NamedItemCells">
@@ -266,13 +312,21 @@
<line width="1" gap="false">
<v8ui:style xsi:type="v8ui:SpreadsheetDocumentCellLineType">Solid</v8ui:style>
</line>
<line width="1" gap="false">
<v8ui:style xsi:type="v8ui:SpreadsheetDocumentCellLineType">Dotted</v8ui:style>
</line>
<line width="1" gap="false">
<v8ui:style xsi:type="v8ui:SpreadsheetDocumentCellLineType">None</v8ui:style>
</line>
<font faceName="Arial" height="14" bold="false" italic="false" underline="false" strikeout="false" kind="Absolute" scale="100"/>
<font faceName="Arial" height="8" bold="true" italic="false" underline="false" strikeout="false" kind="Absolute" scale="100"/>
<font faceName="Arial" height="8" bold="false" italic="true" underline="false" strikeout="false" kind="Absolute" scale="100"/>
<format>
<width>42</width>
</format>
<format>
<width>240</width>
<width>160</width>
<widthWeightFactor>1</widthWeightFactor>
</format>
<format>
<font>0</font>
@@ -283,17 +337,36 @@
<border>0</border>
<width>240</width>
</format>
<format>
<border>0</border>
</format>
<format>
<font>1</font>
<border>0</border>
<horizontalAlignment>Center</horizontalAlignment>
</format>
<format>
<border>0</border>
<width>240</width>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
</format>
<format>
<border>0</border>
<font>2</font>
<leftBorder>0</leftBorder>
<topBorder>0</topBorder>
<rightBorder>1</rightBorder>
<bottomBorder>0</bottomBorder>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
</format>
<format>
<leftBorder>2</leftBorder>
<topBorder>0</topBorder>
<rightBorder>0</rightBorder>
<bottomBorder>0</bottomBorder>
<width>240</width>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
</format>
<format>
@@ -305,11 +378,20 @@
<font>1</font>
<border>0</border>
<horizontalAlignment>Center</horizontalAlignment>
<fillType>Parameter</fillType>
</format>
<format>
<font>1</font>
<border>0</border>
<horizontalAlignment>Center</horizontalAlignment>
<fillType>Parameter</fillType>
</format>
<format>
<leftBorder>2</leftBorder>
<topBorder>0</topBorder>
<rightBorder>0</rightBorder>
<bottomBorder>0</bottomBorder>
<width>160</width>
<widthWeightFactor>1</widthWeightFactor>
<textPlacement>Wrap</textPlacement>
<fillType>Parameter</fillType>
</format>
<format>

View File

@@ -83,4 +83,23 @@
<fillValue xsi:type="core:UndefinedValue"/>
<mainFilter>true</mainFilter>
</dimensions>
<dimensions uuid="f9f6b351-ed93-457c-b7e0-b65da115b720">
<name>StatusTime</name>
<synonym>
<key>en</key>
<value>Status time</value>
</synonym>
<type>
<types>Number</types>
<numberQualifiers>
<precision>20</precision>
<nonNegative>true</nonNegative>
</numberQualifiers>
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<fullTextSearch>Use</fullTextSearch>
<dataHistory>Use</dataHistory>
<fillValue xsi:type="core:UndefinedValue"/>
</dimensions>
</mdclass:InformationRegister>

View File

@@ -10,4 +10,48 @@ Function GetAccessKey() Export
Return AccessKeyStructure;
EndFunction
#EndRegion
#EndRegion
// Get last status.
//
// Parameters:
// ExecutionProcess - BusinessProcessRef.ExecutionProcesses - Execution process
//
// Returns:
// Structure - Get last status:
// * ExecutionProcess - BusinessProcessRef.ExecutionProcesses
// * Period - Date
// * StatusTime - Number
// * CurrentStage - UUID
// * CurrentTask - UUID
// * IterationNumber - Number
Function GetLastStatus(ExecutionProcess) Export
Query = New Query;
Query.Text =
"SELECT TOP 1
| ExecutionProcessStatus.ExecutionProcess,
| ExecutionProcessStatus.Period AS Period,
| ExecutionProcessStatus.StatusTime AS StatusTime,
| ExecutionProcessStatus.CurrentStage,
| ExecutionProcessStatus.CurrentTask,
| ExecutionProcessStatus.IterationNumber
|FROM
| InformationRegister.ExecutionProcessStatus AS ExecutionProcessStatus
|WHERE
| ExecutionProcessStatus.ExecutionProcess = &ExecutionProcess
|
|ORDER BY
| Period DESC,
| StatusTime DESC";
Query.SetParameter("ExecutionProcess", ExecutionProcess);
QuerySelection = Query.Execute().Select();
If QuerySelection.Next() Then
Return QuerySelection;
EndIf;
Return InformationRegisters.ExecutionProcessStatus.GetLast(, New Structure("ExecutionProcess", ExecutionProcess));
EndFunction

View File

@@ -23,5 +23,6 @@
<content>InformationRegister.ExecutionProcessStatus</content>
<content>EventSubscription.OnWrite_ExecutionObject</content>
<content>EventSubscription.OnPosting_ExecutionObject</content>
<content>CommonPicture.IconCollection10_Tasks</content>
<parentSubsystem>Subsystem.Settings</parentSubsystem>
</mdclass:Subsystem>

View File

@@ -115,6 +115,7 @@
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<fillValue xsi:type="core:UndefinedValue"/>
<dataHistory>Use</dataHistory>
</attributes>
<attributes uuid="e87573de-2b60-45d6-ba98-27ab839b54a2">
@@ -147,6 +148,7 @@
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<fillValue xsi:type="core:UndefinedValue"/>
<fullTextSearch>Use</fullTextSearch>
<dataHistory>Use</dataHistory>
</attributes>
@@ -228,6 +230,21 @@
<fillValue xsi:type="core:UndefinedValue"/>
<fullTextSearch>Use</fullTextSearch>
</attributes>
<attributes uuid="aeef31f3-5e83-40cf-bc67-558d2e7bb2f3">
<name>AutoExecute</name>
<synonym>
<key>en</key>
<value>Auto-execute</value>
</synonym>
<type>
<types>Boolean</types>
</type>
<minValue xsi:type="core:UndefinedValue"/>
<maxValue xsi:type="core:UndefinedValue"/>
<fillValue xsi:type="core:UndefinedValue"/>
<fullTextSearch>Use</fullTextSearch>
<dataHistory>Use</dataHistory>
</attributes>
<forms uuid="513d82d4-5088-403e-8052-333c67529f8b">
<name>ItemForm</name>
<synonym>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ConditionalAppearance xmlns="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows">
</ConditionalAppearance>

View File

@@ -687,11 +687,20 @@
<id>11</id>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<readOnly>true</readOnly>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Detailing</name>
@@ -809,9 +818,6 @@
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:LabelFieldExtInfo">
<autoMaxHeight>true</autoMaxHeight>
<border xsi:type="core:BorderDef">
<width>1</width>
</border>
</extInfo>
</items>
<autoCommandBar>

View File

@@ -587,55 +587,56 @@
<main>true</main>
<extInfo xsi:type="form:DynamicListExtInfo">
<queryText>SELECT DISTINCT
ExecutorTasks.Ref,
ExecutorTasks.DeletionMark,
ExecutorTasks.Number,
ExecutorTasks.Date,
ExecutorTasks.BusinessProcess,
ExecutorTasks.RoutePoint,
ExecutorTasks.Executed,
ExecutorTasks.TaskID,
ExecutorTasks.IterationNumber,
ExecutorTasks.TaskType,
ExecutorTasks.ExecutionObject,
ExecutorTasks.ExecutionDate,
ExecutorTasks.AcceptetionForExecutionDate,
ExecutorTasks.Canceled,
ExecutorTasks.CurrentExecutor,
ExecutorTasks.UserGroup,
ExecutorTasks.Position,
ExecutorTasks.Branch,
ExecutorTasks.ProfitLossCenter,
ExecutorTasks.Comment,
ExecutorTasks.Author,
ExecutorTasks.Ref AS Ref,
ExecutorTasks.DeletionMark AS DeletionMark,
ExecutorTasks.Number AS Number,
ExecutorTasks.Date AS Date,
ExecutorTasks.BusinessProcess AS BusinessProcess,
ExecutorTasks.RoutePoint AS RoutePoint,
ExecutorTasks.Executed AS Executed,
ExecutorTasks.TaskID AS TaskID,
ExecutorTasks.IterationNumber AS IterationNumber,
ExecutorTasks.TaskType AS TaskType,
ExecutorTasks.ExecutionObject AS ExecutionObject,
ExecutorTasks.ExecutionDate AS ExecutionDate,
ExecutorTasks.AcceptetionForExecutionDate AS AcceptetionForExecutionDate,
ExecutorTasks.Canceled AS Canceled,
ExecutorTasks.CurrentExecutor AS CurrentExecutor,
ExecutorTasks.UserGroup AS UserGroup,
ExecutorTasks.Position AS Position,
ExecutorTasks.Branch AS Branch,
ExecutorTasks.ProfitLossCenter AS ProfitLossCenter,
ExecutorTasks.Comment AS Comment,
ExecutorTasks.Author AS Author,
ExecutorTasks.Description_en AS Description
FROM
Task.ExecutorTasks AS ExecutorTasks
LEFT JOIN (SELECT
TaskExecutors.Executor,
TaskExecutors.UserGroup,
TaskExecutors.Position,
TaskExecutors.Branch,
TaskExecutors.ProfitLossCenter
TaskExecutors.Executor AS Executor,
TaskExecutors.UserGroup AS UserGroup,
TaskExecutors.Position AS Position,
TaskExecutors.Branch AS Branch,
TaskExecutors.ProfitLossCenter AS ProfitLossCenter
FROM
InformationRegister.TaskExecutors AS TaskExecutors
WHERE
TaskExecutors.Executor = &amp;CurrentUser) AS Addressing
ON ExecutorTasks.CurrentExecutor = VALUE(Catalog.Users.EmptyRef)
AND (ExecutorTasks.UserGroup = Addressing.UserGroup
OR ExecutorTasks.UserGroup = VALUE(Catalog.UserGroups.EmptyRef))
AND (ExecutorTasks.Position = Addressing.Position
OR ExecutorTasks.Position = VALUE(Catalog.EmployeePositions.EmptyRef))
AND (ExecutorTasks.Branch = Addressing.Branch
OR ExecutorTasks.Branch = VALUE(Catalog.BusinessUnits.EmptyRef))
AND (ExecutorTasks.ProfitLossCenter = Addressing.ProfitLossCenter
OR ExecutorTasks.ProfitLossCenter = VALUE(Catalog.BusinessUnits.EmptyRef))
ON (ExecutorTasks.CurrentExecutor = VALUE(Catalog.Users.EmptyRef))
AND (ExecutorTasks.UserGroup = Addressing.UserGroup
OR ExecutorTasks.UserGroup = VALUE(Catalog.UserGroups.EmptyRef))
AND (ExecutorTasks.Position = Addressing.Position
OR ExecutorTasks.Position = VALUE(Catalog.EmployeePositions.EmptyRef))
AND (ExecutorTasks.Branch = Addressing.Branch
OR ExecutorTasks.Branch = VALUE(Catalog.BusinessUnits.EmptyRef))
AND (ExecutorTasks.ProfitLossCenter = Addressing.ProfitLossCenter
OR ExecutorTasks.ProfitLossCenter = VALUE(Catalog.BusinessUnits.EmptyRef))
WHERE
(NOT ExecutorTasks.Executed
OR &amp;ShowExecuted)
OR &amp;ShowExecuted)
AND (ExecutorTasks.CurrentExecutor = &amp;CurrentUser
OR NOT Addressing.Executor IS NULL
OR &amp;ShowAllTasks)</queryText>
OR NOT Addressing.Executor IS NULL
OR &amp;ShowAllTasks)
AND NOT ExecutorTasks.DeletionMark</queryText>
<mainTable>Task.ExecutorTasks</mainTable>
<dynamicDataRead>true</dynamicDataRead>
<autoFillAvailableFields>true</autoFillAvailableFields>
@@ -762,6 +763,10 @@ WHERE
<dataPath>Description_ru</dataPath>
<field>Description_ru</field>
</fields>
<fields xsi:type="schema:DataCompositionSchemaDataSetField">
<dataPath>AutoExecute</dataPath>
<field>AutoExecute</field>
</fields>
<parameters>
<name>ShowExecuted</name>
<title>
@@ -775,6 +780,7 @@ WHERE
<valueType>
<types>Boolean</types>
</valueType>
<values xsi:type="core:UndefinedValue"/>
<useRestriction>true</useRestriction>
</parameters>
<parameters>
@@ -790,6 +796,7 @@ WHERE
<valueType>
<types>CatalogRef.Users</types>
</valueType>
<values xsi:type="core:UndefinedValue"/>
<useRestriction>true</useRestriction>
</parameters>
<parameters>
@@ -805,6 +812,7 @@ WHERE
<valueType>
<types>Boolean</types>
</valueType>
<values xsi:type="core:UndefinedValue"/>
<useRestriction>true</useRestriction>
</parameters>
</extInfo>

View File

@@ -1,12 +1,13 @@
Procedure PresentationGetProcessing(Data, Presentation, StandardProcessing)
StandardProcessing = False;
Presentation = String(Data["Description_" + LocalizationReuse.GetLocalizationCode()]);
Presentation = StrTemplate("%1 (%2)", String(Data["Description_" + LocalizationReuse.GetLocalizationCode()]), Data.Number);
EndProcedure
Procedure PresentationFieldsGetProcessing(Fields, StandardProcessing)
StandardProcessing = False;
Fields = New Array();
Fields.Add("Number");
For Each DescriptionName In LocalizationServer.AllDescription() Do
Fields.Add(DescriptionName);
EndDo;

View File

@@ -2,12 +2,30 @@
Procedure BeforeExecute(Cancel)
CurrentExecutor = SessionParameters.CurrentUser;
ExecutionDate = CommonFunctionsServer.GetCurrentSessionDate();
If AcceptetionForExecutionDate = Date(1,1,1) Then
AcceptetionForExecutionDate = ExecutionDate;
EndIf;
EndProcedure
Procedure OnWrite(Cancel)
If AutoExecute And Not Executed Then
AutoExecute = False;
ExecuteTask();
EndIf;
EndProcedure
Procedure BeforeWrite(Cancel)
If Executed Then
If CurrentExecutor.IsEmpty() Then
CurrentExecutor = SessionParameters.CurrentUser;
EndIf;
If ExecutionDate = Date(1,1,1) Then
ExecutionDate = CommonFunctionsServer.GetCurrentSessionDate();
EndIf;
EndIf;
EndProcedure