FIX #6981
This commit is contained in:
parent
777486d74c
commit
f9d9642340
@ -74,7 +74,7 @@ if ($mode == 'customer')
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$title=$langs->trans("BillsStatisticsSuppliers");
|
||||
$dir=$conf->fournisseur->dir_output.'/facture/temp';
|
||||
$dir=$conf->fournisseur->facture->dir_temp;
|
||||
}
|
||||
|
||||
print load_fiche_titre($title, $mesg, 'title_accountancy.png');
|
||||
|
||||
@ -58,7 +58,7 @@ class Notify
|
||||
'SHIPPING_VALIDATE'
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -85,14 +85,14 @@ class Notify
|
||||
$langs->load("mails");
|
||||
|
||||
$listofnotiftodo=$this->getNotificationsArray($action,$socid,$object,0);
|
||||
|
||||
|
||||
$nb=-1;
|
||||
if (is_array($listofnotiftodo)) $nb=count($listofnotiftodo);
|
||||
if ($nb < 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ErrorFailedToGetListOfNotificationsToSend");
|
||||
if ($nb == 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("NoNotificationsWillBeSent");
|
||||
if ($nb == 1) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ANotificationsWillBeSent");
|
||||
if ($nb >= 2) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("SomeNotificationsWillBeSent",$nb);
|
||||
|
||||
|
||||
if (is_array($listofnotiftodo))
|
||||
{
|
||||
$i=0;
|
||||
@ -106,7 +106,7 @@ class Notify
|
||||
}
|
||||
if ($i) $texte.=')';
|
||||
}
|
||||
|
||||
|
||||
return $texte;
|
||||
}
|
||||
|
||||
@ -149,9 +149,9 @@ class Notify
|
||||
}
|
||||
$sql.= " AND s.entity IN (".getEntity('societe').")";
|
||||
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
||||
|
||||
|
||||
dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG);
|
||||
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -176,7 +176,7 @@ class Notify
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if ($userid >= 0 && in_array('user', $scope))
|
||||
@ -194,9 +194,9 @@ class Notify
|
||||
}
|
||||
$sql.= " AND c.entity IN (".getEntity('user').")";
|
||||
if ($userid > 0) $sql.= " AND c.rowid = ".$userid;
|
||||
|
||||
|
||||
dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG);
|
||||
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -237,10 +237,10 @@ class Notify
|
||||
{
|
||||
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_.*_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
|
||||
}
|
||||
|
||||
|
||||
$threshold = (float) $reg[1];
|
||||
if ($valueforthreshold < $threshold) continue;
|
||||
|
||||
|
||||
$tmpemail=explode(',',$val);
|
||||
foreach($tmpemail as $key2 => $val2)
|
||||
{
|
||||
@ -295,7 +295,7 @@ class Notify
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('notification'));
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
|
||||
|
||||
$langs->load("other");
|
||||
@ -342,7 +342,7 @@ class Notify
|
||||
$sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action";
|
||||
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
|
||||
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
|
||||
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -369,7 +369,7 @@ class Notify
|
||||
}
|
||||
|
||||
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture/card.php?facid='.$object->id;
|
||||
@ -409,7 +409,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_VALIDATE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
|
||||
@ -417,7 +417,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||
@ -425,7 +425,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
|
||||
@ -462,7 +462,7 @@ class Notify
|
||||
if (! empty($hookmanager->resArray['subject'])) $subject.=$hookmanager->resArray['subject'];
|
||||
if (! empty($hookmanager->resArray['message'])) $message.=$hookmanager->resArray['message'];
|
||||
}
|
||||
|
||||
|
||||
$mailfile = new CMailFile(
|
||||
$subject,
|
||||
$sendto,
|
||||
@ -478,16 +478,16 @@ class Notify
|
||||
);
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
{
|
||||
if ($obj->type_target == 'touserid') {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)";
|
||||
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')";
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, type_target, objet_id, email)";
|
||||
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')";
|
||||
|
||||
|
||||
}
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
@ -585,7 +585,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_VALIDATE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs));
|
||||
@ -593,7 +593,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||
@ -601,7 +601,7 @@ class Notify
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE2':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||
@ -664,7 +664,7 @@ class Notify
|
||||
if (! empty($hookmanager->resArray['subject'])) $subject.=$hookmanager->resArray['subject'];
|
||||
if (! empty($hookmanager->resArray['message'])) $message.=$hookmanager->resArray['message'];
|
||||
}
|
||||
|
||||
|
||||
$mailfile = new CMailFile(
|
||||
$subject,
|
||||
$sendto,
|
||||
|
||||
@ -1279,8 +1279,8 @@ function dol_delete_preview($object)
|
||||
// Define parent dir of elements
|
||||
$element = $object->element;
|
||||
|
||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
||||
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture';
|
||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->commande->dir_output;
|
||||
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->facture->dir_output;
|
||||
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
||||
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||
@ -2083,7 +2083,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output))
|
||||
{
|
||||
if ($fuser->rights->fournisseur->facture->{$lire}) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
|
||||
$original_file=$conf->fournisseur->facture->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp))
|
||||
|
||||
@ -157,7 +157,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if ($conf->fournisseur->dir_output.'/facture')
|
||||
if ($conf->fournisseur->facture->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@ -540,7 +540,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
|
||||
return 1; // Pas d'erreur
|
||||
}
|
||||
else
|
||||
|
||||
@ -168,7 +168,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$outputlangs->load("orders");
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
|
||||
// Loop on each lines to detect if there is at least one image to show
|
||||
$realpatharray=array();
|
||||
if (! empty($conf->global->MAIN_GENERATE_SUPPLIER_ORDER_WITH_PICTURE))
|
||||
@ -190,7 +190,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
}
|
||||
|
||||
|
||||
$realpath='';
|
||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
||||
{
|
||||
@ -205,7 +205,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
|
||||
|
||||
if ($conf->fournisseur->dir_output.'/commande')
|
||||
if ($conf->fournisseur->commande->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@ -412,11 +412,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->startTransaction();
|
||||
if ($posYAfterImage > 0)
|
||||
if ($posYAfterImage > 0)
|
||||
{
|
||||
$descWidth = $this->posxpicture-$curX;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
$descWidth = $this->posxtva-$curX;
|
||||
}
|
||||
@ -639,7 +639,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$this->result = array('fullpath'=>$file);
|
||||
|
||||
|
||||
return 1; // Pas d'erreur
|
||||
}
|
||||
else
|
||||
|
||||
@ -450,8 +450,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
// in order not to lose the attached files
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$newref = dol_sanitizeFileName($num);
|
||||
$dirsource = $conf->fournisseur->dir_output.'/commande/'.$oldref;
|
||||
$dirdest = $conf->fournisseur->dir_output.'/commande/'.$newref;
|
||||
$dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref;
|
||||
$dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref;
|
||||
if (file_exists($dirsource))
|
||||
{
|
||||
dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest);
|
||||
@ -460,7 +460,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
dol_syslog("Rename ok");
|
||||
// Rename docs starting with $oldref with $newref
|
||||
$listoffiles=dol_dir_list($conf->fournisseur->dir_output.'/commande/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
|
||||
$listoffiles=dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
|
||||
foreach($listoffiles as $fileentry)
|
||||
{
|
||||
$dirsource=$fileentry['name'];
|
||||
|
||||
@ -71,7 +71,7 @@ if ($object->fetch($id,$ref) < 0)
|
||||
exit;
|
||||
}
|
||||
|
||||
$upload_dir = $conf->fournisseur->dir_output.'/commande/'.dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
|
||||
|
||||
@ -1021,7 +1021,7 @@ if ($resql)
|
||||
// Other picto tool
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->dir_output.'/commande/' . dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->fournisseur->commande->dir_output.'/' . dol_sanitizeFileName($obj->ref);
|
||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user