Merge branch 'develop' into 11.0_translation

This commit is contained in:
Alexandre SPANGARO 2019-09-19 22:34:43 +02:00
commit b3807bbb20
1130 changed files with 3081 additions and 3279 deletions

View File

@ -13,7 +13,7 @@ Component Version License GPL Compatible
-------------------------------------------------------------------------------------
PHP libraries:
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
CKEditor 4.11.4 LGPL-2.1+ Yes Editor WYSIWYG
CKEditor 4.12.1 LGPL-2.1+ Yes Editor WYSIWYG
EvalMath 1.0 BSD Yes Safe math expressions evaluation
Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)

102
ChangeLog
View File

@ -20,8 +20,110 @@ Following changes may create regressions for some external modules, but were nec
* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead.
* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french).
* Removed deprecated method actioncomm->add(), use create() instead
* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...)
* Removed function dol_micro_time. Use native PHP microtime instead.
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
FIX: #10460 compatibility with MariaDB 10.4
FIX: #11401 Adherent unknown language key
FIX: #11422 Can't edit his own events with standard rights
FIX: #11427 require product class (fixes POST /supplierinvoices REST API endpoint)
FIX: #11570
FIX: #11591 FIX: #11592
FIX: #11671 CVE-2019-15062
FIX: #11672
FIX: #11685
FIX: #11702
FIX: #11711
FIX: #11720
FIX: #11746 Unable to modify amount of insurance of a loan
FIX: #11752
FIX: #11789 FIX: #11790
FIX: #11804 list of tickets from a customer card display ALL tickets
FIX: #11834
FIX: Add char $ and ; in sanitizing of filenames.
FIX: Add comment before protected functions
FIX: Add log and type of content in dolWebsiteOutput and
FIX: Add repair.php option 'restore' to restore user picture after v10
FIX: amount opened on thirdparty card dont care of credit note not converted
FIX: Api of documents work with value 'thirdparty'
FIX: author in message / ticket API
FIX: avoid sql error if fk_project is empty during update
FIX: avoid Warning: A non-numeric value encountered
FIX: bad consistency in list of invoice for direct debit order.
FIX: Bad error management in zip compress and web site export
FIX: bad substitution for extrafields type checkbox
FIX: better help message with multicompany
FIX: calculation of $products_dispatched
FIX: Can't add a new chart of account
FIX: Can't delete a draft leave even if it should
FIX: Can't save setup of mailman module
FIX: column jabberid missing
FIX: Confirmation of deletion
FIX: Consistency in direct debit order lists.
FIX: Content send before header warning
FIX: credit note can be split
FIX: credit note used on list
FIX: Css was saved on wrong website.
FIX: delivery extrafields
FIX: Disabling a website does not put it offline
FIX: display only stripe sources for customer
FIX: display payment intent in stripe's charge list
FIX: document list for products in API
FIX: dol_thirdparty_id for stripe PI
FIX: Do not show tooltip if tooltip is empty
FIX: duplicate css tag, decrease padding-bottom for boxes in eldy theme
FIX: duration when creating service
FIX: EDB-ID:47370
FIX: Enable web site
FIX: error management when adding a property with type real
FIX: Fatal situation if payment removed on expense report. Action
FIX: filepath of generated documents doesn't handle products with special characters
FIX: for MAIN_MAXTABS_IN_CARD = $i card
FIX: gzip and bzip2 must use option -f
FIX: It was possible to create cashfence without entering data.
FIX: javascript error when using dol_use_jmobile=1
FIX: logout redirect to takepos.php
FIX: Look and feel v10
FIX: Make protected all pfd models functions
FIX: management of extrafields in modulebuilder
FIX: Missing div for buttons in tax, loan, various payment modules
FIX: missing include (dol_convert_file not found)
FIX: Missing some replacements in website module
FIX: missing test on permission on button to delete ledger record
FIX: Missing the filter fields in export of expense report and leaves
FIX: Missing ticket icon on md theme
FIX: Missing transaction
FIX: Mode smartphone was not triggered when there is too loo menu
FIX: Must escape shell
FIX: Must exclude logs and some dirs for compressed backup
FIX: name and position of hook FIX: #11710
FIX: Not showing MAIN_INVERT_SENDER_RECIPIENT when edit field
FIX: Nowrap missing on amount in boxes
FIX: Option to use ZipArchive instead of PclZip bugged with large files.
FIX: order or proposals billed if both workflow conf activated
FIX: permission check on API intervention
FIX: phpcs
FIX: placement function
FIX: qty in invoice list on product's stats
FIX: remove disabled product type from product list
FIX: Return code of pdf_einstein.modules.php and proformat
FIX: round for application fee in stripe
FIX: Sens of the balance (Debit - Credit in accountancy not contrary)
FIX: Several pb in export of documents
FIX: SQL syntax error and CSRF check on vat reports
FIX: takepos layout clear or focus search
FIX: too many record in sql request. Whena criteria is a filter, we must
FIX: Translation of month
FIX: USEDOLIBARREDITOR not always set
FIX: VAT number for Monaco (it uses FR)
FIX: vulenrability in uploading file found by 美创科技安全实验室
FIX: wrong display (and hidden input) for already dispatched quantity
FIX: wrong parameters (same error in branch 9, 10, develop)
FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES
***** ChangeLog for 10.0.1 compared to 10.0.0 *****
FIX: #10930
FIX: #10984

View File

@ -10,7 +10,6 @@ File added into doxygen generated documentation
<br>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
@ -24,13 +23,30 @@ File added into doxygen generated documentation
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '1998533953704960');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
<!-- Twitter ad collector -->
<script src="//platform.twitter.com/oct.js" type="text/javascript"></script>
<script src="//static.ads-twitter.com/oct.js" type="text/javascript"></script>
<script type="text/javascript">twttr.conversion.trackPid('ntm4n', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
<noscript>
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?txn_id=ntm4n&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0" />
</noscript>
</body>
</html>

View File

@ -30,7 +30,6 @@ src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1"
</head>
<body>
<div id="top">
<div class="topmaincol">
<div class="divpath">

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -164,7 +164,7 @@ if ($action == 'export_csv')
print $object->get_compte_desc($line->numero_compte) . $sep;
print price($line->debit) . $sep;
print price($line->credit) . $sep;
print price($line->credit - $line->debit) . $sep;
print price($line->debit - $line->credit) . $sep;
print "\n";
}
@ -293,9 +293,9 @@ if ($action != 'export_csv')
print '<td>' . length_accountg($line->numero_compte) . '</td>';
print '<td>' . $description . '</td>';
print '<td class="right">' . price($line->debit) . '</td>';
print '<td class="right">' . price($line->credit) . '</td>';
print '<td class="right">' . price($line->credit - $line->debit) . '</td>';
print '<td class="nowraponall right">' . price($line->debit) . '</td>';
print '<td class="nowraponall right">' . price($line->credit) . '</td>';
print '<td class="nowraponall right">' . price($line->debit - $line->credit) . '</td>';
print '<td class="center">' . $link;
print '</td>';
print "</tr>\n";
@ -305,11 +305,11 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap right">' . price($total_debit) . '</td><td class="nowrap right">' . price($total_credit) . '</td><td class="nowrap right">' . price(price2num($total_credit - $total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap right">' . price($total_debit) . '</td><td class="nowrap right">' . price($total_credit) . '</td><td class="nowrap right">' . price(price2num($total_debit - $total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -50,6 +51,7 @@ $hookmanager->initHooks(array('accountancyindex'));
llxHeader('', $langs->trans("AccountancyArea"));
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy');
//dol_fiche_head();
$step = 0;
@ -175,6 +177,7 @@ else
{
print $langs->trans("Module10Desc")."<br>\n";
}
//dol_fiche_end();
// End of page
llxFooter();

View File

@ -1740,8 +1740,7 @@ class Adherent extends CommonObject
$paiement->datepaye = $paymentdate;
$paiement->amounts = $amounts;
$paiement->paiementid = dol_getIdFromCode($this->db, $operation, 'c_paiement', 'code', 'id', 1);
$paiement->num_paiement = $num_chq;
$paiement->note = $label;
$paiement->num_payment = $num_chq;
$paiement->note_public = $label;
if (! $error)
@ -2072,10 +2071,8 @@ class Adherent extends CommonObject
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
$notooltip=0;
$result=''; $label='';
$link=''; $linkstart=''; $linkend='';
$linkstart=''; $linkend='';
if (! empty($this->photo))
{
@ -2108,7 +2105,7 @@ class Adherent extends CommonObject
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
$link = '<a href="'.$url.'"';
$linkstart.= '<a href="'.$url.'"';
$linkclose="";
if (empty($notooltip))
{
@ -2122,10 +2119,10 @@ class Adherent extends CommonObject
$linkclose.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
}
$link.=$linkclose.'>';
$linkstart.=$linkclose.'>';
$linkend='</a>';
$result.=$link;
$result.=$linkstart;
if ($withpictoimg) $result.='<div class="inline-block nopadding valignmiddle">';
if ($withpictoimg)
{

View File

@ -424,7 +424,7 @@ class AdherentType extends CommonObject
global $langs;
if ($morphy == 'phy') { return $langs->trans("Physical"); }
elseif ($morphy == 'mor') { return $langs->trans("Moral"); }
else return $langs->trans("Physical & Morale");
else return $langs->trans("MorPhy");
//return $morphy;
}

View File

@ -261,7 +261,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label']))
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql.=preg_replace('/^,/', '', $hookmanager->resPrint);
$sql =preg_replace('/, $/', '', $sql);
$sql =preg_replace('/,\s*$/', '', $sql);
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ

View File

@ -283,7 +283,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '<td class="center">';
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); }
elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); }
else print $langs->trans("Physical & Morale");
else print $langs->trans("MorPhy");
print '</td>';
print '<td class="center">'.yn($objp->subscription).'</td>';
print '<td class="center">'.yn($objp->vote).'</td>';

View File

@ -44,7 +44,7 @@ $actionsave=GETPOST('save', 'alpha');
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
// List of aviable colors
// List of available colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');

View File

@ -1,5 +1,4 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
@ -28,6 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
@ -38,6 +38,7 @@ if (!$user->admin)
accessforbidden();
$action = GETPOST('action', 'alpha');
$actionsave=GETPOST('save', 'alpha');
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
@ -60,7 +61,7 @@ if ($action == 'setbankorder') {
}
}
//Auto report last num releve on conciliate
// Auto report last num releve on conciliate
if ($action == 'setreportlastnumreleve') {
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0)
{
@ -82,6 +83,58 @@ elseif ($action == 'unsetreportlastnumreleve') {
}
}
// Colorize movements
if ($action == 'setbankcolorizemovement') {
if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
else {
dol_print_error($db);
}
}
elseif ($action == 'unsetbankcolorizemovement') {
if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
else {
dol_print_error($db);
}
}
if ($actionsave)
{
$db->begin();
$i=1; $errorsaved=0;
$error=0;
// Save colors
while ($i <= 2)
{
$color=trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha'));
if ($color=='-1') $color='';
$res=dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
$i++;
}
if (! $error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
}
}
if ($action == 'specimen') {
$modele = GETPOST('module', 'alpha');
@ -157,10 +210,11 @@ elseif ($action == 'setdoc') {
/*
* view
* View
*/
$form = new Form($db);
$formother=new FormOther($db);
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@ -169,6 +223,10 @@ llxHeader("", $langs->trans("BankSetupModule"));
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
print '<form name="bankmovementcolorconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="save">';
$head = bank_admin_prepare_head(null);
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
@ -372,7 +430,56 @@ foreach ($dirmodels as $reldir) {
print '</table>';
//}
print '<br><br>';
print load_fiche_titre($langs->trans("BankColorizeMovement"), '', '');
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">\n";
print '<td colspan="4">' . $langs->trans("Name") . '</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print "</tr>\n";
print '<tr class="oddeven"><td colspan="4" width="100">';
print $langs->trans('BankColorizeMovementDesc');
print "</td>";
// Active
if ($conf->global->BANK_COLORIZE_MOVEMENT) {
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetbankcolorizemovement">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
print '</td>';
}
else
{
print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setbankcolorizemovement">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
print "</td>";
}
print "</tr>\n";
if(! empty($conf->global->BANK_COLORIZE_MOVEMENT))
{
$i=1;
while ($i <= 2)
{
$key=$i;
$color='BANK_COLORIZE_MOVEMENT_COLOR'.$key;
print '<tr class="oddeven">';
// Label
print '<td colspan="4" width="180" class="nowrap">'.$langs->trans("BankColorizeMovementName".$key)."</td>";
// Color
print '<td class="nowrap right">';
print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key)?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key):$conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset');
print '</td>';
print "</tr>";
$i++;
}
}
print '</table>';
print '<br><br>';
@ -384,7 +491,6 @@ print '<br><br>';
//{
print load_fiche_titre($langs->trans("Other"), '', '');
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>';
@ -416,6 +522,12 @@ print "</tr>\n";
print '</table>';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';
print '</div>';
print "</form>\n";
// End of page
llxFooter();
$db->close();

View File

@ -204,7 +204,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[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.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1";
$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON 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[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
$tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
@ -244,7 +244,7 @@ $tabsqlsort[28]="country ASC, code ASC";
$tabsqlsort[29]="position ASC";
$tabsqlsort[30]="code ASC";
//$tabsqlsort[31]="pcg_version ASC";
$tabsqlsort[32]="year ASC, month ASC, day ASC";
$tabsqlsort[32]="country, year ASC, month ASC, day ASC";
$tabsqlsort[33]="code ASC";
$tabsqlsort[34]="code ASC";
$tabsqlsort[35]="c.label ASC";
@ -284,7 +284,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country";
$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[31]= "pcg_version,label";
$tabfield[32]= "code,year,month,day,country_id,country";
$tabfield[32]= "code,dayrule,year,month,day,country_id,country";
$tabfield[33]= "code,label";
$tabfield[34]= "code,label";
$tabfield[35]= "label";
@ -324,7 +324,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country";
$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[31]= "pcg_version,label";
$tabfieldvalue[32]= "code,day,month,year,country";
$tabfieldvalue[32]= "code,dayrule,day,month,year,country";
$tabfieldvalue[33]= "code,label";
$tabfieldvalue[34]= "code,label";
$tabfieldvalue[35]= "label";
@ -365,7 +365,7 @@ $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[31]= "pcg_version,label";
//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
$tabfieldinsert[32]= "code,day,month,year,fk_country";
$tabfieldinsert[32]= "code,dayrule,day,month,year,fk_country";
$tabfieldinsert[33]= "code,label";
$tabfieldinsert[34]= "code,label";
$tabfieldinsert[35]= "label";
@ -487,7 +487,7 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'daterule'=>"Use 'date'", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"));
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'dayrule'=>"Keep empty for a date defined with month and day (most common case).<br>Use a keyword like 'easter', 'eastermonday', ... for a date predefined by complex rules.", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear"));
$tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[35] = array();

View File

@ -58,6 +58,7 @@ if ($action == 'setvalue' && $user->admin)
//if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++;
// This one must be after the others
$valkey='';
@ -170,6 +171,13 @@ print '</td><td>'.$langs->trans("LDAPFieldGroupMembersExample").'</td>';
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_GROUPMEMBERS"'.(($conf->global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'')."></td>";
print '</tr>';
// Group id
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupid").'</td><td>';
print '<input size="25" type="text" name="fieldgroupid" value="'.$conf->global->LDAP_GROUP_FIELD_GROUPID.'">';
print '</td><td>'.$langs->trans("LDAPFieldGroupidExample").'</td>';
print '<td class="right">&nbsp;</td>';
print '</tr>';
print '</table>';
print info_admin($langs->trans("LDAPDescValues"));

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Abbes Bahfir <dolipar@dolipar.org>
*
* 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
@ -73,6 +74,10 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID', GETPOST("fieldsid"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE', GETPOST("fieldtitle"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_GROUPID', GETPOST("fieldgroupid"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_USERID', GETPOST("fielduserid"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_HOMEDIRECTORY', GETPOST("fieldhomedirectory"), 'chaine', 0, '', $conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_HOMEDIRECTORYPREFIX', GETPOST("fieldhomedirectoryprefix"), 'chaine', 0, '', $conf->entity)) $error++;
// This one must be after the others
$valkey='';
@ -301,6 +306,34 @@ print '</td><td>'.$langs->trans("LDAPFieldSidExample").'</td>';
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_SID"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'')."></td>";
print '</tr>';
// Group id
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupid").'</td><td>';
print '<input size="25" type="text" name="fieldgroupid" value="'.$conf->global->LDAP_FIELD_GROUPID.'">';
print '</td><td>'.$langs->trans("LDAPFieldGroupidExample").'</td>';
print '<td class="right">&nbsp;</td>';
print '</tr>';
// Userid
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldUserid").'</td><td>';
print '<input size="25" type="text" name="fielduserid" value="'.$conf->global->LDAP_FIELD_USERID.'">';
print '</td><td>'.$langs->trans("LDAPFieldUseridExample").'</td>';
print '<td class="right">&nbsp;</td>';
print '</tr>';
// Home Directory
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectory").'</td><td>';
print '<input size="25" type="text" name="fieldhomedirectory" value="'.$conf->global->LDAP_FIELD_HOMEDIRECTORY.'">';
print '</td><td>'.$langs->trans("LDAPFieldHomedirectoryExample").'</td>';
print '<td class="right">&nbsp;</td>';
print '</tr>';
// Home Directory Prefix
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectoryprefix").'</td><td>';
print '<input size="25" type="text" name="fieldhomedirectoryprefix" value="'.$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX.'">';
print '</td><td></td>';
print '<td class="right">&nbsp;</td>';
print '</tr>';
print '</table>';
print info_admin($langs->trans("LDAPDescValues"));

View File

@ -127,6 +127,15 @@ print '</td>';
print '<td></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
print '<td>';
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
print '</td>';
print '<td></td>';
print '</tr>';
print '</table>';
print '</form>';

View File

@ -746,13 +746,19 @@ class Categorie extends CommonObject
/**
* Return list of fetched instance of elements having this category
*
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
* @param int $onlyids Return only ids of objects (consume less memory)
* @return array|int -1 if KO, array of instance of object if OK
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
* @param int $onlyids Return only ids of objects (consume less memory)
* @param int $limit Limit
* @param int $offset Offset
* @param string $sortfield Sort fields
* @param string $sortorder Sort order ('ASC' or 'DESC');
* @return array|int -1 if KO, array of instance of object if OK
* @see containsObject()
*/
public function getObjectsInCateg($type, $onlyids = 0)
public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC')
{
global $user;
$objs = array();
$obj = new $this->MAP_OBJ_CLASS[$type]( $this->db );
@ -761,8 +767,15 @@ class Categorie extends CommonObject
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c";
$sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o";
$sql .= " WHERE o.entity IN (" . getEntity($obj->element).")";
$sql.= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
// Protection for external users
if (($type == 'customer' || $type == 'supplier') && $user->societe_id > 0)
{
$sql.= " AND o.rowid = ".$user->societe_id;
}
if ($limit > 0 || $offset > 0) $sql .= $this->db->plimit($limit + 1, $offset);
$sql .= $this->db->order($sortfield, $sortorder);
dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -34,13 +34,32 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->load("categories");
$id = GETPOST('id', 'int');
$label= GETPOST('label', 'alpha');
$type = GETPOST('type', 'az09');
$action=GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$label = GETPOST('label', 'alpha');
$type = GETPOST('type', 'az09');
$removeelem = GETPOST('removeelem', 'int');
$elemid = GETPOST('elemid', 'alpha');
$elemid = GETPOST('elemid', 'int');
$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Load variable for pagination
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($id == "" && $label == "")
{
@ -319,10 +338,20 @@ else
}
// List of mass actions available
$arrayofmassactions = array(
//'validate'=>$langs->trans("Validate"),
//'generate_doc'=>$langs->trans("ReGeneratePDF"),
//'builddoc'=>$langs->trans("PDFMerge"),
//'presend'=>$langs->trans("SendByMail"),
);
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
// List of products or services (type is type of category)
if ($type == Categorie::TYPE_PRODUCT)
{
$prods = $object->getObjectsInCateg("product");
$prods = $object->getObjectsInCateg("product", 0, $limit, $offset);
if ($prods < 0)
{
dol_print_error($db, $prods->error, $prods->errors);
@ -351,14 +380,28 @@ if ($type == Categorie::TYPE_PRODUCT)
print '</form>';
}
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("ProductsAndServices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("ProductsAndServices").' <span class="badge">'.count($prods).'</span></td></tr>'."\n";
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($prods) > 0)
{
$i = 0;
foreach ($prods as $prod)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
print $prod->getNomUrl(1);
@ -388,26 +431,42 @@ if ($type == Categorie::TYPE_PRODUCT)
print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoProduct").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
if ($type == Categorie::TYPE_SUPPLIER)
{
$socs = $object->getObjectsInCateg("supplier");
$socs = $object->getObjectsInCateg("supplier", 0, $limit, $offset);
if ($socs < 0)
{
dol_print_error($db, $socs->error, $socs->errors);
}
else
{
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Suppliers").' <span class="badge">'.count($socs)."</span></td></tr>\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name")."</td></tr>\n";
if (count($socs) > 0)
{
$i = 0;
foreach ($socs as $soc)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1);
@ -437,30 +496,41 @@ if ($type == Categorie::TYPE_SUPPLIER)
print '<tr class="oddeven"><td class="opacitymedium">'.$langs->trans("ThisCategoryHasNoSupplier").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
if($type == Categorie::TYPE_CUSTOMER)
{
$socs = $object->getObjectsInCateg("customer");
$socs = $object->getObjectsInCateg("customer", 0, $limit, $offset);
if ($socs < 0)
{
dol_print_error($db, $socs->error, $socs->errors);
}
else
{
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Customers").' <span class="badge">'.count($socs).'</span></td></tr>'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name").'</td></tr>'."\n";
if (count($socs) > 0)
{
$i = 0;
foreach ($socs as $key => $soc)
{
if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
@ -490,6 +560,8 @@ if($type == Categorie::TYPE_CUSTOMER)
print '<tr class="oddeven"><td class="opacitymedium">'.$langs->trans("ThisCategoryHasNoCustomer").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
@ -498,21 +570,35 @@ if ($type == Categorie::TYPE_MEMBER)
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$prods = $object->getObjectsInCateg("member");
$prods = $object->getObjectsInCateg("member", 0, $limit, $offset);
if ($prods < 0)
{
dol_print_error($db, $prods->error, $prods->errors);
}
else
{
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Member").' <span class="badge">'.count($prods).'</span></td></tr>'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Name").'</td></tr>'."\n";
if (count($prods) > 0)
{
$i = 0;
foreach ($prods as $key => $member)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
$member->ref=$member->login;
@ -543,22 +629,35 @@ if ($type == Categorie::TYPE_MEMBER)
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoMember").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
// Categorie contact
if ($type == Categorie::TYPE_CONTACT)
{
$contacts = $object->getObjectsInCateg("contact");
$contacts = $object->getObjectsInCateg("contact", 0, $limit, $offset);
if ($contacts < 0)
{
dol_print_error($db, $contacts->error, $contacts->errors);
}
else
{
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($contacts); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Contact").' <span class="badge">'.count($contacts).'</span></td></tr>'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($contacts) > 0)
{
@ -566,6 +665,7 @@ if ($type == Categorie::TYPE_CONTACT)
foreach ($contacts as $key => $contact)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
@ -595,6 +695,8 @@ if ($type == Categorie::TYPE_CONTACT)
print '<tr class="oddeven"><td class="opacitymedium">'.$langs->trans("ThisCategoryHasNoContact").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
@ -603,21 +705,35 @@ if ($type == Categorie::TYPE_ACCOUNT)
{
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$accounts = $object->getObjectsInCateg("account");
$accounts = $object->getObjectsInCateg("account", 0, $limit, $offset);
if ($accounts < 0)
{
dol_print_error($db, $accounts->error, $accounts->errors);
}
else
{
print "<br>";
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Account").' <span class="badge">'.count($accounts).'</span></td></tr>'."\n";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($accounts); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($accounts) > 0)
{
$i = 0;
foreach ($accounts as $key => $account)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
print $account->getNomUrl(1, 0);
@ -647,6 +763,8 @@ if ($type == Categorie::TYPE_ACCOUNT)
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoAccount").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}
@ -655,21 +773,35 @@ if ($type == Categorie::TYPE_PROJECT)
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projects = $object->getObjectsInCateg("project");
$projects = $object->getObjectsInCateg("project", 0, $limit, $offset);
if ($projects < 0)
{
dol_print_error($db, $object->error, $object->errors);
}
else
{
print "<br>";
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
print '<input type="hidden" name="type" value="'.$typeid.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="action" value="list">';
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($projects); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Project"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Project").' <span class="badge">'.count($projects).'</span></td></tr>'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($projects) > 0)
{
$i = 0;
foreach ($projects as $key => $project)
{
$i++;
if ($i > $limit) break;
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
print $project->getNomUrl(1);
@ -699,6 +831,8 @@ if ($type == Categorie::TYPE_PROJECT)
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoProject").'</td></tr>';
}
print "</table>\n";
print '</form>'."\n";
}
}

View File

@ -221,7 +221,7 @@ if ($action == 'add')
}
// Initialisation objet cactioncomm
if (! GETPOST('actioncode') > 0) // actioncode is id
if (GETPOSTISSET('actioncode') && ! GETPOST('actioncode', 'aZ09')) // actioncode is '0'
{
$error++; $donotclearsession=1;
$action = 'create';
@ -229,7 +229,7 @@ if ($action == 'add')
}
else
{
$object->type_code = GETPOST('actioncode');
$object->type_code = GETPOST('actioncode', 'aZ09');
}
if (! $error)
@ -243,7 +243,7 @@ if ($action == 'add')
$object->elementtype = GETPOST("elementtype", 'alpha');
if (! GETPOST('label'))
{
if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
if (GETPOST('actioncode', 'aZ09') == 'AC_RDV' && $contact->getFullName($langs))
{
$object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs));
}
@ -426,15 +426,15 @@ if ($action == 'update')
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority");
$object->priority = GETPOST("priority", "alphanohtml");
$object->fulldayevent= GETPOST("fullday")?1:0;
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->location = GETPOST('location', "alphanohtml");
$object->socid = GETPOST("socid", "int");
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
$object->socpeopleassigned = array();
foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid);
@ -446,8 +446,8 @@ if ($action == 'update')
$object->fk_project = GETPOST("projectid", 'int');
$object->note = GETPOST("note", "none"); // deprecated
$object->note_private= GETPOST("note", "none");
$object->fk_element = GETPOST("fk_element");
$object->elementtype = GETPOST("elementtype");
$object->fk_element = GETPOST("fk_element", "int");
$object->elementtype = GETPOST("elementtype", "alphanohtml");
if (! $datef && $percentage == 100)
{
@ -491,7 +491,7 @@ if ($action == 'update')
}
// Check parameters
if (! GETPOST('actioncode') > 0)
if (GETPOSTISSET('actioncode') && ! GETPOST('actioncode', 'aZ09')) // actioncode is '0'
{
$error++; $donotclearsession=1;
$action = 'edit';
@ -499,7 +499,7 @@ if ($action == 'update')
}
else
{
$result=$cactioncomm->fetch(GETPOST('actioncode'));
$result=$cactioncomm->fetch(GETPOST('actioncode', 'aZ09'));
}
if (empty($object->userownerid))
{
@ -512,6 +512,65 @@ if ($action == 'update')
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++;
if (!$error) {
// check if an event resource is already in use
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') {
$eventDateStart = $object->datep;
$eventDateEnd = $object->datef;
$sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'";
$sql .= " WHERE ac.id != " . $object->id;
$sql .= " AND er.resource_id IN (";
$sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources";
$sql .= " WHERE element_id = " . $object->id;
$sql .= " AND element_type = '" . $db->escape($object->element) . "'";
$sql .= " AND busy = 1";
$sql .= ")";
$sql .= " AND er.busy = 1";
$sql .= " AND (";
// event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end)
$sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))";
// event date end between ac.datep and ac.datep2
if (!empty($eventDateEnd)) {
$sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))";
}
// event date start before ac.datep and event date end after ac.datep2
$sql .= " OR (";
$sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'";
if (!empty($eventDateEnd)) {
$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')";
}
$sql .= ")";
$sql .= ")";
$resql = $db->query($sql);
if (!$resql) {
$error++;
$object->error = $db->lasterror();
$object->errors[] = $object->error;
} else {
if ($db->num_rows($resql) > 0) {
// already in use
$error++;
$object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : ';
while ($obj = $db->fetch_object($resql)) {
$object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']');
}
$object->errors[] = $object->error;
}
$db->free($resql);
}
if ($error) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
if (! $error)
{
$db->begin();
@ -689,7 +748,7 @@ if ($action == 'create')
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '<input type="hidden" name="actioncode" value="'.dol_getIdFromCode($db, 'AC_OTH', 'c_actioncomm').'">';
if (GETPOST("actioncode") == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda');
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda');
else print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda');
dol_fiche_head();
@ -701,7 +760,7 @@ if ($action == 'create')
{
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
$default=(empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)?'':$conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1);
$formactions->select_type_actions(GETPOST("actioncode", 'aZ09')?GETPOST("actioncode", 'aZ09'):($object->type_code?$object->type_code:$default), "actioncode", "systemauto", 0, -1);
print '</td></tr>';
}
@ -731,7 +790,7 @@ if ($action == 'create')
{
$datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
}
print '<tr><td><span id="dateend"'.(GETPOST("actioncode") == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
print '<tr><td><span id="dateend"'.(GETPOST("actioncode", 'aZ09') == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} elseif (GETPOST("afaire") == 2) {
@ -1010,15 +1069,15 @@ if ($id > 0)
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority");
$object->priority = GETPOST("priority", "alphanohtml");
$object->fulldayevent= GETPOST("fullday")?1:0;
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->location = GETPOST('location', "alpanohtml");
$object->socid = GETPOST("socid", "int");
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
foreach ($socpeopleassigned as $tmpid) $object->socpeopleassigned[$id] = array('id' => $tmpid);
$object->contactid = GETPOST("contactid", 'int');
@ -1101,7 +1160,7 @@ if ($id > 0)
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
if ($object->type_code != 'AC_OTH_AUTO')
{
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode", "systemauto");
$formactions->select_type_actions(GETPOST("actioncode", 'aZ09')?GETPOST("actioncode", 'aZ09'):$object->type_code, "actioncode", "systemauto");
}
else
{

View File

@ -84,7 +84,7 @@ class CActionComm
$sql = "SELECT id, code, type, libelle as label, color, active, picto";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if (is_numeric($id)) $sql.= " WHERE id=".$id;
else $sql.= " WHERE code='".$id."'";
else $sql.= " WHERE code='".$this->db->escape($id)."'";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@ -607,9 +607,7 @@ if ($resql)
$event->fk_element=$obj->fk_element;
$event->elementtype=$obj->elementtype;
$event->societe->id=$obj->fk_soc;
$event->thirdparty_id=$obj->fk_soc;
$event->contact->id=$obj->fk_contact;
$event->contact_id=$obj->fk_contact;
// Defined date_start_in_calendar and date_end_in_calendar property
@ -1569,28 +1567,31 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
$thirdparty_id = ($event->thirdparty_id > 0 ? $event->thirdparty_id : ((is_object($event->societe) && $event->societe->id > 0) ? $event->societe->id : 0));
$contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->cotact->id > 0) ? $event->contact->id : 0));
// If action related to company / contact
$linerelatedto='';
if (! empty($event->societe->id) && $event->societe->id > 0)
if ($thirdparty_id > 0)
{
if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id]))
if (! isset($cachethirdparties[$thirdparty_id]) || ! is_object($cachethirdparties[$thirdparty_id]))
{
$thirdparty=new Societe($db);
$thirdparty->fetch($event->societe->id);
$cachethirdparties[$event->societe->id]=$thirdparty;
$thirdparty->fetch($thirdparty_id);
$cachethirdparties[$thirdparty_id]=$thirdparty;
}
else $thirdparty=$cachethirdparties[$event->societe->id];
else $thirdparty=$cachethirdparties[$thirdparty_id];
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1, '', 0);
}
if (! empty($event->contact->id) && $event->contact->id > 0)
if (! empty($contact_id) && $contact_id > 0)
{
if (! is_object($cachecontacts[$event->contact->id]))
if (! is_object($cachecontacts[$contact_id]))
{
$contact=new Contact($db);
$contact->fetch($event->contact->id);
$cachecontacts[$event->contact->id]=$contact;
$contact->fetch($contact_id);
$cachecontacts[$contact_id]=$contact;
}
else $contact=$cachecontacts[$event->contact->id];
else $contact=$cachecontacts[$contact_id];
if ($linerelatedto) $linerelatedto.='&nbsp;';
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1, '', 0);
}

View File

@ -835,7 +835,7 @@ else
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
// You ensure that every user is using its own SMTP server when using the mass emailing module.
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails_emailing.php">';
$linktoadminemailend='</a>';
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings');

View File

@ -335,15 +335,15 @@ class Mailing extends CommonObject
$target_array=array();
$sql = "SELECT fk_contact, ";
$sql.=" lastname, ";
$sql.=" firstname,";
$sql.=" email,";
$sql.=" other,";
$sql.=" source_url,";
$sql.=" source_id ,";
$sql.=" source_type ";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles ";
$sql = "SELECT fk_contact,";
$sql.= " lastname,";
$sql.= " firstname,";
$sql.= " email,";
$sql.= " other,";
$sql.= " source_url,";
$sql.= " source_id ,";
$sql.= " source_type";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$fromid;
$result=$this->db->query($sql);
@ -353,14 +353,16 @@ class Mailing extends CommonObject
{
while ($obj = $this->db->fetch_object($result)) {
$target_array[]=array('fk_contact'=>$obj->fk_contact,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'email'=>$obj->email,
'other'=>$obj->other,
'source_url'=>$obj->source_url,
'source_id'=>$obj->source_id,
'source_type'=>$obj->source_type);
$target_array[]=array(
'fk_contact'=>$obj->fk_contact,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'email'=>$obj->email,
'other'=>$obj->other,
'source_url'=>$obj->source_url,
'source_id'=>$obj->source_id,
'source_type'=>$obj->source_type
);
}
}
}
@ -370,7 +372,7 @@ class Mailing extends CommonObject
return -1;
}
$mailing_target->add_to_target($object->id, $target_array);
$mailing_target->addTargetsToDatabase($object->id, $target_array);
}
}

View File

@ -670,7 +670,7 @@ if (empty($reshook))
}
$qty = GETPOST('qty' . $predef);
$remise_percent = GETPOST('remise_percent' . $predef);
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
// Extrafields
$extrafieldsline = new ExtraFields($db);

View File

@ -6,7 +6,7 @@
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
@ -1110,7 +1110,27 @@ if ($resql)
$bankaccount = $cachebankaccount[$objp->bankid];
}
print '<tr class="oddeven">';
if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
$backgroundcolor = "class='oddeven'";
} else {
if ($objp->amount < 0)
{
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) {
$color = '#fca955';
} else {
$color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
}
$backgroundcolor = 'style="background-color: ' . $color . ';"';
} else {
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
$color = '#7fdb86';
} else {
$color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
}
$backgroundcolor = 'style="background-color: ' . $color . ';"';
}
}
print '<tr class="oddeven" '.$backgroundcolor.'>';
// Ref
if (! empty($arrayfields['b.rowid']['checked']))
@ -1356,7 +1376,7 @@ if ($resql)
// Debit
if (! empty($arrayfields['b.debit']['checked']))
{
print '<td class="right">';
print '<td class="nowrap right">';
if ($objp->amount < 0)
{
print price($objp->amount * -1);
@ -1370,7 +1390,7 @@ if ($resql)
// Credit
if (! empty($arrayfields['b.credit']['checked']))
{
print '<td class="right">';
print '<td class="nowrap right">';
if ($objp->amount > 0)
{
print price($objp->amount);

View File

@ -156,8 +156,6 @@ $title=$langs->trans("LT".$object->ltt) . " - " . $langs->trans("Card");
$help_url='';
llxHeader("", $title, $helpurl);
if ($action == 'create')
{
print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment", $mysoc->country_code));

View File

@ -85,6 +85,12 @@ $socid = GETPOST('socid', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
if (empty($local))
{
accessforbidden('Parameter localTaxType is missing');
exit;
}
/*
@ -106,11 +112,12 @@ llxHeader('', '', '', '', 0, 0, '', '', $morequerystring);
$name=$langs->transcountry($local==1?"LT1ReportByCustomers":"LT2ReportByCustomers", $mysoc->country_code);
$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
$fsearch ='<!-- hidden fields for form -->';
$fsearch.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.='<input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.='<input type="hidden" name="localTaxType" value="'.$local.'">';
$fsearch.=$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.='<input type="text" name="min" id="min" value="'.$min.'" size="6">';
$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport

View File

@ -188,6 +188,19 @@ function pt($db, $sql, $date)
}
}
if (empty($localTaxType))
{
accessforbidden('Parameter localTaxType is missing');
exit;
}
/*
* Actions
*/
// None
/*
* View
@ -213,7 +226,11 @@ if($localTaxType==1) {
$CalcLT= $conf->global->MAIN_INFO_LOCALTAX_CALC2;
}
$fsearch.=' <input type="hidden" name="localTaxType" value="'.$localTaxType.'">';
$fsearch = '<!-- hidden fields for form -->';
$fsearch.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.= '<input type="hidden" name="localTaxType" value="'.$localTaxType.'">';
$fsearch.= '<input type="hidden" name="modetax" value="'.$modetax.'">';
$description = $fsearch;
// Show report header
@ -528,7 +545,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
$total = $total + $diff;
$subtotal = price2num($subtotal + $diff, 'MT');
print '<td class="nowrap right">'.price(price2num($diff, 'MT')).'</td>\n';
print '<td class="nowrap right">'.price(price2num($diff, 'MT')).'</td>'."\n";
print "<td>&nbsp;</td>\n";
print "</tr>\n";

View File

@ -97,6 +97,12 @@ $socid = GETPOST('socid', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
if (empty($local))
{
accessforbidden('Parameter localTaxType is missing');
exit;
}
/*
@ -122,9 +128,10 @@ foreach ($listofparams as $param)
llxHeader('', $langs->trans("LocalTaxReport"), '', '', 0, 0, '', '', $morequerystring);
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=' <input type="hidden" name="localTaxType" value="'.$local.'">';
$fsearch = '<!-- hidden fields for form -->';
$fsearch.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.= '<input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.= '<input type="hidden" name="localTaxType" value="'.$local.'">';
$name=$langs->transcountry($local==1?"LT1ReportByQuarters":"LT2ReportByQuarters", $mysoc->country_code);
$calcmode='';
@ -161,7 +168,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description.='<br>'.$langs->trans("DepositsAreNotIncluded");
}
*/
if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='<br>'.$langs->trans("ThisIsAnEstimatedValue");
if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.=$langs->trans("ThisIsAnEstimatedValue");
// Customers invoices
$elementcust=$langs->trans("CustomersInvoices");
@ -186,15 +193,14 @@ if ($mysoc->tva_assuj) {
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
if($local==1){
$vatcust=$langs->transcountry("LocalTax1", $mysoc->country_code);
$vatsup=$langs->transcountry("LocalTax1", $mysoc->country_code);
$vatexpensereport=$langs->transcountry("LocalTax1", $mysoc->country_code);
$vatcust=$langs->transcountry("LT1", $mysoc->country_code);
$vatsup=$langs->transcountry("LT1", $mysoc->country_code);
$vatexpensereport=$langs->transcountry("LT1", $mysoc->country_code);
}else{
$vatcust=$langs->transcountry("LocalTax2", $mysoc->country_code);
$vatsup=$langs->transcountry("LocalTax2", $mysoc->country_code);
$vatexpensereport=$langs->transcountry("LocalTax2", $mysoc->country_code);
$vatcust=$langs->transcountry("LT2", $mysoc->country_code);
$vatsup=$langs->transcountry("LT2", $mysoc->country_code);
$vatexpensereport=$langs->transcountry("LT2", $mysoc->country_code);
}
// VAT Received and paid

View File

@ -813,7 +813,7 @@ class RemiseCheque extends CommonObject
$rejectedPayment->amounts = array();
$rejectedPayment->datepaye = $rejection_date;
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement', 'code', 'id', 1);
$rejectedPayment->num_paiement = $payment->numero;
$rejectedPayment->num_payment = $payment->num_payment;
while($obj = $db->fetch_object($resql))
{

View File

@ -117,6 +117,7 @@ class Paiement extends CommonObject
/**
* @var int bank account id of payment
* @deprecated
* @see $fk_account
*/
public $bank_account;
@ -182,7 +183,6 @@ class Paiement extends CommonObject
$this->ref = $obj->ref?$obj->ref:$obj->rowid;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_payment; // deprecated
$this->num_paiement = $obj->num_payment; // deprecated
$this->num_payment = $obj->num_payment;
$this->montant = $obj->amount; // deprecated
@ -286,10 +286,12 @@ class Paiement extends CommonObject
$total = $totalamount_converted; // Maybe use price2num with MT for the converted value
$mtotal = $totalamount;
}
$num_payment = ($this->num_payment?$this->num_payment:$this->num_paiement);
$note = ($this->note_public?$this->note_public:$this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id?"'".$this->db->escape($this->ext_payment_id)."'":"null").", ".($this->ext_payment_site?"'".$this->db->escape($this->ext_payment_site)."'":"null").", ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -885,7 +887,7 @@ class Paiement extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
$this->numero = $this->db->escape($num);
$this->num_payment = $this->db->escape($num);
return 0;
}
else

View File

@ -739,8 +739,11 @@ class BonPrelevement extends CommonObject
$sql = "SELECT count(f.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED;
$sql.= " AND f.entity IN (".getEntity('invoice').")";
$sql.= " WHERE f.entity IN (".getEntity('invoice').")";
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql.= " AND f.rowid = pfd.fk_facture";
$sql.= " AND pfd.traite = 0";
$sql.= " AND f.total_ttc > 0";

View File

@ -208,7 +208,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql.= " WHERE s.rowid = f.fk_soc";
$sql.= " AND f.entity IN (".getEntity('invoice').")";
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql.= " AND f.total_ttc > 0";
$sql.= " AND pfd.traite = 0";
$sql.= " AND pfd.fk_facture = f.rowid";

View File

@ -93,7 +93,10 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$status) $sql.= " AND pfd.traite = 0";
if ($status) $sql.= " AND pfd.traite = ".$status;
$sql.= " AND f.total_ttc > 0";
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql.= " AND pfd.fk_facture = f.rowid";
if (dol_strlen(trim(GETPOST('search_societe', 'alpha'))))
{

View File

@ -102,7 +102,10 @@ $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql.= " WHERE s.rowid = f.fk_soc";
$sql.= " AND f.entity IN (".getEntity('invoice').")";
$sql.= " AND f.total_ttc > 0";
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;

View File

@ -123,11 +123,11 @@ if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) {
llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring);
$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
$fsearch ='<!-- hidden fields for form -->';
$fsearch.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.='<input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch.=$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.='<input type="text" name="min" id="min" value="'.$min.'" size="6">';
// Show report header
$name=$langs->trans("VATReportByThirdParties");

View File

@ -198,7 +198,11 @@ $form=new Form($db);
$company_static=new Societe($db);
$tva = new Tva($db);
$description = '';
$fsearch ='<!-- hidden fields for form -->';
$fsearch.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.='<input type="hidden" name="modetax" value="'.$modetax.'">';
$description = $fsearch;
// Show report header
$name = $langs->trans("ReportByMonth");
@ -208,7 +212,7 @@ if ($modetax == 1) $calcmode=$langs->trans('OptionVATDebitOption');
if ($modetax == 2) $calcmode=$langs->trans('OptionPaymentForProductAndServices');
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')';
$description = $langs->trans("VATSummary").'<br>';
$description .= $langs->trans("VATSummary").'<br>';
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') $description.=$langs->trans("RulesVATDueProducts");
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts");
if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='<br>'.$langs->trans("RulesVATDueServices");

View File

@ -124,8 +124,9 @@ llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring);
//print load_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
$fsearch ='<!-- hidden fields for form -->';
$fsearch.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$fsearch.='<input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
//$fsearch.=' <input type="text" name="min" value="'.$min.'">';

View File

@ -433,7 +433,7 @@ if (empty($reshook))
}
$qty = GETPOST('qty'.$predef);
$remise_percent = GETPOST('remise_percent'.$predef);
$remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0);
if ($qty == '')
{
@ -566,7 +566,8 @@ if (empty($reshook))
$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))))
if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance))
|| empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))))
{
$object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency));
$result = -1 ;

View File

@ -173,7 +173,7 @@ class box_activity extends ModeleBoxes
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(
@ -256,7 +256,7 @@ class box_activity extends ModeleBoxes
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(
@ -340,7 +340,7 @@ class box_activity extends ModeleBoxes
);
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency)
);

View File

@ -134,7 +134,7 @@ class box_comptes extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="right nowraponall"',
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
);

View File

@ -179,12 +179,12 @@ class box_produits_alerte_stock extends ModeleBoxes
}
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="right nowraponall"',
'text' => $price,
);
$this->info_box_contents[$line][] = array(
'td' => 'class="nowrap"',
'td' => 'class="right"',
'text' => $price_base_type,
);

View File

@ -135,7 +135,7 @@ class box_supplier_orders extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="right nowrap"',
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);

View File

@ -156,6 +156,8 @@ class box_task extends ModeleBoxes
$sql.= " pt.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = ".Project::STATUS_VALIDATED;
$sql.= " AND (pt.progress < 100 OR pt.progress IS NULL ) "; // 100% is done and not displayed
$sql.= " AND p.usage_task = 1 ";
$sql.= " ORDER BY pt.datee ASC, pt.dateo ASC";
$sql.= $db->plimit($max, 0);

View File

@ -4517,7 +4517,7 @@ abstract class CommonObject
$parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams);
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if(empty($reshook))
{
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
@ -4902,13 +4902,12 @@ abstract class CommonObject
if (! is_array($optionsArray))
{
// If $extrafields is not a known object, we initialize it. Best practice is to have $extrafields defined into card.php or list.php page.
// TODO Use of existing $extrafield is not yet ready (must mutualize code that use extrafields in form first)
// global $extrafields;
//if (! is_object($extrafields))
//{
global $extrafields;
if (! isset($extrafields) || ! is_object($extrafields))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
//}
}
// Load array of extrafields for elementype = $this->table_element
if (empty($extrafields->attributes[$this->table_element]['loaded']))
@ -7625,18 +7624,20 @@ abstract class CommonObject
}
// Delete cascade first
foreach($this->childtablesoncascade as $table)
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error=$this->db->lasterror();
$this->errors[]=$this->error;
$this->db->rollback();
return -1;
}
}
if (! empty($this->childtablesoncascade)) {
foreach($this->childtablesoncascade as $table)
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error=$this->db->lasterror();
$this->errors[]=$this->error;
$this->db->rollback();
return -1;
}
}
}
if (! $error) {
if (! $notrigger) {
@ -7810,4 +7811,35 @@ abstract class CommonObject
}
}
}
/**
* copy related categories to another object
*
* @param int $fromId Id object source
* @param int $toId Id object cible
* @param string $type Type of category ('product', ...)
* @return int < 0 si erreur, > 0 si ok
*/
public function cloneCategories($fromId, $toId, $type = '')
{
$this->db->begin();
if (empty($type)) $type = $this->table_element;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorystatic = new Categorie($this->db);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type] . " (fk_categorie, fk_product)";
$sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type];
$sql.= " WHERE fk_product = '".$fromId."'";
if (! $this->db->query($sql))
{
$this->db->rollback();die($sql);
return -1;
}
$this->db->commit();
return 1;
}
}

View File

@ -552,9 +552,6 @@ class Conf
if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; // use dash between lines
if (! isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT=1; // allow html content into free footer text
// Set default value to MAIN_SHOW_LOGO
if (! isset($this->global->MAIN_SHOW_LOGO)) $this->global->MAIN_SHOW_LOGO=1;
// Default max file size for upload
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024);

View File

@ -1152,9 +1152,8 @@ class Form
$sql .= ", dictp.code as country_code";
}
$sql.= " FROM (".MAIN_DB_PREFIX ."societe as s";
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " )";
if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) {
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid=s.fk_pays";
}
@ -4238,7 +4237,7 @@ class Form
$formconfirm.= '<td class="valid">';
$formconfirm.= $this->selectyesno("confirm", $newselectedchoice);
$formconfirm.= '</td>';
$formconfirm.= '<td class="valid center"><input class="button valignmiddle" type="submit" onclick="this.disabled=\'disabled\' value="'.$langs->trans("Validate").'"></td>';
$formconfirm.= '<td class="valid center"><input class="button valignmiddle" type="submit" value="'.$langs->trans("Validate").'"></td>';
$formconfirm.= '</tr>'."\n";
$formconfirm.= '</table>'."\n";

View File

@ -609,7 +609,7 @@ class Ldap
}
if ($result <= 0)
{
$this->error = ldap_errno($this->connection)." ".ldap_error($this->connection)." ".$this->error;
$this->error = ldap_error($this->connection).' (Code '.ldap_errno($this->connection).") ".$this->error;
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
//print_r($info);
return -1;

View File

@ -334,6 +334,7 @@ class Link extends CommonObject
if($this->db->num_rows($resql) > 0)
{
$obj = $this->db->fetch_object($resql);
$this->id=$obj->rowid;
$this->entity = $obj->entity;
$this->datea = $this->db->jdate($obj->datea);
$this->url = $obj->url;

View File

@ -826,7 +826,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
}
else
{
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$db->free($result);
}

View File

@ -82,7 +82,6 @@ function getServerTimeZoneString()
*/
function getServerTimeZoneInt($refgmtdate = 'now')
{
global $conf;
if (method_exists('DateTimeZone', 'getOffset'))
{
// Method 1 (include daylight)
@ -329,6 +328,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date)
*/
function dol_stringtotime($string, $gm = 1)
{
$reg=array();
// Convert date with format DD/MM/YYY HH:MM:SS. This part of code should not be used.
if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $string, $reg))
{
@ -595,39 +595,47 @@ function dol_get_first_day_week($day, $month, $year, $gm = false)
}
/**
* Fonction retournant le nombre de jour feries, samedis et dimanches entre 2 dates entrees en timestamp. Dates must be UTC with hour, day, min to 0
* Return the number of non working days including saturday and sunday (or not) between 2 dates in timestamp.
* Dates must be UTC with hour, day, min to 0.
* Called by function num_open_day
*
* @param int $timestampStart Timestamp de debut
* @param int $timestampEnd Timestamp de fin
* @param string $countrycode Country code
* @param string $country_code Country code
* @param int $lastday Last day is included, 0: no, 1:yes
* @return int Nombre de jours feries
* @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes)
* @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes)
* @return int|string Number of non working days or error message string if error
* @see num_between_day(), num_open_day()
*/
function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0)
function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1)
{
global $conf;
global $db, $conf, $mysoc;
$nbFerie = 0;
$specialdayrule = array();
// Check to ensure we use correct parameters
if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates';
if (empty($country_code)) $country_code = $mysoc->country_code;
if ($includesaturday < 0) $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
if ($includesunday < 0) $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
$i=0;
while (( ($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd) )
&& ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop)
{
$ferie=false;
$countryfound=0;
$includesaturdayandsunday=1;
$jour = date("d", $timestampStart);
$mois = date("m", $timestampStart);
$annee = date("Y", $timestampStart);
// Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ...
// Do not use this anymore, use instead the dictionary of public holidays.
if (! empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS))
{
$arrayofdaystring=explode(',', $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS);
@ -645,29 +653,61 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
}
}
if ($countrycode == 'FR')
$country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid');
// Loop on public holiday defined into hrm_public_holiday
$sql = "SELECT code, entity, fk_country, dayrule, year, month, day, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday";
$sql.= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")";
$resql = $db->query($sql);
if ($resql)
{
$countryfound=1;
$num_rows = $db->num_rows($resql);
$i=0;
while ($i < $num_rows)
{
$obj = $db->fetch_object($resql);
// Definition of fixed working days
if($jour == 1 && $mois == 1) $ferie=true; // 1er january
if($jour == 1 && $mois == 5) $ferie=true; // 1er may
if($jour == 8 && $mois == 5) $ferie=true; // 5 may
if($jour == 14 && $mois == 7) $ferie=true; // 14 july
if($jour == 15 && $mois == 8) $ferie=true; // 15 august
if($jour == 1 && $mois == 11) $ferie=true; // 1 november
if($jour == 11 && $mois == 11) $ferie=true; // 11 november
if($jour == 25 && $mois == 12) $ferie=true; // 25 december
if (! empty($obj->dayrule) && $obj->dayrule != 'date') // For example 'easter', '...'
{
$specialdayrule[$obj->dayrule] = $obj->dayrule;
}
else
{
$match = 1;
if (! empty($obj->year) && $obj->year != $annee) $match = 0;
if ($obj->month != $mois) $match = 0;
if ($obj->day != $jour) $match = 0;
if ($match) $ferie = true;
}
$i++;
}
}
else
{
dol_syslog($db->lasterror(), LOG_ERR);
return 'Error sql '.$db->lasterror();
}
// Special dayrules
if (in_array('easter', $specialdayrule))
{
// Calculation for easter date
$date_paques = easter_date($annee);
$jour_paques = date("d", $date_paques);
$mois_paques = date("m", $date_paques);
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
// Pâques
// Easter (sunday)
}
if (in_array('eastermonday', $specialdayrule))
{
// Calculation for the monday of easter date
$date_lundi_paques = mktime(
$date_paques = easter_date($annee);
$date_lundi_paques = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
@ -677,11 +717,15 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
);
$jour_lundi_ascension = date("d", $date_lundi_paques);
$mois_lundi_ascension = date("m", $date_lundi_paques);
if($jour_lundi_ascension == $jour && $mois_lundi_ascension == $mois) $ferie=true;
// Lundi de Pâques
if ($jour_lundi_ascension == $jour && $mois_lundi_ascension == $mois) $ferie=true;
// Easter (monday)
}
// Calcul du jour de l'ascension (38 days after easter day)
$date_ascension = mktime(
if (in_array('ascension', $specialdayrule))
{
// Calcul du jour de l'ascension (39 days after easter day)
$date_paques = easter_date($annee);
$date_ascension = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
@ -692,10 +736,14 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
$jour_ascension = date("d", $date_ascension);
$mois_ascension = date("m", $date_ascension);
if($jour_ascension == $jour && $mois_ascension == $mois) $ferie=true;
// Ascension
// Ascension (thursday)
}
// Calculation of "Pentecote" (11 days after easter day)
$date_pentecote = mktime(
if (in_array('pentecote', $specialdayrule))
{
// Calculation of "Pentecote" (49 days after easter day)
$date_paques = easter_date($annee);
$date_pentecote = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
@ -706,71 +754,31 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
$jour_pentecote = date("d", $date_pentecote);
$mois_pentecote = date("m", $date_pentecote);
if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true;
// "Pentecote"
// "Pentecote" (sunday)
}
// Pentecoste and Ascensione in Italy go to the sunday after: isn't holiday.
// Pentecoste is 50 days after Easter, Ascensione 40
if ($countrycode == 'IT')
if (in_array('pentecotemonday', $specialdayrule))
{
$countryfound=1;
// Definition des dates feriees fixes
if($jour == 1 && $mois == 1) $ferie=true; // Capodanno
if($jour == 6 && $mois == 1) $ferie=true; // Epifania
if($jour == 25 && $mois == 4) $ferie=true; // Anniversario Liberazione
if($jour == 1 && $mois == 5) $ferie=true; // Festa del Lavoro
if($jour == 2 && $mois == 6) $ferie=true; // Festa della Repubblica
if($jour == 15 && $mois == 8) $ferie=true; // Ferragosto
if($jour == 1 && $mois == 11) $ferie=true; // Tutti i Santi
if($jour == 8 && $mois == 12) $ferie=true; // Immacolata Concezione
if($jour == 25 && $mois == 12) $ferie=true; // 25 decembre
if($jour == 26 && $mois == 12) $ferie=true; // Santo Stefano
// Calcul du jour de paques
// Calculation of "Pentecote" (49 days after easter day)
$date_paques = easter_date($annee);
$jour_paques = date("d", $date_paques);
$mois_paques = date("m", $date_paques);
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
// Paques
$date_pentecote = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 50,
date("Y", $date_paques)
);
$jour_pentecote = date("d", $date_pentecote);
$mois_pentecote = date("m", $date_pentecote);
if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true;
// "Pentecote" (monday)
}
if ($countrycode == 'IN')
if (in_array('viernessanto', $specialdayrule))
{
$countryfound=1;
if($jour == 1 && $mois == 1) $ferie=true; // New Year's Day
if($jour == 26 && $mois == 1) $ferie=true; // Republic Day
if($jour == 1 && $mois == 5) $ferie=true; // May Day
if($jour == 15 && $mois == 8) $ferie=true; // Independence Day
if($jour == 2 && $mois == 10) $ferie=true; // Gandhi Jayanti
if($jour == 25 && $mois == 12) $ferie=true; // Christmas
}
if ($countrycode == 'ES')
{
$countryfound=1;
// Definition des dates feriees fixes
if($jour == 1 && $mois == 1) $ferie=true; // Año nuevo
if($jour == 6 && $mois == 1) $ferie=true; // Día Reyes
if($jour == 1 && $mois == 5) $ferie=true; // 1 Mayo
if($jour == 15 && $mois == 8) $ferie=true; // 15 Agosto
if($jour == 12 && $mois == 10) $ferie=true; // Día Hispanidad
if($jour == 1 && $mois == 11) $ferie=true; // 1 noviembre
if($jour == 6 && $mois == 12) $ferie=true; // Constitución
if($jour == 8 && $mois == 12) $ferie=true; // Inmaculada
if($jour == 25 && $mois == 12) $ferie=true; // 25 diciembre
// Calcul día de Pascua
$date_paques = easter_date($annee);
$jour_paques = date("d", $date_paques);
$mois_paques = date("m", $date_paques);
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
// Paques
// Viernes Santo
$date_viernes = mktime(
$date_paques = easter_date($annee);
$date_viernes = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
@ -784,74 +792,11 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
//Viernes Santo
}
if ($countrycode == 'AT')
if (in_array('fronleichnam', $specialdayrule))
{
$countryfound=1;
// Definition des dates feriees fixes
if($jour == 1 && $mois == 1) $ferie=true; // Neujahr
if($jour == 6 && $mois == 1) $ferie=true; // Hl. 3 Koenige
if($jour == 1 && $mois == 5) $ferie=true; // 1. Mai
if($jour == 15 && $mois == 8) $ferie=true; // Mariae Himmelfahrt
if($jour == 26 && $mois == 10) $ferie=true; // 26. Oktober
if($jour == 1 && $mois == 11) $ferie=true; // Allerheiligen
if($jour == 8 && $mois == 12) $ferie=true; // Mariae Empfaengnis
if($jour == 24 && $mois == 12) $ferie=true; // Heilig abend
if($jour == 25 && $mois == 12) $ferie=true; // Christtag
if($jour == 26 && $mois == 12) $ferie=true; // Stefanietag
if($jour == 31 && $mois == 12) $ferie=true; // Silvester
// Easter calculation
$date_paques = easter_date($annee);
$jour_paques = date("d", $date_paques);
$mois_paques = date("m", $date_paques);
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
// Easter sunday
// Monday after easter
$date_eastermonday = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 1,
date("Y", $date_paques)
);
$jour_eastermonday = date("d", $date_eastermonday);
$mois_eastermonday = date("m", $date_eastermonday);
if($jour_eastermonday == $jour && $mois_eastermonday == $mois) $ferie=true;
// Easter monday
// Christi Himmelfahrt (39 days after easter sunday)
$date_ch = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 39,
date("Y", $date_paques)
);
$jour_ch = date("d", $date_ch);
$mois_ch = date("m", $date_ch);
if($jour_ch == $jour && $mois_ch == $mois) $ferie=true;
// Christi Himmelfahrt
// Pfingsten (50 days after easter sunday)
$date_pentecote = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 50,
date("Y", $date_paques)
);
$jour_pentecote = date("d", $date_pentecote);
$mois_pentecote = date("m", $date_pentecote);
if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true;
// Pfingsten
// Fronleichnam (60 days after easter sunday)
$date_fronleichnam = mktime(
$date_paques = easter_date($annee);
$date_fronleichnam = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
@ -866,15 +811,21 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR',
}
// If we have to include saturday and sunday
if ($includesaturdayandsunday)
if ($includesaturday || $includesunday)
{
$jour_julien = unixtojd($timestampStart);
$jour_semaine = jddayofweek($jour_julien, 0);
if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true;
//Saturday (6) and Sunday (0)
if ($includesaturday) //Saturday (6) and Sunday (0)
{
if ($jour_semaine == 6) $ferie=true;
}
if ($includesunday) //Saturday (6) and Sunday (0)
{
if($jour_semaine == 0) $ferie=true;
}
}
// On incremente compteur
// We increase the counter of non working day
if ($ferie) $nbFerie++;
// Increase number of days (on go up into loop)

View File

@ -3897,7 +3897,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages =
$now=dol_now();
print '<br><div class="center login_main_message"><div class="'.$morecss.'">';
print $langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now, '%Y%m%d'));
print $langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now, '%Y%m%d%H%M%S'));
if ($errormessage) print '<br><br>'.$errormessage;
if (is_array($errormessages) && count($errormessages))
{
@ -5753,20 +5753,6 @@ function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8')
return $nblines;
}
/**
* Same function than microtime in PHP 5 but compatible with PHP4
*
* @return float Time (millisecondes) with microsecondes in decimal part
* @deprecated Dolibarr does not support PHP4, you should use native function
* @see microtime()
*/
function dol_microtime_float()
{
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
return microtime(true);
}
/**
* Return if a text is a html content
*
@ -7279,7 +7265,7 @@ function printCommonFooter($zone = 'private')
{
print "\n";
print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n";
print 'jQuery(".menuhider").click(function(event) {';
print 'jQuery("li.menuhider").click(function(event) {';
print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n";
print ' console.log("We click on .menuhider");'."\n";
print ' $("body").toggleClass("sidebar-collapse")'."\n";

View File

@ -565,7 +565,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// resume
print '<td class="right">';
print getTaskProgressView($taskstatic, false, false);
if ($lines[$i]->progress != '' && $lines[$i]->duration) {
print getTaskProgressView($taskstatic, false, false);
}
print '</td>';
if ($showbilltime)
@ -664,12 +666,48 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
if ($projectidfortotallink > 0) print '</a>';
print '</td>';
if ($total_projectlinesa_planned) {
$totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2);
$totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2);
// this conf is actually hidden, by default we use 1% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01;
// define progress color according to time spend vs workload
$progressBarClass = 'progress-bar-info';
$badgeClass = 'badge ';
if ($totalCalculatedProgress > $totalAverageDeclaredProgress) {
$progressBarClass = 'progress-bar-danger';
$badgeClass.= 'badge-danger';
} elseif ($totalCalculatedProgress * $warningRatio >= $totalAverageDeclaredProgress) { // warning if close at 1%
$progressBarClass = 'progress-bar-warning';
$badgeClass.= 'badge-warning';
} else {
$progressBarClass = 'progress-bar-success';
$badgeClass.= 'badge-success';
}
}
print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %';
if ($total_projectlinesa_planned) print $totalCalculatedProgress.' %';
print '</td>';
print '<td class="nowrap liste_total right">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2).' %';
if ($total_projectlinesa_planned) print '<span class="'.$badgeClass.'" >'.$totalAverageDeclaredProgress.' %</span>';
print '</td>';
// resume
print '<td class="right">';
if ($total_projectlinesa_planned) {
print '</span>';
print ' <div class="progress sm" title="'.$totalAverageDeclaredProgress.'%" >';
print ' <div class="progress-bar '.$progressBarClass.'" style="width: '.$totalAverageDeclaredProgress.'%"></div>';
print ' </div>';
print '</div>';
}
print '</td>';
if ($showbilltime)
{
print '<td class="nowrap liste_total right">';

View File

@ -124,7 +124,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$invoicefieldref='ref';
}
if ( strpos($type, 'localtax') === 0 ) {
if (strpos($type, 'localtax') === 0) {
$f_rate = $type . '_tx';
} else {
$f_rate = 'tva_tx';

View File

@ -55,7 +55,7 @@ function dolStripPhpCode($str, $replacewith = '')
//remove content before closing tag
if (count($partlings) > 1) $partlings[0] = ''; // Todo why a count > 1 and not >= 1 ?
//append to out string
$newstr .= '<span class="phptag">'.$replacewith.'<!-- '.$phppart.' --></span>'.implode('', $partlings);
$newstr .= '<span class="phptag" class="tooltip" title="'.dol_escape_htmltag(dolGetFirstLineOfText($phppart).'...').'">'.$replacewith.'<!-- '.$phppart.' --></span>'.implode('', $partlings);
}
}
}

View File

@ -53,8 +53,8 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
if (empty($noout)) print_start_menu_array_auguria();
$usemenuhider = 1;
global $usemenuhider;
$usemenuhider = 1;
// Show/Hide vertical menu
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
@ -265,8 +265,8 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]);
$leftmenu=($forceleftmenu?'':(empty($_SESSION["leftmenu"])?'none':$_SESSION["leftmenu"]));
$usemenuhider = 0;
global $usemenuhider;
$usemenuhider = 0;
// Show logo company
if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))

View File

@ -55,22 +55,23 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
$usemenuhider = 1;
// Show/Hide vertical menu
// Show/Hide vertical menu. The hamburger icon for .menuhider action.
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$showmode=1;
$classname = 'class="tmenu menuhider"';
$idsel='menu';
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
$menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '<span class="fa fa-bars"></span>' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
}
$menu_arr = array();
// Home
$menu_arr[] = array(
'name' => 'Home',
'link' => '/index.php?mainmenu=home&amp;leftmenu=home',
'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? '&nbsp; <span class="fa fa-home"></span> &nbsp;' : "Home") ,
'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '<span class="fa fa-home"></span>' : "Home") ,
'level' => 0,
'enabled' => $showmode = 1,
'target' => $atarget,
@ -176,7 +177,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
$menu_arr[] = array(
'name' => 'TMenuMRP',
'link' => '/mrp/index.php?mainmenu=mrp&amp;leftmenu=',
'title' => $langs->trans("TMenuMRP"),
'title' => "TMenuMRP",
'level' => 0,
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
'target' => $atarget,
@ -473,8 +474,30 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
$menu->liste = dol_sort_array($menu->liste, 'position');
// Output menu entries
// Show logo company
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
}
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
}
$title=$langs->trans("GoIntoSetupToChangeLogo");
print "\n".'<!-- Show logo on menu -->'."\n";
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1);
print '<div class="center backgroundforcompanylogo"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
print_end_menu_entry(4);
}
if (empty($noout)) {
foreach($menu->liste as $menkey => $menuval) {
foreach($menu->liste as $menuval) {
print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
print_end_menu_entry($menuval['enabled']);
@ -615,30 +638,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$usemenuhider = 0;
// Show logo company
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
}
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
}
$title=$langs->trans("GoIntoSetupToChangeLogo");
print "\n".'<!-- Show logo on menu -->'."\n";
print '<div class="blockvmenuimpair blockvmenulogo">'."\n";
print '<div class="menu_titre" id="menu_titre_logo"></div>';
print '<div class="menu_top" id="menu_top_logo"></div>';
print '<div class="menu_contenu" id="menu_contenu_logo">';
print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n";
print '</div>';
print '<div class="menu_end" id="menu_end_logo"></div>';
print '</div>'."\n";
}
if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page
{
print "\n";
@ -1580,8 +1579,17 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write);
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read);
$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom');
}
if (! empty($conf->mrp->enabled))
{
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo');
$newmenu->add("/mrp/mo_card.php?leftmenu=mo&amp;action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo');
$newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo');
}
}

View File

@ -61,7 +61,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* @var string Family
* @see familyinfo
* @see $familyinfo
*
* Native values: 'crm', 'financial', 'hr', 'projects', 'products', 'ecm', 'technic', 'other'.
* Use familyinfo to declare a custom value.
@ -70,7 +70,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* @var array Custom family informations
* @see family
* @see $family
*
* e.g.:
* array(
@ -259,26 +259,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/
public $core_enabled;
/**
* @var string Relative path to module style sheet
* @deprecated
* @see module_parts
*/
public $style_sheet = '';
/**
* @var 0|1|2|3 Where to display the module in setup page
* @deprecated @since 4.0.0
* @see family
* @see familyinfo
*
* 0: common
* 1: interface
* 2: others
* 3: very specific
*/
public $special;
/**
* @var string Name of image file used for this module
*
@ -297,20 +277,20 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* @var string[] List of module class names that must be enabled if this module is enabled.
*
* e.g.: array('modAnotherModule', 'FR'=>'modYetAnotherModule')
* @var string[] List of module class names that must be enabled if this module is enabled. e.g.: array('modAnotherModule', 'FR'=>'modYetAnotherModule')
* @see $requiredby
*/
public $depends;
/**
* @var int[] List of module ids to disable if this one is disabled.
* @var string[] List of module class names to disable if the module is disabled.
* @see $depends
*/
public $requiredby;
/**
* @var string[] List of module class names as string this module is in conflict with.
* @see depends
* @see $depends
*/
public $conflictwith;
@ -915,7 +895,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* Gives the last date of activation
*
* @return timestamp|string Date of last activation
* @return int|string Date of last activation or '' if module was never activated
*/
public function getLastActivationDate()
{

View File

@ -43,6 +43,9 @@ $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0',
$target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n');
// ----- Your code end here -----
and call the method
parent::addTargetsToDatabase($mailing_id, $target);
***** STEP 3 *****

View File

@ -65,7 +65,7 @@ class mailing_advthirdparties extends MailingTargets
// phpcs:enable
global $conf, $langs;
dol_syslog(get_class($this)."::add_to_target socid=".var_export($socid, true).' contactid='.var_export($contactid, true));
dol_syslog(get_class($this)."::add_to_target_spec socid=".var_export($socid, true).' contactid='.var_export($contactid, true));
$cibles = array();
@ -86,9 +86,8 @@ class mailing_advthirdparties extends MailingTargets
$num = $this->db->num_rows($result);
$i = 0;
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found", LOG_DEBUG);
dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found", LOG_DEBUG);
$old = '';
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
@ -142,9 +141,8 @@ class mailing_advthirdparties extends MailingTargets
$num = $this->db->num_rows($result);
$i = 0;
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found");
$old = '';
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
@ -177,8 +175,9 @@ class mailing_advthirdparties extends MailingTargets
}
dol_syslog(get_class($this)."::add_to_target mailing cibles=".var_export($cibles, true), LOG_DEBUG);
return parent::add_to_target($mailing_id, $cibles);
dol_syslog(get_class($this)."::add_to_target_spec mailing cibles=".var_export($cibles, true), LOG_DEBUG);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}

View File

@ -447,6 +447,6 @@ class mailing_contacts1 extends MailingTargets
return -1;
}
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}
}

View File

@ -80,7 +80,7 @@ class mailing_example extends MailingTargets
// ----- Your code end here -----
return parent::add_to_target($mailing_id, $target);
return parent::addTargetsToDatabase($mailing_id, $target);
}

View File

@ -315,6 +315,6 @@ class mailing_fraise extends MailingTargets
return -1;
}
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}
}

View File

@ -151,17 +151,15 @@ class MailingTargets // This can't be abstract as it is used for some method
return $nb;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Ajoute destinataires dans table des cibles
* Add a list of targets int the database
*
* @param int $mailing_id Id of emailing
* @param array $cibles Array with targets
* @return int < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id, $cibles)
public function addTargetsToDatabase($mailing_id, $cibles)
{
// phpcs:enable
global $conf;
$this->db->begin();

View File

@ -217,6 +217,6 @@ class mailing_pomme extends MailingTargets
return -1;
}
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}
}

View File

@ -190,7 +190,7 @@ class mailing_thirdparties extends MailingTargets
return -1;
}
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}

View File

@ -159,7 +159,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
// ----- Your code end here -----
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}

View File

@ -221,6 +221,6 @@ class mailing_xinputfile extends MailingTargets
ini_set('auto_detect_line_endings', false);
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}
}

View File

@ -143,7 +143,7 @@ class mailing_xinputuser extends MailingTargets
'source_type' => 'file'
);
return parent::add_to_target($mailing_id, $cibles);
return parent::addTargetsToDatabase($mailing_id, $cibles);
}
else
{

View File

@ -93,7 +93,7 @@ class modBlockedLog extends DolibarrModules
$this->always_enabled = (!empty($conf->blockedlog->enabled)
&& !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)
&& in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
&& $this->alreadyUsed(1));
&& $this->alreadyUsed());
// Constants
//-----------

View File

@ -66,7 +66,7 @@ class modBom extends DolibarrModules
$this->descriptionlong = "Bill of Materials definitions. They can be used to make Manufacturing Resource Planning";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'experimental';
$this->version = 'dolibarr';
//Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
@ -105,7 +105,7 @@ class modBom extends DolibarrModules
// Dependencies
$this->hidden = false; // A condition to hide module
$this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("mrp");
//$this->phpmin = array(5,4); // Minimum version of PHP required by module

View File

@ -316,17 +316,21 @@ class modStock extends DolibarrModules
$this->import_fields_array[$r]=array('e.ref'=>"LocationSummary*",
'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse",
'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode',
'e.statut'=>'Status'
'e.statut'=>'Status',
'e.fk_parent'=>'ParentWarehouse'
);
$this->import_convertvalue_array[$r]=array(
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry')
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
'e.fk_parent'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'ref')
);
$this->import_regex_array[$r]=array('e.statut'=>'^[0|1]');
$this->import_examplevalues_array[$r]=array('e.ref'=>"ALM001",
'e.description'=>"Central Warehouse",'e.lieu'=>"Central",
'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US',
'e.statut'=>'1');
'e.statut'=>'1',
'e.fk_parent'=>''
);
// Import stocks
$r++;

View File

@ -208,7 +208,7 @@ if ($permission) {
if ($tab[$i]['source']=='external')
{
$contactstatic->fetch($tab[$i]['id']);
echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0, '', 'valignmiddle');
echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0);
}
?>
</div>

View File

@ -1,147 +0,0 @@
<?php
/*
* Copyright (C) 2014-2016 Jean-François Ferry <hello@librethic.io>
* 2016 Christophe Battarel <christophe@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/>.
*/
/**
* \file htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php
* \ingroup core
* \brief File of trigger for IFTTT module
*/
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
/**
* Class of triggers for IFTTT module
*/
class InterfaceIFTTT extends DolibarrTriggers
{
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
$this->db = $db;
$this->name = preg_replace('/^Interface/i', '', get_class($this));
$this->family = "ifttt";
$this->description = "Triggers of the module IFTTT";
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
$this->picto = 'ifttt';
}
/**
* Return name of trigger file
*
* @return string Name of trigger file
*/
public function getName()
{
return $this->name;
}
/**
* Return description of trigger file
*
* @return string Description of trigger file
*/
public function getDesc()
{
return $this->description;
}
/**
* Return version of trigger file
*
* @return string Version of trigger file
*/
public function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') {
return $langs->trans("Development");
} elseif ($this->version == 'experimental') {
return $langs->trans("Experimental");
} elseif ($this->version == 'dolibarr') {
return DOL_VERSION;
} elseif ($this->version) {
return $this->version;
} else {
return $langs->trans("Unknown");
}
}
/**
* Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers
*
* @param string $action Event action code
* @param Object $object Object
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
$ok = 0;
if (empty($conf->ifttt->enabled)) return 0; // Module not active, we do nothing
switch ($action) {
case 'THIRDPARTY_CREATED':
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
// See https://platform.ifttt.com/docs/api_reference#realtime-api
$arrayofdata=array();
$arrayofdata['user_id']=$conf->global->IFTTT_USER_ID;
$arrayofdata['trigger_identity']=$conf->global->IFTTT_TRIGGER_IDENTITY;
$arrayofdata['name']='testabcdef';
$arrayofdata['email']='testemailabcdef';
$url = 'https://realtime.ifttt.com/v1/notifications';
$addheaders=array(
'IFTTT-Service-Key'=>'123',
'Accept'=>'application/json',
'Accept-Charset'=>'utf-8',
'Accept-Encoding'=>'gzip, deflate',
'Content-Type'=>'application/json',
'X-Request-ID'=>getRandomPassword(true, null)
);
$result = getURLContent($url, 'POSTALREADYFORMATED', '', 1, $addheaders);
$ok = 1;
break;
}
return $ok;
}
}

View File

@ -1262,7 +1262,13 @@ if ($action == 'create')
if ($line->fk_product > 0)
{
print '<!-- Show warehouse selection -->';
print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1);
$stockMin = false;
if (empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) {
$stockMin = 0;
}
print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', '', 1, $stockMin, 'stock DESC, e.ref');
if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id)
{
//print $stock.' '.$quantityToBeDelivered;

View File

@ -152,7 +152,7 @@ if (empty($dolibarr_strict_mode)) $dolibarr_strict_mode=0; // For debug in php s
// See also option $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN for a stronger CSRF protection.
if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck))
{
if (! empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'GET' && ! empty($_SERVER['HTTP_HOST']))
if (! empty($_SERVER['REQUEST_METHOD']) && ! in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) && ! empty($_SERVER['HTTP_HOST']))
{
$csrfattack=false;
if (empty($_SERVER['HTTP_REFERER'])) $csrfattack=true; // An evil browser was used
@ -165,8 +165,8 @@ if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck))
if ($csrfattack)
{
//print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER'];
print "Access refused by CSRF protection in main.inc.php. Referer of form is outside server that serve the POST.\n";
print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n";
print "Access refused by CSRF protection in main.inc.php. Referer of form (".$_SERVER['HTTP_REFERER'].") is outside the server that serve this page (with method = ".$_SERVER['REQUEST_METHOD'].").\n";
print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n";
die;
}
}

View File

@ -605,8 +605,9 @@ if ($object->id > 0)
$sql2.= ' WHERE c.fk_soc = s.rowid';
$sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")";
$sql2.= ' AND s.rowid = '.$object->id;
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql2.= " AND c.fk_statut IN (5)";
// Show orders with status validated, shipping started and delivered (even if any order we can bill).
//$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")";
$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/orderstoinvoice.php
$sql2.= " AND c.billed = 0";
// Find order that are not already invoiced
// just need to check received status because we have the billed status now
@ -826,7 +827,7 @@ if ($object->id > 0)
{
if (! empty($orders2invoice) && $orders2invoice > 0)
{
if ($object->status == 1)
if ($object->status == 1) // Company is open
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
}
@ -835,7 +836,7 @@ if ($object->id > 0)
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
}
}
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice").' ('.$langs->trans("WithReceptionFinished").')').'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
}
// Add action

View File

@ -88,7 +88,7 @@ class PaiementFourn extends Paiement
$sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql.= ' c.code as paiement_code, c.libelle as paiement_type,';
$sql.= ' p.num_paiement, p.note, b.fk_account';
$sql.= ' p.num_paiement as num_payment, p.note, b.fk_account';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
@ -113,12 +113,15 @@ class PaiementFourn extends Paiement
$this->entity = $obj->entity;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_paiement;
$this->num_paiement = $obj->num_paiement;
$this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
$this->bank_account = $obj->fk_account;
$this->fk_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount;
$this->amount = $obj->amount;
$this->note = $obj->note;
$this->note_private = $obj->note;
$this->type_code = $obj->paiement_code;
$this->type_libelle = $obj->paiement_type;
$this->statut = $obj->statut;

View File

@ -2502,11 +2502,18 @@ elseif (! empty($object->id))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
}
elseif (!empty($object->linkedObjectsIds['invoice_supplier']))
else
{
if ($user->rights->fournisseur->facture->creer)
if (!empty($object->linkedObjectsIds['invoice_supplier']))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
if ($user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NeedAtLeastOneInvoice")).'">'.$langs->trans("ClassifyBilled").'</a>';
}
}
}

View File

@ -1093,7 +1093,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@ -1158,6 +1158,8 @@ if ($resql)
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
else print '<td></td>';
}
print '</tr>';
}

View File

@ -73,18 +73,27 @@ $date_endy = dol_mktime(23, 59, 59, $_REQUEST["date_end_delymonth"], $_REQUEST["
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('facture_fourn');
if ($action == 'create')
{
if (! is_array($selected))
if (! GETPOST('createbill'))
{
$error++;
setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors');
} else {
$origin = GETPOST('origin');
$originid = GETPOST('originid');
$action = '';
}
else
{
if (! is_array($selected))
{
//$error++;
setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors');
$action = '';
} else {
$origin = GETPOST('origin', 'alpha');
$originid = GETPOST('originid', 'int');
}
}
}
@ -286,7 +295,6 @@ if (($action == 'create' || $action == 'add') && ! $error) {
$html = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
// Mode creation
if ($action == 'create' && !$error) {
@ -324,6 +332,8 @@ if ($action == 'create' && !$error) {
print '<input name="ref_int" type="hidden" value="' . $ref_int . '">';
print '<input type="hidden" name="origin" value="' . GETPOST('origin') . '">';
print '<input type="hidden" name="originid" value="' . GETPOST('originid') . '">';
print '<input type="hidden" name="socid" value="' . $soc->id . '">';
print '<table class="border" width="100%">';
// Ref
@ -333,13 +343,6 @@ if ($action == 'create' && !$error) {
print '<tr><td class="fieldrequired">' . $langs->trans('RefSupplier') . '</td><td><input name="ref_supplier" value="' . dol_escape_htmltag(isset($_POST['ref_supplier']) ? GETPOST('ref_supplier', 'alpha', 2) : '') . '" type="text"></td>';
print '</tr>';
// Third party
print '<tr><td class="fieldrequired">' . $langs->trans('Customer') . '</td><td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="' . $soc->id . '">';
print '</td>';
print '</tr>' . "\n";
// Date invoice
print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
print $html->selectDate('', '', '', '', '', "add", 1, 1);
@ -387,18 +390,19 @@ if ($action == 'create' && !$error) {
// Public note
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
print '<td valign="top" colspan="2">';
print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
print '<td colspan="2">';
print '<textarea name="note_public" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">';
print $langs->trans("Orders") . ": " . implode(', ', $listoforders);
print '</textarea></td></tr>';
// Private note
if (empty($user->societe_id)) {
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
print '<td valign="top" colspan="2">';
print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
print '<td colspan="2">';
print '<textarea name="note" wrap="soft" cols="70" rows="' . ROWS_3 . '">';
print '</textarea></td></tr>';
@ -406,10 +410,10 @@ if ($action == 'create' && !$error) {
print '</table>';
while ( $i < $n ) {
while ($i < $n) {
print '<input type="hidden" name="orders_to_invoice[]" value="' . $orders_id[$i] . '">';
$i ++;
$i++;
}
// Button "Create Draft"
@ -446,7 +450,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
$sql .= ' AND c.fk_soc = s.rowid';
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql .= " AND c.fk_statut IN (5)";
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/card.php
$sql .= " AND c.billed = 0";
// Find order that are not already invoiced
@ -465,10 +469,16 @@ if (($action != 'create' && $action != 'add') && !$error) {
}
// Date filter
if ($date_start && $date_end)
$sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "' AND c.date_commande <= '" . $db->idate($date_end) . "'";
if ($date_starty && $date_endy)
$sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "' AND c.date_livraison <= '" . $db->idate($date_endy) . "'";
//$sql.= dolSqlDateFilter("c.date_commande", GETPOST("date_startday", 'int'), GETPOST("date_startmonth", 'int'), GETPOST("date_startyear", 'int'));
//$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear);
if ($date_start)
$sql .= " AND c.date_commande >= '" . $db->idate($date_start) . "'";
if ($date_end)
$sql .= " AND c.date_commande <= '" . $db->idate($date_end) . "'";
if ($date_starty)
$sql .= " AND c.date_livraison >= '" . $db->idate($date_starty) . "'";
if ($date_endy)
$sql .= " AND c.date_livraison <= '" . $db->idate($date_endy) . "'";
if (! empty($sref_client)) {
$sql .= natural_search('c.ref_supplier', $sref_client);
@ -484,21 +494,21 @@ if (($action != 'create' && $action != 'add') && !$error) {
}
$title = $langs->trans('ListOfSupplierOrders');
$title .= ' - ' . $langs->trans('StatusOrderReceivedAllShort');
$title .= ' - ' . $soc->getNomUrl(1, 'supplier');
$num = $db->num_rows($resql);
print load_fiche_titre($title);
$i = 0;
$period = $html->selectDate($date_start, 'date_start', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_end, 'date_end', 0, 0, 1, '', 1, 0);
$periodely = $html->selectDate($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0) . ' - ' . $html->selectDate($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0);
if (! empty($socid)) {
// Company
$companystatic->id = $socid;
$companystatic->nom = $soc->nom;
print '<h3>' . $companystatic->getNomUrl(1, 'customer') . '</h3>';
}
print '<form name="orders2invoice" method="GET" action="orderstoinvoice.php">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="socid" value="' . $socid . '">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', 'orderstoinvoice.php', 'c.ref', '', '&amp;socid=' . $socid, '', $sortfield, $sortorder);
@ -511,10 +521,12 @@ if (($action != 'create' && $action != 'add') && !$error) {
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
// REF
print '<input class="flat" size="10" type="text" name="sref" value="' . $sref . '">';
print '</td>';
// print '<td class="liste_titre">';
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="10" name="sref_client" value="' . $sref_client . '">';
@ -604,7 +616,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="origin" value="order_supplier"><br>';
// print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
print '<input type="submit" class="butAction" value="' . $langs->trans("GenerateBill") . '">';
print '<input type="submit" class="butAction" name="createbill" value="' . $langs->trans("GenerateBill") . '">';
print '</div>';
print '</div>';

View File

@ -0,0 +1,9 @@
To upgrade ckeditor:
- Go on web site.
- Choose profile "Online builder"
- Choose Full package
- Add plugin SourceDialog (for "source" button on edit inline)
- Choose skin mona-lisa
- Choose all languages
- Download
- Repalce files and remove dir 'samples'.

View File

@ -1,6 +1,60 @@
CKEditor 4 Changelog
====================
## CKEditor 4.12.1
Fixed Issues:
* [#3220](https://github.com/ckeditor/ckeditor-dev/issues/3220): Fixed: Prevent [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) filter from deleting [Page Break](https://ckeditor.com/cke4/addon/pagebreak) elements on paste.
## CKEditor 4.12
New Features:
* [#2598](https://github.com/ckeditor/ckeditor-dev/issues/2598): Added the [Page Break](https://ckeditor.com/cke4/addon/pagebreak) feature support for the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin.
* [#1490](https://github.com/ckeditor/ckeditor-dev/issues/1490): Improved the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin to retain table cell borders.
* [#2870](https://github.com/ckeditor/ckeditor-dev/issues/2870): Improved support for preserving the indentation of list items for nested lists pasted with the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin.
* [#2048](https://github.com/ckeditor/ckeditor-dev/issues/2048): New [`CKEDITOR.config.image2_maxSize`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-image2_maxSize) configuration option for the [Enhanced Image](https://ckeditor.com/cke4/addon/image2) plugin that allows setting a maximum size that an image can be resized to with the resizer.
* [#2639](https://github.com/ckeditor/ckeditor-dev/issues/2639): The [Color Dialog](https://ckeditor.com/cke4/addon/colordialog) plugin now shows the current selection's color when opened.
* [#2084](https://github.com/ckeditor/ckeditor-dev/issues/2084): The [Table Tools](https://ckeditor.com/cke4/addon/tabletools) plugin now allows to change the cell height unit type to either pixels or percent.
* [#3164](https://github.com/ckeditor/ckeditor-dev/issues/3164): The [Table Tools](https://ckeditor.com/cke4/addon/tabletools) plugin now accepts floating point values as the table cell width and height.
Fixed Issues:
* [#2672](https://github.com/ckeditor/ckeditor-dev/issues/2672): Fixed: When resizing an [Enhanced Image](https://ckeditor.com/cke4/addon/image2) to a minimum size with the resizer, the image dialog does not show actual values.
* [#1478](https://github.com/ckeditor/ckeditor-dev/issues/1478): Fixed: Custom colors added to [Color Button](https://ckeditor.com/cke4/addon/colorbutton) with the [`config.colorButton_colors`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-colorButton_colors) configuration option in the form of a label or code do not work correctly.
* [#1469](https://github.com/ckeditor/ckeditor-dev/issues/1469): Fixed: Trying to get data from a nested editable inside a freshly pasted widget throws an error.
* [#2235](https://github.com/ckeditor/ckeditor-dev/issues/2235): Fixed: An [Image](https://ckeditor.com/cke4/addon/image) in a table cell has an empty URL field when edited from the context menu opened by right-click when the [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin is in use.
* [#3098](https://github.com/ckeditor/ckeditor-dev/issues/3098): Fixed: Unit pickers for table cell width and height in the [Table Tools](https://ckeditor.com/cke4/addon/tabletools) plugin have a different width.
* [#2923](https://github.com/ckeditor/ckeditor-dev/issues/2923): Fixed: The CSS `windowtext` color is not correctly recognized by the [`CKEDITOR.tools.style.parse`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_style_parse.html) methods.
* [#3120](https://github.com/ckeditor/ckeditor-dev/issues/3120): [IE8] Fixed: The [`CKEDITOR.tools.extend()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tool.html#method-extend) method does not work with the [`DontEnum`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Properties) object property attribute.
* [#2813](https://github.com/ckeditor/ckeditor-dev/issues/2813): Fixed: Editor HTML insertion methods ([`editor.insertHtml()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertHtml), [`editor.insertHtmlIntoRange()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertHtmlIntoRange), [`editor.insertElement()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertElement) and [`editor.insertElementIntoRange()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertElementIntoRange)) pollute the editable with empty `<span>` elements.
* [#2751](https://github.com/ckeditor/ckeditor-dev/issues/2751): Fixed: An editor with [`config.enterMode`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-enterMode) set to [`ENTER_DIV`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#property-ENTER_DIV) alters pasted content.
API Changes:
* [#1496](https://github.com/ckeditor/ckeditor-dev/issues/1496): The [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) plugin exposes the [`CKEDITOR.ui.balloonToolbar.reposition()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_balloonToolbar.html#reposition) and [`CKEDITOR.ui.balloonToolbarView.reposition()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_balloonToolbarView.html#reposition) methods.
* [#2021](https://github.com/ckeditor/ckeditor-dev/issues/2021): Added new [`CKEDITOR.dom.documentFragment.find()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dom_documentFragment.html#method-find) and [`CKEDITOR.dom.documentFragment.findOne()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dom_documentFragment.html#method-findOne) methods.
* [#2700](https://github.com/ckeditor/ckeditor-dev/issues/2700): Added the [`CKEDITOR.tools.array.find()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_array.html#method-find) method.
* [#3123](https://github.com/ckeditor/ckeditor-dev/issues/3123): Added the [`CKEDITOR.tools.object.keys()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_object.html#method-keys) method.
* [#3123](https://github.com/ckeditor/ckeditor-dev/issues/3123): Added the [`CKEDITOR.tools.object.entries()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_object.html#method-entries) method.
* [#3123](https://github.com/ckeditor/ckeditor-dev/issues/3123): Added the [`CKEDITOR.tools.object.values()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_object.html#method-values) method.
* [#2821](https://github.com/ckeditor/ckeditor-dev/issues/2821): The [`CKEDITOR.template#source`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_template.html#property-source) property can now be a function, so it can return the changed template values during the runtime. Thanks to [Jacek Pulit](https://github.com/jacek-pulit)!
* [#2598](https://github.com/ckeditor/ckeditor-dev/issues/2598): Added the [`CKEDITOR.plugins.pagebreak.createElement()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_pagebreak.html#method-createElement) method allowing to create a [Page Break](https://ckeditor.com/cke4/addon/pagebreak) plugin [`CKEDITOR.dom.element`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dom_element.html) instance.
* [#2748](https://github.com/ckeditor/ckeditor-dev/issues/2748): Enhanced error messages thrown when creating an editor on a non-existent element or when trying to instantiate the second editor on the same element. Thanks to [Byran Zaugg](https://github.com/blzaugg)!
* [#2698](https://github.com/ckeditor/ckeditor-dev/issues/2698): Added the [`CKEDITOR.htmlParser.element.findOne()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_htmlParser_element.html#method-findOne) method.
* [#2935](https://github.com/ckeditor/ckeditor-dev/issues/2935): Introduced the [`CKEDITOR.config.pasteFromWord_keepZeroMargins`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-pasteFromWord_keepZeroMargins) configuration option that allows for keeping any `margin-*: 0` style that would be otherwise removed when pasting content with the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin.
* [#2962](https://github.com/ckeditor/ckeditor-dev/issues/2962): Added the [`CKEDITOR.tools.promise`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_promise.html) class.
* [#2924](https://github.com/ckeditor/ckeditor-dev/issues/2924): Added the [`CKEDITOR.tools.style.border`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_style_border.html) object wrapping CSS border style helpers under a single type.
* [#2495](https://github.com/ckeditor/ckeditor-dev/issues/2495): The [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin can now be disabled for the given table with the `data-cke-tableselection-ignored` attribute.
* [#2692](https://github.com/ckeditor/ckeditor-dev/issues/2692): Plugins can now expose information about the supported environment by implementing the [`pluginDefinition.isSupportedEnvironment()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_pluginDefinition.html#method-isSupportedEnvironment) method.
Other Changes:
* [#2741](https://github.com/ckeditor/ckeditor-dev/issues/2741): Replaced deprecated `arguments.callee` calls with named function expressions to allow the editor to work in strict mode.
* [#2924](https://github.com/ckeditor/ckeditor-dev/issues/2924): Marked [`CKEDITOR.tools.style.parse.border()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_style_parse.html#method-border) as deprecated in favor of the [`CKEDITOR.tools.style.border.fromCssRule()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_style_border.html#static-method-fromCssRule) method.
* [#3132](https://github.com/ckeditor/ckeditor-dev/issues/2924): Marked [`CKEDITOR.tools.objectKeys()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-objectKeys) as deprecated in favor of the [`CKEDITOR.tools.object.keys()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_object.html#method-keys) method.
## CKEditor 4.11.4
Fixed Issues:
@ -270,6 +324,7 @@ Fixed Issues:
* [#1570](https://github.com/ckeditor/ckeditor-dev/issues/1570): Fixed: Fake selection allows cutting content in read-only mode using the <kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>X</kbd> keys.
* [#1363](https://github.com/ckeditor/ckeditor-dev/issues/1363): Fixed: Paste notification is unclear and it might confuse users.
API Changes:
* [#1346](https://github.com/ckeditor/ckeditor-dev/issues/1346): [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) [context manager API](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.plugins.balloontoolbar.contextManager.html) is now available in the [`pluginDefinition.init()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_pluginDefinition.html#method-init) method of the [requiring](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_pluginDefinition.html#property-requires) plugin.
@ -899,7 +954,7 @@ New Features:
* Direct access to clipboard could only be implemented in Chrome, Safari on Mac OS, Opera and Firefox. In other browsers the pastebin must still be used.
* [#12875](https://dev.ckeditor.com/ticket/12875): Samples and toolbar configuration tools.
* The old set of samples shipped with every CKEditor package was replaced with a shiny new single-page sample. This change concluded a long term plan which started from introducing the [CKEditor SDK](https://ckeditor.com/docs/ckeditor4/latest/examples/index.html) and [CKEditor Functionality Overview](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_features.html) section in the documentation which essentially redefined the old samples.
* The old set of samples shipped with every CKEditor package was replaced with a shiny new single-page sample. This change concluded a long term plan which started from introducing the [CKEditor SDK](https://ckeditor.com/docs/ckeditor4/latest/examples/index.html) and [CKEditor Features Overview](https://ckeditor.com/docs/ckeditor4/latest/features.html) section in the documentation which essentially redefined the old samples.
* Toolbar configurators with live previews were introduced. They will be shipped with every CKEditor package and are meant to help in configuring toolbar layouts.
* [#10925](https://dev.ckeditor.com/ticket/10925): The [Media Embed](https://ckeditor.com/cke4/addon/embed) and [Semantic Media Embed](https://ckeditor.com/cke4/addon/embedsemantic) plugins were introduced. Read more about the new features in the [Embedding Content](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_media_embed.html) article.

View File

@ -40,6 +40,7 @@ The following libraries are included in CKEditor under the MIT license (see Appe
* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2019, CKSource - Frederico Knabben.
* PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca.
* CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others.
* ES6Promise - Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors.
Parts of code taken from the following libraries are included in CKEditor under the MIT license (see Appendix D):

View File

@ -3,8 +3,8 @@
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);
ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,9999);
else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
[d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).submit();return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);

View File

@ -1,10 +0,0 @@
{
"name": "ckeditor",
"description": "JavaScript WYSIWYG web text editor.",
"keywords": [ "ckeditor", "fckeditor", "editor", "wysiwyg", "html", "richtext", "text", "javascript" ],
"authors": "CKSource (http://cksource.com/)",
"license": "For licensing, see LICENSE.md or http://ckeditor.com/license.",
"homepage": "http://ckeditor.com",
"main": "./ckeditor.js",
"moduleType": "globals"
}

View File

@ -13,10 +13,10 @@
* (1) https://ckeditor.com/cke4/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) https://ckeditor.com/cke4/builder/c3fc0dcaa9c80d707aab3e60fdcddbfb
* (2) https://ckeditor.com/cke4/builder/c0b7b44e9f5c0f0cac8bacb78b968de8
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) https://ckeditor.com/cke4/builder/download/c3fc0dcaa9c80d707aab3e60fdcddbfb
* (3) https://ckeditor.com/cke4/builder/download/c0b7b44e9f5c0f0cac8bacb78b968de8
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
@ -102,6 +102,7 @@ var CKBUILDER_CONFIG = {
'showborders' : 1,
'smiley' : 1,
'sourcearea' : 1,
'sourcedialog' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
@ -116,75 +117,8 @@ var CKBUILDER_CONFIG = {
'wysiwygarea' : 1
},
languages : {
'af' : 1,
'ar' : 1,
'az' : 1,
'bg' : 1,
'bn' : 1,
'bs' : 1,
'ca' : 1,
'cs' : 1,
'cy' : 1,
'da' : 1,
'de' : 1,
'de-ch' : 1,
'el' : 1,
'en' : 1,
'en-au' : 1,
'en-ca' : 1,
'en-gb' : 1,
'eo' : 1,
'es' : 1,
'es-mx' : 1,
'et' : 1,
'eu' : 1,
'fa' : 1,
'fi' : 1,
'fo' : 1,
'fr' : 1,
'fr-ca' : 1,
'gl' : 1,
'gu' : 1,
'he' : 1,
'hi' : 1,
'hr' : 1,
'hu' : 1,
'id' : 1,
'is' : 1,
'it' : 1,
'ja' : 1,
'ka' : 1,
'km' : 1,
'ko' : 1,
'ku' : 1,
'lt' : 1,
'lv' : 1,
'mk' : 1,
'mn' : 1,
'ms' : 1,
'nb' : 1,
'nl' : 1,
'no' : 1,
'oc' : 1,
'pl' : 1,
'pt' : 1,
'pt-br' : 1,
'ro' : 1,
'ru' : 1,
'si' : 1,
'sk' : 1,
'sl' : 1,
'sq' : 1,
'sr' : 1,
'sr-latn' : 1,
'sv' : 1,
'th' : 1,
'tr' : 1,
'tt' : 1,
'ug' : 1,
'uk' : 1,
'vi' : 1,
'zh' : 1,
'zh-cn' : 1
'fr' : 1
}
};

File diff suppressed because one or more lines are too long

View File

@ -1,20 +0,0 @@
{
"name": "ckeditor/ckeditor",
"description": "JavaScript WYSIWYG web text editor.",
"type": "library",
"keywords": [ "ckeditor", "fckeditor", "editor", "wysiwyg", "html", "richtext", "text", "javascript" ],
"homepage": "http://ckeditor.com",
"license": [ "GPL-2.0+", "LGPL-2.1+", "MPL-1.1+" ],
"authors": [
{
"name": "CKSource",
"homepage": "http://cksource.com"
}
],
"support": {
"issues": "http://dev.ckeditor.com",
"forum": "http://ckeditor.com/forums",
"wiki": "http://docs.ckeditor.com",
"source": "http://github.com/ckeditor/ckeditor-dev"
}
}

View File

@ -7,4 +7,4 @@ CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};
};

View File

@ -1,63 +0,0 @@
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
af.js Found: 62 Missing: 4
ar.js Found: 51 Missing: 15
bg.js Found: 58 Missing: 8
bn.js Found: 40 Missing: 26
bs.js Found: 29 Missing: 37
ca.js Found: 61 Missing: 5
cs.js Found: 66 Missing: 0
cy.js Found: 66 Missing: 0
da.js Found: 66 Missing: 0
de.js Found: 66 Missing: 0
el.js Found: 59 Missing: 7
en-au.js Found: 38 Missing: 28
en-ca.js Found: 37 Missing: 29
en-gb.js Found: 61 Missing: 5
eo.js Found: 66 Missing: 0
es.js Found: 66 Missing: 0
et.js Found: 66 Missing: 0
eu.js Found: 48 Missing: 18
fa.js Found: 66 Missing: 0
fi.js Found: 66 Missing: 0
fo.js Found: 66 Missing: 0
fr-ca.js Found: 42 Missing: 24
fr.js Found: 66 Missing: 0
gl.js Found: 40 Missing: 26
gu.js Found: 66 Missing: 0
he.js Found: 66 Missing: 0
hi.js Found: 43 Missing: 23
hr.js Found: 66 Missing: 0
hu.js Found: 63 Missing: 3
is.js Found: 41 Missing: 25
it.js Found: 66 Missing: 0
ja.js Found: 62 Missing: 4
ka.js Found: 62 Missing: 4
km.js Found: 40 Missing: 26
ko.js Found: 40 Missing: 26
lt.js Found: 66 Missing: 0
lv.js Found: 40 Missing: 26
mk.js Found: 0 Missing: 66
mn.js Found: 40 Missing: 26
ms.js Found: 39 Missing: 27
nb.js Found: 66 Missing: 0
nl.js Found: 65 Missing: 1
no.js Found: 66 Missing: 0
pl.js Found: 66 Missing: 0
pt-br.js Found: 66 Missing: 0
pt.js Found: 52 Missing: 14
ro.js Found: 61 Missing: 5
ru.js Found: 66 Missing: 0
sk.js Found: 49 Missing: 17
sl.js Found: 48 Missing: 18
sr-latn.js Found: 40 Missing: 26
sr.js Found: 40 Missing: 26
sv.js Found: 62 Missing: 4
th.js Found: 40 Missing: 26
tr.js Found: 66 Missing: 0
ug.js Found: 66 Missing: 0
uk.js Found: 66 Missing: 0
vi.js Found: 66 Missing: 0
zh-cn.js Found: 66 Missing: 0
zh.js Found: 58 Missing: 8

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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