Merge remote-tracking branch 'Upstream/develop' into develop-57
Conflicts: htdocs/install/mysql/migration/3.8.0-3.9.0.sql
This commit is contained in:
commit
e4bac2adfd
@ -22,7 +22,7 @@ NuSoap 0.9.5 LGPL 2.1+ Yes
|
|||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
|
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
|
||||||
PHPExcel 1.8.0 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
PHPExcel 1.8.0 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||||
php-iban 1.4.6 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||||
Restler 3.0 LGPL-3+ Yes Library to develop REST Web services
|
Restler 3.0 LGPL-3+ Yes Library to develop REST Web services
|
||||||
TCPDF 6.2.6 LGPL-3+ Yes PDF generation
|
TCPDF 6.2.6 LGPL-3+ Yes PDF generation
|
||||||
|
|||||||
@ -224,7 +224,7 @@ Dolibarr better:
|
|||||||
hook afterLogin or afterLoginFailed instead.
|
hook afterLogin or afterLoginFailed instead.
|
||||||
- The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled
|
- The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled
|
||||||
to make difference between creation from contact or not.
|
to make difference between creation from contact or not.
|
||||||
|
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
|
||||||
|
|
||||||
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
||||||
FIX [ bug #2855 ] Wrong translation key in localtax report page
|
FIX [ bug #2855 ] Wrong translation key in localtax report page
|
||||||
@ -238,6 +238,7 @@ FIX: Not showing delivery date on rouget pdf
|
|||||||
FIX: Not showing task extrafields when creating from left menu
|
FIX: Not showing task extrafields when creating from left menu
|
||||||
FIX [ bug #3288 ] Tasks box is not properly drawn
|
FIX [ bug #3288 ] Tasks box is not properly drawn
|
||||||
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
|
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
|
||||||
|
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
|
||||||
|
|
||||||
NEW: Created new ContratLigne::insert function
|
NEW: Created new ContratLigne::insert function
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Script build for hudson CI -->
|
||||||
<project name="dolibarr" default="hudson" basedir=".">
|
<project name="dolibarr" default="hudson" basedir=".">
|
||||||
fdfds
|
|
||||||
<!-- Exclude/ignore paths -->
|
<!-- Exclude/ignore paths -->
|
||||||
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
|
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
|
||||||
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*" />
|
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*" />
|
||||||
|
|||||||
@ -117,7 +117,7 @@ http://bugs.debian.org/package
|
|||||||
severity 123 xxx
|
severity 123 xxx
|
||||||
|
|
||||||
|
|
||||||
##### Update but tracker system
|
##### Update bug tracker system
|
||||||
|
|
||||||
To set status of a bug to "pending"
|
To set status of a bug to "pending"
|
||||||
> bts --smtp-host=yoursmtpserver tag 999999 +pending
|
> bts --smtp-host=yoursmtpserver tag 999999 +pending
|
||||||
@ -249,7 +249,7 @@ from git clone dir and make link to git.
|
|||||||
* If local branch upstream and pristine-tar does not exists, create it
|
* If local branch upstream and pristine-tar does not exists, create it
|
||||||
from origin/upstream and origin/pristine.
|
from origin/upstream and origin/pristine.
|
||||||
|
|
||||||
* If new upstream is available onto sourceforge, launch:
|
* When new upstream is available onto sourceforge, launch:
|
||||||
> debian/get-orig-source.sh
|
> debian/get-orig-source.sh
|
||||||
If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
|
If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this.
|
||||||
|
|
||||||
@ -273,8 +273,8 @@ Note: If there was errors solved manually after get-orig-sources.sh, you may nee
|
|||||||
* Fix debian/* files used to build package.
|
* Fix debian/* files used to build package.
|
||||||
Add an entry into debian/changelog
|
Add an entry into debian/changelog
|
||||||
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
||||||
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import)
|
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
||||||
Then modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
||||||
Then check/modify also the user/date signature:
|
Then check/modify also the user/date signature:
|
||||||
- Date must have format reported by "date -R"
|
- Date must have format reported by "date -R"
|
||||||
- Name and email must match value into debian/control file (Entry added here is used by next step).
|
- Name and email must match value into debian/control file (Entry added here is used by next step).
|
||||||
@ -299,7 +299,7 @@ Note: Package is built into directory ../build-area
|
|||||||
|
|
||||||
* If package .deb is ok:
|
* If package .deb is ok:
|
||||||
Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
|
Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit
|
||||||
> git push --all ou git push origin --all
|
> git push --all
|
||||||
|
|
||||||
* If ok, you can tag.
|
* If ok, you can tag.
|
||||||
> Edit debian/changelog to replace "UNRELEASED" into "unstable", then push
|
> Edit debian/changelog to replace "UNRELEASED" into "unstable", then push
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -53,6 +53,7 @@ $search_desc = GETPOST('search_desc', 'alpha');
|
|||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
$search_account = GETPOST('search_account', 'alpha');
|
$search_account = GETPOST('search_account', 'alpha');
|
||||||
$search_vat = GETPOST('search_vat', 'alpha');
|
$search_vat = GETPOST('search_vat', 'alpha');
|
||||||
|
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||||
|
|
||||||
// Getpost Order and column and limit page
|
// Getpost Order and column and limit page
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
@ -129,7 +130,7 @@ print '<script type="text/javascript">
|
|||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'ventil') {
|
if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||||
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||||
if (! empty($codeventil) && ! empty($mesCasesCochees)) {
|
if (! empty($codeventil) && ! empty($mesCasesCochees)) {
|
||||||
print '<div><font color="red">' . count($mesCasesCochees) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
|
print '<div><font color="red">' . count($mesCasesCochees) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
|
||||||
@ -337,7 +338,7 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
|
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $db->error();
|
print $db->error();
|
||||||
|
|||||||
@ -90,7 +90,7 @@ $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client,";
|
|||||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||||
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
|
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
|
||||||
$sql .= " ct.accountancy_code_sell as account_tva";
|
$sql .= " fd.situation_percent,ct.accountancy_code_sell as account_tva";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||||
@ -102,16 +102,18 @@ if (! empty($conf->multicompany->enabled)) {
|
|||||||
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
|
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
|
||||||
}
|
}
|
||||||
$sql .= " AND f.fk_statut > 0";
|
$sql .= " AND f.fk_statut > 0";
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
$sql .= " AND f.type IN (0,1,2,5)";
|
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||||
else
|
}
|
||||||
$sql .= " AND f.type IN (0,1,2,3,5)";
|
else {
|
||||||
|
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||||
|
}
|
||||||
$sql .= " AND fd.product_type IN (0,1)";
|
$sql .= " AND fd.product_type IN (0,1)";
|
||||||
if ($date_start && $date_end)
|
if ($date_start && $date_end)
|
||||||
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||||
$sql .= " ORDER BY f.datef";
|
$sql .= " ORDER BY f.datef";
|
||||||
|
|
||||||
dol_syslog('accountancy/journal/sellsjournal.php:: $sql=' . $sql);
|
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$tabfac = array ();
|
$tabfac = array ();
|
||||||
@ -143,11 +145,16 @@ if ($result) {
|
|||||||
$line = new FactureLigne($db);
|
$line = new FactureLigne($db);
|
||||||
$line->fetch($obj->rowid);
|
$line->fetch($obj->rowid);
|
||||||
$prev_progress = $line->get_prev_progress();
|
$prev_progress = $line->get_prev_progress();
|
||||||
if ($obj->situation_percent == 0) { // Avoid divide by 0
|
if ($obj->type==Facture::TYPE_SITUATION) {
|
||||||
|
// Avoid divide by 0
|
||||||
|
if ($obj->situation_percent == 0) {
|
||||||
$situation_ratio = 0;
|
$situation_ratio = 0;
|
||||||
} else {
|
} else {
|
||||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$situation_ratio = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Invoice lines
|
// Invoice lines
|
||||||
$tabfac[$obj->rowid]["date"] = $obj->df;
|
$tabfac[$obj->rowid]["date"] = $obj->df;
|
||||||
|
|||||||
@ -183,6 +183,7 @@ if ($result)
|
|||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||||
@ -195,7 +196,6 @@ if ($result)
|
|||||||
|
|
||||||
|
|
||||||
// Lignes des champs de filtres
|
// Lignes des champs de filtres
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
|
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
|
||||||
@ -222,7 +222,6 @@ if ($result)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
@ -283,7 +282,7 @@ if ($result)
|
|||||||
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
|
||||||
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table></form>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
|
|||||||
@ -61,15 +61,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
* Search form
|
* Search form
|
||||||
*/
|
*/
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/askpricesupplier/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/askpricesupplier/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchRequest").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchRequest").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -97,6 +97,7 @@ if ($result)
|
|||||||
$param = "&sall=".$sall;
|
$param = "&sall=".$sall;
|
||||||
if ($filteremail) $param.='&filteremail='.urlencode($filteremail);
|
if ($filteremail) $param.='&filteremail='.urlencode($filteremail);
|
||||||
|
|
||||||
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<table class="liste">';
|
print '<table class="liste">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
|
||||||
@ -108,7 +109,6 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="flat" name="sref" value="'.$sref.'" size="6">';
|
print '<input type="text" class="flat" name="sref" value="'.$sref.'" size="6">';
|
||||||
@ -123,7 +123,6 @@ if ($result)
|
|||||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
@ -177,7 +176,7 @@ if ($result)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print '</table></form>';
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -63,15 +63,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
* Search form
|
* Search form
|
||||||
*/
|
*/
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -54,15 +54,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
if (! empty($conf->propal->enabled))
|
if (! empty($conf->propal->enabled))
|
||||||
{
|
{
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProposal").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProposal").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -150,7 +150,7 @@ $search_categ = GETPOST('search_categ','int');
|
|||||||
// If the internal user must only see his prospect, force searching by him
|
// If the internal user must only see his prospect, force searching by him
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
|
||||||
|
|
||||||
// List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
|
// List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
|
||||||
$sts = array(-1,0,1,2,3);
|
$sts = array(-1,0,1,2,3);
|
||||||
|
|
||||||
|
|
||||||
@ -158,6 +158,10 @@ $sts = array(-1,0,1,2,3);
|
|||||||
$hookmanager->initHooks(array('prospectlist'));
|
$hookmanager->initHooks(array('prospectlist'));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label('thirdparty');
|
||||||
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -171,6 +175,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_datec="";
|
$search_datec="";
|
||||||
$search_categ="";
|
$search_categ="";
|
||||||
$search_status="";
|
$search_status="";
|
||||||
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_status=='') $search_status=1; // always display active customer first
|
if ($search_status=='') $search_status=1; // always display active customer first
|
||||||
@ -216,13 +221,14 @@ $sql.= " st.libelle as stcomm_label,";
|
|||||||
$sql.= " d.nom as departement";
|
$sql.= " d.nom as departement";
|
||||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||||
// Add fields for extrafields
|
// Add fields for extrafields
|
||||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
|
||||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ
|
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ
|
||||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||||
@ -231,7 +237,7 @@ $sql.= " AND s.client IN (2, 3)";
|
|||||||
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
||||||
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
|
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
|
||||||
if ($socid) $sql.= " AND s.rowid = " .$socid;
|
if ($socid) $sql.= " AND s.rowid = " .$socid;
|
||||||
if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
|
if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
|
||||||
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||||
@ -252,6 +258,19 @@ if ($socname)
|
|||||||
$sortfield = "s.nom";
|
$sortfield = "s.nom";
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
foreach ($search_array_options as $key => $val)
|
||||||
|
{
|
||||||
|
$crit=$val;
|
||||||
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
|
$typ=$extrafields->attribute_type[$tmpkey];
|
||||||
|
$mode=0;
|
||||||
|
if (in_array($typ, array('int'))) $mode=1; // Search on a numeric
|
||||||
|
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||||
|
{
|
||||||
|
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -265,6 +284,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
}
|
}
|
||||||
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
|
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
//print $sql;
|
||||||
|
|
||||||
dol_syslog('comm/prospect/list.php', LOG_DEBUG);
|
dol_syslog('comm/prospect/list.php', LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -298,9 +318,15 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
if ($search_level_from != '') $param.='&search_level_from='.$search_level_from;
|
if ($search_level_from != '') $param.='&search_level_from='.$search_level_from;
|
||||||
if ($search_level_to != '') $param.='&search_level_to='.$search_level_to;
|
if ($search_level_to != '') $param.='&search_level_to='.$search_level_to;
|
||||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
if ($search_categ != '') $param.='&search_categ='.urlencode($search_categ);
|
||||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||||
|
foreach ($search_array_options as $key => $val)
|
||||||
|
{
|
||||||
|
$crit=$val;
|
||||||
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
|
$param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
|
}
|
||||||
// $param and $urladd should have the same value
|
// $param and $urladd should have the same value
|
||||||
$urladd = $param;
|
$urladd = $param;
|
||||||
|
|
||||||
@ -347,6 +373,18 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
|
|
||||||
|
// Extrafields
|
||||||
|
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_list as $key => $val)
|
||||||
|
{
|
||||||
|
if ($val)
|
||||||
|
{
|
||||||
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hook fields
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
@ -360,13 +398,13 @@ if ($resql)
|
|||||||
print '<input type="text" class="flat" name="search_nom" size="10" value="'.$search_nom.'">';
|
print '<input type="text" class="flat" name="search_nom" size="10" value="'.$search_nom.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="flat" name="search_zipcode" size="10" value="'.$search_zipcode.'">';
|
print '<input type="text" class="flat" name="search_zipcode" size="6" value="'.$search_zipcode.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="flat" name="search_town" size="10" value="'.$search_town.'">';
|
print '<input type="text" class="flat" name="search_town" size="8" value="'.$search_town.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print '<input type="text" class="flat" name="search_state" size="10" value="'.$search_state.'">';
|
print '<input type="text" class="flat" name="search_state" size="8" value="'.$search_state.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center" class="liste_titre">';
|
print '<td align="center" class="liste_titre">';
|
||||||
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
|
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
|
||||||
@ -404,13 +442,28 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$arraystcomm[$val['id']]=$val['label'];
|
$arraystcomm[$val['id']]=$val['label'];
|
||||||
}
|
}
|
||||||
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, 1);
|
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Extrafields
|
||||||
|
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_list as $key => $val)
|
||||||
|
{
|
||||||
|
if ($val)
|
||||||
|
{
|
||||||
|
$crit=$search_array_options['search_options_'.$key];
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $extrafields->showInputField($key, $crit, '', '', 'search_', 4);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hook fields
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
@ -460,7 +513,7 @@ if ($resql)
|
|||||||
print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']);
|
print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
foreach($prospectstatic->cacheprospectstatus as $key => $val)
|
foreach($prospectstatic->cacheprospectstatus as $key => $val)
|
||||||
{
|
{
|
||||||
$titlealt='default';
|
$titlealt='default';
|
||||||
@ -469,6 +522,21 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Extrafields
|
||||||
|
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_list as $key => $val)
|
||||||
|
{
|
||||||
|
if ($val)
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$paramkey='options_'.$key;
|
||||||
|
print $extrafields->showOutputField($key, $obj->$paramkey);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hook fields
|
||||||
$parameters=array('obj' => $obj);
|
$parameters=array('obj' => $obj);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|||||||
@ -62,15 +62,15 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
|
|
||||||
// Search customer orders
|
// Search customer orders
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -158,7 +158,6 @@ if ($result)
|
|||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Line to add category
|
* Line to add category
|
||||||
@ -172,9 +171,7 @@ if ($action != 'edit')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print '</table></form>';
|
||||||
|
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -596,8 +596,7 @@ if ($result)
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>";
|
print '</table></form>';
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -610,22 +609,21 @@ print '</div>';
|
|||||||
|
|
||||||
|
|
||||||
// List of bank categories
|
// List of bank categories
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'&id='.$id.'">';
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'&id='.$id.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="class">';
|
print '<input type="hidden" name="action" value="class">';
|
||||||
print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
|
print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Rubriques").'</td><td colspan="2">';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Rubriques").'</td><td colspan="2">';
|
||||||
if ($user->rights->banque->modifier)
|
if ($user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
print '<select class="flat" name="cat1">'.$options.'</select> ';
|
print '<select class="flat" name="cat1">'.$options.'</select> ';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
}
|
}
|
||||||
print "</tr>";
|
print '</tr>';
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
$sql = "SELECT c.label, c.rowid";
|
$sql = "SELECT c.label, c.rowid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
|
||||||
@ -650,13 +648,13 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=delete_categ&rowid='.$rowid.'&fk_categ='.$objp->rowid.'">'.img_delete($langs->trans("Remove")).'</a></td>';
|
print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=delete_categ&rowid='.$rowid.'&fk_categ='.$objp->rowid.'">'.img_delete($langs->trans("Remove")).'</a></td>';
|
||||||
}
|
}
|
||||||
print "</tr>";
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print '</table></form>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -636,7 +636,7 @@ else
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else print '<tr><td>'.$langs->trans("NoneF").'</td></tr>';
|
else print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("NoneF").'</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
@ -129,6 +129,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_montant_ht='';
|
$search_montant_ht='';
|
||||||
$search_montant_ttc='';
|
$search_montant_ttc='';
|
||||||
$search_status='';
|
$search_status='';
|
||||||
|
$day='';
|
||||||
$year='';
|
$year='';
|
||||||
$month='';
|
$month='';
|
||||||
}
|
}
|
||||||
@ -350,7 +351,7 @@ if ($resql)
|
|||||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
|
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
$liststatus=array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"), '3'=>$langs->trans("Cancel"));
|
$liststatus=array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled"));
|
||||||
print $form->selectarray('search_status', $liststatus, $search_status, 1);
|
print $form->selectarray('search_status', $liststatus, $search_status, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if (GETPOST('button_search'))
|
|||||||
}
|
}
|
||||||
if ($option == 'late') $filter = 'paye:0';
|
if ($option == 'late') $filter = 'paye:0';
|
||||||
if ($option == 'unpaidall') $filter = 'paye:0';
|
if ($option == 'unpaidall') $filter = 'paye:0';
|
||||||
if ($mode == 'sendremind' && $filter == '') $filter = 'paye:0';
|
if ($mode == 'sendmassremind' && $filter == '') $filter = 'paye:0';
|
||||||
if ($filter == '') $filter = 'paye:0';
|
if ($filter == '') $filter = 'paye:0';
|
||||||
|
|
||||||
$search_user = GETPOST('search_user','int');
|
$search_user = GETPOST('search_user','int');
|
||||||
|
|||||||
@ -114,8 +114,13 @@ $sql.= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
|
||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sql.= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||||
|
}
|
||||||
|
|
||||||
$sql.= " AND fd.product_type IN (0,1)";
|
$sql.= " AND fd.product_type IN (0,1)";
|
||||||
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||||
$sql.= " ORDER BY f.rowid";
|
$sql.= " ORDER BY f.rowid";
|
||||||
@ -163,11 +168,16 @@ if ($result)
|
|||||||
$line = new FactureLigne($db);
|
$line = new FactureLigne($db);
|
||||||
$line->fetch($obj->id);
|
$line->fetch($obj->id);
|
||||||
$prev_progress = $line->get_prev_progress();
|
$prev_progress = $line->get_prev_progress();
|
||||||
if ($obj->situation_percent == 0) { // Avoid divide by 0
|
if ($obj->type==Facture::TYPE_SITUATION) {
|
||||||
|
// Avoid divide by 0
|
||||||
|
if ($obj->situation_percent == 0) {
|
||||||
$situation_ratio = 0;
|
$situation_ratio = 0;
|
||||||
} else {
|
} else {
|
||||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$situation_ratio = 1;
|
||||||
|
}
|
||||||
|
|
||||||
//la ligne facture
|
//la ligne facture
|
||||||
$tabfac[$obj->rowid]["date"] = $obj->datef;
|
$tabfac[$obj->rowid]["date"] = $obj->datef;
|
||||||
|
|||||||
@ -88,10 +88,6 @@ if ($action == 'setdate' && $user->rights->banque->cheque)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ($action == 'setrefext' && $user->rights->banque->cheque)
|
if ($action == 'setrefext' && $user->rights->banque->cheque)
|
||||||
{
|
{
|
||||||
$result = $object->fetch(GETPOST('id','int'));
|
$result = $object->fetch(GETPOST('id','int'));
|
||||||
@ -282,7 +278,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque)
|
|||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
$file=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . GETPOST('file');
|
$file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file');
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
$ret=dol_delete_file($file,0,0,0,$object);
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
|
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
|
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
|
||||||
@ -581,6 +577,7 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// External ref
|
// External ref
|
||||||
|
/* Ext ref are not visible field on standard usage
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
@ -605,6 +602,7 @@ else
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('Account').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('Account').'</td><td colspan="2">';
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
@ -626,7 +624,7 @@ else
|
|||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
|
|
||||||
// Liste des cheques
|
// List of cheques
|
||||||
$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
|
$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
|
||||||
$sql.= " b.dateo as date, b.datec as datec, b.banque,";
|
$sql.= " b.dateo as date, b.datec as datec, b.banque,";
|
||||||
$sql.= " p.rowid as pid, ba.rowid as bid, p.statut";
|
$sql.= " p.rowid as pid, ba.rowid as bid, p.statut";
|
||||||
@ -636,7 +634,7 @@ else
|
|||||||
$sql.= " WHERE ba.entity IN (".getEntity('bank_account', 1).")";
|
$sql.= " WHERE ba.entity IN (".getEntity('bank_account', 1).")";
|
||||||
$sql.= " AND b.fk_type= 'CHQ'";
|
$sql.= " AND b.fk_type= 'CHQ'";
|
||||||
$sql.= " AND b.fk_bordereau = ".$object->id;
|
$sql.= " AND b.fk_bordereau = ".$object->id;
|
||||||
$sql.= " ORDER BY $sortfield $sortorder";
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -655,7 +653,6 @@ else
|
|||||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i=1;
|
$i=1;
|
||||||
$var=false;
|
$var=false;
|
||||||
@ -751,7 +748,7 @@ if ($action != 'new')
|
|||||||
if ($object->statut == 1)
|
if ($object->statut == 1)
|
||||||
{
|
{
|
||||||
$filename=dol_sanitizeFileName($object->ref);
|
$filename=dol_sanitizeFileName($object->ref);
|
||||||
$filedir=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref);
|
$filedir=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
|
||||||
$formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
$formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
||||||
|
|||||||
@ -548,7 +548,7 @@ class RemiseCheque extends CommonObject
|
|||||||
// We save charset_output to restore it because write_file can change it if needed for
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
// output format that does not support UTF8.
|
// output format that does not support UTF8.
|
||||||
$sav_charseSupprimert_output=$outputlangs->charset_output;
|
$sav_charseSupprimert_output=$outputlangs->charset_output;
|
||||||
$result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
|
$result=$docmodel->write_file($this, $conf->banque->dir_output.'/bordereau', $this->number, $outputlangs);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
//$outputlangs->charset_output=$sav_charset_output;
|
//$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -36,6 +38,10 @@ $langs->load("compta");
|
|||||||
$facid =GETPOST('facid','int');
|
$facid =GETPOST('facid','int');
|
||||||
$socid =GETPOST('socid','int');
|
$socid =GETPOST('socid','int');
|
||||||
$userid=GETPOST('userid','int');
|
$userid=GETPOST('userid','int');
|
||||||
|
$day = GETPOST('day','int');
|
||||||
|
$month = GETPOST('month','int');
|
||||||
|
$year = GETPOST('year','int');
|
||||||
|
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'facture',$facid,'');
|
$result = restrictedArea($user, 'facture',$facid,'');
|
||||||
|
|
||||||
@ -66,6 +72,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_amount="";
|
$search_amount="";
|
||||||
$search_paymenttype="";
|
$search_paymenttype="";
|
||||||
$search_company="";
|
$search_company="";
|
||||||
|
$day='';
|
||||||
|
$year='';
|
||||||
|
$month='';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
@ -81,6 +90,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
llxHeader('', $langs->trans('ListPayment'));
|
llxHeader('', $langs->trans('ListPayment'));
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
$formother=new FormOther($db);
|
||||||
|
|
||||||
if (GETPOST("orphelins"))
|
if (GETPOST("orphelins"))
|
||||||
{
|
{
|
||||||
@ -141,6 +151,19 @@ else
|
|||||||
else $sql.= " AND f.fk_user_author = ".$userid;
|
else $sql.= " AND f.fk_user_author = ".$userid;
|
||||||
}
|
}
|
||||||
// Search criteria
|
// Search criteria
|
||||||
|
if ($month > 0)
|
||||||
|
{
|
||||||
|
if ($year > 0 && empty($day))
|
||||||
|
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||||
|
else if ($year > 0 && ! empty($day))
|
||||||
|
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
|
||||||
|
else
|
||||||
|
$sql.= " AND date_format(p.datep, '%m') = '".$month."'";
|
||||||
|
}
|
||||||
|
else if ($year > 0)
|
||||||
|
{
|
||||||
|
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||||
|
}
|
||||||
if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref;
|
if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref;
|
||||||
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||||
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
|
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
|
||||||
@ -194,7 +217,11 @@ if ($resql)
|
|||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
|
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td> </td>';
|
print '<td align="center">';
|
||||||
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||||
|
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||||
|
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
||||||
|
print '</td>';
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
|
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -269,7 +269,7 @@ if ($result)
|
|||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="view" value="'.htmlspecialchars($view).'">';
|
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
|
|||||||
@ -154,6 +154,8 @@ if ($resql)
|
|||||||
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
|
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png');
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png');
|
||||||
|
|
||||||
|
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -169,9 +171,6 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<form method="POST" action="'. $_SERVER["PHP_SELF"] .'">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="hidden" name="filter" value="'.$filter.'">';
|
print '<input type="hidden" name="filter" value="'.$filter.'">';
|
||||||
@ -203,7 +202,6 @@ if ($resql)
|
|||||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$contractstatic=new Contrat($db);
|
$contractstatic=new Contrat($db);
|
||||||
$productstatic=new Product($db);
|
$productstatic=new Product($db);
|
||||||
@ -278,7 +276,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
print "</table>";
|
print '</table></form>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -27,6 +27,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
|||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||||
|
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1');
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2011-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/ajax/security.php
|
* \file htdocs/core/ajax/security.php
|
||||||
* \brief File for return security data
|
* \brief This ajax component is used to generated has keys for security purposes
|
||||||
|
* like key to use into URL to protect them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
|
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
|
||||||
@ -26,6 +27,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
|||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||||
|
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1');
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -33,10 +35,6 @@ require '../../main.inc.php';
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Ajout directives pour resoudre bug IE
|
|
||||||
//header('Cache-Control: Public, must-revalidate');
|
|
||||||
//header('Pragma: public');
|
|
||||||
|
|
||||||
//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
|
//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
|
||||||
top_httphead();
|
top_httphead();
|
||||||
|
|
||||||
@ -48,7 +46,7 @@ if (isset($_GET['action']) && ! empty($_GET['action']))
|
|||||||
if ($_GET['action'] == 'getrandompassword' && $user->admin)
|
if ($_GET['action'] == 'getrandompassword' && $user->admin)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||||
$generic = $_GET['generic'];
|
$generic = $_GET['generic'] ? true : false;
|
||||||
echo getRandomPassword($generic);
|
echo getRandomPassword($generic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class box_contacts extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'align="left"',
|
'td' => 'align="left"',
|
||||||
'text' => $societestatic->getNomUrl(1),
|
'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''),
|
||||||
'asis' => 1,
|
'asis' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -375,14 +375,14 @@ class CMailFile
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
|
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
|
||||||
{
|
{
|
||||||
|
|
||||||
dol_include_once('/core/class/hookmanager.class.php');
|
dol_include_once('/core/class/hookmanager.class.php');
|
||||||
$hookmanager = new HookManager($db);
|
$hookmanager = new HookManager($db);
|
||||||
$hookmanager->initHooks(array('maildao'));
|
$hookmanager->initHooks(array(
|
||||||
|
'maildao'
|
||||||
|
));
|
||||||
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (! empty($reshook))
|
if (! empty($reshook))
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->error = "Error in hook maildao doactions " . $reshook;
|
$this->error = "Error in hook maildao doactions " . $reshook;
|
||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
||||||
|
|
||||||
|
|||||||
@ -3794,7 +3794,7 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='')
|
function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='')
|
||||||
{
|
{
|
||||||
global $_POST, $conf;
|
global $_POST, $conf, $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
@ -3852,7 +3852,7 @@ abstract class CommonObject
|
|||||||
if($extrafields->attribute_required[$key])
|
if($extrafields->attribute_required[$key])
|
||||||
$label = '<span class="fieldrequired">'.$label.'</span>';
|
$label = '<span class="fieldrequired">'.$label.'</span>';
|
||||||
|
|
||||||
$out .= '<td>'.$label.'</td>';
|
$out .= '<td>'.$langs->trans($label).'</td>';
|
||||||
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
|
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
|
||||||
|
|
||||||
switch($mode) {
|
switch($mode) {
|
||||||
|
|||||||
@ -567,7 +567,7 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
|
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
|
||||||
*
|
*
|
||||||
* @param string $elementtype Type of element ('adherent', 'commande', thirdparty', 'facture', 'propal', 'product', ...)
|
* @param string $elementtype Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)
|
||||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||||
* @return array Array of attributes for all extra fields
|
* @return array Array of attributes for all extra fields
|
||||||
*/
|
*/
|
||||||
@ -635,9 +635,11 @@ class ExtraFields
|
|||||||
* @param string $value Value to show (for date type it must be in timestamp format)
|
* @param string $value Value to show (for date type it must be in timestamp format)
|
||||||
* @param string $moreparam To add more parametes on html input tag
|
* @param string $moreparam To add more parametes on html input tag
|
||||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
|
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
|
* @param int $showsize Value for size attribute
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showInputField($key,$value,$moreparam='',$keyprefix='')
|
function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$showsize=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -651,6 +653,8 @@ class ExtraFields
|
|||||||
$perms=$this->attribute_perms[$key];
|
$perms=$this->attribute_perms[$key];
|
||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
|
|
||||||
|
if (empty($showsize))
|
||||||
|
{
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
{
|
{
|
||||||
$showsize=10;
|
$showsize=10;
|
||||||
@ -668,6 +672,7 @@ class ExtraFields
|
|||||||
$showsize=round($size);
|
$showsize=round($size);
|
||||||
if ($showsize > 48) $showsize=48;
|
if ($showsize > 48) $showsize=48;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array($type,array('date','datetime')))
|
if (in_array($type,array('date','datetime')))
|
||||||
{
|
{
|
||||||
@ -684,22 +689,22 @@ class ExtraFields
|
|||||||
if (! is_object($form)) $form=new Form($this->db);
|
if (! is_object($form)) $form=new Form($this->db);
|
||||||
|
|
||||||
// TODO Must also support $moreparam
|
// TODO Must also support $moreparam
|
||||||
$out = $form->select_date($value, 'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
|
$out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
|
||||||
}
|
}
|
||||||
elseif (in_array($type,array('int')))
|
elseif (in_array($type,array('int')))
|
||||||
{
|
{
|
||||||
$tmp=explode(',',$size);
|
$tmp=explode(',',$size);
|
||||||
$newsize=$tmp[0];
|
$newsize=$tmp[0];
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif ($type == 'varchar')
|
elseif ($type == 'varchar')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif ($type == 'text')
|
elseif ($type == 'text')
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor('options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
|
$doleditor=new DolEditor($keysuffix.'options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
|
||||||
$out=$doleditor->Create(1);
|
$out=$doleditor->Create(1);
|
||||||
}
|
}
|
||||||
elseif ($type == 'boolean')
|
elseif ($type == 'boolean')
|
||||||
@ -710,26 +715,26 @@ class ExtraFields
|
|||||||
} else {
|
} else {
|
||||||
$checked=' value="1" ';
|
$checked=' value="1" ';
|
||||||
}
|
}
|
||||||
$out='<input type="checkbox" class="flat" name="options_'.$key.$keyprefix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
|
$out='<input type="checkbox" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif ($type == 'mail')
|
elseif ($type == 'mail')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="32" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="32" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif ($type == 'phone')
|
elseif ($type == 'phone')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="20" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
||||||
}
|
}
|
||||||
elseif ($type == 'price')
|
elseif ($type == 'price')
|
||||||
{
|
{
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
||||||
}
|
}
|
||||||
elseif ($type == 'double')
|
elseif ($type == 'double')
|
||||||
{
|
{
|
||||||
if (!empty($value)) {
|
if (!empty($value)) {
|
||||||
$value=price($value);
|
$value=price($value);
|
||||||
}
|
}
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
|
||||||
}
|
}
|
||||||
elseif ($type == 'select')
|
elseif ($type == 'select')
|
||||||
{
|
{
|
||||||
@ -737,10 +742,10 @@ class ExtraFields
|
|||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
|
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
$out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
||||||
$out.='<option value="0"> </option>';
|
$out.='<option value="0"> </option>';
|
||||||
foreach ($param['options'] as $key=>$val )
|
foreach ($param['options'] as $key=>$val )
|
||||||
{
|
{
|
||||||
@ -758,10 +763,10 @@ class ExtraFields
|
|||||||
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
|
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
$out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
||||||
if (is_array($param['options']))
|
if (is_array($param['options']))
|
||||||
{
|
{
|
||||||
$param_list=array_keys($param['options']);
|
$param_list=array_keys($param['options']);
|
||||||
@ -907,7 +912,7 @@ class ExtraFields
|
|||||||
foreach ($param['options'] as $keyopt=>$val )
|
foreach ($param['options'] as $keyopt=>$val )
|
||||||
{
|
{
|
||||||
|
|
||||||
$out.='<input class="flat" type="checkbox" name="options_'.$key.$keyprefix.'[]" '.($moreparam?$moreparam:'');
|
$out.='<input class="flat" type="checkbox" name="'.$keysuffix.'options_'.$key.$keyprefix.'[]" '.($moreparam?$moreparam:'');
|
||||||
$out.=' value="'.$keyopt.'"';
|
$out.=' value="'.$keyopt.'"';
|
||||||
|
|
||||||
if ((is_array($value_arr)) && in_array($keyopt,$value_arr)) {
|
if ((is_array($value_arr)) && in_array($keyopt,$value_arr)) {
|
||||||
@ -924,7 +929,7 @@ class ExtraFields
|
|||||||
$out='';
|
$out='';
|
||||||
foreach ($param['options'] as $keyopt=>$val )
|
foreach ($param['options'] as $keyopt=>$val )
|
||||||
{
|
{
|
||||||
$out.='<input class="flat" type="radio" name="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'');
|
$out.='<input class="flat" type="radio" name="'.$keysuffix.'options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'');
|
||||||
$out.=' value="'.$keyopt.'"';
|
$out.=' value="'.$keyopt.'"';
|
||||||
$out.= ($value==$keyopt?'checked':'');
|
$out.= ($value==$keyopt?'checked':'');
|
||||||
$out.='/>'.$val.'<br>';
|
$out.='/>'.$val.'<br>';
|
||||||
@ -1018,7 +1023,7 @@ class ExtraFields
|
|||||||
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
|
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||||
$out .= ' value="' . $obj->rowid . '"';
|
$out .= ' value="' . $obj->rowid . '"';
|
||||||
|
|
||||||
$out .= 'checked';
|
$out .= 'checked';
|
||||||
@ -1037,7 +1042,7 @@ class ExtraFields
|
|||||||
$labeltoshow = '(not defined)';
|
$labeltoshow = '(not defined)';
|
||||||
|
|
||||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||||
$out .= ' value="' . $obj->rowid . '"';
|
$out .= ' value="' . $obj->rowid . '"';
|
||||||
|
|
||||||
$out .= 'checked';
|
$out .= 'checked';
|
||||||
@ -1050,7 +1055,7 @@ class ExtraFields
|
|||||||
$parent = $parentName . ':' . $obj->{$parentField};
|
$parent = $parentName . ':' . $obj->{$parentField};
|
||||||
}
|
}
|
||||||
|
|
||||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
$out .= '<input class="flat" type="checkbox" name="'.$keysuffix.'options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||||
$out .= ' value="' . $obj->rowid . '"';
|
$out .= ' value="' . $obj->rowid . '"';
|
||||||
|
|
||||||
$out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked ' : '');
|
$out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked ' : '');
|
||||||
@ -1080,7 +1085,7 @@ class ExtraFields
|
|||||||
dol_include_once($InfoFieldList[1]);
|
dol_include_once($InfoFieldList[1]);
|
||||||
$object = new $InfoFieldList[0]($this->db);
|
$object = new $InfoFieldList[0]($this->db);
|
||||||
$object->fetch($value);
|
$object->fetch($value);
|
||||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
|
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
|
||||||
|
|
||||||
}
|
}
|
||||||
/* Add comments
|
/* Add comments
|
||||||
@ -1417,14 +1422,16 @@ class ExtraFields
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return array_options array for object by extrafields value (using for data send by forms)
|
* return array_options array for object by extrafields value (using for data send by forms)
|
||||||
*
|
*
|
||||||
* @param array $extralabels $array of extrafields
|
* @param array $extralabels $array of extrafields
|
||||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
|
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
|
||||||
* @return int 1 if array_options set / 0 if no value
|
* @return int 1 if array_options set / 0 if no value
|
||||||
*/
|
*/
|
||||||
function getOptionalsFromPost($extralabels,$keyprefix='')
|
function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='')
|
||||||
{
|
{
|
||||||
global $_POST;
|
global $_POST;
|
||||||
|
|
||||||
@ -1439,24 +1446,24 @@ class ExtraFields
|
|||||||
if (in_array($key_type,array('date','datetime')))
|
if (in_array($key_type,array('date','datetime')))
|
||||||
{
|
{
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$value_key=dol_mktime($_POST["options_".$key.$keyprefix."hour"], $_POST["options_".$key.$keyprefix."min"], 0, $_POST["options_".$key.$keyprefix."month"], $_POST["options_".$key.$keyprefix."day"], $_POST["options_".$key.$keyprefix."year"]);
|
$value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]);
|
||||||
}
|
}
|
||||||
else if (in_array($key_type,array('checkbox')))
|
else if (in_array($key_type,array('checkbox')))
|
||||||
{
|
{
|
||||||
$value_arr=GETPOST("options_".$key.$keyprefix);
|
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||||
$value_key=implode($value_arr,',');
|
$value_key=implode($value_arr,',');
|
||||||
}
|
}
|
||||||
else if (in_array($key_type,array('price','double')))
|
else if (in_array($key_type,array('price','double')))
|
||||||
{
|
{
|
||||||
$value_arr=GETPOST("options_".$key.$keyprefix);
|
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||||
$value_key=price2num($value_arr);
|
$value_key=price2num($value_arr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$value_key=GETPOST("options_".$key.$keyprefix);
|
$value_key=GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
$array_options["options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read.
|
$array_options[$keysuffix."options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read.
|
||||||
}
|
}
|
||||||
|
|
||||||
return $array_options;
|
return $array_options;
|
||||||
|
|||||||
@ -4406,7 +4406,7 @@ class Form
|
|||||||
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
|
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
|
||||||
* @param array $array Array with key+value
|
* @param array $array Array with key+value
|
||||||
* @param string|string[] $id Preselected key or preselected keys for multiselect
|
* @param string|string[] $id Preselected key or preselected keys for multiselect
|
||||||
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' ').
|
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value.
|
||||||
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
||||||
* @param int $value_as_key 1 to use value as key
|
* @param int $value_as_key 1 to use value as key
|
||||||
* @param string $moreparam Add more parameters onto the select tag
|
* @param string $moreparam Add more parameters onto the select tag
|
||||||
@ -4455,7 +4455,7 @@ class Form
|
|||||||
{
|
{
|
||||||
$textforempty=' ';
|
$textforempty=' ';
|
||||||
if (! empty($conf->use_javascript_ajax)) $textforempty=' '; // If we use ajaxcombo, we need here to avoid to have an empty element that is too small.
|
if (! empty($conf->use_javascript_ajax)) $textforempty=' '; // If we use ajaxcombo, we need here to avoid to have an empty element that is too small.
|
||||||
$out.='<option value="-1"'.($id==-1?' selected':'').'>'.$textforempty.'</option>'."\n";
|
$out.='<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id==-2?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($array))
|
if (is_array($array))
|
||||||
|
|||||||
@ -306,10 +306,11 @@ class FormOther
|
|||||||
* @param integer $selected Preselected value
|
* @param integer $selected Preselected value
|
||||||
* @param string $htmlname Name of combo list
|
* @param string $htmlname Name of combo list
|
||||||
* @param int $nocateg Show also an entry "Not categorized"
|
* @param int $nocateg Show also an entry "Not categorized"
|
||||||
|
* @param int $showempty Add also an empty line
|
||||||
* @return string Html combo list code
|
* @return string Html combo list code
|
||||||
* @see select_all_categories
|
* @see select_all_categories
|
||||||
*/
|
*/
|
||||||
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0)
|
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
@ -331,7 +332,7 @@ class FormOther
|
|||||||
|
|
||||||
// Print a select with each of them
|
// Print a select with each of them
|
||||||
$moreforfilter.='<select class="flat minwidth100" id="select_categ_'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
|
$moreforfilter.='<select class="flat minwidth100" id="select_categ_'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
|
||||||
$moreforfilter.='<option value=""> </option>'; // Should use -1 to say nothing
|
if ($showempty) $moreforfilter.='<option value="0"> </option>'; // Should use -1 to say nothing
|
||||||
|
|
||||||
if (is_array($tab_categs))
|
if (is_array($tab_categs))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -421,7 +421,11 @@ class Translate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
if (! preg_match('/^Format/',$key))
|
||||||
|
{
|
||||||
|
//print $str;
|
||||||
|
$str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
||||||
|
}
|
||||||
|
|
||||||
if ($maxsize) $str=dol_trunc($str,$maxsize);
|
if ($maxsize) $str=dol_trunc($str,$maxsize);
|
||||||
|
|
||||||
@ -497,7 +501,11 @@ class Translate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! preg_match('/^Format/',$key)) $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
if (! preg_match('/^Format/',$key))
|
||||||
|
{
|
||||||
|
//print $str;
|
||||||
|
$str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings.
|
||||||
|
}
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
@ -819,3 +827,8 @@ class Translate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function warning_handler($errno, $errstr, $errfile, $errline, array $errcontext) {
|
||||||
|
global $str;
|
||||||
|
print 'str='.$str;
|
||||||
|
}
|
||||||
|
|||||||
@ -144,7 +144,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
|||||||
/** Return, in clear text, value of a number of seconds in days, hours and minutes
|
/** Return, in clear text, value of a number of seconds in days, hours and minutes
|
||||||
*
|
*
|
||||||
* @param int $iSecond Number of seconds
|
* @param int $iSecond Number of seconds
|
||||||
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30"", 'allhourmin': total delay hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part);
|
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30", 'allwithouthour': total delay days without hour part like "2 days", 'allhourmin': total delay with format hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part);
|
||||||
* @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour)
|
* @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour)
|
||||||
* @param int $lengthOfWeek Length of week (default 7)
|
* @param int $lengthOfWeek Length of week (default 7)
|
||||||
* @return string Formated text of duration
|
* @return string Formated text of duration
|
||||||
@ -157,7 +157,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
|||||||
if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours
|
if (empty($lengthOfDay)) $lengthOfDay = 86400; // 1 day = 24 hours
|
||||||
if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days
|
if (empty($lengthOfWeek)) $lengthOfWeek = 7; // 1 week = 7 days
|
||||||
|
|
||||||
if ($format == 'all' || $format == 'allhour' || $format == 'allhourmin')
|
if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin')
|
||||||
{
|
{
|
||||||
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
|
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
|
||||||
|
|
||||||
|
|||||||
@ -3743,7 +3743,7 @@ function yn($yesno, $case=1, $color=0)
|
|||||||
*
|
*
|
||||||
* @param string $num Id of object
|
* @param string $num Id of object
|
||||||
* @param int $level Level of subdirs to return (1, 2 or 3 levels)
|
* @param int $level Level of subdirs to return (1, 2 or 3 levels)
|
||||||
* @param int $alpha Use alpha ref
|
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0).
|
||||||
* @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '')
|
* @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '')
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')
|
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')
|
||||||
|
|||||||
@ -1692,64 +1692,61 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
|||||||
if ($objecttype == 'propal')
|
if ($objecttype == 'propal')
|
||||||
{
|
{
|
||||||
$outputlangs->load('propal');
|
$outputlangs->load('propal');
|
||||||
$num=count($objects);
|
|
||||||
for ($i=0;$i<$num;$i++)
|
foreach($objects as $elementobject)
|
||||||
{
|
{
|
||||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
|
||||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
|
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
|
||||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
|
||||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($objecttype == 'commande')
|
else if ($objecttype == 'commande')
|
||||||
{
|
{
|
||||||
$outputlangs->load('orders');
|
$outputlangs->load('orders');
|
||||||
$num=count($objects);
|
foreach($objects as $elementobject)
|
||||||
for ($i=0;$i<$num;$i++)
|
|
||||||
{
|
{
|
||||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
|
||||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
|
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
|
||||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
|
||||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($objecttype == 'contrat')
|
else if ($objecttype == 'contrat')
|
||||||
{
|
{
|
||||||
$outputlangs->load('contracts');
|
$outputlangs->load('contracts');
|
||||||
$num=count($objects);
|
foreach($objects as $elementobject)
|
||||||
for ($i=0;$i<$num;$i++)
|
|
||||||
{
|
{
|
||||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
|
||||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
|
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
|
||||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
|
||||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($objecttype == 'shipping')
|
else if ($objecttype == 'shipping')
|
||||||
{
|
{
|
||||||
$outputlangs->load('orders');
|
$outputlangs->load('orders');
|
||||||
$outputlangs->load('sendings');
|
$outputlangs->load('sendings');
|
||||||
$num=count($objects);
|
foreach($objects as $elementobject)
|
||||||
for ($i=0;$i<$num;$i++)
|
|
||||||
{
|
{
|
||||||
$objects[$i]->fetchObjectLinked();
|
$elementobject->fetchObjectLinked();
|
||||||
$order = $objects[$i]->linkedObjects['commande'][0];
|
$order = $elementobject->linkedObjects['commande'][0];
|
||||||
|
|
||||||
if (! empty($object->linkedObjects['commande'])) // There is already a link to order so we show only info of shipment
|
if (! empty($object->linkedObjects['commande'])) // There is already a link to order so we show only info of shipment
|
||||||
{
|
{
|
||||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
|
||||||
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($objects[$i]->ref);
|
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref);
|
||||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
|
||||||
$linkedobjects[$objecttype]['date_value'].= dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||||
}
|
}
|
||||||
else // We show both info of order and shipment
|
else // We show both info of order and shipment
|
||||||
{
|
{
|
||||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
|
||||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||||
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref);
|
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
|
||||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
|
||||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
|
||||||
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
|
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1023,14 +1023,13 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
|||||||
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE))
|
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE))
|
||||||
{
|
{
|
||||||
//Add the year filter input
|
//Add the year filter input
|
||||||
|
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<table width="100%">';
|
print '<table width="100%">';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Year").'</td>';
|
print '<td>'.$langs->trans("Year").'</td>';
|
||||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="'.$project_year_filter.'"/>';
|
print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="'.$project_year_filter.'"/>';
|
||||||
print '</form>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</table>';
|
print '</table></form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ function dol_hash($chain,$type=0)
|
|||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
||||||
|
|
||||||
// No enconding defined
|
// No particular enconding defined, use default
|
||||||
return md5($chain);
|
return md5($chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -439,7 +439,7 @@ function encodedecode_dbpassconf($level=0)
|
|||||||
/**
|
/**
|
||||||
* Return a generated password using default module
|
* Return a generated password using default module
|
||||||
*
|
*
|
||||||
* @param boolean $generic true=Create generic password (use default crypt function), false=Use the configured password generation module
|
* @param boolean $generic true=Create generic password (use md5, sha1 depending on setup), false=Use the configured password generation module
|
||||||
* @return string New value for password
|
* @return string New value for password
|
||||||
*/
|
*/
|
||||||
function getRandomPassword($generic=false)
|
function getRandomPassword($generic=false)
|
||||||
|
|||||||
@ -789,7 +789,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
|
|
||||||
if (empty($leftmenu) || ($leftmenu == 'suppliers_bills')) {
|
if (empty($leftmenu) || ($leftmenu == 'suppliers_bills')) {
|
||||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2009-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -76,14 +76,15 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction generant le rapport sur le disque
|
* Fonction to generate document on disk
|
||||||
*
|
*
|
||||||
|
* @param RemiseCheque $object Object RemiseCheque
|
||||||
* @param string $_dir Directory
|
* @param string $_dir Directory
|
||||||
* @param string $number Number
|
* @param string $number Number
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @return int 1=ok, 0=ko
|
* @return int 1=ok, 0=ko
|
||||||
*/
|
*/
|
||||||
function write_file($_dir, $number, $outputlangs)
|
function write_file($object, $_dir, $number, $outputlangs)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$hookmanager;
|
global $user,$conf,$langs,$hookmanager;
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
$outputlangs->load("compta");
|
$outputlangs->load("compta");
|
||||||
|
|
||||||
$dir = $_dir . "/".get_exdir($number,2,1,0,null,'cheque').$number;
|
$dir = $_dir . "/".get_exdir($number,0,1,0,$object,'cheque').$number;
|
||||||
|
|
||||||
if (! is_dir($dir))
|
if (! is_dir($dir))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -269,16 +269,30 @@ class pdf_strato extends ModelePDFContract
|
|||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
|
|
||||||
if ($objectligne->datei) {
|
if ($objectligne->date_ouverture_prevue) {
|
||||||
$datei = dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
|
$datei = dol_print_date($objectligne->date_ouverture_prevue,'day',false,$outputlangs,true);
|
||||||
} else {
|
} else {
|
||||||
$datei = $langs->trans("Unknown");
|
$datei = $langs->trans("Unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($objectligne->duration) {
|
if ($objectligne->date_fin_validite) {
|
||||||
$durationi = convertSecondToTime($objectligne->duration);
|
$durationi = convertSecondToTime($objectligne->date_fin_validite - $objectligne->date_ouverture_prevue, 'allwithouthour');
|
||||||
|
$datee = dol_print_date($objectligne->date_fin_validite,'day',false,$outputlangs,true);
|
||||||
} else {
|
} else {
|
||||||
$durationi = $langs->trans("Unknown");
|
$durationi = $langs->trans("Unknown");
|
||||||
|
$datee = $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($objectligne->date_ouverture) {
|
||||||
|
$daters = dol_print_date($objectligne->date_ouverture,'day',false,$outputlangs,true);
|
||||||
|
} else {
|
||||||
|
$daters = $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($objectligne->date_cloture) {
|
||||||
|
$datere = dol_print_date($objectligne->date_cloture,'day',false,$outputlangs,true);
|
||||||
|
} else {
|
||||||
|
$datere = $langs->trans("Unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
$txtpredefinedservice='';
|
$txtpredefinedservice='';
|
||||||
@ -289,7 +303,10 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$txtpredefinedservice .= $objectligne->product_label;
|
$txtpredefinedservice .= $objectligne->product_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".$datei." - ".$outputlangs->transnoentities("Duration")." : ".$durationi,1,$outputlangs->charset_output).'</strong>';
|
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("DateStartPlannedShort")." : ".$datei." - ".$outputlangs->transnoentities("DateEndPlanned")." : ".$datee,1,$outputlangs->charset_output).'</strong>';
|
||||||
|
$txt.='<br>';
|
||||||
|
$txt.='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("DateStartRealShort")." : ".$daters,1,$outputlangs->charset_output);
|
||||||
|
if ($objectligne->date_cloture) $txt.=dol_htmlentitiesbr(" - ".$outputlangs->transnoentities("DateEndRealShort")." : ".$datere,1,$outputlangs->charset_output).'</strong>';
|
||||||
$desc=dol_htmlentitiesbr($objectligne->desc,1);
|
$desc=dol_htmlentitiesbr($objectligne->desc,1);
|
||||||
|
|
||||||
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,dol_concatdesc($txtpredefinedservice,$desc)), 0, 1, 0);
|
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,dol_concatdesc($txtpredefinedservice,$desc)), 0, 1, 0);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$donref = dol_sanitizeFileName($don->ref);
|
$donref = dol_sanitizeFileName($don->ref);
|
||||||
$dir = $conf->don->dir_output . "/" . get_exdir($donref,2,0,1,$don,'donation') . "/" . dol_sanitizeFileName($don->ref);
|
$dir = $conf->don->dir_output . "/" . $donref;
|
||||||
$file = $dir . "/" . $donref . ".html";
|
$file = $dir . "/" . $donref . ".html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class modContrat extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->numero = 54;
|
$this->numero = 54;
|
||||||
@ -132,6 +132,8 @@ class modContrat extends DolibarrModules
|
|||||||
|
|
||||||
// Exports
|
// Exports
|
||||||
//--------
|
//--------
|
||||||
|
$langs->load("contracts");
|
||||||
|
|
||||||
$r=1;
|
$r=1;
|
||||||
|
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
@ -141,18 +143,18 @@ class modContrat extends DolibarrModules
|
|||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode',
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode',
|
||||||
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra',
|
's.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra',
|
||||||
'co.rowid'=>"contractId",'co.ref'=>"contactRef",'co.datec'=>"contractDateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"DateMiseService",
|
'co.rowid'=>"Id",'co.ref'=>"Ref",'co.datec'=>"DateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"ContractStartDate",
|
||||||
'co.fin_validite'=>"EndValidity",'co.date_cloture'=>"Cloture",'co.note_private'=>"NotePrivate",'co.note_public'=>"NotePublic",
|
'co.fin_validite'=>"ContractEndDate",'co.date_cloture'=>"Closing",'co.note_private'=>"NotePrivate",'co.note_public'=>"NotePublic",
|
||||||
'cod.rowid'=>'LineId','cod.label'=>"LineLabel",'cod.description'=>"LineDescription",'cod.price_ht'=>"LineUnitPrice",'cod.tva_tx'=>"LineVATRate",
|
'cod.rowid'=>'LineId','cod.label'=>"LineLabel",'cod.description'=>"LineDescription",'cod.price_ht'=>"LineUnitPrice",'cod.tva_tx'=>"LineVATRate",
|
||||||
'cod.qty'=>"LineQty",'cod.total_ht'=>"LineTotalHT",'cod.total_tva'=>"LineTotalVAT",'cod.total_ttc'=>"LineTotalTTC",
|
'cod.qty'=>"LineQty",'cod.total_ht'=>"LineTotalHT",'cod.total_tva'=>"LineTotalVAT",'cod.total_ttc'=>"LineTotalTTC",
|
||||||
'cod.date_ouverture'=>"DateStart",'cod.date_ouverture_prevue'=>"DateStartPrevis",'cod.date_fin_validite'=>"EndValidity",'cod.date_cloture'=>"DateEnd",
|
'cod.date_ouverture'=>"DateStart",'cod.date_ouverture_prevue'=>"DateStartPlanned",'cod.date_fin_validite'=>"DateEndPlanned",'cod.date_cloture'=>"DateEnd",
|
||||||
'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
||||||
|
|
||||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company',
|
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company',
|
||||||
's.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company',
|
's.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company',
|
||||||
's.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',
|
's.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',
|
||||||
'co.rowid'=>"Contract",'co.ref'=>"Contract",'co.datec'=>"Contract",'co.date_contrat'=>"Contract",'co.mise_en_service'=>"Contract",
|
'co.rowid'=>"contract",'co.ref'=>"contract",'co.datec'=>"contract",'co.date_contrat'=>"contract",'co.mise_en_service'=>"contract",
|
||||||
'co.fin_validite'=>"Contract",'co.date_cloture'=>"Contract",'co.note_private'=>"Contract",'co.note_public'=>"Contract",
|
'co.fin_validite'=>"contract",'co.date_cloture'=>"contract",'co.note_private'=>"contract",'co.note_public'=>"contract",
|
||||||
'cod.rowid'=>'contract_line','cod.label'=>"contract_line",'cod.description'=>"contract_line",'cod.price_ht'=>"contract_line",'cod.tva_tx'=>"contract_line",
|
'cod.rowid'=>'contract_line','cod.label'=>"contract_line",'cod.description'=>"contract_line",'cod.price_ht'=>"contract_line",'cod.tva_tx'=>"contract_line",
|
||||||
'cod.qty'=>"contract_line",'cod.total_ht'=>"contract_line",'cod.total_tva'=>"contract_line",'cod.total_ttc'=>"contract_line",
|
'cod.qty'=>"contract_line",'cod.total_ht'=>"contract_line",'cod.total_tva'=>"contract_line",'cod.total_ttc'=>"contract_line",
|
||||||
'cod.date_ouverture'=>"contract_line",'cod.date_ouverture_prevue'=>"contract_line",'cod.date_fin_validite'=>"contract_line",'cod.date_cloture'=>"contract_line",
|
'cod.date_ouverture'=>"contract_line",'cod.date_ouverture_prevue'=>"contract_line",'cod.date_fin_validite'=>"contract_line",'cod.date_cloture'=>"contract_line",
|
||||||
|
|||||||
@ -154,6 +154,11 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$task = new Task($this->db);
|
$task = new Task($this->db);
|
||||||
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
||||||
|
|
||||||
|
if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
|
||||||
|
{
|
||||||
|
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
|
||||||
|
}
|
||||||
|
|
||||||
$object->lines=$tasksarray;
|
$object->lines=$tasksarray;
|
||||||
$nblignes=count($object->lines);
|
$nblignes=count($object->lines);
|
||||||
|
|
||||||
@ -230,12 +235,12 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
|
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
|
||||||
$pdf->SetXY($this->posxprogress, $curY);
|
$pdf->SetXY($this->posxprogress, $curY);
|
||||||
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
||||||
|
|
||||||
$pdf->SetXY($this->posxdatestart, $curY);
|
$pdf->SetXY($this->posxdatestart, $curY);
|
||||||
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
|
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
|
||||||
$pdf->SetXY($this->posxdateend, $curY);
|
$pdf->SetXY($this->posxdateend, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
||||||
|
|
||||||
|
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|||||||
@ -323,7 +323,6 @@ if ($num> 0)
|
|||||||
$pdf->SetXY($this->posxref, $curY);
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
|
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
|
||||||
|
|
||||||
|
|
||||||
$selectList = $formproject->select_element($tablename, $project->thirdparty->id);
|
$selectList = $formproject->select_element($tablename, $project->thirdparty->id);
|
||||||
$nexY = $pdf->GetY() + 1;
|
$nexY = $pdf->GetY() + 1;
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
@ -333,22 +332,18 @@ if ($num> 0)
|
|||||||
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
|
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
|
||||||
$pdf->SetXY($this->posxsociety, $curY);
|
$pdf->SetXY($this->posxsociety, $curY);
|
||||||
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L');
|
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L');
|
||||||
if (empty($value['disableamount']))
|
if (empty($value['disableamount'])) {
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R');
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R');
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R');
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
||||||
}
|
}
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
|
||||||
|
|
||||||
|
|
||||||
if (is_array($elementarray) && count($elementarray) > 0)
|
if (is_array($elementarray) && count($elementarray) > 0)
|
||||||
{
|
{
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
@ -357,31 +352,32 @@ if ($num> 0)
|
|||||||
$total_ht = 0;
|
$total_ht = 0;
|
||||||
$total_ttc = 0;
|
$total_ttc = 0;
|
||||||
$num = count($elementarray);
|
$num = count($elementarray);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i ++) {
|
||||||
{
|
|
||||||
$element = new $classname($this->db);
|
$element = new $classname($this->db);
|
||||||
$element->fetch($elementarray[$i]);
|
$element->fetch($elementarray[$i]);
|
||||||
$element->fetch_thirdparty();
|
$element->fetch_thirdparty();
|
||||||
// print $classname;
|
// print $classname;
|
||||||
|
|
||||||
$qualifiedfortotal = true;
|
$qualifiedfortotal = true;
|
||||||
if ($key == 'invoice')
|
if ($key == 'invoice') {
|
||||||
{
|
if ($element->close_code == 'replaced')
|
||||||
if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice
|
$qualifiedfortotal = false; // Replacement invoice
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
||||||
|
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date=$element->date_commande;
|
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
||||||
else
|
$date = $element->date_commande;
|
||||||
{
|
else {
|
||||||
$date = $element->date;
|
$date = $element->date;
|
||||||
if (empty($date)) $date=$element->datep;
|
if (empty($date))
|
||||||
if (empty($date)) $date=$element->date_contrat;
|
$date = $element->datep;
|
||||||
if (empty($date)) $date=$element->datev; //Fiche inter
|
if (empty($date))
|
||||||
|
$date = $element->date_contrat;
|
||||||
|
if (empty($date))
|
||||||
|
$date = $element->datev; // Fiche inter
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetXY($this->posxdate, $curY);
|
$pdf->SetXY($this->posxdate, $curY);
|
||||||
@ -391,19 +387,13 @@ if ($num> 0)
|
|||||||
if (is_object($element->thirdparty))
|
if (is_object($element->thirdparty))
|
||||||
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L');
|
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L');
|
||||||
|
|
||||||
|
|
||||||
// Amount without tax
|
// Amount without tax
|
||||||
if (empty($value['disableamount']))
|
if (empty($value['disableamount'])) {
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3,
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R');
|
||||||
(isset($element->total_ht)?price($element->total_ht):' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3,
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R');
|
||||||
(isset($element->total_ttc)?price($element->total_ttc):' '), 1, 'R');
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
||||||
}
|
}
|
||||||
@ -416,11 +406,9 @@ if ($num> 0)
|
|||||||
$outputstatut = $element->getLibStatut(1);
|
$outputstatut = $element->getLibStatut(1);
|
||||||
}
|
}
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3,
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true);
|
||||||
$outputstatut, 1, 'R',false, 1, '', '', true, 0, true);
|
|
||||||
|
|
||||||
if ($qualifiedfortotal)
|
if ($qualifiedfortotal) {
|
||||||
{
|
|
||||||
$total_ht = $total_ht + $element->total_ht;
|
$total_ht = $total_ht + $element->total_ht;
|
||||||
$total_ttc = $total_ttc + $element->total_ttc;
|
$total_ttc = $total_ttc + $element->total_ttc;
|
||||||
}
|
}
|
||||||
@ -428,21 +416,16 @@ $nexY = $pdf->GetY();
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($value['disableamount'])) {
|
||||||
if (empty($value['disableamount']))
|
|
||||||
{
|
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L');
|
$pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L');
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3,
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R');
|
||||||
(isset($element->total_ht)?price($total_ht):' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3,
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R');
|
||||||
(isset($element->total_ttc)?price($total_ttc):' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3,
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L');
|
||||||
$outputlangs->transnoentities("Nb")." ".$num, 1, 'L');
|
|
||||||
}
|
}
|
||||||
$nexY = $pdf->GetY() + 5;
|
$nexY = $pdf->GetY() + 5;
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
|
|||||||
print '<table width="100%" class="nobordernopadding"><tr><td';
|
print '<table width="100%" class="nobordernopadding"><tr><td';
|
||||||
//var_dump($action);exit;
|
//var_dump($action);exit;
|
||||||
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
if ((! empty($action) && ($action == 'create' || $action == 'edit')) && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
|
||||||
print '>' . $label . '</td>';
|
print '>' . $langs->trans($label) . '</td>';
|
||||||
|
|
||||||
//TODO Improve element and rights detection
|
//TODO Improve element and rights detection
|
||||||
//var_dump($user->rights);
|
//var_dump($user->rights);
|
||||||
|
|||||||
@ -322,7 +322,7 @@ if (! empty($conf->margin->enabled))
|
|||||||
var remise = $("input[name='remise_percent']:first");
|
var remise = $("input[name='remise_percent']:first");
|
||||||
|
|
||||||
var rate = $("input[name='"+npRate+"']:first");
|
var rate = $("input[name='"+npRate+"']:first");
|
||||||
if (rate.val() == '') return true;
|
if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true;
|
||||||
|
|
||||||
if (! $.isNumeric(rate.val().replace(',','.')))
|
if (! $.isNumeric(rate.val().replace(',','.')))
|
||||||
{
|
{
|
||||||
@ -331,7 +331,7 @@ if (! empty($conf->margin->enabled))
|
|||||||
setTimeout(function () { rate.focus() }, 50);
|
setTimeout(function () { rate.focus() }, 50);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (npRate == "markRate" && rate.val() >= 100)
|
if (npRate == "np_markRate" && rate.val() >= 100)
|
||||||
{
|
{
|
||||||
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
|
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@ -347,9 +347,11 @@ if (! empty($conf->margin->enabled))
|
|||||||
bpjs=price2numjs(buying_price.val());
|
bpjs=price2numjs(buying_price.val());
|
||||||
ratejs=price2numjs(rate.val());
|
ratejs=price2numjs(rate.val());
|
||||||
|
|
||||||
if (npRate == "marginRate")
|
/* console.log(npRate+" - "+bpjs+" - "+ratejs); */
|
||||||
|
|
||||||
|
if (npRate == "np_marginRate")
|
||||||
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
|
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
|
||||||
else if (npRate == "markRate")
|
else if (npRate == "np_markRate")
|
||||||
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
|
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
|
||||||
}
|
}
|
||||||
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
|
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
|
||||||
|
|||||||
@ -229,6 +229,25 @@ if ($action == 'set_paid')
|
|||||||
setEventMessage($object->error, 'errors');
|
setEventMessage($object->error, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Remove file in doc form
|
||||||
|
if ($action == 'remove_file')
|
||||||
|
{
|
||||||
|
$object = new Don($db, 0, $_GET['id']);
|
||||||
|
if ($object->fetch($id))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$langs->load("other");
|
||||||
|
$upload_dir = $conf->don->dir_output;
|
||||||
|
$file = $upload_dir . '/' . GETPOST('file');
|
||||||
|
$ret=dol_delete_file($file,0,0,0,$object);
|
||||||
|
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||||
|
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Build doc
|
* Build doc
|
||||||
@ -744,12 +763,10 @@ if (! empty($id) && $action != 'edit')
|
|||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$filename = dol_sanitizeFileName($object->id);
|
$filename = dol_sanitizeFileName($object->id);
|
||||||
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref);
|
$filedir = $conf->don->dir_output . "/" . dol_sanitizeFileName($object->id);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id;
|
||||||
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
$genallowed = ($object->statut == 2 && ($object->paid == 0 || $user->admin) && $user->rights->don->creer);
|
||||||
// $delallowed=$user->rights->facture->supprimer;
|
$delallowed = $user->rights->don->supprimer;
|
||||||
$genallowed=1;
|
|
||||||
$delallowed=0;
|
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
|||||||
@ -628,7 +628,7 @@ class Expedition extends CommonObject
|
|||||||
// TODO possibilite d'expedier a partir d'une propale ou autre origine
|
// TODO possibilite d'expedier a partir d'une propale ou autre origine
|
||||||
$sql = "SELECT cd.fk_product, cd.subprice,";
|
$sql = "SELECT cd.fk_product, cd.subprice,";
|
||||||
$sql.= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
$sql.= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
||||||
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty, edb.fk_origin_stock";
|
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed";
|
$sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
|
||||||
@ -665,7 +665,7 @@ class Expedition extends CommonObject
|
|||||||
// line with batch detail
|
// line with batch detail
|
||||||
|
|
||||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->edbqty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++; break;
|
$error++; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,13 +48,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
|
|
||||||
|
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="list.php">';
|
print '<form method="post" action="list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchASending").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchASending").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shipments to validate
|
* Shipments to validate
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Charles-Fr BENKE <charles.fr@benke.fr>
|
* Copyright (C) 2012 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||||
|
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -63,7 +64,8 @@ $entitytoicon = array(
|
|||||||
'shipment' => 'sending',
|
'shipment' => 'sending',
|
||||||
'shipment_line'=> 'sending',
|
'shipment_line'=> 'sending',
|
||||||
'expensereport'=> 'trip',
|
'expensereport'=> 'trip',
|
||||||
'expensereport_line'=> 'trip'
|
'expensereport_line'=> 'trip',
|
||||||
|
'contract_line' => 'contract'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Translation code
|
// Translation code
|
||||||
@ -101,7 +103,9 @@ $entitytolang = array(
|
|||||||
'task_time' => 'TaskTimeSpent',
|
'task_time' => 'TaskTimeSpent',
|
||||||
'action' => 'Event',
|
'action' => 'Event',
|
||||||
'expensereport'=> 'ExpenseReport',
|
'expensereport'=> 'ExpenseReport',
|
||||||
'expensereport_line'=> 'ExpenseReportLine'
|
'expensereport_line'=> 'ExpenseReportLine',
|
||||||
|
'contract' => 'Contract',
|
||||||
|
'contract_line'=> 'ContractLine'
|
||||||
);
|
);
|
||||||
|
|
||||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||||
|
|||||||
@ -1197,7 +1197,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog("Error error=".$this->error, LOG_ERR);
|
dol_syslog("Error after updateline error=".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -2096,16 +2096,17 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($this->fk_product) {
|
if (empty($this->fk_product))
|
||||||
|
{
|
||||||
$fk_product = "null";
|
$fk_product = "null";
|
||||||
} else {
|
} else {
|
||||||
$fk_product = $this->fk_product;
|
$fk_product = $this->fk_product;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->fk_unit) {
|
if (empty($this->fk_unit)) {
|
||||||
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
|
|
||||||
} else {
|
|
||||||
$fk_unit = "null";
|
$fk_unit = "null";
|
||||||
|
} else {
|
||||||
|
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||||
|
|||||||
@ -58,15 +58,15 @@ print '<tr valign="top"><td class="notopnoleft" width="30%">';
|
|||||||
* Search form
|
* Search form
|
||||||
*/
|
*/
|
||||||
$var=false;
|
$var=false;
|
||||||
print '<table class="noborder nohover" width="100%">';
|
|
||||||
print '<form method="post" action="list.php">';
|
print '<form method="post" action="list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="search_all" size="18"></td>';
|
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="search_all" size="18"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</form></table><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -454,6 +454,8 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||||||
print '<h3>' . $companystatic->getNomUrl(1, 'customer') . '</h3>';
|
print '<h3>' . $companystatic->getNomUrl(1, 'customer') . '</h3>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<form method="get" action="orderstoinvoice.php">';
|
||||||
|
print '<input type="hidden" name="socid" value="' . $socid . '">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans('Ref'), 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans('Ref'), 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder);
|
||||||
@ -465,8 +467,6 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
print '<form method="get" action="orderstoinvoice.php">';
|
|
||||||
print '<input type="hidden" name="socid" value="' . $socid . '">';
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
// REF
|
// REF
|
||||||
@ -497,7 +497,6 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
||||||
$var = True;
|
$var = True;
|
||||||
|
|||||||
@ -305,7 +305,7 @@ if ($resql)
|
|||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" align="right">';
|
||||||
print '<input class="flat" type="text" size="6" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
print '<input class="flat" type="text" size="6" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" align="right">';
|
||||||
$liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
|
$liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
|
||||||
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" align="right">';
|
||||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
|||||||
@ -790,3 +790,5 @@ DELETE FROM llx_c_departements WHERE ncc='OTROS' AND fk_region=420;
|
|||||||
DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4;
|
DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4;
|
||||||
|
|
||||||
ALTER TABLE llx_c_paiement MODIFY COLUMN libelle varchar(62);
|
ALTER TABLE llx_c_paiement MODIFY COLUMN libelle varchar(62);
|
||||||
|
|
||||||
|
ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL;
|
||||||
@ -19,4 +19,7 @@
|
|||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
|
|
||||||
|
|
||||||
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
|
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
|
||||||
|
|
||||||
|
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
|
||||||
|
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
create table llx_accounting_system
|
create table llx_accounting_system
|
||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
pcg_version varchar(12) NOT NULL,
|
pcg_version varchar(32) NOT NULL,
|
||||||
fk_pays integer NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
label varchar(128) NOT NULL,
|
label varchar(128) NOT NULL,
|
||||||
active smallint DEFAULT 0
|
active smallint DEFAULT 0
|
||||||
|
|||||||
@ -24,7 +24,7 @@ create table llx_accountingaccount
|
|||||||
entity integer DEFAULT 1 NOT NULL,
|
entity integer DEFAULT 1 NOT NULL,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_pcg_version varchar(12) NOT NULL,
|
fk_pcg_version varchar(32) NOT NULL,
|
||||||
pcg_type varchar(20) NOT NULL,
|
pcg_type varchar(20) NOT NULL,
|
||||||
pcg_subtype varchar(20) NOT NULL,
|
pcg_subtype varchar(20) NOT NULL,
|
||||||
account_number varchar(32) NOT NULL,
|
account_number varchar(32) NOT NULL,
|
||||||
|
|||||||
@ -32,5 +32,5 @@ create table llx_societe_remise_except
|
|||||||
fk_facture_line integer,
|
fk_facture_line integer,
|
||||||
fk_facture integer,
|
fk_facture integer,
|
||||||
fk_facture_source integer,
|
fk_facture_source integer,
|
||||||
description varchar(255) NOT NULL
|
description text NOT NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -63,7 +63,7 @@ MenuSpecialExpenses=Special expenses
|
|||||||
MenuTaxAndDividends=Taxes and dividends
|
MenuTaxAndDividends=Taxes and dividends
|
||||||
MenuSalaries=Salaries
|
MenuSalaries=Salaries
|
||||||
MenuSocialContributions=Social/fiscal taxes
|
MenuSocialContributions=Social/fiscal taxes
|
||||||
MenuNewSocialContribution=New tax payment
|
MenuNewSocialContribution=New social/fiscal tax
|
||||||
NewSocialContribution=New social/fiscal tax
|
NewSocialContribution=New social/fiscal tax
|
||||||
ContributionsToPay=Social/fiscal taxes to pay
|
ContributionsToPay=Social/fiscal taxes to pay
|
||||||
AccountancyTreasuryArea=Accountancy/Treasury area
|
AccountancyTreasuryArea=Accountancy/Treasury area
|
||||||
|
|||||||
@ -21,6 +21,8 @@ ServicesLegend=Services legend
|
|||||||
Contracts=Contracts
|
Contracts=Contracts
|
||||||
ContractsAndLine=Contracts and line of contracts
|
ContractsAndLine=Contracts and line of contracts
|
||||||
Contract=Contract
|
Contract=Contract
|
||||||
|
ContractLine=Contract line
|
||||||
|
Closing=Closing
|
||||||
NoContracts=No contracts
|
NoContracts=No contracts
|
||||||
MenuServices=Services
|
MenuServices=Services
|
||||||
MenuInactiveServices=Services not active
|
MenuInactiveServices=Services not active
|
||||||
|
|||||||
@ -79,7 +79,7 @@ ErrorModuleRequireJavascript=Javascript must not be disabled to have this featur
|
|||||||
ErrorPasswordsMustMatch=Both typed passwords must match each other
|
ErrorPasswordsMustMatch=Both typed passwords must match each other
|
||||||
ErrorContactEMail=A technical error occured. Please, contact administrator to following email <b>%s</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page.
|
ErrorContactEMail=A technical error occured. Please, contact administrator to following email <b>%s</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page.
|
||||||
ErrorWrongValueForField=Wrong value for field number <b>%s</b> (value '<b>%s</b>' does not match regex rule <b>%s</b>)
|
ErrorWrongValueForField=Wrong value for field number <b>%s</b> (value '<b>%s</b>' does not match regex rule <b>%s</b>)
|
||||||
ErrorFieldValueNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a value available into field <b>%s</b> of table <b>%s</b> = <b>%s</b>)
|
ErrorFieldValueNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a value available into field <b>%s</b> of table <b>%s</b>)
|
||||||
ErrorFieldRefNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a <b>%s</b> existing ref)
|
ErrorFieldRefNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a <b>%s</b> existing ref)
|
||||||
ErrorsOnXLines=Errors on <b>%s</b> source record(s)
|
ErrorsOnXLines=Errors on <b>%s</b> source record(s)
|
||||||
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)
|
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)
|
||||||
|
|||||||
@ -48,6 +48,7 @@ NoImportableData=No importable data (no module with definitions to allow data im
|
|||||||
FileSuccessfullyBuilt=Export file generated
|
FileSuccessfullyBuilt=Export file generated
|
||||||
SQLUsedForExport=SQL Request used to build export file
|
SQLUsedForExport=SQL Request used to build export file
|
||||||
LineId=Id of line
|
LineId=Id of line
|
||||||
|
LineLabel=Label of line
|
||||||
LineDescription=Description of line
|
LineDescription=Description of line
|
||||||
LineUnitPrice=Unit price of line
|
LineUnitPrice=Unit price of line
|
||||||
LineVATRate=VAT Rate of line
|
LineVATRate=VAT Rate of line
|
||||||
|
|||||||
@ -709,6 +709,7 @@ GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into
|
|||||||
Deny=Deny
|
Deny=Deny
|
||||||
Denied=Denied
|
Denied=Denied
|
||||||
ListOfTemplates=List of templates
|
ListOfTemplates=List of templates
|
||||||
|
Gender=Gender
|
||||||
Genderman=Man
|
Genderman=Man
|
||||||
Genderwoman=Woman
|
Genderwoman=Woman
|
||||||
ViewList=List view
|
ViewList=List view
|
||||||
@ -745,3 +746,4 @@ ShortFriday=F
|
|||||||
ShortSaturday=S
|
ShortSaturday=S
|
||||||
ShortSunday=S
|
ShortSunday=S
|
||||||
SelectMailModel=Select email template
|
SelectMailModel=Select email template
|
||||||
|
SetRef=Set ref
|
||||||
@ -143,7 +143,8 @@ SelectElement=Select element
|
|||||||
AddElement=Link to element
|
AddElement=Link to element
|
||||||
UnlinkElement=Unlink element
|
UnlinkElement=Unlink element
|
||||||
# Documents models
|
# Documents models
|
||||||
DocumentModelBaleine=A complete project's report model (logo...)
|
DocumentModelBeluga=Project template for linked objects overview
|
||||||
|
DocumentModelBaleine=Project report template for tasks
|
||||||
PlannedWorkload=Planned workload
|
PlannedWorkload=Planned workload
|
||||||
PlannedWorkloadShort=Workload
|
PlannedWorkloadShort=Workload
|
||||||
WorkloadOccupation=Workload assignation
|
WorkloadOccupation=Workload assignation
|
||||||
|
|||||||
@ -79,7 +79,7 @@ ErrorModuleRequireJavascript=Le javascript ne doit pas être désactivé pour qu
|
|||||||
ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre
|
ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre
|
||||||
ErrorContactEMail=Une erreur technique est apparue. Merci de contacter l'administrateur à l'email suivant <b>%s</b> en lui indiquant le code erreur <b>%s</b> dans votre message ou mieux en fournissant une copie d'écran de cette page.
|
ErrorContactEMail=Une erreur technique est apparue. Merci de contacter l'administrateur à l'email suivant <b>%s</b> en lui indiquant le code erreur <b>%s</b> dans votre message ou mieux en fournissant une copie d'écran de cette page.
|
||||||
ErrorWrongValueForField=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' ne respecte pas la règle <b>%s</b>)
|
ErrorWrongValueForField=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' ne respecte pas la règle <b>%s</b>)
|
||||||
ErrorFieldValueNotIn=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' n'est pas une valeur présente dans le champ <b>%s</b> de la table <b>%s</b> = <b>%s</b>)
|
ErrorFieldValueNotIn=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' n'est pas une valeur présente dans le champ <b>%s</b> de la table <b>%s</b>)
|
||||||
ErrorFieldRefNotIn=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' n'est pas une référence existante comme <b>%s</b>)
|
ErrorFieldRefNotIn=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<b>%s</b>' n'est pas une référence existante comme <b>%s</b>)
|
||||||
ErrorsOnXLines=Erreurs sur <b>%s</b> enregistrement(s) source
|
ErrorsOnXLines=Erreurs sur <b>%s</b> enregistrement(s) source
|
||||||
ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) !
|
ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) !
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013-2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2013-2014 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
@ -1786,6 +1786,8 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans("Add"),'','');
|
print load_fiche_titre($langs->trans("Add"),'','');
|
||||||
|
|
||||||
|
dol_fiche_head('');
|
||||||
|
|
||||||
$html .= '<tr><td class="nowrap">'.$langs->trans("Quantity").' ';
|
$html .= '<tr><td class="nowrap">'.$langs->trans("Quantity").' ';
|
||||||
$html .= '<input type="text" class="flat" name="qty" size="1" value="1"></td><td class="nowrap">'.$langs->trans("ReductionShort").'(%) ';
|
$html .= '<input type="text" class="flat" name="qty" size="1" value="1"></td><td class="nowrap">'.$langs->trans("ReductionShort").'(%) ';
|
||||||
$html .= '<input type="text" class="flat" name="remise_percent" size="1" value="0">';
|
$html .= '<input type="text" class="flat" name="remise_percent" size="1" value="0">';
|
||||||
@ -1795,6 +1797,8 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
|||||||
print $html;
|
print $html;
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
|
* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
|
||||||
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -321,6 +322,8 @@ if ($id || $ref)
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="updateprice">';
|
print '<input type="hidden" name="action" value="updateprice">';
|
||||||
|
|
||||||
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("Supplier").'</td><td>';
|
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("Supplier").'</td><td>';
|
||||||
@ -487,9 +490,11 @@ if ($id || $ref)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -536,6 +541,7 @@ if ($id || $ref)
|
|||||||
print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DiscountQtyMin"));
|
print_liste_field_titre($langs->trans("DiscountQtyMin"));
|
||||||
print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
|
||||||
// Charges ????
|
// Charges ????
|
||||||
if ($conf->global->PRODUCT_CHARGES)
|
if ($conf->global->PRODUCT_CHARGES)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
||||||
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -690,6 +691,9 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="update_price">';
|
print '<input type="hidden" name="action" value="update_price">';
|
||||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||||
|
|
||||||
|
dol_fiche_head('');
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
@ -771,7 +775,9 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||||
@ -787,6 +793,9 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="update_price">';
|
print '<input type="hidden" name="action" value="update_price">';
|
||||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||||
|
|
||||||
|
dol_fiche_head('');
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
@ -826,9 +835,14 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"> ';
|
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||||
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></td></tr>';
|
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -662,6 +662,13 @@ class MouvementStock extends CommonObject
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if ($origintype)
|
||||||
|
{
|
||||||
|
dol_include_once ('/'.$origintype.'/class/'.$origintype.'.class.php');
|
||||||
|
$classname = ucfirst($origintype);
|
||||||
|
$origin = new $classname($this->db);
|
||||||
|
}
|
||||||
|
else
|
||||||
return '';
|
return '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -498,7 +498,6 @@ if ($resql)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre" valign="right">';
|
print '<td class="liste_titre" valign="right">';
|
||||||
print '<input class="flat" type="text" size="2" maxlength="2" placeholder="'.dol_escape_htmltag($langs->trans("Month")).'" name="month" value="'.$month.'">';
|
print '<input class="flat" type="text" size="2" maxlength="2" placeholder="'.dol_escape_htmltag($langs->trans("Month")).'" name="month" value="'.$month.'">';
|
||||||
@ -549,7 +548,6 @@ if ($resql)
|
|||||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$arrayofuniqueproduct=array();
|
$arrayofuniqueproduct=array();
|
||||||
|
|
||||||
@ -621,7 +619,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table></form><br>";
|
||||||
|
|
||||||
// Add number of product when there is a filter on period
|
// Add number of product when there is a filter on period
|
||||||
if (count($arrayofuniqueproduct) == 1 && is_numeric($year))
|
if (count($arrayofuniqueproduct) == 1 && is_numeric($year))
|
||||||
|
|||||||
@ -258,6 +258,7 @@ llxHeader("",$title,"");
|
|||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
||||||
|
|
||||||
|
$param=($mode?'&mode='.$mode:'');
|
||||||
|
|
||||||
// Show navigation bar
|
// Show navigation bar
|
||||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||||
|
|||||||
@ -236,6 +236,7 @@ llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
|||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
||||||
|
|
||||||
|
$param=($mode?'&mode='.$mode:'');
|
||||||
|
|
||||||
// Show navigation bar
|
// Show navigation bar
|
||||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||||
|
|||||||
@ -709,7 +709,7 @@ class Societe extends CommonObject
|
|||||||
$this->localtax2_value=trim($this->localtax2_value);
|
$this->localtax2_value=trim($this->localtax2_value);
|
||||||
|
|
||||||
$this->capital=price2num(trim($this->capital),'MT');
|
$this->capital=price2num(trim($this->capital),'MT');
|
||||||
if (empty($this->capital)) $this->capital = 0;
|
if (empty($this->capital) || ! is_numeric($this->capital)) $this->capital = 0;
|
||||||
|
|
||||||
$this->effectif_id=trim($this->effectif_id);
|
$this->effectif_id=trim($this->effectif_id);
|
||||||
$this->forme_juridique_code=trim($this->forme_juridique_code);
|
$this->forme_juridique_code=trim($this->forme_juridique_code);
|
||||||
|
|||||||
@ -725,7 +725,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="createuser">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST" name="createuser">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
if (! empty($ldap_sid)) print '<input type="hidden" name="ldap_sid" value="'.$ldap_sid.'">';
|
if (! empty($ldap_sid)) print '<input type="hidden" name="ldap_sid" value="'.dol_escape_htmltag($ldap_sid).'">';
|
||||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||||
|
|
||||||
dol_fiche_head('', '', '', 0, '');
|
dol_fiche_head('', '', '', 0, '');
|
||||||
|
|||||||
@ -807,9 +807,9 @@ class User extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Create a user into database
|
* Create a user into database
|
||||||
*
|
*
|
||||||
* @param User $user Objet user qui demande la creation
|
* @param User $user Objet user doing creation
|
||||||
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
|
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||||
* @return int <0 si KO, id compte cree si OK
|
* @return int <0 if KO, id of created user if OK
|
||||||
*/
|
*/
|
||||||
function create($user,$notrigger=0)
|
function create($user,$notrigger=0)
|
||||||
{
|
{
|
||||||
@ -829,6 +829,12 @@ class User extends CommonObject
|
|||||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (empty($this->login))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorFieldRequired",$this->login);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$this->datec = dol_now();
|
$this->datec = dol_now();
|
||||||
|
|
||||||
@ -1171,6 +1177,12 @@ class User extends CommonObject
|
|||||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (empty($this->login))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorFieldRequired",$this->login);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user