X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fproject_add.php;h=c152006f3838d6085f7999120740b40ab57df1a7;hb=cabf2460445f26eded09e7d2c9c8cda97e8db593;hp=6f6f452d4ab34727fe7b6b5b1d4a653578810856;hpb=c059d4ceb33fc1a959028abd85808e33b910cf7e;p=timetracker.git diff --git a/mobile/project_add.php b/mobile/project_add.php index 6f6f452d..c152006f 100644 --- a/mobile/project_add.php +++ b/mobile/project_add.php @@ -36,7 +36,7 @@ if (!ttAccessAllowed('manage_projects')) { header('Location: access_denied.php'); exit(); } -if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) { +if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { header('Location: feature_disabled.php'); exit(); } @@ -49,6 +49,7 @@ foreach ($users as $user_item) $tasks = ttGroupHelper::getActiveTasks(); foreach ($tasks as $task_item) $all_tasks[$task_item['id']] = $task_item['name']; +$show_tasks = MODE_PROJECTS_AND_TASKS == $user->getTrackingMode() && count($tasks) > 0; if ($request->isPost()) { $cl_name = trim($request->getParameter('project_name')); @@ -66,7 +67,7 @@ $form = new Form('projectForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','class'=>'mobile-textarea','value'=>$cl_description)); $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users)); -if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) +if ($show_tasks) $form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks)); $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add'))); @@ -95,6 +96,8 @@ if ($request->isPost()) { $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"'); +$smarty->assign('show_users', count($users) > 0); +$smarty->assign('show_tasks', $show_tasks); $smarty->assign('title', $i18n->get('title.add_project')); $smarty->assign('content_page_name', 'mobile/project_add.tpl'); $smarty->display('mobile/index.tpl');