Results 1 to 10 of 10

Thread: Hide Mass Update (Sugar5)

  1. #1
    wkamdem is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    29

    Default Hide Mass Update (Sugar5)

    Hello Evrybody,

    How can i hide the Mass Update-Segment in the Module Meetings (ListView).??? I currently use Sugar Version 5...

    Thanks for your answers!!

    William From Germany :-)

  2. #2
    wkamdem is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    29

    Default Re: Hide Mass Update (Sugar5)

    HI kuske,

    Thank for ur answer, am gonna try it...

    best regards

  3. #3
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Hide Mass Update (Sugar5)

    Very simple to do:

    In module /include/MassUpdate.php in function getMassUpdateForm add a return statement at the beginning of the function:

    Code:
    	function getMassUpdateForm(){
    		global $app_strings;
    		global $current_user;
    
    //KUS PATCH      
    return 'Mass Update not allowed in this company!';
    //KUS PATCH      
    
    		if($this->sugarbean->bean_implements('ACL') && !ACLController::checkAccess($this->sugarbean->module_dir, 'edit', true)){
    			return '';
    		}
    Gruß von ebendort !

  4. #4
    wkamdem is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    29

    Default Re: Hide Mass Update (Sugar5)

    HI kuske,

    do u know how can i hide the add Envitee-Segment of the module Meetings (EditView), Only the Add Envitees-Segment, the Segment Scheduling have to be displayed....

    It's gonna be better to do it inside a php-File... I've already look inside the JS-File modules/Meetings/jsclass_scheduler.js... But i can get what i want....

    Mit freundlichen Grüßen

    William aus München

  5. #5
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Hide Mass Update (Sugar5)

    The "Add Invitees" form is generated in
    modules/Meetings/jsclass_scheduler.js

    (the original file is located in jssource/src/files/modules/meetings/jsclass_scheduler.js)

    You can comment the line where the output div is written:

    Code:
    SugarWidgetSchedulerSearch.prototype.display = function() {
    	var html ='<br/><h5 class="listViewSubHeadS1">'+GLOBAL_REGISTRY['meeting_strings']['LBL_ADD_INVITEE']+'</h5><table border="0" cellpadding="0" cellspacing="0" width="100%" class="tabForm">';
    	html +='<tr><td>';
    	html += '<form name="schedulerwidget" id="'+this.form_id+'" onsubmit="SugarWidgetSchedulerSearch.submit(this);return false;">';
    
    	html += '<table width="100%" cellpadding="0" cellspacing="0" width="100%" >'
    	html += '<tr>';
    	//html += '<form id="'+this.form_id+'"><table width="100%"><tbody><tr>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_FIRST_NAME']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_first_name" value="" type="text" size="10"></td>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_LAST_NAME']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_last_name" value="" type="text" size="10"></td>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_EMAIL']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_email" type="text" value="" size="15"></td>';
    	//html += '<td valign="center"><input type="submit" onclick="SugarWidgetSchedulerSearch.submit(this.form);" value="Search" ></td></tr></tbody></table></form>';
    	html += '<td valign="center"><input type="submit" class="button" value="'+GLOBAL_REGISTRY['meeting_strings']['LBL_SEARCH_BUTTON']+'" ></td></tr>';
    	html += '</table>';
    	html += '</form>';
    	html += '</td></tr></table>';
    
    	// append the list_view as the third row of the outside table
    //KUS PATCH	
    //	this.parentNode.innerHTML= html;
    //KUS PATCH
    There is no php-PATCH as I know.

    Greetings from Darmstadt

  6. #6
    wkamdem is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    29

    Default Re: Hide Mass Update (Sugar5)

    Hi Kuske,

    Thank u for ur answer, it's work... i wanted to do it inside a php-File because, i just wanna hide this Segement for the users without admin rights...

    I dont know if it's possible from the JS-File if a user an admin is or not... For example with PHP
    PHP Code:
    global $current_user;
     if (
    $current_user->is_admin) {
        
    // do  something

    Danke

    William

  7. #7
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Hide Mass Update (Sugar5)

    OK, to get information about the current user in JavaScript you can use the GLOBAL_REGISTRY var.

    Just change your code like this:

    Code:
    SugarWidgetSchedulerSearch.prototype.display = function() {
    	var html ='<br/><h5 class="listViewSubHeadS1">'+GLOBAL_REGISTRY['meeting_strings']['LBL_ADD_INVITEE']+'</h5><table border="0" cellpadding="0" cellspacing="0" width="100%" class="tabForm">';
    	html +='<tr><td>';
    	html += '<form name="schedulerwidget" id="'+this.form_id+'" onsubmit="SugarWidgetSchedulerSearch.submit(this);return false;">';
    
    	html += '<table width="100%" cellpadding="0" cellspacing="0" width="100%" >'
    	html += '<tr>';
    	//html += '<form id="'+this.form_id+'"><table width="100%"><tbody><tr>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_FIRST_NAME']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_first_name" value="" type="text" size="10"></td>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_LAST_NAME']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_last_name" value="" type="text" size="10"></td>';
    	html += '<td class="dataLabel" nowrap><b>'+GLOBAL_REGISTRY['meeting_strings']['LBL_EMAIL']+':</b>&nbsp;&nbsp;<input class="dataField" name="search_email" type="text" value="" size="15"></td>';
    	//html += '<td valign="center"><input type="submit" onclick="SugarWidgetSchedulerSearch.submit(this.form);" value="Search" ></td></tr></tbody></table></form>';
    	html += '<td valign="center"><input type="submit" class="button" value="'+GLOBAL_REGISTRY['meeting_strings']['LBL_SEARCH_BUTTON']+'" ></td></tr>';
    	html += '</table>';
    	html += '</form>';
    	html += '</td></tr></table>';
    
    	// append the list_view as the third row of the outside table
    //KUS PATCH	
            if ((GLOBAL_REGISTRY.current_user.fields.user_name == "admin")  ||
                (GLOBAL_REGISTRY.current_user.fields.user_name == "admin2") ||
                (GLOBAL_REGISTRY.current_user.fields.user_name == "admin3") )
            this.parentNode.innerHTML= html;
    //KUS PATCH
    You do not have direct access to the property "isAdmin" but you can list all allowed admin accounts, as I indicated by the three admin user names "admin", "admin2" and "admin3".

    Viel Spaß
    H.Kuske

  8. #8
    wkamdem is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    29

    Default Re: Hide Mass Update (Sugar5)

    Hi Kuske,

    Danke für deine Hilfe, woher weiss du das alles???

    ich arbeite mit Sugar nur seit ein paar Monaten, hast du bei Sugar gearbeitet???

    William

  9. #9
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hide Mass Update (Sugar5)

    Hi, all.

    Make sure to don't override the core scripts.

    It is possible to do that in a upgrade safe way, creating a view.list.php into custom/modules/Meetings/views/

    You just have to override the attribute in listview object massupdate to false.

    It will ignore the MassUpdate to the listview in Meetings.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    SugarCRM Silver Partner
    USA: +1 908 998-2278
    BR: +55 11 3237-3110
    www.lampadaglobal.com
    email: info@lampadaglobal.com

    Lampada Global Services delivers enterprise software and offshore programming services to customers around the world.

  10. #10
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Hide Mass Update (Sugar5)

    Quote Originally Posted by wkamdem
    Hi Kuske,

    Danke für deine Hilfe, woher weiss du das alles???

    ich arbeite mit Sugar nur seit ein paar Monaten, hast du bei Sugar gearbeitet???

    William
    Nein, ich habe nie bei Suagr gearbeitet, ich bin nur ein einfacher Sugar Anwender, der im Oktober sein SalesForce komplett auf Sugar OS umgestellt hat.Gut ich gebe zu, 120 user sind eine Herausforderung.
    Da ich einige Änderungen an der Standardinstallation vornehmen musste, habe ich mir den Code genauer anschauen müssen. Zum Glück ist SugarCRM ja meistens sehr sauber programmiert (wenn man mal den Email Modul einfach mal nicht beachtet).

    Wichtig für die Arbeit ist ein gutes CM-System mit dem man alle Änderungen visuell und vertändlich anschauen kann, ich benutze da MS Visual Source Safe und ein gute Editor mit suchmöglichkeiten auf der Platte, ich benutze da schon seit Jahren Textpad.

    Eine große Herausforderung war auch der Umstieg von 4.5.1 auf 5.0.0, weil hierbei das Konzept der Masken komplett überarbeitet wurde. Im Mai werde ich dann wohl - wie vorhergesehen - auf die 5.0.0e migrieren.

    Viel Spaß noch mit Sugar
    Harald Kuske

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unable to Hide 'Mass Update' panel
    By HomeTeam in forum General Discussion
    Replies: 13
    Last Post: 2009-04-26, 03:55 AM
  2. Replies: 1
    Last Post: 2007-10-12, 06:49 PM
  3. Replies: 0
    Last Post: 2007-06-16, 02:20 PM
  4. Mass Update won't work!
    By rsantiago in forum Help
    Replies: 6
    Last Post: 2006-08-18, 02:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •