Example #1
0
 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_extensioned = $this->file_name;
     $last_point = strrpos($this->_extensioned, '.');
     $this->_no_extension = substr($this->_extensioned, 0, $last_point);
     $this->completeField("object_id");
     // Computes complete file path
     if ($this->object_id) {
         $this->completeField("file_real_filename");
         $this->_sub_dir = "{$this->object_class}/" . intval($this->object_id / 1000);
         $this->_absolute_dir = self::$directory . "/{$this->_sub_dir}/{$this->object_id}";
         $this->_file_path = "{$this->_absolute_dir}/{$this->file_real_filename}";
     }
     $this->_shortview = $this->_view = str_replace("_", " ", $this->file_name);
     $this->guessFileType();
 }
 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_extensioned = "{$this->nom}.htm";
     $this->_view = $this->object_id ? "" : "Modèle : ";
     $this->_view .= $this->nom;
     if ($this->object_id) {
         $modele = $this->loadModele();
         if ($modele->_id && $modele->purgeable) {
             $this->_view = "[temp] " . $this->_view;
         }
     }
     if ($this->object_id && $this->fields_missing) {
         $this->_view = " [" . $this->fields_missing . "] {$this->_view}";
     }
     if ($this->user_id) {
         $this->_owner = "prat";
     }
     if ($this->function_id) {
         $this->_owner = "func";
     }
     if ($this->group_id) {
         $this->_owner = "etab";
     }
     $this->_page_format = "";
     foreach (CCompteRendu::$_page_formats as $_key => $_format) {
         if ($_format[0] == $this->page_width && $_format[1] == $this->page_height || $_format[1] == $this->page_width && $_format[0] == $this->page_height) {
             $this->_page_format = $_key;
             break;
         }
     }
     // Formatage de la page
     if (!$this->_page_format) {
         $page_width = round(72 / 2.54 * $this->page_width, 2);
         $page_height = round(72 / 2.54 * $this->page_height, 2);
         $this->_page_format = array(0, 0, $page_width, $page_height);
     }
     $this->_orientation = "portrait";
     if ($this->page_width > $this->page_height) {
         $this->_orientation = "landscape";
     }
     // Le champ valide stocke le user_id de la personne qui l'a verrouillé
     if ($this->_id && $this->valide && !$this->locker_id) {
         $log = $this->loadLastLogForField("valide");
         $this->locker_id = $log->user_id;
     }
 }