AnsweredAssumed Answered

How can I hide buttons on detail view?

Question asked by SpockPT SpockPT on Apr 1, 2014
Latest reply on Apr 1, 2014 by Francesca Shiekh
Hi...
Normally i hide buttons on detail with the code (on view.detail.php):

function display(){
        $focus = $this->bean;
        if ($focus->won=='1') {
            unset($this->dv->defs['templateMeta']['form']['buttons'][0]);
            unset($this->dv->defs['templateMeta']['form']['buttons'][1]);
            unset($this->dv->defs['templateMeta']['form']['buttons'][2]);
            unset($this->dv->defs['templateMeta']['form']['buttons'][3]);       //
        } else {
        }
parent::display();
}

 the problem is that this code doens't work without developer mode on.

The other way i know (and it works for developer mode) is:

0 =>           
  array (
      'customCode' => '<input type="hidden" name="isSaveAndNew" value="false">  <input type="hidden" name="status" value="">  <input type="hidden" name="isSaveFromDetailView" value="true">  <input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"   class="button"  onclick="this.form.status.value=
and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
Heldand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
; this.form.action.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
Saveand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
;this.form.return_module.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
Meetingsand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
;this.form.isDuplicate.value=true;this.form.isSaveAndNew.value=true;this.form.return_action.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
EditViewand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
; this.form.isDuplicate.value=true;this.form.return_id.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
{$fields.id.value}and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
;" id="close_create_button" name="button"  value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}"  type="submit">',
      'sugar_html' => array (
              'type' => 'submit',
              'value' => '{$APP.LBL_EDIT_BUTTON_LABEL}',
              'htmlOptions' => 
              array (
                'title' => '{$APP.LBL_EDIT_BUTTON_TITLE}',
                'accessKey' => '{$APP.LBL_EDIT_BUTTON_KEY}',
                'class' => 'button',
                'onclick' => 'this.form.return_module.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
{$module}and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
; this.form.return_action.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
DetailViewand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
; this.form.return_id.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
{$id}and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
; this.form.action.value=and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
EditViewand on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock
;',
                'id' => 'edit_button',
                'name' => 'Edit',
              ),
              'template' => '{if $DISPLAY_EDIT}[CONTENT]{/if}',
            ),
          ),and on view.detail.php:

$focus = $this->bean;
if ($focus->won=='1') {
            $this->ss->assign('DISPLAY_EDIT', true);
}
        
The problem is that i'm not being able to define a delete button also... how can i do a delete button on that way?

Thank you in advance,

Spock

Outcomes