示例#1
0
     print $langs->trans($tmp);
 } else {
     print $tmp;
 }
 print '</td>' . "\n";
 print '<td align="center">';
 if ($conf->global->EXPEDITION_ADDON_NUMBER == "{$file}") {
     print img_picto($langs->trans("Activated"), 'switch_on');
 } else {
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmodel&amp;value=' . $file . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">';
     print img_picto($langs->trans("Disabled"), 'switch_off');
     print '</a>';
 }
 print '</td>';
 $expedition = new Expedition($db);
 $expedition->initAsSpecimen();
 // Info
 $htmltooltip = '';
 $htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>';
 $nextval = $module->getNextValue($mysoc, $expedition);
 if ("{$nextval}" != $langs->trans("NotAvailable")) {
     $htmltooltip .= '' . $langs->trans("NextValue") . ': ';
     if ($nextval) {
         $htmltooltip .= $nextval . '<br>';
     } else {
         $htmltooltip .= $langs->trans($module->error) . '<br>';
     }
 }
 print '<td align="center">';
 print $form->textwithpicto('', $htmltooltip, 1, 0);
 print '</td>';
示例#2
0
    /**
     * testExpeditionBuild
     *
     * @return int
     */
    public function testExpeditionBuild()
    {
        global $conf,$user,$langs,$db;
        $conf=$this->savconf;
        $user=$this->savuser;
        $langs=$this->savlangs;
        $db=$this->savdb;

        $conf->expedition->dir_output.='/temp';
        $localobject=new Expedition($this->savdb);
        $localobject->initAsSpecimen();

        // Soleil
        $localobject->modelpdf='merou';
        $result=expedition_pdf_create($db, $localobject, $localobject->modelpdf, $langs);

        $this->assertLessThan($result, 0);
        print __METHOD__." result=".$result."\n";

        // Soleil
        $localobject->modelpdf='rouget';
        $result=expedition_pdf_create($db, $localobject, $localobject->modelpdf, $langs);

        $this->assertLessThan($result, 0);
        print __METHOD__." result=".$result."\n";

        return 0;
    }