Skip to content

Commit

Permalink
added need-configure message
Browse files Browse the repository at this point in the history
  • Loading branch information
afedyk-sugarcrm committed May 13, 2014
1 parent 423a8c0 commit f9723ba
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{!
/*********************************************************************************
* By installing or using this file, you are confirming on behalf of the entity
* subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
* the SugarCRM Inc. Master Subscription Agreement (“MSA”), which is viewable at:
* http://www.sugarcrm.com/master-subscription-agreement
*
* If Company is not bound by the MSA, then by installing or using this file
* you are agreeing unconditionally that Company will be bound by the MSA and
* certifying that you have authority to bind Company accordingly.
*
* Copyright (C) 2004-2014 SugarCRM Inc. All rights reserved.
********************************************************************************/
}}
<div class="block-footer">
<a href="#bwc/index.php?module=EAPM&refreshParentWindow=yesPlease&closeWhenDone=1&action=QuickSave&application=Connections">
{{str 'LBL_IBM-CONNECTIONS_CONNECT' this.module}}
</a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@
initDashlet: function () {
var self = this;
this._super('initDashlet', []);
if (this.meta.config) {
var communityCollect = app.data.createBeanCollection("ibm_connectionsCommunity", null, {});
communityCollect.on('reset', this.fillCommunities, this);
communityCollect.fetch({fields: ['id', 'name']});
}

this.$el.on('dragenter', function (event) {
// self.$(event.currentTarget).addClass("dragdrop");
Expand All @@ -157,6 +152,7 @@
},

fillCommunities: function (communityCollect) {
debugger;
this.communityOptions = {};
var communityField = _.find(this.fields, function (field) {
return field.name == 'community_id';
Expand Down Expand Up @@ -473,5 +469,21 @@
}
}
});
},

loadData: function (options) {
this._super('loadData', [options]);
if (this.meta.config) {
var communityCollect = app.data.createBeanCollection("ibm_connectionsCommunity", null, {});
var collectOpts = {
fields: ['id', 'name'],
success: _.bind(this.fillCommunities, this),
error: _.bind(function(){
this.template = app.template.get(this.name + '.ibm-connections-need-configure');
this._render();
}, this),
};
communityCollect.fetch(collectOpts);
}
}
})
3 changes: 3 additions & 0 deletions SugarModules/language/application/en_us.lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@
$app_strings['LBL_IBM-CONNECTIONS_LIST_VERSION'] = 'Version';

$app_strings['LBL_IBM-CONNECTIONS_SELECT_FILE_LABEL'] = 'Select File';


$app_strings['LBL_IBM-CONNECTIONS_CONNECT'] = 'Connect to IBM connections';
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ public function registerApiRest()
public function filterList(ServiceBase $api, array $args)
{
$helper = new ConnectionsHelper();
$res = $helper->apiClass->checkLogin();
if (!$res['success']) {
throw new SugarApiExceptionRequestMethodFailure('ERROR_NEED_AUTHORIZE');
}

$entries = $helper->getCommunityList('MyCommunities', 1, '');
return $this->formatResult($api, $args, array('entries' => $entries ), new ibm_connectionsCommunity());

return $this->formatResult($api, $args, array('entries' => $entries), new ibm_connectionsCommunity());
}

}

0 comments on commit f9723ba

Please sign in to comment.