rbrindley: branch rbrindley/astman_revamp r4644 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Mar 20 11:38:19 CDT 2009


Author: rbrindley
Date: Fri Mar 20 11:38:16 2009
New Revision: 4644

URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4644
Log:

- copied astgui_manageCallPlans.nextAvailableDP to pbx.call_plans.nextAvailable


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=4644&r1=4643&r2=4644
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Fri Mar 20 11:38:16 2009
@@ -311,6 +311,29 @@
 	}
 
 	return list;
+};
+
+/**
+ * Get Next Available Calling Plan.
+ * @return next available calling plan.
+ */
+pbx.call_plans.nextAvailable = function() {
+	var numbers = [];
+	var cxt = ASTGUI.contexts.CallingPlanPrefix + 'DialPlan';
+	var plans = this.list();
+
+	plans.each(function(plan) {
+		if (!plan.beginsWith(cxt)) {
+			return;
+		}
+
+		var num = Number(plan.lChop(cxt));
+		if (!isNaN(num)) {
+			numbers.push(num);
+		}
+	});
+
+	return 'DialPlan' + numbers.firstAvailable(1);
 };
 
 /**




More information about the asterisk-gui-commits mailing list