Commit 0fc58a4a3e96c878aaa37fddc7e11e90a94b8765

Authored by michael
1 parent 18e5478b

formatted


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1562 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/assignGroupToUnitBL.php
... ... @@ -10,65 +10,51 @@
10 10 require_once("../../../../../config/dmsDefaults.php");
11 11  
12 12 if (checkSession()) {
13   - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");
14   - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc");
15   - require_once("assignGroupToUnitUI.inc");
16   - require_once("$default->fileSystemRoot/lib/unitmanagement/Unit.inc");
17   - require_once("$default->fileSystemRoot/lib/groups/Group.inc");
18   - require_once("$default->fileSystemRoot/lib/groups/GroupUnitLink.inc");
19   - require_once("$default->fileSystemRoot/lib/security/permission.inc");
20   - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
21   - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
22   - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
23   - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
24   - require_once("$default->fileSystemRoot/presentation/Html.inc");
25   -
26   -
27   - $oPatternCustom = & new PatternCustom();
28   -
29   - if(!isset($fGroupSet)){
30   - // build first page
31   -
32   - $oPatternCustom->setHtml(getPage(null,null));
33   - $main->setFormAction($_SERVER["PHP_SELF"] . "?fGroupSet=1");
34   -
35   - }else{
36   -
37   - // do a check to see both drop downs selected
38   - if($fGroupID == -1 Or $fUnitID ==-1){
39   -
40   - $oPatternCustom->setHtml(getPageNotSelected());
41   -
42   -
43   - }else{ //check if it belongs to a unit
44   - $unitLink = GroupUnitLink::groupBelongsToUnit($fGroupID);
45   -
46   - // if it does'nt ..then go to normal page
47   - if($unitLink == false){
48   -
49   - $oPatternCustom->setHtml(getPage($fGroupID,$fUnitID));
50   - $main->setFormAction($_SERVER["PHP_SELF"] . "?fGroupSet=1&fGroupAssign=1");
51   -
52   - }else{
53   - //if it does...then go to failure page
54   - $oPatternCustom->setHtml(getPageFail($fGroupID));
55   -
56   - }
57   - }
58   - }
59   -
60   - if (isset($fGroupAssign)){
61   -
62   - // else add to db and then goto page succes
63   - $oGroupUnit = new GroupUnitLink($fGroupID,$fUnitID);
64   - $oGroupUnit->create();
65   - $oPatternCustom->setHtml(getPageSuccess());
66   -
67   - }
68   -
69   - // render page
70   - $main->setCentralPayload($oPatternCustom);
71   - $main->render();
72   -
  13 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc");
  14 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc");
  15 + require_once("assignGroupToUnitUI.inc");
  16 + require_once("$default->fileSystemRoot/lib/unitmanagement/Unit.inc");
  17 + require_once("$default->fileSystemRoot/lib/groups/Group.inc");
  18 + require_once("$default->fileSystemRoot/lib/groups/GroupUnitLink.inc");
  19 + require_once("$default->fileSystemRoot/lib/security/permission.inc");
  20 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  21 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
  22 + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
  23 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
  24 + require_once("$default->fileSystemRoot/presentation/Html.inc");
  25 +
  26 + $oPatternCustom = & new PatternCustom();
  27 +
  28 + if(!isset($fGroupSet)) {
  29 + // build first page
  30 + $oPatternCustom->setHtml(getPage(null,null));
  31 + $main->setFormAction($_SERVER["PHP_SELF"] . "?fGroupSet=1");
  32 + } else {
  33 + // do a check to see both drop downs selected
  34 + if($fGroupID == -1 Or $fUnitID ==-1) {
  35 + $oPatternCustom->setHtml(getPageNotSelected());
  36 + } else { //check if it belongs to a unit
  37 + $unitLink = GroupUnitLink::groupBelongsToUnit($fGroupID);
  38 + // if it does'nt ..then go to normal page
  39 + if($unitLink == false) {
  40 + $oPatternCustom->setHtml(getPage($fGroupID,$fUnitID));
  41 + $main->setFormAction($_SERVER["PHP_SELF"] . "?fGroupSet=1&fGroupAssign=1");
  42 + } else {
  43 + //if it does...then go to failure page
  44 + $oPatternCustom->setHtml(getPageFail($fGroupID));
  45 + }
  46 + }
  47 + }
  48 +
  49 + if (isset($fGroupAssign)) {
  50 + // else add to db and then goto page succes
  51 + $oGroupUnit = new GroupUnitLink($fGroupID,$fUnitID);
  52 + $oGroupUnit->create();
  53 + $oPatternCustom->setHtml(getPageSuccess());
  54 + }
  55 +
  56 + // render page
  57 + $main->setCentralPayload($oPatternCustom);
  58 + $main->render();
73 59 }
74 60 ?>
... ...