rbrindley: branch 2.0 r4634 - /branches/2.0/config/js/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Mar 12 15:09:14 CDT 2009
Author: rbrindley
Date: Thu Mar 12 15:09:11 2009
New Revision: 4634
URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4634
Log:
- merged latest and greatest from astman_revamp
- including: validate.weekday bug fix and pbx.time_intervals.remove func
Modified:
branches/2.0/config/js/object.customs.js
branches/2.0/config/js/pbx2.js
Modified: branches/2.0/config/js/object.customs.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/object.customs.js?view=diff&rev=4634&r1=4633&r2=4634
==============================================================================
--- branches/2.0/config/js/object.customs.js (original)
+++ branches/2.0/config/js/object.customs.js Thu Mar 12 15:09:11 2009
@@ -172,7 +172,7 @@
if (obj[d] instanceof Array) {
props.push(d + ': [' + obj[d].join(',') + ']');
} else {
- props.push(d + ': ' + obj[d].getProperties());
+ props.push(d + ': ' + getProperties(obj[d]));
}
} else {
props.push(d + ': ' + obj[d]);
Modified: branches/2.0/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/pbx2.js?view=diff&rev=4634&r1=4633&r2=4634
==============================================================================
--- branches/2.0/config/js/pbx2.js (original)
+++ branches/2.0/config/js/pbx2.js Thu Mar 12 15:09:11 2009
@@ -487,6 +487,46 @@
/* TODO: add new time interval to gui cache */
ASTGUI.feedback({ msg: 'Updated time interval!', showfor: 3, color: 'green', bgcolor: '#ffffff'});
+ return true;
+};
+
+/**
+ * Delete a Time Interval.
+ * @param name.
+ * @return boolean on success.
+ */
+pbx.time_intervals.remove = function(name) {
+ if (!name) {
+ top.log.warn('pbx.time_intervals.remove: Name is empty.');
+ return false;
+ }
+
+ var actions = new listOfSynActions('extensions.conf');
+ actions.new_action('delete', 'globals', t, '', '');
+
+ var exten_conf = config2json({filename: 'extensions.conf', usf:0});
+ for (var cxt in exten_conf) {
+ if (!exten_conf.hasOwnProperty(cxt)) {
+ continue;
+ }
+
+ if (cxt.beginsWith(ASTGUI.contexts.TrunkDIDPrefix) && !cxt.contains(ASTGUI.contexts.TimeIntervalPrefix)) {
+ var did = exten_conf[cxt];
+ did.each(function(line) {
+ if (line.beginsWith('include=') && line.contains(ASTGUI.contexts.TrunkDIDPrefix) && line.contains(ASTGUI.contexts.TimeIntervalPrefix)) {
+ actions.new_action('delete', cxt, 'include', '', line.afterChar('='));
+ }
+ });
+ }
+ }
+
+ var resp = actions.callActions();
+ if (!resp.contains('Response: Success')) {
+ top.log.error('pbx.time_intervals.remove: error updating extensions.conf.');
+ return false;
+ }
+
+
return true;
};
@@ -595,17 +635,19 @@
return true;
}
- if (week.contains('-') && week[2] !== '-') {
- return false;
- } else if (week[2] === '-') {
+ if (week.contains('-') && week[3] !== '-') {
+ return false;
+ } else if (week[3] === '-') {
var first = week.split('-')[0];
var second = week.split('-')[1];
if (!this.days.contains(first) || !this.days.contains(second)) {
+ alert('zonoes!');
return false;
}
} else {
if (!this.days.contains(week)) {
+ alert('zonoes 2.0!');
return false;
}
More information about the asterisk-gui-commits
mailing list