[cisco-voip] Unity Connection User template sorting
Anthony Holloway
avholloway+cisco-voip at gmail.com
Wed Sep 29 01:16:09 EDT 2010
Ah, I see. I also see that if I had switched the User Type drop down to
"User Without Mailbox," I would have seen an unsorted list there as well.
I'm guessing most people use firefox to administer CUCM and CUC, so I wrote
a userscript to sort the two lists. Feedback is welcomed!
Save as filename.user.js, then open with firefox (greasemonkey add-on
required):
// ==UserScript==
// @name Unity Connection User Template Sorter
// @namespace http://www.avholloway.com
// @include https://*/cuadmin/user.do?op=newUser&isSubscriber=false
// @include https://*/cuadmin/ccm-import.do?op=search
// ==/UserScript==
(function() {
// Get the selection object, return if undefined or has < 2 items
var selection = document.getElementById('templateObjectId');
if (! selection || selection.options.length < 2)
return;
// Create two arrays to store name/value in
var sorted_names = [], sorted_values = [];
// Iterate over the selection items, storing the names in our array
for (var i = 0, j = selection.options.length; i < j; i++)
sorted_names.push(selection.options[i].text);
// Sort the names alphabetically, and ignore case
sorted_names.sort(function(a, b) {
a = a.toLowerCase(); b = b.toLowerCase();
if (a > b) return 1;
if (a < b) return -1;
return 0;
});
// Iterate over the sorted names, locating the option element, and storing
its value
for (var i = 0, j = sorted_names.length; i < j; i++) {
for (var k = 0, l = selection.options.length; k < l; k++) {
if (sorted_names[i] == selection.options[k].text) {
sorted_values.push(selection.options[k].value);
break;
}
}
}
// Iterate over the selection items, removing each one from the selection
for (;selection.options.length > 0;)
selection.remove(0);
// Iterate over the sorted name/value arrays, adding them to the selection
for (var i = 0, j = sorted_names.length; i < j; i++) {
var e = document.createElement('option');
e.text = sorted_names[i];
e.value = sorted_values[i];
selection.add(e, null);
}
})();
This was tested on Unity Connection 7.1.5ES7.10000-7, running firefox 3.6.9,
and greasemonkey 0.8.20100408.6.
Anthony
On Tue, Sep 28, 2010 at 11:27 PM, Dana Tong <Dana.Tong at ivision.com.au>wrote:
> It was the “import from LDAP” function in Unity Connection 8.0(2)
>
>
>
> *From:* cisco-voip-bounces at puck.nether.net [mailto:
> cisco-voip-bounces at puck.nether.net] *On Behalf Of *Jason Aarons (US)
> *Sent:* Wednesday, 29 September 2010 2:19 PM
> *To:* Anthony Holloway; Mike Lydick
>
> *Cc:* cisco-voip at puck.nether.net
> *Subject:* Re: [cisco-voip] Unity Connection User template sorting
>
>
>
> I have this same problem with regular Unity 8.0(3), need a feature request
> to be able to order templates in drop down boxes.
>
>
>
> In Unity 8.0(3) with Exchange you Import a new Subscriber and we always
> have to hit drop down to find the correct template. Be cool if you could set
> a default template and a display order.
>
>
>
> *From:* cisco-voip-bounces at puck.nether.net [mailto:
> cisco-voip-bounces at puck.nether.net] *On Behalf Of *Anthony Holloway
> *Sent:* Tuesday, September 28, 2010 11:51 PM
> *To:* Mike Lydick
> *Cc:* cisco-voip at puck.nether.net
> *Subject:* Re: [cisco-voip] Unity Connection User template sorting
>
>
>
> What version are you using? I have a CUC 7.1.5ES7.10000-7, and my list
> sorts alphabetically. Or is this not the area you were referring to?
>
>
>
> [image: user-template.png]
>
>
>
> Anthony
>
> On Tue, Sep 28, 2010 at 3:30 PM, Mike Lydick <mike.lydick at gmail.com>
> wrote:
>
> Is it possible to change the priority (the way the templates are listed).
> The Administrator Template stays in the first slot regardless if you rename.
> This becomes and issue with MAC staff because they frequently
> (inadvertently) select this and have to delete the acct and re-add. I have
> had this question repeatedly with customers as it is an annoyance.
>
>
>
>
> Best Regards,
>
> Mike Lydick
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> ------------------------------
>
> [image: 0ede5e1b-f.gif]<http://www.dimensiondata.com/_layouts/forms.aspx?FormID=204>
>
> *Disclaimer: This e-mail communication and any attachments may contain
> confidential and privileged information and is for use by the designated
> addressee(s) named above only. If you are not the intended addressee, you
> are hereby notified that you have received this communication in error and
> that any use or reproduction of this email or its contents is strictly
> prohibited and may be unlawful. If you have received this communication in
> error, please notify us immediately by replying to this message and deleting
> it from your computer. Thank you. *
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20100929/ea5eca11/attachment.html>
More information about the cisco-voip
mailing list