From: Nik Okuntseff Date: Wed, 21 Nov 2018 21:24:01 +0000 (+0000) Subject: Some more work in progress on subgroups. X-Git-Tag: timetracker_1.19-1~582 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6f1a57ddce604840c432915d97574f175b935475;p=timetracker.git Some more work in progress on subgroups. --- diff --git a/WEB-INF/templates/group_add.tpl b/WEB-INF/templates/group_add.tpl new file mode 100644 index 00000000..852f1b78 --- /dev/null +++ b/WEB-INF/templates/group_add.tpl @@ -0,0 +1,28 @@ +{$forms.groupForm.open} + + + + +
+ + + + + + + + + + + + + + + + + + + +
{$i18n.label.thing_name} (*):{$forms.groupForm.group_name.control}
{$i18n.label.description}:{$forms.groupForm.description.control}
{$i18n.label.required_fields}
 
{$forms.groupForm.btn_add.control}
+
+{$forms.groupForm.close} diff --git a/WEB-INF/templates/groups.tpl b/WEB-INF/templates/groups.tpl index d9748bcb..58105519 100644 --- a/WEB-INF/templates/groups.tpl +++ b/WEB-INF/templates/groups.tpl @@ -4,7 +4,8 @@ - + + @@ -12,6 +13,7 @@ {foreach $groups as $group} + diff --git a/dbinstall.php b/dbinstall.php index f87b2a4e..653d13a1 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -957,7 +957,7 @@ if ($_POST) { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11824"]) { + if ($_POST["convert11797to11826"]) { setChange("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); setChange("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); setChange("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); @@ -1086,7 +1086,7 @@ if ($_POST) {

DB Install

{$i18n.label.thing_name}{$i18n.label.thing_name}{$i18n.label.description} {$i18n.label.edit} {$i18n.label.delete}
{$group.name|escape}{$group.description|escape} {$i18n.label.edit} {$i18n.label.delete}
-
Create database structure (v1.18.24) + Create database structure (v1.18.26)
(applies only to new installations, do not execute when updating)
@@ -1131,8 +1131,8 @@ if ($_POST) { - Update database structure (v1.17.97 to v1.18.24) - + Update database structure (v1.17.97 to v1.18.26) + diff --git a/group_add.php b/group_add.php new file mode 100644 index 00000000..8bb8d003 --- /dev/null +++ b/group_add.php @@ -0,0 +1,78 @@ +isPost()) { + $cl_name = trim($request->getParameter('group_name')); + $cl_description = trim($request->getParameter('description')); +} + +$form = new Form('groupForm'); +$form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'group_name','value'=>$cl_group,'enable'=>$advanced_settings)); +$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description)); +$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add'))); + +if ($request->isPost()) { + // Validate user input. + if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); + if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); +/* + if ($err->no()) { + if (!ttProjectHelper::getProjectByName($cl_name)) { + if (ttProjectHelper::insert(array( + 'group_id' => $user->getActiveGroup(), + 'org_id' => $user->org_id, + 'name' => $cl_name, + 'description' => $cl_description, + 'users' => $cl_users, + 'tasks' => $cl_tasks, + 'status' => ACTIVE))) { + header('Location: projects.php'); + exit(); + } else + $err->add($i18n->get('error.db')); + } else + $err->add($i18n->get('error.project_exists')); + } +*/ +} // isPost + +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +//$smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"'); +$smarty->assign('title', $i18n->get('title.add_group')); +$smarty->assign('content_page_name', 'group_add.tpl'); +$smarty->display('index.tpl');