Commit f44583b4 authored by sylvieg's avatar sylvieg

[MOD]tracker: option to assign an item or not to the auto created group

parent f35b209f
......@@ -1479,7 +1479,7 @@ class TrackerLib extends TikiLib {
if ($prefs['groupTracker'] == 'y' && isset($tracker_info['autoCreateGroup']) && $tracker_info['autoCreateGroup'] == 'y' && empty($itemId)) {
$groupName = $this->groupName($tracker_info, $new_itemId, $groupInc);
if (!empty($creatorGroupFieldId)) {
if (!empty($creatorGroupFieldId) && $tracker_info['autoCreateGroupItem'] == 'y') {
$query = 'update `tiki_tracker_item_fields` set `value`=? where `itemId`=? and `fieldId`=?';
$this->query($query, array($groupName, $new_itemId, $creatorGroupFieldId));
}
......
......@@ -130,7 +130,7 @@
<tr class="formcolor">
<td><label for="autoCreateGroup">{tr}Create a group for each item{/tr}</label></td>
<td>
<input type="checkbox" id="autoCreateGroup" name="autoCreateGroup" {if $info.autoCreateGroup eq 'y' }checked="checked"{/if} onclick="toggleTrTd('autoCreateGroupOptions');toggleTrTd('autoCreateGroupOptions2');toggleTrTd('autoCreateGroupOptions3');"/>
<input type="checkbox" id="autoCreateGroup" name="autoCreateGroup" {if $info.autoCreateGroup eq 'y' }checked="checked"{/if} onclick="toggleTrTd('autoCreateGroupOptions');toggleTrTd('autoCreateGroupOptions2');toggleTrTd('autoCreateGroupOptions3');toggleTrTd('autoCreateGroupOptions4');"/>
</td>
<tr class="formcolor" id="autoCreateGroupOptions"{if $info.autoCreateGroup ne 'y' and $prefs.javascript_enabled eq 'y'} style="display:none;"{/if}>
<td></td>
......@@ -152,7 +152,13 @@
<tr class="formcolor" id="autoCreateGroupOptions3"{if $info.autoCreateGroup ne 'y' and $prefs.javascript_enabled eq 'y'} style="display:none;"{/if}>
<td></td>
<td><label for="autoAssignCreatorGroupDefault">{tr}and it becomes his default group{/tr}</label>
<input type="checkbox" name="autoAssignCreatorGroupDefault" id="autoAssignCreatorGroupDefaujlt" {if $info.autoAssignCreatorGroupDefault eq 'y'}checked="checked"{/if} />
<input type="checkbox" name="autoAssignCreatorGroupDefault" id="autoAssignCreatorGroupDefault" {if $info.autoAssignCreatorGroupDefault eq 'y'}checked="checked"{/if} />
</td>
</tr>
<tr class="formcolor" id="autoCreateGroupOptions4"{if $info.autoCreateGroup ne 'y' and $prefs.javascript_enabled eq 'y'} style="display:none;"{/if}>
<td></td>
<td><label for="autoAssignGroupItem">{tr}and it becomes the new item group creator{/tr}</label>
<input type="checkbox" name="autoAssignGroupItem" id="autoAssignGroupItem" {if $info.autoAssignGroupItem eq 'y'}checked="checked"{/if} />
</td>
</tr>
{/if}
......
......@@ -274,6 +274,13 @@ if (isset($_REQUEST["save"])) {
} else {
$tracker_options['autoCreateGroup'] = 'n';
}
if (isset($_REQUEST['autoAssignGroupItem'])
&& ($_REQUEST['autoAssignGroupItem'] == 'on'
or $_REQUEST['autoAssignGroupItem'] == 'y')) {
$tracker_options['autoAssignGroupItem'] = 'y';
} else {
$tracker_options['autoAssignGroupItem'] = 'n';
}
if (isset($_REQUEST['autoAssignCreatorGroup'])
&& ($_REQUEST['autoAssignCreatorGroup'] == 'on'
or $_REQUEST['autoAssignCreatorGroup'] == 'y')) {
......@@ -458,6 +465,7 @@ $info['end'] = 0;
$info['autoCreateCategories']='';
$info['autoCreateGroup'] = '';
$info['autoCreateGroupInc'] = 0;
$info['autoAssignGroupItem'] = '';
if ($_REQUEST["trackerId"]) {
$info = array_merge($info,$tikilib->get_tracker($_REQUEST["trackerId"]));
......
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