return $ok;
}
- // rend vrai si la donnee d'oid $koid existe dans la langue specifiee
- // $xx est la connection bd s'il en existe une a utiliser
- //
+ /** rend vrai si la donnee d'oid $koid existe dans la langue specifiee
+ $xx est la connection bd s'il en existe une a utiliser
+ */
static function objectExists($koid, $klang='%') {
$table = Kernel::getTable($koid);
if (empty($table)) return false;
return selectQueryExists($requete);
}
- // rend vrai si la donnee d'oid $koid existe dans la langue specifiee
- //
+ /// rend vrai si la donnee d'oid $koid existe dans la langue specifiee
static function objectExists2($koid, $klang='%') {
$table = Kernel::getTable($koid);
if (empty($table)) return false;
$p=new XParam($ar,array());
$doid=$p->get('doid');
$auth=$this->getTypes($doid);
+ $noworkflow=$p->get('_noworkflow');
if(empty($auth)){
XLogs::critical('security',"access type denied |".get_class($this)."|procInput|".$this->_moid."|TYPE ".$doid.
"| user ".XUser::get_current_user_uid());
$this->registerDoc($oidres, $doid);
$docparent = &XDocumentDT::objectFactory($parentoid, $this);
$docparent->addChild($oidres);
+ if(XModule::getMoid(XMODWORKFLOW_TOID) && empty($noworkflow)) {
+ $umod=XModule::singletonFactory(XMODWORKFLOW_TOID);
+ $umod->checkAndRun($this, $mod, $oidres, 'new');
+ }
// creation des fils par clone du modele
if (!empty($d1['opattern']->raw)){
$p=new XParam($ar,array('onlyssm'=>false,'ssmnottodel'=>array()));
$nolog=$p->get('_nolog','local');
$onlyssm=$p->get('onlyssm');
+ $noworkflow=$p->get('_noworkflow');
$ssmnottodel=$p->get('ssmnottodel');
$ar['table']=$this->table;
$ar['action']='OK';
function procInsert($ar) {
$p=new XParam($ar,array('_applyrules'=>true));
$tplentry=$p->get('tplentry');
+ $noworkflow=$p->get('_noworkflow');
$applyrules=$p->get('_applyrules');
if($this->procInsertCtrl($ar)) {
$ar['table']=$this->table;
if($submodcontext) $ar['fieldssec'][$submodcontext['_linkedfield']]='rw';
if(!$p->is_set('PUBLISH')) $ar['PUBLISH']=($this->defaultispublished?1:2);
$r=$this->xset->procInput($ar);
+ if(empty($noworkflow) && XModule::getMoid(XMODWORKFLOW_TOID)) {
+ $umod=XModule::singletonFactory(XMODWORKFLOW_TOID);
+ $umod->checkAndRun($this, $this, $r['oid'], 'new');
+ }
if($applyrules) {
XModRule::applyRules($this,$r['oid']);
- if(XModule::getMoid(XMODWORKFLOW_TOID)) {
- $umod=XModule::singletonFactory(XMODWORKFLOW_TOID);
- $umod->checkAndRun($this, $this, $r['oid'], 'new');
- }
}
if($this->object_sec && $this->owner_sec)
$GLOBALS['XUSER']->setUserAccess(get_class($this),$this->_moid,XShell::getLangData(),$r['oid'],'admin');
/// verifie si un workflow s'applique, et si oui cree un cas
public function checkAndRun(XModule $mod, $interface, $oid, $event) {
+ if(!Kernel::objectExists($oid)) return;
+
// affichage de l'objet
$display=$interface->XMCdisplay(array('oid'=>$oid, 'tplentry'=>TZR_RETURN_DATA));
// recherche des workflow qui s'appliquent
$wfs=selectQueryGetAll('SELECT distinct KOID FROM WFWORKFLOW WHERE (modid= "'.$mod->_moid.
- '" OR modid like "%'.$mod->_moid.'%") AND trig like "'.$event.'%"');
+ '" OR modid like "%'.$mod->_moid.'%") AND trig like "%'.$event.'%"');
foreach($wfs as $wf) {
$wfd=$this->xset->rDisplay($wf['KOID']);
// verification qu'on est dans les groupes qui permettent le lancement