Advertisement
Guest User

Untitled

a guest
Jan 29th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.06 KB | None | 0 0
  1. <div class="page-title">
  2. <h1><?php echo $this->__('Edit Account Information') ?></h1>
  3. </div>
  4. <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
  5. <form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate" autocomplete="off">
  6. <div class="fieldset">
  7. <?php
  8. $attribute = Mage::getModel('eav/config')->getAttribute('customer', 'tipopessoa');
  9. $_tipopessoaLabel = $attribute->getSource()->getOptionText($this->getCustomer()->getTipopessoa());
  10. ?>
  11. <?php echo $this->getBlockHtml('formkey') ?>
  12. <h2 class="legend"><?php echo $this->__('Account Information') ?></h2>
  13. <ul class="form-list">
  14. <?php $_tipopessoa = $this->getLayout()->createBlock('onestepcheckout/widget_tipopessoa') ?>
  15. <?php if ($_tipopessoa->isEnabled()): ?>
  16. <li class="wide hide">
  17. <?php echo $_tipopessoa->setTipopessoa($this->getCustomer()->getTipopessoa())->setFieldParams('disabled')->toHtml() ?>
  18. </li>
  19. <?php endif ?>
  20. <li class="fields">
  21. <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?>
  22. </li>
  23. <li>
  24. <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
  25. <div class="input-box">
  26. <input type="text" name="email" id="email" readonly="" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />
  27. </div>
  28. </li>
  29. <li class="control">
  30. <input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo $this->__('Change Password') ?>"<?php if ($this->getCustomer()->getChangePassword() == 1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change_password"><?php echo $this->__('Change Password') ?></label>
  31. </li>
  32. </ul>
  33. </div>
  34. <div class="fieldset" style="display:none;">
  35. <h2 class="legend"><?php echo $this->__('Change Password') ?></h2>
  36. <ul class="form-list">
  37. <li>
  38. <label for="current_password" class="required"><em>*</em><?php echo $this->__('Current Password') ?></label>
  39. <div class="input-box">
  40. <!-- Este é um campo fictício escondido para enganar o Firefox no auto preenchimento de senha -->
  41. <input type="text" class="input-text no-display" name="dummy" id="dummy" />
  42. <input type="password" title="<?php echo $this->__('Current Password') ?>" class="input-text" name="current_password" id="current_password" />
  43. </div>
  44. </li>
  45. <li class="fields">
  46. <div class="field">
  47. <label for="password" class="required"><em>*</em><?php echo $this->__('New Password') ?></label>
  48. <div class="input-box">
  49. <input type="password" title="<?php echo $this->__('New Password') ?>" class="input-text validate-password" name="password" id="password" />
  50. </div>
  51. </div>
  52. <div class="field">
  53. <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm New Password') ?></label>
  54. <div class="input-box">
  55. <input type="password" title="<?php echo $this->__('Confirm New Password') ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" />
  56. </div>
  57. </div>
  58. </li>
  59. </ul>
  60. </div>
  61. <div class="fieldset">
  62. <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
  63. <ul class="form-list">
  64. <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
  65. <?php if ($_taxvat->isEnabled()): ?>
  66. <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li>
  67. <?php endif ?>
  68. <li class="wide">
  69. <?php $_ie = $this->getLayout()->createBlock('onestepcheckout/widget_ie') ?>
  70. <?php if ($_ie->isEnabled()): ?>
  71. <?php echo $_ie->setIe($this->getCustomer()->getIe())->toHtml() ?>
  72. <?php endif ?>
  73. </li>
  74. <li>
  75. <ul id="tipopessoa-area" style="overflow: hidden;display:block;">
  76. <li class="fields">
  77. <div class="field">
  78. <?php $_dob = $this->getLayout()->createBlock('onestepcheckout/widget_dob') ?>
  79. <?php if ($_dob->isEnabled()): ?>
  80. <?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?>
  81. <?php endif ?>
  82. </div>
  83. <div class="field">
  84. <?php $_gender = $this->getLayout()->createBlock('onestepcheckout/widget_gender') ?>
  85. <?php if ($_gender->isEnabled()): ?>
  86. <?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?>
  87. <?php endif ?>
  88. </div>
  89. </li>
  90. </ul>
  91. </li>
  92. </ul>
  93. </div>
  94. <div class="buttons-set">
  95. <p class="required"><?php echo $this->__('* Required Fields') ?></p>
  96. <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
  97. <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
  98. </div>
  99. </form>
  100. <script type="text/javascript">
  101. //<![CDATA[
  102. var dataForm = new VarienForm('form-validate', true);
  103. dataForm.submit = function(button, url) {
  104. if (this.validator.validate()) {
  105. if (button && button != 'undefined') {
  106. button.disabled = true;
  107. }
  108. }
  109. }.bind(dataForm);
  110. setTipopessoaArea('<?php echo $_tipopessoaLabel ?>');
  111. function setTipopessoaArea(arg) {
  112. if (arg == 'Jurídica') {
  113. if ($('taxvat')) {
  114. $('taxvat').maxLength = 18;
  115. $('ie').maxLength = 30;
  116. $$('label[for="ie"]').first().update('<em>*</em>IE (Inscrição Estadual)');
  117. $$('label[for="taxvat"]').first().update('<em>*</em>CNPJ');
  118. $$('label[for="firstname"]').first().update('<em>*</em>Razão social');
  119. $$('label[for="lastname"]').first().update('<em>*</em>N. Fantasia');
  120. $$('input[name="taxvat"]').first().writeAttribute('title','CNPJ');
  121. $$('input[name="ie"]').first().writeAttribute('title','IE (Inscrição Estadual)');
  122. $$('input[name="firstname"]').first().writeAttribute('title','Razão social');
  123. $$('input[name="lastname"]').first().writeAttribute('title','N. Fantasia');
  124. $('tipopessoa-area').hide();
  125. }
  126. } else {
  127. if ($('taxvat')) {
  128. $('taxvat').maxLength = 14;
  129. $('ie').maxLength = 30;
  130. $$('label[for="taxvat"]').first().update('<em>*</em>CPF');
  131. $$('label[for="ie"]').first().update('<em>*</em>RG');
  132. $$('label[for="firstname"]').first().update('<em>*</em>Nome');
  133. $$('label[for="lastname"]').first().update('<em>*</em>Sobrenome');
  134. $$('input[name="taxvat"]').first().writeAttribute('title','CPF');
  135. $$('input[name="ie"]').first().writeAttribute('title','RG');
  136. $$('input[name="firstname"]').first().writeAttribute('title','Nome');
  137. $$('input[name="lastname"]').first().writeAttribute('title','Sobrenome');
  138. $('tipopessoa-area').show();
  139. }
  140. }
  141. }
  142. function setPasswordForm(arg) {
  143. if (arg) {
  144. $('current_password').up(3).show();
  145. $('current_password').addClassName('required-entry');
  146. $('password').addClassName('required-entry');
  147. $('confirmation').addClassName('required-entry');
  148.  
  149. } else {
  150. $('current_password').up(3).hide();
  151. $('current_password').removeClassName('required-entry');
  152. $('password').removeClassName('required-entry');
  153. $('confirmation').removeClassName('required-entry');
  154. }
  155. }
  156. if ($('taxvat')) {
  157. $('taxvat').addClassName('validate-taxvat');
  158. $('taxvat').observe('keyup', function(event) {
  159. mascara(this, mdocumento);
  160. });
  161. }
  162.  
  163. <?php if ($this->getCustomer()->getChangePassword()): ?>
  164. setPasswordForm(true);
  165. <?php endif; ?>
  166. //]]>
  167. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement