public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 public function regraPend($id_doc, $id_doc_pend_tipo)
 {
     $DocShow = knl_lib_doc_DocShow::getInstance();
     $doc = $DocShow->getDocumento($id_doc);
     $DocRegraPend = knl_dao_doc_sub_tipo_regra_pend::getInstance();
     $mDocRegraPend = $DocRegraPend->selectBySubTipoPendTipo($doc->get_id_doc_sub_tipo(), $id_doc_pend_tipo);
     foreach ($mDocRegraPend as $rp) {
         $newmRegraPend = new knl_model_doc_pendencia(0, $id_doc, $rp->get_id_knl_usuario(), $rp->get_id_knl_grupo(), $rp->get_id_doc_pendencia_tipo2(), 'S');
         $newRegraPend = knl_dao_doc_pendencia::getInstance()->upsert($newmRegraPend);
         //echo $rp->get_id()."\n";
     }
 }
Example #3
0
 public function add()
 {
     $request = knl_lib_Registry::getRequestObj()->getInstance();
     $arr_grupos = $request->getPost("grupos");
     $doc_pend_tp = $request->getPost("pendtipo");
     $doc_pend_tp2 = $request->getPost("pendtipo2");
     $doc_sub_tp = $request->getPost("docsubtipo");
     /*
     $id,$id_doc_pendencia_tipo,$id_doc_pendencia_tipo2,
     $id_doc_sub_tipo,$id_knl_usuario,$id_knl_grupo
     */
     $mRegraPend = new knl_model_doc_sub_tipo_regra_pend(0, $doc_pend_tp, $doc_pend_tp2, $doc_sub_tp, 0, 0);
     $dRegraPend = knl_dao_doc_sub_tipo_regra_pend::getInstance();
     if (!empty($arr_grupos)) {
         foreach ($arr_grupos as $v) {
             $mRegraPend->set_id(0);
             $mRegraPend->set_id_knl_grupo($v);
             $dRegraPend->upsert($mRegraPend);
         }
     }
     echo "add em domain RegraPend";
 }
Example #4
0
 private function createDocExtension($conf)
 {
     $m_doc_tipo = new knl_model_doc_tipo(0, $conf['doc_tipo'], $conf['extension'], "0");
     knl_dao_doc_tipo::getInstance()->upsert($m_doc_tipo);
     $m_doc_tipo_cred = new knl_model_doc_tipo_cred(0, $m_doc_tipo->get_id(), 1, 3, 1, 1, 0);
     knl_dao_doc_tipo_cred::getInstance()->upsert($m_doc_tipo_cred);
     $m_doc_tipo_cred = new knl_model_doc_tipo_cred(0, $m_doc_tipo->get_id(), 0, 2, 0, 1, 0);
     knl_dao_doc_tipo_cred::getInstance()->upsert($m_doc_tipo_cred);
     $m_doc_sub_tipo = new knl_model_doc_sub_tipo(0, $m_doc_tipo->get_id(), $conf['doc_sub_tipo'], '', $conf['doc_sub_tipo_path']);
     knl_dao_doc_sub_tipo::getInstance()->upsert($m_doc_sub_tipo);
     $m_doc_sub_tipo_regra_cred = new knl_model_doc_sub_tipo_regra_cred(0, 'A', -1, 1, 3, $m_doc_sub_tipo->get_id(), 511, 119, 0);
     knl_dao_doc_sub_tipo_regra_cred::getInstance()->upsert($m_doc_sub_tipo_regra_cred);
     $m_doc_sub_tipo_regra_cred = new knl_model_doc_sub_tipo_regra_cred(0, 'A', -1, 0, 2, $m_doc_sub_tipo->get_id(), 0, 287, 0);
     knl_dao_doc_sub_tipo_regra_cred::getInstance()->upsert($m_doc_sub_tipo_regra_cred);
     $m_doc_sub_tipo_regra_cred = new knl_model_doc_sub_tipo_regra_cred(0, 'A', 4, 0, 2, $m_doc_sub_tipo->get_id(), 0, 224, 0);
     knl_dao_doc_sub_tipo_regra_cred::getInstance()->upsert($m_doc_sub_tipo_regra_cred);
     $m_doc_sub_tipo_regra_cred = new knl_model_doc_sub_tipo_regra_cred(0, 'R', 4, 0, 2, $m_doc_sub_tipo->get_id(), 0, 8, 0);
     knl_dao_doc_sub_tipo_regra_cred::getInstance()->upsert($m_doc_sub_tipo_regra_cred);
     $m_doc_sub_tipo_regra_pend = new knl_model_doc_sub_tipo_regra_pend(0, -1, 4, $m_doc_sub_tipo->get_id(), 0, 2);
     knl_dao_doc_sub_tipo_regra_pend::getInstance()->upsert($m_doc_sub_tipo_regra_pend);
     $m_doc_sub_tipo_regra_pend = new knl_model_doc_sub_tipo_regra_pend(0, 4, 5, $m_doc_sub_tipo->get_id(), 0, 2);
     knl_dao_doc_sub_tipo_regra_pend::getInstance()->upsert($m_doc_sub_tipo_regra_pend);
     $m_doc_sub_tipo_regra_pend = new knl_model_doc_sub_tipo_regra_pend(0, 4, 1, $m_doc_sub_tipo->get_id(), 0, 2);
     knl_dao_doc_sub_tipo_regra_pend::getInstance()->upsert($m_doc_sub_tipo_regra_pend);
 }