diff options
| -rw-r--r-- | application/modules/user/controllers/GroupController.php | 3 | ||||
| -rw-r--r-- | application/modules/user/forms/GroupAdd.php | 4 | ||||
| -rw-r--r-- | library/Pbs/Graph.php | 10 | ||||
| -rw-r--r-- | pbs.sql | 2 |
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); @@ -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 ; |
