35 $sql =
'SELECT rowid FROM '.MAIN_DB_PREFIX.$table;
36 $sql .=
' WHERE rowid = '.$id;
40 $num = $db->num_rows(
$resql);
41 if ($num > 0)
return true;
60 $sourcetable = $sourcetype;
61 $targettable = $targettype;
63 if ($sourcetype ==
'shipping') $sourcetable =
'expedition';
64 elseif ($targettype ==
'shipping') $targettable =
'expedition';
65 if ($sourcetype ==
'delivery') $sourcetable =
'livraison';
66 elseif ($targettype ==
'delivery') $targettable =
'livraison';
67 if ($sourcetype ==
'order_supplier') $sourcetable =
'commande_fournisseur';
68 elseif ($targettype ==
'order_supplier') $targettable =
'commande_fournisseur';
69 if ($sourcetype ==
'invoice_supplier') $sourcetable =
'facture_fourn';
70 elseif ($targettype ==
'invoice_supplier') $targettable =
'facture_fourn';
72 $out = $langs->trans(
'SourceType').
': '.$sourcetype.
' => '.$langs->trans(
'TargetType').
': '.$targettype.
' ';
74 $sql =
'SELECT rowid, fk_source, fk_target FROM '.MAIN_DB_PREFIX.
'element_element';
75 $sql .=
' WHERE sourcetype="'.$sourcetype.
'" AND targettype="'.$targettype.
'"';
79 $num = $db->num_rows(
$resql);
85 $obj = $db->fetch_object(
$resql);
86 $elements[$obj->rowid] = array($sourcetype => $obj->fk_source, $targettype => $obj->fk_target);
92 if (!empty($elements))
94 foreach ($elements as $key => $element)
98 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'element_element';
99 $sql .=
' WHERE rowid = '.$key;
100 $resql = $db->query($sql);
106 if ($deleted) $out .=
'('.$langs->trans(
'LinkedElementsInvalidDeleted', $deleted).
')<br>';
107 else $out .=
'('.$langs->trans(
'NothingToDelete').
')<br>';
122 $sql =
"SELECT rowid, label FROM ".MAIN_DB_PREFIX.
"ecm_directories";
123 $resql = $db->query($sql);
126 while ($obj = $db->fetch_object(
$resql))
129 $label = $obj->label;
131 if ($label != $newlabel)
133 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"ecm_directories set label='".$db->escape($newlabel).
"' WHERE rowid=".$id;
134 print '<tr><td>'.$sqlupdate.
"</td></tr>\n";
135 $resqlupdate = $db->query($sqlupdate);
checkLinkedElements($sourcetype, $targettype)
Check linked elements and delete if invalid.
clean_data_ecm_directories()
Clean data into ecm_directories table.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
checkElementExist($id, $table)
Check if an element exist.