mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Bug fixes
This commit is contained in:
parent
5bf287f51a
commit
9d96a9daed
@ -36,8 +36,6 @@ class TaskController extends BaseController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
self::checkTimezone();
|
||||
|
||||
return View::make('list', array(
|
||||
'entityType' => ENTITY_TASK,
|
||||
'title' => trans('texts.tasks'),
|
||||
@ -128,16 +126,14 @@ class TaskController extends BaseController
|
||||
*/
|
||||
public function create($clientPublicId = 0)
|
||||
{
|
||||
self::checkTimezone();
|
||||
|
||||
$data = [
|
||||
'task' => null,
|
||||
'clientPublicId' => Input::old('client') ? Input::old('client') : $clientPublicId,
|
||||
'method' => 'POST',
|
||||
'url' => 'tasks',
|
||||
'title' => trans('texts.new_task'),
|
||||
'timezone' => Auth::user()->account->timezone->name,
|
||||
'datetimeFormat' => Auth::user()->account->datetime_format ? Auth::user()->account->datetime_format->format_moment : 'DD/MMM/YYYY h:mm:ss a'
|
||||
'timezone' => Auth::user()->account->timezone ? Auth::user()->account->timezone->name : DEFAULT_TIMEZONE,
|
||||
'datetimeFormat' => Auth::user()->account->datetime_format ? Auth::user()->account->datetime_format->format_moment : DEFAULT_DATETIME_MOMENT_FORMAT
|
||||
];
|
||||
|
||||
$data = array_merge($data, self::getViewModel());
|
||||
@ -153,8 +149,6 @@ class TaskController extends BaseController
|
||||
*/
|
||||
public function edit($publicId)
|
||||
{
|
||||
self::checkTimezone();
|
||||
|
||||
$task = Task::scope($publicId)->with('client', 'invoice')->firstOrFail();
|
||||
|
||||
$actions = [];
|
||||
@ -187,8 +181,8 @@ class TaskController extends BaseController
|
||||
'title' => trans('texts.edit_task'),
|
||||
'duration' => $task->is_running ? $task->getCurrentDuration() : $task->getDuration(),
|
||||
'actions' => $actions,
|
||||
'timezone' => Auth::user()->account->timezone->name,
|
||||
'datetimeFormat' => Auth::user()->account->datetime_format ? Auth::user()->account->datetime_format->format_moment : 'DD/MMM/YYYY h:mm:ss a'
|
||||
'timezone' => Auth::user()->account->timezone ? Auth::user()->account->timezone->name : DEFAULT_TIMEZONE,
|
||||
'datetimeFormat' => Auth::user()->account->datetime_format ? Auth::user()->account->datetime_format->format_moment : DEFAULT_DATETIME_MOMENT_FORMAT
|
||||
];
|
||||
|
||||
$data = array_merge($data, self::getViewModel());
|
||||
@ -287,12 +281,4 @@ class TaskController extends BaseController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function checkTimezone()
|
||||
{
|
||||
if (!Auth::user()->account->timezone) {
|
||||
$link = link_to('/company/details?focus=timezone_id', trans('texts.click_here'), ['target' => '_blank']);
|
||||
Session::flash('warning', trans('texts.timezone_unset', ['link' => $link]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -338,6 +338,7 @@ if (!defined('CONTACT_EMAIL')) {
|
||||
define('DEFAULT_DATE_FORMAT', 'M j, Y');
|
||||
define('DEFAULT_DATE_PICKER_FORMAT', 'M d, yyyy');
|
||||
define('DEFAULT_DATETIME_FORMAT', 'F j, Y, g:i a');
|
||||
define('DEFAULT_DATETIME_MOMENT_FORMAT', 'MMM D, YYYY h:mm:ss a');
|
||||
define('DEFAULT_QUERY_CACHE', 120); // minutes
|
||||
define('DEFAULT_LOCALE', 'en');
|
||||
|
||||
|
@ -743,4 +743,13 @@ class Utils
|
||||
return $values;
|
||||
}
|
||||
}
|
||||
|
||||
// nouns in German and French should be uppercase
|
||||
public static function transFlowText($key) {
|
||||
$str = trans("texts.$key");
|
||||
if (!in_array(App::getLocale(), ['de', 'fr'])) {
|
||||
$str = strtolower($str);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ class Mailer
|
||||
return true;
|
||||
} catch (Exception $exception) {
|
||||
if (isset($_ENV['POSTMARK_API_TOKEN'])) {
|
||||
//dd($exception->getResponse());
|
||||
$response = $exception->getResponse()->getBody()->getContents();
|
||||
$response = json_decode($response);
|
||||
return nl2br($response->Message);
|
||||
|
@ -37,11 +37,8 @@ class AppServiceProvider extends ServiceProvider {
|
||||
|
||||
$str = '<li class="dropdown '.$class.'">
|
||||
<a href="'.URL::to($types).'" class="dropdown-toggle">'.trans("texts.$types").'</a>
|
||||
<ul class="dropdown-menu" id="menu1">';
|
||||
|
||||
if ($type != ENTITY_TASK || Auth::user()->account->timezone_id) {
|
||||
$str .= '<li><a href="'.URL::to($types.'/create').'">'.trans("texts.new_$type").'</a></li>';
|
||||
}
|
||||
<ul class="dropdown-menu" id="menu1">
|
||||
<li><a href="'.URL::to($types.'/create').'">'.trans("texts.new_$type").'</a></li>';
|
||||
|
||||
if ($type == ENTITY_INVOICE) {
|
||||
$str .= '<li><a href="'.URL::to('recurring_invoices/create').'">'.trans("texts.new_recurring_invoice").'</a></li>';
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
|
||||
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
|
||||
{{ Session::get("show_trash:{$entityType}") ? 'checked' : ''}}/> {{ trans('texts.show_archived_deleted')}} {{ strtolower(trans('texts.'.$entityType.'s')) }}
|
||||
{{ Session::get("show_trash:{$entityType}") ? 'checked' : ''}}/> {{ trans('texts.show_archived_deleted')}} {{ Utils::transFlowText($entityType.'s') }}
|
||||
</label>
|
||||
|
||||
<div id="top_right_buttons" class="pull-right">
|
||||
@ -31,9 +31,8 @@
|
||||
{!! Button::normal(trans('texts.credits'))->asLinkTo(URL::to('/credits'))->appendIcon(Icon::create('list')) !!}
|
||||
@endif
|
||||
|
||||
@if ($entityType != ENTITY_TASK || Auth::user()->account->timezone_id)
|
||||
{!! Button::primary(trans("texts.new_$entityType"))->asLinkTo(URL::to("/{$entityType}s/create"))->appendIcon(Icon::create('plus-sign')) !!}
|
||||
@endif
|
||||
{!! Button::primary(trans("texts.new_$entityType"))->asLinkTo(URL::to("/{$entityType}s/create"))->appendIcon(Icon::create('plus-sign')) !!}
|
||||
|
||||
</div>
|
||||
|
||||
@if (isset($secEntityType))
|
||||
|
@ -41,7 +41,7 @@
|
||||
<label for="simple-time" class="control-label col-lg-4 col-sm-4">
|
||||
</label>
|
||||
<div class="col-lg-8 col-sm-8" style="padding-top: 10px">
|
||||
<p>{{ $task->getStartTime() }}<p/>
|
||||
<p>{{ $task->getStartTime() }} {{ $timezone }}<p/>
|
||||
|
||||
@if ($task->hasPreviousDuration())
|
||||
{{ trans('texts.duration') . ': ' . gmdate('H:i:s', $task->getDuration()) }}<br/>
|
||||
|
Loading…
Reference in New Issue
Block a user