diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 07a30f516611d..bdef789401f50 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1987,7 +1987,7 @@ } // Source / Channel - What trigger creation - print ''.$langs->trans('Channel').''; + print ''.$langs->trans('Source').''; print img_picto('', 'question', 'class="pictofixedwidth"'); $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4fa281dada043..8239bdc3edb3a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -193,7 +193,7 @@ 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled("shipping")), 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67), 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68), - 'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69), + 'c.fk_input_reason' => array('label' => "Origin", 'checked' => -1, 'position' => 69), 'c.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 75), 'c.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 80), 'c.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 85), diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 7fb5e8f1930a6..e263c282dc372 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1122,6 +1122,7 @@ public function sendfile() $storage = new DoliStorage($db, $conf, $keyforprovider); try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + $expire = false; // Is token expired or will token expire in the next 30 seconds if (is_object($tokenobj)) { @@ -1140,17 +1141,17 @@ public function sendfile() $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); // We have to save the token because Google give it only once $refreshtoken = $tokenobj->getRefreshToken(); - if ($apiService instanceof OAuth\OAuth2\Service\AbstractService - || $apiService instanceof OAuth\OAuth1\Service\AbstractService - ) { + + if ($apiService instanceof OAuth\OAuth2\Service\AbstractService || $apiService instanceof OAuth\OAuth1\Service\AbstractService) { // ServiceInterface does not provide refreshAccessToekn, AbstractService does $tokenobj = $apiService->refreshAccessToken($tokenobj); $tokenobj->setRefreshToken($refreshtoken); $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); } + + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); } - $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); if (is_object($tokenobj)) { $this->smtps->setToken($tokenobj->getAccessToken()); } else { @@ -1284,6 +1285,7 @@ public function sendfile() try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + $expire = false; // Is token expired or will token expire in the next 30 seconds if (is_object($tokenobj)) { @@ -1301,16 +1303,18 @@ public function sendfile() // ex service is Google-Emails we need only the first part Google $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); $refreshtoken = $tokenobj->getRefreshToken(); - if ($apiService instanceof OAuth\OAuth2\Service\AbstractService - || $apiService instanceof OAuth\OAuth1\Service\AbstractService - ) { + + if ($apiService instanceof OAuth\OAuth2\Service\AbstractService || $apiService instanceof OAuth\OAuth1\Service\AbstractService) { // ServiceInterface does not provide refreshAccessToekn, AbstractService does // We must save the token because Google provides it only once $tokenobj = $apiService->refreshAccessToken($tokenobj); $tokenobj->setRefreshToken($refreshtoken); $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); + + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); } } + if (is_object($tokenobj)) { $this->transport->setAuthMode('XOAUTH2'); $this->transport->setPassword($tokenobj->getAccessToken()); diff --git a/htdocs/install/mysql/data/llx_c_input_reason.sql b/htdocs/install/mysql/data/llx_c_input_reason.sql index ff3621aed1601..0e1509f21df95 100644 --- a/htdocs/install/mysql/data/llx_c_input_reason.sql +++ b/htdocs/install/mysql/data/llx_c_input_reason.sql @@ -24,7 +24,7 @@ INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 1, 'SRC_INTE', 'Web site', 1); INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 2, 'SRC_CAMP_MAIL', 'Mailing campaign', 1); INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 3, 'SRC_CAMP_PHO', 'Phone campaign', 1); -INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 4, 'SRC_CAMP_FAX', 'Fax campaign', 1); +INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 4, 'SRC_CAMP_FAX', 'Fax campaign', 0); INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 5, 'SRC_COMM', 'Commercial contact', 1); INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 6, 'SRC_SHOP', 'Shop contact', 1); INSERT INTO llx_c_input_reason (rowid,code,label,active) VALUES ( 7, 'SRC_CAMP_EMAIL', 'EMailing campaign', 1); diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 1d0cb1e2b5cbc..7b7c9b3e99cb0 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -474,7 +474,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks // Write new file - if (getDolGlobalInt('MAIN_ODT_AS_PDF')) { + if (getDolGlobalString('MAIN_ODT_AS_PDF')) { try { $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index d95224d5884ce..9f4660815fb3c 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1121,9 +1121,7 @@ function barcodeserialforproduct(tabproduct,index,element,barcodeproductqty,sele //PMP Real print ''; - - - if (!empty($obj->pmp_real)) { + if (!empty($obj->pmp_real) || (string) $obj->pmp_real === '0') { $pmp_real = $obj->pmp_real; } else { $pmp_real = $product_static->pmp; @@ -1348,6 +1346,7 @@ function updateTotalValuation() { })); } +