Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop

This commit is contained in:
Darkjeff 2017-08-09 16:43:12 +02:00
commit 58f9bf6bab
132 changed files with 5700 additions and 3416 deletions

122
ChangeLog
View File

@ -2,12 +2,134 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 7.0.0 compared to 6.0.* *****
***** ChangeLog for 6.0.0 compared to 5.0.* *****
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes)
NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC)
NEW: Add a tracking id into mass emailing.
NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST).
NEW: Add calculation function for Loan schedule
NEW: Add "depends on" and "required by" into module informations
NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO
NEW: Add key __USERID__ and __ENTITYID__ as key for dynamic filters.
NEW: Add last activation author and ip of modules
NEW: Add mass actions (pdf merge and delete) for interventions
NEW: Add module resources import/export
NEW: Add option PROJECT_THIRDPARTY_REQUIRED
NEW: Add page statistics for project tasks
NEW: add property to show warnings when activating modules
NEW: add rapport file for supplier paiement
NEW: Add statistics on supplier tab.
NEW: Add tooltip help on shipment weight and volume calculation
NEW: An external module can hook and add mass actions
NEW: Better reponsive design
NEW: Bookmarks are into a combo list.
NEW: Bulk actions available on supplier orders
NEW: Can add a background image on login page
NEW: Can change customer from POS
NEW: Can clone expense report on another user
NEW: Can control constants values into file integrity checker
NEW: Can define default values for create forms.
NEW: Can define default filters for list pages.
NEW: Can define default sort order for list pages.
NEW: Can deploy an external module from the module setup area.
NEW: Can disable all overwrote translations in one click.
NEW: Can edit background color for odd and even lines in tables
NEW: Can filter on code in dictionnaries
NEW: Can filter on year and product tags on the product statistic page
NEW: Can import users
NEW: Can read time spent of others (hierarchy only or all if granted)
NEW: Can send an email to a user from its card.
NEW: Can send email to multiple destinaries from the mailform combo list.
NEW: Can set margins of PDFs
NEW: Can set number of dump to keep with job "local database backup"
NEW: Can sort customer balance summary on date.
NEW: Can sort thumbs visible on product card.
NEW: Can use a credit note into a "down payment/deposit".
NEW: Can use dol_fiche_end without showing bottom border.
NEW: Can use translations into all substitutions (watermark, freetext...)
NEW: Change to allow a specific numbering rule for invoice with POS module.
NEW: convert exceiss received to reduc
NEW: custom dir is enabled dy default on first install.
NEW: Description of feature of a module visible into a dedicated popup.
NEW: Direct open of card after a search if one record only found.
NEW: download button
NEW: Enable bulk actions delete on supplier invoices.
NEW: Extrafields support formulas to be computed using PHP expressions.
NEW: Feature to crop/resize images available on user and expense reports.
NEW: Filechecker can include custom dir and report added files.
NEW: fix listview class and add a demo for product list
NEW: [FP17] Accountancy - Add select field in list of accounts
NEW: get amount base on hourly rate for ficheinter
NEW: hidden Easter egg to display commitstrip strip on login page
NEW: Include an hourglass icon when we click on online payment button
NEW: Index upload files into database.
NEW: Introduce mass action on product list ('delete' for the moment)
NEW: Introduce mass actions on contacts
NEW: Introduce option MAIN_HTTP_CONTENT_SECURITY_POLICY
NEW: It's easier to switch between sandbox and live for paypal
NEW: Mass action delete available on project and tasks
NEW: Move login information on home page into a widget
NEW: new demo entry page
NEW: No external check of version without explicit click in about page.
NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class
NEW: odt usergroup
NEW: On invoices generated by template, we save if invoice come from a source template.
NEW: option to copy into attachement files of events, files send by mail (with auto event creation)
NEW: PDF with numbertoword
NEW: Permit multiple file upload in linked documents
NEW: PHP 7.1 compatibility
NEW: Reduce memory usage by removing deprecated constant loading.
NEW: Report page and menu for suppliers paiements
NEW: Show by default README.md file found into root dir of ext module.
NEW: Show company into combo list of projects
NEW: show files in the bank statement + download
NEW: Show local taxes in facture list
NEW: Show local taxes in supplier facture list
NEW: Small PDF template for products
NEW: Option SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT
NEW: The substitution keys available for emailing edition are now visible into a popup.
NEW: Uniformize behaviour: Action to make order is an action button.
NEW: Use autocompletion on the "Add widget list".
NEW: Use html5 type "number" on select field for year and duration.
NEW: Can use pdktk to concat mass pdf because tcpdf generate avoid to split large file into multiple smaller file (all have same size) encounter issue with mailer provider virtual delivery service
NEW: Default theme of v6 is cleaner.
NEW: When down payment is entered, discount to reuse into final invoice is automatically created. This save one click into invoice workflow.
NEW: Add UI to configure MEMBER_NEWFORM_FORCETYPE
NEW: #2763 Go to document block after clicking in Generate document button
NEW: #6280: Generate PDF after creating an invoice from a customer order
NEW: #6915 Simplest change.
NEW: Uniformize the look and feel with v6 new look.
For developers:
NEW: Add a lot of API REST: dictionaryevents, memberstypes, ...
NEW: Big refactorization of multicompany transverse mode.
NEW: getEntity function use true $shared value by default.
NEW: Add font-awesome css.
NEW: Add function ajax_autoselect
NEW: Add function dolMd2Html
NEW: Add hook doUpgrade2
NEW: Add hook "formatNotificationMessage"
NEW: Add index and constraints keys on supplier proposal detail table
NEW: Add phpunit to check the engine is defined into sql create files.
NEW: Add project and Hook to Loan
NEW: Add REST API to push a file.
NEW: Allow extrafields list select to be dependands on other standard list and not only other extrafields list
NEW: Architecture to manage search criteria persistance (using save_lastsearch_values=1 on exit links and restore_lastsearch_values=1 in entry links)
NEW: data files are now also parsed by phpunit for sql syntax
NEW: Hook to allow inserting custom product head #6001
NEW: Introduce fields that can be computed during export in export profiles.
NEW: Introduce function dol_compress_dir
NEW: Removed commande_pdf_create, contract_pdf_create,expedition_pdf_create, facture_pdf_create, delivery_order_pdf_create, task_pdf_create, project_pdf_create, propale_pdf_create, supplier_invoice_pdf_create, supplier_order_pdf_create, supplier_proposal_pdf_create deprecated functions
NEW: tooltip can be on hover or on click with textwithpicto function.
NEW: Upgrade jquery to 3.3.1 and jquery-ui to 1.12
WARNING:

View File

@ -353,10 +353,12 @@ begin
begin
// TODO Copy file or ask to install package ?
//CustomMessage('YouWillInstallDoliWamp')+#13#13
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://ccc">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
end;
// Pb seems similar with msvcp110.dll
//vcredist_x64.exe
// If we have a new database version, we should only copy old my.ini file into new directory
// and change only all basedir= strings to use new version. Like this, data dir is still correct.
// Install of service and stop/start scripts are already rebuild by installer.

View File

@ -592,6 +592,8 @@ if ($nboftargetok) {
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
}
# Build package for each target
@ -972,9 +974,11 @@ if ($nboftargetok) {
$ret=`$cmd`;
$ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject_api_class.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`;

View File

@ -162,6 +162,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories

View File

@ -242,6 +242,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories

View File

@ -159,6 +159,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories

View File

@ -170,6 +170,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/api
%_datadir/dolibarr/htdocs/asterisk
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
%_datadir/dolibarr/htdocs/cashdesk
%_datadir/dolibarr/htdocs/categories

View File

@ -1 +1,4 @@
http://www.taxrates.cc/index.html
http://www.taxrates.cc/index.html
For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst

View File

@ -25,7 +25,7 @@ $path=dirname(__FILE__).'/';
$web=0;
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi')
if (substr($sapi_type, 0, 3) == 'cgi')
{
$web=1;
}
@ -35,9 +35,9 @@ if ($web)
{
echo "<html>";
echo "<head>";
echo "<STYLE type=\"text/css\">
table {
background: #f5f5f5;
border-collapse: separate;
@ -48,7 +48,7 @@ if ($web)
text-align: left;
width: 800px;
}
th {
background-color: #777;
border-left: 1px solid #555;
@ -61,7 +61,7 @@ if ($web)
position: relative;
text-shadow: 0 1px 0 #000;
}
td {
border-right: 1px solid #fff;
border-left: 1px solid #e8e8e8;
@ -70,19 +70,19 @@ if ($web)
padding: 10px 15px;
position: relative;
}
tr {
background-color: #f1f1f1;
}
tr:nth-child(odd) td {
background-color: #f1f1f1;
}
</STYLE>";
echo "<body>";
}
@ -142,9 +142,9 @@ foreach ($files AS $file) {
}
}
foreach ($langstrings_3d AS $filename => $file)
foreach ($langstrings_3d AS $filename => $file)
{
foreach ($file AS $linenum => $value)
foreach ($file AS $linenum => $value)
{
$keys = array_keys($langstrings_full, $value);
if (count($keys)>1)
@ -173,11 +173,11 @@ $sininstallandadmin='';
$sother='';
$count = 0;
foreach ($dups as $string => $pages)
foreach ($dups as $string => $pages)
{
$count++;
$s='';
// Keyword $string
if ($web) $s.="<tr>";
if ($web) $s.="<td align=\"center\">";
@ -188,32 +188,32 @@ foreach ($dups as $string => $pages)
if ($web) $s.="</td>";
if ($web) $s.="<td>";
if (! $web) $s.= ' : ';
// Loop on each files keyword was found
$duplicateinsamefile=0;
$inmain=0;
$inadmin=0;
foreach ($pages AS $file => $lines)
foreach ($pages AS $file => $lines)
{
if ($file == 'main.lang') { $inmain=1; $inadmin=0; }
if ($file == 'admin.lang' && ! $inmain) { $inadmin=1; }
$s.=$file." ";
// Loop on each line keword was found into file.
$listoffilesforthisentry=array();
foreach ($lines as $line => $translatedvalue)
foreach ($lines as $line => $translatedvalue)
{
if (! empty($listoffilesforthisentry[$file])) $duplicateinsamefile=1;
$listoffilesforthisentry[$file]=1;
$s.= "(".$line." - ".htmlentities($translatedvalue).") ";
}
if ($web) $s.="<br>";
}
if ($web) $s.="</td></tr>";
$s.="\n";
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
else if ($inmain) $sinmainandother .= $s;
else if ($inadmin) $sininstallandadmin .= $s;
@ -252,7 +252,7 @@ if ($web)
if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true'))
{
print "***** Strings in en_US that are never used:\n";
$unused=array();
foreach ($langstrings_dist AS $value => $line)
{
@ -288,7 +288,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0;
if (preg_match('/^newLT/', $value)) $qualifiedforclean=0;
if (preg_match('/^LT\d/', $value)) $qualifiedforclean=0;
if (preg_match('/^LT[0-9]/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0;
if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0;
if (preg_match('/^Language_/', $value)) $qualifiedforclean=0;
@ -315,7 +315,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
// orders
if (preg_match('/^OrderSource/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_/', $value)) $qualifiedforclean=0;
// other.lang
// other.lang
if (preg_match('/^Notify_/', $value)) $qualifiedforclean=0;
if (preg_match('/^PredefinedMail/', $value)) $qualifiedforclean=0;
if (preg_match('/^DemoCompany/', $value)) $qualifiedforclean=0;
@ -336,17 +336,17 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/OppStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/AvailabilityType/', $value)) $qualifiedforclean=0;
if (preg_match('/CardProduct/', $value)) $qualifiedforclean=0;
if (preg_match('/sms/i', $value)) $qualifiedforclean=0;
if (preg_match('/TF_/i', $value)) $qualifiedforclean=0;
if (preg_match('/WithBankUsing/i', $value)) $qualifiedforclean=0;
if (preg_match('/descWORKFLOW_/i', $value)) $qualifiedforclean=0;
if (! $qualifiedforclean)
{
continue;
continue;
}
//$search = '\'trans("'.$value.'")\'';
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"';
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
@ -356,7 +356,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
$unused[$value] = $line;
echo $line; // $trad contains the \n
}
else
else
{
unset($output);
//print 'X'.$output.'Y';
@ -364,7 +364,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
}
if (empty($unused)) print "No string not used found.\n";
else
else
{
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";

View File

@ -71,6 +71,7 @@ class BookKeeping extends CommonObject
/**
*/
public $doc_date;
public $date_lim_reglement;
public $doc_type;
public $doc_ref;
public $fk_doc;
@ -255,6 +256,7 @@ class BookKeeping extends CommonObject
$sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " (";
$sql .= "doc_date";
$sql .= ", date_lim_reglement";
$sql .= ", doc_type";
$sql .= ", doc_ref";
$sql .= ", fk_doc";
@ -277,6 +279,7 @@ class BookKeeping extends CommonObject
$sql .= ', entity';
$sql .= ") VALUES (";
$sql .= "'" . $this->db->idate($this->doc_date) . "'";
$sql .= ",'" . $this->db->idate($this->date_lim_reglement) . "'";
$sql .= ",'" . $this->db->escape($this->doc_type) . "'";
$sql .= ",'" . $this->db->escape($this->doc_ref) . "'";
$sql .= "," . $this->fk_doc;
@ -444,6 +447,7 @@ class BookKeeping extends CommonObject
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.'(';
$sql .= 'doc_date,';
$sql .= 'date_lim_reglement,';
$sql .= 'doc_type,';
$sql .= 'doc_ref,';
$sql .= 'fk_doc,';
@ -466,6 +470,7 @@ class BookKeeping extends CommonObject
$sql .= 'entity';
$sql .= ') VALUES (';
$sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->doc_date) . "'") . ',';
$sql .= ' ' . (! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_type) ? 'NULL' : "'" . $this->db->escape($this->doc_type) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_ref) ? 'NULL' : "'" . $this->db->escape($this->doc_ref) . "'") . ',';
$sql .= ' ' . (empty($this->fk_doc) ? '0' : $this->fk_doc) . ',';
@ -540,6 +545,7 @@ class BookKeeping extends CommonObject
$sql = 'SELECT';
$sql .= ' t.rowid,';
$sql .= " t.doc_date,";
$sql .= " t.date_lim_reglement,";
$sql .= " t.doc_type,";
$sql .= " t.doc_ref,";
$sql .= " t.fk_doc,";
@ -577,6 +583,7 @@ class BookKeeping extends CommonObject
$this->id = $obj->rowid;
$this->doc_date = $this->db->jdate($obj->doc_date);
$this->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
$this->doc_type = $obj->doc_type;
$this->doc_ref = $obj->doc_ref;
$this->fk_doc = $obj->fk_doc;
@ -1260,7 +1267,7 @@ class BookKeeping extends CommonObject
global $user;
$error = 0;
$object = new Accountingbookkeeping($this->db);
$object = new BookKeeping($this->db);
$this->db->begin();

View File

@ -401,7 +401,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->numero_compte = $k;
$bookkeeping->label_operation = $val["label"];
$bookkeeping->label_compte = $langs->trans("Bank");
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
@ -462,7 +462,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_bank"];
$bookkeeping->label_operation = $tabcompany[$key]['name'];
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;

View File

@ -203,7 +203,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->label_operation = $tabuser[$key]['name'];
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;

View File

@ -85,7 +85,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
$idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier,";
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, ";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
$sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
@ -155,6 +155,7 @@ if ($result) {
}
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier . ' (' . $obj->ref . ')';
$tabfac[$obj->rowid]["refsologest"] = $obj->ref;
$tabfac[$obj->rowid]["refsuppliersologest"] = $obj->ref_supplier;
@ -222,6 +223,7 @@ if ($action == 'writebookkeeping') {
if ($mt) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'supplier_invoice';
@ -269,6 +271,7 @@ if ($action == 'writebookkeeping') {
if ($accountingaccount->fetch(null, $k, true)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'supplier_invoice';
@ -322,6 +325,7 @@ if ($action == 'writebookkeeping') {
if ($mt) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'supplier_invoice';

View File

@ -89,7 +89,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
$idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client,";
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
$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";
@ -178,6 +178,7 @@ if ($result) {
// Invoice lines
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
$tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
@ -240,6 +241,7 @@ if ($action == 'writebookkeeping') {
if ($mt) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'customer_invoice';
@ -287,6 +289,7 @@ if ($action == 'writebookkeeping') {
if ($accountingaccount->fetch(null, $k, true)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'customer_invoice';
@ -340,6 +343,7 @@ if ($action == 'writebookkeeping') {
if ($mt) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->date_lim_reglement = $val["datereg"];
$bookkeeping->doc_ref = $val["ref"];
$bookkeeping->date_create = $now;
$bookkeeping->doc_type = 'customer_invoice';

View File

@ -249,7 +249,7 @@ $tabfield[6] = "code,libelle,type,color,position";
$tabfield[7] = "code,libelle,country,accountancy_code,deductible";
$tabfield[8] = "code,libelle,country_id,country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':'');
$tabfield[9] = "code,label,unicode";
$tabfield[10]= "country_id,country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[10]= "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle,position";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder";
$tabfield[13]= "code,libelle,type,accountancy_code";
@ -286,7 +286,7 @@ $tabfieldvalue[6] = "code,libelle,type,color,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
$tabfieldvalue[8] = "code,libelle,country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':'');
$tabfieldvalue[9] = "code,label,unicode";
$tabfieldvalue[10]= "country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[10]= "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11]= "element,source,code,libelle,position";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder";
$tabfieldvalue[13]= "code,libelle,type,accountancy_code";
@ -323,7 +323,7 @@ $tabfieldinsert[6] = "code,libelle,type,color,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
$tabfieldinsert[8] = "code,libelle,fk_country".(! empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?',position':'');
$tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[10]= "fk_pays,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[10]= "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[11]= "element,source,code,libelle,position";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder";
$tabfieldinsert[13]= "code,libelle,type,accountancy_code";

View File

@ -100,7 +100,7 @@ elseif ($action == 'update_currency')
if ($submit == $langs->trans('Modify'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$rate = GETPOST('rate', 'float');
$rate = price2num(GETPOST('rate', 'alpha'));
$currency = new MultiCurrency($db);
if ($currency->fetch($fk_multicurrency) > 0)

View File

@ -114,7 +114,7 @@ $tabfieldcheck[1] = array();
$elementList = array();
$sourceList=array();
// Actions add or modify an entry into a dictionary
// Actions add or modify a website
if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
{
$listfield=explode(',',$tabfield[$id]);
@ -133,7 +133,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
$fieldnamekey=$listfield[$f];
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
if ($value == 'ref' && (preg_match('/[a-zA-Z0-9]/', $_POST[$value])))
if ($value == 'ref' && ! preg_match('/^[a-z0-9]+$/i', $_POST[$value]))
{
$ok=0;
$fieldnamekey=$listfield[$f];
@ -141,6 +141,12 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
}
}
// Clean parameters
if (! empty($_POST['ref']))
{
$websitekey=strtolower($_POST['ref']);
}
// Si verif ok et action add, on ajoute la ligne
if ($ok && GETPOST('actionadd','alpha'))
{
@ -160,6 +166,12 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
}
}
/* $website=new Website($db);
$website->ref=
$website->description=
$website->virtualhost=
$website->create($user); */
// Add new entry
$sql = "INSERT INTO ".$tabname[$id]." (";
// List of fields
@ -178,6 +190,9 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
if ($value == 'entity') {
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($value == 'ref') {
$_POST[$listfieldvalue[$i]] = strtolower($_POST[$listfieldvalue[$i]]);
}
if ($i) $sql.=",";
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null";
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
@ -189,6 +204,29 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
$result = $db->query($sql);
if ($result) // Add is ok
{
global $dolibarr_main_data_root;
$pathofwebsite=$dolibarr_main_data_root.'/websites/'.$websitekey;
$filehtmlheader=$pathofwebsite.'/htmlheader.html';
$filecss=$pathofwebsite.'/styles.css.php';
$filetpl=$pathofwebsite.'/page'.$pageid.'.tpl.php';
$fileindex=$pathofwebsite.'/index.php';
// Css file
$csscontent = '<!-- BEGIN DOLIBARR-WEBSITE-ADDED-HEADER -->'."\n";
$csscontent.= '<!-- File generated to wrap the css file - YOU CAN MODIFY DIRECTLY THE FILE styles.css.php. Change affects all pages of website. -->'."\n";
$csscontent.= '<?php '."\n";
$csscontent.= "header('Content-type: text/css');\n";
$csscontent.= "?>"."\n";
$csscontent.= '<!-- END -->'."\n";
$csscontent.= 'body { margin: 0; }'."\n";
dol_syslog("Save file css into ".$filecss);
dol_mkdir($pathofwebsite);
$result = file_put_contents($filecss, $csscontent);
if (! empty($conf->global->MAIN_UMASK))
@chmod($filecss, octdec($conf->global->MAIN_UMASK));
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
unset($_POST); // Clean $_POST array, we keep only
}
@ -400,7 +438,11 @@ if ($id)
{
print '<td class="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
elseif (! empty($tabhelp[$id][$value]))
{
if ($value == 'virtualhost') print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltipvirtual');
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
}
else print $valuetoshow;
print '</td>';
}

View File

@ -42,24 +42,24 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
*/
class Categorie extends CommonObject
{
// Categories types
const TYPE_PRODUCT = 0; // TODO Replace with value 'product'
const TYPE_SUPPLIER = 1; // TODO Replace this value with 'supplier'
const TYPE_CUSTOMER = 2; // TODO Replace this value with 'customer'
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account'
const TYPE_PROJECT = 6; // TODO Replace this value with 'project'
// Categories types (we use string because we want to accept any modules/types in a future)
const TYPE_PRODUCT = 'product';
const TYPE_SUPPLIER = 'supplier';
const TYPE_CUSTOMER = 'customer';
const TYPE_MEMBER = 'member';
const TYPE_CONTACT = 'contact';
const TYPE_USER = 'user';
const TYPE_PROJECT = 'project';
const TYPE_ACCOUNT = 'bank_account';
const TYPE_BANK_LINE = 'bank_line';
public $picto = 'category';
/**
* @var array ID mapping from type string
*
* @note This array should be remove in future, once previous constants are moved to the string value.
* @note This array should be remove in future, once previous constants are moved to the string value. Deprecated
*/
private $MAP_ID = array(
'product' => 0,
@ -67,10 +67,21 @@ class Categorie extends CommonObject
'customer' => 2,
'member' => 3,
'contact' => 4,
'user' => 4,
'account' => 5,
'project' => 6,
'user' => 7,
);
public static $MAP_ID_TO_CODE = array(
0 => 'product',
1 => 'supplier',
2 => 'customer',
3 => 'member',
4 => 'contact',
5 => 'account',
6 => 'project',
7 => 'user',
);
/**
* @var array Foreign keys mapping from type string
*
@ -82,9 +93,9 @@ class Categorie extends CommonObject
'supplier' => 'soc',
'member' => 'member',
'contact' => 'socpeople',
'user' => 'user',
'account' => 'account',
'project' => 'project',
'user' => 'user',
'account' => 'account',
'project' => 'project',
);
/**
* @var array Category tables mapping from type string
@ -97,9 +108,9 @@ class Categorie extends CommonObject
'supplier' => 'fournisseur',
'member' => 'member',
'contact' => 'contact',
'user' => 'user',
'account' => 'account',
'project' => 'project',
'user' => 'user',
'account' => 'account',
'project' => 'project',
);
/**
* @var array Object class mapping from type string
@ -113,8 +124,8 @@ class Categorie extends CommonObject
'member' => 'Adherent',
'contact' => 'Contact',
'user' => 'User',
'account' => 'Account',
'project' => 'Project',
'account' => 'Account',
'project' => 'Project',
);
/**
* @var array Object table mapping from type string
@ -128,8 +139,8 @@ class Categorie extends CommonObject
'member' => 'adherent',
'contact' => 'socpeople',
'user' => 'user',
'account' => 'bank_account',
'project' => 'projet',
'account' => 'bank_account',
'project' => 'projet',
);
public $element='category';
@ -178,15 +189,16 @@ class Categorie extends CommonObject
*
* @param int $id Id of category
* @param string $label Label of category
* @param string $type Type of category
* @param string $type Type of category ('product', '...') or (0, 1, ...)
* @return int <0 if KO, >0 if OK
*/
function fetch($id,$label='',$type='')
function fetch($id, $label='', $type=null)
{
global $conf;
// Check parameters
if (empty($id) && empty($label)) return -1;
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
$sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
@ -197,7 +209,7 @@ class Categorie extends CommonObject
else
{
$sql.= " WHERE label = '".$this->db->escape($label)."' AND entity IN (".getEntity('category').")";
if ($type) $sql.= " AND type = '".$this->db->escape($type)."'";
if (! is_null($type)) $sql.= " AND type = ".$this->db->escape($type);
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -254,6 +266,10 @@ class Categorie extends CommonObject
global $conf,$langs,$hookmanager;
$langs->load('categories');
$type=$this->type;
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
$error=0;
dol_syslog(get_class($this).'::create', LOG_DEBUG);
@ -299,7 +315,7 @@ class Categorie extends CommonObject
$sql.= ($this->socid != -1 ? $this->socid : 'null').",";
}
$sql.= "'".$this->visible."',";
$sql.= $this->type.",";
$sql.= $type.",";
$sql.= (! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":'null').",";
$sql.= $conf->entity;
$sql.= ")";
@ -618,12 +634,11 @@ class Categorie extends CommonObject
/**
* Link an object to the category
*
* @param CommonObject $obj Object to link to category
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
*
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
* @param CommonObject $obj Object to link to category
* @param string $type Type of category ('product', ...)
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/
function add_type($obj,$type)
function add_type($obj, $type)
{
global $user,$langs,$conf;
@ -840,13 +855,12 @@ class Categorie extends CommonObject
/**
* Check for the presence of an object in a category
*
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
* @param int $object_id id of the object to search
*
* @return int number of occurrences
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
* @param int $object_id Id of the object to search
* @return int Number of occurrences
* @see getObjectsInCateg
*/
function containsObject($type, $object_id )
function containsObject($type, $object_id)
{
$sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type];
$sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $this->MAP_CAT_FK[$type] . " = " . $object_id;
@ -933,24 +947,16 @@ class Categorie extends CommonObject
* fulllabel = nom avec chemin complet de la categorie
* fullpath = chemin complet compose des id
*
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member').
* Old mode (0, 1, 2, ...) is deprecated.
* @param int $markafterid Removed all categories including the leaf $markafterid in category tree.
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
* @param int $markafterid Removed all categories including the leaf $markafterid in category tree.
*
* @return array Array of categories. this->cats and this->motherof are set.
* @return array Array of categories. this->cats and this->motherof are set.
*/
function get_full_arbo($type, $markafterid=0)
{
global $conf, $langs;
// For backward compatibility
if (is_numeric($type))
{
// We want to reverse lookup
$map_type = array_flip($this->MAP_ID);
$type = $map_type[$type];
dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead", LOG_WARNING);
}
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
$this->cats = array();
@ -964,7 +970,7 @@ class Categorie extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql .= " WHERE c.entity IN (" . getEntity( 'category', 1 ) . ")";
$sql .= " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.type = " . $type;
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1088,7 +1094,7 @@ class Categorie extends CommonObject
/**
* Returns all categories
*
* @param int $type Type of category
* @param int $type Type of category (0, 1, ...)
* @param boolean $parent Just parent categories if true
* @return array Table of Object Category
*/
@ -1151,13 +1157,17 @@ class Categorie extends CommonObject
*/
function already_exists()
{
$type=$this->type;
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
/* We have to select any rowid from llx_categorie which category's mother and label
* are equals to those of the calling category
*/
$sql = "SELECT c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c ";
$sql.= " WHERE c.entity IN (".getEntity('category').")";
$sql.= " AND c.type = ".$this->type;
$sql.= " AND c.type = ".$type;
$sql.= " AND c.fk_parent = ".$this->fk_parent;
$sql.= " AND c.label = '".$this->db->escape($this->label)."'";
@ -1192,7 +1202,7 @@ class Categorie extends CommonObject
/**
* Returns the top level categories (which are not girls)
*
* @param int $type Type of category
* @param int $type Type of category (0, 1, ...)
* @return array
*/
function get_main_categories($type=null)
@ -1330,24 +1340,17 @@ class Categorie extends CommonObject
* Return list of categories (object instances or labels) linked to element of id $id and type $type
* Should be named getListOfCategForObject
*
* @param int $id Id of element
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
* @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category
* labels, 'id'= Get array of category IDs
* @return mixed Array of category objects or < 0 if KO
* @param int $id Id of element
* @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...)
* @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category
* labels, 'id'= Get array of category IDs
* @return mixed Array of category objects or < 0 if KO
*/
function containing($id, $type, $mode='object')
{
$cats = array();
// For backward compatibility
if (is_numeric($type))
{
dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING);
// We want to reverse lookup
$map_type = array_flip($this->MAP_ID);
$type = $map_type[$type];
}
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type];
if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code
{

View File

@ -39,6 +39,8 @@ $id=GETPOST('id','int');
$type=(GETPOST('type','aZ09') ? GETPOST('type','aZ09') : Categorie::TYPE_PRODUCT);
$catname=GETPOST('catname','alpha');
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
/*
* View
@ -53,8 +55,8 @@ elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCat
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='account'; }
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');

View File

@ -42,6 +42,8 @@ $type=GETPOST('type');
$action=GETPOST('action','aZ09');
$confirm=GETPOST('confirm');
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
if ($id == "")
{
dol_print_error('','Missing parameter id');
@ -100,15 +102,16 @@ if ($object->id)
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
else $title=$langs->trans("Category");
elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("UsersCategoriesShort");
else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'photos', $title, -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->ref = $object->label;
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
$ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
@ -117,9 +120,9 @@ if ($object->id)
$morehtmlref.=$way."<br>\n";
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
/*
* Confirmation de la suppression de photo
*/
@ -129,7 +132,7 @@ if ($object->id)
}
print '<br>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
@ -148,7 +151,7 @@ if ($object->id)
print "</table>\n";
print '</div>';
print dol_fiche_end();
@ -258,7 +261,7 @@ if ($object->id)
}
print '</table>';
if ($nbphoto < 1)
{
print '<div class="opacitymedium">'.$langs->trans("NoPhotoYet")."</div>";

View File

@ -35,11 +35,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load("categories");
$langs->load("languages");
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action=GETPOST('action','alpha');
$cancel=GETPOST('cancel','alpha');
$type=GETPOST('type');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');
$type = GETPOST('type','aZ09');
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
@ -153,6 +155,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategor
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("UsersCategoriesShort");
else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
@ -256,9 +259,9 @@ if ($action == 'edit')
print '</table>';
}
}
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@ -271,7 +274,7 @@ if ($action == 'edit')
else if ($action != 'add')
{
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
if (! empty($object->multilangs))
{
foreach ($object->multilangs as $key => $value)

View File

@ -34,13 +34,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load("categories");
$id=GETPOST('id','int');
$label=GETPOST('label');
$type=GETPOST('type');
$id = GETPOST('id','int');
$label= GETPOST('label','alpha');
$type = GETPOST('type','az09');
$action=GETPOST('action','aZ09');
$confirm=GETPOST('confirm');
$confirm = GETPOST('confirm','alpha');
$removeelem = GETPOST('removeelem','int');
$elemid=GETPOST('elemid');
$elemid = GETPOST('elemid','alpha');
if ($id == "" && $label == "")
{
@ -61,6 +61,7 @@ if ($result <= 0)
}
$type=$object->type;
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@ -187,6 +188,7 @@ elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategor
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort");
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort");
elseif ($type == Categorie::TYPE_USER) $title=$langs->trans("ProjectsCategoriesShort");
else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);

View File

@ -603,11 +603,17 @@ if ($id > 0)
if ($link) $boxstat.='</a>';
}
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreBoxStatsCustomer', $parameters, $object, $action);
if(empty($reshook)){
$boxstat.= $hookmanager->resPrint;
}
$boxstat.='</td></tr>';
$boxstat.='</table>';
$boxstat.='</div>';
print $boxstat;
print $boxstat;
$now=dol_now();

View File

@ -1750,6 +1750,7 @@ if ($action == 'create')
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherProposals").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{

View File

@ -355,6 +355,7 @@ if ($resql)
$soc = new Societe($db);
$soc->fetch($socid);
$title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
if (empty($search_societe)) $search_societe = $soc->name;
}
else
{

View File

@ -1924,6 +1924,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherOrders").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{

View File

@ -578,6 +578,7 @@ if ($resql)
$soc = new Societe($db);
$soc->fetch($socid);
$title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
if (empty($search_company)) $search_company = $soc->name;
}
else
{

View File

@ -72,7 +72,7 @@ class BankAccounts extends DolibarrApi
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
$sql.= ' WHERE t.entity IN ('.getEntity('bank_account').')';
// Add sql filters
if ($sqlfilters)
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
@ -81,7 +81,7 @@ class BankAccounts extends DolibarrApi
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0)
@ -89,10 +89,10 @@ class BankAccounts extends DolibarrApi
$page = 0;
}
$offset = $limit * $page;
$sql.= $this->db->plimit($limit + 1, $offset);
}
dol_syslog("API Rest request");
$result = $this->db->query($sql);
@ -236,7 +236,7 @@ class BankAccounts extends DolibarrApi
function _validate($data)
{
$account = array();
foreach (Accounts::$FIELDS as $field) {
foreach (BankAccounts::$FIELDS as $field) {
if (! isset($data[$field]))
throw new RestException(400, "$field field missing");
$account[$field] = $data[$field];

View File

@ -400,6 +400,22 @@ if (empty($reshook))
setEventMessages($discount->error, $discount->errors, 'errors');
}
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setref_client' && $user->rights->facture->creer)
@ -1105,8 +1121,17 @@ if (empty($reshook))
foreach ($amountdeposit as $tva => $amount)
{
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
$descline = $langs->trans('Deposit');
$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
if ($typeamount=='amount') {
$descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')';
} elseif ($typeamount=='variable') {
$descline.= ' ('. $valuedeposit.'%)';
}
$descline.= ' - '.$srcobject->ref;
$result = $object->addline(
$langs->trans('Deposit'),
$descline,
$amount, // subprice
1, // quantity
$tva, // vat rate
@ -1128,8 +1153,8 @@ if (empty($reshook))
0,
0,
0,
0,
$langs->trans('Deposit')
0
//,$langs->trans('Deposit') //Deprecated
);
}
@ -1440,7 +1465,7 @@ if (empty($reshook))
{
if (GETPOST('type') < 0 && ! GETPOST('search_idprod'))
{
setEventMessages($langs->trans('ErrorChooseBetweenFreeAntryOrPredefinedProduct'), null, 'errors');
setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors');
$error ++;
}
}
@ -3075,6 +3100,7 @@ else if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{

View File

@ -1311,7 +1311,7 @@ else
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('RIB');
print '<td>';
if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon))
if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon))
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';

View File

@ -531,6 +531,7 @@ if ($resql)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_societe)) $search_societe = $soc->name;
}
$param='&socid='.$socid;

View File

@ -337,6 +337,24 @@ class Paiement extends CommonObject
$error++;
}
}
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$ret = $invoice->fetch($id); // Reload to get new records
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
if ($result < 0) {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
}
}
}

View File

@ -117,7 +117,7 @@ $textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previo
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
print $conf->dol_optimize_smallscreen;
print load_fiche_titre($langs->trans("VAT"), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
@ -263,18 +263,18 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
print "<tr>";
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($total, 1)) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($total, 'MT')) . '</td>';
print "</tr>\n";
print "<tr>";
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 1)) . "</td>\n";
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 'MT')) . "</td>\n";
print "</tr>\n";
$restopay = $total - $obj->mm;
print "<tr>";
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($restopay, 1)) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($restopay, 'MT')) . '</td>';
print "</tr>\n";
print '</table>';

View File

@ -1278,6 +1278,15 @@ class Contrat extends CommonObject
//// End call triggers
}
}
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
// Commit or rollback
if ($error)
@ -1633,8 +1642,8 @@ class Contrat extends CommonObject
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
{
$contractline = new ContratLigne($this->db);
$contractline->array_options=$array_option;
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element);
$contractline->array_options=$array_options;
$contractline->id= $rowid;
$result=$contractline->insertExtraFields();
if ($result < 0)
{

View File

@ -306,6 +306,13 @@ if ($resql)
$arrayofselected=is_array($toselect)?$toselect:array();
if ($socid > 0)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_name)) $search_name = $soc->name;
}
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;

View File

@ -332,7 +332,7 @@ if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights-
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
@ -523,7 +523,6 @@ while ($i < min($num,$limit))
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
print '<tr class="oddeven">';
// Ref

View File

@ -28,9 +28,9 @@
// $cancel must be defined
// $id or $ref must be defined (object is loaded in this file with fetch)
if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask')))) && empty($cancel))
if (($id > 0 || (! empty($ref) && ! in_array($action, array('create', 'createtask', 'add')))) && empty($cancel))
{
$ret = $object->fetch($id,$ref);
$ret = $object->fetch($id, $ref);
if ($ret > 0)
{
$object->fetch_thirdparty();
@ -38,7 +38,8 @@ if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
if (empty($object->error) && ! count($object->errors)) setEventMessages('Fetch on object return an error without filling $object->error nor $object->errors', null, 'errors');
else setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}

View File

@ -594,7 +594,7 @@ if (! $error && $massaction == 'delete' && $permtodelete)
$nbok = 0;
foreach($toselect as $toselectid)
{
$result=$objecttmp->fetch($toselectid);
$result=$objecttmp->fetch($toselectid);
if ($result > 0)
{
if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);

View File

@ -391,6 +391,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$object->trackid = $trackid;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
if (is_array($attachedfiles) && count($attachedfiles)>0) {
$object->attachedfiles = $attachedfiles;
}
// Call of triggers
if (! empty($trigger_name))

View File

@ -31,8 +31,17 @@ if (! isset($usedbyinclude) || empty($usedbyinclude))
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREDIRECTBYMAINTOLOGIN')) define('NOREDIRECTBYMAINTOLOGIN','1');
$res=@include '../../main.inc.php';
if ($res == 'ERROR_NOT_LOGGED')
{
$langs->load("other");
$arrayresult['jumptologin']=array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>'<span class="fa fa-sign-in"></span> '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php');
print json_encode($arrayresult);
if (is_object($db)) $db->close();
exit;
}
}
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';

View File

@ -334,23 +334,23 @@ abstract class CommonObject
// No constructor as it is an abstract class
/**
* Check an object id/ref exists
* If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
*
/**
* Check an object id/ref exists
* If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
*
* @param string $element String of element ('product', 'facture', ...)
* @param int $id Id of object
* @param string $ref Ref of object to check
* @param string $ref_ext Ref ext of object to check
* @return int <0 if KO, 0 if OK but not found, >0 if OK and exists
*/
static function isExistingObject($element, $id, $ref='', $ref_ext='')
{
global $db,$conf;
*/
static function isExistingObject($element, $id, $ref='', $ref_ext='')
{
global $db,$conf;
$sql = "SELECT rowid, ref, ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
$sql.= " WHERE entity IN (".getEntity($element, true).")" ;
$sql.= " WHERE entity IN (".getEntity($element).")" ;
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
@ -371,17 +371,17 @@ abstract class CommonObject
else return 0;
}
return -1;
}
}
/**
* Method to output saved errors
*
* @return string String with errors
*/
function errorsToString()
{
return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
}
/**
* Method to output saved errors
*
* @return string String with errors
*/
function errorsToString()
{
return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
}
/**
* Return full name (civility+' '+name+' '+lastname)
@ -1309,7 +1309,7 @@ abstract class CommonObject
* Load properties id_previous and id_next
*
* @param string $filter Optional filter. Example: " AND (t.field1 = 'aa' OR t.field2 = 'bb')"
* @param int $fieldid Name of field to use for the select MAX and MIN
* @param string $fieldid Name of field to use for the select MAX and MIN
* @param int $nodbprefix Do not include DB prefix to forge table name
* @return int <0 if KO, >0 if OK
*/
@ -1322,6 +1322,7 @@ abstract class CommonObject
dol_print_error('',get_class($this)."::load_previous_next_ref was called on objet with property table_element not defined");
return -1;
}
if ($fieldid == 'none') return 1;
// this->ismultientitymanaged contains
// 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
@ -3947,7 +3948,7 @@ abstract class CommonObject
// Now we add first model found in directories scanned
$listofdir=explode(',',$dirtoscan);
foreach($listofdir as $key=>$tmpdir)
foreach($listofdir as $key => $tmpdir)
{
$tmpdir=trim($tmpdir);
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
@ -4736,19 +4737,6 @@ abstract class CommonObject
/**
* Function test if type is date
*
* @param array $info content informations of field
* @return bool
*/
protected function isDate($info)
{
if(isset($info['type']) && ($info['type']=='date' || $info['type']=='datetime' || $info['type']=='timestamp')) return true;
else return false;
}
/**
* Function test if type is array
*
@ -4781,13 +4769,26 @@ abstract class CommonObject
else return false;
}
/**
* Function test if type is date
*
* @param array $info content informations of field
* @return bool
*/
public function isDate($info)
{
if(isset($info['type']) && ($info['type']=='date' || $info['type']=='datetime' || $info['type']=='timestamp')) return true;
else return false;
}
/**
* Function test if type is integer
*
* @param array $info content informations of field
* @return bool
*/
protected function isInt($info)
public function isInt($info)
{
if(is_array($info))
{
@ -4803,11 +4804,11 @@ abstract class CommonObject
* @param array $info content informations of field
* @return bool
*/
protected function isFloat($info)
public function isFloat($info)
{
if(is_array($info))
{
if(isset($info['type']) && $info['type']=='float') return true;
if (isset($info['type']) && (preg_match('/^(double|real)/i', $info['type']))) return true;
else return false;
}
else return false;
@ -4819,7 +4820,7 @@ abstract class CommonObject
* @param array $info content informations of field
* @return bool
*/
protected function isText($info)
public function isText($info)
{
if(is_array($info))
{
@ -4846,49 +4847,58 @@ abstract class CommonObject
}
/**
* Function to prepare the values to insert
* Function to prepare the values to insert.
* Note $this->${field} are set by the page that make the createCommon or the updateCommon.
*
* @return array
*/
private function set_save_query()
{
$query=array();
foreach ($this->fields as $field=>$info)
global $conf;
$queryarray=array();
foreach ($this->fields as $field=>$info) // Loop on definition of fields
{
// Depending on field type ('datetime', ...)
if($this->isDate($info))
{
if(empty($this->{$field}))
{
$query[$field] = NULL;
$queryarray[$field] = NULL;
}
else
{
$query[$field] = $this->db->idate($this->{$field});
$queryarray[$field] = $this->db->idate($this->{$field});
}
}
else if($this->isArray($info))
{
$query[$field] = serialize($this->{$field});
$queryarray[$field] = serialize($this->{$field});
}
else if($this->isInt($info))
{
$query[$field] = (int) price2num($this->{$field});
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity;
else
{
$queryarray[$field] = (int) price2num($this->{$field});
if (empty($queryarray[$field])) $queryarray[$field]=0; // May be rest to null later if property 'nullifempty' is on for this field.
}
}
else if($this->isFloat($info))
{
$query[$field] = (double) price2num($this->{$field});
}
elseif($this->isNull($info))
{
$query[$field] = (is_null($this->{$field}) || (empty($this->{$field}) && $this->{$field}!==0 && $this->{$field}!=='0') ? null : $this->{$field});
$queryarray[$field] = (double) price2num($this->{$field});
if (empty($queryarray[$field])) $queryarray[$field]=0;
}
else
{
$query[$field] = $this->{$field};
$queryarray[$field] = $this->{$field};
}
if ($info['type'] == 'timestamp' && empty($queryarray[$field])) unset($queryarray[$field]);
if (! empty($info['nullifempty']) && empty($queryarray[$field])) $queryarray[$field] = null;
}
return $query;
return $queryarray;
}
/**
@ -4896,7 +4906,7 @@ abstract class CommonObject
*
* @param stdClass $obj Contain data of object from database
*/
private function set_vars_by_db(&$obj)
private function setVarsFromFetchObj(&$obj)
{
foreach ($this->fields as $field => $info)
{
@ -4913,7 +4923,8 @@ abstract class CommonObject
}
elseif($this->isInt($info))
{
$this->{$field} = (int) $obj->{$field};
if ($field == 'rowid') $this->id = (int) $obj->{$field};
else $this->{$field} = (int) $obj->{$field};
}
elseif($this->isFloat($info))
{
@ -4947,15 +4958,14 @@ abstract class CommonObject
/**
* Add quote to field value if necessary
*
* @param string|int $value value to protect
* @return string|int
* @param string|int $value Value to protect
* @param array $fieldsentry Properties of field
* @return string
*/
protected function quote($value) {
if(is_null($value)) return 'NULL';
else if(is_numeric($value)) return $value;
else return "'".$this->db->escape( $value )."'";
protected function quote($value, $fieldsentry) {
if (is_null($value)) return 'NULL';
else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
else return "'".$this->db->escape($value)."'";
}
@ -4970,23 +4980,29 @@ abstract class CommonObject
{
$error = 0;
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
$now=dol_now();
$fieldvalues = $this->set_save_query();
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation']=$this->db->idate($now);
if (array_key_exists('fk_user_creat', $fieldvalues) && ! ($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat']=$user->id;
unset($fieldvalues['rowid']); // We suppose the field rowid is reserved field for autoincrement field.
$keys=array();
$values = array();
foreach ($fields as $k => $v) {
foreach ($fieldvalues as $k => $v) {
$keys[] = $k;
$values[] = $this->quote($v);
$values[] = $this->quote($v, $this->fields[$k]);
}
$this->db->begin();
if (! $error)
{
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.'
( '.implode( ",", $keys ).' )
VALUES ( '.implode( ",", $values ).' ) ';
$res = $this->db->query( $sql );
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
$sql.= ' ('.implode( ", ", $keys ).')';
$sql.= ' VALUES ('.implode( ", ", $values ).')';
$res = $this->db->query( $sql );
if ($res===false) {
$error++;
$this->errors[] = $this->db->lasterror();
@ -4998,7 +5014,7 @@ abstract class CommonObject
if (!$notrigger) {
// Call triggers
$result=$this->call_trigger(strtoupper(get_class(self)).'_CREATE',$user);
$result=$this->call_trigger(strtoupper(get_class($this)).'_CREATE',$user);
if ($result < 0) { $error++; }
// End call triggers
}
@ -5023,7 +5039,7 @@ abstract class CommonObject
*/
public function createFromCloneCommon(User $user, $fromid)
{
global $user;
global $user, $langs;
$error = 0;
@ -5035,10 +5051,14 @@ abstract class CommonObject
// Load source object
$object->fetchCommon($fromid);
// Reset object
$object->id = 0;
// Reset some properties
unset($object->id);
unset($object->fk_user_creat);
unset($object->import_key);
// Clear fields
$object->ref = "copy_of_".$object->ref;
$object->title = $langs->trans("CopyOf")." ".$object->title;
// ...
// Create clone
@ -5046,7 +5066,8 @@ abstract class CommonObject
// Other options
if ($result < 0) {
$error ++;
$error++;
$this->error = $object->error;
$this->errors = $object->errors;
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
}
@ -5072,11 +5093,11 @@ abstract class CommonObject
{
if (empty($id) && empty($ref)) return false;
$sql = 'SELECT '.$this->get_field_list().', datec, tms';
$sql = 'SELECT '.$this->get_field_list();
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
if(!empty($id)) $sql.= ' WHERE rowid = '.$id;
else $sql.= ' WHERE ref = \''.$this->quote($ref).'\'';
else $sql.= " WHERE ref = ".$this->quote($ref, $this->fields['ref']);
$res = $this->db->query($sql);
if ($res)
@ -5085,12 +5106,7 @@ abstract class CommonObject
{
if ($obj)
{
$this->id = $id;
$this->set_vars_by_db($obj);
$this->datec = $this->db->idate($obj->datec);
$this->tms = $this->db->idate($obj->tms);
$this->setVarsFromFetchObj($obj);
return $this->id;
}
else
@ -5124,27 +5140,27 @@ abstract class CommonObject
{
$error = 0;
$fields = $this->set_save_query();
$fieldvalues = $this->set_save_query();
unset($fieldvalues['rowid']); // We don't update this field, it is the key to define which record to update.
foreach ($fields as $k => $v) {
foreach ($fieldvalues as $k => $v) {
if (is_array($key)){
$i=array_search($k, $key);
if ( $i !== false) {
$where[] = $key[$i].'=' . $this->quote( $v ) ;
$where[] = $key[$i].'=' . $this->quote($v, $this->fields[$k]);
continue;
}
} else {
if ( $k == $key) {
$where[] = $k.'=' .$this->quote( $v ) ;
$where[] = $k.'=' .$this->quote($v, $this->fields[$k]);
continue;
}
}
$tmp[] = $k.'='.$this->quote($v);
$tmp[] = $k.'='.$this->quote($v, $this->fields[$k]);
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ;
$this->db->begin();
if (! $error)
{
$res = $this->db->query($sql);
@ -5157,7 +5173,7 @@ abstract class CommonObject
if (! $error && ! $notrigger) {
// Call triggers
$result=$this->call_trigger(strtoupper(get_class(self)).'_MODIFY',$user);
$result=$this->call_trigger(strtoupper(get_class($this)).'_MODIFY',$user);
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
// End call triggers
}
@ -5188,7 +5204,7 @@ abstract class CommonObject
if (! $error) {
if (! $notrigger) {
// Call triggers
$result=$this->call_trigger(strtoupper(get_class(self)).'_DELETE', $user);
$result=$this->call_trigger(strtoupper(get_class($this)).'_DELETE', $user);
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
// End call triggers
}

View File

@ -82,7 +82,7 @@ class DolEditor
// Check if extended editor is ok. If not we force textarea
if ((empty($conf->fckeditor->enabled) && $okforextendededitor != 'ace') || empty($okforextendededitor)) $this->tool = 'textarea';
if ($okforextendededitor === 'ace') $this->tool='ace';
if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // TODO ckeditor ko with mobile ? ace ko with mobile ?
//if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // ckeditor and ace seems ok with mobile
// Define content and some properties
if ($this->tool == 'ckeditor')

View File

@ -281,7 +281,7 @@ class ExtraFields
*/
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='')
{
global $conf;
global $conf,$user;
if ($elementtype == 'thirdparty') $elementtype='societe';
if ($elementtype == 'contact') $elementtype='socpeople';
@ -305,7 +305,27 @@ class ExtraFields
$params='';
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable, perms, list, ishidden, fielddefault, fieldcomputed)";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(";
$sql.= " name,";
$sql.= " label,";
$sql.= " type,";
$sql.= " pos,";
$sql.= " size,";
$sql.= " entity,";
$sql.= " elementtype,";
$sql.= " fieldunique,";
$sql.= " fieldrequired,";
$sql.= " param,";
$sql.= " alwayseditable,";
$sql.= " perms,";
$sql.= " list,";
$sql.= " ishidden,";
$sql.= " fielddefault,";
$sql.= " fieldcomputed,";
$sql.= " fk_user_author,";
$sql.= " fk_user_modif,";
$sql.= " datec";
$sql.= " )";
$sql.= " VALUES('".$attrname."',";
$sql.= " '".$this->db->escape($label)."',";
$sql.= " '".$type."',";
@ -321,9 +341,12 @@ class ExtraFields
$sql.= " ".$list.",";
$sql.= " ".$ishidden.",";
$sql.= " ".($default?"'".$this->db->escape($default)."'":"null").",";
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null");
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
$sql .= " " . $user->id . ",";
$sql .= " " . $user->id . ",";
$sql .= "'" . $this->db->idate(dol_now()) . "'";
$sql.=')';
dol_syslog(get_class($this)."::create_label", LOG_DEBUG);
if ($this->db->query($sql))
{
@ -562,7 +585,7 @@ class ExtraFields
*/
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='')
{
global $conf;
global $conf, $user;
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed);
// Clean parameters
@ -603,7 +626,10 @@ class ExtraFields
$sql.= " list,";
$sql.= " ishidden,";
$sql.= " fielddefault,";
$sql.= " fieldcomputed";
$sql.= " fieldcomputed,";
$sql.= " fk_user_author,";
$sql.= " fk_user_modif,";
$sql.= " datec";
$sql.= ") VALUES (";
$sql.= "'".$attrname."',";
$sql.= " ".$conf->entity.",";
@ -620,7 +646,10 @@ class ExtraFields
$sql.= " ".$list.", ";
$sql.= " ".$ishidden.", ";
$sql.= " ".($default?"'".$this->db->escape($default)."'":"null").",";
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null");
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
$sql .= " " . $user->id . ",";
$sql .= " " . $user->id . ",";
$sql .= "'" . $this->db->idate(dol_now()) . "'";
$sql.= ")";
$resql2=$this->db->query($sql);

View File

@ -4417,7 +4417,7 @@ class Form
dol_syslog(__METHOD__, LOG_DEBUG);
$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.recuperableonly";
$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active > 0";
@ -4436,8 +4436,20 @@ class Form
$this->cache_vatrates[$i]['rowid'] = $obj->rowid;
$this->cache_vatrates[$i]['code'] = $obj->code;
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
$this->cache_vatrates[$i]['localtax1'] = $obj->localtax1;
$this->cache_vatrates[$i]['localtax1_type'] = $obj->localtax1_type;
$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;
$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1?$obj->localtax1:'0').'/'.($obj->localtax2?$obj->localtax2:'0').($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
$positiverates='';
if ($obj->taux) $positiverates.=($positiverates?'/':'').$obj->taux;
if ($obj->localtax1) $positiverates.=($positiverates?'/':'').$obj->localtax1;
if ($obj->localtax2) $positiverates.=($positiverates?'/':'').$obj->localtax2;
if (empty($positiverates)) $positiverates='0';
$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
}
return $num;
@ -4611,7 +4623,16 @@ class Form
$selectedfound=true;
}
}
$return.= '>'.vatrate($rate['libtva']);
$return.= '>';
//if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES))
if ($mysoc->country_code == 'IN' || ! empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES))
{
$return.= $rate['labelpositiverates'];
}
else
{
$return.= vatrate($rate['label']);
}
//$return.=($rate['code']?' '.$rate['code']:'');
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
@ -5604,6 +5625,14 @@ class Form
{
$listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;
if (($object->fk_project > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO))
{
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$tmpproject=new Project($this->db);
$tmpproject->fetch($object->fk_project);
if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) $listofidcompanytoscan.=','.$tmpproject->socid;
unset($tmpproject);
}
$possiblelinks=array(
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal').')'),
@ -5835,7 +5864,7 @@ class Form
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link.
* @param string $morehtml More html content to output just before the nav bar.
* @param int $shownav Show Condition (navigation is shown if value is 1).
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field).
* @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field). Use 'none' to disable next/prev.
* @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref.
* @param string $morehtmlref More html to show after ref.
* @param string $moreparam More param to add in nav link url. Must start with '&...'.

File diff suppressed because it is too large Load Diff

View File

@ -271,7 +271,7 @@ class SMTPs
{
$this->_moreinheader = $_val;
}
/**
* get trackid
*
@ -291,7 +291,7 @@ class SMTPs
{
return $this->_moreinheader;
}
/**
* Set errors to
*
@ -411,7 +411,7 @@ class SMTPs
function _server_authenticate()
{
global $conf;
// Send the RFC2554 specified EHLO.
// This improvment as provided by 'SirSir' to
// accomodate both SMTP AND ESMTP capable servers
@ -462,7 +462,7 @@ class SMTPs
{
$this->_setErr(126, '"' . $host . '" does not support authenticated connections.');
return $_retVal;
}
}
}
// Send Authentication to Server
// Check for errors along the way
@ -903,7 +903,7 @@ class SMTPs
if ( $_strReplyTo )
$this->_msgReplyTo = $this->_strip_email($_strReplyTo);
}
/**
* Retrieves the Address from which mail will be the reply-to
*
@ -913,15 +913,15 @@ class SMTPs
function getReplyTo($_part = true)
{
$_retValue = '';
if ( $_part === true )
$_retValue = $this->_msgReplyTo;
else
$_retValue = $this->_msgReplyTo[$_part];
return $_retValue;
}
/**
* Inserts given addresses into structured format.
* This method takes a list of given addresses, via an array
@ -1217,6 +1217,8 @@ class SMTPs
*/
function getHeader()
{
global $conf;
$_header = 'From: ' . $this->getFrom('org') . "\r\n"
. 'To: ' . $this->getTO() . "\r\n";
@ -1233,13 +1235,13 @@ class SMTPs
if ( $this->getBCC() )
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
*/
$host=$this->getHost();
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
$host=dol_getprefix('email');
//NOTE: Message-ID should probably contain the username of the user who sent the msg
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
$_header .= 'Date: ' . date("r") . "\r\n";
@ -1258,7 +1260,7 @@ class SMTPs
}
if ( $this->getMoreInHeader() )
$_header .= $this->getMoreInHeader(); // Value must include the "\r\n";
//$_header .=
// 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"
// 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n";
@ -1279,9 +1281,10 @@ class SMTPs
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n";
$_header .= 'X-Dolibarr-Option: '.($conf->global->MAIN_MAIL_USE_MULTI_PART?'MAIN_MAIL_USE_MULTI_PART':'No MAIN_MAIL_USE_MULTI_PART') . "\r\n";
$_header .= 'Mime-Version: 1.0' . "\r\n";
return $_header;
}
@ -1310,17 +1313,17 @@ class SMTPs
$strContentAltText = html_entity_decode(strip_tags($strContent));
$strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n"));
}
// Make RFC2045 Compliant
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
$this->_msgContent[$strType] = array();
$this->_msgContent[$strType]['mimeType'] = $strMimeType;
$this->_msgContent[$strType]['data'] = $strContent;
$this->_msgContent[$strType]['dataText'] = $strContentAltText;
if ( $this->getMD5flag() )
$this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3);
//}
@ -1334,7 +1337,7 @@ class SMTPs
function getBodyContent()
{
global $conf;
// Generate a new Boundary string
$this->_setBoundary();
@ -1382,7 +1385,7 @@ class SMTPs
$content .= "\r\n";
$content .= "--" . $this->_getBoundary('mixed') . "\r\n";
if (key_exists('image', $this->_msgContent)) // If inline image found
{
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
@ -1390,7 +1393,7 @@ class SMTPs
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
}
// $this->_msgContent must be sorted with key 'text' or 'html' first then 'image' then 'attachment'
@ -1450,18 +1453,18 @@ class SMTPs
$content.= "\r\n";
$content.= "--" . $this->_getBoundary('related') . "\r\n";
}
if (! key_exists('image', $this->_msgContent) && $_content['dataText'] && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part
{
$content.= 'Content-Type: multipart/alternative; boundary="'.$this->_getBoundary('alternative').'"' . "\r\n";
$content .= "\r\n";
$content .= "--" . $this->_getBoundary('alternative') . "\r\n";
$content.= "Content-Type: text/plain; charset=" . $this->getCharSet() . "\r\n";
$content.= "\r\n". $_content['dataText'] . "\r\n";
$content.= "--" . $this->_getBoundary('alternative') . "\r\n";
}
}
$content .= 'Content-Type: ' . $_content['mimeType'] . '; '
// . 'charset="' . $this->getCharSet() . '"';
. 'charset=' . $this->getCharSet() . '';
@ -1483,7 +1486,7 @@ class SMTPs
{
$content.= "--" . $this->_getBoundary('alternative') . "--". "\r\n";
}
$content .= "\r\n";
}
}

View File

@ -393,6 +393,7 @@ function dol_dir_is_emtpy($folder)
*
* @param string $file Filename
* @return int <0 if KO, Number of lines in files if OK
* @see dol_nboflines
*/
function dol_count_nb_of_line($file)
{
@ -448,12 +449,12 @@ function dol_filemtime($pathoffile)
* Make replacement of strings into a file.
*
* @param string $srcfile Source file (can't be a directory)
* @param array $arrayreplacement Array with strings to replace
* @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $indexdatabase Index new file into database.
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dolCopyr
* @see dolCopyr dolReplaceRegExInFile
*/
function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0)
{
@ -514,6 +515,23 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0,
return 1;
}
/**
* Make replacement of strings into a file.
*
* @param string $srcfile Source file (can't be a directory)
* @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $indexdatabase Index new file into database.
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dolCopyr dolReplaceInFile
*/
function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0)
{
// TODO
}
/**
* Copy a file to another file.
*

View File

@ -624,18 +624,26 @@ function dol_buildpath($path, $type=0)
/**
* Create a clone of instance of object (new instance with same value for properties)
* Property that are reference are also new object (true clone)
* With native = 0: Property that are reference are also new object (true clone). This means $this->db is not valid.
* With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db is still valid.
*
* @param object $object Object to clone
* @param int $native Native method or true method
* @return object Object clone
* @see https://php.net/manual/language.oop5.cloning.php
*/
function dol_clone($object)
function dol_clone($object, $native=0)
{
//dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
//$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable
$myclone=unserialize(serialize($object));
if (empty($native))
{
$myclone=unserialize(serialize($object));
}
else
{
$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep references (refer to the same target/variable)
}
return $myclone;
}
@ -1127,7 +1135,7 @@ function dol_get_fiche_end($notab=0)
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link
* @param string $morehtml More html content to output just before the nav bar
* @param int $shownav Show Condition (navigation is shown if value is 1)
* @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field)
* @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search.
* @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
* @param string $morehtmlref More html to show after ref
* @param string $moreparam More param to add in nav link url.
@ -1278,7 +1286,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub
$nophoto=img_picto('', 'object_'.$picto, '', false, 1);
}
$morehtmlleft.='<!-- No photo to show --><div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.$nophoto.'"></div></div>';
$morehtmlleft.='<!-- No photo to show -->';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.$nophoto.'"></div></div>';
$morehtmlleft.='</div>';
}
}
@ -2545,7 +2554,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if ($pictoisfullpath)
{
// Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
$fullpathpicto = $picto;
}
else
@ -2567,7 +2576,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
}
// Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
// If alt path are defined, define url where img file is, according to physical path
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
{
@ -4766,22 +4775,57 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
* Return first line of text. Cut will depends if content is HTML or not.
*
* @param string $text Input text
* @param int $nboflines Nb of lines to get (default is 1 = first line only)
* @return string Output text
* @see dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag
*/
function dolGetFirstLineOfText($text)
function dolGetFirstLineOfText($text, $nboflines=1)
{
if (dol_textishtml($text))
if ($nboflines == 1)
{
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
if (dol_textishtml($text))
{
$firstline=preg_replace('/<br[^>]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters
$firstline=preg_replace('/<div[^>]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters
}
else
{
$firstline=preg_replace('/[\n\r].*/','',$text);
}
return $firstline.((strlen($firstline) != strlen($text))?'...':'');
}
else
{
$firstline=preg_replace('/[\n\r].*/','',$text);
$ishtml=0;
if (dol_textishtml($text))
{
$text=preg_replace('/\n/','',$text);
$ishtml=1;
$repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " ");
}
else
{
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
}
$text = strtr($text, $repTable);
if ($charset == 'UTF-8') { $pattern = '/(<br[^>]*>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
else $pattern = '/(<br[^>]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
$a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$firstline='';
$i=0;
$nba = count($a); // 2x nb of lines in $a because $a contains also a line for each new line separator
while (($i < $nba) && ($i < ($nboflines * 2)))
{
if ($i % 2 == 0) $firstline .= $a[$i];
elseif (($i < (($nboflines * 2) - 1)) && ($i < ($nba - 1))) $firstline .= ($ishtml?"<br>\n":"\n");
$i++;
}
unset($a);
return $firstline.(($i < $nba)?'...':'');
}
return $firstline.((strlen($firstline) != strlen($text))?'...':'');
}
@ -4943,7 +4987,7 @@ function dol_nboflines($s,$maxchar=0)
/**
* Return nb of lines of a formated text with \n and <br> (we can't have both \n and br)
* Return nb of lines of a formated text with \n and <br> (WARNING: string must not have mixed \n and br separators)
*
* @param string $text Text
* @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
@ -4979,6 +5023,8 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
}
}
}
unset($a);
return $nblines;
}

View File

@ -77,6 +77,8 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
$i++;
$typephp='';
$texttoinsert.= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',";
$texttoinsert.= " 'visible'=>".($val['visible']?$val['visible']:0).",";
$texttoinsert.= " 'enabled'=>".($val['enabled']?$val['enabled']:0).",";
if ($val['position']) $texttoinsert.= " 'position'=>".$val['position'].",";
if ($val['notnull']) $texttoinsert.= " 'notnull'=>".$val['notnull'].",";
if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].",";

View File

@ -31,17 +31,17 @@
function dolWebsiteOutput($content)
{
global $db, $langs, $conf, $user;
global $dolibarr_main_url_root;
global $dolibarr_main_url_root, $dolibarr_main_data_root;
dol_syslog("dolWebsiteOutput start");
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
if (! defined('USEDOLIBARRSERVER'))
{
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$symlinktomediaexists=1;
// Make a change into HTML code to allow to include images from medias directory correct with direct link for virtual server
@ -55,12 +55,57 @@ function dolWebsiteOutput($content)
}
else
{
$content=preg_replace('/(<img.*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^\/]*\/>)/', '\1medias/\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<img.*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^\/]*\/>)/', '\1medias/\4\5', $content, -1, $nbrep);
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1medias/\4\5', $content, -1, $nbrep);
}
}
else
{
global $website;
// Replace relative link / with dolibarr URL
$content=preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageid='.$website->fk_default_home.'"', $content, -1, $nbrep);
// Replace relative link /xxx.php with dolibarr URL
$content=preg_replace('/(href=")\/?([^\"]*)(\.php\")/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageref=\2"', $content, -1, $nbrep);
}
dol_syslog("dolWebsiteOutput end");
print $content;
}
/**
* Clean an HTML page to report only content, so we can include it into another page
* It outputs content of file sanitized from html and body part.
*
* @param string $contentfile Path to file to include (must include website root. Example: 'mywebsite/mypage.php')
* @return void
*/
function dolIncludeHtmlContent($contentfile)
{
global $conf, $db, $langs, $mysoc, $user, $website;
global $includehtmlcontentopened;
$MAXLEVEL=20;
$fullpathfile=DOL_DATA_ROOT.'/websites/'.$contentfile;
//$content = file_get_contents($fullpathfile);
//print preg_replace(array('/^.*<body[^>]*>/ims','/<\/body>.*$/ims'), array('', ''), $content);*/
if (empty($includehtmlcontentopened)) $includehtmlcontentopened=0;
$includehtmlcontentopened++;
if ($includehtmlcontentopened > $MAXLEVEL)
{
print 'ERROR: RECURSIVE CONTENT LEVEL. Depth of recursive call is more than the limit of '.$MAXLEVEL.".\n";
return;
}
$res = include $fullpathfile; // Include because we want to execute code content
if (! $res)
{
print 'ERROR: FAILED TO INCLUDE PAGE '.$contentfile.".\n";
}
$includehtmlcontentopened--;
}

View File

@ -871,7 +871,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// VAT
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
{
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);

View File

@ -1447,55 +1447,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
*
* @return int Error count (0 if ok)
*/
function insert_tabs()
{
global $conf;
function insert_tabs()
{
global $conf;
$err=0;
$err=0;
if (! empty($this->tabs))
{
$i=0;
foreach ($this->tabs as $key => $value)
{
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
if (! empty($this->tabs))
{
$i=0;
foreach ($this->tabs as $key => $value)
{
if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
$entity=$conf->entity;
$newvalue = $value;
$entity=$conf->entity;
$newvalue = $value;
if (is_array($value))
{
$newvalue = $value['data'];
if (isset($value['entity'])) $entity = $value['entity'];
}
if (is_array($value))
{
$newvalue = $value['data'];
if (isset($value['entity'])) $entity = $value['entity'];
}
if ($newvalue)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
$sql.= "name";
$sql.= ", type";
$sql.= ", value";
$sql.= ", note";
$sql.= ", visible";
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES (";
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
$sql.= ", 'chaine'";
$sql.= ", ".$this->db->encrypt($value,1);
$sql.= ", null";
$sql.= ", '0'";
$sql.= ", ".$conf->entity;
$sql.= ")";
if ($newvalue)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
$sql.= "name";
$sql.= ", type";
$sql.= ", value";
$sql.= ", note";
$sql.= ", visible";
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES (";
$sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
$sql.= ", 'chaine'";
$sql.= ", ".$this->db->encrypt($newvalue,1);
$sql.= ", null";
$sql.= ", '0'";
$sql.= ", ".$entity;
$sql.= ")";
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
$this->db->query($sql);
}
$i++;
}
}
return $err;
}
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
$this->db->query($sql);
}
$i++;
}
}
return $err;
}
/**
* Adds constants

View File

@ -45,28 +45,28 @@ class pdf_einstein extends ModelePDFCommandes
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.3 = array(5, 3)
*/
public $phpmin = array(5, 2);
public $phpmin = array(5, 2);
/**
* Dolibarr version of the loaded document
* @public string
@ -240,11 +240,11 @@ class pdf_einstein extends ModelePDFCommandes
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -263,10 +263,10 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Order"));
$pdf->SetSubject($outputlangs->transnoentities("PdfOrderTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -317,16 +317,16 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6;
$height_incoterms += 4;
}
}
// Affiche notes
$notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
@ -478,7 +478,7 @@ class pdf_einstein extends ModelePDFCommandes
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
@ -585,7 +585,7 @@ class pdf_einstein extends ModelePDFCommandes
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
}
*/
// Pied de page
$this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
@ -1201,7 +1201,7 @@ class pdf_einstein extends ModelePDFCommandes
* @param string $titlekey Translation key to show as title of document
* @return void
*/
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="Order")
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="PdfOrderTitle")
{
global $conf,$langs,$hookmanager;
@ -1294,7 +1294,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=2;
// Show list of linked objects

View File

@ -211,7 +211,7 @@ class doc_generic_contract_odt extends ModelePDFContract
if (! is_object($object))
{
$id = $object;
$object = new Contract($this->db);
$object = new Contrat($this->db);
$result=$object->fetch($id);
if ($result < 0)
{

View File

@ -1,13 +1,13 @@
<?php
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -255,16 +255,16 @@ class pdf_crabe extends ModelePDFFactures
// Set nblignes with the new facture lines content after hook
$nblignes = count($object->lines);
$nbpayments = count($object->getListOfPayments());
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -284,10 +284,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Invoice"));
$pdf->SetSubject($outputlangs->transnoentities("PdfInvoiceTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -509,7 +509,7 @@ class pdf_crabe extends ModelePDFFactures
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if ($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
@ -769,7 +769,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','', $default_font_size - 4);
// Loop on each deposits and credit notes included
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql.= " re.description, re.fk_facture_source,";
@ -822,7 +822,7 @@ class pdf_crabe extends ModelePDFFactures
$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
//$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1";
$sql.= " ORDER BY p.datep";
$resql=$this->db->query($sql);
if ($resql)
{
@ -1052,7 +1052,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFillColor(255,255,255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
@ -1071,7 +1071,7 @@ class pdf_crabe extends ModelePDFFactures
else
{
// FIXME amount of vat not supported with multicurrency
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
@ -1141,26 +1141,26 @@ class pdf_crabe extends ModelePDFFactures
}
//}
// VAT
// Situations totals migth be wrong on huge amounts
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
$sum_pdf_tva = 0;
foreach($this->tva as $tvakey => $tvaval){
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
}
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
foreach($this->tva as $tvakey => $tvaval) {
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
}
}
}
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
@ -1416,7 +1416,7 @@ class pdf_crabe extends ModelePDFFactures
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
@ -1430,14 +1430,14 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
}
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxprogress, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
@ -1450,9 +1450,9 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
}
}
if($conf->global->PRODUCT_USE_UNITS) {
@ -1559,7 +1559,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("Invoice");
$title=$outputlangs->transnoentities("PdfInvoiceTitle");
if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement");
if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir");
if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit");
@ -1573,10 +1573,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref);
if ($object->statut == Facture::STATUS_DRAFT)
if ($object->statut == Facture::STATUS_DRAFT)
{
$pdf->SetTextColor(128,0,0);
$textref.=' - '.$outputlangs->trans("NotValidated");
$textref.=' - '.$outputlangs->transnoentities("NotValidated");
}
$pdf->MultiCell($w, 4, $textref, '', 'R');
@ -1635,7 +1635,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R');
}
if ($object->type != 2)
{
$posy+=3;
@ -1663,10 +1663,10 @@ class pdf_crabe extends ModelePDFFactures
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
$pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=1;
// Show list of linked objects

View File

@ -167,7 +167,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
{
// Model for creation
@ -252,7 +252,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
if (! is_object($object))
{
$id = $object;
$object = new Propale($this->db);
$object = new Propal($this->db);
$result=$object->fetch($id);
if ($result < 0)
{

View File

@ -273,7 +273,7 @@ class pdf_azur extends ModelePDFPropales
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@ -292,10 +292,10 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("CommercialProposal"));
$pdf->SetSubject($outputlangs->transnoentities("PdfCommercialProposalTitle"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfCommercialProposalTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
@ -322,19 +322,19 @@ class pdf_azur extends ModelePDFPropales
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0;
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
$this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top = 90;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
$tab_height = 130;
@ -383,7 +383,7 @@ class pdf_azur extends ModelePDFPropales
$notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs);
if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
}
}
if ($notetoshow)
{
$tab_top = 88 + $height_incoterms;
@ -452,7 +452,7 @@ class pdf_azur extends ModelePDFPropales
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
@ -554,14 +554,14 @@ class pdf_azur extends ModelePDFPropales
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
$localtax2_rate=$object->lines[$i]->localtax2_tx;
$localtax1_type=$object->lines[$i]->localtax1_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
@ -669,7 +669,7 @@ class pdf_azur extends ModelePDFPropales
{
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
}
// Pied de page
$this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
@ -1428,7 +1428,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFont('','B',$default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("CommercialProposal");
$title=$outputlangs->transnoentities("PdfCommercialProposalTitle");
$pdf->MultiCell(100, 4, $title, '', 'R');
$pdf->SetFont('','B',$default_font_size);
@ -1481,7 +1481,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=2;
// Show list of linked objects

View File

@ -21,43 +21,45 @@ if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocb
if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
?>
<!-- BEGIN PHP TEMPLATE bloc_showhide.tpl.php -->
<!-- BEGIN PHP TEMPLATE BLOC SHOW/HIDE -->
<?php
print '<script type="text/javascript">'."\n";
print '$(document).ready(function() {'."\n";
print '$("#hide-'.$blocname.'").click(function(){'."\n";
print ' setShowHide(0);'."\n";
print ' $("#'.$blocname.'_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");'."\n";
print ' $(this).hide();'."\n";
print ' $("#show-'.$blocname.'").show();'."\n";
print '});'."\n";
<script type="text/javascript">
$(document).ready(function() {
$("#hide-<?php echo $blocname ?>").click(function(){
setShowHide(0);
$("#<?php echo $blocname ?>_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");
$(this).hide();
$("#show-<?php echo $blocname ?>").show();
});
$("#show-<?php echo $blocname ?>").click(function(){
setShowHide(1);
$("#<?php echo $blocname ?>_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");
$(this).hide();
$("#hide-<?php echo $blocname ?>").show();
});
function setShowHide(status) {
var id = <?php echo $object->id; ?>;
var element = '<?php echo $object->element; ?>';
var htmlelement = '<?php echo $blocname ?>';
var type = 'showhide';
print '$("#show-'.$blocname.'").click(function(){'."\n";
print ' setShowHide(1);'."\n";
print ' $("#'.$blocname.'").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n";
print ' $(this).hide();'."\n";
print ' $("#hide-'.$blocname.'").show();'."\n";
print '});'."\n";
$.get("<?php echo dol_buildpath('/core/ajax/extraparams.php', 1); ?>?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);
}
});
</script>
print 'function setShowHide(status) {'."\n";
print ' var id = '.$object->id.";\n";
print " var element = '".$object->element."';\n";
print " var htmlelement = '".$blocname."';\n";
print ' var type = "showhide";'."\n";
print ' $.get("'.dol_buildpath('/core/ajax/extraparams.php', 1);
print '?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);'."\n";
print '}'."\n";
<div style="float:right; position: relative; top: 3px; right:5px;" id="hide-<?php echo $blocname ?>" class="linkobject<?php echo ($hide ? ' hideobject' : ''); ?>"><?php echo img_picto('', '1uparrow.png'); ?></div>
<div style="float:right; position: relative; top: 3px; right:5px;" id="show-<?php echo $blocname ?>" class="linkobject<?php echo ($hide ? '' : ' hideobject'); ?>"><?php echo img_picto('', '1downarrow.png'); ?></div>
<div id="<?php echo $blocname ?>_title" class="liste_titre"><?php echo $title; ?></div>
print '});'."\n";
print '</script>'."\n";
<div id="<?php echo $blocname ?>_bloc" class="<?php echo ($hide ? 'hideobject' : 'nohideobject'); ?>">
print '<div style="float:right; position: relative; top: 3px; right:5px;" id="hide-'.$blocname.'"';
print ' class="linkobject'.($hide ? ' hideobject' : '').'">'.img_picto('', '1uparrow.png').'</div>'."\n";
print '<div style="float:right; position: relative; top: 3px; right:5px;" id="show-'.$blocname.'"';
print ' class="linkobject'.($hide ? '' : ' hideobject').'">'.img_picto('', '1downarrow.png').'</div>'."\n";
print '<div id="'.$blocname.'_title" class="liste_titre">'.$title.'</div>'."\n";
print '<div id="'.$blocname.'_bloc" class="'.($hide ? 'hideobject' : 'nohideobject').'">'."\n";
<?php include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php'; ?>
</div>
<br>
<!-- END PHP TEMPLATE BLOC SHOW/HIDE -->
include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php';
print '</div><br>';
?>
<!-- END PHP TEMPLATE BLOC SHOW/HIDE -->

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Laurent Destailleur <eldy@destailleur.fr>
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2017 Laurent Destailleur <eldy@destailleur.fr>
*
* 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
@ -17,9 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// $cssclass must be defined by caller. For example cssclass='fieldtitle"
$module = $object->element;
$note_public = 'note_public';
// $permission must be defined by caller.
// $cssclass must be defined by caller. For example cssclass='fieldtitle"
$module = $object->element;
$note_public = 'note_public';
$note_private = 'note_private';
$colwidth=(isset($colwidth)?$colwidth:(empty($cssclass)?'25':''));

View File

@ -0,0 +1,28 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/website.inc.php
* \brief Common file loaded used by all website pages (after master.inc.php)
* The global variable $website must be defined.
*/
include_once DOL_DOCUMENT_ROOT.'/websites/class/website.class.php';
$website=new Website($db);
$website->fetch(0,$websitekey);

View File

@ -380,7 +380,7 @@ if (($action=="create") || ($action=="edit"))
print '<tr class="blockmethod"><td>';
print $langs->trans('CronArgs')."</td><td>";
print "<input type=\"text\" size=\"20\" name=\"params\" value=\"".$object->params."\" /> ";
print "<input type=\"text\" class=\"quatrevingtpercent\" name=\"params\" value=\"".$object->params."\" /> ";
print "</td>";
print "<td>";
print $form->textwithpicto('',$langs->trans("CronArgsHelp"),1,'help');
@ -408,10 +408,10 @@ if (($action=="create") || ($action=="edit"))
print '<tr><td class="fieldrequired">';
print $langs->trans('CronEvery')."</td>";
print "<td>";
print "<select name=\"nbfrequency\">";
for($i=1; $i<=60; $i++)
print '<select name="nbfrequency">';
for ($i=1; $i<=60; $i++)
{
if (! empty($object->unitfrequency) && ($object->frequency/$object->unitfrequency) == $i)
if ($object->frequency == $i)
{
print "<option value='".$i."' selected>".$i."</option>";
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
@ -61,7 +61,7 @@ class Cronjob extends CommonObject
public $fk_user_mod;
public $nbrun;
public $libname;
public $test; // A test condition to know if job is visible/qualified
/**
* Constructor
@ -194,12 +194,12 @@ class Cronjob extends CommonObject
$sql.= " ".(! isset($this->md5params)?'NULL':"'".$this->db->escape($this->md5params)."'").",";
$sql.= " ".(! isset($this->module_name)?'NULL':"'".$this->db->escape($this->module_name)."'").",";
$sql.= " ".(! isset($this->priority)?'0':$this->priority).",";
$sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).",";
$sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':$this->db->idate($this->datenextrun)).",";
$sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':$this->db->idate($this->dateend)).",";
$sql.= " ".(! isset($this->datestart) || dol_strlen($this->datestart)==0?'NULL':$this->db->idate($this->datestart)).",";
$sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':"'".$this->db->idate($this->datelastrun)."'").",";
$sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':"'".$this->db->idate($this->datenextrun)."'").",";
$sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':"'".$this->db->idate($this->dateend)."'").",";
$sql.= " ".(! isset($this->datestart) || dol_strlen($this->datestart)==0?'NULL':"'".$this->db->idate($this->datestart)."'").",";
$sql.= " ".(! isset($this->lastresult)?'NULL':"'".$this->db->escape($this->lastresult)."'").",";
$sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':$this->db->idate($this->datelastresult)).",";
$sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':"'".$this->db->idate($this->datelastresult)."'").",";
$sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").",";
$sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").",";
$sql.= " ".(! isset($this->frequency)?'0':$this->frequency).",";

View File

@ -18,7 +18,7 @@
*/
/**
* \file htdocs/cron/cron/list.php
* \file htdocs/cron/list.php
* \ingroup cron
* \brief Lists Jobs
*/
@ -356,11 +356,7 @@ if ($num > 0)
if (! verifCond($obj->test)) continue; // Discard line with test = false
// title profil
if ($style=='pair') {$style='impair';}
else {$style='pair';}
print '<tr class="'.$style.'">';
print '<tr class="oddeven">';
print '<td class="nowrap">';
print '<a href="'.DOL_URL_ROOT.'/cron/card.php?id='.$obj->rowid.'">';

View File

@ -1577,7 +1577,7 @@ else if ($id > 0 || ! empty($ref))
{
if ($action != 'editdescription' && ($action != 'presend')) {
// Validate
if ($object->statut == 0 && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=validate"';
print '>' . $langs->trans("Validate") . '</a></div>';
@ -1585,7 +1585,7 @@ else if ($id > 0 || ! empty($ref))
}
// Modify
if ($object->statut == 1 && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate)))
if ($object->statut == Fichinter::STATUS_VALIDATED && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate)))
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=modify">';
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify");
@ -1594,7 +1594,7 @@ else if ($id > 0 || ! empty($ref))
}
// Send
if ($object->statut > 0)
if ($object->statut > Fichinter::STATUS_DRAFT)
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
{
@ -1606,10 +1606,10 @@ else if ($id > 0 || ! empty($ref))
// Event agenda
if (! empty($conf->global->FICHINTER_ADDLINK_TO_EVENT))
{
if (! empty($conf->agenda->enabled) && $object->statut > 0)
if (! empty($conf->agenda->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
{
$langs->load("agenda");
if ($object->statut < 2)
if ($object->statut < Fichinter::STATUS_BILLED)
{
if ($user->rights->agenda->myactions->create) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'&amp;backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddEvent").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddEvent").'</a></div>';
@ -1618,10 +1618,10 @@ else if ($id > 0 || ! empty($ref))
}
// Proposal
if (! empty($conf->propal->enabled) && $object->statut > 0)
if (! empty($conf->propal->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
{
$langs->load("propal");
if ($object->statut < 2)
if ($object->statut < Fichinter::STATUS_BILLED)
{
if ($user->rights->propal->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddProp").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddProp").'</a></div>';
@ -1629,10 +1629,10 @@ else if ($id > 0 || ! empty($ref))
}
// Invoicing
if (! empty($conf->facture->enabled) && $object->statut > 0)
if (! empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT)
{
$langs->load("bills");
if ($object->statut < 2)
if ($object->statut < Fichinter::STATUS_BILLED)
{
if ($user->rights->facture->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddBill").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddBill").'</a></div>';
@ -1640,7 +1640,7 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->global->FICHINTER_CLASSIFY_BILLED)) // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1
{
if ($object->statut != 2)
if ($object->statut != Fichinter::STATUS_BILLED)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("InterventionClassifyBilled").'</a></div>';
}
@ -1652,7 +1652,7 @@ else if ($id > 0 || ! empty($ref))
}
// Done
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED) && $object->statut > 0 && $object->statut < 3)
if (empty($conf->global->FICHINTER_CLASSIFY_BILLED) && $object->statut > Fichinter::STATUS_DRAFT && $object->statut < Fichinter::STATUS_CLOSED)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifydone">'.$langs->trans("InterventionClassifyDone").'</a></div>';
}
@ -1663,7 +1663,7 @@ else if ($id > 0 || ! empty($ref))
}
// Delete
if (($object->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
if (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete"';
print '>'.$langs->trans('Delete').'</a></div>';

View File

@ -39,7 +39,7 @@ class Fichinter extends CommonObject
public $fk_element='fk_fichinter';
public $table_element_line='fichinterdet';
public $picto = 'intervention';
/**
* {@inheritdoc}
*/
@ -62,6 +62,23 @@ class Fichinter extends CommonObject
var $lines = array();
/**
* Draft status
*/
const STATUS_DRAFT = 0;
/**
* Validated status
*/
const STATUS_VALIDATED = 1;
/**
* Billed
*/
const STATUS_BILLED = 2;
/**
* Closed
*/
const STATUS_CLOSED = 3;
/**
* Constructor
*
@ -361,7 +378,7 @@ class Fichinter extends CommonObject
$this->fk_contrat = $obj->fk_contrat;
$this->user_creation= $obj->fk_user_author;
$this->extraparams = (array) json_decode($obj->extraparams, true);
if ($this->statut == 0) $this->brouillon = 1;
@ -546,23 +563,23 @@ class Fichinter extends CommonObject
*/
function getAmount() {
global $db;
$amount = 0;
$this->author = new User($db);
$this->author->fetch($this->user_creation);
$thm = $this->author->thm;
foreach($this->lines as &$line) {
$amount+=$line->qty * $thm;
}
return $amount;
}
/**
* Returns the label status
*
@ -599,7 +616,7 @@ class Fichinter extends CommonObject
return '<span class="hideonsmartphone">'.$langs->trans($this->statuts_short[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]);
if ($mode == 6)
return '<span class="hideonsmartphone">'.$langs->trans($this->statuts[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),$this->statuts_logo[$statut]);
return '';
}
@ -949,7 +966,7 @@ class Fichinter extends CommonObject
return -2;
}
/**
* Load an object from its id and create a new one in database
@ -1001,7 +1018,7 @@ class Fichinter extends CommonObject
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
@ -1013,7 +1030,7 @@ class Fichinter extends CommonObject
{
$this->addline($user, $this->id, $line->desc, $line->datei, $line->duration);
}
// Hook of thirdparty module
if (is_object($hookmanager))
{
@ -1043,8 +1060,8 @@ class Fichinter extends CommonObject
return -1;
}
}
/**
* Adding a line of intervention into data base
*

View File

@ -253,6 +253,13 @@ if ($resql)
$arrayofselected=is_array($toselect)?$toselect:array();
if ($socid > 0)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_company)) $search_company = $soc->name;
}
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;

View File

@ -427,6 +427,7 @@ if ($resql)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_societe)) $search_societe = $soc->name;
}
$param='&socid='.$socid;
@ -493,7 +494,7 @@ if ($resql)
if (! GETPOST('cancel'))
{
$objecttmp=new FactureFourn($db);
$objecttmp=new FactureFournisseur($db);
$listofselectedid=array();
$listofselectedthirdparties=array();
$listofselectedref=array();

View File

@ -448,7 +448,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
}
// Number of supplier invoices (has paid)
if (! empty($conf->supplier_invoice->enabled) && ! empty($conf->facture->enabled) && $user->rights->facture->lire)
if (! empty($conf->supplier_invoice->enabled) && ! empty($user->rights->fournisseur->facture->lire))
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$board=new FactureFournisseur($db);

View File

@ -133,10 +133,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 3
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1);
-- INDIA (id country=117)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',0);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1);
-- IRELAND (id country=8)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1);

View File

@ -1106,6 +1106,7 @@ ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_d
ALTER TABLE llx_projet_task MODIFY COLUMN duration_effective real DEFAULT 0 NULL;
ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
-- VPGSQL8.2 ALTER TABLE llx_projet_task ALTER COLUMN planned_workload DROP NOT NULL;
-- add extrafield on ficheinter lines
CREATE TABLE llx_fichinterdet_extrafields

View File

@ -110,6 +110,7 @@ ALTER TABLE llx_projet_task_time ADD COLUMN task_date_withhour integer DEFAULT 0
ALTER TABLE llx_projet_task MODIFY COLUMN duration_effective real DEFAULT 0 NULL;
ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
-- VPGSQL8.2 ALTER TABLE llx_projet_task ALTER COLUMN planned_workload DROP NOT NULL;
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;

View File

@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
-- Negative buying prices
UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht)

View File

@ -547,4 +547,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
ALTER TABLE llx_user MODIFY COLUMN login varchar(50);

View File

@ -467,6 +467,8 @@ DELETE FROM llx_categorie_project WHERE fk_categorie NOT IN (SELECT rowid FROM l
ALTER TABLE llx_inventory ADD COLUMN ref varchar(48);
-- VPGSQL8.2 ALTER TABLE llx_projet_task ALTER COLUMN planned_workload DROP NOT NULL;
CREATE TABLE llx_loan_schedule
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -571,3 +573,10 @@ UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement c
UPDATE llx_bank SET label= '(payment_salary)' WHERE label LIKE 'Règlement salaire';
ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255);
-- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST-CGST', 8, 8, '1', 0, '0', 0, 'IGST-CGST', 1);
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1);

View File

@ -28,4 +28,19 @@
ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL;
ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date;
ALTER TABLE llx_website_page MODIFY COLUMN pageurl varchar(255);
ALTER TABLE llx_website_page ADD COLUMN lang varchar(6);
ALTER TABLE llx_website_page ADD COLUMN fk_page integer;
ALTER TABLE llx_fichinter ADD COLUMN import_key varchar(14);
ALTER TABLE llx_livraison ADD COLUMN import_key varchar(14);
ALTER TABLE llx_livraison ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_don ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_accounting_account ADD COLUMN import_key varchar(14);
ALTER TABLE llx_accounting_account ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN import_key varchar(14);
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_lim_reglement datetime;

View File

@ -35,4 +35,6 @@ create table llx_accounting_account
fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
)ENGINE=innodb;

View File

@ -40,14 +40,16 @@ CREATE TABLE llx_accounting_bookkeeping
multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet
date_lim_reglement datetime, -- | date limite de reglement
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
tms timestamp, -- | date last modification
import_key varchar(14),
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
piece_num integer NOT NULL, -- FEC:EcritureNum
validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
date_validated datetime -- FEC:ValidDate
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
) ENGINE=innodb;

View File

@ -40,6 +40,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet
date_lim_reglement datetime, -- | date limite de reglement
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date

View File

@ -51,5 +51,6 @@ create table llx_don
note_private text,
note_public text,
model_pdf varchar(255),
import_key varchar(14)
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
)ENGINE=innodb;

View File

@ -37,5 +37,9 @@ create table llx_extrafields
param text, -- extra parameters to define possible values of field
list integer DEFAULT 0, -- list of values for field that are combo lists
langs varchar(24), -- example: fileofmymodule@mymodule
ishidden integer DEFAULT 0 -- ??? example of use case ???
ishidden integer DEFAULT 0, -- Can be foreign key of external system
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
datec datetime, -- date de creation
tms timestamp
)ENGINE=innodb;

View File

@ -31,8 +31,8 @@ create table llx_fichinter
date_valid datetime, -- date de validation
datei date, -- date de livraison du bon d'intervention
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
fk_user_valid integer, -- valideur de la fiche
fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating record
fk_statut smallint DEFAULT 0,
dateo date, -- date de début d'intervention
datee date, -- date de fin d'intervention
@ -42,5 +42,6 @@ create table llx_fichinter
note_private text,
note_public text,
model_pdf varchar(255),
extraparams varchar(255) -- for stock other parameters with json format
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
)ENGINE=innodb;

View File

@ -41,6 +41,8 @@ create table llx_livraison
note_public text,
model_pdf varchar(255),
fk_incoterms integer, -- for incoterms
location_incoterms varchar(255) -- for incoterms
location_incoterms varchar(255), -- for incoterms
import_key varchar(14),
extraparams varchar(255) -- for other parameters with json format
)ENGINE=innodb;

View File

@ -33,7 +33,7 @@ create table llx_user
tms timestamp,
fk_user_creat integer,
fk_user_modif integer,
login varchar(24) NOT NULL,
login varchar(50) NOT NULL,
pass varchar(128),
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password

View File

@ -21,10 +21,12 @@ CREATE TABLE llx_website_page
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
fk_website integer NOT NULL,
pageurl varchar(16) NOT NULL,
pageurl varchar(255) NOT NULL,
title varchar(255),
description varchar(255),
keywords varchar(255),
lang varchar(6),
fk_page integer,
content mediumtext, -- text is not enough in size
status integer,
fk_user_create integer,

View File

@ -163,6 +163,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_price_by_qty FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-- Add triggers for timestamp fields named date_m

View File

@ -423,13 +423,11 @@ if (! $error && $db->connected && $action == "set")
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre telecharges en passant outre l'authentification
$dir[0] = $main_data_dir."/mycompany";
$dir[1] = $main_data_dir."/users";
$dir[2] = $main_data_dir."/custom";
$dir[3] = $main_data_dir."/facture";
$dir[4] = $main_data_dir."/propale";
$dir[5] = $main_data_dir."/ficheinter";
$dir[6] = $main_data_dir."/produit";
$dir[7] = $main_data_dir."/doctemplates";
$dir[7] = $main_data_dir."/extensions";
$dir[2] = $main_data_dir."/facture";
$dir[3] = $main_data_dir."/propale";
$dir[4] = $main_data_dir."/ficheinter";
$dir[5] = $main_data_dir."/produit";
$dir[6] = $main_data_dir."/doctemplates";
// Boucle sur chaque repertoire de dir[] pour les creer s'ils nexistent pas
$num=count($dir);

View File

@ -24,3 +24,7 @@ LinkToProposal=Link to quotation
LinkToSupplierProposal=Link to supplier quotation
SearchIntoCustomerProposals=Customer quotations
SearchIntoSupplierProposals=Supplier quotations
AmountVAT=Amount tax IGST
AmountLT1=Amount tax CGST
AmountLT2=Amount tax SGST

View File

@ -1058,7 +1058,7 @@ RestoreDesc2=Restore archive file (zip file for example) of documents directory
RestoreDesc3=Restore the data, from a backup dump file, into the database of the new Dolibarr installation or into the database of this current installation (<b>%s</b>). Warning, once restore is finished, you must use a login/password, that existed when backup was made, to connect again. To restore a backup database into this current installation, you can follow this assistant.
RestoreMySQL=MySQL import
ForcedToByAModule= This rule is forced to <b>%s</b> by an activated module
PreviousDumpFiles=Available database backup dump files
PreviousDumpFiles=Generated database backup files
WeekStartOnDay=First day of week
RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be required (Programs version %s differs from database version %s)
YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user <b>%s</b> or you must add -W option at end of command line to provide <b>%s</b> password.

View File

@ -45,6 +45,7 @@ InvoiceHasAvoir=Was source of one or several credit notes
CardBill=Invoice card
PredefinedInvoices=Predefined Invoices
Invoice=Invoice
PdfInvoiceTitle=Invoice
Invoices=Invoices
InvoiceLine=Invoice line
InvoiceCustomer=Customer invoice

View File

@ -30,18 +30,34 @@ Piece=Accounting Doc.
AmountHTVATRealReceived=Net collected
AmountHTVATRealPaid=Net paid
VATToPay=VAT sells
VATReceived=VAT received
VATToCollect=VAT purchases
VATSummary=VAT Balance
LT2SummaryES=IRPF Balance
VATReceived=Tax received
VATToCollect=Tax purchases
VATSummary=Tax Balance
VATPaid=Tax paid
LT1Summary=Tax 2 summary
LT2Summary=Tax 3 summary
LT1SummaryES=RE Balance
VATPaid=VAT paid
LT2PaidES=IRPF Paid
LT2SummaryES=IRPF Balance
LT1SummaryIN=CGST Balance
LT2SummaryIN=SGST Balance
LT1Paid=Tax 2 paid
LT2Paid=Tax 3 paid
LT1PaidES=RE Paid
LT2CustomerES=IRPF sales
LT2SupplierES=IRPF purchases
LT2PaidES=IRPF Paid
LT1PaidIN=CGST Paid
LT2PaidIN=SGST Paid
LT1Customer=Tax 2 sales
LT1Supplier=Tax 2 purchases
LT1CustomerES=RE sales
LT1SupplierES=RE purchases
LT1CustomerIN=CGST sales
LT1SupplierIN=CGST purchases
LT2Customer=Tax 3 sales
LT2Supplier=Tax 3 purchases
LT2CustomerES=IRPF sales
LT2SupplierES=IRPF purchases
LT2CustomerIN=SGST sales
LT2SupplierIN=SGST purchases
VATCollected=VAT collected
ToPay=To pay
SpecialExpensesArea=Area for all special payments

View File

@ -14,6 +14,8 @@ FileToLaunchCronJobs=Command line to launch cron jobs
CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes
CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes
CronMethodDoesNotExists=Class %s does not contains any method %s
CronJobDefDesc=Cron job profiles are defined into the module descriptor file. When module is activated, they are loaded and available so you can administer the jobs from the admin tools menu %s.
CronJobProfiles=List of predefined cron job profiles
# Menu
EnabledAndDisabled=Enabled and disabled
# Page list
@ -53,16 +55,17 @@ CronSaveSucess=Save successfully
CronNote=Comment
CronFieldMandatory=Fields %s is mandatory
CronErrEndDateStartDt=End date cannot be before start date
StatusAtInstall=Status at installation
CronStatusActiveBtn=Enable
CronStatusInactiveBtn=Disable
CronTaskInactive=This job is disabled
CronId=Id
CronClassFile=Filename with class
CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module). <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/<u>product</u>/class/product.class.php, the value for module is <i>product</i>
CronClassFileHelp=The relative path and file name to load (path is relative to web server root directory). <BR> For exemple to call the fetch method of Dolibarr Product object htdocs/product/class/<u>product.class.php</u>, the value for class file name is <i>product/class/product.class.php</i>
CronObjectHelp=The object name to load. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is <i>Product</i>
CronMethodHelp=The object method to launch. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for method is <i>fecth</i>
CronArgsHelp=The method arguments. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for paramters can be <i>0, ProductRef</i>
CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module). <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/<u>product</u>/class/product.class.php, the value for module is<br><i>product</i>
CronClassFileHelp=The relative path and file name to load (path is relative to web server root directory). <BR> For exemple to call the fetch method of Dolibarr Product object htdocs/product/class/<u>product.class.php</u>, the value for class file name is<br><i>product/class/product.class.php</i>
CronObjectHelp=The object name to load. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is<br><i>Product</i>
CronMethodHelp=The object method to launch. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for method is<br><i>fetch</i>
CronArgsHelp=The method arguments. <BR> For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for paramters can be<br><i>0, ProductRef</i>
CronCommandHelp=The system command line to execute.
CronCreateJob=Create new Scheduled Job
CronFrom=From

View File

@ -356,17 +356,26 @@ Totalforthispage=Total for this page
TotalTTC=Total (inc. tax)
TotalTTCToYourCredit=Total (inc. tax) to your credit
TotalVAT=Total tax
TotalVATIN=Total IGST
TotalLT1=Total tax 2
TotalLT2=Total tax 3
TotalLT1ES=Total RE
TotalLT2ES=Total IRPF
TotalLT1IN=Total CGST
TotalLT2IN=Total SGST
HT=Net of tax
TTC=Inc. tax
INCT=Inc. all taxes
VAT=Sales tax
VATIN=IGST
VATs=Sales taxes
VATINs=IGST taxes
LT1=Sales tax 2
LT2=Sales tax 3
LT1ES=RE
LT2ES=IRPF
LT1IN=CGST
LT2IN=SGST
VATRate=Tax Rate
Average=Average
Sum=Sum
@ -785,6 +794,7 @@ HRAndBank=HR and Bank
AutomaticallyCalculated=Automatically calculated
TitleSetToDraft=Go back to draft
ConfirmSetToDraft=Are you sure you want to go back to Draft status ?
ImportId=Import id
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@ -13,7 +13,7 @@ FilesForObjectInitialized=Files for new object '%s' initialized
FilesForObjectUpdated=Files for object '%s' updated (.sql files and .class.php file)
ModuleBuilderDescdescription=Enter here all general information that describe your module
ModuleBuilderDescspecifications=You can enter here a long text to describe the specifications of your module that is not already structured into other tabs. So you have within easy reach all the rules to develop. Also this text content will be included into the generated documentation (see last tab). You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
ModuleBuilderDescobjects=Define here the objects you want to manage with your module. A sql file, a page to list them, to create/edit/view a card and an API will be generated.
ModuleBuilderDescobjects=Define here the objects you want to manage with your module. A CRUD DAO class, SQL files, page to list record of objects, to create/edit/view a record and an API will be generated.
ModuleBuilderDescmenus=This tab is dedicated to define menu entries provided by your module.
ModuleBuilderDescpermissions=This tab is dedicated to define the new permissions you want to provide with your module.
ModuleBuilderDesctriggers=This is the view of triggers provided by your module. To include code executed when a triggered business event is launched, just edit this file.
@ -25,13 +25,13 @@ EnterNameOfObjectToDeleteDesc=You can delete an object. WARNING: All files relat
DangerZone=Danger zone
BuildPackage=Build package/documentation
BuildDocumentation=Build documentation
ModuleIsNotActive=This module was not activated yet. Ggo into %s to make it live or click here:
ModuleIsNotActive=This module was not activated yet. Go into %s to make it live or click here:
ModuleIsLive=This module has been activated. Any change on it may break a current active feature.
DescriptionLong=Long description
EditorName=Name of editor
EditorUrl=URL of editor
DescriptorFile=Descriptor file of module
ClassFile=File for PHP class
ClassFile=File for PHP DAO CRUD class
ApiClassFile=File for PHP API class
PageForList=PHP page for list of record
PageForCreateEditView=PHP page to create/edit/view a record
@ -50,7 +50,10 @@ HooksFile=File for hooks code
WidgetFile=Widget file
ReadmeFile=Readme file
ChangeLog=ChangeLog file
TestClassFile=File for PHP Unit Test class
SqlFile=Sql file
SqlFileExtraFields=Sql file for complementary attributes
SqlFileKey=Sql file for keys
AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
IsAMeasure=Is a measure

View File

@ -4,6 +4,7 @@ SuppliersOrdersArea=Suppliers orders area
OrderCard=Order card
OrderId=Order Id
Order=Order
PdfOrderTitle=Order
Orders=Orders
OrderLine=Order line
OrderDate=Order date
@ -117,6 +118,7 @@ SecondApprovalAlreadyDone=Second approval already done
SupplierOrderReceivedInDolibarr=Supplier order %s received %s
SupplierOrderSubmitedInDolibarr=Supplier order %s submited
SupplierOrderClassifiedBilled=Supplier order %s set billed
OtherOrders=Other orders
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order
TypeContact_commande_internal_SHIPPING=Representative following-up shipping

View File

@ -18,6 +18,7 @@ NextMonthOfInvoice=Following month (number 1-12) of invoice date
TextNextMonthOfInvoice=Following month (text) of invoice date
ZipFileGeneratedInto=Zip file generated into <b>%s</b>.
DocFileGeneratedInto=Doc file generated into <b>%s</b>.
JumpToLogin=Disconnected. Go to login page...
YearOfInvoice=Year of invoice date
PreviousYearOfInvoice=Previous year of invoice date

View File

@ -6,6 +6,7 @@ ProposalsDraft=Draft commercial proposals
ProposalsOpened=Open commercial proposals
Prop=Commercial proposals
CommercialProposal=Commercial proposal
PdfCommercialProposalTitle=Commercial proposal
ProposalCard=Proposal card
NewProp=New commercial proposal
NewPropal=New proposal
@ -63,6 +64,7 @@ ProposalLine=Proposal line
AvailabilityPeriod=Availability delay
SetAvailability=Set availability delay
AfterOrder=after order
OtherProposals=Other proposals
##### Availability #####
AvailabilityTypeAV_NOW=Immediate
AvailabilityTypeAV_1W=1 week

View File

@ -69,6 +69,7 @@ NoPredefinedProductToDispatch=No predefined products for this object. So no disp
DispatchVerb=Dispatch
StockLimitShort=Limit for alert
StockLimit=Stock limit for alert
StockLimitDesc="" (empty) default value means no alert. <br>"0" can be used with 'Stock can be negative' configuration.
PhysicalStock=Physical stock
RealStock=Real Stock
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
@ -192,4 +193,4 @@ InventoryFlushed=Inventory flushed
ExitEditMode=Exit edition
inventoryDeleteLine=Delete line
RegulateStock=Regulate Stock
ListInventory=List
ListInventory=List

View File

@ -7,20 +7,22 @@ WEBSITE_PAGENAME=Page name/alias
WEBSITE_HTML_HEADER=HTML Header
WEBSITE_CSS_URL=URL of external CSS file
WEBSITE_CSS_INLINE=CSS content
PageNameAliasHelp=Name or alias of the page.<br>This alias is also used to forge a SEO URL when website is read from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "<strong>%s</strong>" to edit this alias.
PageNameAliasHelp=Name or alias of the page.<br>This alias is also used to forge a SEO URL when website is ran from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "<strong>%s</strong>" to edit this alias.
MediaFiles=Media library
EditCss=Edit Style/CSS
EditCss=Edit Style/CSS or HTML header
EditMenu=Edit menu
EditPageMeta=Edit Meta
EditPageContent=Edit Content
EditPageSource=Edit HTML Source
EditPageContent=Edit with CKEditor
Website=Web site
Webpage=Web page
AddPage=Add page
Webpage=Web page/container
AddPage=Add page/container
HomePage=Home Page
PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page.
RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this.
PageDeleted=Page '%s' of website %s deleted
PageAdded=Page '%s' added
PageContent=Page/Contenair
PageDeleted=Page/Contenair '%s' of website %s deleted
PageAdded=Page/Contenair '%s' added
ViewSiteInNewTab=View site in new tab
ViewPageInNewTab=View page in new tab
SetAsHomePage=Set as Home page
@ -30,4 +32,12 @@ SetHereVirtualHost=If you can create, on your web server (Apache, Nginx, ...), a
PreviewSiteServedByWebServer=Preview %s in a new tab.<br><br>The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:<br><strong>%s</strong><br>URL served by external server:<br><strong>%s</strong>
PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.<br>The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.<br>URL served by Dolibarr:<br><strong>%s</strong><br><br>To use your own external web server to serve this web site, create a virtual host on your web server that point on directory<br><strong>%s</strong><br>then enter the name of this virtual server and click on the other preview button.
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
NoPageYet=No pages yet
NoPageYet=No pages yet
SyntaxHelp=Help on code syntax
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong>&lt;a href="/document.php?modulepart=medias&file=filename.ext"&gt;</strong>.
ClonePage=Clone page/container
CloneSite=Clone site
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.
PageIsANewTranslation=The new page is a translation of the current page ?
LanguageMustNotBeSameThanClonedPage=You clone a page as a translation. The language of the new page must be different than language of source page.

View File

@ -76,7 +76,7 @@ ThisWillAlsoAddPaymentOnInvoice=Ceci créera également les paiements sur les fa
StatisticsByLineStatus=Statistiques par statut des lignes
RUM=RUM
RUMLong=Référence Unique de Mandat
RUMWillBeGenerated=Le numéro de RUM sera généré une fois les informations de compte bancaire sont enregistrées
RUMWillBeGenerated=Si vide le numéro de RUM sera généré une fois les informations de compte bancaire sont enregistrées
WithdrawMode=Mode de prélévement (FRST ou RECUR)
WithdrawRequestAmount=Montant de la demande de prélèvement
WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement pour un montant nul

View File

@ -457,9 +457,7 @@ if (! defined('NOLOGIN'))
$passwordtotest = GETPOST('password','none',2);
$entitytotest = (GETPOST('entity','int') ? GETPOST('entity','int') : (!empty($conf->entity) ? $conf->entity : 1));
// Validation of login/pass/entity
// If ok, the variable login will be returned
// If error, we will put error message in session under the name dol_loginmesg
// Define if we received data to test the login.
$goontestloop=false;
if (isset($_SERVER["REMOTE_USER"]) && in_array('http',$authmode)) $goontestloop=true;
if ($dolibarr_main_authentication == 'forceuser' && ! empty($dolibarr_auto_user)) $goontestloop=true;
@ -473,6 +471,9 @@ if (! defined('NOLOGIN'))
$langs->setDefaultLang($langcode);
}
// Validation of login/pass/entity
// If ok, the variable login will be returned
// If error, we will put error message in session under the name dol_loginmesg
if ($test && $goontestloop)
{
$login = checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmode);
@ -531,9 +532,10 @@ if (! defined('NOLOGIN'))
// End test login / passwords
if (! $login || (in_array('ldap',$authmode) && empty($passwordtotest))) // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success.
{
// We show login page
// No data to test login, so we show the login page
dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit");
dol_loginfunction($langs,$conf,(! empty($mysoc)?$mysoc:''));
if (defined('NOREDIRECTBYMAINTOLOGIN')) return 'ERROR_NOT_LOGGED';
else dol_loginfunction($langs,$conf,(! empty($mysoc)?$mysoc:''));
exit;
}

Some files were not shown because too many files have changed in this diff Show More