Pipedrive: allow super admin to choose target pipeline
This commit is contained in:
parent
6a74aaa42a
commit
2102130fa3
3 changed files with 25 additions and 6 deletions
|
@ -11,7 +11,7 @@ module Manager
|
|||
PipedriveAcceptsDealsJob.perform_later(
|
||||
create_administrateur_params[:person_id],
|
||||
PipedriveService::PIPEDRIVE_CAMILLE_ID,
|
||||
PipedriveService::PIPEDRIVE_ADMIN_CENTRAL_STOCK_STAGE_ID
|
||||
create_administrateur_params[:stage_id]
|
||||
)
|
||||
|
||||
flash.notice = "Administrateur créé"
|
||||
|
@ -26,7 +26,7 @@ module Manager
|
|||
private
|
||||
|
||||
def create_administrateur_params
|
||||
params.require(:administrateur).permit(:email, :person_id)
|
||||
params.permit(:email, :person_id, :stage_id)
|
||||
end
|
||||
|
||||
def pending_demandes
|
||||
|
|
|
@ -7,6 +7,11 @@ class PipedriveService
|
|||
PIPEDRIVE_ALL_NOT_DELETED_DEALS = 'all_not_deleted'
|
||||
|
||||
PIPEDRIVE_ADMIN_CENTRAL_STOCK_STAGE_ID = 35
|
||||
PIPEDRIVE_REGIONS_STOCK_STAGE_ID = 24
|
||||
PIPEDRIVE_PREFECTURES_STOCK_STAGE_ID = 20
|
||||
PIPEDRIVE_DEPARTEMENTS_STOCK_STAGE_ID = 30
|
||||
PIPEDRIVE_COMMUNES_STOCK_STAGE_ID = 40
|
||||
PIPEDRIVE_ORGANISMES_STOCK_STAGE_ID = 1
|
||||
|
||||
class << self
|
||||
def accept_deals_from_person(person_id, owner_id, stage_id)
|
||||
|
|
|
@ -29,10 +29,24 @@
|
|||
<%= demande[key] %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="cell-data cell-data--string">
|
||||
<%= button_to('Créer',
|
||||
manager_demandes_create_administrateur_path,
|
||||
params: { administrateur: { email: demande[:email], person_id: demande[:person_id] } }) %>
|
||||
<td class="cell-data cell-data--string" style="text-align: center;">
|
||||
<%= form_tag(manager_demandes_create_administrateur_path) do -%>
|
||||
<%= select_tag "stage_id",
|
||||
options_for_select({
|
||||
"administration centrale" => PipedriveService::PIPEDRIVE_ADMIN_CENTRAL_STOCK_STAGE_ID,
|
||||
"région" => PipedriveService::PIPEDRIVE_REGIONS_STOCK_STAGE_ID,
|
||||
"préfecture" => PipedriveService::PIPEDRIVE_PREFECTURES_STOCK_STAGE_ID,
|
||||
"département" =>PipedriveService::PIPEDRIVE_DEPARTEMENTS_STOCK_STAGE_ID,
|
||||
"commune" => PipedriveService::PIPEDRIVE_COMMUNES_STOCK_STAGE_ID,
|
||||
"organisme" => PipedriveService::PIPEDRIVE_ORGANISMES_STOCK_STAGE_ID
|
||||
}),
|
||||
style: 'margin-bottom: 20px; width: inherit;' %>
|
||||
|
||||
<%= hidden_field_tag 'email', demande[:email] %>
|
||||
<%= hidden_field_tag 'person_id', demande[:person_id] %>
|
||||
|
||||
<%= submit_tag 'Créer' %>
|
||||
<% end -%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue