{extends "base.tpl.html"}
{block title}{t 1=$issue_id}Issue #%1 -  Select Partners{/t}{/block}

{block content}
{if $update_result|default:'' != ''}
<br />
<center>
    <span class="default"><b>
        {if $update_result == -1}
        {t}An error occurred while trying to run your query{/t}
        {elseif $update_result == 1}
        {t}Thank you, the partners were selected successfully.{/t}
        {/if}
    </b></span>
</center>
<script type="text/javascript">
    <!--
    {if $core.current_user_prefs.close_popup_windows}
        setTimeout('Eventum.close_and_refresh()', 2000);
    {/if}
    //-->
</script>
<br />
{if not $core.current_user_prefs.close_popup_windows}
<center>
    <span class="default"><a class="link" href="javascript:void(null);" onClick="Eventum.close_and_refresh();">{t}Continue{/t}</a></span>
</center>
{/if}
{else}
<script type="text/javascript">

    $().ready(function() {
        $('input.partners').click(function(e) {
            var target = $(e.target);
            if (target.is(':checked')) {
                var warning = 'WARNING: Adding a partner will allow them to see the issue overview, emails and other issue information.';
                if (!confirm(warning)) {
                    return false
                }
            }
        });
    });

</script>

<form name="select_partners" method="post">
    <input type="hidden" name="cat" value="update">
    <input type="hidden" name="issue_id" value="{$issue_id}">
    <table class="bordered">
        <tr class="title">
            <th colspan="2">{t}Select Partners{/t}</th>
        </tr>

        {html_checkboxes name="partners" options=$partners.options selected=$partners.selected assign="checkboxes"}
        {foreach from=$checkboxes item=checkbox}
        <tr>
          <td>{$checkbox}</td>
        </tr>
        {/foreach}

        <tr class="buttons">
            <td colspan="2" >
                <input type="submit" value="{t}Select Partners{/t}">
            </td>
        </tr>
        {/if}
    </table>
</form>
{/block}
