Skip to content

Commit

Permalink
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into
Browse files Browse the repository at this point in the history
develop
  • Loading branch information
eldy committed Aug 1, 2024
2 parents 6593a7e + 534570a commit cbc28b0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion htdocs/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@
}

// Source / Channel - What trigger creation
print '<tr><td>'.$langs->trans('Channel').'</td><td>';
print '<tr><td>'.$langs->trans('Source').'</td><td>';
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 '</td></tr>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
18 changes: 11 additions & 7 deletions htdocs/core/class/CMailFile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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 {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/data/llx_c_input_reason.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions htdocs/product/inventory/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,7 @@ function barcodeserialforproduct(tabproduct,index,element,barcodeproductqty,sele

//PMP Real
print '<td class="right">';


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;
Expand Down Expand Up @@ -1348,6 +1346,7 @@ function updateTotalValuation() {
}));
}


</script>
<?php
}
Expand Down

0 comments on commit cbc28b0

Please sign in to comment.