|
@@ -5100,7 +5100,68 @@ class Form
|
|
|
print '</div>';
|
|
|
}
|
|
|
|
|
|
- if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto))
|
|
|
+ if ((in_array('fichinter',$restrictlinksto)) && ! empty($conf->ficheinter->enabled))
|
|
|
+ {
|
|
|
+ $linktoelem.=($linktoelem?' ':'').'<a href="#" id="linktoorder">' . $langs->trans('LinkedFichinter') . '</a>';
|
|
|
+
|
|
|
+ print '
|
|
|
+ <script type="text/javascript" language="javascript">
|
|
|
+ jQuery(document).ready(function() {
|
|
|
+ jQuery("#linktoorder").click(function() {
|
|
|
+ jQuery("#orderlist").toggle();
|
|
|
+ jQuery("#linktoorder").toggle();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+ ';
|
|
|
+
|
|
|
+ print '<div id="orderlist"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
|
|
|
+
|
|
|
+ $sql = "SELECT s.rowid as socid, s.nom as name, s.client, f.rowid, f.ref";
|
|
|
+ $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
|
|
|
+ $sql .= ", " . MAIN_DB_PREFIX . "fichinter as f";
|
|
|
+ $sql .= ' WHERE f.fk_soc = s.rowid';
|
|
|
+
|
|
|
+ $resqlorderlist = $this->db->query($sql);
|
|
|
+ if ($resqlorderlist)
|
|
|
+ {
|
|
|
+ $num = $this->db->num_rows($resqlorderlist);
|
|
|
+ $i = 0;
|
|
|
+
|
|
|
+ print '<br><form action="" method="POST" name="LinkedFichinter">';
|
|
|
+ print '<table class="noborder">';
|
|
|
+ print '<tr class="liste_titre">';
|
|
|
+ print '<td class="nowrap"></td>';
|
|
|
+ print '<td align="center">' . $langs->trans("Ref") . '</td>';
|
|
|
+ print '<td align="left">' . $langs->trans("Company") . '</td>';
|
|
|
+ print '</tr>';
|
|
|
+ while ($i < $num)
|
|
|
+ {
|
|
|
+ $objp = $this->db->fetch_object($resqlorderlist);
|
|
|
+
|
|
|
+ $var = ! $var;
|
|
|
+ print '<tr ' . $bc [$var] . '>';
|
|
|
+ print '<td aling="left">';
|
|
|
+ print '<input type="radio" name="LinkedFichinter" value=' . $objp->rowid . '>';
|
|
|
+ print '<td align="center">' . $objp->ref . '</td>';
|
|
|
+ print '<td>' . $objp->name . '</td>';
|
|
|
+ print '</td>';
|
|
|
+ print '</tr>';
|
|
|
+
|
|
|
+ $i ++;
|
|
|
+ }
|
|
|
+ print '</table>';
|
|
|
+ print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
|
|
+ print '</form>';
|
|
|
+ $this->db->free($resqlorderlist);
|
|
|
+ } else {
|
|
|
+ dol_print_error($this->db);
|
|
|
+ }
|
|
|
+
|
|
|
+ print '</div>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((! is_array($restrictlinksto)) || in_array('supplier_order',$restrictlinksto))
|
|
|
&& ! empty($conf->fournisseur->enabled))
|
|
|
{
|
|
|
$linktoelem.=($linktoelem?' ':'').'<a href="#linktoorder" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';
|