mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-10-03 17:00:43 -04:00
Compare commits
2
Commits
8ae82f1423
...
2026.8.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57dc8127b0 | ||
|
|
9dc4b79355 |
No files matched your search
@@ -8,7 +8,6 @@
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# This controller class will handle map management
|
||||
class CustomersController < ApplicationController
|
||||
|
||||
include AuthHelper
|
||||
@@ -26,8 +25,8 @@ class CustomersController < ApplicationController
|
||||
include SortHelper
|
||||
helper :timelog
|
||||
|
||||
before_action :add_customer, only: :new
|
||||
before_action :view_customer, except: [:new, :view]
|
||||
before_action :add_customer, only: [:new, :create]
|
||||
before_action :view_customer, except: [:new, :create, :view]
|
||||
skip_before_action :verify_authenticity_token, :check_if_login_required, only: [:view]
|
||||
|
||||
def address_to_s(address)
|
||||
@@ -75,14 +74,28 @@ class CustomersController < ApplicationController
|
||||
|
||||
def create
|
||||
@customer = Customer.new(allowed_params)
|
||||
@customer.save
|
||||
|
||||
respond_to do |format|
|
||||
if @customer.save
|
||||
log "Customer ##{@customer.id} created successfully."
|
||||
flash[:notice] = t :notice_customer_created
|
||||
redirect_to @customer
|
||||
format.html { redirect_to @customer, notice: l(:notice_successful_create) }
|
||||
format.json { render json: { id: @customer.id, name: @customer.name }, status: :created }
|
||||
else
|
||||
format.html { render :new }
|
||||
format.json { render json: { errors: @customer.errors.full_messages }, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
log "Failed to create customer: #{e.message}"
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
flash[:error] = e.message
|
||||
redirect_to new_customer_path
|
||||
}
|
||||
format.json {
|
||||
render json: { errors: [e.message] }, status: :internal_server_error
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@@ -136,6 +149,10 @@ class CustomersController < ApplicationController
|
||||
|
||||
def new
|
||||
@customer = Customer.new
|
||||
|
||||
if request.xhr?
|
||||
render partial: 'form', layout: false, locals: { hide_submit: true, hide_toolbar: true }
|
||||
end
|
||||
end
|
||||
|
||||
def only_one_non_zero?(array)
|
||||
|
||||
@@ -40,16 +40,20 @@
|
||||
rows: 8,
|
||||
class: 'wiki-edit',
|
||||
style: 'width: 95%;',
|
||||
id: 'customer_appointment_description' %>
|
||||
<%= wikitoolbar_for 'customer_appointment_description' %>
|
||||
id: 'customer_notes' %>
|
||||
<% unless local_assigns[:hide_toolbar] %>
|
||||
<%= wikitoolbar_for 'customer_notes' %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% unless local_assigns[:hide_submit] %>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo do
|
||||
name 'Redmine QBO plugin'
|
||||
author 'Rick Barrette'
|
||||
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
|
||||
version '2026.8.1'
|
||||
version '2026.8.2'
|
||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||
author_url 'https://barrettefabrication.com'
|
||||
settings default: {empty: true}, partial: 'qbo/settings'
|
||||
|
||||
Reference in new issue
Block a user