Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/websites/index.php
This commit is contained in:
Florian HENRY 2016-05-02 20:27:34 +02:00
commit fda5e6002f
146 changed files with 2171 additions and 782 deletions

View File

@ -6,8 +6,8 @@ WARNING:
Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40. Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost. Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41/42/43 with error "Lost connection" You may also experience troubles with Mysql 5.5.41/42/43 with error "Lost connection" during
during migration. migration.
Upgrading to any other version or any other database system is abolutely required BEFORE trying Upgrading to any other version or any other database system is abolutely required BEFORE trying
make a Dolibarr upgrade. make a Dolibarr upgrade.
@ -25,6 +25,8 @@ Dolibarr 4.0 should be compatible with PHP 7 but more feedbacks are still expect
Following changes may create regression for some external modules, but were necessary to make Following changes may create regression for some external modules, but were necessary to make
Dolibarr better: Dolibarr better:
- Function log() of class CommandeFournisseur has been removed. Using it is no more required. - Function log() of class CommandeFournisseur has been removed. Using it is no more required.
- Class Resource was renamed into DolResource to avoid conflict with a reserved PHP word.
- Method commonobject->add_thumb() has been renamed into commonobject->addThumbs().
- Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount() - Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount()
- Property ->client that was deprecated 6 years ago, is replaced in all core code with ->thirdparty. - Property ->client that was deprecated 6 years ago, is replaced in all core code with ->thirdparty.
- File '/core/tpl/document_actions_pre_headers.tpl.php' were renamed into '/core/actions_linkedfiles.inc.php'. - File '/core/tpl/document_actions_pre_headers.tpl.php' were renamed into '/core/actions_linkedfiles.inc.php'.
@ -33,7 +35,6 @@ So if you included it into your module, change your code like this to be compati
if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; if (! $res) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
***** ChangeLog for 3.9.1 compared to 3.9.* ***** ***** ChangeLog for 3.9.1 compared to 3.9.* *****
FIX: #3815 Call to undefined function local_by_date() FIX: #3815 Call to undefined function local_by_date()
FIX: #4424 Missing email of user popup in supplier orders area FIX: #4424 Missing email of user popup in supplier orders area

View File

@ -379,7 +379,7 @@ if ($nboftargetok) {
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/) if ($ret =~ /(already exists|existe déjà)/)
{ {
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? "; print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>; $QUESTIONOVERWRITETAG=<STDIN>;

View File

@ -238,7 +238,7 @@ if ($result) {
$paymentsalstatic->ref = $links[$key]['url_id']; $paymentsalstatic->ref = $links[$key]['url_id'];
$paymentsalstatic->label = $links[$key]['label']; $paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
$tabtp[$obj->rowid][$account_employee ] += $obj->amount; $tabtp[$obj->rowid][$account_employee] += $obj->amount;
} else if ($links[$key]['type'] == 'banktransfert') { } else if ($links[$key]['type'] == 'banktransfert') {
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer"); $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
$tabtp[$obj->rowid][$account_transfer] += $obj->amount; $tabtp[$obj->rowid][$account_transfer] += $obj->amount;
@ -418,12 +418,27 @@ if ($action == 'export_csv') {
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
$reflabel = $val["ref"];
if ($reflabel == '(SupplierInvoicePayment)') {
$reflabel = $langs->trans('Supplier');
}
if ($reflabel == '(CustomerInvoicePayment)') {
$reflabel = $langs->trans('Customer');
}
if ($reflabel == '(SocialContributionPayment)') {
$reflabel = $langs->trans('SocialContribution');
}
if ($reflabel == '(DonationPayment)') {
$reflabel = $langs->trans('Donation');
}
if ($reflabel == '(SubscriptionPayment)') {
$reflabel = $langs->trans('Donation');
}
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
$companystatic->client = $tabcompany[$key]['code_client']; $companystatic->client = $tabcompany[$key]['code_client'];
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print $date . $sep; print $date . $sep;
@ -432,8 +447,12 @@ if ($action == 'export_csv') {
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep; if ($companystatic->name == '') {
print utf8_decode($val["ref"]) . $sep; print $langs->trans('Bank')." - ". utf8_decode($val["ref"]) . $sep;
} else {
print $langs->trans("Bank") .' - '.utf8_decode($companystatic->name) . $sep;
}
print utf8_decode($reflabel) . $sep;
print "\n"; print "\n";
} }
@ -443,33 +462,45 @@ if ($action == 'export_csv') {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $journal . $sep; print $journal . $sep;
if ($val["lib"] == '(SupplierInvoicePayment)') { if ($tabtype[$key] == 'payment') {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
} else {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
print length_accounta(html_entity_decode($k)) . $sep;
} else if ($tabtype[$key] == 'payment_supplier') {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
print length_accounta(html_entity_decode($k)) . $sep;
} else {
print length_accountg(html_entity_decode($k)) . $sep;
print $sep;
} }
print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep; if ($companystatic->name == '') {
print utf8_decode($val["ref"]) . $sep; print $langs->trans('ThirdParty')." - ". utf8_decode($val["ref"]) . $sep;
} else {
print $langs->trans('ThirdParty')." - ". utf8_decode($companystatic->name) . $sep;
}
print utf8_decode($reflabel) . $sep;
print "\n"; print "\n";
} }
} }
} else { } else {
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print $date . $sep; print $date . $sep;
print $journal . $sep; print $journal . $sep;
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep; if ($companystatic->name == '') {
print utf8_decode($val["ref"]) . $sep; print $langs->trans('ThirdParty')." - ". utf8_decode($val["ref"]) . $sep;
print "\n"; } else {
print $langs->trans('ThirdParty')." - ". utf8_decode($companystatic->name) . $sep;
} }
print utf8_decode($reflabel) . $sep;
print "\n";
} }
} }
}
} else { } else {
// Model Classic Export // Model Classic Export
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
@ -480,6 +511,7 @@ if ($action == 'export_csv') {
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep; print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
@ -488,7 +520,6 @@ if ($action == 'export_csv') {
} else { } else {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep; print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
} }
// print '"' . $langs->trans("Bank") . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n"; print "\n";
@ -498,10 +529,10 @@ if ($action == 'export_csv') {
if (is_array($tabtp[$key])) { if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep; print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
// print '"' . $companystatic->name . '"' . $sep;
if ($companystatic->name == '') { if ($companystatic->name == '') {
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($val["ref"]) . '"' . $sep; print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($val["ref"]) . '"' . $sep;
} else { } else {
@ -514,10 +545,10 @@ if ($action == 'export_csv') {
} }
} else { } else {
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print '"' . $journal . '"' . $sep;
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep; print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep; print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
// print '"' . $langs->trans("Bank") . '"' . $sep;
if ($companystatic->name == '') { if ($companystatic->name == '') {
print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($val["ref"]) . '"' . $sep; print '"' . $langs->trans("Bank") . ' - ' . utf8_decode($val["ref"]) . '"' . $sep;
} else { } else {
@ -599,6 +630,9 @@ else {
if ($reflabel == '(DonationPayment)') { if ($reflabel == '(DonationPayment)') {
$reflabel = $langs->trans('Donation'); $reflabel = $langs->trans('Donation');
} }
if ($reflabel == '(SubscriptionPayment)') {
$reflabel = $langs->trans('SubscriptionPayment');
}
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {

View File

@ -731,7 +731,9 @@ else
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyCurrency").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyCurrency").'</td><td>';
print currency_name($conf->currency,1); print currency_name($conf->currency,1);
print ' ('.$langs->getCurrencySymbol($conf->currency).')'; print ' ('.$conf->currency;
print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : '');
print ')';
print '</td></tr>'; print '</td></tr>';
$var=!$var; $var=!$var;

View File

@ -189,7 +189,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
$tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1"; $tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; $tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
$tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
$tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
@ -226,7 +226,7 @@ $tabsqlsort[28]="country ASC, code ASC";
$tabsqlsort[29]="position ASC"; $tabsqlsort[29]="position ASC";
$tabsqlsort[30]="code ASC"; $tabsqlsort[30]="code ASC";
$tabsqlsort[31]="pcg_version ASC"; $tabsqlsort[31]="pcg_version ASC";
$tabsqlsort[32]="code ASC, label ASC"; $tabsqlsort[32]="position ASC";
$tabsqlsort[33]="code ASC"; $tabsqlsort[33]="code ASC";
$tabsqlsort[34]="code ASC"; $tabsqlsort[34]="code ASC";
@ -263,7 +263,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
$tabfield[29]= "code,label,percent,position"; $tabfield[29]= "code,label,percent,position";
$tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfield[31]= "pcg_version,country_id,country,label"; $tabfield[31]= "pcg_version,country_id,country,label";
$tabfield[32]= "code,label,range,position,country_id,country"; $tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
$tabfield[33]= "code,label"; $tabfield[33]= "code,label";
$tabfield[34]= "code,label"; $tabfield[34]= "code,label";
@ -300,7 +300,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
$tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[29]= "code,label,percent,position";
$tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfieldvalue[31]= "pcg_version,country,label"; $tabfieldvalue[31]= "pcg_version,country,label";
$tabfieldvalue[32]= "code,label,range_account,position,country"; $tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
$tabfieldvalue[33]= "code,label"; $tabfieldvalue[33]= "code,label";
$tabfieldvalue[34]= "code,label"; $tabfieldvalue[34]= "code,label";
@ -337,7 +337,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country";
$tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[29]= "code,label,percent,position";
$tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfieldinsert[31]= "pcg_version,fk_pays,label"; $tabfieldinsert[31]= "pcg_version,fk_pays,label";
$tabfieldinsert[32]= "code,label,range_account,position,fk_country"; $tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
$tabfieldinsert[33]= "code,label"; $tabfieldinsert[33]= "code,label";
$tabfieldinsert[34]= "code,label"; $tabfieldinsert[34]= "code,label";
@ -524,6 +524,7 @@ if ($id == 11)
'propal' => $langs->trans('Proposal'), 'propal' => $langs->trans('Proposal'),
'commande' => $langs->trans('Order'), 'commande' => $langs->trans('Order'),
'facture' => $langs->trans('Bill'), 'facture' => $langs->trans('Bill'),
'resource' => $langs->trans('Resource'),
// 'facture_fourn' => $langs->trans('SupplierBill'), // 'facture_fourn' => $langs->trans('SupplierBill'),
'fichinter' => $langs->trans('InterventionCard') 'fichinter' => $langs->trans('InterventionCard')
); );
@ -585,6 +586,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ((! isset($_POST[$value]) || $_POST[$value]=='') if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
) )
@ -605,6 +607,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode'; if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible'; if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder'; if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
} }
@ -999,6 +1002,9 @@ if ($id)
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
if ($id == 2) // Special cas for state page if ($id == 2) // Special cas for state page
{ {
@ -1167,6 +1173,9 @@ if ($id)
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
// Affiche nom du champ // Affiche nom du champ
if ($showfield) if ($showfield)
@ -1248,7 +1257,7 @@ if ($id)
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
} }
} }
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') { else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
$valuetoshow=yn($valuetoshow); $valuetoshow=yn($valuetoshow);
$align="center"; $align="center";
} }
@ -1618,7 +1627,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print 'user<input type="hidden" name="type" value="user">'; print 'user<input type="hidden" name="type" value="user">';
print '</td>'; print '</td>';
} }
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') { elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
print '<td>'; print '<td>';
print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1);
print '</td>'; print '</td>';
@ -1697,7 +1706,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
if ($fieldlist[$field]=='position') $size='size="4" '; if ($fieldlist[$field]=='position') $size='size="4" ';
if ($fieldlist[$field]=='libelle') $size='centpercent'; if ($fieldlist[$field]=='libelle') $size='centpercent';
if ($fieldlist[$field]=='tracking') $class='centpercent'; if ($fieldlist[$field]=='tracking') $class='centpercent';
if ($fieldlist[$field]=='sortorder') $size='size="2" '; if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
print '<input type="text" '.$size.' class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">'; print '<input type="text" '.$size.' class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
print '</td>'; print '</td>';
} }

View File

@ -189,7 +189,19 @@ else
show_skin(null,1); show_skin(null,1);
print '<br>'."\n"; print '<br>'."\n";
print load_fiche_titre($langs->trans("TestSubmitForm"),'(mode='.$mode.')',''); $listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','Full');
$linkstomode='';
foreach($listofmodes as $newmode)
{
if ($linkstomode) $linkstomode.=' - ';
$linkstomode.='<a href="'.$_SERVER["PHP_SELF"].'?mode='.$newmode.'">';
if ($mode == $newmode) $linkstomode.='<strong>';
$linkstomode.=$newmode;
if ($mode == $newmode) $linkstomode.='</strong>';
$linkstomode.='</a>';
}
$linkstomode.='';
print load_fiche_titre($langs->trans("TestSubmitForm"),$linkstomode,'');
print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">'; print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">';
$uselocalbrowser=true; $uselocalbrowser=true;
$readonly=($mode=='dolibarr_readonly'?1:0); $readonly=($mode=='dolibarr_readonly'?1:0);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,6 +26,7 @@ require '../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("loan"); $langs->load("loan");
@ -76,6 +77,7 @@ if ($action == 'update')
llxHeader(); llxHeader();
$form = new Form($db); $form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup'); print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup');
@ -104,7 +106,14 @@ foreach ($list as $key)
// Value // Value
print '<td>'; print '<td>';
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">'; if (! empty($conf->accounting->enabled))
{
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
}
else
{
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
}
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -75,6 +75,7 @@ if ($action == 'update')
$menu->perms=$_POST['perms']; $menu->perms=$_POST['perms'];
$menu->target=$_POST['target']; $menu->target=$_POST['target'];
$menu->user=$_POST['user']; $menu->user=$_POST['user'];
$menu->fk_menu=$_POST['fk_menu'];
$result=$menu->update($user); $result=$menu->update($user);
if ($result > 0) if ($result > 0)
{ {
@ -275,6 +276,8 @@ if ($action == 'create')
print '<form action="./edit.php?action=add&menuId='.$_GET['menuId'].'" method="post" name="formmenucreate">'; print '<form action="./edit.php?action=add&menuId='.$_GET['menuId'].'" method="post" name="formmenucreate">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Id // Id
@ -368,8 +371,10 @@ if ($action == 'create')
print '</table>'; print '</table>';
dol_fiche_end();
// Boutons // Boutons
print '<br><div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
@ -387,6 +392,8 @@ elseif ($action == 'edit')
print '<input type="hidden" name="handler_origine" value="'.$menu_handler.'">'; print '<input type="hidden" name="handler_origine" value="'.$menu_handler.'">';
print '<input type="hidden" name="menuId" value="'.$_GET['menuId'].'">'; print '<input type="hidden" name="menuId" value="'.$_GET['menuId'].'">';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$menu = new Menubase($db); $menu = new Menubase($db);
@ -416,9 +423,9 @@ elseif ($action == 'edit')
// MenuId Parent // MenuId Parent
print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent').'</td>'; print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent').'</td>';
print '<td><input type="text" name="fk_menu" value="'.$menu->fk_menu.'" size=10></td>';
//$menu_handler //$menu_handler
//print '<td><input type="text" size="50" name="handler" value="all"></td>'; //print '<td><input type="text" size="50" name="handler" value="all"></td>';
print '<td>'.$menu->fk_menu.'</td>';
print '<td>'.$langs->trans('DetailMenuIdParent').'</td></tr>'; print '<td>'.$langs->trans('DetailMenuIdParent').'</td></tr>';
// Niveau // Niveau
@ -454,8 +461,10 @@ elseif ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end();
// Bouton // Bouton
print '<br><div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';

View File

@ -150,12 +150,30 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print load_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup');
// 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
// Show message
print '<br>';
$message='';
$url='<a href="'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword" target="_blank">'.$urlwithroot.'/api/index.php/login?login='.urlencode($user->login).'&password=yourpassword</a>';
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
$message.=img_picto('','object_globe.png').' '.$url;
print $message;
print '<br>';
print '<br>';
print $langs->trans("ListOfAvailableAPIs").':<br>';
foreach($listofapis['v1'] as $key => $val) foreach($listofapis['v1'] as $key => $val)
{ {
if ($key == 'login') continue;
if ($key) if ($key)
{ {
//print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n"; //print $key.' - '.$val['classname'].' - '.$val['fullpath']." - ".DOL_MAIN_URL_ROOT.'/api/index.php/'.strtolower(preg_replace('/Api$/','',$val['classname']))."/xxx<br>\n";
$url=DOL_MAIN_URL_ROOT.'/api/index.php/'.$key; $url=$urlwithroot.'/api/index.php/'.$key;
$url.='?api_key=token';
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n"; print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
} }

View File

@ -116,16 +116,13 @@ class DolibarrApiAccess implements iAuthenticate
else else
{ {
throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided"); throw new RestException(401, "Failed to login to API. No parameter 'api_key' provided");
//dol_syslog("Failed to login to API. No parameter key provided", LOG_DEBUG);
//return false;
} }
$userClass::setCacheIdentifier(static::$role); $userClass::setCacheIdentifier(static::$role);
Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess'; Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess';
$requirefortest = static::$requires;
$requirefortest = static::$requires; if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest);
if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest); return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
return in_array(static::$role, (array) static::$requirefortest) || static::$role == 'admin';
} }
/** /**

View File

@ -141,6 +141,8 @@ foreach ($modulesdir as $dir)
// TODO If not found, redirect to explorer // TODO If not found, redirect to explorer
// Call API (we suppose we found it)
$api->r->handle(); $api->r->handle();

View File

@ -207,9 +207,9 @@ class CommandeApi extends DolibarrApi
*/ */
function post($request_data = NULL) function post($request_data = NULL)
{ {
if(! DolibarrApiAccess::$user->rights->commande->creer) { if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401); throw new RestException(401, "Insuffisant rights");
} }
// Check mandatory fields // Check mandatory fields
$result = $this->_validate($request_data); $result = $this->_validate($request_data);
@ -224,7 +224,7 @@ class CommandeApi extends DolibarrApi
$this->commande->lines = $lines; $this->commande->lines = $lines;
} }
if(! $this->commande->create(DolibarrApiAccess::$user) ) { if(! $this->commande->create(DolibarrApiAccess::$user) ) {
throw new RestException(401); throw new RestException(500, "Error while creating order");
} }
return $this->commande->id; return $this->commande->id;

View File

@ -9,6 +9,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -2516,7 +2517,7 @@ class Commande extends CommonOrder
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null) function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null)
{ {
global $conf, $mysoc; global $conf, $mysoc, $langs;
dol_syslog(get_class($this)."::updateline id=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, date_start=$date_start, date_end=$date_end, type=$type, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, special_code=$special_code"); dol_syslog(get_class($this)."::updateline id=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, date_start=$date_start, date_end=$date_end, type=$type, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, special_code=$special_code");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -2585,6 +2586,26 @@ class Commande extends CommonOrder
$line = new OrderLine($this->db); $line = new OrderLine($this->db);
$line->fetch($rowid); $line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
unset($_POST['productid']);
unset($_POST['tva_tx']);
unset($_POST['price_ht']);
unset($_POST['qty']);
unset($_POST['buying_price']);
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
}
}
$staticline = clone $line; $staticline = clone $line;
$line->oldline = $staticline; $line->oldline = $staticline;

View File

@ -673,6 +673,12 @@ if ($resql)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
$notshippable=0;
$warning = 0;
$text_info='';
$text_warning='';
$nbprod=0;
if (! empty($arrayfields['c.ref']['checked'])) if (! empty($arrayfields['c.ref']['checked']))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
@ -696,15 +702,9 @@ if ($resql)
// Show shippable Icon (create subloop, so may be slow) // Show shippable Icon (create subloop, so may be slow)
if ($conf->stock->enabled) if ($conf->stock->enabled)
{ {
$notshippable=0; $langs->load("stocks");
$warning = 0; if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
$text_info=''; {
$text_warning='';
$nbprod=0;
$langs->load("stocks");
if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
{
$numlines = count($generic_commande->lines); // Loop on each line of order $numlines = count($generic_commande->lines); // Loop on each line of order
for ($lig=0; $lig < $numlines; $lig++) for ($lig=0; $lig < $numlines; $lig++)
{ {

View File

@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* *
@ -34,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbank.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbank.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("bills"); $langs->load("bills");
@ -675,7 +675,13 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Accountancy code // Accountancy code
print '<tr><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3">'.length_accountg($account->account_number).'</td></tr>'; print '<td colspan="3">';
if (! empty($conf->accounting->enabled)) {
print length_accountg($account->account_number).'</td></tr>';
} else {
print $account->account_number;
}
print '</td></tr>';
// Accountancy journal // Accountancy journal
if (! empty($conf->accounting->enabled)) if (! empty($conf->accounting->enabled))

View File

@ -7,6 +7,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -588,7 +589,7 @@ class Account extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account");
$result=$this->update(); $result=$this->update($user);
if ($result > 0) if ($result > 0)
{ {
$accline = new AccountLine($this->db); $accline = new AccountLine($this->db);
@ -1100,15 +1101,19 @@ class Account extends CommonObject
*/ */
public static function countAccountToReconcile() public static function countAccountToReconcile()
{ {
global $db, $conf, $langs; global $db, $conf, $user;
if ($user->societe_id) return 0; // protection pour eviter appel par utilisateur externe //Protection against external users
if ($user->societe_id) {
return 0;
}
$nb=0; $nb=0;
$sql = "SELECT COUNT(ba.rowid) as nb"; $sql = "SELECT COUNT(ba.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE ba.rappro > 0 and ba.clos = 0"; $sql.= " WHERE ba.rappro > 0 and ba.clos = 0";
$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")";
if (empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) $sql.= " AND ba.courant != 2"; if (empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) $sql.= " AND ba.courant != 2";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@ -136,7 +136,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print '</tr>'; print '</tr>';
$var=!$var; $var=!$var;
print '<tr class="liste_total">'; print '<tr class="liste_titre">';
print '<td align="left" colspan="5">'.$langs->trans("RemainderToPay").'</td>'; print '<td align="left" colspan="5">'.$langs->trans("RemainderToPay").'</td>';
print '<td align="right" class="nowrap">&nbsp;</td>'; print '<td align="right" class="nowrap">&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -3567,7 +3567,7 @@ else if ($id > 0 || ! empty($ref))
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount'); print $langs->trans('BankAccount');
print '<td>'; 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 '<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 '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';

View File

@ -14,6 +14,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -2540,6 +2541,19 @@ class Facture extends CommonInvoice
$line = new FactureLigne($this->db); $line = new FactureLigne($this->db);
$line->fetch($rowid); $line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
return -3;
}
}
$staticline = clone $line; $staticline = clone $line;
$line->oldline = $staticline; $line->oldline = $staticline;
@ -2592,7 +2606,7 @@ class Facture extends CommonInvoice
$this->line->array_options=$array_options; $this->line->array_options=$array_options;
} }
$result=$this->line->update(); $result=$this->line->update($user);
if ($result > 0) if ($result > 0)
{ {
// Reorder if child line // Reorder if child line
@ -2666,7 +2680,7 @@ class Facture extends CommonInvoice
$line->total_ttc = $tabprice[2]; $line->total_ttc = $tabprice[2];
$line->total_localtax1 = $tabprice[9]; $line->total_localtax1 = $tabprice[9];
$line->total_localtax2 = $tabprice[10]; $line->total_localtax2 = $tabprice[10];
$line->update(); $line->update($user);
$this->update_price(1); $this->update_price(1);
$this->db->commit(); $this->db->commit();
} }

View File

@ -153,6 +153,7 @@ $arrayfields=array(
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), 'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), 'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'am'=>array('label'=>$langs->trans("Received"), 'checked'=>0), 'am'=>array('label'=>$langs->trans("Received"), 'checked'=>0),
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), 'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@ -997,6 +998,7 @@ if ($resql)
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['am']['checked'])) print_liste_field_titre($arrayfields['am']['label'],$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['am']['checked'])) print_liste_field_titre($arrayfields['am']['label'],$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'rtp','',$param,'align="right"',$sortfield,$sortorder);
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
@ -1117,6 +1119,11 @@ if ($resql)
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['rtp']['checked']))
{
print '<td class="liste_titre" align="right">';
print '</td>';
}
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
@ -1195,6 +1202,7 @@ if ($resql)
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1); $notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1);
$paiement = $facturestatic->getSommePaiement(); $paiement = $facturestatic->getSommePaiement();
$remaintopay = $obj->total_ttc - $paiement;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
@ -1348,6 +1356,14 @@ if ($resql)
$totalarray['totalam'] += $paiement; $totalarray['totalam'] += $paiement;
} }
if (! empty($arrayfields['rtp']['checked']))
{
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay,0,$langs):'&nbsp;').'</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
$totalarray['totalrtp'] += $remaintopay;
}
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
@ -1425,6 +1441,7 @@ if ($resql)
elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>'; elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>'; elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>'; elseif ($totalarray['totalamfield'] == $i) print '<td align="right">'.price($totalarray['totalam']).'</td>';
elseif ($totalarray['totalrtpfield'] == $i) print '<td align="right">'.price($totalarray['totalrtp']).'</td>';
else print '<td></td>'; else print '<td></td>';
} }
print '</tr>'; print '</tr>';

View File

@ -382,7 +382,7 @@ print '</tr>';
* Charges sociales non deductibles * Charges sociales non deductibles
*/ */
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)</td></tr>'; print '<tr><td colspan="4">'.$langs->trans("SocialContributionsNondeductibles").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
@ -456,7 +456,7 @@ print '</tr>';
* Charges sociales deductibles * Charges sociales deductibles
*/ */
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)</td></tr>'; print '<tr><td colspan="4">'.$langs->trans("SocialContributionsDeductibles").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {

View File

@ -181,6 +181,8 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
// SQL request // SQL request
$catotal=0; $catotal=0;
$catotal_ht=0;
$qtytotal=0;
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
@ -401,6 +403,8 @@ if ($modecompta == 'CREANCES-DETTES')
// Total // Total
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>'; print '<td>'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($qtytotal).'</td>';
print '<td>&nbsp;</td>';
print '<td align="right">'.price($catotal_ht).'</td>'; print '<td align="right">'.price($catotal_ht).'</td>';
print '<td align="right">'.price($catotal).'</td>'; print '<td align="right">'.price($catotal).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';

View File

@ -108,6 +108,47 @@ class Contact extends CommonObject
$this->statut = 1; // By default, status is enabled $this->statut = 1; // By default, status is enabled
} }
/**
* Load indicators into this->nb for board
*
* @return int <0 if KO, >0 if OK
*/
function load_state_board()
{
global $user;
$this->nb=array();
$clause = "WHERE";
$sql = "SELECT count(sp.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (sp.fk_soc = s.rowid)";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql.= " WHERE sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= ' '.$clause.' s.entity IN ('.getEntity($this->element, 1).')';
$resql=$this->db->query($sql);
if ($resql)
{
while ($obj=$this->db->fetch_object($resql))
{
$this->nb["contacts"]=$obj->nb;
}
$this->db->free($resql);
return 1;
}
else
{
dol_print_error($this->db);
$this->error=$this->db->lasterror();
return -1;
}
}
/** /**
* Add a contact into database * Add a contact into database
* *

View File

@ -4561,7 +4561,7 @@ abstract class CommonObject
$productFournisseur = new ProductFournisseur($this->db); $productFournisseur = new ProductFournisseur($this->db);
if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0) if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0)
{ {
$buyPrice = $productFournisseur->fourn_price; $buyPrice = $productFournisseur->fourn_unitprice;
} }
else if ($result < 0) else if ($result < 0)
{ {

View File

@ -52,7 +52,7 @@ class DolEditor
* @param string $content Content of WYSIWIG field * @param string $content Content of WYSIWIG field
* @param int $width Width in pixel of edit area (auto by default) * @param int $width Width in pixel of edit area (auto by default)
* @param int $height Height in pixel of edit area (200px by default) * @param int $height Height in pixel of edit area (200px by default)
* @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', ') * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly')
* @param string $toolbarlocation Where bar is stored : * @param string $toolbarlocation Where bar is stored :
* 'In' each window has its own toolbar * 'In' each window has its own toolbar
* 'Out:name' share toolbar into the div called 'name' * 'Out:name' share toolbar into the div called 'name'
@ -148,7 +148,10 @@ class DolEditor
{ {
global $conf,$langs; global $conf,$langs;
$found=0; $fullpage=False;
$disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed
$found=0;
$out=''; $out='';
if ($this->tool == 'fckeditor') if ($this->tool == 'fckeditor')
@ -186,7 +189,8 @@ class DolEditor
customConfig : ckeditorConfig, customConfig : ckeditorConfig,
readOnly : '.($this->readonly?'true':'false').', readOnly : '.($this->readonly?'true':'false').',
htmlEncodeOutput :'.$htmlencode_force.', htmlEncodeOutput :'.$htmlencode_force.',
allowedContent :'.(empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)?'false':'true').', allowedContent :'.($disallowAnyContent?'false':'true').',
fullPage : '.($fullpage?'true':'false').',
toolbar: \''.$this->toolbarname.'\', toolbar: \''.$this->toolbarname.'\',
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').', width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',

View File

@ -390,6 +390,7 @@ class Form
* @param int $noencodehtmltext Do not encode into html entity the htmltext * @param int $noencodehtmltext Do not encode into html entity the htmltext
* @return string Code html du tooltip (texte+picto) * @return string Code html du tooltip (texte+picto)
* @see Use function textwithpicto if you can. * @see Use function textwithpicto if you can.
* TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip
*/ */
function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0) function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0)
{ {
@ -2400,10 +2401,10 @@ class Form
$form.= $opt; $form.= $opt;
$i++; $i++;
} }
$form.= '</select>';
$this->db->free($result);
} }
$form.= '</select>';
$this->db->free($result);
return $form; return $form;
} }
else else

View File

@ -805,6 +805,7 @@ class FormOther
$select_week .= '<option value="'.$key.'">'; $select_week .= '<option value="'.$key.'">';
} }
$select_week .= $val; $select_week .= $val;
$select_week .= '</option>';
} }
$select_week .= '</select>'; $select_week .= '</select>';
return $select_week; return $select_week;
@ -844,6 +845,7 @@ class FormOther
$select_month .= '<option value="'.$key.'">'; $select_month .= '<option value="'.$key.'">';
} }
$select_month .= $val; $select_month .= $val;
$select_month .= '</option>';
} }
$select_month .= '</select>'; $select_month .= '</select>';
return $select_month; return $select_month;

View File

@ -908,7 +908,8 @@ class Translate
} }
/** /**
* Return a currency code into its symbol * Return a currency code into its symbol.
* If mb_convert_encoding is not available, return currency code.
* *
* @param string $currency_code Currency code * @param string $currency_code Currency code
* @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency.

View File

@ -19,15 +19,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
define('NOTOKENRENEWAL',1); // Disables token renewal //define('NOTOKENRENEWAL',1); // Disables token renewal
//require '../../../../main.inc.php';
require '../../connectors/php/config.php'; // This include the define('NOTOKENRENEWAL',1) and the require main.in.php
global $Config;
require '../../../../main.inc.php';
?> ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd"> "http://www.w3.org/TR/html4/frameset.dtd">
<html> <html>
<head> <head>
<title>FCKeditor - Resources Browser</title> <title><?php echo $langs->trans("MediaBrowser").' - '.$Config['UserFilesAbsolutePathRelative']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/fckxml.js"></script> <script type="text/javascript" src="js/fckxml.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -23,6 +23,7 @@
*/ */
global $Config ; global $Config ;
global $website;
define('NOTOKENRENEWAL',1); // Disables token renewal define('NOTOKENRENEWAL',1); // Disables token renewal
@ -44,13 +45,15 @@ $Config['Enabled'] = true ;
// Path to user files relative to the document root. // Path to user files relative to the document root.
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&file=' ; $Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ;
$Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website));
// Fill the following value it you prefer to specify the absolute path for the // Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful if you are using a virtual directory, symbolic // user files directory. Useful if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory. // Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root . (!empty($entity) ? '/' . $entity : '') . '/fckeditor/'; $Config['UserFilesAbsolutePath'] = $dolibarr_main_data_root . $Config['UserFilesAbsolutePathRelative'];
// Due to security issues with Apache modules, it is recommended to leave the // Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled. // following setting enabled.
@ -64,7 +67,7 @@ $Config['SecureImageUploads'] = true;
$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder'); $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder');
// Allowed Resource Types. // Allowed Resource Types.
$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media'); $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Media');
// For security, HTML is allowed in the first Kb of data for files having the // For security, HTML is allowed in the first Kb of data for files having the
// following extensions only. // following extensions only.
@ -75,11 +78,19 @@ $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js");
// If possible, it is recommended to set more restrictive permissions, like 0755. // If possible, it is recommended to set more restrictive permissions, like 0755.
// Set to 0 to disable this feature. // Set to 0 to disable this feature.
// Note: not needed on Windows-based servers. // Note: not needed on Windows-based servers.
$Config['ChmodOnUpload'] = 0775 ; $newmask = '0644';
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
$Config['ChmodOnUpload'] = $newmask;
// See comments above. // See comments above.
// Used when creating folders that does not exist. // Used when creating folders that does not exist.
$Config['ChmodOnFolderCreate'] = 0775 ; $newmask = '0755';
$dirmaskdec=octdec($newmask);
if (! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK);
$dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files
$newmask = decoct($dirmaskdec);
$Config['ChmodOnFolderCreate'] = $newmask;
/* /*
Configuration settings for each Resource Type Configuration settings for each Resource Type

View File

@ -42,7 +42,7 @@ function SendError($number, $text)
// Check if this uploader has been enabled. // Check if this uploader has been enabled.
if ( !$Config['Enabled'] ) if ( !$Config['Enabled'] )
SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file'); SendUploadResults('1', '', '', 'This file uploader is disabled. Please check the "filemanagerdol/connectors/php/config.php" file');
$sCommand = 'QuickUpload' ; $sCommand = 'QuickUpload' ;

View File

@ -346,7 +346,8 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
'DB_ERROR_NO_INDEX_TO_DROP', 'DB_ERROR_NO_INDEX_TO_DROP',
'DB_ERROR_CANNOT_CREATE', // Qd contrainte deja existante 'DB_ERROR_CANNOT_CREATE', // Qd contrainte deja existante
'DB_ERROR_CANT_DROP_PRIMARY_KEY', 'DB_ERROR_CANT_DROP_PRIMARY_KEY',
'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS' 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS',
'DB_ERROR_22P02'
); );
if ($okerror == 'none') $okerrors=array(); if ($okerror == 'none') $okerrors=array();

View File

@ -291,14 +291,15 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt
needtotrigger="#" + fields[i]; needtotrigger="#" + fields[i];
} }
} }
}
if (needtotrigger != "") // To force select2 to refresh visible content if (needtotrigger != "") // To force select2 to refresh visible content
{ {
// We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done
// This is required for example when changing zip with autocomplete that change the country // This is required for example when changing zip with autocomplete that change the country
jQuery(needtotrigger).delay(500).queue(function() { jQuery(needtotrigger).delay(500).queue(function() {
jQuery(needtotrigger).trigger("change"); jQuery(this).trigger("change");
}); });
}
} }
} }
}); });

View File

@ -2,6 +2,8 @@
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -67,6 +69,15 @@ function fichinter_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention'); complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention');
// Tab to link resources
if ($conf->resource->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
$head[$h][2] = 'resource';
$h++;
}
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{ {
$nbNote = 0; $nbNote = 0;

View File

@ -2213,8 +2213,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
// Wrapping for import module // Wrapping for import module
else if ($modulepart == 'import') else if ($modulepart == 'import')
{ {
// Aucun test necessaire car on force le rep de download sur
// le rep export qui est propre a l'utilisateur
$accessallowed=1; $accessallowed=1;
$original_file=$conf->import->dir_temp.'/'.$original_file; $original_file=$conf->import->dir_temp.'/'.$original_file;
} }
@ -2222,13 +2220,19 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
// Wrapping pour l'editeur wysiwyg // Wrapping pour l'editeur wysiwyg
else if ($modulepart == 'editor') else if ($modulepart == 'editor')
{ {
// Aucun test necessaire car on force le rep de download sur
// le rep export qui est propre a l'utilisateur
$accessallowed=1; $accessallowed=1;
$original_file=$conf->fckeditor->dir_output.'/'.$original_file; $original_file=$conf->fckeditor->dir_output.'/'.$original_file;
} }
// Wrapping pour les backups // Wrapping for miscellaneous medias files
elseif ($modulepart == 'medias')
{
$accessallowed=1;
global $dolibarr_main_data_root;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
}
// Wrapping for backups
else if ($modulepart == 'systemtools') else if ($modulepart == 'systemtools')
{ {
if ($fuser->admin) if ($fuser->admin)

View File

@ -71,7 +71,8 @@ function jsUnEscape($source)
/** /**
* Return list of modules directories * Return list of modules directories. We detect directories that contains a subdirectory /core/modules
* We discard directory modules that contains 'disabled' into their name.
* *
* @param string $subdir Sub directory (Example: '/mailings') * @param string $subdir Sub directory (Example: '/mailings')
* @return array Array of directories that can contains module descriptors * @return array Array of directories that can contains module descriptors
@ -95,6 +96,8 @@ function dolGetModulesDirs($subdir='')
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (preg_match('/disabled/',$file)) continue; // We discard module if it contains disabled into name.
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{ {
if (is_dir($dirroot . '/' . $file . '/core/modules'.$subdir.'/')) if (is_dir($dirroot . '/' . $file . '/core/modules'.$subdir.'/'))
@ -1963,6 +1966,11 @@ function getElementProperties($element_type)
$module='ficheinter'; $module='ficheinter';
$subelement='fichinter'; $subelement='fichinter';
} }
if ($element_type == 'dolresource') {
$classpath = 'resource/class';
$module='resource';
$subelement='dolresource';
}
$classfile = strtolower($subelement); $classfile = strtolower($subelement);
$classname = ucfirst($subelement); $classname = ucfirst($subelement);

View File

@ -1,6 +1,7 @@
<?php <?php
/* Module to manage locations, buildings, floors and rooms into Dolibarr ERP/CRM /* Module to manage locations, buildings, floors and rooms into Dolibarr ERP/CRM
* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,7 +29,7 @@
* @param Object $object Object * @param Object $object Object
* @return array Array of head entries * @return array Array of head entries
*/ */
function resourcePrepareHead($object) function resource_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$h = 0; $h = 0;
@ -36,15 +37,50 @@ function resourcePrepareHead($object)
$head[$h][0] = dol_buildpath('/resource/card.php',1).'?id='.$object->id; $head[$h][0] = dol_buildpath('/resource/card.php',1).'?id='.$object->id;
$head[$h][1] = $langs->trans("ResourceCard"); $head[$h][1] = $langs->trans("ResourceCard");
$head[$h][2] = 'resource'; $head[$h][2] = 'resource';
$h++; $h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('Contact');
$head[$h][2] = 'contact';
$h++;
}
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'resource'); complete_head_from_modules($conf,$langs,$object,$head,$h,'resource');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = 0;
if(!empty($object->note_private)) $nbNote++;
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/resource/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'note';
$h++;
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/resource/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' <span class="badge">'.$nbFiles.'</span>';
$head[$h][2] = 'documents';
$h++;
/*$head[$h][0] = DOL_URL_ROOT.'/resource/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;*/
complete_head_from_modules($conf,$langs,$object,$head,$h,'resource', 'remove');
return $head; return $head;
} }

View File

@ -1009,7 +1009,12 @@ class DolibarrModules // Can not be abstract, because we need to insta
if (! $err) if (! $err)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, label, jobtype, classesname, objectname, methodename, command, params, note, frequency, unitfrequency, priority, status, entity, test)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, label, jobtype, classesname, objectname, methodename, command, params, note,";
if(is_int($frequency)){ $sql.= ' frequency,'; }
if(is_int($unitfrequency)){ $sql.= ' unitfrequency,'; }
if(is_int($priority)){ $sql.= ' priority,'; }
if(is_int($status)){ $sql.= ' status,'; }
$sql.= " entity, test)";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "'".$this->db->escape($this->rights_class)."', "; $sql.= "'".$this->db->escape($this->rights_class)."', ";
$sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->idate($now)."', ";
@ -1022,10 +1027,10 @@ class DolibarrModules // Can not be abstract, because we need to insta
$sql.= ($command?"'".$this->db->escape($command)."'":"null").","; $sql.= ($command?"'".$this->db->escape($command)."'":"null").",";
$sql.= ($parameters?"'".$this->db->escape($parameters)."'":"null").","; $sql.= ($parameters?"'".$this->db->escape($parameters)."'":"null").",";
$sql.= ($comment?"'".$this->db->escape($comment)."'":"null").","; $sql.= ($comment?"'".$this->db->escape($comment)."'":"null").",";
$sql.= "'".$this->db->escape($frequency)."', "; if(is_int($frequency)){ $sql.= "'".$this->db->escape($frequency)."', "; }
$sql.= "'".$this->db->escape($unitfrequency)."', "; if(is_int($unitfrequency)){ $sql.= "'".$this->db->escape($unitfrequency)."', "; }
$sql.= "'".$this->db->escape($priority)."', "; if(is_int($priority)) {$sql.= "'".$this->db->escape($priority)."', ";}
$sql.= "'".$this->db->escape($status)."', "; if(is_int($status)){ $sql.= "'".$this->db->escape($status)."', "; }
$sql.= $conf->entity.","; $sql.= $conf->entity.",";
$sql.= "'".$this->db->escape($test)."'"; $sql.= "'".$this->db->escape($test)."'";
$sql.= ")"; $sql.= ")";

View File

@ -240,7 +240,7 @@ class ExportCsv extends ModeleExports
$this->col=0; $this->col=0;
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code); if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-','(',')'),'_',$code);
else $alias=substr($code, strpos($code, ' as ') + 4); else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('','Bad value for field with key='.$code.'. Try to redefine export.'); if (empty($alias)) dol_print_error('','Bad value for field with key='.$code.'. Try to redefine export.');

View File

@ -319,7 +319,7 @@ class ExportExcel extends ModeleExports
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code); if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-','(',')'),'_',$code);
else $alias=substr($code, strpos($code, ' as ') + 4); else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
$newvalue=$objp->$alias; $newvalue=$objp->$alias;

View File

@ -215,7 +215,7 @@ class ExportTsv extends ModeleExports
$this->col=0; $this->col=0;
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code); if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-','(',')'),'_',$code);
else $alias=substr($code, strpos($code, ' as ') + 4); else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');

View File

@ -57,7 +57,7 @@ class modFckeditor extends DolibarrModules
$this->picto='list'; $this->picto='list';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/fckeditor/temp","/fckeditor/image"); $this->dirs = array("/medias/temp","/medias/image");
// Config pages // Config pages
$this->config_page_url = array("fckeditor.php"); $this->config_page_url = array("fckeditor.php");
@ -65,7 +65,7 @@ class modFckeditor extends DolibarrModules
// Dependencies // Dependencies
$this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) $this->disabled = (in_array(constant('JS_CKEDITOR'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array('modWebsites');
// Constants // Constants
$this->const = array(); $this->const = array();

View File

@ -164,6 +164,7 @@ class modProduct extends DolibarrModules
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product','pf.ref_fourn'=>'product','pf.unitprice'=>'product')); if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product','pf.ref_fourn'=>'product','pf.unitprice'=>'product'));
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('l.lang'=>'translation', 'l.label'=>'translation','l.description'=>'translation','l.note'=>'translation')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('l.lang'=>'translation', 'l.label'=>'translation','l.description'=>'translation','l.note'=>'translation'));
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('group_concat(cat.label)'=>'Categories'));
$keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra'; $keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -260,6 +260,7 @@ class modSociete extends DolibarrModules
$this->export_fields_array[$r]+=array('u.login'=>'SaleRepresentativeLogin','u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname'); $this->export_fields_array[$r]+=array('u.login'=>'SaleRepresentativeLogin','u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Numeric",'s.client'=>"Numeric",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Numeric",'s.client'=>"Numeric",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text','u.login'=>'Text','u.firstname'=>'Text','u.lastname'=>'Text');
$this->export_entities_array[$r]=array('u.login'=>'user','u.firstname'=>'user','u.lastname'=>'user'); // We define here only fields that use another picto $this->export_entities_array[$r]=array('u.login'=>'user','u.firstname'=>'user','u.lastname'=>'user'); // We define here only fields that use another picto
$this->export_examplevalues_array[$r]=array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 (not a supplier) or 1 (supplier)'); $this->export_examplevalues_array[$r]=array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 (not a supplier) or 1 (supplier)');
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -58,8 +58,8 @@ class modWebsites extends DolibarrModules
// Name of image file used for this module. // Name of image file used for this module.
$this->picto='globe'; $this->picto='globe';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array("/websites/temp");
// Config pages // Config pages
//------------- //-------------
@ -68,7 +68,7 @@ class modWebsites extends DolibarrModules
// Dependancies // Dependancies
//------------- //-------------
$this->hidden = ! empty($conf->global->WEBSITE_MODULE_DISABLED); // A condition to disable module $this->hidden = ! empty($conf->global->WEBSITE_MODULE_DISABLED); // A condition to disable module
$this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array(); // List of modules id this module is in conflict with $this->conflictwith = array(); // List of modules id this module is in conflict with
$this->langfiles = array("websites"); $this->langfiles = array("websites");

View File

@ -255,12 +255,15 @@ $coldisplay=-1; // We remove first td
<script type="text/javascript"> <script type="text/javascript">
<?php jQuery(document).ready(function()
if (! empty($conf->margin->enabled))
{ {
?> jQuery("#price_ht").keyup(function() { jQuery("#price_ttc").val(''); });
jQuery(document).ready(function() jQuery("#price_ttc").keyup(function() { jQuery("#price_ht").val(''); });
{
<?php
if (! empty($conf->margin->enabled))
{
?>
/* Add rule to clear margin when we change some data, so when we change sell or buy price, margin will be recalculated after submitting form */ /* Add rule to clear margin when we change some data, so when we change sell or buy price, margin will be recalculated after submitting form */
jQuery("#tva_tx").click(function() { /* somtimes field is a text, sometimes a combo */ jQuery("#tva_tx").click(function() { /* somtimes field is a text, sometimes a combo */
jQuery("input[name='np_marginRate']:first").val(''); jQuery("input[name='np_marginRate']:first").val('');
@ -323,86 +326,10 @@ if (! empty($conf->margin->enabled))
$('#buying_price').show(); $('#buying_price').show();
} }
}, 'json'); }, 'json');
<?php
/* Add rules to reset price_ht from margin info */ }
<?php ?>
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD)) });
{
?>
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_marginRate']:first").blur(function(e) {
return checkEditLine(e, "np_marginRate");
});*/
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES) && !empty($conf->global->MARGIN_RESET_HT_FROM_MARGIN_FIELD))
{
?>
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_markRate']:first").blur(function(e) {
return checkEditLine(e, "np_markRate");
});*/
<?php
}
?>
});
/* If margin rate field empty, do nothing. */
/* Force content of price_ht to 0 or if a discount is set, recalculate it from margin rate */
/* TODO This function seems no more used */
function checkEditLine(e, npRate)
{
var buying_price = $("input[name='buying_price']:first");
var remise = $("input[name='remise_percent']:first");
var rate = $("input[name='"+npRate+"']:first");
if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true;
if (! $.isNumeric(rate.val().replace(' ','').replace(',','.')))
{
alert('<?php echo $langs->transnoentitiesnoconv("rateMustBeNumeric"); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "np_markRate" && rate.val() > 100)
{
alert('<?php echo $langs->transnoentitiesnoconv("markRateShouldBeLesserThan100"); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
var price = 0;
remisejs=price2numjs(remise.val());
if (remisejs != 100)
{
bpjs=price2numjs(buying_price.val());
ratejs=price2numjs(rate.val());
/* console.log(npRate+" - "+bpjs+" - "+ratejs); */
if (npRate == "np_marginRate")
price = ((bpjs * (1 + (ratejs / 100))) / (1 - remisejs / 100));
else if (npRate == "np_markRate")
{
if (ratejs != 100) // If markRate is 100, it means buying price is 0, so it is not possible to retreive price from it and markRate. We keep it unchange
{
price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100));
}
else price=$("input[name='price_ht']:first").val();
}
}
/* console.log("new price ht = "+price); */
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
return true;
}
<?php
}
?>
</script> </script>
<!-- END PHP TEMPLATE objectline_edit.tpl.php --> <!-- END PHP TEMPLATE objectline_edit.tpl.php -->

View File

@ -13,7 +13,7 @@ $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$out .= '<input type="hidden" name="action" value="add_element_resource">'; $out .= '<input type="hidden" name="action" value="add_element_resource">';
$out .= '<input type="hidden" name="element" value="'.$element.'">'; $out .= '<input type="hidden" name="element" value="'.$element.'">';
$out .= '<input type="hidden" name="element_id" value="'.$element_id.'">'; $out .= '<input type="hidden" name="element_id" value="'.$element_id.'">';
$out .= '<input type="hidden" name="resource_type" value="'.(empty($resource_type) ? 'resource' : $resource_type).'">'; $out .= '<input type="hidden" name="resource_type" value="'.(empty($resource_type) ? 'dolresource' : $resource_type).'">';
// Place // Place

View File

@ -14,11 +14,9 @@ Then create the symbolic link
ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule
WARNING !!! WARNING !!!
You must also enable the custom directory into dolibarr conf/conf.php file by adding the following Check also that the custom directory into dolibarr conf/conf.php file by adding the following
two lines, so dolibarr will also scan this directories to find external external modules: two lines, so dolibarr will also scan this directories to find external external modules:
$dolibarr_main_url_root_alt='/custom'; $dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; $dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/';
(This is not enabled by default because enabling external module may slow down application)

View File

@ -65,6 +65,7 @@ $entity=GETPOST('entity')?GETPOST('entity','int'):$conf->entity;
// Security check // Security check
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
if ($modulepart == 'fckeditor') $modulepart='medias'; // For backward compatibility
$socid=0; $socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id; if ($user->societe_id > 0) $socid = $user->societe_id;
@ -97,7 +98,7 @@ if (preg_match('/\.(html|htm)$/i',$original_file)) $attachment = false;
if (isset($_GET["attachment"])) $attachment = GETPOST("attachment")?true:false; if (isset($_GET["attachment"])) $attachment = GETPOST("attachment")?true:false;
if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false; if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
// Suppression de la chaine de caractere ../ dans $original_file // Security: Delete string ../ into $original_file
$original_file = str_replace("../","/", $original_file); $original_file = str_replace("../","/", $original_file);
// Find the subdirectory name as the reference // Find the subdirectory name as the reference
@ -169,7 +170,6 @@ if (! file_exists($original_file_osencoded))
} }
// Permissions are ok and file found, so we return it // Permissions are ok and file found, so we return it
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
if ($encoding) header('Content-Encoding: '.$encoding); if ($encoding) header('Content-Encoding: '.$encoding);
if ($type) header('Content-Type: '.$type.(preg_match('/text/',$type)?'; charset="'.$conf->file->character_set_client:'')); if ($type) header('Content-Type: '.$type.(preg_match('/text/',$type)?'; charset="'.$conf->file->character_set_client:''));

View File

@ -878,16 +878,14 @@ class Expedition extends CommonObject
$product=new Product($this->db); $product=new Product($this->db);
$result=$product->fetch($fk_product); $result=$product->fetch($fk_product);
$product_type=$product->type;
if ($entrepot_id > 0) { if ($entrepot_id > 0) {
$product->load_stock(); $product->load_stock();
$product_stock = $product->stock_warehouse[$entrepot_id]->real; $product_stock = $product->stock_warehouse[$entrepot_id]->real;
} }
else else
{ $product_stock = $product->stock_reel;
$product_stock = $product->stock_reel;
}
$product_type=$product->type;
if ($product_type == 0 && $product_stock < $qty) if ($product_type == 0 && $product_stock < $qty)
{ {
$this->error=$langs->trans('ErrorStockIsNotEnough'); $this->error=$langs->trans('ErrorStockIsNotEnough');

View File

@ -1625,7 +1625,7 @@ else
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' WHERE fde.fk_expensereport = '.$object->id; $sql.= ' WHERE fde.fk_expensereport = '.$object->id;
@ -1691,7 +1691,7 @@ else
} }
print '</td>'; print '</td>';
} }
print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper($objp->type_fees_libelle)).'</td>'; print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
print '<td style="text-align:left;">'.$objp->comments.'</td>'; print '<td style="text-align:left;">'.$objp->comments.'</td>';
print '<td style="text-align:right;">'.vatrate($objp->vatrate,true).'</td>'; print '<td style="text-align:right;">'.vatrate($objp->vatrate,true).'</td>';
print '<td style="text-align:right;">'.price($objp->value_unit).'</td>'; print '<td style="text-align:right;">'.price($objp->value_unit).'</td>';

View File

@ -746,7 +746,7 @@ class ExpenseReport extends CommonObject
$sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,';
$sql.= ' p.ref as ref_projet, p.title as title_projet'; $sql.= ' p.ref as ref_projet, p.title as title_projet';
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid';
$sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id; $sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id;
@ -776,7 +776,7 @@ class ExpenseReport extends CommonObject
$deplig->total_tva = $objp->total_tva; $deplig->total_tva = $objp->total_tva;
$deplig->total_ttc = $objp->total_ttc; $deplig->total_ttc = $objp->total_ttc;
$deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_code = empty($objp->code_type_fees)?'TF_OTHER':$objp->code_type_fees;
$deplig->type_fees_libelle = $objp->libelle_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees;
$deplig->tva_tx = $objp->tva_tx; $deplig->tva_tx = $objp->tva_tx;
$deplig->vatrate = $objp->tva_tx; $deplig->vatrate = $objp->tva_tx;
@ -850,12 +850,9 @@ class ExpenseReport extends CommonObject
{ {
global $conf,$langs; global $conf,$langs;
$this->oldref = $this->ref;
$expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR; $expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR;
// Sélection du numéro de ref suivant
$ref_next = $this->getNextNumRef();
$ref_number_int = ($this->ref+1)-1;
// Sélection de la date de début de la NDF // Sélection de la date de début de la NDF
$sql = 'SELECT date_debut'; $sql = 'SELECT date_debut';
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
@ -864,12 +861,48 @@ class ExpenseReport extends CommonObject
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$this->date_debut = $this->db->jdate($objp->date_debut); $this->date_debut = $this->db->jdate($objp->date_debut);
// Création du ref_number suivant $update_number_int = false;
if($ref_next)
// Create next ref if ref is PROVxx
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{ {
$prefix="ER"; // Sélection du numéro de ref suivant
if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX; $ref_next = $this->getNextNumRef();
$this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); $ref_number_int = ($this->ref+1)-1;
$update_number_int = true;
// Création du ref_number suivant
if($ref_next)
{
$prefix="ER";
if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX;
$this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d');
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// We rename directory in order to avoid losing the attachments
$oldref = dol_sanitizeFileName($this->oldref);
$newref = dol_sanitizeFileName($this->ref);
$dirsource = $conf->expensereport->dir_output.'/'.$oldref;
$dirdest = $conf->expensereport->dir_output.'/'.$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
dol_syslog("Rename ok");
// Rename docs starting with $oldref with $newref
$listoffiles=dol_dir_list($conf->expensereport->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
foreach($listoffiles as $fileentry)
{
$dirsource=$fileentry['name'];
$dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource);
$dirsource=$fileentry['path'].'/'.$dirsource;
$dirdest=$fileentry['path'].'/'.$dirdest;
@rename($dirsource, $dirdest);
}
}
}
} }
if ($this->fk_statut != 2) if ($this->fk_statut != 2)
@ -877,8 +910,10 @@ class ExpenseReport extends CommonObject
$now = dol_now(); $now = dol_now();
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET ref = '".$this->ref."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."',"; $sql.= " SET ref = '".$this->ref."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."'";
$sql.= " ref_number_int = ".$ref_number_int; if ($update_number_int) {
$sql.= ", ref_number_int = ".$ref_number_int;
}
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -1265,7 +1300,9 @@ class ExpenseReport extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE p.rowid = ".$projet_id; $sql.= " WHERE p.rowid = ".$projet_id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$objp_projet = $this->db->fetch_object($result); if ($result) {
$objp_projet = $this->db->fetch_object($result);
}
$ligne->projet_ref = $objp_projet->ref_projet; $ligne->projet_ref = $objp_projet->ref_projet;
$ligne->projet_title = $objp_projet->title_projet; $ligne->projet_title = $objp_projet->title_projet;

View File

@ -225,7 +225,7 @@ class Export
else $i++; else $i++;
if (strpos($key, ' as ')===false) { if (strpos($key, ' as ')===false) {
$newfield=$key.' as '.str_replace(array('.', '-'),'_',$key); $newfield=$key.' as '.str_replace(array('.', '-','(',')'),'_',$key);
} else { } else {
$newfield=$key; $newfield=$key;
} }
@ -587,14 +587,14 @@ class Export
if ($this->array_export_special[$indice][$key]=='NULLIFNEG') if ($this->array_export_special[$indice][$key]=='NULLIFNEG')
{ {
//$alias=$this->array_export_alias[$indice][$key]; //$alias=$this->array_export_alias[$indice][$key];
$alias=str_replace(array('.', '-'),'_',$key); $alias=str_replace(array('.', '-','(',')'),'_',$key);
if ($objp->$alias < 0) $objp->$alias=''; if ($objp->$alias < 0) $objp->$alias='';
} }
// Operation ZEROIFNEG // Operation ZEROIFNEG
if ($this->array_export_special[$indice][$key]=='ZEROIFNEG') if ($this->array_export_special[$indice][$key]=='ZEROIFNEG')
{ {
//$alias=$this->array_export_alias[$indice][$key]; //$alias=$this->array_export_alias[$indice][$key];
$alias=str_replace(array('.', '-'),'_',$key); $alias=str_replace(array('.', '-','(',')'),'_',$key);
if ($objp->$alias < 0) $objp->$alias='0'; if ($objp->$alias < 0) $objp->$alias='0';
} }
} }

View File

@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("exports"); $langs->load("exports");
$langs->load("users"); $langs->load("users");
$langs->load("companies"); $langs->load("companies");
$langs->load("projects");
// Everybody should be able to go on this page // Everybody should be able to go on this page
//if (! $user->admin) //if (! $user->admin)

View File

@ -89,6 +89,46 @@ class Fichinter extends CommonObject
$this->statuts_logo[3]='statut4'; $this->statuts_logo[3]='statut4';
} }
/**
* Load indicators into this->nb for board
*
* @return int <0 if KO, >0 if OK
*/
function load_state_board()
{
global $user;
$this->nb=array();
$clause = "WHERE";
$sql = "SELECT count(fi.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as fi";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON fi.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql.= " WHERE sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element, 1).")";
$resql=$this->db->query($sql);
if ($resql)
{
while ($obj=$this->db->fetch_object($resql))
{
$this->nb["fichinters"]=$obj->nb;
}
$this->db->free($resql);
return 1;
}
else
{
dol_print_error($this->db);
$this->error=$this->db->error();
return -1;
}
}
/** /**
* Create an intervention into data base * Create an intervention into data base

View File

@ -7,7 +7,7 @@
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* *
@ -694,7 +694,16 @@ class FactureFournisseur extends CommonInvoice
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (!$resql) {
$error++;
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->errors[] = $langs->trans('ErrorRefAlreadyExists');
} else {
$this->errors[] = "Error ".$this->db->lasterror();
}
}
if (! $error) if (! $error)
{ {

View File

@ -247,8 +247,11 @@ if (empty($reshook))
// Set supplier ref // Set supplier ref
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{ {
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); $object->ref_supplier = GETPOST('ref_supplier', 'alpha');
if ($result < 0) dol_print_error($db, $object->error);
if ($object->update($user) < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
} }
// payments conditions // payments conditions

View File

@ -225,10 +225,19 @@ if ($search_amount_all_tax != '')
$sql .= natural_search('fac.total_ttc', $search_amount_all_tax, 1); $sql .= natural_search('fac.total_ttc', $search_amount_all_tax, 1);
} }
if ($search_status != '') if ($search_status != '' && $search_status>=0)
{ {
$sql.= " AND fac.fk_statut = ".$search_status; $sql.= " AND fac.fk_statut = ".$search_status;
} }
if ($filter && $filter != -1)
{
$aFilter = explode(',', $filter);
foreach ($aFilter as $fil)
{
$filt = explode(':', $fil);
$sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]);
}
}
$nbtotalofrecords = 0; $nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -265,7 +274,7 @@ if ($resql)
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter); if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_status >= 0) $param.="&search_status=".$search_status; if ($search_status >= 0) $param.="&search_status=".$search_status;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -136,7 +136,7 @@ else if ($action == 'update')
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->fk_user_mod = $user->id; $object->fk_user_mod = $user->id;
$result = $object->update(); $result = $object->update($user);
if ($result > 0) if ($result > 0)
{ {

View File

@ -162,6 +162,7 @@ if (empty($user->societe_id))
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
! empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
! empty($conf->adherent->enabled) && $user->rights->adherent->lire, ! empty($conf->adherent->enabled) && $user->rights->adherent->lire,
! empty($conf->product->enabled) && $user->rights->produit->lire, ! empty($conf->product->enabled) && $user->rights->produit->lire,
! empty($conf->service->enabled) && $user->rights->service->lire, ! empty($conf->service->enabled) && $user->rights->service->lire,
@ -169,6 +170,7 @@ if (empty($user->societe_id))
! empty($conf->commande->enabled) && $user->rights->commande->lire, ! empty($conf->commande->enabled) && $user->rights->commande->lire,
! empty($conf->facture->enabled) && $user->rights->facture->lire, ! empty($conf->facture->enabled) && $user->rights->facture->lire,
! empty($conf->contrat->enabled) && $user->rights->contrat->activer, ! empty($conf->contrat->enabled) && $user->rights->contrat->activer,
! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), ! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), ! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), ! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
@ -181,6 +183,7 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT."/societe/class/client.class.php", DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
DOL_DOCUMENT_ROOT."/societe/class/client.class.php", DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php", DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php",
DOL_DOCUMENT_ROOT."/contact/class/contact.class.php",
DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php",
DOL_DOCUMENT_ROOT."/product/class/product.class.php", DOL_DOCUMENT_ROOT."/product/class/product.class.php",
DOL_DOCUMENT_ROOT."/product/class/service.class.php", DOL_DOCUMENT_ROOT."/product/class/service.class.php",
@ -188,6 +191,7 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", DOL_DOCUMENT_ROOT."/commande/class/commande.class.php",
DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php",
DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php",
DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php",
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php", DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php",
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php", DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php", DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php",
@ -199,6 +203,7 @@ if (empty($user->societe_id))
'Client', 'Client',
'Client', 'Client',
'Fournisseur', 'Fournisseur',
'Contact',
'Adherent', 'Adherent',
'Product', 'Product',
'Service', 'Service',
@ -206,6 +211,7 @@ if (empty($user->societe_id))
'Commande', 'Commande',
'Facture', 'Facture',
'Contrat', 'Contrat',
'Fichinter',
'CommandeFournisseur', 'CommandeFournisseur',
'FactureFournisseur', 'FactureFournisseur',
'SupplierProposal', 'SupplierProposal',
@ -217,6 +223,7 @@ if (empty($user->societe_id))
'customers', 'customers',
'prospects', 'prospects',
'suppliers', 'suppliers',
'contacts',
'members', 'members',
'products', 'products',
'services', 'services',
@ -224,6 +231,7 @@ if (empty($user->societe_id))
'orders', 'orders',
'invoices', 'invoices',
'Contracts', 'Contracts',
'fichinters',
'supplier_orders', 'supplier_orders',
'supplier_invoices', 'supplier_invoices',
'askprice', 'askprice',
@ -235,6 +243,7 @@ if (empty($user->societe_id))
'company', 'company',
'company', 'company',
'company', 'company',
'contact',
'user', 'user',
'product', 'product',
'service', 'service',
@ -243,6 +252,7 @@ if (empty($user->societe_id))
'bill', 'bill',
'order', 'order',
'order', 'order',
'order',
'bill', 'bill',
'propal', 'propal',
'trip', 'trip',
@ -253,6 +263,7 @@ if (empty($user->societe_id))
"ThirdPartyCustomersStats", "ThirdPartyCustomersStats",
"ThirdPartyProspectsStats", "ThirdPartyProspectsStats",
"Suppliers", "Suppliers",
"Contacts",
"Members", "Members",
"Products", "Products",
"Services", "Services",
@ -260,6 +271,7 @@ if (empty($user->societe_id))
"CustomersOrders", "CustomersOrders",
"BillsCustomers", "BillsCustomers",
"Contracts", "Contracts",
"Interventions",
"SuppliersOrders", "SuppliersOrders",
"SuppliersInvoices", "SuppliersInvoices",
"SupplierProposalShort", "SupplierProposalShort",
@ -272,6 +284,7 @@ if (empty($user->societe_id))
DOL_URL_ROOT.'/societe/list.php?type=c', DOL_URL_ROOT.'/societe/list.php?type=c',
DOL_URL_ROOT.'/societe/list.php?type=p', DOL_URL_ROOT.'/societe/list.php?type=p',
DOL_URL_ROOT.'/societe/list.php?type=f', DOL_URL_ROOT.'/societe/list.php?type=f',
DOL_URL_ROOT.'/contact/list.php',
DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members', DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members',
DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products', DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products',
DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products',
@ -279,6 +292,7 @@ if (empty($user->societe_id))
DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial', DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial',
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy',
DOL_URL_ROOT.'/contrat/list.php', DOL_URL_ROOT.'/contrat/list.php',
DOL_URL_ROOT.'/fichinter/list.php',
DOL_URL_ROOT.'/fourn/commande/list.php', DOL_URL_ROOT.'/fourn/commande/list.php',
DOL_URL_ROOT.'/fourn/facture/list.php', DOL_URL_ROOT.'/fourn/facture/list.php',
DOL_URL_ROOT.'/supplier_proposal/list.php', DOL_URL_ROOT.'/supplier_proposal/list.php',
@ -290,6 +304,7 @@ if (empty($user->societe_id))
"companies", "companies",
"prospects", "prospects",
"suppliers", "suppliers",
"companies",
"members", "members",
"products", "products",
"produts", "produts",
@ -298,6 +313,7 @@ if (empty($user->societe_id))
"bills", "bills",
"supplier_proposal", "supplier_proposal",
"contracts", "contracts",
"interventions",
"trips", "trips",
"projects" "projects"
); );

View File

@ -0,0 +1,29 @@
-- Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
--
-- 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/>.
--
--
--
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
-- de l'install et tous les sigles '--' sont supprimés.
--
--
-- Categories compte de résultat Français
--
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1,'VTE','Ventes de marchandises', '707xxx', 0, 0, '', '10', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2,'MAR','Coût d\'achats marchandises vendues', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3,'MARGE','Marge commerciale', '', 0, 1, '1 + 2', '30', 1, 1);

View File

@ -115,11 +115,12 @@ CREATE TABLE llx_website
ref varchar(24) NOT NULL, ref varchar(24) NOT NULL,
description varchar(255), description varchar(255),
status integer, status integer,
fk_default_home integer,
date_creation datetime, date_creation datetime,
date_modification datetime, date_modification datetime,
tms timestamp tms timestamp
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_website ADD COLUMN fk_default_home integer;
ALTER TABLE llx_website ADD UNIQUE INDEX uk_website_ref (ref, entity); ALTER TABLE llx_website ADD UNIQUE INDEX uk_website_ref (ref, entity);
CREATE TABLE llx_website_page CREATE TABLE llx_website_page
@ -305,19 +306,15 @@ ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_ht double(24,8) DEFAUL
ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_tva double(24,8) DEFAULT 0; ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_tva double(24,8) DEFAULT 0;
ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_ttc double(24,8) DEFAULT 0; ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_ttc double(24,8) DEFAULT 0;
ALTER TABLE llx_paiement ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; ALTER TABLE llx_paiement ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_paiementfourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; ALTER TABLE llx_paiementfourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ht double(24,8) NOT NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL;
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL;
ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL;
ALTER TABLE llx_supplier_proposal ADD COLUMN fk_multicurrency integer; ALTER TABLE llx_supplier_proposal ADD COLUMN fk_multicurrency integer;
ALTER TABLE llx_supplier_proposal ADD COLUMN multicurrency_code varchar(255); ALTER TABLE llx_supplier_proposal ADD COLUMN multicurrency_code varchar(255);
ALTER TABLE llx_supplier_proposal ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1; ALTER TABLE llx_supplier_proposal ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
@ -368,11 +365,18 @@ CREATE TABLE llx_c_accounting_category (
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code); ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1,'VTE',"Ventes de marchandises", '707xxx', 0, 0, '', '10', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2,'MAR',"Coût d'achats marchandises vendues", '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3,'MARGE',"Marge commerciale", '', 0, 1, '1 + 2', '30', 1, 1);
UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = ''; UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = '';
ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0; -- VMYSQL4.1 ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0;
-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_parent TYPE integer USING account_parent::integer;
DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque; -- VMYSQL4.1 DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
-- VPGSQL8.2 DROP INDEX uk_bordereau_cheque;
ALTER TABLE llx_bordereau_cheque CHANGE COLUMN number ref VARCHAR(30) NOT NULL; ALTER TABLE llx_bordereau_cheque CHANGE COLUMN number ref VARCHAR(30) NOT NULL;
CREATE UNIQUE INDEX uk_bordereau_cheque ON llx_bordereau_cheque (ref, entity); CREATE UNIQUE INDEX uk_bordereau_cheque ON llx_bordereau_cheque (ref, entity);
@ -393,3 +397,18 @@ ALTER TABLE llx_product ADD COLUMN default_vat_code varchar(10) after cost_price
-- Delete old deprecated field -- Delete old deprecated field
ALTER TABLE llx_product_stock DROP COLUMN pmp; ALTER TABLE llx_product_stock DROP COLUMN pmp;
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
ALTER TABLE llx_resource ADD COLUMN asset_number varchar(255) after ref;
ALTER TABLE llx_resource ADD COLUMN datec datetime DEFAULT NULL;
ALTER TABLE llx_resource ADD COLUMN date_valid datetime DEFAULT NULL;
ALTER TABLE llx_resource ADD COLUMN fk_user_author integer DEFAULT NULL;
ALTER TABLE llx_resource ADD COLUMN fk_user_modif integer DEFAULT NULL;
ALTER TABLE llx_resource ADD COLUMN fk_user_valid integer DEFAULT NULL;
ALTER TABLE llx_resource ADD COLUMN fk_statut smallint NOT NULL DEFAULT '0';
ALTER TABLE llx_resource ADD COLUMN import_key varchar(14);
ALTER TABLE llx_resource ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_element_resources ADD COLUMN duree real; -- total duration of using ressource

View File

@ -29,7 +29,7 @@ create table llx_accounting_account
pcg_type varchar(20) NOT NULL, pcg_type varchar(20) NOT NULL,
pcg_subtype varchar(20) NOT NULL, pcg_subtype varchar(20) NOT NULL,
account_number varchar(32) NOT NULL, account_number varchar(32) NOT NULL,
account_parent integer, -- Hierarchic parent account_parent integer DEFAULT 0, -- Hierarchic parent
label varchar(255) NOT NULL, label varchar(255) NOT NULL,
fk_accounting_category integer DEFAULT 0, fk_accounting_category integer DEFAULT 0,
fk_user_author integer DEFAULT NULL, fk_user_author integer DEFAULT NULL,

View File

@ -26,6 +26,7 @@ CREATE TABLE llx_element_resources
resource_type varchar(64), -- resource or user resource_type varchar(64), -- resource or user
busy integer, busy integer,
mandatory integer, mandatory integer,
duree real, -- total duration of using ressource
fk_user_create integer, fk_user_create integer,
tms timestamp tms timestamp
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- Module to manage resources into Dolibarr ERP/CRM -- Module to manage resources into Dolibarr ERP/CRM
-- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr> -- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
-- Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
-- --
-- This program is free software: you can redistribute it and/or modify -- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by -- it under the terms of the GNU General Public License as published by
@ -16,12 +17,21 @@
CREATE TABLE llx_resource CREATE TABLE llx_resource
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
ref varchar(255), ref varchar(255),
description text, asset_number varchar(255),
description text,
fk_code_type_resource varchar(32), fk_code_type_resource varchar(32),
note_public text, datec datetime DEFAULT NULL,
note_private text, date_valid datetime DEFAULT NULL,
tms timestamp fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
fk_statut smallint NOT NULL DEFAULT '0',
note_public text,
note_private text,
import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format
tms timestamp
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -33,7 +33,7 @@ create table llx_societe_remise_except
fk_facture integer, fk_facture integer,
fk_facture_source integer, fk_facture_source integer,
description text NOT NULL, description text NOT NULL,
multicurrency_amount_ht double(24,8) NOT NULL, multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL,
multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL, multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL,
multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -24,6 +24,7 @@ CREATE TABLE llx_website
ref varchar(24) NOT NULL, ref varchar(24) NOT NULL,
description varchar(255), description varchar(255),
status integer, status integer,
fk_default_home integer,
date_creation datetime, date_creation datetime,
date_modification datetime, date_modification datetime,
tms timestamp tms timestamp

View File

@ -401,6 +401,8 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
$beforeversionarray=explode('.','4.0.9'); $beforeversionarray=explode('.','4.0.9');
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
{ {
migrate_directories($db,$langs,$conf,'/fckeditor','/medias');
// Reload modules (this must be always and only into last targeted version) // Reload modules (this must be always and only into last targeted version)
$listofmodule=array( $listofmodule=array(
'MAIN_MODULE_BARCODE'=>'newboxdefonly', 'MAIN_MODULE_BARCODE'=>'newboxdefonly',

View File

@ -199,6 +199,6 @@ OppStatusQUAL=المؤهل العلمى
OppStatusPROPO=مقترح OppStatusPROPO=مقترح
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=بانتظار OppStatusPENDING=بانتظار
OppStatusWIN=فاز OppStatusWON=فاز
OppStatusLOST=ضائع OppStatusLOST=ضائع
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualificació
OppStatusPROPO=Pressupost OppStatusPROPO=Pressupost
OppStatusNEGO=Negociació OppStatusNEGO=Negociació
OppStatusPENDING=Pendent OppStatusPENDING=Pendent
OppStatusWIN=Guanyat OppStatusWON=Guanyat
OppStatusLOST=Perdut OppStatusLOST=Perdut
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualifikation
OppStatusPROPO=Angebot OppStatusPROPO=Angebot
OppStatusNEGO=Verhandlung OppStatusNEGO=Verhandlung
OppStatusPENDING=Anstehend OppStatusPENDING=Anstehend
OppStatusWIN=Gewonnen OppStatusWON=Gewonnen
OppStatusLOST=Verloren OppStatusLOST=Verloren
Budget=Budget Budget=Budget

View File

@ -174,6 +174,9 @@ OptionModeProductBuyDesc=Show all products with no accounting account defined fo
## Dictionary ## Dictionary
Range=Range of accounting account Range=Range of accounting account
Sens=Sens
Calculated=Calculated
Formula=Formula
## Error ## Error
ErrorNoAccountingCategoryForThisCountry=No accounting category are available for this country ErrorNoAccountingCategoryForThisCountry=No accounting category are available for this country

View File

@ -521,7 +521,7 @@ Module1520Desc=Mass mail document generation
Module1780Name=Tags/Categories Module1780Name=Tags/Categories
Module1780Desc=Create tags/category (products, customers, suppliers, contacts or members) Module1780Desc=Create tags/category (products, customers, suppliers, contacts or members)
Module2000Name=WYSIWYG editor Module2000Name=WYSIWYG editor
Module2000Desc=Allow to edit some text area using an advanced editor Module2000Desc=Allow to edit some text area using an advanced editor (Based on CKEditor)
Module2200Name=Dynamic Prices Module2200Name=Dynamic Prices
Module2200Desc=Enable the usage of math expressions for prices Module2200Desc=Enable the usage of math expressions for prices
Module2300Name=Cron Module2300Name=Cron
@ -1602,7 +1602,7 @@ ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscel
KeyForApiAccess=Key to use API (parameter "api_key") KeyForApiAccess=Key to use API (parameter "api_key")
ApiProductionMode=Enable production mode (this will activate use of a caches for services management) ApiProductionMode=Enable production mode (this will activate use of a caches for services management)
ApiEndPointIs=You can access to the API at url ApiEndPointIs=You can access to the API at url
ApiExporerIs=You can explore the API at url ApiExporerIs=You can explore the APIs at url
OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed
ApiKey=Key for API ApiKey=Key for API
##### Bank ##### ##### Bank #####
@ -1740,3 +1740,5 @@ AddOtherPagesOrServices=Add other pages or services
AddModels=Add document or numbering templates AddModels=Add document or numbering templates
AddSubstitutions=Add keys substitutions AddSubstitutions=Add keys substitutions
DetectionNotPossible=Detection not possible DetectionNotPossible=Detection not possible
UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access)
ListOfAvailableAPIs=List of available APIs

View File

@ -59,6 +59,8 @@ SpecialExpensesArea=Area for all special payments
TaxAndDividendsArea=Sale taxes, social/fiscal taxes contributions and dividends area TaxAndDividendsArea=Sale taxes, social/fiscal taxes contributions and dividends area
SocialContribution=Social or fiscal tax SocialContribution=Social or fiscal tax
SocialContributions=Social or fiscal taxes SocialContributions=Social or fiscal taxes
SocialContributionsDeductibles=Deductible social or fiscal taxes
SocialContributionsNondeductibles=Nondeductible social or fiscal taxes
MenuSpecialExpenses=Special expenses MenuSpecialExpenses=Special expenses
MenuTaxAndDividends=Taxes and dividends MenuTaxAndDividends=Taxes and dividends
MenuSalaries=Salaries MenuSalaries=Salaries

View File

@ -120,6 +120,7 @@ Home=Home
Help=Help Help=Help
OnlineHelp=Online help OnlineHelp=Online help
PageWiki=Wiki page PageWiki=Wiki page
MediaBrowser=Media browser
Always=Always Always=Always
Never=Never Never=Never
Under=under Under=under

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -4,7 +4,11 @@ WebsiteSetupDesc=Create here as much entry as number of different websites you n
DeleteWebsite=Delete website DeleteWebsite=Delete website
ConfirmDeleteWebsite=Are you sure you want to delete this web site. All its pages and content will also be removed. ConfirmDeleteWebsite=Are you sure you want to delete this web site. All its pages and content will also be removed.
WEBSITE_PAGENAME=Page name/alias WEBSITE_PAGENAME=Page name/alias
WEBSITE_URL=Page real URL WEBSITE_URL=Web site URL
WEBSITE_CSS_URL=URL of external CSS file
WEBSITE_CSS_INLINE=CSS content
MediaFiles=Media library
EditCss=Edit Style/CSS
EditMenu=Edit menu EditMenu=Edit menu
EditPageMeta=Edit Meta EditPageMeta=Edit Meta
EditPageContent=Edit Content EditPageContent=Edit Content
@ -12,3 +16,7 @@ Website=Web site
AddPage=Add page AddPage=Add page
Page=Page Page=Page
PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page. PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page.
PageDeleted=Page %s of website %s deleted
ViewSiteInNewTab=View site in new tab
ViewPageInNewTab=View page in new tab
SetAsHomePage=Set as Home page

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Cualificación
OppStatusPROPO=Presupuesto OppStatusPROPO=Presupuesto
OppStatusNEGO=Negociación OppStatusNEGO=Negociación
OppStatusPENDING=Pendiente OppStatusPENDING=Pendiente
OppStatusWIN=Ganado OppStatusWON=Ganado
OppStatusLOST=Perdido OppStatusLOST=Perdido
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposition OppStatusPROPO=Proposition
OppStatusNEGO=Négociation OppStatusNEGO=Négociation
OppStatusPENDING=En attente OppStatusPENDING=En attente
OppStatusWIN=Gagné OppStatusWON=Gagné
OppStatusLOST=Perdu OppStatusLOST=Perdu
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualificazione
OppStatusPROPO=Proposta OppStatusPROPO=Proposta
OppStatusNEGO=Negoziazione OppStatusNEGO=Negoziazione
OppStatusPENDING=In attesa OppStatusPENDING=In attesa
OppStatusWIN=Vinto OppStatusWON=Vinto
OppStatusLOST=Perso OppStatusLOST=Perso
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikācija
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Qualification
OppStatusPROPO=Proposal OppStatusPROPO=Proposal
OppStatusNEGO=Negociation OppStatusNEGO=Negociation
OppStatusPENDING=Pending OppStatusPENDING=Pending
OppStatusWIN=Won OppStatusWON=Won
OppStatusLOST=Lost OppStatusLOST=Lost
Budget=Budget Budget=Budget

View File

@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikasjon
OppStatusPROPO=Tilbud OppStatusPROPO=Tilbud
OppStatusNEGO=Forhandling OppStatusNEGO=Forhandling
OppStatusPENDING=Venter OppStatusPENDING=Venter
OppStatusWIN=Vunnet OppStatusWON=Vunnet
OppStatusLOST=Tapt OppStatusLOST=Tapt
Budget=Budget Budget=Budget

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