Example #1
0
 public static function jiraCreateIssueLink($key)
 {
     return config('jiracal.jira_url') . 'secure/CreateIssue!default.jspa?pid=' . JiraCalHelper::jiraProjectID($key);
 }
Example #2
0
 /**
  * Display a day of the day
  * @param  String  $key     The project key
  * @param  Integer $year    The year to display
  * @param  Integer $month   The month to display
  * @param  Integer $day     The day to display
  * @return \Illuminate\Http\Response
  */
 public function day($key, $year, $month, $day)
 {
     if (!session('jira-auth')) {
         return redirect()->action('\\Josevh\\JiraCal\\JiraCalController@login')->withErrors(['message' => 'Login required']);
     }
     $key = strtoupper($key);
     $maxDays = date('t', mktime(0, 0, 0, $month, 1, $year));
     if ($day > $maxDays || $day == 0) {
         return redirect()->action('\\Josevh\\JiraCal\\JiraCalController@month', [$year, $month]);
     }
     $cDate = Carbon::createFromDate($year, $month, $day);
     $nDate = $cDate->copy()->addDay();
     $pDate = $cDate->copy()->subDay();
     $issues = JiraCalHelper::jiraIssues($key, $year, $month, $day, 'day');
     $createIssueLink = JiraCalHelper::jiraCreateIssueLink($key);
     return view('jiracal::_day', compact('year', 'month', 'day', 'issues', 'cDate', 'nDate', 'pDate', 'key', 'createIssueLink'));
 }