X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=role_add.php;h=bd9f3e46f12074a87715cf826a6d148c3f06821d;hb=ecf7d911c95935f8cfb2403f645cd12f93d8c3f5;hp=7a01cfcd1a6155c3c702a26b3f07aac246f4021e;hpb=ae00c14ac2999773e17a761542932cb95420430a;p=timetracker.git diff --git a/role_add.php b/role_add.php index 7a01cfcd..bd9f3e46 100644 --- a/role_add.php +++ b/role_add.php @@ -46,8 +46,7 @@ if ($request->isPost()) { $form = new Form('roleForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 250px;','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description)); -for ($i = 0; $i < $user->role; $i++) { - $existing_role_name = null; +for ($i = 0; $i < $user->rank; $i++) { $rank_data[] = $i; } $form->addInput(array('type'=>'combobox','name'=>'rank','data'=>$rank_data)); @@ -59,7 +58,7 @@ if ($request->isPost()) { if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description')); if ($err->no()) { - $existing_role = ttRoleHelper::getRoleByRank($cl_rank); + $existing_role = ttRoleHelper::getRoleByRank($cl_rank, $user->team_id); if (!$existing_role) { // Insert a role with default user rights. if (ttRoleHelper::insert(array(