Skip to content

Commit

Permalink
Merge remote-tracking branch 'uptream/develop' into 7.0-general_ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Nov 1, 2017
2 parents 7a719c6 + 4220d02 commit 7c0ff3a
Show file tree
Hide file tree
Showing 223 changed files with 32,545 additions and 4,359 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -79,7 +79,7 @@ matrix:
notifications:
email:
on_success: never # [always|never|change] default: change
on_failure: change # [always|never|change] default: always
on_failure: never # [always|never|change] default: always
irc:
channels:
- "chat.freenode.net#dolibarr"
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Expand Up @@ -36,7 +36,7 @@ Stripe 4.7.0 MIT licence Yes
JS libraries:
jQuery 3.1.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.4 GPL and Apache License Yes JS library plugin for sexier multiselect
jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
jQuery Flot 0.8.3 MIT License Yes JS library to build graph
Expand Down
27 changes: 27 additions & 0 deletions ChangeLog
Expand Up @@ -28,6 +28,33 @@ Following changes may create regressions for some external modules, but were nec
* Remove js library fileupload that was not used by core code.


***** ChangeLog for 6.0.3 compared to 6.0.2 *****
FIX: #7211 Update qty dispatched on qty change
FIX: #7458
FIX: #7593
FIX: #7616
FIX: #7619
FIX: #7626
FIX: #7648
FIX: #7675
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: API to get object does not return data of linked objects
FIX: Bad localtax apply
FIX: Bad ressource list in popup in gantt view
FIX: bankentries search conciliated if val 0
FIX: hook formObjectOptions() must use $expe and not $object which i…
FIX: hook formObjectOptions() must use $expe and not $object which is an order here
FIX: make of link to other object during creation
FIX: Missing function getLinesArray
FIX: old batch not shown in multi shipping
FIX: paid supplier invoices are shown as abandoned
FIX: selection of thirdparty was lost on stats page of invoices
FIX: sql syntax error because of old field accountancy_journal
FIX: Stats on invoices show nothing
FIX: substitution in ODT of thirdparties documents
FIX: wrong key in selectarray
FIX: wrong personnal project time spent

***** ChangeLog for 6.0.2 compared to 6.0.1 *****
FIX: #7148
FIX: #7288
Expand Down
51 changes: 33 additions & 18 deletions dev/initdata/purge-data.php
Expand Up @@ -78,15 +78,17 @@
'DELETE FROM '.MAIN_DB_PREFIX.'propaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'propal',
),
'supplier_order'=>array(
'supplier_proposal'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposal',
),
'supplier_order'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet',
'DELETE FROM '.MAIN_DB_PREFIX.'commande_fournisseur',
),
'supplier_invoice'=>array(
'supplier_invoice'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det',
'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposaldet',
'DELETE FROM '.MAIN_DB_PREFIX.'supplier_proposal',
),
'delivery'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'livraisondet',
Expand Down Expand Up @@ -114,8 +116,10 @@
'DELETE FROM '.MAIN_DB_PREFIX.'product_lang',
'DELETE FROM '.MAIN_DB_PREFIX.'product_price',
'DELETE FROM '.MAIN_DB_PREFIX.'product_fournisseur_price',
'DELETE FROM '.MAIN_DB_PREFIX.'product_stock',
'DELETE FROM '.MAIN_DB_PREFIX.'product',
'DELETE FROM '.MAIN_DB_PREFIX.'product_batch',
'DELETE FROM '.MAIN_DB_PREFIX.'product_stock',
'DELETE FROM '.MAIN_DB_PREFIX.'product_lot',
'DELETE FROM '.MAIN_DB_PREFIX.'product',
),
'project'=>array(
'DELETE FROM '.MAIN_DB_PREFIX.'projet_task_time',
Expand All @@ -128,12 +132,13 @@
),
'thirdparty'=>array(
'@contact',
'DELETE FROM '.MAIN_DB_PREFIX.'cabinetmed_cons',
'DELETE FROM '.MAIN_DB_PREFIX.'cabinetmed_cons',
'UPDATE '.MAIN_DB_PREFIX.'adherent SET fk_soc = NULL',
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_fournisseur',
'DELETE FROM '.MAIN_DB_PREFIX.'categorie_societe',
'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except',
'DELETE FROM '.MAIN_DB_PREFIX.'societe',
'DELETE FROM '.MAIN_DB_PREFIX.'societe_rib',
'DELETE FROM '.MAIN_DB_PREFIX.'societe',
)
);

Expand All @@ -152,27 +157,37 @@
$option = $argv[2];

if (empty($mode) || ! in_array($mode,array('test','confirm'))) {
print "Usage: $script_file (test|confirm) (all|option)\n";
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',',array_keys($sqls))."\n";
exit(-1);
}

if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) {
print "Usage: $script_file (test|confirm) (all|option)\n";
print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',',array_keys($sqls))."\n";
exit(-1);
}

// Replace database handler
if (! empty($argv[3]))
{
$db->close();
unset($db);
$db=getDoliDBInstance($argv[3], $argv[4], $argv[5], $argv[6], $argv[7], $argv[8]);
$user=new User($db);
}

//var_dump($user->db->database_name);
$ret=$user->fetch('','admin');
if (! $ret > 0)
{
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
print 'An admin user with login "admin" must exists to use this script.'."\n";
exit;
}
$user->getrights();
//$user->getrights();


print "Purge all data for this database:\n";
print "Server = ".$db->database_host."\n";
Expand All @@ -190,14 +205,14 @@

/**
* Process sql requests of a family
*
*
* @param string $family Name of family key of array $sqls
* @return int -1 if KO, 1 if OK
*/
function processfamily($family)
{
global $db, $sqls;

$error=0;
foreach($sqls[$family] as $sql)
{
Expand All @@ -207,7 +222,7 @@ function processfamily($family)
processfamily($newfamily);
continue;
}

print "Run sql: ".$sql."\n";
$resql=$db->query($sql);
if (! $resql)
Expand All @@ -217,15 +232,15 @@ function processfamily($family)
$error++;
}
}

if ($error)
{
print $db->lasterror();
$error++;
break;
}
}

if ($error) return -1;
else return 1;
}
Expand All @@ -242,7 +257,7 @@ function processfamily($family)
$oldfamily = $family;

$result=processfamily($family);
if ($result < 0)
if ($result < 0)
{
$error++;
break;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/class/accountingjournal.class.php
Expand Up @@ -29,7 +29,7 @@ class AccountingJournal extends CommonObject
public $element='accounting_journal';
public $table_element='accounting_journal';
public $fk_element = '';
protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

var $rowid;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/class/adherent.class.php
Expand Up @@ -43,7 +43,7 @@ class Adherent extends CommonObject
{
public $element='member';
public $table_element='adherent';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

var $mesgs;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/list.php
Expand Up @@ -130,7 +130,7 @@
{
foreach($extrafields->attribute_label as $key => $val)
{
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
}
}

Expand Down
53 changes: 39 additions & 14 deletions htdocs/admin/agenda.php
Expand Up @@ -38,6 +38,7 @@
$action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');

$search_event = GETPOST('search_event', 'alpha');

// Get list of triggers available
$sql = "SELECT a.rowid, a.code, a.label, a.elementtype";
Expand Down Expand Up @@ -70,6 +71,12 @@
* Actions
*/

// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_event = '';
}

if ($action == "save" && empty($cancel))
{
$i=0;
Expand All @@ -78,10 +85,13 @@

foreach ($triggers as $trigger)
{
$param='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
$keyparam='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
//print "param=".$param." - ".$_POST[$param];
$res = dolibarr_set_const($db,$param,(GETPOST($param,'alpha')?GETPOST($param,'alpha'):''),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $keyparam))
{
$res = dolibarr_set_const($db,$keyparam,(GETPOST($keyparam,'alpha')?GETPOST($keyparam,'alpha'):''),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}

if (! $error)
Expand Down Expand Up @@ -140,6 +150,8 @@
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="save">';

$param = '';
$param.= '&search_event='.urlencode($search_event);

$head=agenda_prepare_head();

Expand All @@ -151,8 +163,19 @@

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ActionsEvents").'</td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=selectall">'.$langs->trans("All").'</a>/<a href="'.$_SERVER["PHP_SELF"].'?action=selectnone">'.$langs->trans("None").'</a>';
print '<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).'"></td>';
print '<td class="liste_titre"></td>';
// Action column
print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
print '</tr>'."\n";
print '<tr class="liste_titre">';
print '<th class="liste_titre">'.$langs->trans("ActionsEvents").'</th>';
print '<th class="liste_titre"></th>';
print '<th class="liste_titre"><a href="'.$_SERVER["PHP_SELF"].'?action=selectall'.($param?$param:'').'">'.$langs->trans("All").'</a>/<a href="'.$_SERVER["PHP_SELF"].'?action=selectnone'.($param?$param:'').'">'.$langs->trans("None").'</a></th>';
print '</tr>'."\n";
// Show each trigger (list is in c_action_trigger)
if (! empty($triggers))
Expand All @@ -173,15 +196,17 @@
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue;
if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue;


print '<tr class="oddeven">';
print '<td>'.$trigger['code'].'</td>';
print '<td>'.$trigger['label'].'</td>';
print '<td align="right" width="40">';
$key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
$value=$conf->global->$key;
print '<input class="oddeven" type="checkbox" name="'.$key.'" value="1"'.((($action=='selectall'||$value) && $action!="selectnone")?' checked':'').'>';
print '</td></tr>'."\n";
if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $trigger['code']))
{
print '<tr class="oddeven">';
print '<td>'.$trigger['code'].'</td>';
print '<td>'.$trigger['label'].'</td>';
print '<td align="right" width="40">';
$key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
$value=$conf->global->$key;
print '<input class="oddeven" type="checkbox" name="'.$key.'" value="1"'.((($action=='selectall'||$value) && $action!="selectnone")?' checked':'').'>';
print '</td></tr>'."\n";
}
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions htdocs/admin/agenda_other.php
Expand Up @@ -352,6 +352,15 @@
}
print '</td></tr>'."\n";

// AGENDA_DEFAULT_VIEW
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print '</td></tr>'."\n";

if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{

Expand Down Expand Up @@ -381,15 +390,6 @@
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
print '</td></tr>'."\n";

// AGENDA_DEFAULT_VIEW
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print '</td></tr>'."\n";

print '</table>';

dol_fiche_end();
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/chequereceipts.php
Expand Up @@ -258,14 +258,14 @@

$var=! $var;

$substitutionarray=pdf_getSubstitutionArray($langs);
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';

print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext).'<br>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/commande.php
Expand Up @@ -539,7 +539,7 @@
print "</tr>\n";
$var=true;

$substitutionarray=pdf_getSubstitutionArray($langs);
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
Expand All @@ -550,7 +550,7 @@
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ORDER_FREE_TEXT">';
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext).'<br>';
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
$variablename='ORDER_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
Expand All @@ -573,7 +573,7 @@
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMARK\">";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext);
print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
print '</td><td align="right">';
Expand Down

0 comments on commit 7c0ff3a

Please sign in to comment.