Permalink
Browse files

Object browser shows object location

* Requires i-doit version 1.0.1 or higher
  • Loading branch information...
1 parent 4e8fdec commit 9932e19d0973908c1ce670995d53c61e6ea715a2 @bheisig committed Jan 15, 2013
View
@@ -1,10 +1,13 @@
Revision history for RT-Extension-ReferenceIDoitObjects
0.92 - unreleased -
+ * Object browser shows object location
* Implemented browser in "Jumbo update"
* Hide custom fields when modifying referenced objects
+ * Fixed broken link in page menu for /Ticket/ModifyIDoitObjects.html after update
* Removed buggy unused code
* Updated to Module::Install 1.06 (thanks to Tatsuhiko Miyagawa)
+ * Requires i-doit version 1.0.1 or higher
0.91 Fri, 07 Sep 2012 14:02:49 +0200
* Removed deprecated Switch.pm (important for newer Perl versions; thanks to Matthias)
View
@@ -21,7 +21,7 @@ DESCRIPTION
INSTALLATION
This extension requires RT 4.x or higher and a running installation of
- i-doit 0.9.9-9 or higher.
+ i-doit 1.0.1 or higher.
To install this extension, run the following commands:
View
@@ -14,12 +14,12 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 beb68d41f0ddbdf0def3919a5c34a13247e5a2a7 Changes
+SHA1 5687284dab0c853b6ee8a85ca9724cbbcdce03c0 Changes
SHA1 50334a73c918d80ad88264dba24efd7185fe83ec MANIFEST
SHA1 30732a5045c730baf75d689f6ffbce7669da7da6 MANIFEST.SKIP
SHA1 25bc9212b421d131d61d7f8e4bf133ae9e1eb307 META.yml
SHA1 4894a510e5bc7202f9471782a495dcdf94111054 Makefile.PL
-SHA1 0dc967f7162dacff818cf00a9766aa5f686d5055 README
+SHA1 6f968cd2368ac8b350b53db7e003b9dd165fc241 README
SHA1 676583b776bf7a2500ff9067ea3474fb005da96c TODO
SHA1 49701a1582499c03b668cb0607e6e2880fe71909 etc/i-doit_api_proxy.php
SHA1 e1e604e5d2bbb842d030132c60f56692f814a468 etc/initialdata
@@ -29,14 +29,14 @@ SHA1 4c89e02668a080563ab94d5bd9c76c13d853524c html/Callbacks/ReferenceIdoitObjec
SHA1 480ad3b74dd93bc420497555fd0d7079dbb55a04 html/Callbacks/ReferenceIdoitObjects/Ticket/Create.html/FormStart
SHA1 c71887d1107cdcfc9c83487d0ec0e70f32993c81 html/Callbacks/ReferenceIdoitObjects/Ticket/Elements/ShowSummary/LeftColumn
SHA1 db1dbde793e20055f07087728016ab369af4f74d html/Callbacks/ReferenceIdoitObjects/Ticket/ModifyAll.html/AfterBasics
-SHA1 90ffec1d5d1a2877ae0e991cbbab7779565d7f5b html/Elements/SelectIDoitObjects
-SHA1 6049b1e731d7ec11f244edc36c4b79bff6c07b75 html/Elements/ShowIDoitObjects
+SHA1 6d6e156fbd1911d29d33b5c3c0d9ca37b187a4a7 html/Elements/SelectIDoitObjects
+SHA1 383d20604a1111d3e244a854ee53e9731c755755 html/Elements/ShowIDoitObjects
SHA1 faf56d314fefe40211b3db8fb305dedec3861bab html/NoAuth/css/demo_table.css
SHA1 63c5b31231d04e9ec86200d05b4525c76535d4a4 html/NoAuth/css/demo_table_jui.css
SHA1 d1ca3bb3874b847f323100f2ad790ecbb90ec646 html/NoAuth/css/i-doit_object_browser.css
SHA1 21117f74c1256a9045626a08027068ea0e930842 html/NoAuth/images/i-doit.png
SHA1 658230fb99283dae82b6bb3a70f1007ed8ed6f23 html/NoAuth/js/i-doit_ie_fix.js
-SHA1 744360fe7ad612bddab3537c9b6d9688f5d4af41 html/NoAuth/js/i-doit_object_browser.js
+SHA1 46c736849f385ebfa92dca8951622caa6c63d621 html/NoAuth/js/i-doit_object_browser.js
SHA1 6f6c12b01532eeebefde965a5fa832a9d441122c html/NoAuth/js/jquery.dataTables.min.js
SHA1 2e9f9445ac8e4abbae95fe092f9212810484872c html/Ticket/Elements/EditIDoitObjects
SHA1 370b4e858d38606a6298c3aa26a92f03123959a3 html/Ticket/Elements/ShowIDoitObjects
@@ -78,7 +78,7 @@ SHA1 8057872efd55c155d12f009cb190a81f7f775703 inc/Module/Install/Share.pm
SHA1 3ef36786817df816cca65bcae5e987591512aeeb inc/Module/Install/Win32.pm
SHA1 1349967ec3cd8c41a7717750ae23ede9824a2f39 inc/Module/Install/With.pm
SHA1 b7fc200ced09546b337e460a29379e4bd6927ca2 inc/Module/Install/WriteAll.pm
-SHA1 957de860791a333fb9a77f0f7667779c43bce9b3 lib/RT/Extension/ReferenceIDoitObjects.pm
+SHA1 168a04e5e19f118353b582e11f5f225f6011cab2 lib/RT/Extension/ReferenceIDoitObjects.pm
SHA1 4b73bb903ecf361c17a7f6be9998b9f8095f0693 po/de.po
SHA1 3987a51914e4ffa806ad31ce27fedd752468e3bf t/00-load.t
SHA1 f7be47a0678c02f3c2a037ee4095907442a245c7 t/boilerplate.t
@@ -87,7 +87,7 @@ SHA1 640935336dc1123c0069bcf5432bcaedc2cf22d3 t/pod.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-iEYEARECAAYFAlD0CwUACgkQWFkxZRfLwXLuMgCglhtX6rJEK0LGjqKb5MkfCrNU
-xbsAnRBEuiffg2rodUzKYwrFjtLlqtXw
-=9BpY
+iEYEARECAAYFAlD1cvkACgkQWFkxZRfLwXKvsgCgiaon7uNF5voZ1abf8ZJ0StGz
+qncAoJxy1kHOzAypsVr5vn8XuZ13X5ew
+=PKoY
-----END PGP SIGNATURE-----
@@ -30,7 +30,8 @@
<tr>
<th width="5%" style="text-align: left;"><input type="checkbox" id="check_all_objects" name="check_all_objects"></th>
<th width="15%"><% loc('ID') %></th>
- <th width="70%"><% loc('Name') %></th>
+ <th width="50%"><% loc('Name') %></th>
+ <th width="25%"><% loc('Location') %></th>
<th width="10%"><% loc('Link') %></th>
</tr>
</thead>
@@ -47,9 +48,10 @@
<thead>
<tr>
<th width="10%" style="text-align: left;"><a href="javascript:window.remove_all_objects();"><% loc('Delete') %></a></th>
- <th width="10%"><% loc('ID') %></th>
- <th width="40%"><% loc('Name') %></th>
+ <th width="5%"><% loc('ID') %></th>
+ <th width="30%"><% loc('Name') %></th>
<th width="30%"><% loc('Type') %></th>
+ <th width="15%"><% loc('Location') %></th>
<th width="10%"><% loc('Link') %></th>
</tr>
</thead>
@@ -9,57 +9,58 @@
<div id="i-doit-objectbrowser" style="position: relative; min-width: 400px;">
<div id="data-store" style="display:none;"></div>
- <div id="i-doit-browser-notice" class="ui-corner-all" style="display: none;"></div>
+ <div id="i-doit-browser-notice" class="ui-corner-all" style="display: none;"></div>
<div id="i-doit-content" style="display:none;">
- <table class="object-table" style="width:100%;">
- <thead>
- <tr>
- <th width="10%"><% loc('ID') %></th>
- <th width="40%"><% loc('Name') %></th>
- <th width="40%"><% loc('Type') %></th>
- <th width="10%"><% loc('Link') %></th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
+ <table class="object-table" style="width:100%;">
+ <thead>
+ <tr>
+ <th width="5%"><% loc('ID') %></th>
+ <th width="35%"><% loc('Name') %></th>
+ <th width="35%"><% loc('Type') %></th>
+ <th width="15%"><% loc('Location') %></th>
+ <th width="10%"><% loc('Link') %></th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
</div>
</div>
<script type="text/javascript">
- // Global variables (without "var").
+ // Global variables (without "var").
idoit_url = '<% $IDoitURL %>';
- api_url = '<% $IDoitAPI %>';
- api_lang = '<% $Language %>';
- api_user = '<% $IDoitUser %>';
- api_password = '<% $IDoitPassword %>';
- api_mandator = '<% $IDoitMandator %>';
+ api_url = '<% $IDoitAPI %>';
+ api_lang = '<% $Language %>';
+ api_user = '<% $IDoitUser %>';
+ api_password = '<% $IDoitPassword %>';
+ api_mandator = '<% $IDoitMandator %>';
- show_custom_fields = <% $IDoitShowCustomFields %>;
+ show_custom_fields = <% $IDoitShowCustomFields %>;
- browser_preselection_field = 'tr#<% $IDoitObjectsField %>';
- browser_mandator_field = 'tr#<% $IDoitMandatorField %>';
+ browser_preselection_field = 'tr#<% $IDoitObjectsField %>';
+ browser_mandator_field = 'tr#<% $IDoitMandatorField %>';
- preselection = [<% $IDoitObjects %>];
+ preselection = [<% $IDoitObjects %>];
</script>
<script type="text/javascript" src="<% RT->Config->Get('WebPath') %>/NoAuth/js/i-doit_object_browser.js"></script>
<script type="text/javascript">
- (function($) {
- $(document).ready(function() {
- browser_preselection_field = $(browser_preselection_field);
- browser_mandator_field = $(browser_mandator_field);
-
- list = $('#i-doit-content table.object-table').dataTable({
- "bJQueryUI": true,
- "bAutoWidth": false,
- "bPaginate": false,
- "bLengthChange": false,
- "bSort": false,
- "oLanguage": datatable_lang
- });
+ (function($) {
+ $(document).ready(function() {
+ browser_preselection_field = $(browser_preselection_field);
+ browser_mandator_field = $(browser_mandator_field);
+
+ list = $('#i-doit-content table.object-table').dataTable({
+ "bJQueryUI": true,
+ "bAutoWidth": false,
+ "bPaginate": false,
+ "bLengthChange": false,
+ "bSort": false,
+ "oLanguage": datatable_lang
+ });
if (isNaN(parseInt(api_mandator)) || api_mandator <= 0) {
window.error_notice('<% loc("Please select an i-doit mandator.") %>');
@@ -77,7 +78,9 @@
"language":api_lang,
"mandator":api_mandator},
"filter":{
- "ids":preselection}},
+ "ids":preselection,
+ "location": true
+ }},
"id":"1",
"jsonrpc":"2.0"};
@@ -90,7 +93,7 @@
$.each(response.result, function(i, e) {
var link = '<a href="' + idoit_url + '?objID=' + e.id + '" title="<% loc('Go to i-doit') %>" target="_blank">&raquo; i-doit</a>';
- entities.push([e.id, e.title, e.type_title, link]);
+ entities.push([e.id, e.title, e.type_title, e.location, link]);
});
list.fnAddData(entities);
@@ -100,13 +103,13 @@
});
}
- // Hide custom fields:
- if (show_custom_fields == 0) {
- browser_preselection_field.hide();
- browser_mandator_field.hide();
- }
- });
- })(jQuery);
+ // Hide custom fields:
+ if (show_custom_fields == 0) {
+ browser_preselection_field.hide();
+ browser_mandator_field.hide();
+ }
+ });
+ })(jQuery);
</script>
<%INIT>
@@ -112,7 +112,7 @@
* @author Leonard Fischer <lfischer@synetics.de>
*/
$('#i-doit-objectbrowser select.object-type').change(function() {
- window.display_loading();
+ window.display_loading();
var data = {
"method":"cmdb.objects",
"params":{
@@ -122,14 +122,16 @@
"language":api_lang,
"mandator":api_mandator},
"filter":{
- "type":parseInt(this.value)},
+ "type":parseInt(this.value),
+ "location": true
+ },
"order_by":"title"},
"id":"1",
"jsonrpc":"2.0"};
idoit_ajax(data, function(response) {
if (response.error == null) {
- window.remove_loading();
+ window.remove_loading();
// Clear the table from our old entries.
current_objectview_data = response.result;
window.render_objectview();
@@ -148,9 +150,10 @@
$('input[name="i-doit-objectbrowser-obj[]"]').live('change', function() {
if ($(this).attr('checked')) {
var name = $(this).closest('tr').find('td:eq(2)').text(),
- type = $('#i-doit-objectbrowser select.object-type option:selected').text();
+ type = $('#i-doit-objectbrowser select.object-type option:selected').text(),
+ location = $('#i-doit-objectbrowser select.location option:selected').text();
- window.add_object($(this).val(), name, type);
+ window.add_object($(this).val(), name, type, location);
} else {
window.remove_object($(this).val());
}
@@ -173,7 +176,7 @@
var name = $(this).next().text(),
type = $(this).next().next().text();
- window.add_object($(this).val(), name, type);
+ window.add_object($(this).val(), name, type, '');
} else {
window.remove_object($(this).val());
}
@@ -283,7 +286,10 @@
"language":api_lang,
"mandator":api_mandator},
"filter":{
- "ids":preselection}},
+ "ids":preselection,
+ "location": true
+ }
+ },
"id":"1",
"jsonrpc":"2.0"};
@@ -293,7 +299,7 @@
window.remove_all_objects();
$.each(response.result, function(i, e) {
- window.add_object(e.id, e.title, e.type_title);
+ window.add_object(e.id, e.title, e.type_title, e.location);
});
} else {
window.error_notice('<% loc("Error while loading pre-selecting objects") %>');
@@ -333,7 +339,7 @@
// We iterate through the first level (email-addresses).
$.each(current_treeview_data, function(i, e) {
- workplaces.append('<a href="' + idoit_url + '?objID=' + i + '" target="_blank" style="font-weight:bold;">' + e.data.title + ' &lt;' + e.data.email + '&gt;</a><br />');
+ workplaces.append('<a href="' + idoit_url + '?objID=' + i + '" target="_blank" title="<% loc("Go to i-doit") %>" style="font-weight:bold;">' + e.data.title + ' &lt;' + e.data.email + '&gt;</a><br />');
if (e.children != false) {
window.render_treeview_recursion(e.children, 1);
@@ -359,7 +365,7 @@
}
var output = '<div><input type="checkbox" value="' + i + '" name="i-doit-treebrowser-obj[]" ' + ((selected) ? 'checked="checked"' : '') + ' style="margin-left:' + (level * 20) + 'px;"> ' +
- '<span class="obj-name"><a href="' + idoit_url + '?objID=' + i + '" target="_blank">' + e.data.title + '</a></span>' +
+ '<span class="obj-name"><a href="' + idoit_url + '?objID=' + i + '" target="_blank" title="<% loc("Go to i-doit") %>">' + e.data.title + '</a></span>' +
' (<span class="obj-type">' + e.data.type_title + '</span>) &raquo; ' +
'<span class="relation-button"><% loc("show installed software") %></span></div>';
@@ -450,7 +456,7 @@
check = '<input type="checkbox" value="' + e.id + '" name="i-doit-objectbrowser-obj[]" ' + ((selected) ? 'checked="checked"' : '') + ' />';
link = '<a href="' + idoit_url + '?objID=' + e.id + '" target="_blank" title="<% loc('Go to i-doit') %>">&raquo; i-doit</a>';
- entities.push([check, e.id, e.title, link]);
+ entities.push([check, e.id, e.title, e.location, link]);
});
objectview_table.fnAddData(entities);
@@ -496,8 +502,8 @@
* @param integer type The object-type.
* @author Leonard Fischer <lfischer@synetics.de>
*/
- window.add_object = function(id, name, type) {
- $('#data-store').data(id, {"name": name, "type": type});
+ window.add_object = function(id, name, type, location) {
+ $('#data-store').data(id, {"name": name, "type": type, "location": location});
window.render_selected_items();
@@ -521,7 +527,7 @@
$.each(data, function(i, e) {
var link = '<a href="' + idoit_url + '?objID=' + i + '" title="<% loc('Go to i-doit') %>">&raquo; i-doit</a>';
- entities.push(['<span class="i-doit-objectbrowser-remover" onclick="window.remove_object(' + i + ')"><% loc("Delete") %></span>', i, e.name, e.type, link]);
+ entities.push(['<span class="i-doit-objectbrowser-remover" onclick="window.remove_object(' + i + ')"><% loc("Delete") %></span>', i, e.name, e.type, e.location, link]);
data_array.push(i);
});
@@ -41,7 +41,7 @@ only implemented in the commercial branch>.
=head1 INSTALLATION
This extension requires RT 4.x or higher and a running installation of i-doit
-0.9.9-9 or higher.
+1.0.1 or higher.
To install this extension, run the following commands:

0 comments on commit 9932e19

Please sign in to comment.