예제 #1
0
     }
 } else {
     if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save', 'alpha') == $langs->trans("Save")) {
         $objectline = new FichinterLigne($db);
         if ($objectline->fetch($lineid) <= 0) {
             dol_print_error($db);
             exit;
         }
         if ($object->fetch($objectline->fk_fichinter) <= 0) {
             dol_print_error($db);
             exit;
         }
         $object->fetch_thirdparty();
         $desc = GETPOST('np_desc');
         $date_inter = dol_mktime(GETPOST('dihour', 'int'), GETPOST('dimin', 'int'), 0, GETPOST('dimonth', 'int'), GETPOST('diday', 'int'), GETPOST('diyear', 'int'));
         $duration = convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int'));
         $objectline->datei = $date_inter;
         $objectline->desc = $desc;
         $objectline->duration = $duration;
         // Extrafields
         $extrafieldsline = new ExtraFields($db);
         $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
         $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
         $objectline->array_options = $array_options;
         $result = $objectline->update($user);
         if ($result < 0) {
             dol_print_error($db);
             exit;
         }
         // Define output language
         $outputlangs = $langs;
예제 #2
0
    /**
     * testConvertTime2Seconds
     *
     * @return	void
     */
    public function testConvertTime2Seconds()
    {
    	global $conf,$user,$langs,$db;
		$conf=$this->savconf;
		$user=$this->savuser;
		$langs=$this->savlangs;
		$db=$this->savdb;

		$result=convertTime2Seconds(1,1,2);
    	print __METHOD__." result=".$result."\n";
		$this->assertEquals(3662,$result);

		return $result;
    }