File tree Expand file tree Collapse file tree 8 files changed +81
-2
lines changed
design/adminhtml/default/default Expand file tree Collapse file tree 8 files changed +81
-2
lines changed Original file line number Diff line number Diff line change @@ -364,9 +364,14 @@ public function autocompleteAction()
364364 public function logAction ()
365365 {
366366 $ path = Mage::helper ('zendesk/log ' )->getLogPath ();
367-
367+
368368 if (!file_exists ($ path )) {
369- Mage::getSingleton ('adminhtml/session ' )->addError (Mage::helper ('zendesk ' )->__ ('The Zendesk log file has not been created. Check to see if logging has been enabled. ' ));
369+ if (is_writable ($ path )) {
370+ Mage::getSingleton ('adminhtml/session ' )->addError (Mage::helper ('zendesk ' )->__ ('Creating a Zendesk log file. ' ));
371+ file_put_contents (" " ,$ path );
372+ } else {
373+ Mage::getSingleton ('adminhtml/session ' )->addError (Mage::helper ('zendesk ' )->__ ('Magento logging has been disabled or Magento log folder has incorrect permissions. ' ));
374+ }
370375 }
371376
372377 if (Mage::helper ('zendesk/log ' )->isLogTooLarge ()) {
Original file line number Diff line number Diff line change 115115 <zendesk >
116116 <file >zendesk.xml</file >
117117 </zendesk >
118+ <jstranslate >
119+ <file >jstranslate.xml</file >
120+ </jstranslate >
118121 </updates >
119122 </layout >
120123 <translate >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <!--
3+ /**
4+ * Copyright 2015 Zendesk
5+ *
6+ * Licensed under the Apache License, Version 2.0 (the "License");
7+ * you may not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing, software
13+ * distributed under the License is distributed on an "AS IS" BASIS,
14+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ * See the License for the specific language governing permissions and
16+ * limitations under the License.
17+ */
18+ -->
19+ <jstranslator >
20+ <validate-zendesk-sso-token translate =" message" module =" zendesk" >
21+ <message >Token cannot be empty</message >
22+ </validate-zendesk-sso-token >
23+ <validate-zendesk-sso-frontend-token translate =" message" module =" zendesk" >
24+ <message >Token cannot be empty</message >
25+ </validate-zendesk-sso-frontend-token >
26+ </jstranslator >
Original file line number Diff line number Diff line change 135135 <label >Remote Authentication Token</label >
136136 <frontend_type >text</frontend_type >
137137 <sort_order >2</sort_order >
138+ <validate >validate-zendesk-sso-token</validate >
138139 <show_in_default >1</show_in_default >
139140 <show_in_website >1</show_in_website >
140141 <show_in_store >1</show_in_store >
164165 <label >Remote Authentication Token</label >
165166 <frontend_type >text</frontend_type >
166167 <sort_order >2</sort_order >
168+ <validate >validate-zendesk-sso-frontend-token</validate >
167169 <show_in_default >1</show_in_default >
168170 <show_in_website >1</show_in_website >
169171 <show_in_store >1</show_in_store >
Original file line number Diff line number Diff line change 2222 <action method =" addCss" >
2323 <stylesheet >zendesk/zendesk.css</stylesheet >
2424 </action >
25+ <action method =" addJs" >
26+ <script >zendesk/validation.js</script >
27+ </action >
28+ </reference >
29+ <reference name =" content" >
30+ <block type =" core/template" template =" zendesk/translations.phtml" ></block >
2531 </reference >
2632 </adminhtml_system_config_edit >
2733
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright 2015 Zendesk
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+ ?>
18+ <script>
19+ Translator.add('Token cannot be empty', '<?php echo $ this ->__ ('Token cannot be empty ' ); ?> ');
20+ </script>
Original file line number Diff line number Diff line change 109109"Decide which features you would like turned on in your admin panel.","Decide which features you would like turned on in your admin panel."
110110"Show "All" tab on dashboard","Show "All" tab on dashboard"
111111"Generate New Token","Generate New Token"
112+ "Token cannot be empty","Token cannot be empty"
Original file line number Diff line number Diff line change 1+ Validation . addAllThese ( [
2+ [ 'validate-zendesk-sso-token' , 'Token cannot be empty' , function ( v ) {
3+ if ( $ ( 'zendesk_sso_enabled' ) . getValue ( ) === '1' ) {
4+ return ! Validation . get ( 'IsEmpty' ) . test ( v ) ;
5+ } else {
6+ return true ;
7+ }
8+ } ] ,
9+ [ 'validate-zendesk-sso-frontend-token' , 'Token cannot be empty' , function ( v ) {
10+ if ( $ ( 'zendesk_sso_frontend_enabled' ) . getValue ( ) === '1' ) {
11+ return ! Validation . get ( 'IsEmpty' ) . test ( v ) ;
12+ } else {
13+ return true ;
14+ }
15+ } ]
16+ ] ) ;
You can’t perform that action at this time.
0 commit comments