Esempio n. 1
1
			<br />
			<form name="host_template_contactgroup_add" method="post" action="hosts.php?id=<?php 
                            echo $_GET['id'];
                            ?>
&section=contactgroups">
			<input type="hidden" name="request" value="add_contactgroup_command" />
			<input type="hidden" name="host_manage[contactgroup_add][host_id]" value="<?php 
                            echo $_GET['id'];
                            ?>
" />
			<b>Add New Contact Group:</b> <?php 
                            if (!count($contactgroups_list)) {
                                ?>
<strong>No Contact Groups Available</strong><br /><?php 
                            } else {
                                print_select("host_manage[contactgroup_add][contactgroup_id]", $contactgroups_list, "contactgroup_id", "contactgroup_name", "0");
                                ?>
 <input type="submit" value="Add Contact Group"><br /><?php 
                            }
                            ?>
			<?php 
                            echo $lilac->element_desc("contact_groups", "nagios_hosts_desc");
                            ?>
<br />
			<br />
			</form>
			</td>
		</tr>
		</table>
		<?php 
                        } else {
Esempio n. 2
0
function print_search_body($query, $type, $server = '')
{
    global $rr_types;
    $rr = $rr_types;
    unset($rr['basic']);
    echo '<table  cellpadding="2" cellspacing="0">';
    echo '<tr><td><center><form name search method="GET">';
    echo '<input type="text" maxlength="300" name="query" placeholder="Domain/IP" value="' . $query . '">&nbsp;';
    print_select('type', $rr, 'Type', $type);
    echo '<input type="text" maxlength="100" name="server" placeholder="DNS Server" value="' . $server . '">&nbsp;';
    echo '<input type="submit" value="Search">';
    echo '</form><center><br> ';
}
Esempio n. 3
0
    serialize_in_temp($filter, $config["id_user"]);
    $buttons .= print_button(__('Export to CSV'), '', false, 'window.open(\'' . 'include/export_csv.php?export_csv_inventory=1' . '\')', 'class="sub csv"', true);
    $buttons .= print_report_button("index.php?sec=inventory&sec2=operation/inventories/inventory&search=1&params={$params}", __('Export to PDF') . "&nbsp;");
    $buttons .= '</div>';
    $all_inventory_status = inventories_get_inventory_status();
    array_unshift($all_inventory_status, __("All"));
    $table_search->data[2][0] = print_select($all_inventory_status, 'inventory_status', $inventory_status, '', '', '', true, false, false, __('Status'));
    $params_associated['input_id'] = 'text-associated_user';
    $params_associated['input_name'] = 'associated_user';
    $params_associated['input_value'] = $associated_user;
    $params_associated['title'] = __('Associated user');
    $params_associated['return'] = true;
    $table_search->data[2][1] = user_print_autocomplete_input($params_associated);
    $companies = get_companies();
    array_unshift($companies, __("All"));
    $table_search->data[2][2] = print_select($companies, 'id_company', $id_company, '', '', 0, true, false, false, __('Associated company'), '', 'width: 200px;');
    $table_search->data[3][0] = "&nbsp;";
    $table_search->colspan[3][0] = 4;
    $table_search->data[4][0] = $buttons;
    $table_search->colspan[4][0] = 4;
    print_table($table_search);
    echo '</form>';
}
$page = (int) get_parameter('page', 1);
switch ($mode) {
    case 'tree':
        inventories_print_tree($sql_search, $sql_search_obj_type, $last_update);
        break;
    case 'list':
        inventories_show_list($sql_search, $sql_search_count, $params, $last_update);
        break;
Esempio n. 4
0
    $actions[$act['accion']] = $act['accion'];
}
$table_search = new StdClass();
$table_search->width = '100%';
$table_search->class = 'search-table';
$table_search->style = array();
$table_search->colspan = array();
$table_search->style[0] = 'font-weight: bold';
$table_search->style[1] = 'font-weight: bold';
$table_search->style[2] = 'font-weight: bold';
$table_search->style[3] = 'font-weight: bold';
$table_search->data = array();
$table_search->data[0][0] = __('Search');
$table_search->data[0][0] .= print_input_text("text", $text, "", 25, 100, true);
$table_search->data[1][0] = __('Action');
$table_search->data[1][0] .= print_select($actions, 'action', $action, '', __('Any'), '', true, false, true, '', false, "width:218px;");
$table_search->data[2][0] = __('Date from');
$table_search->data[2][0] .= print_input_text('date_from', $date_from, '', 10, 20, true, '');
$table_search->data[3][0] = __('Date to');
$table_search->data[3][0] .= print_input_text('date_to', $date_to, '', 10, 20, true);
$table_search->data[4][0] = print_submit_button(__('Search'), 'search_btn', false, 'class="sub search"', true);
$where_clause = $where;
$where_clause = str_replace(array("\r", "\n"), '', $where_clause);
$table_search->data[5][0] = print_button(__('Export to CSV'), '', false, 'window.open(\'include/export_csv.php?export_csv_audit=1&where_clause=' . str_replace('"', "\\'", $where_clause) . '\')', 'class="sub"', true);
echo "<div class='divform'>";
echo "<form method=post action ='index.php?sec=godmode&sec2=godmode/setup/audit&text={$text}&action={$action}' >";
print_table($table_search);
echo "</form>";
echo "</div>";
// Pagination
$total_events = get_db_sql("SELECT COUNT(ID_sesion) FROM tsesion {$where}");
Esempio n. 5
0
$types = get_incident_types();
echo "<h1>" . __('CREATE TICKET') . "</h1>";
echo "<div id=msg-str></div>";
// NEW INCIDENT FORM
echo "<div id='form_file'>";
$table->width = '98%';
$table->class = 'search-table';
$table->id = "incident-editor";
$table->style = array();
$table->data = array();
$table->colspan = array();
$table->colspan[0][0] = 2;
$table->colspan[2][0] = 2;
$table->data[0][0] = print_input_text('title', '', '', 100, 0, true, __('Title'));
$table->data[1][0] = print_select($priorities, 'priority_form', 2, '', '', '', true, false, false, __('Priority'));
$table->data[1][1] = print_select($types, 'id_incident_type', '', 'javascript: show_incident_type_fields(1);', 'Select', '', true, 0, true, __('Ticket type'));
$table->data[2][0] = print_textarea('description', 9, 80, '', '', true, __('Description'));
$action = 'index.php?sec=incidents&sec2=operation/incidents_simple/incidents';
$into_form = print_table($table, true);
$into_form .= '<h3><a href="javascript:toggle_file_addition();">' . __('Add a file') . ' (' . __('Optional') . ')<div style="float:left;"><img id="file_moreless" src="images/sort_down.png" border=0>&nbsp;</div></a></h3>';
$into_form .= '<div id="file_addition" style="display:none"><b>' . __('File') . '</b>';
$into_form .= '___FILE___';
$into_form .= print_input_hidden('create_incident', 1, true);
$into_form .= print_input_hidden('group_id', $group_id, true);
$into_form .= print_textarea('file_description', 2, 10, '', '', true, __('Description'));
$into_form .= "</div>";
$into_form .= "<div style='text-align:right;'>";
$into_form .= print_button(__('Create'), 'create_incident', false, '', 'style="margin-top:4px;" class="action_btn sub next"', true);
$into_form .= "</div>";
echo print_input_file_progress($action, $into_form, 'id="form-add-file"', 'sub next', 'button-create_incident', true, '___FILE___');
echo "</div>";
Esempio n. 6
0
    $newsletters = array();
}
$newsletter_values = array();
foreach ($newsletters as $news) {
    $newsletter_values[$news['id']] = $news['name'];
}
$newsletter_values[0] = __('Any');
$table->data[0][2] = print_select($newsletter_values, "search_newsletter", $search_newsletter, '', '', '', true, 0, true);
$status_values[0] = __('Show enabled addresses');
$status_values[1] = __('Show disabled addresses');
$status_values[2] = __('Any');
$table->data[0][3] = print_select($status_values, "search_status", $search_status, '', '', '', true, 0, true);
$validated_values[0] = __('Validated');
$validated_values[1] = __('Pending');
$validated_values[2] = __('Any');
$table->data[0][4] = print_select($validated_values, "search_validate", $search_validate, '', '', '', true, 0, true);
$table->data[0][5] = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
echo '<form method="post" action="">';
print_table($table);
echo '</form>';
$sql = "SELECT * FROM tnewsletter_address {$where_clause} ORDER BY datetime DESC";
$issues = get_db_all_rows_sql($sql);
$count_addresses = count($issues);
echo '<h5>' . __('Total addresses: ') . $count_addresses . '</h5>';
$issues = print_array_pagination($issues, "index.php?sec=customers&sec2=operation/newsletter/address_definition&search_text={$search_text}&search_status={$search_status}&search_newsletter={$search_newsletter}");
if ($issues !== false) {
    $table->width = "90%";
    $table->class = "listing";
    $table->data = array();
    $table->style = array();
    $table->style[0] = 'font-weight: bold';
Esempio n. 7
0
}
$table->data[3][0] .= '</span>';
$banners = list_files('images/group_banners/', 'png', 0, true);
$table->data[3][1] = print_select($banners, "banner", $banner, '', 'None', '', true, false, false, __('Banner'));
$table->data[4][0] = print_input_text('soft_limit', $soft_limit, '', 10, 0, true, __('Tickets Soft limit')) . print_help_tip(__("If it's a standard user it shows the maximum nº of tickets for this group that one user can have opened at the same time. If it's a external user it shows the maximum nº of tickets for this group and user that one user can have opened at the same time"), true);
if ($config['enteprise'] == 1) {
    $table->data[4][1] = print_checkbox('enforce_soft_limit', 1, $enforce_soft_limit, true, __('Enforce soft limit'));
}
$table->data[5][0] = print_input_text('hard_limit', $hard_limit, '', 10, 0, true, __('Tickets Hard limit')) . print_help_tip(__("If it's a standard user it shows the nº of maximum tickets for this group, that one user could have in total (open or closed). If it's a external user it shows the nº of maximum tickets for user, for this group, that one user could have in total (open or closed). When this limit is exceeded, the user will receive a notification in the screen when he try to create a ticket, so he won't be able to create any more."), true);
$slas_aux = get_db_all_rows_sql("SELECT id, name FROM tsla ORDER BY name");
$slas = array();
$slas[0] = __("None");
foreach ($slas_aux as $s) {
    $slas[$s["id"]] = $s["name"];
}
$table->data[5][1] = print_select($slas, 'id_sla', $id_sla, '', '', 0, true, false, false, __('Ticket SLA'));
$table->data[6][0] = print_input_text('inventory_name', $inventory_name, '', 25, 0, true, __('Default Inventory object'), false);
$table->data[6][0] .= "<a href='javascript: show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . '&nbsp;&nbsp;' . __('Search parent') . "</a>";
$table->data[6][0] .= print_input_hidden('id_inventory', $id_inventory, true);
$table->data[6][1] = print_input_text('email_from', $email_from, '', 40, 0, true, __('Email from'));
if ($config['enteprise'] == 1) {
    $table->data[7][0] = print_textarea("email_group", 5, 40, $email_group, '', true, __('Email group') . print_help_tip(__("Place each email address in a new line. You can use regular expresions"), true));
}
echo '<form id="form-configurar_grupo" method="post" action="index.php?sec=users&sec2=godmode/grupos/lista_grupos">';
print_table($table);
enterprise_hook("groups_email_queue_form", array($autocreate_user, $grant_access, $send_welcome, $default_company, $welcome_email, $email_queue, $default_profile, $user_level, $incident_type));
echo '<div class="button" style="width: ' . $table->width . '">';
if ($id) {
    print_submit_button(__('Update'), '', false, 'class="sub upd"');
    print_input_hidden('update_group', 1);
    print_input_hidden('id', $id);
Esempio n. 8
0
                                            ?>
					<h3>Add A Service Filter</h3>
					<div class="shaded">
					<form name="host_manage" method="post" action="host_template.php?id=<?php 
                                            echo $_GET['id'];
                                            ?>
&section=autodiscovery">
					<input type="hidden" name="request" value="host_template_add_autodiscovery_service" />
					<input type="hidden" name="host_template_id" value="<?php 
                                            echo $_GET['id'];
                                            ?>
">

					<p>
					 <strong>Protocol: </strong><?php 
                                            print_select("host_manage[protocol]", $protocol_select, "value", "option");
                                            ?>
 <strong>Port: (Required) </strong><input type="text" size="4" maxlength="40" name="host_manage[port]" />
					</p>
					<p>
					<strong>Name: </strong><input type="text" name="host_manage[name]" size="40" maxlength="255" /><br />
					<?php 
                                            echo $lilac->element_desc("autodiscovery_service_filter_name", "host_template_autodiscovery");
                                            ?>
					</p>
					<p>
					<strong>Product: </strong><input type="text" name="host_manage[product]" size="40" maxlength="255" /> <strong>Version: </strong><input type="text" name="host_manage[version]" size="4" maxlength="255" /><br />
					<?php 
                                            echo $lilac->element_desc("autodiscovery_service_filter_product", "host_template_autodiscovery");
                                            ?>
					</p>
Esempio n. 9
0
function newai_import($fields, $mode = 'table')
{
    global $common_html, $html_etc;
    global $return_sql_line, $db;
    global $columns;
    //print_R($columns);
    global $showlistfieldlist, $showlistfieldlist_key;
    global $foreignkey, $uniquekey, $primarykey;
    $tablename = $fields['table']['name'];
    $SQL = $fields['sql']['SQL'];
    $init = explode('_', $_GET['action']);
    $mark = $init[1];
    if ($uniquekey == '') {
        $uniquekey = $primarykey;
    }
    //print $uniquekey;
    print "<FORM name=form1 action=\"?action=import_" . $mark . "_data\" method=post encType=multipart/form-data>\n";
    print "<input type=hidden name=hidden_str value=''>\n";
    print "<script >";
    print "\nfunction temp_function()\n{\n\n\tvar selectid_str=\"\";\n\t/*\n\tfor(i=0;i<document.all(\"selectid\").length;i++)\n\t\t{\n\n\t\tel=document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{  val=el.value;\n         selectid_str+=val + \",\";\n\t\t}\n\t}*/\n\tform1.hidden_str.value=selectid_str;\n\tform1.submit();\n\tvar sbtn=document.getElementsByName('submitbtn');\n\tfor(i=0;i<sbtn.length;i++)\n\t{\n\t\tsbtn[i].value='提交中';\n\t\tsbtn[i].disabled=true;\n\t}\n}\n";
    print "</script>";
    global $tablewidth, $primarykey, $primarykey_index;
    $tablewidth = $tablewidth != "" ? $tablewidth : 450;
    table_begin($tablewidth);
    print_title("数据导入操作,唯一索引限制,多个表示不能同时重复", 3);
    //print_R($common_html['common_html']['contentimport']);
    if ($foreignkey != "") {
        $foreignkey_array = explode(':', $foreignkey);
        $columns_parent = returntablecolumn($foreignkey_array[1]);
        print_R($columns_parent);
        print_select('选择考试名称', $columns[(string) $foreignkey_array[3]], $value, $foreignkey_array[1], $columns_parent[(string) $foreignkey_array[3]], $columns_parent[(string) $foreignkey_array[2]], $colspan = 3, $columns_parent[(string) $foreignkey_array[4]]);
        print_hidden($columns[(string) $foreignkey_array[3]], 'foreignkey');
    }
    print "<TR class=TableData>\n";
    print "<TD noWrap align=middle width=50>唯一索引:</TD>\n";
    print "<TD colspan=2>";
    $uniquekey_array = explode(',', $uniquekey);
    $FieldList = array();
    for ($i = 0; $i < sizeof($uniquekey_array); $i++) {
        $uniquekey_KEY = $uniquekey_array[$i];
        if ($uniquekey_KEY != "") {
            $uniquekey_KEY_ADD = explode(':', $uniquekey_KEY);
            if ($uniquekey_KEY_ADD[1] == "userid") {
                $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
            } else {
                if ($uniquekey_KEY_ADD[1] == "username") {
                    $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
                } else {
                    if ($uniquekey_KEY_ADD[1] == "datetime") {
                        $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
                    } else {
                        $tablenamelang = returnsystemlang($tablename);
                        $FieldList[] = $tablenamelang[$tablename][$columns["" . $uniquekey_KEY_ADD[0] . ""]];
                    }
                }
            }
        }
    }
    //print_R($uniquekey_array);
    //输出不较验主键时的选择列表
    $唯一字段显示文本 = join(',', $FieldList);
    print $唯一字段显示文本;
    print "</TD>\n";
    print "</TR>\n";
    global $importgroup;
    if ($importgroup != "") {
        //print $importgroup;
        print_title('选择要导入的组', 3);
        $importgroupArray = explode(':', $importgroup);
        $showfieldIndex = $importgroupArray[0];
        $showFieldName = $columns[$showfieldIndex];
        $showfieldTableName = $importgroupArray[1];
        $showfieldColumns = returntablecolumn($showfieldTableName);
        $showfieldIndexValue = $importgroupArray[2];
        $showfieldIndexName = $importgroupArray[3];
        $showfieldIndexValue = $showfieldColumns[$showfieldIndexName];
        $showfieldIndexName = $showfieldColumns[$showfieldIndexName];
        print_select('选择要导入的组:', $showFieldName, $value = '', $showfieldTableName, $showfieldIndexValue, $showfieldIndexName, $colspan = 2, $setfieldname = '', $setfieldvalue = '', $setfieldboolean = '');
    }
    /*
    if($tablename == 'customer'){
    	print_title('请您先<a style="color:red;" href="xls_template/客户信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }elseif($tablename == 'supply'){
    	print_title('请您先<a style="color:red;" href="xls_template/供应商信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }elseif($tablename == 'product'){
    	print_title('请您先<a style="color:red;" href="xls_template/商品信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }else{
    	print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板',3);
    }
    */
    print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板', 3);
    print "<TR class=TableData height=50>\n";
    print "<TD noWrap align=middle >EXCEL格式文件</TD>\n";
    print "<TD colspan=2><input name='uploadfileXLS' type=file size=25 class=SmallInput></TD>\n";
    print "</TR>\n";
    //print_title('导入CSV格式数据文件',3);
    //print "<TR class=TableData height=50>\n";
    //print "<TD noWrap align=middle >MS CSV文件</TD>\n";
    //print "<TD colspan=2><input name='uploadfile' type=file size=25 class=SmallInput></TD>\n";
    //print "</TR>\n";
    print "<tr align=\"center\" class=\"TableControl\">\n<td colspan=\"3\">\n<div align=\"center\"><input type=\"button\" name='submitbtn' value=\"" . $common_html['common_html']['import'] . "\" class=\"SmallButton\" onClick=\"temp_function();\">  <input type=\"button\" value=\"" . $common_html['common_html']['return'] . "\" class=\"SmallButton\" onClick=\"history.back();\"></div>\n</td></tr>\n";
    table_end();
    form_end();
    print "<BR>";
    table_begin($tablewidth);
    print_title("EXCEL格式数据正确但导入失败时,请按以下方法进行:");
    print "<TR class=TableData height=50>\n";
    print "<TD colspan=3><font color=green>\n\t如何过滤EXCEL里面的格式,转化为纯净的EXCEL数据格式文件:<BR>\n\n\t&nbsp;&nbsp;1 准备好原始格式数据文件<BR>\n\t&nbsp;&nbsp;2 新建一个EXCEL文件,即空白文件<BR>\n\t&nbsp;&nbsp;3 工具栏选择数据->导入外部数据->导入数据,弹出的对话框里面,选择第一步准备好的原始文件<BR>\n\t&nbsp;&nbsp;4 其它不要动,一切按默认的方法进行操作<BR>\n\t&nbsp;&nbsp;5 即可得到纯净的EXCEL数据格式文件,把这个文件进行导入即可<BR>\n\t&nbsp;&nbsp;注意:这种方法只用于解决,数据列数及列名正确,但软件无法识别的情况<BR>\n\t</font>\n\t\n";
    print "</TD></TR>\n";
    table_end();
    form_end();
}
Esempio n. 10
0
$status = get_parameter('status', 0);
$search = get_parameter('search', '');
unset($table);
$table->class = 'result_table';
$table->width = '98%';
$table->data = array();
$table->header = array();
$table->style[0] = 'width:60px;text-align:right;';
$table->style[1] = 'width:150px';
$table->style[2] = 'width:60px;text-align:right;';
$table->style[3] = 'width:150px';
$table->style[4] = 'width:100px';
$table->data[0][0] = "<b>" . __('Search') . "</b>";
$table->data[0][1] = print_input_text('search', $search, '', 20, 0, true);
$table->data[0][2] = "<b>" . __('Status') . "</b>";
$table->data[0][3] = print_select($statuses, 'status', $status, '', __('Any'), 0, true);
$table->data[0][4] = print_submit_button(__('Filter'), '', false, 'class="sub search"', true);
$table->data[0][5] = '';
echo '<form method="post">';
print_table($table);
echo '</form>';
unset($table);
// INCIDENT LIST
$table->class = 'result_table listing';
$table->width = '98%';
$table->id = 'incident_search_result_table';
$table->head = array();
$table->head[0] = __('ID');
$table->head[1] = __('Ticket');
$table->head[2] = __('Status') . "<br /><em>" . __('Resolution') . "</em>";
$table->head[3] = __('Priority');
Esempio n. 11
0
 function editfeeds()
 {
     global $purge_intervals;
     global $update_intervals;
     $feed_ids = $this->dbh->escape_string($_REQUEST["ids"]);
     print_notice("Enable the options you wish to apply using checkboxes on the right:");
     print "<p>";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"ids\" value=\"{$feed_ids}\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-feeds\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"batchEditSave\">";
     print "<div class=\"dlgSec\">" . __("Feed") . "</div>";
     print "<div class=\"dlgSecCont\">";
     /* Category */
     if (get_pref('ENABLE_FEED_CATS')) {
         print __('Place in category:') . " ";
         print_feed_cat_select("cat_id", false, 'disabled="1" dojoType="dijit.form.Select"');
         $this->batch_edit_cbox("cat_id");
     }
     /* FTS Stemming Language */
     if (DB_TYPE == "pgsql") {
         print "<hr/>";
         print __('Language:') . " ";
         print_select("feed_language", "", $this::$feed_languages, 'disabled="1" dojoType="dijit.form.Select"');
         $this->batch_edit_cbox("feed_language");
     }
     print "</div>";
     print "<div class=\"dlgSec\">" . __("Update") . "</div>";
     print "<div class=\"dlgSecCont\">";
     /* Update Interval */
     print_select_hash("update_interval", "", $update_intervals, 'disabled="1" dojoType="dijit.form.Select"');
     $this->batch_edit_cbox("update_interval");
     /* Purge intl */
     if (FORCE_ARTICLE_PURGE == 0) {
         print "<br/>";
         print __('Article purging:') . " ";
         print_select_hash("purge_interval", "", $purge_intervals, 'disabled="1" dojoType="dijit.form.Select"');
         $this->batch_edit_cbox("purge_interval");
     }
     print "</div>";
     print "<div class=\"dlgSec\">" . __("Authentication") . "</div>";
     print "<div class=\"dlgSecCont\">";
     print "<input dojoType=\"dijit.form.TextBox\"\n\t\t\tplaceHolder=\"" . __("Login") . "\" disabled=\"1\"\n\t\t\tname=\"auth_login\" value=\"\">";
     $this->batch_edit_cbox("auth_login");
     print "<hr/> <input dojoType=\"dijit.form.TextBox\" type=\"password\" name=\"auth_pass\"\n\t\t\tplaceHolder=\"" . __("Password") . "\" disabled=\"1\"\n\t\t\tvalue=\"\">";
     $this->batch_edit_cbox("auth_pass");
     print "</div>";
     print "<div class=\"dlgSec\">" . __("Options") . "</div>";
     print "<div class=\"dlgSecCont\">";
     print "<input disabled=\"1\" type=\"checkbox\" name=\"private\" id=\"private\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"private_l\" class='insensitive' for=\"private\">" . __('Hide from Popular feeds') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("private", "private_l");
     print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"include_in_digest\"\n\t\t\tname=\"include_in_digest\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"include_in_digest_l\" class='insensitive' for=\"include_in_digest\">" . __('Include in e-mail digest') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("include_in_digest", "include_in_digest_l");
     print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"always_display_enclosures\"\n\t\t\tname=\"always_display_enclosures\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"always_display_enclosures_l\" class='insensitive' for=\"always_display_enclosures\">" . __('Always display image attachments') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("always_display_enclosures", "always_display_enclosures_l");
     print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"hide_images\"\n\t\t\tname=\"hide_images\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"hide_images_l\"\n\t\t\tfor=\"hide_images\">" . __('Do not embed images') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("hide_images", "hide_images_l");
     print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"cache_images\"\n\t\t\tname=\"cache_images\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label class='insensitive' id=\"cache_images_l\"\n\t\t\tfor=\"cache_images\">" . __('Cache images locally') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("cache_images", "cache_images_l");
     print "<br/><input disabled=\"1\" type=\"checkbox\" id=\"mark_unread_on_update\"\n\t\t\tname=\"mark_unread_on_update\"\n\t\t\tdojoType=\"dijit.form.CheckBox\">&nbsp;<label id=\"mark_unread_on_update_l\" class='insensitive' for=\"mark_unread_on_update\">" . __('Mark updated articles as unread') . "</label>";
     print "&nbsp;";
     $this->batch_edit_cbox("mark_unread_on_update", "mark_unread_on_update_l");
     print "</div>";
     print "<div class='dlgButtons'>\n\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return dijit.byId('feedEditDlg').execute()\">" . __('Save') . "</button>\n\t\t\t<button dojoType=\"dijit.form.Button\"\n\t\t\tonclick=\"return dijit.byId('feedEditDlg').hide()\">" . __('Cancel') . "</button>\n\t\t\t</div>";
     return;
 }
Esempio n. 12
0
$table->class = 'search-table-button';
$table->colspan = array();
$table->data = array();
$incident_reporter_options[0] = __('Disabled');
$incident_reporter_options[1] = __('Enabled');
$language_config = get_db_value('value', 'tconfig', 'token', 'language_code');
$table->data[0][0] = print_select_from_sql('SELECT id_language, name FROM tlanguage ORDER BY name', 'language_code', $language_config, '', '', '', true, false, false, __('Language'));
$table->data[0][1] = print_input_text("sitename", $config["sitename"], '', 30, 50, true, __('Sitename'));
$error_log_options[0] = __('Disabled');
$error_log_options[1] = __('Enabled');
$table->data[1][0] = print_checkbox("error_log", $error_log_options, $config["error_log"], true, __('Enable error log') . print_help_tip(__("This errorlog is on /integria.log"), true));
$table->data[1][1] = print_input_text("timezone", $config["timezone"], '', 15, 30, true, __('Timezone for integria'));
$table->data[2][0] = print_textarea("api_acl", 2, 1, $config["api_acl"], 'style="max-width: 280px;"', true, __('List of IP with access to API') . print_help_tip(__("List of IP (separated with commas which can access to the integria API. Use * for any address (INSECURE!)"), true), false);
$table->data[2][1] = print_input_password("api_password", $config["api_password"], '', 30, 255, true, __('API password'));
$days_of_week = get_days_of_week();
$table->data[4][0] = print_select($days_of_week, "first_day_week", $config["first_day_week"], '', '', '', true, 0, false, __('First day of the week'));
$table->data[4][1] = print_input_text("url_updatemanager", $config["url_updatemanager"], '', 35, 255, true, __('URL update manager'));
$table->data[5][0] = print_input_text("loginhash_pwd", $config["loginhash_pwd"], '', 30, 255, true, __('Loginhash password'));
$table->data[5][1] = print_checkbox("access_protocol", 1, $config["access_protocol"], true, __('Enable HTTPS access'));
$table->data[6][0] = print_input_text("access_port", $config["access_port"], '', 10, 255, true, __('Access port') . print_help_tip(__("Leave blank to use default port (80)"), true));
$table->data[6][1] = print_input_text("access_public", $config["access_public"], '', 30, 50, true, __('Public access to server') . print_help_tip(__("Public IP or name for the server, for example (23.45.67.3 or mydomain.com)"), true));
$csv_standard_encoding = !isset($config['csv_standard_encoding']) ? false : (bool) $config['csv_standard_encoding'];
$table->data[7][0] = print_label(__('CSV encoding type'), '', '', true);
$table->data[7][0] .= __('Excel') . '&nbsp;' . print_radio_button('csv_standard_encoding', 0, '', $csv_standard_encoding, true);
$table->data[7][0] .= print_help_tip(__("The Excel type may not be compatible with other applications"), true);
$table->data[7][0] .= '&nbsp;&nbsp;' . __('Other') . '&nbsp;' . print_radio_button('csv_standard_encoding', 1, '', $csv_standard_encoding, true);
$table->data[7][1] = print_checkbox("enable_update_manager", 1, $config["enable_update_manager"], true, __('Enable update manager updates'));
$table->data[8][0] = print_input_text("max_direct_download", $config["max_direct_download"], '', 10, 255, true, __('Maximum direct download size (MB)'));
$table->data[8][1] = print_input_text("max_file_size", $config["max_file_size"], '', 10, 255, true, __('Max. Upload file size'));
echo "<form name='setup' method='post'>";
print_table($table);
Esempio n. 13
0
$table->data['id_combo_value'][0] .= print_help_tip(__("Set values separated by comma"), true);
// Add values
if ($global_field) {
    $table->data['id_combo_value'][1] = print_input_text('add_combo_value', $add_combo_value, '', 45, 0, true, __('Add values')) . print_help_tip(__("Set values separated by comma"), true);
}
// Linked values
$sql = "SELECT id, label\n\t\tFROM tincident_type_field\t\n\t\tWHERE id_incident_type = {$id_incident_type}\n\t\t\tAND type = 'linked'";
$parents_result = get_db_all_rows_sql($sql);
if ($parents_result == false) {
    $parents_result = array();
}
$parents = array();
foreach ($parents_result as $result) {
    $parents[$result['id']] = $result['label'];
}
$table->data['id_parent_value'][0] = print_select($parents, 'parent', $parent, '', __('Select parent'), '0', true, 0, true, __("Parent"), $global_field);
$table->data['id_linked_value'][0] = print_textarea('linked_value', 15, 1, $linked_value, '', true, __('Linked value') . integria_help("linked_values", true), $global_field);
if ($global_field) {
    $table->data['id_linked_value'][1] = "";
    $table->data['id_linked_value'][2] = print_textarea('add_linked_value', 15, 1, $add_linked_value, '', true, __('Add values') . integria_help("linked_values", true));
}
// Buttons
if ($add_field) {
    $button = print_input_hidden('add_field', 1, true);
    $button .= print_submit_button(__('Create'), 'create_btn', false, 'class="sub next"', true);
} else {
    if ($update_field) {
        if (!$global_field && ($type != 'linked' || $type != 'combo') || $global_field && ($type == 'linked' || $type == 'combo')) {
            $button = print_input_hidden('update_field', 1, true);
            $button .= print_input_hidden('add_field', 0, true);
            $button .= print_input_hidden('id_field', $id_field, true);
}
echo $result_msg;

$table = new stdClass;
$table->width = '100%';
$table->class = 'search-table-button';
$table->data = array ();
$table->colspan = array ();
$table->colspan[1][0] = 2;
$table->colspan[2][0] = 2;
	
$table->data[0][0] = print_input_text ('name', $name, '', 40, 255, true, __('Name'));

$groups = get_user_groups ($config['id_user'], "VR");
$groups[0] = __('None');
$table->data[0][1] = print_select ($groups, "id_group", $id_group, '', '', 0, true, false, false, __('Group'));

$table->data[1][0] = print_textarea ('sql', 10, 100, $sql, '', true, __('Report SQL sentence'));

if (dame_admin ($config['id_user'])) {
	if ($id) {
			$button = print_input_hidden ('update_report', 1, true);
			$button .= print_input_hidden ('id', $id, true);
			$button .= print_submit_button (__('Update'), 'update', false, 'class="sub upd"', true);
	} else {
		$button = print_input_hidden ('create_report', 1, true);
		$button .= print_submit_button (__('Create'), 'create', false, 'class="sub create"', true);
	}
}

echo '<form id="form-inventory_report" method="post">';
	$available_links = get_db_all_rows_sql("SELECT `id`,`name` FROM tinventory WHERE id NOT IN ($id)");
} else {
	$available_links = get_db_all_rows_sql("SELECT `id`,`name` FROM tinventory WHERE id NOT IN ($ids_str)");
}

if ($available_links == false) {
	$available_links = array();
}

$available_inventory = array();
foreach ($available_links as $key => $inventory) {
	$available_inventory[$inventory['id']] = $inventory['name'];
}

if ($write_permission) {
	$url = "index.php?sec=inventory&sec2=operation/inventories/inventory_relationship&add_link=1&id_src=$id&id=$id";

	$data[0] = "<form name=dataedit method=post action='" . $url . "'>";
	$data[0] .= print_select($available_inventory, "link", '', '', __("Select inventory"), 0, true);

	$data[1] = "";

	$data[2] = print_input_image("add_link", "images/add.png", 1, '', true);
	$data[2] .= "</form>";

	array_push ($table->data, $data);
}

print_table($table);
?>
Esempio n. 16
0
function print_select($pid, $depth) {
	global $all_content;

	if (!isset($all_content[$pid])) {
		return;
	}

	foreach ($all_content[$pid] as $row) {
		if (isset($all_content[$row['content_id']])) {
			echo '<option value="'.$row['content_id'].'"';
			if ($_GET['ctid'] == $row['content_id']) {
				echo ' selected="selected"';
			}
			echo '>';
			echo str_repeat('&nbsp;', $depth * 5);
			echo $row['title'].'</option>';

			print_select($row['content_id'], $depth+1);
		}
	}
}
Esempio n. 17
0
$row = array();
$row[] = print_input_text("smtp_user", $config["smtp_user"], '', 25, 200, true, __('SMTP User'));
$row[] = print_input_text("smtp_pass", $config["smtp_pass"], '', 25, 200, true, __('SMTP Password'));
$row[] = print_button(__("Test"), 'test_smtp', false, '', 'class="sub"', true) . '<div id="test_smtp_images" style="display: inline;"></div>';
$table->data[] = $row;
$row = array();
$row[] = print_input_text("smtp_queue_retries", $config["smtp_queue_retries"], '', 5, 10, true, __('SMTP Queue retries') . print_help_tip(__("This are the number of attempts the mail queue try to send the mail. Should be high (20-30) if your internet connection have frequent downtimes and near zero if its stable"), true));
$row[] = print_input_text("max_pending_mail", $config["max_pending_mail"], '', 10, 255, true, __('Max pending mail') . print_help_tip(__("Maximum number of queued emails. When this number is exceeded, an alert is activated"), true));
$row[] = print_input_text("batch_newsletter", $config["batch_newsletter"], '', 4, 255, true, __('Max. emails sent per execution') . print_help_tip(__("This means, in each execution of the batch external process (integria_cron). If you set your cron to execute each hour in each execution of that process will try to send this ammount of emails. If you set the cron to run each 5 min, will try this number of mails."), true));
$table->data[] = $row;
$row = array();
$row[] = "<br /><h4>" . __("POP/IMAP Parameters") . "</h4>";
$table->data['pop-imap'] = $row;
$table->colspan['pop-imap'][0] = $cols;
$row = array();
$row[] = print_select($popimap, "select_pop_imap", $config["select_pop_imap"], '', '', '', true, 0, true, __('Select IMAP or POP'));
$row[] = print_input_text("pop_host", $config["pop_host"], '', 25, 30, true, __('POP/IMAP Host') . print_help_tip(__("Use ssl://host.domain.com if want to use IMAP with SSL"), true));
$row[] = print_input_text("pop_port", $config["pop_port"], '', 15, 30, true, __('POP/IMAP Port') . print_help_tip(__("POP3: Port 110, IMAP: Port 143, IMAPS: Port 993, SSL-POP: Port 995"), true));
$table->data[] = $row;
$row = array();
$row[] = print_input_text("pop_user", $config["pop_user"], '', 15, 30, true, __('POP/IMAP User'));
$row[] = print_input_text("pop_pass", $config["pop_pass"], '', 15, 30, true, __('POP/IMAP Password'));
$table->data[] = $row;
$row = array();
$row[] = "<br /><h4>" . __("Mail general texts") . "</h4>";
$table->data['mail_header_footer'] = $row;
$table->colspan['mail_header_footer'][0] = $cols;
$row = array();
$row[] = print_textarea("header_email", 9, 40, $config["HEADER_EMAIL"], '', true, __('Email header'));
$table->data['header_email'] = $row;
$table->colspan['header_email'][0] = $cols;
 function index()
 {
     global $access_level_names;
     $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES", "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT", "FEEDS_SORT_BY_UNREAD");
     /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */
     $profile_blacklist = array("ALLOW_DUPLICATE_POSTS", "PURGE_OLD_DAYS", "PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP", "BLACKLISTED_TAGS", "ENABLE_API_ACCESS", "UPDATE_POST_ON_CHECKSUM_CHANGE", "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE", "SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
     $_SESSION["prefs_op_result"] = "";
     print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Personal data / Authentication') . "\">";
     print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
     print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\tevt.preventDefault();\n\t\tif (this.validate()) {\n\t\t\tnotify_progress('Saving data...', true);\n\n\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\tnotify_callback2(transport);\n\t\t\t} });\n\n\t\t}\n\t\t</script>";
     print "<table width=\"100%\" class=\"prefPrefsList\">";
     print "<h2>" . __("Personal data") . "</h2>";
     $result = $this->dbh->query("SELECT email,full_name,otp_enabled,\n\t\t\taccess_level FROM ttrss_users\n\t\t\tWHERE id = " . $_SESSION["uid"]);
     $email = htmlspecialchars($this->dbh->fetch_result($result, 0, "email"));
     $full_name = htmlspecialchars($this->dbh->fetch_result($result, 0, "full_name"));
     $otp_enabled = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "otp_enabled"));
     print "<tr><td width=\"40%\">" . __('Full name') . "</td>";
     print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"\n\t\t\tvalue=\"{$full_name}\"></td></tr>";
     print "<tr><td width=\"40%\">" . __('E-mail') . "</td>";
     print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"email\" required=\"1\" value=\"{$email}\"></td></tr>";
     if (!SINGLE_USER_MODE && !$_SESSION["hide_hello"]) {
         $access_level = $this->dbh->fetch_result($result, 0, "access_level");
         print "<tr><td width=\"40%\">" . __('Access level') . "</td>";
         print "<td>" . $access_level_names[$access_level] . "</td></tr>";
     }
     print "</table>";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changeemail\">";
     print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Save data") . "</button>";
     print "</form>";
     if ($_SESSION["auth_module"]) {
         $authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
     } else {
         $authenticator = false;
     }
     if ($authenticator && method_exists($authenticator, "change_password")) {
         print "<h2>" . __("Password") . "</h2>";
         $result = $this->dbh->query("SELECT id FROM ttrss_users\n\t\t\t\tWHERE id = " . $_SESSION["uid"] . " AND pwd_hash\n\t\t\t\t= 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'");
         if ($this->dbh->num_rows($result) != 0) {
             print format_warning(__("Your password is at default value, please change it."), "default_pass_warning");
         }
         print "<form dojoType=\"dijit.form.Form\">";
         print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\tevt.preventDefault();\n\t\t\tif (this.validate()) {\n\t\t\t\tnotify_progress('Changing password...', true);\n\n\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\tnotify('');\n\t\t\t\t\t\tif (transport.responseText.indexOf('ERROR: ') == 0) {\n\t\t\t\t\t\t\tnotify_error(transport.responseText.replace('ERROR: ', ''));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnotify_info(transport.responseText);\n\t\t\t\t\t\t\tvar warn = \$('default_pass_warning');\n\t\t\t\t\t\t\tif (warn) Element.hide(warn);\n\t\t\t\t\t\t}\n\t\t\t\t}});\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t\t</script>";
         if ($otp_enabled) {
             print_notice(__("Changing your current password will disable OTP."));
         }
         print "<table width=\"100%\" class=\"prefPrefsList\">";
         print "<tr><td width=\"40%\">" . __("Old password") . "</td>";
         print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\" name=\"old_password\"></td></tr>";
         print "<tr><td width=\"40%\">" . __("New password") . "</td>";
         print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"\n\t\t\t\tname=\"new_password\"></td></tr>";
         print "<tr><td width=\"40%\">" . __("Confirm password") . "</td>";
         print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\" name=\"confirm_password\"></td></tr>";
         print "</table>";
         print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
         print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changepassword\">";
         print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Change password") . "</button>";
         print "</form>";
         if ($_SESSION["auth_module"] == "auth_internal") {
             print "<h2>" . __("One time passwords / Authenticator") . "</h2>";
             if ($otp_enabled) {
                 print_notice(__("One time passwords are currently enabled. Enter your current password below to disable."));
                 print "<form dojoType=\"dijit.form.Form\">";
                 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\t\tevt.preventDefault();\n\t\t\t\tif (this.validate()) {\n\t\t\t\t\tnotify_progress('Disabling OTP', true);\n\n\t\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\t\tnotify('');\n\t\t\t\t\t\t\tif (transport.responseText.indexOf('ERROR: ') == 0) {\n\t\t\t\t\t\t\t\tnotify_error(transport.responseText.replace('ERROR: ', ''));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t\t\t\tthis.reset();\n\t\t\t\t}\n\t\t\t\t</script>";
                 print "<table width=\"100%\" class=\"prefPrefsList\">";
                 print "<tr><td width=\"40%\">" . __("Enter your password") . "</td>";
                 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"\n\t\t\t\t\tname=\"password\"></td></tr>";
                 print "</table>";
                 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
                 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"otpdisable\">";
                 print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Disable OTP") . "</button>";
                 print "</form>";
             } else {
                 if (function_exists("imagecreatefromstring")) {
                     print_warning(__("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP."));
                     print "<p>" . __("Scan the following code by the Authenticator application:") . "</p>";
                     $csrf_token = $_SESSION["csrf_token"];
                     print "<img src=\"backend.php?op=pref-prefs&method=otpqrcode&csrf_token={$csrf_token}\">";
                     print "<form dojoType=\"dijit.form.Form\" id=\"changeOtpForm\">";
                     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
                     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"otpenable\">";
                     print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\tif (this.validate()) {\n\t\t\t\t\t\tnotify_progress('Saving data...', true);\n\n\t\t\t\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\t\t\tnotify('');\n\t\t\t\t\t\t\t\tif (transport.responseText.indexOf('ERROR:') == 0) {\n\t\t\t\t\t\t\t\t\tnotify_error(transport.responseText.replace('ERROR:', ''));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} });\n\n\t\t\t\t\t}\n\t\t\t\t\t</script>";
                     print "<table width=\"100%\" class=\"prefPrefsList\">";
                     print "<tr><td width=\"40%\">" . __("Enter your password") . "</td>";
                     print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"\n\t\t\t\t\t\tname=\"password\"></td></tr>";
                     print "<tr><td width=\"40%\">" . __("Enter the generated one time password") . "</td>";
                     print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" autocomplete=\"off\"\n\t\t\t\t\t\trequired=\"1\"\n\t\t\t\t\t\tname=\"otp\"></td></tr>";
                     print "<tr><td colspan=\"2\">";
                     print "</td></tr><tr><td colspan=\"2\">";
                     print "</td></tr>";
                     print "</table>";
                     print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Enable OTP") . "</button>";
                     print "</form>";
                 } else {
                     print_notice(__("PHP GD functions are required for OTP support."));
                 }
             }
         }
     }
     PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsAuth");
     print "</div>";
     #pane
     print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"" . __('Preferences') . "\">";
     print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">";
     print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt, quit\">\n\t\tif (evt) evt.preventDefault();\n\t\tif (this.validate()) {\n\t\t\tconsole.log(dojo.objectToQuery(this.getValues()));\n\n\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\tvar msg = transport.responseText;\n\t\t\t\t\tif (quit) {\n\t\t\t\t\t\tgotoMain();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (msg == 'PREFS_NEED_RELOAD') {\n\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnotify_info(msg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t} });\n\t\t}\n\t\t</script>";
     print '<div dojoType="dijit.layout.BorderContainer" gutters="false">';
     print '<div dojoType="dijit.layout.ContentPane" region="center" style="overflow-y : auto">';
     if ($_SESSION["profile"]) {
         print_notice(__("Some preferences are only available in default profile."));
     }
     if ($_SESSION["profile"]) {
         initialize_user_prefs($_SESSION["uid"], $_SESSION["profile"]);
         $profile_qpart = "profile = '" . $_SESSION["profile"] . "'";
     } else {
         initialize_user_prefs($_SESSION["uid"]);
         $profile_qpart = "profile IS NULL";
     }
     /* if ($_SESSION["prefs_show_advanced"])
     			$access_query = "true";
     		else
     			$access_query = "(access_level = 0 AND section_id != 3)"; */
     $access_query = 'true';
     $result = $this->dbh->query("SELECT DISTINCT\n\t\t\tttrss_user_prefs.pref_name,value,type_name,\n\t\t\tttrss_prefs_sections.order_id,\n\t\t\tdef_value,section_id\n\t\t\tFROM ttrss_prefs,ttrss_prefs_types,ttrss_prefs_sections,ttrss_user_prefs\n\t\t\tWHERE type_id = ttrss_prefs_types.id AND\n\t\t\t\t{$profile_qpart} AND\n\t\t\t\tsection_id = ttrss_prefs_sections.id AND\n\t\t\t\tttrss_user_prefs.pref_name = ttrss_prefs.pref_name AND\n\t\t\t\t{$access_query} AND\n\t\t\t\towner_uid = " . $_SESSION["uid"] . "\n\t\t\tORDER BY ttrss_prefs_sections.order_id,pref_name");
     $lnum = 0;
     $active_section = "";
     $listed_boolean_prefs = array();
     while ($line = $this->dbh->fetch_assoc($result)) {
         if (in_array($line["pref_name"], $prefs_blacklist)) {
             continue;
         }
         $type_name = $line["type_name"];
         $pref_name = $line["pref_name"];
         $section_name = $this->getSectionName($line["section_id"]);
         $value = $line["value"];
         $short_desc = $this->getShortDesc($pref_name);
         $help_text = $this->getHelpText($pref_name);
         if (!$short_desc) {
             continue;
         }
         if ($_SESSION["profile"] && in_array($line["pref_name"], $profile_blacklist)) {
             continue;
         }
         if ($active_section != $line["section_id"]) {
             if ($active_section != "") {
                 print "</table>";
             }
             print "<table width=\"100%\" class=\"prefPrefsList\">";
             $active_section = $line["section_id"];
             print "<tr><td colspan=\"3\"><h3>" . $section_name . "</h3></td></tr>";
             $lnum = 0;
         }
         print "<tr>";
         print "<td width=\"40%\" class=\"prefName\" id=\"{$pref_name}\">";
         print "<label for='CB_{$pref_name}'>";
         print $short_desc;
         print "</label>";
         if ($help_text) {
             print "<div class=\"prefHelp\">" . __($help_text) . "</div>";
         }
         print "</td>";
         print "<td class=\"prefValue\">";
         if ($pref_name == "USER_LANGUAGE") {
             print_select_hash($pref_name, $value, get_translations(), "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
         } else {
             if ($pref_name == "USER_TIMEZONE") {
                 $timezones = explode("\n", file_get_contents("lib/timezones.txt"));
                 print_select($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"');
             } else {
                 if ($pref_name == "USER_STYLESHEET") {
                     print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"customizeCSS()\">" . __('Customize') . "</button>";
                 } else {
                     if ($pref_name == "USER_CSS_THEME") {
                         $themes = array_map("basename", glob("themes/*.css"));
                         print_select($pref_name, $value, $themes, 'dojoType="dijit.form.Select"');
                     } else {
                         if ($pref_name == "DEFAULT_UPDATE_INTERVAL") {
                             global $update_intervals_nodefault;
                             print_select_hash($pref_name, $value, $update_intervals_nodefault, 'dojoType="dijit.form.Select"');
                         } else {
                             if ($type_name == "bool") {
                                 array_push($listed_boolean_prefs, $pref_name);
                                 $checked = $value == "true" ? "checked=\"checked\"" : "";
                                 if ($pref_name == "PURGE_UNREAD_ARTICLES" && FORCE_ARTICLE_PURGE != 0) {
                                     $disabled = "disabled=\"1\"";
                                     $checked = "checked=\"checked\"";
                                 } else {
                                     $disabled = "";
                                 }
                                 print "<input type='checkbox' name='{$pref_name}' {$checked} {$disabled}\n\t\t\t\t\tdojoType='dijit.form.CheckBox' id='CB_{$pref_name}' value='1'>";
                             } else {
                                 if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) {
                                     $regexp = $type_name == 'integer' ? 'regexp="^\\d*$"' : '';
                                     if ($pref_name == "PURGE_OLD_DAYS" && FORCE_ARTICLE_PURGE != 0) {
                                         $disabled = "disabled=\"1\"";
                                         $value = FORCE_ARTICLE_PURGE;
                                     } else {
                                         $disabled = "";
                                     }
                                     print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\trequired=\"1\" {$regexp} {$disabled}\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                                 } else {
                                     if ($pref_name == "SSL_CERT_SERIAL") {
                                         print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tid=\"SSL_CERT_SERIAL\" readonly=\"1\"\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                                         $cert_serial = htmlspecialchars(get_ssl_certificate_id());
                                         $has_serial = $cert_serial ? "false" : "true";
                                         print " <button dojoType=\"dijit.form.Button\" disabled=\"{$has_serial}\"\n\t\t\t\t\tonclick=\"insertSSLserial('{$cert_serial}')\">" . __('Register') . "</button>";
                                         print " <button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"insertSSLserial('')\">" . __('Clear') . "</button>";
                                     } else {
                                         if ($pref_name == 'DIGEST_PREFERRED_TIME') {
                                             print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tid=\"{$pref_name}\" regexp=\"[012]?\\d:\\d\\d\" placeHolder=\"12:00\"\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\"><div class=\"insensitive\">" . T_sprintf("Current server time: %s (UTC)", date("H:i")) . "</div>";
                                         } else {
                                             $regexp = $type_name == 'integer' ? 'regexp="^\\d*$"' : '';
                                             print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\t{$regexp}\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         print "</td>";
         print "</tr>";
         $lnum++;
     }
     print "</table>";
     $listed_boolean_prefs = htmlspecialchars(join(",", $listed_boolean_prefs));
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"boolean_prefs\" value=\"{$listed_boolean_prefs}\">";
     PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsPrefsInside");
     print '</div>';
     # inside pane
     print '<div dojoType="dijit.layout.ContentPane" region="bottom">';
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"saveconfig\">";
     print "<div dojoType=\"dijit.form.ComboButton\" type=\"submit\">\n\t\t\t<span>" . __('Save configuration') . "</span>\n\t\t\t<div dojoType=\"dijit.DropDownMenu\">\n\t\t\t\t<div dojoType=\"dijit.MenuItem\"\n\t\t\t\t\tonclick=\"dijit.byId('changeSettingsForm').onSubmit(null, true)\">" . __("Save and exit preferences") . "</div>\n\t\t\t</div>\n\t\t\t</div>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return editProfiles()\">" . __('Manage profiles') . "</button> ";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return validatePrefsReset()\">" . __('Reset to defaults') . "</button>";
     print "&nbsp;";
     /* $checked = $_SESSION["prefs_show_advanced"] ? "checked='1'" : "";
     
     		print "<input onclick='toggleAdvancedPrefs()'
     				id='prefs_show_advanced'
     				dojoType=\"dijit.form.CheckBox\"
     				$checked
     				type=\"checkbox\"></input>
     				<label for='prefs_show_advanced'>" .
     				__("Show additional preferences") . "</label>"; */
     PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsPrefsOutside");
     print "</form>";
     print '</div>';
     # inner pane
     print '</div>';
     # border container
     print "</div>";
     #pane
     print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Plugins') . "\">";
     print "<p>" . __("You will need to reload Tiny Tiny RSS for plugin changes to take effect.") . "</p>";
     print_notice(__("Download more plugins at tt-rss.org <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/forum/viewforum.php?f=22\">forums</a> or <a target=\"_blank\" class=\"visibleLink\" href=\"http://tt-rss.org/wiki/Plugins\">wiki</a>."));
     print "<form dojoType=\"dijit.form.Form\" id=\"changePluginsForm\">";
     print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">\n\t\tevt.preventDefault();\n\t\tif (this.validate()) {\n\t\t\tnotify_progress('Saving data...', true);\n\n\t\t\tnew Ajax.Request('backend.php', {\n\t\t\t\tparameters: dojo.objectToQuery(this.getValues()),\n\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\tnotify('');\n\t\t\t\t\tif (confirm(__('Selected plugins have been enabled. Reload?'))) {\n\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t}\n\t\t\t} });\n\n\t\t}\n\t\t</script>";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setplugins\">";
     print "<table width='100%' class='prefPluginsList'>";
     print "<tr><td colspan='4'><h3>" . __("System plugins") . "</h3></td></tr>";
     print "<tr class=\"title\">\n\t\t\t\t<td width=\"5%\">&nbsp;</td>\n\t\t\t\t<td width='10%'>" . __('Plugin') . "</td>\n\t\t\t\t<td width=''>" . __('Description') . "</td>\n\t\t\t\t<td width='5%'>" . __('Version') . "</td>\n\t\t\t\t<td width='10%'>" . __('Author') . "</td></tr>";
     $system_enabled = array_map("trim", explode(",", PLUGINS));
     $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
     $tmppluginhost = new PluginHost();
     $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"]);
     $tmppluginhost->load_data(true);
     foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
         $about = $plugin->about();
         if ($about[3] && strpos($name, "example") === FALSE) {
             if (in_array($name, $system_enabled)) {
                 $checked = "checked='1'";
             } else {
                 $checked = "";
             }
             print "<tr>";
             print "<td align='center'><input disabled='1'\n\t\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" {$checked}\n\t\t\t\t\t\ttype=\"checkbox\"></td>";
             $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
             print "<td><label><img src='images/{$plugin_icon}' alt=''> {$name}</label></td>";
             print "<td>" . htmlspecialchars($about[1]);
             if (@$about[4]) {
                 print " &mdash; <a target=\"_blank\" class=\"visibleLink\"\n\t\t\t\t\t\thref=\"" . htmlspecialchars($about[4]) . "\">" . __("more info") . "</a>";
             }
             print "</td>";
             print "<td>" . htmlspecialchars(sprintf("%.2f", $about[0])) . "</td>";
             print "<td>" . htmlspecialchars($about[2]) . "</td>";
             if (count($tmppluginhost->get_all($plugin)) > 0) {
                 if (in_array($name, $system_enabled)) {
                     print "<td><a href='#' onclick=\"clearPluginData('{$name}')\"\n\t\t\t\t\t\t\tclass='visibleLink'>" . __("Clear data") . "</a></td>";
                 }
             }
             print "</tr>";
         }
     }
     print "<tr><td colspan='4'><h3>" . __("User plugins") . "</h3></td></tr>";
     print "<tr class=\"title\">\n\t\t\t\t<td width=\"5%\">&nbsp;</td>\n\t\t\t\t<td width='10%'>" . __('Plugin') . "</td>\n\t\t\t\t<td width=''>" . __('Description') . "</td>\n\t\t\t\t<td width='5%'>" . __('Version') . "</td>\n\t\t\t\t<td width='10%'>" . __('Author') . "</td></tr>";
     foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
         $about = $plugin->about();
         if (!$about[3] && strpos($name, "example") === FALSE) {
             if (in_array($name, $system_enabled)) {
                 $checked = "checked='1'";
                 $disabled = "disabled='1'";
                 $rowclass = '';
             } else {
                 if (in_array($name, $user_enabled)) {
                     $checked = "checked='1'";
                     $disabled = "";
                     $rowclass = "Selected";
                 } else {
                     $checked = "";
                     $disabled = "";
                     $rowclass = '';
                 }
             }
             print "<tr class='{$rowclass}'>";
             $plugin_icon = $checked ? "plugin.png" : "plugin_disabled.png";
             print "<td align='center'><input id='FPCHK-{$name}' name='plugins[]' value='{$name}' onclick='toggleSelectRow2(this);'\n\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" {$checked} {$disabled}\n\t\t\t\t\ttype=\"checkbox\"></td>";
             print "<td><label for='FPCHK-{$name}'><img src='images/{$plugin_icon}' alt=''> {$name}</label></td>";
             print "<td><label for='FPCHK-{$name}'>" . htmlspecialchars($about[1]) . "</label>";
             if (@$about[4]) {
                 print " &mdash; <a target=\"_blank\" class=\"visibleLink\"\n\t\t\t\t\t\thref=\"" . htmlspecialchars($about[4]) . "\">" . __("more info") . "</a>";
             }
             print "</td>";
             print "<td>" . htmlspecialchars(sprintf("%.2f", $about[0])) . "</td>";
             print "<td>" . htmlspecialchars($about[2]) . "</td>";
             if (count($tmppluginhost->get_all($plugin)) > 0) {
                 if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
                     print "<td><a href='#' onclick=\"clearPluginData('{$name}')\" class='visibleLink'>" . __("Clear data") . "</a></td>";
                 }
             }
             print "</tr>";
         }
     }
     print "</table>";
     print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Enable selected plugins") . "</button></p>";
     print "</form>";
     print "</div>";
     #pane
     PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "hook_prefs_tab", "prefPrefs");
     print "</div>";
     #container
 }
Esempio n. 19
0
function get_last_date_control($last_date = 0, $id = 'last_date_search', $label = '', $start_date = '', $start_date_name = 'start_date_search', $start_date_label = '', $end_date = '', $end_date_name = 'end_date_search', $end_date_label = '')
{
    if ($label == '') {
        $label = __('Date');
    }
    if ($start_date_label == '') {
        $start_date_label = __('Start date');
    }
    if ($end_date_label == '') {
        $end_date_label = __('End date');
    }
    $script = "javascript:\n\t\tif (\$('#{$id}').val() > 0) {\n\t\t\t\$('#start_end_dates').slideUp();\n\t\t} else {\n\t\t\t\$('#start_end_dates').slideDown();\n\t\t}\n\t;";
    $hidden = "";
    if ($last_date > 0) {
        $hidden = "style='display: none;'";
    }
    $html = print_select(get_last_dates(), $id, $last_date, $script, '', '', true, 0, false, $label);
    $html .= "<br>";
    $html .= "<div id='start_end_dates' {$hidden}>";
    $html .= "<div id='{$start_date_name}' style='display: inline-block;'>" . print_input_text($start_date_name, $start_date, "", 21, 100, true, $start_date_label) . "</div>";
    $html .= "&nbsp;";
    $html .= "<div id='{$end_date_name}' style='display: inline-block;'>" . print_input_text($end_date_name, $end_date, "", 21, 100, true, $end_date_label) . "</div>";
    $html .= "</div>";
    return $html;
}
Esempio n. 20
0
if ($create_incident) {
    $id_inventory = (int) get_parameter('id_inventory');
    $inventories = array();
    if ($id_inventory) {
        if (!give_acl($config['id_user'], $id_inventory, "VR")) {
            audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access inventory #" . $id);
        } else {
            $inventories[$id_inventory] = get_db_value('name', 'tinventory', 'id', $id_inventory);
        }
    }
    $table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'));
    $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
    $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
} else {
    $inventories = get_inventories_in_incident($id);
    $table_advanced->data[3][2] = print_select($inventories, 'incident_inventories', NULL, '', '', '', true, false, false, __('Objects affected'), $blocked_incident);
    if (!$blocked_incident) {
        $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: incident_show_inventory_search(\"\",\"\",\"\",\"\",\"\",\"\");'>" . print_image('images/add.png', true, array('title' => __('Add'))) . "</a>";
        $table_advanced->data[3][2] .= "&nbsp;&nbsp;<a href='javascript: removeInventory();'>" . print_image('images/cross.png', true, array('title' => __('Remove'))) . "</a>";
    }
}
foreach ($inventories as $inventory_id => $inventory_name) {
    $table_advanced->data[3][2] .= print_input_hidden("inventories[]", $inventory_id, true, 'selected-inventories');
}
// END TABLE ADVANCED
$table->colspan['row_advanced'][0] = 4;
$table->data['row_advanced'][0] = print_container('advanced_parameters_incidents_form', __('Advanced parameters'), print_table($table_advanced, true), 'closed', true, false);
$table->colspan[9][0] = 4;
$table->colspan[10][0] = 4;
$disabled_str = $disabled ? 'readonly="1"' : '';
$table->data[9][0] = print_textarea('description', 9, 80, $description, $disabled_str, true, __('Description'), $blocked_incident);
Esempio n. 21
0
	$table->data = array ();
	$table->colspan = array ();
	$table->align = array ();
	$table->colspan[3][0] = 4;
	
	$table->data[0][0] = print_input_text ("name", $name, "", 30, 100, true, __('SLA name'));
	$table->data[0][1] = print_checkbox ('enforced', 1 ,$enforced, true, __('Enforced'));
	
	$table->data[0][2] = print_select_from_sql ('SELECT id, name FROM tsla ORDER BY name',
		'id_sla_base', $id_sla_base, '', __('None'), 0, true, false, false, __('SLA Base'));
		
	$id_sla_type_arr[0] = __("Normal SLA");
	$id_sla_type_arr[1] = __("Third party SLA");
	$id_sla_type_arr[2] = __("Both");
					
	$table->data[0][3] = print_select ($id_sla_type_arr, 'id_sla_type', $id_sla_type,'', '', '0', true, 0, false, __('SLA Type'));

	$table->data[1][0] = print_label(__('Max. response time (in hours)'), '', 'text', true);
	$table->data[1][0] .= "<input type='text' name='min_response' id='text-min_response' value='$min_response' size='5' maxlenght='100' onChange='hours_to_dms(\"min\")'>";
		
	$min_response_time = incidents_hours_to_dayminseg ($min_response);
	$table->data[1][0] .= print_input_text ('min_response_time', $min_response_time, '',
		7, 100, true, '', true);

	$table->data[1][1] = print_label(__('Max. resolution time (in hours)'), '', 'text', true);
	$table->data[1][1] .= "<input type='text' name='max_response' id='text-max_response' value='$max_response' size='5' maxlenght='100' onChange='hours_to_dms(\"max\")'>";
	$max_response_time = incidents_hours_to_dayminseg ($max_response);
	$table->data[1][1] .= print_input_text ('max_response_time', $max_response_time, '',
		7, 100, true, '', true);

	$table->data[1][2] = print_input_text ("max_incidents", $max_incidents, '',
Esempio n. 22
0
			'', true, '', __('Owner'))

		. print_help_tip (__("Type at least two characters to search"). ". " . __("Use '*' for get all values"), true);

	$table->data[0][2] = print_input_text_extended ('creator', $creator, 'text-user2', '', 15, 30, false, '',
			'', true, '', __('Submitter'))

		. print_help_tip (__("Type at least two characters to search"), true);


	$wo_status_values = wo_status_array ();		

	$table->data[1][0] = print_select ($wo_status_values, 'search_status', $search_status, '', __("Any"), -1, true, 0, false, __('WO Status') );

	$priorities = get_priorities();
	$table->data[1][1] = print_select ($priorities, 'search_priority', $search_priority, '', __("Any"), -1, true, 0, false, __('Priority') );
	
	$avatar = get_db_value ('avatar', 'tusuario', 'id_usuario', $config["id_user"]);
	if (!$avatar)
		$avatar = "avatar1";
	
	$table->data[1][2] = print_submit_button (__('Search'), "search_btn", false, 'class="sub search"', true);
	$table->data[1][2] .= ' <a href="index.php?sec=projects&sec2=operation/workorders/wo&owner='
		.$config["id_user"].'"><img src="images/avatars/'.$avatar.'.png" class="avatar_small" title="'.__('My WO\'s').'"></a>';
	$table->data[1][2] .= ' <a href="index.php?sec=projects&sec2=operation/workorders/wo&creator='
		.$config["id_user"].'"><img src="images/user_comment.png" title="'.__('My delegated WO\'s').'"></a>';
	
	$table->rowspan[0][3] = 3;
	
	if ($owner != "") {
		$table->data[0][3] = '<b>'.__('Submitters') .'</b>';
 $incident_sla .= '<tr>';
 $incident_sla .= "<td>";
 $incident_sla .= __('SLA history compliance for: ');
 $incident_sla .= "</td>";
 $incident_sla .= "<td style='vertical-align: bottom;'>";
 $a_day = 24 * 3600;
 $fields = array($a_day => "1 day", 2 * $a_day => "2 days", 7 * $a_day => "1 week", 14 * $a_day => "2 weeks", 30 * $a_day => "1 month");
 $period = get_parameter("period", $a_day);
 $ttl = 1;
 if ($clean_output) {
     $ttl = 2;
 }
 if ($clean_output) {
     $incident_sla .= "<strong>" . $fields[$period] . "</strong>";
 } else {
     $incident_sla .= print_select($fields, "period", $period, 'reload_sla_slice_graph(\'' . $id . '\');', '', '', true, 0, false, false, false, 'width: 75px');
 }
 $incident_sla .= "</td>";
 $incident_sla .= "<td colspan=2 style='text-align: center; width: 50%;'>";
 $incident_sla .= __('SLA total compliance (%)') . ': ';
 $incident_sla .= format_numeric(get_sla_compliance_single_id($id));
 $incident_sla .= "</td>";
 $incident_sla .= "</tr>";
 $incident_sla .= "<tr>";
 $incident_sla .= "<td id=slaSlicebarField colspan=2 style='text-align: center; padding: 1px 2px 1px 5px;'>";
 $incident_sla .= graph_sla_slicebar($id, $period, 155, 15, $ttl);
 $incident_sla .= "</td>";
 $incident_sla .= "<td colspan=2 style='text-align: center;' >";
 $incident_sla .= "<div class='pie_frame'>";
 $incident_sla .= graph_incident_sla_compliance($id, 155, 80, $ttl);
 $incident_sla .= "</div>";
Esempio n. 24
0
function show_task_row($table, $id_project, $task, $level, $users)
{
    global $config;
    $id_task = $task['id'];
    // Second column (Task  name)
    $prefix = '';
    for ($i = 0; $i < $level; $i++) {
        $prefix .= '<img src="images/small_arrow_right_green.gif" style="position: relative; top: 5px;"> ';
    }
    echo "<td>";
    echo $prefix . print_input_text("name_" . $id_task, $task['name'], "", 40, 0, true);
    echo "</td>";
    // Thrid column (Owner)Completion
    echo "<td style='text-align:center;'>";
    $owners = get_db_value('COUNT(DISTINCT(id_user))', 'trole_people_task', 'id_task', $task['id']);
    if ($owners > 1) {
        echo combo_users_task($task['id'], 1, true);
        echo ' ';
        echo $owners;
    } else {
        $owner_id = get_db_value('id_user', 'trole_people_task', 'id_task', $task['id']);
        print_select($users, "owner_" . $id_task, $owner_id, '', '', 0, false, 0, true, false, false, 'width: 90px');
    }
    echo "</td>";
    // Fourth column (Start date)
    echo "<td style='text-align:center;'>";
    print_input_text_extended("start_" . $id_task, $task['start'], "start_" . $id_task, '', 7, 15, 0, '', 'style="font-size:9px;"');
    echo "</td>";
    // Fifth column (End date)
    echo "<td style='text-align:center;'>";
    print_input_text_extended("end_" . $id_task, $task['end'], "end_" . $id_task, '', 7, 15, 0, '', 'style="font-size:9px;"');
    echo "</td>";
    //Worked time based on workunits
    $worked_time = get_task_workunit_hours($id_task);
    echo "<td style='text-align:left;'>" . $worked_time . "</td>";
    // Sixth column (Delay)
    //If task was completed delay is 0
    if ($task['completion']) {
        $delay = 0;
    } else {
        //If was not completed check for time delay from end to now
        $end = strtotime($task['end']);
        $now = time();
        $a_day_in_sec = 3600 * 24;
        if ($now > $end) {
            $diff = $now - $end;
            $delay = $diff / $a_day_in_sec;
            $delay = round($delay, 1);
        } else {
            $delay = 0;
        }
    }
    echo "<td style='text-align:left;'>" . $delay . "</td>";
    // Seventh column (Delay)
    //Task status
    /*
     * 0%-40% = Pending
     * 41%-90% = In process
     * 91%-99% = Completed
     * 100% = Verified
     * 
     */
    //Check selected status
    $selected = 0;
    if ($task['completion'] < 40) {
        $selected = 0;
    } else {
        if ($task['completion'] < 90) {
            $selected = 45;
        } else {
            if ($task['completion'] < 100) {
                $selected = 95;
            } else {
                if ($task['completion'] == 100) {
                    $selected = 100;
                }
            }
        }
    }
    $fields = array();
    $fields[0] = __("Pending");
    $fields[45] = __("In process");
    $fields[95] = __("Completed");
    $fields[100] = __("Verified");
    echo "<td>";
    print_select($fields, "status_" . $id_task, $selected, '', '', 0, false, 0, true, false, false, "width: 100px;");
    echo "</td>";
    // Last Edit and del column. (Del) Only for PM flag
    //Create new task only if PM && TM flags or PW and project manager.
    echo "<td style='text-align:center;'>";
    echo '<a href="index.php?sec=projects&sec2=operation/projects/task_detail&id_project=' . $id_project . '&id_task=' . $task['id'] . '&operation=view">';
    echo '<img style="margin-right: 6px;" src="images/wrench.png">';
    echo '</a>';
    echo '<a href="index.php?sec=projects&sec2=operation/projects/task_planning&id_project=' . $id_project . '&delete=' . $task["id"] . '"
		onClick="if (!confirm(\'' . __('Are you sure?') . '\')) return false;"><img src="images/cross.png" /></a>';
    echo "</td>";
}
Esempio n. 25
0
$table->style[0] = 'font-weight: bold; text-align: right;';
$table->style[1] = 'text-align: left;';
$table->style[2] = 'font-weight: bold; text-align: right;';
$table->style[3] = 'text-align: left;';
$table->style[4] = 'font-weight: bold; text-align: right;';
$table->style[5] = 'text-align: left;';
$table->style[6] = 'text-align: right;';
$table->data = array();
$row = array();
// Name
$row[0] = __('Name') . '&nbsp;';
$row[1] = print_input_text('name', $name, '', 25, 100, true);
// Colour
$row[2] = __('Colour') . '&nbsp;';
$tag_colours = get_available_tag_colours();
$row[3] = print_select($tag_colours, 'colour', $colour, '', '', '', true, false, false);
// Preview
$row[4] = __('Preview') . '&nbsp;';
$row[5] = '<span id="tag-preview"></span>';
$row[6] = print_input_hidden('id', $id, true);
if (empty($id)) {
    $row[6] .= print_input_hidden('action', 'create', true);
} else {
    $row[6] .= print_input_hidden('action', 'update', true);
}
$row[6] .= print_submit_button(__('Add'), 'create_btn', false, 'class="sub create"', true);
$row[6] .= print_submit_button(__('Update'), 'update_btn', false, 'class="sub upd"', true);
$row[6] .= '&nbsp;';
$row[6] .= print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"', true);
$table->data[] = $row;
echo '<form id="tags-form" method="POST">';
Esempio n. 26
0
 }
 /*if ($id == -1) {
 		echo "<h3>".__('Create a new object')."</h3>";
 	} else {
 		echo "<h3>".__('Update existing object')."</h3>";
 	}*/
 $table->width = '99%';
 $table->class = 'search-table-button';
 $table->colspan = array();
 $table->colspan[3][0] = 2;
 $table->data = array();
 $table->data[0][0] = print_input_text('name', $name, '', 45, 100, true, __('Name'));
 $table->data[0][1] = '<label>' . __('Show in tree view') . print_help_tip(__('If this value is checked this object type will appear as a root inside inventory\'s tree view.'), true) . '</label>';
 $table->data[0][1] .= print_checkbox('show_in_list', 1, $show_in_list, __('Show in tree view'));
 $files = list_files('images/objects/', "png", 1, 0);
 $table->data[1][0] = print_select($files, 'icon', $icon, '', __('None'), "", true, false, false, __('Icon'));
 $table->data[1][0] .= objects_get_icon($id, true);
 $table->data[1][1] = print_input_text('min_stock', $min_stock, '', 45, 100, true, __('Min. stock'));
 $table->data[2][0] = print_textarea('description', 10, 50, $description, '', true, __('Description'));
 $table->colspan[2][0] = 2;
 if ($id == -1) {
     $button = print_submit_button(__('Create'), 'crt_btn', false, 'class="sub next"', true);
     $button .= print_input_hidden('insert_object', 1, true);
 } else {
     $button = print_submit_button(__('Update'), 'upd_btn', false, 'class="sub upd"', true);
     $button .= print_input_hidden('id', $id, true);
     $button .= print_input_hidden('update_object', 1, true);
 }
 $table->data[3][0] = $button;
 echo '<form id="form-manage_objects" method="post">';
 print_table($table);
Esempio n. 27
0
		}
		$params_associated['input_id'] = 'text-associated_user';
		$params_associated['input_name'] = 'associated_user';
		$params_associated['input_value'] = $params['associated_user'];
		$params_associated['title'] = __('Associated user');
		$params_associated['return'] = true;
	
		$table_search->data[1][2] = user_print_autocomplete_input($params_associated);
		
		//status
		$all_inventory_status = inventories_get_inventory_status ();
		array_unshift($all_inventory_status, __("All"));
		if(!isset($params['inventory_status'])){
			$params['inventory_status'] = 'All';
		}
		$table_search->data[2][0] = print_select ($all_inventory_status, 'inventory_status', $params['inventory_status'], '', '', '', true, false, false, __('Status'));

		//Parent name
		if(!isset($params['parent_name'])){
			$params['parent_name'] = '';
		}
		$table_search->data[2][1] =  print_input_text_extended ("parent_name", $params['parent_name'], "text-parent_name", '', 20, 0, false, "", "class='inventory_obj_search' style='width:165px !important;'", true, false,  __('Parent object'), false, true);
		$table_search->data[2][1] .= "&nbsp;&nbsp;" . print_image("images/add.png", true, array("onclick" => "show_inventory_search('','','','','','','','','','', '', '')", "style" => "cursor: pointer"));	
		$table_search->data[2][1] .= "&nbsp;&nbsp;" . print_image("images/cross.png", true, array("onclick" => "cleanParentInventory()", "style" => "cursor: pointer"));	
		//$table_search->data[2][1] .= print_input_hidden ('id_parent', $id_parent, true);

		//check
		$table_search->data[2][2] = print_checkbox_extended ('last_update', 1, $params['last_update'],
		false, '', '', true, __('Last updated'));

		//input pagination size
        }
    }
    $result_insert = process_sql_insert($external_table, $values);
    if ($result_insert) {
        echo "<h3 class='suc'>" . __('Inserted row') . "</h3>";
    } else {
        echo "<h3 class='error'>" . __('There was a problem inserting row') . "</h3>";
    }
}
echo "<h1>" . __('External table management') . "</h1>";
$table->width = '98%';
$table->class = 'search-table';
$table->id = "external-editor";
$table->data = array();
$ext_tables = inventories_get_external_tables($id_object_type);
$table->data[0][0] = print_select($ext_tables, 'external_table', $external_table, '', __('None'), "", true, false, false, __('Select external table'));
$button = '<div style=" text-align: right;">';
$button .= print_submit_button(__('Add row'), 'search', false, 'class="sub search"', true);
$button .= '</div>';
$table->data[1][1] = $button;
echo '<form id="add_row" method="post" action="index.php?sec=inventory&sec2=operation/inventories/manage_external_tables&id=' . $id_object_type . '&external_table=' . $external_table . '&add_row=1">';
print_table($table);
echo '</form>';
if ($external_table) {
    $table_list->width = '99%';
    $table_list->class = 'listing';
    $table_list->data = array();
    $table_list->head = array();
    $table_list->size = array();
    $table_fields = get_db_all_rows_sql("DESC " . $external_table);
    if ($table_fields == false) {
Esempio n. 29
0
function combo_roles_people_task($id_task, $id_user, $label = '', $return = false)
{
    $roles = get_db_all_rows_filter('trole_people_task', array('id_task' => $id_task, 'id_user' => $id_user), 'id_role');
    $user_roles = array();
    $output = '';
    if ($roles !== false) {
        foreach ($roles as $key => $rol) {
            $rol_name = get_db_value('name', 'trole', 'id', $rol['id_role']);
            $user_roles[$rol['id_role']] = $rol_name;
        }
    }
    return print_select($user_roles, 'id_profile', '', '', 0, 0, true, 0, false, $label);
}
Esempio n. 30
-1
$ticket_options[1] = __('Enabled');
echo "<table width='99%' class='search-table-button\n'>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_input_text("iwu_defaultime", $config["iwu_defaultime"], '', 5, 5, true, __('Ticket WU Default time')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "email_on_incident_update", $config["email_on_incident_update"], '', '', '', true, 0, true, __('Send email on every ticket update')) . print_help_tip(__("Enabling this, you will get emails on file attachs also. If left disabled, you only get notifications only in major events on tickets"), true) . "</td>";
echo "<td style='vertical-align: top;'>" . print_input_text("limit_size", $config["limit_size"], '', 5, 5, true, __('Max. tickets by search')) . integria_help("limit_size", true) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "show_owner_incident", $config["show_owner_incident"], '', '', '', true, 0, true, __('Show ticket owner')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($incident_reporter_options, "show_creator_incident", $config["show_creator_incident"], '', '', '', true, 0, true, __('Show ticket creator')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_input_text("auto_incident_close", $config["auto_incident_close"], '', 10, 10, true, __('Auto ticket close')) . integria_help("auto_incident_close", true) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("iw_creator_enabled", 1, $config["iw_creator_enabled"], true, __('Enable IW to change creator')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($newsletter_options, "incident_creation_wu", $config["incident_creation_wu"], '', '', '', true, 0, true, __('Editor adds a WU on ticket creation')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_select($ticket_options, "enabled_ticket_editor", $config["enabled_ticket_editor"], '', '', '', true, 0, true, __('Enable quick edit mode')) . "</td>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("incident_type_change", 1, $config["incident_type_change"], true, __('Allow to change the ticket type')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("change_incident_datetime", 1, $config["change_incident_datetime"], true, __('Allow to set the date/time in creation ')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("email_ticket_on_creation_and_closing", 1, $config["email_ticket_on_creation_and_closing"], true, __('Send email only on creation and closing ')) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("ticket_owner_is_creator", 1, $config["ticket_owner_is_creator"], true, __('Ignore user defined by the group for owner')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("show_user_name", 1, $config["show_user_name"], true, __('Show user name instead of id in the ticket search')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("required_ticket_type", 1, $config["required_ticket_type"], true, __('Required ticket type')) . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='vertical-align: top;'>" . print_checkbox("show_creator_blank", 1, $config["show_creator_blank"], true, __('Ignore user creator by default')) . "</td>";
echo "<td style='vertical-align: top;'>" . print_checkbox("change_creator_owner", 1, $config["change_creator_owner"], true, __('Allow to change user creator and user owner')) . "</td>";
echo "</tr>";
echo "<tr>";