From: Nik Okuntseff Date: Wed, 4 Apr 2018 22:56:37 +0000 (+0000) Subject: Renamed a few files. X-Git-Tag: timetracker_1.19-1~876 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8aef74b216afaf7d9a19e069a68807b54e71267e;p=timetracker.git Renamed a few files. --- diff --git a/WEB-INF/templates/admin_teams.tpl b/WEB-INF/templates/admin_teams.tpl index aa017883..40207c8a 100644 --- a/WEB-INF/templates/admin_teams.tpl +++ b/WEB-INF/templates/admin_teams.tpl @@ -22,8 +22,8 @@ {$team.name|escape} {$team.date} {$team.lang} - {$i18n.label.edit} - {$i18n.label.delete} + {$i18n.label.edit} + {$i18n.label.delete} {/foreach} {/if} @@ -34,7 +34,7 @@
-  {$i18n.label.or}  +  {$i18n.label.or} 
diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ce32bb19..b526292a 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.86.4225 | Copyright © Anuko | +  Anuko Time Tracker 1.17.86.4226 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/admin_group_add.php b/admin_group_add.php new file mode 100644 index 00000000..7904d9f2 --- /dev/null +++ b/admin_group_add.php @@ -0,0 +1,120 @@ +isPost()) { + $cl_team_name = trim($request->getParameter('team_name')); + $cl_lang = $request->getParameter('lang'); + $cl_manager_name = trim($request->getParameter('manager_name')); + $cl_manager_login = trim($request->getParameter('manager_login')); + if (!$auth->isPasswordExternal()) { + $cl_password1 = $request->getParameter('password1'); + $cl_password2 = $request->getParameter('password2'); + } + $cl_manager_email = trim($request->getParameter('manager_email')); +} else + $cl_lang = $i18n->lang; // Browser setting from initialize.php. + +$form = new Form('teamForm'); +$form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'team_name','value'=>$cl_team_name)); + +// Prepare an array of available languages. +$lang_files = I18n::getLangFileList(); +foreach ($lang_files as $lfile) { + $content = file(RESOURCE_DIR."/".$lfile); + $lname = ''; + foreach ($content as $line) { + if (strstr($line, 'i18n_language')) { + $a = explode('=', $line); + $lname = trim(str_replace(';','',str_replace("'","",$a[1]))); + break; + } + } + unset($content); + $longname_lang[] = array('id'=>I18n::getLangFromFilename($lfile),'name'=>$lname); +} +$longname_lang = mu_sort($longname_lang, 'name'); +$form->addInput(array('type'=>'combobox','name'=>'lang','style'=>'width: 200px','data'=>$longname_lang,'datakeys'=>array('id','name'),'value'=>$cl_lang)); + +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_name','value'=>$cl_manager_name)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_login','value'=>$cl_manager_login)); +if (!$auth->isPasswordExternal()) { + $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password1','value'=>$cl_password1)); + $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2)); +} +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email)); +$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit'))); + +if ($request->isPost()) { + + /* + * Note: creating a group by admin is pretty much the same as self-registration, + * except that created_by fields for group and user must be set to admin account. + * Therefore, we'll reuse ttRegistrator instance to create a group here + * and override created_by fields using ttRegistrator::setCreatedBy() function. + */ + + // Create fields array for ttRegistrator instance. + if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$'); + $fields = array( + 'user_name' => $cl_manager_name, + 'login' => $cl_manager_login, + 'password1' => $cl_password1, + 'password2' => $cl_password2, + 'email' => $cl_manager_email, + 'group_name' => $cl_team_name, + 'currency' => CURRENCY_DEFAULT, + 'lang' => $cl_lang); + + // Create an instance of ttRegistrator class. + import('ttRegistrator'); + $registrator = new ttRegistrator($fields, $err); + $registrator->register(); + $registrator->setCreatedBy($user->id); // Override created_by to admin account. + if ($err->no()) { + header('Location: admin_groups.php'); + exit(); + } +} // isPost + +$smarty->assign('auth_external', $auth->isPasswordExternal()); +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('onload', 'onLoad="document.teamForm.team.focus()"'); +$smarty->assign('content_page_name', 'admin_team_add.tpl'); +$smarty->assign('title', $i18n->get('title.create_group')); +$smarty->display('index.tpl'); diff --git a/admin_group_delete.php b/admin_group_delete.php new file mode 100644 index 00000000..99d508fb --- /dev/null +++ b/admin_group_delete.php @@ -0,0 +1,70 @@ +getParameter('id'); +$team_details = ttTeamHelper::getTeamDetails($group_id); +$team_name = $team_details['team_name']; + +$form = new Form('teamForm'); +$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id)); +$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); +$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); + +if ($request->isPost()) { + if ($request->getParameter('btn_delete')) { + import('ttAdmin'); + $admin = new ttAdmin(); + $result = $admin->markGroupDeleted($group_id); + if ($result) { + header('Location: admin_groups.php'); + exit(); + } else + $err->add($i18n->get('error.db')); + } + + if ($request->getParameter('btn_cancel')) { + header('Location: admin_groups.php'); + exit(); + } +} // isPost + +$smarty->assign('team_to_delete', $team_name); +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('title', $i18n->get('title.delete_group')); +$smarty->assign('content_page_name', 'admin_team_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_group_edit.php b/admin_group_edit.php new file mode 100644 index 00000000..0efca4f6 --- /dev/null +++ b/admin_group_edit.php @@ -0,0 +1,109 @@ +getParameter('id'); +$team_details = ttTeamHelper::getTeamDetails($group_id); + +if ($request->isPost()) { + $cl_team_name = trim($request->getParameter('team_name')); + $cl_manager_name = trim($request->getParameter('manager_name')); + $cl_manager_login = trim($request->getParameter('manager_login')); + if (!$auth->isPasswordExternal()) { + $cl_password1 = $request->getParameter('password1'); + $cl_password2 = $request->getParameter('password2'); + } + $cl_manager_email = trim($request->getParameter('manager_email')); +} else { + $cl_team_name = $team_details['team_name']; + $cl_manager_name = $team_details['manager_name']; + $cl_manager_login = $team_details['manager_login']; + if (!$auth->isPasswordExternal()) { + $cl_password1 = $cl_password2 = ''; + } + $cl_manager_email = $team_details['manager_email']; +} + +$form = new Form('teamForm'); +$form->addInput(array('type'=>'text','maxlength'=>'80','name'=>'team_name','value'=>$cl_team_name)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_name','value'=>$cl_manager_name)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_login','value'=>$cl_manager_login)); +if (!$auth->isPasswordExternal()) { + $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password1','value'=>$cl_password1)); + $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2)); +} +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email)); +$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id)); +$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); +$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); + +if ($request->isPost()) { + if ($request->getParameter('btn_save')) { + // Create fields array for ttAdmin instance. + $fields = array( + 'old_group_name' => $team_details['team_name'], + 'new_group_name' => $cl_team_name, + 'user_id' => $team_details['manager_id'], + 'user_name' => $cl_manager_name, + 'old_login' => $team_details['manager_login'], + 'new_login' => $cl_manager_login, + 'password1' => $cl_password1, + 'password2' => $cl_password2, + 'email' => $cl_manager_email); + + import('ttAdmin'); + $admin = new ttAdmin($err); + $result = $admin->updateGroup($group_id, $fields); + if ($result) { + header('Location: admin_groups.php'); + exit(); + } + } + + if ($request->getParameter('btn_cancel')) { + header('Location: admin_groups.php'); + exit(); + } +} // isPost + +$smarty->assign('auth_external', $auth->isPasswordExternal()); +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('onload', 'onLoad="document.teamForm.manager_name.focus()"'); +$smarty->assign('title', $i18n->get('title.edit_group')); +$smarty->assign('content_page_name', 'admin_team_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_team_add.php b/admin_team_add.php deleted file mode 100644 index 7904d9f2..00000000 --- a/admin_team_add.php +++ /dev/null @@ -1,120 +0,0 @@ -isPost()) { - $cl_team_name = trim($request->getParameter('team_name')); - $cl_lang = $request->getParameter('lang'); - $cl_manager_name = trim($request->getParameter('manager_name')); - $cl_manager_login = trim($request->getParameter('manager_login')); - if (!$auth->isPasswordExternal()) { - $cl_password1 = $request->getParameter('password1'); - $cl_password2 = $request->getParameter('password2'); - } - $cl_manager_email = trim($request->getParameter('manager_email')); -} else - $cl_lang = $i18n->lang; // Browser setting from initialize.php. - -$form = new Form('teamForm'); -$form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'team_name','value'=>$cl_team_name)); - -// Prepare an array of available languages. -$lang_files = I18n::getLangFileList(); -foreach ($lang_files as $lfile) { - $content = file(RESOURCE_DIR."/".$lfile); - $lname = ''; - foreach ($content as $line) { - if (strstr($line, 'i18n_language')) { - $a = explode('=', $line); - $lname = trim(str_replace(';','',str_replace("'","",$a[1]))); - break; - } - } - unset($content); - $longname_lang[] = array('id'=>I18n::getLangFromFilename($lfile),'name'=>$lname); -} -$longname_lang = mu_sort($longname_lang, 'name'); -$form->addInput(array('type'=>'combobox','name'=>'lang','style'=>'width: 200px','data'=>$longname_lang,'datakeys'=>array('id','name'),'value'=>$cl_lang)); - -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_name','value'=>$cl_manager_name)); -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_login','value'=>$cl_manager_login)); -if (!$auth->isPasswordExternal()) { - $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password1','value'=>$cl_password1)); - $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2)); -} -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email)); -$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit'))); - -if ($request->isPost()) { - - /* - * Note: creating a group by admin is pretty much the same as self-registration, - * except that created_by fields for group and user must be set to admin account. - * Therefore, we'll reuse ttRegistrator instance to create a group here - * and override created_by fields using ttRegistrator::setCreatedBy() function. - */ - - // Create fields array for ttRegistrator instance. - if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$'); - $fields = array( - 'user_name' => $cl_manager_name, - 'login' => $cl_manager_login, - 'password1' => $cl_password1, - 'password2' => $cl_password2, - 'email' => $cl_manager_email, - 'group_name' => $cl_team_name, - 'currency' => CURRENCY_DEFAULT, - 'lang' => $cl_lang); - - // Create an instance of ttRegistrator class. - import('ttRegistrator'); - $registrator = new ttRegistrator($fields, $err); - $registrator->register(); - $registrator->setCreatedBy($user->id); // Override created_by to admin account. - if ($err->no()) { - header('Location: admin_groups.php'); - exit(); - } -} // isPost - -$smarty->assign('auth_external', $auth->isPasswordExternal()); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.teamForm.team.focus()"'); -$smarty->assign('content_page_name', 'admin_team_add.tpl'); -$smarty->assign('title', $i18n->get('title.create_group')); -$smarty->display('index.tpl'); diff --git a/admin_team_delete.php b/admin_team_delete.php deleted file mode 100644 index 99d508fb..00000000 --- a/admin_team_delete.php +++ /dev/null @@ -1,70 +0,0 @@ -getParameter('id'); -$team_details = ttTeamHelper::getTeamDetails($group_id); -$team_name = $team_details['team_name']; - -$form = new Form('teamForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_delete')) { - import('ttAdmin'); - $admin = new ttAdmin(); - $result = $admin->markGroupDeleted($group_id); - if ($result) { - header('Location: admin_groups.php'); - exit(); - } else - $err->add($i18n->get('error.db')); - } - - if ($request->getParameter('btn_cancel')) { - header('Location: admin_groups.php'); - exit(); - } -} // isPost - -$smarty->assign('team_to_delete', $team_name); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.delete_group')); -$smarty->assign('content_page_name', 'admin_team_delete.tpl'); -$smarty->display('index.tpl'); diff --git a/admin_team_edit.php b/admin_team_edit.php deleted file mode 100644 index 0efca4f6..00000000 --- a/admin_team_edit.php +++ /dev/null @@ -1,109 +0,0 @@ -getParameter('id'); -$team_details = ttTeamHelper::getTeamDetails($group_id); - -if ($request->isPost()) { - $cl_team_name = trim($request->getParameter('team_name')); - $cl_manager_name = trim($request->getParameter('manager_name')); - $cl_manager_login = trim($request->getParameter('manager_login')); - if (!$auth->isPasswordExternal()) { - $cl_password1 = $request->getParameter('password1'); - $cl_password2 = $request->getParameter('password2'); - } - $cl_manager_email = trim($request->getParameter('manager_email')); -} else { - $cl_team_name = $team_details['team_name']; - $cl_manager_name = $team_details['manager_name']; - $cl_manager_login = $team_details['manager_login']; - if (!$auth->isPasswordExternal()) { - $cl_password1 = $cl_password2 = ''; - } - $cl_manager_email = $team_details['manager_email']; -} - -$form = new Form('teamForm'); -$form->addInput(array('type'=>'text','maxlength'=>'80','name'=>'team_name','value'=>$cl_team_name)); -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_name','value'=>$cl_manager_name)); -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_login','value'=>$cl_manager_login)); -if (!$auth->isPasswordExternal()) { - $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password1','value'=>$cl_password1)); - $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2)); -} -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email)); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_save')) { - // Create fields array for ttAdmin instance. - $fields = array( - 'old_group_name' => $team_details['team_name'], - 'new_group_name' => $cl_team_name, - 'user_id' => $team_details['manager_id'], - 'user_name' => $cl_manager_name, - 'old_login' => $team_details['manager_login'], - 'new_login' => $cl_manager_login, - 'password1' => $cl_password1, - 'password2' => $cl_password2, - 'email' => $cl_manager_email); - - import('ttAdmin'); - $admin = new ttAdmin($err); - $result = $admin->updateGroup($group_id, $fields); - if ($result) { - header('Location: admin_groups.php'); - exit(); - } - } - - if ($request->getParameter('btn_cancel')) { - header('Location: admin_groups.php'); - exit(); - } -} // isPost - -$smarty->assign('auth_external', $auth->isPasswordExternal()); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.teamForm.manager_name.focus()"'); -$smarty->assign('title', $i18n->get('title.edit_group')); -$smarty->assign('content_page_name', 'admin_team_edit.tpl'); -$smarty->display('index.tpl');