[racktables-users] Re: Change columns viewed on Objects page

  • From: Michał Sochoń <kaszpir@xxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Thu, 6 Mar 2014 09:54:09 +0100

Here is my function renderDepot() - I've altered one line and added two
extra lines.

http://pastebin.com/Gd4V24qf

line number from pastebin:
22 - added extra columnt header named S/N
37 - added line to get all attibutes from the object, it is returned as
array
38 - print table cell with the value from given array, in here ['1'] states
it is a array key '1' , which returns array, and we can get a 'value' key
from it

If you defined custom attributes then you must change key '1' to the number
of the attribute, in your example it should be 10004.
The @ sign means to silently return null on error, so you will not get any
notices or error messages if the given object does not exist.

Hope you gonna get that now :)


On Thu, Mar 6, 2014 at 1:05 AM, Ragsdale, Justin <ragsdalej@xxxxxxx> wrote:

>  Ok so if I understand correctly, where should I be adding the $values =
> should this be before  or after the foreach ($objects as $obj) where it
> start to print out the data.
>
>
>
> And the in my case I would replace the 1 with a 10004 since that is my
> attr code for the function entry. How/where would this be placed in the
> with regards to the cell where ${obj['label']}</td>"; is currently
>
>
>
> I tried to modify the file but it started to print out @array[value] or
> something like that.
>
>
>
> I don’t usually do PHP coding so..
>
>
>
>
>
> Justin
>
>
>
> *From:* racktables-users-bounce@xxxxxxxxxxxxx [mailto:
> racktables-users-bounce@xxxxxxxxxxxxx] *On Behalf Of *Michal Sochon
> *Sent:* Monday, March 3, 2014 2:09 AM
> *To:* racktables-users@xxxxxxxxxxxxx
> *Subject:* [racktables-users] Re: Change columns viewed on Objects page
>
>
>
> I did that recently - added serial number column to the Object list view.
> Check out wwwroot/inc/interface.php in function renderDepot()
>
> I've added
>
> $values = @getAttrValues($obj['id']);
>
> and for example serial number for already well defined objects like server
> is as @$values[1]['value']; // OEM S/N 1
>
>
>
> On Mon, Mar 3, 2014 at 12:03 AM, Ragsdale, Justin <ragsdalej@xxxxxxx>
> wrote:
>
>  I would like to change two of the cols on the Objects/depot page and not
> sure how to do this. I see that this page is created with the interface.php
> page but not sure where or what in the code to change.
>
>
>
> One of the new cols that i want added is an attribute, Function, that we
> added with an id of 10004
>
> The other would be object type.
>
>
>
> Any help would be great.
>
>
>
> Justin Ragsdale * Director of Network Operations * Division of Technology
> Services * Wentworth Institute of Technology * 550 Huntington Ave, Boston
> MA 02115 * *Lync/Voice* 617-989-4584 * Fax 617-989-4502 * *E-Mail/IM*
> ragsdalej@xxxxxxx * www.wit.edu/dts * blogs.wit.edu/dts * Follow us on
> Twitter @ DTSatWIT <http://twitter.com/DTSatWIT>
>
> P
>
> *Think before you print *CONFIDENTIALITY: This e-mail (including any
> attachments) may contain confidential, proprietary and privileged
> information, and unauthorized disclosure or use is prohibited. If you
> received this e-mail in error, please notify the sender and delete this
> e-mail from your system.
>
>
>
>
> --
>
> Michal Sochoń
> alias _KaszpiR_ kaszpir@xxxxxxxxx
> IRC: _KaszpiR_ @ freenode.net
>



-- 
Michal Sochoń
alias _KaszpiR_ kaszpir@xxxxxxxxx
IRC: _KaszpiR_ @ freenode.net

Other related posts: