diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..4d86664e43f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto + + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. +*.php text eol=lf +*.sql text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.js text eol=lf +*.css text eol=lf +*.lang text eol=lf +*.txt text eol=lf +*.md text eol=lf + +# Denote all files that are truly binary and should not be modified. +*.ico binary +*.png binary +*.jpg binary +*.odt binary +*.odf binary diff --git a/.gitignore b/.gitignore index 3748a6ef1b8..3ec764dec5b 100755 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ doxygen_warnings.log /.project .DS_Store .idea +*.iml diff --git a/ChangeLog b/ChangeLog index cf19d7f6565..6152f1407b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,16 +4,21 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5 compared to 3.4 ***** For users: -- New: [ task #877 ] Reorganize menus -- New: [ task #858 ] Holiday module: note on manual holiday assignation -- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method -- New: [ task #531 ] Add a workload on tasks +- New: [ task #877 ] Reorganize menus. +- New: [ task #858 ] Holiday module: note on manual holiday assignation. +- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method. +- New: [ task #531 ] Add a workload on tasks. - New: Add graph of bank account input/output into input-output report page. - New: Add script export-bank-receipts. -- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge +- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge. PDF that has one payment on a specific bank account.* -- New: [ task #901 ] Add Extrafeild on Fiche Inter -- New: Show process id in all command line scripts +- New: [ task #901 ] Add Extrafeild on Fiche Inter. +- New: Show process id in all command line scripts. +- New: Module mailman can subscribe/unsubscribe to ML according to categories of member. + +For translators: +- Normalized sort order of all languages files with english ref file. + For developers: - New: DolGraph can build graph with three lines. @@ -104,10 +109,12 @@ WARNING: If you used external modules, some of them may need to be upgraded due - If module use hook pdf_writelinedesc, module may have to add return 1 at end of function to keep same behaviour. - + + +***** ChangeLog for 3.3.3 compared to 3.3.2 ***** + - Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** - - Fix: Dutch (nl_NL) translation - Generalize fix: file with a specific mask not found, again - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger @@ -136,8 +143,8 @@ WARNING: If you used external modules, some of them may need to be upgraded due - Fix: [ bug #788 ] Date of linked interventions are not shown - Fix: external users should not see costprice and margin infos - Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order -***** ChangeLog for 3.3.1 compared to 3.3 ***** +***** ChangeLog for 3.3.1 compared to 3.3 ***** - Fix: [ bug #733 ] Mass emailing tools do not support -'; llxHeaderVierge($langs->trans("DolibarrDemo"), $head); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index e44342278f0..81d218cec78 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -26,10 +26,10 @@ */ if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu /** * Header empty @@ -55,13 +55,13 @@ $securitykey=GETPOST('securitykey'); * Actions */ -dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); - +dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); + if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { print 'Bad security key value.'; exit; -} +} if (! empty($tag)) { diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 8585b19cd4a..3f86685fad3 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -25,16 +25,16 @@ * \brief Script use to update unsubcribe contact to prospect mailing list */ -if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -/** - * Header empty - * - * @return void - */ -function llxHeader() { } +/** + * Header empty + * + * @return void + */ +function llxHeader() { } /** * Footer empty * @@ -53,15 +53,15 @@ $langs->load("mails"); $tag=GETPOST('tag'); $unsuscrib=GETPOST('unsuscrib'); -$securitykey=GETPOST('securitykey'); +$securitykey=GETPOST('securitykey'); /* * Actions */ -dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); - +dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); + if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { print 'Bad security key value.'; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 358201aa4a7..d2de44e3beb 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -71,7 +71,7 @@ if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1); if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { - print $langs->trans("Auto subscription form for public visitors has no been enabled"); + print $langs->trans("Auto subscription form for public visitors has not been enabled"); exit; } diff --git a/htdocs/public/offline.php b/htdocs/public/offline.php index d97c8e6e7f3..a52b446b4bb 100644 --- a/htdocs/public/offline.php +++ b/htdocs/public/offline.php @@ -23,8 +23,8 @@ * \brief Dolibarr offline page */ -define('NOCSRFCHECK',1); -define('NOLOGIN',1); +define('NOCSRFCHECK',1); +define('NOLOGIN',1); require '../main.inc.php'; diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index 24be3c5af6f..c4457ff4d93 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -63,29 +63,29 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox'); -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, + 'New subscription payed', + $sendto, $from, 'New subscription payed '.$fulltag - ); + ); - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } -} + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} llxHeaderPayBox($langs->trans("PaymentForm")); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 33107883d8f..b8940fa1a32 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -41,15 +41,15 @@ $langs->load("companies"); $langs->load("paybox"); $langs->load("paypal"); -/*$source=GETPOST('source'); -$ref=GETPOST('ref'); -$PAYBOXTOKEN=GETPOST('TOKEN'); -if (empty($PAYBOXTOKEN)) $PAYBOXTOKEN=GETPOST('token'); -$PAYBOXPAYERID=GETPOST('PAYERID'); -if (empty($PAYBOXPAYERID)) $PAYBOXPAYERID=GETPOST('PayerID'); +/*$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYBOXTOKEN=GETPOST('TOKEN'); +if (empty($PAYBOXTOKEN)) $PAYBOXTOKEN=GETPOST('token'); +$PAYBOXPAYERID=GETPOST('PAYERID'); +if (empty($PAYBOXPAYERID)) $PAYBOXPAYERID=GETPOST('PayerID'); */ -$PAYBOXFULLTAG=GETPOST('FULLTAG'); -if (empty($PAYBOXFULLTAG)) $PAYBOXFULLTAG=GETPOST('fulltag'); +$PAYBOXFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYBOXFULLTAG)) $PAYBOXFULLTAG=GETPOST('fulltag'); /* @@ -77,44 +77,44 @@ llxHeaderPayBox($langs->trans("PaymentForm")); print ''."\n"; print '
'."\n"; -// Get on url call +// Get on url call /* $token = $PAYBOXTOKEN; -*/ -$fulltag = $PAYBOXFULLTAG; -/*$payerID = $PAYBOXPAYERID; -// Set by newpayment.php -$paymentType = $_SESSION['PaymentType']; -$currencyCodeType = $_SESSION['currencyCodeType']; -$FinalPaymentAmt = $_SESSION["Payment_Amount"]; -// From env -$ipaddress = $_SESSION['ipaddress']; - -dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); -*/ - -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +*/ +$fulltag = $PAYBOXFULLTAG; +/*$payerID = $PAYBOXPAYERID; +// Set by newpayment.php +$paymentType = $_SESSION['PaymentType']; +$currencyCodeType = $_SESSION['currencyCodeType']; +$FinalPaymentAmt = $_SESSION["Payment_Amount"]; +// From env +$ipaddress = $_SESSION['ipaddress']; + +dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); +*/ + +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, - $from, + 'New subscription payed', + $sendto, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } } diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index ee72206ae52..21d93f3eaa1 100755 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -71,29 +71,29 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal'); -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, - $from, + 'New subscription payed', + $sendto, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } -} + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} llxHeaderPaypal($langs->trans("PaymentForm")); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 012269b8be3..e4ea8a92095 100755 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -81,14 +81,14 @@ if (empty($PAYPAL_API_SIGNATURE)) return -1; } -$source=GETPOST('source'); -$ref=GETPOST('ref'); -$PAYPALTOKEN=GETPOST('TOKEN'); -if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); -$PAYPALPAYERID=GETPOST('PAYERID'); -if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); -$PAYPALFULLTAG=GETPOST('FULLTAG'); -if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); +$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYPALTOKEN=GETPOST('TOKEN'); +if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); +$PAYPALPAYERID=GETPOST('PAYERID'); +if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); +$PAYPALFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); /* @@ -135,23 +135,23 @@ if ($PAYPALTOKEN) { $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', + 'New subscription payed', $sendto, - $from, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } + } } diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php new file mode 100644 index 00000000000..d79fe3f4ee9 --- /dev/null +++ b/htdocs/societe/ajax/company.php @@ -0,0 +1,107 @@ + + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2007-2011 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/product/ajax/products.php + * \brief File to return Ajax response on product list request + */ + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); +if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); + +require '../../main.inc.php'; + +$htmlname=GETPOST('htmlname','alpha'); +$socid=GETPOST('socid','int'); +$type=GETPOST('type','int'); +$mode=GETPOST('mode','int'); +$status=((GETPOST('status','int') >= 0) ? GETPOST('status','int') : -1); +$outjson=(GETPOST('outjson','int') ? GETPOST('outjson','int') : 0); +$price_level=GETPOST('price_level','int'); +$action=GETPOST('action', 'alpha'); +$id=GETPOST('id', 'int'); +$price_by_qty_rowid=GETPOST('pbq', 'int'); + +/* + * View + */ + +//print ''."\n"; + +dol_syslog(join(',',$_GET)); +//print_r($_GET); + +if (! empty($action) && $action == 'fetch' && ! empty($id)) +{ + require DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $outjson=array(); + + $object = new Societe($db); + $ret=$object->fetch($id); + if ($ret > 0) + { + $outname=$object->name; + + $outjson = array('name'=>$outname); + } + + echo json_encode($outjson); +} +else +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + + $langs->load("products"); + $langs->load("main"); + + top_httphead(); + + if (empty($htmlname)) return; + + $match = preg_grep('/('.$htmlname.'[0-9]+)/',array_keys($_GET)); + sort($match); + $id = (! empty($match[0]) ? $match[0] : ''); + + if (! GETPOST($htmlname) && ! GETPOST($id)) return; + + // When used from jQuery, the search term is added as GET param "term". + $searchkey=(GETPOST($id)?GETPOST($id):(GETPOST($htmlname)?GETPOST($htmlname):'')); + + $form = new Form($db); + if (empty($mode) || $mode == 'customer') + { + $arrayresult=$form->select_company_html($socid,$htmlname,"client IN (1,3)",0,0,0,null,$searchkey,$outjson); + } + elseif ($mode == 'supplier') + { + $arrayresult=$form->select_company_html($socid,$htmlname,"fournisseur=1",0,0,0,null,$searchkey,$outjson); + } + + $db->close(); + + if ($outjson) print json_encode($arrayresult); +} + +?> \ No newline at end of file diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 61c01b00f2a..0fb2da5a053 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -66,8 +66,8 @@ else //ini_set('default_socket_timeout', $params['response_timeout']); //$soapclient = new SoapClient($WS_DOL_URL_WSDL,$params); $soapclient = new nusoap_client($WS_DOL_URL_WSDL,true,$params['proxy_host'],$params['proxy_port'],$params['proxy_login'],$params['proxy_password'],$params['connection_timeout'],$params['response_timeout']); - $soapclient->soap_defencoding = 'utf-8'; - $soapclient->xml_encoding = 'utf-8'; + $soapclient->soap_defencoding = 'utf-8'; + $soapclient->xml_encoding = 'utf-8'; $soapclient->decode_utf8 = false; // Check for an error diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f998f563729..b6bee432087 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1452,14 +1452,14 @@ class Societe extends CommonObject { $lien = 'url='http://www.specimen.com'; $this->phone='0909090901'; - $this->fax='0909090909'; + $this->fax='0909090909'; $this->code_client='CC-'.dol_print_date($now,'dayhourlog'); $this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 27db36e8a32..356001648c3 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -443,10 +443,10 @@ if (empty($reshook)) } // Set parent company - if ($action == 'set_thirdparty' && $user->rights->societe->creer) + if ($action == 'set_thirdparty' && $user->rights->societe->creer) { - $result = $object->set_parent(GETPOST('editparentcompany','int')); - } + $result = $object->set_parent(GETPOST('editparentcompany','int')); + } /* * Generate document @@ -1721,24 +1721,24 @@ else // Parent company if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) { - // Payment term - print ''; - print ''; - if ($action != 'editparentcompany') print ''; - print '
'; - print $langs->trans('ParentCompany'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
'; - print ''; - if ($action == 'editparentcompany') - { - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'editparentcompany','s.rowid <> '.$object->id,1); - } - else - { - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'none','s.rowid <> '.$object->id,1); - } - print ''; - print ''; + // Payment term + print ''; + print ''; + if ($action != 'editparentcompany') print ''; + print '
'; + print $langs->trans('ParentCompany'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
'; + print ''; + if ($action == 'editparentcompany') + { + $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'editparentcompany','s.rowid <> '.$object->id,1); + } + else + { + $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'none','s.rowid <> '.$object->id,1); + } + print ''; + print ''; } // Sales representative diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 6b555672631..5d2d7fb5104 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -175,7 +175,7 @@ print ''; print ''."\n"; -print '
'; +print '
'; // Other support diff --git a/htdocs/theme/amarok/ckeditor/config.js b/htdocs/theme/amarok/ckeditor/config.js index 0f3a3eb60d3..0f2dbb3fc6f 100755 --- a/htdocs/theme/amarok/ckeditor/config.js +++ b/htdocs/theme/amarok/ckeditor/config.js @@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config ) ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['SpecialChar'] ]; + + // Used for mailing fields + config.toolbar_dolibarr_readonly = + [ + ['Source','Maximize'], + ['Find'] + ]; + }; diff --git a/htdocs/theme/amarok/graph-color.php b/htdocs/theme/amarok/graph-color.php index 1a0d2253a2a..be8421b6d4b 100755 --- a/htdocs/theme/amarok/graph-color.php +++ b/htdocs/theme/amarok/graph-color.php @@ -22,10 +22,10 @@ * \ingroup core */ -global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; -$theme_bordercolor = array(235,235,224); -$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); -$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); -$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); +global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; +$theme_bordercolor = array(235,235,224); +$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); +$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); +$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); ?> diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 4f55463a323..6c5ca41d52b 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -41,8 +41,8 @@ session_cache_limiter(FALSE); require_once '../../main.inc.php'; -// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) -if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login']); +// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) +if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login']); // Define css type header('Content-type: text/css'); @@ -72,109 +72,109 @@ $fontlist='helvetica,arial,tahoma,verdana'; //$fontlist='Verdana,Helvetica,Ar $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; - -// Define reference colors -// Example: Light grey: $colred=235;$colgreen=235;$colblue=235; -// Example: Pink: $colred=230;$colgreen=210;$colblue=230; -// Example: Green: $colred=210;$colgreen=230;$colblue=210; -// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; -//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; -//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; -//var_dump($user->conf->THEME_ELDY_RGB); -$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2))); -$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2))); -$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2))); - -// Colors -$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 -$isgreen=max(0,(2*$colgreen-$colred-$colblue)/2); // 0 - 255 -$isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 -$colorback1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu -$colorback2=($colred+5).','.($colgreen+5).','.($colblue+5); -$colorbacktab1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu -$colorbacktab1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) -$colorbacktab2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array -$colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktabcard1=($colred+15).','.($colgreen+16).','.($colblue+17); // card -$colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair -$colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair -$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair -$colorbacklinepair1='255,255,255'; // line pair -$colorbacklinepair2='255,255,255'; // line pair -$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); -$colorbackbody='#f5f5f5'; -$colortext='40,40,40'; -$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; -$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; -$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); -$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); -$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); -$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); -$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); -$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); -$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); -$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); -$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); -$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); -$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); -$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); -$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); -$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); -$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); -$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); -$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); -$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); -$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); -$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); -// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER -if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) - || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) -{ - $colorbacklineimpairhover=''; - $colorbacklinepairhover=''; -} - -// Set text color to black or white -$tmppart=explode(',',$colorback1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); -$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); -$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); -//print $tmpval; -if ($tmpval < 340) $colortextmain='FFFFFF'; -else $colortextmain='101010'; - -$usecss3=true; -if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; -elseif ($conf->browser->name == 'iceweasel') $usecss3=false; -elseif ($conf->browser->name == 'epiphany') $usecss3=false; - -print '/*'."\n"; -print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; -print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; -print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; -print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; -print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; -print 'colorbacklinepair1='.$colorbacklinepair1."\n"; -print 'colorbacklinepair2='.$colorbacklinepair2."\n"; -print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; -print 'usecss3='.$usecss3."\n"; -print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; -print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; -print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; -print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; -print '*/'."\n"; - +// Define reference colors +// Example: Light grey: $colred=235;$colgreen=235;$colblue=235; +// Example: Pink: $colred=230;$colgreen=210;$colblue=230; +// Example: Green: $colred=210;$colgreen=230;$colblue=210; +// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; +//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; +//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; +//var_dump($user->conf->THEME_ELDY_RGB); +$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2))); +$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2))); +$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2))); + +// Colors +$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 +$isgreen=max(0,(2*$colgreen-$colred-$colblue)/2); // 0 - 255 +$isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 +$colorback1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu +$colorback2=($colred+5).','.($colgreen+5).','.($colblue+5); +$colorbacktab1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu +$colorbacktab1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) +$colorbacktab2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array +$colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabcard1=($colred+15).','.($colgreen+16).','.($colblue+17); // card +$colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair +$colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair +$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair +$colorbacklinepair1='255,255,255'; // line pair +$colorbacklinepair2='255,255,255'; // line pair +$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); +$colorbackbody='#f5f5f5'; +$colortext='40,40,40'; +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; + +$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); +$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); +$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); +$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); +$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); +$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); +$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); +$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); +$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); +$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); +$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); +$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); +$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); +$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); +$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); +$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); +$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} + +// Set text color to black or white +$tmppart=explode(',',$colorback1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); +$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); +$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); +//print $tmpval; +if ($tmpval < 340) $colortextmain='FFFFFF'; +else $colortextmain='101010'; + +$usecss3=true; +if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; +elseif ($conf->browser->name == 'iceweasel') $usecss3=false; +elseif ($conf->browser->name == 'epiphany') $usecss3=false; + +print '/*'."\n"; +print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; +print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; +print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; +print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepair1='.$colorbacklinepair1."\n"; +print 'colorbacklinepair2='.$colorbacklinepair2."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'usecss3='.$usecss3."\n"; +print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; +print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; +print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; +print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; +print 'dol_use_jmobile='.$dol_use_jmobile."\n"; +print '*/'."\n"; + if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11; ?> diff --git a/htdocs/theme/auguria/ckeditor/config.js b/htdocs/theme/auguria/ckeditor/config.js index 45e65240f25..ed3e3d462b9 100644 --- a/htdocs/theme/auguria/ckeditor/config.js +++ b/htdocs/theme/auguria/ckeditor/config.js @@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config ) ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','SpecialChar'] ]; + + // Used for mailing fields + config.toolbar_dolibarr_readonly = + [ + ['Source','Maximize'], + ['Find'] + ]; + }; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 41bdadf037c..71deed1ce23 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -63,10 +63,10 @@ if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global- // Define image path files $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); diff --git a/htdocs/theme/bureau2crea/ckeditor/config.js b/htdocs/theme/bureau2crea/ckeditor/config.js index 45e65240f25..ed3e3d462b9 100644 --- a/htdocs/theme/bureau2crea/ckeditor/config.js +++ b/htdocs/theme/bureau2crea/ckeditor/config.js @@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config ) ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','SpecialChar'] ]; + + // Used for mailing fields + config.toolbar_dolibarr_readonly = + [ + ['Source','Maximize'], + ['Find'] + ]; + }; diff --git a/htdocs/theme/bureau2crea/img/object_project.png b/htdocs/theme/bureau2crea/img/object_project.png index ae1d7deadb7..47029fed03d 100644 Binary files a/htdocs/theme/bureau2crea/img/object_project.png and b/htdocs/theme/bureau2crea/img/object_project.png differ diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 46abe55ecae..a4933807864 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -60,10 +60,10 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; $path=''; // This value may be used in future for external module to overwrite theme @@ -227,7 +227,9 @@ div.inline-block .nowrap { white-space: ; } - +.dolibarrcombobox { + height: 22px; +} /* ============================================================================== */ /* Styles to hide objects */ @@ -787,7 +789,7 @@ div.blockvmenusearch div.menu_titre { { padding-top: 1px; padding-bottom: 1px; - height: 16px; + min-height: 14px; } div.blockvmenubookmarks @@ -1143,20 +1145,6 @@ div.tabs a.tab#active { } -div.tabs a.tab span { - padding: 0px 10px 0px 10px; - background-image: url(); - background-position: left; - background-repeat: no-repeat; - display: block; - height: 18px; - width: auto; -} - -div.tabs a.tab#active span { - background-image: url(); -} - div.tabs a.tab:hover { color: #FFFFFF; background-color: #505050; @@ -1174,6 +1162,7 @@ div.tabBar { margin: 0px 0px 10px 0px; background: #dee7ec url() repeat-x; } +*/ div.tabsAction { margin: 20px 0em 1px 0em; @@ -1181,7 +1170,7 @@ div.tabsAction { text-align: right; } - +/* a.tabTitle { background: #5088A9; color: white; @@ -1299,8 +1288,7 @@ div.divButAction { margin-bottom: 1.4em; } margin: 0px 10px 0px 10px; text-decoration: none; white-space: nowrap; - float: right; - font-size: 10px; + font-size: 12px; height: 18px; line-height: 18px; cursor: pointer; @@ -1330,8 +1318,7 @@ div.divButAction { margin-bottom: 1.4em; } margin: 0px 10px 0px 10px; text-decoration: none; white-space: nowrap; - float: right; - font-size: 10px; + font-size: 12px; height: 18px; line-height: 18px; margin-bottom: 10px; @@ -2119,10 +2106,6 @@ A.none, A.none:active, A.none:visited, A.none:hover { font-size:1em; } -div.tabsAction { - margin-top: 10px; -} - table.noborder { margin-bottom: 10px; position: relative; diff --git a/htdocs/theme/cameleo/ckeditor/config.js b/htdocs/theme/cameleo/ckeditor/config.js index 85dd8c7429f..99d5d33fc5d 100644 --- a/htdocs/theme/cameleo/ckeditor/config.js +++ b/htdocs/theme/cameleo/ckeditor/config.js @@ -79,4 +79,11 @@ CKEDITOR.editorConfig = function( config ) ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','SpecialChar'] ]; + + // Used for mailing fields + config.toolbar_dolibarr_readonly = + [ + ['Source','Maximize'], + ['Find'] + ]; }; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index be7c6532f44..2f58829b422 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -60,10 +60,10 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; $path=''; // This value may be used in future for external module to overwrite theme diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 02e871c20f6..a98b2f72df2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -58,8 +58,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); -$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; -$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $path=''; // This value may be used in future for external module to overwrite theme $theme='eldy'; // Value of theme @@ -70,10 +70,10 @@ $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Ar $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); $dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; // Define reference colors @@ -919,19 +919,20 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks margin: 1px 0px 8px 2px; - background-image: -o-linear-gradient(bottom, rgb() 0px, rgb() 8px); - background-image: -moz-linear-gradient(bottom, rgb() 0px, rgb() 8px); -/* background-image: -webkit-linear-gradient(bottom, rgb() 90%, rgb() 100%); */ - background-image: -webkit-linear-gradient(right, rgb() 0px, rgb() 8px); - background-image: -ms-linear-gradient(bottom, rgb() 0px, rgb() 8px); - background-image: linear-gradient(bottom, rgb() 0px, rgb() 8px); + + background-image: -o-linear-gradient(bottom, rgb() 0px, rgb() 3px); + background-image: -moz-linear-gradient(bottom, rgb() 0px, rgb() 3px); + background-image: -webkit-linear-gradient(right, rgb() 0px, rgb() 3px); + background-image: -ms-linear-gradient(bottom, rgb() 0px, rgb() 3px); + background-image: linear-gradient(bottom, rgb() 0px, rgb() 3px); + background-image: url(); background-position:top; background-repeat:repeat-x; border-left: 1px solid #CCCCCC; - border-right: 1px solid #DDDDDD; + border-right: 1px solid #D0D0D0; border-bottom: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD; border-radius: 5px; @@ -1874,19 +1875,20 @@ div.ok { } div.warning { - color: #997711; - padding: 0.2em 0.2em 0.2em 0.2em; + color: #504020; + padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; - border: 1px solid #e0e0d0; + border: 1px solid #e0d0b0; -moz-border-radius:6px; -webkit-border-radius: 6px; border-radius: 6px; - background: #efefd4; + background: #FFEF9A; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } div.error { color: #550000; font-weight: bold; - padding: 0.2em 0.2em 0.2em 0.2em; + padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #DC9CAB; -moz-border-radius:6px; @@ -1897,14 +1899,15 @@ div.error { /* Info admin */ div.info { - color: #807050; + color: #302010; padding: 0.4em 0.4em 0.4em 0.4em; margin: 0.5em 0em 0.5em 0em; - border: 1px solid #DFDFA0; + border: 1px solid #DFBF9A; -moz-border-radius:6px; -webkit-border-radius: 6px; border-radius:6px; - background: #EFEFBA; + background: #EFCFAA; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 7e884a5c10a..aa6fb883a1d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1113,9 +1113,9 @@ class User extends CommonObject $this->note = trim($this->note); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; - $this->address = empty($this->address)?'':$this->address; - $this->zip = empty($this->zip)?'':$this->zip; - $this->town = empty($this->town)?'':$this->town; + $this->address = empty($this->address)?'':$this->address; + $this->zip = empty($this->zip)?'':$this->zip; + $this->town = empty($this->town)?'':$this->town; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 48f02ca5603..b95374d800b 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -54,7 +54,7 @@ if ($action == 'update' && ! $_POST['cancel']) $edituser->clicktodial_url = GETPOST("url"); $edituser->clicktodial_login = GETPOST("login"); $edituser->clicktodial_password = GETPOST("password"); - $edituser->clicktodial_poste = GETPOST("poste"); + $edituser->clicktodial_poste = GETPOST("poste"); $result=$edituser->update_clicktodial(); if ($result < 0) setEventMessage($edituser->error,'errors'); @@ -155,10 +155,10 @@ if ($id > 0) print ''; - print '
'; - print '     '; - print ''; - print '
'; + print '
'; + print '     '; + print ''; + print '
'; print ''; } diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 3dcd1eae8ff..edd860426aa 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -63,9 +63,9 @@ if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOU if (GETPOST('dol_hide_topmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1'; if (GETPOST('dol_hide_leftmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1'; -if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1'; -if (GETPOST('dol_no_mouse_hover')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_hover=1'; -if (GETPOST('dol_use_jmobile')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_use_jmobile=1'; +if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1'; +if (GETPOST('dol_no_mouse_hover')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_hover=1'; +if (GETPOST('dol_use_jmobile')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_use_jmobile=1'; // Destroy session $prefix=dol_getprefix(); @@ -77,8 +77,8 @@ session_destroy(); dol_syslog("End of session ".$sessionname); // TODO Not sure this is required -unset($_SESSION['dol_login']); -unset($_SESSION['dol_entity']); +unset($_SESSION['dol_login']); +unset($_SESSION['dol_entity']); header("Location: ".$url); ?> diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 568cebad27e..54a9093bd34 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -122,10 +122,10 @@ $title = $langs->trans("User"); if ($action == 'edit') { - print '
'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 112f38caded..d1512fea9ab 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -55,11 +55,11 @@ $conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1); $hookmanager->initHooks(array('passwordforgottenpage')); -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 (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; /** diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 616b0609f7a..0c2b17dcb1a 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -272,8 +272,8 @@ print ''."\n"; print '
'; if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"), 0, 1).'
'; -// Show warning about external users -if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'

'."\n"; +// Show warning about external users +if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'

'."\n"; // For multicompany transversal mode if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index efa2dbe576d..b12a38000a7 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -47,7 +47,7 @@ function llxHeader() { } * * @return void */ -function llxFooter() { } +function llxFooter() { } require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -97,15 +97,15 @@ else $type=dol_mimetype($original_file); // Suppression de la chaine de caractere ../ dans $original_file $original_file = str_replace("../","/", $original_file); -// Find the subdirectory name as the reference -$refname=basename(dirname($original_file)."/"); - -// Security check +// Find the subdirectory name as the reference +$refname=basename(dirname($original_file)."/"); + +// Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); -$check_access = dol_check_secure_access_document($modulepart,$original_file,$entity,$refname); -$accessallowed = $check_access['accessallowed']; -$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$original_file = $check_access['original_file']; +$check_access = dol_check_secure_access_document($modulepart,$original_file,$entity,$refname); +$accessallowed = $check_access['accessallowed']; +$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; +$original_file = $check_access['original_file']; // Security: // Limit access if permissions are wrong diff --git a/htdocs/webservices/README b/htdocs/webservices/README index 14535775c52..b4c1137bf67 100644 --- a/htdocs/webservices/README +++ b/htdocs/webservices/README @@ -1,14 +1,14 @@ -README (english) ---------------------------------------------------------- -This directory contains files to make Dolibarr a server -of SOAP Web Services. - -* To see all Webservices provided by Dolibarr, just call following Url: -http://mydomain.com/dolibarr/webservices/server.php - -* WSDL file of Web services provided by Dolibarr can be obtained at: -http://mydomain.com/dolibarr/webservices/server.php?wsdl -and is also saved in file: -server.wsdl - -Note, you can test this Webservices by calling the page client.php. +README (english) +--------------------------------------------------------- +This directory contains files to make Dolibarr a server +of SOAP Web Services. + +* To see all Webservices provided by Dolibarr, just call following Url: +http://mydomain.com/dolibarr/webservices/server.php + +* WSDL file of Web services provided by Dolibarr can be obtained at: +http://mydomain.com/dolibarr/webservices/server.php?wsdl +and is also saved in file: +server.wsdl + +Note, you can test this Webservices by calling the page client.php. diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 0655b0cd729..57021f5f2b2 100755 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -381,7 +381,7 @@ function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) $result=$invoice->fetch($obj->facid); if ($result < 0) { - $error++; + $error++; $errorcode=$result; $errorlabel=$invoice->error; break; } diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 825d13a3afe..8ba7f665f60 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -33,33 +33,33 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit; } -require_once($path."../../htdocs/master.inc.php"); -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once($path."../../htdocs/master.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; // Global variables $version=DOL_VERSION; $error=0; - - + + /* * Main */ -@set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +@set_time_limit(0); +print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; if (! isset($argv[3]) || ! $argv[3]) { print "Usage: $script_file bank_ref bank_receipt_number (csv|tsv|excel|excel2007) [lang=xx_XX]\n"; @@ -68,52 +68,52 @@ if (! isset($argv[3]) || ! $argv[3]) { $bankref=$argv[1]; $num=$argv[2]; $model=$argv[3]; -$newlangid='en_EN'; // To force a new lang id +$newlangid='en_EN'; // To force a new lang id $invoicestatic=new Facture($db); $invoicesupplierstatic=new FactureFournisseur($db); -$societestatic=new Societe($db); +$societestatic=new Societe($db); $chargestatic=new ChargeSociales($db); -$memberstatic=new Adherent($db); -$paymentstatic=new Paiement($db); +$memberstatic=new Adherent($db); +$paymentstatic=new Paiement($db); $paymentsupplierstatic=new PaiementFourn($db); -$paymentsocialcontributionstatic=new PaymentSocialContribution($db); -$paymentvatstatic=new Tva($db); -$bankstatic=new Account($db); +$paymentsocialcontributionstatic=new PaymentSocialContribution($db); +$paymentvatstatic=new Tva($db); +$bankstatic=new Account($db); $banklinestatic=new AccountLine($db); // Parse parameters -foreach ($argv as $key => $value) -{ - $found=false; - - // Define options - if (preg_match('/^lang=/i',$value)) - { - $found=true; - $valarray=explode('=',$value); - $newlangid=$valarray[1]; - print 'Use language '.$newlangid.".\n"; +foreach ($argv as $key => $value) +{ + $found=false; + + // Define options + if (preg_match('/^lang=/i',$value)) + { + $found=true; + $valarray=explode('=',$value); + $newlangid=$valarray[1]; + print 'Use language '.$newlangid.".\n"; } } -$outputlangs = $langs; -if (! empty($newlangid)) -{ - if ($outputlangs->defaultlang != $newlangid) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlangid); - } +$outputlangs = $langs; +if (! empty($newlangid)) +{ + if ($outputlangs->defaultlang != $newlangid) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlangid); + } } $outputlangs->load("main"); $outputlangs->load("bills"); -$outputlangs->load("companies"); -$outputlangs->load("banks"); -$outputlangs->load("members"); -$outputlangs->load("compta"); - +$outputlangs->load("companies"); +$outputlangs->load("banks"); +$outputlangs->load("members"); +$outputlangs->load("compta"); + $acct=new Account($db); $result=$acct->fetch('',$bankref); @@ -128,22 +128,22 @@ else } -// Creation de la classe d'export du model ExportXXX -$dir = DOL_DOCUMENT_ROOT . "/core/modules/export/"; -$file = "export_".$model.".modules.php"; -$classname = "Export".$model; +// Creation de la classe d'export du model ExportXXX +$dir = DOL_DOCUMENT_ROOT . "/core/modules/export/"; +$file = "export_".$model.".modules.php"; +$classname = "Export".$model; if (! dol_is_file($dir.$file)) { print "No driver to export with format ".$model."\n"; exit; } -require_once $dir.$file; -$objmodel = new $classname($db); +require_once $dir.$file; +$objmodel = new $classname($db); // Define target path -$dirname = $conf->banque->dir_temp; -$filename = 'export-bank-receipts-'.$bankref.'-'.$num.'.'.$objmodel->extension; +$dirname = $conf->banque->dir_temp; +$filename = 'export-bank-receipts-'.$bankref.'-'.$num.'.'.$objmodel->extension; $array_fields=array( @@ -154,21 +154,21 @@ $array_fields=array( 'soldbefore'=>$outputlangs->transnoentitiesnoconv("BankBalanceBefore"), 'soldafter'=>$outputlangs->transnoentitiesnoconv("BankBalanceAfter"), 'comment'=>$outputlangs->transnoentitiesnoconv("Comment") ); -$array_selected=array( -'bankreceipt'=>'bankreceipt', 'bankaccount'=>'bankaccount', -'dateop'=>'dateop','dateval'=>'dateval','type'=>'type', -'description'=>'description', 'thirdparty'=>'thirdparty', 'accountelem'=>'accountelem', +$array_selected=array( +'bankreceipt'=>'bankreceipt', 'bankaccount'=>'bankaccount', +'dateop'=>'dateop','dateval'=>'dateval','type'=>'type', +'description'=>'description', 'thirdparty'=>'thirdparty', 'accountelem'=>'accountelem', 'debit'=>'debit', 'credit'=>'credit', 'soldbefore'=>'soldbefore','soldafter'=>'soldafter', -'comment'=>'comment' -); +'comment'=>'comment' +); $array_export_TypeFields=array( -'bankreceipt'=>'Text', 'bankaccount'=>'Text', -'dateop'=>'Date','dateval'=>'Date','type'=>'Text', -'description'=>'Text', 'thirdparty'=>'Text', 'accountelem'=>'Text', +'bankreceipt'=>'Text', 'bankaccount'=>'Text', +'dateop'=>'Date','dateval'=>'Date','type'=>'Text', +'description'=>'Text', 'thirdparty'=>'Text', 'accountelem'=>'Text', 'debit'=>'Number', 'credit'=>'Number', 'soldbefore'=>'Number','soldafter'=>'Number', -'comment'=>'Text' +'comment'=>'Text' ); @@ -180,69 +180,69 @@ foreach($arraynum as $val) if ($listofnum != "'") $listofnum.="','"; $listofnum.=$val; } -$listofnum.="'"; -$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; -$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; -$sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel"; -$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; -$sql.= ", ".MAIN_DB_PREFIX."bank as b"; -$sql.= " WHERE b.num_releve IN (".$listofnum.")"; -if (!isset($num)) $sql.= " OR b.num_releve is null"; -$sql.= " AND b.fk_account = ".$acct->id; -$sql.= " AND b.fk_account = ba.rowid"; -$sql.= $db->order("b.num_releve, b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day -//print $sql; +$listofnum.="'"; +$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; +$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; +$sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel"; +$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; +$sql.= ", ".MAIN_DB_PREFIX."bank as b"; +$sql.= " WHERE b.num_releve IN (".$listofnum.")"; +if (!isset($num)) $sql.= " OR b.num_releve is null"; +$sql.= " AND b.fk_account = ".$acct->id; +$sql.= " AND b.fk_account = ba.rowid"; +$sql.= $db->order("b.num_releve, b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day +//print $sql; $resql=$db->query($sql); if ($resql) { - $balancebefore=array(); + $balancebefore=array(); $numrows = $db->num_rows($resql); if ($numrows > 0) { - // Open file - print 'Open file '.$filename.' into directory '.$dirname."\n"; - dol_mkdir($dirname); - $result=$objmodel->open_file($dirname."/".$filename, $outputlangs); - - if ($result < 0) + // Open file + print 'Open file '.$filename.' into directory '.$dirname."\n"; + dol_mkdir($dirname); + $result=$objmodel->open_file($dirname."/".$filename, $outputlangs); + + if ($result < 0) { - print 'Failed to create file '.$filename.' into dir '.$dirname.'.'."\n"; + print 'Failed to create file '.$filename.' into dir '.$dirname.'.'."\n"; return -1; - } - - // Genere en-tete - $objmodel->write_header($outputlangs); - - // Genere ligne de titre - $objmodel->write_title($array_fields,$array_selected,$outputlangs,$array_export_TypeFields); - } + } + + // Genere en-tete + $objmodel->write_header($outputlangs); + + // Genere ligne de titre + $objmodel->write_title($array_fields,$array_selected,$outputlangs,$array_export_TypeFields); + } $i=0; - while ($i < $numrows) + while ($i < $numrows) { - $thirdparty=''; + $thirdparty=''; $accountelem=''; - $comment=''; - - $objp = $db->fetch_object($resql); + $comment=''; + + $objp = $db->fetch_object($resql); // Calculate start balance if (! isset($balancebefore[$objp->num_releve])) - { + { print 'Calculate start balance for receipt '.$objp->num_releve."\n"; - $sql2 = "SELECT sum(b.amount) as amount"; - $sql2.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql2.= " WHERE b.num_releve < '".$db->escape($objp->num_releve)."'"; - $sql2.= " AND b.fk_account = ".$objp->bankid; - $resql2=$db->query($sql2); - if ($resql2) - { - $obj2=$db->fetch_object($resql2); - $balancebefore[$objp->num_releve] = ($obj2->amount?$obj2->amount:0); - $db->free($resql2); + $sql2 = "SELECT sum(b.amount) as amount"; + $sql2.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql2.= " WHERE b.num_releve < '".$db->escape($objp->num_releve)."'"; + $sql2.= " AND b.fk_account = ".$objp->bankid; + $resql2=$db->query($sql2); + if ($resql2) + { + $obj2=$db->fetch_object($resql2); + $balancebefore[$objp->num_releve] = ($obj2->amount?$obj2->amount:0); + $db->free($resql2); } else { @@ -254,44 +254,44 @@ if ($resql) } $totalbefore = $total; - $total = $total + $objp->amount; - - $var=!$var; - - // Date operation - $dateop=$db->jdate($objp->do); - - // Date de valeur - $datevalue=$db->jdate($objp->dv); - - // Num cheque - $numchq=($objp->num_chq?$objp->num_chq:''); - - // Libelle - $reg=array(); - preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction - if ($reg[1] && $langs->transnoentitiesnoconv($reg[1])!=$reg[1]) $description=$langs->transnoentitiesnoconv($reg[1]); - else $description=$objp->label; + $total = $total + $objp->amount; - /* - * Ajout les liens (societe, company...) - */ - $links = $acct->get_url($objp->rowid); - foreach($links as $key=>$val) - { - if ($links[$key]['type']=='payment') - { + $var=!$var; + + // Date operation + $dateop=$db->jdate($objp->do); + + // Date de valeur + $datevalue=$db->jdate($objp->dv); + + // Num cheque + $numchq=($objp->num_chq?$objp->num_chq:''); + + // Libelle + $reg=array(); + preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction + if ($reg[1] && $langs->transnoentitiesnoconv($reg[1])!=$reg[1]) $description=$langs->transnoentitiesnoconv($reg[1]); + else $description=$objp->label; + + /* + * Ajout les liens (societe, company...) + */ + $links = $acct->get_url($objp->rowid); + foreach($links as $key=>$val) + { + if ($links[$key]['type']=='payment') + { $paymentstatic->fetch($links[$key]['url_id']); - $tmparray=$paymentstatic->getBillsArray(''); + $tmparray=$paymentstatic->getBillsArray(''); foreach($tmparray as $key => $val) { $invoicestatic->fetch($val); if ($accountelem) $accountelem.= ', '; $accountelem.=$invoicestatic->ref; } - } - elseif ($links[$key]['type']=='payment_supplier') - { + } + elseif ($links[$key]['type']=='payment_supplier') + { $paymentsupplierstatic->fetch($links[$key]['url_id']); $tmparray=$paymentsupplierstatic->getBillsArray(''); foreach($tmparray as $key => $val) @@ -300,94 +300,94 @@ if ($resql) if ($accountelem) $accountelem.= ', '; $accountelem.=$invoicesupplierstatic->ref; } - } - elseif ($links[$key]['type']=='payment_sc') + } + elseif ($links[$key]['type']=='payment_sc') { - $paymentsocialcontributionstatic->fetch($links[$key]['url_id']); + $paymentsocialcontributionstatic->fetch($links[$key]['url_id']); if ($accountelem) $accountelem.= ', '; $accountelem.=$langs->transnoentitiesnoconv("SocialContribution").' '.$paymentsocialcontributionstatic->ref; - } - elseif ($links[$key]['type']=='payment_vat') - { + } + elseif ($links[$key]['type']=='payment_vat') + { $paymentvatstatic->fetch($links[$key]['url_id']); - if ($accountelem) $accountelem.= ', '; + if ($accountelem) $accountelem.= ', '; $accountelem.=$langs->transnoentitiesnoconv("VATPayments").' '.$paymentvatstatic->ref; - } + } elseif ($links[$key]['type']=='banktransfert') { - $comment=$outputlangs->transnoentitiesnoconv("Transfer"); - if ($objp->amount > 0) - { + $comment=$outputlangs->transnoentitiesnoconv("Transfer"); + if ($objp->amount > 0) + { if ($comment) $comment.= ' '; - $banklinestatic->fetch($links[$key]['url_id']); - $bankstatic->id=$banklinestatic->fk_account; - $bankstatic->label=$banklinestatic->bank_account_label; - $comment.= ' ('.$langs->transnoentitiesnoconv("from").' '; - $comment.= $bankstatic->getNomUrl(1,'transactions'); - $comment.= ' '.$langs->transnoentitiesnoconv("toward").' '; - $bankstatic->id=$objp->bankid; - $bankstatic->label=$objp->bankref; - $comment.= $bankstatic->getNomUrl(1,''); - $comment.= ')'; - } - else - { + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + $comment.= ' ('.$langs->transnoentitiesnoconv("from").' '; + $comment.= $bankstatic->getNomUrl(1,'transactions'); + $comment.= ' '.$langs->transnoentitiesnoconv("toward").' '; + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + $comment.= $bankstatic->getNomUrl(1,''); + $comment.= ')'; + } + else + { if ($comment) $comment.= ' '; - $bankstatic->id=$objp->bankid; - $bankstatic->label=$objp->bankref; - $comment.= ' ('.$langs->transnoentitiesnoconv("from").' '; - $comment.= $bankstatic->getNomUrl(1,''); - $comment.= ' '.$langs->transnoentitiesnoconv("toward").' '; - $banklinestatic->fetch($links[$key]['url_id']); - $bankstatic->id=$banklinestatic->fk_account; - $bankstatic->label=$banklinestatic->bank_account_label; - $comment.= $bankstatic->getNomUrl(1,'transactions'); - $comment.= ')'; - } - } + $bankstatic->id=$objp->bankid; + $bankstatic->label=$objp->bankref; + $comment.= ' ('.$langs->transnoentitiesnoconv("from").' '; + $comment.= $bankstatic->getNomUrl(1,''); + $comment.= ' '.$langs->transnoentitiesnoconv("toward").' '; + $banklinestatic->fetch($links[$key]['url_id']); + $bankstatic->id=$banklinestatic->fk_account; + $bankstatic->label=$banklinestatic->bank_account_label; + $comment.= $bankstatic->getNomUrl(1,'transactions'); + $comment.= ')'; + } + } elseif ($links[$key]['type']=='company') - { + { if ($thirdparty) $thirdparty.= ', '; - $thirdparty.= dol_trunc($links[$key]['label'],24); - $newline=0; - } + $thirdparty.= dol_trunc($links[$key]['label'],24); + $newline=0; + } elseif ($links[$key]['type']=='member') - { + { if ($thirdparty) $accountelem.= ', '; - $thirdparty.= $links[$key]['label']; - $newline=0; - } + $thirdparty.= $links[$key]['label']; + $newline=0; + } /*elseif ($links[$key]['type']=='sc') - { + { if ($accountelem) $accountelem.= ', '; - //$accountelem.= '
'; - //$accountelem.= img_object($langs->transnoentitiesnoconv('ShowBill'),'bill').' '; - $accountelem.= $langs->transnoentitiesnoconv("SocialContribution"); - //$accountelem.= ''; - $newline=0; - } + //$accountelem.= ''; + //$accountelem.= img_object($langs->transnoentitiesnoconv('ShowBill'),'bill').' '; + $accountelem.= $langs->transnoentitiesnoconv("SocialContribution"); + //$accountelem.= ''; + $newline=0; + } else - { + { if ($accountelem) $accountelem.= ', '; - //$accountelem.= ''; - $accountelem.= $links[$key]['label']; - //$accountelem.= ''; - $newline=0; - }*/ + //$accountelem.= ''; + $accountelem.= $links[$key]['label']; + //$accountelem.= ''; + $newline=0; + }*/ } $debit=$credit=''; - if ($objp->amount < 0) - { - $totald = $totald + abs($objp->amount); - $debit=price2num($objp->amount * -1); - } - else - { - $totalc = $totalc + abs($objp->amount); - $credit=price2num($objp->amount); - } - + if ($objp->amount < 0) + { + $totald = $totald + abs($objp->amount); + $debit=price2num($objp->amount * -1); + } + else + { + $totalc = $totalc + abs($objp->amount); + $credit=price2num($objp->amount); + } + $i++; $rec=new stdClass(); @@ -399,25 +399,25 @@ if ($resql) $rec->description=$description; $rec->thirdparty=$thirdparty; $rec->accountelem=$accountelem; - $rec->debit=$debit; - $rec->credit=$credit; + $rec->debit=$debit; + $rec->credit=$credit; $rec->sold=$sold; $rec->comment=$comment; $rec->soldbefore=price2num($totalbefore); - $rec->soldafter=price2num($total); + $rec->soldafter=price2num($total); - // end of special operation processing + // end of special operation processing $objmodel->write_record($array_selected,$rec,$outputlangs,$array_export_TypeFields); } if ($numrows > 0) { - print "Found ".$numrows." records for receipt ".$num."\n"; - - // Genere en-tete - $objmodel->write_footer($outputlangs); - - // Close file + print "Found ".$numrows." records for receipt ".$num."\n"; + + // Genere en-tete + $objmodel->write_footer($outputlangs); + + // Close file $objmodel->close_file(); print 'File '.$filename.' was generated into dir '.$dirname.'.'."\n"; diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 589b1eb5014..e3b4830f180 100644 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -49,8 +49,8 @@ require_once(PHPEXCEL_PATH."/PHPExcel.php"); //require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel2007.php"); require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel5.php"); -// Global variables -$version=DOL_VERSION; +// Global variables +$version=DOL_VERSION; $error=0; @@ -58,8 +58,8 @@ $error=0; * Main */ -@set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +@set_time_limit(0); +print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; $fname = DOL_DATA_ROOT.'/export-contacts.xls'; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index ee7512405a3..d60d5a86a5a 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -55,16 +55,16 @@ $langs->load('main'); $langs->load('contracts'); -// Global variables -$version=DOL_VERSION; -$error=0; - - +// Global variables +$version=DOL_VERSION; +$error=0; + + /* * Main */ -@set_time_limit(0); +@set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; $now=dol_now('tzserver'); @@ -72,7 +72,7 @@ $duration_value=isset($argv[2])?$argv[2]:'none'; print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n"; -if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; +if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; $sql = "SELECT DISTINCT s.nom as name, c.ref, cd.date_fin_validite, cd.total_ttc, p.label label, s.email, s.default_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."societe AS s"; @@ -110,10 +110,10 @@ if ($resql) { envoi_mail($mode,$oldemail,$message,$total,$oldlang,$oldcustomer,$duration_value); } - else - { - if ($oldemail != 'none') print "- No email sent for ".$oldcustomer.", total: ".$total."\n"; - } + else + { + if ($oldemail != 'none') print "- No email sent for ".$oldcustomer.", total: ".$total."\n"; + } $oldemail = $obj->email; $oldlang = $obj->lang; $oldcustomer=$obj->name; @@ -133,9 +133,9 @@ if ($resql) print "Service to expire ".$obj->ref.", label ".$obj->label.", due date ".dol_print_date($db->jdate($obj->date_fin_validite),'day')." (linked to company ".$obj->nom.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email."): "; if (dol_strlen($obj->email)) print "qualified."; else print "disqualified (no email)."; - print "\n"; + print "\n"; - $total += $obj->total_ttc; + $total += $obj->total_ttc; $i++; } @@ -147,9 +147,9 @@ if ($resql) { envoi_mail($mode,$oldemail,$message,$total,$oldlang,$oldcustomer,$duration_value); } - else - { - if ($oldemail != 'none') print "- No email sent for ".$oldcustomer.", total: ".$total."\n"; + else + { + if ($oldemail != 'none') print "- No email sent for ".$oldcustomer.", total: ".$total."\n"; } } } @@ -181,7 +181,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura { global $conf,$langs; - if (getenv('DOL_FORCE_EMAIL_TO')) $oldemail=getenv('DOL_FORCE_EMAIL_TO'); + if (getenv('DOL_FORCE_EMAIL_TO')) $oldemail=getenv('DOL_FORCE_EMAIL_TO'); $newlangs=new Translate('',$conf); $newlangs->setDefaultLang(empty($userlang)?(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT):$userlang); @@ -197,7 +197,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura $sendto = $oldemail; $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; - $msgishtml = 0; + $msgishtml = -1; print "- Send email for ".$oldcustomer."(".$oldemail."), total: ".$total."\n"; dol_syslog("email_expire_services_to_customers.php: send mail to ".$oldemail); diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 8b995f31773..e5701458152 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -55,16 +55,16 @@ $langs->load('main'); $langs->load('contracts'); -// Global variables -$version=DOL_VERSION; -$error=0; - - +// Global variables +$version=DOL_VERSION; +$error=0; + + /* * Main */ -@set_time_limit(0); +@set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; $now=dol_now('tzserver'); @@ -72,7 +72,7 @@ $duration_value=isset($argv[2])?$argv[2]:'none'; print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n"; -if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; +if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; $sql = "SELECT DISTINCT s.nom, c.ref, cd.date_fin_validite, cd.total_ttc, p.label label, c.fk_soc,u.rowid AS uid, u.lastname, u.firstname, u.email, u.lang"; $sql .= " FROM ".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."contrat AS c, ".MAIN_DB_PREFIX."contratdet AS cd"; @@ -147,10 +147,10 @@ if ($resql) { envoi_mail($mode,$oldemail,$message,$total,$oldlang,$oldsalerepresentative,$duration_value); } - else - { - if ($oldemail != 'none') print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; - } + else + { + if ($oldemail != 'none') print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; + } } } else @@ -197,7 +197,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta $sendto = $oldemail; $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; - $msgishtml = 0; + $msgishtml = -1; print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n"; dol_syslog("email_expire_services_to_representatives.php: send mail to ".$oldemail); @@ -244,11 +244,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta if ($mode == 'confirm') { $result=$mail->sendfile(); - if (! $result) - { - print "Error sending email ".$mail->error."\n"; - dol_syslog("Error sending email ".$mail->error."\n"); - } + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 398a2d7f422..63836a979f4 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -59,16 +59,16 @@ require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"); require_once (DOL_DOCUMENT_ROOT.'/user/class/user.class.php'); require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"); -// Global variables -$version=DOL_VERSION; -$error=0; - - -/* - * Main - */ +// Global variables +$version=DOL_VERSION; +$error=0; -@set_time_limit(0); + +/* + * Main + */ + +@set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; // Check security key diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 786704299bf..33b1160ef7e 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -109,8 +109,8 @@ if ($resql) if ($resql2) { $num2 = $db->num_rows($resql2); - dol_syslog("Nb of targets = ".$num2, LOG_DEBUG); - print "Nb of targets = ".$num2."\n"; + dol_syslog("Nb of targets = ".$num2, LOG_DEBUG); + print "Nb of targets = ".$num2."\n"; if ($num2) { @@ -122,7 +122,7 @@ if ($resql) if (! $resqlstartdate) { dol_print_error($db); - $error++; + $error++; } // Look on each email and sent message @@ -210,7 +210,7 @@ if ($resql) if (! $resqlok) { dol_print_error($db); - $error++; + $error++; } else { @@ -224,7 +224,7 @@ if ($resql) if (! $resqlx) { dol_print_error($db); - $error++; + $error++; } //Update status communication of contact prospect @@ -260,11 +260,11 @@ if ($resql) $i++; } } - else - { - $mesg="Emailing id ".$id." has no recipient to target"; - print $mesg."\n"; - dol_syslog($mesg,LOG_ERR); + else + { + $mesg="Emailing id ".$id." has no recipient to target"; + print $mesg."\n"; + dol_syslog($mesg,LOG_ERR); } // Loop finished, set global statut of mail @@ -291,9 +291,9 @@ if ($resql) } else { - $mesg="No validated emailing id to send found."; - print $mesg."\n"; - dol_syslog($mesg,LOG_ERR); + $mesg="No validated emailing id to send found."; + print $mesg."\n"; + dol_syslog($mesg,LOG_ERR); $error++; } } diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index d518d41ab39..9260d85cd91 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -54,18 +54,18 @@ require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); $langs->load('main'); -// Global variables -$version=DOL_VERSION; -$error=0; - - - -/* - * Main - */ - -@set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +// Global variables +$version=DOL_VERSION; +$error=0; + + + +/* + * Main + */ + +@set_time_limit(0); +print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; $now=dol_now('tzserver'); $duration_value=isset($argv[3])?$argv[3]:'none'; @@ -73,7 +73,7 @@ $duration_value=isset($argv[3])?$argv[3]:'none'; $error = 0; print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n"; -if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; +if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; $sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date,"; $sql.= " s.rowid as sid, s.nom as name, s.email, s.default_lang"; @@ -113,8 +113,8 @@ if ($resql) // Check if this record is a break after previous one $startbreak=false; if ($newemail <> $oldemail || $oldemail == 'none') $startbreak=true; - if ($obj->sid && $obj->sid <> $oldsid) $startbreak=true; - if ($obj->cid && $obj->cid <> $oldcid) $startbreak=true; + if ($obj->sid && $obj->sid <> $oldsid) $startbreak=true; + if ($obj->cid && $obj->cid <> $oldcid) $startbreak=true; if ($startbreak) { @@ -124,14 +124,14 @@ if ($resql) envoi_mail($mode,$oldemail,$message,$total,$oldlang,$oldtarget); $trackthirdpartiessent[$oldsid.'|'.$oldemail]='contact id '.$oldcid; } - else + else { if ($oldemail != 'none') { if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) print "- No email sent for '".$oldtarget."', total: ".$total."\n"; else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n"; - } - } + } + } $oldemail = $newemail; $oldsid = $obj->sid; $oldcid = $obj->cid; @@ -150,12 +150,12 @@ if ($resql) dol_syslog("email_unpaid_invoices_to_customers.php: ".$newemail." ".$message); $foundtoprocess++; } - print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." customer id ".$obj->sid." ".$obj->name.", ".($obj->cid?"contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.",":"")." email ".$newemail.": "; - if (dol_strlen($newemail)) print "qualified."; - else print "disqualified (no email)."; - print "\n"; + print "Unpaid invoice ".$obj->facnumber.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date),'day')." customer id ".$obj->sid." ".$obj->name.", ".($obj->cid?"contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.",":"")." email ".$newemail.": "; + if (dol_strlen($newemail)) print "qualified."; + else print "disqualified (no email)."; + print "\n"; - $total += $obj->total_ttc; + $total += $obj->total_ttc; $i++; } @@ -168,13 +168,13 @@ if ($resql) envoi_mail($mode,$oldemail,$message,$total,$oldlang,$oldtarget); $trackthirdpartiessent[$oldsid.'|'.$oldemail]='contact id '.$oldcid; } - else - { + else + { if ($oldemail != 'none') { if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) print "- No email sent for '".$oldtarget."', total: ".$total."\n"; - else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n"; - } + else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n"; + } } } } @@ -205,7 +205,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) { global $conf,$langs; - if (getenv('DOL_FORCE_EMAIL_TO')) $oldemail=getenv('DOL_FORCE_EMAIL_TO'); + if (getenv('DOL_FORCE_EMAIL_TO')) $oldemail=getenv('DOL_FORCE_EMAIL_TO'); $newlangs=new Translate('',$conf); $newlangs->setDefaultLang(empty($userlang)?(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT):$userlang); @@ -216,19 +216,19 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) $sendto = $oldemail; $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; - $msgishtml = 0; + $msgishtml = -1; print "- Send email for '".$oldtarget."' (".$oldemail."), total: ".$total."\n"; dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail); $usehtml=0; - if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_FOOTER)) $usehtml+=1; - if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) $usehtml+=1; - + if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER)) $usehtml+=1; + if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER)) $usehtml+=1; + $allmessage=''; - if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) + if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER)) { - $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER; + $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER; } else { @@ -264,11 +264,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) if ($mode == 'confirm') { $result=$mail->sendfile(); - if (! $result) - { - print "Error sending email ".$mail->error."\n"; - dol_syslog("Error sending email ".$mail->error."\n"); - } + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 1ab5e15c2ec..2c23512cedb 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -72,7 +72,7 @@ $duration_value=isset($argv[2])?$argv[2]:'none'; print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n"; -if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; +if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1; $sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; @@ -192,19 +192,19 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta $sendto = $oldemail; $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; - $msgishtml = 0; + $msgishtml = -1; print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n"; dol_syslog("email_unpaid_invoices_to_representatives.php: send mail to ".$oldemail); $usehtml=0; - if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_FOOTER)) $usehtml+=1; - if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) $usehtml+=1; + if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) $usehtml+=1; + if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) $usehtml+=1; $allmessage=''; - if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) + if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) { - $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER; + $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER; } else { @@ -239,11 +239,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta if ($mode == 'confirm') { $result=$mail->sendfile(); - if (! $result) - { - print "Error sending email ".$mail->error."\n"; - dol_syslog("Error sending email ".$mail->error."\n"); - } + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 42504bd372e..a53e8940361 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -122,10 +122,10 @@ foreach ($argv as $key => $value) $paymentdateafter=dol_stringtotime($argv[$key+1]); $paymentdatebefore=dol_stringtotime($argv[$key+2]); - if (empty($paymentdateafter) || empty($paymentdatebefore)) - { - print 'Error: Bad date format'."\n"; - exit; + if (empty($paymentdateafter) || empty($paymentdatebefore)) + { + print 'Error: Bad date format'."\n"; + exit; } print 'Rebuild PDF for invoices with at least one payment between '.dol_print_date($paymentdateafter,'day')." and ".dol_print_date($paymentdatebefore,'day').".\n"; } @@ -196,16 +196,16 @@ if (empty($option) && count($filter) <= 0) exit; } // Check if there is no uncompatible choice -if (in_array('payments',$filter) && in_array('nopayment',$filter)) -{ - usage(); - exit; -} -if (in_array('bank',$filter) && in_array('nopayment',$filter)) -{ - usage(); - exit; -} +if (in_array('payments',$filter) && in_array('nopayment',$filter)) +{ + usage(); + exit; +} +if (in_array('bank',$filter) && in_array('nopayment',$filter)) +{ + usage(); + exit; +} // Define SQL and SQL request to select invoices diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 85687eca95e..1b4fc64457c 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -41,13 +41,13 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php"); $langs->load("main"); -$langs->load("errors"); +$langs->load("errors"); // Global variables $version=DOL_VERSION; $error=0; -$forcecommit=0; +$forcecommit=0; @@ -125,16 +125,16 @@ print "Mapped LDAP fields=".join(',',$required_fields)."\n"; print "\n"; // Check parameters -if (empty($conf->global->LDAP_MEMBER_DN)) -{ - print $langs->trans("Error").': '.$langs->trans("LDAP setup for members not defined inside Dolibarr")."\n"; - exit(1); -} -if ($typeid <= 0) -{ - print $langs->trans("Error").': Parameter id_member_type is not a valid ref of an existing member type'."\n"; - exit(2); -} +if (empty($conf->global->LDAP_MEMBER_DN)) +{ + print $langs->trans("Error").': '.$langs->trans("LDAP setup for members not defined inside Dolibarr")."\n"; + exit(1); +} +if ($typeid <= 0) +{ + print $langs->trans("Error").': Parameter id_member_type is not a valid ref of an existing member type'."\n"; + exit(2); +} print "Press a key to confirm..."; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index ff9907e43ee..0a010791793 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -35,28 +35,28 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit; } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"); - -$langs->load("main"); -$langs->load("errors"); +require_once($path."../../htdocs/master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); +require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); +require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php"); + +$langs->load("main"); +$langs->load("errors"); -// Global variables -$version=DOL_VERSION; -$error=0; -$forcecommit=0; - - -/* - * Main - */ - -@set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +// Global variables +$version=DOL_VERSION; +$error=0; +$forcecommit=0; + + +/* + * Main + */ + +@set_time_limit(0); +print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; // List of fields to get from LDAP diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 13fb7464cd4..89bc4613487 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -34,14 +34,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit; } -require_once($path."../../htdocs/master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); -require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); - -$langs->load("main"); -$langs->load("errors"); - +require_once($path."../../htdocs/master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"); +require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); + +$langs->load("main"); +$langs->load("errors"); + // Global variables $version=DOL_VERSION; diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index f7a932250b2..fe7c51289cb 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -29,6 +29,7 @@ global $conf,$user,$langs,$db; require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php'; +require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent_type.class.php'; if (empty($user->id)) { @@ -115,11 +116,39 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** - * testAdherentCreate + * testAdherentTypeCreate * * @return void */ - public function testAdherentCreate() + public function testAdherentTypeCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new AdherentType($this->savdb); + $localobject->statut=1; + $localobject->libelle='Adherent type test'; + $localobject->cotisation=1; + $localobject->vote=1; + $result=$localobject->create($user); + print __METHOD__." result=".$result."\n"; + $this->assertLessThan($result, 0); + + return $localobject->id; + } + + /** + * testAdherentCreate + * + * @return void + * + * @depends testAdherentTypeCreate + * The depends says test is run only if previous is ok + */ + public function testAdherentCreate($fk_adherent_type) { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -129,6 +158,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $localobject=new Adherent($this->savdb); $localobject->initAsSpecimen(); + $localobject->typeid=$fk_adherent_type; $result=$localobject->create($user); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 501781b309d..de99d38eb59 100755 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -184,17 +184,24 @@ class CategorieTest extends PHPUnit_Framework_TestCase print __METHOD__." catid=".$catid."\n"; $this->assertGreaterThan(0, $catid); - // Category + // Try to create product linked to category $localobject2=new Product($this->savdb); $localobject2->initAsSpecimen(); $localobject2->ref.='-CATEG'; $localobject2->tva_npr=1; - $localobject2->catid=$catid; $result=$localobject2->create($user); + $cat = new Categorie($this->savdb); + $cat->id = $catid; + $result=$cat->add_type($localobject2,"product"); - print __METHOD__." result=".$result."\n"; + print __METHOD__." result=".$result."\n"; $this->assertGreaterThan(0, $result); + // Get list of categories for product + $localcateg=new Categorie($this->savdb); + $listofcateg=$localcateg->containing($localobject2->id, 'product', 'label'); + $this->assertTrue(in_array('Specimen Category for product',$listofcateg), 'Categ not found linked to product when it should'); + return $id; } diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 10435972924..ffc1776d559 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -131,12 +131,12 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase // Set supplier and product to use $socid=1; - $prodid=1; $societe=new Societe($db); $societe->fetch($socid); $product=new ProductFournisseur($db); - $product->fetch($prodid); - + $product->fetch(0,'PIDRESS'); + if ($product->id <= 0) { print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(); } + $quantity=10; $ref_fourn='SUPPLIER_REF_PHPUNIT'; $tva_tx=19.6; diff --git a/test/phpunit/FunctionsTest.php b/test/phpunit/FunctionsTest.php index 34276ce5892..1fa41f0c460 100755 --- a/test/phpunit/FunctionsTest.php +++ b/test/phpunit/FunctionsTest.php @@ -613,7 +613,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase $vat1=get_default_localtax($companyes,$companyes,1,0); $vat2=get_default_localtax($companyes,$companyes,2,0); $this->assertEquals(5.2,$vat1); - $this->assertEquals(-15,$vat2); + $this->assertEquals(-21,$vat2); // Test RULE ES-IT $vat1=get_default_localtax($companyes,$companyit,1,0); diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 82bb96dc0be..a4f4ad53b0e 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -160,10 +160,10 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject2->validate($user, $result); // create invoice by forcing ref print __METHOD__." result=".$result."\n"; $this->assertEquals('1916-0002', $result); // counter must not be reseted so be 2 - $result=$localobject2->is_erasable(); + $result=$localobject2->is_erasable(); print __METHOD__." is_erasable=".$result."\n"; - $this->assertEquals(1, $result); // Can be deleted - $result=$localobject->is_erasable(); + $this->assertEquals(1, $result); // Can be deleted + $result=$localobject->is_erasable(); print __METHOD__." is_erasable=".$result."\n"; $this->assertEquals(0, $result); // Case 1 can not be deleted (case 2 is more recent) @@ -191,9 +191,9 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject->validate($user, $result); print __METHOD__." result=".$result."\n"; $this->assertEquals('192001-0001', $result); // counter must start to 1 - $result=$localobject->is_erasable(); + $result=$localobject->is_erasable(); print __METHOD__." is_erasable=".$result."\n"; - $this->assertEquals(1, $result); // Can be deleted + $this->assertEquals(1, $result); // Can be deleted $localobject2=new Facture($this->savdb); $localobject2->initAsSpecimen(); @@ -204,12 +204,12 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject2->validate($user, $result); print __METHOD__." result=".$result."\n"; $this->assertEquals('192101-0001', $result); // counter must be reseted to 1 - $result=$localobject2->is_erasable(); + $result=$localobject2->is_erasable(); print __METHOD__." is_erasable=".$result."\n"; - $this->assertEquals(1, $result); // Can be deleted - $result=$localobject->is_erasable(); + $this->assertEquals(1, $result); // Can be deleted + $result=$localobject->is_erasable(); print __METHOD__." is_erasable=".$result."\n"; - $this->assertEquals(1, $result); // Case 1 can be deleted (because there was a reset for case 2) + $this->assertEquals(1, $result); // Case 1 can be deleted (because there was a reset for case 2) // Now we try with a different fiscal month (forced by mask) @@ -228,9 +228,9 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject->validate($user, $result); print __METHOD__." result=".$result."\n"; $this->assertEquals('193001-0001', $result); // counter must start to 1 - $result=$numbering->getNextValue($mysoc, $localobject, 'last'); - print __METHOD__." result for last=".$result."\n"; - $this->assertEquals('193001-0001', $result); // last ref into reset range should be same than last created + $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + print __METHOD__." result for last=".$result."\n"; + $this->assertEquals('193001-0001', $result); // last ref into reset range should be same than last created $localobject=new Facture($this->savdb); $localobject->initAsSpecimen(); diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index c119f1a4ec6..6823b60e314 100755 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -129,11 +129,16 @@ class PdfDocTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; + $localproduct=new Product($this->savdb); + $localproduct->fetch(0,'PIDRESS'); + $product_id=$localproduct->id; + if ($product_id <= 0) { print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(); } + $localobject=new Facture($this->savdb); $localobject->initAsSpecimen(); $localobject->lines=array(); $localobject->lines[0]=new FactureLigne($this->savdb); - $localobject->lines[0]->fk_product=1; + $localobject->lines[0]->fk_product=$product_id; $localobject->lines[0]->label='Label 1'; $localobject->lines[0]->desc="This is a description with a é accent\n(Country of origin: France)"; diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 088115a64ec..18cbe78c468 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -269,53 +269,53 @@ class UserTest extends PHPUnit_Framework_TestCase } - /** - * Edit an object to test updates - * - * @param mixed &$localobject Object Facture - * @return void - */ - public function changeProperties(&$localobject) - { - $localobject->note='New note after update'; - } - - /** - * Compare all public properties values of 2 objects - * - * @param Object $oA Object operand 1 - * @param Object $oB Object operand 2 - * @param boolean $ignoretype False will not report diff if type of value differs - * @param array $fieldstoignorearray Array of fields to ignore in diff - * @return array Array with differences - */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) - { - $retAr=array(); - - if (get_class($oA) !== get_class($oB)) - { - $retAr[]="Supplied objects are not of same class."; - } - else - { - $oVarsA=get_object_vars($oA); - $oVarsB=get_object_vars($oB); - $aKeys=array_keys($oVarsA); - foreach($aKeys as $sKey) - { - if (in_array($sKey,$fieldstoignorearray)) continue; - if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey]) - { - $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); - } - if ($ignoretype && $oVarsA[$sKey] != $oVarsB[$sKey]) - { - $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); - } - } - } - return $retAr; + /** + * Edit an object to test updates + * + * @param mixed &$localobject Object Facture + * @return void + */ + public function changeProperties(&$localobject) + { + $localobject->note='New note after update'; + } + + /** + * Compare all public properties values of 2 objects + * + * @param Object $oA Object operand 1 + * @param Object $oB Object operand 2 + * @param boolean $ignoretype False will not report diff if type of value differs + * @param array $fieldstoignorearray Array of fields to ignore in diff + * @return array Array with differences + */ + public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + { + $retAr=array(); + + if (get_class($oA) !== get_class($oB)) + { + $retAr[]="Supplied objects are not of same class."; + } + else + { + $oVarsA=get_object_vars($oA); + $oVarsB=get_object_vars($oB); + $aKeys=array_keys($oVarsA); + foreach($aKeys as $sKey) + { + if (in_array($sKey,$fieldstoignorearray)) continue; + if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey]) + { + $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); + } + if ($ignoretype && $oVarsA[$sKey] != $oVarsB[$sKey]) + { + $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); + } + } + } + return $retAr; } } ?> \ No newline at end of file