|
129 | 129 |
|
130 | 130 | //$langs=new Translate('', $conf); |
131 | 131 | //$langs->setDefaultLang(GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09') : 'auto'); |
132 | | -$langs->loadLangs(array("main","companies","bills","sellyoursaas@sellyoursaas","other","errors",'mails','paypal','paybox','stripe','withdrawals','other','admin','website')); |
| 132 | +$langs->loadLangs(array("main","companies","bills","sellyoursaas@sellyoursaas","other","products","errors",'mails','paypal','paybox','stripe','withdrawals','other','admin','website')); |
133 | 133 |
|
134 | 134 | if ($langs->defaultlang == 'en_US') { |
135 | 135 | $langsen = $langs; |
|
316 | 316 | } |
317 | 317 |
|
318 | 318 | // Define if the thirdparty is a module provider |
319 | | -$mythirdpartyaccount->context['isamoduleprovider'] = array(); // TODO Use $mythirdpartyaccount->context['isamoduleprovider'] |
| 319 | +$mythirdpartyaccount->context['isamoduleprovider'] = array(); |
320 | 320 | if (getDolGlobalInt('SELLYOURSAAS_ALLOW_MODULE_PROVIDER_PROGRAM') > 0) { |
321 | 321 | $sql = "SELECT p.rowid FROM ".MAIN_DB_PREFIX."product as p"; |
322 | 322 | $sql.= " JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; |
|
429 | 429 | $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'contratdet as d ON d.fk_contrat = c.rowid'; |
430 | 430 | $sql.= ', '.MAIN_DB_PREFIX.'product as p'; |
431 | 431 | $sql.= " WHERE d.fk_product = p.rowid"; |
432 | | - $sql.= " AND d.fk_product IN (".(implode(",", $mythirdpartyaccount->context['isamoduleprovider'])).")"; |
| 432 | + $sql.= " AND d.fk_product IN (".$db->sanitize(implode(",", array_keys($mythirdpartyaccount->context['isamoduleprovider']))).")"; |
433 | 433 | $sql.= " AND d.statut = 4"; |
434 | 434 |
|
435 | 435 | if ($search_instance_name) { |
|
2817 | 2817 | } |
2818 | 2818 |
|
2819 | 2819 |
|
2820 | | -// Show partner links |
2821 | | -if ($mythirdpartyaccount->isareseller) { |
| 2820 | +// Show resellection section |
| 2821 | +if ($mythirdpartyaccount->isareseller && !in_array($mode, array('mymodulecustomerinstances', 'mymodulecustomerbilling'))) { |
2822 | 2822 | print ' |
2823 | 2823 | <!-- Info reseller --> |
2824 | 2824 | <div class="note note-info"> |
|
2963 | 2963 | } |
2964 | 2964 |
|
2965 | 2965 |
|
| 2966 | +// Show module provider section |
| 2967 | +if (!empty($mythirdpartyaccount->context['isamoduleprovider']) && !in_array($mode, array('mycustomerinstances', 'mycustomerbilling'))) { |
| 2968 | + print ' |
| 2969 | + <!-- Info module provider --> |
| 2970 | + <div class="note note-info"> |
| 2971 | + <h4 class="block"><span class="fa fa-briefcase"></span> '.$langs->trans("YouAreAModuleProvider").'.</h4> |
| 2972 | + '; |
| 2973 | + print '<span class="opacitymedium">'.$langs->trans("YouAreTheProviderOfTheFollowingModules").':</span><br>'; |
| 2974 | + foreach ($mythirdpartyaccount->context['isamoduleprovider'] as $id => $val) { |
| 2975 | + $tmpproduct = new Product($db); |
| 2976 | + $tmpproduct->fetch($id); |
| 2977 | + print '- '.$tmpproduct->ref.($tmpproduct->label != $tmpproduct->ref ? ' '.$tmpproduct->label : '').' - <span class="small opacitymedium">'.$langs->trans("SellingPriceHT").'</span> = '.price($tmpproduct->price, 0, '', 1, -1, -1, $conf->currency).' / '.$langs->trans("month").'<br>'; |
| 2978 | + } |
| 2979 | + print '</div>'; |
| 2980 | +} |
2966 | 2981 |
|
2967 | 2982 | // Fill array of company payment modes |
2968 | 2983 | $arrayofcompanypaymentmode = array(); |
|
3073 | 3088 | $atleastonepaymentinerroronopeninvoice = 0; |
3074 | 3089 | $atleastoneinvoicedisputed = 0; |
3075 | 3090 |
|
3076 | | -// Show warnings |
3077 | 3091 |
|
| 3092 | +// Show warnings |
3078 | 3093 |
|
3079 | 3094 | if (empty($welcomecid) && ! in_array($action, array('instanceverification', 'autoupgrade'))) { |
3080 | 3095 | $companypaymentmode = new CompanyPaymentMode($db); |
3081 | 3096 | $result = $companypaymentmode->fetch(0, null, $mythirdpartyaccount->id); |
3082 | 3097 |
|
3083 | 3098 | foreach ($listofcontractid as $contractid => $contract) { |
3084 | | - if ($mode == 'mycustomerbilling') { |
| 3099 | + if (in_array($mode, array('mycustomerinstances', 'mycustomerbilling'))) { |
3085 | 3100 | continue; |
3086 | 3101 | } |
3087 | | - if ($mode == 'mycustomerinstances') { |
| 3102 | + if (in_array($mode, array('mymodulecustomerinstances', 'mymodulecustomerbilling'))) { |
3088 | 3103 | continue; |
3089 | 3104 | } |
3090 | 3105 | if ($contract->array_options['options_deployment_status'] == 'undeployed') { |
|
0 commit comments