Exemple #1
0
             $text .= ' <strong>' . $object->lines[$i]->label . '</strong>';
             print $form->textwithtooltip($text, $object->lines[$i]->description, 3, '', '', $i);
         } else {
             print $text . ' ' . nl2br($object->lines[$i]->description);
         }
         print_date_range($objp->date_start, $objp->date_end);
         print "</td>\n";
     }
     print '<td align="center">' . $object->lines[$i]->qty_asked . '</td>';
     print '<td align="center">' . $object->lines[$i]->qty_shipped . '</td>';
     print "</tr>";
     //Display lines extrafields
     if (is_array($extralabelslines) && count($extralabelslines) > 0) {
         $colspan = 2;
         $mode = $object->statut == 0 ? 'edit' : 'view';
         $line = new LivraisonLigne($db);
         $line->fetch_optionals($object->lines[$i]->id, $extralabelslines);
         print '<tr ' . $bc[$var] . '>';
         print $line->showOptionals($extrafieldsline, $mode, array('style' => $bc[$var], 'colspan' => $colspan), $i);
         print '</tr>';
     }
     $i++;
 }
 print "</table>\n";
 dol_fiche_end();
 //if ($object->statut == 0)	// only if draft
 //	print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
 print '</form>';
 /*
  *    Boutons actions
  */
Exemple #2
0
 /**
  * Update a livraison line (only extrafields)
  *
  * @param 	int		$id					Id of line (livraison line)
  * @param	array		$array_options		extrafields array
  * @return	int							<0 if KO, >0 if OK
  */
 function update_line($id, $array_options = 0)
 {
     global $conf;
     $error = 0;
     if ($id > 0 && !$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) {
         $livraisonline = new LivraisonLigne($this->db);
         $livraisonline->array_options = $array_options;
         $livraisonline->id = $id;
         $result = $livraisonline->insertExtraFields();
         if ($result < 0) {
             $this->error[] = $livraisonline->error;
             $error++;
         }
     }
     if (!$error) {
         return 1;
     } else {
         return -1;
     }
 }