- if ($_POST['btn_submit']){
- // User pressed the Save button under monthly quotas table.
- $postedYear = $request->getParameter('year');
- $selectedYear = intval($postedYear);
+ // Finished validating user input.
+
+ if ($err->no()) {
+
+ // Handle workday hours.
+ $workday_minutes = ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours'));
+ if ($workday_minutes != $user->getWorkdayMinutes()) {
+ if (!$user->updateGroup(array('workday_minutes'=>$workday_minutes)))
+ $err->add($i18n->get('error.db'));
+ }
+
+ // Handle monthly quotas for a selected year.
+ $selectedYear = (int) $request->getParameter('year');