New: Can now send supplier order by mail

This commit is contained in:
Laurent Destailleur
2010-05-12 13:14:26 +00:00
parent 83aebbb2ce
commit af7cfec808
6 changed files with 34 additions and 22 deletions

View File

@@ -26,6 +26,7 @@ For users:
- New: Can delete several files at once in FTP module.
- New: Add box "last contracts".
- New: Works even if Web hosting provider has disabled glob function.
- New: Can now send supplier order by mail.
- Fix: Format number was wrong for ar_AR language.
- Fix: Can change password if has only permission change password.
- Fix: Project PDF document show the tasks.

View File

@@ -51,6 +51,7 @@ $eventstolog=array(
array('id'=>'BILL_SENTBYMAIL', 'test'=>$conf->facture->enabled),
array('id'=>'FICHEINTER_VALIDATE', 'test'=>$conf->ficheinter->enabled),
array('id'=>'ORDER_SUPPLIER_VALIDATE','test'=>$conf->fournisseur->enabled),
array('id'=>'ORDER_SUPPLIER_SENTBYMAIL','test'=>$conf->fournisseur->enabled),
array('id'=>'BILL_SUPPLIER_VALIDATE', 'test'=>$conf->fournisseur->enabled),
array('id'=>'BILL_SUPPLIER_PAYED', 'test'=>$conf->fournisseur->enabled),
// array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled),

View File

@@ -60,12 +60,12 @@ class Interfaces
// Check parameters
if (! is_object($object) || ! is_object($conf)) // Error
{
dol_syslog('interface::run_triggers was called with wrong parameters object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERROR);
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERROR);
return -1;
}
if (! is_object($user) || ! is_object($langs)) // Warning
{
dol_syslog('interface::run_triggers was called with wrong parameters object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
}
foreach($conf->triggers_modules as $dir)
@@ -88,7 +88,7 @@ class Interfaces
if (in_array($modName,$modules))
{
$langs->load("errors");
dol_syslog("Interface::run_triggers ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR);
dol_syslog("Interface::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR);
continue;
}
@@ -108,7 +108,7 @@ class Interfaces
if (! $qualified)
{
dol_syslog("Interfaces::run_triggers Triggers for file '".$file."' need module to be enabled",LOG_INFO);
dol_syslog("Interfaces::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled",LOG_INFO);
continue;
}
@@ -120,11 +120,11 @@ class Interfaces
// Bypass if workflow module is enabled and if the trigger asked to be disable in such case
if ($conf->workflow->enabled && ! empty($objMod->disabled_if_workflow))
{
dol_syslog("Interfaces::run_triggers Bypass triggers for file '".$file."'",LOG_INFO);
dol_syslog("Interfaces::run_triggers action=".$action." Bypass triggers for file '".$file."'",LOG_INFO);
continue;
}
dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
dol_syslog("Interfaces::run_triggers action=".$action." Launch triggers for file '".$file."'",LOG_INFO);
$modules[$i] = $modName;
//dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
@@ -151,7 +151,7 @@ class Interfaces
}
else
{
dol_syslog("Interfaces::run_triggers Failed to instantiate trigger for file '".$file."'",LOG_ERROR);
dol_syslog("Interfaces::run_triggers action=".$action." Failed to instantiate trigger for file '".$file."'",LOG_ERROR);
}
}
}
@@ -160,7 +160,7 @@ class Interfaces
if ($nbko)
{
dol_syslog("Interfaces::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR);
dol_syslog("Interfaces::run_triggers action=".$action." Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_ERR);
return -$nbko;
}
else

View File

@@ -638,7 +638,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
$commande->actiontypecode=$actiontypecode;
$commande->actionmsg = $actionmsg;
$commande->actionmsg2= $actionmsg2;
$commande->orderrowid=$commande->id;
$commande->supplierorderrowid=$commande->id;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
@@ -1249,8 +1249,6 @@ if ($id > 0 || ! empty($ref))
{
if ($user->rights->fournisseur->commande->commander)
{
print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>';
$comref = dol_sanitizeFileName($commande->ref);
$file = $conf->fournisseur->commande->dir_output . '/'.$comref.'/'.$comref.'.pdf';
if (file_exists($file))

View File

@@ -324,6 +324,17 @@ class InterfaceActionsAuto
$object->propalrowid=$object->facid=0;
$ok=1;
}
elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("bills");
$langs->load("agenda");
$langs->load("orders");
$ok=1;
// Parameters $object->xxx defined by caller
}
elseif ($action == 'BILL_SUPPLIER_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@@ -396,13 +396,13 @@ class CMailFile
{
$this->error="Failed to send mail to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."<br>Recipient address '$dest' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res=false;
}
else
{
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true);
$result=$this->smtps->sendMsg();
//print $result;
}
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
@@ -411,9 +411,10 @@ class CMailFile
else
{
if (empty($this->error)) $this->error=$result;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res=false;
}
}
}
else
{