function inboxgroup_forwardmembers($data, $log_in_id, $sms_sender, $message) { global $core_config; logger_print("forwardmembers id:" . $data['id'] . " s:" . $sms_sender . " r:" . $data['in_receiver'] . " m:" . $message, 3, "inboxgroup"); if ($username = uid2username($data['uid'])) { $users = inboxgroup_getmembers($data['id']); $continue = false; if ($data['exclusive']) { for ($i = 0; $i < count($users); $i++) { if ($sms_sender == $users[$i]['mobile']) { $continue = true; } } } else { $continue = true; } if ($continue) { for ($i = 0; $i < count($users); $i++) { if (($sms_to = $users[$i]['mobile']) && $sms_to != $sms_sender) { //list($ok, $to, $smslog_id) = sendsms_pv($username, $sms_to, $message, 'text', 0); //logger_print("forwardmembers sendsms smslog_id:".$smslog_id[0]." to:".$sms_to, 3, "inboxgroup"); //inboxgroup_saveoutlog($log_in_id, $smslog_id[0], 0, $users[$i]['uid']); $c_username = uid2username($users[$i]['uid']); insertsmstoinbox($core_config['datetime']['now'], $sms_sender, $c_username, $message, $data['in_receiver']); } } } } }
} else { $_SESSION['dialog']['info'][] = _('Fail to edit group inbox') . " (" . _('Number') . ": " . $in_receiver . ")"; } } else { $_SESSION['dialog']['info'][] = _('You must fill all fields'); } header("Location: " . _u('index.php?app=main&inc=feature_inboxgroup&op=edit&rid=' . $rid)); exit; break; case 'del': $rid = $_REQUEST['rid']; $data = inboxgroup_getdatabyid($rid); $in_receiver = $data['in_receiver']; $keywords = $data['keywords']; $description = $data['description']; $c_members = count(inboxgroup_getmembers($rid)); $c_members = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=members&op=members&rid=' . $rid) . "'>" . $c_members . "</a>"; $c_catchall = count(inboxgroup_getcatchall($rid)); $c_catchall = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=catchall&op=catchall&rid=' . $rid) . "'>" . $c_catchall . "</a>"; $c_status = $data['status'] ? "<span class=status_enabled />" : "<span class=status_disabled />"; if ($error_content) { $content .= $error_content; } unset($tpl); $tpl = array('name' => 'inboxgroup_del', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Group inbox' => _('Group inbox'), 'Delete group inbox' => _('Delete group inbox'), 'RID' => $rid, 'Receiver number' => _('Receiver number'), 'Keywords' => _('Keywords'), 'Description' => _('Description'), 'Members' => _('Members'), 'Catch-all' => _('Catch-all'), 'Status' => _('Status'), 'IN_RECEIVER' => $in_receiver, 'KEYWORDS' => $keywords, 'DESCRIPTION' => $description, 'C_MEMBERS' => $c_members, 'C_CATCHALL' => $c_catchall, 'C_STATUS' => $c_status, 'ARE_YOU_SURE' => _('Are you sure you want to delete this group inbox ?'), 'Yes' => _('Yes'), 'BACK' => _back('index.php?app=main&inc=feature_inboxgroup&op=list'))); _p(tpl_apply($tpl)); break; case 'del_submit': $rid = $_REQUEST['rid']; $data = inboxgroup_getdatabyid($rid); $in_receiver = $data['in_receiver'];
} $content .= '<h3>' . _('Remove member') . '</h3><p />'; $rid = $_REQUEST['rid']; $data = inboxgroup_getdatabyid($rid); $in_receiver = $data['in_receiver']; $keywords = $data['keywords']; $description = $data['description']; $c_members = count(inboxgroup_getmembers($rid)); $c_members = "<a href='index.php?app=menu&inc=feature_inboxgroup&route=members&op=members&rid=" . $rid . "'>" . $c_members . "</a>"; $c_catchall = count(inboxgroup_getcatchall($rid)); $c_catchall = "<a href='index.php?app=menu&inc=feature_inboxgroup&route=catchall&op=catchall&rid=" . $rid . "'>" . $c_catchall . "</a>"; $c_status = $data['status'] ? "<font color='green'>" . _('enabled') . "</font>" : "<font color='red'>" . _('disabled') . "</font>"; $content .= "\n\t\t\t<table cellpadding='1' cellspacing='2' border='0'>\n\t\t\t<tr><td>" . _('Receiver number') . "</td><td>:</td><td>" . $in_receiver . "</td></tr>\n\t\t\t<tr><td>" . _('Keywords') . "</td><td>:</td><td>" . $keywords . "</td></tr>\n\t\t\t<tr><td>" . _('Description') . "</td><td>:</td><td>" . $description . "</td></tr>\n\t\t\t<tr><td>" . _('Members') . "</td><td>:</td><td>" . $c_members . "</td></tr>\n\t\t\t<tr><td>" . _('Catch-all') . "</td><td>:</td><td>" . $c_catchall . "</td></tr>\n\t\t\t<tr><td>" . _('Status') . "</td><td>:</td><td>" . $c_status . "</td></tr>\n\t\t\t</table>\n\t\t"; $list_of_members = ''; // get members $users = inboxgroup_getmembers($rid); for ($i = 0; $i < count($users); $i++) { $c_uid = $users[$i]['uid']; $c_username = uid2username($c_uid); $c_name = username2name($c_username); $c_mobile = username2mobile($c_username); $list_of_users .= "<option value='" . $c_uid . "'>" . $c_name . " " . $c_mobile . "</option>"; } $content .= "\n\t\t\t<form action=\"index.php?app=menu&inc=feature_inboxgroup&route=members&op=members_delete_submit\" method=\"post\">\n\t\t\t<input type=hidden name='rid' value='" . $rid . "'>\n\t\t\t<table cellpadding=1 cellspacing=2 border=0>\n\t\t\t<tr>\n\t\t\t\t<td nowrap>\n\t\t\t\t\t" . _('Current members') . ":<br />\n\t\t \t\t\t<select name=\"uids_dump[]\" size=\"10\" multiple=\"multiple\" onDblClick=\"moveSelectedOptions(this.form['uids_dump[]'],this.form['uids[]'])\">{$list_of_users}</select>\n\t\t\t\t</td>\n\t\t\t\t<td width=10> </td>\n\t\t\t\t<td align=center valign=middle>\n\t\t\t\t\t<input type=\"button\" class=\"button\" value=\">>\" onclick=\"moveSelectedOptions(this.form['uids_dump[]'],this.form['uids[]'])\"><br><br>\n\t\t\t\t\t<input type=\"button\" class=\"button\" value=\"" . _('All') . " >>\" onclick=\"moveAllOptions(this.form['uids_dump[]'],this.form['uids[]'])\"><br><br>\n\t\t\t\t\t<input type=\"button\" class=\"button\" value=\"<<\" onclick=\"moveSelectedOptions(this.form['uids[]'],this.form['uids_dump[]'])\"><br><br>\n\t\t\t\t\t<input type=\"button\" class=\"button\" value=\"" . _('All') . " <<\" onclick=\"moveAllOptions(this.form['uids[]'],this.form['uids_dump[]'])\">\n\t\t\t\t</td>\t\t\n\t\t\t\t<td width=10> </td>\n\t\t\t\t<td nowrap>\n\t\t\t\t " . _('Selected members') . ":<br>\n\t\t\t\t <select name=\"uids[]\" size=\"10\" multiple=\"multiple\" onDblClick=\"moveSelectedOptions(this.form['uids[]'],this.form['uids_dump[]'])\"></select>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p>" . _('Press submit button to remove selected members from member list') . "</p>\n\t\t\t<p><input class='button' type='submit' value='Submit' onClick=\"selectAllOptions(this.form['uids[]'])\"></p>\n\t\t\t</form>\n\t\t"; echo $content; break; case 'members_delete_submit': $rid = $_REQUEST['rid']; $rid = $_REQUEST['rid']; $data = inboxgroup_getdatabyid($rid); $in_receiver = $data['in_receiver'];