diff --git a/ChangeLog b/ChangeLog index f2bf26c201239..524229d014aab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -141,7 +141,7 @@ parameter. All methods addline in this case were modified to remove this paramet 5) Property ->tel on objects is now ->phone - + ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** Fix: field's problem into company's page (RIB) Fix: Document cerfa doesn't contained firstname & lastname from donator @@ -153,6 +153,14 @@ Fix: [ bug #1142 ] Set paiement on invoice (PGSql) Fix: [ bug #1145 ] Agenda button list type do not display Fix: [ bug #1148 ] Product consomation : supplier order bad status Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists +Fix: [ bug #1174 ] Product translated description not good into PDF +Fix: [ bug #1163 ] SQL Error when searching for supplier orders +Fix: [ bug #1162 ] Translaction for morning and afternoon +Fix: [ bug #1161 ] Search on product label +Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode. +Fix: [ bug #1171 ] Documents lost in interventions after validating +Fix: fix unsubscribe URL into mailing when sending manually (not by script) +Fix: [ bug #1182 ] ODT company_country tag is htmlencoded ***** ChangeLog for 3.4.1 compared to 3.4.0 ***** Fix: Display buying price on line edit when no supplier price is defined @@ -183,7 +191,6 @@ Fix: there was no escaping on filter fields in supplier product list Fix: bugs on margin reports and better margin calculation on credit notes Qual: Add travis-ci integration - ***** ChangeLog for 3.4 compared to 3.3.* ***** For users: - New: Can use ODS templates as document templates. diff --git a/build/doxygen/doxygen_footer.html b/build/doxygen/doxygen_footer.html index 38985bb5c2700..1f4cbd00215c7 100755 --- a/build/doxygen/doxygen_footer.html +++ b/build/doxygen/doxygen_footer.html @@ -22,7 +22,7 @@ +for $projectname by Doxygen $doxygenversion @@ -40,5 +40,6 @@
+ \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 6b444fe911bb2..2837bef8ca08d 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -346,6 +346,7 @@ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; diff --git a/htdocs/.gitignore b/htdocs/.gitignore index 200ea956cff4b..a4ebd2bb7c796 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -8,4 +8,4 @@ /numberingpack* /ovh* /pos -/ultimatepdf* \ No newline at end of file +/ultimatepdf* diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 0a2e0ac0a7e1a..8476a1508cd27 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/admin/agenda.php + * \file htdocs/admin/agenda_other.php * \ingroup agenda * \brief Autocreate actions for agenda module setup page */ diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index ad77a9ba8c7d3..26611da68ee51 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -292,14 +292,14 @@ // Country $var=!$var; - print ''.$langs->trans("Country").''; + print ''.$langs->trans("Country").''; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''."\n"; $var=!$var; - print ''.$langs->trans("State").''; + print ''.$langs->trans("State").''; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print ''."\n"; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 94c660c9a3ff7..ae4b9eb35dd9b 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -42,9 +42,6 @@ $constname=GETPOST('constname','alpha'); $constvalue=GETPOST('constvalue'); $constnote=GETPOST('constnote','alpha'); -$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine'); - -$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine'); @@ -52,7 +49,7 @@ * Actions */ -if ($action == 'add') +if ($action == 'add' || (GETPOST('add') && $action != 'update')) { $error=0; @@ -69,9 +66,13 @@ if (! $error) { - if (dolibarr_set_const($db, $constname, $constvalue, $typeconst[$consttype], 1, $constnote, $entity) >= 0) + if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0) { setEventMessage($langs->trans("RecordSaved")); + $action=""; + $constname=""; + $constvalue=""; + $constnote=""; } else { @@ -176,6 +177,10 @@ print $langs->trans("ConstDesc")."
\n"; print "
\n"; +print '
entity) && $debug)?'?debug=1':'').'" method="POST">'; +print ''; +print ''; + print ''; print ''; print ''; @@ -189,15 +194,12 @@ // Line to add new record $var=false; print "\n"; -print ''; -print ''; -print ''; -print ''."\n"; +print ''."\n"; print ''; // Limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) @@ -205,22 +207,17 @@ print ''; + print '\n"; print ''; -print ''; -print "\n"; - -print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; -print ''; -print ''; // Show constants $sql = "SELECT"; @@ -250,21 +247,20 @@ $var=!$var; print "\n"; - print ''; - print ''; - print ''; print ''."\n"; // Value print ''; // Note - print ''; + print ''; // Entity limit to superadmin @@ -273,13 +269,14 @@ print ''; + print ''; } diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index f7f5fe0ab5137..21a2b38e2a016 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -82,4 +82,4 @@ llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/cashdesk/deconnexion.php b/htdocs/cashdesk/deconnexion.php index a10518c983b20..50417b1972794 100644 --- a/htdocs/cashdesk/deconnexion.php +++ b/htdocs/cashdesk/deconnexion.php @@ -15,6 +15,12 @@ * along with this program. If not, see . */ +/** + * \file htdocs/cashdesk/deconnexion.php + * \ingroup cashdesk + * \brief Manage deconnexion for point of sale module + */ + //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Uncomment creates pb to relogon after a disconnect if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 16fc6e8793a9c..e903e716afb08 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -17,8 +17,9 @@ */ /** - * This page is called each time we press a key in the code - * search form to show product combo list. + * \file htdocs/cashdesk/facturation_dhtml.php + * \ingroup cashdesk + * \brief This page is called each time we press a key in the code search form to show product combo list. */ diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 3a93713ab68c9..3b65d7dd132ab 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -16,6 +16,12 @@ * along with this program. If not, see . */ +/** + * \file htdocs/cashdesk/facturation_verif.php + * \ingroup cashdesk + * \brief facturation_verif.php + */ + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php'; diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 7ceabf13308d9..94ec87edea014 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -20,6 +20,12 @@ * We set here login choices into session. */ +/** + * \file htdocs/cashdesk/index_verif.php + * \ingroup cashdesk + * \brief index_verif.php + */ + include '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; diff --git a/htdocs/cashdesk/validation.php b/htdocs/cashdesk/validation.php index 2c5ad6839d86c..fc4172f3d2dbf 100644 --- a/htdocs/cashdesk/validation.php +++ b/htdocs/cashdesk/validation.php @@ -15,6 +15,12 @@ * along with this program. If not, see . */ +/** + * \file htdocs/cashdesk/validation.php + * \ingroup cashdesk + * \brief validation.php + */ + // Affichage des templates require ('tpl/validation1.tpl.php'); diff --git a/htdocs/cashdesk/validation_ok.php b/htdocs/cashdesk/validation_ok.php index 3a3f9ba887804..1066af6b4ce2a 100644 --- a/htdocs/cashdesk/validation_ok.php +++ b/htdocs/cashdesk/validation_ok.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2008 Jeremie Ollivier * * 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 @@ -15,7 +15,13 @@ * along with this program. If not, see . */ - // Affichage des templates - require ('tpl/validation2.tpl.php'); +/** + * \file htdocs/cashdesk/validation_ok.php + * \ingroup cashdesk + * \brief validation_ok.php + */ + +// Affichage des templates +require ('tpl/validation2.tpl.php'); ?> diff --git a/htdocs/cashdesk/validation_ticket.php b/htdocs/cashdesk/validation_ticket.php index cd09bc71a0308..fe50fa680090c 100644 --- a/htdocs/cashdesk/validation_ticket.php +++ b/htdocs/cashdesk/validation_ticket.php @@ -15,6 +15,12 @@ * along with this program. If not, see . */ +/** + * \file htdocs/cashdesk/validation_ticket.php + * \ingroup cashdesk + * \brief validation_ticket.php + */ + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php'; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 3cd7784d59d40..d2b55deccde7b 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -17,6 +17,12 @@ * along with this program. If not, see . */ +/** + * \file htdocs/cashdesk/validation_verif.php + * \ingroup cashdesk + * \brief validation_verif.php + */ + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php'; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 75e994d281a71..974c42c95bb24 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -19,8 +19,8 @@ */ /** - * \file htdocs/societe/admin/societe_extrafields.php - * \ingroup societe + * \file htdocs/comm/admin/propal_extrafields.php + * \ingroup propal * \brief Page to setup extra fields of third party */ diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 3d74196e1fed2..6a963c2365846 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -984,7 +984,7 @@ $error++; } } - + if (! $error) { $db->begin(); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 123e42696acd6..50bc205d9f5da 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -21,7 +21,7 @@ /** * \file htdocs/comm/propal/document.php - * \ingroup propale + * \ingroup propal * \brief Management page of documents attached to a business proposal */ diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index ea0af0f0634c0..433dbdbf12fca 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -19,7 +19,7 @@ /** * \file htdocs/comm/propal/info.php - * \ingroup propale + * \ingroup propal * \brief Page d'affichage des infos d'une proposition commerciale */ diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2c23db317a72e..280da52f6c5d2 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -25,8 +25,8 @@ */ /** - * \file htdocs/comm/propal.php - * \ingroup propale + * \file htdocs/comm/propal/list.php + * \ingroup propal * \brief Page of commercial proposals card and list */ diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index a9ee5b6a839de..2855a296010fe 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -21,7 +21,7 @@ /** * \file htdocs/comm/propal/note.php - * \ingroup propale + * \ingroup propal * \brief Fiche d'information sur une proposition commerciale */ diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index e9ad176a86d9a..632dee6396547 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -14,7 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + */ + +/** + * \file htdocs/comm/propal/tpl/linkedobjectblock.tpl.php + * \ingroup propal + * \brief Template to show objects linked to proposals */ ?> diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index cab6277729109..a0d181e8f81d5 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ $langs->load("banks"); $langs->load("bills"); -$id=GETPOST("id"); +$id=GETPOST("id",'int'); $action=GETPOST('action'); // Security check @@ -87,7 +87,7 @@ if ($action == 'delete') { - $result=$tva->fetch($_GET['id']); + $result=$tva->fetch($id); if ($tva->rappro == 0) { @@ -100,10 +100,10 @@ { $accountline=new AccountLine($db); $result=$accountline->fetch($tva->fk_bank); - $result=$accountline->delete($user); + if ($result > 0) $result=$accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) } - if ($result > 0) + if ($result >= 0) { $db->commit(); header("Location: ".DOL_URL_ROOT.'/compta/tva/reglement.php'); @@ -289,4 +289,4 @@ $db->close(); llxFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index bff890a09b7e2..64cef78239d32 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 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 @@ -59,6 +59,8 @@ class Contact extends CommonObject var $country_code; // Code of country var $country; // Label of country + var $poste; // Position + var $socid; // fk_soc var $statut; // 0=inactif, 1=actif @@ -949,37 +951,35 @@ function LibStatut($statut,$mode) if ($mode == 0) { - if ($statut==0) return $langs->trans('Disabled'); - elseif ($statut==1) return $langs->trans('Enabled'); + if ($statut==0 || $statut==5) return $langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return $langs->trans('Enabled'); } elseif ($mode == 1) { - if ($statut==0) return $langs->trans('Disabled'); - elseif ($statut==1) return $langs->trans('Enabled'); + if ($statut==0 || $statut==5) return $langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return $langs->trans('Enabled'); } elseif ($mode == 2) { - if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); - elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); } elseif ($mode == 3) { - if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5'); - elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4'); - + if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4'); } elseif ($mode == 4) { if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft'); - elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); } elseif ($mode == 5) { - if ($statut==0) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); - elseif ($statut==1) return ''.$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($statut==0 || $statut==5) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + elseif ($statut==1 || $statut==4) return ''.$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); } - } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index dfdcfc799493e..c269b8864134d 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 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 @@ -432,14 +432,14 @@ if ($socid > 0) { print ''; - print ''; print ''; print ''; } else { - print ''; } @@ -474,13 +474,13 @@ // Zip / Town if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party - print ''; // Country - print ''; @@ -488,7 +488,7 @@ // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } - + // Visibility print ''; - print ''; print ''; @@ -680,13 +680,13 @@ print ''; // Zip / Town - print ''; // Country - print ''; @@ -694,7 +694,7 @@ // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } @@ -731,13 +731,13 @@ print ''; } print ''; - + // Skype if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''; } - + // Visibility print ''; } print ''; - + // Skype if (! empty($conf->skype->enabled) && $user->rights->skype->view) { diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 196a3eefbb896..b50cea8a482d4 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -35,6 +35,7 @@ $pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' define('DOL_URL_ROOT', $pos); +$entity = ((!empty($_SESSION['dol_entity']) && $_SESSION['dol_entity'] > 1) ? $_SESSION['dol_entity'] : null); // SECURITY: You must explicitly enable this "connector". (Set it to "true"). // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only @@ -49,7 +50,7 @@ // user files directory. Useful if you are using a virtual directory, symbolic // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // Attention: The above 'UserFilesPath' must point to the same directory. -$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root.'/fckeditor/'; +$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root . (!empty($entity) ? '/' . $entity : '') . '/fckeditor/'; // Due to security issues with Apache modules, it is recommended to leave the // following setting enabled. diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 93fa8b70a845b..9716939337665 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -99,7 +99,7 @@ function checkBanForAccount($account) if (empty($account->number)) $account->number=$account->num_compte; if (empty($account->cle)) $account->cle=$account->cle_rib; - dol_syslog("Bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG); + dol_syslog("bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG); if ($country_code == 'FR') // France rules { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a1885cbba1413..90d685e80a884 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -957,7 +957,17 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) { if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"]; - if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"]; + + //Manage HTML entities description test + //Cause $prodser->description is store with htmlentities but $desc no + $needdesctranslation=false; + if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) { + $needdesctranslation=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false); + } else { + $needdesctranslation=($desc == $prodser->description); + } + + if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($needdesctranslation)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"]; if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 39178ab38749f..bf9c98dc9038a 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -288,7 +288,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) $var=!$var; print '
'.$langs->trans("Name").'
'; -print ''; +print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; } else { + print ''; print ''; } -print ''; -print ''; +print ''; print "
'.$obj->name.''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; } else { + print ''; print ''; } - print ''; if ($conf->use_javascript_ajax) { print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ec8399e0a35da..bb17d1b039e2b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1316,9 +1316,9 @@ function fieldList($fieldlist,$obj='',$tabname='') $size=''; if ($fieldlist[$field]=='libelle') $size='size="32" '; if ($fieldlist[$field]=='tracking') $size='size="92" '; - if ($fieldlist[$field]=='accountancy_code') $size='size="15" '; - if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" '; - if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" '; + if ($fieldlist[$field]=='accountancy_code') $size='size="10" '; + if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" '; + if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" '; print ''; print '
'.$langs->trans("Company").''; + print ''; print $objsoc->getNomUrl(1); print '
'.$langs->trans("Company").''; + print '
'.$langs->trans("Company").''; print $form->select_company($socid,'socid','',1); print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").''; + print '
'.$langs->trans("Country").''; print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans('State').''; + print '
'.$langs->trans('State').''; if ($object->country_id) { print $formcompany->select_state(isset($_POST["state_id"])?$_POST["state_id"]:$object->state_id,$object->country_code,'state_id'); @@ -527,10 +527,10 @@ // Skype if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { + { print '
'.$langs->trans("Skype").'skype).'">
'.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -655,7 +655,7 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print '
'.$langs->trans("Company").''; + print ''; print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").''; + print '
'.$langs->trans("Country").''; print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '
'.$langs->trans('State').''; + print '
'.$langs->trans('State').''; print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id'); print '
 
'.$langs->trans("Skype").'skype).'">
'.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -950,7 +950,7 @@ print ' 
'; - print ''; + print '
'; - } - - print ''; + print ''; $i++; - - if ($i % $thumbsbyrow == 0) print ''; } } } } } - if ($i % $thumbsbyrow != 0) - { - while ($i % $thumbsbyrow != 0) - { - print ''; - $i++; - } - print ''; - } - print '
'; $i=0; foreach($dirthemes as $dir) @@ -310,22 +310,15 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) // Disable not stable themes //if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue; - if ($i % $thumbsbyrow == 0) - { - print '
'; + print '
'; $file=$dirtheme."/".$subdir."/thumb.png"; $url=$urltheme."/".$subdir."/thumb.png"; if (! file_exists($file)) $url=$urltheme."/common/nophoto.jpg"; - print '
'; print 'id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); else $title=$langs->trans("ShowPreview"); - print ''.$title.''; - print ''; - print '
'; + print ''.$title.''; + print '
'; if ($subdir == $selected_theme) { print ' '.$subdir.''; @@ -334,27 +327,16 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print ' '.$subdir; } - print '
 
'; + print '
'; print ''; print ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1581af09a1d4d..230287420b560 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -627,7 +627,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/contact/fiche.php?leftmenu=contacts&action=create", (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); - $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); + if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); if (! empty($conf->fournisseur->enabled)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); @@ -636,11 +636,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->categorie->enabled)) { $langs->load("categories"); - // Categories prospects/customers - $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - if (empty($user->societe_id)) + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - $newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); + // Categories prospects/customers + $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + if (empty($user->societe_id)) + { + $newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); + } } // Categories Contact $newmenu->add("/categories/index.php?leftmenu=cat&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 08bd0e008acc4..4e88c56130687 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -178,10 +178,10 @@ function __construct($db) $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 33b98d56f48a7..c2c2ef9a452ee 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * This template needs: * $object */ @@ -47,77 +47,77 @@
- -
trans("Source"); ?>
-
trans("Company"); ?>
-
trans("Contacts"); ?>
-
trans("ContactType"); ?>
-
 
-
 
+ +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
 
+
 
-
action="id; ?>" method="POST"> + " /> -
trans("Users"); ?>
-
global->MAIN_INFO_SOCIETE_NOM; ?>
-
select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?>
-
selectTypeContact($object, '', 'type','internal'); ?>
-
 
-
">
+
trans("Users"); ?>
+
global->MAIN_INFO_SOCIETE_NOM; ?>
+
select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?>
+
selectTypeContact($object, '', 'type','internal'); ?>
+
 
+
">
-
action="id; ?>" method="POST"> + " /> -
trans("ThirdPartyContacts"); ?>
+
trans("ThirdPartyContacts"); ?>
use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?> -
+
'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); print $form->select_company($object->socid,'socid','',1,0,0,$events); ?>
-
+
select_contacts($object->socid, '', 'contactid'); ?>
-
+
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany'); ?>
-
+
select_contacts($selectedCompany, '', 'contactid'); ?>
-
+
selectTypeContact($object, '', 'type','external'); ?>
-
 
-
+
 
+
">
-
-
trans("Source"); ?>
-
trans("Company"); ?>
-
trans("Contacts"); ?>
-
trans("ContactType"); ?>
-
trans("Status"); ?>
-
 
+ +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
trans("Status"); ?>
+
 
@@ -132,12 +132,12 @@ $var = !$var; ?> -
> -
+ "> +
trans("User"); ?> trans("ThirdPartyContact"); ?>
-
+
0) { @@ -154,7 +154,7 @@ } ?>
-
+
-
-
+
+ -
+
 "> diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 2609c402ffed8..8461465c5540d 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -51,7 +51,9 @@ require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php'; $ecmdirstatic = new EcmDirectory($db); + $ecmdirtmp = new EcmDirectory($db); + // This part of code is same than into file index.php for action refreshmanual TODO Remove duplicate clearstatcache(); $diroutputslash=str_replace('\\', '/', $conf->$element->dir_output); @@ -129,7 +131,6 @@ if ($fk_parent >= 0) { - $ecmdirtmp=new EcmDirectory($db); $ecmdirtmp->ref = 'NOTUSEDYET'; $ecmdirtmp->label = dol_basename($dirdesc['fullname']); $ecmdirtmp->description = ''; @@ -163,7 +164,21 @@ } } + // Loop now on each sql tree to check if dir exists + foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk + { + $dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename']; + if (! dol_is_dir($dirtotest)) + { + $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."
\n"; + $ecmdirtmp->id=$dirdesc['id']; + $ecmdirtmp->delete($user,'databaseonly'); + //exit; + } + } + $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" + dol_syslog("sql = ".$sql); $db->query($sql); } } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 4abeea326e4cb..54e3fa0a5616e 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -151,7 +151,7 @@ function create($user) $dir=$conf->ecm->dir_output.'/'.$this->getRelativePath(); $result=dol_mkdir($dir); if ($result < 0) { $error++; $this->error="ErrorFailedToCreateDir"; } - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -325,21 +325,23 @@ function fetch($id) /** - * Delete object on database and on disk + * Delete object on database and/or on disk * * @param User $user User that delete + * @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented) * @return int <0 if KO, >0 if OK */ - function delete($user) + function delete($user, $mode='all') { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error=0; + $result=0; - $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3 + if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3 - dol_syslog(get_class($this)."::delete remove directory ".$relativepath); + dol_syslog(get_class($this)."::delete remove directory id=".$this->id." mode=".$mode.(($mode == 'databaseonly')?'':' relativepath='.$relativepath)); $this->db->begin(); @@ -356,8 +358,11 @@ function delete($user) return -2; } - $file = $conf->ecm->dir_output . "/" . $relativepath; - $result=@dol_delete_dir($file); + if ($mode != 'databaseonly') + { + $file = $conf->ecm->dir_output . "/" . $relativepath; + $result=@dol_delete_dir($file); + } if ($result || ! @is_dir(dol_osencode($file))) { diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 531138aaab904..e7e4498f99d84 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -206,7 +206,10 @@ // Refresh directory view if ($action == 'refreshmanual') { - clearstatcache(); + $ecmdirtmp = new EcmDirectory($db); + + // This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate + clearstatcache(); $diroutputslash=str_replace('\\','/',$conf->ecm->dir_output); $diroutputslash.='/'; @@ -269,7 +272,7 @@ //break; // We found parent, we can stop the while loop } else - { + { dol_syslog("No"); //print "No
\n"; } @@ -282,7 +285,6 @@ if ($fk_parent >= 0) { - $ecmdirtmp=new EcmDirectory($db); $ecmdirtmp->ref = 'NOTUSEDYET'; $ecmdirtmp->label = dol_basename($dirdesc['fullname']); $ecmdirtmp->description = ''; @@ -316,6 +318,19 @@ } } + // Loop now on each sql tree to check if dir exists + foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk + { + $dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename']; + if (! dol_is_dir($dirtotest)) + { + $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."
\n"; + $ecmdirtmp->id=$dirdesc['id']; + $ecmdirtmp->delete($user,'databaseonly'); + //exit; + } + } + $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" dol_syslog("sql = ".$sql); $db->query($sql); diff --git a/htdocs/ecm/tpl/builddatabase.tpl.php b/htdocs/ecm/tpl/builddatabase.tpl.php index 4d5c0ab953a76..1b34027142f68 100644 --- a/htdocs/ecm/tpl/builddatabase.tpl.php +++ b/htdocs/ecm/tpl/builddatabase.tpl.php @@ -50,7 +50,15 @@ function(elem) { ); $('#refreshbutton').click( function() { - ecmBuildDatabase(); + $.pleaseBePatient("trans('PleaseBePatient'); ?>"); + $.getJSON( "", { + action: "build", + element: "ecm" + }, + function(response) { + $.unblockUI(); + location.href=""; + }); }); }); @@ -78,17 +86,5 @@ function loadandshowpreview(filedirname,section) }); } -ecmBuildDatabase = function() { - $.pleaseBePatient("trans('PleaseBePatient'); ?>"); - $.getJSON( "", { - action: "build", - element: "ecm" - }, - function(response) { - $.unblockUI(); - location.href=""; - }); -}; - - \ No newline at end of file + diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index e56c60a68dd31..bc4004e4fc114 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -109,16 +109,17 @@ } if ($sall) { - $sql .= natural_search(array('cf.ref', 'cf.note_public'), $sall); + $sql .= natural_search(array('cf.ref', 'cf.note_public', 'cf.note_private'), $sall); } if ($socid) $sql.= " AND s.rowid = ".$socid; if (GETPOST('statut')) { - $sql .= " AND fk_statut =".GETPOST('statut'); + $sql .= " AND fk_statut =".GETPOST('statut','int'); } -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); +$sql.= " ORDER BY $sortfield $sortorder "; +$sql.= $db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index a932a2fb67f9d..1671d7d976edf 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -812,7 +812,7 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_document_root=\''.str_replace("'","\'",($main_dir)).'\';'); fputs($fp,"\n"); - fputs($fp, $main_use_alt_dir.'$dolibarr_main_url_root_alt=\''.str_replace("'","\'",($main_url."/".$main_alt_dir_name)).'\';'); + fputs($fp, $main_use_alt_dir.'$dolibarr_main_url_root_alt=\''.str_replace("'","\'",("/".$main_alt_dir_name)).'\';'); fputs($fp,"\n"); fputs($fp, $main_use_alt_dir.'$dolibarr_main_document_root_alt=\''.str_replace("'","\'",($main_dir."/".$main_alt_dir_name)).'\';'); diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 1423820f1650d..5bd2c698dceff 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -53,6 +53,7 @@ Language_sl_SI=Slovenian Language_sv_SV=Swedish Language_sv_SE=Swedish Language_sk_SK=Slovakian +Language_uz_UZ=Uzbek Language_vi_VN=Vietnamese Language_zh_CN=Chinese Language_zh_TW=Chinese (Traditional) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7c535e07d5d5a..89b05f25f9a93 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -257,6 +257,8 @@ Seconds=Seconds Today=Today Yesterday=Yesterday Tomorrow=Tomorrow +Morning=Morning +Afternoon=Afternoon Quadri=Quadri MonthOfDay=Month of the day HourShort=H diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 7aad675d0bac4..4d55ae663e18b 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -109,4 +109,5 @@ NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> MassStockMovement=Mass stock movement SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s". RecordMovement=Record transfert -ReceivingForSameOrder=Receivings for this order \ No newline at end of file +ReceivingForSameOrder=Receivings for this order +StockMovementRecorded=Stock movements recorded \ No newline at end of file diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index 651d303f50291..86b7dd369ee98 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -53,6 +53,7 @@ Language_sl_SI=Slovène Language_sv_SV=Suédois Language_sv_SE=Suédois Language_sk_SK=Slovaque +Language_uz_UZ=Ouzbek Language_vi_VN=Vietnamien Language_zh_CN=Chinois Language_zh_TW=Chinois (Traditionel) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 8527c6d8b0661..b553b648e36ed 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -257,6 +257,8 @@ Seconds=Secondes Today=Aujourd'hui Yesterday=Hier Tomorrow=Demain +Morning=Matin +Afternoon=Après-midi Quadri=Trimestre MonthOfDay=Mois du jour HourShort=H diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 9814d4f37044a..236a83571bf6b 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -90,7 +90,7 @@ CalculatedVolume=Volume calculé Weight=Poids TotalWeight=Poids total WeightUnitton=tonnes -WeightUnitkg=Kg +WeightUnitkg=kg WeightUnitg=g WeightUnitmg=mg WeightUnitpound=livre diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index a39576f86f318..3af178c3f63b2 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -109,4 +109,5 @@ NbOfProductAfterPeriod=Quantité du produit %s en stock après la périod MassStockMovement=Mouvement de stock en masse SelectProductInAndOutWareHouse=Sélectionner un produit, une quantité à transférer, un entrepôt source et destination et cliquer sur "%s". Une fois tous les mouvements choisis, cliquer sur "%s". RecordMovement=Enregistrer transferts -ReceivingForSameOrder=Réceptions pour cette commande \ No newline at end of file +ReceivingForSameOrder=Réceptions pour cette commande +StockMovementRecorded=Mouvements de stock enregistrés \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 64a28b60ccf92..e8342224c4b5e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -102,7 +102,7 @@ function test_sql_and_script_inject($val, $type) } // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) if ($type == 1) $sql_inj += preg_match('/"/i', $val); // We refused " in GET parameters value - if ($type == 2) $sql_inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. + if ($type == 2) $sql_inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. return $sql_inj; } @@ -1173,7 +1173,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { // We must force not using ajax because cache of jquery does not load js of other pages. // This also increase seriously speed onto mobile device where complex js code is very slow and memory very low. - if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2) + if (empty($conf->dol_use_jmobile) || ($conf->dol_use_jmobile != 2 && $conf->dol_use_jmobile != 3)) { print ''; } - print ''."\n"; + if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n"; } } @@ -1614,11 +1614,11 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me //Dolibarr version $doliurl='http://www.dolibarr.org'; - + //local communities if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr'; if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es'; - + $appli='Dolibarr'; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 161cb4aa30ec3..da7642e8df4a6 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -78,9 +78,14 @@ { if (preg_match('/^http(s)?:/',$value)) { - print 'Error: values for $dolibarr_main_url_root_alt into conf.php file must contains relative path added to $dolibarr_main_url_root to get alternative URLs.
'."\n"; - print "Found: \"".$value."\"
\n"; - print "Should found something like following examples:
\n"; + // TODO: Make this a warning rather than an error since the correct value can be derived in most cases + $correct_value = str_replace($dolibarr_main_url_root, '', $value); + print 'Error:
'."\n"; + print 'Wrong $dolibarr_main_url_root_alt value in conf.php file.
'."\n"; + print 'We now use a relative path to $dolibarr_main_url_root to build alternate URLs.
'."\n"; + print 'Value found: '.$value.'
'."\n"; + print 'Should be replaced by: '.$correct_value.'
'."\n"; + print "Or something like following examples:
\n"; print "\"/extensions\"
\n"; print "\"/extensions1,/extensions2,...\"
\n"; print "\"/../extensions\"
\n"; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 2d3683abe6be3..31ed9b97ff8fe 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -309,10 +309,10 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f } } } - + // For multicompany - $out.="&entity=".$conf->entity; - + //$out.="&entity=".$conf->entity; // This should not be into link. Link contains already a ref of an object that allow to retreive entity + return $out; } @@ -691,7 +691,7 @@ function hash_call($methodName,$nvpStr) curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); - + curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index aafe01bbb019b..aa1a470aef1de 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Laurent Destailleur * * 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 @@ -28,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $langs->load("admin"); $langs->load("products"); @@ -41,6 +43,7 @@ //$price_base_type=GETPOST('price_base_type'); $objectstatic = new Product($db); +$objectstatic2 = new ProductFournisseur($db); /* @@ -60,104 +63,176 @@ if (! $error) { - $db->begin(); + $country_id=$mysoc->country_id; // TODO Allow to choose country into form - $sql = 'SELECT rowid'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'product'; - $sql.= ' WHERE entity IN ('.getEntity('product',1).')'; - $sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'"; - //$sql.= ' AND price_base_type = "'..'"'; - //print $sql; + $nbrecordsmodified=0; - $resql=$db->query($sql); - if ($resql) + $db->begin(); + + // If country to edit is my country, so we change customer prices + if ($country_id == $mysoc->country_id) { - $num = $db->num_rows($resql); + $sql = 'SELECT rowid'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'product'; + $sql.= ' WHERE entity IN ('.getEntity('product',1).')'; + $sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'"; - $i = 0; $nbrecordsmodified=0; - while ($i < $num) + $resql=$db->query($sql); + if ($resql) { - $obj = $db->fetch_object($resql); + $num = $db->num_rows($resql); - $ret=$objectstatic->fetch($obj->rowid); - if ($ret > 0) + $i = 0; + while ($i < $num) { - $ret=0; $retm=0; $updatelevel1=false; + $obj = $db->fetch_object($resql); - // Update multiprice - $listofmulti=array_reverse($objectstatic->multiprices, true); // To finish with level 1 - foreach ($listofmulti as $level => $multiprices) + $ret=$objectstatic->fetch($obj->rowid); + if ($ret > 0) { - $price_base_type = $objectstatic->multiprices_base_type[$level]; // Get price_base_type of product/service to keep the same for update - if (empty($price_base_type)) continue; // Discard not defined price levels + $ret=0; $retm=0; $updatelevel1=false; + + // Update multiprice + $listofmulti=array_reverse($objectstatic->multiprices, true); // To finish with level 1 + foreach ($listofmulti as $level => $multiprices) + { + $price_base_type = $objectstatic->multiprices_base_type[$level]; // Get price_base_type of product/service to keep the same for update + if (empty($price_base_type)) continue; // Discard not defined price levels + + if ($price_base_type == 'TTC') + { + $newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->multiprices_min_ttc[$level]; + } + else + { + $newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->multiprices_min[$level]; + } + if ($newminprice > $newprice) $newminprice=$newprice; + $newvat=str_replace('*','',$newvatrate); + $newnpr=$objectstatic->multiprices_recuperableonly[$level]; + $newlevel=$level; + + //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; + $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); + if ($retm < 0) + { + $error++; + break; + } + + if ($newlevel == 1) $updatelevel1=true; + } + // Update single price + $price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update if ($price_base_type == 'TTC') { - $newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->multiprices_min_ttc[$level]; + $newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->price_min_ttc; } else { - $newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->multiprices_min[$level]; + $newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->price_min; } if ($newminprice > $newprice) $newminprice=$newprice; $newvat=str_replace('*','',$newvatrate); - $newnpr=$objectstatic->multiprices_recuperableonly[$level]; - $newlevel=$level; - - //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; - $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); - if ($retm < 0) + $newnpr=$objectstatic->recuperableonly; + $newlevel=0; + if (! empty($price_base_type) && ! $updatelevel1) { - $error++; - break; + //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; + $ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); } - if ($newlevel == 1) $updatelevel1=true; + if ($ret < 0 || $retm < 0) $error++; + else $nbrecordsmodified++; } - // Update single price - $price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update - if ($price_base_type == 'TTC') - { - $newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->price_min_ttc; - } - else - { - $newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->price_min; - } - if ($newminprice > $newprice) $newminprice=$newprice; + $i++; + } + } + else dol_print_error($db); + } + + $fourn = new Fournisseur($db); + + // Change supplier prices + $sql = 'SELECT pfp.rowid, pfp.fk_soc, pfp.price as price, pfp.quantity as qty, pfp.fk_availability, pfp.ref_fourn'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp, '.MAIN_DB_PREFIX.'societe as s'; + $sql.= ' WHERE pfp.fk_soc = s.rowid AND pfp.entity IN ('.getEntity('product',1).')'; + $sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'"; + $sql.= " AND s.fk_pays = '".$country_id."'"; + //print $sql; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid); + if ($ret > 0) + { + $ret=0; $retm=0; $updatelevel1=false; + + $price_base_type='HT'; + //$price_base_type = $objectstatic2->price_base_type; // Get price_base_type of product/service to keep the same for update + //if ($price_base_type == 'TTC') + //{ + // $newprice=price2num($objectstatic2->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + // $newminprice=$objectstatic2->price_min_ttc; + //} + //else + //{ + $newprice=price2num($obj->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + //$newminprice=$objectstatic2->fourn_price_min; + //} + //if ($newminprice > $newprice) $newminprice=$newprice; $newvat=str_replace('*','',$newvatrate); - $newnpr=$objectstatic->recuperableonly; + //$newnpr=$objectstatic2->recuperableonly; $newlevel=0; if (! empty($price_base_type) && ! $updatelevel1) { - //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; - $ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); + //print "$objectstatic2->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; + $fourn->id=$obj->fk_soc; + $ret=$objectstatic2->update_buyprice($obj->qty, $newprice, $user, $price_base_type, $fourn, $obj->fk_availability, $obj->ref_fourn, $newvat); } if ($ret < 0 || $retm < 0) $error++; else $nbrecordsmodified++; } - $i++; } + } + else dol_print_error($db); - if (! $error) - { - if ($nbrecordsmodified > 0) setEventMessage($langs->trans("RecordsModified",$nbrecordsmodified)); - else setEventMessage($langs->trans("NoRecordFound"),'warnings'); - $db->commit(); - } - else - { - setEventMessage($langs->trans("Error"),'errors'); - $db->rollback(); - } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + + // Output result + if (! $error) + { + if ($nbrecordsmodified > 0) setEventMessage($langs->trans("RecordsModified",$nbrecordsmodified)); + else setEventMessage($langs->trans("NoRecordFound"),'warnings'); } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } + } } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index d65da9d78515a..e98ce39bfe927 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent @@ -99,6 +99,11 @@ $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); $tva_tx = price2num($tva_tx); + if ($tva_tx == '') + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'
'; + } if (empty($quantity)) { $error++; @@ -353,6 +358,7 @@ if (! empty($socid)) // When update { $default_vat=get_default_tva($supplier, $mysoc, $product->id); + if (empty($default_vat)) $default_vat=$product->tva_tx; } print ''; print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index d2de44e3bebf9..3e3082cc98198 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -247,7 +247,7 @@ function llxFooterVierge() $adh->morphy = $_POST["morphy"]; $adh->birth = $birthday; - + // Fill array 'array_options' with data from add form $extralabels=$extrafields->fetch_name_optionals_label($adh->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels,$adh); @@ -521,7 +521,7 @@ function initmorphy() // Add specific fields used by Dolibarr foundation for example if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - $arraybudget=array('50'=>'<= 100 000','100'=>'<= 200 000','200'=>'<= 500 000','400'=>'<= 1 500 000','750'=>'<= 3 000 000','1500'=>'<= 5 000 000','2000'=>'5 000 000+'); + $arraybudget=array('50'=>'<= 100 000','100'=>'<= 200 000','200'=>'<= 500 000','300'=>'<= 1 500 000','600'=>'<= 3 000 000','1000'=>'<= 5 000 000','2000'=>'5 000 000+'); print ''.$langs->trans("TurnoverOrBudget").' *'; print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); print ' € or $'; diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index 8dc175e221b8b..f01628324bbe3 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * * 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 @@ -70,10 +70,10 @@ $from=$conf->global->MAILING_EMAIL_FROM; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->trans("NewPayboxPaymentFailed"), + '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPayboxPaymentFailed"), $sendto, $from, - $langs->trans("NewPayboxPaymentFailed")."\n".$fulltag + $langs->transnoentitiesnoconv("NewPayboxPaymentFailed")."\n".$fulltag ); $result=$mailfile->sendfile(); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 323a8f3b395cc..e204b6d6697bf 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * * 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 @@ -100,10 +100,10 @@ $from=$conf->global->MAILING_EMAIL_FROM; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->trans("NewPayboxPaymentReceived"), + '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPayboxPaymentReceived"), $sendto, $from, - $langs->trans("NewPayboxPaymentReceived")."\n".$fulltag + $langs->transnoentitiesnoconv("NewPayboxPaymentReceived")."\n".$fulltag ); $result=$mailfile->sendfile(); diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index 730e0e954fb08..012880f817afc 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -29,12 +29,10 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +// For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url. +$entity=GETPOST('entity')?GETPOST('entity','int'):1; +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; @@ -78,10 +76,10 @@ $from=$conf->global->MAILING_EMAIL_FROM; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->trans("NewPaypalPaymentFailed"), + '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentFailed"), $sendto, $from, - $langs->trans("NewPaypalPaymentFailed")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt + $langs->transnoentitiesnoconv("NewPaypalPaymentFailed")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt ); $result=$mailfile->sendfile(); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 35dc64d377c19..47fd55dc5d6f1 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -29,12 +29,10 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_int($entity)) -{ - define("DOLENTITY", $entity); -} +// For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url. +$entity=GETPOST('entity')?GETPOST('entity','int'):1; +if (is_int($entity)) define("DOLENTITY", $entity); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; @@ -139,10 +137,10 @@ $from=$conf->global->MAILING_EMAIL_FROM; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->trans("NewPaypalPaymentReceived"), + '['.$conf->global->MAIN_APPLICATION_TITLE.'] '.$langs->transnoentitiesnoconv("NewPaypalPaymentReceived"), $sendto, $from, - $langs->trans("NewPaypalPaymentReceived")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt + $langs->transnoentitiesnoconv("NewPaypalPaymentReceived")."\ntag=".$fulltag."\ntoken=".$token." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt ); $result=$mailfile->sendfile(); diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 7229c0cda9d8b..fb8274e552476 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -44,48 +44,68 @@
-Example 0 : Table with div and table with table containg a select that should be overflowed and truncated
-
- -
-
- -
+Example 0a : Table with div+div+div containg a select that should be overflowed and truncated
+
+
+
+ +
+
+ +
+
+
+Example 0b: Table with div+form+div containg a select that should be overflowed and truncated
+
+ +
+ +
+
+ +
+ +
+Example 0c: Table with table+tr+td containg a select that should be overflowed and truncated
+ + + + + +
-
+ +

-Example 1 : Table using tags: div.tagtable+form+div or div.tagtable+div.tagtr+div.tagtd
+Example 1 : Table using tags: div.tagtable+div.tagtr+div or div.tagtable+div.tagtr+div.tagtd
use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; ?> - - -
-
-
line3
-
dfsdf
-
ffdsfsd
-
aaaa
+
+
line3
+
dfsdf
+
ffdsfsd
+
aaaa
-
line4
-
dfsdf
-
-
bbbb
+
line4
+
dfsdf
+
+
bbbb
-
line5
-
dfsdf
-
-
bbbb
+
line5
+
dfsdf
+
+
bbbb