rbrindley: branch rbrindley/astman_revamp r4648 - /team/rbrindley/astman_reva...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Mar 24 08:17:15 CDT 2009
Author: rbrindley
Date: Tue Mar 24 08:17:11 2009
New Revision: 4648
URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4648
Log:
- copied ASTGUI.getUser_DeviceStatus_Image to pbx.users.stateImage
- changed params, now you can either send {state: <char>} or {user: <exten>}. This is an optimization as many times we already know the state and don't need to repeat the ExtensionState action
- state has priority over user if you send {state: 'U', user: <exten>}
Modified:
team/rbrindley/astman_revamp/config/js/pbx2.js
Modified: team/rbrindley/astman_revamp/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/pbx2.js?view=diff&rev=4648&r1=4647&r2=4648
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Tue Mar 24 08:17:11 2009
@@ -1641,6 +1641,37 @@
return 'U';
}
};
+
+/**
+ * Get a User's Status Image.
+ * copied from ASTGUI.getUser_DeviceStatus.
+ * @param state [OPTIONAL] if the state already exists give it to us!
+ * @param user [OPTIONAL] if the state already exists give it to us!
+ * @return html for img
+ */
+pbx.users.stateImage = function(obj) {
+ var state;
+ if (obj.state) {
+ state = obj.state;
+ } else if (obj.user) {
+ state = this.state(user);
+ } else {
+ top.log.error('pbx.users.stateImage: neither state nor user were present in params.');
+ return '<img src="images/status_gray.png" border="0" />';
+ }
+
+ switch(state) {
+ case 'F': /* Available */
+ return '<img src="images/status_green.png" border="0" />';
+ case 'B': /* Busy */
+ return '<img src="images/status_red.png" border="0" />';
+ case 'R': /* Ringing */
+ return '<img src="images/status_orange.png" border="0" />';
+ case 'U': /* Unavailable */
+ default:
+ return '<img src="images/status_gray.png" border="0" />';
+ }
+};
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
More information about the asterisk-gui-commits
mailing list