diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index f9901feb7bd..9cf6604ce9b 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -81,6 +81,7 @@ class modMyModule extends DolibarrModules // 'models' => 0, // Set this to 1 if module has its own models directory // 'css' => '/mymodule/css/mymodule.css.php', // Set this to relative path of css if module has its own css file // 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module + // 'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) // Set here all workflow context managed by module // ); $this->module_parts = array(); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 354c0eb745d..9ddd160b7e3 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -36,11 +36,13 @@ $langs->load("admin"); $langs->load("errors"); $langs->load("interventions"); -if (!$user->admin) -accessforbidden(); +if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); +$action = GETPOST('action','alpha'); +$value = GETPOST('value','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); +$type='ficheinter'; /* @@ -146,30 +148,13 @@ if ($action == 'specimen') if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='ficheinter'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - if ($db->query($sql)) - { - - } + $ret = addDocumentModel($value, $type, $label, $scandir); } if ($action == 'del') { - $type='ficheinter'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - - if ($db->query($sql)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity); } @@ -177,11 +162,6 @@ if ($action == 'del') if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { // La constante qui a ete lue en avant du nouveau set @@ -190,28 +170,10 @@ if ($action == 'setdoc') } // On active le modele - $type='ficheinter'; - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - dol_syslog("fichinter: sql_del=".$sql_del); - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - dol_syslog("fichinter: sql_del=".$sql_del); - $result2=$db->query($sql); - if ($result1 && $result2) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } @@ -372,9 +334,9 @@ print "\n"; clearstatcache(); $var=true; -foreach ($conf->file->dol_document_root as $dirroot) -{ - $dir = $dirroot . "/core/modules/fichinter/doc/"; +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/fichinter/doc/"); if (is_dir($dir)) { diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index e5f97fe51a9..d8b93c52b8e 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -37,8 +37,11 @@ $langs->load("errors"); if (! $user->admin) accessforbidden(); -$action =GETPOST('action','alpha'); +$action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); +$type='propal'; /* * Actions @@ -183,26 +186,13 @@ if ($action == 'setclassifiedinvoiced') if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='propal'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $resql=$db->query($sql); + $ret = addDocumentModel($value, $type, $label, $scandir); } else if ($action == 'del') { - $type='propal'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - if ($db->query($sql)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->PROPALE_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROPALE_ADDON_PDF',$conf->entity); } @@ -210,37 +200,16 @@ else if ($action == 'del') else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { $conf->global->PROPALE_ADDON_PDF = $value; } // On active le modele - $type='propal'; - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($value?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($value)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 00775ed3070..2132a059926 100755 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -77,10 +77,36 @@ print "\n"; clearstatcache(); $workflowcodes=array(); -if ($conf->propal->enabled && $conf->commande->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_ORDER']='WORKFLOW_PROPAL_AUTOCREATE_ORDER'; -//if ($conf->propal->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_PROPAL_AUTOCREATE_INVOICE']='WORKFLOW_PROPAL_AUTOCREATE_INVOICE'; -//if ($conf->contrat->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_CONTRACT_AUTOCREATE_INVOICE']='WORKFLOW_CONTRACT_AUTOCREATE_INVOICE'; -if ($conf->commande->enabled && $conf->facture->enabled) $workflowcodes['WORKFLOW_ORDER_AUTOCREATE_INVOICE']='WORKFLOW_ORDER_AUTOCREATE_INVOICE'; +$workflow=array( + 'order' => array( + 'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER') + ), + 'invoice' => array ( + 'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE') + //,'contract' => array('WORKFLOW_CONTRACT_AUTOCREATE_INVOICE') + //, 'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_INVOICE') + ) +); +$workflow = array_merge($workflow, $conf->modules_parts['workflow']); + +foreach($workflow as $child => $parents) +{ + if ($conf->$child->enabled) + { + $langs->Load($child.'@'.$child); + + foreach($parents as $parent => $actions) + { + if ($conf->$parent->enabled) + { + foreach($actions as $action) + { + $workflowcodes[$action] = $action; + } + } + } + } +} if (count($workflowcodes) > 0) { diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 7da91cd5146..6cad6fd8d49 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -192,7 +192,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__CHECK_READ__' => '', + '__CHECK_READ__' => '', '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', '__LASTNAME__' => $obj->nom, '__FIRSTNAME__' => $obj->prenom, @@ -257,6 +257,34 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') { dol_print_error($db); } + else + { + //if cheack read is use then update prospect contact status + if (strpos($message, '__CHECK_READ__') !== false) + { + //Update status communication of thirdparty prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")"; + dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG); + $resql2=$db->query($sql); + if (! $resql2) + { + dol_print_error($db); + } + + //Update status communication of contact prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; + dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG); + + $resql2=$db->query($sql); + if (! $resql2) + { + dol_print_error($db); + } + } + } + + + //test if CHECK READ change statut prospect contact } else { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 71cabf3f68d..3f1e3bf94a6 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -401,6 +401,9 @@ class Conf // For backward compatibility $this->produit=$this->product; + $this->invoice=$this->facture; + $this->order=$this->commande; + $this->contract=$this->contrat; // Define menu manager in setup diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index e08606797d9..272a4b2ffa2 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1121,4 +1121,73 @@ function form_constantes($tableau) print ''; } +/** + * Add document model used by doc generator + * + * @param string $name Model name + * @param string $type Model type + * @param string $label Model label + * @param string $description Model description + * @return int <0 if KO, >0 if OK + */ +function addDocumentModel($name, $type, $label='', $description='') +{ + global $db, $conf; + + $db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; + $sql.= " VALUES ('".$db->escape($name)."','".$type."',".$conf->entity.", "; + $sql.= ($label?"'".$db->escape($label)."'":'null').", "; + $sql.= (! empty($description)?"'".$db->escape($description)."'":"null"); + $sql.= ")"; + + dol_syslog("admin.lib::addDocumentModel sql=".$sql); + $resql=$db->query($sql); + if ($resql) + { + $db->commit(); + return 1; + } + else + { + dol_print_error($db); + $db->rollback(); + return -1; + } +} + +/** + * Delete document model used by doc generator + * + * @param string $name Model name + * @param string $type Model type + * @return int <0 if KO, >0 if OK + */ +function delDocumentModel($name, $type) +{ + global $db, $conf; + + $db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; + $sql.= " WHERE nom = '".$db->escape($name)."'"; + $sql.= " AND type = '".$type."'"; + $sql.= " AND entity = ".$conf->entity; + + dol_syslog("admin.lib::delDocumentModel sql=".$sql); + $resql=$db->query($sql); + if ($resql) + { + $db->commit(); + return 1; + } + else + { + dol_print_error($db); + $db->rollback(); + return -1; + } +} + ?> \ No newline at end of file diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index b1a2b92f9af..eac6ff70dc8 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -695,12 +695,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass * @param Translate $outputlangs Object lang * @param int $posx X * @param int $posy Y + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param float $h Cell minimum height. The cell extends automatically if needed. * @param int $align Align * @param string $default_font_size Font size * @param HookManager $hookmanager Hook manager object * @return void */ -function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$default_font_size,$hookmanager=false) +function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$align,$default_font_size,$hookmanager=false) { $linkedobjects = pdf_getLinkedObjects($object,$outputlangs,$hookmanager); if (! empty($linkedobjects)) @@ -710,13 +712,13 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$align,$d $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetFont('','', $default_font_size - 2); - $pdf->MultiCell(100, 3, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align); + $pdf->MultiCell($w, $h, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align); if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"])) { $posy+=3; $pdf->SetXY($posx,$posy); - $pdf->MultiCell(100, 3, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align); + $pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align); } } } diff --git a/htdocs/core/modules/commande/doc/pdf_edison.modules.php b/htdocs/core/modules/commande/doc/pdf_edison.modules.php index 4dd0ba21ab5..fbe8770dc6e 100644 --- a/htdocs/core/modules/commande/doc/pdf_edison.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_edison.modules.php @@ -653,7 +653,7 @@ class pdf_edison extends ModelePDFCommandes $posy+=1; // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'L', $default_font_size, $hookmanager); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'L', $default_font_size, $hookmanager); } /** diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 809f2d7f4ac..0e0c7f1474f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -930,7 +930,7 @@ class pdf_einstein extends ModelePDFCommandes $posy+=2; // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'R', $default_font_size, $hookmanager); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); if ($showaddress) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 56d12802efb..90615358db7 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1125,7 +1125,7 @@ class pdf_crabe extends ModelePDFFactures $posy+=2; // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'R', $default_font_size, $hookmanager); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); if ($showaddress) { diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index 7b6719be03a..274b11a4baf 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -1003,7 +1003,7 @@ class pdf_oursin extends ModelePDFFactures $posy+=1; // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'L', $default_font_size, $hookmanager); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'L', $default_font_size, $hookmanager); // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0); diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index bc5939676a7..75032bbab9e 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -184,13 +184,24 @@ class MailingTargets // This can't be abstract as it is used for some method dol_syslog(get_class($this)."::add_to_target: mailing ".$j." targets added"); - //Update the status to show poelple that don't want to be contacted anymore' + //Update the status to show thirdparty mail that don't want to be contacted anymore' $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " SET statut=3"; - $sql .= " WHERE fk_mailing=".$mailing_id." and email in (SELECT email FROM ".MAIN_DB_PREFIX."societe where fk_stcomm=-1)"; + $sql .= " WHERE fk_mailing=".$mailing_id." AND email in (SELECT email FROM ".MAIN_DB_PREFIX."societe where fk_stcomm=-1)"; + $sql .= " AND source_type='thirdparty'"; $result=$this->db->query($sql); - dol_syslog("MailingTargets::add_to_target: mailing update status to display people that do not want to be contacted sql:".$sql); + dol_syslog(get_class($this)."::add_to_target: mailing update status to display thirdparty mail that do not want to be contacted sql:".$sql); + + //Update the status to show contact mail that don't want to be contacted anymore' + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; + $sql .= " SET statut=3"; + $sql .= " WHERE fk_mailing=".$mailing_id." AND email in (SELECT sc.email FROM ".MAIN_DB_PREFIX."socpeople AS sc "; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.fk_stcomm=-1 AND s.rowid=sc.fk_soc)"; + $sql .= " AND source_type='contact'"; + $result=$this->db->query($sql); + + dol_syslog(get_class($this)."::add_to_target: mailing update status to display contact mail that do not want to be contacted sql:".$sql); $this->update_nb($mailing_id); diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index f2cff187233..e1b1d128e2d 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -69,7 +69,7 @@ class modWorkflow extends DolibarrModules $this->dirs = array("/workflow/temp"); // Config pages. Put here list of php page names stored in admmin directory used to setup module. - $this->config_page_url = 'workflow.php'; + $this->config_page_url = array('workflow.php'); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 13a68888d54..b17312c6b3b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -985,7 +985,7 @@ class pdf_azur extends ModelePDFPropales $posy+=2; // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 'R', $default_font_size, $hookmanager); + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); if ($showaddress) { diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index 45fdf290314..29ca25d00dc 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ $langs->load("externalsite"); $def = array(); -$action = GETPOST("action"); +$action = GETPOST('action','alpha'); // Sauvegardes parametres if ($action == 'update') @@ -49,7 +49,7 @@ if ($action == 'update') $db->begin(); - $exturl = GETPOST("EXTERNALSITE_URL"); + $exturl = GETPOST('EXTERNALSITE_URL','alpha'); $i+=dolibarr_set_const($db,'EXTERNALSITE_URL',trim($exturl),'chaine',0,'',$conf->entity); //$i+=dolibarr_set_const($db,'EXTERNALSITE_LABEL',trim($_POST["EXTERNALSITE_LABEL"]),'chaine',0,'',$conf->entity); @@ -99,7 +99,7 @@ print ""; print ""; print "".$langs->trans("ExternalSiteURL").""; -print "global->EXTERNALSITE_URL) . "\" size=\"40\">"; +print "global->EXTERNALSITE_URL) . "\" size=\"40\">"; print "http://localhost/myurl/"; print "
http://wikipedia.org/"; print ""; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php old mode 100644 new mode 100755 index daa4f915f87..565c5adff1c --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2012-2012 Vinicius Nogueira * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,47 +148,54 @@ else } /* - * Commandes brouillons + * Legends / Status + * + * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles + * Reason: Show all Status and give the possibility to filter only one */ -if ($conf->fournisseur->enabled) + +$sql = "SELECT count(cf.rowid), fk_statut"; +$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; +$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; +if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +$sql.= " WHERE cf.fk_soc = s.rowid"; +$sql.= " AND s.entity = ".$conf->entity; +if ($user->societe_id) $sql.=' AND cf.fk_soc = '.$user->societe_id; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " GROUP BY cf.fk_statut"; + +$resql = $db->query($sql); +if ($resql) { - $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE c.fk_soc = s.rowid"; - $sql.= " AND c.entity = ".$conf->entity; - $sql.= " AND c.fk_statut = 0"; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + $num = $db->num_rows($resql); + $i = 0; - $resql=$db->query($sql); - if ($resql) + print ''; + + print ''; + print ''; + print "\n"; + $var=True; + + while ($i < $num) { - print '
'.$langs->trans("Status").''.$langs->trans("Nb").'
'; - print ''; - print ''; - $langs->load("orders"); - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - $var = True; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print ""; - print '"; - print ''; - $i++; - } - } - print "
'.$langs->trans("DraftOrders").'
'; - print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'

"; - } -} + $row = $db->fetch_row($resql); + $var=!$var; + print ""; + print ''.$langs->trans($commandestatic->statuts[$row[1]]).''; + print ''.$row[0].' '.$commandestatic->LibStatut($row[1],3).''; + + print "\n"; + $i++; + } + print "
"; + $db->free($resql); +} +else +{ + dol_print_error($db); +} /* * List of users allowed @@ -312,11 +320,54 @@ if ($resql) } else dol_print_error($db); +/* + * Commandes brouillons + */ + // Drafts position of the box changed to a better visualization + +if ($conf->fournisseur->enabled) +{ + $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; + $sql.= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE c.fk_soc = s.rowid"; + $sql.= " AND c.entity = ".$conf->entity; + $sql.= " AND c.fk_statut = 0"; + if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + + $resql=$db->query($sql); + if ($resql) + { + print ''; + print ''; + print ''; + $langs->load("orders"); + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + $var = True; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ""; + print '"; + print ''; + $i++; + } + } + print "
'.$langs->trans("DraftOrders").'
'; + print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'

"; + } +} /* * Orders to process */ -/* + /* $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 353714bc5bb..8ad93526b2c 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -34,8 +34,8 @@ if (!$user->admin) accessforbidden(); $def = array(); $lastftpentry=0; -$action = GETPOST("action"); -$entry = GETPOST("numero_entry"); +$action = GETPOST('action','alpha'); +$entry = GETPOST('numero_entry','alpha'); // Positionne la variable pour le nombre de rss externes $sql ="select MAX(name) as name from ".MAIN_DB_PREFIX."const"; @@ -52,7 +52,7 @@ else dol_print_error($db); } -if ($action == 'add' || GETPOST("modify")) +if ($action == 'add' || GETPOST('modify','alpha')) { $ftp_name = "FTP_NAME_" . $entry;// $_POST["numero_entry"]; $ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"]; @@ -60,13 +60,13 @@ if ($action == 'add' || GETPOST("modify")) $error=0; $mesg=''; - if (! GETPOST("$ftp_name")) + if (! GETPOST("$ftp_name",'alpha')) { $error=1; $mesg.='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'
'; } - if (! GETPOST("$ftp_server")) + if (! GETPOST("$ftp_server",'alpha')) { $error=1; $mesg.='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")).'
'; @@ -81,11 +81,11 @@ if ($action == 'add' || GETPOST("modify")) $db->begin(); - $result1=dolibarr_set_const($db, "FTP_PORT_" . $entry,GETPOST($ftp_port),'chaine',0,'',$conf->entity); - if ($result1) $result2=dolibarr_set_const($db, "FTP_SERVER_" . $entry, GETPOST($ftp_server),'chaine',0,'',$conf->entity); - if ($result2) $result3=dolibarr_set_const($db, "FTP_USER_" . $entry,GETPOST($ftp_user),'chaine',0,'',$conf->entity); - if ($result3) $result4=dolibarr_set_const($db, "FTP_PASSWORD_" . $entry,GETPOST($ftp_password),'chaine',0,'',$conf->entity); - if ($result4) $result5=dolibarr_set_const($db, "FTP_NAME_" . $entry,GETPOST($ftp_name),'chaine',0,'',$conf->entity); + $result1=dolibarr_set_const($db, "FTP_PORT_" . $entry,GETPOST($ftp_port,'alpha'),'chaine',0,'',$conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "FTP_SERVER_" . $entry, GETPOST($ftp_server,'alpha'),'chaine',0,'',$conf->entity); + if ($result2) $result3=dolibarr_set_const($db, "FTP_USER_" . $entry,GETPOST($ftp_user,'alpha'),'chaine',0,'',$conf->entity); + if ($result3) $result4=dolibarr_set_const($db, "FTP_PASSWORD_" . $entry,GETPOST($ftp_password,'alpha'),'chaine',0,'',$conf->entity); + if ($result4) $result5=dolibarr_set_const($db, "FTP_NAME_" . $entry,GETPOST($ftp_name,'alpha'),'chaine',0,'',$conf->entity); if ($result1 && $result2 && $result3 && $result4 && $result5) { @@ -102,7 +102,7 @@ if ($action == 'add' || GETPOST("modify")) } } -if ($_POST["delete"]) +if (GETPOST('delete','alpha')) { if($entry) { diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index d35b3009023..7eb4bb0a57a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -216,6 +216,7 @@ OfficialWebSiteFr=lloc web oficial francòfon OfficialWiki=Wiki Dolibarr OfficialDemo=Demo en línia Dolibarr OfficialMarketPlace=Lloc oficial de mòduls complementaris i extensions +OfficialWebHostingService=Servei oficial d'allotjament (SaaS) ForDocumentationSeeWiki=Per a la documentació d'usuari, desenvolupador o Preguntes Freqüents (FAQ), consulteu el wiki Dolibarr:
%s ForAnswersSeeForum=Per altres qüestions o realitzar les seves pròpies consultes, pot utilitzar el fòrum Dolibarr:
%s HelpCenterDesc1=Aquesta aplicació, independent de Dolibarr, us permet ajudar a obtenir un servei de suport de Dolibarr. diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index f7ab73e8981..8b89e1aff63 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -216,6 +216,7 @@ OfficialWebSiteFr=sitio web oficial habla francesa OfficialWiki=Wiki documentación Dolibarr OfficialDemo=Demo en línea Dolibarr OfficialMarketPlace=Sitio oficial de módulos complementarios y extensiones +OfficialWebHostingService=Servicio oficial de alojamiento (SaaS) ForDocumentationSeeWiki=Para la documentación de usuario, desarrollador o Preguntas Frecuentes (FAQ), consulte el wiki Dolibarr:
%s ForAnswersSeeForum=Para otras cuestiones o realizar sus propias consultas, puede utilizar el foro Dolibarr:
%s HelpCenterDesc1=Esta aplicación, independiente de Dolibarr, le permite ayudarle a obtener un servicio de soporte de Dolibarr. diff --git a/htdocs/langs/pt_BR/banks.lang b/htdocs/langs/pt_BR/banks.lang old mode 100644 new mode 100755 index 25fd06d13b6..aa49bec395d --- a/htdocs/langs/pt_BR/banks.lang +++ b/htdocs/langs/pt_BR/banks.lang @@ -12,7 +12,7 @@ BankAccounts=Contas Bancarias AccountRef=Ref. Conta Financeira AccountLabel=Etiqueta da Conta Financeira CashAccount=Conta Caixa/Efetivo -CashAccounts=Contas Caixa/Efecivo +CashAccounts=Contas Caixa/Efetivo MainAccount=Conta Principal CurrentAccount=Conta Corrente CurrentAccounts=Contas Correntes diff --git a/htdocs/langs/pt_BR/bills.lang b/htdocs/langs/pt_BR/bills.lang old mode 100644 new mode 100755 index 9603063da48..074e759b57f --- a/htdocs/langs/pt_BR/bills.lang +++ b/htdocs/langs/pt_BR/bills.lang @@ -1,4 +1,5 @@ # Dolibarr language file - pt_BR rev. 0.0 - bills +# 2012 Vinícius Nogueira CHARSET=UTF-8 Bill=Fatura Bills=Faturas @@ -356,6 +357,8 @@ ShowUnpayedAll=Ver todos os não remunerados ShowUnpayedLateOnly=Mostrar apenas os não remunerados PaymentInvoiceRef=Pagamento Fatura %s ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible=Não é possível excluir pagamento de uma Fatura fechada. +CustomerBillsUnpaid=Faturas de Clientes Pendentes de Cobrança +BillsCustomersUnpaid=Faturas de Clientes Pendentes de Cobrança # oursin PDF model Of=de diff --git a/htdocs/langs/pt_BR/commercial.lang b/htdocs/langs/pt_BR/commercial.lang old mode 100644 new mode 100755 index daef48ebcd4..1da77f54c0e --- a/htdocs/langs/pt_BR/commercial.lang +++ b/htdocs/langs/pt_BR/commercial.lang @@ -76,6 +76,8 @@ ActionAC_REL=Lembrete fatura por correio ActionAC_CLO=Fechar ActionAC_EMAILING=Envio mailing massivo ActionAC_COM=Envio Pedido por Correio +ActionAC_OTH=Outro +ActionAC_SHIP=Enviar Por E-Mail Stats=Estatisticas de Venda CAOrder=Ordem CA FromTo=A partir de %s até %s diff --git a/htdocs/langs/pt_BR/companies.lang b/htdocs/langs/pt_BR/companies.lang index d65a1b4b999..2cdef4cf6e5 100644 --- a/htdocs/langs/pt_BR/companies.lang +++ b/htdocs/langs/pt_BR/companies.lang @@ -153,7 +153,11 @@ DiscountNone=Nenhuma Supplier=Fornecedor CompanyList=Lista de Empresas AddContact=Criar Contato +NewContactAddress=Novo Contato/Endereço Contact=Contato +AddContactAddress=Novo Contato/Endereço +ListOfContacts=Lista de Contatos/Endereços +ListOfContactsAddresses=Lista de Contatos/Endereços NoContactDefined=Nenhum contato definido para este fornecedor DefaultContact=Contato por Padrao AddCompany=Criar Empresa @@ -174,7 +178,6 @@ ThisIsModuleRules=Esta é a regra para este módulo LastProspect=último Cliente Potencial ProspectToContact=Cliente Potencial a Contactar CompanyDeleted=A Empresa "%s" foi Eliminada -ListOfContacts=Lista de Contatos ListOfProspectsContacts=Lista de Contatos Clientes Potenciais ListOfCustomersContacts=Lista de Contatos Clientes ListOfSuppliersContacts=Lista de Contatos Fornecedores @@ -213,7 +216,7 @@ Staff=Empregados ProspectLevelShort=Cli. Potenc. ProspectLevel=Cliente Potencial ContactPrivate=Privado -ContactPublic=Partilhado +ContactPublic=Compartilhado ContactVisibility=Visibilidade OthersNotLinkedToThirdParty=Outros, não associado a um Fornecedor ProspectStatus=Estado cliente potencial diff --git a/htdocs/langs/pt_BR/main.lang b/htdocs/langs/pt_BR/main.lang old mode 100644 new mode 100755 index f786a7161e0..ec807cdff79 --- a/htdocs/langs/pt_BR/main.lang +++ b/htdocs/langs/pt_BR/main.lang @@ -158,7 +158,7 @@ Number=Número Numero=Número Limit=Límite Limits=Limites -DevelopmentTeam=Equipa de Desenvolvimento +DevelopmentTeam=Equipe de Desenvolvimento Logout=Sair Connection=Login Setup=Configuração @@ -175,7 +175,7 @@ DateCreation=Data de Criação DateModification=Data Modificação DateModificationShort=Data Modif. DateLastModification=Data última Modificação -DateValidation=Vata Validação +DateValidation=Data Validação DateClosing=Data de Encerramento DateDue=Data Vencimento DateValue=Data Valor @@ -428,13 +428,13 @@ RebuildDoc=Recriar o doc Entity=Entidade Entities=Entidadees EventLogs=Log -CustomerPreview=Historial Cliente -SupplierPreview=Historial Fornecedor -AccountancyPreview=Historial Contabilidade -ShowCustomerPreview=Ver Historial Cliente -ShowSupplierPreview=Ver Historial Fornecedor -ShowProspectPreview=Ver Historial Cliente Potencial -ShowAccountancyPreview=Ver Historial Contabilidade +CustomerPreview=Historico Cliente +SupplierPreview=Historico Fornecedor +AccountancyPreview=Historico Contabilidade +ShowCustomerPreview=Ver Historico Cliente +ShowSupplierPreview=Ver Historico Fornecedor +ShowProspectPreview=Ver Historico Cliente Potencial +ShowAccountancyPreview=Ver Historico Contabilidade RefCustomer=Ref. Cliente Currency=Moeda InfoAdmin=Informação para os administradores diff --git a/htdocs/langs/pt_BR/orders.lang b/htdocs/langs/pt_BR/orders.lang old mode 100644 new mode 100755 index 8b4b14c79da..2fed7ad44ce --- a/htdocs/langs/pt_BR/orders.lang +++ b/htdocs/langs/pt_BR/orders.lang @@ -1,6 +1,8 @@ # Dolibarr language file - pt_BR rev. 0.0 - orders +# 2012 Vinícius Nogueira + CHARSET=UTF-8 -OrdersArea=Area de Pedidos de Clientes +OrdersArea=Área de Pedidos de Clientes SuppliersOrdersArea=Área de Pedidos a Fornecedores OrderCard=Ficha Pedido Order=Pedido @@ -59,7 +61,7 @@ ShipProduct=Enviar Produto Discount=Desconto CreateOrder=Criar Pedido RefuseOrder=Rejeitar o Pedido -ApproveOrder=Aceptar o Pedido +ApproveOrder=Aceitar o Pedido ValidateOrder=Confirmar o Pedido DeleteOrder=Eliminar o pedido CancelOrder=Anular o Pedido diff --git a/htdocs/langs/pt_BR/other.lang b/htdocs/langs/pt_BR/other.lang old mode 100644 new mode 100755 index 4c5d70117a0..1435c89e37d --- a/htdocs/langs/pt_BR/other.lang +++ b/htdocs/langs/pt_BR/other.lang @@ -1,4 +1,5 @@ # Dolibarr language file - pt_BR rev. 0.0 - other +# 2012 Vinícius Nogueira CHARSET=UTF-8 SecurityCode=Código Segurança Calendar=Calendário @@ -18,10 +19,10 @@ AttachANewFile=Adicionar Novo Arquivo/Documento LinkedObject=Arquivo Anexo Miscellanous=Diversos NbOfActiveNotifications=Número Notificações -PredefinedMailContentSendInvoice=Le juntamos a fatura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Ponemos na sua conhecimento que a fatura __FACREF__ parece não estar paga. Se a juntamos pois, para que possa revisarla.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Anexo segue proposta solicitada de codigo__PROPREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Anexo segue o pedido solicitado de codigo __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=Le juntamos a fatura __FACREF__\n\nCordialmente\n\n +PredefinedMailContentSendInvoiceReminder=Ponemos na sua conhecimento que a fatura __FACREF__ parece não estar paga. Se a juntamos pois, para que possa revisarla.\n\nCordialmente\n\n +PredefinedMailContentSendProposal=Anexo segue proposta solicitada de codigo__PROPREF__\n\nCordialmente\n\n +PredefinedMailContentSendOrder=Anexo segue o pedido solicitado de codigo __ORDERREF__\n\nCordialmente\n\n DemoDesc=Dolibarr não é um ERP monolítico, mas está composto de módulos funcionais simples e opcionais. uma demonstração que inclua todos estes módulos não tem sentido, já que nunca mais todos Os módulos são utilizados. De todas maneras existe disponíveis muitos perfis de demonstração ChooseYourDemoProfil=quer ver o perfil de demonstração que melhor corresponda e a sua Atividade... DemoFundation=Administração de Membros de uma associação @@ -64,7 +65,7 @@ SizeUnitdm=dm SizeUnitcm=cm SizeUnitmm=mm BugTracker=Incidências -SendNewPasswordDesc=Este formulário permite enviar uma Nova senha. Se enviará à e-mail do usuário
a modificação da senha não será efetiva até que o usario faça click ao link de confirmação incluido neste e-mail.
Supervise a sua correio. +SendNewPasswordDesc=Este formulário permite enviar uma Nova senha. Será enviado ao e-mail do usuário
a modificação da senha não será efetiva até que o usuário click no link de confirmação neste e-mail.
Verifique sua caixa de correio. BackToLoginPage=Voltar e a página de login AuthenticationDoesNotAllowSendNewPassword=o modo de autentificação de Dolibarr está configurado como "%s".
neste modo Dolibarr não pode conhecer nem modificar a sua senha
Contacte com a sua administrador para conhecer as modalidades de alterar. EnableGDLibraryDesc=deve ativar o instalar a Bibliotéca GD na sua PHP para poder ativar esta Opção @@ -112,23 +113,23 @@ ErrorWebcalLoginNotDefined=o login Webcalendar associado e a sua usuário Doliba ErrorPhenixLoginNotDefined=o login Phenix associado e a sua conta Dolibarrr %s não está definido ##### Calendar common #####= AddCalendarEntry=Adicionar entrada ao calendário -NewCompanyToDolibarr=Empresa %s inserida em Dolibarr -ContractValidatedInDolibarr=Contrato %s validado em Dolibarr -ContractCanceledInDolibarr=Contrato %s anulado em Dolibarr -ContractClosedInDolibarr=Contrato %s encerrado no Dolibarr -PropalClosedSignedInDolibarr=Orçamento %s assinado no Dolibarr -PropalClosedRefusedInDolibarr=Orçamento %s rejeitado no Dolibarr -PropalValidatedInDolibarr=orçamento %s validado em Dolibarr -InvoiceValidatedInDolibarr=Fatura %s validada em Dolibarr -InvoicePayedInDolibarr=Fatura %s pasada a paga em Dolibarr -InvoiceCanceledInDolibarr=Fatura %s anulada em Dolibarr -PaymentDoneInDolibarr=pagamento %s realizado em Dolibarr -CustomerPaymentDoneInDolibarr=pagamento de cliente %s em Dolibarr -SupplierPaymentDoneInDolibarr=pagamento a fornecedor %s em Dolibarr -MemberValidatedInDolibarr=membro %s validado em Dolibarr -MemberResiliatedInDolibarr=membro %s dado de baixa em Dolibarr -MemberDeletedInDolibarr=membro %s eliminado de Dolibarr -MemberSubscriptionAddedInDolibarr=Subscrição do membro % adicionada em Dolibarr +NewCompanyToDolibarr=Empresa %s Cadastrada +ContractValidatedInDolibarr=Contrato %s Confirmado +ContractCanceledInDolibarr=Contrato %s Cancelado +ContractClosedInDolibarr=Contrato %s Encerrado +PropalClosedSignedInDolibarr=Orçamento %s Assinado +PropalClosedRefusedInDolibarr=Orçamento %s rejeitado +PropalValidatedInDolibarr=Orçamento %s Validado +InvoiceValidatedInDolibarr=Fatura %s Confirmada +InvoicePayedInDolibarr=Fatura %s recebeu status de PAGA +InvoiceCanceledInDolibarr=Fatura %s Cancelada +PaymentDoneInDolibarr=Pagamento %s Realizado +CustomerPaymentDoneInDolibarr=Pagamento do cliente %s +SupplierPaymentDoneInDolibarr=Pagamento a fornecedor %s +MemberValidatedInDolibarr=Membro %s Confirmado +MemberResiliatedInDolibarr=Membro %s Baixado +MemberDeletedInDolibarr=Membro %s Excluido +MemberSubscriptionAddedInDolibarr=Inscrição do membro % adicionada ##### Export #####= ExportsArea=Área de Exportações AvailableFormats=Formatos disponíveis diff --git a/htdocs/langs/pt_BR/products.lang b/htdocs/langs/pt_BR/products.lang old mode 100644 new mode 100755 index cf5d3865109..d642b09bfe2 --- a/htdocs/langs/pt_BR/products.lang +++ b/htdocs/langs/pt_BR/products.lang @@ -1,4 +1,5 @@ # Dolibarr language file - pt_BR rev. 0.0 - products +# 2012 Vinícius Nogueira CHARSET=UTF-8 ProductRef=Ref. Produto ProductLabel=Nome do Produto diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang old mode 100644 new mode 100755 index d8604ebec86..ec28c4b03d8 --- a/htdocs/langs/pt_BR/projects.lang +++ b/htdocs/langs/pt_BR/projects.lang @@ -2,7 +2,8 @@ CHARSET=UTF-8 Project=Projeto Projects=Projetos -SharedProject=Projeto Partilhado +SharedProject=Projeto Compartilhado +PrivateProject=Contatos do Projeto Myprojects=Os Meus Projetos ProjectsArea=Área de Projetos NewProject=Novo Projeto diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index d4eea8f36a9..4ed37d53e0a 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -155,13 +155,15 @@ if ($format == 'ical' || $format == 'vcal') // Ajout directives pour resoudre bug IE //header('Cache-Control: Public, must-revalidate'); //header('Pragma: public'); + if ($cachedelay) header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate'); + else header('Cache-Control: private, must-revalidate'); // Clean parameters $outputfile=$conf->agenda->dir_temp.'/'.$filename; $result=readfile($outputfile); if (! $result) print 'File '.$outputfile.' was empty.'; - // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); + //header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); exit; } else diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 9b5721b70da..1df669ee8b5 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -41,13 +41,23 @@ if ($id!='') dol_syslog("public/emailing/mailing-read.php : Mail read : ".$sql, LOG_DEBUG); $resql=$db->query($sql); - - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$id."')"; - dol_syslog("public/emailing/mailing-read.php : Mail read : ".$sql, LOG_DEBUG); + + //Update status communication of thirdparty prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$id."' AND source_type='thirdparty' AND source_id is not null)"; + dol_syslog("public/emailing/mailing-read.php : Mail read thirdparty : ".$sql, LOG_DEBUG); $resql=$db->query($sql); + + //Update status communication of contact prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$id."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; + dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG); + + $resql=$db->query($sql); + } + + $db->close(); ?> diff --git a/htdocs/public/emailing/mailing-usubscribe.php b/htdocs/public/emailing/mailing-usubscribe.php index a46946b9661..9dd1cdcf779 100644 --- a/htdocs/public/emailing/mailing-usubscribe.php +++ b/htdocs/public/emailing/mailing-usubscribe.php @@ -20,7 +20,7 @@ /** - * \file scripts/emailings/mailing-read.php + * \file scripts/emailings/mailing-usubscribe.php * \ingroup mailing * \brief Script use to update unsubcribe contact to prospect mailing list */ @@ -45,13 +45,19 @@ if (($id!='') && ($unsuscrib=='1')) //Udate status of mail in Destinaries maling list $statut='3'; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE tag='".$id."'"; - dol_syslog("public/emailing/mailing-read.php : Mail unsubcribe : ".$sql, LOG_DEBUG); + dol_syslog("public/emailing/mailing-usubscribe.php : Mail unsubcribe : ".$sql, LOG_DEBUG); $resql=$db->query($sql); - //Update status communication of prospect - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$id."' AND source_type='thirdparty')"; - dol_syslog("public/emailing/mailing-read.php : Mail unsubcribe : ".$sql, LOG_DEBUG); + //Update status communication of thirdparty prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE tag='".$id."' AND source_type='thirdparty' AND source_id is not null)"; + dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe thirdparty : ".$sql, LOG_DEBUG); + + $resql=$db->query($sql); + + //Update status communication of contact prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=-1 WHERE rowid IN (SELECT fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$id."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; + dol_syslog("public/emailing/mailing-unsubscribe.php : Mail unsubcribe contact : ".$sql, LOG_DEBUG); $resql=$db->query($sql); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 97376e2a7db..4f74cd76439 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -136,7 +136,7 @@ if ($resql) $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__CHECK_READ__' => '', + '__CHECK_READ__' => '', '__UNSUSCRIBE__' => ''.$langs->trans("MailUnsubcribe").'', '__LASTNAME__' => $obj->lastname, '__FIRSTNAME__' => $obj->firstname, @@ -199,6 +199,31 @@ if ($resql) { dol_print_error($db); } + else + { + //if cheack read is use then update prospect contact status + if (strpos($message, '__CHECK_READ__') !== false) + { + //Update status communication of thirdparty prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")"; + dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG); + $resql2=$db->query($sql); + if (! $resql2) + { + dol_print_error($db); + } + + //Update status communication of contact prospect + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; + dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG); + + $resql2=$db->query($sql); + if (! $resql2) + { + dol_print_error($db); + } + } + } } else {