$confArr['mantisbtcreate'] = getIntFromRequest('mantisbtcreate');
$confArr['mantisbtname'] = getStringFromRequest('mantisbtname');
-if (!$mantisbt->initialize($group_id,$confArr))
+if (!$mantisbt->initialize($group_id, $confArr))
session_redirect('/plugins/mantisbt/?type=group&group_id='.$group_id.'&pluginname=mantisbt&error_msg='.urlencode($group->getErrorMessage()));
$feedback = _('MantisBT plugin successfully initialized.');
$mantisbtConfArray = array();
$resIdProjetMantis = db_query_params('SELECT * FROM plugin_mantisbt WHERE id_group = $1', array($groupId));
if (!$resIdProjetMantis) {
- $group->setError('getMantisBTId::error ' .db_error());
+ $group->setError('getMantisBTId::error '.db_error());
return $mantisbtConfArray;
}
$row = db_numrows($resIdProjetMantis);
- if ($row == null || count($row)>2) {
+ if ($row == null || count($row) > 2) {
$mantisbtConfArray['id_mantisbt'] = 0;
return $mantisbtConfArray;
}
case 'project': {
global $group_id;
$params['group'] = $group_id;
- $params['title'] = $this->name . ' Project Plugin!';
+ $params['title'] = $this->name.' Project Plugin!';
$params['pagename'] = $this->name;
$params['sectionvals'] = array(group_getname($group_id));
site_project_header($params);
if (!$group->usesPlugin($mantisbt->name)) {//check if the group has the MantisBT plugin active
exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $mantisbt->name), 'home');
}
+ if ( $group->isError()) {
+ $error_msg .= $group->getErrorMessage();
+ }
$userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
if ( !$userperm->IsMember()) {
if ($mantisbtConf['id_mantisbt'] === 0) {
$warning_msg = _('The mantisbt plugin for this project is not initialized.');
- session_redirect('/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&view=init&warning_msg='.urlencode($warning_msg));
+ $redirect_url = '/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&view=init&warning_msg='.urlencode($warning_msg);
+ if ($error_msg) {
+ $redirect_url .= '&error_msg='.urlencode($error_msg);
+ }
+ session_redirect($redirect_url);
}
if (!$mantisbtConf['sync_users']) {
if (!$group->usesPlugin($mantisbt->name)) {//check if the group has the MantisBT plugin active
exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'),$mantisbt->name),'home');
}
+ if ($group->isError()) {
+ $error_msg .= $group->getErrorMessage();
+ }
+
$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
if (!$userperm->IsMember()) {
exit_permission_denied(_('You are not a member of this project'));