Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/websites/index.php
This commit is contained in:
commit
764c7ac792
@ -288,7 +288,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
|||||||
if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^newLT/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^newLT/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^LT\d/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^LT[0-9]/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0;
|
||||||
if (preg_match('/^Language_/', $value)) $qualifiedforclean=0;
|
if (preg_match('/^Language_/', $value)) $qualifiedforclean=0;
|
||||||
|
|||||||
@ -117,7 +117,7 @@ $textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previo
|
|||||||
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
||||||
|
|
||||||
print $conf->dol_optimize_smallscreen;
|
print $conf->dol_optimize_smallscreen;
|
||||||
print load_fiche_titre($langs->trans("VAT"), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
|
print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
|
||||||
|
|
||||||
print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
|
print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
|
||||||
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
|
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
|
||||||
@ -263,18 +263,18 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
|
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
|
||||||
print '<td class="nowrap" align="right">' . price(price2num($total, 1)) . '</td>';
|
print '<td class="nowrap" align="right">' . price(price2num($total, 'MT')) . '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
|
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
|
||||||
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 1)) . "</td>\n";
|
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 'MT')) . "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$restopay = $total - $obj->mm;
|
$restopay = $total - $obj->mm;
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
|
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
|
||||||
print '<td class="nowrap" align="right">' . price(price2num($restopay, 1)) . '</td>';
|
print '<td class="nowrap" align="right">' . price(price2num($restopay, 'MT')) . '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -4417,7 +4417,7 @@ class Form
|
|||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.recuperableonly";
|
$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||||
$sql.= " WHERE t.fk_pays = c.rowid";
|
$sql.= " WHERE t.fk_pays = c.rowid";
|
||||||
$sql.= " AND t.active > 0";
|
$sql.= " AND t.active > 0";
|
||||||
@ -4436,8 +4436,20 @@ class Form
|
|||||||
$this->cache_vatrates[$i]['rowid'] = $obj->rowid;
|
$this->cache_vatrates[$i]['rowid'] = $obj->rowid;
|
||||||
$this->cache_vatrates[$i]['code'] = $obj->code;
|
$this->cache_vatrates[$i]['code'] = $obj->code;
|
||||||
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
|
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
|
||||||
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
|
|
||||||
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
|
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
|
||||||
|
$this->cache_vatrates[$i]['localtax1'] = $obj->localtax1;
|
||||||
|
$this->cache_vatrates[$i]['localtax1_type'] = $obj->localtax1_type;
|
||||||
|
$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
|
||||||
|
$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
|
||||||
|
|
||||||
|
$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
|
||||||
|
$this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1?$obj->localtax1:'0').'/'.($obj->localtax2?$obj->localtax2:'0').($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
|
||||||
|
$positiverates='';
|
||||||
|
if ($obj->taux) $positiverates.=($positiverates?'/':'').$obj->taux;
|
||||||
|
if ($obj->localtax1) $positiverates.=($positiverates?'/':'').$obj->localtax1;
|
||||||
|
if ($obj->localtax2) $positiverates.=($positiverates?'/':'').$obj->localtax2;
|
||||||
|
if (empty($positiverates)) $positiverates='0';
|
||||||
|
$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
|
||||||
}
|
}
|
||||||
|
|
||||||
return $num;
|
return $num;
|
||||||
@ -4611,7 +4623,16 @@ class Form
|
|||||||
$selectedfound=true;
|
$selectedfound=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return.= '>'.vatrate($rate['libtva']);
|
$return.= '>';
|
||||||
|
//if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES))
|
||||||
|
if ($mysoc->country_code == 'IN' || ! empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES))
|
||||||
|
{
|
||||||
|
$return.= $rate['labelpositiverates'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$return.= vatrate($rate['label']);
|
||||||
|
}
|
||||||
//$return.=($rate['code']?' '.$rate['code']:'');
|
//$return.=($rate['code']?' '.$rate['code']:'');
|
||||||
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
|
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
|
||||||
|
|
||||||
|
|||||||
@ -871,7 +871,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
// VAT
|
// VAT
|
||||||
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
|
||||||
{
|
{
|
||||||
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer);
|
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer);
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
|
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
|
||||||
|
|||||||
@ -30,18 +30,34 @@ Piece=Accounting Doc.
|
|||||||
AmountHTVATRealReceived=Net collected
|
AmountHTVATRealReceived=Net collected
|
||||||
AmountHTVATRealPaid=Net paid
|
AmountHTVATRealPaid=Net paid
|
||||||
VATToPay=VAT sells
|
VATToPay=VAT sells
|
||||||
VATReceived=VAT received
|
VATReceived=Tax received
|
||||||
VATToCollect=VAT purchases
|
VATToCollect=Tax purchases
|
||||||
VATSummary=VAT Balance
|
VATSummary=Tax Balance
|
||||||
LT2SummaryES=IRPF Balance
|
VATPaid=Tax paid
|
||||||
|
LT1Summary=Tax 2 summary
|
||||||
|
LT2Summary=Tax 3 summary
|
||||||
LT1SummaryES=RE Balance
|
LT1SummaryES=RE Balance
|
||||||
VATPaid=VAT paid
|
LT2SummaryES=IRPF Balance
|
||||||
LT2PaidES=IRPF Paid
|
LT1SummaryIN=CGST Balance
|
||||||
|
LT2SummaryIN=SGST Balance
|
||||||
|
LT1Paid=Tax 2 paid
|
||||||
|
LT2Paid=Tax 3 paid
|
||||||
LT1PaidES=RE Paid
|
LT1PaidES=RE Paid
|
||||||
LT2CustomerES=IRPF sales
|
LT2PaidES=IRPF Paid
|
||||||
LT2SupplierES=IRPF purchases
|
LT1PaidIN=CGST Paid
|
||||||
|
LT2PaidIN=SGST Paid
|
||||||
|
LT1Customer=Tax 2 sales
|
||||||
|
LT1Supplier=Tax 2 purchases
|
||||||
LT1CustomerES=RE sales
|
LT1CustomerES=RE sales
|
||||||
LT1SupplierES=RE purchases
|
LT1SupplierES=RE purchases
|
||||||
|
LT1CustomerIN=CGST sales
|
||||||
|
LT1SupplierIN=CGST purchases
|
||||||
|
LT2Customer=Tax 3 sales
|
||||||
|
LT2Supplier=Tax 3 purchases
|
||||||
|
LT2CustomerES=IRPF sales
|
||||||
|
LT2SupplierES=IRPF purchases
|
||||||
|
LT2CustomerIN=SGST sales
|
||||||
|
LT2SupplierIN=SGST purchases
|
||||||
VATCollected=VAT collected
|
VATCollected=VAT collected
|
||||||
ToPay=To pay
|
ToPay=To pay
|
||||||
SpecialExpensesArea=Area for all special payments
|
SpecialExpensesArea=Area for all special payments
|
||||||
|
|||||||
@ -356,17 +356,26 @@ Totalforthispage=Total for this page
|
|||||||
TotalTTC=Total (inc. tax)
|
TotalTTC=Total (inc. tax)
|
||||||
TotalTTCToYourCredit=Total (inc. tax) to your credit
|
TotalTTCToYourCredit=Total (inc. tax) to your credit
|
||||||
TotalVAT=Total tax
|
TotalVAT=Total tax
|
||||||
|
TotalVATIN=Total IGST
|
||||||
TotalLT1=Total tax 2
|
TotalLT1=Total tax 2
|
||||||
TotalLT2=Total tax 3
|
TotalLT2=Total tax 3
|
||||||
TotalLT1ES=Total RE
|
TotalLT1ES=Total RE
|
||||||
TotalLT2ES=Total IRPF
|
TotalLT2ES=Total IRPF
|
||||||
|
TotalLT1IN=Total CGST
|
||||||
|
TotalLT2IN=Total SGST
|
||||||
HT=Net of tax
|
HT=Net of tax
|
||||||
TTC=Inc. tax
|
TTC=Inc. tax
|
||||||
INCT=Inc. all taxes
|
INCT=Inc. all taxes
|
||||||
VAT=Sales tax
|
VAT=Sales tax
|
||||||
|
VATIN=IGST
|
||||||
VATs=Sales taxes
|
VATs=Sales taxes
|
||||||
|
VATINs=IGST taxes
|
||||||
|
LT1=Sales tax 2
|
||||||
|
LT2=Sales tax 3
|
||||||
LT1ES=RE
|
LT1ES=RE
|
||||||
LT2ES=IRPF
|
LT2ES=IRPF
|
||||||
|
LT1IN=CGST
|
||||||
|
LT2IN=SGST
|
||||||
VATRate=Tax Rate
|
VATRate=Tax Rate
|
||||||
Average=Average
|
Average=Average
|
||||||
Sum=Sum
|
Sum=Sum
|
||||||
|
|||||||
@ -51,6 +51,7 @@ WidgetFile=Widget file
|
|||||||
ReadmeFile=Readme file
|
ReadmeFile=Readme file
|
||||||
ChangeLog=ChangeLog file
|
ChangeLog=ChangeLog file
|
||||||
SqlFile=Sql file
|
SqlFile=Sql file
|
||||||
|
SqlFileExtraFields=Sql file for complementary attributes
|
||||||
SqlFileKey=Sql file for keys
|
SqlFileKey=Sql file for keys
|
||||||
AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case
|
AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case
|
||||||
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
|
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
|
||||||
@ -12,7 +12,8 @@ MediaFiles=Media library
|
|||||||
EditCss=Edit Style/CSS or HTML header
|
EditCss=Edit Style/CSS or HTML header
|
||||||
EditMenu=Edit menu
|
EditMenu=Edit menu
|
||||||
EditPageMeta=Edit Meta
|
EditPageMeta=Edit Meta
|
||||||
EditPageContent=Edit Content
|
EditPageSource=Edit HTML Source
|
||||||
|
EditPageContent=Edit with CKEditor
|
||||||
Website=Web site
|
Website=Web site
|
||||||
Webpage=Web page/container
|
Webpage=Web page/container
|
||||||
AddPage=Add page/container
|
AddPage=Add page/container
|
||||||
@ -33,7 +34,8 @@ PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be serve
|
|||||||
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
|
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
|
||||||
NoPageYet=No pages yet
|
NoPageYet=No pages yet
|
||||||
SyntaxHelp=Help on code syntax
|
SyntaxHelp=Help on code syntax
|
||||||
YouCanEditHtmlSource=You can edit HTML source code using the "Source" button in editor. You can also include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong><?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?></strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong><a href="/document.php?modulepart=medias&file=filename.ext"></strong>.
|
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
|
||||||
|
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong><?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?></strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong><a href="/document.php?modulepart=medias&file=filename.ext"></strong>.
|
||||||
ClonePage=Clone page/container
|
ClonePage=Clone page/container
|
||||||
CloneSite=Clone site
|
CloneSite=Clone site
|
||||||
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.
|
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.
|
||||||
|
|||||||
@ -110,8 +110,9 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
|||||||
dol_delete_file($destdir.'/myobject_card.php');
|
dol_delete_file($destdir.'/myobject_card.php');
|
||||||
dol_delete_file($destdir.'/myobject_list.php');
|
dol_delete_file($destdir.'/myobject_list.php');
|
||||||
dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php');
|
dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php');
|
||||||
dol_delete_file($destdir.'/sql/llx_myobject.key.sql');
|
|
||||||
dol_delete_file($destdir.'/sql/llx_myobject.sql');
|
dol_delete_file($destdir.'/sql/llx_myobject.sql');
|
||||||
|
dol_delete_file($destdir.'/sql/llx_myobject_extrafields.sql');
|
||||||
|
dol_delete_file($destdir.'/sql/llx_myobject.key.sql');
|
||||||
dol_delete_file($destdir.'/scripts/myobject.php');
|
dol_delete_file($destdir.'/scripts/myobject.php');
|
||||||
dol_delete_file($destdir.'/img/object_myobject.png');
|
dol_delete_file($destdir.'/img/object_myobject.png');
|
||||||
dol_delete_file($destdir.'/class/myobject.class.php');
|
dol_delete_file($destdir.'/class/myobject.class.php');
|
||||||
@ -189,9 +190,10 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
|||||||
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
||||||
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
||||||
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
|
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
|
||||||
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
|
|
||||||
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
|
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
|
||||||
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
|
'sql/llx_myobject_extrafields.sql'=>'sql/llx_'.strtolower($objectname).'_extrafields.sql',
|
||||||
|
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
|
||||||
|
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
|
||||||
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
||||||
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
||||||
'class/api_myobject.class.php'=>'class/api_'.strtolower($objectname).'.class.php',
|
'class/api_myobject.class.php'=>'class/api_'.strtolower($objectname).'.class.php',
|
||||||
@ -377,9 +379,10 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
|
|||||||
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
||||||
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
||||||
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
|
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
|
||||||
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
|
|
||||||
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
|
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
|
||||||
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
|
'sql/llx_myobject_extrafields.sql'=>'sql/llx_'.strtolower($objectname).'_extrafields.sql',
|
||||||
|
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
|
||||||
|
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
|
||||||
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
||||||
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
||||||
'class/api_myobject.class.php'=>'class/api_'.strtolower($objectname).'.class.php',
|
'class/api_myobject.class.php'=>'class/api_'.strtolower($objectname).'.class.php',
|
||||||
@ -423,6 +426,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey)
|
|||||||
|
|
||||||
// File of sql
|
// File of sql
|
||||||
$fileforsql = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.sql';
|
$fileforsql = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.sql';
|
||||||
|
$fileforsqlextra = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'_extrafields.sql';
|
||||||
$fileforsqlkey = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.key.sql';
|
$fileforsqlkey = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.key.sql';
|
||||||
|
|
||||||
|
|
||||||
@ -1195,6 +1199,7 @@ elseif (! empty($module))
|
|||||||
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
||||||
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php';
|
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php';
|
||||||
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
|
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
|
||||||
|
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql';
|
||||||
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
|
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
|
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
|
||||||
@ -1206,6 +1211,9 @@ elseif (! empty($module))
|
|||||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.$pathtosql.'</strong>';
|
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.$pathtosql.'</strong>';
|
||||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=sql&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=sql&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.$pathtosqlextra.'</strong>';
|
||||||
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
print '<br>';
|
||||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.$pathtosqlkey.'</strong>';
|
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.$pathtosqlkey.'</strong>';
|
||||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=sql&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=sql&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
-- Copyright (C) ---Put here your own copyright and developer email---
|
||||||
|
--
|
||||||
|
-- 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
create table llx_myobject_extrafields
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
tms timestamp,
|
||||||
|
fk_object integer NOT NULL,
|
||||||
|
import_key varchar(14) -- import key
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
@ -101,6 +101,7 @@ if (GETPOST('editcss')) { $action='editcss'; }
|
|||||||
if (GETPOST('editmenu')) { $action='editmenu'; }
|
if (GETPOST('editmenu')) { $action='editmenu'; }
|
||||||
if (GETPOST('setashome')) { $action='setashome'; }
|
if (GETPOST('setashome')) { $action='setashome'; }
|
||||||
if (GETPOST('editmeta')) { $action='editmeta'; }
|
if (GETPOST('editmeta')) { $action='editmeta'; }
|
||||||
|
if (GETPOST('editsource')) { $action='editsource'; }
|
||||||
if (GETPOST('editcontent')) { $action='editcontent'; }
|
if (GETPOST('editcontent')) { $action='editcontent'; }
|
||||||
if (GETPOST('createfromclone')) { $action='createfromclone'; }
|
if (GETPOST('createfromclone')) { $action='createfromclone'; }
|
||||||
if (GETPOST('createpagefromclone')) { $action='createpagefromclone'; }
|
if (GETPOST('createpagefromclone')) { $action='createpagefromclone'; }
|
||||||
@ -463,12 +464,12 @@ if ($action == 'updatemeta')
|
|||||||
if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
|
if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
|
||||||
|
|
||||||
|
|
||||||
// Now create the .tpl file (duplicate code with actions updatecontent but we need this to save new header)
|
// Now create the .tpl file (duplicate code with actions updatesource or updatecontent but we need this to save new header)
|
||||||
dol_syslog("We regenerate the tpl page filetpl=".$filetpl);
|
dol_syslog("We regenerate the tpl page filetpl=".$filetpl);
|
||||||
|
|
||||||
dol_delete_file($filetpl);
|
dol_delete_file($filetpl);
|
||||||
|
|
||||||
// TODO Same code than into updatecontent
|
// TODO Same code than into updatesource updatecontent
|
||||||
$tplcontent ='';
|
$tplcontent ='';
|
||||||
$tplcontent.= "<?php // BEGIN PHP\n";
|
$tplcontent.= "<?php // BEGIN PHP\n";
|
||||||
$tplcontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
|
$tplcontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
|
||||||
@ -527,7 +528,7 @@ if ($action == 'updatemeta')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update page
|
// Update page
|
||||||
if (($action == 'updatecontent' || $action == 'confirm_createpagefromclone')
|
if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'confirm_createpagefromclone')
|
||||||
|| ($action == 'preview' && (GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview'))))
|
|| ($action == 'preview' && (GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview'))))
|
||||||
{
|
{
|
||||||
$object->fetch(0, $website);
|
$object->fetch(0, $website);
|
||||||
@ -600,7 +601,7 @@ if (($action == 'updatecontent' || $action == 'confirm_createpagefromclone')
|
|||||||
|
|
||||||
if (! $error && $res > 0)
|
if (! $error && $res > 0)
|
||||||
{
|
{
|
||||||
if ($action == 'updatecontent')
|
if ($action == 'updatesource' || $action == 'updatecontent')
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -777,6 +778,10 @@ if ($action == 'editmeta')
|
|||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="updatemeta">';
|
print '<input type="hidden" name="action" value="updatemeta">';
|
||||||
}
|
}
|
||||||
|
if ($action == 'editsource')
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="action" value="updatesource">';
|
||||||
|
}
|
||||||
if ($action == 'editcontent')
|
if ($action == 'editcontent')
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="action" value="updatecontent">';
|
print '<input type="hidden" name="action" value="updatecontent">';
|
||||||
@ -789,7 +794,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
// Add a margin under toolbar ?
|
// Add a margin under toolbar ?
|
||||||
$style='';
|
$style='';
|
||||||
if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5px;';
|
if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource') $style=' margin-bottom: 5px;';
|
||||||
|
|
||||||
//var_dump($objectpage);exit;
|
//var_dump($objectpage);exit;
|
||||||
print '<div class="centpercent websitebar">';
|
print '<div class="centpercent websitebar">';
|
||||||
@ -862,7 +867,7 @@ if (count($object->records) > 0)
|
|||||||
$urlext=$virtualurl;
|
$urlext=$virtualurl;
|
||||||
$urlint=$urlwithroot.'/public/websites/index.php?website='.$website;
|
$urlint=$urlwithroot.'/public/websites/index.php?website='.$website;
|
||||||
print '<a class="websitebuttonsitepreview'.($urlext?'':' websitebuttonsitepreviewdisabled cursornotallowed').'" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'ext" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">';
|
print '<a class="websitebuttonsitepreview'.($urlext?'':' websitebuttonsitepreviewdisabled cursornotallowed').'" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'ext" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">';
|
||||||
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext');
|
print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:'<span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span>'), 1, 'preview_ext');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/websites/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">';
|
print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/websites/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">';
|
||||||
@ -962,6 +967,7 @@ if (count($object->records) > 0)
|
|||||||
|
|
||||||
print ' ';
|
print ' ';
|
||||||
|
|
||||||
|
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageSource")).'" name="editsource">';
|
||||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">';
|
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">';
|
||||||
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
|
print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
|
||||||
if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
||||||
@ -1012,7 +1018,7 @@ if (count($object->records) > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="websitehelp">';
|
print '<div class="websitehelp">';
|
||||||
if (GETPOST('editcontent', 'alpha'))
|
if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha'))
|
||||||
{
|
{
|
||||||
$htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource");
|
$htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource");
|
||||||
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 0, 2, 'tooltipsubstitution');
|
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 0, 2, 'tooltipsubstitution');
|
||||||
@ -1226,6 +1232,25 @@ if ($action == 'editmenu')
|
|||||||
print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';
|
print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'editsource')
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Editing global variables not related to a specific theme
|
||||||
|
*/
|
||||||
|
|
||||||
|
$csscontent = @file_get_contents($filecss);
|
||||||
|
|
||||||
|
$contentforedit = '';
|
||||||
|
/*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers
|
||||||
|
$contentforedit.=$csscontent;
|
||||||
|
$contentforedit.='</style>'."\n";*/
|
||||||
|
$contentforedit .= $objectpage->content;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
$doleditor=new DolEditor('PAGE_CONTENT',$contentforedit,'',500,'Full','',true,true,'ace',ROWS_5,'90%');
|
||||||
|
$doleditor->Create(0, '', false, 'HTML Source', 'php');
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'editcontent')
|
if ($action == 'editcontent')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user