Forum

Add field mandatory...
 
Notifications
Retirer tout

Add field mandatory on class Action

3 Posts
1 Utilisateurs
0 Reactions
3,864 Vu
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 
[#853]

hi,

I need to add a mandatory on my field idResultsType in class Action since description or result :

1) I have add mandatoryEfficiencyOnDone in table Type

2) I have add that in class Type :

public $mandatoryEfficiencyOnDone;
  public $_lib_mandatoryEfficiencyOnDoneStatus;
"mandatoryEfficiencyOnDone"=>"nobr",

So i see in ActionType my new field mandatory :

But now, my checkbox efficiency has no effect in my field idResultsType in Action

After, i have add that in SqlElement.php but it changes nothing :

if (property_exists($objType, 'mandatoryEfficiencyOnDone') and $objType->mandatoryEfficiencyOnDone 
      and property_exists($this, 'idResultsType')
      and property_exists($this, 'done')) {
        if ($this->done and ! $this->idResultsType) {
          $result.='
' . i18n('messageMandatory',array($this->getColCaption('idResultsType'))); } }

Thx


 
Posté : 10 Déc PM 15:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

The problem is in this condition :

if ($this->done and ! $this->idResultsType) 

Because i think i copy that :

if ($this->done and ! $this->result)

And i have just change $this->result


 
Posté : 10 Déc PM 15:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

Okay i found, should be added 'trim()':

if ($this->done and ! trim($this->idResultsType))

It works !


 
Posté : 10 Déc PM 15:1212
Share:
Retour en haut