print $langs->trans($tmp); } else { print $tmp; } print '</td>' . "\n"; print '<td align="center">'; if ($conf->global->CONTRACT_ADDON == "{$file}") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmod&value=' . $file . '">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print '</a>'; } print '</td>'; $contract = new Contrat($db); $contract->initAsSpecimen(); // Info $htmltooltip = ''; $htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>'; $nextval = $module->getNextValue($mysoc, $contract); if ("{$nextval}" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip .= '' . $langs->trans("NextValue") . ': '; if ($nextval) { if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { $nextval = $langs->trans($nextval); } $htmltooltip .= $nextval . '<br>'; } else { $htmltooltip .= $langs->trans($module->error) . '<br>'; }
/** * testContratCreate * * @return int */ public function testContratCreate() { global $conf, $user, $langs, $db; $conf = $this->savconf; $user = $this->savuser; $langs = $this->savlangs; $db = $this->savdb; $localobject = new Contrat($this->savdb); $localobject->initAsSpecimen(); $result = $localobject->create($user); print __METHOD__ . " result=" . $result . "\n"; $this->assertLessThan($result, 0); return $result; }