Commit 4810eda8 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1724704: The webservice connection manager 'Add' field missing"

parents 2c3cff8d 6aa41223
......@@ -54,7 +54,7 @@ $string['youmaynotregisterwithouttandc'] = 'You may not register unless you agre
$string['pluginconnections'] = 'Connection objects';
$string['pcdescription'] = 'Select a connection';
$string['nodefinedconnections'] = 'No webservice connections defined in any plugins. Please define a connection first.';
$string['instancelistempty'] = 'No connection objects for this institution.';
$string['addconnection'] = 'Add client connection';
......
{{if $connections}}
<script type="application/javascript">
function addinstance() {
var selectedPlugin = document.getElementById('dummySelect').value;
var institution = '{{$institution}}';
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?add=1&i={{$institution}}&p=' + selectedPlugin;
return;
}
</script>
<div class="select connections lead">
<span class="picker">
<select class="select form-control" name="dummy" id="dummySelect">
{{foreach $connections connection}}
<option value="{{$connection->id}}">{{$connection->shortname}} - {{$connection->name}}</option>
{{/foreach}}
</select>
</span>
<div>
<button class="btn btn-primary" type="button" onclick="addinstance(); return false;" name="button" value="foo">{{str tag=Add section=admin}}</button>
</div>
</div>
{{else}}
<div class="alert alert-info">
{{str tag="nodefinedconnections" section="auth.webservice"}}
</div>
{{/if}}
\ No newline at end of file
......@@ -3,19 +3,23 @@
<div class="collapsible-group" id="accordion" aria-multiselectable="true" role="tablist" >
{foreach from=$form.elements item=element name=elements}
{if $element.type == 'fieldset'}
<div class="pseudofieldset panel panel-default collapsible collapsible-group{if $.foreach.elements.last} last{/if}">
<h2 class="pseudolegend panel-heading has-link">
<h2 class="pseudolegend panel-heading has-link">
<a class="{if !$.foreach.elements.first}collapsed{/if}" href="#{$element.name}_pseudofieldset" data-toggle="collapse" aria-expanded="{if $.foreach.elements.first}true{else}false{/if}" aria-controls="{$element.name}_pseudofieldset" data-parent="#accordion">
{$element.legend}
<span class="icon icon-chevron-down right collapse-indicator pull-right" role="presentation" aria-hidden="true"></span>
</a>
</h2>
<div class="panel-body table-responsive collapse {if $.foreach.elements.first} in{/if}" id="{$element.name}_pseudofieldset">
{foreach from=$element.elements item=item}
{$item.value|safe}
{/foreach}
</div>
</h2>
<div class="panel-body table-responsive collapse {if $.foreach.elements.first} in{/if}{if $.foreach.elements.last} no-footer{/if}" id="{$element.name}_pseudofieldset">
{foreach from=$element.elements item=item}
{$item.value|safe}
{/foreach}
</div>
</div>
{else}
{$element.value|safe}
{/if}
{/foreach}
</div>
<script type="application/javascript">
......
......@@ -104,13 +104,6 @@
return false;
}
function addinstance() {
var selectedPlugin = document.getElementById('dummySelect').value;
var institution = '{{$institution}}';
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?add=1&i={{$institution}}&p=' + selectedPlugin;
return;
}
function editinstance(id, plugin) {
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?id=' + id + '&edit=1&i={{$institution}}&p=' + plugin;
return;
......@@ -160,19 +153,6 @@ IMPORTANT: do not introduce any new whitespace into the instanceList div.
</div>
{{/foreach}}
</div>
<div class="postlist">{{str tag='pcdescription' section='auth.webservice'}}</div>
<div class="select connections">
<span class="picker">
<select class="select form-control" name="dummy" id="dummySelect">
{{foreach $connections connection}}
<option value="{{$connection->id}}">{{$connection->shortname}} - {{$connection->name}}</option>
{{/foreach}}
</select>
</span>
<div>
<button class="btn btn-primary" type="button" onclick="addinstance(); return false;" name="button" value="foo">{{str tag=Add section=admin}}</button>
</div>
</div>
{{else}}
<div>{{str tag='instancelistempty' section='auth.webservice'}}</div>
{{/if}}
......
{{if $connections}}
<script type="application/javascript">
function addinstance() {
var selectedPlugin = document.getElementById('dummySelect').value;
var institution = '{{$institution}}';
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?add=1&i={{$institution}}&p=' + selectedPlugin;
return;
}
</script>
<div class="select connections lead">
<span class="picker">
<select class="select form-control" name="dummy" id="dummySelect">
{{foreach $connections connection}}
<option value="{{$connection->id}}">{{$connection->shortname}} - {{$connection->name}}</option>
{{/foreach}}
</select>
</span>
<div>
<button class="btn btn-primary" type="button" onclick="addinstance(); return false;" name="button" value="foo">{{str tag=Add section=admin}}</button>
</div>
</div>
{{else}}
<div class="alert alert-info">
{{str tag="nodefinedconnections" section="auth.webservice"}}
</div>
{{/if}}
\ No newline at end of file
......@@ -3,19 +3,23 @@
<div class="collapsible-group" id="accordion" aria-multiselectable="true" role="tablist" >
{foreach from=$form.elements item=element name=elements}
{if $element.type == 'fieldset'}
<div class="pseudofieldset panel panel-default collapsible collapsible-group{if $.foreach.elements.last} last{/if}">
<h2 class="pseudolegend panel-heading has-link">
<h2 class="pseudolegend panel-heading has-link">
<a class="{if !$.foreach.elements.first}collapsed{/if}" href="#{$element.name}_pseudofieldset" data-toggle="collapse" aria-expanded="{if $.foreach.elements.first}true{else}false{/if}" aria-controls="{$element.name}_pseudofieldset" data-parent="#accordion">
{$element.legend}
<span class="icon icon-chevron-down right collapse-indicator pull-right" role="presentation" aria-hidden="true"></span>
</a>
</h2>
<div class="panel-body table-responsive collapse {if $.foreach.elements.first} in{/if}" id="{$element.name}_pseudofieldset">
{foreach from=$element.elements item=item}
{$item.value|safe}
{/foreach}
</div>
</h2>
<div class="panel-body table-responsive collapse {if $.foreach.elements.first} in{/if}{if $.foreach.elements.last} no-footer{/if}" id="{$element.name}_pseudofieldset">
{foreach from=$element.elements item=item}
{$item.value|safe}
{/foreach}
</div>
</div>
{else}
{$element.value|safe}
{/if}
{/foreach}
</div>
<script type="application/javascript">
......
......@@ -104,13 +104,6 @@
return false;
}
function addinstance() {
var selectedPlugin = document.getElementById('dummySelect').value;
var institution = '{{$institution}}';
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?add=1&i={{$institution}}&p=' + selectedPlugin;
return;
}
function editinstance(id, plugin) {
window.location = '{{$WWWROOT}}webservice/admin/addconnection.php?id=' + id + '&edit=1&i={{$institution}}&p=' + plugin;
return;
......@@ -160,19 +153,6 @@ IMPORTANT: do not introduce any new whitespace into the instanceList div.
</div>
{{/foreach}}
</div>
<div class="postlist">{{str tag='pcdescription' section='auth.webservice'}}</div>
<div class="select connections">
<span class="picker">
<select class="select form-control" name="dummy" id="dummySelect">
{{foreach $connections connection}}
<option value="{{$connection->id}}">{{$connection->shortname}} - {{$connection->name}}</option>
{{/foreach}}
</select>
</span>
<div>
<button class="btn btn-primary" type="button" onclick="addinstance(); return false;" name="button" value="foo">{{str tag=Add section=admin}}</button>
</div>
</div>
{{else}}
<div>{{str tag='instancelistempty' section='auth.webservice'}}</div>
{{/if}}
......
......@@ -103,8 +103,12 @@ if ($reorder && $json) {
* @return pieforms $element array
*/
function webservice_client_connections($institution) {
$wcc = webservice_connection_classes($institution);
$elements = array(
'addconnection' => array(
'type' => 'html',
'value' => $wcc['addconnection'],
),
// fieldset for managing service function groups
'pluginconnections' => array(
'type' => 'fieldset',
......@@ -112,7 +116,7 @@ function webservice_client_connections($institution) {
'elements' => array(
'webservicesservicecontainer' => array(
'type' => 'html',
'value' => webservice_connection_classes($institution),
'value' => $wcc['instances'],
)
),
'collapsible' => true,
......@@ -174,9 +178,11 @@ function webservice_connection_classes($institution) {
$smarty->assign('instancelist', $connection_instances);
$smarty->assign('connections', $connections);
$smarty->assign('institution', $institution);
$addhtml = $smarty->fetch('auth:webservice:addconnectionform.tpl');
$smarty->assign('instancestring', $instancestring);
$smarty->assign('sesskey', $USER->get('sesskey'));
return $smarty->fetch('auth:webservice:connections.tpl');
$html = $smarty->fetch('auth:webservice:connections.tpl');
return array('instances' => $html, 'addconnection' => $addhtml);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment