*
* Copyright 2009, Fabien Dubois - Capgemini
* Copyright 2009-2011, Franck Villaume - Capgemini
- * Copyright 2011, Franck Villaume - TrivialDev
+ * Copyright 2011-2012, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
* @return bool success or not
*/
function initialize($group_id, $confArr) {
+ if ($confArr['globalconf']) {
+ $globalConfArr = $this->getGlobalconf();
+ $confArr['url'] = $globalConfArr['url'];
+ $confArr['soap_user'] = $globalConfArr['soap_user'];
+ $confArr['soap_password'] = $globalConfArr['soap_password'];
+ }
if ($confArr['mantisbtcreate']) {
$idProjectMantis = $this->addProjectMantis($group_id, $confArr);
- } else {
+ } elseif ($confArr['mantisbtname'] && sizeof($confArr['mantisbtname'])) {
$idProjectMantis = $this->getProjectMantisByName($group_id, $confArr);
+ } else {
+ $groupObject = group_get_object($group_id);
+ $groupObject->setError('initialize::Error: '. _('MantisBT project not initialized, missing params'));
}
- if ($idProjectMantis) {
- $result = db_query_params('insert into plugin_mantisbt (id_group, id_mantisbt, url, soap_user, soap_password, sync_roles)
- values ($1, $2, $3, $4, $5, $6)',
+
+ if (isset($idProjectMantis) && $idProjectMantis) {
+ $result = db_query_params('insert into plugin_mantisbt (id_group, id_mantisbt, url, soap_user, soap_password, sync_roles, use_global)
+ values ($1, $2, $3, $4, $5, $6, $7)',
array($group_id,
$idProjectMantis,
$confArr['url'],
$confArr['soap_user'],
$confArr['soap_password'],
- $confArr['sync_roles']));
- if (!$result)
+ $confArr['sync_roles'],
+ $confArr['globalconf']));
+ if (!$result) {
+ $groupObject = group_get_object($group_id);
+ $groupObject->setError('initialize::Error: '. db_error());
return false;
-
+ }
return true;
}
return false;
return $mantisbtProject->id;
}
}
- $groupObject->setError('getProjectMantisByName::Error: mantisbt project not found');
+ $groupObject->setError('getProjectMantisByName::Error: '. _('MantisBT project not found'));
return false;
}
* MantisBT plugin
*
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2011, Franck Villaume - TrivialDev
+ * Copyright 2011-2012, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
echo '<tr><td><label id="mantisbtinit-global" ';
if ($use_tooltips)
echo 'title="'._('Use the global configuration defined at forge level').'"';
-echo ' >'._('Use global configuration').'</label></td><td><input id="mantisbtglobalconf" type="checkbox" name="global_conf" /></td></tr>';
+echo ' >'._('Use global configuration').'</label></td><td><input id="mantisbtglobalconf" type="checkbox" name="global_conf" value="1" /></td></tr>';
echo '<tr><td><label id="mantisbtinit-url" ';
if ($use_tooltips)
echo 'title="'._('Specify the Full URL of the MantisBT Web Server.').'"';
echo '<tr><td><label id="mantisbtinit-create" ';
if ($use_tooltips)
echo 'title="'._('If this project does NOT exist in MantisBT, do you want to create it ?').'"';
-echo ' >Create the project in MantisBT</label></td><td><input id="mantisbtcreate" type="checkbox" name="mantisbtcreate" value="1" ></td></tr>';
+echo ' >Create the project in MantisBT</label></td><td><input id="mantisbtcreate" type="checkbox" name="mantisbtcreate" value="1" /></td></tr>';
echo '<tr><td><label id="mantisbtinit-name" ';
if ($use_tooltips)
echo 'title="'._('Specify the name of the project in MantisBT if already created in MantisBT').'"';
* MantisBT Plugin
*
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2011, Franck Villaume - TrivialDev
+ * Copyright 2011-2012, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
toggleAllInput: function() {
if (!this.params.checkboxGlobalConf.is(":checked")) {
- this.params.inputName.attr('disabled',false);
this.params.inputUrl.attr('disabled',false);
this.params.inputUser.attr('disabled',false);
this.params.inputPassword.attr('disabled',false);
} else {
- this.params.inputName.attr('disabled',true);
this.params.inputUrl.attr('disabled',true);
this.params.inputUser.attr('disabled',true);
this.params.inputPassword.attr('disabled',true);