if ($ret > 0) { $ret = $object->fetch_thirdparty(); } if ($ret < 0) { dol_print_error('', $object->error); } } $permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php /* * Actions */ include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $result = $object->setValid($user); if ($result >= 0) { // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'alpha')) { $newlang = GETPOST('lang_id', 'alpha'); } if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { $newlang = $object->client->default_lang; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
* Actions */ if ($action != 'create' && $action != 'add' && $action != 'classifybilled' && ! ($_REQUEST["id"] > 0) && empty($_REQUEST["ref"])) { Header("Location: index.php"); exit; } if ($action == 'confirm_validate' && $_REQUEST['confirm'] == 'yes') { $object = new Fichinter($db); $object->fetch($id); $object->fetch_thirdparty(); $result = $object->setValid($user, $conf->fichinter->outputdir); if ($result >= 0) { // Define output language $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } $result=fichinter_create($db, $object, $_REQUEST['model'], $outputlangs); Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit;
/** * testFichinterValid * * @param Fichinter $localobject Intervention * @return int * * @depends testFichinterFetch * The depends says test is run only if previous is ok */ public function testFichinterValid($localobject) { global $conf, $user, $langs, $db; $conf = $this->savconf; $user = $this->savuser; $langs = $this->savlangs; $db = $this->savdb; $result = $localobject->setValid($user); print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n"; $this->assertLessThan($result, 0); return $localobject; }