Ticket #2375: patch.diff
| File patch.diff, 12.4 kB (added by ThomasHawk2_, 5 years ago) |
|---|
-
functions.inc.php
old new 2665 2665 2666 2666 if ( $dispnum == 'users' || $dispnum == 'extensions' ) { 2667 2667 // Setup option list we need 2668 $currentcomponent->addoptlistitem('recordoptions', 'Adhoc', 'On Demand');2669 $currentcomponent->addoptlistitem('recordoptions', 'Always', 'Always');2670 $currentcomponent->addoptlistitem('recordoptions', 'Never', 'Never');2668 $currentcomponent->addoptlistitem('recordoptions', 'Adhoc', _("On Demand")); 2669 $currentcomponent->addoptlistitem('recordoptions', 'Always', _("Always")); 2670 $currentcomponent->addoptlistitem('recordoptions', 'Never', _("Never")); 2671 2671 $currentcomponent->setoptlistopts('recordoptions', 'sort', false); 2672 2672 2673 $currentcomponent->addoptlistitem('faxdetecttype', '0', 'None');2673 $currentcomponent->addoptlistitem('faxdetecttype', '0', _("None")); 2674 2674 $currentcomponent->addoptlistitem('faxdetecttype', '1', 'Zaptel'); 2675 2675 $currentcomponent->addoptlistitem('faxdetecttype', '2', 'NVFax'); 2676 2676 $currentcomponent->setoptlistopts('faxdetecttype', 'sort', false); 2677 2677 2678 $currentcomponent->addoptlistitem('privyn', '0', 'No');2679 $currentcomponent->addoptlistitem('privyn', '1', 'Yes');2678 $currentcomponent->addoptlistitem('privyn', '0', _("No")); 2679 $currentcomponent->addoptlistitem('privyn', '1', _("Yes")); 2680 2680 $currentcomponent->setoptlistopts('privyn', 'sort', false); 2681 2681 2682 $currentcomponent->addoptlistitem('callwaiting', 'enabled', 'Enable');2683 $currentcomponent->addoptlistitem('callwaiting', 'disabled', 'Disable');2682 $currentcomponent->addoptlistitem('callwaiting', 'enabled', _("Enable")); 2683 $currentcomponent->addoptlistitem('callwaiting', 'disabled', _("Disable")); 2684 2684 $currentcomponent->setoptlistopts('callwaiting', 'sort', false); 2685 2685 2686 2686 $currentcomponent->addoptlistitem('ringtime', '0', 'Default'); … … 2689 2689 } 2690 2690 $currentcomponent->setoptlistopts('ringtime', 'sort', false); 2691 2691 2692 $currentcomponent->addoptlistitem('faxdestoptions', 'default', 'FreePBX default');2693 $currentcomponent->addoptlistitem('faxdestoptions', 'disabled', 'disabled');2694 $currentcomponent->addoptlistitem('faxdestoptions', 'system', 'system');2692 $currentcomponent->addoptlistitem('faxdestoptions', 'default', _("FreePBX default")); 2693 $currentcomponent->addoptlistitem('faxdestoptions', 'disabled', _("disabled")); 2694 $currentcomponent->addoptlistitem('faxdestoptions', 'system', _("system")); 2695 2695 $currentcomponent->setoptlistopts('faxdestoptions', 'sort', false); 2696 2696 2697 2697 if (function_exists('music_list')) { … … 2763 2763 } 2764 2764 2765 2765 } elseif ( $display != 'extensions' ) { 2766 $currentcomponent->addguielem('_top', new gui_pageheading('title', 'Add User/Extension'), 0);2766 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add User/Extension")), 0); 2767 2767 } 2768 2768 2769 2769 // Setup vars for use in the gui later on 2770 2770 $fc_logon = featurecodes_getFeatureCode('core', 'userlogon'); 2771 2771 $fc_logoff = featurecodes_getFeatureCode('core', 'userlogoff'); 2772 2772 2773 $msgInvalidExtNum = 'Please enter a valid extension number.';2774 $msgInvalidCidNum = 'Please enter a valid CID Num Alias (must be a valid number).';2775 $msgInvalidExtPwd = 'Please enter valid User Password using numbers only';2776 $msgInvalidDispName = 'Please enter a valid Display Name';2777 $msgInvalidOutboundCID = 'Please enter a valid Outbound CID';2778 $msgInvalidPause = 'Please enter a valid pause time in seconds, using digits only';2773 $msgInvalidExtNum = _("Please enter a valid extension number."); 2774 $msgInvalidCidNum = _("Please enter a valid CID Num Alias (must be a valid number)."); 2775 $msgInvalidExtPwd = _("Please enter valid User Password using numbers only"); 2776 $msgInvalidDispName = _("Please enter a valid Display Name"); 2777 $msgInvalidOutboundCID = _("Please enter a valid Outbound CID"); 2778 $msgInvalidPause = _("Please enter a valid pause time in seconds, using digits only"); 2779 2779 2780 2780 // This is the actual gui stuff 2781 2781 $currentcomponent->addguielem('_top', new gui_hidden('action', ($extdisplay ? 'edit' : 'add'))); 2782 2782 $currentcomponent->addguielem('_top', new gui_hidden('extdisplay', $extdisplay)); 2783 2783 2784 2784 if ( $display == 'extensions' ) { 2785 $section = ($extdisplay ? 'Edit Extension' : 'Add Extension');2785 $section = ($extdisplay ? _("Edit Extension") : _("Add Extension")); 2786 2786 } else { 2787 $section = ($extdisplay ? 'Edit User' : 'Add User');2787 $section = ($extdisplay ? _("Edit User") : _("Add User")); 2788 2788 } 2789 2789 if ( $extdisplay ) { 2790 2790 $currentcomponent->addguielem($section, new gui_hidden('extension', $extdisplay), 2); … … 2792 2792 $currentcomponent->addguielem($section, new gui_textbox('extension', $extdisplay, 'User Extension', 'The extension number to dial to reach this user.', '!isInteger()', $msgInvalidExtNum, false), 3); 2793 2793 } 2794 2794 if ( $display != 'extensions' ) { 2795 $currentcomponent->addguielem($section, new gui_password('password', $password, 'User Password', _("A user will enter this password when logging onto a device.").' '.$fc_logon.' '._( 'logs into a device.').' '.$fc_logoff.' '._('logs out of a device.'), '!isInteger() && !isWhitespace()', $msgInvalidExtPwd, true));2795 $currentcomponent->addguielem($section, new gui_password('password', $password, 'User Password', _("A user will enter this password when logging onto a device.").' '.$fc_logon.' '._("logs into a device.").' '.$fc_logoff.' '._("logs out of a device."), '!isInteger() && !isWhitespace()', $msgInvalidExtPwd, true)); 2796 2796 // extra JS function check required for blank password warning -- call last in the onsubmit() function 2797 2797 $currentcomponent->addjsfunc('onsubmit()', "\treturn checkBlankUserPwd();\n", 9); 2798 2798 } … … 2897 2897 $currentcomponent->addgeneralarray('devtechs'); 2898 2898 2899 2899 // Some errors for the validation bits 2900 $msgInvalidDTMFMODE = 'Please enter the dtmfmode for this device';2901 $msgInvalidChannel = 'Please enter the channel for this device';2902 $msgConfirmSecret = 'You have not entered a Secret for this device, although this is possible it is generally bad practice to not assign a Secret to a device.\n\nAre you sure you want to leave the Secret empty?';2903 $msgInvalidSecret = 'Please enter a Secret for this device';2900 $msgInvalidDTMFMODE = _("Please enter the dtmfmode for this device"); 2901 $msgInvalidChannel = _("Please enter the channel for this device"); 2902 $msgConfirmSecret = _("You have not entered a Secret for this device, although this is possible it is generally bad practice to not assign a Secret to a device.\n\nAre you sure you want to leave the Secret empty?"); 2903 $msgInvalidSecret = _("Please enter a Secret for this device"); 2904 2904 2905 2905 // zap 2906 2906 $tmparr = array(); … … 2965 2965 unset($tmparr); 2966 2966 2967 2967 // Devices list 2968 $currentcomponent->addoptlistitem('devicelist', 'sip_generic', 'Generic SIP Device');2969 $currentcomponent->addoptlistitem('devicelist', 'iax2_generic', 'Generic IAX2 Device');2970 $currentcomponent->addoptlistitem('devicelist', 'zap_generic', 'Generic ZAP Device');2971 $currentcomponent->addoptlistitem('devicelist', 'custom_custom', 'Other (Custom) Device');2968 $currentcomponent->addoptlistitem('devicelist', 'sip_generic', _("Generic SIP Device")); 2969 $currentcomponent->addoptlistitem('devicelist', 'iax2_generic', _("Generic IAX2 Device")); 2970 $currentcomponent->addoptlistitem('devicelist', 'zap_generic', _("Generic ZAP Device")); 2971 $currentcomponent->addoptlistitem('devicelist', 'custom_custom', _("Other (Custom) Device")); 2972 2972 $currentcomponent->setoptlistopts('devicelist', 'sort', false); 2973 2973 2974 2974 2975 2975 // Option lists used by the gui 2976 $currentcomponent->addoptlistitem('devicetypelist', 'fixed', 'Fixed');2977 $currentcomponent->addoptlistitem('devicetypelist', 'adhoc', 'Adhoc');2976 $currentcomponent->addoptlistitem('devicetypelist', 'fixed', _("Fixed")); 2977 $currentcomponent->addoptlistitem('devicetypelist', 'adhoc', _("Adhoc")); 2978 2978 $currentcomponent->setoptlistopts('devicetypelist', 'sort', false); 2979 2979 2980 $currentcomponent->addoptlistitem('deviceuserlist', 'none', 'none');2981 $currentcomponent->addoptlistitem('deviceuserlist', 'new', 'New User');2980 $currentcomponent->addoptlistitem('deviceuserlist', 'none', _("none")); 2981 $currentcomponent->addoptlistitem('deviceuserlist', 'new', _("New User")); 2982 2982 $users = core_users_list(); 2983 2983 if (isset($users)) { 2984 2984 foreach ($users as $auser) { … … 3010 3010 } elseif ( $extdisplay == '' && $tech_hardware == '' ) { // Adding 3011 3011 3012 3012 if ( $display != 'extensions') { 3013 $currentcomponent->addguielem('_top', new gui_pageheading('title', 'Add Device'), 0);3013 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add Device")), 0); 3014 3014 } else { 3015 $currentcomponent->addguielem('_top', new gui_pageheading('title', 'Add an Extension'), 0);3015 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add an Extension")), 0); 3016 3016 } 3017 $currentcomponent->addguielem('_top', new gui_label('instructions', 'Please select your Device below then click Submit'));3017 $currentcomponent->addguielem('_top', new gui_label('instructions', _("Please select your Device below then click Submit"))); 3018 3018 $currentcomponent->addguielem('Device', new gui_selectbox('tech_hardware', $currentcomponent->getoptlist('devicelist'), '', 'Device', '', false)); 3019 3019 3020 3020 } else { … … 3039 3039 unset($tmparr); 3040 3040 3041 3041 if ( $display != 'extensions' ) { 3042 $currentcomponent->addguielem('_top', new gui_pageheading('title', _( 'Add').' '.strtoupper($deviceInfo['tech']).' '._('Device')), 0);3042 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add").' '.strtoupper($deviceInfo['tech']).' '._("Device")), 0); 3043 3043 } else { 3044 $currentcomponent->addguielem('_top', new gui_pageheading('title', _( 'Add').' '.strtoupper($deviceInfo['tech']).' '._('Extension')), 0);3044 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add").' '.strtoupper($deviceInfo['tech']).' '._("Extension")), 0); 3045 3045 } 3046 3046 3047 3047 } … … 3056 3056 $fc_logon = featurecodes_getFeatureCode('core', 'userlogon'); 3057 3057 $fc_logoff = featurecodes_getFeatureCode('core', 'userlogoff'); 3058 3058 3059 $msgInvalidDevID = 'Please enter a device id.';3060 $msgInvalidDevDesc = 'Please enter a valid Description for this device';3061 $msgInvalidEmergCID = 'Please enter a valid Emergency CID';3062 $msgInvalidExtNum = 'Please enter a valid extension number.';3059 $msgInvalidDevID = _("Please enter a device id."); 3060 $msgInvalidDevDesc = _("Please enter a valid Description for this device"); 3061 $msgInvalidEmergCID = _("Please enter a valid Emergency CID"); 3062 $msgInvalidExtNum = _("Please enter a valid extension number."); 3063 3063 3064 3064 // Actual gui 3065 3065 $currentcomponent->addguielem('_top', new gui_hidden('action', ($extdisplay ? 'edit' : 'add'))); … … 3074 3074 } 3075 3075 $currentcomponent->addguielem($section, new gui_textbox('description', $devinfo_description, 'Description', 'The caller id name for this device will be set to this description until it is logged into.', '!isAlphanumeric() || isWhitespace()', $msgInvalidDevDesc, false)); 3076 3076 $currentcomponent->addguielem($section, new gui_textbox('emergency_cid', $devinfo_emergency_cid, 'Emergency CID', 'This caller id will always be set when dialing out an Outbound Route flagged as Emergency. The Emergency CID overrides all other caller id settings.', '!isCallerID()', $msgInvalidEmergCID)); 3077 $currentcomponent->addguielem($section, new gui_selectbox('devicetype', $currentcomponent->getoptlist('devicetypelist'), $devinfo_devicetype, 'Device Type', _( 'Devices can be fixed or adhoc. Fixed devices are always associated to the same extension/user. Adhoc devices can be logged into and logged out of by users.').' '.$fc_logon.' '._('logs into a device.').' '.$fc_logoff.' '._('logs out of a device.'), false));3077 $currentcomponent->addguielem($section, new gui_selectbox('devicetype', $currentcomponent->getoptlist('devicetypelist'), $devinfo_devicetype, 'Device Type', _("Devices can be fixed or adhoc. Fixed devices are always associated to the same extension/user. Adhoc devices can be logged into and logged out of by users.").' '.$fc_logon.' '._("logs into a device.").' '.$fc_logoff.' '._("logs out of a device."), false)); 3078 3078 $currentcomponent->addguielem($section, new gui_selectbox('deviceuser', $currentcomponent->getoptlist('deviceuserlist'), $devinfo_user, 'Default User', 'Fixed devices will always mapped to this user. Adhoc devices will be mapped to this user by default.<br><br>If selecting "New User", a new User Extension of the same Device ID will be set as the Default User.', false)); 3079 3079 } else { 3080 3080 $section = 'Extension Options';
