|
15 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | */ |
17 | 17 |
|
18 | | -// $initialaction can be set |
| 18 | +/** |
| 19 | + * @var Conf $conf |
| 20 | + * @var DoliDB $db |
| 21 | + * @var Translate $langs |
| 22 | + * |
| 23 | + * @var string $initialaction can be set |
| 24 | + * @var Societe $mythirdpartyaccount |
| 25 | + */ |
19 | 26 |
|
20 | 27 | // Protection to avoid direct call of template |
21 | 28 | if (empty($conf) || ! is_object($conf)) { |
|
1250 | 1257 | </div></div> |
1251 | 1258 |
|
1252 | 1259 | </form> |
1253 | | - </div> |
| 1260 | + </div>'; |
1254 | 1261 |
|
| 1262 | + // Tab for SSH/SFTP |
| 1263 | + print ' |
1255 | 1264 | <!-- tab ssh/sftp --> |
1256 | 1265 | <div class="tab-pane" id="tab_ssh_'.$contract->id.'"> |
1257 | 1266 | <p class="opacitymedium" style="padding: 15px">'.$langs->trans("SSHFTPDesc"); |
|
1321 | 1330 | } |
1322 | 1331 |
|
1323 | 1332 | print ' |
1324 | | - </div> <!-- END TAB SSH PANE --> |
| 1333 | + </div> <!-- END TAB SSH PANE -->'; |
| 1334 | + |
| 1335 | + // Tab for DB access |
| 1336 | + print ' |
1325 | 1337 |
|
1326 | 1338 | <!-- tab db --> |
1327 | 1339 | <div class="tab-pane" id="tab_db_'.$contract->id.'"> |
|
1436 | 1448 | } |
1437 | 1449 | } |
1438 | 1450 | } |
1439 | | - print ' <!-- tab upgrade --> |
1440 | | - <div class="tab-pane" id="tab_upgrade_'.$contract->id.'">'; |
1441 | | - if ($lastversiondolibarrinstance < $newversiondolibarr) { |
1442 | | - print ' <form class="form-upgrade" action="'.$_SERVER["PHP_SELF"].'" method="POST"> |
1443 | | - <input type="hidden" name="token" value="'.newToken().'"> |
1444 | | - <input type="hidden" name="mode" value="autoupgrade"> |
1445 | | - <input type="hidden" name="backtopagesupport" value="'.$_SERVER["PHP_SELF"].'?mode=instances"> |
1446 | | - <input type="hidden" name="instanceselect" value="'.$priority.'_'.$contract->id.'"> |
1447 | | - <p class="opacitymediumbis" style="padding: 15px"> |
1448 | | - '.$langs->trans("NewerVersionAvailable", $lastversiondolibarrinstance, $newversiondolibarr).' |
1449 | | - </p> |
1450 | | - <p class="center" style="padding-bottom: 15px"> |
1451 | | - <input type="submit" class="btn" name="undeploy" value="'.$langs->trans("Upgrade").'"> |
1452 | | - </p> |
1453 | | - </form>'; |
1454 | | - }else { |
1455 | | - print ' <p class="opacitymediumbis" style="padding: 15px"> |
1456 | | - '.$langs->trans("AlreadyToLastVersionUpgrade", $newversiondolibarr).' |
1457 | | - </p> |
1458 | | - '; |
| 1451 | + |
| 1452 | + // Get the URL for support |
| 1453 | + $sellyoursaassupporturl = getDolGlobalString('SELLYOURSAAS_SUPPORT_URL'); |
| 1454 | + if (! empty($mythirdpartyaccount->array_options['options_domain_registration_page']) |
| 1455 | + && $mythirdpartyaccount->array_options['options_domain_registration_page'] != getDolGlobalString('SELLYOURSAAS_MAIN_DOMAIN_NAME')) { |
| 1456 | + $newnamekey = 'SELLYOURSAAS_SUPPORT_URL_'.strtoupper(str_replace('.', '_', $mythirdpartyaccount->array_options['options_domain_registration_page'])); |
| 1457 | + if (getDolGlobalString($newnamekey)) { |
| 1458 | + $sellyoursaassupporturl = getDolGlobalString($newnamekey); |
| 1459 | + } |
1459 | 1460 | } |
1460 | 1461 |
|
1461 | | - print ' </div> |
1462 | | - <!-- END tab upgrade --> |
1463 | | -'; |
1464 | | -print ' <!-- tab destroy --> |
| 1462 | + // Tab for upgrade |
| 1463 | + if (empty($sellyoursaassupporturl)) { |
| 1464 | + print ' <!-- tab upgrade --> |
| 1465 | + <div class="tab-pane" id="tab_upgrade_'.$contract->id.'">'; |
| 1466 | + if ($lastversiondolibarrinstance < $newversiondolibarr) { |
| 1467 | + print ' <form class="form-upgrade" action="'.$_SERVER["PHP_SELF"].'" method="POST"> |
| 1468 | + <input type="hidden" name="token" value="'.newToken().'"> |
| 1469 | + <input type="hidden" name="mode" value="autoupgrade"> |
| 1470 | + <input type="hidden" name="backtopagesupport" value="'.$_SERVER["PHP_SELF"].'?mode=instances"> |
| 1471 | + <input type="hidden" name="instanceselect" value="'.$priority.'_'.$contract->id.'"> |
| 1472 | + <p class="opacitymediumbis" style="padding: 15px"> |
| 1473 | + '.$langs->trans("NewerVersionAvailable", $lastversiondolibarrinstance, $newversiondolibarr).' |
| 1474 | + </p> |
| 1475 | + <p class="center" style="padding-bottom: 15px"> |
| 1476 | + <input type="submit" class="btn" name="undeploy" value="'.$langs->trans("Upgrade").'"> |
| 1477 | + </p> |
| 1478 | + </form>'; |
| 1479 | + } else { |
| 1480 | + print ' <p class="opacitymediumbis" style="padding: 15px"> |
| 1481 | + '.$langs->trans("AlreadyToLastVersionUpgrade", $newversiondolibarr).' |
| 1482 | + </p>'; |
| 1483 | + } |
| 1484 | + |
| 1485 | + print "\n".' </div> |
| 1486 | + <!-- END tab upgrade -->'; |
| 1487 | + } |
| 1488 | + |
| 1489 | + // Tab de destroy/cancel instance |
| 1490 | + print ' |
| 1491 | + <!-- tab destroy --> |
1465 | 1492 | <div class="tab-pane" id="tab_danger_'.$contract->id.'"> |
1466 | 1493 |
|
1467 | 1494 | <form class="form-group" action="'.$_SERVER["PHP_SELF"].'" method="POST"> |
|
0 commit comments