Skip to content

Commit

Permalink
Further work to pull request 9257 CRM-16243 - Extension API - Automat…
Browse files Browse the repository at this point in the history
…ically enable dependencies

Also adjusted interface to show the needed dependencies.
  • Loading branch information
JohnFF committed Oct 9, 2017
1 parent 3b3f6d2 commit a1a9f5a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CRM/Admin/Form/Extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ public function postProcess() {
}

if ($this->_action & CRM_Core_Action::ADD) {
CRM_Extension_System::singleton()->getManager()->install(array($this->_key));
civicrm_api3('Extension', 'install', array('keys' => $this->_key));
CRM_Core_Session::setStatus("", ts('Extension Installed'), "success");
}

if ($this->_action & CRM_Core_Action::ENABLE) {
CRM_Extension_System::singleton()->getManager()->enable(array($this->_key));
civicrm_api3('Extension', 'enable', array('keys' => $this->_key));
CRM_Core_Session::setStatus("", ts('Extension Enabled'), "success");
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/Extension/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function findInstallRequirements($keys) {
$info = @$infos[$key];

if ($this->getStatus($key) === self::STATUS_INSTALLED) {
// skip
$sorter->add($key, $info->requires);
}
elseif ($info && $info->requires) {
$sorter->add($key, $info->requires);
Expand Down
14 changes: 14 additions & 0 deletions templates/CRM/Admin/Page/ExtensionDetails.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@
<tr>
<td class="label">{ts}Development stage{/ts}</td><td>{$extension.develStage}</td>
</tr>
<tr>
<td class="label">{ts}Requires{/ts}</td>
<td>
{foreach from=$extension.requires item=ext}
{if array_key_exists($ext, $localExtensionRows)}
{$localExtensionRows.$ext.name}
{elseif array_key_exists($ext, $remoteExtensionRows)}
{$remoteExtensionRows.$ext.name} (not downloaded)
{else}
{$ext} (not installed locally or available remotely)
{/if}
{/foreach}
</td>
</tr>
<tr>
<td class="label">{ts}Compatible with{/ts}</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Admin/Page/Extensions/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl
</tr>
<tr class="hiddenElement" id="crm-extensions-details-{$row.id}">
<td>
{include file="CRM/Admin/Page/ExtensionDetails.tpl" extension=$row}
{include file="CRM/Admin/Page/ExtensionDetails.tpl" extension=$row localExtensionRows=$localExtensionRows remoteExtensionRows=$remoteExtensionRows}
</td>
<td></td><td></td><td></td><td></td>
</tr>
Expand Down

0 comments on commit a1a9f5a

Please sign in to comment.