Merge branch 'develop' into ModuleBuilderFixes
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="7.0">
|
<project version="7.1">
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.0" />
|
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|||||||
13
ChangeLog
@ -5,12 +5,13 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
||||||
|
|
||||||
NEW: PHP 8.2 compatibility:
|
NEW: PHP 8.2 compatibility.
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* Minimal PHP version is now PHP 7.1 instead of PHP 7.0
|
||||||
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
||||||
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
||||||
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
||||||
@ -18,6 +19,12 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that.
|
* The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 17.0.1 compared to 17.0.0 *****
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
|
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
@ -223,6 +230,10 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all)
|
* Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all)
|
||||||
* The property $url_last_version must be public if defined into module descriptor files;
|
* The property $url_last_version must be public if defined into module descriptor files;
|
||||||
|
|
||||||
|
***** ChangeLog for 16.0.5 compared to 16.0.4 *****
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 16.0.4 compared to 16.0.3 *****
|
***** ChangeLog for 16.0.4 compared to 16.0.3 *****
|
||||||
|
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
README
|
|
||||||
------
|
|
||||||
|
|
||||||
Scripts in this directory can be used to reload or save a demo database.
|
|
||||||
Install of package "dialog" is required.
|
|
||||||
|
|
||||||
|
|
||||||
*** Init demo
|
|
||||||
|
|
||||||
The script initdemo.sh will erase current database with data into mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
|
||||||
|
|
||||||
Do a chmod 700 initdemo.sh
|
|
||||||
then run ./initdemo.sh to launch Graphic User Interface.
|
|
||||||
|
|
||||||
After loading the demo files, admin login may be:
|
|
||||||
- admin / admin
|
|
||||||
or
|
|
||||||
- admin / adminadmin
|
|
||||||
|
|
||||||
|
|
||||||
*** Save demo
|
|
||||||
|
|
||||||
The script savedemo.sh will save current database into a database dump file.
|
|
||||||
|
|
||||||
|
|
||||||
*** Update demo
|
|
||||||
|
|
||||||
The goal of script updatedemo.php is to update dates into the demo data so samples are up to date.
|
|
||||||
32
dev/initdemo/README.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
README
|
||||||
|
======
|
||||||
|
|
||||||
|
Scripts in this directory can be used to reload or save a demo database.
|
||||||
|
Install of package "dialog" is required.
|
||||||
|
|
||||||
|
|
||||||
|
Init demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The script initdemo.sh will erase current database with data intodev/initdemo/mysqldump_dolibarr_x.y.z.sql and copy files into documents_demo into officiel document directory.
|
||||||
|
|
||||||
|
Do a chmod 700 initdemo.sh
|
||||||
|
then run ./initdemo.sh to launch Graphic User Interface.
|
||||||
|
|
||||||
|
After loading the demo files, admin login may be:
|
||||||
|
- admin / admin
|
||||||
|
or
|
||||||
|
- admin / adminadmin
|
||||||
|
|
||||||
|
|
||||||
|
Update demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The goal of script dev/initdemo/updatedemo.php is to update dates into the demo data so samples are up to date.
|
||||||
|
|
||||||
|
|
||||||
|
Save demo
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The script dev/initdemo.savedemo.sh will save current database into a database dump file.
|
||||||
|
|
||||||
@ -290,6 +290,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_monmodule_abcdef
|
--ignore-table=$base.llx_monmodule_abcdef
|
||||||
--ignore-table=$base.llx_notes
|
--ignore-table=$base.llx_notes
|
||||||
--ignore-table=$base.llx_packages
|
--ignore-table=$base.llx_packages
|
||||||
|
--ignore-table=$base.llx_packages_extrafields
|
||||||
--ignore-table=$base.llx_pos_cash
|
--ignore-table=$base.llx_pos_cash
|
||||||
--ignore-table=$base.llx_pos_control_cash
|
--ignore-table=$base.llx_pos_control_cash
|
||||||
--ignore-table=$base.llx_pos_facture
|
--ignore-table=$base.llx_pos_facture
|
||||||
@ -305,6 +306,19 @@ export list="
|
|||||||
--ignore-table=$base.llx_residence
|
--ignore-table=$base.llx_residence
|
||||||
--ignore-table=$base.llx_residence_building
|
--ignore-table=$base.llx_residence_building
|
||||||
--ignore-table=$base.llx_residence_building_links
|
--ignore-table=$base.llx_residence_building_links
|
||||||
|
--ignore-table=$base.llx_scaninvoices_filestoimport
|
||||||
|
--ignore-table=$base.llx_scaninvoices_filestoimport_extrafields
|
||||||
|
--ignore-table=$base.llx_scaninvoices_settings
|
||||||
|
--ignore-table=$base.llx_scaninvoices_settings_extrafields
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistcontent
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistdir
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistfrom
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistip
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistmail
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_blacklistto
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_deploymentserver
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_stats
|
||||||
|
--ignore-table=$base.llx_sellyoursaas_whitelistip
|
||||||
--ignore-table=$base.llx_societe_rib2
|
--ignore-table=$base.llx_societe_rib2
|
||||||
--ignore-table=$base.llx_sellyoursaas_cancellation
|
--ignore-table=$base.llx_sellyoursaas_cancellation
|
||||||
--ignore-table=$base.llx_ticketsup
|
--ignore-table=$base.llx_ticketsup
|
||||||
|
|||||||
@ -60,6 +60,8 @@ if ($action == 'update') {
|
|||||||
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
|
||||||
$minamount = GETPOST('MEMBER_MIN_AMOUNT');
|
$minamount = GETPOST('MEMBER_MIN_AMOUNT');
|
||||||
$publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC');
|
$publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC');
|
||||||
|
$showtable = GETPOST('MEMBER_SHOW_TABLE');;
|
||||||
|
$showvoteallowed = GETPOST('MEMBER_SHOW_VOTE_ALLOWED');
|
||||||
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||||
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
|
||||||
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
$forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09');
|
||||||
@ -68,6 +70,8 @@ if ($action == 'update') {
|
|||||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
||||||
|
$res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", !$showtable, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show"
|
||||||
|
$res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", !$showvoteallowed, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show"
|
||||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
||||||
if ($forcetype < 0) {
|
if ($forcetype < 0) {
|
||||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
||||||
@ -246,6 +250,22 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
|||||||
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1);
|
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0)
|
||||||
|
$skiptable = (!empty($conf->global->MEMBER_SKIP_TABLE) ? $conf->global->MEMBER_SKIP_TABLE : 0);
|
||||||
|
print '<tr class="oddeven" id="tredit"><td>';
|
||||||
|
print $langs->trans("MembersShowMembershipTypesTable");
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->selectyesno("MEMBER_SHOW_TABLE", !$skiptable, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Show "vote allowed" setting for membership types
|
||||||
|
$hidevoteallowed = (!empty($conf->global->MEMBER_HIDE_VOTE_ALLOWED) ? $conf->global->MEMBER_HIDE_VOTE_ALLOWED : 0);
|
||||||
|
print '<tr class="oddeven" id="tredit"><td>';
|
||||||
|
print $langs->trans("MembersShowVotesAllowed");
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", !$hidevoteallowed, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Jump to an online payment page
|
// Jump to an online payment page
|
||||||
print '<tr class="oddeven" id="trpayment"><td>';
|
print '<tr class="oddeven" id="trpayment"><td>';
|
||||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||||
|
|||||||
@ -345,19 +345,19 @@ $sql .= " d.note_private, d.note_public, d.import_key,";
|
|||||||
$sql .= " s.nom,";
|
$sql .= " s.nom,";
|
||||||
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
|
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
|
||||||
$sql .= " t.libelle as type, t.subscription,";
|
$sql .= " t.libelle as type, t.subscription,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name";
|
||||||
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -224,7 +224,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -226,19 +226,17 @@ print "<br>\n";
|
|||||||
// Build and execute select
|
// Build and execute select
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$sql = 'SELECT ';
|
$sql = 'SELECT ';
|
||||||
foreach ($object->fields as $key => $val) {
|
$sql .= $object->getFieldList('t');
|
||||||
$sql .= "t.".$key.", ";
|
|
||||||
}
|
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : '');
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -1181,7 +1181,11 @@ if ($mode == 'deploy') {
|
|||||||
} else {
|
} else {
|
||||||
if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
||||||
// Show clean message
|
// Show clean message
|
||||||
|
if (!is_numeric('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
|
||||||
|
$message = info_admin($langs->trans(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')));
|
||||||
|
} else {
|
||||||
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
|
$message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show technical message
|
// Show technical message
|
||||||
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
|
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
|
||||||
|
|||||||
@ -109,12 +109,18 @@ if (!$base) {
|
|||||||
|
|
||||||
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
|
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
|
||||||
$arrayoffiles = array();
|
$arrayoffiles = array();
|
||||||
|
$arrayoftablesautocreated = array();
|
||||||
foreach ($arrayoffilesrich as $value) {
|
foreach ($arrayoffilesrich as $value) {
|
||||||
//print $shortsqlfilename.' ';
|
//print $shortsqlfilename.' ';
|
||||||
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
|
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
|
||||||
$arrayoffiles[] = $shortsqlfilename;
|
$arrayoffiles[$value['name']] = $shortsqlfilename;
|
||||||
|
if ($value['name'] == $shortsqlfilename && ! preg_match('/\.key\.sql$/', $value['name'])) {
|
||||||
|
// This is a sql file automatically created
|
||||||
|
$arrayoftablesautocreated[$value['name']] = $shortsqlfilename;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now loop on tables really found into database
|
||||||
$sql = "SHOW TABLE STATUS";
|
$sql = "SHOW TABLE STATUS";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -123,6 +129,7 @@ if (!$base) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td>'.($i+1).'</td>';
|
print '<td>'.($i+1).'</td>';
|
||||||
@ -130,11 +137,14 @@ if (!$base) {
|
|||||||
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
||||||
|
|
||||||
if (in_array($tablename.'.sql', $arrayoffiles)) {
|
if (in_array($tablename.'.sql', $arrayoffiles)) {
|
||||||
|
if (in_array($tablename.'.sql', $arrayoftablesautocreated)) {
|
||||||
$img = "info";
|
$img = "info";
|
||||||
//print img_picto($langs->trans("ExternalModule"), $img);
|
|
||||||
} else {
|
} else {
|
||||||
$img = "info_black";
|
$img = "info_black";
|
||||||
//print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql';
|
print img_picto($langs->trans("NotAvailableByDefaultEnabledOnModuleActivation"), $img, 'class="small opacitymedium"');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$img = "info_black";
|
||||||
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
|
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -330,7 +330,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Auto fill the contact found from email
|
// Auto fill the contact found from email
|
||||||
// This option is a serious security hole. it allowe to any non looged perso, to get the database of contacts
|
// This option is a serious security hole. it allows to any non logged perso, to get the database of contacts or to check if an email is a customer or not. We must keep it as hidden option only.
|
||||||
/*
|
/*
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
|
|||||||
@ -106,6 +106,9 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
if (isset($_SERVER['HTTP_DOLAPIKEY'])) { // Param DOLAPIKEY in header can be read with HTTP_DOLAPIKEY
|
if (isset($_SERVER['HTTP_DOLAPIKEY'])) { // Param DOLAPIKEY in header can be read with HTTP_DOLAPIKEY
|
||||||
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
$api_key = $_SERVER['HTTP_DOLAPIKEY']; // With header method (recommanded)
|
||||||
}
|
}
|
||||||
|
if (preg_match('/^dolcrypt:/i', $api_key)) {
|
||||||
|
throw new RestException(503, 'Bad value for the API key. An API key should not start with dolcrypt:');
|
||||||
|
}
|
||||||
|
|
||||||
if ($api_key) {
|
if ($api_key) {
|
||||||
$userentity = 0;
|
$userentity = 0;
|
||||||
@ -113,15 +116,15 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||||
$sql .= " u.tms as date_modification, u.entity";
|
$sql .= " u.tms as date_modification, u.entity";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.api_key = '".$this->db->escape($api_key)."'";
|
$sql .= " WHERE u.api_key = '".$this->db->escape($api_key)."' OR u.api_key = '".$this->db->escape(dolEncrypt($api_key, '', '', 'dolibarr'))."'";
|
||||||
// TODO Check if 2 users has same API key.
|
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($this->db->num_rows($result)) {
|
$nbrows = $this->db->num_rows($result);
|
||||||
|
if ($nbrows == 1) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
$login = $obj->login;
|
$login = $obj->login;
|
||||||
$stored_key = $obj->api_key;
|
$stored_key = dolDecrypt($obj->api_key);
|
||||||
$userentity = $obj->entity;
|
$userentity = $obj->entity;
|
||||||
|
|
||||||
if (!defined("DOLENTITY") && $conf->entity != ($obj->entity ? $obj->entity : 1)) { // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
|
if (!defined("DOLENTITY") && $conf->entity != ($obj->entity ? $obj->entity : 1)) { // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
|
||||||
@ -130,6 +133,8 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
dol_syslog("Entity was not set on http header with HTTP_DOLAPIENTITY (recommanded for performance purpose), so we switch now on entity of user (".$conf->entity.") and we have to reload configuration.", LOG_WARNING);
|
dol_syslog("Entity was not set on http header with HTTP_DOLAPIENTITY (recommanded for performance purpose), so we switch now on entity of user (".$conf->entity.") and we have to reload configuration.", LOG_WARNING);
|
||||||
$conf->setValues($this->db);
|
$conf->setValues($this->db);
|
||||||
}
|
}
|
||||||
|
} elseif ($nbrows > 1) {
|
||||||
|
throw new RestException(503, 'Error when fetching user api_key : More than 1 user with this apikey');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new RestException(503, 'Error when fetching user api_key :'.$this->db->error_msg);
|
throw new RestException(503, 'Error when fetching user api_key :'.$this->db->error_msg);
|
||||||
|
|||||||
@ -607,6 +607,7 @@ class Documents extends DolibarrApi
|
|||||||
|
|
||||||
if ($ref) {
|
if ($ref) {
|
||||||
$tmpreldir = '';
|
$tmpreldir = '';
|
||||||
|
$fetchbyid = false;
|
||||||
|
|
||||||
if ($modulepart == 'facture' || $modulepart == 'invoice') {
|
if ($modulepart == 'facture' || $modulepart == 'invoice') {
|
||||||
$modulepart = 'facture';
|
$modulepart = 'facture';
|
||||||
@ -666,13 +667,22 @@ class Documents extends DolibarrApi
|
|||||||
$modulepart = 'propale';
|
$modulepart = 'propale';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
$object = new Propal($this->db);
|
$object = new Propal($this->db);
|
||||||
|
} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
|
||||||
|
$modulepart = 'contact';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
$object = new Contact($this->db);
|
||||||
|
$fetchbyid = true;
|
||||||
} else {
|
} else {
|
||||||
// TODO Implement additional moduleparts
|
// TODO Implement additional moduleparts
|
||||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($object)) {
|
if (is_object($object)) {
|
||||||
|
if ($fetchbyid) {
|
||||||
|
$result = $object->fetch($ref);
|
||||||
|
} else {
|
||||||
$result = $object->fetch('', $ref);
|
$result = $object->fetch('', $ref);
|
||||||
|
}
|
||||||
|
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
throw new RestException(404, "Object with ref '".$ref."' was not found.");
|
throw new RestException(404, "Object with ref '".$ref."' was not found.");
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
use Luracast\Restler\RestException;
|
use Luracast\Restler\RestException;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -152,7 +153,7 @@ class Login
|
|||||||
|
|
||||||
// We store API token into database
|
// We store API token into database
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||||
$sql .= " SET api_key = '".$this->db->escape($token)."'";
|
$sql .= " SET api_key = '".$this->db->escape(dolEncrypt($token, '', '', 'dolibarr'))."'";
|
||||||
$sql .= " WHERE login = '".$this->db->escape($login)."'";
|
$sql .= " WHERE login = '".$this->db->escape($login)."'";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log
|
dol_syslog(get_class($this)."::login", LOG_DEBUG); // No log
|
||||||
|
|||||||
@ -214,7 +214,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -219,7 +219,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -306,7 +306,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -227,7 +227,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
|
|||||||
@ -227,7 +227,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) ---Put here your own copyright and developer email---
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,7 +70,7 @@ if (!$sortorder) {
|
|||||||
$object = new Propal($db);
|
$object = new Propal($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('myobjectagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('propalagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
|||||||
255
htdocs/commande/agenda.php
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/commande/agenda.php
|
||||||
|
* \ingroup commande
|
||||||
|
* \brief Tab of events on Sale Orders
|
||||||
|
*/
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("order", "other"));
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
if (GETPOST('actioncode', 'array')) {
|
||||||
|
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||||
|
if (!count($actioncode)) {
|
||||||
|
$actioncode = '0';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||||
|
}
|
||||||
|
$search_rowid = GETPOST('search_rowid');
|
||||||
|
$search_agenda_label = GETPOST('search_agenda_label');
|
||||||
|
|
||||||
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortfield) {
|
||||||
|
$sortfield = 'a.datep,a.id';
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = 'DESC,DESC';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new Commande($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('orderagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$upload_dir = $conf->commande->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$permissiontoread = $user->hasRight("commande", "lire");
|
||||||
|
$permissiontoadd = $user->hasRight("commande", "creer");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!empty($user->socid)) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
restrictedArea($user, 'commande', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters = array('id'=>$id);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
|
// Cancel
|
||||||
|
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||||
|
$actioncode = '';
|
||||||
|
$search_agenda_label = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if ($object->id > 0) {
|
||||||
|
$title = $langs->trans("Agenda");
|
||||||
|
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||||
|
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
if (isModEnabled('notification')) {
|
||||||
|
$langs->load("mails");
|
||||||
|
}
|
||||||
|
$head = commande_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'agenda', $langs->trans("Order"), -1, $object->picto);
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||||
|
// Project
|
||||||
|
if (isModEnabled('project')) {
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= '<br>';
|
||||||
|
if (0) {
|
||||||
|
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||||
|
if ($action != 'classify') {
|
||||||
|
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||||
|
}
|
||||||
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||||
|
} else {
|
||||||
|
if (!empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= $proj->getNomUrl(1);
|
||||||
|
if ($proj->title) {
|
||||||
|
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
$object->info($object->id);
|
||||||
|
dol_print_object_info($object, 1);
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Actions buttons
|
||||||
|
|
||||||
|
$objthirdparty = $object;
|
||||||
|
$objcon = new stdClass();
|
||||||
|
|
||||||
|
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id);
|
||||||
|
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
|
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||||
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||||
|
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') {
|
||||||
|
$out .= '&socid='.urlencode($objthirdparty->id);
|
||||||
|
}
|
||||||
|
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
|
||||||
|
//$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
//$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$morehtmlright = '';
|
||||||
|
|
||||||
|
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
|
||||||
|
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
|
||||||
|
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
||||||
|
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
|
||||||
|
|
||||||
|
if (isModEnabled('agenda')) {
|
||||||
|
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||||
|
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||||
|
} else {
|
||||||
|
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
}
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
|
$param .= '&limit='.urlencode($limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to know count of actioncomm from cache
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_commande_'.$object->id;
|
||||||
|
$nbEvent = dol_getcache($cachekey);
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||||
|
//print_barre_liste($langs->trans("ActionsOnOrder"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||||
|
|
||||||
|
// List of all actions
|
||||||
|
$filters = array();
|
||||||
|
$filters['search_agenda_label'] = $search_agenda_label;
|
||||||
|
$filters['search_rowid'] = $search_rowid;
|
||||||
|
|
||||||
|
// TODO Replace this with same code than into list.php
|
||||||
|
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, property_exists($object, 'module') ? $object->module : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -2976,10 +2976,14 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
|
|
||||||
print '</div><div class="fichehalfright">';
|
print '</div><div class="fichehalfright">';
|
||||||
|
|
||||||
|
$MAXEVENT = 10;
|
||||||
|
|
||||||
|
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id);
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, 'order', $socid, 1);
|
$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,13 +243,14 @@ class CommandeStats extends Stats
|
|||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||||
$sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
$sql .= " FROM ".$this->from;
|
||||||
|
$sql .= " INNER JOIN ".$this->from_line." ON c.rowid = tl.fk_commande";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."product as product ON tl.fk_product = product.rowid";
|
||||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||||
}
|
}
|
||||||
$sql .= $this->join;
|
$sql .= $this->join;
|
||||||
$sql .= " WHERE ".$this->where;
|
$sql .= " WHERE ".$this->where;
|
||||||
$sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
|
|
||||||
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
$sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'";
|
||||||
$sql .= " GROUP BY product.ref";
|
$sql .= " GROUP BY product.ref";
|
||||||
$sql .= $this->db->order('nb', 'DESC');
|
$sql .= $this->db->order('nb', 'DESC');
|
||||||
|
|||||||
@ -1,129 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
|
||||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
|
||||||
*
|
|
||||||
* 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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/commande/info.php
|
|
||||||
* \ingroup commande
|
|
||||||
* \brief Sale Order info page
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load Dolibarr environment
|
|
||||||
require '../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
|
||||||
if (isModEnabled('project')) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->commande->lire) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load translation files required by the page
|
|
||||||
$langs->loadLangs(array('orders', 'sendings', 'bills'));
|
|
||||||
|
|
||||||
$socid = 0;
|
|
||||||
$comid = GETPOST("id", 'int');
|
|
||||||
$id = GETPOST("id", 'int');
|
|
||||||
$ref = GETPOST('ref', 'alpha');
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'commande', $comid, '');
|
|
||||||
|
|
||||||
$usercancreate = $user->hasRight("commande", "creer");
|
|
||||||
|
|
||||||
$object = new Commande($db);
|
|
||||||
if (!$object->fetch($id, $ref) > 0) {
|
|
||||||
dol_print_error($db);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
$title = $langs->trans('Order')." - ".$langs->trans('Info');
|
|
||||||
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
|
|
||||||
llxHeader('', $title, $help_url);
|
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$object->info($object->id);
|
|
||||||
|
|
||||||
$head = commande_prepare_head($object);
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order');
|
|
||||||
|
|
||||||
// Order card
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
|
||||||
// Ref customer
|
|
||||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
|
||||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
|
||||||
// Thirdparty
|
|
||||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
|
||||||
// Project
|
|
||||||
if (isModEnabled('project')) {
|
|
||||||
$langs->load("projects");
|
|
||||||
$morehtmlref .= '<br>';
|
|
||||||
if (0) {
|
|
||||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
|
||||||
if ($action != 'classify') {
|
|
||||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
|
||||||
}
|
|
||||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
|
||||||
} else {
|
|
||||||
if (!empty($object->fk_project)) {
|
|
||||||
$proj = new Project($db);
|
|
||||||
$proj->fetch($object->fk_project);
|
|
||||||
$morehtmlref .= $proj->getNomUrl(1);
|
|
||||||
if ($proj->title) {
|
|
||||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$morehtmlref .= '</div>';
|
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
|
||||||
dol_print_object_info($object);
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
|
||||||
|
|
||||||
// End of page
|
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
@ -223,6 +223,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||||||
$object->fields = dol_sort_array($object->fields, 'position');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1284,24 +1285,24 @@ if ($resql) {
|
|||||||
if ($permissiontovalidate) {
|
if ($permissiontovalidate) {
|
||||||
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
|
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
|
||||||
}
|
}
|
||||||
if ($permissiontosendbymail) {
|
|
||||||
$arrayofmassactions['presend'] = img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
|
|
||||||
}
|
|
||||||
if ($permissiontoclose) {
|
if ($permissiontoclose) {
|
||||||
$arrayofmassactions['preshipped'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').$langs->trans("ClassifyShipped");
|
$arrayofmassactions['preshipped'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').$langs->trans("ClassifyShipped");
|
||||||
}
|
}
|
||||||
if ($permissiontocancel) {
|
|
||||||
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
|
|
||||||
}
|
|
||||||
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
|
|
||||||
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
|
|
||||||
}
|
|
||||||
if ($permissiontoclose) {
|
if ($permissiontoclose) {
|
||||||
$arrayofmassactions['setbilled'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
|
$arrayofmassactions['setbilled'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
|
||||||
}
|
}
|
||||||
|
if ($permissiontocancel) {
|
||||||
|
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
|
||||||
|
}
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
|
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
|
||||||
|
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
|
}
|
||||||
|
if ($permissiontosendbymail) {
|
||||||
|
$arrayofmassactions['presend'] = img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
|
||||||
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
|
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1119,6 +1119,8 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
// @TODO Check there is no child into llx_payment_various, ... to allow deletion ?
|
||||||
|
|
||||||
// Delete link between tag and bank account
|
// Delete link between tag and bank account
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
||||||
@ -2018,7 +2020,6 @@ class AccountLine extends CommonObjectLine
|
|||||||
$sql .= " b.fk_user_author, b.fk_user_rappro,";
|
$sql .= " b.fk_user_author, b.fk_user_rappro,";
|
||||||
$sql .= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
$sql .= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
||||||
$sql .= " b.fk_bordereau, b.banque, b.emetteur,";
|
$sql .= " b.fk_bordereau, b.banque, b.emetteur,";
|
||||||
//$sql.= " b.author"; // Is this used ?
|
|
||||||
$sql .= " ba.ref as bank_account_ref, ba.label as bank_account_label";
|
$sql .= " ba.ref as bank_account_ref, ba.label as bank_account_label";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
|
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
|
|||||||
@ -126,6 +126,22 @@ class PaymentVarious extends CommonObject
|
|||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Type of bank account if the payment is on a bank account
|
||||||
|
*/
|
||||||
|
public $fk_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int 1 if the payment is on a bank account line that is conciliated
|
||||||
|
*/
|
||||||
|
public $rappro;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string ID of bank receipt
|
||||||
|
*/
|
||||||
|
public $bank_num_releve;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
@ -251,7 +267,6 @@ class PaymentVarious extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($id, $user = null)
|
public function fetch($id, $user = null)
|
||||||
{
|
{
|
||||||
global $langs;
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql .= " v.rowid,";
|
$sql .= " v.rowid,";
|
||||||
$sql .= " v.tms,";
|
$sql .= " v.tms,";
|
||||||
@ -262,7 +277,7 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql .= " v.fk_typepayment,";
|
$sql .= " v.fk_typepayment,";
|
||||||
$sql .= " v.num_payment,";
|
$sql .= " v.num_payment,";
|
||||||
$sql .= " v.label,";
|
$sql .= " v.label,";
|
||||||
$sql .= " v.note,";
|
$sql .= " v.note as note_private,";
|
||||||
$sql .= " v.accountancy_code,";
|
$sql .= " v.accountancy_code,";
|
||||||
$sql .= " v.subledger_account,";
|
$sql .= " v.subledger_account,";
|
||||||
$sql .= " v.fk_projet as fk_project,";
|
$sql .= " v.fk_projet as fk_project,";
|
||||||
@ -271,7 +286,8 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql .= " v.fk_user_modif,";
|
$sql .= " v.fk_user_modif,";
|
||||||
$sql .= " b.fk_account,";
|
$sql .= " b.fk_account,";
|
||||||
$sql .= " b.fk_type,";
|
$sql .= " b.fk_type,";
|
||||||
$sql .= " b.rappro";
|
$sql .= " b.rappro,";
|
||||||
|
$sql .= " b.num_releve as bank_num_releve";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
||||||
$sql .= " WHERE v.rowid = ".((int) $id);
|
$sql .= " WHERE v.rowid = ".((int) $id);
|
||||||
@ -292,7 +308,8 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->type_payment = $obj->fk_typepayment;
|
$this->type_payment = $obj->fk_typepayment;
|
||||||
$this->num_payment = $obj->num_payment;
|
$this->num_payment = $obj->num_payment;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note_private; // For backward compatibility
|
||||||
|
$this->note_private = $obj->note_private;
|
||||||
$this->subledger_account = $obj->subledger_account;
|
$this->subledger_account = $obj->subledger_account;
|
||||||
$this->accountancy_code = $obj->accountancy_code;
|
$this->accountancy_code = $obj->accountancy_code;
|
||||||
$this->fk_project = $obj->fk_project;
|
$this->fk_project = $obj->fk_project;
|
||||||
@ -302,6 +319,7 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->fk_account = $obj->fk_account;
|
$this->fk_account = $obj->fk_account;
|
||||||
$this->fk_type = $obj->fk_type;
|
$this->fk_type = $obj->fk_type;
|
||||||
$this->rappro = $obj->rappro;
|
$this->rappro = $obj->rappro;
|
||||||
|
$this->bank_num_releve = $obj->bank_num_releve;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
|
||||||
|
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,7 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('banks', 'categories', 'multicurrency'));
|
$langs->loadLangs(array('banks', 'categories', 'multicurrency'));
|
||||||
|
|
||||||
|
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
@ -45,10 +46,11 @@ if (!$user->rights->banque->transfer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$hookmanager->initHooks(array('banktransfer'));
|
$hookmanager->initHooks(array('banktransfer'));
|
||||||
|
|
||||||
|
$MAXLINES = 10;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -60,57 +62,84 @@ if ($reshook < 0) {
|
|||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
}
|
}
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$langs->load("errors");
|
$langs->load('errors');
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
$dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
while ($i < $MAXLINES) {
|
||||||
$label = GETPOST('label', 'alpha');
|
$dateo[$i] = dol_mktime(12, 0, 0, GETPOST($i.'_month', 'int'), GETPOST($i.'_day', 'int'), GETPOST($i.'_year', 'int'));
|
||||||
$amount = price2num(GETPOST('amount', 'alpha'), 'MT', 2);
|
$label[$i] = GETPOST($i.'_label', 'alpha');
|
||||||
$amountto = price2num(GETPOST('amountto', 'alpha'), 'MT', 2);
|
$amount[$i] = intval(price2num(GETPOST($i.'_amount', 'alpha'), 'MT', 2));
|
||||||
|
$amountto[$i] = price2num(GETPOST($i.'_amountto', 'alpha'), 'MT', 2);
|
||||||
|
$accountfrom[$i] = intval(GETPOST($i.'_account_from', 'int'));
|
||||||
|
$accountto[$i] = intval(GETPOST($i.'_account_to', 'int'));
|
||||||
|
$type[$i] = GETPOST($i.'_type', 'int');
|
||||||
|
$errori[$i] = 0;
|
||||||
|
|
||||||
if (!$label) {
|
$tabnum[$i] = 0;
|
||||||
$error++;
|
if (!empty($label[$i]) || !empty($type[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) {
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
|
$tabnum[$i] = 1;
|
||||||
}
|
}
|
||||||
if (!$amount) {
|
$i++;
|
||||||
$error++;
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
|
||||||
}
|
}
|
||||||
if (!GETPOST('account_from', 'int')) {
|
|
||||||
$error++;
|
$n = 1;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors');
|
while ($n < $MAXLINES) {
|
||||||
|
if ($tabnum[$n] === 1) {
|
||||||
|
if ($accountfrom[$n] < 0) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferFrom")), null, 'errors');
|
||||||
}
|
}
|
||||||
if (!GETPOST('account_to', 'int')) {
|
if ($accountto[$n] < 0) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferTo")), null, 'errors');
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$type[$n]) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Type")), null, 'errors');
|
||||||
|
}
|
||||||
|
if (!$dateo[$n]) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Date")), null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($label[$n])) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' . $langs->transnoentities("Description")), null, 'errors');
|
||||||
|
}
|
||||||
|
if (!($amount[$n])) {
|
||||||
|
$errori[$n]++;
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Amount")), null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$errori[$n]) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
$accountfrom = new Account($db);
|
$accountfrom = new Account($db);
|
||||||
$accountfrom->fetch(GETPOST('account_from', 'int'));
|
$accountfrom->fetch(GETPOST($n.'_account_from', 'int'));
|
||||||
|
|
||||||
$accountto = new Account($db);
|
$accountto = new Account($db);
|
||||||
$accountto->fetch(GETPOST('account_to', 'int'));
|
$accountto->fetch(GETPOST($n.'_account_to', 'int'));
|
||||||
|
|
||||||
if ($accountto->currency_code == $accountfrom->currency_code) {
|
if ($accountto->currency_code == $accountfrom->currency_code) {
|
||||||
$amountto = $amount;
|
$amountto[$n] = $amount[$n];
|
||||||
} else {
|
} else {
|
||||||
if (!$amountto) {
|
if (!$amountto[$n]) {
|
||||||
$error++;
|
$error[$n]++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")).' #'.$n, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($amountto < 0) {
|
if ($amountto[$n] < 0) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
setEventMessages($langs->trans("AmountMustBePositive"), null, 'errors');
|
setEventMessages($langs->trans("AmountMustBePositive").' #'.$n, null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($accountto->id == $accountfrom->id) {
|
if ($accountto->id == $accountfrom->id) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
|
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers").' #'.$n, null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if ($errori[$n] == 0) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$bank_line_id_from = 0;
|
$bank_line_id_from = 0;
|
||||||
@ -118,42 +147,41 @@ if ($action == 'add') {
|
|||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
// By default, electronic transfert from bank to bank
|
// By default, electronic transfert from bank to bank
|
||||||
$typefrom = 'PRE';
|
$typefrom = $type[$n];
|
||||||
$typeto = 'VIR';
|
$typeto = $type[$n];
|
||||||
if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) {
|
if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) {
|
||||||
// This is transfer of change
|
// This is transfer of change
|
||||||
$typefrom = 'LIQ';
|
$typefrom = 'LIQ';
|
||||||
$typeto = 'LIQ';
|
$typeto = 'LIQ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$errori[$n]) {
|
||||||
$bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, price2num(-1 * $amount), '', '', $user);
|
$bank_line_id_from = $accountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * $amount[$n]), '', '', $user);
|
||||||
}
|
}
|
||||||
if (!($bank_line_id_from > 0)) {
|
if (!($bank_line_id_from > 0)) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$errori[$n]) {
|
||||||
$bank_line_id_to = $accountto->addline($dateo, $typeto, $label, $amountto, '', '', $user);
|
$bank_line_id_to = $accountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', '', $user);
|
||||||
}
|
}
|
||||||
if (!($bank_line_id_to > 0)) {
|
if (!($bank_line_id_to > 0)) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$errori[$n]) {
|
||||||
$result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
$result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
||||||
}
|
}
|
||||||
if (!($result > 0)) {
|
if (!($result > 0)) {
|
||||||
$error++;
|
$errori++;
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$errori[$n]) {
|
||||||
$result = $accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
$result = $accountto->add_url_line($bank_line_id_to, $bank_line_id_from, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert');
|
||||||
}
|
}
|
||||||
if (!($result > 0)) {
|
if (!($result > 0)) {
|
||||||
$error++;
|
$errori[$n]++;
|
||||||
}
|
}
|
||||||
|
if (!$errori[$n]) {
|
||||||
if (!$error) {
|
$mesgs = $langs->trans("TransferFromToDone", '{s1}', '{s2}', $amount[$n], $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||||
$mesgs = $langs->trans("TransferFromToDone", '{s1}', '{s2}', $amount, $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
|
||||||
$mesgs = str_replace('{s1}', '<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label.'</a>', $mesgs);
|
$mesgs = str_replace('{s1}', '<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label.'</a>', $mesgs);
|
||||||
$mesgs = str_replace('{s2}', '<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label.'</a>', $mesgs);
|
$mesgs = str_replace('{s2}', '<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label.'</a>', $mesgs);
|
||||||
setEventMessages($mesgs, null, 'mesgs');
|
setEventMessages($mesgs, null, 'mesgs');
|
||||||
@ -164,19 +192,22 @@ if ($action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
|
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
|
||||||
$title = $langs->trans('MenuBankInternalTransfer');
|
$title = $langs->trans('MenuBankInternalTransfer');
|
||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
|
||||||
print ' <script type="text/javascript">
|
print ' <script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".selectbankaccount").change(function() {
|
$(".selectbankaccount").change(function() {
|
||||||
@ -191,6 +222,13 @@ print ' <script type="text/javascript">
|
|||||||
var currencycode1="";
|
var currencycode1="";
|
||||||
var currencycode2="";
|
var currencycode2="";
|
||||||
|
|
||||||
|
$("select").each(function() {
|
||||||
|
if( $(this).attr("view")){
|
||||||
|
$(this).closest("tr").removeClass("hidejs").removeClass("hideobject");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$.get("'.DOL_URL_ROOT.'/core/ajax/getaccountcurrency.php", {id: account1})
|
$.get("'.DOL_URL_ROOT.'/core/ajax/getaccountcurrency.php", {id: account1})
|
||||||
.done(function( data ) {
|
.done(function( data ) {
|
||||||
if (data != null)
|
if (data != null)
|
||||||
@ -238,63 +276,104 @@ print ' <script type="text/javascript">
|
|||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
$account_from = '';
|
|
||||||
$account_to = '';
|
|
||||||
$label = '';
|
|
||||||
$amount = '';
|
|
||||||
$amountto = '';
|
|
||||||
|
|
||||||
if ($error) {
|
|
||||||
$account_from = GETPOST('account_from', 'int');
|
|
||||||
$account_to = GETPOST('account_to', 'int');
|
|
||||||
$label = GETPOST('label', 'alpha');
|
|
||||||
$amount = GETPOST('amount', 'alpha');
|
|
||||||
}
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
|
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("TransferDesc").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("TransferDesc").'</span>';
|
||||||
print "<br><br>";
|
print '<br><br>';
|
||||||
|
|
||||||
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
|
print '<div>';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table id="tablemouvbank" class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td>';
|
print '<th>'.$langs->trans("TransferFrom").'</th>';
|
||||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
print '<th>'.$langs->trans("TransferTo").'</th>';
|
||||||
print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
print '<th>'.$langs->trans("Type").'</th>';
|
||||||
|
print '<th>'.$langs->trans("Date").'</th>';
|
||||||
|
print '<th>'.$langs->trans("Description").'</th>';
|
||||||
|
print '<th class="right">'.$langs->trans("Amount").'</th>';
|
||||||
|
//print '<td class="hideobject" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
for ($i = 1 ; $i < $MAXLINES; $i++) {
|
||||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
$label = '';
|
||||||
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
|
$amount = '';
|
||||||
print "</td>";
|
|
||||||
|
|
||||||
print "<td>\n";
|
if ($errori[$i]) {
|
||||||
|
$label = GETPOST($i.'_label', 'alpha');
|
||||||
|
$amount = GETPOST($i.'_amount', 'alpha');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i == 1) {
|
||||||
|
$classi = 'numvir number'. $i;
|
||||||
|
$classi .= ' active';
|
||||||
|
} else {
|
||||||
|
$classi = 'numvir number'. $i;
|
||||||
|
$classi .= ' hidejs hideobject';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven nowraponall '.$classi.'"><td>';
|
||||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', !isModEnabled('multicurrency') ? 0 : 1);
|
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="nowraponall">';
|
||||||
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
|
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
print "<td>";
|
// Payment mode
|
||||||
print $form->selectDate((!empty($dateo) ? $dateo : ''), '', '', '', '', 'add');
|
print '<td class="nowraponall">';
|
||||||
|
$idpaymentmodetransfer = dol_getIdFromCode($db, 'VIR', 'c_paiement');
|
||||||
|
$form->select_types_paiements(($errori[$i] ? GETPOST($i.'_type', 'aZ09') : $idpaymentmodetransfer), $i.'_type', '', 0, 1, 0, 0, 1, 'minwidth100');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
|
||||||
print '<td class="right"><input name="amount" class="flat right" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
|
||||||
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
|
||||||
|
|
||||||
print "</table>";
|
// Date
|
||||||
|
print '<td class="nowraponall">';
|
||||||
|
print $form->selectDate((!empty($dateo[$i]) ? $dateo[$i] : ''), $i.'_', '', '', '', 'add');
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
print '<td><input name="'.$i.'_label" class="flat quatrevingtpercent selectjs" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
||||||
|
|
||||||
|
print '<td class="right"><input name="'.$i.'_amount" class="flat right selectjs" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
||||||
|
|
||||||
|
print '<td class="hideobject" class="multicurrency"><input name="'.$i.'_amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
};
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '</div>';
|
||||||
|
print '<div id="btncont" style="display: flex; align-items: center">';
|
||||||
|
print '<a id="btnincrement" style="margin-left:35%" class="btnTitle btnTitlePlus" onclick="increment()" title="Ajouter écriture">
|
||||||
|
<span class="fa fa-plus-circle valignmiddle btnTitle-icon">
|
||||||
|
</span>
|
||||||
|
</a>';
|
||||||
|
print '<br><div class=""><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
|
print '</form>';
|
||||||
|
|
||||||
print "</form>";
|
print ' <script type="text/javascript">
|
||||||
|
function increment(){
|
||||||
|
$(".numvir").nextAll(".hidejs:first").removeClass("hidejs").removeClass("hideobject").addClass("active").show();
|
||||||
|
};
|
||||||
|
$(".number1").on("click",(function() {
|
||||||
|
console.log("We click on number1");
|
||||||
|
$(".hidejs").each(function (){$(this).hide()});
|
||||||
|
$("#btncont").show();
|
||||||
|
}))
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -643,19 +643,29 @@ if ($id) {
|
|||||||
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
|
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (isModEnabled("banque")) {
|
$bankaccountnotfound = 0;
|
||||||
if ($object->fk_account > 0) {
|
|
||||||
$bankline = new AccountLine($db);
|
|
||||||
$bankline->fetch($object->fk_bank);
|
|
||||||
|
|
||||||
|
if (isModEnabled('banque')) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
if ($object->fk_bank > 0) {
|
||||||
|
$bankline = new AccountLine($db);
|
||||||
|
$result = $bankline->fetch($object->fk_bank);
|
||||||
|
|
||||||
|
if ($result <= 0) {
|
||||||
|
$bankaccountnotfound = 1;
|
||||||
|
} else {
|
||||||
print $bankline->getNomUrl(1, 0, 'showall');
|
print $bankline->getNomUrl(1, 0, 'showall');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$bankaccountnotfound = 1;
|
||||||
|
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("NoRecordfound").'</span>';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('socid'=>$object->id);
|
$parameters = array('socid'=>$object->id);
|
||||||
@ -684,7 +694,7 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
if (empty($object->rappro)) {
|
if (empty($object->rappro) || $bankaccountnotfound) {
|
||||||
if (!empty($user->rights->banque->modifier)) {
|
if (!empty($user->rights->banque->modifier)) {
|
||||||
if ($alreadyaccounted) {
|
if ($alreadyaccounted) {
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("Accounted").'">'.$langs->trans("Delete").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("Accounted").'">'.$langs->trans("Delete").'</a></div>';
|
||||||
|
|||||||
@ -211,7 +211,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
255
htdocs/compta/facture/agenda.php
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/facture/agenda.php
|
||||||
|
* \ingroup facture
|
||||||
|
* \brief Tab of events on Invoices
|
||||||
|
*/
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("facture", "other"));
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
if (GETPOST('actioncode', 'array')) {
|
||||||
|
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||||
|
if (!count($actioncode)) {
|
||||||
|
$actioncode = '0';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||||
|
}
|
||||||
|
$search_rowid = GETPOST('search_rowid');
|
||||||
|
$search_agenda_label = GETPOST('search_agenda_label');
|
||||||
|
|
||||||
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortfield) {
|
||||||
|
$sortfield = 'a.datep,a.id';
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = 'DESC,DESC';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new Facture($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->facture->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('invoiceagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$permissiontoread = $user->hasRight("facture", "lire");
|
||||||
|
$permissiontoadd = $user->hasRight("facture", "creer");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (!empty($user->socid)) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters = array('id'=>$id);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
|
// Cancel
|
||||||
|
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||||
|
$actioncode = '';
|
||||||
|
$search_agenda_label = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if ($object->id > 0) {
|
||||||
|
$title = $langs->trans("Agenda");
|
||||||
|
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||||
|
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
if (isModEnabled('notification')) {
|
||||||
|
$langs->load("mails");
|
||||||
|
}
|
||||||
|
$head = facture_prepare_head($object);
|
||||||
|
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'agenda', $langs->trans("Invoice"), -1, $object->picto);
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||||
|
// Project
|
||||||
|
if (isModEnabled('project')) {
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= '<br>';
|
||||||
|
if (0) {
|
||||||
|
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||||
|
if ($action != 'classify') {
|
||||||
|
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||||
|
}
|
||||||
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||||
|
} else {
|
||||||
|
if (!empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= $proj->getNomUrl(1);
|
||||||
|
if ($proj->title) {
|
||||||
|
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
$object->info($object->id);
|
||||||
|
dol_print_object_info($object, 1);
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Actions buttons
|
||||||
|
|
||||||
|
$objthirdparty = $object;
|
||||||
|
$objcon = new stdClass();
|
||||||
|
|
||||||
|
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id);
|
||||||
|
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
|
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||||
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||||
|
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') {
|
||||||
|
$out .= '&socid='.urlencode($objthirdparty->id);
|
||||||
|
}
|
||||||
|
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
|
||||||
|
//$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
//$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$morehtmlright = '';
|
||||||
|
|
||||||
|
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
|
||||||
|
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
|
||||||
|
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
||||||
|
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
|
||||||
|
|
||||||
|
if (isModEnabled('agenda')) {
|
||||||
|
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||||
|
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||||
|
} else {
|
||||||
|
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
}
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
|
$param .= '&limit='.urlencode($limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to know count of actioncomm from cache
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_facture_'.$object->id;
|
||||||
|
$nbEvent = dol_getcache($cachekey);
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans("ActionsOnBill").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||||
|
//print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
|
||||||
|
|
||||||
|
// List of all actions
|
||||||
|
$filters = array();
|
||||||
|
$filters['search_agenda_label'] = $search_agenda_label;
|
||||||
|
$filters['search_rowid'] = $search_rowid;
|
||||||
|
|
||||||
|
// TODO Replace this with same code than into list.php
|
||||||
|
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, property_exists($object, 'module') ? $object->module : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -1304,7 +1304,8 @@ if (empty($reshook)) {
|
|||||||
$object->date_pointoftax = $date_pointoftax;
|
$object->date_pointoftax = $date_pointoftax;
|
||||||
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
|
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
|
||||||
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
|
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
|
||||||
$object->ref_client = GETPOST('ref_client');
|
$object->ref_customer = GETPOST('ref_client');
|
||||||
|
$object->ref_client = $object->ref_customer;
|
||||||
$object->model_pdf = GETPOST('model');
|
$object->model_pdf = GETPOST('model');
|
||||||
$object->fk_project = GETPOST('projectid', 'int');
|
$object->fk_project = GETPOST('projectid', 'int');
|
||||||
$object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
|
$object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
|
||||||
@ -5809,10 +5810,14 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '</div><div class="fichehalfright">';
|
print '</div><div class="fichehalfright">';
|
||||||
|
|
||||||
|
$MAXEVENT = 10;
|
||||||
|
|
||||||
|
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id);
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
|
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -336,10 +336,6 @@ class Facture extends CommonInvoice
|
|||||||
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),
|
||||||
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>115, 'isameasure'=>1),
|
||||||
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1),
|
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1),
|
||||||
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
|
|
||||||
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>166),
|
|
||||||
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>167),
|
|
||||||
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>168),
|
|
||||||
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
'fk_facture_source' =>array('type'=>'integer', 'label'=>'SourceInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||||
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||||
@ -370,7 +366,11 @@ class Facture extends CommonInvoice
|
|||||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
|
||||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>320),
|
||||||
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502),
|
||||||
|
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>506),
|
||||||
|
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>508),
|
||||||
|
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>510),
|
||||||
|
'fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,144 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
|
||||||
*
|
|
||||||
* 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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/compta/facture/info.php
|
|
||||||
* \ingroup facture
|
|
||||||
* \brief Page des informations d'une facture
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load Dolibarr environment
|
|
||||||
require '../../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
|
||||||
if (isModEnabled('project')) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load translation files required by the page
|
|
||||||
$langs->loadLangs(array('companies', 'bills'));
|
|
||||||
|
|
||||||
$id = GETPOST("facid", "int");
|
|
||||||
$ref = GETPOST("ref", 'alpha');
|
|
||||||
|
|
||||||
$object = new Facture($db);
|
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
|
||||||
|
|
||||||
// Load object
|
|
||||||
if ($id > 0 || !empty($ref)) {
|
|
||||||
$ret = $object->fetch($id, $ref, '', '', (!empty($conf->global->INVOICE_USE_SITUATION) ? $conf->global->INVOICE_USE_SITUATION : 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
|
||||||
|
|
||||||
$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
|
||||||
|
|
||||||
$usercancreate = $user->hasRight("facture", "creer");
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
$title = $object->ref." - ".$langs->trans('Info');
|
|
||||||
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
|
||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
|
||||||
|
|
||||||
if (empty($object->id)) {
|
|
||||||
$langs->load('errors');
|
|
||||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
|
||||||
llxFooter();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
$object->info($object->id);
|
|
||||||
|
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill');
|
|
||||||
|
|
||||||
$totalpaid = $object->getSommePaiement();
|
|
||||||
|
|
||||||
// Invoice content
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
|
||||||
// Ref customer
|
|
||||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
|
||||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
|
||||||
// Thirdparty
|
|
||||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
|
||||||
// Project
|
|
||||||
if (isModEnabled('project')) {
|
|
||||||
$langs->load("projects");
|
|
||||||
$morehtmlref .= '<br>';
|
|
||||||
if (0) {
|
|
||||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
|
||||||
if ($action != 'classify') {
|
|
||||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
|
||||||
}
|
|
||||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
|
||||||
} else {
|
|
||||||
if (!empty($object->fk_project)) {
|
|
||||||
$proj = new Project($db);
|
|
||||||
$proj->fetch($object->fk_project);
|
|
||||||
$morehtmlref .= $proj->getNomUrl(1);
|
|
||||||
if ($proj->title) {
|
|
||||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$morehtmlref .= '</div>';
|
|
||||||
|
|
||||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<table class="centpercent"><tr><td>';
|
|
||||||
dol_print_object_info($object);
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
|
||||||
|
|
||||||
// End of page
|
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
@ -300,7 +300,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
@ -1035,7 +1035,7 @@ while ($i < $imaxinloop) {
|
|||||||
// Status
|
// Status
|
||||||
if (!empty($arrayfields['status']['checked'])) {
|
if (!empty($arrayfields['status']['checked'])) {
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $invoicerectmp->getLibStatut(3, 0);
|
print $invoicerectmp->getLibStatut(5, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
|
|||||||
@ -112,6 +112,7 @@ $search_zip = GETPOST('search_zip', 'alpha');
|
|||||||
$search_state = GETPOST("search_state");
|
$search_state = GETPOST("search_state");
|
||||||
$search_country = GETPOST("search_country", 'alpha');
|
$search_country = GETPOST("search_country", 'alpha');
|
||||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||||
|
$search_company_code_client = GETPOST("search_type_thirdparty", 'alpha');
|
||||||
$search_user = GETPOST('search_user', 'int');
|
$search_user = GETPOST('search_user', 'int');
|
||||||
$search_sale = GETPOST('search_sale', 'int');
|
$search_sale = GETPOST('search_sale', 'int');
|
||||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||||
@ -232,8 +233,8 @@ $arrayfields = array(
|
|||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
|
||||||
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
|
||||||
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
|
||||||
'f.module_source'=>array('label'=>"POSModule", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90),
|
'f.module_source'=>array('label'=>"POSModule", 'langs'=>'cashdesk', 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90),
|
||||||
'f.pos_source'=>array('label'=>"POSTerminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91),
|
'f.pos_source'=>array('label'=>"POSTerminal", 'langs'=>'cashdesk', 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91),
|
||||||
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
|
||||||
'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
|
||||||
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110),
|
||||||
@ -241,8 +242,6 @@ $arrayfields = array(
|
|||||||
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
|
||||||
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
|
||||||
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
|
||||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
|
|
||||||
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166),
|
|
||||||
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
|
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280),
|
||||||
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285),
|
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285),
|
||||||
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290),
|
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290),
|
||||||
@ -255,10 +254,16 @@ $arrayfields = array(
|
|||||||
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
|
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
|
||||||
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
|
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
|
||||||
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502),
|
'f.tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502),
|
||||||
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
|
'u.login'=>array('label'=>"UserAuthor", 'checked'=>1, 'position'=>504),
|
||||||
'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
|
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>506),
|
||||||
'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>520, 'enabled'=>'1'),
|
//'f.fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>506),
|
||||||
|
//'f.fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>508),
|
||||||
|
//'f.fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>510),
|
||||||
|
//'f.fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||||
|
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>520, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
|
||||||
|
'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>521, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
|
||||||
|
'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>530, 'enabled'=>'1'),
|
||||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -268,10 +273,11 @@ if (getDolGlobalString("INVOICE_USE_SITUATION") && !empty($conf->global->INVOICE
|
|||||||
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
|
|
||||||
if (!empty($val['visible'])) {
|
if (!empty($val['visible'])) {
|
||||||
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
||||||
$newkey = '';
|
$newkey = '';
|
||||||
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('t.'.$key, $arrayfields)) { $newkey = 't.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
|
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
|
||||||
if ($newkey) {
|
if ($newkey) {
|
||||||
$arrayfields[$newkey] = array(
|
$arrayfields[$newkey] = array(
|
||||||
'label'=>$val['label'],
|
'label'=>$val['label'],
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2019 Markus Welters <markus@welters.de>
|
* Copyright (C) 2019 Markus Welters <markus@welters.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -126,8 +126,8 @@ if (empty($reshook)) {
|
|||||||
$bprev = new BonPrelevement($db);
|
$bprev = new BonPrelevement($db);
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty (we don't use them anymore)
|
// getDolGlobalString('PRELEVEMENT_CODE_BANQUE') and getDolGlobalString('PRELEVEMENT_CODE_GUICHET') should be empty (we don't use them anymore)
|
||||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format, $executiondate, 0, $type);
|
$result = $bprev->create(getDolGlobalString('PRELEVEMENT_CODE_BANQUE'), getDolGlobalString('PRELEVEMENT_CODE_GUICHET'), $mode, $format, $executiondate, 0, $type);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||||
} elseif ($result == 0) {
|
} elseif ($result == 0) {
|
||||||
|
|||||||
@ -39,12 +39,17 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('compta', 'bills'));
|
$langs->loadLangs(array('compta', 'bills'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||||
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
|
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
|
||||||
$mode = GETPOST('mode', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
|
||||||
|
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_label = GETPOST('search_label', 'alpha');
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
@ -62,9 +67,9 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
|
||||||
|
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
if (empty($page) || $page == -1) {
|
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||||
$page = 0; // If $page is not defined, or '' or -1
|
$page = 0;
|
||||||
}
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
@ -96,6 +101,9 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
$hookmanager->initHooks(array('salestaxeslist'));
|
$hookmanager->initHooks(array('salestaxeslist'));
|
||||||
$object = new Tva($db);
|
$object = new Tva($db);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->hasRight('tax', 'charges', 'creer');
|
||||||
|
$permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
@ -116,6 +124,7 @@ if ($reshook < 0) {
|
|||||||
|
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
|
// Selection of new fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
|
||||||
@ -129,7 +138,15 @@ if (empty($reshook)) {
|
|||||||
$search_account = '';
|
$search_account = '';
|
||||||
$search_amount = '';
|
$search_amount = '';
|
||||||
$search_status = '';
|
$search_status = '';
|
||||||
|
$toselect = array();
|
||||||
|
$search_array_options = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass = 'Tva';
|
||||||
|
$objectlabel = 'Tva';
|
||||||
|
$uploaddir = $conf->tax->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,9 +162,16 @@ $bankstatic = new Account($db);
|
|||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
$bankline = new AccountLine($db);
|
$bankline = new AccountLine($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("VATDeclarations"));
|
$now = dol_now();
|
||||||
|
|
||||||
$sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment as type, t.fk_account,';
|
$title = $langs->trans("VATDeclarations");
|
||||||
|
//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||||
|
$help_url = '';
|
||||||
|
|
||||||
|
|
||||||
|
// Build and execute select
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
$sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye as status, t.fk_typepayment as type, t.fk_account,';
|
||||||
$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,';
|
$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,';
|
||||||
$sql.= ' t.num_payment, pst.code as payment_code,';
|
$sql.= ' t.num_payment, pst.code as payment_code,';
|
||||||
$sql .= ' SUM(ptva.amount) as alreadypayed';
|
$sql .= ' SUM(ptva.amount) as alreadypayed';
|
||||||
@ -207,7 +231,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -223,22 +247,28 @@ if ($limit) {
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
llxFooter();
|
|
||||||
$db->close();
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
|
||||||
|
// Output page
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($mode)) {
|
if (!empty($mode)) {
|
||||||
$param .= '&mode='.urlencode($mode);
|
$param .= '&mode='.urlencode($mode);
|
||||||
}
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.$contextpage;
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
$param .= '&limit='.$limit;
|
$param .= '&limit='.((int) $limit);
|
||||||
}
|
}
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
$param .= '&optioncss='.urlencode($optioncss);
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
@ -298,24 +328,33 @@ if (!empty($search_amount)) {
|
|||||||
if ($search_status != '' && $search_status != '-1') {
|
if ($search_status != '' && $search_status != '-1') {
|
||||||
$param .= '&search_status='.urlencode($search_status);
|
$param .= '&search_status='.urlencode($search_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
|
if (!empty($permissiontodelete)) {
|
||||||
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
|
$url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
|
||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
@ -324,8 +363,17 @@ if (!empty($socid)) {
|
|||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
|
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||||
print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
|
||||||
|
|
||||||
|
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
|
$topicmail = "SendVAT";
|
||||||
|
$modelmail = "vat";
|
||||||
|
$objecttmp = new Tva($db);
|
||||||
|
$trackid = 'vat'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||||
@ -333,15 +381,40 @@ if ($massactionbutton) {
|
|||||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
$moreforfilter = '';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$moreforfilter = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($moreforfilter)) {
|
||||||
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
|
print $moreforfilter;
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
||||||
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
// Fields title search
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
// Action column
|
||||||
// Filter: Buttons
|
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
print $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterButtons('left');
|
||||||
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,92 +491,137 @@ if (!empty($arrayfields['t.status']['checked'])) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$parameters = array('arrayfields'=>$arrayfields);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
// Filter: Buttons
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
print $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
|
// Fields title label
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||||
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.rowid']['checked'])) {
|
if (!empty($arrayfields['t.rowid']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.rowid']['label'], $_SERVER['PHP_SELF'], 't.rowid', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.rowid']['label'], $_SERVER['PHP_SELF'], 't.rowid', '', $param, '', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.label']['checked'])) {
|
if (!empty($arrayfields['t.label']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER['PHP_SELF'], 't.label', '', $param, 'align="left"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER['PHP_SELF'], 't.label', '', $param, 'align="left"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.datev']['checked'])) {
|
if (!empty($arrayfields['t.datev']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.datev']['label'], $_SERVER['PHP_SELF'], 't.datev', '', $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.datev']['label'], $_SERVER['PHP_SELF'], 't.datev', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.fk_typepayment']['checked'])) {
|
if (!empty($arrayfields['t.fk_typepayment']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.fk_typepayment']['label'], $_SERVER['PHP_SELF'], 't.fk_typepayment', '', $param, '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre($arrayfields['t.fk_typepayment']['label'], $_SERVER['PHP_SELF'], 't.fk_typepayment', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.fk_account']['checked'])) {
|
if (!empty($arrayfields['t.fk_account']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.fk_account']['label'], $_SERVER['PHP_SELF'], 't.fk_account', '', $param, '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre($arrayfields['t.fk_account']['label'], $_SERVER['PHP_SELF'], 't.fk_account', '', $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.amount']['label'], $_SERVER['PHP_SELF'], 't.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre($arrayfields['t.amount']['label'], $_SERVER['PHP_SELF'], 't.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.status']['checked'])) {
|
if (!empty($arrayfields['t.status']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.status']['label'], $_SERVER["PHP_SELF"], "t.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.status']['label'], $_SERVER["PHP_SELF"], "t.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
// Loop on record
|
||||||
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$savnbfield = $totalarray['nbfield'];
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$totalarray['nbfield'] = 0;
|
$totalarray['nbfield'] = 0;
|
||||||
$total = 0;
|
|
||||||
|
|
||||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
while ($i < $imaxinloop) {
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
if (empty($obj)) {
|
||||||
|
break; // Should not happen
|
||||||
|
}
|
||||||
|
|
||||||
$tva_static->id = $obj->rowid;
|
$tva_static->id = $obj->rowid;
|
||||||
$tva_static->ref = $obj->rowid;
|
$tva_static->ref = $obj->rowid;
|
||||||
$tva_static->label = $obj->label;
|
$tva_static->label = $obj->label;
|
||||||
$tva_static->paiementtype = $obj->paye;
|
|
||||||
$tva_static->type_payment = $obj->payment_code;
|
$tva_static->type_payment = $obj->payment_code;
|
||||||
$tva_static->datev = $obj->datev;
|
$tva_static->datev = $obj->datev;
|
||||||
$tva_static->amount = $obj->amount;
|
$tva_static->amount = $obj->amount;
|
||||||
|
$tva_static->paye = $obj->status;
|
||||||
|
$tva_static->status = $obj->status;
|
||||||
|
$object = $tva_static;
|
||||||
|
|
||||||
if ($mode == 'kanban') {
|
if ($mode == 'kanban') {
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
print '<tr><td colspan="12">';
|
print '<tr><td colspan="'.$savnbfield.'">';
|
||||||
print '<div class="box-flex-container kanban">';
|
print '<div class="box-flex-container kanban">';
|
||||||
}
|
}
|
||||||
// Output Kanban
|
// Output Kanban
|
||||||
print $tva_static->getKanbanView('');
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print $object->getKanbanView('');
|
||||||
if ($i == ($imaxinloop - 1)) {
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven">';
|
// Show here line of result
|
||||||
|
$j = 0;
|
||||||
// Buttons
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||||
|
// Action column
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No
|
// No
|
||||||
@ -588,7 +706,6 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||||
$total = $total + $obj->amount;
|
|
||||||
print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
|
print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
@ -602,7 +719,7 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['t.status']['checked'])) {
|
if (!empty($arrayfields['t.status']['checked'])) {
|
||||||
print '<td class="nowrap right">' . $tva_static->LibStatut($obj->paye, 5, $obj->alreadypayed) . '</td>';
|
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -611,19 +728,28 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td></td>';
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a buttons placeholder for the total line
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
|
|
||||||
// Show total line
|
// Show total line
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
@ -641,7 +767,7 @@ if ($num == 0) {
|
|||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|||||||
@ -425,7 +425,7 @@ if (isModEnabled('mailing')) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -261,7 +261,12 @@ if ($object->id > 0) {
|
|||||||
$param .= '&limit='.$limit;
|
$param .= '&limit='.$limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ActionsOnContract"), $newcardbutton, '');
|
// Try to know count of actioncomm from cache
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_thirdparty_'.$object->id;
|
||||||
|
$nbEvent = dol_getcache($cachekey);
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ActionsOnContract").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>': ''), $newcardbutton, '');
|
||||||
//print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 1);
|
//print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 1);
|
||||||
|
|
||||||
// List of all actions
|
// List of all actions
|
||||||
|
|||||||
@ -279,7 +279,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -36,7 +36,7 @@ if (!defined('NOREQUIREAJAX')) {
|
|||||||
if (!defined('NOREQUIRESOC')) {
|
if (!defined('NOREQUIRESOC')) {
|
||||||
define('NOREQUIRESOC', '1');
|
define('NOREQUIRESOC', '1');
|
||||||
}
|
}
|
||||||
// We need langs because the getRandomPassword may use user language to define some rules of pass generation
|
// We need langs because the getRandomPassword may use the user language to define some rules of pass generation
|
||||||
/*if (!defined('NOREQUIRETRAN')) {
|
/*if (!defined('NOREQUIRETRAN')) {
|
||||||
define('NOREQUIRETRAN', '1');
|
define('NOREQUIRETRAN', '1');
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
@ -85,19 +85,19 @@ class box_birthdays extends ModeleBoxes
|
|||||||
if ($user->rights->user->user->lire) {
|
if ($user->rights->user->user->lire) {
|
||||||
$tmparray = dol_getdate(dol_now(), true);
|
$tmparray = dol_getdate(dol_now(), true);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, 'birth' as typea, u.email, u.statut as status";
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, date_format(u.birth, '%d') as daya, 'birth' as typea, u.email, u.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= ' UNION ';
|
$sql .= ' UNION ';
|
||||||
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, 'employment' as typea, u.email, u.statut as status";
|
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, date_format(u.dateemployment, '%d') as daya, 'employment' as typea, u.email, u.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||||
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
||||||
|
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||||
$sql .= " ORDER BY DAY(datea) ASC";
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@ -85,12 +85,12 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
if ($user->rights->adherent->lire) {
|
if ($user->rights->adherent->lire) {
|
||||||
$tmparray = dol_getdate(dol_now(), true);
|
$tmparray = dol_getdate(dol_now(), true);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, date_format(u.birth, '%d') as daya, u.email, u.statut as status, u.datefin";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||||
$sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED;
|
$sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED;
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= " ORDER BY DAY(u.birth) ASC";
|
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
@ -104,9 +104,16 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
$memberstatic->id = $objp->rowid;
|
$memberstatic->id = $objp->rowid;
|
||||||
$memberstatic->firstname = $objp->firstname;
|
$memberstatic->firstname = $objp->firstname;
|
||||||
$memberstatic->lastname = $objp->lastname;
|
$memberstatic->lastname = $objp->lastname;
|
||||||
|
$memberstatic->email = $objp->email;
|
||||||
|
$memberstatic->status = $objp->status;
|
||||||
|
$memberstatic->statut = $memberstatic->status;
|
||||||
|
$memberstatic->datefin = $this->db->jdate($objp->datefin);
|
||||||
|
//$memberstatic->need_subscription = 1;
|
||||||
$dateb = $this->db->jdate($objp->birth);
|
$dateb = $this->db->jdate($objp->birth);
|
||||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||||
|
|
||||||
|
$typea = '<i class="fas fa-birthday-cake inline-block"></i>';
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => '',
|
'td' => '',
|
||||||
'text' => $memberstatic->getNomUrl(1),
|
'text' => $memberstatic->getNomUrl(1),
|
||||||
@ -118,6 +125,12 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][] = array(
|
||||||
|
'td' => 'class="center nowraponall"',
|
||||||
|
'text' => $typea,
|
||||||
|
'asis' => 1
|
||||||
|
);
|
||||||
|
|
||||||
/*$this->info_box_contents[$line][] = array(
|
/*$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="right" width="18"',
|
'td' => 'class="right" width="18"',
|
||||||
'text' => $memberstatic->LibStatut($objp->status, 3)
|
'text' => $memberstatic->LibStatut($objp->status, 3)
|
||||||
|
|||||||
@ -112,6 +112,11 @@ class DolGraph
|
|||||||
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
||||||
$this->bgcolor = array(235, 235, 224);
|
$this->bgcolor = array(235, 235, 224);
|
||||||
|
|
||||||
|
// For small screen, we prefer a default with of 300
|
||||||
|
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||||
|
$this->width = 300;
|
||||||
|
}
|
||||||
|
|
||||||
// Load color of the theme
|
// Load color of the theme
|
||||||
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||||
if (is_readable($color_file)) {
|
if (is_readable($color_file)) {
|
||||||
|
|||||||
@ -726,6 +726,8 @@ class ExtraFields
|
|||||||
|
|
||||||
if (is_array($param) && count($param) > 0) {
|
if (is_array($param) && count($param) > 0) {
|
||||||
$params = serialize($param);
|
$params = serialize($param);
|
||||||
|
} elseif (is_array($param)) {
|
||||||
|
$params = '';
|
||||||
} elseif (strlen($param) > 0) {
|
} elseif (strlen($param) > 0) {
|
||||||
$params = trim($param);
|
$params = trim($param);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -6729,7 +6729,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Zone de saisie manuelle de la date
|
// Zone de saisie manuelle de la date
|
||||||
$retstring .= '<div class="nowrap inline-block divfordateinput">';
|
$retstring .= '<div class="nowraponall inline-block divfordateinput">';
|
||||||
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
||||||
$retstring .= ($disabled ? ' disabled' : '');
|
$retstring .= ($disabled ? ' disabled' : '');
|
||||||
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
||||||
|
|||||||
@ -190,14 +190,10 @@ class FormActions
|
|||||||
|
|
||||||
$num = count($listofactions);
|
$num = count($listofactions);
|
||||||
if ($num || $forceshowtitle) {
|
if ($num || $forceshowtitle) {
|
||||||
if ($typeelement == 'invoice') {
|
if ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') {
|
||||||
$title = $langs->trans('ActionsOnBill');
|
|
||||||
} elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') {
|
|
||||||
$title = $langs->trans('ActionsOnBill');
|
$title = $langs->trans('ActionsOnBill');
|
||||||
} elseif ($typeelement == 'supplier_proposal') {
|
} elseif ($typeelement == 'supplier_proposal') {
|
||||||
$title = $langs->trans('ActionsOnSupplierProposal');
|
$title = $langs->trans('ActionsOnSupplierProposal');
|
||||||
} elseif ($typeelement == 'order') {
|
|
||||||
$title = $langs->trans('ActionsOnOrder');
|
|
||||||
} elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') {
|
} elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') {
|
||||||
$title = $langs->trans('ActionsOnOrder');
|
$title = $langs->trans('ActionsOnOrder');
|
||||||
} elseif ($typeelement == 'shipping') {
|
} elseif ($typeelement == 'shipping') {
|
||||||
|
|||||||
@ -1445,7 +1445,25 @@ class FormFile
|
|||||||
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
if (in_array($modulepart, array('product', 'produit', 'service'))) {
|
||||||
$newmodulepart = 'produit|service';
|
$newmodulepart = 'produit|service';
|
||||||
}
|
}
|
||||||
|
if (image_format_supported($file['name']) > 0) {
|
||||||
|
if ($permtoeditline) {
|
||||||
|
$moreparaminurl = '';
|
||||||
|
if (!empty($object->id) && $object->id > 0) {
|
||||||
|
$moreparaminurl .= '&id='.$object->id;
|
||||||
|
} elseif (GETPOST('website', 'alpha')) {
|
||||||
|
$moreparaminurl .= '&website='.GETPOST('website', 'alpha');
|
||||||
|
}
|
||||||
|
// Set the backtourl
|
||||||
|
if ($modulepart == 'medias' && !GETPOST('website')) {
|
||||||
|
$moreparaminurl .= '&backtourl='.urlencode(DOL_URL_ROOT.'/ecm/index_medias.php?file_manager=1&modulepart='.$modulepart.'§ion_dir='.$relativepath);
|
||||||
|
}
|
||||||
|
if ($modulepart == 'medias' && !GETPOST('website')) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/ecm/index_medias.php?action=confirmconvertimgwebp&token='.newToken().'§ion_dir='.urlencode($relativepath).'&filetoregenerate='.urlencode($fileinfo['basename']).'&module='.$modulepart.$param.$moreparaminurl.'" title="'.dol_escape_htmltag($langs->trans("GenerateChosenImgWebp")).'">'.img_picto('', 'images', 'class="flip marginrightonly"').'</a>';
|
||||||
|
} elseif ($modulepart == 'medias' && GETPOST('website')) {
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/website/index.php?action=confirmconvertimgwebp&token='.newToken().'§ion_dir='.urlencode($relativepath).'&filetoregenerate='.urlencode($fileinfo['basename']).'&module='.$modulepart.$param.$moreparaminurl.'" title="'.dol_escape_htmltag($langs->trans("GenerateChosenImgWebp")).'">'.img_picto('', 'images', 'class="flip marginrightonly"').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!$disablecrop && image_format_supported($file['name']) > 0) {
|
if (!$disablecrop && image_format_supported($file['name']) > 0) {
|
||||||
if ($permtoeditline) {
|
if ($permtoeditline) {
|
||||||
// Link to resize
|
// Link to resize
|
||||||
|
|||||||
@ -98,13 +98,18 @@ class FormMargin
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pv = $line->total_ht;
|
$pv = $line->total_ht;
|
||||||
$pa_ht = ($pv < 0 ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
$pa_ht = (($pv < 0 || ($pv == 0 && in_array($object->element, array('facture', 'facture_fourn')) && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||||
|
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode
|
||||||
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
||||||
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
|
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
|
||||||
|
// We need a compensation relative to $line->situation_percent
|
||||||
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
|
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
|
||||||
} else {
|
} else {
|
||||||
$pa = $line->qty * $pa_ht;
|
$pa = $line->qty * $pa_ht;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$pa = $line->qty * $pa_ht;
|
||||||
|
}
|
||||||
|
|
||||||
// calcul des marges
|
// calcul des marges
|
||||||
if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise
|
if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise
|
||||||
@ -233,8 +238,8 @@ class FormMargin
|
|||||||
print '});</script>';
|
print '});</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<!-- displayMarginInfos() - Show margin table -->' . "\n";
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<!-- Margin table -->' . "\n";
|
|
||||||
|
|
||||||
print '<table class="noborder margintable centpercent" id="margintable">';
|
print '<table class="noborder margintable centpercent" id="margintable">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -1644,11 +1644,21 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
if ($filterobj->id) {
|
if ($filterobj->id) {
|
||||||
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
||||||
}
|
}
|
||||||
|
} elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') {
|
||||||
|
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'";
|
||||||
|
if ($filterobj->id) {
|
||||||
|
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
||||||
|
}
|
||||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
|
} elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') {
|
||||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
|
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
|
||||||
if ($filterobj->id) {
|
if ($filterobj->id) {
|
||||||
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
||||||
}
|
}
|
||||||
|
} elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') {
|
||||||
|
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice'";
|
||||||
|
if ($filterobj->id) {
|
||||||
|
$sql .= " AND a.fk_element = ".((int) $filterobj->id);
|
||||||
|
}
|
||||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
|
} elseif (is_object($filterobj) && get_class($filterobj) == 'Product') {
|
||||||
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
|
$sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
|
||||||
if ($filterobj->id) {
|
if ($filterobj->id) {
|
||||||
|
|||||||
@ -87,11 +87,37 @@ function contract_prepare_head(Contrat $object)
|
|||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Events");
|
$head[$h][1] = $langs->trans("Events");
|
||||||
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
$nbEvent = 0;
|
||||||
|
// Enable caching of thirdparty count actioncomm
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_contract_'.$object->id;
|
||||||
|
$dataretrieved = dol_getcache($cachekey);
|
||||||
|
if (!is_null($dataretrieved)) {
|
||||||
|
$nbEvent = $dataretrieved;
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT COUNT(id) as nb";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE fk_element = ".((int) $object->id);
|
||||||
|
$sql .= " AND elementtype = 'contract'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nbEvent = $obj->nb;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
|
||||||
|
}
|
||||||
|
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||||
|
}
|
||||||
|
|
||||||
$head[$h][1] .= '/';
|
$head[$h][1] .= '/';
|
||||||
$head[$h][1] .= $langs->trans("Agenda");
|
$head[$h][1] .= $langs->trans("Agenda");
|
||||||
|
if ($nbEvent > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$head[$h][2] = 'agenda';
|
$head[$h][2] = 'agenda';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -5413,7 +5413,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
|
|||||||
* @param string $morecss More css to the table
|
* @param string $morecss More css to the table
|
||||||
* @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
|
* @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
|
||||||
* @param int $hideselectlimit Force to hide select limit
|
* @param int $hideselectlimit Force to hide select limit
|
||||||
* @param int $hidenavigation Force to hide all navigation tools
|
* @param int $hidenavigation Force to hide the arrows and page for navigation
|
||||||
* @param int $pagenavastextinput 1=Do not suggest list of pages to navigate but suggest the page number into an input field.
|
* @param int $pagenavastextinput 1=Do not suggest list of pages to navigate but suggest the page number into an input field.
|
||||||
* @param string $morehtmlrightbeforearrow More html to show (before arrows)
|
* @param string $morehtmlrightbeforearrow More html to show (before arrows)
|
||||||
* @return void
|
* @return void
|
||||||
@ -5441,7 +5441,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
|
|||||||
} else {
|
} else {
|
||||||
$nextpage = 0;
|
$nextpage = 0;
|
||||||
}
|
}
|
||||||
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
|
//print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage.'-hideselectlimit='.$hideselectlimit.'-hidenavigation='.$hidenavigation;
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin title -->\n";
|
print "<!-- Begin title -->\n";
|
||||||
@ -5536,8 +5536,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($savlimit || $morehtmlright || $morehtmlrightbeforearrow) && empty($hidenavigation)) {
|
if ($savlimit || $morehtmlright || $morehtmlrightbeforearrow) {
|
||||||
print_fleche_navigation((int) $page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow); // output the div and ul for previous/last completed with page numbers into $pagelist
|
print_fleche_navigation((int) $page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow, $hidenavigation); // output the div and ul for previous/last completed with page numbers into $pagelist
|
||||||
}
|
}
|
||||||
|
|
||||||
// js to autoselect page field on focus
|
// js to autoselect page field on focus
|
||||||
@ -5571,9 +5571,10 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
|
|||||||
* @param int $totalnboflines Total number of records/lines for all pages (if known)
|
* @param int $totalnboflines Total number of records/lines for all pages (if known)
|
||||||
* @param int $hideselectlimit Force to hide select limit
|
* @param int $hideselectlimit Force to hide select limit
|
||||||
* @param string $beforearrows HTML content to show before arrows. Must NOT contains '<li> </li>' tags.
|
* @param string $beforearrows HTML content to show before arrows. Must NOT contains '<li> </li>' tags.
|
||||||
|
* @param int $hidenavigation Force to hide the arrows and page for navigation
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $betweenarrows = '', $afterarrows = '', $limit = -1, $totalnboflines = 0, $hideselectlimit = 0, $beforearrows = '')
|
function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $betweenarrows = '', $afterarrows = '', $limit = -1, $totalnboflines = 0, $hideselectlimit = 0, $beforearrows = '', $hidenavigation = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@ -5583,6 +5584,8 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||||||
print $beforearrows;
|
print $beforearrows;
|
||||||
print '</li>';
|
print '</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($hidenavigation)) {
|
||||||
if ((int) $limit > 0 && empty($hideselectlimit)) {
|
if ((int) $limit > 0 && empty($hideselectlimit)) {
|
||||||
$pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000';
|
$pagesizechoices = '10:10,15:15,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000';
|
||||||
$pagesizechoices .= ',5000:5000,10000:10000,20000:20000';
|
$pagesizechoices .= ',5000:5000,10000:10000,20000:20000';
|
||||||
@ -5647,6 +5650,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||||||
print $afterarrows;
|
print $afterarrows;
|
||||||
print '</li>';
|
print '</li>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print '</ul></div>'."\n";
|
print '</ul></div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8985,7 +8989,7 @@ function verifCond($strToEvaluate)
|
|||||||
* @param string $s String to evaluate
|
* @param string $s String to evaluate
|
||||||
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
||||||
* @param int $hideerrors 1=Hide errors
|
* @param int $hideerrors 1=Hide errors
|
||||||
* @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (not used)=Accept also ';[]'
|
* @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]'
|
||||||
* @return mixed Nothing or return result of eval
|
* @return mixed Nothing or return result of eval
|
||||||
*/
|
*/
|
||||||
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
||||||
@ -9021,15 +9025,21 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||||||
}
|
}
|
||||||
} elseif ($onlysimplestring == '2') {
|
} elseif ($onlysimplestring == '2') {
|
||||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||||
} else {
|
} else {
|
||||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
// TODO
|
||||||
|
// We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled('
|
||||||
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_array($s) || $s === 'Array') {
|
||||||
|
return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true);
|
||||||
|
}
|
||||||
if (strpos($s, '::') !== false) {
|
if (strpos($s, '::') !== false) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
||||||
@ -12310,25 +12320,28 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
$out .= '</div>';
|
$out .= '</div>';
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
|
$libelle = '';
|
||||||
$out .= ' <div class="messaging-title inline-block">';
|
$out .= ' <div class="messaging-title inline-block">';
|
||||||
|
|
||||||
if (preg_match('/^TICKET_MSG/', $actionstatic->code)) {
|
if (preg_match('/^TICKET_MSG/', $actionstatic->code)) {
|
||||||
$out .= $langs->trans('TicketNewMessage');
|
$out .= $langs->trans('TicketNewMessage');
|
||||||
} elseif (preg_match('/^TICKET_MSG_PRIVATE/', $actionstatic->code)) {
|
} elseif (preg_match('/^TICKET_MSG_PRIVATE/', $actionstatic->code)) {
|
||||||
$out .= $langs->trans('TicketNewMessage').' <em>('.$langs->trans('Private').')</em>';
|
$out .= $langs->trans('TicketNewMessage').' <em>('.$langs->trans('Private').')</em>';
|
||||||
} else {
|
} elseif (isset($histo[$key]['type'])) {
|
||||||
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') {
|
if ($histo[$key]['type'] == 'action') {
|
||||||
$transcode = $langs->trans("Action".$histo[$key]['acode']);
|
$transcode = $langs->transnoentitiesnoconv("Action".$histo[$key]['acode']);
|
||||||
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
|
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']);
|
||||||
$libelle = $histo[$key]['note'];
|
$libelle = $histo[$key]['note'];
|
||||||
$actionstatic->id = $histo[$key]['id'];
|
$actionstatic->id = $histo[$key]['id'];
|
||||||
$out .= dol_trunc($libelle, 120);
|
$out .= dol_escape_htmltag(dol_trunc($libelle, 120));
|
||||||
}
|
} elseif ($histo[$key]['type'] == 'mailing') {
|
||||||
if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') {
|
|
||||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
|
$out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
|
||||||
$transcode = $langs->trans("Action".$histo[$key]['acode']);
|
$transcode = $langs->transnoentitiesnoconv("Action".$histo[$key]['acode']);
|
||||||
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
|
$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing');
|
||||||
$out .= dol_trunc($libelle, 120);
|
$out .= dol_escape_htmltag(dol_trunc($libelle, 120));
|
||||||
|
} else {
|
||||||
|
$libelle .= $histo[$key]['note'];
|
||||||
|
$out .= dol_escape_htmltag(dol_trunc($libelle, 120));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12336,7 +12349,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
|||||||
|
|
||||||
$out .= '</h3>';
|
$out .= '</h3>';
|
||||||
|
|
||||||
if (!empty($histo[$key]['message'])
|
if (!empty($histo[$key]['message'] && $histo[$key]['message'] != $libelle)
|
||||||
&& $actionstatic->code != 'AC_TICKET_CREATE'
|
&& $actionstatic->code != 'AC_TICKET_CREATE'
|
||||||
&& $actionstatic->code != 'AC_TICKET_MODIFY'
|
&& $actionstatic->code != 'AC_TICKET_MODIFY'
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -35,19 +35,19 @@
|
|||||||
*/
|
*/
|
||||||
function facture_prepare_head($object)
|
function facture_prepare_head($object)
|
||||||
{
|
{
|
||||||
global $db, $langs, $conf;
|
global $db, $langs, $conf, $user;
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('CustomerInvoice');
|
$head[$h][1] = $langs->trans('CustomerInvoice');
|
||||||
$head[$h][2] = 'compta';
|
$head[$h][2] = 'compta';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
|
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
|
||||||
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
|
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.urlencode($object->id);
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?id='.urlencode($object->id);
|
||||||
$head[$h][1] = $langs->trans('ContactsAddresses');
|
$head[$h][1] = $langs->trans('ContactsAddresses');
|
||||||
if ($nbContact > 0) {
|
if ($nbContact > 0) {
|
||||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
|
||||||
@ -73,7 +73,7 @@ function facture_prepare_head($object)
|
|||||||
}
|
}
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.urlencode($object->id);
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?id='.urlencode($object->id);
|
||||||
$head[$h][1] = $langs->trans('StandingOrders');
|
$head[$h][1] = $langs->trans('StandingOrders');
|
||||||
if ($nbStandingOrders > 0) {
|
if ($nbStandingOrders > 0) {
|
||||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbStandingOrders.'</span>';
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbStandingOrders.'</span>';
|
||||||
@ -96,7 +96,7 @@ function facture_prepare_head($object)
|
|||||||
if (!empty($object->note_public)) {
|
if (!empty($object->note_public)) {
|
||||||
$nbNote++;
|
$nbNote++;
|
||||||
}
|
}
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('Notes');
|
$head[$h][1] = $langs->trans('Notes');
|
||||||
if ($nbNote > 0) {
|
if ($nbNote > 0) {
|
||||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||||
@ -110,7 +110,7 @@ function facture_prepare_head($object)
|
|||||||
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('Documents');
|
$head[$h][1] = $langs->trans('Documents');
|
||||||
if (($nbFiles + $nbLinks) > 0) {
|
if (($nbFiles + $nbLinks) > 0) {
|
||||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||||
@ -118,9 +118,38 @@ function facture_prepare_head($object)
|
|||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('Info');
|
$head[$h][1] = $langs->trans("Events");
|
||||||
$head[$h][2] = 'info';
|
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
$nbEvent = 0;
|
||||||
|
// Enable caching of thirdparty count actioncomm
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_facture_'.$object->id;
|
||||||
|
$dataretrieved = dol_getcache($cachekey);
|
||||||
|
if (!is_null($dataretrieved)) {
|
||||||
|
$nbEvent = $dataretrieved;
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT COUNT(id) as nb";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE fk_element = ".((int) $object->id);
|
||||||
|
$sql .= " AND elementtype = 'invoice'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nbEvent = $obj->nb;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
|
||||||
|
}
|
||||||
|
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||||
|
}
|
||||||
|
|
||||||
|
$head[$h][1] .= '/';
|
||||||
|
$head[$h][1] .= $langs->trans("Agenda");
|
||||||
|
if ($nbEvent > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$head[$h][2] = 'agenda';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external');
|
||||||
|
|||||||
@ -126,16 +126,38 @@ function member_prepare_head(Adherent $object)
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
// Show agenda tab
|
// Show agenda tab
|
||||||
if (isModEnabled('agenda')) {
|
$head[$h][0] = DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id;
|
||||||
$head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id;
|
|
||||||
$head[$h][1] = $langs->trans("Events");
|
$head[$h][1] = $langs->trans("Events");
|
||||||
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
$nbEvent = 0;
|
||||||
|
// Enable caching of thirdparty count actioncomm
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_member_'.$object->id;
|
||||||
|
$dataretrieved = dol_getcache($cachekey);
|
||||||
|
if (!is_null($dataretrieved)) {
|
||||||
|
$nbEvent = $dataretrieved;
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT COUNT(id) as nb";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE elementtype = 'member' AND fk_element = ".((int) $object->id);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nbEvent = $obj->nb;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
|
||||||
|
}
|
||||||
|
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||||
|
}
|
||||||
|
|
||||||
$head[$h][1] .= '/';
|
$head[$h][1] .= '/';
|
||||||
$head[$h][1] .= $langs->trans("Agenda");
|
$head[$h][1] .= $langs->trans("Agenda");
|
||||||
|
if ($nbEvent > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$head[$h][2] = 'agenda';
|
$head[$h][2] = 'agenda';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'external');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'external');
|
||||||
|
|
||||||
|
|||||||
@ -419,6 +419,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list of existing objects from directory
|
* Get list of existing objects from directory
|
||||||
|
*
|
||||||
* @param string $destdir Directory
|
* @param string $destdir Directory
|
||||||
* @return Array|int <=0 if KO, array if OK
|
* @return Array|int <=0 if KO, array if OK
|
||||||
*/
|
*/
|
||||||
@ -446,4 +447,84 @@ function dolGetListOfObjectClasses($destdir)
|
|||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete all permissions
|
||||||
|
*
|
||||||
|
* @param string $file file with path
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function deletePerms($file)
|
||||||
|
{
|
||||||
|
$start = "/* BEGIN MODULEBUILDER PERMISSIONS */";
|
||||||
|
$end = "/* END MODULEBUILDER PERMISSIONS */";
|
||||||
|
$i = 1;
|
||||||
|
$array = array();
|
||||||
|
$lines = file($file);
|
||||||
|
// Search for start and end lines
|
||||||
|
foreach ($lines as $i => $line) {
|
||||||
|
if (strpos($line, $start) !== false) {
|
||||||
|
$start_line = $i + 1;
|
||||||
|
|
||||||
|
// Copy lines until the end on array
|
||||||
|
while (($line = $lines[++$i]) !== false) {
|
||||||
|
if (strpos($line, $end) !== false) {
|
||||||
|
$end_line = $i + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$array[] = $line;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$allContent = implode("", $array);
|
||||||
|
dolReplaceInFile($file, array($allContent => ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewriting all permissions after any actions
|
||||||
|
* @param string $file filename or path
|
||||||
|
* @param array $permissions permissions existing in file
|
||||||
|
* @param int|null $key key for permission needed
|
||||||
|
* @param array|null $right $right to update or add
|
||||||
|
* @param int $action 0 for delete, 1 for add, 2 for update
|
||||||
|
* @return int 1 if OK,-1 if KO
|
||||||
|
*/
|
||||||
|
function reWriteAllPermissions($file, $permissions, $key, $right, $action)
|
||||||
|
{
|
||||||
|
$error = 0;
|
||||||
|
$rights = array();
|
||||||
|
if ($action == 0) {
|
||||||
|
// delete right from permissions array
|
||||||
|
array_splice($permissions, array_search($permissions[$key], $permissions), 1);
|
||||||
|
} elseif ($action == 1) {
|
||||||
|
array_push($permissions, $right);
|
||||||
|
} elseif ($action == 2 && !empty($right)) {
|
||||||
|
// update right from permissions array
|
||||||
|
array_splice($permissions, array_search($permissions[$key], $permissions), 1, $right);
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (!$error) {
|
||||||
|
// prepare permissions array
|
||||||
|
$count_perms = count($permissions);
|
||||||
|
for ($i = 0;$i<$count_perms;$i++) {
|
||||||
|
$permissions[$i][0] = "\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1)";
|
||||||
|
$permissions[$i][1] = "\$this->rights[\$r][1] = '".$permissions[$i][1]."'";
|
||||||
|
$permissions[$i][4] = "\$this->rights[\$r][4] = '".$permissions[$i][4]."'";
|
||||||
|
$permissions[$i][5] = "\$this->rights[\$r][5] = '".$permissions[$i][5]."';\n\t\t";
|
||||||
|
}
|
||||||
|
|
||||||
|
//convert to string
|
||||||
|
foreach ($permissions as $perms) {
|
||||||
|
$rights[] = implode(";\n\t\t", $perms);
|
||||||
|
$rights[] = "\$r++;\n\t\t";
|
||||||
|
}
|
||||||
|
$rights_str = implode("", $rights);
|
||||||
|
// delete all permission from file
|
||||||
|
deletePerms($file);
|
||||||
|
// rewrite all permission again
|
||||||
|
dolReplaceInFile($file, array('/* BEGIN MODULEBUILDER PERMISSIONS */' => '/* BEGIN MODULEBUILDER PERMISSIONS */'."\n\t\t".$rights_str));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,9 +128,39 @@ function commande_prepare_head(Commande $object)
|
|||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$object->id;
|
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][0] = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id;
|
||||||
$head[$h][2] = 'info';
|
$head[$h][1] = $langs->trans("Events");
|
||||||
|
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
|
$nbEvent = 0;
|
||||||
|
// Enable caching of thirdparty count actioncomm
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
|
$cachekey = 'count_events_propal_'.$object->id;
|
||||||
|
$dataretrieved = dol_getcache($cachekey);
|
||||||
|
if (!is_null($dataretrieved)) {
|
||||||
|
$nbEvent = $dataretrieved;
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT COUNT(id) as nb";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
|
||||||
|
$sql .= " WHERE fk_element = ".((int) $object->id);
|
||||||
|
$sql .= " AND elementtype = 'order'";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$nbEvent = $obj->nb;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
|
||||||
|
}
|
||||||
|
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
|
||||||
|
}
|
||||||
|
|
||||||
|
$head[$h][1] .= '/';
|
||||||
|
$head[$h][1] .= $langs->trans("Agenda");
|
||||||
|
if ($nbEvent > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$head[$h][2] = 'agenda';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external');
|
||||||
|
|||||||
@ -113,10 +113,11 @@ function dolGetRandomBytes($length)
|
|||||||
* @param string $chain string to encode
|
* @param string $chain string to encode
|
||||||
* @param string $key If '', we use $dolibarr_main_instance_unique_id
|
* @param string $key If '', we use $dolibarr_main_instance_unique_id
|
||||||
* @param string $ciphering Default ciphering algorithm
|
* @param string $ciphering Default ciphering algorithm
|
||||||
|
* @param string $forceseed To force the seed
|
||||||
* @return string encoded string
|
* @return string encoded string
|
||||||
* @see dolDecrypt(), dol_hash()
|
* @see dolDecrypt(), dol_hash()
|
||||||
*/
|
*/
|
||||||
function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = '')
|
||||||
{
|
{
|
||||||
global $dolibarr_main_instance_unique_id;
|
global $dolibarr_main_instance_unique_id;
|
||||||
global $dolibarr_disable_dolcrypt_for_debug;
|
global $dolibarr_disable_dolcrypt_for_debug;
|
||||||
@ -134,6 +135,9 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
|||||||
if (empty($key)) {
|
if (empty($key)) {
|
||||||
$key = $dolibarr_main_instance_unique_id;
|
$key = $dolibarr_main_instance_unique_id;
|
||||||
}
|
}
|
||||||
|
if (empty($ciphering)) {
|
||||||
|
$ciphering = 'AES-256-CTR';
|
||||||
|
}
|
||||||
|
|
||||||
$newchain = $chain;
|
$newchain = $chain;
|
||||||
|
|
||||||
@ -145,7 +149,11 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
|||||||
if ($ivlen === false || $ivlen < 1 || $ivlen > 32) {
|
if ($ivlen === false || $ivlen < 1 || $ivlen > 32) {
|
||||||
$ivlen = 16;
|
$ivlen = 16;
|
||||||
}
|
}
|
||||||
|
if (empty($forceseed)) {
|
||||||
$ivseed = dolGetRandomBytes($ivlen);
|
$ivseed = dolGetRandomBytes($ivlen);
|
||||||
|
} else {
|
||||||
|
$ivseed = dol_trunc(md5($forceseed), $ivlen, 'right', 'UTF-8', 1);
|
||||||
|
}
|
||||||
|
|
||||||
$newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed);
|
$newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed);
|
||||||
return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain;
|
return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain;
|
||||||
|
|||||||
@ -581,6 +581,9 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token
|
|||||||
token: \''.dol_escape_js(newToken()).'\'
|
token: \''.dol_escape_js(newToken()).'\'
|
||||||
},
|
},
|
||||||
function(result) {
|
function(result) {
|
||||||
|
if ($("input#'.dol_escape_js($htmlname).'").attr("type") == "password") {
|
||||||
|
$("input#'.dol_escape_js($htmlname).'").attr("type", "text");
|
||||||
|
}
|
||||||
$("#'.dol_escape_js($htmlname).'").val(result);
|
$("#'.dol_escape_js($htmlname).'").val(result);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -248,10 +248,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
public $export_icon;
|
public $export_icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array export enabled
|
||||||
|
*/
|
||||||
|
public $export_enabled;
|
||||||
public $export_permission;
|
public $export_permission;
|
||||||
public $export_fields_array;
|
public $export_fields_array;
|
||||||
public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
|
public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
|
||||||
public $export_entities_array;
|
public $export_entities_array;
|
||||||
|
public $export_examplevalues_array;
|
||||||
public $export_help_array;
|
public $export_help_array;
|
||||||
public $export_special_array; // special or computed field
|
public $export_special_array; // special or computed field
|
||||||
public $export_dependencies_array;
|
public $export_dependencies_array;
|
||||||
@ -273,9 +278,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
public $import_label;
|
public $import_label;
|
||||||
|
|
||||||
public $import_icon;
|
public $import_icon;
|
||||||
|
|
||||||
public $import_entities_array;
|
public $import_entities_array;
|
||||||
public $import_tables_array;
|
public $import_tables_array;
|
||||||
|
public $import_tables_creator_array;
|
||||||
public $import_fields_array;
|
public $import_fields_array;
|
||||||
public $import_fieldshidden_array;
|
public $import_fieldshidden_array;
|
||||||
public $import_convertvalue_array;
|
public $import_convertvalue_array;
|
||||||
|
|||||||
@ -142,16 +142,16 @@ class modCategorie extends DolibarrModules
|
|||||||
if (isModEnabled("societe")) {
|
if (isModEnabled("societe")) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."4=Contact";
|
$typeexample .= ($typeexample ? " / " : "")."4=Contact";
|
||||||
}
|
}
|
||||||
if (!empty($conf->bank->enabled)) {
|
if (isModEnabled('bank')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
|
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
|
||||||
}
|
}
|
||||||
if (isModEnabled('project')) {
|
if (isModEnabled('project')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."6=Project";
|
$typeexample .= ($typeexample ? " / " : "")."6=Project";
|
||||||
}
|
}
|
||||||
if (!empty($conf->user->enabled)) {
|
if (isModEnabled('user')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."7=User";
|
$typeexample .= ($typeexample ? " / " : "")."7=User";
|
||||||
}
|
}
|
||||||
if (!empty($conf->bank->enabled)) {
|
if (isModEnabled('bank')) {
|
||||||
$typeexample .= ($typeexample ? " / " : "")."8=Bank line";
|
$typeexample .= ($typeexample ? " / " : "")."8=Bank line";
|
||||||
}
|
}
|
||||||
if (isModEnabled('stock')) {
|
if (isModEnabled('stock')) {
|
||||||
@ -411,7 +411,7 @@ class modCategorie extends DolibarrModules
|
|||||||
$this->export_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
$this->export_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
||||||
$this->export_label[$r] = 'CatUsersList';
|
$this->export_label[$r] = 'CatUsersList';
|
||||||
$this->export_icon[$r] = $this->picto;
|
$this->export_icon[$r] = $this->picto;
|
||||||
$this->export_enabled[$r] = '!empty($conf->user->enabled)';
|
$this->export_enabled[$r] = 'isModEnabled("user")';
|
||||||
$this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export"));
|
$this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export"));
|
||||||
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname');
|
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname');
|
||||||
$this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
|
$this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
|
||||||
@ -594,7 +594,7 @@ class modCategorie extends DolibarrModules
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 7 Users
|
// 7 Users
|
||||||
if (!empty($conf->user->enabled)) {
|
if (isModEnabled('user')) {
|
||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
$this->import_code[$r] = $this->rights_class.'_7_'.Categorie::$MAP_ID_TO_CODE[7];
|
||||||
$this->import_label[$r] = "CatUsersLinks"; // Translation key
|
$this->import_label[$r] = "CatUsersLinks"; // Translation key
|
||||||
|
|||||||
@ -158,8 +158,6 @@ class modLoan extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$result = $this->_load_tables('/install/mysql/', 'loan');
|
$result = $this->_load_tables('/install/mysql/', 'loan');
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||||
|
|||||||
@ -269,11 +269,16 @@ class modTakePos extends DolibarrModules
|
|||||||
|
|
||||||
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$sql = array();
|
$result = $this->_load_tables('/install/mysql/', 'takepos');
|
||||||
|
if ($result < 0) {
|
||||||
|
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||||
|
}
|
||||||
|
|
||||||
// Remove permissions and default values
|
// Clean before activation
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|
||||||
|
$sql = array();
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -359,8 +359,6 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
// [!-- BEGIN lines --]*[!-- END lines --]
|
// [!-- BEGIN lines --]*[!-- END lines --]
|
||||||
//print html_entity_decode($odfHandler->__toString());
|
//print html_entity_decode($odfHandler->__toString());
|
||||||
//print exit;
|
//print exit;
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
// Make substitutions into odt of freetext
|
// Make substitutions into odt of freetext
|
||||||
try {
|
try {
|
||||||
@ -461,7 +459,7 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||||||
|
|
||||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
|
||||||
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
*/
|
|
||||||
// Write new file
|
// Write new file
|
||||||
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -203,7 +203,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
|||||||
<!-- Always editable -->
|
<!-- Always editable -->
|
||||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
||||||
<!-- Visibility -->
|
<!-- Visibility -->
|
||||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
|
||||||
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
|
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
|
||||||
<!-- Visibility for PDF-->
|
<!-- Visibility for PDF-->
|
||||||
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
|
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
|
||||||
|
|||||||
@ -289,7 +289,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
|
|||||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
||||||
|
|
||||||
<!-- Visibility -->
|
<!-- Visibility -->
|
||||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
|
||||||
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
|
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr>
|
||||||
|
|
||||||
<!-- Visibility for PDF-->
|
<!-- Visibility for PDF-->
|
||||||
|
|||||||
@ -73,7 +73,7 @@ print '<td>'.$langs->trans("ComputedFormula").'</td>';
|
|||||||
print '<td class="center">'.$langs->trans("Unique").'</td>';
|
print '<td class="center">'.$langs->trans("Unique").'</td>';
|
||||||
print '<td class="center">'.$langs->trans("Mandatory").'</td>';
|
print '<td class="center">'.$langs->trans("Mandatory").'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
|
||||||
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).'</td>';
|
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).'</td>';
|
||||||
|
|||||||
@ -197,18 +197,22 @@ if ($action == 'confirmconvertimgwebp') {
|
|||||||
|
|
||||||
$section_dir=GETPOST('section_dir', 'alpha');
|
$section_dir=GETPOST('section_dir', 'alpha');
|
||||||
$section=GETPOST('section', 'alpha');
|
$section=GETPOST('section', 'alpha');
|
||||||
|
$file=GETPOST('filetoregenerate', 'alpha');
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
|
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
|
||||||
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
|
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
|
||||||
|
$formquestion['filetoregenerate']=array('type'=>'hidden', 'value'=>$file, 'name'=>'filetoregenerate');
|
||||||
if ($module == 'medias') {
|
if ($module == 'medias') {
|
||||||
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
|
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
|
||||||
}
|
}
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', $formquestion, "yes", 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], empty($file) ? $langs->trans('ConfirmImgWebpCreation') : $langs->trans('ConfirmChosenImgWebpCreation'), empty($file) ? $langs->trans('ConfirmGenerateImgWebp') : $langs->trans('ConfirmGenerateChosenImgWebp'), 'convertimgwebp', $formquestion, "yes", 1);
|
||||||
$action = 'file_manager';
|
$action = 'file_manager';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duplicate images into .webp
|
// Duplicate images into .webp
|
||||||
if ($action == 'convertimgwebp' && $permtoadd) {
|
if ($action == 'convertimgwebp' && $permtoadd) {
|
||||||
|
$file = GETPOST('filetoregenerate', 'alpha');
|
||||||
|
|
||||||
if ($module == 'medias') {
|
if ($module == 'medias') {
|
||||||
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.dol_sanitizePathName(GETPOST('section_dir', 'alpha'));
|
$imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.dol_sanitizePathName(GETPOST('section_dir', 'alpha'));
|
||||||
} else {
|
} else {
|
||||||
@ -217,9 +221,14 @@ if ($action == 'convertimgwebp' && $permtoadd) {
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
|
||||||
|
if (!empty($file)) {
|
||||||
|
$filelist = array();
|
||||||
|
$filelist[]["fullname"] = dol_osencode($imagefolder.'/'.$file); // get $imagefolder.'/'.$file infos
|
||||||
|
} else {
|
||||||
$regeximgext = getListOfPossibleImageExt();
|
$regeximgext = getListOfPossibleImageExt();
|
||||||
|
|
||||||
$filelist = dol_dir_list($imagefolder, "files", 0, $regeximgext);
|
$filelist = dol_dir_list($imagefolder, "files", 0, $regeximgext);
|
||||||
|
}
|
||||||
|
|
||||||
$nbconverted = 0;
|
$nbconverted = 0;
|
||||||
|
|
||||||
@ -245,8 +254,12 @@ if ($action == 'convertimgwebp' && $permtoadd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
if (!empty($file)) {
|
||||||
|
setEventMessages($langs->trans('SucessConvertChosenImgWebp'), null);
|
||||||
|
} else {
|
||||||
setEventMessages($langs->trans('SucessConvertImgWebp'), null);
|
setEventMessages($langs->trans('SucessConvertImgWebp'), null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$action = 'file_manager';
|
$action = 'file_manager';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ if ($nolinesbefore) {
|
|||||||
<?php if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { ?>
|
<?php if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { ?>
|
||||||
<td class="linecoluht_currency right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td>
|
<td class="linecoluht_currency right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if (!empty($inputalsopricewithtax)) { ?>
|
<?php if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) { ?>
|
||||||
<td class="linecoluttc right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
|
<td class="linecoluttc right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td>
|
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td>
|
||||||
|
|||||||
@ -102,8 +102,14 @@ $(document).ready(function () {
|
|||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="login_center center"<?php
|
||||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
|
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||||
|
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||||
|
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||||
|
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||||
|
}
|
||||||
|
?>>
|
||||||
<div class="login_vertical_align">
|
<div class="login_vertical_align">
|
||||||
|
|
||||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||||
|
|||||||
@ -134,7 +134,14 @@ $(document).ready(function () {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
<div class="login_center center"<?php
|
||||||
|
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
|
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||||
|
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||||
|
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||||
|
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||||
|
}
|
||||||
|
?>>
|
||||||
<div class="login_vertical_align">
|
<div class="login_vertical_align">
|
||||||
|
|
||||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||||
|
|||||||
@ -524,7 +524,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
|
|
||||||
|
|||||||
@ -274,7 +274,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (!empty($confOrBooth->id)) {
|
if (!empty($confOrBooth->id)) {
|
||||||
|
|||||||
@ -1840,7 +1840,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setdate_livraison">';
|
print '<input type="hidden" name="action" value="setdate_livraison">';
|
||||||
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
|
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' ';
|
print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' ';
|
||||||
@ -1858,10 +1858,10 @@ if ($action == 'create') {
|
|||||||
print '<input name="action" value="settrueWeight" type="hidden">';
|
print '<input name="action" value="settrueWeight" type="hidden">';
|
||||||
print '<input name="id" value="'.$object->id.'" type="hidden">';
|
print '<input name="id" value="'.$object->id.'" type="hidden">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50">';
|
print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50 valignmiddle">';
|
||||||
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
|
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2, 'maxwidth125 valignmiddle');
|
||||||
print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
||||||
print ' <input class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->trueWeight;
|
print $object->trueWeight;
|
||||||
@ -1895,8 +1895,8 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text" class="width50">';
|
print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text" class="width50">';
|
||||||
print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units, 0, 2);
|
print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units, 0, 2);
|
||||||
print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
print ' <input class="button smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
|
||||||
print ' <input class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
print ' <input class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->trueHeight;
|
print $object->trueHeight;
|
||||||
@ -1975,7 +1975,7 @@ if ($action == 'create') {
|
|||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
}
|
}
|
||||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
if ($object->shipping_method_id > 0) {
|
if ($object->shipping_method_id > 0) {
|
||||||
|
|||||||
@ -4051,8 +4051,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($result > 0) {
|
if ($resql) {
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -4061,7 +4061,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
global $user;
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('LINEORDER_SUPPLIER_MODIFY', $user);
|
$result = $this->call_trigger('LINEORDER_SUPPLIER_MODIFY', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|||||||
@ -278,7 +278,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn_rec as f';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn_rec as f';
|
||||||
|
|||||||
@ -431,7 +431,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -309,7 +309,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|||||||
@ -231,7 +231,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -226,7 +226,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -363,7 +363,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
@ -906,7 +906,7 @@ function DisplayPositionList()
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
|
$sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -232,7 +232,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t LEFT JOIN ".MAIN_DB_PREFIX.$userstatic->table_element." as u on t.fk_user = u.rowid, ".MAIN_DB_PREFIX."hrm_job as j";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t LEFT JOIN ".MAIN_DB_PREFIX.$userstatic->table_element." as u on t.fk_user = u.rowid, ".MAIN_DB_PREFIX."hrm_job as j";
|
||||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
|
|||||||
@ -235,7 +235,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
//$sql .= ", COUNT(rc.rowid) as anotherfield";
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
@ -279,255 +279,255 @@ INSERT INTO llx_c_country (rowid, code, code_iso, label, active, favorite) VALUE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = "AFG";
|
UPDATE llx_c_country SET numeric_code = '004' WHERE code_iso = 'AFG';
|
||||||
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = "ALA";
|
UPDATE llx_c_country SET numeric_code = '248' WHERE code_iso = 'ALA';
|
||||||
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = "ALB";
|
UPDATE llx_c_country SET numeric_code = '008' WHERE code_iso = 'ALB';
|
||||||
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = "DEU";
|
UPDATE llx_c_country SET numeric_code = '276' WHERE code_iso = 'DEU';
|
||||||
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = "AND";
|
UPDATE llx_c_country SET numeric_code = '020' WHERE code_iso = 'AND';
|
||||||
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = "AGO";
|
UPDATE llx_c_country SET numeric_code = '024' WHERE code_iso = 'AGO';
|
||||||
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = "AIA";
|
UPDATE llx_c_country SET numeric_code = '660' WHERE code_iso = 'AIA';
|
||||||
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = "ATA";
|
UPDATE llx_c_country SET numeric_code = '010' WHERE code_iso = 'ATA';
|
||||||
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = "ATG";
|
UPDATE llx_c_country SET numeric_code = '028' WHERE code_iso = 'ATG';
|
||||||
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = "SAU";
|
UPDATE llx_c_country SET numeric_code = '682' WHERE code_iso = 'SAU';
|
||||||
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = "DZA";
|
UPDATE llx_c_country SET numeric_code = '012' WHERE code_iso = 'DZA';
|
||||||
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = "ARG";
|
UPDATE llx_c_country SET numeric_code = '032' WHERE code_iso = 'ARG';
|
||||||
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = "ARM";
|
UPDATE llx_c_country SET numeric_code = '051' WHERE code_iso = 'ARM';
|
||||||
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = "ABW";
|
UPDATE llx_c_country SET numeric_code = '533' WHERE code_iso = 'ABW';
|
||||||
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = "AUS";
|
UPDATE llx_c_country SET numeric_code = '036' WHERE code_iso = 'AUS';
|
||||||
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = "AUT";
|
UPDATE llx_c_country SET numeric_code = '040' WHERE code_iso = 'AUT';
|
||||||
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = "AZE";
|
UPDATE llx_c_country SET numeric_code = '031' WHERE code_iso = 'AZE';
|
||||||
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = "BHS";
|
UPDATE llx_c_country SET numeric_code = '044' WHERE code_iso = 'BHS';
|
||||||
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = "BGD";
|
UPDATE llx_c_country SET numeric_code = '050' WHERE code_iso = 'BGD';
|
||||||
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = "BRB";
|
UPDATE llx_c_country SET numeric_code = '052' WHERE code_iso = 'BRB';
|
||||||
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = "BHR";
|
UPDATE llx_c_country SET numeric_code = '048' WHERE code_iso = 'BHR';
|
||||||
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = "BEL";
|
UPDATE llx_c_country SET numeric_code = '056' WHERE code_iso = 'BEL';
|
||||||
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = "BLZ";
|
UPDATE llx_c_country SET numeric_code = '084' WHERE code_iso = 'BLZ';
|
||||||
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = "BEN";
|
UPDATE llx_c_country SET numeric_code = '204' WHERE code_iso = 'BEN';
|
||||||
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = "BMU";
|
UPDATE llx_c_country SET numeric_code = '060' WHERE code_iso = 'BMU';
|
||||||
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = "BLR";
|
UPDATE llx_c_country SET numeric_code = '112' WHERE code_iso = 'BLR';
|
||||||
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = "BOL";
|
UPDATE llx_c_country SET numeric_code = '068' WHERE code_iso = 'BOL';
|
||||||
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = "BES";
|
UPDATE llx_c_country SET numeric_code = '535' WHERE code_iso = 'BES';
|
||||||
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = "BIH";
|
UPDATE llx_c_country SET numeric_code = '070' WHERE code_iso = 'BIH';
|
||||||
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = "BWA";
|
UPDATE llx_c_country SET numeric_code = '072' WHERE code_iso = 'BWA';
|
||||||
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = "BRA";
|
UPDATE llx_c_country SET numeric_code = '076' WHERE code_iso = 'BRA';
|
||||||
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = "BRN";
|
UPDATE llx_c_country SET numeric_code = '096' WHERE code_iso = 'BRN';
|
||||||
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = "BGR";
|
UPDATE llx_c_country SET numeric_code = '100' WHERE code_iso = 'BGR';
|
||||||
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = "BFA";
|
UPDATE llx_c_country SET numeric_code = '854' WHERE code_iso = 'BFA';
|
||||||
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = "BDI";
|
UPDATE llx_c_country SET numeric_code = '108' WHERE code_iso = 'BDI';
|
||||||
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = "BTN";
|
UPDATE llx_c_country SET numeric_code = '064' WHERE code_iso = 'BTN';
|
||||||
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = "CPV";
|
UPDATE llx_c_country SET numeric_code = '132' WHERE code_iso = 'CPV';
|
||||||
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = "KHM";
|
UPDATE llx_c_country SET numeric_code = '116' WHERE code_iso = 'KHM';
|
||||||
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = "CMR";
|
UPDATE llx_c_country SET numeric_code = '120' WHERE code_iso = 'CMR';
|
||||||
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = "CAN";
|
UPDATE llx_c_country SET numeric_code = '124' WHERE code_iso = 'CAN';
|
||||||
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = "QAT";
|
UPDATE llx_c_country SET numeric_code = '634' WHERE code_iso = 'QAT';
|
||||||
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = "TCD";
|
UPDATE llx_c_country SET numeric_code = '148' WHERE code_iso = 'TCD';
|
||||||
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = "CHL";
|
UPDATE llx_c_country SET numeric_code = '152' WHERE code_iso = 'CHL';
|
||||||
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = "CHN";
|
UPDATE llx_c_country SET numeric_code = '156' WHERE code_iso = 'CHN';
|
||||||
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = "CYP";
|
UPDATE llx_c_country SET numeric_code = '196' WHERE code_iso = 'CYP';
|
||||||
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = "COL";
|
UPDATE llx_c_country SET numeric_code = '170' WHERE code_iso = 'COL';
|
||||||
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = "COM";
|
UPDATE llx_c_country SET numeric_code = '174' WHERE code_iso = 'COM';
|
||||||
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = "PRK";
|
UPDATE llx_c_country SET numeric_code = '408' WHERE code_iso = 'PRK';
|
||||||
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = "KOR";
|
UPDATE llx_c_country SET numeric_code = '410' WHERE code_iso = 'KOR';
|
||||||
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = "CIV";
|
UPDATE llx_c_country SET numeric_code = '384' WHERE code_iso = 'CIV';
|
||||||
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = "CRI";
|
UPDATE llx_c_country SET numeric_code = '188' WHERE code_iso = 'CRI';
|
||||||
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = "HRV";
|
UPDATE llx_c_country SET numeric_code = '191' WHERE code_iso = 'HRV';
|
||||||
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = "CUB";
|
UPDATE llx_c_country SET numeric_code = '192' WHERE code_iso = 'CUB';
|
||||||
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = "CUW";
|
UPDATE llx_c_country SET numeric_code = '531' WHERE code_iso = 'CUW';
|
||||||
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = "DNK";
|
UPDATE llx_c_country SET numeric_code = '208' WHERE code_iso = 'DNK';
|
||||||
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = "DMA";
|
UPDATE llx_c_country SET numeric_code = '212' WHERE code_iso = 'DMA';
|
||||||
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = "ECU";
|
UPDATE llx_c_country SET numeric_code = '218' WHERE code_iso = 'ECU';
|
||||||
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = "EGY";
|
UPDATE llx_c_country SET numeric_code = '818' WHERE code_iso = 'EGY';
|
||||||
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = "SLV";
|
UPDATE llx_c_country SET numeric_code = '222' WHERE code_iso = 'SLV';
|
||||||
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = "ARE";
|
UPDATE llx_c_country SET numeric_code = '784' WHERE code_iso = 'ARE';
|
||||||
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = "ERI";
|
UPDATE llx_c_country SET numeric_code = '232' WHERE code_iso = 'ERI';
|
||||||
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = "SVK";
|
UPDATE llx_c_country SET numeric_code = '703' WHERE code_iso = 'SVK';
|
||||||
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = "SVN";
|
UPDATE llx_c_country SET numeric_code = '705' WHERE code_iso = 'SVN';
|
||||||
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = "ESP";
|
UPDATE llx_c_country SET numeric_code = '724' WHERE code_iso = 'ESP';
|
||||||
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = "USA";
|
UPDATE llx_c_country SET numeric_code = '840' WHERE code_iso = 'USA';
|
||||||
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = "EST";
|
UPDATE llx_c_country SET numeric_code = '233' WHERE code_iso = 'EST';
|
||||||
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = "ETH";
|
UPDATE llx_c_country SET numeric_code = '231' WHERE code_iso = 'ETH';
|
||||||
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = "PHL";
|
UPDATE llx_c_country SET numeric_code = '608' WHERE code_iso = 'PHL';
|
||||||
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = "FIN";
|
UPDATE llx_c_country SET numeric_code = '246' WHERE code_iso = 'FIN';
|
||||||
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = "FJI";
|
UPDATE llx_c_country SET numeric_code = '242' WHERE code_iso = 'FJI';
|
||||||
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = "FRA";
|
UPDATE llx_c_country SET numeric_code = '250' WHERE code_iso = 'FRA';
|
||||||
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = "GAB";
|
UPDATE llx_c_country SET numeric_code = '266' WHERE code_iso = 'GAB';
|
||||||
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = "GMB";
|
UPDATE llx_c_country SET numeric_code = '270' WHERE code_iso = 'GMB';
|
||||||
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = "GEO";
|
UPDATE llx_c_country SET numeric_code = '268' WHERE code_iso = 'GEO';
|
||||||
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = "GHA";
|
UPDATE llx_c_country SET numeric_code = '288' WHERE code_iso = 'GHA';
|
||||||
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = "GIB";
|
UPDATE llx_c_country SET numeric_code = '292' WHERE code_iso = 'GIB';
|
||||||
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = "GRD";
|
UPDATE llx_c_country SET numeric_code = '308' WHERE code_iso = 'GRD';
|
||||||
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = "GRC";
|
UPDATE llx_c_country SET numeric_code = '300' WHERE code_iso = 'GRC';
|
||||||
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = "GRL";
|
UPDATE llx_c_country SET numeric_code = '304' WHERE code_iso = 'GRL';
|
||||||
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = "GLP";
|
UPDATE llx_c_country SET numeric_code = '312' WHERE code_iso = 'GLP';
|
||||||
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = "GUM";
|
UPDATE llx_c_country SET numeric_code = '316' WHERE code_iso = 'GUM';
|
||||||
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = "GTM";
|
UPDATE llx_c_country SET numeric_code = '320' WHERE code_iso = 'GTM';
|
||||||
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = "GUF";
|
UPDATE llx_c_country SET numeric_code = '254' WHERE code_iso = 'GUF';
|
||||||
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = "GGY";
|
UPDATE llx_c_country SET numeric_code = '831' WHERE code_iso = 'GGY';
|
||||||
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = "GIN";
|
UPDATE llx_c_country SET numeric_code = '324' WHERE code_iso = 'GIN';
|
||||||
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = "GNB";
|
UPDATE llx_c_country SET numeric_code = '624' WHERE code_iso = 'GNB';
|
||||||
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = "GNQ";
|
UPDATE llx_c_country SET numeric_code = '226' WHERE code_iso = 'GNQ';
|
||||||
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = "GUY";
|
UPDATE llx_c_country SET numeric_code = '328' WHERE code_iso = 'GUY';
|
||||||
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = "HTI";
|
UPDATE llx_c_country SET numeric_code = '332' WHERE code_iso = 'HTI';
|
||||||
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = "HND";
|
UPDATE llx_c_country SET numeric_code = '340' WHERE code_iso = 'HND';
|
||||||
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = "HKG";
|
UPDATE llx_c_country SET numeric_code = '344' WHERE code_iso = 'HKG';
|
||||||
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = "HUN";
|
UPDATE llx_c_country SET numeric_code = '348' WHERE code_iso = 'HUN';
|
||||||
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = "IND";
|
UPDATE llx_c_country SET numeric_code = '356' WHERE code_iso = 'IND';
|
||||||
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = "IDN";
|
UPDATE llx_c_country SET numeric_code = '360' WHERE code_iso = 'IDN';
|
||||||
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = "IRQ";
|
UPDATE llx_c_country SET numeric_code = '368' WHERE code_iso = 'IRQ';
|
||||||
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = "IRN";
|
UPDATE llx_c_country SET numeric_code = '364' WHERE code_iso = 'IRN';
|
||||||
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = "IRL";
|
UPDATE llx_c_country SET numeric_code = '372' WHERE code_iso = 'IRL';
|
||||||
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = "BVT";
|
UPDATE llx_c_country SET numeric_code = '074' WHERE code_iso = 'BVT';
|
||||||
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = "IMN";
|
UPDATE llx_c_country SET numeric_code = '833' WHERE code_iso = 'IMN';
|
||||||
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = "CXR";
|
UPDATE llx_c_country SET numeric_code = '162' WHERE code_iso = 'CXR';
|
||||||
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = "ISL";
|
UPDATE llx_c_country SET numeric_code = '352' WHERE code_iso = 'ISL';
|
||||||
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = "CYM";
|
UPDATE llx_c_country SET numeric_code = '136' WHERE code_iso = 'CYM';
|
||||||
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = "CCK";
|
UPDATE llx_c_country SET numeric_code = '166' WHERE code_iso = 'CCK';
|
||||||
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = "COK";
|
UPDATE llx_c_country SET numeric_code = '184' WHERE code_iso = 'COK';
|
||||||
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = "FRO";
|
UPDATE llx_c_country SET numeric_code = '234' WHERE code_iso = 'FRO';
|
||||||
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = "SGS";
|
UPDATE llx_c_country SET numeric_code = '239' WHERE code_iso = 'SGS';
|
||||||
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = "HMD";
|
UPDATE llx_c_country SET numeric_code = '334' WHERE code_iso = 'HMD';
|
||||||
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = "FLK";
|
UPDATE llx_c_country SET numeric_code = '238' WHERE code_iso = 'FLK';
|
||||||
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = "MNP";
|
UPDATE llx_c_country SET numeric_code = '580' WHERE code_iso = 'MNP';
|
||||||
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = "MHL";
|
UPDATE llx_c_country SET numeric_code = '584' WHERE code_iso = 'MHL';
|
||||||
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = "PCN";
|
UPDATE llx_c_country SET numeric_code = '612' WHERE code_iso = 'PCN';
|
||||||
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = "SLB";
|
UPDATE llx_c_country SET numeric_code = '090' WHERE code_iso = 'SLB';
|
||||||
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = "TCA";
|
UPDATE llx_c_country SET numeric_code = '796' WHERE code_iso = 'TCA';
|
||||||
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = "UMI";
|
UPDATE llx_c_country SET numeric_code = '581' WHERE code_iso = 'UMI';
|
||||||
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = "VGB";
|
UPDATE llx_c_country SET numeric_code = '092' WHERE code_iso = 'VGB';
|
||||||
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = "VIR";
|
UPDATE llx_c_country SET numeric_code = '850' WHERE code_iso = 'VIR';
|
||||||
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = "ISR";
|
UPDATE llx_c_country SET numeric_code = '376' WHERE code_iso = 'ISR';
|
||||||
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = "ITA";
|
UPDATE llx_c_country SET numeric_code = '380' WHERE code_iso = 'ITA';
|
||||||
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = "JAM";
|
UPDATE llx_c_country SET numeric_code = '388' WHERE code_iso = 'JAM';
|
||||||
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = "JPN";
|
UPDATE llx_c_country SET numeric_code = '392' WHERE code_iso = 'JPN';
|
||||||
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = "JEY";
|
UPDATE llx_c_country SET numeric_code = '832' WHERE code_iso = 'JEY';
|
||||||
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = "JOR";
|
UPDATE llx_c_country SET numeric_code = '400' WHERE code_iso = 'JOR';
|
||||||
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = "KAZ";
|
UPDATE llx_c_country SET numeric_code = '398' WHERE code_iso = 'KAZ';
|
||||||
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = "KEN";
|
UPDATE llx_c_country SET numeric_code = '404' WHERE code_iso = 'KEN';
|
||||||
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = "KGZ";
|
UPDATE llx_c_country SET numeric_code = '417' WHERE code_iso = 'KGZ';
|
||||||
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = "KIR";
|
UPDATE llx_c_country SET numeric_code = '296' WHERE code_iso = 'KIR';
|
||||||
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = "KWT";
|
UPDATE llx_c_country SET numeric_code = '414' WHERE code_iso = 'KWT';
|
||||||
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = "LAO";
|
UPDATE llx_c_country SET numeric_code = '418' WHERE code_iso = 'LAO';
|
||||||
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = "LSO";
|
UPDATE llx_c_country SET numeric_code = '426' WHERE code_iso = 'LSO';
|
||||||
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = "LVA";
|
UPDATE llx_c_country SET numeric_code = '428' WHERE code_iso = 'LVA';
|
||||||
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = "LBN";
|
UPDATE llx_c_country SET numeric_code = '422' WHERE code_iso = 'LBN';
|
||||||
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = "LBR";
|
UPDATE llx_c_country SET numeric_code = '430' WHERE code_iso = 'LBR';
|
||||||
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = "LBY";
|
UPDATE llx_c_country SET numeric_code = '434' WHERE code_iso = 'LBY';
|
||||||
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = "LIE";
|
UPDATE llx_c_country SET numeric_code = '438' WHERE code_iso = 'LIE';
|
||||||
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = "LTU";
|
UPDATE llx_c_country SET numeric_code = '440' WHERE code_iso = 'LTU';
|
||||||
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = "LUX";
|
UPDATE llx_c_country SET numeric_code = '442' WHERE code_iso = 'LUX';
|
||||||
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = "MAC";
|
UPDATE llx_c_country SET numeric_code = '446' WHERE code_iso = 'MAC';
|
||||||
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = "MKD";
|
UPDATE llx_c_country SET numeric_code = '807' WHERE code_iso = 'MKD';
|
||||||
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = "MDG";
|
UPDATE llx_c_country SET numeric_code = '450' WHERE code_iso = 'MDG';
|
||||||
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = "MYS";
|
UPDATE llx_c_country SET numeric_code = '458' WHERE code_iso = 'MYS';
|
||||||
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = "MWI";
|
UPDATE llx_c_country SET numeric_code = '454' WHERE code_iso = 'MWI';
|
||||||
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = "MDV";
|
UPDATE llx_c_country SET numeric_code = '462' WHERE code_iso = 'MDV';
|
||||||
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = "MLI";
|
UPDATE llx_c_country SET numeric_code = '466' WHERE code_iso = 'MLI';
|
||||||
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = "MLT";
|
UPDATE llx_c_country SET numeric_code = '470' WHERE code_iso = 'MLT';
|
||||||
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = "MAR";
|
UPDATE llx_c_country SET numeric_code = '504' WHERE code_iso = 'MAR';
|
||||||
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = "MTQ";
|
UPDATE llx_c_country SET numeric_code = '474' WHERE code_iso = 'MTQ';
|
||||||
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = "MUS";
|
UPDATE llx_c_country SET numeric_code = '480' WHERE code_iso = 'MUS';
|
||||||
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = "MRT";
|
UPDATE llx_c_country SET numeric_code = '478' WHERE code_iso = 'MRT';
|
||||||
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = "MYT";
|
UPDATE llx_c_country SET numeric_code = '175' WHERE code_iso = 'MYT';
|
||||||
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = "MEX";
|
UPDATE llx_c_country SET numeric_code = '484' WHERE code_iso = 'MEX';
|
||||||
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = "FSM";
|
UPDATE llx_c_country SET numeric_code = '583' WHERE code_iso = 'FSM';
|
||||||
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = "MDA";
|
UPDATE llx_c_country SET numeric_code = '498' WHERE code_iso = 'MDA';
|
||||||
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = "MCO";
|
UPDATE llx_c_country SET numeric_code = '492' WHERE code_iso = 'MCO';
|
||||||
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = "MNG";
|
UPDATE llx_c_country SET numeric_code = '496' WHERE code_iso = 'MNG';
|
||||||
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = "MNE";
|
UPDATE llx_c_country SET numeric_code = '499' WHERE code_iso = 'MNE';
|
||||||
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = "MSR";
|
UPDATE llx_c_country SET numeric_code = '500' WHERE code_iso = 'MSR';
|
||||||
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = "MOZ";
|
UPDATE llx_c_country SET numeric_code = '508' WHERE code_iso = 'MOZ';
|
||||||
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = "MMR";
|
UPDATE llx_c_country SET numeric_code = '104' WHERE code_iso = 'MMR';
|
||||||
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = "NAM";
|
UPDATE llx_c_country SET numeric_code = '516' WHERE code_iso = 'NAM';
|
||||||
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = "NRU";
|
UPDATE llx_c_country SET numeric_code = '520' WHERE code_iso = 'NRU';
|
||||||
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = "NPL";
|
UPDATE llx_c_country SET numeric_code = '524' WHERE code_iso = 'NPL';
|
||||||
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = "NIC";
|
UPDATE llx_c_country SET numeric_code = '558' WHERE code_iso = 'NIC';
|
||||||
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = "NER";
|
UPDATE llx_c_country SET numeric_code = '562' WHERE code_iso = 'NER';
|
||||||
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = "NGA";
|
UPDATE llx_c_country SET numeric_code = '566' WHERE code_iso = 'NGA';
|
||||||
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = "NIU";
|
UPDATE llx_c_country SET numeric_code = '570' WHERE code_iso = 'NIU';
|
||||||
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = "NFK";
|
UPDATE llx_c_country SET numeric_code = '574' WHERE code_iso = 'NFK';
|
||||||
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = "NOR";
|
UPDATE llx_c_country SET numeric_code = '578' WHERE code_iso = 'NOR';
|
||||||
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = "NCL";
|
UPDATE llx_c_country SET numeric_code = '540' WHERE code_iso = 'NCL';
|
||||||
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = "NZL";
|
UPDATE llx_c_country SET numeric_code = '554' WHERE code_iso = 'NZL';
|
||||||
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = "OMN";
|
UPDATE llx_c_country SET numeric_code = '512' WHERE code_iso = 'OMN';
|
||||||
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = "NLD";
|
UPDATE llx_c_country SET numeric_code = '528' WHERE code_iso = 'NLD';
|
||||||
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = "PAK";
|
UPDATE llx_c_country SET numeric_code = '586' WHERE code_iso = 'PAK';
|
||||||
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = "PLW";
|
UPDATE llx_c_country SET numeric_code = '585' WHERE code_iso = 'PLW';
|
||||||
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = "PSE";
|
UPDATE llx_c_country SET numeric_code = '275' WHERE code_iso = 'PSE';
|
||||||
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = "PAN";
|
UPDATE llx_c_country SET numeric_code = '591' WHERE code_iso = 'PAN';
|
||||||
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = "PNG";
|
UPDATE llx_c_country SET numeric_code = '598' WHERE code_iso = 'PNG';
|
||||||
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = "PRY";
|
UPDATE llx_c_country SET numeric_code = '600' WHERE code_iso = 'PRY';
|
||||||
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = "PER";
|
UPDATE llx_c_country SET numeric_code = '604' WHERE code_iso = 'PER';
|
||||||
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = "PYF";
|
UPDATE llx_c_country SET numeric_code = '258' WHERE code_iso = 'PYF';
|
||||||
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = "POL";
|
UPDATE llx_c_country SET numeric_code = '616' WHERE code_iso = 'POL';
|
||||||
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = "PRT";
|
UPDATE llx_c_country SET numeric_code = '620' WHERE code_iso = 'PRT';
|
||||||
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = "PRI";
|
UPDATE llx_c_country SET numeric_code = '630' WHERE code_iso = 'PRI';
|
||||||
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = "GBR";
|
UPDATE llx_c_country SET numeric_code = '826' WHERE code_iso = 'GBR';
|
||||||
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = "ESH";
|
UPDATE llx_c_country SET numeric_code = '732' WHERE code_iso = 'ESH';
|
||||||
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = "CAF";
|
UPDATE llx_c_country SET numeric_code = '140' WHERE code_iso = 'CAF';
|
||||||
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = "CZE";
|
UPDATE llx_c_country SET numeric_code = '203' WHERE code_iso = 'CZE';
|
||||||
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = "COG";
|
UPDATE llx_c_country SET numeric_code = '178' WHERE code_iso = 'COG';
|
||||||
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = "COD";
|
UPDATE llx_c_country SET numeric_code = '180' WHERE code_iso = 'COD';
|
||||||
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = "DOM";
|
UPDATE llx_c_country SET numeric_code = '214' WHERE code_iso = 'DOM';
|
||||||
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = "REU";
|
UPDATE llx_c_country SET numeric_code = '638' WHERE code_iso = 'REU';
|
||||||
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = "RWA";
|
UPDATE llx_c_country SET numeric_code = '646' WHERE code_iso = 'RWA';
|
||||||
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = "ROU";
|
UPDATE llx_c_country SET numeric_code = '642' WHERE code_iso = 'ROU';
|
||||||
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = "RUS";
|
UPDATE llx_c_country SET numeric_code = '643' WHERE code_iso = 'RUS';
|
||||||
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = "WSM";
|
UPDATE llx_c_country SET numeric_code = '882' WHERE code_iso = 'WSM';
|
||||||
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = "ASM";
|
UPDATE llx_c_country SET numeric_code = '016' WHERE code_iso = 'ASM';
|
||||||
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = "BLM";
|
UPDATE llx_c_country SET numeric_code = '652' WHERE code_iso = 'BLM';
|
||||||
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = "KNA";
|
UPDATE llx_c_country SET numeric_code = '659' WHERE code_iso = 'KNA';
|
||||||
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = "SMR";
|
UPDATE llx_c_country SET numeric_code = '674' WHERE code_iso = 'SMR';
|
||||||
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = "MAF";
|
UPDATE llx_c_country SET numeric_code = '663' WHERE code_iso = 'MAF';
|
||||||
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = "SPM";
|
UPDATE llx_c_country SET numeric_code = '666' WHERE code_iso = 'SPM';
|
||||||
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = "VCT";
|
UPDATE llx_c_country SET numeric_code = '670' WHERE code_iso = 'VCT';
|
||||||
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = "SHN";
|
UPDATE llx_c_country SET numeric_code = '654' WHERE code_iso = 'SHN';
|
||||||
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = "LCA";
|
UPDATE llx_c_country SET numeric_code = '662' WHERE code_iso = 'LCA';
|
||||||
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = "STP";
|
UPDATE llx_c_country SET numeric_code = '678' WHERE code_iso = 'STP';
|
||||||
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = "SEN";
|
UPDATE llx_c_country SET numeric_code = '686' WHERE code_iso = 'SEN';
|
||||||
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = "SRB";
|
UPDATE llx_c_country SET numeric_code = '688' WHERE code_iso = 'SRB';
|
||||||
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = "SYC";
|
UPDATE llx_c_country SET numeric_code = '690' WHERE code_iso = 'SYC';
|
||||||
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = "SLE";
|
UPDATE llx_c_country SET numeric_code = '694' WHERE code_iso = 'SLE';
|
||||||
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = "SGP";
|
UPDATE llx_c_country SET numeric_code = '702' WHERE code_iso = 'SGP';
|
||||||
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = "SXM";
|
UPDATE llx_c_country SET numeric_code = '534' WHERE code_iso = 'SXM';
|
||||||
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = "SYR";
|
UPDATE llx_c_country SET numeric_code = '760' WHERE code_iso = 'SYR';
|
||||||
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = "SOM";
|
UPDATE llx_c_country SET numeric_code = '706' WHERE code_iso = 'SOM';
|
||||||
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = "LKA";
|
UPDATE llx_c_country SET numeric_code = '144' WHERE code_iso = 'LKA';
|
||||||
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = "SWZ";
|
UPDATE llx_c_country SET numeric_code = '748' WHERE code_iso = 'SWZ';
|
||||||
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = "ZAF";
|
UPDATE llx_c_country SET numeric_code = '710' WHERE code_iso = 'ZAF';
|
||||||
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = "SDN";
|
UPDATE llx_c_country SET numeric_code = '729' WHERE code_iso = 'SDN';
|
||||||
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = "SSD";
|
UPDATE llx_c_country SET numeric_code = '728' WHERE code_iso = 'SSD';
|
||||||
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = "SWE";
|
UPDATE llx_c_country SET numeric_code = '752' WHERE code_iso = 'SWE';
|
||||||
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = "CHE";
|
UPDATE llx_c_country SET numeric_code = '756' WHERE code_iso = 'CHE';
|
||||||
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = "SUR";
|
UPDATE llx_c_country SET numeric_code = '740' WHERE code_iso = 'SUR';
|
||||||
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = "SJM";
|
UPDATE llx_c_country SET numeric_code = '744' WHERE code_iso = 'SJM';
|
||||||
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = "THA";
|
UPDATE llx_c_country SET numeric_code = '764' WHERE code_iso = 'THA';
|
||||||
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = "TWN";
|
UPDATE llx_c_country SET numeric_code = '158' WHERE code_iso = 'TWN';
|
||||||
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = "TZA";
|
UPDATE llx_c_country SET numeric_code = '834' WHERE code_iso = 'TZA';
|
||||||
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = "TJK";
|
UPDATE llx_c_country SET numeric_code = '762' WHERE code_iso = 'TJK';
|
||||||
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = "IOT";
|
UPDATE llx_c_country SET numeric_code = '086' WHERE code_iso = 'IOT';
|
||||||
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = "ATF";
|
UPDATE llx_c_country SET numeric_code = '260' WHERE code_iso = 'ATF';
|
||||||
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = "TLS";
|
UPDATE llx_c_country SET numeric_code = '626' WHERE code_iso = 'TLS';
|
||||||
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = "TGO";
|
UPDATE llx_c_country SET numeric_code = '768' WHERE code_iso = 'TGO';
|
||||||
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = "TKL";
|
UPDATE llx_c_country SET numeric_code = '772' WHERE code_iso = 'TKL';
|
||||||
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = "TON";
|
UPDATE llx_c_country SET numeric_code = '776' WHERE code_iso = 'TON';
|
||||||
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = "TTO";
|
UPDATE llx_c_country SET numeric_code = '780' WHERE code_iso = 'TTO';
|
||||||
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = "TUN";
|
UPDATE llx_c_country SET numeric_code = '788' WHERE code_iso = 'TUN';
|
||||||
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = "TKM";
|
UPDATE llx_c_country SET numeric_code = '795' WHERE code_iso = 'TKM';
|
||||||
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = "TUR";
|
UPDATE llx_c_country SET numeric_code = '792' WHERE code_iso = 'TUR';
|
||||||
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = "TUV";
|
UPDATE llx_c_country SET numeric_code = '798' WHERE code_iso = 'TUV';
|
||||||
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = "UKR";
|
UPDATE llx_c_country SET numeric_code = '804' WHERE code_iso = 'UKR';
|
||||||
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = "UGA";
|
UPDATE llx_c_country SET numeric_code = '800' WHERE code_iso = 'UGA';
|
||||||
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = "URY";
|
UPDATE llx_c_country SET numeric_code = '858' WHERE code_iso = 'URY';
|
||||||
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = "UZB";
|
UPDATE llx_c_country SET numeric_code = '860' WHERE code_iso = 'UZB';
|
||||||
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = "VUT";
|
UPDATE llx_c_country SET numeric_code = '548' WHERE code_iso = 'VUT';
|
||||||
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = "VAT";
|
UPDATE llx_c_country SET numeric_code = '336' WHERE code_iso = 'VAT';
|
||||||
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = "VEN";
|
UPDATE llx_c_country SET numeric_code = '862' WHERE code_iso = 'VEN';
|
||||||
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = "VNM";
|
UPDATE llx_c_country SET numeric_code = '704' WHERE code_iso = 'VNM';
|
||||||
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = "WLF";
|
UPDATE llx_c_country SET numeric_code = '876' WHERE code_iso = 'WLF';
|
||||||
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = "YEM";
|
UPDATE llx_c_country SET numeric_code = '887' WHERE code_iso = 'YEM';
|
||||||
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = "DJI";
|
UPDATE llx_c_country SET numeric_code = '262' WHERE code_iso = 'DJI';
|
||||||
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = "ZMB";
|
UPDATE llx_c_country SET numeric_code = '894' WHERE code_iso = 'ZMB';
|
||||||
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = "ZWE";
|
UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = 'ZWE';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -401,4 +401,6 @@ ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128);
|
|||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN extraparams varchar(255);
|
ALTER TABLE llx_projet ADD COLUMN extraparams varchar(255);
|
||||||
|
|
||||||
|
DELETE FROM llx_const WHERE name = 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||