";
@@ -288,7 +306,8 @@ if ($resql)
// Action (type)
print '';
$actionstatic->id=$obj->id;
- $actionstatic->type_code=$obj->acode;
+ $actionstatic->type_code=$obj->type_code;
+ $actionstatic->type_label=$obj->type_label;
$actionstatic->libelle=$obj->label;
print $actionstatic->getNomUrl(1,28);
print ' ';
@@ -337,6 +356,7 @@ if ($resql)
print '';
// User author
+ /*
print '';
if ($obj->useridauthor)
{
@@ -347,6 +367,7 @@ if ($resql)
}
else print ' ';
print ' ';
+ */
// User to do
print '';
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 51ddb81c0b4..da34983779a 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -395,6 +395,13 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
+ // Discard auto action if option is on
+ if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO')
+ {
+ $i++;
+ continue;
+ }
+
// Create a new object action
$event=new ActionComm($db);
$event->id=$obj->id;
@@ -710,6 +717,11 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
print '
';
print $langs->trans("Other");
print '
';
+ /* TODO Show this if at least one cumulated event
+ print '
';
+ print $langs->trans("SeveralEvents");
+ print '
';
+ */
}
// Add js code to manage click on a box
@@ -734,7 +746,7 @@ jQuery(document).ready(function() {
else if (ids.indexOf(",") > -1) /* There is several events */
{
/* alert(\'several events\'); */
- url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday;
+ url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
window.location.href = url;
}
else /* One event */
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 6cd70b273be..07cad40be7a 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -111,10 +111,14 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object
-if ($action == 'confirm_clone' && $confirm == 'yes') {
- if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) {
+if ($action == 'confirm_clone' && $confirm == 'yes')
+{
+ if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
+ {
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
- } else {
+ }
+ else
+ {
if ($object->id > 0) {
$result = $object->createFromClone($socid);
if ($result > 0) {
@@ -129,7 +133,8 @@ if ($action == 'confirm_clone' && $confirm == 'yes') {
}
// Delete proposal
-else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) {
+else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer)
+{
$result = $object->delete($user);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php');
@@ -141,7 +146,8 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->prop
}
// Remove line
-else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) {
+else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer)
+{
$result = $object->deleteline($lineid);
// reorder lines
if ($result)
@@ -164,13 +170,17 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
}
// Validation
-else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) {
+else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider)
+{
$result = $object->valid($user);
- if ($result >= 0) {
- if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
+ if ($result >= 0)
+ {
+ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
+ {
// Define output language
$outputlangs = $langs;
- if (! empty($conf->global->MAIN_MULTILANGS)) {
+ if (! empty($conf->global->MAIN_MULTILANGS))
+ {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
@@ -185,8 +195,9 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr
}
}
-else if ($action == 'setdate' && $user->rights->propal->creer) {
- $datep = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']);
+else if ($action == 'setdate' && $user->rights->propal->creer)
+{
+ $datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datep)) {
$error ++;
@@ -198,23 +209,29 @@ else if ($action == 'setdate' && $user->rights->propal->creer) {
if ($result < 0)
dol_print_error($db, $object->error);
}
-} else if ($action == 'setecheance' && $user->rights->propal->creer) {
- $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST ['echmonth'], $_POST ['echday'], $_POST ['echyear']));
+}
+else if ($action == 'setecheance' && $user->rights->propal->creer)
+{
+ $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
if ($result < 0)
dol_print_error($db, $object->error);
-} else if ($action == 'setdate_livraison' && $user->rights->propal->creer) {
- $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST ['liv_month'], $_POST ['liv_day'], $_POST ['liv_year']));
+}
+else if ($action == 'setdate_livraison' && $user->rights->propal->creer)
+{
+ $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']));
if ($result < 0)
dol_print_error($db, $object->error);
}
// Positionne ref client
-else if ($action == 'set_ref_client' && $user->rights->propal->creer) {
- $object->set_ref_client($user, $_POST ['ref_client']);
+else if ($action == 'set_ref_client' && $user->rights->propal->creer)
+{
+ $object->set_ref_client($user, $_POST['ref_client']);
}
// Create proposal
-else if ($action == 'add' && $user->rights->propal->creer) {
+else if ($action == 'add' && $user->rights->propal->creer)
+{
$object->socid = $socid;
$object->fetch_thirdparty();
@@ -296,11 +313,11 @@ else if ($action == 'add' && $user->rights->propal->creer) {
for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++)
{
- if ($_POST ['idprod' . $i]) {
+ if ($_POST['idprod' . $i]) {
$xid = 'idprod' . $i;
$xqty = 'qty' . $i;
$xremise = 'remise' . $i;
- $object->add_product($_POST [$xid], $_POST [$xqty], $_POST [$xremise]);
+ $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
}
}
@@ -544,7 +561,7 @@ if (GETPOST('removedfile')) {
$upload_dir_tmp = $vardir . '/temp';
// TODO Delete only files that was uploaded from email form
- dol_remove_file_process($_POST ['removedfile'], 0);
+ dol_remove_file_process($_POST['removedfile'], 0);
$action = 'presend';
}
@@ -555,35 +572,35 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$langs->load('mails');
if ($object->id > 0) {
- if ($_POST ['sendto']) {
+ if ($_POST['sendto']) {
// Le destinataire a ete fourni via le champ libre
- $sendto = $_POST ['sendto'];
+ $sendto = $_POST['sendto'];
$sendtoid = 0;
- } elseif ($_POST ['receiver'] != '-1') {
+ } elseif ($_POST['receiver'] != '-1') {
// Recipient was provided from combo list
- if ($_POST ['receiver'] == 'thirdparty') // Id of third party
+ if ($_POST['receiver'] == 'thirdparty') // Id of third party
{
$sendto = $object->thirdparty->email;
$sendtoid = 0;
} else // Id du contact
{
- $sendto = $object->thirdparty->contact_get_property($_POST ['receiver'], 'email');
- $sendtoid = $_POST ['receiver'];
+ $sendto = $object->thirdparty->contact_get_property($_POST['receiver'], 'email');
+ $sendtoid = $_POST['receiver'];
}
}
if (dol_strlen($sendto)) {
$langs->load("commercial");
- $from = $_POST ['fromname'] . ' <' . $_POST ['frommail'] . '>';
- $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>';
- $message = $_POST ['message'];
- $sendtocc = $_POST ['sendtocc'];
+ $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>';
+ $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>';
+ $message = $_POST['message'];
+ $sendtocc = $_POST['sendtocc'];
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
- $deliveryreceipt = $_POST ['deliveryreceipt'];
+ $deliveryreceipt = $_POST['deliveryreceipt'];
- if (dol_strlen($_POST ['subject']))
- $subject = $_POST ['subject'];
+ if (dol_strlen($_POST['subject']))
+ $subject = $_POST['subject'];
else
$subject = $langs->transnoentities('Propal') . ' ' . $object->ref;
$actiontypecode = 'AC_PROP';
@@ -683,9 +700,9 @@ if ($action == 'modif' && $user->rights->propal->creer)
}
else if ($action == "setabsolutediscount" && $user->rights->propal->creer) {
- if ($_POST ["remise_id"]) {
+ if ($_POST["remise_id"]) {
if ($object->id > 0) {
- $result = $object->insert_discount($_POST ["remise_id"]);
+ $result = $object->insert_discount($_POST["remise_id"]);
if ($result < 0) {
setEventMessage($object->error, 'errors');
}
@@ -723,7 +740,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
if (is_array($extralabelsline)) {
// Get extra fields
foreach ($extralabelsline as $key => $value) {
- unset($_POST ["options_" . $key]);
+ unset($_POST["options_" . $key]);
}
}
@@ -895,23 +912,23 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
- unset($_POST ['prod_entry_mode']);
+ unset($_POST['prod_entry_mode']);
- unset($_POST ['qty']);
- unset($_POST ['type']);
- unset($_POST ['remise_percent']);
- unset($_POST ['price_ht']);
- unset($_POST ['price_ttc']);
- unset($_POST ['tva_tx']);
- unset($_POST ['product_ref']);
- unset($_POST ['product_label']);
- unset($_POST ['product_desc']);
- unset($_POST ['fournprice']);
- unset($_POST ['buying_price']);
- unset($_POST ['np_marginRate']);
- unset($_POST ['np_markRate']);
- unset($_POST ['dp_desc']);
- unset($_POST ['idprod']);
+ unset($_POST['qty']);
+ unset($_POST['type']);
+ unset($_POST['remise_percent']);
+ unset($_POST['price_ht']);
+ unset($_POST['price_ttc']);
+ unset($_POST['tva_tx']);
+ unset($_POST['product_ref']);
+ unset($_POST['product_label']);
+ unset($_POST['product_desc']);
+ unset($_POST['fournprice']);
+ unset($_POST['buying_price']);
+ unset($_POST['np_marginRate']);
+ unset($_POST['np_markRate']);
+ unset($_POST['dp_desc']);
+ unset($_POST['idprod']);
unset($_POST['date_starthour']);
unset($_POST['date_startmin']);
@@ -966,7 +983,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
if (is_array($extralabelsline)) {
// Get extra fields
foreach ($extralabelsline as $key => $value) {
- unset($_POST ["options_" . $key]);
+ unset($_POST["options_" . $key]);
}
}
@@ -1023,18 +1040,18 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
- unset($_POST ['qty']);
- unset($_POST ['type']);
- unset($_POST ['productid']);
- unset($_POST ['remise_percent']);
- unset($_POST ['price_ht']);
- unset($_POST ['price_ttc']);
- unset($_POST ['tva_tx']);
- unset($_POST ['product_ref']);
- unset($_POST ['product_label']);
- unset($_POST ['product_desc']);
- unset($_POST ['fournprice']);
- unset($_POST ['buying_price']);
+ unset($_POST['qty']);
+ unset($_POST['type']);
+ unset($_POST['productid']);
+ unset($_POST['remise_percent']);
+ unset($_POST['price_ht']);
+ unset($_POST['price_ttc']);
+ unset($_POST['tva_tx']);
+ unset($_POST['product_ref']);
+ unset($_POST['product_label']);
+ unset($_POST['product_desc']);
+ unset($_POST['fournprice']);
+ unset($_POST['buying_price']);
} else {
$db->rollback();
@@ -1091,17 +1108,17 @@ else if ($action == 'remove_file' && $user->rights->propal->creer) {
// Set project
else if ($action == 'classin' && $user->rights->propal->creer) {
- $object->setProject($_POST ['projectid']);
+ $object->setProject($_POST['projectid']);
}
// Delai de livraison
else if ($action == 'setavailability' && $user->rights->propal->creer) {
- $result = $object->availability($_POST ['availability_id']);
+ $result = $object->availability($_POST['availability_id']);
}
// Origine de la propale
else if ($action == 'setdemandreason' && $user->rights->propal->creer) {
- $result = $object->demand_reason($_POST ['demand_reason_id']);
+ $result = $object->demand_reason($_POST['demand_reason_id']);
}
// Conditions de reglement
@@ -1110,11 +1127,11 @@ else if ($action == 'setconditions' && $user->rights->propal->creer) {
}
else if ($action == 'setremisepercent' && $user->rights->propal->creer) {
- $result = $object->set_remise_percent($user, $_POST ['remise_percent']);
+ $result = $object->set_remise_percent($user, $_POST['remise_percent']);
}
else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) {
- $result = $object->set_remise_absolue($user, $_POST ['remise_absolue']);
+ $result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
}
// Mode de reglement
@@ -1206,7 +1223,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->
{
if ($object->id > 0) {
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
- $result = $object->add_contact($contactid, $_POST ["type"], $_POST ["source"]);
+ $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0) {
diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
index ce80783c731..e575c8f27fc 100644
--- a/htdocs/comm/propal/apercu.php
+++ b/htdocs/comm/propal/apercu.php
@@ -186,7 +186,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve
if (file_exists($fileimage))
{
- print ' ';
+ print ' ';
}
// Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis))
@@ -199,13 +199,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview))
{
- print '';
+ print '
';
}
}
}
-print '';
-
-$db->close();
llxFooter();
+
+$db->close();
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index cdd5618c6b7..c056e5aa1c5 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1326,67 +1326,77 @@ class Propal extends CommonObject
{
$num = $this->ref;
}
+ $this->newref = $num;
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql.= " SET ref = '".$num."',";
$sql.= " fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
- dol_syslog(get_class($this).'::valid', LOG_DEBUG);
- if ($this->db->query($sql))
+ dol_syslog(get_class($this)."::valid", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if (! $resql)
+ {
+ dol_print_error($this->db);
+ $error++;
+ }
+
+ // Trigger calls
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('PROPAL_VALIDATE',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+
+ if (! $error)
{
- if (! $notrigger)
- {
- // Call trigger
- $result=$this->call_trigger('PROPAL_VALIDATE',$user);
- if ($result < 0) { $error++; }
- // End call triggers
- }
+ $this->oldref = $this->ref;
- if (! $error)
- {
- // Rename directory if dir was a temporary ref
- if (preg_match('/^[\(]?PROV/i', $this->ref))
- {
- // Rename of propal directory ($this->ref = old ref, $num = new ref)
- // to not lose the linked files
- $oldref = dol_sanitizeFileName($this->ref);
- $newref = dol_sanitizeFileName($num);
- $dirsource = $conf->propal->dir_output.'/'.$oldref;
- $dirdest = $conf->propal->dir_output.'/'.$newref;
- if (file_exists($dirsource))
- {
- dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
+ // Rename directory if dir was a temporary ref
+ if (preg_match('/^[\(]?PROV/i', $this->ref))
+ {
+ // Rename of propal directory ($this->ref = old ref, $num = new ref)
+ // to not lose the linked files
+ $oldref = dol_sanitizeFileName($this->ref);
+ $newref = dol_sanitizeFileName($num);
+ $dirsource = $conf->propal->dir_output.'/'.$oldref;
+ $dirdest = $conf->propal->dir_output.'/'.$newref;
- if (@rename($dirsource, $dirdest))
- {
+ if (file_exists($dirsource))
+ {
+ dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
+ if (@rename($dirsource, $dirdest))
+ {
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->propal->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
+ }
+ }
+ }
- dol_syslog("Rename ok");
- // Deleting old PDF in new rep
- dol_delete_file($conf->propal->dir_output.'/'.$newref.'/'.$oldref.'*.*');
- }
- }
- }
+ $this->ref=$num;
+ $this->brouillon=0;
+ $this->statut = 1;
+ $this->user_valid_id=$user->id;
+ $this->datev=$now;
- $this->ref=$num;
- $this->brouillon=0;
- $this->statut = 1;
- $this->user_valid_id=$user->id;
- $this->datev=$now;
-
- $this->db->commit();
- return 1;
- }
- else
- {
- $this->db->rollback();
- return -2;
- }
+ $this->db->commit();
+ return 1;
}
else
{
- $this->db->rollback();
- return -1;
+ $this->db->rollback();
+ return -1;
}
}
}
diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
index abb2be95076..839ca73d5b9 100644
--- a/htdocs/commande/apercu.php
+++ b/htdocs/commande/apercu.php
@@ -206,7 +206,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve
if (file_exists($fileimage))
{
- print ' ';
+ print ' ';
}
// Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis))
@@ -219,13 +219,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview))
{
- print '
';
+ print '
';
}
}
}
-print '';
-
-$db->close();
llxFooter();
+
+$db->close();
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 60e5d81e37a..82811287604 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2013 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
@@ -1148,7 +1148,7 @@ else if ($action == 'update_extras') {
/*
* Add file in email form
-*/
+ */
if (GETPOST('addfile')) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
@@ -1162,7 +1162,7 @@ if (GETPOST('addfile')) {
/*
* Remove file in email form
-*/
+ */
if (GETPOST('removedfile')) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
@@ -1177,7 +1177,7 @@ if (GETPOST('removedfile')) {
/*
* Send mail
-*/
+ */
if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) {
$langs->load('mails');
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 25c8a1d11c3..ce3ec431180 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -183,9 +183,10 @@ class Commande extends CommonOrder
*
* @param User $user User making status change
* @param int $idwarehouse Id of warehouse to use for stock decrease
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <=0 if OK, >0 if KO
*/
- function valid($user, $idwarehouse=0)
+ function valid($user, $idwarehouse=0, $notrigger=0)
{
global $conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -223,9 +224,10 @@ class Commande extends CommonOrder
$num = $this->getNextNumRef($soc);
}
else
- {
+ {
$num = $this->ref;
}
+ $this->newref = $num;
// Validate
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
@@ -273,43 +275,49 @@ class Commande extends CommonOrder
}
}
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('ORDER_VALIDATE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref='';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
- // On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
+ // On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
// in order not to lose the attachments
- $comref = dol_sanitizeFileName($this->ref);
- $snum = dol_sanitizeFileName($num);
- $dirsource = $conf->commande->dir_output.'/'.$comref;
- $dirdest = $conf->commande->dir_output.'/'.$snum;
+ $oldref = dol_sanitizeFileName($this->ref);
+ $newref = dol_sanitizeFileName($num);
+ $dirsource = $conf->commande->dir_output.'/'.$oldref;
+ $dirdest = $conf->commande->dir_output.'/'.$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $comref;
-
dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*');
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
}
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('ORDER_VALIDATE',$user);
- if ($result < 0) $error++;
- // End call triggers
- }
-
// Set new ref and current status
if (! $error)
{
@@ -323,7 +331,7 @@ class Commande extends CommonOrder
return 1;
}
else
- {
+ {
$this->db->rollback();
return -1;
}
@@ -898,6 +906,13 @@ class Commande extends CommonOrder
$this->date_validation = '';
$this->ref_client = '';
+ // Set ref
+ require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php';
+ $obj = $conf->global->COMMANDE_ADDON;
+ $modCommande = new $obj;
+ $this->ref = $modCommande->getNextValue($objsoc,$this);
+
+
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index 921b1739767..e6961ed97dd 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -233,7 +233,11 @@ foreach ($accounts as $key=>$type)
$total[$acc->currency_code] += $solde;
}
}
-if (! $found) print ''.$langs->trans("None").' ';
+if (! $found)
+{
+ $var = !$var;
+ print ''.$langs->trans("None").' ';
+}
// Total
foreach ($total as $key=>$solde)
{
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index 374851ca749..dd6455a3932 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -112,7 +112,7 @@ if ($conf->salaries->enabled)
$total = 0 ;
print '';
print '';
- print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.datev","",$param,'width="120"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.datev","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
@@ -145,7 +145,7 @@ if ($conf->salaries->enabled)
$i++;
}
- print ' '.$langs->trans("Total").' ';
+ print ''.$langs->trans("Total").' ';
print ''.price($total)." ";
print ' ';
print ' ';
@@ -175,7 +175,7 @@ if ($conf->tax->enabled)
print '';
print '';
- print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="120"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
@@ -305,7 +305,7 @@ if ($conf->tax->enabled)
$total = 0 ;
print '';
print '';
- print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
@@ -338,7 +338,7 @@ if ($conf->tax->enabled)
$i++;
}
- print ' '.$langs->trans("Total").' ';
+ print ''.$langs->trans("Total").' ';
print ''.price($total)." ";
print ' ';
print ' ';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index eb4ca29f022..1a67ffb2feb 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1158,7 +1158,11 @@ else if ($action == 'addline' && $user->rights->facture->creer)
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error ++;
}
-
+ if ($qty < 0) {
+ $langs->load("errors");
+ setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
+ $error ++;
+ }
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
$ret = $object->fetch($id);
if ($ret < 0) {
@@ -1320,7 +1324,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
- unset($_POST ['prod_entry_mode']);
+ unset($_POST['prod_entry_mode']);
unset($_POST['qty']);
unset($_POST['type']);
@@ -1359,9 +1363,9 @@ else if ($action == 'addline' && $user->rights->facture->creer)
}
}
-elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel')) {
- if (! $object->fetch($id) > 0)
- dol_print_error($db);
+elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel'))
+{
+ if (! $object->fetch($id) > 0) dol_print_error($db);
$object->fetch_thirdparty();
// Clean parameters
@@ -1372,6 +1376,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
$description = dol_htmlcleanlastbr(GETPOST('product_desc'));
$pu_ht = GETPOST('price_ht');
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
+ $qty = GETPOST('qty');
// Define info_bits
$info_bits = 0;
@@ -1428,10 +1433,15 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
$error ++;
}
}
+ if ($qty < 0) {
+ $langs->load("errors");
+ setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
+ $error ++;
+ }
// Update line
if (! $error) {
- $result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, 0, $array_option);
+ $result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GETPOST('remise_percent'), $date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, 0, $array_option);
if ($result >= 0) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
@@ -1463,6 +1473,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
+ unset($_POST['np_marginRate']);
+ unset($_POST['np_markRate']);
} else {
setEventMessage($object->error, 'errors');
}
@@ -3579,21 +3591,24 @@ if ($action == 'create')
// Linked object block
$somethingshown = $object->showLinkedObjectBlock();
- if (empty($somethingshown) && ! empty($conf->commande->enabled))
+ $linktoelem='';
+
+ if (! empty($conf->commande->enabled))
{
- print '' . $langs->trans('LinkedOrder') . ' ';
+ $linktoelem.=($linktoelem?' ':'').'' . $langs->trans('LinkedOrder') . ' ';
print '
';
- print '';
+ print '
';
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
@@ -3601,11 +3616,12 @@ if ($action == 'create')
$sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $soc->id . '';
$resqlorderlist = $db->query($sql);
- if ($resqlorderlist) {
+ if ($resqlorderlist)
+ {
$num = $db->num_rows($resqlorderlist);
$i = 0;
- print '
';
$db->free($resqlorderlist);
} else {
@@ -3642,6 +3659,9 @@ if ($action == 'create')
print '
';
}
+ // Show link to elements
+ if ($linktoelem) print '
'.$linktoelem;
+
// Link for paypal payment
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index ee197e9cee3..211d9241a8f 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -398,7 +398,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve
if (file_exists($fileimage))
{
- print '
';
+ print '
';
}
// Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis))
@@ -411,12 +411,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview))
{
- print '
';
+ print '
';
}
}
}
-$db->close();
-
llxFooter();
+
+$db->close();
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index e07881d73db..605d4920669 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1589,9 +1589,10 @@ class Facture extends CommonInvoice
* @param User $user Object user that validate
* @param string $force_number Reference to force on invoice
* @param int $idwarehouse Id of warehouse to use for stock decrease
- * @return int <0 if KO, >0 if OK
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
+ * @return int <0 if KO, >0 if OK
*/
- function validate($user, $force_number='', $idwarehouse=0)
+ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0)
{
global $conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -1679,6 +1680,7 @@ class Facture extends CommonInvoice
{
$num = $this->ref;
}
+ $this->newref = $num;
if ($num)
{
@@ -1738,45 +1740,50 @@ class Facture extends CommonInvoice
}
}
+ // Trigger calls
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('BILL_VALIDATE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref = '';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// Rename of object directory ($this->ref = old ref, $num = new ref)
// to not lose the linked files
- $facref = dol_sanitizeFileName($this->ref);
- $snumfa = dol_sanitizeFileName($num);
- $dirsource = $conf->facture->dir_output.'/'.$facref;
- $dirdest = $conf->facture->dir_output.'/'.$snumfa;
+ $oldref = dol_sanitizeFileName($this->ref);
+ $newref = dol_sanitizeFileName($num);
+ $dirsource = $conf->facture->dir_output.'/'.$oldref;
+ $dirdest = $conf->facture->dir_output.'/'.$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $facref;
-
dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->facture->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
}
- // Trigger calls
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('BILL_VALIDATE',$user);
- if ($result < 0) $error++;
- //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail
- // End call triggers
- }
-
// Set new ref and define current statut
if (! $error)
{
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index 9b58f1e44c0..c99744f7430 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -112,8 +112,8 @@ if ($resql)
print '
';
print '';
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 7e0b818279f..10fb995c023 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -122,11 +122,11 @@ if ($result)
print '
'."\n";
@@ -3715,6 +3730,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
}
}
+
/**
* This function is called to encode a string into a HTML string but differs from htmlentities because
* all entities but &,<,> are converted. This permits to encode special chars to entities with no double
@@ -4543,6 +4559,8 @@ function picto_from_langcode($codelang)
{
global $langs;
+ if (empty($codelang)) return '';
+
if ($codelang == 'auto')
{
return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png');
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index e6f6228eec9..a2420624695 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -573,17 +573,18 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/**
* Return last or next value for a mask (according to area we should not reset)
*
- * @param DoliDB $db Database handler
+ * @param DoliDB $db Database handler
* @param string $mask Mask to use
* @param string $table Table containing field with counter
* @param string $field Field containing already used values of counter
* @param string $where To add a filter on selection (for exemple to filter on invoice types)
* @param Societe $objsoc The company that own the object we need a counter for
* @param string $date Date to use for the {y},{m},{d} tags.
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string New value (numeric) or error message
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany)
+ * @return string New value (numeric) or error message
*/
-function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
+function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true)
{
global $conf;
@@ -784,7 +785,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql.= " FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
- $sql.= " AND entity IN (".getEntity($table, 1).")";
+ if ($bentityon) // only if entity enable
+ $sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@@ -824,7 +826,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql.= " FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
- $sql.= " AND entity IN (".getEntity($table, 1).")";
+ if ($bentityon) // only if entity enable
+ $sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@@ -877,7 +880,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table;
//$sql.= " WHERE ".$field." not like '(%'";
$maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'";
- $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")";
+ if ($bentityon) // only if entity enable
+ $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask
if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask
$maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')";
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 2afb4686162..b26326ae5e7 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -79,7 +79,7 @@ function facture_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'note';
$h++;
}
@@ -89,7 +89,7 @@ function facture_prepare_head($object)
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
+ if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 20a05a701aa..879478daf8d 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -88,7 +88,7 @@ function member_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
@@ -174,7 +174,7 @@ function member_stats_prepare_head($object)
$head[$h][1] = $langs->trans("Country");
$head[$h][2] = 'statscountry';
$h++;
-
+
$head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbyregion';
$head[$h][1] = $langs->trans("Region");
$head[$h][2] = 'statsregion';
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index 0aa3c980911..ba3e8344f47 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -89,7 +89,7 @@ function commande_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'note';
$h++;
}
@@ -99,7 +99,7 @@ function commande_prepare_head($object)
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
+ if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 98a2b111c6f..b384ccceabe 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -71,7 +71,7 @@ function project_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'notes';
$h++;
}
@@ -81,7 +81,7 @@ function project_prepare_head($object)
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
+ if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
$head[$h][2] = 'document';
$h++;
@@ -149,7 +149,7 @@ function task_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][1] = $langs->trans('Notes');
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'task_notes';
$h++;
}
@@ -458,7 +458,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
global $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic;
- if (! is_object($formother))
+ if (! is_object($formother))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db);
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index bc0c7cae868..8a96b86c967 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -83,7 +83,7 @@ function propal_prepare_head($object)
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'note';
$h++;
}
@@ -93,7 +93,7 @@ function propal_prepare_head($object)
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
+ if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
$head[$h][2] = 'document';
$h++;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 87dfcf1367b..f00abaa339f 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -70,11 +70,11 @@ function dol_decode($chain)
/**
* Returns a hash of a string.
- * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (md5 by default)
- * If constant MAIN_SECURITY_SALT is defined, we use it as a salt
+ * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function.
+ * If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
*
* @param string $chain String to hash
- * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5)
+ * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5)
* @return string Hash of string
*/
function dol_hash($chain,$type=0)
@@ -86,9 +86,12 @@ function dol_hash($chain,$type=0)
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));
+ else if ($type == 3) return md5($chain);
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
- else return md5($chain);
+
+ // No enconding defined
+ return md5($chain);
}
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 40dd2c03ac3..fe0c9809296 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -440,7 +440,7 @@ function encodedecode_dbpassconf($level=0)
/**
* Return a generated password using default module
*
- * @param boolean $generic true=Create generic password (a MD5 string), false=Use the configured password generation module
+ * @param boolean $generic true=Create generic password (use default crypt function), false=Use the configured password generation module
* @return string New value for password
*/
function getRandomPassword($generic=false)
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 69cad2c856b..630d2ae5b13 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -101,7 +101,7 @@ function user_prepare_head($object)
if(!empty($object->note)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
- if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.' ';
$head[$h][2] = 'note';
$h++;
@@ -111,7 +111,7 @@ function user_prepare_head($object)
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/user/document.php?userid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
+ if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.' ';
$head[$h][2] = 'document';
$h++;
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 51a3a13ff58..1b7da875073 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -334,7 +334,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
- $array_other=$this->get_substitutionarray_other($user,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 2ad6b87643a..2ca90b13ace 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -343,7 +343,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
- $array_other=$this->get_substitutionarray_other($user,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 93df313ad4c..1364aeff65e 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -504,7 +504,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
- $array_other=$this->get_substitutionarray_other($user,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index c5043857469..7f93851cc65 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -490,7 +490,7 @@ class doc_generic_task_odt extends ModelePDFTask
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($project,$outputlangs);
- $array_other=$this->get_substitutionarray_other($user,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 080c781b404..8f79094befc 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -368,7 +368,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
- $array_other=$this->get_substitutionarray_other($user,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index e7ccc31583c..632acf71b0e 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -106,8 +106,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("contracts");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -117,8 +117,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -165,8 +165,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -192,8 +192,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -251,14 +251,42 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid=0;
}
+ elseif ($action == 'FICHINTER_CREATE')
+ {
+ $langs->load("other");
+ $langs->load("interventions");
+
+ $object->actiontypecode='AC_OTH_AUTO';
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
+ $object->actionmsg=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
+ $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
+
+ $object->sendtoid=0;
+ $object->fk_element=0;
+ $object->elementtype='';
+ }
elseif ($action == 'FICHINTER_VALIDATE')
{
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
+
+ $object->sendtoid=0;
+ $object->fk_element=0;
+ $object->elementtype='';
+ }
+ elseif ($action == 'FICHINTER_MODIFY')
+ {
+ $langs->load("other");
+ $langs->load("interventions");
+
+ $object->actiontypecode='AC_OTH_AUTO';
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
+ $object->actionmsg=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -267,18 +295,17 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
elseif ($action == 'FICHINTER_SENTBYMAIL')
{
- $langs->load("other");
+ $langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
-
// Parameters $object->sendtoid defined by caller
//$object->sendtoid=0;
}
- elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
+ elseif ($action == 'FICHINTER_CLASSIFYBILLED')
{
$langs->load("other");
$langs->load("interventions");
@@ -290,16 +317,30 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid=0;
}
+ elseif ($action == 'FICHINTER_DELETE')
+ {
+ $langs->load("other");
+ $langs->load("interventions");
+
+ $object->actiontypecode='AC_OTH_AUTO';
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
+ $object->actionmsg=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
+ $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
+
+ $object->sendtoid=0;
+ $object->fk_element=0;
+ $object->elementtype='';
+ }
elseif ($action == 'SHIPPING_VALIDATE')
{
$langs->load("other");
$langs->load("sendings");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
if (empty($object->actionmsg))
{
- $object->actionmsg=$langs->transnoentities("ShippingValidated",$object->ref);
+ $object->actionmsg=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
}
@@ -327,8 +368,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -378,8 +419,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
@@ -433,8 +474,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
- if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
- $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
+ if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
+ $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
index 368f7bdeeb8..940e3a1712d 100644
--- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
+++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
@@ -60,70 +60,12 @@ class InterfaceNotification extends DolibarrTriggers
{
if (empty($conf->notification->enabled)) return 0; // Module not active, we do nothing
- require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
-
- $langs->load("other");
-
- switch ($action) {
- case 'BILL_VALIDATE':
- $dir_output = $conf->facture->dir_output;
- $object_type = 'facture';
- $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
- break;
- case 'ORDER_VALIDATE':
- $dir_output = $conf->commande->dir_output;
- $object_type = 'order';
- $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
- break;
- case 'PROPAL_VALIDATE':
- $dir_output = $conf->propal->dir_output;
- $object_type = 'propal';
- $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
- break;
- case 'FICHINTER_VALIDATE':
- $dir_output = $conf->facture->dir_output;
- $object_type = 'ficheinter';
- $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
- break;
- case 'ORDER_SUPPLIER_APPROVE':
- $dir_output = $conf->fournisseur->dir_output.'/commande/';
- $object_type = 'order_supplier';
- $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
- $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
- $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
- break;
- case 'ORDER_SUPPLIER_REFUSE':
- $dir_output = $conf->fournisseur->dir_output.'/commande/';
- $object_type = 'order_supplier';
- $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
- $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
- $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
- break;
- case 'SHIPPING_VALIDATE':
- $dir_output = $conf->expedition->dir_output.'/sending/';
- $object_type = 'order_supplier';
- $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
- break;
-
- default:
- return 0;
-
- }
-
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
- $ref = dol_sanitizeFileName($object->ref);
- $pdf_path = "$dir_output/$ref/$ref.pdf";
-
- if (!file_exists($pdf_path)) {
- // We can't add PDF as it is not generated yet.
- $filepdf = '';
- } else {
- $filepdf = $pdf_path;
- }
+ require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify = new Notify($this->db);
- $notify->send($action, $object->socid, $mesg, $object_type, $object->id, $filepdf);
+ $notify->send($action, $object);
return 1;
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 14ef8738b73..2510bfea086 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1042,7 +1042,7 @@ else if ($id || $ref)
}
/*
* Confirmation de l'annulation
- */
+ */
if ($action == 'annuler')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
@@ -1434,7 +1434,7 @@ else if ($id || $ref)
$entrepot = new Entrepot($db);
$entrepot->fetch($lines[$i]->entrepot_id);
print $entrepot->getNomUrl(1);
- }
+ }
else if (count($lines[$i]->details_entrepot) > 1)
{
$detail = '';
@@ -1539,7 +1539,7 @@ else if ($id || $ref)
print 'id.'&action=classifybilled">'.$langs->trans($label).' ';
}
}
-
+
if ($user->rights->expedition->supprimer)
{
print 'id.'&action=delete">'.$langs->trans("Delete").' ';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 898a65a05b8..bb34f480d97 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -279,7 +279,7 @@ class Expedition extends CommonObject
{
// Call trigger
$result=$this->call_trigger('SHIPPING_CREATE',$user);
- if ($result < 0) { $error++; }
+ if ($result < 0) { $error++; }
// End call triggers
if (! $error)
@@ -503,9 +503,10 @@ class Expedition extends CommonObject
* Validate object and update stock if option enabled
*
* @param User $user Object user that validate
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if OK, >0 if KO
*/
- function valid($user)
+ function valid($user, $notrigger=0)
{
global $conf, $langs;
@@ -547,6 +548,7 @@ class Expedition extends CommonObject
{
$numref = "EXP".$this->id;
}
+ $this->newref = $numref;
$now=dol_now();
@@ -599,7 +601,7 @@ class Expedition extends CommonObject
// We use warehouse selected for each line
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
if ($result < 0) { $error++; break; }
-
+
if (! empty($conf->productbatch->enabled)) {
$details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid);
foreach ($details as $dbatch) {
@@ -617,9 +619,17 @@ class Expedition extends CommonObject
}
}
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('SHIPPING_VALIDATE',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref='';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
@@ -636,11 +646,17 @@ class Expedition extends CommonObject
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $oldref;
-
- dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($dirdest.'/'.$oldref.'*.*');
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->expedition->dir_output.'/sending/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -653,14 +669,6 @@ class Expedition extends CommonObject
$this->statut = 1;
}
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('SHIPPING_VALIDATE',$user);
- if ($result < 0) { $error++; }
- // End call triggers
- }
-
if (! $error)
{
$this->db->commit();
@@ -723,25 +731,25 @@ class Expedition extends CommonObject
function addline($entrepot_id, $id, $qty)
{
global $conf, $langs;
-
+
$num = count($this->lines);
$line = new ExpeditionLigne($this->db);
$line->entrepot_id = $entrepot_id;
$line->origin_line_id = $id;
$line->qty = $qty;
-
+
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) {
$orderline = new OrderLine($this->db);
$orderline->fetch($id);
$fk_product = $orderline->fk_product;
-
+
if (!empty($orderline->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
$product_type=$product->type;
-
+
if($product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
@@ -866,7 +874,7 @@ class Expedition extends CommonObject
{
// Call trigger
$result=$this->call_trigger('SHIPPING_MODIFY',$user);
- if ($result < 0) { $error++; }
+ if ($result < 0) { $error++; }
// End call triggers
}
}
@@ -914,7 +922,7 @@ class Expedition extends CommonObject
if ($conf->productbatch->enabled) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php';
- if ( ExpeditionLigneBatch::deletefromexp($this->db,$this->id)<0)
+ if ( ExpeditionLigneBatch::deletefromexp($this->db,$this->id)<0)
{$error++;$this->errors[]="Error ".$this->db->lasterror();}
}
// Stock control
@@ -980,7 +988,7 @@ class Expedition extends CommonObject
{
// Call trigger
$result=$this->call_trigger('SHIPPING_DELETE',$user);
- if ($result < 0) { $error++; }
+ if ($result < 0) { $error++; }
// End call triggers
if (! $error)
@@ -1089,22 +1097,22 @@ class Expedition extends CommonObject
while ($i < $num)
{
- $obj = $this->db->fetch_object($resql);
-
- if ($originline == $obj->fk_origin_line) {
+ $obj = $this->db->fetch_object($resql);
+
+ if ($originline == $obj->fk_origin_line) {
$line->entrepot_id = 0; // entrepod_id in details_entrepot
- $line->qty_shipped += $obj->qty_shipped;
+ $line->qty_shipped += $obj->qty_shipped;
} else {
$line = new ExpeditionLigne($this->db);
$line->entrepot_id = $obj->fk_entrepot;
$line->qty_shipped = $obj->qty_shipped;
}
-
+
$detail_entrepot = new stdClass;
$detail_entrepot->entrepot_id = $obj->fk_entrepot;
$detail_entrepot->qty_shipped = $obj->qty_shipped;
$line->details_entrepot[] = $detail_entrepot;
-
+
$line->line_id = $obj->line_id;
$line->fk_origin_line = $obj->fk_origin_line;
$line->origin_line_id = $obj->fk_origin_line; // TODO deprecated
@@ -1151,7 +1159,7 @@ class Expedition extends CommonObject
// Eat-by date
if (! empty($conf->productbatch->enabled)) {
/* test on conf at begining of file sometimes doesn't include expeditionbatch
- * May be conf is not well initialized for dark reason
+ * May be conf is not well initialized for dark reason
*/
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php';
if ($originline != $obj->fk_origin_line) {
@@ -1172,7 +1180,7 @@ class Expedition extends CommonObject
}
$i++;
- $originline = $obj->fk_origin_line;
+ $originline = $obj->fk_origin_line;
}
$this->db->free($resql);
return 1;
@@ -1547,10 +1555,14 @@ class Expedition extends CommonObject
global $conf;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut=2';
- $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;';
- if ($this->db->query($sql) )
+ $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0';
+
+ $resql=$this->db->query($sql);
+ if ($resql)
{
//TODO: Option to set order billed if 100% of order is shipped
+ $this->statut=2;
+ $this->billed=1;
return 1;
}
else
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 07f004ca8d2..f1be4b07021 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
}
// Onglet commande
- $nbrow=7;
+ $nbrow=8;
if (! empty($conf->projet->enabled)) $nbrow++;
print '';
@@ -264,6 +264,7 @@ if ($id > 0 || ! empty($ref))
print dol_print_date($commande->date_livraison,'daytext');
}
print '';
+ // Note on several rows
print ''.$langs->trans('NotePublic').' : ';
print nl2br($commande->note_public);
print ' ';
@@ -277,7 +278,7 @@ if ($id > 0 || ! empty($ref))
if ($action != 'editshippingmethod' && $user->rights->expedition->creer)
print 'id.'">'.img_edit($langs->trans('SetShippingMode'),1).' ';
print '
';
- print '';
+ print ' ';
if ($action == 'editshippingmethod') {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->shipping_method_id, 'shipping_method_id', 1);
} else {
@@ -349,16 +350,16 @@ if ($id > 0 || ! empty($ref))
// Total HT
print ' '.$langs->trans('AmountHT').' ';
- print ''.price($commande->total_ht).' ';
- print ''.$langs->trans('Currency'.$conf->currency).' ';
+ print ''.price($commande->total_ht, 0, '', 1, -1, -1, $conf->currency).' ';
+ print '';
// Total TVA
- print ''.$langs->trans('AmountVAT').' '.price($commande->total_tva).' ';
- print ''.$langs->trans('Currency'.$conf->currency).' ';
+ print ''.$langs->trans('AmountVAT').' '.price($commande->total_tva, 0, '', 1, -1, -1, $conf->currency).' ';
+ print ' ';
// Total TTC
- print ''.$langs->trans('AmountTTC').' '.price($commande->total_ttc).' ';
- print ''.$langs->trans('Currency'.$conf->currency).' ';
+ print ''.$langs->trans('AmountTTC').' '.price($commande->total_ttc, 0, '', 1, -1, -1, $conf->currency).' ';
+ print ' ';
// Statut
print ''.$langs->trans('Status').' ';
diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php
index 4edd52809df..65721bdcce1 100644
--- a/htdocs/fichinter/apercu.php
+++ b/htdocs/fichinter/apercu.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2005 Laurent Destailleur
+ * Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2005-2011 Regis Houssin
* Copyright (C) 2011-2012 Juanjo Menent
*
@@ -40,6 +40,11 @@ $ref = GETPOST('ref','alpha');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
+
+/*
+ * View
+ */
+
llxHeader();
$form = new Form($db);
@@ -154,6 +159,8 @@ if ($id > 0 || ! empty($ref))
print ' ';
print '
';
+
+ dol_fiche_end();
}
else
{
@@ -165,7 +172,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve
if (file_exists($fileimage))
{
- print ' ';
+ print ' ';
}
// Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis))
@@ -178,13 +185,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview))
{
- print '';
+ print '
';
}
}
}
-print '';
-
-$db->close();
llxFooter();
+
+$db->close();
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 983293916b6..b5e874d03a6 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -752,7 +752,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
}
- $actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
+ $actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
}
// Create form object
@@ -1165,13 +1165,13 @@ else if ($id > 0 || ! empty($ref))
$formconfirm='';
- // Confirmation de la suppression de la fiche d'intervention
+ // Confirm deletion of intervention
if ($action == 'delete')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
}
- // Confirmation validation
+ // Confirm validation
if ($action == 'validate')
{
// on verifie si l'objet est en numerotation provisoire
@@ -1191,16 +1191,16 @@ else if ($id > 0 || ! empty($ref))
}
$text=$langs->trans('ConfirmValidateIntervention',$numref);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',1,1);
}
- // Confirmation de la validation de la fiche d'intervention
+ // Confirm back to draft
if ($action == 'modify')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
}
- // Confirmation de la suppression d'une ligne d'intervention
+ // Confirm deletion of line
if ($action == 'ask_deleteline')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
@@ -1599,7 +1599,7 @@ else if ($id > 0 || ! empty($ref))
if ($object->statut == 0 && $user->rights->ficheinter->creer && (count($object->lines) > 0 || ! empty($conf->global->FICHINTER_DISABLE_DETAILS)))
{
print '
';
+ print '>'.$langs->trans("Validate").'';
}
// Modify
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 6f613dda5c8..bc12821530f 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -240,6 +240,7 @@ class Fichinter extends CommonObject
$sql.= ", fk_projet = ".$this->fk_project;
$sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
+ $sql.= ", fk_user_modif = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
@@ -373,9 +374,10 @@ class Fichinter extends CommonObject
* Validate a intervention
*
* @param User $user User that validate
- * @return int <0 if KO, >0 if OK
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
+ * @return int <0 if KO, >0 if OK
*/
- function setValid($user)
+ function setValid($user, $notrigger=0)
{
global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -397,6 +399,7 @@ class Fichinter extends CommonObject
{
$num = $this->ref;
}
+ $this->newref = $num;
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
$sql.= " SET fk_statut = 1";
@@ -415,9 +418,17 @@ class Fichinter extends CommonObject
$error++;
}
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('FICHINTER_VALIDATE',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref = '';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
@@ -425,20 +436,26 @@ class Fichinter extends CommonObject
// Rename of object directory ($this->ref = old ref, $num = new ref)
// to not lose the linked files
$oldref = dol_sanitizeFileName($this->ref);
- $snum = dol_sanitizeFileName($num);
+ $newref = dol_sanitizeFileName($num);
$dirsource = $conf->ficheinter->dir_output.'/'.$oldref;
- $dirdest = $conf->ficheinter->dir_output.'/'.$snum;
+ $dirdest = $conf->ficheinter->dir_output.'/'.$newref;
if (file_exists($dirsource))
{
- dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
+ dol_syslog(get_class($this)."::setValid rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $oldref;
-
- dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->ficheinter->dir_output.'/'.$snum.'/'.$oldref.'*.*');
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->ficheinter->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -453,14 +470,6 @@ class Fichinter extends CommonObject
$this->date_validation=$now;
}
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('FICHINTER_VALIDATE',$user);
- if ($result < 0) { $error++; }
- // End call triggers
- }
-
if (! $error)
{
$this->db->commit();
@@ -619,9 +628,11 @@ class Fichinter extends CommonObject
global $conf;
$sql = "SELECT f.rowid,";
- $sql.= " datec,";
+ $sql.= " f.datec,";
+ $sql.= " f.tms as date_modification,";
$sql.= " f.date_valid as datev,";
$sql.= " f.fk_user_author,";
+ $sql.= " f.fk_user_modif as fk_user_modification,";
$sql.= " f.fk_user_valid";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= " WHERE f.rowid = ".$id;
@@ -637,6 +648,7 @@ class Fichinter extends CommonObject
$this->id = $obj->rowid;
$this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->date_modification);
$this->date_validation = $this->db->jdate($obj->datev);
$cuser = new User($this->db);
@@ -649,6 +661,13 @@ class Fichinter extends CommonObject
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
+ if ($obj->fk_user_modification)
+ {
+ $muser = new User($this->db);
+ $muser->fetch($obj->fk_user_modification);
+ $this->user_modification = $muser;
+ }
+
}
$this->db->free($resql);
}
@@ -805,7 +824,8 @@ class Fichinter extends CommonObject
if ($user->rights->ficheinter->creer)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
- $sql.= " SET description = '".$this->db->escape($description)."'";
+ $sql.= " SET description = '".$this->db->escape($description)."',";
+ $sql.= " fk_user_modif = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index b3858c5f4aa..076ad9bc689 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -49,7 +49,11 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
-if (! $sortfield) $sortfield="fd.date";
+if (! $sortfield)
+{
+ if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sortfield="fd.date";
+ else $sortfield="f.ref";
+}
$limit = $conf->liste_limit;
$search_ref=GETPOST('search_ref','alpha');
@@ -70,13 +74,12 @@ llxHeader('', $langs->trans("Intervention"));
$sql = "SELECT";
$sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,";
-$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
+if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
$sql.= " s.nom as name, s.rowid as socid, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
-if (! $user->rights->societe->client->voir && empty($socid))
- $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f)";
-$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
+if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
$sql.= " WHERE f.fk_soc = s.rowid ";
$sql.= " AND f.entity = ".$conf->entity;
if ($search_ref) {
@@ -86,7 +89,8 @@ if ($search_company) {
$sql .= natural_search('s.nom', $search_company);
}
if ($search_desc) {
- $sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
+ if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
+ else $sql .= natural_search(array('f.description'), $search_desc);
}
if ($search_status != '' && $search_status >= 0) {
$sql .= ' AND f.fk_statut = '.$search_status;
@@ -97,6 +101,7 @@ if ($socid)
$sql.= " AND s.rowid = " . $socid;
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset);
+//print $sql;
$result=$db->query($sql);
if ($result)
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 7983060490d..d5f4f400d5a 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -317,9 +317,10 @@ class CommandeFournisseur extends CommonOrder
*
* @param User $user Validator User
* @param int $idwarehouse Id of warehouse to use for stock decrease
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if KO, >0 if OK
*/
- function valid($user,$idwarehouse=0)
+ function valid($user,$idwarehouse=0,$notrigger=0)
{
global $langs,$conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -342,12 +343,13 @@ class CommandeFournisseur extends CommonOrder
$num = $this->getNextNumRef($soc);
}
else
- {
+ {
$num = $this->ref;
}
+ $this->newref = $num;
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur";
- $sql.= " SET ref='".$num."',";
+ $sql.= " SET ref='".$this->db->escape($num)."',";
$sql.= " fk_statut = 1,";
$sql.= " date_valid='".$this->db->idate(dol_now())."',";
$sql.= " fk_user_valid = ".$user->id;
@@ -361,9 +363,17 @@ class CommandeFournisseur extends CommonOrder
$error++;
}
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('ORDER_SUPPLIER_VALIDATE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref='';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
@@ -380,11 +390,17 @@ class CommandeFournisseur extends CommonOrder
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $oldref;
-
dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($dirdest.'/'.$oldref.'*.*');
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->fournisseur->dir_output.'/commande/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -397,18 +413,6 @@ class CommandeFournisseur extends CommonOrder
$this->ref = $num;
}
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('ORDER_SUPPLIER_VALIDATE',$user);
- if ($result < 0)
- {
- $this->db->rollback();
- return -1;
- }
- // End call triggers
- }
-
if (! $error)
{
$this->db->commit();
@@ -619,9 +623,10 @@ class CommandeFournisseur extends CommonOrder
$num = $this->getNextNumRef($soc);
}
else
- {
+ {
$num = $this->ref;
}
+ $this->newref = $num;
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
$sql.= " SET ref='".$this->db->escape($num)."',";
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 9c72319f74f..988ee0b6a96 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -257,7 +257,7 @@ class FactureFournisseur extends CommonInvoice
{
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
if (! $error)
@@ -413,7 +413,7 @@ class FactureFournisseur extends CommonInvoice
$this->socid = $obj->socid;
$this->socnom = $obj->socnom;
-
+
// Retreive all extrafield
// fetch optionals attributes and labels
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
@@ -611,7 +611,7 @@ class FactureFournisseur extends CommonInvoice
{
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_UPDATE',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
}
}
@@ -682,9 +682,9 @@ class FactureFournisseur extends CommonInvoice
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_DELETE',$user);
if ($result < 0)
- {
+ {
$this->db->rollback();
- return -1;
+ return -1;
}
// Fin appel triggers
}
@@ -776,7 +776,7 @@ class FactureFournisseur extends CommonInvoice
{
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_PAYED',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
}
else
@@ -824,7 +824,7 @@ class FactureFournisseur extends CommonInvoice
{
// Call trigger
$result=$this->call_trigger('BILL_SUPPLIER_UNPAYED',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
}
else
@@ -852,9 +852,10 @@ class FactureFournisseur extends CommonInvoice
* @param User $user Object user that validate
* @param string $force_number Reference to force on invoice
* @param int $idwarehouse Id of warehouse for stock change
+ * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if KO, =0 if nothing to do, >0 if OK
*/
- function validate($user, $force_number='', $idwarehouse=0)
+ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0)
{
global $conf,$langs;
@@ -886,9 +887,10 @@ class FactureFournisseur extends CommonInvoice
$num = $this->getNextNumRef($this->client);
}
else
- {
+ {
$num = $this->ref;
}
+ $this->newref = $num;
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
$sql.= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id;
@@ -920,31 +922,46 @@ class FactureFournisseur extends CommonInvoice
}
}
+ // Triggers call
+ if (! $error && $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
+
if (! $error)
{
- $this->oldref = '';
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
// On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
// in order not to lose the attached files
- $facref = dol_sanitizeFileName($this->ref);
- $snumfa = dol_sanitizeFileName($num);
+ $oldref = dol_sanitizeFileName($this->ref);
+ $newref = dol_sanitizeFileName($num);
- $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
- $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa;
+ $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$oldref;
+ $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $facref;
-
dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -958,15 +975,6 @@ class FactureFournisseur extends CommonInvoice
//$this->date_validation=$now; this is stored into log table
}
- // Triggers call
- if (! $error)
- {
- // Call trigger
- $result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user);
- if ($result < 0) $error++;
- // End call triggers
- }
-
if (! $error)
{
$this->db->commit();
@@ -1128,8 +1136,8 @@ class FactureFournisseur extends CommonInvoice
global $conf, $langs, $user;
// Call trigger
$result=$this->call_trigger('LINEBILL_SUPPLIER_CREATE',$user);
- if ($result < 0)
- {
+ if ($result < 0)
+ {
$this->db->rollback();
return -1;
}
@@ -1224,7 +1232,7 @@ class FactureFournisseur extends CommonInvoice
}
$this->db->begin();
-
+
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
$sql.= " description ='".$this->db->escape($desc)."'";
$sql.= ", pu_ht = ".price2num($pu_ht);
@@ -1258,8 +1266,8 @@ class FactureFournisseur extends CommonInvoice
global $conf, $langs, $user;
// Call trigger
$result=$this->call_trigger('LINEBILL_SUPPLIER_UPDATE',$user);
- if ($result < 0)
- {
+ if ($result < 0)
+ {
$this->db->rollback();
return -1;
}
@@ -1270,7 +1278,7 @@ class FactureFournisseur extends CommonInvoice
$result=$this->update_price('','auto');
$this->db->commit();
-
+
return $result;
}
else
@@ -1303,7 +1311,7 @@ class FactureFournisseur extends CommonInvoice
{
// Call trigger
$result=$this->call_trigger('LINEBILL_SUPPLIER_DELETE',$user);
- if ($result < 0) $error++;
+ if ($result < 0) $error++;
// End call triggers
}
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index c8db601a8d9..7f58e6ddd6e 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2288,21 +2288,24 @@ else
*/
$somethingshown=$object->showLinkedObjectBlock();
+ $linktoelem='';
+
if (empty($somethingshown) && ! empty($conf->fournisseur->enabled))
{
- print '' . $langs->trans('LinkedOrder') . ' ';
+ $linktoelem.=($linktoelem?' ':'').'' . $langs->trans('LinkedOrder') . ' ';
print '
';
- print '';
+ print '
';
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_supplier, c.total_ht";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
@@ -2314,7 +2317,7 @@ else
$num = $db->num_rows($resqlorderlist);
$i = 0;
- print '
';
$db->free($resqlorderlist);
} else {
@@ -2351,6 +2354,9 @@ else
print '
';
}
+ // Show link to elements
+ if ($linktoelem) print '
'.$linktoelem;
+
print '
';
//print '
';
//print ' ';
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index e490c727a30..9439fc534bd 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
@@ -109,8 +110,10 @@ llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:Factur
$sql = "SELECT s.rowid as socid, s.nom as name, ";
$sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, fac.date_lim_reglement as date_echeance,";
$sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle";
+if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) $sql.=", p.rowid as project_id, p.ref as project_ref";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac";
+if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = fac.fk_projet";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE fac.entity = ".$conf->entity;
$sql.= " AND fac.fk_soc = s.rowid";
@@ -212,6 +215,7 @@ if ($resql)
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
+ if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="center"',$sortfield,$sortorder);
@@ -239,7 +243,13 @@ if ($resql)
print ' ';
print '
';
print ' ';
- print ' ';
+ print ' ';
+ if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS))
+ {
+ print '
';
+ print ' ';
+ }
+ print '
';
print ' ';
print ' ';
print ' ';
@@ -252,6 +262,7 @@ if ($resql)
$facturestatic=new FactureFournisseur($db);
$supplierstatic=new Fournisseur($db);
+ $projectstatic=new Project($db);
$var=true;
$total=0;
@@ -281,6 +292,15 @@ if ($resql)
$supplierstatic->id=$obj->socid;
$supplierstatic->name=$obj->name;
print $supplierstatic->getNomUrl(1,'',12);
+ print ' ';
+ if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS))
+ {
+ $projectstatic->id=$obj->project_id;
+ $projectstatic->ref=$obj->project_ref;
+ print '
';
+ if ($obj->project_id > 0) print $projectstatic->getNomUrl(1);
+ print ' ';
+ }
print '
'.price($obj->total_ht).' ';
print '
'.price($obj->total_ttc).' ';
$total+=$obj->total_ht;
@@ -301,6 +321,7 @@ if ($resql)
// Print total
print '
';
print ''.$langs->trans("Total").' ';
+ if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print ' ';
print ''.price($total).' ';
print ''.price($total_ttc).' ';
print ' ';
diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
index 211d6c4ad8f..a6d9164a91c 100644
--- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
@@ -32,6 +32,7 @@ echo ' ';
if ($num > 1) print_titre($langs->trans("RelatedBills"));
else print_titre($langs->trans("RelatedBill"));
?>
+
trans("Ref"); ?>
diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php
old mode 100755
new mode 100644
diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php
index 9b0d1bbba62..04a96a7001d 100644
--- a/htdocs/holiday/index.php
+++ b/htdocs/holiday/index.php
@@ -257,7 +257,7 @@ print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_use
print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder);
-print_liste_field_titre($langs->trans("Duration"));
+print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder);
print ' ';
print " \n";
diff --git a/htdocs/holiday/tomergewithdefine_holiday.php b/htdocs/holiday/tomergewithdefine_holiday.php
old mode 100755
new mode 100644
diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql
index 497b85d4059..a6c0efc77a6 100644
--- a/htdocs/install/mysql/data/llx_00_c_country.sql
+++ b/htdocs/install/mysql/data/llx_00_c_country.sql
@@ -5,6 +5,7 @@
-- Copyright (C) 2004 Guillaume Delecourt
-- Copyright (C) 2005-2009 Regis Houssin
-- Copyright (C) 2007 Patrick Raguin
+-- Copyright (C) 2014 Alexandre Spangaro
--
-- 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
@@ -26,247 +27,247 @@
--
-- delete from llx_c_country;
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (0,'',NULL,'-',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (1,'FR','FRA','France',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (2,'BE','BEL','Belgium',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (3,'IT','ITA','Italy',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (4,'ES','ESP','Spain',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (5,'DE','DEU','Germany',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (6,'CH','CHE','Switzerland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (7,'GB','GBR','United Kingdom',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (8,'IE','IRL','Irland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (9,'CN','CHN','China',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (10,'TN','TUN','Tunisia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (11,'US','USA','United States',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (12,'MA','MAR','Maroc',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (13,'DZ','DZA','Algeria',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (14,'CA','CAN','Canada',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (15,'TG','TGO','Togo',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (16,'GA','GAB','Gabon',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (17,'NL','NLD','Nerderland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (18,'HU','HUN','Hongrie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (19,'RU','RUS','Russia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (20,'SE','SWE','Sweden',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (22,'SN','SEN','Senegal',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (23,'AR','ARG','Argentine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (24,'CM','CMR','Cameroun',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (25,'PT','PRT','Portugal',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (26,'SA','SAU','Saudi Arabia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (27,'MC','MCO','Monaco',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (28,'AU','AUS','Australia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (29,'SG','SGP','Singapour',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (30,'AF','AFG','Afghanistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (31,'AX','ALA','Iles Aland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (32,'AL','ALB','Albanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (33,'AS','ASM','Samoa américaines',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (34,'AD','AND','Andorre',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (35,'AO','AGO','Angola',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (36,'AI','AIA','Anguilla',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (37,'AQ','ATA','Antarctique',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (39,'AM','ARM','Arménie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (40,'AW','ABW','Aruba',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (41,'AT','AUT','Autriche',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (43,'BS','BHS','Bahamas',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (44,'BH','BHR','Bahreïn',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (45,'BD','BGD','Bangladesh',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (46,'BB','BRB','Barbade',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (47,'BY','BLR','Biélorussie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (48,'BZ','BLZ','Belize',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (49,'BJ','BEN','Bénin',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (50,'BM','BMU','Bermudes',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (51,'BT','BTN','Bhoutan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (52,'BO','BOL','Bolivie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (54,'BW','BWA','Botswana',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (55,'BV','BVT','Ile Bouvet',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (56,'BR','BRA','Brazil',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (58,'BN','BRN','Brunei',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (59,'BG','BGR','Bulgarie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (60,'BF','BFA','Burkina Faso',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (61,'BI','BDI','Burundi',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (62,'KH','KHM','Cambodge',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (63,'CV','CPV','Cap-Vert',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (64,'KY','CYM','Iles Cayman',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (65,'CF','CAF','République centrafricaine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (66,'TD','TCD','Tchad',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (67,'CL','CHL','Chili',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (68,'CX','CXR','Ile Christmas',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (70,'CO','COL','Colombie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (71,'KM','COM','Comores',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (72,'CG','COG','Congo',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (73,'CD','COD','République démocratique du Congo',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (74,'CK','COK','Iles Cook',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (75,'CR','CRI','Costa Rica',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (76,'HR','HRV','Croatie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (77,'CU','CUB','Cuba',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (78,'CY','CYP','Chypre',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (79,'CZ','CZE','République Tchèque',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (80,'DK','DNK','Danemark',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (81,'DJ','DJI','Djibouti',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (82,'DM','DMA','Dominique',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (83,'DO','DOM','République Dominicaine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (84,'EC','ECU','Equateur',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (85,'EG','EGY','Egypte',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (86,'SV','SLV','Salvador',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (88,'ER','ERI','Erythrée',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (89,'EE','EST','Estonia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (90,'ET','ETH','Ethiopie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (91,'FK','FLK','Iles Falkland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (92,'FO','FRO','Iles Féroé',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (93,'FJ','FJI','Iles Fidji',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (94,'FI','FIN','Finlande',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (95,'GF','GUF','Guyane française',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (96,'PF','PYF','Polynésie française',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (97,'TF','ATF','Terres australes françaises',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (98,'GM','GMB','Gambie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (99,'GE','GEO','Georgia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (100,'GH','GHA','Ghana',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (101,'GI','GIB','Gibraltar',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (102,'GR','GRC','Greece',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (103,'GL','GRL','Groenland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (104,'GD','GRD','Grenade',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (106,'GU','GUM','Guam',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (107,'GT','GTM','Guatemala',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (108,'GN','GIN','Guinea',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (109,'GW','GNB','Guinea-Bissao',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (111,'HT','HTI','Haiti',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (114,'HN','HND','Honduras',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (115,'HK','HKG','Hong Kong',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (116,'IS','ISL','Islande',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (117,'IN','IND','India',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (118,'ID','IDN','Indonésie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (119,'IR','IRN','Iran',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (120,'IQ','IRQ','Iraq',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (121,'IL','ISR','Israel',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (122,'JM','JAM','Jamaïque',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (123,'JP','JPN','Japon',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (124,'JO','JOR','Jordanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (125,'KZ','KAZ','Kazakhstan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (126,'KE','KEN','Kenya',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (127,'KI','KIR','Kiribati',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (128,'KP','PRK','North Corea',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (129,'KR','KOR','South Corea',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (130,'KW','KWT','Koweït',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (131,'KG','KGZ','Kirghizistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (132,'LA','LAO','Laos',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (133,'LV','LVA','Lettonie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (134,'LB','LBN','Liban',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (135,'LS','LSO','Lesotho',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (136,'LR','LBR','Liberia',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (137,'LY','LBY','Libye',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (138,'LI','LIE','Liechtenstein',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (139,'LT','LTU','Lituanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (140,'LU','LUX','Luxembourg',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (141,'MO','MAC','Macao',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (143,'MG','MDG','Madagascar',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (144,'MW','MWI','Malawi',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (145,'MY','MYS','Malaisie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (146,'MV','MDV','Maldives',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (147,'ML','MLI','Mali',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (148,'MT','MLT','Malte',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (149,'MH','MHL','Iles Marshall',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (151,'MR','MRT','Mauritanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (152,'MU','MUS','Maurice',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (153,'YT','MYT','Mayotte',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (154,'MX','MEX','Mexique',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (155,'FM','FSM','Micronésie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (156,'MD','MDA','Moldavie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (157,'MN','MNG','Mongolie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (158,'MS','MSR','Monserrat',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (159,'MZ','MOZ','Mozambique',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (161,'NA','NAM','Namibie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (162,'NR','NRU','Nauru',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (163,'NP','NPL','Népal',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (167,'NI','NIC','Nicaragua',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (168,'NE','NER','Niger',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (169,'NG','NGA','Nigeria',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (170,'NU','NIU','Nioué',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (171,'NF','NFK','Ile Norfolk',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (172,'MP','MNP','Mariannes du Nord',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (173,'NO','NOR','Norvège',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (174,'OM','OMN','Oman',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (175,'PK','PAK','Pakistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (176,'PW','PLW','Palaos',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (178,'PA','PAN','Panama',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (180,'PY','PRY','Paraguay',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (181,'PE','PER','Peru',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (182,'PH','PHL','Philippines',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (183,'PN','PCN','Iles Pitcairn',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (184,'PL','POL','Pologne',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (185,'PR','PRI','Porto Rico',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (186,'QA','QAT','Qatar',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (188,'RO','ROU','Roumanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (189,'RW','RWA','Rwanda',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (190,'SH','SHN','Sainte-Hélène',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (192,'LC','LCA','Sainte-Lucie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (195,'WS','WSM','Samoa',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (196,'SM','SMR','Saint-Marin',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (198,'RS','SRB','Serbie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (199,'SC','SYC','Seychelles',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (200,'SL','SLE','Sierra Leone',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (201,'SK','SVK','Slovaquie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (202,'SI','SVN','Slovénie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (203,'SB','SLB','Iles Salomon',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (204,'SO','SOM','Somalie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (207,'LK','LKA','Sri Lanka',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (208,'SD','SDN','Soudan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (209,'SR','SUR','Suriname',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (211,'SZ','SWZ','Swaziland',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (212,'SY','SYR','Syrie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (213,'TW','TWN','Taïwan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (214,'TJ','TJK','Tadjikistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (215,'TZ','TZA','Tanzanie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (216,'TH','THA','Thaïlande',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (217,'TL','TLS','Timor Oriental',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (218,'TK','TKL','Tokélaou',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (219,'TO','TON','Tonga',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (221,'TR','TUR','Turquie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (222,'TM','TKM','Turkménistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (224,'TV','TUV','Tuvalu',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (225,'UG','UGA','Ouganda',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (226,'UA','UKR','Ukraine',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (227,'AE','ARE','Émirats arabes unis',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (229,'UY','URY','Uruguay',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (230,'UZ','UZB','Ouzbékistan',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (231,'VU','VUT','Vanuatu',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (232,'VE','VEN','Vénézuela',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (233,'VN','VNM','Viêt Nam',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (237,'EH','ESH','Sahara occidental',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (238,'YE','YEM','Yémen',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (239,'ZM','ZMB','Zambie',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (240,'ZW','ZWE','Zimbabwe',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (241,'GG','GGY','Guernesey',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (242,'IM','IMN','Ile de Man',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (243,'JE','JEY','Jersey',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (244,'ME','MNE','Monténégro',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (246,'MF','MAF','Saint-Martin',1);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (247,'BU', null, 'Burundi',1);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (0,'',NULL,'-',1,1);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (1,'FR','FRA','France',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (2,'BE','BEL','Belgium',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (3,'IT','ITA','Italy',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (4,'ES','ESP','Spain',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (5,'DE','DEU','Germany',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (6,'CH','CHE','Switzerland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (7,'GB','GBR','United Kingdom',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (8,'IE','IRL','Irland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (9,'CN','CHN','China',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (10,'TN','TUN','Tunisia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (11,'US','USA','United States',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (12,'MA','MAR','Maroc',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (13,'DZ','DZA','Algeria',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (14,'CA','CAN','Canada',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (15,'TG','TGO','Togo',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (16,'GA','GAB','Gabon',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (17,'NL','NLD','Nerderland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (18,'HU','HUN','Hongrie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (19,'RU','RUS','Russia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (20,'SE','SWE','Sweden',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (21,'CI','CIV','Côte d''Ivoire',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (22,'SN','SEN','Senegal',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (23,'AR','ARG','Argentine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24,'CM','CMR','Cameroun',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (25,'PT','PRT','Portugal',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (26,'SA','SAU','Saudi Arabia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (27,'MC','MCO','Monaco',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (28,'AU','AUS','Australia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (29,'SG','SGP','Singapour',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (30,'AF','AFG','Afghanistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (31,'AX','ALA','Iles Aland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (32,'AL','ALB','Albanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (33,'AS','ASM','Samoa américaines',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (34,'AD','AND','Andorre',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (35,'AO','AGO','Angola',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (36,'AI','AIA','Anguilla',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (37,'AQ','ATA','Antarctique',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (39,'AM','ARM','Arménie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (40,'AW','ABW','Aruba',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (41,'AT','AUT','Autriche',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (42,'AZ','AZE','Azerbaïdjan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (43,'BS','BHS','Bahamas',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (44,'BH','BHR','Bahreïn',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (45,'BD','BGD','Bangladesh',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (46,'BB','BRB','Barbade',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (47,'BY','BLR','Biélorussie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (48,'BZ','BLZ','Belize',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (49,'BJ','BEN','Bénin',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (50,'BM','BMU','Bermudes',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (51,'BT','BTN','Bhoutan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (52,'BO','BOL','Bolivie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (54,'BW','BWA','Botswana',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (55,'BV','BVT','Ile Bouvet',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (56,'BR','BRA','Brazil',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (58,'BN','BRN','Brunei',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (59,'BG','BGR','Bulgarie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (60,'BF','BFA','Burkina Faso',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (61,'BI','BDI','Burundi',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (62,'KH','KHM','Cambodge',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (63,'CV','CPV','Cap-Vert',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (64,'KY','CYM','Iles Cayman',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (65,'CF','CAF','République centrafricaine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (66,'TD','TCD','Tchad',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (67,'CL','CHL','Chili',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (68,'CX','CXR','Ile Christmas',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (70,'CO','COL','Colombie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (71,'KM','COM','Comores',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (72,'CG','COG','Congo',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (73,'CD','COD','République démocratique du Congo',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (74,'CK','COK','Iles Cook',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (75,'CR','CRI','Costa Rica',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (76,'HR','HRV','Croatie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (77,'CU','CUB','Cuba',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (78,'CY','CYP','Chypre',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','République Tchèque',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Danemark',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (81,'DJ','DJI','Djibouti',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominique',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','République Dominicaine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Equateur',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypte',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','Salvador',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Iles Falkland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (92,'FO','FRO','Iles Féroé',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (93,'FJ','FJI','Iles Fidji',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (94,'FI','FIN','Finlande',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (95,'GF','GUF','Guyane française',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (96,'PF','PYF','Polynésie française',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (97,'TF','ATF','Terres australes françaises',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (98,'GM','GMB','Gambie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (99,'GE','GEO','Georgia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (100,'GH','GHA','Ghana',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (101,'GI','GIB','Gibraltar',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (102,'GR','GRC','Greece',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (103,'GL','GRL','Groenland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (104,'GD','GRD','Grenade',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (106,'GU','GUM','Guam',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (107,'GT','GTM','Guatemala',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (108,'GN','GIN','Guinea',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (109,'GW','GNB','Guinea-Bissao',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (111,'HT','HTI','Haiti',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (112,'HM','HMD','Iles Heard et McDonald',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (114,'HN','HND','Honduras',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (115,'HK','HKG','Hong Kong',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (116,'IS','ISL','Islande',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (117,'IN','IND','India',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (118,'ID','IDN','Indonésie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (119,'IR','IRN','Iran',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (120,'IQ','IRQ','Iraq',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (121,'IL','ISR','Israel',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (122,'JM','JAM','Jamaïque',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (123,'JP','JPN','Japon',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (124,'JO','JOR','Jordanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (125,'KZ','KAZ','Kazakhstan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (126,'KE','KEN','Kenya',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (127,'KI','KIR','Kiribati',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (128,'KP','PRK','North Corea',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (129,'KR','KOR','South Corea',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (130,'KW','KWT','Koweït',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (131,'KG','KGZ','Kirghizistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (132,'LA','LAO','Laos',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (133,'LV','LVA','Lettonie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (134,'LB','LBN','Liban',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (135,'LS','LSO','Lesotho',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (136,'LR','LBR','Liberia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (137,'LY','LBY','Libye',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (138,'LI','LIE','Liechtenstein',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (139,'LT','LTU','Lituanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (140,'LU','LUX','Luxembourg',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (141,'MO','MAC','Macao',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (143,'MG','MDG','Madagascar',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (144,'MW','MWI','Malawi',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (145,'MY','MYS','Malaisie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (146,'MV','MDV','Maldives',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (147,'ML','MLI','Mali',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (148,'MT','MLT','Malte',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (149,'MH','MHL','Iles Marshall',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (151,'MR','MRT','Mauritanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (152,'MU','MUS','Maurice',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (153,'YT','MYT','Mayotte',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (154,'MX','MEX','Mexique',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (155,'FM','FSM','Micronésie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (156,'MD','MDA','Moldavie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (157,'MN','MNG','Mongolie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (158,'MS','MSR','Monserrat',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (159,'MZ','MOZ','Mozambique',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (161,'NA','NAM','Namibie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (162,'NR','NRU','Nauru',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (163,'NP','NPL','Népal',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (164,'AN',NULL,'Antilles néerlandaises',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (167,'NI','NIC','Nicaragua',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (168,'NE','NER','Niger',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (169,'NG','NGA','Nigeria',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Nioué',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Ile Norfolk',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Mariannes du Nord',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norvège',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (174,'OM','OMN','Oman',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (175,'PK','PAK','Pakistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palaos',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (178,'PA','PAN','Panama',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (180,'PY','PRY','Paraguay',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (181,'PE','PER','Peru',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (182,'PH','PHL','Philippines',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Iles Pitcairn',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Porto Rico',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Sainte-Hélène',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Sainte-Lucie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (195,'WS','WSM','Samoa',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','Saint-Marin',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (199,'SC','SYC','Seychelles',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (200,'SL','SLE','Sierra Leone',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovaquie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovénie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Iles Salomon',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (205,'ZA','ZAF','Afrique du Sud',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (207,'LK','LKA','Sri Lanka',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (208,'SD','SDN','Soudan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (209,'SR','SUR','Suriname',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (211,'SZ','SWZ','Swaziland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (212,'SY','SYR','Syrie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (213,'TW','TWN','Taïwan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (214,'TJ','TJK','Tadjikistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (215,'TZ','TZA','Tanzanie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (216,'TH','THA','Thaïlande',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (217,'TL','TLS','Timor Oriental',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (218,'TK','TKL','Tokélaou',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (219,'TO','TON','Tonga',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (220,'TT','TTO','Trinité-et-Tobago',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (221,'TR','TUR','Turquie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (222,'TM','TKM','Turkménistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (224,'TV','TUV','Tuvalu',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (225,'UG','UGA','Ouganda',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (226,'UA','UKR','Ukraine',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (227,'AE','ARE','Émirats arabes unis',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (229,'UY','URY','Uruguay',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (230,'UZ','UZB','Ouzbékistan',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (231,'VU','VUT','Vanuatu',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (232,'VE','VEN','Vénézuela',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (233,'VN','VNM','Viêt Nam',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (234,'VG','VGB','Iles Vierges britanniques',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (235,'VI','VIR','Iles Vierges américaines',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (236,'WF','WLF','Wallis-et-Futuna',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (237,'EH','ESH','Sahara occidental',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (238,'YE','YEM','Yémen',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (239,'ZM','ZMB','Zambie',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (240,'ZW','ZWE','Zimbabwe',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (241,'GG','GGY','Guernesey',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (242,'IM','IMN','Ile de Man',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (243,'JE','JEY','Jersey',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (244,'ME','MNE','Monténégro',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (245,'BL','BLM','Saint-Barthélemy',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (246,'MF','MAF','Saint-Martin',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (247,'BU', null, 'Burundi',1,0);
diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql
index 6eddd5883c8..67363b98c72 100644
--- a/htdocs/install/mysql/data/llx_c_action_trigger.sql
+++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql
@@ -32,7 +32,6 @@
-- List of all managed triggered events (used for trigger agenda and for notification)
--
delete from llx_c_action_trigger;
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13);
@@ -51,20 +50,21 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19);
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 645d99a64ef..c2e10543b7a 100644
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -19,6 +19,13 @@
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
+--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19);
+--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19);
+
+ALTER TABLE llx_notify ADD COLUMN fk_soc integer NULL after fk_action;
+
ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer;
ALTER TABLE llx_c_actioncomm ADD COLUMN color varchar(9);
@@ -1088,6 +1095,9 @@ ALTER TABLE llx_usergroup_extrafields ADD INDEX idx_usergroup_extrafields (fk_ob
ALTER TABLE llx_contrat ADD COLUMN model_pdf varchar(255) DEFAULT NULL AFTER note_public;
+ALTER TABLE llx_c_country ADD COLUMN favorite tinyint DEFAULT 0 AFTER active;
+UPDATE llx_c_country SET favorite = '1' WHERE rowid = '0';
+
ALTER TABLE llx_c_email_templates DROP INDEX uk_c_email_templates;
ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, label, lang);
ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template);
@@ -1098,4 +1108,5 @@ DELETE FROM llx_const WHERE name = 'OSC_DB_HOST';
DELETE FROM llx_menu WHERE module = 'boutique';
-- Add option always editable on extrafield
-ALTER TABLE llx_extrafields ADD alwayseditable INT(11) NOT NULL AFTER pos;
+ALTER TABLE llx_extrafields ADD alwayseditable INTEGER DEFAULT 0 AFTER pos;
+
diff --git a/htdocs/install/mysql/tables/llx_c_country.sql b/htdocs/install/mysql/tables/llx_c_country.sql
index f9c69a5093b..503cc0eec06 100644
--- a/htdocs/install/mysql/tables/llx_c_country.sql
+++ b/htdocs/install/mysql/tables/llx_c_country.sql
@@ -1,6 +1,7 @@
-- ========================================================================
--- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville
--- Copyright (C) 2004 Laurent Destailleur
+-- Copyright (C) 2001-2004 Rodolphe Quiedeville
+-- Copyright (C) 2004 Laurent Destailleur
+-- Copyright (C) 2014 Alexandre Spangaro
--
-- 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
@@ -23,5 +24,6 @@ create table llx_c_country
code varchar(2) NOT NULL,
code_iso varchar(3) ,
label varchar(50) NOT NULL,
- active tinyint DEFAULT 1 NOT NULL
+ active tinyint DEFAULT 1 NOT NULL,
+ favorite tinyint DEFAULT 0 NOT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql
index 04963eb3905..f91d21fedb1 100644
--- a/htdocs/install/mysql/tables/llx_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_extrafields.sql
@@ -20,11 +20,11 @@
create table llx_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- name varchar(64) NOT NULL, -- nom de l'attribut
+ name varchar(64) NOT NULL, -- nom de l'attribut
entity integer DEFAULT 1 NOT NULL, -- multi company id
elementtype varchar(64) NOT NULL DEFAULT 'member',
tms timestamp,
- label varchar(255) NOT NULL, -- label correspondant a l'attribut
+ label varchar(255) NOT NULL, -- label correspondant a l'attribut
type varchar(8),
size varchar(8) DEFAULT NULL,
fieldunique integer DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_notify.sql b/htdocs/install/mysql/tables/llx_notify.sql
index fa2936db0fb..21a7b833dec 100644
--- a/htdocs/install/mysql/tables/llx_notify.sql
+++ b/htdocs/install/mysql/tables/llx_notify.sql
@@ -23,6 +23,7 @@ create table llx_notify
tms timestamp,
daten datetime, -- date de la notification
fk_action integer NOT NULL,
+ fk_soc integer NULL,
fk_contact integer NULL,
fk_user integer NULL,
objet_type varchar(24) NOT NULL,
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 28e19dd838d..34f31092bfc 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -484,7 +484,7 @@ Module500Desc=Management of special expenses like taxes, social contribution, di
Module510Name=Salaries
Module510Desc=Management of employees salaries and payments
Module600Name=Notifications
-Module600Desc=Send notifications by email on some Dolibarr business events to third party contacts
+Module600Desc=Send EMail notifications on some Dolibarr business events to third-party contacts (setup defined on each thirdparty)
Module700Name=Donations
Module700Desc=Donation management
Module1200Name=Mantis
@@ -1074,7 +1074,7 @@ ModuleCompanyCodeAquarium=Return an accountancy code built by: %s followed by
ModuleCompanyCodePanicum=Return an empty accountancy code.
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
UseNotifications=Use notifications
-NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events, to third parties (customers or suppliers) that are configured to. Choice of active notification and targets contacts is made one third party at time.
+NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events. Targets of notifications can be defined: * per third parties contacts (customers or suppliers), one third party at time. * or by setting a global target email address on module setup page.
ModelModules=Documents templates
DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT or .ODS files for OpenOffice, KOffice, TextEdit,...)
WatermarkOnDraft=Watermark on draft document
@@ -1382,9 +1382,10 @@ MailingSetup=EMailing module setup
MailingEMailFrom=Sender EMail (From) for emails sent by emailing module
MailingEMailError=Return EMail (Errors-to) for emails with errors
##### Notification #####
-NotificationSetup=Notification bu email module setup
+NotificationSetup=EMail notification module setup
NotificationEMailFrom=Sender EMail (From) for emails sent for notifications
-ListOfAvailableNotifications=List of available notifications (This list depends on activated modules)
+ListOfAvailableNotifications=List of events you can set notification on, for each thirdparty (go into thirdparty card to setup) or by setting a fixed email (List depends on activated modules)
+FixedEmailTarget=Fixed email target
##### Sendings #####
SendingsSetup=Sending module setup
SendingsReceiptModel=Sending receipt model
@@ -1535,6 +1536,7 @@ DeleteFiscalYear=Delete fiscal year
ConfirmDeleteFiscalYear=Are you sure to delete this fiscal year ?
Opened=Opened
Closed=Closed
+AlwaysEditable=Can always be edited
Format=Format
TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 227f7a61118..84383b46f1f 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -89,5 +89,5 @@ ExtSiteUrlAgenda=URL to access .ical file
ExtSiteNoLabel=No Description
WorkingTimeRange=Working time range
WorkingDaysRange=Working days range
-AddEvent=Add event
+AddEvent=Create event
MyAvailability=My availability
\ No newline at end of file
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 0af0a26fd19..5c16e18e4cf 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -28,8 +28,8 @@ InvoiceAvoir=Credit note
InvoiceAvoirAsk=Credit note to correct invoice
InvoiceAvoirDesc=The credit note is a negative invoice used to solve fact that an invoice has an amount that differs than amount really paid (because customer paid too much by error, or will not paid completely since he returned some products for example).
invoiceAvoirWithLines=Create Credit Note with lines from the origin invoice
-invoiceAvoirWithPaymentRestAmount=Create Credit Note with the amount of origin invoice payment's lake
-invoiceAvoirLineWithPaymentRestAmount=Credit Note amount of invoice payment's lake
+invoiceAvoirWithPaymentRestAmount=Create Credit Note with remaining unpaid of origin invoice
+invoiceAvoirLineWithPaymentRestAmount=Credit Note for remaining unpaid amount
ReplaceInvoice=Replace invoice %s
ReplacementInvoice=Replacement invoice
ReplacedByInvoice=Replaced by invoice %s
@@ -87,7 +87,7 @@ ClassifyCanceled=Classify 'Abandoned'
ClassifyClosed=Classify 'Closed'
ClassifyUnBilled=Classify 'Unbilled'
CreateBill=Create Invoice
-AddBill=Add invoice or credit note
+AddBill=Create invoice or credit note
AddToDraftInvoices=Add to draft invoice
DeleteBill=Delete invoice
SearchACustomerInvoice=Search for a customer invoice
@@ -99,7 +99,7 @@ DoPaymentBack=Do payment back
ConvertToReduc=Convert into future discount
EnterPaymentReceivedFromCustomer=Enter payment received from customer
EnterPaymentDueToCustomer=Make payment due to customer
-DisabledBecauseRemainderToPayIsZero=Disabled because remainder to pay is zero
+DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero
Amount=Amount
PriceBase=Price base
BillStatus=Invoice status
@@ -156,9 +156,9 @@ ConfirmCancelBill=Are you sure you want to cancel invoice %s ?
ConfirmCancelBillQuestion=Why do you want to classify this invoice 'abandoned' ?
ConfirmClassifyPaidPartially=Are you sure you want to change invoice %s to status paid ?
ConfirmClassifyPaidPartiallyQuestion=This invoice has not been paid completely. What are reasons for you to close this invoice ?
-ConfirmClassifyPaidPartiallyReasonAvoir=Remainder to pay (%s %s) is a discount granted because payment was made before term. I regularise the VAT with a credit note.
-ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remainder to pay (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount.
-ConfirmClassifyPaidPartiallyReasonDiscountVat=Remainder to pay (%s %s) is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note.
+ConfirmClassifyPaidPartiallyReasonAvoir=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I regularise the VAT with a credit note.
+ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount.
+ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note.
ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer
ConfirmClassifyPaidPartiallyReasonProductReturned=Products partially returned
ConfirmClassifyPaidPartiallyReasonOther=Amount abandoned for other reason
@@ -191,9 +191,9 @@ AlreadyPaid=Already paid
AlreadyPaidBack=Already paid back
AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and deposits)
Abandoned=Abandoned
-RemainderToPay=Remainder to pay
-RemainderToTake=Remainder to take
-RemainderToPayBack=Remainder to pay back
+RemainderToPay=Remaining unpaid
+RemainderToTake=Remaining amount to take
+RemainderToPayBack=Remaining amount to pay back
Rest=Pending
AmountExpected=Amount claimed
ExcessReceived=Excess received
@@ -225,13 +225,13 @@ NonPercuRecuperable=Non-recoverable
SetConditions=Set payment terms
SetMode=Set payment mode
Billed=Billed
-RepeatableInvoice=Pre-defined invoice
-RepeatableInvoices=Pre-defined invoices
-Repeatable=Pre-defined
-Repeatables=Pre-defined
-ChangeIntoRepeatableInvoice=Convert into pre-defined
-CreateRepeatableInvoice=Create pre-defined invoice
-CreateFromRepeatableInvoice=Create from pre-defined invoice
+RepeatableInvoice=Template invoice
+RepeatableInvoices=Template invoices
+Repeatable=Template
+Repeatables=Templates
+ChangeIntoRepeatableInvoice=Convert into template invoice
+CreateRepeatableInvoice=Create template invoice
+CreateFromRepeatableInvoice=Create from template invoice
CustomersInvoicesAndInvoiceLines=Customer invoices and invoice's lines
CustomersInvoicesAndPayments=Customer invoices and payments
ExportDataset_invoice_1=Customer invoices list and invoice's lines
diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang
index 73c399eb604..390a7f837e8 100644
--- a/htdocs/langs/en_US/commercial.lang
+++ b/htdocs/langs/en_US/commercial.lang
@@ -9,9 +9,9 @@ Prospect=Prospect
Prospects=Prospects
DeleteAction=Delete an event/task
NewAction=New event/task
-AddAction=Add event/task
-AddAnAction=Add an event/task
-AddActionRendezVous=Add a Rendez-vous event
+AddAction=Create event/task
+AddAnAction=Create an event/task
+AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous
ConfirmDeleteAction=Are you sure you want to delete this event/task ?
CardAction=Event card
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 06c350039a3..7bfaf799f3a 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -259,8 +259,8 @@ AvailableGlobalDiscounts=Absolute discounts available
DiscountNone=None
Supplier=Supplier
CompanyList=Company's list
-AddContact=Add contact
-AddContactAddress=Add contact/address
+AddContact=Create contact
+AddContactAddress=Create contact/address
EditContact=Edit contact
EditContactAddress=Edit contact/address
Contact=Contact
@@ -268,8 +268,8 @@ ContactsAddresses=Contacts/Addresses
NoContactDefinedForThirdParty=No contact defined for this third party
NoContactDefined=No contact defined
DefaultContact=Default contact/address
-AddCompany=Add company
-AddThirdParty=Add third party
+AddCompany=Create company
+AddThirdParty=Create third party
DeleteACompany=Delete a company
PersonalInformations=Personal data
AccountancyCode=Accountancy code
@@ -379,8 +379,8 @@ DeliveryAddressLabel=Delivery address label
DeleteDeliveryAddress=Delete a delivery address
ConfirmDeleteDeliveryAddress=Are you sure you want to delete this delivery address?
NewDeliveryAddress=New delivery address
-AddDeliveryAddress=Add address
-AddAddress=Add address
+AddDeliveryAddress=Create address
+AddAddress=Create address
NoOtherDeliveryAddress=No alternative delivery address defined
SupplierCategory=Supplier category
JuridicalStatus200=Independant
diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang
index 8a554a9770b..e06aadef531 100644
--- a/htdocs/langs/en_US/contracts.lang
+++ b/htdocs/langs/en_US/contracts.lang
@@ -27,7 +27,7 @@ MenuRunningServices=Running services
MenuExpiredServices=Expired services
MenuClosedServices=Closed services
NewContract=New contract
-AddContract=Add contract
+AddContract=Create contract
SearchAContract=Search a contract
DeleteAContract=Delete a contract
CloseAContract=Close a contract
diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang
index 66ddea95a5c..85dfdd8ff4d 100644
--- a/htdocs/langs/en_US/donations.lang
+++ b/htdocs/langs/en_US/donations.lang
@@ -4,7 +4,7 @@ Donations=Donations
DonationRef=Donation ref.
Donor=Donor
Donors=Donors
-AddDonation=Add a donation
+AddDonation=Create a donation
NewDonation=New donation
ShowDonation=Show donation
DonationPromise=Gift promise
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index ed8354b9e8d..0187c567eb6 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -37,7 +37,7 @@ ErrorSupplierCodeRequired=Supplier code required
ErrorSupplierCodeAlreadyUsed=Supplier code already used
ErrorBadParameters=Bad parameters
ErrorBadValueForParameter=Wrong value '%s' for parameter incorrect '%s'
-ErrorBadImageFormat=Image file has not a supported format
+ErrorBadImageFormat=Image file has not a supported format (Your PHP does not support functions to convert images of this format)
ErrorBadDateFormat=Value '%s' has wrong date format
ErrorWrongDate=Date is not correct!
ErrorFailedToWriteInDir=Failed to write in directory %s
@@ -114,6 +114,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
+ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative
ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that
ErrorNoActivatedBarcode=No barcode type activated
ErrUnzipFails=Failed to unzip %s with ZipArchive
diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang
index 17641a0ab3e..7655616ffc5 100644
--- a/htdocs/langs/en_US/interventions.lang
+++ b/htdocs/langs/en_US/interventions.lang
@@ -3,7 +3,7 @@ Intervention=Intervention
Interventions=Interventions
InterventionCard=Intervention card
NewIntervention=New intervention
-AddIntervention=Add intervention
+AddIntervention=Create intervention
ListOfInterventions=List of interventions
EditIntervention=Edit intervention
ActionsOnFicheInter=Actions on intervention
@@ -30,6 +30,7 @@ StatusInterInvoiced=Billed
RelatedInterventions=Related interventions
ShowIntervention=Show intervention
SendInterventionRef=Submission of intervention %s
+SendInterventionByMail=Send intervention by Email
##### Types de contacts #####
TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention
TypeContact_fichinter_internal_INTERVENING=Intervening
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 0ad86123313..44027b4cc20 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -133,6 +133,6 @@ Notifications=Notifications
NoNotificationsWillBeSent=No email notifications are planned for this event and company
ANotificationsWillBeSent=1 notification will be sent by email
SomeNotificationsWillBeSent=%s notifications will be sent by email
-AddNewNotification=Activate a new email notification request
-ListOfActiveNotifications=List all active email notification requests
+AddNewNotification=Activate a new email notification target
+ListOfActiveNotifications=List all active email notification targets
ListOfNotificationsDone=List all email notifications sent
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index fd2a7d94c76..a18522be5f8 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -58,12 +58,12 @@ ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr
ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'.
ErrorNoSocialContributionForSellerCountry=Error, no social contribution type defined for country '%s'.
ErrorFailedToSaveFile=Error, failed to save file.
-ErrorOnlyPngJpgSupported=Error, only .png and .jpg image format file are supported.
-ErrorImageFormatNotSupported=Your PHP does not support functions to convert images of this format.
SetDate=Set date
SelectDate=Select a date
SeeAlso=See also %s
BackgroundColorByDefault=Default background color
+FileNotUploaded=The file was not uploaded
+FileUploaded=The file was successfully uploaded
FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. Click on "Attach file" for this.
NbOfEntries=Nb of entries
GoToWikiHelpPage=Read online help (need Internet access)
@@ -341,6 +341,7 @@ FullList=Full list
Statistics=Statistics
OtherStatistics=Other statistics
Status=Status
+Favorite=Favorite
ShortInfo=Info.
Ref=Ref.
RefSupplier=Ref. supplier
diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang
index 3fca6d7a644..38b6482a4f3 100644
--- a/htdocs/langs/en_US/margins.lang
+++ b/htdocs/langs/en_US/margins.lang
@@ -38,4 +38,6 @@ BuyingCost=Cost price
UnitCharges=Unit charges
Charges=Charges
AgentContactType=Commercial agent contact type
-AgentContactTypeDetails=Défine what contact type (linked on invoices) will be used for margin report by commercial agents
+AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per sale representative
+rateMustBeNumeric=Rate must be a numeric value
+markRateShouldBeLesserThan100=Mark rate should be lower than 100
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index fd17000a8e0..b789f2f8423 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -85,7 +85,7 @@ SubscriptionLateShort=Late
SubscriptionNotReceivedShort=Never received
ListOfSubscriptions=List of subscriptions
SendCardByMail=Send card by Email
-AddMember=Add member
+AddMember=Create member
NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types"
NewMemberType=New member type
WelcomeEMail=Welcome e-mail
@@ -125,7 +125,7 @@ Date=Date
DateAndTime=Date and time
PublicMemberCard=Member public card
MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe
-AddSubscription=Add subscription
+AddSubscription=Create subscription
ShowSubscription=Show subscription
MemberModifiedInDolibarr=Member modified in Dolibarr
SendAnEMailToMember=Send information email to member
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index d50f8615dc8..76986b67621 100644
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -65,7 +65,7 @@ ValidateOrder=Validate order
UnvalidateOrder=Unvalidate order
DeleteOrder=Delete order
CancelOrder=Cancel order
-AddOrder=Add order
+AddOrder=Create order
AddToMyOrders=Add to my orders
AddToOtherOrders=Add to other orders
AddToDraftOrders=Add to draft order
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 6758b2b482e..1e74b72f635 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -1,7 +1,6 @@
# Dolibarr language file - Source file is en_US - other
SecurityCode=Security code
Calendar=Calendar
-AddTrip=Add trip
Tools=Tools
ToolsDesc=This area is dedicated to group miscellaneous tools not available into other menu entries. Those tools can be reached from menu on the side.
Birthday=Birthday
@@ -48,6 +47,7 @@ Notify_PROJECT_CREATE=Project creation
Notify_TASK_CREATE=Task created
Notify_TASK_MODIFY=Task modified
Notify_TASK_DELETE=Task deleted
+SeeModuleSetup=See module setup
NbOfAttachedFiles=Number of attached files/documents
TotalSizeOfAttachedFiles=Total size of attached files/documents
MaxSize=Maximum size
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index d5b1db83495..b38bcd150a9 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -117,12 +117,12 @@ ServiceLimitedDuration=If product is a service with limited duration:
MultiPricesAbility=Several level of prices per product/service
MultiPricesNumPrices=Number of prices
MultiPriceLevelsName=Price categories
-AssociatedProductsAbility=Activate the virtual products feature
-AssociatedProducts=Virtual product
-AssociatedProductsNumber=Number of products composing this virtual product
-ParentProductsNumber=Number of parent virtual product
-IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product
-IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product
+AssociatedProductsAbility=Activate the virtual package feature
+AssociatedProducts=Package product
+AssociatedProductsNumber=Number of products composing this virtual package product
+ParentProductsNumber=Number of parent packaging product
+IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual package product
+IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual package product
EditAssociate=Associate
Translation=Translation
KeywordFilter=Keyword filter
@@ -132,7 +132,7 @@ AddDel=Add/Delete
Quantity=Quantity
NoMatchFound=No match found
ProductAssociationList=List of related products/services: name of product/service (quantity affected)
-ProductParentList=List of virtual products/services with this product as a component
+ProductParentList=List of package products/services with this product as a component
ErrorAssociationIsFatherOfThis=One of selected product is parent with current product
DeleteProduct=Delete a product/service
ConfirmDeleteProduct=Are you sure you want to delete this product/service?
@@ -179,7 +179,7 @@ CloneProduct=Clone product or service
ConfirmCloneProduct=Are you sure you want to clone product or service %s ?
CloneContentProduct=Clone all main informations of product/service
ClonePricesProduct=Clone main informations and prices
-CloneCompositionProduct=Clone virtual product/services
+CloneCompositionProduct=Clone packaged product/services
ProductIsUsed=This product is used
NewRefForClone=Ref. of new product/service
CustomerPrices=Customers prices
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 3e1ecea0be4..32b7d57e9b0 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -14,7 +14,7 @@ TasksDesc=This view presents all projects and tasks (your user permissions grant
Myprojects=My projects
ProjectsArea=Projects area
NewProject=New project
-AddProject=Add project
+AddProject=Create project
DeleteAProject=Delete a project
DeleteATask=Delete a task
ConfirmDeleteAProject=Are you sure you want to delete this project ?
@@ -45,7 +45,7 @@ TaskDateStart=Task start date
TaskDateEnd=Task end date
TaskDescription=Task description
NewTask=New task
-AddTask=Add task
+AddTask=Create task
AddDuration=Add duration
Activity=Activity
Activities=Tasks/activities
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index 8970d1eb2df..2b6d12870a1 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -16,7 +16,7 @@ Prospect=Prospect
ProspectList=Prospect list
DeleteProp=Delete commercial proposal
ValidateProp=Validate commercial proposal
-AddProp=Add proposal
+AddProp=Create proposal
ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ?
ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name %s ?
LastPropals=Last %s proposals
@@ -55,8 +55,6 @@ NoOpenedPropals=No opened commercial proposals
NoOtherOpenedPropals=No other opened commercial proposals
RefProposal=Commercial proposal ref
SendPropalByMail=Send commercial proposal by mail
-FileNotUploaded=The file was not uploaded
-FileUploaded=The file was successfully uploaded
AssociatedDocuments=Documents associated with the proposal:
ErrorCantOpenDir=Can't open directory
DatePropal=Date of proposal
diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang
index 502d328d7c3..fbc55081185 100755
--- a/htdocs/langs/en_US/resource.lang
+++ b/htdocs/langs/en_US/resource.lang
@@ -10,7 +10,7 @@ NoResourceLinked=No resource linked
ResourcePageIndex=Resources list
ResourceSingular=Resource
ResourceCard=Resource card
-AddResource=Add a resource
+AddResource=Create a resource
ResourceFormLabel_ref=Resource name
ResourceType=Resource type
ResourceFormLabel_description=Resource description
diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang
index 50502c15c7e..ca3a81639bf 100644
--- a/htdocs/langs/en_US/suppliers.lang
+++ b/htdocs/langs/en_US/suppliers.lang
@@ -1,7 +1,7 @@
# Dolibarr language file - Source file is en_US - suppliers
Suppliers=Suppliers
Supplier=Supplier
-AddSupplier=Add a supplier
+AddSupplier=Create a supplier
SupplierRemoved=Supplier removed
SuppliersInvoice=Suppliers invoice
NewSupplier=New supplier
diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang
index 1759ca8e174..64adbeb0dd6 100644
--- a/htdocs/langs/en_US/trips.lang
+++ b/htdocs/langs/en_US/trips.lang
@@ -4,7 +4,7 @@ Trips=Trips
TripsAndExpenses=Trips and expenses
TripsAndExpensesStatistics=Trips and expenses statistics
TripCard=Trip card
-AddTrip=Add trip
+AddTrip=Create trip
ListOfTrips=List of trips
ListOfFees=List of fees
NewTrip=New trip
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index 495cb3981c6..c13e3e767bb 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -119,4 +119,5 @@ HierarchicView=Hierarchical view
UseTypeFieldToChange=Use field Type to change
OpenIDURL=OpenID URL
LoginUsingOpenID=Use OpenID to login
-WeeklyHours=Weekly hours
\ No newline at end of file
+WeeklyHours=Weekly hours
+ColorUser=Color of the user
\ No newline at end of file
diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang
index d3dd7c9ca7c..dccee9d0c8e 100644
--- a/htdocs/langs/en_US/withdrawals.lang
+++ b/htdocs/langs/en_US/withdrawals.lang
@@ -14,8 +14,8 @@ WithdrawalReceiptShort=Receipt
LastWithdrawalReceipts=Last %s withdrawal receipts
WithdrawedBills=Withdrawn invoices
WithdrawalsLines=Withdrawal lines
-RequestStandingOrderToTreat=Request for standing orders to treat
-RequestStandingOrderTreated=Request for standing orders treated
+RequestStandingOrderToTreat=Request for standing orders to process
+RequestStandingOrderTreated=Request for standing orders processed
CustomersStandingOrders=Customer standing orders
CustomerStandingOrder=Customer standing order
NbOfInvoiceToWithdraw=Nb. of invoice with withdraw request
diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang
index d92caea7ab2..a9f20e07d72 100644
--- a/htdocs/langs/es_ES/main.lang
+++ b/htdocs/langs/es_ES/main.lang
@@ -266,6 +266,7 @@ Afternoon=Tarde
Quadri=Trimestre
MonthOfDay=Mes del dÃa
HourShort=H
+MinuteShort=min
Rate=Tipo
UseLocalTax=Incluir tasas
Bytes=Bytes
@@ -679,7 +680,7 @@ ViewPrivateNote=Ver notas
XMoreLines=%s lÃnea(s) ocultas
PublicUrl=URL pública
AddBox=Añadir caja
-
+SelectElementAndClickRefresh=Seleccione un elemento y haga clic en Refrescar
# Week day
Monday=Lunes
Tuesday=Martes
diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php
index ebe46c78ac3..e95fac9f639 100644
--- a/htdocs/livraison/class/livraison.class.php
+++ b/htdocs/livraison/class/livraison.class.php
@@ -359,18 +359,21 @@ class Livraison extends CommonObject
$soc = new Societe($this->db);
$soc->fetch($this->socid);
- // on verifie si le bon de livraison est en numerotation provisoire
- $livref = substr($this->ref, 1, 4);
- if ($livref == 'PROV')
+ if (preg_match('/^[\(]?PROV/i', $this->ref))
+ {
+ $numref = $objMod->livraison_get_num($soc,$this);
+ }
+ else
{
- $numref = $objMod->livraison_get_num($soc,$this);
- }
+ $numref = $this->ref;
+ }
+ $this->newref = $numref;
// Tester si non deja au statut valide. Si oui, on arrete afin d'eviter
// de decrementer 2 fois le stock.
$sql = "SELECT ref";
$sql.= " FROM ".MAIN_DB_PREFIX."livraison";
- $sql.= " WHERE ref = '".$numref."'";
+ $sql.= " WHERE ref = '".$this->db->escape($numref)."'";
$sql.= " AND fk_statut <> 0";
$sql.= " AND entity = ".$conf->entity;
@@ -393,10 +396,24 @@ class Livraison extends CommonObject
$sql.= " AND fk_statut = 0";
$resql=$this->db->query($sql);
- if ($resql)
- {
+ if (! $resql)
+ {
+ dol_print_error($this->db);
+ $this->error=$this->db->lasterror();
+ $error++;
+ }
- $this->oldref='';
+ if (! $error && ! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('DELIVERY_VALIDATE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
+
+ if (! $error)
+ {
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
@@ -413,11 +430,17 @@ class Livraison extends CommonObject
if (@rename($dirsource, $dirdest))
{
- $this->oldref = $oldref;
-
- dol_syslog("Rename ok");
- // Suppression ancien fichier PDF dans nouveau rep
- dol_delete_file($dirdest.'/'.$oldref.'*.*');
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles=dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
+ foreach($listoffiles as $fileentry)
+ {
+ $dirsource=$fileentry['name'];
+ $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
+ $dirsource=$fileentry['path'].'/'.$dirsource;
+ $dirdest=$fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -431,12 +454,17 @@ class Livraison extends CommonObject
dol_syslog(get_class($this)."::valid ok");
}
- else
+
+ if (! $error)
+ {
+ $this->db->commit();
+ return 1;
+ }
+ else
{
- $this->db->rollback();
- $this->error=$this->db->error()." - sql=$sql";
- return -1;
- }
+ $this->db->rollback();
+ return -1;
+ }
}
}
}
@@ -446,21 +474,6 @@ class Livraison extends CommonObject
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
return -1;
}
-
- // Call trigger
- $result=$this->call_trigger('DELIVERY_VALIDATE',$user);
- // End call triggers
- if ($result < 0)
- {
- $this->db->rollback();
- dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
- return -1;
- }
- else
- {
- $this->db->commit();
- return 1;
- }
}
/**
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b20d94164d6..efca5d4efba 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -214,6 +214,7 @@ if (isset($_SERVER["HTTP_USER_AGENT"]))
$conf->browser->layout=$tmp['layout'];
$conf->browser->phone=$tmp['phone']; // deprecated, use layout
$conf->browser->tablet=$tmp['tablet']; // deprecated, use layout
+ //var_dump($conf->browser);
}
@@ -715,14 +716,14 @@ if (! GETPOST('nojs')) // If javascript was not disabled on URL
}
else $conf->use_javascript_ajax=0;
-// Set terminal output option
+// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
-if (! empty($conf->browser->phone)) $conf->dol_no_mouse_hover=1;
-if (! empty($conf->browser->phone)
+if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $conf->dol_no_mouse_hover=1;
+if ((! empty($conf->browser->layout) && $conf->browser->layout == 'phone')
|| (! empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400)
|| (! empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400)
)
@@ -731,12 +732,13 @@ if (! empty($conf->browser->phone)
}
// If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
-// Disabled bugged themes
+// Replace themes bugged with jmobile with eldy
if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo')))
{
$conf->theme='eldy';
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
+//var_dump($conf->browser->phone);
if (! defined('NOREQUIRETRAN'))
{
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index a9f533ba40b..8ec7c5b12a7 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -422,11 +422,10 @@ if (empty($reshook))
$_error++;
$action = "";
- $mesg='';
setEventMessage($mesg, 'errors');
- //dol_print_error($object->db);
+ $object->fetch($id);
}
else
{
@@ -1420,12 +1419,20 @@ else
// Status (to sell)
print ''.$langs->trans("Status").' ('.$langs->trans("Sell").') ';
- print $object->getLibStatut(2,0);
+ if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
+ print ajax_productonoff($object->id, 'status');
+ } else {
+ print $object->getLibStatut(2,0);
+ }
print ' ';
// Status (to buy)
print ''.$langs->trans("Status").' ('.$langs->trans("Buy").') ';
- print $object->getLibStatut(2,1);
+ if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
+ print ajax_productonoff($object->id, 'status_buy');
+ } else {
+ print $object->getLibStatut(2,1);
+ }
print ' ';
// Batch number management (to batch)
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index fa959b38277..226a3501652 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -46,6 +46,8 @@ class Product extends CommonObject
protected $isnolinkedbythird = 1; // No field fk_soc
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff';
+
//! Identifiant unique
var $id ;
//! Ref
@@ -1479,7 +1481,7 @@ class Product extends CommonObject
$this->date_modification = $obj->tms;
$this->import_key = $obj->import_key;
$this->entity = $obj->entity;
-
+
$this->ref_ext = $obj->ref_ext;
$this->db->free($resql);
@@ -3068,18 +3070,19 @@ class Product extends CommonObject
}
/**
- * Deplace fichier uploade sous le nom $files dans le repertoire sdir
+ * Move an uploaded file described into $file array into target directory $sdir.
*
- * @param string $sdir Repertoire destination finale
- * @param string $file Nom du fichier uploade
- * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
- * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
- * @return void
+ * @param string $sdir Target directory
+ * @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...)
+ * @param int $maxWidth Largeur maximum que dois faire la miniature (160 by defaut)
+ * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 by defaut)
+ * @return int <0 if KO, >0 if OK
*/
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ $result = 0;
$dir = $sdir .'/'. get_exdir($this->id,2) . $this->id ."/photos";
dol_mkdir($dir);
@@ -3098,6 +3101,9 @@ class Product extends CommonObject
$this->add_thumb($originImage,$maxWidth,$maxHeight);
}
}
+
+ if (is_numeric($result) && $result > 0) return 1;
+ else return -1;
}
/**
@@ -3192,7 +3198,7 @@ class Product extends CommonObject
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
- if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
+ if (dol_is_file($dir.$file) && preg_match('/('.$this->regeximgext.')$/i', $dir.$file))
{
$nbphoto++;
$photo = $file;
@@ -3227,11 +3233,11 @@ class Product extends CommonObject
$alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($photo_vignette && $imgarray['height'] > $maxHeight) {
$return.= '';
- $return.= ' ';
+ $return.= ' ';
}
else {
$return.= '';
- $return.= ' ';
+ $return.= ' ';
}
$return.= ''."\n";
@@ -3241,7 +3247,7 @@ class Product extends CommonObject
{
$return.= ' ';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
- if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
+ if ($photo_vignette && preg_match('/('.$this->regeximgext.')$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
{
$return.= 'id.'&action=addthumb&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').' ';
}
@@ -3266,7 +3272,7 @@ class Product extends CommonObject
}
if ($size == 0) { // Format origine
- $return.= ' ';
+ $return.= ' ';
if ($showfilename) $return.= ' '.$viewfilename;
if ($showaction)
@@ -3334,14 +3340,14 @@ class Product extends CommonObject
while (($file = readdir($handle)) != false)
{
if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO
- if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
+ if (dol_is_file($dir.$file) && preg_match('/('.$this->regeximgext.')$/i', $dir.$file))
{
$nbphoto++;
// On determine nom du fichier vignette
$photo=$file;
$photo_vignette='';
- if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs))
+ if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs))
{
$photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0];
}
@@ -3385,7 +3391,7 @@ class Product extends CommonObject
dol_delete_file($file);
// Si elle existe, on efface la vignette
- if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs))
+ if (preg_match('/('.$this->regeximgext.')$/i',$filename,$regs))
{
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_small'.$regs[0];
if (file_exists(dol_osencode($dirthumb.$photo_vignette)))
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 3e18cc5d042..45f90823747 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -173,7 +173,7 @@ if (! empty($conf->categorie->enabled))
print ' ';
print '';
print ''.$langs->trans("Categories").' ';
- print '';
+ print ' ';
$sql = "SELECT c.label, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index ebcd3245e7d..3629f98365e 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -462,7 +462,7 @@ else
}
// Better buy price
- if ($user->rights->produit->creer)
+ if ($user->rights->fournisseur->lire)
{
print ' ';
if ($objp->minsellprice != '')
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 09f03b15437..0ae65a7dec6 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -26,6 +26,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
@@ -59,7 +60,20 @@ if ($id > 0 || ! empty($ref))
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
- if ($object->id) $result = $object->add_photo($dir, $_FILES['userfile']);
+ if ($object->id)
+ {
+ if (image_format_supported($_FILES['userfile']['name']) >= 1)
+ {
+ $result = $object->add_photo($dir, $_FILES['userfile']);
+ if ($result > 0) setEventMessage($langs->trans("FileUploaded"));
+ else setEventMessage($langs->trans("FileNotUploaded"), 'errors');
+ }
+ else
+ {
+ $langs->load("errors");
+ setEventMessage($langs->trans("ErrorBadImageFormat"), 'errors');
+ }
+ }
}
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && ($user->rights->produit->creer || $user->rights->service->creer))
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 85fb7c1896d..c55466ebdb1 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -31,9 +31,9 @@ $langs->load("stocks");
// Security check
$result=restrictedArea($user,'stock');
-$sref=GETPOST("sref");;
-$snom=GETPOST("snom");
-$sall=GETPOST("sall");
+$sref=GETPOST("sref","alpha");
+$snom=GETPOST("snom","alpha");
+$sall=GETPOST("sall","alpha");
$sortfield = GETPOST("sortfield");
$sortorder = GETPOST("sortorder");
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index a2096c49f14..ae8afe696bc 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -276,15 +276,23 @@ if ($id > 0 || $ref)
print ' '.$langs->trans("Label").' '.$product->libelle.' ';
print ' ';
- // Status (to sell)
- print ''.$langs->trans("Status").' ('.$langs->trans("Sell").') ';
- print $product->getLibStatut(2,0);
- print ' ';
+ // Status (to sell)
+ print ''.$langs->trans("Status").' ('.$langs->trans("Sell").') ';
+ if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
+ print ajax_productonoff($product->id, 'status');
+ } else {
+ print $product->getLibStatut(2,0);
+ }
+ print ' ';
- // Status (to buy)
- print ''.$langs->trans("Status").' ('.$langs->trans("Buy").') ';
- print $product->getLibStatut(2,1);
- print ' ';
+ // Status (to buy)
+ print ''.$langs->trans("Status").' ('.$langs->trans("Buy").') ';
+ if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
+ print ajax_productonoff($product->id, 'status_buy');
+ } else {
+ print $product->getLibStatut(2,1);
+ }
+ print ' ';
if ($conf->productbatch->enabled) {
print ''.$langs->trans("Status").' ('.$langs->trans("l_sellby").') ';
diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php
old mode 100755
new mode 100644
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
old mode 100755
new mode 100644
diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php
index 8771c0219c7..b3565a2ca26 100644
--- a/htdocs/societe/ajaxcompanies.php
+++ b/htdocs/societe/ajaxcompanies.php
@@ -81,7 +81,7 @@ if (GETPOST('newcompany') || GETPOST('socid','int') || GETPOST('id_fourn'))
if (! empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql.=" OR rowid = '" . $db->escape($socid) . "'";
$sql.=")";
}
- if (! empty($_GET["filter"])) $sql.= " AND ".$_GET["filter"]; // Add other filters
+ if (GETPOST("filter")) $sql.= " AND ".GETPOST("filter","alpha"); // Add other filters
$sql.= " ORDER BY nom ASC";
//dol_syslog("ajaxcompanies", LOG_DEBUG);
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 0aa9f0e5979..f89212e5fbc 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -494,10 +494,10 @@ if ($sql_select)
}
else if (empty($type_element) || $type_element == -1)
{
- print ' '.$langs->trans("SelectElementAndClickRefresh").' ';
+ print ''.$langs->trans("SelectElementAndClickRefresh").' ';
}
else {
- print ''.$langs->trans("FeatureNotYetAvailable").' ';
+ print ''.$langs->trans("FeatureNotYetAvailable").' ';
}
print "
";
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 740a6157809..243b55f01ca 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -183,7 +183,7 @@ if (! empty($conf->categorie->enabled))
print ' ';
print '';
print ''.$langs->trans("Categories").' ';
- print '';
+ print ' ';
$sql = "SELECT c.label, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php
index 8604b229134..542a2066e93 100644
--- a/htdocs/societe/notify/card.php
+++ b/htdocs/societe/notify/card.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2010-2012 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
@@ -191,12 +191,10 @@ if ($result > 0)
print ' ';
print '
';
- // Help
- print ' '.$langs->trans("NotificationsDesc").' ';
-
-
dol_fiche_end();
+ // Help
+ print $langs->trans("NotificationsDesc").' ';
print "\n";
@@ -212,7 +210,7 @@ if ($result > 0)
// Line with titles
print '';
print '';
- print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder);
print_liste_field_titre('');
@@ -265,13 +263,40 @@ if ($result > 0)
// Line with titles
print '';
print '';
- print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print ' ';
- // List of notifications for contacts
+ // List of notifications enabled for fixed email
+ foreach($conf->global as $key => $val)
+ {
+ if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
+ //print $key.' - '.$val.' - '.$reg[1].' ';
+ print ''.$val;
+ if (isValidEmail($val))
+ {
+ print ' <'.$val.'>';
+ }
+ else
+ {
+ $langs->load("errors");
+ print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$val);
+ }
+ print ' ';
+ print '';
+ $label=($langs->trans("Notify_".$reg[1])!="Notify_".$reg[1]?$langs->trans("Notify_".$reg[1]):$reg[1]);
+ print $label;
+ print ' ';
+ print '';
+ print $langs->trans("Email");
+ print ' ';
+ print ''.$langs->trans("SeeModuleSetup").' ';
+ print ' ';
+ }
+
+ // List of notifications enabled for contacts
$sql = "SELECT n.rowid, n.type,";
$sql.= " a.code, a.label,";
$sql.= " c.rowid as contactid, c.lastname, c.firstname, c.email";
@@ -343,21 +368,22 @@ if ($result > 0)
// Line with titles
print '';
print '';
- print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder);
+ //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.daten",'',$param,'align="right"',$sortfield,$sortorder);
print ' ';
// List
- $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
- $sql.= " c.rowid as id, c.lastname, c.firstname, c.email,";
+ $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id as object_id, n.type,";
+ $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
$sql.= " a.code, a.label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
- $sql.= " ".MAIN_DB_PREFIX."notify as n, ";
- $sql.= " ".MAIN_DB_PREFIX."socpeople as c";
+ $sql.= " ".MAIN_DB_PREFIX."notify as n ";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid";
$sql.= " WHERE a.rowid = n.fk_action";
- $sql.= " AND c.rowid = n.fk_contact";
- $sql.= " AND c.fk_soc = ".$object->id;
+ $sql.= " AND n.fk_soc = ".$object->id;
$resql=$db->query($sql);
if ($resql)
@@ -373,17 +399,37 @@ if ($result > 0)
$obj = $db->fetch_object($resql);
- $contactstatic->id=$obj->id;
- $contactstatic->lastname=$obj->lastname;
- $contactstatic->firstname=$obj->firstname;
- print ''.$contactstatic->getNomUrl(1);
- print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
+ print ' ';
+ if ($obj->id > 0)
+ {
+ $contactstatic->id=$obj->id;
+ $contactstatic->lastname=$obj->lastname;
+ $contactstatic->firstname=$obj->firstname;
+ print $contactstatic->getNomUrl(1);
+ print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
+ }
+ else
+ {
+ print $obj->email;
+ }
print ' ';
print '';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print $label;
print ' ';
- // TODO Add link to object here
+ print '';
+ if ($obj->type == 'email') print $langs->trans("Email");
+ if ($obj->type == 'sms') print $langs->trans("Sms");
+ print ' ';
+ // TODO Add link to object here for other types
+ /*print '';
+ if ($obj->object_type == 'order')
+ {
+ $orderstatic->id=$obj->object_id;
+ $orderstatic->ref=...
+ print $orderstatic->getNomUrl(1);
+ }
+ print ' ';*/
// print
print''.dol_print_date($db->jdate($obj->daten), 'dayhour').' ';
print ' ';
@@ -400,7 +446,7 @@ if ($result > 0)
}
else dol_print_error('','RecordNotFound');
-$db->close();
llxFooter();
+$db->close();
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index e9e79d52130..a0b9bda1c8e 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -136,48 +136,48 @@ if (empty($reshook))
{
$object->particulier = GETPOST("private");
- $object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha'));
+ $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha'));
$object->civility_id = GETPOST('civility_id', 'int');
// Add non official properties
- $object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha');
- $object->firstname = GETPOST('firstname','san_alpha');
+ $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha');
+ $object->firstname = GETPOST('firstname','alpha');
}
else
{
- $object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha');
+ $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha');
}
- $object->address = GETPOST('address', 'san_alpha');
- $object->zip = GETPOST('zipcode', 'san_alpha');
- $object->town = GETPOST('town', 'san_alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->state_id = GETPOST('state_id', 'int');
- $object->skype = GETPOST('skype', 'san_alpha');
- $object->phone = GETPOST('phone', 'san_alpha');
- $object->fax = GETPOST('fax','san_alpha');
+ $object->skype = GETPOST('skype', 'alpha');
+ $object->phone = GETPOST('phone', 'alpha');
+ $object->fax = GETPOST('fax','alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
- $object->idprof1 = GETPOST('idprof1', 'san_alpha');
- $object->idprof2 = GETPOST('idprof2', 'san_alpha');
- $object->idprof3 = GETPOST('idprof3', 'san_alpha');
- $object->idprof4 = GETPOST('idprof4', 'san_alpha');
- $object->idprof5 = GETPOST('idprof5', 'san_alpha');
- $object->idprof6 = GETPOST('idprof6', 'san_alpha');
- $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha');
- $object->code_client = GETPOST('code_client', 'san_alpha');
- $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha');
- $object->capital = GETPOST('capital', 'san_alpha');
- $object->barcode = GETPOST('barcode', 'san_alpha');
+ $object->idprof1 = GETPOST('idprof1', 'alpha');
+ $object->idprof2 = GETPOST('idprof2', 'alpha');
+ $object->idprof3 = GETPOST('idprof3', 'alpha');
+ $object->idprof4 = GETPOST('idprof4', 'alpha');
+ $object->idprof5 = GETPOST('idprof5', 'alpha');
+ $object->idprof6 = GETPOST('idprof6', 'alpha');
+ $object->prefix_comm = GETPOST('prefix_comm', 'alpha');
+ $object->code_client = GETPOST('code_client', 'alpha');
+ $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->capital = GETPOST('capital', 'alpha');
+ $object->barcode = GETPOST('barcode', 'alpha');
- $object->tva_intra = GETPOST('tva_intra', 'san_alpha');
- $object->tva_assuj = GETPOST('assujtva_value', 'san_alpha');
- $object->status = GETPOST('status', 'san_alpha');
+ $object->tva_intra = GETPOST('tva_intra', 'alpha');
+ $object->tva_assuj = GETPOST('assujtva_value', 'alpha');
+ $object->status = GETPOST('status', 'alpha');
// Local Taxes
- $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha');
- $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha');
+ $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha');
+ $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha');
- $object->localtax1_value = GETPOST('lt1', 'san_alpha');
- $object->localtax2_value = GETPOST('lt2', 'san_alpha');
+ $object->localtax1_value = GETPOST('lt1', 'alpha');
+ $object->localtax2_value = GETPOST('lt2', 'alpha');
$object->forme_juridique_code = GETPOST('forme_juridique_code', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int');
@@ -446,7 +446,6 @@ if (empty($reshook))
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id;
- dol_syslog(get_class($object)."::delete", LOG_DEBUG);
if (! $object->db->query($sql))
{
$error++;
@@ -528,7 +527,7 @@ if (empty($reshook))
// Define output language
$outputlangs = $langs;
$newlang='';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang;
if (! empty($newlang))
{
@@ -638,31 +637,31 @@ else
if (GETPOST("type")=='p') { $object->client=2; }
if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; }
- $object->name = GETPOST('nom', 'san_alpha');
- $object->firstname = GETPOST('firstname', 'san_alpha');
+ $object->name = GETPOST('nom', 'alpha');
+ $object->firstname = GETPOST('firstname', 'alpha');
$object->particulier = $private;
$object->prefix_comm = GETPOST('prefix_comm');
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
- $object->code_client = GETPOST('code_client', 'san_alpha');
+ $object->code_client = GETPOST('code_client', 'alpha');
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
- $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha');
- $object->address = GETPOST('address', 'san_alpha');
- $object->zip = GETPOST('zipcode', 'san_alpha');
- $object->town = GETPOST('town', 'san_alpha');
+ $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
$object->state_id = GETPOST('state_id', 'int');
- $object->skype = GETPOST('skype', 'san_alpha');
- $object->phone = GETPOST('phone', 'san_alpha');
- $object->fax = GETPOST('fax', 'san_alpha');
+ $object->skype = GETPOST('skype', 'alpha');
+ $object->phone = GETPOST('phone', 'alpha');
+ $object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
$object->capital = GETPOST('capital', 'int');
- $object->barcode = GETPOST('barcode', 'san_alpha');
- $object->idprof1 = GETPOST('idprof1', 'san_alpha');
- $object->idprof2 = GETPOST('idprof2', 'san_alpha');
- $object->idprof3 = GETPOST('idprof3', 'san_alpha');
- $object->idprof4 = GETPOST('idprof4', 'san_alpha');
- $object->idprof5 = GETPOST('idprof5', 'san_alpha');
- $object->idprof6 = GETPOST('idprof6', 'san_alpha');
+ $object->barcode = GETPOST('barcode', 'alpha');
+ $object->idprof1 = GETPOST('idprof1', 'alpha');
+ $object->idprof2 = GETPOST('idprof2', 'alpha');
+ $object->idprof3 = GETPOST('idprof3', 'alpha');
+ $object->idprof4 = GETPOST('idprof4', 'alpha');
+ $object->idprof5 = GETPOST('idprof5', 'alpha');
+ $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int');
$object->civility_id = GETPOST('civility_id', 'int');
@@ -677,7 +676,7 @@ else
$object->localtax1_value =GETPOST('lt1', 'int');
$object->localtax2_value =GETPOST('lt2', 'int');
- $object->tva_intra = GETPOST('tva_intra', 'san_alpha');
+ $object->tva_intra = GETPOST('tva_intra', 'alpha');
$object->commercial_id = GETPOST('commercial_id', 'int');
$object->default_lang = GETPOST('default_lang');
@@ -1147,37 +1146,37 @@ else
if (GETPOST('nom'))
{
// We overwrite with values if posted
- $object->name = GETPOST('nom', 'san_alpha');
- $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha');
+ $object->name = GETPOST('nom', 'alpha');
+ $object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->client = GETPOST('client', 'int');
- $object->code_client = GETPOST('code_client', 'san_alpha');
+ $object->code_client = GETPOST('code_client', 'alpha');
$object->fournisseur = GETPOST('fournisseur', 'int');
- $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha');
- $object->address = GETPOST('address', 'san_alpha');
- $object->zip = GETPOST('zipcode', 'san_alpha');
- $object->town = GETPOST('town', 'san_alpha');
+ $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
$object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id;
$object->state_id = GETPOST('state_id', 'int');
- $object->skype = GETPOST('skype', 'san_alpha');
- $object->phone = GETPOST('phone', 'san_alpha');
- $object->fax = GETPOST('fax', 'san_alpha');
+ $object->skype = GETPOST('skype', 'alpha');
+ $object->phone = GETPOST('phone', 'alpha');
+ $object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
$object->capital = GETPOST('capital', 'int');
- $object->idprof1 = GETPOST('idprof1', 'san_alpha');
- $object->idprof2 = GETPOST('idprof2', 'san_alpha');
- $object->idprof3 = GETPOST('idprof3', 'san_alpha');
- $object->idprof4 = GETPOST('idprof4', 'san_alpha');
- $object->idprof5 = GETPOST('idprof5', 'san_alpha');
- $object->idprof6 = GETPOST('idprof6', 'san_alpha');
+ $object->idprof1 = GETPOST('idprof1', 'alpha');
+ $object->idprof2 = GETPOST('idprof2', 'alpha');
+ $object->idprof3 = GETPOST('idprof3', 'alpha');
+ $object->idprof4 = GETPOST('idprof4', 'alpha');
+ $object->idprof5 = GETPOST('idprof5', 'alpha');
+ $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int');
- $object->barcode = GETPOST('barcode', 'san_alpha');
+ $object->barcode = GETPOST('barcode', 'alpha');
$object->forme_juridique_code = GETPOST('forme_juridique_code', 'int');
- $object->default_lang = GETPOST('default_lang', 'san_alpha');
+ $object->default_lang = GETPOST('default_lang', 'alpha');
$object->tva_assuj = GETPOST('assujtva_value', 'int');
- $object->tva_intra = GETPOST('tva_intra', 'san_alpha');
+ $object->tva_intra = GETPOST('tva_intra', 'alpha');
$object->status = GETPOST('status', 'int');
//Local Taxes
diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php
index 9e82e1a052f..7a2274e81b5 100644
--- a/htdocs/societe/societecontact.php
+++ b/htdocs/societe/societecontact.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("orders");
$langs->load("companies");
-$id=GETPOST('id','int');
+$id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
$ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha');
@@ -44,8 +44,9 @@ $result = restrictedArea($user, 'societe', $id,'');
$object = new Societe($db);
+
/*
- * Ajout d'un nouveau contact
+ * Actions
*/
if ($action == 'addcontact' && $user->rights->societe->creer)
@@ -133,12 +134,9 @@ $userstatic=new User($db);
/* Mode vue et edition */
/* */
/* *************************************************************************** */
-dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
{
- $langs->trans("OrderCard");
-
if ($object->fetch($id, $ref) > 0)
{
$soc = new Societe($db);
@@ -154,12 +152,12 @@ if ($id > 0 || ! empty($ref))
print '';
print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom');
print ' ';
-
+
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print ''.$langs->trans('Prefix').' '.$object->prefix_comm.' ';
}
-
+
if ($object->client)
{
print '';
@@ -168,7 +166,7 @@ if ($id > 0 || ! empty($ref))
if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").') ';
print ' ';
}
-
+
if ($object->fournisseur)
{
print '';
@@ -216,7 +214,7 @@ if ($id > 0 || ! empty($ref))
{
$titre=$langs->trans("MembersListOfTiers");
print ' ';
-
+
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
print "";
@@ -230,13 +228,13 @@ if ($id > 0 || ! empty($ref))
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print "\n";
-
+
$var=True;
$i=0;
while ($i < $num && $i < $conf->liste_limit)
{
$objp = $db->fetch_object($resql);
-
+
$datefin=$db->jdate($objp->datefin);
$memberstatic->id=$objp->rowid;
$memberstatic->ref=$objp->rowid;
@@ -244,43 +242,43 @@ if ($id > 0 || ! empty($ref))
$memberstatic->firstname=$objp->firstname;
$companyname=$objp->company;
-
+
$var=!$var;
print "";
-
+
// Ref
print "";
print $memberstatic->getNomUrl(1);
print " \n";
-
+
// Lastname
print "rowid\">";
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
print " \n";
-
+
// Login
print "".$objp->login." \n";
-
+
// Type
$membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type;
print '';
print $membertypestatic->getNomUrl(1,32);
print ' ';
-
+
// Moral/Physique
print "".$memberstatic->getmorphylib($objp->morphy)." \n";
-
+
// EMail
print "".dol_print_email($objp->email,0,0,1)." \n";
-
+
// Statut
print '';
print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print " ";
-
+
// End of subscription date
if ($datefin)
{
@@ -303,7 +301,7 @@ if ($id > 0 || ! empty($ref))
}
print '';
}
-
+
print " \n";
$i++;
}
diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php
index b971cbad338..abfeef4aa2a 100644
--- a/htdocs/theme/amarok/style.css.php
+++ b/htdocs/theme/amarok/style.css.php
@@ -347,6 +347,20 @@ th .button {
/* ! Message d'erreur lors du login : */
center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: 700;
+ line-height: 0.9em;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px;
+}
/* ============================================================================== */
diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php
index e66c0d5623e..6e4ba602ade 100644
--- a/htdocs/theme/auguria/style.css.php
+++ b/htdocs/theme/auguria/style.css.php
@@ -228,6 +228,21 @@ div.inline-block
.cursorpointer {
cursor: pointer;
}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: 700;
+ line-height: 0.9em;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px;
+}
+
/* ============================================================================== */
/* Styles to hide objects */
diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php
index 3c4f7c8d712..b4573c1fc13 100644
--- a/htdocs/theme/bureau2crea/style.css.php
+++ b/htdocs/theme/bureau2crea/style.css.php
@@ -253,6 +253,20 @@ div.inline-block
.cursorpointer {
cursor: pointer;
}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: 700;
+ line-height: 0.9em;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px;
+}
/* ============================================================================== */
diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php
index be3403fabcb..096eab6c74d 100644
--- a/htdocs/theme/cameleo/style.css.php
+++ b/htdocs/theme/cameleo/style.css.php
@@ -229,6 +229,20 @@ div.inline-block
.cursorpointer {
cursor: pointer;
}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: 700;
+ line-height: 0.9em;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px;
+}
/* ============================================================================== */
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 34a653b61ea..90826327b59 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -131,12 +131,12 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
$conf->global->THEME_ELDY_LINEIMPAIR2='255,255,255';
$conf->global->THEME_ELDY_LINEIMPAIRHOVER='238,246,252';
$conf->global->THEME_ELDY_TEXT='50,50,130';
- if ($dol_use_jmobile)
+ /*if ($dol_use_jmobile)
{
$conf->global->THEME_ELDY_BACKTABCARD1='245,245,245'; // topmenu
$conf->global->THEME_ELDY_BACKTABCARD2='245,245,245';
$conf->global->THEME_ELDY_BACKTABACTIVE='245,245,245';
- }
+ }*/
}
$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
@@ -223,6 +223,7 @@ body {
background-color: #FFFFFF;
background: ;
+ /* background-image: url(""); */
color: #101010;
font-size: px;
@@ -409,6 +410,21 @@ th .button {
.cursorpointer {
cursor: pointer;
}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: 700;
+ line-height: 0.9em;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ background-color: #777;
+ border-radius: 10px;
+}
+
/* ============================================================================== */
/* Styles to hide objects */
@@ -816,6 +832,9 @@ foreach($mainmenuusedarray as $val)
.bodylogin
{
background: #f0f0f0;
+ /*-moz-box-shadow: inset 0 0 10px #000000;
+ -webkit-box-shadow: inset 0 0 10px #000000;
+ box-shadow: inset 0 0 10px #000000;*/
}
.login_vertical_align {
padding: 10px;
@@ -985,9 +1004,9 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
background-repeat:repeat-x;
border-left: 1px solid #AAA;
- border-right: 1px solid #CCC;
- border-bottom: 1px solid #CCC;
- border-top: 1px solid #CCC;
+ border-right: 1px solid #BBB;
+ border-bottom: 1px solid #BBB;
+ border-top: 1px solid #BBB;
border-radius: 5px;
-moz-border-radius: 5px;
-moz-box-shadow: 3px 3px 4px #DDD;
@@ -1325,7 +1344,8 @@ div.tabs {
/* margin: 0px 0px 2px 6px;
padding: 0px 6px 3px 0px; */
text-align: ;
- margin-left: 4px !important;
+ margin-left: 6px !important;
+ margin-right: 6px !important;
clear:both;
height:100%;
}
@@ -1341,10 +1361,10 @@ div.tabBar {
-moz-border-radius:6px;
-webkit-border-radius: 6px;
border-radius: 6px;
- border-right: 1px solid #CCCCCC;
- border-bottom: 1px solid #CCCCCC;
- border-left: 1px solid #D0D0D0;
- border-top: 1px solid #D8D8D8;
+ border-right: 1px solid #BBB;
+ border-bottom: 1px solid #BBB;
+ border-left: 1px solid #BBB;
+ border-top: 1px solid #CCC;
width: auto;
background-image: -o-linear-gradient(bottom, rgba(, 0.5) 25%, rgba(, 0.5) 100%);
@@ -1400,9 +1420,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
box-shadow: 0 -1px 4px rgba(0,0,0,.1);
border-bottom: none;
- border-right: 1px solid #CCCCCC;
- border-left: 1px solid #D0D0D0;
- border-top: 1px solid #D8D8D8;
+ border-right: 1px solid #BBB;
+ border-left: 1px solid #BBB;
+ border-top: 1px solid #CCC;
background-image: -o-linear-gradient(bottom, rgb() 35%, rgb() 100%);
@@ -1655,7 +1675,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord
}
table.border td, div.border div div.tagtd {
- padding: 1px 2px 1px 2px;
+ padding: 2px 2px 2px 2px;
border: 1px solid #D0D0D0;
border-collapse: collapse;
}
@@ -2119,9 +2139,11 @@ div.dolgraph div.legend, div.dolgraph div.legend div { background-color: rgba(25
div.dolgraph div.legend table tbody tr { height: auto; }
.photo {
-border: 0px;
-/* filter:alpha(opacity=55); */
-/* opacity:.55; */
+ border: 0px;
+}
+.photowithmargin {
+ margin-bottom: 2px;
+ margin-top: 2px;
}
.logo_setup
@@ -2959,9 +2981,9 @@ a.ui-link {
}
/* Warning: setting this may make screen not beeing refreshed after a combo selection */
-.ui-body-c {
+/*.ui-body-c {
background: #fff;
-}
+}*/
div.ui-radio, div.ui-checkbox
{
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index 4109e7ab9a4..1993f12bd5c 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -46,7 +46,7 @@ $actionsave=GETPOST('save','alpha');
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
-// List of aviable colors
+// List of available colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
// Security check
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 01b6ec32f52..4760f73f855 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
@@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
}
}
-// Action ajout user
+// Action Add user
if ($action == 'add' && $canadduser)
{
$error = 0;
@@ -206,6 +207,8 @@ if ($action == 'add' && $canadduser)
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
+ $object->color = GETPOST("color")!=''?GETPOST("color"):'';
+
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@@ -258,7 +261,7 @@ if ($action == 'add' && $canadduser)
}
}
-// Action ajout groupe utilisateur
+// Action add usergroup
if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
{
if ($group)
@@ -351,6 +354,8 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
+ $object->color = GETPOST("color")!=''?GETPOST("color"):'';
+
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@@ -589,6 +594,7 @@ if ($action == 'adduserldap')
*/
$form = new Form($db);
+$formother=new FormOther($db);
llxHeader('',$langs->trans("UserCard"));
@@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
setEventMessage($ldap->error, 'errors');
}
- // Si la liste des users est rempli, on affiche la liste deroulante
+ // If user list is full, we show drop-down list
print "\n\n\n";
print '