From f6057bd7943e46722513795f63f33448b4ab836a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Thu, 30 May 2013 16:48:04 +0200 Subject: [PATCH 01/43] Reverting PR #1002 Incorrect translation that shouldn't have been accepted --- htdocs/langs/es_MX/banks.lang | 2 -- htdocs/langs/es_MX/bills.lang | 2 -- 2 files changed, 4 deletions(-) diff --git a/htdocs/langs/es_MX/banks.lang b/htdocs/langs/es_MX/banks.lang index 4e7fd2d1080..58ef3a65d00 100644 --- a/htdocs/langs/es_MX/banks.lang +++ b/htdocs/langs/es_MX/banks.lang @@ -1,5 +1,3 @@ # Dolibarr language file - es_MX - banks CHARSET=UTF-8 -IBAN=CLAVE Interbancaria -BIC=Sucursal BankAccountDomiciliation=Tarjeta \ No newline at end of file diff --git a/htdocs/langs/es_MX/bills.lang b/htdocs/langs/es_MX/bills.lang index 26c1a6583d1..e5ae5cc1336 100644 --- a/htdocs/langs/es_MX/bills.lang +++ b/htdocs/langs/es_MX/bills.lang @@ -23,6 +23,4 @@ TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las f AddCreditNote=Crear nota de crédito BillTo=Receptor Residence=Tarjeta -IBANNumber=CLAVE Interbancaria -BICNumber=Sucursal PaymentByTransferOnThisBankAccount=Cuenta para depositos y transferencias \ No newline at end of file From 8ae0939ae57e18e29cdcec59106bbeb3d6a78dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 1 Jun 2013 15:39:45 +0200 Subject: [PATCH 02/43] Fixed bug #903: Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php --- ChangeLog | 3 +++ htdocs/commande/liste.php | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9f8e4697296..ddafb08d110 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** 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 ***** @@ -34,6 +36,7 @@ English Dolibarr ChangeLog - 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 ***** - 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/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/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 '
'; // Other support 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/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); From 37ef86379f5c30dc302f9122b6776545a48fc175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 5 Jun 2013 18:19:50 +0200 Subject: [PATCH 36/43] fixed bug when editing a supplier order line --- .../fourn/class/fournisseur.commande.class.php | 6 ++++-- htdocs/fourn/commande/fiche.php | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dbd23b2f465..3374393310e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1802,7 +1802,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ",total_localtax1='".price2num($total_localtax1)."'"; $sql.= ",total_localtax2='".price2num($total_localtax2)."'"; $sql.= ",total_ttc='".price2num($total_ttc)."'"; - $sql.= ",product_type='".$type."'"; + $sql.= ",product_type=".$type; $sql.= " WHERE rowid = ".$rowid; dol_syslog(get_class($this)."::updateline sql=".$sql); @@ -2063,7 +2063,7 @@ class CommandeFournisseurLigne $sql.= ' cd.localtax1_tx, cd.localtax2_tx,'; $sql.= ' cd.remise, cd.remise_percent, cd.subprice,'; $sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,'; - $sql.= ' cd.total_localtax1, cd.local_localtax2,'; + $sql.= ' cd.total_localtax1, cd.total_localtax2,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; @@ -2096,10 +2096,12 @@ class CommandeFournisseurLigne $this->product_desc = $objp->product_desc; $this->db->free($result); + return 1; } else { dol_print_error($this->db); + return -1; } } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index cbe5388164e..1bb3fa405af 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -336,10 +336,11 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) */ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer && $_POST['save'] == $langs->trans('Save')) { - $product=new Product($db); if ($_POST["elrowid"]) { - if ($product->fetch($_POST["elrowid"]) < 0) dol_print_error($db); + $line = new CommandeFournisseurLigne($db); + $res = $line->fetch($_POST["elrowid"]); + if (!$res) dol_print_error($db); } $localtax1_tx=get_localtax($_POST['tva_tx'],1,$mysoc,$object->thirdparty); @@ -356,9 +357,18 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer $localtax2_tx, 'HT', 0, - isset($_POST["type"])?$_POST["type"]:$product->type + isset($_POST["type"])?$_POST["type"]:$line->product_type ); - + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprodfournprice']); + unset($_POST['remmise_percent']); + unset($_POST['dp_desc']); + unset($_POST['np_desc']); + unset($_POST['pu']); + unset($_POST['tva_tx']); + unset($localtax1_tx); + unset($localtax2_tx); if ($result >= 0) { $outputlangs = $langs; From 61d5359f237a9be1826d4941fb428ae60b1e9650 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jun 2013 21:55:51 +0200 Subject: [PATCH 37/43] Fix: Uniformize menu entries --- htdocs/core/menus/init_menu_auguria.sql | 10 +++++----- htdocs/core/menus/standard/eldy.lib.php | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index aec2b78f9ad..8f49ca9eb7e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -108,7 +108,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Commercial - Proposals insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?leftmenu=propals', 'Prop', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal.php?action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&viewstatut=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&viewstatut=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); @@ -118,7 +118,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/fiche.php?action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&viewstatut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&viewstatut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__); @@ -129,12 +129,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); -- Commercial - Supplier's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/fiche.php?action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=orders_suppliers&viewstatut=0', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__); -- Commercial - Contracts insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/societe/societe.php?leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/fiche.php?&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/liste.php?leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled&&$leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts&mode=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__); @@ -153,7 +153,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Accountancy - Customer invoice insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/clients.php?action=facturer&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'Repeatable', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1703__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/impayees.php?action=facturer&leftmenu=customers_bills', 'Unpaid', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/liste.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 857b23c5466..9d497589705 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -658,7 +658,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("orders"); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); - $newmenu->add("/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); + $newmenu->add("/commande/fiche.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); @@ -674,7 +674,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("orders"); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers'); - $newmenu->add("/fourn/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); + $newmenu->add("/fourn/commande/fiche.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } @@ -1172,15 +1172,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND clos = 0"; $sql.= " ORDER BY label"; - + $resql = $db->query($sql); if ($resql) { $numr = $db->num_rows($resql); $i = 0; - + if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire); - + while ($i < $numr) { $objp = $db->fetch_object($resql); @@ -1206,16 +1206,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->global->$paramkey)) { $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - + $newmenu->add($link, dol_trunc($conf->global->$paramkey,24)); } $i++; } - } - + } + } - - + + // Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after //var_dump($menu_array_before);exit; //var_dump($menu_array_after);exit; From 7e53f98baa4d9cfcf949f8d33259c83de54520ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jun 2013 22:01:35 +0200 Subject: [PATCH 38/43] Qual: Uniformize code --- htdocs/core/class/html.form.class.php | 232 +++++++++++++++++--------- htdocs/societe/ajax/company.php | 107 ++++++++++++ 2 files changed, 264 insertions(+), 75 deletions(-) create mode 100644 htdocs/societe/ajax/company.php diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d68d9c8d59f..d753803dc54 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -655,6 +655,72 @@ class Form if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); } + + /** + * Return list of company for customer in Ajax if Ajax activated or go to select_thirparty_list + * + * @param int $selected Preselected products + * @param string $htmlname Name of HTML seletc field (must be unique in page) + * @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int $limit Limit on number of returned lines + * @param array $ajaxoptions Options for ajax_autocompleter + * @return void + */ + function select_thirdparty($selected='', $htmlname='productid', $filtertype='', $limit=20, $ajaxoptions=array()) + { + global $langs,$conf; + + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + { + $placeholder=''; + + if ($selected && empty($selected_input_value)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $societe = new Societe($this->db); + $societe->fetch($selected); + $selected_input_value=$societe->ref; + } + // mode=1 means customers products + $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished; + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; + else if ($hidelabel > 1) { + if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"'; + else $placeholder=' title="'.$langs->trans("RefOrLabel").'"'; + if ($hidelabel == 2) { + print img_picto($langs->trans("Search"), 'search'); + } + } + print ''; + if ($hidelabel == 3) { + print img_picto($langs->trans("Search"), 'search'); + } + } + else + { + print $this->select_thirdparty_list($selected,$htmlname,$filtertype,1,0,1,array(),'',0,$limit); + } + } + + /** + * Output html form to select a third party + * + * @param string $selected Preselected type + * @param string $htmlname Name of field in form + * @param string $filter Optionnal filters criteras (example: 's.rowid <> x') + * @param int $showempty Add an empty field + * @param int $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int $forcecombo Force to use combo box + * @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @return string HTML string with + * @deprecated Use select_thirdparty instead + */ + function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()) + { + return $this->select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()); + } + /** * Output html form to select a third party * @@ -665,13 +731,17 @@ class Form * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box * @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param string $filterkey Filter on key value + * @param int $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit number of answers * @return string HTML string with */ - function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()) + function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20) { global $conf,$user,$langs; $out=''; + $outarray=array(); // On recherche les societes $sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; @@ -682,9 +752,33 @@ class Form if ($filter) $sql.= " AND (".$filter.")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 "; + // Add criteria + if ($filterkey && $filterkey != '') + { + $sql.=" AND ("; + if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index + { + $sql.="(s.name LIKE '".$filterkey."%'"; + $sql.=")"; + } + else + { + // For natural search + $scrit = explode(' ', $filterkey); + foreach ($scrit as $crit) { + $sql.=" AND (s.name LIKE '%".$crit."%'"; + $sql.=")"; + } + } + if (! empty($conf->barcode->enabled)) + { + $sql .= " OR s.barcode LIKE '".$filterkey."'"; + } + $sql.=")"; + } $sql.= " ORDER BY nom ASC"; - dol_syslog(get_class($this)."::select_company sql=".$sql); + dol_syslog(get_class($this)."::select_thirdparty_list sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -692,32 +786,9 @@ class Form { //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); - /* -<<<<<<< HEAD - if ($selected && empty($selected_input_value)) - { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $product = new Product($this->db); - $product->fetch($selected); - $selected_input_value=$product->ref; - } -======= - if ($selected && empty($selected_input_value)) - { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $product = new Product($this->db); - $product->fetch($selected); - $selected_input_value=$product->ref; - } ->>>>>>> refs/remotes/origin/3.3 - // mode=1 means customers products - $ajaxoptions=array(); - $urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype; - $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); - $out.=''; - */ } + // Construct $out and $outarray $out.= ''; - $outselect.=''; + $out.=''; + $out.=''; $this->db->free($result); - if (empty($disableout)) print $outselect; - return $outjson; + if (empty($outputmode)) return $out; + return $outarray; } else - { + { dol_print_error($db); } } /** * _construct_product_list_option - * + * * @param resultset &$objp Resultset of fetch * @param string $opt Option * @param string $optJson Option * @param int $price_level Price level * @param string $selected Preselected value - * @return + * @return */ - private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) + private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) { global $langs,$conf,$user,$db; @@ -1399,7 +1479,7 @@ class Form $sql.= " ORDER BY date_price"; $sql.= " DESC LIMIT 1"; - dol_syslog(get_class($this)."::select_produits_do search price for level '.$price_level.' sql=".$sql); + dol_syslog(get_class($this)."::_construct_product_list_option search price for level '.$price_level.' sql=".$sql); $result2 = $this->db->query($sql); if ($result2) { @@ -1430,7 +1510,8 @@ class Form } // Price by quantity - if (!empty($objp->quantity) && $objp->quantity >= 1) { + if (!empty($objp->quantity) && $objp->quantity >= 1) + { $found = 1; $outqty=$objp->quantity; $outdiscount=$objp->remise_percent; @@ -1511,7 +1592,7 @@ class Form } /** - * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_do) + * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) * * @param int $socid Id third party * @param string $selected Preselected product @@ -1536,7 +1617,7 @@ class Form } else { - $this->select_produits_fournisseurs_do($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0); + print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0); } } @@ -1550,13 +1631,16 @@ class Form * @param string $filtre Pour filtre sql * @param string $filterkey Filtre des produits * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell - * @param int $disableout Disable print output + * @param int $outputmode 0=HTML select string, 1=Array * @return array Array of keys for json */ - function select_produits_fournisseurs_do($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$disableout=0) + function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0) { global $langs,$conf; + $out=''; + $outarray=array(); + $langs->load('stocks'); $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; @@ -1590,20 +1674,18 @@ class Form $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; // Build output string - $outselect=''; - $outjson=array(); - dol_syslog(get_class($this)."::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::select_produits_fournisseurs_list sql=".$sql,LOG_DEBUG); $result=$this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); - //$outselect.=''; - if (! $selected) $outselect.=''; - else $outselect.=''; + //$out.=''; + if (! $selected) $out.=''; + else $out.=''; $i = 0; while ($i < $num) @@ -1694,9 +1776,9 @@ class Form // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box - $outselect.=$opt; - array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); - // Exemple of var_dump $outjson + $out.=$opt; + array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); + // Exemple of var_dump $outarray // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" // ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false) @@ -1707,12 +1789,12 @@ class Form $i++; } - $outselect.=''; + $out.=''; $this->db->free($result); - if (empty($disableout)) print $outselect; - return $outjson; + if (empty($outputmode)) return $out; + return $outarray; } else { @@ -3524,7 +3606,7 @@ class Form function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select') { global $langs; - + if ($iSecond) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -3532,8 +3614,8 @@ class Form $hourSelected = convertSecondToTime($iSecond,'hour'); $minSelected = convertSecondToTime($iSecond,'min'); } - - if ($typehour=='select') + + if ($typehour=='select') { print '"; } - elseif ($typehour=='text') + elseif ($typehour=='text') { $fullhours=convertSecondToTime($iSecond,'fullhour'); print ''; 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 From 56f9d8f50c9b1a202e490d30bb0a428c458a20c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jun 2013 22:10:43 +0200 Subject: [PATCH 39/43] Fix: missing style --- htdocs/theme/bureau2crea/style.css.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 73873699280..7f506006b74 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -227,7 +227,9 @@ div.inline-block .nowrap { white-space: ; } - +.dolibarrcombobox { + height: 22px; +} /* ============================================================================== */ /* Styles to hide objects */ From b7f697e8c49eebeb1d883970de31ae575037a8cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jun 2013 22:27:02 +0200 Subject: [PATCH 40/43] Remove a call of a deprecated function --- htdocs/cashdesk/admin/cashdesk.php | 3 ++- htdocs/core/class/html.form.class.php | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 91700e328df..217b184f1d9 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -103,7 +103,8 @@ print "\n"; $var=!$var; print ''.$langs->trans("CashDeskThirdPartyForSell").''; print ''; -print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); +//print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); +print $form->select_thirdparty($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',0,array(),1); print ''; if (! empty($conf->banque->enabled)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d753803dc54..87bc7dff59f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -661,16 +661,18 @@ class Form * * @param int $selected Preselected products * @param string $htmlname Name of HTML seletc field (must be unique in page) - * @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int $filter Filter on thirdparty * @param int $limit Limit on number of returned lines * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $forcecombo Force to use combo box * @return void */ - function select_thirdparty($selected='', $htmlname='productid', $filtertype='', $limit=20, $ajaxoptions=array()) + function select_thirdparty($selected='', $htmlname='productid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0) { global $langs,$conf; - - if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) + + /* TODO Use ajax autocompletion (not finished) + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { $placeholder=''; @@ -698,9 +700,9 @@ class Form } } else - { - print $this->select_thirdparty_list($selected,$htmlname,$filtertype,1,0,1,array(),'',0,$limit); - } + {*/ + print $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit); + //} } /** From 81d6d5d51f6b0acac9c277e2fe3bad3b96f5a419 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jun 2013 22:28:55 +0200 Subject: [PATCH 41/43] Doc --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1a1e738da68..6152f1407b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,9 @@ For users: - 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. From db6d226ffd1973897f5f5befc734a9c1a8e24c13 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 6 Jun 2013 09:22:26 +0200 Subject: [PATCH 42/43] code was displayed twice --- htdocs/fichinter/fiche.php | 51 -------------------------------------- 1 file changed, 51 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 2f8cdc6ed22..96565d9ebd2 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1065,7 +1065,6 @@ if ($action == 'create') print $object->showOptionals($extrafields,'edit'); } - // Show link to origin object if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { @@ -1082,56 +1081,6 @@ if ($action == 'create') print ''; } - // Model - print ''; - print ''.$langs->trans("DefaultModel").''; - print ''; - $liste=ModelePDFFicheinter::liste_modeles($db); - print $form->selectarray('model',$liste,$conf->global->FICHEINTER_ADDON_PDF); - print ""; - - // Public note - print ''; - print ''.$langs->trans('NotePublic').''; - print ''; - $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); - print $doleditor->Create(1); - //print ''; - print ''; - - // Private note - if (!empty($user->societe_id)) - { - print ''; - print ''.$langs->trans('NotePrivate').''; - print ''; - $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); - print $doleditor->Create(1); - //print ''; - print ''; - } - - // Other attributes - $parameters=array('colspan' => ' colspan="2"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - - - // Show link to origin object - if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) - { - $newclassname=$classname; - if ($newclassname=='Propal') $newclassname='CommercialProposal'; - print ''.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).''; - } - - print ''; - - if (is_object($objectsrc)) - { - print ''; - print ''; - } - print '

'; print ''; print '
'; From bf8fd7d34f4eea343c2a4023e895cc7aaf42fa4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Jun 2013 09:42:39 +0200 Subject: [PATCH 43/43] Fix: CSS --- htdocs/theme/bureau2crea/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 7f506006b74..ab50ee574b8 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -789,7 +789,7 @@ div.blockvmenusearch div.menu_titre { { padding-top: 1px; padding-bottom: 1px; - height: 16px; + min-height: 14px; } div.blockvmenubookmarks