user profile page in service portal

RudhraKAM
Tera Guru

Hello We have the cloned version of the user profile widget in portal and we want to remove the mobile phone from the displaying on the page can some one help me with that ? and make business phone readonly

find_real_file.png

 

below is the html code for that widget

<div>
  <div ng-if="data.userExists">
    <div class="wrapper-md">
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-12 col-sm-4 text-center">
            <div class="row">
              <div class="avatar-extra-large avatar-container" style="cursor:default;">
                <div class="avatar soloAvatar bottom">
                  <div class="sub-avatar mia" ng-style="avatarPicture"><i class="fa fa-user"></i></div>
                </div>
              </div>
            </div>
    
            <div class="row">
              <button ng-if="::connectEnabled()" ng-click="openConnectConversation()" type="button"
                      class="button send-message"><span class="glyphicon glyphicon-comment pad-right"></span>${Message}</button>
              <!-- file upload -->
              <span ng-if="::data.isLoggedInUsersProfile">
                <input ng-show="false" type="file" ng-file-select="attachFiles({files: $files})" />
                <button ng-click="uploadNewProfilePicture($event)"
                        ng-keypress="uploadNewProfilePicture($event)" type="button"
                        class="btn btn-default send-message">${Upload Picture}</button>
              </span>
            </div>
          </div>
          <div class="col-xs-12 col-sm-8">
            <h2>{{data.name}}</h2>
            <h4 ng-if="::(displayField('sys_user', 'title', true) || displayField('sys_user', 'company', true))">
              <sp-editable-field ng-if="::displayField('sys_user', 'title', true)" editable-by-user="false" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.title" on-change="titleOnChange" on-submit="titleOnSubmit"></sp-editable-field>
           <!--   
//commented as we dont need these fields              
<span ng-if="::(displayField('sys_user', 'company', true) && displayField('sys_user', 'title', true))">at</span>
              <span ng-if="::(displayField('sys_user', 'company', true) && !displayField('sys_user', 'title', true))">Works at</span>
               <sp-editable-field ng-if="::displayField('sys_user', 'company', true)" editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.company"></sp-editable-field>
            -->
            </h4>
            <p ng-if="::displayField('sys_user', 'department', true)"><strong class="pad-right">${Department}</strong><sp-editable-field editable-by-user="false" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.department"></sp-editable-field></p>
            <p ng-if="::displayField('sys_user', 'location', true)"><strong class="pad-right">${Location}</strong><sp-editable-field editable-by-user="false" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.location"></sp-editable-field></p>
            <p ng-if="::(data.liveProfileID && displayField('live_profile', 'short_description', true))"><strong class="pad-right">${Bio}</strong><sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="live_profile" table-id="data.liveProfileID" field-model="data.liveProfileModel.short_description"></sp-editable-field></p>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div ng-class="{'col-md-6': teamExists(), 'col-md-12': !teamExists()}" class="col-sm-12 col-xs-12">
        <div class="panel panel-primary b" ng-if="getSysUserModelFields().length > 0">
          <div class="panel-heading">
            <h4 class="panel-title">
                        
              <i class="fa fa-info-circle m-r-sm"></i>${About}
            </h4>
          </div>
          <div class="padder-xs">
            <div class="list-group">
              <div ng-repeat="fieldModel in getSysUserModelFields()">
                <div class="list-group-item">
                  <div>
     
                    <strong class="pad-right">{{ fieldModel.label }}</strong><br />
<span ng-if="fieldModel.name == 'email'"><sp-editable-field block="false" table="sys_user" editable-by-user="false" table-id="data.sysUserID" field-model="fieldModel"></sp-editable-field></span>
<span ng-if="fieldModel.name != 'email'"><sp-editable-field block="false" table="sys_user" editable-by-user="data.isLoggedInUsersProfile" table-id="data.sysUserID" field-model="fieldModel"></sp-editable-field></span>
                  </div>
                </div>
              </div>
              
            </div>
          </div>
        </div>
      </div>
      <div ng-if="teamExists()" class="col-md-6 col-sm-12 col-xs-12">
        <sp-widget widget="data.teamWidget"></sp-widget>
      </div>
    </div>
    
    
    
    
    <div class="row" ng-if="data.preferencesEnabled.preferencesPanelEnabled">
      <div class="col-sm-12 col-xs-12">
        <div class="panel panel-primary b">
          <div class="panel-heading">
            <h4 class="panel-title">
              <i class="fa fa-cog m-r-sm"></i>${User preferences}
            </h4>
          </div>
          <div class="padder-xs">
             <div class="list-group">
               <div class="list-group-item">
                <label for="accessibility-enabled">${Accessibility enabled} </label>
                <div class="input-switch">
                   <input type="checkbox"
                          ng-change="setUserPreferenceValue(data.userPreferences.accessibility)"
                          ng-model="data.userPreferences.accessibility.value"
                          name="accessibility-enabled" id="accessibility-enabled"  />
                   <label class="switch" for="accessibility-enabled" tabindex="0" ng-click="toggle($event, data.userPreferences.accessibility)"></label>
                 </div>
              </div>
               <div class="list-group-item" ng-if="data.preferencesEnabled.timezoneEnabled">
                <label for="time_zone">${Time zone}</label>
                <select id="time_zone_picker_select" class="form-control "
                          name="time_zone_picker_select" ng-model="data.listProperties.timezone.current"
                          ng-change="setPreferenceValue('timezone', data.listProperties.timezone.current.value)"
                          ng-options="item as item.label for item in data.listProperties.timezone.list"/>
              </div>
             	<div class="list-group-item" ng-if="data.preferencesEnabled.languageEnabled">
                <label for="time_zone">${Language}</label>
                <select id="time_zone_picker_select" class="form-control"
                          name="time_zone_picker_select" ng-model="data.listProperties.language.current"
                          ng-change="setPreferenceValue('language', data.listProperties.language.current.value)"
                          ng-options="item as item.label for item in data.listProperties.language.list "/>
              </div>
        	</div>
        </div>
        <div class="panel-footer clearfix" ng-if="data.userPreferencesChanged">
          <a id="refresh-to-see-changes" href="javascript:void(0)"
             ng-click="reloadPage()" class="pull-right btn btn-primary"><i class="fa fa-refresh m-r-sm" aria-hidden="true"></i>${Refresh to see changes}</a>
        </div>
    </div>
  </div>
  <div ng-if="!data.userExists" >
    <div class="panel panel-default">
      <div class="panel-heading"><h4 class="panel-title">${User not found}</h4></div>
      <div class="panel-body wrapper">
        <p>${This user does not exist}</p>
        <p>${Suggestions}:</p>
        <ul>
          <li>${Contact your portal administrator}</li>
        </ul>
      </div>
    </div>
  </div>
</div>
1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

For this you don't actually need to do anything in the widget.

It's actually a view you can alter on the sys_user profile page in the back_end

find_real_file.png

Once you remove the Mobile phone here as a field that's viewable, refresh your profile page on the portal and you'll see that gone.

As far as making it read-only, this is controlled with a "write" ACL on the sys_user table for that field. So either look and see if there is one that exists and if so, change the conditions or use a script OR, create a write ACL for that table and field and set the conditions as you see fit.

Please mark reply as Helpful/Correct. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

For this you don't actually need to do anything in the widget.

It's actually a view you can alter on the sys_user profile page in the back_end

find_real_file.png

Once you remove the Mobile phone here as a field that's viewable, refresh your profile page on the portal and you'll see that gone.

As far as making it read-only, this is controlled with a "write" ACL on the sys_user table for that field. So either look and see if there is one that exists and if so, change the conditions or use a script OR, create a write ACL for that table and field and set the conditions as you see fit.

Please mark reply as Helpful/Correct. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

This does not work, Service Portal view is nowhere to be found.  Please advise

Hey

I did the same process as you mentioned. But I want to hide User ID from profile which is just below of mobile number. I have removed it as per the steps you mentioned but still I am able to see User ID on HR profile.

 

Can you please suggest me about this?

Thanks in Advance!