Friday, November 13, 2009

Spiceworks 4.5 Beta III is out; my adventure

I use Spiceworks to keep track of everything connected to our network and also as a help desk solution. To tell you the truth, I use it as a help desk solution much more than any other of the millions of tools built into Spiceworks.

So when I heard that version 4.5 was going to be released, I immediately signed up for the beta so I could test out all the new and cool features.

I installed the Beta I and couldn't get the service started. I ended up uninstalling it and didn't have time to troubleshoot the problems before Beta II came out. So I installed Beta II and ended up with a "503 service unavailable" error. I reinstalled once and came up with the same error. Since the Spiceworks team is so fast at coming up with new versions, they had already come out with Beta III by the time I had gotten a chance to look into the problems I was having. I installed that version the day it came out. I tried to log in and received another 503 error. It was really pretty frustrating.

I came in the next day and logged in to my computer only to find it was running really really slow. I opened up the task manager and found that spiceworks-finder.exe was running and hogging all my resources. I thought to myself "hmm isn't that executable only running if Spiceworks is running?" So I went to the login screen, and voila, it was running. Needless to say I was excited.

Looking back, I realize that I probably wasn't having any problems with the Spiceworks beta, I just have too many things installed on my machine and too many services running so it took forever to load.

So far, I've only taken a quick look around and am quite excited by what I've seen so far. The first place I looked was the plugin screen. It looks so much better than before with customizable ticket rules and views built in.


The next place I looked was the plugin editor. I had heard that there were improvements made to the editor so I needed to check it out. All I have to say is wow. They separated out the title, description, and versioning to keep you concentrated on the actual code in the code area. And you can separate the code into different files inside the editor. These are really nice improvements.


Here is a video sneak-peek of 4.5 from Spiceworks.

Friday, October 30, 2009

Version 1.0 of the Helpdesk Customization Plugin

Well, it has finally happened. I've hit version 1.0 of the Helpdesk Customizations Plugin.

In the most recent version, I've added info for tickets relating to software items and fixed a bug where the plugin would only retrieve 100 tickets in the info bar.

If you run into this problem, here is the code to get around it for now.


tkt_ct = (new Ajax.Request('/api/tickets.json?total_count=true&filter=open', {method:'get', asynchronous:false})).transport.responseText.evalJSON().count;

Monday, October 26, 2009

The Spiceworld 2009 Aftermath

I wasn't able to attend Spiceworld Austin this year but it sounds like it was a fun event. I just want to say congratulations to the plugin and poster winners.
Great job everybody.

Monday, October 5, 2009

Giorgio Sironi just finished his writeup on an introduction to PHPUnit testing. If you are new to PHPUnit, you should check it out.


Thursday, August 27, 2009

Free extending Spiceworks webinar

Pretty exciting webinar for those looking to get into Spiceworks plugin creation but haven't yet jumped in. Plugin writers can win some neat prizes just as mentioned below.

Love Spiceworks but wish it did one thing differently? With the plugin functionality you can extend Spiceworks to meet the needs of your network. From fun widgets and skins to new functionality you can make Spiceworks yours. Join this webinar and learn how you can get started writing plugins & more. Plus you could win an all expense paid trip to SpiceWorld Austin and a $250 Amazon gift card by submitting your plugin to the plugin contest.

Title: Extending Spiceworks
Date: Tuesday, September 1, 2009
Time: 10:00 AM - 11:00 AM CDT
Registration Link: https://www2.gotomeeting.com/register/246101330

Tuesday, August 25, 2009

A new version of Spiceworks, a new helpdesk customization revision

Well Spiceworks released version 4.1 of their software so I have gone and updated the helpdesk optimization plugin. You will notice that there is a check for version 4.1 due to a small bug in the search for devices, but not to worry, as everything works. For the next release, I plan on having info for software too and not just devices.

Syntax highlighting done courtesy of http://tohtml.com

Anyway, the code is as follows:
// ==SPICEWORKS-PLUGIN==
// @name Help Desk Customizations Clone
// @description Adds minor enhancements to your Help Desk, including ticket status in the toolbar, colors for past due tickets and private messages, and information on devices in the Related To field.
// @version 0.9
// ==/SPICEWORKS-PLUGIN==
//
// Author: Brent Wong
// Date: June 30, 2009
// SW Version: 3.6, 4.0, 4.1

var is4 = SPICEWORKS.version && SPICEWORKS.version.is(">= 4.0");
var is41 = SPICEWORKS.version && SPICEWORKS.version.is(">= 4.1");

var helpdeskCustSettings = [
{name:'past_due_color', label:'Past Due Highlight Color', type:'string', defaultValue:'#ffdede', example:'Default: #ffdede'},
{name:'private_note_color', label:'Private Note Color', type:'string', defaultValue:'#cccccc', example:'Default: #cccccc'},
{name:'tickets_open_display', label:'Display Open Tickets', type:'checkbox', defaultValue:true},
{name:'tickets_due_display', label:'Display Past Due Tickets', type:'checkbox', defaultValue:true},
{name:'tickets_unassigned_display', label:'Display Unassigned Tickets', type:'checkbox', defaultValue:true},
{name:'priority_low_color', label:'Priority Low Color', type:'string', defaultValue:'#c9dcc8', example:'Default: #c9dcc8'},
{name:'priority_med_color', label:'Priority Medium Color', type:'string', defaultValue:'#ffffd7', example:'Default: #ffffd7'},
{name:'priority_high_color', label:'Priority High Color', type:'string', defaultValue:'#fc939c', example:'Default: #fc939c'}
]

// Setup based on Spiceworks version
if (is4){
// For version 4.0
var strToolbar = 'main-toolbar';
var strToolbarDown = 'span.right';
var strDevLink = 'related_to_property';
var strDevLinkDown = '.value a';
var strDevURL = 'devices/';
var strDevInfoAdd = 'related_to_section';
}else{
// For older versions
var strToolbar = 'toolbar';
var strToolbarDown = 'span.advanced_controls';
var strDevLink = 'ticket_review_summary_view';
var strDevLinkDown = 'p.related_to a';
var strDevURL = 'id-';
var strDevInfoAdd = 'ticket_purchase_container';
helpdeskCustSettings.push(
{name: 'expanded_height_enabled', label:'Enable Increased Window Height', type:'checkbox', defaultValue: false},
{name: 'expanded_height', label: 'Ticket Window Height (in px)', type: 'string', defaultValue: '500', example: 'Default: 500'}
);
}

plugin.configure({
settingDefinitions: helpdeskCustSettings
});

function refreshToolbarTicketInfo(){
// display ticket stats
if (plugin.settings.tickets_open_display || plugin.settings.tickets_due_display || plugin.settings.ticket_unassigned_display){
var displayString = '';

if (plugin.settings.tickets_open_display){
displayString += '<span><strong>Open:</strong> ' + SPICEWORKS.data.Ticket.find('all', {filter:'open'}).length + '</span>';
}
if (plugin.settings.tickets_due_display){
displayString += '<span><strong>Past Due:</strong> ' + SPICEWORKS.data.Ticket.find('all', {filter:'past_due'}).length + '</span>';
}
if (plugin.settings.tickets_unassigned_display){
displayString += '<span><strong>Unassigned:</strong> ' + SPICEWORKS.data.Ticket.find( 'all', {filter:'unassigned'}).length + '</span>';
}

var toolbarTicketInfo = $(strToolbar).down(strToolbarDown + ' span.toolbar_ticket_info');

if (toolbarTicketInfo){
toolbarTicketInfo.remove();
}

$(strToolbar).down(strToolbarDown).insert({top:'<span class="toolbar_ticket_info">' + displayString + '</span>'});
}
}

SPICEWORKS.app.helpdesk.ready(function(){
// set styling
if (is4){
SPICEWORKS.utils.addStyle("\
span.toolbar_ticket_info{margin-right:20px;padding:0 5px;border:1px solid #999;}\
span.toolbar_ticket_info span{margin-right:5px;}\
#related_to_summary{clear:both;border:1px solid #ccc;padding:10px;margin:5px 0;overflow:hidden;}\
#related_to_summary ul{margin:0;padding:0;text-align:left;}\
#related_to_summary p{float:right;}\
.filter-priority-low td.priority{background-color:" + plugin.settings.priority_low_color + ";}\
.filter-priority-med td.priority{background-color:" + plugin.settings.priority_med_color + ";}\
.filter-priority-high td.priority{background-color:" + plugin.settings.priority_high_color + ";}\
    ");
}else{
SPICEWORKS.utils.addStyle("\
span.toolbar_ticket_info{font-size:1em;color:#000;float:right;background:#e8e8e8;padding:3px 5px;border:#888 1px solid;}\
span.toolbar_ticket_info span{margin-right:5px;}\
#related_to_summary{clear:both;border:1px solid #ccc;padding:10px;margin:5px 0;overflow:hidden;}\
#related_to_summary ul{margin:0;padding:0;}\
#related_to_summary li{float:left;width:200px;}\
#related_to_summary p{float:right;}\
.filter-priority-low td.priority{background-color:" + plugin.settings.priority_low_color + ";}\
.filter-priority-med td.priority{background-color:" + plugin.settings.priority_med_color + ";}\
.filter-priority-high td.priority{background-color:" + plugin.settings.priority_high_color + ";}\
    ");

// Only Expand the height on version 3
if(plugin.settings.expanded_height_enabled){
SPICEWORKS.utils.addStyle("body.tickets #active_overview {height: " + plugin.settings.expanded_height + "px !important;}");
}
}

// mark past due ticket rows
$$('td.past_due').each(function(item){
item.up().setStyle({backgroundColor: plugin.settings.past_due_color});
});

refreshToolbarTicketInfo();

});

SPICEWORKS.app.helpdesk.ticket.closed(function(){
refreshToolbarTicketInfo();
});

SPICEWORKS.app.helpdesk.ticket.ready(function(){
// color private messages
$$('li.private').each(function(item){
item.setStyle({backgroundColor: plugin.settings.private_note_color})
});

// add device summary
var deviceLink = $(strDevLink).down(strDevLinkDown);
if(deviceLink) {
var deviceURL = deviceLink.readAttribute('href');
var startIndex = deviceURL.indexOf(strDevURL);

if(startIndex != -1) {
var substring = deviceURL.substring(startIndex);
var deviceID = substring.gsub(/[^\d]/, '');
if (is41) {
var devices = SPICEWORKS.data.Device.find('all', {ids:deviceID});
var device = devices.first();
} else {
var device = SPICEWORKS.data.Device.find(deviceID);
}
if(device) {
var displayInfo = '<div id="related_to_summary" style="display:none;"><ul>'
var listStyle = '<li>'
if(device.ip_address && !device.ip_address.empty()) {
displayInfo += listStyle + '<strong>IP:</strong> ' + device.ip_address + '</li>';
}
if(device.mac_address && !device.mac_address.empty()) {
displayInfo += listStyle + '<strong>MAC:</strong> ' + device.mac_address + '</li>';
}
if(device.manufacturer && !device.manufacturer.empty()) {
displayInfo += listStyle + '<strong>Vendor:</strong> ' + device.manufacturer + '</li>';
}
if(device.current_user && !device.current_user.empty()) {
displayInfo += listStyle + '<strong>Last Login:</strong> ' + device.current_user + '</li>';
}
if(device.primary_owner_name && !device.primary_owner_name.empty()) {
displayInfo += listStyle + '<strong>Owner:</strong> ' + device.primary_owner_name + '</li>';
}
if(device.asset_tag && !device.asset_tag.empty()) {
displayInfo += listStyle + '<strong>Asset Tag:</strong> ' + device.asset_tag + '</li>';
}
if(device.operating_system && !device.operating_system.empty()) {
displayInfo += listStyle + '<strong>OS:</strong> ' + device.operating_system + '</li>';
}
if(device.serial_number && !device.serial_number.empty()) {
displayInfo += listStyle + '<strong>Serial No:</strong> ' + device.serial_number + '</li>';
}
displayInfo += '</ul><p><a href="#" onclick="new Effect.BlindUp(\'related_to_summary\', {duration:0.20}); return false;">hide</a></p></div>';
$(strDevInfoAdd).insert({after: displayInfo});
deviceLink.insert({after: '&nbsp;&nbsp;(<a href="#" onclick="new Effect.BlindDown(\'related_to_summary\', {duration:0.20}); return false;">info</a>)'})
}
}
}
});

Tuesday, July 28, 2009

Why will socialized health care work?

What I want to know is why people think that socialized health care will work.  I mean let's break this problem down into it's components, the actual problem and the solution.

What I am told is that the problem we are facing are rising health care costs.  Over the last few years health care costs have continued to rise and are going to increase at a more rapid pace.  I am not going to say that this doesn't happen, because it does, but let's take a look at the reasons that health care costs have been rising.  Health care costs can be split into two different categories from my point of view, medical insurance and out-of-pocket, or a-la-carte, expenses.  First, the insurance costs go up because insurance companies have to make a profit and their costs go up because of both administrative costs and reimbursement costs.  Let's say that administrative costs only need to go up when there is a raise in the minimum wage or there is added red tape, and therefore could be pretty much static.  That leaves us with the reimbursement costs being the main factor in the rise of medical insurance rates.  There are also two main factors in the rise of reimbursement costs, rising cost of service and increase in the number of services performed.  We'll say that reimbursement costs are equivalent to costs incurred by someone paying out-of-pocket.

Okay, we've looked at the problem, so let's take a look at the solution.  The proposed governmental solution is one of socialized health care in the form of a tax based public insurance option.  In other words, everybody pays into this system and is helping to support it.  Well, gee, if it is another insurance option, isn't it still affected by reimbursement costs.  Why, yes, yes it is.  And the only way that an insurance company can cut those costs are by decreasing the number of services performed or to lower the cost of service.  To decrease the number of services performed, the government could put in age restrictions or just other restrictions on procedures.  And to lower the cost of service, the government can put caps on the price of services performed.  Are either of those options going to make health care better?

What I'm not saying is that insurance companies are the best option.  What I am saying is that a government run insurance company isn't a better option.  What our Nation was founded on is Capitalism and competition breeds lower prices and innovation.

Regular Expressions and an MVC introduction

This morning, upon reading my RSS feeds, I came across two interesting and very useful posts.  The first titled "MVC anatomy for PHP developers" is a great introduction as to why the model, view, controller design is good and is really meant for people just beginning out with PHP or have never used the MVC design before.  The post doesn't go into much depth, but it does cover that first step.

The next post I came across was "15 PHP regular expressions for web development." This post goes across some basics of regular expressions but then goes on to list some very useful and commonly used ones.  There are a couple strictly WordPress regular expressions in there, but most of them are universal.

Thursday, July 9, 2009

The caveats of phone conversations

So I was having a chat with someone about PHP over the phone the other day and they ask me to explain the "Foreesh" pattern in PHP. To which I am saying to myself "Is there a 'foreesh' pattern, I've never heard of it." but respond with "I'm sorry, can you say that one more time?". The person I am talking to tries to spell it out "F-O-R-E-S-E-H" at which point I am more confused than ever.

This is one of the biggest problems with talking to people over the phone (especially with people that have a different accent than you), you are just very limited in ways of communication. When you are chatting with someone in person, there is body language, you can watch the way their mouth moves, hand gestures, and even writing or drawing things out on a piece of paper. I have heard that video chats work better but then you are stuck with slow imitation of the real thing.

BTW, I think the person I was talking with meant foreach.

Tuesday, July 7, 2009

This just in...Michael Jackson is dead

I don't know if you guys have heard or not because not many places are reporting this, but Michael Jackson died. I mean it's like no one even cares about him.

Okay, really, he was great for pop back in the 80's and 90's, but recently he hasn't even done anything notable. I think this just goes to show the sad state of America where we care more about one person two weeks after his death than the state of our Nation.