35 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.$table;
36 $sql .=
" WHERE rowid = ".((int) $id);
39 $num = $db->num_rows(
$resql);
64 $sourcetable = $sourcetype;
65 $targettable = $targettype;
67 if ($sourcetype ==
'shipping') {
68 $sourcetable =
'expedition';
69 } elseif ($targettype ==
'shipping') {
70 $targettable =
'expedition';
72 if ($sourcetype ==
'delivery') {
73 $sourcetable =
'livraison';
74 } elseif ($targettype ==
'delivery') {
75 $targettable =
'livraison';
77 if ($sourcetype ==
'order_supplier') {
78 $sourcetable =
'commande_fournisseur';
79 } elseif ($targettype ==
'order_supplier') {
80 $targettable =
'commande_fournisseur';
82 if ($sourcetype ==
'invoice_supplier') {
83 $sourcetable =
'facture_fourn';
84 } elseif ($targettype ==
'invoice_supplier') {
85 $targettable =
'facture_fourn';
88 $out = $langs->trans(
'SourceType').
': '.$sourcetype.
' => '.$langs->trans(
'TargetType').
': '.$targettype.
' ';
90 $sql =
"SELECT rowid, fk_source, fk_target FROM ".MAIN_DB_PREFIX.
"element_element";
91 $sql .=
" WHERE sourcetype = '".$db->escape($sourcetype).
"' AND targettype = '".$db->escape($targettype).
"'";
94 $num = $db->num_rows(
$resql);
98 $obj = $db->fetch_object(
$resql);
99 $elements[$obj->rowid] = array($sourcetype => $obj->fk_source, $targettype => $obj->fk_target);
105 if (!empty($elements)) {
106 foreach ($elements as $key => $element) {
108 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'element_element';
109 $sql .=
" WHERE rowid = ".((int) $key);
110 $resql = $db->query($sql);
117 $out .=
'('.$langs->trans(
'LinkedElementsInvalidDeleted', $deleted).
')<br>';
119 $out .=
'('.$langs->trans(
'NothingToDelete').
')<br>';
135 $sql =
"SELECT rowid, label FROM ".MAIN_DB_PREFIX.
"ecm_directories";
136 $resql = $db->query($sql);
138 while ($obj = $db->fetch_object(
$resql)) {
140 $label = $obj->label;
142 if ($label != $newlabel) {
143 $sqlupdate =
"UPDATE ".MAIN_DB_PREFIX.
"ecm_directories set label = '".$db->escape($newlabel).
"' WHERE rowid = ".((int) $id);
144 print
'<tr><td>'.$sqlupdate.
"</td></tr>\n";
145 $resqlupdate = $db->query($sqlupdate);
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $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...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
clean_data_ecm_directories()
Clean data into ecm_directories table.
checkLinkedElements($sourcetype, $targettype)
Check linked elements and delete if invalid.
checkElementExist($id, $table)
Check if an element exist.