Exemple #1
0
 /**
  * @see parent::check()
  */
 function check()
 {
     if ($msg = parent::check()) {
         return $msg;
     }
     $this->completeField("tag_id", "object_class");
     if ($this->loadRefTag()->object_class !== $this->object_class) {
         return "L'objet et le tag doivent appartenir à la même classe";
     }
     return null;
 }
 /**
  * @see parent::check()
  */
 function check()
 {
     $this->completeField("debut", "fin");
     if ($this->debut == null || $this->fin == null) {
         return parent::check();
     }
     $siblings = $this->getSiblings();
     if (count($siblings)) {
         foreach ($siblings as $_sibling) {
             if ($_sibling->debut == null || $_sibling->fin == null) {
                 continue;
             }
             if (CMbRange::collides($this->debut, $this->fin, $_sibling->debut, $_sibling->fin) || CMbRange::inside($this->debut, $this->fin, $_sibling->debut, $_sibling->fin) || CMbRange::inside($_sibling->debut, $_sibling->fin, $this->debut, $this->fin)) {
                 return "Collision de personnel !";
             }
         }
     }
     return parent::check();
 }
 /**
  * @see parent::check()
  */
 function check()
 {
     if ($msg = parent::check()) {
         return $msg;
     }
     $this->completeField("montant");
     if (!$this->montant) {
         return 'Le montant du règlement ne doit pas être nul';
     }
     $this->loadRefsFwd();
     return null;
 }