function testDataCreatedAfterViewWasDisplayedOverLapEndTime()
 {
     $this->testDeleteTaskTableData();
     $this->setRDBMSTrue($this->getClassName($this));
     $this->visit('/task/1')->createDate()->type('16:00', '#startt-search')->wait(1000)->type('18:00', '#endt')->select('#taskType', 1)->type('rich was here', '#notes')->click('#saveButton')->notSee(appGlobals::getInfoMessageText(appGlobals::INFO_TIME_VALUE_OVERLAP));
     $this->setRDBMSFalse($this->getClassName($this));
 }
 /**
  * Display the specified resource.
  *
  * @param $timeCardHoursWorkedId
  *
  * @return \Illuminate\Http\Response|\Illuminate\View\View
  */
 public function show($timeCardHoursWorkedId)
 {
     // set appGlobal.clientId to current view, otherwise 'if (appGlobal.clientId)' in TimeCard.js causes a js load failure.
     appGlobals::populateJsGlobalClient();
     // used for routing.
     appGlobals::setSessionVariableAppGlobalTimeCardTableName($timeCardHoursWorkedId);
     // get all task for a specific time_card.date.
     /* @noinspection PhpUndefinedMethodInspection */
     $tasks = Task::where('time_card_hours_worked_id', '=', $timeCardHoursWorkedId)->get()->sortBy('start_time');
     // derive total hours worked.
     $totalHoursWorked = 0;
     foreach ($tasks as $task) {
         $totalHoursWorked += $task->hours_worked;
     }
     // eager load task_type for each task.
     /* @noinspection PhpUndefinedMethodInspection */
     $tasks->load('taskType');
     // get time_card data.
     /* @noinspection PhpUndefinedMethodInspection */
     $timeCard = TimeCardHoursWorked::where('id', '=', $timeCardHoursWorkedId)->get();
     // check if $timeCardHoursWorkedId exists, if not return 404 message.
     if (count($timeCard) == 0) {
         abort(404, 'Your Task ID does not exist.');
     }
     // pass the data to the view.
     return view('pages.userTaskView')->with('tasks', $tasks)->with('timeCard', $timeCard)->with('timeCardHoursWorkedId', $timeCardHoursWorkedId)->with('totalHoursWorked', $totalHoursWorked);
 }
Exemple #3
0
 /**
  * reads Project table by unique index
  *  - if not found, emit a not found message.
  *  - if found return the $project record to the caller.
  *
  * @param [in] $text
  * @return a record.
  */
 public static function checkIfExists($text)
 {
     $project = Project::where('name', '=', $text)->first();
     if (!is_null($project)) {
         appGlobals::existsMessage(appGlobals::getProjectTableName(), $project->name, $project->id);
     }
     return $project;
 }
Exemple #4
0
 /**
  * reads Project table by unique index
  *  - if not found, emit a not found message.
  *  - if found return the $project record to the caller.
  *
  * @param [in] $text
  * @return a record.
  */
 public static function checkIfExists($text)
 {
     $client = Client::where('name', '=', $text)->first();
     if (!is_null($client)) {
         appGlobals::existsMessage(appGlobals::getClientTableName(), $client->name, $client->id);
     }
     return $client;
 }
Exemple #5
0
 public static function checkIfExists($startTime)
 {
     $task = self::getStartTime($startTime);
     if (!is_null($task)) {
         appGlobals::existsMessage(appGlobals::getTaskTableName(), $task->start_time, $task->id);
     }
     return $task;
 }
 public static function checkIfExists($text)
 {
     $timeCardFormat = TimeCardFormat::where('description', '=', $text)->first();
     if (!is_null($timeCardFormat)) {
         appGlobals::existsMessage(appGlobals::getTimeCardFormatTableName(), $timeCardFormat->description, $timeCardFormat->id);
     }
     return $timeCardFormat;
 }
 /**
  * @param $timeCardHoursWorked
  *
  * @return mixed
  */
 public static function checkIfExists($timeCardHoursWorked)
 {
     $timeCardHoursWorked = self::where('time_card_id', '=', $timeCardHoursWorked->time_card_id)->first();
     if (!is_null($timeCardHoursWorked)) {
         appGlobals::existsMessage(appGlobals::getTimeCardHoursWorkedTableName(), $timeCardHoursWorked->time_card_id, $timeCardHoursWorked->date_worked);
     }
     return $timeCardHoursWorked;
 }
Exemple #8
0
 public static function checkIfExists($text)
 {
     $work = Work::where('work_type_description', '=', $text)->first();
     if (!is_null($work)) {
         appGlobals::existsMessage(appGlobals::getWorkTableName(), $work->work_type_description, $work->id);
     }
     return $work;
 }
Exemple #9
0
 /**
  * reads Project table by unique index
  *  - if not found, emit a not found message.
  *  - if found return the $project record to the caller.
  *
  * @param [in] $text
  * @return record.
  */
 public static function checkIfExists($text)
 {
     $workType = WorkType::where('type', '=', $text)->first();
     if (!is_null($workType)) {
         appGlobals::existsMessage(appGlobals::getWorkTypeTableName(), $workType->type, $workType->id);
     }
     return $workType;
 }
Exemple #10
0
 /**
  * If time card found set $inTimeCard to found time card.  If not found don't $inTimeCard.
  *
  * @param $inTimeCard
  *
  * @return mixed
  */
 public static function checkIfExists(&$inTimeCard)
 {
     $timeCard = self::where('work_id', $inTimeCard->work_id)->where('time_card_format_id', '=', $inTimeCard->time_card_format_id)->first();
     if (!is_null($timeCard)) {
         $inTimeCard = $timeCard;
         appGlobals::existsMessage(appGlobals::getTimeCardTableName(), $timeCard->iso_beginning_dow_date, $timeCard->id);
     }
     return $timeCard;
 }
 /**
  * @param $timeCardId
  */
 private function setGlobals($timeCardId)
 {
     // set appGlobal.clientId to current view, otherwise 'if (appGlobal.clientId)' in TimeCard.js causes js load failure.
     appGlobals::populateJsGlobalClient();
     // set appGlobal.taskTypeUpdateURI for ajax update routing.
     appGlobals::populateJsGlobalTaskTypeUpdateURI();
     // set appGlobal.ttvTypeClearText when phpunit selenium testing, only.
     appGlobals::populateJsGlobalTtvTypeClearTextTrue();
     // correctly sets the back button if the $timeCardId has been passed, the back button is set, else not.
     if (is_null($timeCardId)) {
         session()->forget(appGlobals::getTaskTableName());
     } else {
         session()->set(appGlobals::getTaskTableName(), $timeCardId);
     }
 }
Exemple #12
0
 public function created($task)
 {
     appGlobals::createdMessage(appGlobals::getTaskTableName(), $task->start_time, $task->id);
 }
 /**
  * post successful call to the save() method
  * @param $project
  */
 public function created($workType)
 {
     appGlobals::createdMessage(appGlobals::getWorkTypeTableName(), $workType->type, $workType->id);
 }
 public function created($timeCard)
 {
     appGlobals::createdMessage(appGlobals::getTimeCardTableName(), $timeCard->iso_beginning_dow_date, $timeCard->id);
 }
 /**
  * post successful call to the save() method
  * @param $project
  */
 public function created($client)
 {
     appGlobals::createdMessage(appGlobals::getClientTableName(), $client->name, $client->id);
 }
 public function created($timeCardHoursWorked)
 {
     appGlobals::createdMessage(appGlobals::getTimeCardHoursWorkedTableName(), $timeCardHoursWorked->date_worked, $timeCardHoursWorked->id);
 }
 /**
  * @param $timeCardRows
  *
  * @internal param Request $request
  */
 private function setValueUseByAppGlobal($timeCardRows)
 {
     // jeffery way's package for moving php variables to the .js space.
     // see https://github.com/laracasts/PHP-Vars-To-Js-Transformer.
     // also see javascript.php in the config dir for view and .js namespace used.
     appGlobals::populateJsGlobalSpace();
     // used for routing.
     $this->setRefreshButtonToCorrectTimeCardWorkedId($timeCardRows);
 }
 public function created($timeCardFormat)
 {
     appGlobals::createdMessage(appGlobals::getTimeCardFormatTableName(), $timeCardFormat->description, $timeCardFormat->id);
 }
 /**
  * post successful call to the save() method
  * @param $project
  */
 public function created($project)
 {
     appGlobals::createdMessage(appGlobals::getProjectTableName(), $project->name, $project->id);
 }
Exemple #20
0
 /**
  * @param $timeCardHoursWorkedId
  */
 public static function setSessionVariableAppGlobalTimeCardTableName($timeCardHoursWorkedId)
 {
     if (is_null($timeCardHoursWorkedId)) {
         \Session::forget(appGlobals::getTimeCardTableName());
     } else {
         \Session::set(appGlobals::getTimeCardTableName(), $timeCardHoursWorkedId);
     }
 }
Exemple #21
0
 public function created($work)
 {
     appGlobals::createdMessage(appGlobals::getWorkTableName(), $work->work_type_description, $work->id);
 }