Merge remote-tracking branch 'origin/3.7' into 3.7_bug
This commit is contained in:
commit
7ec13c9435
@ -11,6 +11,7 @@ make a Dolibarr upgrade.
|
||||
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
||||
FIX [ bug #2855 ] Wrong translation key in localtax report page
|
||||
FIX [ bug #1852 ] JS error when editing a customer order line
|
||||
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
|
||||
|
||||
***** ChangeLog for 3.7.1 compared to 3.7.* *****
|
||||
FIX Bug in the new photo system
|
||||
@ -265,6 +266,7 @@ Dolibarr better:
|
||||
- Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme
|
||||
- Fix: [ bug #2542 ] Contracts store localtax preferences
|
||||
- Fix: Bad permission assignments for stock movements actions
|
||||
- Fix: [ bug #2891 ] Category hooks do not work
|
||||
|
||||
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
||||
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
|
||||
@ -439,6 +441,11 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec
|
||||
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
|
||||
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
|
||||
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
|
||||
Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selected by the UI
|
||||
Fix: [ bug #2861 ] Undefined variable $res when migrating
|
||||
Fix: [ bug #2837 ] Product list table column header does not match column body
|
||||
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
|
||||
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
|
||||
|
||||
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
|
||||
Fix: Avoid missing class error for fetch_thirdparty method #1973
|
||||
|
||||
@ -456,10 +456,10 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||
# Removed known external modules to avoir any error when packaging on test env
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
|
||||
@ -44,8 +44,8 @@ $langs->load("cashdesk");
|
||||
<!-- Affichage de la reference et de la designation -->
|
||||
<td><input class="texte_ref" type="text" id ="txtRef" name="txtRef" value="<?php echo $obj_facturation->ref() ?>"
|
||||
onchange="javascript: setSource('REF');"
|
||||
onkeyup="javascript: verifResultat('resultats_dhtml', this.value, <?php echo (! empty($conf->global->BARCODE_USE_SEARCH_TO_SELECT)?(int)$conf->global->BARCODE_USE_SEARCH_TO_SELECT:1) ?>);"
|
||||
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (! empty($conf->global->BARCODE_USE_SEARCH_TO_SELECT)?(int)$conf->global->BARCODE_USE_SEARCH_TO_SELECT:1) ?>);"
|
||||
onkeyup="javascript: verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
|
||||
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
|
||||
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
|
||||
</td>
|
||||
<td class="select_design">
|
||||
|
||||
@ -64,6 +64,10 @@ $object = new Categorie($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -56,6 +56,9 @@ $object = new Categorie($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -63,6 +63,9 @@ $type=$object->type;
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -66,7 +66,7 @@ class PropaleStats extends Stats
|
||||
|
||||
$this->field='total_ht';
|
||||
$this->field_line='total_ht';
|
||||
|
||||
|
||||
$this->where.= " p.fk_statut > 0";
|
||||
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
|
||||
$this->where.= " AND p.entity = ".$conf->entity;
|
||||
@ -183,7 +183,7 @@ class PropaleStats extends Stats
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return nb, amount of predefined product for year
|
||||
@ -193,9 +193,11 @@ class PropaleStats extends Stats
|
||||
*/
|
||||
function getAllByProduct($year)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
|
||||
$sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
|
||||
@ -204,5 +206,5 @@ class PropaleStats extends Stats
|
||||
//$sql.= $this->db->plimit(20);
|
||||
|
||||
return $this->_getAllByProduct($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ $form->select_comptes($account_to,'account_to',0,'',1);
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>";
|
||||
$form->select_date((isset($dateo) ? $dateo : ''),'','','','','add');
|
||||
$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
|
||||
print "</td>\n";
|
||||
print '<td><input name="label" class="flat" type="text" size="40" value="'.$label.'"></td>';
|
||||
print '<td><input name="amount" class="flat" type="text" size="8" value="'.$amount.'"></td>';
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.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
|
||||
@ -18,7 +19,6 @@
|
||||
* \file htdocs/core/boxes/box_task.php
|
||||
* \ingroup Projet
|
||||
* \brief Module to Task activity of the current year
|
||||
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
|
||||
@ -39,11 +39,11 @@ class box_task extends ModeleBoxes
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function box_task()
|
||||
{
|
||||
global $langs;
|
||||
@ -120,8 +120,7 @@ class box_task extends ModeleBoxes
|
||||
|
||||
|
||||
// Add the sum à the bottom of the boxes
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
||||
|
||||
@ -81,7 +81,7 @@ abstract class CommonObject
|
||||
|
||||
$sql = "SELECT rowid, ref, ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
||||
$sql.= " WHERE entity IN (".getEntity($element).")" ;
|
||||
$sql.= " WHERE entity IN (".getEntity($element,1).")" ;
|
||||
|
||||
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
|
||||
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
|
||||
|
||||
@ -394,9 +394,9 @@ class Form
|
||||
$htmltext=str_replace("\n","",$htmltext);
|
||||
|
||||
$htmltext=str_replace('"',""",$htmltext);
|
||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'" '; // Attribut to put on td img tag to store tooltip
|
||||
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
||||
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'" '; // Attribut to put on td tag to store tooltip
|
||||
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||
$s="";
|
||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||
|
||||
@ -124,7 +124,7 @@ class FormProjets
|
||||
}
|
||||
else if ($obj->fk_statut == 2)
|
||||
{
|
||||
if ($discard_close == 2) $disabled=1;
|
||||
if ($discard_closed == 2) $disabled=1;
|
||||
$labeltoshow.=' - '.$langs->trans("Closed");
|
||||
}
|
||||
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
|
||||
|
||||
@ -400,7 +400,7 @@ class RssParser
|
||||
{
|
||||
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
$itemLink = (string) $item['link']['href'];
|
||||
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
|
||||
$itemTitle = (string) $item['title'];
|
||||
$itemDescription = (string) $item['summary'];
|
||||
$itemPubDate = (string) $item['created'];
|
||||
@ -409,7 +409,7 @@ class RssParser
|
||||
}
|
||||
else
|
||||
{
|
||||
$itemLink = (string) $item['link']['href'];
|
||||
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
|
||||
$itemTitle = (string) $item['title'];
|
||||
$itemDescription = (string) $item['summary'];
|
||||
$itemPubDate = (string) $item['created'];
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
// \brief File that include javascript functions used when dispatching batch-enabled product
|
||||
//
|
||||
|
||||
function AddLineBatch(index) {
|
||||
function addLineBatch(index) {
|
||||
var nme = 'dluo_0_'+index;
|
||||
$row=$("tr[name='"+nme+"']").clone(true);
|
||||
$row.find("input[name^='qty']").val('');
|
||||
|
||||
@ -181,7 +181,7 @@ function dol_shutdown()
|
||||
global $conf,$user,$langs,$db;
|
||||
$disconnectdone=false; $depth=0;
|
||||
if (is_object($db) && ! empty($db->connected)) { $depth=$db->transaction_opened; $disconnectdone=$db->close(); }
|
||||
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_DEBUG));
|
||||
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_INFO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
|
||||
{
|
||||
global $langs, $hselected;
|
||||
global $langs;
|
||||
|
||||
print "\n\n<!-- debut cartouche rapport -->\n";
|
||||
|
||||
@ -48,7 +48,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
||||
$head[$h][1] = $langs->trans("Report");
|
||||
$head[$h][2] = 'report';
|
||||
|
||||
dol_fiche_head($head, $hselected);
|
||||
dol_fiche_head($head, 'report');
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
foreach($moreparam as $key => $value)
|
||||
|
||||
@ -210,7 +210,7 @@ class modUser extends DolibarrModules
|
||||
$this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs';
|
||||
$this->export_permission[$r]=array(array("user","user","export"));
|
||||
$this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_societe'=>"IdCompany",'u.fk_member'=>"MemberId");
|
||||
$this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_societe'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:nom");
|
||||
$this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_societe'=>"Text",'u.fk_member'=>"Text");
|
||||
|
||||
$this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_societe'=>"company",'u.fk_member'=>"member");
|
||||
if (empty($conf->adherent->enabled))
|
||||
|
||||
@ -194,7 +194,7 @@ else {
|
||||
</td>
|
||||
|
||||
<td align="right"><?php
|
||||
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">0';
|
||||
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
|
||||
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
|
||||
?>
|
||||
</td>
|
||||
|
||||
@ -46,7 +46,6 @@ class Export
|
||||
|
||||
// To store export modules
|
||||
var $hexa;
|
||||
var $hexafilter;
|
||||
var $hexafiltervalue;
|
||||
var $datatoexport;
|
||||
var $model_name;
|
||||
@ -627,9 +626,6 @@ class Export
|
||||
$this->db->begin();
|
||||
|
||||
$filter='';
|
||||
if (! empty($this->hexafilter) && ! empty($this->hexafiltervalue)) {
|
||||
$filter = json_encode(array('field' => $this->hexafilter, 'value' => $this->hexafiltervalue));
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'export_model (';
|
||||
$sql.= 'label,';
|
||||
@ -638,12 +634,12 @@ class Export
|
||||
$sql.= 'filter';
|
||||
$sql.= ') VALUES (';
|
||||
$sql.= "'".$this->db->escape($this->model_name)."',";
|
||||
$sql.= "'".$this->datatoexport."',";
|
||||
$sql.= "'".$this->hexa."',";
|
||||
$sql.= (! empty($filter)?"'".$filter."'":"null");
|
||||
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
||||
$sql.= "'".$this->db->escape($this->hexa)."',";
|
||||
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Export::create", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -667,7 +663,7 @@ class Export
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = 'SELECT em.rowid, em.field, em.label, em.type, em.filter';
|
||||
$sql = 'SELECT em.rowid, em.label, em.type, em.field, em.filter';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
|
||||
$sql.= ' WHERE em.rowid = '.$id;
|
||||
|
||||
@ -679,13 +675,11 @@ class Export
|
||||
if ($obj)
|
||||
{
|
||||
$this->id = $obj->rowid;
|
||||
$this->hexa = $obj->field;
|
||||
$this->model_name = $obj->label;
|
||||
$this->datatoexport = $obj->type;
|
||||
|
||||
$filter = json_decode($obj->filter, true);
|
||||
$this->hexafilter = (isset($filter['field'])?$filter['field']:'');
|
||||
$this->hexafiltervalue = (isset($filter['value'])?$filter['value']:'');
|
||||
|
||||
$this->hexa = $obj->field;
|
||||
$this->hexafiltervalue = $obj->filter;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ $entitytolang = array(
|
||||
);
|
||||
|
||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||
$array_filtervalue=isset($_SESSION["export_FilterValue_fields"])?$_SESSION["export_FilterValue_fields"]:array();
|
||||
$array_filtervalue=isset($_SESSION["export_filtered_fields"])?$_SESSION["export_filtered_fields"]:array();
|
||||
$datatoexport=GETPOST("datatoexport");
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
@ -222,7 +222,6 @@ if ($action=='downfield' || $action=='upfield')
|
||||
if ($step == 1 || $action == 'cleanselect')
|
||||
{
|
||||
$_SESSION["export_selected_fields"]=array();
|
||||
//$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
$array_selected=array();
|
||||
$array_filtervalue=array();
|
||||
@ -280,12 +279,15 @@ if ($action == 'add_export_model')
|
||||
}
|
||||
|
||||
$hexafiltervalue='';
|
||||
foreach($array_filtervalue as $key=>$val)
|
||||
if (! empty($array_filtervalue) && is_array($array_filtervalue))
|
||||
{
|
||||
if ($hexafilter) $hexafiltervalue.=',';
|
||||
$hexafiltervalue.=$key.'='.$val;
|
||||
foreach($array_filtervalue as $key=>$val)
|
||||
{
|
||||
if ($hexafiltervalue) $hexafiltervalue.=',';
|
||||
$hexafiltervalue.=$key.'='.$val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$objexport->model_name = $export_name;
|
||||
$objexport->datatoexport = $datatoexport;
|
||||
$objexport->hexa = $hexa;
|
||||
@ -311,10 +313,11 @@ if ($action == 'add_export_model')
|
||||
}
|
||||
}
|
||||
|
||||
// Reload an predefined export model
|
||||
if ($step == 2 && $action == 'select_model')
|
||||
{
|
||||
$_SESSION["export_selected_fields"]=array();
|
||||
$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
|
||||
$array_selected=array();
|
||||
$array_filtervalue=array();
|
||||
@ -331,16 +334,15 @@ if ($step == 2 && $action == 'select_model')
|
||||
}
|
||||
$_SESSION["export_selected_fields"]=$array_selected;
|
||||
|
||||
$fieldsarray=explode(',',$objexport->hexafilter);
|
||||
$fieldsarrayvalue=explode(',',$objexport->hexafiltervalue);
|
||||
$i=1;
|
||||
foreach($fieldsarray as $val)
|
||||
foreach($fieldsarrayvalue as $val)
|
||||
{
|
||||
$tmp=explode('=',$val);
|
||||
$array_filtervalue[$tmp[0]]=$tmp[1];
|
||||
$i++;
|
||||
}
|
||||
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
|
||||
$_SESSION["export_filtered_fields"]=$array_filtervalue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -350,7 +352,7 @@ if ($step == 4 && $action == 'submitFormField')
|
||||
// on boucle sur les champs selectionne pour recuperer la valeur
|
||||
if (is_array($objexport->array_export_TypeFields[0]))
|
||||
{
|
||||
$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
//var_dump($_POST);
|
||||
foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc
|
||||
{
|
||||
@ -366,7 +368,7 @@ if ($step == 4 && $action == 'submitFormField')
|
||||
}
|
||||
}
|
||||
$array_filtervalue=(! empty($objexport->array_export_FilterValue[0])?$objexport->array_export_FilterValue[0]:'');
|
||||
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
|
||||
$_SESSION["export_filtered_fields"]=$array_filtervalue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
@ -324,24 +324,34 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extrafields
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_option = $extrafields->getOptionalsFromPost($extralabels);
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
$object->array_options = $array_option;
|
||||
if (! $error)
|
||||
{
|
||||
// Extrafields
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_option = $extrafields->getOptionalsFromPost($extralabels);
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
$object->array_options = $array_option;
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -535,7 +535,7 @@ if (! defined('NOLOGIN'))
|
||||
{
|
||||
// We are already into an authenticated session
|
||||
$login=$_SESSION["dol_login"];
|
||||
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login);
|
||||
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG);
|
||||
|
||||
$resultFetchUser=$user->fetch('',$login);
|
||||
if ($resultFetchUser <= 0)
|
||||
|
||||
@ -2169,7 +2169,7 @@ class Product extends CommonObject
|
||||
$sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')";
|
||||
if ($mode == 'bynumber') $sql.= ", count(DISTINCT c.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as d, ".MAIN_DB_PREFIX."commande_fournisseur as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->fournisseur->lire && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE c.rowid = d.fk_commande";
|
||||
$sql.= " AND d.fk_product =".$this->id;
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
@ -3447,6 +3447,12 @@ class Product extends CommonObject
|
||||
{
|
||||
dol_delete_file($dirthumb.$photo_vignette);
|
||||
}
|
||||
|
||||
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_mini'.$regs[0];
|
||||
if (file_exists(dol_osencode($dirthumb.$photo_vignette)))
|
||||
{
|
||||
dol_delete_file($dirthumb.$photo_vignette);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -748,9 +748,8 @@ $sql .= " " . MAIN_DB_PREFIX . "user as u";
|
||||
$sql .= " WHERE fk_product = " . $object->id;
|
||||
$sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")";
|
||||
$sql .= " AND p.fk_user_author = u.rowid";
|
||||
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
$sql .= " AND p.price_level = " . $soc->price_level;
|
||||
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC";
|
||||
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level;
|
||||
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC";
|
||||
// $sql .= $db->plimit();
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2012-2013 Philippe Berthet <berthet@systune.be>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* Version V1.1 Initial version of Philippe Berthet
|
||||
* Version V2 Change to be compatible with 3.4 and enhanced to be more generic
|
||||
@ -197,7 +198,7 @@ if ($type_element == 'invoice')
|
||||
{ // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$documentstatic=new Facture($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, ';
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
|
||||
$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_facture = f.rowid";
|
||||
@ -228,7 +229,7 @@ if ($type_element == 'order')
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
|
||||
$where.= " AND d.fk_commande = c.rowid";
|
||||
$where.= " AND c.entity = ".$conf->entity;
|
||||
$dateprint = 'c.datef';
|
||||
$dateprint = 'c.date_commande';
|
||||
$doc_number='c.ref';
|
||||
$thirdTypeSelect='customer';
|
||||
}
|
||||
@ -335,11 +336,12 @@ if ($sql_select)
|
||||
{
|
||||
$documentstatic->id=$objp->doc_id;
|
||||
$documentstatic->ref=$objp->doc_number;
|
||||
$documentstatic->type=$objp->type;
|
||||
$documentstatic->type=$objp->doc_type;
|
||||
$documentstatic->fk_statut=$objp->status;
|
||||
$documentstatic->fk_status=$objp->status;
|
||||
$documentstatic->statut=$objp->status;
|
||||
$documentstatic->status=$objp->status;
|
||||
$documentstatic->paye=$objp->paid;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
@ -137,7 +137,7 @@ if (empty($reshook))
|
||||
$object->particulier = GETPOST("private");
|
||||
|
||||
$object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha'));
|
||||
$object->civility_id = GETPOST('civility_id', 'int');
|
||||
$object->civility_id = GETPOST('civility_id');
|
||||
// Add non official properties
|
||||
$object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha');
|
||||
$object->firstname = GETPOST('firstname','alpha');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user