Beispiel #1
0
<?php

/**
 * $Id: vw_procencours.php 19316 2013-05-28 09:33:17Z rhum1 $
 *
 * @package    Mediboard
 * @subpackage Qualite
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19316 $
 */
CCanDo::checkEdit();
$user = CUser::get();
$doc_ged_id = CValue::getOrSession("doc_ged_id", 0);
$docGed = new CDocGed();
if (!$docGed->load($doc_ged_id) || $docGed->etat == 0) {
    // Ce document n'est pas valide
    $doc_ged_id = null;
    CValue::setSession("doc_ged_id");
    $docGed = new CDocGed();
} else {
    $docGed->loadLastActif();
    $docGed->loadRefs();
}
$docGed->loadLastEntry();
$docGed->_lastentry->loadFile();
if ($docGed->etat == CDocGed::TERMINE) {
    $docGed->_lastentry = new CDocGedSuivi();
    $docGed->_lastentry->date = CMbDT::dateTime();
}
//Procédure Terminé et/ou Refusé
Beispiel #2
0
 * $Id: vw_procedures.php 19316 2013-05-28 09:33:17Z rhum1 $
 *
 * @package    Mediboard
 * @subpackage Qualite
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19316 $
 */
CCanDo::checkRead();
$doc_ged_id = CValue::getOrSession("doc_ged_id");
$theme_id = CValue::getOrSession("theme_id");
$chapitre_id = CValue::getOrSession("chapitre_id");
$sort_by = CValue::getOrSession("sort_by", "date");
$sort_way = CValue::getOrSession("sort_way", "DESC");
$docGed = new CDocGed();
if (!$docGed->load($doc_ged_id)) {
    // Ce document n'est pas valide
    $doc_ged_id = null;
    CValue::setSession("doc_ged_id");
    $docGed = new CDocGed();
} else {
    $docGed->loadLastActif();
    if (!$docGed->_lastactif->doc_ged_suivi_id || $docGed->annule) {
        // Ce document n'est pas Terminé ou est suspendu
        $doc_ged_id = null;
        CValue::setSession("doc_ged_id");
        $docGed = new CDocGed();
    } else {
        $docGed->_lastactif->loadFile();
        $docGed->loadRefs();
    }
 /**
  * @see parent::check()
  */
 function check()
 {
     if ($this->_id) {
         $oldObj = new CDocGed();
         $oldObj->load($this->_id);
         if ($this->group_id === null) {
             $this->group_id = $oldObj->group_id;
         }
         if ($this->doc_chapitre_id === null) {
             $this->doc_chapitre_id = $oldObj->doc_chapitre_id;
         }
         if ($this->doc_categorie_id === null) {
             $this->doc_categorie_id = $oldObj->doc_categorie_id;
         }
         if ($this->num_ref === null) {
             $this->num_ref = $oldObj->num_ref;
         }
         if ($this->annule === null) {
             $this->annule = $oldObj->annule;
         }
     }
     if ($this->annule == 1) {
         return null;
     }
     $where = array();
     if ($this->_id) {
         $where["doc_ged_id"] = "!= '" . $this->_id . "'";
     }
     $where["num_ref"] = "IS NOT NULL";
     $where["group_id"] = "= '" . $this->group_id . "'";
     $where["doc_chapitre_id"] = "= '" . $this->doc_chapitre_id . "'";
     $where["doc_categorie_id"] = "= '" . $this->doc_categorie_id . "'";
     $where["num_ref"] = "= '" . $this->num_ref . "'";
     $where["annule"] = "= '0'";
     $order = "num_ref DESC";
     $sameNumRef = new self();
     $sameNumRef->loadObject($where, $order);
     if ($sameNumRef->_id) {
         return "Un document existe déjà avec la même référence";
     }
     return null;
 }