17 require_once SQ_SYSTEM_ROOT.
'/core/assets/system/tool/tool.inc';
44 $this->
Tool($assetid);
60 $tool_info = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($type_code);
61 $o->openSection($tool_info[
'name']);
63 $o->openField(translate(
'bm_tool_delete_bmail_users_file_upload'));
64 file_upload($type_code.
'_file_upload');
65 $o->note(translate(
'bm_tool_delete_bmail_users_file_upload_note'));
68 $o->openField(translate(
'bm_tool_delete_bmail_users_root_node'));
69 multiple_asset_finder($type_code.
'_root_node');
70 $o->note(translate(
'bm_tool_delete_bmail_users_root_node_note'));
73 $o->openField(translate(
'bm_tool_delete_bmail_users_confirm'));
74 combo_box($type_code.
'_confirm', Array(0=>translate(
'no'), 1=>translate(
'yes')));
75 $o->note(translate(
'bm_tool_delete_bmail_users_confirm_note'));
78 $o->openField(translate(
'bm_tool_delete_bmail_users_link_node'));
79 asset_finder($type_code.
'_link_node');
80 $o->note(translate(
'bm_tool_delete_bmail_users_link_node_note'));
83 $link_type_list = get_link_type_names();
85 $o->openField(translate(
'bm_tool_delete_bmail_users_link_type'));
86 combo_box($type_code.
'_link_type', $link_type_list, FALSE);
87 $o->note(translate(
'bm_tool_delete_bmail_users_link_type_note'));
107 $file_info = get_file_upload_info($type_code.
'_file_upload');
108 if (empty($file_info)) {
109 trigger_localised_error(
'BML0011', E_USER_NOTICE);
113 $selected_root_nodes = array_get_index($_POST, $type_code.
'_root_node', Array());
114 $root_nodes = Array();
115 if (!empty($selected_root_nodes)) {
116 foreach ($selected_root_nodes as $root_node) {
117 $assetid = array_get_index($root_node,
'assetid', 0);
118 if (!empty($assetid)) {
119 $root_nodes[] = $assetid;
124 $link_node = array_get_index($_POST, $type_code.
'_link_node');
125 $link_type = array_get_index($_POST, $type_code.
'_link_type', Array());
129 'file_info' => $file_info,
130 'root_nodes' => $root_nodes,
131 'link_asset' => Array(
132 'assetid' => $link_node[
'assetid'],
133 'link_type' => $link_type,
138 if ((!isset($_POST[$type_code.
'_confirm'])) || ($_POST[$type_code.
'_confirm'] == 0)) {
143 $hh =& $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
144 $hh->queueHipo(
'hipo_job_tool_delete_bmail_users', $vars,
'', SQ_PACKAGES_PATH.
'/bulkmail/hipo_jobs');
145 $url = $hh->runQueuedJobs();
146 if (!empty($url)) $o->setRedirect($url);