Commit 0f78f482e7baa6be0dbcec501db13a31cd38d31e

Authored by Neil Blakey-Milner
1 parent a20092d5

KTS-1329: Show the owner value in document details


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6079 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/widgets/fieldsetDisplay.inc.php
@@ -192,6 +192,12 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -192,6 +192,12 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
192 } else { 192 } else {
193 $creator_name = $creator->getName(); 193 $creator_name = $creator->getName();
194 } 194 }
  195 + $owner =& User::get($document->getOwnerId());
  196 + if (PEAR::isError($owner)) {
  197 + $owner_name = "<span class='ktError'>" . _kt("Unable to find the document's owner") . "</span>";
  198 + } else {
  199 + $owner_name = $owner->getName();
  200 + }
195 $modified_user =& User::get($document->getModifiedUserId()); 201 $modified_user =& User::get($document->getModifiedUserId());
196 if (PEAR::isError($modified_user)) { 202 if (PEAR::isError($modified_user)) {
197 $modified_user_name = "<span class='ktError'>" . _kt("Unable to find the document's creator") . "</span>"; 203 $modified_user_name = "<span class='ktError'>" . _kt("Unable to find the document's creator") . "</span>";
@@ -220,6 +226,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -220,6 +226,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
220 "filename" => $document->getFileName(), 226 "filename" => $document->getFileName(),
221 227
222 "creator" => $creator_name, 228 "creator" => $creator_name,
  229 + "owner" => $owner_name,
223 "creation_date" => $creation_date, 230 "creation_date" => $creation_date,
224 231
225 "last_modified_by" => $modified_user_name, 232 "last_modified_by" => $modified_user_name,
@@ -262,6 +269,13 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -262,6 +269,13 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
262 } else { 269 } else {
263 $modified_user = $modified_user->getName(); 270 $modified_user = $modified_user->getName();
264 } 271 }
  272 +
  273 + $owner_user =& User::get($document->getOwnerId());
  274 + if (PEAR::isError($owner_user)) {
  275 + $owner_user = "<span class='ktError'>" . _kt("Unable to find the document's owner") . "</span>";
  276 + } else {
  277 + $owner_user = $owner_user->getName();
  278 + }
265 279
266 280
267 281
@@ -293,6 +307,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -293,6 +307,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
293 307
294 "creator" => $creator, 308 "creator" => $creator,
295 "creation_date" => $creation_date, 309 "creation_date" => $creation_date,
  310 + "owner" => $owner_user,
296 311
297 "last_modified_by" => $modified_user, 312 "last_modified_by" => $modified_user,
298 "last_modified_date" => $last_modified_date, 313 "last_modified_date" => $last_modified_date,
templates/kt3/fieldsets/generic.smarty
@@ -27,16 +27,21 @@ @@ -27,16 +27,21 @@
27 </tr> 27 </tr>
28 28
29 <tr class="even"> 29 <tr class="even">
  30 + <th>{i18n}Owned by{/i18n}</th>
  31 + <td>{$owner}</td>
  32 + </tr>
  33 +
  34 + <tr class="odd">
30 <th>{i18n}Last update by{/i18n}</th> 35 <th>{i18n}Last update by{/i18n}</th>
31 <td>{$last_modified_by} ({$last_modified_date})</td> 36 <td>{$last_modified_by} ({$last_modified_date})</td>
32 </tr> 37 </tr>
33 38
34 - <tr class="odd"> 39 + <tr class="even">
35 <th>{i18n}Document Type{/i18n}</th> 40 <th>{i18n}Document Type{/i18n}</th>
36 <td>{$document_type}</td> 41 <td>{$document_type}</td>
37 </tr> 42 </tr>
38 43
39 - <tr class="even"> 44 + <tr class="odd">
40 <th>{i18n}Workflow status{/i18n}</th> 45 <th>{i18n}Workflow status{/i18n}</th>
41 <td> 46 <td>
42 {if $workflow_state} 47 {if $workflow_state}
@@ -46,7 +51,7 @@ @@ -46,7 +51,7 @@
46 {/if}</td> 51 {/if}</td>
47 </tr> 52 </tr>
48 53
49 - <tr class="odd"> 54 + <tr class="even">
50 <th>{i18n}Document ID{/i18n}</th> 55 <th>{i18n}Document ID{/i18n}</th>
51 <td>{$document->getId()}</td> 56 <td>{$document->getId()}</td>
52 </tr> 57 </tr>
templates/kt3/fieldsets/generic_versioned.smarty
@@ -44,10 +44,14 @@ @@ -44,10 +44,14 @@
44 <td colspan="2">{$creator} ({$creation_date}) <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</td> 44 <td colspan="2">{$creator} ({$creation_date}) <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</td>
45 </tr> 45 </tr>
46 46
  47 + <tr class="even">
  48 + <th>{i18n}Owned by{/i18n}</th>
  49 + <td colspan="2">{$owner} <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</td>
  50 + </tr>
47 51
48 {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture} 52 {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture}
49 {capture assign="newval"}{$last_modified_by} ({$last_modified_date}){/capture} 53 {capture assign="newval"}{$last_modified_by} ({$last_modified_date}){/capture}
50 - <tr class="even"> 54 + <tr class="odd">
51 <th>{i18n}Last update by{/i18n}</th> 55 <th>{i18n}Last update by{/i18n}</th>
52 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td> 56 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td>
53 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td> 57 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td>
@@ -55,7 +59,7 @@ @@ -55,7 +59,7 @@
55 59
56 {capture assign="oldval"}{$comparison_document_type}{/capture} 60 {capture assign="oldval"}{$comparison_document_type}{/capture}
57 {capture assign="newval"}{$document_type}{/capture} 61 {capture assign="newval"}{$document_type}{/capture}
58 - <tr class="odd"> 62 + <tr class="even">
59 <th>{i18n}Document Type{/i18n}</th> 63 <th>{i18n}Document Type{/i18n}</th>
60 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td> 64 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td>
61 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td> 65 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td>
@@ -71,13 +75,13 @@ @@ -71,13 +75,13 @@
71 {else} 75 {else}
72 {i18n}No workflow{/i18n} 76 {i18n}No workflow{/i18n}
73 {/if}{/capture} 77 {/if}{/capture}
74 - <tr class="even"> 78 + <tr class="odd">
75 <th>{i18n}Workflow status{/i18n}</th> 79 <th>{i18n}Workflow status{/i18n}</th>
76 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td> 80 <td class="current {if ($oldval != $newval)}different{/if}">{$newval}</td>
77 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td> 81 <td class="previous {if ($oldval != $newval)}different{/if}">{$oldval}</td>
78 </tr> 82 </tr>
79 83
80 - <tr class="odd"> 84 + <tr class="even">
81 <th>{i18n}Document ID{/i18n}</th> 85 <th>{i18n}Document ID{/i18n}</th>
82 <td colspan="2">{$document->getId()} <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</span></td> 86 <td colspan="2">{$document->getId()} <span class="descriptiveText">({i18n}this cannot not change between versions{/i18n})</span></td>
83 </tr> 87 </tr>