Skip to content

Commit

Permalink
Remove activitystatus js. Add submitOnce handler for activity create
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Dec 27, 2018
1 parent f01f6ac commit f49bb71
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 67 deletions.
13 changes: 3 additions & 10 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -797,25 +797,18 @@ public function buildQuickForm() {
// form should be frozen for view mode
$this->freeze();

$buttons = array();
$buttons[] = array(
$this->addButtons(array(
'type' => 'cancel',
'name' => ts('Done'),
);
$this->addButtons($buttons);
));
}
else {
$message = array(
'completed' => ts('Are you sure? This is a COMPLETED activity with the DATE in the FUTURE. Click Cancel to change the date / status. Otherwise, click OK to save.'),
'scheduled' => ts('Are you sure? This is a SCHEDULED activity with the DATE in the PAST. Click Cancel to change the date / status. Otherwise, click OK to save.'),
);
$js = array('onclick' => "return activityStatus(" . json_encode($message) . ");");
$this->addButtons(array(
array(
'type' => 'upload',
'name' => ts('Save'),
'js' => $js,
'isDefault' => TRUE,
'submitOnce' => TRUE,
),
array(
'type' => 'cancel',
Expand Down
2 changes: 0 additions & 2 deletions templates/CRM/Activity/Form/Activity.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
{/if}
<div class="crm-block crm-form-block crm-activity-form-block">
{/if}
{* added onload javascript for source contact*}
{include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="activity"}
{if !$action or ( $action eq 1 ) or ( $action eq 2 ) }
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
{/if}
Expand Down
51 changes: 0 additions & 51 deletions templates/CRM/Activity/Form/ActivityJs.tpl

This file was deleted.

4 changes: 0 additions & 4 deletions templates/CRM/Case/Form/Activity.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
{if $action neq 8 and $action neq 32768 }
{* Include form buttons on top for new and edit modes. *}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>

{* added onload javascript for source contact*}
{include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="case_activity"}

{/if}

{if $action eq 8 or $action eq 32768 }
Expand Down

0 comments on commit f49bb71

Please sign in to comment.