1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
|
<?xml version="1.0"?>
<!--
-
- $Id$
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-->
<v:page name="blog-home-page" xmlns:vm="http://www.openlinksw.com/vspx/ods/" xmlns:v="http://www.openlinksw.com/vspx/" style="index.xsl"
doctype="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<vm:page>
<vm:header>
<vm:title>Received Invitations</vm:title>
</vm:header>
<vm:pagewrapper>
<vm:variable name="conn_num" type="int" default="0" />
<vm:variable name="sne_id" type="int" default="0" />
<!--<vm:navigation on="home"/>
<vm:navigation1 on="sn"/>-->
<vm:navigation-new on="home"/>
<vm:navigation2 on="sn_rec_inv"/>
<vm:rawheader caption="Received Invitations"/>
<vm:body>
<script type="text/javascript">
<![CDATA[
function selectAllCheckboxes (form, btn, txt)
{
var i;
for (i =0; i < form.elements.length; i++)
{
var contr = form.elements[i];
if (contr != null && contr.type == "checkbox" && contr.name.indexOf (txt) != -1)
{
contr.focus();
if (btn.value == 'Select All')
contr.checked = true;
else
contr.checked = false;
}
}
if (btn.value == 'Select All')
btn.value = 'Unselect All';
else
btn.value = 'Select All';
btn.focus();
}
]]>
</script>
<vm:login redirect="login.vspx"/>
<div id="container">
<div>
<v:local-variable name="lv1">
<v:after-data-bind>
whenever not found goto nf;
select sne_id into self.sne_id from sn_entity where sne_name = self.u_name;
select count(*) into self.conn_num from sn_invitation where sni_to = self.u_e_mail and sni_status = 0;
nf:;
</v:after-data-bind>
</v:local-variable>
<p>You have <v:label name="lnc1" value="--self.conn_num" format="%d"/> unprocessed invitation(s)</p>
<table class="listing">
<tr class="listing_header_row">
<th>
<input type="checkbox" value="Unselect All" onclick="selectAllCheckboxes(this.form, this, 'cb1')" checked="1"/>
From
</th>
<th>Name</th>
</tr>
<v:data-set
name="ds_conn"
sql="select sne_name, sne_id from sn_invitation, sn_entity where
sni_from = sne_id and sni_to = :mail and sni_status = 0"
nrows="1000"
cursor-type="dynamic"
scrollable="1"
editable="1"
>
<v:param name="mail" value="--self.u_e_mail"/>
<v:template type="repeat" name="ds_conn_rep">
<v:template name="ds_conn_no" type="if-not-exists">
<tr><td colspan="2">No invitation(s) available</td></tr>
</v:template>
<v:template type="browse" name="ds_conn_brows">
<tr class="<?V case when mod(control.te_ctr, 2) = 0 then 'listing_row_odd' else 'listing_row_even' end ?>">
<td>
<v:check-box name="cb1" group-name="cb1" value="--(control.vc_parent as vspx_row_template).te_rowset[1]" initial-checked="1"/>
<v:label name="l1" value="--(control.vc_parent as vspx_row_template).te_rowset[0]" />
</td>
<td>
<v:label name="l2" value="--coalesce (USER_GET_OPTION((control.vc_parent as vspx_row_template).te_rowset[0], 'FULL_NAME'), '')" />
</td>
</tr>
</v:template>
</v:template>
<v:template name="ds_foot" type="simple" enabled="--(control.vc_parent as vspx_data_set).ds_rows_fetched">
<tr>
<td colspan="2">
<span class="fm_ctl_btn">
<v:button name="bt_conf1" value="Accept Invitations" action="simple" >
<v:on-post><![CDATA[
declare inx, sne_id int;
declare ent any;
while ((ent := adm_next_keyword ('cb1', e.ve_params, inx)) <> 0)
{
insert soft sn_related (snr_from, snr_to, snr_since, snr_serial, snr_source)
values (ent, self.sne_id, now(), 0,1);
delete from sn_invitation where
sni_from = ent and sni_to = self.u_e_mail;
}
if (exists (select 1 from sn_invitation where sni_to = self.u_e_mail and sni_status <> -1))
self.ds_conn.vc_data_bind (e);
else
self.vc_redirect ('sn_connections.vspx');
]]></v:on-post>
</v:button>
<v:button name="bt_conf2" value="Reject Invitations" action="simple" >
<v:on-post><![CDATA[
declare inx, sne_id int;
declare ent any;
while ((ent := adm_next_keyword ('cb1', e.ve_params, inx)) <> 0)
{
update sn_invitation set sni_status = -1 where
sni_from = ent and sni_to = self.u_e_mail;
}
if (exists (select 1 from sn_invitation where sni_to = self.u_e_mail and sni_status <> -1))
self.ds_conn.vc_data_bind (e);
else
self.vc_redirect ('sn_connections.vspx');
]]></v:on-post>
</v:button>
</span>
</td>
</tr>
</v:template>
</v:data-set>
<v:template name="tmpl_cancl" type="simple" enabled="--equ (self.ds_conn.ds_rows_fetched, 0)">
<tr>
<td colspan="2">
<span class="fm_ctl_btn">
<v:button name="bt_conf3" value="Back" action="simple">
<v:on-post><![CDATA[
self.vc_redirect ('sn_connections.vspx');
]]></v:on-post>
</v:button>
</span>
</td>
</tr>
</v:template>
</table>
</div>
</div>
</vm:body>
</vm:pagewrapper>
</vm:page>
</v:page>
|