Merge branch 'develop' into develop
This commit is contained in:
commit
aa422ce4d7
@ -5,6 +5,7 @@
|
|||||||
# We use dist: xenial to have php 5.6+ available
|
# We use dist: xenial to have php 5.6+ available
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
|
#dist: bionic
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|||||||
64
ChangeLog
64
ChangeLog
@ -4,7 +4,7 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||||
For users:
|
For users:
|
||||||
|
NEW: Add module Credit transfer SEPA to manage payment of supplier using bank credit transfer SEPA files
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
@ -14,6 +14,68 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||||
|
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||||
|
FIX: DebugBar hides content at page bottom
|
||||||
|
FIX: allow more harmless html tags
|
||||||
|
FIX: Bad back to link
|
||||||
|
FIX: Bad param
|
||||||
|
FIX: Can go on page even when module is disabled
|
||||||
|
FIX: Change position of line in BOM
|
||||||
|
FIX: Checkbox "drop table" was not checked when using php method to generate backup dump
|
||||||
|
FIX: ClickToDial tab of users has disappeared
|
||||||
|
FIX: CSS
|
||||||
|
FIX: date in supplier price log tooltip.
|
||||||
|
FIX: Debug module direct debit order. Solve conflict with credit transfer
|
||||||
|
FIX: Debug setup of receipt printer module
|
||||||
|
FIX: dolGetElementUrl and agenda page for external modules
|
||||||
|
FIX: DO not erase variable $key and $label during output of extrafields
|
||||||
|
FIX: duration fields size with firefox
|
||||||
|
FIX: Edit extrafield of type long text loose carriage returns
|
||||||
|
FIX: Fails to retraive accounting code of social contribution sometimes
|
||||||
|
FIX: Filter too large for extrafields with type text or html
|
||||||
|
FIX: If using a rounding step, localtax1+2 not included in total
|
||||||
|
FIX: input field of extrafields must keep data if form submit fails.
|
||||||
|
FIX: Label of opportunities in graph with special chars badly encoded
|
||||||
|
FIX: locataxes lost on lines when cloning a vendor invoice
|
||||||
|
FIX: Look and feel v12
|
||||||
|
FIX: Missing PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE conf support in supplier order
|
||||||
|
FIX: Navigation in object fails to find the next ref in some cases
|
||||||
|
FIX: null required
|
||||||
|
FIX: order by amount ht uses wrong column
|
||||||
|
FIX: Order by amount in product propal stats must be done on d.total_ht and not p.total
|
||||||
|
FIX: page for confirmation of payments is empty
|
||||||
|
FIX: Param of fetch_name_optionals_label must be object->table_element
|
||||||
|
FIX: Picto of HRM module
|
||||||
|
FIX: product label and desc were never updated when modifying translation
|
||||||
|
FIX: redirect on contact card from main search
|
||||||
|
FIX: Reposition and nav
|
||||||
|
FIX: search warehouse list
|
||||||
|
FIX: Setup of clicktodial hang on smartphone
|
||||||
|
FIX: Setup of currency limit and accuracy
|
||||||
|
FIX: shipping creation: checks not done on weight and sizes
|
||||||
|
FIX: Should not be able to edit qty on shipment when no stock available
|
||||||
|
FIX: Size of image on the help popup of modules
|
||||||
|
FIX: Sql error on stat by referring entries of a product
|
||||||
|
FIX: Warning if no bank account defined
|
||||||
|
FIX: We need to see unit line on PDF even though it's an option
|
||||||
|
FIX: wrong element var for fetch_name_optionals_label function with expeditions
|
||||||
|
FIX: wrong link to third invoice templates
|
||||||
|
FIX: Disable svg as supported image by default (can contains javascript). Set MAIN_ALLOW_SVG_FILES_AS_IMAGES to 1 to have svg accepted
|
||||||
|
FIX: #14076
|
||||||
|
FIX: #14146
|
||||||
|
FIX: #14209
|
||||||
|
FIX: #14222
|
||||||
|
FIX: #14236
|
||||||
|
FIX: #14241 Mysql 8 compatibility
|
||||||
|
FIX: #14253
|
||||||
|
FIX: #14256
|
||||||
|
FIX: #14259
|
||||||
|
FIX: #14279
|
||||||
|
FIX: #14291
|
||||||
|
FIX: #14292
|
||||||
|
FIX: #14336
|
||||||
|
|
||||||
***** ChangeLog for 12.0.1 compared to 12.0.0 *****
|
***** ChangeLog for 12.0.1 compared to 12.0.0 *****
|
||||||
FIX: reposition was broken if url end with #anchor
|
FIX: reposition was broken if url end with #anchor
|
||||||
FIX: $_POST must be GETPOST
|
FIX: $_POST must be GETPOST
|
||||||
|
|||||||
@ -1,2 +1,8 @@
|
|||||||
|
Spec for credit transfer:
|
||||||
|
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
|
||||||
|
|
||||||
|
To validate a SEPA file:
|
||||||
|
xmllint --schema pain.001.001.03.xsd T200801.xml --noout
|
||||||
|
|
||||||
To test a SEPA file:
|
To test a SEPA file:
|
||||||
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa
|
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa
|
||||||
|
|||||||
@ -88,6 +88,7 @@ if ($action == 'update' || $action == 'add') {
|
|||||||
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
||||||
|
|
||||||
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
|
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
|
||||||
|
$constvalue = preg_replace('/:member$/', '', $constvalue);
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
||||||
|
|
||||||
@ -100,23 +101,6 @@ if ($action == 'update' || $action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action to enable a submodule of the adherent module
|
|
||||||
if ($action == 'set') {
|
|
||||||
$result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity);
|
|
||||||
if ($result < 0) {
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action to disable a submodule of the adherent module
|
|
||||||
if ($action == 'unset') {
|
|
||||||
$result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
|
|
||||||
if ($result < 0) {
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -109,6 +109,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
|||||||
|
|
||||||
foreach ($arrayofimages as $varforimage)
|
foreach ($arrayofimages as $varforimage)
|
||||||
{
|
{
|
||||||
|
if ($_FILES[$varforimage]["name"] && ! preg_match('/(\.jpeg|\.jpg|\.png)$/i', $_FILES[$varforimage]["name"])) { // Logo can be used on a lot of different places. Only jpg and png can be supported.
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_FILES[$varforimage]["tmp_name"])
|
if ($_FILES[$varforimage]["tmp_name"])
|
||||||
{
|
{
|
||||||
$reg = array();
|
$reg = array();
|
||||||
@ -473,10 +479,17 @@ if (!empty($mysoc->logo_mini)) {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||||
} else {
|
} elseif (!empty($mysoc->logo)) {
|
||||||
print '<div class="inline-block valignmiddle">';
|
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<div class="inline-block valignmiddle">';
|
||||||
print '</div>';
|
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo).'">';
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||||
|
} else {
|
||||||
|
print '<div class="inline-block valignmiddle">';
|
||||||
|
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -493,10 +506,18 @@ if (!empty($mysoc->logo_squarred_mini)) {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||||
} else {
|
} elseif (!empty($mysoc->logo_squarred)) {
|
||||||
print '<div class="inline-block valignmiddle">';
|
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred)) {
|
||||||
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<div class="inline-block valignmiddle">';
|
||||||
print '</div>';
|
print '<img style="max-height: 60px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo_squarred).'">';
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<div class="inline-block valignmiddle">';
|
||||||
|
print '<img height="60" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -262,7 +262,7 @@ print '<div class="centpercent">';
|
|||||||
|
|
||||||
$picto = 'object_'.$objMod->picto;
|
$picto = 'object_'.$objMod->picto;
|
||||||
|
|
||||||
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto);
|
print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0, '', 'titlemodulehelp');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
dol_fiche_head($head, $mode, '', -1);
|
dol_fiche_head($head, $mode, '', -1);
|
||||||
|
|||||||
@ -506,10 +506,10 @@ if ($mode == 'common' || $mode == 'commonkanban')
|
|||||||
$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="">'.$moreinfo.'</span><br><b class="largenumber">'.$moreinfo2.'</b></div>';
|
$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="">'.$moreinfo.'</span><br><b class="largenumber">'.$moreinfo2.'</b></div>';
|
||||||
|
|
||||||
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
$moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">';
|
$moreforfilter .= $langs->trans('Keyword').': <input type="text" id="search_keyword" name="search_keyword" class="maxwidth100" value="'.dol_escape_htmltag($search_keyword).'">';
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
$moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
$moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (!empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
@ -518,11 +518,11 @@ if ($mode == 'common' || $mode == 'commonkanban')
|
|||||||
if ($conf->global->MAIN_FEATURES_LEVEL < 0) $array_version['deprecated'] = $langs->trans("Deprecated");
|
if ($conf->global->MAIN_FEATURES_LEVEL < 0) $array_version['deprecated'] = $langs->trans("Deprecated");
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental'] = $langs->trans("Experimental");
|
if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental'] = $langs->trans("Experimental");
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development'] = $langs->trans("Development");
|
if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development'] = $langs->trans("Development");
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
$moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
$moreforfilter .= $langs->trans('Version').': '.$form->selectarray('search_version', $array_version, $search_version, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
$moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
$moreforfilter .= $langs->trans('Status').': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
$moreforfilter .= ' ';
|
$moreforfilter .= ' ';
|
||||||
|
|||||||
@ -28,21 +28,27 @@ require '../../main.inc.php';
|
|||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'convert')
|
if ($action == 'convert')
|
||||||
{
|
{
|
||||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
|
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
if ($action == 'convertutf8')
|
if ($action == 'convertutf8')
|
||||||
{
|
{
|
||||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
|
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
if ($action == 'convertdynamic')
|
||||||
|
{
|
||||||
|
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;";
|
||||||
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,8 +88,8 @@ if (!$base)
|
|||||||
} else {
|
} else {
|
||||||
if ($base == 1)
|
if ($base == 1)
|
||||||
{
|
{
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||||
@ -112,13 +118,17 @@ if (!$base)
|
|||||||
|
|
||||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
|
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
|
||||||
print '<td>'.$obj->Engine.'</td>';
|
print '<td>'.$obj->Engine.'</td>';
|
||||||
if (isset($obj->Engine) && $obj->Engine == "MyISAM")
|
if (isset($obj->Engine) && $obj->Engine == "MyISAM") {
|
||||||
{
|
|
||||||
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
|
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
print '<td>'.$obj->Row_format.'</td>';
|
print '<td>';
|
||||||
|
print $obj->Row_format;
|
||||||
|
if (isset($obj->Row_format) && (in_array($obj->Row_format, array("Compact")))) {
|
||||||
|
print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&table='.$obj->Name.'">'.$langs->trans("Convert").' Dynamic</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '<td align="right">'.$obj->Rows.'</td>';
|
print '<td align="right">'.$obj->Rows.'</td>';
|
||||||
print '<td align="right">'.$obj->Avg_row_length.'</td>';
|
print '<td align="right">'.$obj->Avg_row_length.'</td>';
|
||||||
print '<td align="right">'.$obj->Data_length.'</td>';
|
print '<td align="right">'.$obj->Data_length.'</td>';
|
||||||
@ -127,9 +137,8 @@ if (!$base)
|
|||||||
print '<td align="right">'.$obj->Auto_increment.'</td>';
|
print '<td align="right">'.$obj->Auto_increment.'</td>';
|
||||||
print '<td align="right">'.$obj->Check_time.'</td>';
|
print '<td align="right">'.$obj->Check_time.'</td>';
|
||||||
print '<td align="right">'.$obj->Collation;
|
print '<td align="right">'.$obj->Collation;
|
||||||
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci"))))
|
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) {
|
||||||
{
|
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
|
||||||
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -142,8 +151,8 @@ if (!$base)
|
|||||||
|
|
||||||
if ($base == 2)
|
if ($base == 2)
|
||||||
{
|
{
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>Nb of tuples</td>';
|
print '<td>Nb of tuples</td>';
|
||||||
@ -182,8 +191,8 @@ if (!$base)
|
|||||||
if ($base == 4)
|
if ($base == 4)
|
||||||
{
|
{
|
||||||
// Sqlite by PDO or by Sqlite3
|
// Sqlite by PDO or by Sqlite3
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("TableName").'</td>';
|
print '<td>'.$langs->trans("TableName").'</td>';
|
||||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||||
|
|||||||
@ -929,6 +929,7 @@ class BOM extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("mrp");
|
$langs->load("mrp");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'standard';
|
$modele = 'standard';
|
||||||
|
|||||||
@ -145,6 +145,7 @@ if ($action == 'create')
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
|
||||||
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 '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewBookmark"));
|
print load_fiche_titre($langs->trans("NewBookmark"));
|
||||||
|
|
||||||
|
|||||||
@ -154,7 +154,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
|||||||
@ -3664,6 +3664,7 @@ class Propal extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("propale");
|
$langs->load("propale");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'azur';
|
$modele = 'azur';
|
||||||
|
|||||||
@ -3859,6 +3859,7 @@ class Commande extends CommonOrder
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'einstein';
|
$modele = 'einstein';
|
||||||
|
|||||||
@ -116,7 +116,7 @@ $hookmanager->initHooks(array('orderlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('commande');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
|
|||||||
@ -469,7 +469,7 @@ class Account extends CommonObject
|
|||||||
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
* Add an entry into table ".MAIN_DB_PREFIX."bank
|
||||||
*
|
*
|
||||||
* @param int $date Date operation
|
* @param int $date Date operation
|
||||||
* @param string $oper 1,2,3,4... (deprecated) or 'TYP','VIR','PRE','LIQ','VAD','CB','CHQ'...
|
* @param string $oper 'VIR','PRE','LIQ','VAD','CB','CHQ'...
|
||||||
* @param string $label Descripton
|
* @param string $label Descripton
|
||||||
* @param float $amount Amount
|
* @param float $amount Amount
|
||||||
* @param string $num_chq Numero cheque ou virement
|
* @param string $num_chq Numero cheque ou virement
|
||||||
|
|||||||
@ -4296,6 +4296,7 @@ class Facture extends CommonInvoice
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele))
|
if (!dol_strlen($modele))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -108,7 +108,7 @@ $hookmanager->initHooks(array('invoicereclist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('facture_rec');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ $hookmanager->initHooks(array('invoicelist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('facture');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
@ -830,12 +830,15 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
|
/*
|
||||||
print $langs->trans('From').' ';
|
print $langs->trans('From').' ';
|
||||||
print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1);
|
print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $langs->trans('to').' ';*/
|
||||||
|
print $langs->trans("Before").' ';
|
||||||
print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1);
|
print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1);
|
||||||
|
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Alert");
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1442,7 +1445,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$userstatic->id = $obj->fk_user_author;
|
$userstatic->id = $obj->fk_user_author;
|
||||||
$userstatic->login = $obj->login;
|
$userstatic->login = $obj->login;
|
||||||
print '<td align="center">';
|
print '<td class="center tdoverflowmax100">';
|
||||||
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|||||||
@ -68,7 +68,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
|
|
||||||
|
|
||||||
$thirdpartystatic = new Societe($db);
|
$thirdpartystatic = new Societe($db);
|
||||||
$invoicestatic = new Facture($db);
|
$invoicestatic = new FactureFournisseur($db);
|
||||||
$bprev = new BonPrelevement($db);
|
$bprev = new BonPrelevement($db);
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
|||||||
@ -146,11 +146,9 @@ if (empty($reshook))
|
|||||||
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
|
|
||||||
$error = $object->set_infocredit($user, $dt);
|
$error = $object->set_infocredit($user, $dt);
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
header("Location: card.php?id=".$id."&error=$error");
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -59,7 +59,7 @@ class LignePrelevement
|
|||||||
|
|
||||||
$langs->load("withdrawals");
|
$langs->load("withdrawals");
|
||||||
$this->statuts[0] = $langs->trans("StatusWaiting");
|
$this->statuts[0] = $langs->trans("StatusWaiting");
|
||||||
$this->statuts[2] = $langs->trans("StatusCredited");
|
$this->statuts[2] = $langs->trans("StatusPaid");
|
||||||
$this->statuts[3] = $langs->trans("StatusRefused");
|
$this->statuts[3] = $langs->trans("StatusRefused");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,11 +88,9 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty (we don't use them anymore)
|
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->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($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->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) {
|
||||||
{
|
|
||||||
$mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
$mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format);
|
||||||
setEventMessages($mesg, null, 'errors');
|
setEventMessages($mesg, null, 'errors');
|
||||||
$mesg .= '<br>'."\n";
|
$mesg .= '<br>'."\n";
|
||||||
@ -370,10 +368,15 @@ if ($resql)
|
|||||||
|
|
||||||
// RUM
|
// RUM
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $thirdpartystatic->display_rib('rum');
|
$rumtoshow = $thirdpartystatic->display_rib('rum');
|
||||||
$format = $thirdpartystatic->display_rib('format');
|
if ($rumtoshow) {
|
||||||
if ($type != 'bank-transfer') {
|
print $rumtoshow;
|
||||||
if ($format) print ' ('.$format.')';
|
$format = $thirdpartystatic->display_rib('format');
|
||||||
|
if ($type != 'bank-transfer') {
|
||||||
|
if ($format) print ' ('.$format.')';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print img_warning($langs->trans("NoBankAccount"));
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount
|
// Amount
|
||||||
|
|||||||
@ -105,14 +105,17 @@ if ($type != 'bank-transfer') {
|
|||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
$thirdpartystatic = new Societe($db);
|
$thirdpartystatic = new Societe($db);
|
||||||
$invoicestatic = new Facture($db);
|
if ($type == 'bank-transfer') {
|
||||||
|
$invoicestatic = new FactureFournisseur($db);
|
||||||
|
} else {
|
||||||
|
$invoicestatic = new Facture($db);
|
||||||
|
}
|
||||||
|
|
||||||
// List of requests
|
// List of requests
|
||||||
|
|
||||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc,";
|
$sql = "SELECT f.ref, f.rowid, f.total_ttc,";
|
||||||
$sql .= " s.nom as name, s.rowid as socid,";
|
$sql .= " s.nom as name, s.rowid as socid,";
|
||||||
$sql .= " pfd.date_demande as date_demande,";
|
$sql .= " pfd.date_demande as date_demande, pfd.amount, pfd.fk_user_demande";
|
||||||
$sql .= " pfd.fk_user_demande";
|
|
||||||
if ($type != 'bank-transfer') {
|
if ($type != 'bank-transfer') {
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||||
} else {
|
} else {
|
||||||
@ -126,6 +129,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")";
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
|
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
|
||||||
if (!$status) $sql .= " AND pfd.traite = 0";
|
if (!$status) $sql .= " AND pfd.traite = 0";
|
||||||
|
$sql .= " AND pfd.ext_payment_id IS NULL";
|
||||||
if ($status) $sql .= " AND pfd.traite = ".$status;
|
if ($status) $sql .= " AND pfd.traite = ".$status;
|
||||||
$sql .= " AND f.total_ttc > 0";
|
$sql .= " AND f.total_ttc > 0";
|
||||||
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
|
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
|
||||||
@ -141,7 +145,6 @@ if ($search_facture) $sql .= natural_search("f.ref", $search_facture);
|
|||||||
if ($search_societe) $sql .= natural_search("s.nom", $search_societe);
|
if ($search_societe) $sql .= natural_search("s.nom", $search_societe);
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
@ -173,9 +176,9 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
||||||
if ($type == 'bank-transfer') {
|
if ($type == 'bank-transfer') {
|
||||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
|
$newcardbutton = '<a class="marginrightonly" href="'.DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php">'.$langs->trans("Back").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="searchFormList" name="searchFormList">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="searchFormList" name="searchFormList">';
|
||||||
@ -205,7 +208,7 @@ print '<table class="liste centpercent">';
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
|
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right ');
|
||||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
|
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center ');
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -228,12 +231,12 @@ while ($i < min($num, $limit))
|
|||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if (empty($obj)) break; // Should not happen
|
if (empty($obj)) break; // Should not happen
|
||||||
|
|
||||||
|
$invoicestatic->fetch($obj->rowid);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref facture
|
// Ref facture
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$invoicestatic->id = $obj->rowid;
|
|
||||||
$invoicestatic->ref = $obj->ref;
|
|
||||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -243,7 +246,9 @@ while ($i < min($num, $limit))
|
|||||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
print '<td class="right">';
|
||||||
|
print price($obj->amount, 1, $langs, 1, -1, -1, $conf->currency).' / '.price($obj->total_ttc, 1, $langs, 1, -1, -1, $conf->currency);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||||
print dol_print_date($object->date_trans, 'day');
|
print dol_print_date($object->date_trans, 'day');
|
||||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||||
print $object->methodes_trans[$object->method_trans];
|
print $object->methodes_trans[$object->method_trans];
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -158,7 +158,7 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
|
|
||||||
// List of invoices
|
// List of invoices
|
||||||
$sql = "SELECT pf.rowid,";
|
$sql = "SELECT pf.rowid, p.type,";
|
||||||
$sql .= " f.rowid as facid, f.ref as ref, f.total_ttc,";
|
$sql .= " f.rowid as facid, f.ref as ref, f.total_ttc,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
|
$sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||||
@ -191,8 +191,8 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($resql);
|
||||||
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 then paging size (filtering), goto and load page 0
|
||||||
{
|
{
|
||||||
$page = 0;
|
$page = 0;
|
||||||
@ -202,10 +202,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($result)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = "&id=".$id;
|
$param = "&id=".$id;
|
||||||
@ -234,22 +234,28 @@ if ($result)
|
|||||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AmountInvoice", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre("AmountInvoice", $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("StatusDebitCredit", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$totalinvoices = 0;
|
$totalinvoices = 0;
|
||||||
$totalamount_requested = 0;
|
$totalamount_requested = 0;
|
||||||
|
|
||||||
|
$invoicetmpcustomer = new Facture($db);
|
||||||
|
$invoicetmpsupplier = new FactureFournisseur($db);
|
||||||
|
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$invoicetmp->id = $obj->facid;
|
if ($obj->type == 'bank-transfer') {
|
||||||
$invoicetmp->ref = $obj->ref;
|
$invoicetmp = $invoicetmpsupplier;
|
||||||
|
} else {
|
||||||
|
$invoicetmp = $invoicetmpcustomer;
|
||||||
|
}
|
||||||
|
$invoicetmp->fetch($obj->facid);
|
||||||
|
|
||||||
$thirdpartytmp->id = $obj->socid;
|
$thirdpartytmp->fetch($obj->socid);
|
||||||
$thirdpartytmp->name = $obj->name;
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -270,14 +276,15 @@ if ($result)
|
|||||||
// Status of requests
|
// Status of requests
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
|
|
||||||
if ($obj->statut == 0)
|
if ($obj->statut == 0) {
|
||||||
{
|
|
||||||
print '-';
|
print '-';
|
||||||
} elseif ($obj->statut == 2)
|
} elseif ($obj->statut == 2) {
|
||||||
{
|
if ($obj->type == 'bank-transfer') {
|
||||||
print $langs->trans("StatusCredited");
|
print $langs->trans("StatusDebited");
|
||||||
} elseif ($obj->statut == 3)
|
} else {
|
||||||
{
|
print $langs->trans("StatusCredited");
|
||||||
|
}
|
||||||
|
} elseif ($obj->statut == 3) {
|
||||||
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ if ($prev_id > 0 || $ref)
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||||
print dol_print_date($object->date_trans, 'day');
|
print dol_print_date($object->date_trans, 'day');
|
||||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||||
print $object->methodes_trans[$object->method_trans];
|
print $object->methodes_trans[$object->method_trans];
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -230,7 +230,7 @@ if ($resql)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
|
|||||||
@ -98,7 +98,7 @@ if ($prev_id > 0 || $ref)
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||||
print dol_print_date($object->date_trans, 'day');
|
print dol_print_date($object->date_trans, 'day');
|
||||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
print ' <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getFullName($langs).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||||
print $object->methodes_trans[$object->method_trans];
|
print $object->methodes_trans[$object->method_trans];
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -144,7 +144,7 @@ $hookmanager->initHooks(array('contactlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('contact');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -2393,6 +2393,7 @@ class Contrat extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'strato';
|
$modele = 'strato';
|
||||||
|
|||||||
@ -100,7 +100,7 @@ $hookmanager->initHooks(array('contractlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('contrat');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
|
|||||||
@ -84,7 +84,7 @@ $hookmanager->initHooks(array('contractservicelist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('contratdet');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@ if ($action == 'update' && !empty($permissiontoadd))
|
|||||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||||
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
||||||
} elseif ($object->fields[$key]['type'] == 'boolean') {
|
} elseif ($object->fields[$key]['type'] == 'boolean') {
|
||||||
$value = (GETPOST($key) == 'on' ? 1 : 0);
|
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
|
||||||
} else {
|
} else {
|
||||||
$value = GETPOST($key, 'alpha');
|
$value = GETPOST($key, 'alpha');
|
||||||
}
|
}
|
||||||
@ -285,18 +285,20 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd)
|
|||||||
// Define output language
|
// Define output language
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
{
|
{
|
||||||
$outputlangs = $langs;
|
if (method_exists($object, 'generateDocument')) {
|
||||||
$newlang = '';
|
$outputlangs = $langs;
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
$newlang = '';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
||||||
if (!empty($newlang)) {
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||||
$outputlangs = new Translate("", $conf);
|
if (!empty($newlang)) {
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs = new Translate("", $conf);
|
||||||
}
|
$outputlangs->setDefaultLang($newlang);
|
||||||
$model = $object->modelpdf;
|
}
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$model = $object->modelpdf;
|
||||||
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
|||||||
@ -268,6 +268,28 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->addr_to = $to;
|
||||||
|
$this->addr_cc = $addr_cc;
|
||||||
|
$this->addr_bcc = $addr_bcc;
|
||||||
|
$this->reply_to = $replyto;
|
||||||
|
$this->addr_from = $from;
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->errors_to = $errors_to;
|
||||||
|
$this->deliveryreceipt = $deliveryreceipt;
|
||||||
|
$this->trackid = $trackid;
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
|
||||||
|
{
|
||||||
|
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
|
||||||
|
$this->addr_cc = '';
|
||||||
|
$this->addr_bcc = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
|
||||||
|
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) {
|
||||||
|
$addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||||
|
}
|
||||||
|
|
||||||
// We set all data according to choosed sending method.
|
// We set all data according to choosed sending method.
|
||||||
// We also set a value for ->msgid
|
// We also set a value for ->msgid
|
||||||
if ($this->sendmode == 'mail')
|
if ($this->sendmode == 'mail')
|
||||||
@ -327,16 +349,16 @@ class CMailFile
|
|||||||
$smtps->setCharSet($conf->file->character_set_client);
|
$smtps->setCharSet($conf->file->character_set_client);
|
||||||
|
|
||||||
// Encode subject if required.
|
// Encode subject if required.
|
||||||
$subjecttouse = $subject;
|
$subjecttouse = $this->subject;
|
||||||
if (!ascii_check($subjecttouse)) {
|
if (!ascii_check($subjecttouse)) {
|
||||||
$subjecttouse = $this->encodetorfc2822($subjecttouse);
|
$subjecttouse = $this->encodetorfc2822($subjecttouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
$smtps->setSubject($subjecttouse);
|
$smtps->setSubject($subjecttouse);
|
||||||
$smtps->setTO($this->getValidAddress($to, 0, 1));
|
$smtps->setTO($this->getValidAddress($this->to, 0, 1));
|
||||||
$smtps->setFrom($this->getValidAddress($from, 0, 1));
|
$smtps->setFrom($this->getValidAddress($this->from, 0, 1));
|
||||||
$smtps->setTrackId($trackid);
|
$smtps->setTrackId($this->trackid);
|
||||||
$smtps->setReplyTo($this->getValidAddress($replyto, 0, 1));
|
$smtps->setReplyTo($this->getValidAddress($this->replyto, 0, 1));
|
||||||
|
|
||||||
if (!empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
if (!empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
||||||
|
|
||||||
@ -374,17 +396,16 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$smtps->setCC($addr_cc);
|
$smtps->setCC($this->addr_cc);
|
||||||
$smtps->setBCC($addr_bcc);
|
$smtps->setBCC($this->addr_bcc);
|
||||||
$smtps->setErrorsTo($errors_to);
|
$smtps->setErrorsTo($this->errors_to);
|
||||||
$smtps->setDeliveryReceipt($deliveryreceipt);
|
$smtps->setDeliveryReceipt($this->deliveryreceipt);
|
||||||
|
|
||||||
$host = dol_getprefix('email');
|
$host = dol_getprefix('email');
|
||||||
$this->msgid = time().'.SMTPs-dolibarr-'.$trackid.'@'.$host;
|
$this->msgid = time().'.SMTPs-dolibarr-'.$trackid.'@'.$host;
|
||||||
|
|
||||||
$this->smtps = $smtps;
|
$this->smtps = $smtps;
|
||||||
} elseif ($this->sendmode == 'swiftmailer')
|
} elseif ($this->sendmode == 'swiftmailer') {
|
||||||
{
|
|
||||||
// Use Swift Mailer library
|
// Use Swift Mailer library
|
||||||
$host = dol_getprefix('email');
|
$host = dol_getprefix('email');
|
||||||
|
|
||||||
@ -401,8 +422,8 @@ class CMailFile
|
|||||||
//$this->message = new Swift_SignedMessage();
|
//$this->message = new Swift_SignedMessage();
|
||||||
// Adding a trackid header to a message
|
// Adding a trackid header to a message
|
||||||
$headers = $this->message->getHeaders();
|
$headers = $this->message->getHeaders();
|
||||||
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid.'@'.$host);
|
$headers->addTextHeader('X-Dolibarr-TRACKID', $this->trackid.'@'.$host);
|
||||||
$this->msgid = time().'.swiftmailer-dolibarr-'.$trackid.'@'.$host;
|
$this->msgid = time().'.swiftmailer-dolibarr-'.$this->trackid.'@'.$host;
|
||||||
$headerID = $this->msgid;
|
$headerID = $this->msgid;
|
||||||
$msgid = $headers->get('Message-ID');
|
$msgid = $headers->get('Message-ID');
|
||||||
$msgid->setId($headerID);
|
$msgid->setId($headerID);
|
||||||
@ -411,14 +432,14 @@ class CMailFile
|
|||||||
|
|
||||||
// Give the message a subject
|
// Give the message a subject
|
||||||
try {
|
try {
|
||||||
$result = $this->message->setSubject($subject);
|
$result = $this->message->setSubject($this->subject);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the From address with an associative array
|
// Set the From address with an associative array
|
||||||
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
|
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
|
||||||
if (!empty($from)) {
|
if (! empty($this->addr_from)) {
|
||||||
try {
|
try {
|
||||||
if (! empty($conf->global->MAIN_FORCE_DISABLE_MAIL_SPOOFING)) {
|
if (! empty($conf->global->MAIN_FORCE_DISABLE_MAIL_SPOOFING)) {
|
||||||
// Prevent email spoofing for smtp server with a strict configuration
|
// Prevent email spoofing for smtp server with a strict configuration
|
||||||
@ -429,10 +450,10 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
$result = $this->message->setFrom($conf->global->MAIN_MAIL_SMTPS_ID);
|
$result = $this->message->setFrom($conf->global->MAIN_MAIL_SMTPS_ID);
|
||||||
} else {
|
} else {
|
||||||
$result = $this->message->setFrom($this->getArrayAddress($from));
|
$result = $this->message->setFrom($this->getArrayAddress($this->addr_from));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = $this->message->setFrom($this->getArrayAddress($from));
|
$result = $this->message->setFrom($this->getArrayAddress($this->addr_from));
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
@ -440,17 +461,17 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the To addresses with an associative array
|
// Set the To addresses with an associative array
|
||||||
if (!empty($to)) {
|
if (! empty($this->addr_to)) {
|
||||||
try {
|
try {
|
||||||
$result = $this->message->setTo($this->getArrayAddress($to));
|
$result = $this->message->setTo($this->getArrayAddress($this->addr_to));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($replyto)) {
|
if (! empty($this->reply_to)) {
|
||||||
try {
|
try {
|
||||||
$result = $this->message->SetReplyTo($this->getArrayAddress($replyto));
|
$result = $this->message->SetReplyTo($this->getArrayAddress($this->reply_to));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
@ -504,10 +525,10 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
|
if (! empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc));
|
||||||
if (!empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
|
if (! empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
|
||||||
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
|
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
|
||||||
if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
|
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
|
||||||
} else {
|
} else {
|
||||||
// Send mail method not correctly defined
|
// Send mail method not correctly defined
|
||||||
// --------------------------------------
|
// --------------------------------------
|
||||||
@ -624,13 +645,6 @@ class CMailFile
|
|||||||
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
|
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
|
|
||||||
{
|
|
||||||
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
|
|
||||||
$this->addr_cc = '';
|
|
||||||
$this->addr_bcc = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action according to choosed sending method
|
// Action according to choosed sending method
|
||||||
if ($this->sendmode == 'mail')
|
if ($this->sendmode == 'mail')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5311,11 +5311,12 @@ abstract class CommonObject
|
|||||||
$new_array_options[$key] = null;
|
$new_array_options[$key] = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'double':
|
case 'price':
|
||||||
|
case 'double':
|
||||||
$value = price2num($value);
|
$value = price2num($value);
|
||||||
if (!is_numeric($value) && $value != '')
|
if (!is_numeric($value) && $value != '')
|
||||||
{
|
{
|
||||||
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
|
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." for ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
|
||||||
$this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
|
$this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
|
||||||
return -1;
|
return -1;
|
||||||
} elseif ($value == '')
|
} elseif ($value == '')
|
||||||
@ -5363,9 +5364,6 @@ abstract class CommonObject
|
|||||||
$new_array_options[$key] = $this->array_options[$key];
|
$new_array_options[$key] = $this->array_options[$key];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'price':
|
|
||||||
$new_array_options[$key] = price2num($this->array_options[$key]);
|
|
||||||
break;
|
|
||||||
case 'date':
|
case 'date':
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
// If data is a string instead of a timestamp, we convert it
|
// If data is a string instead of a timestamp, we convert it
|
||||||
@ -5457,7 +5455,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
|
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
|
||||||
{
|
{
|
||||||
if (in_array($tmpval, array('int', 'double'))) $sql .= ", 0";
|
if (in_array($tmpval, array('int', 'double', 'price'))) $sql .= ", 0";
|
||||||
else $sql .= ", ''";
|
else $sql .= ", ''";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6733,7 +6731,7 @@ abstract class CommonObject
|
|||||||
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0)
|
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0)
|
||||||
{
|
{
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
$out .= '<!-- showOptionalsInput --> ';
|
$out .= '<!-- showOptionals --> ';
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
|
|
||||||
$extrafields_collapse_num = '';
|
$extrafields_collapse_num = '';
|
||||||
@ -6867,7 +6865,7 @@ abstract class CommonObject
|
|||||||
// HTML, select, integer and text add default value
|
// HTML, select, integer and text add default value
|
||||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
|
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
|
||||||
{
|
{
|
||||||
if ($action == 'create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
|
if ($action == 'create') $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ? GETPOST($keyprefix.'options_'.$key.$keysuffix, 'none', 3) : $extrafields->attributes[$this->table_element]['default'][$key];
|
||||||
else $value = $this->array_options['options_'.$key];
|
else $value = $this->array_options['options_'.$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6953,7 +6951,7 @@ abstract class CommonObject
|
|||||||
</script>'."\n";
|
</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$out .= '<!-- /showOptionalsInput --> '."\n";
|
$out .= '<!-- /showOptionals --> '."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7613,6 +7611,7 @@ abstract class CommonObject
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$fieldvalues = $this->setSaveQuery();
|
$fieldvalues = $this->setSaveQuery();
|
||||||
|
|
||||||
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
||||||
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
||||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
||||||
|
|||||||
@ -50,6 +50,16 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
public $fk_unit;
|
public $fk_unit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
public function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db = $db;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the translation key from units dictionary.
|
* Returns the translation key from units dictionary.
|
||||||
* A langs->trans() must be called on result to get translated value.
|
* A langs->trans() must be called on result to get translated value.
|
||||||
@ -74,12 +84,12 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
$label_type = 'short_label';
|
$label_type = 'short_label';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
|
$sql = 'select '.$label_type.',code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql && $this->db->num_rows($resql) > 0)
|
if ($resql && $this->db->num_rows($resql) > 0)
|
||||||
{
|
{
|
||||||
$res = $this->db->fetch_array($resql);
|
$res = $this->db->fetch_array($resql);
|
||||||
$label = $res[$label_type];
|
$label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']);
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $label;
|
return $label;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -807,7 +807,7 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
||||||
*
|
*
|
||||||
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
* @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||||
* @param boolean $forceload Force load of extra fields whatever is status of cache.
|
* @param boolean $forceload Force load of extra fields whatever is status of cache.
|
||||||
* @return array Array of attributes keys+label for all extra fields.
|
* @return array Array of attributes keys+label for all extra fields.
|
||||||
*/
|
*/
|
||||||
@ -821,6 +821,7 @@ class ExtraFields
|
|||||||
if ($elementtype == 'thirdparty') $elementtype = 'societe';
|
if ($elementtype == 'thirdparty') $elementtype = 'societe';
|
||||||
if ($elementtype == 'contact') $elementtype = 'socpeople';
|
if ($elementtype == 'contact') $elementtype = 'socpeople';
|
||||||
if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur';
|
if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur';
|
||||||
|
if ($elementtype == 'stock_mouvement') $elementtype = 'movement';
|
||||||
|
|
||||||
$array_name_label = array();
|
$array_name_label = array();
|
||||||
|
|
||||||
|
|||||||
@ -539,7 +539,10 @@ class Translate
|
|||||||
{
|
{
|
||||||
global $conf, $db;
|
global $conf, $db;
|
||||||
|
|
||||||
if (!is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
|
if (!is_string($key)) {
|
||||||
|
//xdebug_print_function_stack('ErrorBadValueForParamNotAString');
|
||||||
|
return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
|
||||||
|
}
|
||||||
|
|
||||||
$newstr = $key;
|
$newstr = $key;
|
||||||
if (preg_match('/^Civility([0-9A-Z]+)$/i', $key, $reg))
|
if (preg_match('/^Civility([0-9A-Z]+)$/i', $key, $reg))
|
||||||
|
|||||||
@ -5507,12 +5507,13 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
|
|||||||
* Clean a string to keep only desirable HTML tags.
|
* Clean a string to keep only desirable HTML tags.
|
||||||
*
|
*
|
||||||
* @param string $stringtoclean String to clean
|
* @param string $stringtoclean String to clean
|
||||||
* @param string $cleanalsosomestyles Clean also some tags
|
* @param boolean $cleanalsosomestyles Remove absolute/fixed positioning from inline styles
|
||||||
|
* @param boolean $removeclassattribute Remove the class attribute from tags
|
||||||
* @return string String cleaned
|
* @return string String cleaned
|
||||||
*
|
*
|
||||||
* @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()
|
* @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()
|
||||||
*/
|
*/
|
||||||
function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
|
function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $removeclassattribute = 1)
|
||||||
{
|
{
|
||||||
$allowed_tags = array(
|
$allowed_tags = array(
|
||||||
"html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
|
"html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
|
||||||
@ -5524,7 +5525,10 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
|
|||||||
$allowed_tags_string = '<'.$allowed_tags_string.'>';
|
$allowed_tags_string = '<'.$allowed_tags_string.'>';
|
||||||
|
|
||||||
if ($cleanalsosomestyles) {
|
if ($cleanalsosomestyles) {
|
||||||
$stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless
|
$stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/i', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless
|
||||||
|
}
|
||||||
|
if ($removeclassattribute) {
|
||||||
|
$stringtoclean = preg_replace('/(<[^>]+)\s+class=((["\']).*?\\3|\\w*)/i', '\\1', $stringtoclean);
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp = strip_tags($stringtoclean, $allowed_tags_string);
|
$temp = strip_tags($stringtoclean, $allowed_tags_string);
|
||||||
|
|||||||
@ -24,23 +24,23 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to return number in text.
|
* Function to return a number into a text.
|
||||||
* May use module NUMBERWORDS if found.
|
* May use module NUMBERWORDS if found.
|
||||||
*
|
*
|
||||||
* @param float $num Number to convert
|
* @param float $num Number to convert (must be a numeric value, like reported by price2num())
|
||||||
* @param Translate $langs Language
|
* @param Translate $langs Language
|
||||||
* @param boolean $currency 0=number to translate | 1=currency to translate
|
* @param boolean $currency 0=number to translate | 1=currency to translate
|
||||||
* @param boolean $centimes 0=no centimes | 1=centimes to translate
|
* @param boolean $centimes 0=no cents/centimes | 1=there is cents/centimes to translate
|
||||||
* @return string|false Text of the number
|
* @return string|false Text of the number
|
||||||
*/
|
*/
|
||||||
function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$num = str_replace(array(',', ' '), '', trim($num));
|
//$num = str_replace(array(',', ' '), '', trim($num)); This should be useless since $num MUST be a php numeric value
|
||||||
if (!$num) {
|
if (!$num) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($centimes && strlen($num) == 1) {
|
if ($centimes && strlen($num) == 1) {
|
||||||
$num = $num * 10;
|
$num = $num * 10;
|
||||||
@ -57,78 +57,79 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
|||||||
return $concatWords;
|
return $concatWords;
|
||||||
} else {
|
} else {
|
||||||
$TNum = explode('.', $num);
|
$TNum = explode('.', $num);
|
||||||
$num = (int) $TNum[0];
|
|
||||||
$words = array();
|
|
||||||
$list1 = array(
|
|
||||||
'',
|
|
||||||
$langs->transnoentitiesnoconv('one'),
|
|
||||||
$langs->transnoentitiesnoconv('two'),
|
|
||||||
$langs->transnoentitiesnoconv('three'),
|
|
||||||
$langs->transnoentitiesnoconv('four'),
|
|
||||||
$langs->transnoentitiesnoconv('five'),
|
|
||||||
$langs->transnoentitiesnoconv('six'),
|
|
||||||
$langs->transnoentitiesnoconv('seven'),
|
|
||||||
$langs->transnoentitiesnoconv('eight'),
|
|
||||||
$langs->transnoentitiesnoconv('nine'),
|
|
||||||
$langs->transnoentitiesnoconv('ten'),
|
|
||||||
$langs->transnoentitiesnoconv('eleven'),
|
|
||||||
$langs->transnoentitiesnoconv('twelve'),
|
|
||||||
$langs->transnoentitiesnoconv('thirteen'),
|
|
||||||
$langs->transnoentitiesnoconv('fourteen'),
|
|
||||||
$langs->transnoentitiesnoconv('fifteen'),
|
|
||||||
$langs->transnoentitiesnoconv('sixteen'),
|
|
||||||
$langs->transnoentitiesnoconv('seventeen'),
|
|
||||||
$langs->transnoentitiesnoconv('eighteen'),
|
|
||||||
$langs->transnoentitiesnoconv('nineteen')
|
|
||||||
);
|
|
||||||
$list2 = array(
|
|
||||||
'',
|
|
||||||
$langs->transnoentitiesnoconv('ten'),
|
|
||||||
$langs->transnoentitiesnoconv('twenty'),
|
|
||||||
$langs->transnoentitiesnoconv('thirty'),
|
|
||||||
$langs->transnoentitiesnoconv('forty'),
|
|
||||||
$langs->transnoentitiesnoconv('fifty'),
|
|
||||||
$langs->transnoentitiesnoconv('sixty'),
|
|
||||||
$langs->transnoentitiesnoconv('seventy'),
|
|
||||||
$langs->transnoentitiesnoconv('eighty'),
|
|
||||||
$langs->transnoentitiesnoconv('ninety'),
|
|
||||||
$langs->transnoentitiesnoconv('hundred')
|
|
||||||
);
|
|
||||||
$list3 = array(
|
|
||||||
'',
|
|
||||||
$langs->transnoentitiesnoconv('thousand'),
|
|
||||||
$langs->transnoentitiesnoconv('million'),
|
|
||||||
$langs->transnoentitiesnoconv('billion'),
|
|
||||||
$langs->transnoentitiesnoconv('trillion'),
|
|
||||||
$langs->transnoentitiesnoconv('quadrillion')
|
|
||||||
);
|
|
||||||
|
|
||||||
$num_length = strlen($num);
|
$num = (int) $TNum[0];
|
||||||
$levels = (int) (($num_length + 2) / 3);
|
$words = array();
|
||||||
$max_length = $levels * 3;
|
$list1 = array(
|
||||||
$num = substr('00'.$num, -$max_length);
|
'',
|
||||||
$num_levels = str_split($num, 3);
|
$langs->transnoentitiesnoconv('one'),
|
||||||
$nboflevels = count($num_levels);
|
$langs->transnoentitiesnoconv('two'),
|
||||||
for ($i = 0; $i < $nboflevels; $i++) {
|
$langs->transnoentitiesnoconv('three'),
|
||||||
$levels--;
|
$langs->transnoentitiesnoconv('four'),
|
||||||
$hundreds = (int) ($num_levels[$i] / 100);
|
$langs->transnoentitiesnoconv('five'),
|
||||||
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
|
$langs->transnoentitiesnoconv('six'),
|
||||||
$tens = (int) ($num_levels[$i] % 100);
|
$langs->transnoentitiesnoconv('seven'),
|
||||||
$singles = '';
|
$langs->transnoentitiesnoconv('eight'),
|
||||||
if ($tens < 20) {
|
$langs->transnoentitiesnoconv('nine'),
|
||||||
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
|
$langs->transnoentitiesnoconv('ten'),
|
||||||
} else {
|
$langs->transnoentitiesnoconv('eleven'),
|
||||||
$tens = (int) ($tens / 10);
|
$langs->transnoentitiesnoconv('twelve'),
|
||||||
$tens = ' '.$list2[$tens].' ';
|
$langs->transnoentitiesnoconv('thirteen'),
|
||||||
$singles = (int) ($num_levels[$i] % 10);
|
$langs->transnoentitiesnoconv('fourteen'),
|
||||||
$singles = ' '.$list1[$singles].' ';
|
$langs->transnoentitiesnoconv('fifteen'),
|
||||||
}
|
$langs->transnoentitiesnoconv('sixteen'),
|
||||||
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
|
$langs->transnoentitiesnoconv('seventeen'),
|
||||||
} //end for loop
|
$langs->transnoentitiesnoconv('eighteen'),
|
||||||
$commas = count($words);
|
$langs->transnoentitiesnoconv('nineteen')
|
||||||
if ($commas > 1) {
|
);
|
||||||
$commas = $commas - 1;
|
$list2 = array(
|
||||||
}
|
'',
|
||||||
|
$langs->transnoentitiesnoconv('ten'),
|
||||||
|
$langs->transnoentitiesnoconv('twenty'),
|
||||||
|
$langs->transnoentitiesnoconv('thirty'),
|
||||||
|
$langs->transnoentitiesnoconv('forty'),
|
||||||
|
$langs->transnoentitiesnoconv('fifty'),
|
||||||
|
$langs->transnoentitiesnoconv('sixty'),
|
||||||
|
$langs->transnoentitiesnoconv('seventy'),
|
||||||
|
$langs->transnoentitiesnoconv('eighty'),
|
||||||
|
$langs->transnoentitiesnoconv('ninety'),
|
||||||
|
$langs->transnoentitiesnoconv('hundred')
|
||||||
|
);
|
||||||
|
$list3 = array(
|
||||||
|
'',
|
||||||
|
$langs->transnoentitiesnoconv('thousand'),
|
||||||
|
$langs->transnoentitiesnoconv('million'),
|
||||||
|
$langs->transnoentitiesnoconv('billion'),
|
||||||
|
$langs->transnoentitiesnoconv('trillion'),
|
||||||
|
$langs->transnoentitiesnoconv('quadrillion')
|
||||||
|
);
|
||||||
|
|
||||||
|
$num_length = strlen($num);
|
||||||
|
$levels = (int) (($num_length + 2) / 3);
|
||||||
|
$max_length = $levels * 3;
|
||||||
|
$num = substr('00'.$num, -$max_length);
|
||||||
|
$num_levels = str_split($num, 3);
|
||||||
|
$nboflevels = count($num_levels);
|
||||||
|
for ($i = 0; $i < $nboflevels; $i++) {
|
||||||
|
$levels--;
|
||||||
|
$hundreds = (int) ($num_levels[$i] / 100);
|
||||||
|
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
|
||||||
|
$tens = (int) ($num_levels[$i] % 100);
|
||||||
|
$singles = '';
|
||||||
|
if ($tens < 20) {
|
||||||
|
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
|
||||||
|
} else {
|
||||||
|
$tens = (int) ($tens / 10);
|
||||||
|
$tens = ' '.$list2[$tens].' ';
|
||||||
|
$singles = (int) ($num_levels[$i] % 10);
|
||||||
|
$singles = ' '.$list1[$singles].' ';
|
||||||
|
}
|
||||||
|
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
|
||||||
|
} //end for loop
|
||||||
|
$commas = count($words);
|
||||||
|
if ($commas > 1) {
|
||||||
|
$commas = $commas - 1;
|
||||||
|
}
|
||||||
$concatWords = implode(' ', $words);
|
$concatWords = implode(' ', $words);
|
||||||
// Delete multi whitespaces
|
// Delete multi whitespaces
|
||||||
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
||||||
@ -138,12 +139,16 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we need to write cents call again this function for cents
|
// If we need to write cents call again this function for cents
|
||||||
if (!empty($TNum[1])) {
|
$decimalpart = $TNum[1];
|
||||||
|
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
|
||||||
|
|
||||||
|
if ($decimalpart) {
|
||||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||||
$concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true);
|
|
||||||
|
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
|
||||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
||||||
}
|
}
|
||||||
return $concatWords;
|
return $concatWords;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,10 +164,12 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
|||||||
*/
|
*/
|
||||||
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||||
{
|
{
|
||||||
// If the number is negative convert to positive and return -1 if is too long
|
// If the number is negative convert to positive and return -1 if it is too long
|
||||||
if ($numero < 0) $numero *= -1;
|
if ($numero < 0) $numero *= -1;
|
||||||
if ($numero >= 1000000000001)
|
if ($numero >= 1000000000001) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Get 2 decimals to cents, another functions round or truncate
|
// Get 2 decimals to cents, another functions round or truncate
|
||||||
$strnumber = number_format($numero, 10);
|
$strnumber = number_format($numero, 10);
|
||||||
$len = strlen($strnumber);
|
$len = strlen($strnumber);
|
||||||
|
|||||||
@ -33,11 +33,17 @@ $quality = 80;
|
|||||||
* Return if a filename is file name of a supported image format
|
* Return if a filename is file name of a supported image format
|
||||||
*
|
*
|
||||||
* @param string $file Filename
|
* @param string $file Filename
|
||||||
|
* @param int $acceptsvg 0=Default (depends on setup), 1=Always accept SVG as image files
|
||||||
* @return int -1=Not image filename, 0=Image filename but format not supported for conversion by PHP, 1=Image filename with format supported by this PHP
|
* @return int -1=Not image filename, 0=Image filename but format not supported for conversion by PHP, 1=Image filename with format supported by this PHP
|
||||||
*/
|
*/
|
||||||
function image_format_supported($file)
|
function image_format_supported($file, $acceptsvg = 0)
|
||||||
{
|
{
|
||||||
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm|\.svg'; // See also into product.class.php
|
global $conf;
|
||||||
|
|
||||||
|
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php
|
||||||
|
if ($acceptsvg || ! empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) {
|
||||||
|
$regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript
|
||||||
|
}
|
||||||
|
|
||||||
// Case filename is not a format image
|
// Case filename is not a format image
|
||||||
$reg = array();
|
$reg = array();
|
||||||
|
|||||||
@ -207,11 +207,12 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||||||
* @param string $objectname Name of object
|
* @param string $objectname Name of object
|
||||||
* @param string $newmask New mask
|
* @param string $newmask New mask
|
||||||
* @param string $readdir Directory source (use $destdir when not defined)
|
* @param string $readdir Directory source (use $destdir when not defined)
|
||||||
* @param Object $object If object was already loaded/known, it is pass to avaoid another include and new.
|
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
|
||||||
|
* @param string $moduletype 'external' or 'internal'
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
* @see rebuildObjectClass()
|
* @see rebuildObjectClass()
|
||||||
*/
|
*/
|
||||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null)
|
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
|
||||||
{
|
{
|
||||||
global $db, $langs;
|
global $db, $langs;
|
||||||
|
|
||||||
@ -223,8 +224,14 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
$pathoffiletoclasssrc = $readdir.'/class/'.strtolower($objectname).'.class.php';
|
$pathoffiletoclasssrc = $readdir.'/class/'.strtolower($objectname).'.class.php';
|
||||||
|
|
||||||
// Edit .sql file
|
// Edit .sql file
|
||||||
$pathoffiletoeditsrc = $readdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
|
if ($moduletype == 'internal') {
|
||||||
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
|
$pathoffiletoeditsrc = $readdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
|
||||||
|
$pathoffiletoedittarget = $destdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
|
||||||
|
} else {
|
||||||
|
$pathoffiletoeditsrc = $readdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql';
|
||||||
|
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql'.($readdir != $destdir ? '.new' : '');
|
||||||
|
}
|
||||||
|
|
||||||
if (!dol_is_file($pathoffiletoeditsrc))
|
if (!dol_is_file($pathoffiletoeditsrc))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@ -293,8 +300,13 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Edit .key.sql file
|
// Edit .key.sql file
|
||||||
$pathoffiletoeditsrc = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql';
|
if ($moduletype == 'internal') {
|
||||||
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : '');
|
$pathoffiletoeditsrc = $readdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql';
|
||||||
|
$pathoffiletoedittarget = $destdir.'/../install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : '');
|
||||||
|
} else {
|
||||||
|
$pathoffiletoeditsrc = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql';
|
||||||
|
$pathoffiletoedittarget = $destdir.'/sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql'.($readdir != $destdir ? '.new' : '');
|
||||||
|
}
|
||||||
|
|
||||||
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
|
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
|
||||||
|
|
||||||
|
|||||||
@ -2217,10 +2217,16 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
||||||
|
|
||||||
|
$version = $this->getVersion(0);
|
||||||
|
$versiontrans = '';
|
||||||
|
if (preg_match('/development/i', $version)) $versiontrans .= 'warning';
|
||||||
|
if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning';
|
||||||
|
if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning';
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ? ' info-box-module-disabled' : '').($this->isCoreOrExternalModule() == 'external' ? ' info-box-module-external' : '').'">
|
<div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ? ' info-box-module-disabled' : '').($this->isCoreOrExternalModule() == 'external' ? ' info-box-module-external' : '').'">
|
||||||
<div class="info-box info-box-sm info-box-module">
|
<div class="info-box info-box-sm info-box-module">
|
||||||
<div class="info-box-icon">';
|
<div class="info-box-icon'.(empty($conf->global->$const_name) ? '' : ' info-box-icon-module-enabled'.($versiontrans ? ' info-box-icon-module-warning' : '')).'">';
|
||||||
|
|
||||||
$alttext = '';
|
$alttext = '';
|
||||||
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||||
@ -2233,39 +2239,19 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
print img_object($alttext, 'generic', 'class="inline-block valignmiddle"');
|
print img_object($alttext, 'generic', 'class="inline-block valignmiddle"');
|
||||||
}
|
}
|
||||||
|
|
||||||
$version = $this->getVersion(0);
|
|
||||||
$versiontrans = '';
|
|
||||||
if (preg_match('/development/i', $version)) $versiontrans .= 'warning';
|
|
||||||
if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning';
|
|
||||||
if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning';
|
|
||||||
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
|
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
|
||||||
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
|
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
|
||||||
print $this->getVersion(1);
|
print $this->getVersion(1);
|
||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*print '<span class="info-box-icon-action">';
|
|
||||||
print '<div class="valignmiddle inline-block">';
|
|
||||||
print '<div class="valignmiddle inline-block">';
|
|
||||||
print $codeenabledisable;
|
|
||||||
print '</div>';
|
|
||||||
print '<div class="valignmiddle inline-block marginleftonly">';
|
|
||||||
print $codetoconfig;
|
|
||||||
print '</div>';
|
|
||||||
print '</div>';
|
|
||||||
print '</span>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</div>
|
print '</div>
|
||||||
<div class="info-box-content info-box-text-module">
|
<div class="info-box-content info-box-text-module'.(empty($conf->global->$const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'">
|
||||||
<span class="info-box-title">'.$this->getName().'</span>
|
<span class="info-box-title">'.$this->getName().'</span>
|
||||||
<span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
|
<span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
|
||||||
|
|
||||||
/*print '<span class="info-box-icon-version" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
|
|
||||||
print $this->getVersion(1);
|
|
||||||
print '</span>'; */
|
|
||||||
|
|
||||||
print '<div class="valignmiddle inline-block info-box-more">';
|
print '<div class="valignmiddle inline-block info-box-more">';
|
||||||
|
//if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' ';
|
||||||
print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||||
print '</div><br>';
|
print '</div><br>';
|
||||||
|
|
||||||
|
|||||||
@ -1100,7 +1100,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param TCPDF $pdf PDF
|
||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class modPaymentByBankTransfer extends DolibarrModules
|
|||||||
$this->description = "Management of payment by bank transfer";
|
$this->description = "Management of payment by bank transfer";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||||
$this->version = 'development';
|
$this->version = 'dolibarr';
|
||||||
|
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
// Name of png file (without png) used for this module
|
// Name of png file (without png) used for this module
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class modRecruitment extends DolibarrModules
|
|||||||
// Used only if file README.md and README-LL.md not found.
|
// Used only if file README.md and README-LL.md not found.
|
||||||
$this->descriptionlong = "Manage and follow recruitment campaign for new job positions";
|
$this->descriptionlong = "Manage and follow recruitment campaign for new job positions";
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = 'development';
|
$this->version = 'experimental';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class modGeneratePassStandard extends ModeleGenPassword
|
|||||||
public function __construct($db, $conf, $langs, $user)
|
public function __construct($db, $conf, $langs, $user)
|
||||||
{
|
{
|
||||||
$this->id = "standard";
|
$this->id = "standard";
|
||||||
$this->length = 8;
|
$this->length = 10;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->conf = $conf;
|
$this->conf = $conf;
|
||||||
|
|||||||
@ -183,7 +183,7 @@ class pdf_stdmovement extends ModelePDFMovement
|
|||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
* @param StockMovements $object Object source to build document
|
* @param MouvementStock $object Object source to build document
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
|
|||||||
@ -552,7 +552,6 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$pdf->MultiCell(35, 4, str_pad(price($object->amount).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', 1);
|
$pdf->MultiCell(35, 4, str_pad(price($object->amount).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', 1);
|
||||||
$posy += 10;
|
$posy += 10;
|
||||||
|
|
||||||
|
|
||||||
// City
|
// City
|
||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy);
|
||||||
$pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', 1);
|
$pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', 1);
|
||||||
@ -592,9 +591,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$pdf->SetTextColor(0, 0, 0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('', '', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
|
|
||||||
$titre = strtoupper($mysoc->town).', le '.date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y");
|
/*$titre = strtoupper($mysoc->town).' - '.dol_print_date(dol_now(), 'day', 'tzserver', $outputlangs);
|
||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top - 6);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3) - 60, $tab_top - 6);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);*/
|
||||||
|
|
||||||
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
|
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
|
||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top);
|
||||||
@ -754,7 +753,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
|
|
||||||
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||||
|
|
||||||
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object);
|
$usecontact = 0;
|
||||||
|
|
||||||
|
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object);
|
||||||
|
|
||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox = 90;
|
$widthrecbox = 90;
|
||||||
|
|||||||
@ -27,6 +27,10 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
|
|||||||
if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') {
|
if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') {
|
||||||
print '<th class="liste_titre thseparator"></th>';
|
print '<th class="liste_titre thseparator"></th>';
|
||||||
} else {
|
} else {
|
||||||
|
if (! empty($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]) && is_object($langs)) {
|
||||||
|
$langs->load($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]);
|
||||||
|
}
|
||||||
|
|
||||||
$tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
|
$tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
|
||||||
|
|
||||||
print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n";
|
print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n";
|
||||||
|
|||||||
@ -2463,6 +2463,7 @@ class Expedition extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'rouget';
|
$modele = 'rouget';
|
||||||
|
|||||||
@ -109,7 +109,7 @@ $hookmanager->initHooks(array('expensereportlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('expensereport');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ $hookmanager->initHooks(array('interventionlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('fichinter');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -293,9 +293,9 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate an order
|
* Validate an invoice
|
||||||
*
|
*
|
||||||
* @param int $id Order ID
|
* @param int $id Invoice ID
|
||||||
* @param int $idwarehouse Warehouse ID
|
* @param int $idwarehouse Warehouse ID
|
||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
*
|
*
|
||||||
@ -325,7 +325,7 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
|
|
||||||
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
|
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
throw new RestException(304, 'Error nothing done. The invoice is already validated');
|
||||||
}
|
}
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
|
throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
|
||||||
@ -454,6 +454,7 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
||||||
$paiement->paiementid = $paiementid;
|
$paiement->paiementid = $paiementid;
|
||||||
$paiement->paiementcode = dol_getIdFromCode($this->db, $paiementid, 'c_paiement', 'id', 'code', 1);
|
$paiement->paiementcode = dol_getIdFromCode($this->db, $paiementid, 'c_paiement', 'id', 'code', 1);
|
||||||
|
$paiement->oper = $paiement->paiementcode; // For backward compatibility
|
||||||
$paiement->num_payment = $num_payment;
|
$paiement->num_payment = $num_payment;
|
||||||
$paiement->note_public = $comment;
|
$paiement->note_public = $comment;
|
||||||
|
|
||||||
|
|||||||
@ -187,6 +187,8 @@ class SupplierOrders extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Create supplier order object
|
* Create supplier order object
|
||||||
*
|
*
|
||||||
|
* Example: {"ref": "auto", "ref_supplier": "1234", "socid": "1", "multicurrency_code": "SEK", "multicurrency_tx": 1, "tva_tx": 25, "note": "Imported via the REST API"}
|
||||||
|
*
|
||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of supplier order
|
* @return int ID of supplier order
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2966,6 +2966,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'muscadet';
|
$modele = 'muscadet';
|
||||||
|
|||||||
@ -1259,7 +1259,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn';
|
||||||
$sql .= ' SET paye = 1, fk_statut=2';
|
$sql .= ' SET paye = 1, fk_statut = '.self::STATUS_CLOSED;
|
||||||
$sql .= ' WHERE rowid = '.$this->id;
|
$sql .= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
dol_syslog("FactureFournisseur::set_paid", LOG_DEBUG);
|
dol_syslog("FactureFournisseur::set_paid", LOG_DEBUG);
|
||||||
@ -2267,7 +2267,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
if ($option == 'document') $url = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id;
|
if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id.'&type=bank-transfer';
|
||||||
|
elseif ($option == 'document') $url = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id;
|
||||||
else $url = DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$this->id;
|
else $url = DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$this->id;
|
||||||
|
|
||||||
if ($short) return $url;
|
if ($short) return $url;
|
||||||
@ -2641,6 +2642,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
// Set the model on the model name to use
|
// Set the model on the model name to use
|
||||||
if (empty($modele))
|
if (empty($modele))
|
||||||
|
|||||||
@ -463,11 +463,26 @@ if (empty($reshook))
|
|||||||
if ($idprod > 0)
|
if ($idprod > 0)
|
||||||
{
|
{
|
||||||
$label = $productsupplier->label;
|
$label = $productsupplier->label;
|
||||||
|
// Define output language
|
||||||
|
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||||
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if (empty($newlang) && GETPOST('lang_id', 'aZ09'))
|
||||||
|
$newlang = GETPOST('lang_id', 'aZ09');
|
||||||
|
if (empty($newlang))
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
if (!empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
$desc = (!empty($productsupplier->multilangs [$outputlangs->defaultlang] ["description"])) ? $productsupplier->multilangs [$outputlangs->defaultlang] ["description"] : $productsupplier->description;
|
||||||
|
} else {
|
||||||
|
$desc = $productsupplier->description;
|
||||||
|
}
|
||||||
// if we use supplier description of the products
|
// if we use supplier description of the products
|
||||||
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
}
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
|
|||||||
@ -743,7 +743,8 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
print '<td class="right">'.$langs->trans("SupplierRef").'</td>';
|
print '<td class="right">'.$langs->trans("SupplierRef").'</td>';
|
||||||
print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
|
print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
|
||||||
print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
|
print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
|
||||||
print '<td class="right">'.$langs->trans("QtyToDispatchShort").'</td>';
|
print ' <td class="right">'.$langs->trans("QtyToDispatchShort");
|
||||||
|
print '<br><a href="#" id="autoreset">'.$langs->trans("Reset").'</a></td>';
|
||||||
print '<td width="32"></td>';
|
print '<td width="32"></td>';
|
||||||
|
|
||||||
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
|
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
|
||||||
@ -1068,7 +1069,16 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$("select[name=fk_default_warehouse]").change(function() {
|
$("select[name=fk_default_warehouse]").change(function() {
|
||||||
var fk_default_warehouse = $("option:selected", this).val();
|
var fk_default_warehouse = $("option:selected", this).val();
|
||||||
$("select[name^=entrepot_]").val(fk_default_warehouse).change();
|
$("select[name^=entrepot_]").val(fk_default_warehouse).change();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
jQuery("#autoreset").click(function() {';
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $nbproduct) {
|
||||||
|
print ' jQuery("#qty_0_'.$i.'").val("");';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print '
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,7 @@ $hookmanager->initHooks(array('supplierorderlist'));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('commande_fournisseur');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
@ -27,10 +27,10 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
|
|
||||||
$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers'));
|
$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers'));
|
||||||
|
|
||||||
|
|||||||
@ -356,7 +356,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
$dashboardlines[$board->element] = $board->load_board($user);
|
$dashboardlines[$board->element] = $board->load_board($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of commercial proposals opened (expired)
|
// Number of commercial proposals open (expired)
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
|
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
$board = new Propal($db);
|
$board = new Propal($db);
|
||||||
@ -365,7 +365,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
$dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
|
$dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of commercial proposals opened (expired)
|
// Number of commercial proposals open (expired)
|
||||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||||
$board = new SupplierProposal($db);
|
$board = new SupplierProposal($db);
|
||||||
@ -407,14 +407,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
//$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
|
//$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of invoices customers (has paid)
|
// Number of invoices customers (paid)
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$board = new Facture($db);
|
$board = new Facture($db);
|
||||||
$dashboardlines[$board->element] = $board->load_board($user);
|
$dashboardlines[$board->element] = $board->load_board($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of supplier invoices (has paid)
|
// Number of supplier invoices (paid)
|
||||||
if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) {
|
if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
$board = new FactureFournisseur($db);
|
$board = new FactureFournisseur($db);
|
||||||
@ -715,21 +715,35 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
$textLate = '';
|
$textLate = '';
|
||||||
if ($board->nbtodolate > 0) {
|
if ($board->nbtodolate > 0) {
|
||||||
$textLate .= ' <span title="'.dol_htmlentities($textLateTitle).'" class="classfortooltip badge badge-warning">';
|
$textLate .= '<span title="'.dol_htmlentities($textLateTitle).'" class="classfortooltip badge badge-warning">';
|
||||||
$textLate .= '<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
|
$textLate .= '<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
|
||||||
$textLate .= '</span>';
|
$textLate .= '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$openedDashBoard .= '<div class="info-box-line">';
|
||||||
|
|
||||||
$nbtodClass = '';
|
$nbtodClass = '';
|
||||||
if ($board->nbtodo > 0) {
|
if ($board->nbtodo > 0) {
|
||||||
$nbtodClass = 'badge badge-info';
|
$nbtodClass = 'badge badge-info';
|
||||||
}
|
}
|
||||||
|
|
||||||
$openedDashBoard .= ' <a href="'.$board->url.'" class="info-box-text">'.$infoName.' : <span class="'.$nbtodClass.' classfortooltip" title="'.$board->label.'" >'.$board->nbtodo.'</span>'.$textLate.'</a>'."\n";
|
$openedDashBoard .= ' <a href="'.$board->url.'" class="info-box-text info-box-text-a">'.$infoName.' : <span class="'.$nbtodClass.' classfortooltip" title="'.$board->label.'" >'.$board->nbtodo.'</span>';
|
||||||
|
if ($textLate) {
|
||||||
|
if ($board->url_late) {
|
||||||
|
$openedDashBoard .= '</a>';
|
||||||
|
$openedDashBoard .= ' <a href="'.$board->url_late.'" class="info-box-text info-box-text-a paddingleft">';
|
||||||
|
} else {
|
||||||
|
$openedDashBoard .= ' ';
|
||||||
|
}
|
||||||
|
$openedDashBoard .= $textLate;
|
||||||
|
}
|
||||||
|
$openedDashBoard .= '</a>'."\n";
|
||||||
|
|
||||||
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
||||||
$openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text">'.$langs->trans('Total').' : '.price($board->total).'</a>';
|
$openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text">'.$langs->trans('Total').' : '.price($board->total).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$openedDashBoard .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$openedDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
|
$openedDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
|
||||||
|
|||||||
@ -81,6 +81,7 @@ ALTER TABLE llx_c_incoterms ADD COLUMN label varchar(100) NULL;
|
|||||||
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL,
|
||||||
label varchar(255) NOT NULL,
|
label varchar(255) NOT NULL,
|
||||||
qty integer DEFAULT 1 NOT NULL,
|
qty integer DEFAULT 1 NOT NULL,
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
@ -89,6 +90,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
|
|||||||
fk_user_supervisor integer,
|
fk_user_supervisor integer,
|
||||||
fk_establishment integer,
|
fk_establishment integer,
|
||||||
date_planned date,
|
date_planned date,
|
||||||
|
remuneration_suggested varchar(255),
|
||||||
description text,
|
description text,
|
||||||
note_public text,
|
note_public text,
|
||||||
note_private text,
|
note_private text,
|
||||||
@ -113,6 +115,8 @@ ALTER TABLE llx_recruitment_recruitmentjobposition ADD CONSTRAINT llx_recruitmen
|
|||||||
ALTER TABLE llx_recruitment_recruitmentjobposition ADD INDEX idx_recruitment_recruitmentjobposition_status (status);
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD INDEX idx_recruitment_recruitmentjobposition_status (status);
|
||||||
|
|
||||||
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN email_recruiter varchar(255);
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN email_recruiter varchar(255);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN entity INTEGER DEFAULT 1 NOT NULL;
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN remuneration_suggested varchar(255);
|
||||||
|
|
||||||
create table llx_recruitment_recruitmentjobposition_extrafields
|
create table llx_recruitment_recruitmentjobposition_extrafields
|
||||||
(
|
(
|
||||||
@ -125,6 +129,51 @@ create table llx_recruitment_recruitmentjobposition_extrafields
|
|||||||
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD INDEX idx_fk_object(fk_object);
|
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD INDEX idx_fk_object(fk_object);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE llx_recruitment_recruitmentcandidature(
|
||||||
|
-- BEGIN MODULEBUILDER FIELDS
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
fk_recruitmentjobposition INTEGER NOT NULL,
|
||||||
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
description text,
|
||||||
|
note_public text,
|
||||||
|
note_private text,
|
||||||
|
date_creation datetime NOT NULL,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer NOT NULL,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key varchar(14),
|
||||||
|
model_pdf varchar(255),
|
||||||
|
status smallint NOT NULL,
|
||||||
|
firstname varchar(128),
|
||||||
|
lastname varchar(128),
|
||||||
|
remuneration_requested integer,
|
||||||
|
remuneration_proposed integer
|
||||||
|
-- END MODULEBUILDER FIELDS
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_rowid (rowid);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_ref (ref);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_recruitment_recruitmentcandidature_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_status (status);
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_recruitment_recruitmentcandidature_extrafields
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
tms timestamp,
|
||||||
|
fk_object integer NOT NULL,
|
||||||
|
import_key varchar(14) -- import key
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_fk_object(fk_object);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Add dictionary for prospect level and action commercial on contacts (Using this is not recommanded)
|
-- Add dictionary for prospect level and action commercial on contacts (Using this is not recommanded)
|
||||||
|
|
||||||
create table llx_c_prospectcontactlevel
|
create table llx_c_prospectcontactlevel
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
-- Copyright (C) 2020 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/.
|
||||||
|
|
||||||
|
|
||||||
|
-- BEGIN MODULEBUILDER INDEXES
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_rowid (rowid);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_ref (ref);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_recruitment_recruitmentcandidature_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_status (status);
|
||||||
|
-- END MODULEBUILDER INDEXES
|
||||||
|
|
||||||
|
--ALTER TABLE llx_mymodule_myobject ADD UNIQUE INDEX uk_mymodule_myobject_fieldxy(fieldx, fieldy);
|
||||||
|
|
||||||
|
--ALTER TABLE llx_mymodule_myobject ADD CONSTRAINT llx_mymodule_myobject_fk_field FOREIGN KEY (fk_field) REFERENCES llx_mymodule_myotherobject(rowid);
|
||||||
|
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
-- Copyright (C) 2020 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/.
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE llx_recruitment_recruitmentcandidature(
|
||||||
|
-- BEGIN MODULEBUILDER FIELDS
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
fk_recruitmentjobposition INTEGER NOT NULL,
|
||||||
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
description text,
|
||||||
|
note_public text,
|
||||||
|
note_private text,
|
||||||
|
date_creation datetime NOT NULL,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer NOT NULL,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key varchar(14),
|
||||||
|
model_pdf varchar(255),
|
||||||
|
status smallint NOT NULL,
|
||||||
|
firstname varchar(128),
|
||||||
|
lastname varchar(128),
|
||||||
|
remuneration_requested integer,
|
||||||
|
remuneration_proposed integer
|
||||||
|
-- END MODULEBUILDER FIELDS
|
||||||
|
) ENGINE=innodb;
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
-- Copyright (C) 2020 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/.
|
||||||
|
|
||||||
|
|
||||||
|
-- BEGIN MODULEBUILDER INDEXES
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_fk_object(fk_object);
|
||||||
|
-- END MODULEBUILDER INDEXES
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
-- Copyright (C) 2020 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/.
|
||||||
|
|
||||||
|
create table llx_recruitment_recruitmentcandidature_extrafields
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
tms timestamp,
|
||||||
|
fk_object integer NOT NULL,
|
||||||
|
import_key varchar(14) -- import key
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
@ -17,7 +17,8 @@
|
|||||||
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
||||||
-- BEGIN MODULEBUILDER FIELDS
|
-- BEGIN MODULEBUILDER FIELDS
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL,
|
||||||
label varchar(255) NOT NULL,
|
label varchar(255) NOT NULL,
|
||||||
qty integer DEFAULT 1 NOT NULL,
|
qty integer DEFAULT 1 NOT NULL,
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
@ -26,7 +27,8 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
|
|||||||
email_recruiter varchar(255),
|
email_recruiter varchar(255),
|
||||||
fk_user_supervisor integer,
|
fk_user_supervisor integer,
|
||||||
fk_establishment integer,
|
fk_establishment integer,
|
||||||
date_planned date,
|
date_planned date,
|
||||||
|
remuneration_suggested varchar(255),
|
||||||
description text,
|
description text,
|
||||||
note_public text,
|
note_public text,
|
||||||
note_private text,
|
note_private text,
|
||||||
|
|||||||
@ -546,9 +546,9 @@ Module54Desc=Management of contracts (services or recurring subscriptions)
|
|||||||
Module55Name=Barcodes
|
Module55Name=Barcodes
|
||||||
Module55Desc=Barcode management
|
Module55Desc=Barcode management
|
||||||
Module56Name=Payment by credit transfer
|
Module56Name=Payment by credit transfer
|
||||||
Module56Desc=Management of payment of suppliers by credit transfer orders. It includes generation of SEPA file for European countries.
|
Module56Desc=Management of payment of suppliers by Credit Transfer orders. It includes generation of SEPA file for European countries.
|
||||||
Module57Name=Bank Direct Debit payments
|
Module57Name=Payments by Direct Debit
|
||||||
Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries.
|
Module57Desc=Management of Direct Debit orders. It includes generation of SEPA file for European countries.
|
||||||
Module58Name=ClickToDial
|
Module58Name=ClickToDial
|
||||||
Module58Desc=Integration of a ClickToDial system (Asterisk, ...)
|
Module58Desc=Integration of a ClickToDial system (Asterisk, ...)
|
||||||
Module59Name=Bookmark4u
|
Module59Name=Bookmark4u
|
||||||
|
|||||||
@ -83,6 +83,7 @@ BoxTitleLatestModifiedSupplierOrders=Vendor Orders: last %s modified
|
|||||||
BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified
|
BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified
|
||||||
BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified
|
BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified
|
||||||
BoxTitleLastModifiedPropals=Latest %s modified proposals
|
BoxTitleLastModifiedPropals=Latest %s modified proposals
|
||||||
|
BoxTitleLatestModifiedJobPositions=Latest %s modified jobs
|
||||||
ForCustomersInvoices=Customers invoices
|
ForCustomersInvoices=Customers invoices
|
||||||
ForCustomersOrders=Customers orders
|
ForCustomersOrders=Customers orders
|
||||||
ForProposals=Proposals
|
ForProposals=Proposals
|
||||||
|
|||||||
@ -688,6 +688,7 @@ Method=Method
|
|||||||
Receive=Receive
|
Receive=Receive
|
||||||
CompleteOrNoMoreReceptionExpected=Complete or nothing more expected
|
CompleteOrNoMoreReceptionExpected=Complete or nothing more expected
|
||||||
ExpectedValue=Expected Value
|
ExpectedValue=Expected Value
|
||||||
|
ExpectedQty=Expected Qty
|
||||||
PartialWoman=Partial
|
PartialWoman=Partial
|
||||||
TotalWoman=Total
|
TotalWoman=Total
|
||||||
NeverReceived=Never received
|
NeverReceived=Never received
|
||||||
@ -944,6 +945,39 @@ ShortThursday=T
|
|||||||
ShortFriday=F
|
ShortFriday=F
|
||||||
ShortSaturday=S
|
ShortSaturday=S
|
||||||
ShortSunday=S
|
ShortSunday=S
|
||||||
|
one=one
|
||||||
|
two=two
|
||||||
|
three=three
|
||||||
|
four=four
|
||||||
|
five=five
|
||||||
|
six=six
|
||||||
|
seven=seven
|
||||||
|
eight=eight
|
||||||
|
nine=nine
|
||||||
|
ten=ten
|
||||||
|
eleven=eleven
|
||||||
|
twelve=twelve
|
||||||
|
thirteen=thirdteen
|
||||||
|
fourteen=fourteen
|
||||||
|
fifteen=fifteen
|
||||||
|
sixteen=sixteen
|
||||||
|
seventeen=seventeen
|
||||||
|
eighteen=eighteen
|
||||||
|
nineteen=nineteen
|
||||||
|
twenty=twenty
|
||||||
|
thirty=thirty
|
||||||
|
forty=forty
|
||||||
|
fifty=fifty
|
||||||
|
sixty=sixty
|
||||||
|
seventy=seventy
|
||||||
|
eighty=eighty
|
||||||
|
ninety=ninety
|
||||||
|
hundred=hundred
|
||||||
|
thousand=thousand
|
||||||
|
million=million
|
||||||
|
billion=billion
|
||||||
|
trillion=trillion
|
||||||
|
quadrillion=quadrillion
|
||||||
SelectMailModel=Select an email template
|
SelectMailModel=Select an email template
|
||||||
SetRef=Set ref
|
SetRef=Set ref
|
||||||
Select2ResultFoundUseArrows=Some results found. Use arrows to select.
|
Select2ResultFoundUseArrows=Some results found. Use arrows to select.
|
||||||
|
|||||||
@ -236,4 +236,5 @@ ForceTo=Force to
|
|||||||
AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances)
|
AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances)
|
||||||
StockAtDatePastDesc=You can view here the stock (real stock) at a given date in the past
|
StockAtDatePastDesc=You can view here the stock (real stock) at a given date in the past
|
||||||
StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in future
|
StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in future
|
||||||
CurrentStock=Current stock
|
CurrentStock=Current stock
|
||||||
|
InventoryRealQtyHelp=Set value to 0 to reset qty<br>Keep field empty, or remove line, to keep unchanged
|
||||||
@ -63,7 +63,9 @@ InvoiceRefused=Invoice refused (Charge the rejection to customer)
|
|||||||
StatusDebitCredit=Status debit/credit
|
StatusDebitCredit=Status debit/credit
|
||||||
StatusWaiting=Waiting
|
StatusWaiting=Waiting
|
||||||
StatusTrans=Sent
|
StatusTrans=Sent
|
||||||
|
StatusDebited=Debited
|
||||||
StatusCredited=Credited
|
StatusCredited=Credited
|
||||||
|
StatusPaid=Paid
|
||||||
StatusRefused=Refused
|
StatusRefused=Refused
|
||||||
StatusMotif0=Unspecified
|
StatusMotif0=Unspecified
|
||||||
StatusMotif1=Insufficient funds
|
StatusMotif1=Insufficient funds
|
||||||
@ -77,13 +79,13 @@ StatusMotif8=Other reason
|
|||||||
CreateForSepaFRST=Create direct debit file (SEPA FRST)
|
CreateForSepaFRST=Create direct debit file (SEPA FRST)
|
||||||
CreateForSepaRCUR=Create direct debit file (SEPA RCUR)
|
CreateForSepaRCUR=Create direct debit file (SEPA RCUR)
|
||||||
CreateAll=Create direct debit file (all)
|
CreateAll=Create direct debit file (all)
|
||||||
CreateFileForPaymentByBankTransfer=Create file for credit transfer (all)
|
CreateFileForPaymentByBankTransfer=Create file for credit transfer
|
||||||
CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA)
|
CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA)
|
||||||
CreateGuichet=Only office
|
CreateGuichet=Only office
|
||||||
CreateBanque=Only bank
|
CreateBanque=Only bank
|
||||||
OrderWaiting=Waiting for treatment
|
OrderWaiting=Waiting for treatment
|
||||||
NotifyTransmision=File transmission
|
NotifyTransmision=Record file transmission of order
|
||||||
NotifyCredit=Withdrawal Credit
|
NotifyCredit=Record credit of order
|
||||||
NumeroNationalEmetter=National Transmitter Number
|
NumeroNationalEmetter=National Transmitter Number
|
||||||
WithBankUsingRIB=For bank accounts using RIB
|
WithBankUsingRIB=For bank accounts using RIB
|
||||||
WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT
|
WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT
|
||||||
@ -143,3 +145,4 @@ InfoTransData=Amount: %s<br>Method: %s<br>Date: %s
|
|||||||
InfoRejectSubject=Direct debit payment order refused
|
InfoRejectSubject=Direct debit payment order refused
|
||||||
InfoRejectMessage=Hello,<br><br>the direct debit payment order of invoice %s related to the company %s, with an amount of %s has been refused by the bank.<br><br>--<br>%s
|
InfoRejectMessage=Hello,<br><br>the direct debit payment order of invoice %s related to the company %s, with an amount of %s has been refused by the bank.<br><br>--<br>%s
|
||||||
ModeWarning=Option for real mode was not set, we stop after this simulation
|
ModeWarning=Option for real mode was not set, we stop after this simulation
|
||||||
|
ErrorCompanyHasDuplicateDefaultBAN=Company with id %s has more than one default bank account. No way to know wich one to use.
|
||||||
@ -77,7 +77,7 @@ StatusMotif8=Autre motif
|
|||||||
CreateForSepaFRST=Créer fichier de prélèvement (SEPA FRST)
|
CreateForSepaFRST=Créer fichier de prélèvement (SEPA FRST)
|
||||||
CreateForSepaRCUR=Créer fichier de prélèvement (SEPA RCUR)
|
CreateForSepaRCUR=Créer fichier de prélèvement (SEPA RCUR)
|
||||||
CreateAll=Créer le fichier de prélèvement (tout)
|
CreateAll=Créer le fichier de prélèvement (tout)
|
||||||
CreateFileForPaymentByBankTransfer=Créer fichier pour les virements (tous)
|
CreateFileForPaymentByBankTransfer=Créer un fichier de virement
|
||||||
CreateSepaFileForPaymentByBankTransfer=Créer un fichier de virement (SEPA)
|
CreateSepaFileForPaymentByBankTransfer=Créer un fichier de virement (SEPA)
|
||||||
CreateGuichet=Seulement guichet
|
CreateGuichet=Seulement guichet
|
||||||
CreateBanque=Seulement banque
|
CreateBanque=Seulement banque
|
||||||
|
|||||||
@ -1035,6 +1035,7 @@ class Livraison extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'typhon';
|
$modele = 'typhon';
|
||||||
|
|||||||
@ -95,6 +95,85 @@ $result = restrictedArea($user, 'modulebuilder', null);
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Define $listofmodules
|
||||||
|
$dirsrootforscan = array($dirread);
|
||||||
|
// Add also the core modules into the list of modules to show/edit
|
||||||
|
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) { $dirsrootforscan[] = DOL_DOCUMENT_ROOT; }
|
||||||
|
|
||||||
|
// Search modules to edit
|
||||||
|
$textforlistofdirs = '<!-- Scanned dir -->'."\n";
|
||||||
|
$listofmodules = array();
|
||||||
|
$i = 0;
|
||||||
|
foreach ($dirsrootforscan as $dirread)
|
||||||
|
{
|
||||||
|
$moduletype = 'external';
|
||||||
|
if ($dirread == DOL_DOCUMENT_ROOT) {
|
||||||
|
$moduletype = 'internal';
|
||||||
|
}
|
||||||
|
|
||||||
|
$dirsincustom = dol_dir_list($dirread, 'directories');
|
||||||
|
if (is_array($dirsincustom) && count($dirsincustom) > 0) {
|
||||||
|
foreach ($dirsincustom as $dircustomcursor) {
|
||||||
|
$fullname = $dircustomcursor['fullname'];
|
||||||
|
if (dol_is_file($fullname.'/'.$FILEFLAG))
|
||||||
|
{
|
||||||
|
// Get real name of module (MyModule instead of mymodule)
|
||||||
|
$dirtoscanrel = basename($fullname).'/core/modules/';
|
||||||
|
|
||||||
|
$descriptorfiles = dol_dir_list(dirname($fullname).'/'.$dirtoscanrel, 'files', 0, 'mod.*\.class\.php$');
|
||||||
|
if (empty($descriptorfiles)) // If descriptor not found into module dir, we look into main module dir.
|
||||||
|
{
|
||||||
|
$dirtoscanrel = 'core/modules/';
|
||||||
|
$descriptorfiles = dol_dir_list($fullname.'/../'.$dirtoscanrel, 'files', 0, 'mod'.strtoupper(basename($fullname)).'\.class\.php$');
|
||||||
|
}
|
||||||
|
$modulenamewithcase = '';
|
||||||
|
$moduledescriptorrelpath = '';
|
||||||
|
$moduledescriptorfullpath = '';
|
||||||
|
|
||||||
|
foreach ($descriptorfiles as $descriptorcursor) {
|
||||||
|
$modulenamewithcase = preg_replace('/^mod/', '', $descriptorcursor['name']);
|
||||||
|
$modulenamewithcase = preg_replace('/\.class\.php$/', '', $modulenamewithcase);
|
||||||
|
$moduledescriptorrelpath = $dirtoscanrel.$descriptorcursor['name'];
|
||||||
|
$moduledescriptorfullpath = $descriptorcursor['fullname'];
|
||||||
|
//var_dump($descriptorcursor);
|
||||||
|
}
|
||||||
|
if ($modulenamewithcase)
|
||||||
|
{
|
||||||
|
$listofmodules[$dircustomcursor['name']] = array(
|
||||||
|
'modulenamewithcase'=>$modulenamewithcase,
|
||||||
|
'moduledescriptorrelpath'=> $moduledescriptorrelpath,
|
||||||
|
'moduledescriptorfullpath'=>$moduledescriptorfullpath,
|
||||||
|
'moduledescriptorrootpath'=>$dirread,
|
||||||
|
'moduletype'=>$moduletype
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//var_dump($listofmodules);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($forceddirread && empty($listofmodules)) // $forceddirread is 1 if we forced dir to read with dirins=... or with module=...@mydir
|
||||||
|
{
|
||||||
|
$listofmodules[strtolower($module)] = array(
|
||||||
|
'modulenamewithcase'=>$module,
|
||||||
|
'moduledescriptorrelpath'=> 'notyetimplemented',
|
||||||
|
'moduledescriptorfullpath'=> 'notyetimplemented',
|
||||||
|
'moduledescriptorrootpath'=> 'notyetimplemented',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show description of content
|
||||||
|
$newdircustom = $dirins;
|
||||||
|
if (empty($newdircustom)) $newdircustom = img_warning();
|
||||||
|
// If dirread was forced to somewhere else, by using URL
|
||||||
|
// htdocs/modulebuilder/index.php?module=Inventory@/home/ldestailleur/git/dolibarr/htdocs/product
|
||||||
|
if (empty($i)) $textforlistofdirs .= $langs->trans("DirScanned").' : ';
|
||||||
|
else $textforlistofdirs .= ', ';
|
||||||
|
$textforlistofdirs .= '<strong class="wordbreakimp">'.$dirread.'</strong>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -214,7 +293,6 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||||
|
|
||||||
//var_dump($result);
|
//var_dump($result);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -769,6 +847,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
|||||||
{
|
{
|
||||||
$objectname = ucfirst($objectname);
|
$objectname = ucfirst($objectname);
|
||||||
|
|
||||||
|
$dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||||
|
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
|
||||||
|
|
||||||
if (preg_match('/[^a-z0-9_]/i', $objectname))
|
if (preg_match('/[^a-z0-9_]/i', $objectname))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -1076,6 +1157,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
|||||||
|
|
||||||
$objectname = $tabobj;
|
$objectname = $tabobj;
|
||||||
|
|
||||||
|
$dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||||
|
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
|
||||||
|
|
||||||
$srcdir = $dirread.'/'.strtolower($module);
|
$srcdir = $dirread.'/'.strtolower($module);
|
||||||
$destdir = $dirins.'/'.strtolower($module);
|
$destdir = $dirins.'/'.strtolower($module);
|
||||||
dol_mkdir($destdir);
|
dol_mkdir($destdir);
|
||||||
@ -1125,7 +1209,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
|||||||
// Edit the class file to write properties
|
// Edit the class file to write properties
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry);
|
$moduletype = 'external';
|
||||||
|
|
||||||
|
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
||||||
if (is_numeric($object) && $object <= 0)
|
if (is_numeric($object) && $object <= 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -1135,7 +1221,9 @@ if ($dirins && $action == 'addproperty' && !empty($module) && !empty($tabobj))
|
|||||||
// Edit sql with new properties
|
// Edit sql with new properties
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object);
|
$moduletype = 'external';
|
||||||
|
|
||||||
|
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object, $moduletype);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -1477,79 +1565,11 @@ print load_fiche_titre($text, '', 'title_setup');
|
|||||||
|
|
||||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModuleBuilderDesc", 'https://wiki.dolibarr.org/index.php/Module_development#Create_your_module').'</span><br>';
|
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModuleBuilderDesc", 'https://wiki.dolibarr.org/index.php/Module_development#Create_your_module').'</span><br>';
|
||||||
|
|
||||||
$dirsrootforscan = array($dirread);
|
print $textforlistofdirs;
|
||||||
// Add also the core modules into the list of modules to show/edit
|
|
||||||
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) { $dirsrootforscan[] = DOL_DOCUMENT_ROOT; }
|
|
||||||
|
|
||||||
// Search modules to edit
|
|
||||||
print '<!-- Scanned dir -->'."\n";
|
|
||||||
$listofmodules = array();
|
|
||||||
$i = 0;
|
|
||||||
foreach ($dirsrootforscan as $dirread)
|
|
||||||
{
|
|
||||||
$dirsincustom = dol_dir_list($dirread, 'directories');
|
|
||||||
if (is_array($dirsincustom) && count($dirsincustom) > 0) {
|
|
||||||
foreach ($dirsincustom as $dircustomcursor) {
|
|
||||||
$fullname = $dircustomcursor['fullname'];
|
|
||||||
if (dol_is_file($fullname.'/'.$FILEFLAG))
|
|
||||||
{
|
|
||||||
// Get real name of module (MyModule instead of mymodule)
|
|
||||||
$dirtoscanrel = basename($fullname).'/core/modules/';
|
|
||||||
|
|
||||||
$descriptorfiles = dol_dir_list(dirname($fullname).'/'.$dirtoscanrel, 'files', 0, 'mod.*\.class\.php$');
|
|
||||||
if (empty($descriptorfiles)) // If descriptor not found into module dir, we look into main module dir.
|
|
||||||
{
|
|
||||||
$dirtoscanrel = 'core/modules/';
|
|
||||||
$descriptorfiles = dol_dir_list($fullname.'/../'.$dirtoscanrel, 'files', 0, 'mod'.strtoupper(basename($fullname)).'\.class\.php$');
|
|
||||||
}
|
|
||||||
$modulenamewithcase = '';
|
|
||||||
$moduledescriptorrelpath = '';
|
|
||||||
$moduledescriptorfullpath = '';
|
|
||||||
|
|
||||||
foreach ($descriptorfiles as $descriptorcursor) {
|
|
||||||
$modulenamewithcase = preg_replace('/^mod/', '', $descriptorcursor['name']);
|
|
||||||
$modulenamewithcase = preg_replace('/\.class\.php$/', '', $modulenamewithcase);
|
|
||||||
$moduledescriptorrelpath = $dirtoscanrel.$descriptorcursor['name'];
|
|
||||||
$moduledescriptorfullpath = $descriptorcursor['fullname'];
|
|
||||||
//var_dump($descriptorcursor);
|
|
||||||
}
|
|
||||||
if ($modulenamewithcase)
|
|
||||||
{
|
|
||||||
$listofmodules[$dircustomcursor['name']] = array(
|
|
||||||
'modulenamewithcase'=>$modulenamewithcase,
|
|
||||||
'moduledescriptorrelpath'=> $moduledescriptorrelpath,
|
|
||||||
'moduledescriptorfullpath'=>$moduledescriptorfullpath,
|
|
||||||
'moduledescriptorrootpath'=>$dirread
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//var_dump($listofmodules);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($forceddirread && empty($listofmodules)) // $forceddirread is 1 if we forced dir to read with dirins=... or with module=...@mydir
|
|
||||||
{
|
|
||||||
$listofmodules[strtolower($module)] = array(
|
|
||||||
'modulenamewithcase'=>$module,
|
|
||||||
'moduledescriptorrelpath'=> 'notyetimplemented',
|
|
||||||
'moduledescriptorfullpath'=> 'notyetimplemented',
|
|
||||||
'moduledescriptorrootpath'=> 'notyetimplemented',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show description of content
|
|
||||||
$newdircustom = $dirins;
|
|
||||||
if (empty($newdircustom)) $newdircustom = img_warning();
|
|
||||||
// If dirread was forced to somewhere else, by using URL
|
|
||||||
// htdocs/modulebuilder/index.php?module=Inventory@/home/ldestailleur/git/dolibarr/htdocs/product
|
|
||||||
if (empty($i)) print $langs->trans("DirScanned").' : ';
|
|
||||||
else print ', ';
|
|
||||||
print '<strong class="wordbreakimp">'.$dirread.'</strong>';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
//var_dump($listofmodules);
|
//var_dump($listofmodules);
|
||||||
|
|
||||||
|
|
||||||
$message = '';
|
$message = '';
|
||||||
if (!$dirins)
|
if (!$dirins)
|
||||||
{
|
{
|
||||||
@ -1583,7 +1603,6 @@ $error = 0;
|
|||||||
$moduleobj = null;
|
$moduleobj = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule')
|
if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule')
|
||||||
{
|
{
|
||||||
$modulelowercase = strtolower($module);
|
$modulelowercase = strtolower($module);
|
||||||
@ -1835,6 +1854,8 @@ if ($module == 'initmodule')
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
// Note module is inside $dirread
|
||||||
|
|
||||||
if ($tab == 'description')
|
if ($tab == 'description')
|
||||||
{
|
{
|
||||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||||
@ -2315,29 +2336,31 @@ if ($module == 'initmodule')
|
|||||||
$pathtopicto = strtolower($module).'/img/object_'.strtolower($tabobj).'.png';
|
$pathtopicto = strtolower($module).'/img/object_'.strtolower($tabobj).'.png';
|
||||||
$pathtoscript = strtolower($module).'/scripts/'.strtolower($tabobj).'.php';
|
$pathtoscript = strtolower($module).'/scripts/'.strtolower($tabobj).'.php';
|
||||||
|
|
||||||
//var_dump($pathtolib);
|
//var_dump($pathtoclass); var_dump($dirread);
|
||||||
$realpathtoclass = dol_buildpath($pathtoclass, 0, 2);
|
$realpathtoclass = $dirread.'/'.$pathtoclass;
|
||||||
$realpathtoapi = dol_buildpath($pathtoapi, 0, 2);
|
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||||
$realpathtoagenda = dol_buildpath($pathtoagenda, 0, 2);
|
$realpathtoagenda = $dirread.'/'.$pathtoagenda;
|
||||||
$realpathtocard = dol_buildpath($pathtocard, 0, 2);
|
$realpathtocard = $dirread.'/'.$pathtocard;
|
||||||
$realpathtodocument = dol_buildpath($pathtodocument, 0, 2);
|
$realpathtodocument = $dirread.'/'.$pathtodocument;
|
||||||
$realpathtolist = dol_buildpath($pathtolist, 0, 2);
|
$realpathtolist = $dirread.'/'.$pathtolist;
|
||||||
$realpathtonote = dol_buildpath($pathtonote, 0, 2);
|
$realpathtonote = $dirread.'/'.$pathtonote;
|
||||||
$realpathtophpunit = dol_buildpath($pathtophpunit, 0, 2);
|
$realpathtophpunit = $dirread.'/'.$pathtophpunit;
|
||||||
$realpathtosql = dol_buildpath($pathtosql, 0, 2);
|
$realpathtosql = $dirread.'/'.$pathtosql;
|
||||||
$realpathtosqlextra = dol_buildpath($pathtosqlextra, 0, 2);
|
$realpathtosqlextra = $dirread.'/'.$pathtosqlextra;
|
||||||
$realpathtosqlkey = dol_buildpath($pathtosqlkey, 0, 2);
|
$realpathtosqlkey = $dirread.'/'.$pathtosqlkey;
|
||||||
$realpathtosqlextrakey = dol_buildpath($pathtosqlextrakey, 0, 2);
|
$realpathtosqlextrakey = $dirread.'/'.$pathtosqlextrakey;
|
||||||
$realpathtolib = dol_buildpath($pathtolib, 0, 2);
|
$realpathtolib = $dirread.'/'.$pathtolib;
|
||||||
$realpathtoobjlib = dol_buildpath($pathtoobjlib, 0, 2);
|
$realpathtoobjlib = $dirread.'/'.$pathtoobjlib;
|
||||||
$realpathtopicto = dol_buildpath($pathtopicto, 0, 2);
|
$realpathtopicto = $dirread.'/'.$pathtopicto;
|
||||||
$realpathtoscript = dol_buildpath($pathtoscript, 0, 2);
|
$realpathtoscript = $dirread.'/'.$pathtoscript;
|
||||||
|
|
||||||
if (empty($realpathtoapi)) // For compatibility with some old modules
|
if (empty($realpathtoapi)) // For compatibility with some old modules
|
||||||
{
|
{
|
||||||
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
||||||
$realpathtoapi = dol_buildpath($pathtoapi, 0, 2);
|
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||||
}
|
}
|
||||||
|
$urloflist = $dirread.'/'.$pathtolist;
|
||||||
|
$urlofcard = $dirread.'/'.$pathtocard;
|
||||||
|
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').$pathtoclass.($realpathtoclass ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').$pathtoclass.($realpathtoclass ? '' : '</strike>').'</strong>';
|
||||||
@ -2423,9 +2446,6 @@ if ($module == 'initmodule')
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
$urloflist = dol_buildpath($pathtolist, 1);
|
|
||||||
$urlofcard = dol_buildpath($pathtocard, 1);
|
|
||||||
|
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForList").' : <strong><a href="'.$urloflist.'" target="_test">'.($realpathtolist ? '' : '<strike>').$pathtolist.($realpathtolist ? '' : '</strike>').'</a></strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForList").' : <strong><a href="'.$urloflist.'" target="_test">'.($realpathtolist ? '' : '<strike>').$pathtolist.($realpathtolist ? '' : '</strike>').'</a></strong>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
@ -2472,7 +2492,7 @@ if ($module == 'initmodule')
|
|||||||
|
|
||||||
if (function_exists('opcache_invalidate')) opcache_invalidate($dirread.'/'.$pathtoclass, true); // remove the include cache hell !
|
if (function_exists('opcache_invalidate')) opcache_invalidate($dirread.'/'.$pathtoclass, true); // remove the include cache hell !
|
||||||
|
|
||||||
if (empty($forceddirread))
|
if (empty($forceddirread) && empty($dirread))
|
||||||
{
|
{
|
||||||
$result = dol_include_once($pathtoclass);
|
$result = dol_include_once($pathtoclass);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -310,7 +310,7 @@ class MyObject extends CommonObject
|
|||||||
foreach ($object->array_options as $key => $option)
|
foreach ($object->array_options as $key => $option)
|
||||||
{
|
{
|
||||||
$shortkey = preg_replace('/options_/', '', $key);
|
$shortkey = preg_replace('/options_/', '', $key);
|
||||||
if (!empty($extrafields->attributes[$this->element]['unique'][$shortkey]))
|
if (!empty($extrafields->attributes[$this->table_element]['unique'][$shortkey]))
|
||||||
{
|
{
|
||||||
//var_dump($key); var_dump($clonedObj->array_options[$key]); exit;
|
//var_dump($key); var_dump($clonedObj->array_options[$key]); exit;
|
||||||
unset($object->array_options[$key]);
|
unset($object->array_options[$key]);
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
# DO NOT DELETE THIS FILE MANUALLY
|
# DO NOT DELETE THIS FILE MANUALLY
|
||||||
# File to flag module built using official module template.
|
# File to flag module built using official module template.
|
||||||
# When this file is present into a module directory, you can edit it with the module builder tool. Use ModuleBuilder if you want to delete module.
|
# When this file is present into a module directory, you can edit it with the module builder tool.
|
||||||
@ -106,7 +106,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("DraftOrders").($num?'<span class="badge marginleftonlyshort">'.$num.'</span>':'').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftMyObjects").($num?'<span class="badge marginleftonlyshort">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
@ -117,22 +117,17 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
print '<tr class="oddeven"><td class="nowrap">';
|
||||||
$orderstatic->id=$obj->rowid;
|
|
||||||
$orderstatic->ref=$obj->ref;
|
$myobjectstatic->id=$obj->rowid;
|
||||||
$orderstatic->ref_client=$obj->ref_client;
|
$myobjectstatic->ref=$obj->ref;
|
||||||
$orderstatic->total_ht = $obj->total_ht;
|
$myobjectstatic->ref_client=$obj->ref_client;
|
||||||
$orderstatic->total_tva = $obj->total_tva;
|
$myobjectstatic->total_ht = $obj->total_ht;
|
||||||
$orderstatic->total_ttc = $obj->total_ttc;
|
$myobjectstatic->total_tva = $obj->total_tva;
|
||||||
print $orderstatic->getNomUrl(1);
|
$myobjectstatic->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
print $myobjectstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->client=$obj->client;
|
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
$companystatic->canvas=$obj->canvas;
|
|
||||||
print $companystatic->getNomUrl(1,'customer',16);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
@ -171,14 +166,12 @@ $max = 3;
|
|||||||
// Last modified myobject
|
// Last modified myobject
|
||||||
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
|
||||||
$sql.= ", s.code_client";
|
$sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql.= " WHERE s.entity IN (".getEntity($myobjectstatic->element).")";
|
||||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
//if ($socid) $sql.= " AND s.rowid = $socid";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if ($socid) $sql.= " AND s.rowid = $socid";
|
|
||||||
$sql .= " ORDER BY s.tms DESC";
|
$sql .= " ORDER BY s.tms DESC";
|
||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
@ -191,9 +184,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="2">';
|
print '<th colspan="2">';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
|
print $langs->trans("BoxTitleLatestModifiedMyObjects", $max);
|
||||||
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
|
|
||||||
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
|
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -202,28 +193,23 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$companystatic->id=$objp->rowid;
|
|
||||||
$companystatic->name=$objp->name;
|
$myobjectstatic->id=$objp->rowid;
|
||||||
$companystatic->client=$objp->client;
|
$myobjectstatic->ref=$objp->ref;
|
||||||
$companystatic->code_client = $objp->code_client;
|
$myobjectstatic->label=$objp->label;
|
||||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
$myobjectstatic->status = $objp->status;
|
||||||
$companystatic->canvas=$objp->canvas;
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
|
print '<td class="nowrap">'.$myobjectstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="right nowrap">';
|
print '<td class="right nowrap">';
|
||||||
print $companystatic->getLibCustProspStatut();
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
|
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms), 'day')."</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
|||||||
@ -287,13 +287,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$formconfirm = '';
|
$formconfirm = '';
|
||||||
|
|
||||||
// Confirmation to delete
|
// Confirmation to delete
|
||||||
if ($action == 'delete')
|
if ($action == 'delete') {
|
||||||
{
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
// Confirmation to delete line
|
// Confirmation to delete line
|
||||||
if ($action == 'deleteline')
|
if ($action == 'deleteline') {
|
||||||
{
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
}
|
}
|
||||||
// Clone confirmation
|
// Clone confirmation
|
||||||
@ -345,19 +343,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
//if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
|
//if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref .= ' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
@ -470,27 +468,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Back to draft
|
// Back to draft
|
||||||
if ($object->status == $object::STATUS_VALIDATED)
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
{
|
if ($permissiontoadd) {
|
||||||
if ($permissiontoadd)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->status == $object::STATUS_DRAFT)
|
if ($object->status == $object::STATUS_DRAFT) {
|
||||||
{
|
if ($permissiontoadd) {
|
||||||
if ($permissiontoadd)
|
|
||||||
{
|
|
||||||
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0))
|
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes">'.$langs->trans("Validate").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes">'.$langs->trans("Validate").'</a>';
|
||||||
@ -502,31 +495,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=myobject">'.$langs->trans("ToClone").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=myobject">'.$langs->trans("ToClone").'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($object->status == $object::STATUS_ENABLED)
|
if ($object->status == $object::STATUS_ENABLED) {
|
||||||
{
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($object->status == $object::STATUS_VALIDATED)
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
{
|
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Re-Open").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,6 +286,9 @@ class Products extends DolibarrApi
|
|||||||
|
|
||||||
foreach ($request_data as $field => $value) {
|
foreach ($request_data as $field => $value) {
|
||||||
if ($field == 'id') { continue;
|
if ($field == 'id') { continue;
|
||||||
|
}
|
||||||
|
if ($field == 'stock_reel') {
|
||||||
|
throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead');
|
||||||
}
|
}
|
||||||
$this->product->$field = $value;
|
$this->product->$field = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4428,6 +4428,7 @@ class Product extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
// Positionne le modele sur le nom du modele a utiliser
|
// Positionne le modele sur le nom du modele a utiliser
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
|
|||||||
@ -22,9 +22,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("stocks", "other"));
|
$langs->loadLangs(array("stocks", "other"));
|
||||||
@ -49,7 +51,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
|||||||
$object = new Inventory($db);
|
$object = new Inventory($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
|
$diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
$hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array
|
$hookmanager->initHooks(array('inventorycard', '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);
|
||||||
@ -76,11 +78,19 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
|
||||||
{
|
{
|
||||||
|
$permissiontoread = $user->rights->stock->lire;
|
||||||
$permissiontoadd = $user->rights->stock->creer;
|
$permissiontoadd = $user->rights->stock->creer;
|
||||||
$permissiontodelete = $user->rights->stock->supprimer;
|
$permissiontodelete = $user->rights->stock->supprimer;
|
||||||
|
$permissionnote = $user->rights->stock->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
$permissiondellink = $user->rights->stock->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
$upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
} else {
|
} else {
|
||||||
|
$permissiontoread = $user->rights->stock->inventory_advance->read;
|
||||||
$permissiontoadd = $user->rights->stock->inventory_advance->write;
|
$permissiontoadd = $user->rights->stock->inventory_advance->write;
|
||||||
$permissiontodelete = $user->rights->stock->inventory_advance->write;
|
$permissiontodelete = $user->rights->stock->inventory_advance->write;
|
||||||
|
$permissionnote = $user->rights->stock->inventory_advance->write; // Used by the include of actions_setnotes.inc.php
|
||||||
|
$permissiondellink = $user->rights->stock->inventory_advance->write; // Used by the include of actions_dellink.inc.php
|
||||||
|
$upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +108,15 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
$backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
|
||||||
|
|
||||||
// Actions cancel, add, update, delete or clone
|
if (empty($backtopage) || ($cancel && empty($id))) {
|
||||||
|
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||||
|
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist;
|
||||||
|
else $backtopage = dol_buildpath('/product/inventory/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$triggermodname = 'STOCK_INVENTORY_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||||
|
|
||||||
|
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||||
|
|
||||||
// Actions when linking object each other
|
// Actions when linking object each other
|
||||||
@ -107,11 +125,26 @@ if (empty($reshook))
|
|||||||
// Actions when printing a doc from card
|
// Actions when printing a doc from card
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
|
// Action to move up and down lines of object
|
||||||
|
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
|
||||||
|
|
||||||
|
// Action to build doc
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
|
/*if ($action == 'set_thirdparty' && $permissiontoadd)
|
||||||
|
{
|
||||||
|
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
|
||||||
|
}*/
|
||||||
|
if ($action == 'classin' && $permissiontoadd)
|
||||||
|
{
|
||||||
|
$object->setProject(GETPOST('projectid', 'int'));
|
||||||
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
|
$triggersendname = 'INVENTORY_SENTBYMAIL';
|
||||||
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
$autocopy='MAIN_MAIL_AUTOCOPY_INVENTORY_TO';
|
||||||
$trackid='myobject'.$object->id;
|
$trackid='stockinv'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -122,8 +155,12 @@ if (empty($reshook))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans('Inventory'), '');
|
$title = $langs->trans("Inventory");
|
||||||
|
$help_url = '';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
// Example : Adding jquery code
|
// Example : Adding jquery code
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
@ -149,10 +186,14 @@ if ($action == 'create')
|
|||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form 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 '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||||
|
|
||||||
dol_fiche_head(array(), '');
|
dol_fiche_head(array(), '');
|
||||||
|
|
||||||
|
// Set some default values
|
||||||
|
//if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue';
|
||||||
|
|
||||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
@ -184,12 +225,13 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form 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="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
|
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
print '<table class="border centpercent tableforfieldedit">'."\n";
|
||||||
|
|
||||||
// Common attributes
|
// Common attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
||||||
@ -220,11 +262,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
// Confirmation to delete
|
// Confirmation to delete
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
// Confirmation to delete line
|
// Confirmation to delete line
|
||||||
if ($action == 'deleteline')
|
if ($action == 'deleteline') {
|
||||||
{
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,7 +273,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if ($action == 'clone') {
|
if ($action == 'clone') {
|
||||||
// Create an array for form
|
// Create an array for form
|
||||||
$formquestion = array();
|
$formquestion = array();
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Confirmation of action xxxx
|
||||||
|
if ($action == 'xxx')
|
||||||
|
{
|
||||||
|
$formquestion = array();
|
||||||
|
/*
|
||||||
|
$forcecombo=0;
|
||||||
|
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
|
||||||
|
$formquestion = array(
|
||||||
|
// 'text' => $langs->trans("ConfirmClone"),
|
||||||
|
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||||
|
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||||
|
// array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call Hook formConfirm
|
// Call Hook formConfirm
|
||||||
@ -261,19 +319,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($user->rights->inventory->creer)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($action != 'classify')
|
if ($action != 'classify')
|
||||||
{
|
{
|
||||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
@ -282,7 +340,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.=$proj->getNomUrl();
|
$morehtmlref .= $proj->getNomUrl();
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.='';
|
$morehtmlref.='';
|
||||||
}
|
}
|
||||||
@ -329,21 +387,43 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($permissiontoadd)
|
// Back to draft
|
||||||
|
if ($object->status == $object::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
if ($permissiontoadd)
|
||||||
} else {
|
{
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($permissiontoadd)
|
// Modify
|
||||||
|
if ($object->status == $object::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Validate").'</a>'."\n";
|
if ($permissiontoadd)
|
||||||
} else {
|
{
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Validate').'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($permissiontodelete)
|
// Validate
|
||||||
|
if ($object->status == $object::STATUS_DRAFT)
|
||||||
|
{
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes">'.$langs->trans("Validate").' ('.$langs->trans("Start").')</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clone
|
||||||
|
/*if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=myobject">'.$langs->trans("ToClone").'</a>'."\n";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
|
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
@ -365,14 +445,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents
|
// Documents
|
||||||
/*$objref = dol_sanitizeFileName($object->ref);
|
if ($includedocgeneration) {
|
||||||
$relativepath = $comref . '/' . $comref . '.pdf';
|
$objref = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->mymodule->dir_output . '/' . $objref;
|
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref;
|
||||||
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
|
$genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
|
||||||
print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
$delallowed = $user->rights->mymodule->myobject->write; // If you can create/edit, you can remove a file on card
|
||||||
*/
|
print $formfile->showdocuments('mymodule:MyObject', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||||
|
}
|
||||||
|
|
||||||
// Show links to link elements
|
// Show links to link elements
|
||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory'));
|
||||||
@ -397,7 +478,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
|
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
/*
|
|
||||||
if (GETPOST('modelselected')) $action = 'presend';
|
if (GETPOST('modelselected')) $action = 'presend';
|
||||||
|
|
||||||
// Presend form
|
// Presend form
|
||||||
@ -407,7 +487,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$trackid = 'stockinv'.$object->id;
|
$trackid = 'stockinv'.$object->id;
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -228,7 +228,101 @@ class Inventory extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function create(User $user, $notrigger = false)
|
public function create(User $user, $notrigger = false)
|
||||||
{
|
{
|
||||||
return $this->createCommon($user, $notrigger);
|
$result = $this->createCommon($user, $notrigger);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate inventory (start it)
|
||||||
|
*
|
||||||
|
* @param User $user User that creates
|
||||||
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, Id of created object if OK
|
||||||
|
*/
|
||||||
|
public function validate(User $user, $notrigger = false)
|
||||||
|
{
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$result = 0;
|
||||||
|
|
||||||
|
if ($result >= 0) {
|
||||||
|
// Scan existing stock to prefill the inventory
|
||||||
|
$sql = 'SELECT ps.rowid, ps.fk_entrepot as fk_warehouse, ps.fk_product, ps.reel,';
|
||||||
|
$sql .= ' pb.batch, pb.qty';
|
||||||
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'product_stock as ps';
|
||||||
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_batch as pb ON pb.fk_product_stock = ps.rowid,';
|
||||||
|
$sql .= ' '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'entrepot as e';
|
||||||
|
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||||
|
$sql .= ' AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid';
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND p.fk_product_type = 0";
|
||||||
|
if ($object->fk_product > 0) $sql .= ' AND ps.fk_product = '.$object->fk_product;
|
||||||
|
if ($object->fk_warehouse > 0) $sql .= ' AND ps.fk_entrepot = '.$object->fk_warehouse;
|
||||||
|
|
||||||
|
$inventoryline = new InventoryLine($this->db);
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
|
$inventoryline->fk_inventory = $this->id;
|
||||||
|
$inventoryline->fk_warehouse = $obj->fk_warehouse;
|
||||||
|
$inventoryline->fk_product = $obj->fk_product;
|
||||||
|
$inventoryline->batch = $obj->batch;
|
||||||
|
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
|
||||||
|
$inventoryline->datec = dol_now();
|
||||||
|
|
||||||
|
$resultline = $inventoryline->create($user);
|
||||||
|
if ($resultline <= 0) {
|
||||||
|
$this->error = $inventoryline->error;
|
||||||
|
$this->errors = $inventoryline->errors;
|
||||||
|
$result = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result = -1;
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($result >= 0) {
|
||||||
|
$result = $this->setStatut($this::STATUS_VALIDATED, null, '', 'INVENTORY_VALIDATED');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$this->db->commit();
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Go back to draft
|
||||||
|
*
|
||||||
|
* @param User $user User that creates
|
||||||
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, Id of created object if OK
|
||||||
|
*/
|
||||||
|
public function setDraft(User $user, $notrigger = false)
|
||||||
|
{
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$result = $this->setStatut($this::STATUS_DRAFT, null, '', 'INVENTORY_DRAFT');
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$this->db->commit();
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -412,10 +506,13 @@ class Inventory extends CommonObject
|
|||||||
|
|
||||||
$labelStatus = array();
|
$labelStatus = array();
|
||||||
$labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
$labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
$labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
$labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' ('.$langs->trans('Started').')';
|
||||||
$labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
$labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
||||||
|
$labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
|
$labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Started');
|
||||||
|
$labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
||||||
|
|
||||||
return dolGetStatus($labelStatus[$status], $labelStatus[$status], '', 'status'.$status, $mode);
|
return dolGetStatus($labelStatus[$status], $labelStatusShort[$status], '', 'status'.$status, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -506,7 +603,6 @@ class InventoryLine extends CommonObjectLine
|
|||||||
*/
|
*/
|
||||||
public $picto = 'stock';
|
public $picto = 'stock';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format.
|
* 'type' if the field format.
|
||||||
* 'label' the translation key.
|
* 'label' the translation key.
|
||||||
@ -546,6 +642,28 @@ class InventoryLine extends CommonObjectLine
|
|||||||
*/
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
|
public $fk_inventory;
|
||||||
|
public $fk_warehouse;
|
||||||
|
public $fk_product;
|
||||||
|
public $batch;
|
||||||
|
public $datec;
|
||||||
|
public $tms;
|
||||||
|
public $qty_stock;
|
||||||
|
public $qty_view;
|
||||||
|
public $qty_regulated;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create object in database
|
||||||
|
*
|
||||||
|
* @param User $user User that creates
|
||||||
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function create(User $user, $notrigger = false)
|
||||||
|
{
|
||||||
|
return $this->createCommon($user, $notrigger);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
|
|||||||
@ -250,7 +250,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
|
|
||||||
// Buttons for actions
|
// Buttons for actions
|
||||||
if ($action == 'edit') {
|
if ($action == 'record') {
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form 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="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@ -276,19 +276,36 @@ if ($object->id > 0)
|
|||||||
{
|
{
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Edit").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_validate&confirm=yes">'.$langs->trans("Validate").' ('.$langs->trans("Start").')</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Edit').'</a>'."\n";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Validate').' ('.$langs->trans("Start").')</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->status == Inventory::STATUS_DRAFT)
|
if ($object->status == Inventory::STATUS_VALIDATED)
|
||||||
|
{
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($conf->barcode->enabled) {
|
||||||
|
print '<a href="#" class="butAction">'.$langs->trans("UpdateByScanningProductBarcode").'</a>';
|
||||||
|
}
|
||||||
|
if ($conf->productbatch->enabled) {
|
||||||
|
print '<a href="#" class="butAction">'.$langs->trans('UpdateByScaningLot').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=savecurrent">'.$langs->trans("Save").'</a>'."\n";
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Save').'</a>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->status == Inventory::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=record">'.$langs->trans("Finish").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Validate').'</a>'."\n";
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Finish').'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,24 +342,25 @@ if ($object->id > 0)
|
|||||||
print $langs->trans("Batch");
|
print $langs->trans("Batch");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td class="right">'.$langs->trans("RecordedQty").'</td>';
|
print '<td class="right">'.$langs->trans("ExpectedQty").'</td>';
|
||||||
print '<td class="right">'.$langs->trans("RealQty").'</td>';
|
print '<td class="center">';
|
||||||
print '<td>';
|
print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp"));
|
||||||
|
print '</td>';
|
||||||
|
// Actions
|
||||||
|
print '<td class="center">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Request to show lines of inventory (prefilled during creation)
|
||||||
$sql = 'SELECT ps.rowid, ps.fk_entrepot as fk_warehouse, ps.fk_product';
|
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'entrepot as e';
|
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
|
||||||
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
|
||||||
$sql .= ' AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid';
|
$sql .= ' WHERE id.fk_inventory = '.$object->id;
|
||||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql .= " AND p.fk_product_type = 0";
|
|
||||||
if ($object->fk_product > 0) $sql .= ' AND ps.fk_product = '.$object->fk_product;
|
|
||||||
if ($object->fk_warehouse > 0) $sql .= ' AND ps.fk_entrepot = '.$object->fk_warehouse;
|
|
||||||
|
|
||||||
$cacheOfProducts = array();
|
$cacheOfProducts = array();
|
||||||
$cacheOfWarehouses = array();
|
$cacheOfWarehouses = array();
|
||||||
|
|
||||||
|
//$sql = '';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -386,18 +404,18 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
if ($conf->productbatch->enabled) {
|
if ($conf->productbatch->enabled) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '';
|
print $obj->batch;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
print '';
|
print 'TODO';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td class="center">';
|
||||||
print '';
|
print '<input type="text" class="maxwidth75" name="id_'.$obj->rowid.' value="'.GETPOST("id_".$obj->rowid).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
print '';
|
print img_delete();
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -107,7 +107,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label('product');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
if (empty($action)) $action = 'list';
|
if (empty($action)) $action = 'list';
|
||||||
|
|||||||
@ -859,6 +859,7 @@ class Entrepot extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'standard';
|
$modele = 'standard';
|
||||||
|
|||||||
@ -1167,6 +1167,7 @@ class MouvementStock extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'stdmovement';
|
$modele = 'stdmovement';
|
||||||
|
|||||||
@ -231,7 +231,7 @@ foreach ($search as $key => $val)
|
|||||||
if ($search[$key] == '-1') $search[$key] = '';
|
if ($search[$key] == '-1') $search[$key] = '';
|
||||||
$mode_search = 2;
|
$mode_search = 2;
|
||||||
}
|
}
|
||||||
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : 't.' . $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||||
}
|
}
|
||||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
|
|||||||
@ -749,11 +749,7 @@ if ($id > 0 || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
// Actions buttons
|
||||||
/* */
|
|
||||||
/* Barre d'action */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|
||||||
|
|||||||
@ -29,16 +29,15 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
||||||
<?php
|
<?php
|
||||||
|
$productref = '';
|
||||||
|
if ($object->element == 'product') $productref = $object->ref;
|
||||||
|
|
||||||
$productref = '';
|
$langs->load("productbatch");
|
||||||
if ($object->element == 'product') $productref = $object->ref;
|
|
||||||
|
|
||||||
$langs->load("productbatch");
|
|
||||||
|
|
||||||
|
|
||||||
if (empty($id)) $id = $object->id;
|
if (empty($id)) $id = $object->id;
|
||||||
|
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
function init_price()
|
function init_price()
|
||||||
{
|
{
|
||||||
@ -53,65 +52,50 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("StockCorrection"), '', 'generic');
|
print load_fiche_titre($langs->trans("StockCorrection"), '', 'generic');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="correct_stock">';
|
print '<input type="hidden" name="action" value="correct_stock">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Warehouse or product
|
// Warehouse or product
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
if ($object->element == 'product')
|
if ($object->element == 'product') {
|
||||||
{
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$ident = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ? GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
|
$ident = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ? GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
|
||||||
if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||||
print $formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
|
print $formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
|
||||||
print ' <select name="mouvement" id="mouvement">';
|
print ' <select class="button buttongen" name="mouvement" id="mouvement">';
|
||||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||||
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if ($object->element == 'stock')
|
if ($object->element == 'stock') {
|
||||||
{
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
|
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
|
||||||
print ' <select name="mouvement" id="mouvement">';
|
print ' <select class="button buttongen" name="mouvement" id="mouvement">';
|
||||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||||
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
|
||||||
print '<td><input name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>';
|
print '<td><input name="nbpiece" id="nbpiece" class="maxwidth75" value="'.GETPOST("nbpiece").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Purchase price
|
// Serial / Eat-by date
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("UnitPurchaseValue").'</td>';
|
|
||||||
print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
|
|
||||||
if (!empty($conf->projet->enabled))
|
|
||||||
{
|
|
||||||
print '<td>'.$langs->trans('Project').'</td>';
|
|
||||||
print '<td>';
|
|
||||||
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Serial / Eat-by date
|
|
||||||
if (!empty($conf->productbatch->enabled) &&
|
if (!empty($conf->productbatch->enabled) &&
|
||||||
(($object->element == 'product' && $object->hasbatch())
|
(($object->element == 'product' && $object->hasbatch())
|
||||||
|| ($object->element == 'stock'))
|
|| ($object->element == 'stock'))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
||||||
@ -130,26 +114,39 @@ if (!empty($conf->productbatch->enabled) &&
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label of mouvement of id of inventory
|
// Purchase price and project
|
||||||
$valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));
|
print '<tr>';
|
||||||
print '<tr>';
|
print '<td>'.$langs->trans("UnitPurchaseValue").'</td>';
|
||||||
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
print '<td colspan="'.(!empty($conf->projet->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
|
||||||
print '<td>';
|
if (!empty($conf->projet->enabled))
|
||||||
print '<input type="text" name="label" class="minwidth300" value="'.$valformovementlabel.'">';
|
{
|
||||||
print '</td>';
|
print '<td>'.$langs->trans('Project').'</td>';
|
||||||
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"]) ?GETPOST("inventorycode", 'alpha') : dol_print_date(dol_now(), '%y%m%d%H%M%S')).'"></td>';
|
print '<td>';
|
||||||
print '</tr>';
|
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
// Label of mouvement of id of inventory
|
||||||
|
$valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref));
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="text" name="label" class="minwidth300" value="'.$valformovementlabel.'">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"]) ?GETPOST("inventorycode", 'alpha') : dol_print_date(dol_now(), '%y%m%d%H%M%S')).'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print '</table>';
|
||||||
|
|
||||||
print '<div class="center">';
|
dol_fiche_end();
|
||||||
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '</form>';
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
?>
|
?>
|
||||||
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
||||||
|
|||||||
@ -29,16 +29,16 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
||||||
<?php
|
<?php
|
||||||
$productref = '';
|
$productref = '';
|
||||||
if ($object->element == 'product') $productref = $object->ref;
|
if ($object->element == 'product') $productref = $object->ref;
|
||||||
|
|
||||||
$langs->load("productbatch");
|
$langs->load("productbatch");
|
||||||
|
|
||||||
if (empty($id)) $id = $object->id;
|
if (empty($id)) $id = $object->id;
|
||||||
|
|
||||||
$pdluoid = GETPOST('pdluoid', 'int');
|
$pdluoid = GETPOST('pdluoid', 'int');
|
||||||
|
|
||||||
$pdluo = new Productbatch($db);
|
$pdluo = new Productbatch($db);
|
||||||
|
|
||||||
if ($pdluoid > 0)
|
if ($pdluoid > 0)
|
||||||
{
|
{
|
||||||
@ -51,49 +51,47 @@ if ($pdluoid > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
|
print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
if ($pdluoid)
|
if ($pdluoid)
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
|
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
|
||||||
}
|
}
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Source warehouse or product
|
// Source warehouse or product
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
if ($object->element == 'product')
|
if ($object->element == 'product') {
|
||||||
{
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
|
print $formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if ($object->element == 'stock')
|
if ($object->element == 'stock') {
|
||||||
{
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
|
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
|
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>';
|
print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>';
|
||||||
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
|
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td colspan="3"><input type="text" name="nbpiece" size="10" value="'.dol_escape_htmltag(GETPOST("nbpiece")).'"></td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td colspan="3"><input type="text" name="nbpiece" size="10" value="'.dol_escape_htmltag(GETPOST("nbpiece")).'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Serial / Eat-by date
|
// Serial / Eat-by date
|
||||||
if (!empty($conf->productbatch->enabled) &&
|
if (!empty($conf->productbatch->enabled) &&
|
||||||
(($object->element == 'product' && $object->hasbatch())
|
(($object->element == 'product' && $object->hasbatch())
|
||||||
|| ($object->element == 'stock'))
|
|| ($object->element == 'stock'))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
||||||
@ -118,26 +116,26 @@ if (!empty($conf->productbatch->enabled) &&
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
$valformovementlabel = (GETPOST("label") ?GETPOST("label") : $langs->trans("MovementTransferStock", $productref));
|
$valformovementlabel = (GETPOST("label") ?GETPOST("label") : $langs->trans("MovementTransferStock", $productref));
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag($valformovementlabel).'">';
|
print '<input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag($valformovementlabel).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"]) ?GETPOST("inventorycode", 'alpha') : dol_print_date(dol_now(), '%y%m%d%H%M%S')).'"></td>';
|
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"]) ?GETPOST("inventorycode", 'alpha') : dol_print_date(dol_now(), '%y%m%d%H%M%S')).'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
?>
|
?>
|
||||||
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
||||||
|
|||||||
@ -73,11 +73,11 @@ $cancel != $langs->trans("Cancel") &&
|
|||||||
$current_lang = $langs->getDefaultLang();
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
// update de l'objet
|
// update de l'objet
|
||||||
if ($_POST["forcelangprod"] == $current_lang)
|
if ($_POST["forcelangprod"] == $current_lang) {
|
||||||
{
|
|
||||||
$object->label = $_POST["libelle"];
|
$object->label = $_POST["libelle"];
|
||||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||||
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
||||||
|
$object->update($object->id, $user);
|
||||||
} else {
|
} else {
|
||||||
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
||||||
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||||
@ -85,8 +85,7 @@ $cancel != $langs->trans("Cancel") &&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sauvegarde en base
|
// sauvegarde en base
|
||||||
if ($object->setMultiLangs($user) > 0)
|
if ($object->setMultiLangs($user) > 0) {
|
||||||
{
|
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
} else {
|
||||||
$action = 'add';
|
$action = 'add';
|
||||||
|
|||||||
@ -119,8 +119,7 @@ $object = new Task($db);
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
//$extrafields->fetch_name_optionals_label('projet');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$extrafields->fetch_name_optionals_label('projet_task');
|
|
||||||
|
|
||||||
$arrayfields = array();
|
$arrayfields = array();
|
||||||
/*$arrayfields=array(
|
/*$arrayfields=array(
|
||||||
|
|||||||
@ -178,12 +178,12 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans($object->error), null, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (!$error && !empty($object->id) > 0)
|
if (!$error && !empty($object->id) > 0)
|
||||||
|
|||||||
@ -1,4 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/* Copyright (C) 2013-2020 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// variable $listofopplabel and $listofoppstatus should be defined
|
||||||
|
|
||||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
|
$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";
|
||||||
@ -54,7 +72,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
|||||||
$labelStatus = '';
|
$labelStatus = '';
|
||||||
|
|
||||||
$code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code');
|
$code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code');
|
||||||
if ($code) $labelStatus = $langs->trans("OppStatus".$code);
|
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
|
||||||
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
|
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
|
||||||
|
|
||||||
//$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
|
//$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
|
||||||
|
|||||||
@ -127,10 +127,12 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice
|
|||||||
$ipaddress = $_SESSION['ipaddress'];
|
$ipaddress = $_SESSION['ipaddress'];
|
||||||
$errormessage = $_SESSION['errormessage'];
|
$errormessage = $_SESSION['errormessage'];
|
||||||
|
|
||||||
// Call trigger
|
if (is_object($object) && method_exists($object, 'call_trigger')) {
|
||||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
// Call trigger
|
||||||
if ($result < 0) $error++;
|
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
||||||
// End call triggers
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
// Send an email
|
// Send an email
|
||||||
$sendemail = '';
|
$sendemail = '';
|
||||||
|
|||||||
@ -186,7 +186,7 @@ if ($urllogo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br><br>';
|
||||||
|
|
||||||
|
|
||||||
if (!empty($conf->paypal->enabled))
|
if (!empty($conf->paypal->enabled))
|
||||||
@ -593,8 +593,8 @@ if ($ispaymentok)
|
|||||||
{
|
{
|
||||||
// Record payment
|
// Record payment
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$invoice = new Facture($db);
|
$object = new Facture($db);
|
||||||
$result = $invoice->fetch($tmptag['INV']);
|
$result = $object->fetch($tmptag['INV']);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||||
@ -623,9 +623,9 @@ if ($ispaymentok)
|
|||||||
$paiement->datepaye = $now;
|
$paiement->datepaye = $now;
|
||||||
if ($currencyCodeType == $conf->currency)
|
if ($currencyCodeType == $conf->currency)
|
||||||
{
|
{
|
||||||
$paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
|
$paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
|
||||||
} else {
|
} else {
|
||||||
$paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching
|
$paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching
|
||||||
|
|
||||||
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
|
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
|
||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
@ -662,7 +662,7 @@ if ($ispaymentok)
|
|||||||
if ($bankaccountid > 0)
|
if ($bankaccountid > 0)
|
||||||
{
|
{
|
||||||
$label = '(CustomerInvoicePayment)';
|
$label = '(CustomerInvoicePayment)';
|
||||||
if ($invoice->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
|
if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
|
||||||
$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
|
$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -709,10 +709,12 @@ if ($ispaymentok)
|
|||||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||||
|
|
||||||
// Call trigger
|
if (is_object($object) && method_exists($object, 'call_trigger')) {
|
||||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user);
|
// Call trigger
|
||||||
if ($result < 0) $error++;
|
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user);
|
||||||
// End call triggers
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||||
if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n";
|
if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n";
|
||||||
@ -831,10 +833,12 @@ if ($ispaymentok)
|
|||||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||||
|
|
||||||
// Call trigger
|
if (is_object($object) && method_exists($object, 'call_trigger')) {
|
||||||
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
// Call trigger
|
||||||
if ($result < 0) $error++;
|
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
|
||||||
// End call triggers
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."<br>\n";
|
print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."<br>\n";
|
||||||
print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n";
|
print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n";
|
||||||
|
|||||||
@ -264,6 +264,12 @@ if ($object->date_planned > $now) {
|
|||||||
}
|
}
|
||||||
print '</b><br>';
|
print '</b><br>';
|
||||||
|
|
||||||
|
// Remuneration
|
||||||
|
print $langs->trans("Remuneration").' : ';
|
||||||
|
print '<b>';
|
||||||
|
print $object->remuneration_suggested;
|
||||||
|
print '</b><br>';
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
$tmpuser = new User($db);
|
$tmpuser = new User($db);
|
||||||
$tmpuser->fetch($object->fk_user_recruiter);
|
$tmpuser->fetch($object->fk_user_recruiter);
|
||||||
|
|||||||
@ -201,7 +201,7 @@ if ($action == "view_ticketlist")
|
|||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$extrafields->fetch_name_optionals_label('ticket');
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||||
|
|
||||||
|
|||||||
1041
htdocs/recruitment/class/recruitmentcandidature.class.php
Normal file
1041
htdocs/recruitment/class/recruitmentcandidature.class.php
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user