Changeset 9215
- Timestamp:
- 03/14/10 22:09:56 (2 years ago)
- Files:
-
- modules/branches/2.8/core/page.routing.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.8/core/page.routing.php
r9207 r9215 679 679 changedClass: "text-red" 680 680 }); 681 /*TODO: call clearPattern() here, or move this to routeEdit_onsubmit()?682 */683 $("form").submit(function() {684 $(this).find(".dpt-title").each(function() {685 if($(this).val() == $(this).data("defText")) {686 $(this).val("");687 }688 });689 });690 681 }); 691 682 … … 763 754 var msgInvalidRouteName = "<?php echo _('Route name is invalid, please try again'); ?>"; 764 755 var msgInvalidRoutePwd = "<?php echo _('Route password must be numeric or leave blank to disable'); ?>"; 765 var msgInvalidDialPattern = "<?php echo _('Dial pattern is invalid'); ?>";766 756 var msgInvalidTrunkSelection = "<?php echo _('At least one trunk must be picked'); ?>"; 767 757 var msgInvalidOutboundCID = "<?php echo _('Invalid Outbound Caller ID'); ?>"; … … 790 780 791 781 theForm.action.value = act; 792 return true; 782 783 clearPatterns(); 784 return validatePatterns(); 793 785 } 794 786 … … 799 791 } 800 792 }); 793 return true; 794 } 795 796 function validatePatterns() { 797 var one_good = false; 798 var culprit; 799 var msgInvalidDialPattern; 800 defaultEmptyOK = false; 801 802 $(".toggleval").each(function() { 803 if ($.trim($(this).val()) == '') { 804 } else if (!isDialpattern($(this).val())) { 805 culprit = this; 806 return false; 807 } else { 808 one_good = true; 809 } 810 }); 811 812 if (culprit == undefined && !one_good) { 813 culprit = $('.toggleval:visible').get(0); 814 msgInvalidDialPattern = "<?php echo _('No dial pattern, there must be at least one'); ?>"; 815 } else { 816 msgInvalidDialPattern = "<?php echo _('Dial pattern is invalid'); ?>"; 817 } 818 if (culprit != undefined) { 819 // now we have to put it back... 820 // do I have to turn it off first though? 821 $(".dpt-title").each(function() { 822 if ($.trim($(this).val()) == '') { 823 $(this).toggleVal({ 824 populateFrom: "title", 825 changedClass: "text-normal", 826 focusClass: "text-normal" 827 }); 828 } 829 }); 830 return warnInvalid(culprit, msgInvalidDialPattern); 831 } else { 832 return true; 833 } 801 834 } 802 835 … … 829 862 document.getElementById('reporoutekey').value=key; 830 863 document.getElementById('action').value='prioritizeroute'; 864 clearPatterns(); 831 865 document.getElementById('routeEdit').submit(); 832 866 break;
