Merge branch 'dev_16' into dev_13_dev_15_dev_16
This commit is contained in:
commit
746b4304d1
2 changed files with 20 additions and 4 deletions
|
@ -129,10 +129,6 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
|||
$profile_name = NULL;
|
||||
}
|
||||
|
||||
// Assign template variables.
|
||||
$this->assign('op', $this->_op);
|
||||
$this->assign('profile_name', $profile_name);
|
||||
|
||||
// Set redirect destination.
|
||||
$this->controller->_destination = CRM_Utils_System::url('civicrm/admin/settings/twingle/profiles', 'reset=1');
|
||||
|
||||
|
@ -158,6 +154,21 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
|||
}
|
||||
CRM_Utils_System::setTitle(E::ts('Edit Twingle API profile <em>%1</em>', array(1 => $this->profile->getName())));
|
||||
break;
|
||||
case 'copy':
|
||||
// This will be a 'create' actually.
|
||||
$this->_op = 'create';
|
||||
|
||||
// When copying without a valid profile name, copy the default profile.
|
||||
if (!$profile_name) {
|
||||
$profile_name = 'default';
|
||||
$this->profile = CRM_Twingle_Profile::getProfile($profile_name);
|
||||
}
|
||||
|
||||
// Set a new name for this profile.
|
||||
$profile_name = $profile_name . '_copy';
|
||||
$this->profile->setName($profile_name);
|
||||
CRM_Utils_System::setTitle(E::ts('New Twingle API profile'));
|
||||
break;
|
||||
case 'create':
|
||||
// Load factory default profile values.
|
||||
$this->profile = CRM_twingle_Profile::createDefaultProfile($profile_name);
|
||||
|
@ -165,6 +176,10 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
|||
break;
|
||||
}
|
||||
|
||||
// Assign template variables.
|
||||
$this->assign('op', $this->_op);
|
||||
$this->assign('profile_name', $profile_name);
|
||||
|
||||
// Add form elements.
|
||||
$is_default = $profile_name == 'default';
|
||||
$this->add(
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<a href="{crmURL p="civicrm/admin/settings/twingle/profile" q="op=edit&name=$profile_name"}" title="{ts domain="de.systopia.twingle" 1=$profile.name}Edit profile %1{/ts}" class="action-item crm-hover-button">{ts domain="de.systopia.twingle"}Edit{/ts}</a>
|
||||
<a href="{crmURL p="civicrm/admin/settings/twingle/profile" q="op=copy&name=$profile_name"}" title="{ts domain="de.systopia.twingle" 1=$profile.name}Copy profile %1{/ts}" class="action-item crm-hover-button">{ts domain="de.systopia.twingle"}Copy{/ts}</a>
|
||||
{if $profile_name == 'default'}
|
||||
<a href="{crmURL p="civicrm/admin/settings/twingle/profile" q="op=delete&name=$profile_name"}" title="{ts domain="de.systopia.twingle" 1=$profile.name}Reset profile %1{/ts}" class="action-item crm-hover-button">{ts domain="de.systopia.twingle"}Reset{/ts}</a>
|
||||
{else}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue