summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-04-13 17:32:53 +0200
committerSimon2011-04-13 17:32:53 +0200
commitf86b5fdf8e8ff6374c64c62792ac73bd787dc765 (patch)
tree14276905dca0d345fc4d507adbf9f559bfcd54fb
parentGroups - Rechte & RootNode darf keine Eltern (diff)
downloadpbs2-f86b5fdf8e8ff6374c64c62792ac73bd787dc765.tar.gz
pbs2-f86b5fdf8e8ff6374c64c62792ac73bd787dc765.tar.xz
pbs2-f86b5fdf8e8ff6374c64c62792ac73bd787dc765.zip
Superordinated Group ist immer die aktuelle Gruppe
-rw-r--r--application/modules/user/controllers/GroupController.php3
-rw-r--r--application/modules/user/forms/GroupAdd.php4
-rw-r--r--library/Pbs/Graph.php10
-rw-r--r--pbs.sql2
4 files changed, 15 insertions, 4 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index b66f368..0502a34 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -149,7 +149,8 @@ class User_GroupController extends Zend_Controller_Action
}
if($_POST['superordinatedGroupID'] != -1) {
$groupgroups = new Application_Model_GroupGroups();
- $groupgroups->setParentID($_POST['superordinatedGroupID']);
+ #print_a($this->membership->getGroupID(),$this->membership);
+ $groupgroups->setParentID($this->membership->getGroupID());
$groupgroups->setGroupID($groupID);
try {
$this->groupGroupsMapper->save($groupgroups);
diff --git a/application/modules/user/forms/GroupAdd.php b/application/modules/user/forms/GroupAdd.php
index b1ae0ee..52fdd32 100644
--- a/application/modules/user/forms/GroupAdd.php
+++ b/application/modules/user/forms/GroupAdd.php
@@ -32,7 +32,7 @@ class user_Form_GroupAdd extends Zend_Form
'required' => false,
'label' => 'Description:',
));
-
+ /*
$groupfield = $this->createElement('select','superordinatedGroupID');
$groupfield ->setLabel('superordinated Group:');
@@ -45,7 +45,7 @@ class user_Form_GroupAdd extends Zend_Form
}
$groupfield->setRegisterInArrayValidator(false);
$this->addElement($groupfield);
-
+ */
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php
index e7ebc55..e42b9d4 100644
--- a/library/Pbs/Graph.php
+++ b/library/Pbs/Graph.php
@@ -15,6 +15,9 @@ class Pbs_Graph{
$db = $this->db;
+ $path = "../resources/groupgraphs/";
+ @mkdir($path ,0777, true);
+
$this->graphstring = 'digraph groups {
size="5,5";
pad=0.1;
@@ -25,6 +28,13 @@ class Pbs_Graph{
$this->getParentGroups($groupID);
$this->getChildGroups($groupID);
$this->graphstring .= '}';
+
+ // for debugging
+ # $fp = fopen($path.'thisgraph.dot', "w");
+ # fputs ($fp, $this->graphstring);
+ # fclose ($fp);
+
+
$this->graphstring = str_replace(array("\t","\n"),"",$this->graphstring);
$this->graphstring = str_replace('"','\"',$this->graphstring);
diff --git a/pbs.sql b/pbs.sql
index 7ff2e11..c245f03 100644
--- a/pbs.sql
+++ b/pbs.sql
@@ -4,7 +4,7 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `pbs_group` (
`groupID` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
+ `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
`description` varchar(140) COLLATE utf8_unicode_ci,
PRIMARY KEY (`groupID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;