Support Forums - Classified Ads Script Osclass

Osclass theme support => Veronika Osclass Responsive Theme => Topic started by: Anonymous on January 14, 2018, 05:49:19 PM

Title: user type (user-profile)
Post by: Anonymous on January 14, 2018, 05:49:19 PM
hi,
strange things occured!!!

i removed whole line-   <div class="row">
              <label for="user_type"><?php _e('User type', 'veronika'); ?></label>
              <div class="input-box"><i class="fa fa-industry"></i><?php UserForm::is_company_select(osc_user()); ?></div>
            </div>

from user-profile, so that user cant able to choose user type,

issue occured- when i applied user as company , and that user updates his/her profile information, then automatically user type convert to user,
means to say- user as company; after updating his profile info , it becomes user, user type- user instead of company,

how to solve this strange issue,  :-[
Title: Re: user type (user-profile)
Post by: MB Themes on January 14, 2018, 05:50:20 PM
Remove user type on database
Title: Re: user type (user-profile)
Post by: Anonymous on January 14, 2018, 05:53:51 PM
you mean t_user_type
will it affect other users,

i just want that;
 user does not able to change their type from his/her profile
Title: Re: user type (user-profile)
Post by: Anonymous on January 14, 2018, 06:02:15 PM
theres b_company
in t_user database,
this line assigns 1 & 0,  true or false,

if i delete user type then, i loose all user type, :-[

please suggest me any alternate option, remedy :D
so that user wont get any option to select their type,
Title: Re: user type (user-profile)
Post by: MB Themes on January 14, 2018, 06:18:55 PM
@Anonymous
Not sure if I understand. You want to disable user types option, but you want to keep user type options... :o
Title: Re: user type (user-profile)
Post by: Anonymous on January 14, 2018, 06:36:48 PM
i wants to disable user type drop down from user-profile.php,  :)
only admin could having rights to change user type from admin dashboard. :D

i dont want to delete user type from db, cause it will affect rest of users,


just wants to Hide user type from  user-profile.php :)

any div or element hidding method , could you suggest, for hidding this drop down option from user profile
Title: Re: user type (user-profile)
Post by: MB Themes on January 14, 2018, 06:51:11 PM
Ok, removes it in user-profile.php
Title: Re: user type (user-profile)
Post by: Anonymous on January 14, 2018, 07:07:41 PM
Quote
i removed whole line-   <div class="row">
              <label for="user_type"><?php _e('User type', 'veronika'); ?></label>
              <div class="input-box"><i class="fa fa-industry"></i><?php UserForm::is_company_select(osc_user()); ?></div>
            </div>

i already did that, & issue occured,

user type (company) when updates his profile information then automatically, it becomes user,
company becomes user,

i hope you are getting what am trying to say,

every times when user updates his profile information then automatically his database becomes user as type,
 
assigns data automatically in b_company  after deleting line


 
Code: [Select]
  <div class="row">
              <label for="user_type"><?php _e('User type''veronika'); ?></label>
              <div class="input-box"><i class="fa fa-industry"></i><?php UserForm::is_company_select(osc_user()); ?></div>
            </div>
Title: Re: user type (user-profile)
Post by: MB Themes on January 14, 2018, 07:57:13 PM
@Anonymous
Put the field as invisible or readonly.
Title: Re: user type (user-profile)
Post by: Anonymous on January 14, 2018, 08:12:01 PM
Pls suggest me how to do that..

I followed - https://stackoverflow.com/questions/27921391/make-a-field-invisible-or-readonly-dynamically-in-odoo-websites-not-in-form-v (https://stackoverflow.com/questions/27921391/make-a-field-invisible-or-readonly-dynamically-in-odoo-websites-not-in-form-v)
&
https://www.odoo.com/forum/help-1/question/how-to-make-a-field-invisible-only-on-create-88936 (https://www.odoo.com/forum/help-1/question/how-to-make-a-field-invisible-only-on-create-88936)

Seems hard to coded.

I will be grateful if you
Could provide code..
Title: Re: user type (user-profile)
Post by: MB Themes on January 14, 2018, 08:21:12 PM
Code: [Select]
$('#element').prop('readonly', true);
or remove osclass function and replace it with HTML that is generated by it
Title: Re: user type (user-profile)
Post by: Anonymous on January 15, 2018, 07:44:40 AM
not working.

also removed from osclass core file, nothings seems to work

please take a look, same issue persist
Title: Re: user type (user-profile)
Post by: MB Themes on January 15, 2018, 08:57:46 AM
It's not issue, but your requirement. Contact plugin owner.
Title: Re: user type (user-profile)
Post by: atomo on November 09, 2018, 01:18:43 AM
@Anonymous

Why don't you just create a js like this in user profile page (NOT on registration):

  <script type="text/javascript">
   $(document).ready(function(){
      $("#b_company").attr('disabled', true);
   });
  </script>

Function still exists, user profile shows the type, but user can't change it (user type only can be changed by admin).