Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
017a483eb3
@ -1,6 +1,9 @@
|
||||
--------------------------------------------------------------
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
***** ChangeLog for 3.8 compared to 3.7.* *****
|
||||
- New: Add Option to not change date on cloning project
|
||||
- New: Add check list from table for extrafield type
|
||||
|
||||
|
||||
***** ChangeLog for 3.8 compared to 3.7.* *****
|
||||
|
||||
@ -519,7 +519,7 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
@ -531,11 +531,13 @@ if ($id > 0)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap"><a href="propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a>'."\n";
|
||||
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 )
|
||||
{
|
||||
print " ".img_warning();
|
||||
}
|
||||
print '<td class="nowrap">';
|
||||
$propal_static->id=$objp->propalid;
|
||||
$propal_static->ref=$objp->ref;
|
||||
print $propal_static->getNomUrl(1);
|
||||
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" style="min-width: 60px" class="nowrap">'.$propal_static->LibStatut($objp->fk_statut,5).'</td></tr>';
|
||||
@ -592,7 +594,7 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
//if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
|
||||
//else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
|
||||
@ -606,7 +608,10 @@ if ($id > 0)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
|
||||
print '<td class="nowrap">';
|
||||
$commande_static->id=$objp->cid;
|
||||
$commande_static->ref=$objp->ref;
|
||||
print $commande_static->getNomUrl(1);
|
||||
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
|
||||
@ -647,7 +652,7 @@ if ($id > 0)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' ('.$num.')</a></td></tr></table></td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$i = 0;
|
||||
@ -706,7 +711,7 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' ('.$num.')</td></tr></table></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
}
|
||||
@ -769,7 +774,7 @@ if ($id > 0)
|
||||
|
||||
$tableaushown=1;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' ('.$num.')</a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -313,7 +313,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1">('.$num.')</a></td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
|
||||
while ($i < $nbofloop)
|
||||
@ -399,7 +399,7 @@ if (! empty($conf->propal->enabled))
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1">('.$num.')</a></td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("ProposalsToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
@ -471,7 +471,7 @@ if (! empty($conf->propal->enabled))
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2">('.$num.')</a></td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
|
||||
@ -303,7 +303,7 @@ if (! empty($conf->commande->enabled))
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1">('.$num.')</a></td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
@ -374,7 +374,7 @@ if (! empty($conf->commande->enabled))
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2">('.$num.')</a></td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=2"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
|
||||
@ -30,6 +30,36 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
*/
|
||||
abstract class CommonInvoice extends CommonObject
|
||||
{
|
||||
/**
|
||||
* Standard invoice
|
||||
*/
|
||||
const TYPE_STANDARD = 0;
|
||||
|
||||
/**
|
||||
* Replacement invoice
|
||||
*/
|
||||
const TYPE_REPLACEMENT = 1;
|
||||
|
||||
/**
|
||||
* Credit note invoice
|
||||
*/
|
||||
const TYPE_CREDIT_NOTE = 2;
|
||||
|
||||
/**
|
||||
* Deposit invoice
|
||||
*/
|
||||
const TYPE_DEPOSIT = 3;
|
||||
|
||||
/**
|
||||
* Proforma invoice
|
||||
*/
|
||||
const TYPE_PROFORMA = 4;
|
||||
|
||||
/**
|
||||
* Situation invoice
|
||||
*/
|
||||
const TYPE_SITUATION = 5;
|
||||
|
||||
/**
|
||||
* Return amount of payments already done
|
||||
*
|
||||
@ -145,12 +175,12 @@ abstract class CommonInvoice extends CommonObject
|
||||
function getLibType()
|
||||
{
|
||||
global $langs;
|
||||
if ($this->type == Facture::TYPE_STANDARD) return $langs->trans("InvoiceStandard");
|
||||
if ($this->type == Facture::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement");
|
||||
if ($this->type == Facture::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir");
|
||||
if ($this->type == Facture::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit");
|
||||
if ($this->type == Facture::TYPE_PROFORMA) return $langs->trans("InvoiceProForma");
|
||||
if ($this->type == Facture::TYPE_SITUATION) return $langs->trans("InvoiceSituation");
|
||||
if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard");
|
||||
if ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement");
|
||||
if ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir");
|
||||
if ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit");
|
||||
if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma");
|
||||
if ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation");
|
||||
return $langs->trans("Unknown");
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ class ExtraFields
|
||||
'separate' => 'ExtrafieldSeparator',
|
||||
'checkbox' => 'ExtrafieldCheckBox',
|
||||
'radio' => 'ExtrafieldRadio',
|
||||
|
||||
'chkbxlst' => 'ExtrafieldCheckBoxFromList',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -171,7 +171,7 @@ class ExtraFields
|
||||
}elseif($type=='mail') {
|
||||
$typedb='varchar';
|
||||
$lengthdb='128';
|
||||
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox')){
|
||||
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){
|
||||
$typedb='text';
|
||||
$lengthdb='';
|
||||
} else {
|
||||
@ -373,7 +373,7 @@ class ExtraFields
|
||||
}elseif($type=='mail') {
|
||||
$typedb='varchar';
|
||||
$lengthdb='128';
|
||||
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox')) {
|
||||
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') || ($type=='checkbox') || ($type=='chkbxlst')) {
|
||||
$typedb='text';
|
||||
$lengthdb='';
|
||||
} else {
|
||||
@ -864,6 +864,140 @@ class ExtraFields
|
||||
$out.='/>'.$val.'<br>';
|
||||
}
|
||||
}
|
||||
elseif ($type == 'chkbxlst')
|
||||
{
|
||||
$value_arr = explode(',', $value);
|
||||
|
||||
if (is_array($param['options'])) {
|
||||
$param_list = array_keys($param['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
// 0 : tableName
|
||||
// 1 : label field name
|
||||
// 2 : key fields name (if differ of rowid)
|
||||
// 3 : key field parent (for dependent lists)
|
||||
// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
|
||||
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid');
|
||||
|
||||
if (count($InfoFieldList) > 3 && ! empty($InfoFieldList[3])) {
|
||||
list ( $parentName, $parentField ) = explode('|', $InfoFieldList[3]);
|
||||
$keyList .= ', ' . $parentField;
|
||||
}
|
||||
if (count($InfoFieldList) > 4 && ! empty($InfoFieldList[4])) {
|
||||
if (strpos($InfoFieldList[4], 'extra.') !== false) {
|
||||
$keyList = 'main.' . $InfoFieldList[2] . ' as rowid';
|
||||
} else {
|
||||
$keyList = $InfoFieldList[2] . ' as rowid';
|
||||
}
|
||||
}
|
||||
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$sqlwhere = '';
|
||||
$sql = 'SELECT ' . $keyList;
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
|
||||
if (! empty($InfoFieldList[4])) {
|
||||
// We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList[0] . '_extrafields as extra';
|
||||
$sqlwhere .= ' WHERE extra.fk_object=main.' . $InfoFieldList[2] . ' AND ' . $InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE ' . $InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1';
|
||||
}
|
||||
if (in_array($InfoFieldList[0], array (
|
||||
'tablewithentity'
|
||||
)))
|
||||
$sqlwhere .= ' AND entity = ' . $conf->entity; // Some tables may have field, some other not. For the moment we disable it.
|
||||
// $sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
// print $sql;
|
||||
$sql .= $sqlwhere;
|
||||
dol_syslog(get_class($this) . '::showInputField type=chkbxlst',LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ( $i < $num ) {
|
||||
$labeltoshow = '';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$notrans = true;
|
||||
foreach ( $fields_label as $field_toshow ) {
|
||||
$labeltoshow .= $obj->$field_toshow . ' ';
|
||||
}
|
||||
} else {
|
||||
$labeltoshow = $obj->$InfoFieldList[1];
|
||||
}
|
||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
||||
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
foreach ( $fields_label as $field_toshow ) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel, 18) . ' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
|
||||
}
|
||||
}
|
||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||
$out .= ' value="' . $obj->rowid . '"';
|
||||
|
||||
$out .= 'checked="checked"';
|
||||
|
||||
$out .= '/>' . $labeltoshow . '<br>';
|
||||
} else {
|
||||
if (! $notrans) {
|
||||
$translabel = $langs->trans($obj->$InfoFieldList[1]);
|
||||
if ($translabel != $obj->$InfoFieldList[1]) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$InfoFieldList[1], 18);
|
||||
}
|
||||
}
|
||||
if (empty($labeltoshow))
|
||||
$labeltoshow = '(not defined)';
|
||||
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||
$out .= ' value="' . $obj->rowid . '"';
|
||||
|
||||
$out .= 'checked="checked"';
|
||||
$out .= '';
|
||||
|
||||
$out .= '/>' . $labeltoshow . '<br>';
|
||||
}
|
||||
|
||||
if (! empty($InfoFieldList[3])) {
|
||||
$parent = $parentName . ':' . $obj->{$parentField};
|
||||
}
|
||||
|
||||
$out .= '<input class="flat" type="checkbox" name="options_' . $key . $keyprefix . '[]" ' . ($moreparam ? $moreparam : '');
|
||||
$out .= ' value="' . $obj->rowid . '"';
|
||||
|
||||
$out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked="checked" ' : '');
|
||||
;
|
||||
$out .= '';
|
||||
|
||||
$out .= '/>' . $labeltoshow . '<br>';
|
||||
}
|
||||
|
||||
$i ++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
}
|
||||
/* Add comments
|
||||
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
||||
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
||||
@ -1019,6 +1153,73 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($type == 'chkbxlst')
|
||||
{
|
||||
$value_arr = explode(',', $value);
|
||||
|
||||
$param_list = array_keys($params['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
|
||||
$selectkey = "rowid";
|
||||
$keyList = 'rowid';
|
||||
|
||||
if (count($InfoFieldList) >= 3) {
|
||||
$selectkey = $InfoFieldList[2];
|
||||
$keyList = $InfoFieldList[2] . ' as rowid';
|
||||
}
|
||||
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$sql = 'SELECT ' . $keyList;
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= ' as main';
|
||||
}
|
||||
// $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||
// $sql.= ' AND entity = '.$conf->entity;
|
||||
|
||||
dol_syslog(get_class($this) . ':showOutputField:$type=chkbxlst',LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$value = ''; // value was used, so now we reste it to use it to build final output
|
||||
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
if (is_array($fields_label) && count($fields_label) > 1) {
|
||||
foreach ( $fields_label as $field_toshow ) {
|
||||
$translabel = '';
|
||||
if (! empty($obj->$field_toshow)) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$value .= dol_trunc($translabel, 18) . '<BR>';
|
||||
} else {
|
||||
$value .= $obj->$field_toshow . '<BR>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$translabel = '';
|
||||
if (! empty($obj->$InfoFieldList[1])) {
|
||||
$translabel = $langs->trans($obj->$InfoFieldList[1]);
|
||||
}
|
||||
if ($translabel != $obj->$InfoFieldList[1]) {
|
||||
$value .= dol_trunc($translabel, 18) . '<BR>';
|
||||
} else {
|
||||
$value .= $obj->$InfoFieldList[1] . '<BR>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
$showsize=round($size);
|
||||
@ -1074,7 +1275,7 @@ class ExtraFields
|
||||
// Clean parameters
|
||||
$value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
|
||||
}
|
||||
else if (in_array($key_type,array('checkbox')))
|
||||
else if (in_array($key_type,array('checkbox','chkbxlst')))
|
||||
{
|
||||
$value_arr=GETPOST("options_".$key);
|
||||
if (!empty($value_arr)) {
|
||||
|
||||
@ -39,19 +39,20 @@
|
||||
}
|
||||
?>
|
||||
|
||||
if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'datetime') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'double') { size.val('24,8').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'int') { size.val('10').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.attr('disabled','disabled').removeAttr('checked'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); }
|
||||
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();}
|
||||
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
|
||||
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||
if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'datetime') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'double') { size.val('24,8').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'int') { size.val('10').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.attr('disabled','disabled').removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
|
||||
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
|
||||
else if (type == 'chkbxlst') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide(); jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").show();}
|
||||
else size.val('').attr('disabled','disabled');
|
||||
}
|
||||
init_typeoffields('<?php echo GETPOST('type'); ?>');
|
||||
@ -90,7 +91,8 @@
|
||||
<tr><td>
|
||||
<textarea name="param" id="param" cols="80" rwos="<?php echo ROWS_4 ?>"><?php echo GETPOST('param'); ?></textarea>
|
||||
</td><td id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?></td>
|
||||
<td id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?></td></tr>
|
||||
<td><span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?></span>
|
||||
<span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?></span></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ $pos=$extrafields->attribute_pos[$attrname];
|
||||
$alwayseditable=$extrafields->attribute_alwayseditable[$attrname];
|
||||
$param=$extrafields->attribute_param[$attrname];
|
||||
|
||||
if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_array($param))
|
||||
if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
|
||||
{
|
||||
$param_chain = '';
|
||||
foreach ($param['options'] as $key => $value)
|
||||
@ -68,7 +68,7 @@ if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_a
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($type== 'sellist')
|
||||
elseif (($type== 'sellist') || ($type == 'chkbxlst'))
|
||||
{
|
||||
$paramlist=array_keys($param['options']);
|
||||
$param_chain = $paramlist[0];
|
||||
@ -89,7 +89,7 @@ elseif ($type== 'sellist')
|
||||
<tr><td><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo $extrafields->attribute_pos[$attrname]; ?>"></td></tr>
|
||||
<!-- Value (for select list / radio) -->
|
||||
<?php
|
||||
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($type == 'radio')))
|
||||
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') || ($type == 'chkbxlst') || ($type == 'radio'))
|
||||
{
|
||||
?>
|
||||
<tr id="value_choice">
|
||||
|
||||
@ -299,7 +299,7 @@ if ($object->id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("ProductsAndServices").'</td><td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("All").' ('.$object->nbOfProductRefs().')';
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("All").' <span class="badge">'.$object->nbOfProductRefs().'</span>';
|
||||
print '</a></td></tr></table>';
|
||||
}
|
||||
|
||||
@ -355,7 +355,7 @@ if ($object->id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a href="commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</td>';
|
||||
print '<td align="right"><a href="commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
@ -367,7 +367,11 @@ if ($object->id > 0)
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td><a href="commande/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.'</a></td>';
|
||||
print '<td class="nowrap">';
|
||||
$orderstatic->id=$obj->rowid;
|
||||
$orderstatic->ref=$obj->ref;
|
||||
print $orderstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
@ -422,7 +426,7 @@ if ($object->id > 0)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' ('.$num.')</td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -126,7 +126,7 @@ if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("DraftOrders").' ('.$num.')</td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("DraftOrders").' <span class="badge">'.$num.'</span></td></tr>';
|
||||
|
||||
$i = 0;
|
||||
$var = true;
|
||||
@ -183,7 +183,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("DraftBills").' ('.$num.')</td></tr>';
|
||||
print '<td colspan="3">'.$langs->trans("DraftBills").' <span class="badge">'.$num.'</span></td></tr>';
|
||||
$i = 0;
|
||||
$tot_ttc = 0;
|
||||
$var = True;
|
||||
|
||||
@ -382,10 +382,12 @@ ExtrafieldSelectList = Select from table
|
||||
ExtrafieldSeparator=Separator
|
||||
ExtrafieldCheckBox=Checkbox
|
||||
ExtrafieldRadio=Radio button
|
||||
ExtrafieldCheckBoxFromList= Checkbox from table
|
||||
ExtrafieldParamHelpselect=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>In order to have the list depending on another :<br>1,value1|parent_list_code:parent_key<br>2,value2|parent_list_code:parent_key
|
||||
ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpradio=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpsellist=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
ExtrafieldParamHelpsellist=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
ExtrafieldParamHelpchkbxlst=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
LibraryToBuildPDF=Library used to build PDF
|
||||
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
|
||||
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)
|
||||
|
||||
@ -103,6 +103,7 @@ CloneContacts=Clone contacts
|
||||
CloneNotes=Clone notes
|
||||
CloneProjectFiles=Clone project joined files
|
||||
CloneTaskFiles=Clone task(s) joined files (if task(s) cloned)
|
||||
CloneMoveDate=Update project/tasks dates from now ?
|
||||
ConfirmCloneProject=Are you sure to clone this project ?
|
||||
ProjectReportDate=Change task date according project start date
|
||||
ErrorShiftTaskDate=Impossible to shift task date according to new project start date
|
||||
|
||||
@ -382,10 +382,12 @@ ExtrafieldSelectList = Liste issue d'une table
|
||||
ExtrafieldSeparator=Séparateur de champ
|
||||
ExtrafieldCheckBox=Case à cocher
|
||||
ExtrafieldRadio=Bouton radio
|
||||
ExtrafieldCheckBoxFromList= Case à cocher issue d'une table
|
||||
ExtrafieldParamHelpselect=La liste doit être de la forme clef,valeur<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...<br><br>Pour que la liste soit dépendante d'une autre :<br>1,valeur1|code_liste_parent:clef_parent<br>2,valeur2|code_liste_parent:clef_parent
|
||||
ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...
|
||||
ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...
|
||||
ExtrafieldParamHelpsellist=La liste vient d'une table<br>Syntaxe: <br>nom_de_table:nom_de_champ:id_champ::filtre<br>Exemple : <br>c_typent:libelle:id::filter<br><br>filter peux être un test simple (exemple active=1 pour ne proposer que les valeur active)<br>si vous voulez faire un filtre sur des attributs supplémentaires, utilisez la syntax extra.champ=... (où champ est la code de l'attribut supplémentaire)<br><br>Pour que la liste soit dépendante d'une autre :<br>c_typent:libelle:id:code_liste_parent|colonne_parent:filter
|
||||
ExtrafieldParamHelpchkbxlst=Les cases à cocher viennent d'une table<br>Syntaxe: <br>nom_de_table:nom_de_champ:id_champ::filtre<br>Exemple : <br>c_typent:libelle:id::filter<br><br>filter peux être un test simple (exemple active=1 pour ne proposer que les valeur active)<br>si vous voulez faire un filtre sur des attributs supplémentaires, utilisez la syntax extra.champ=... (où champ est la code de l'attribut supplémentaire)<br><br>Pour que la liste soit dépendante d'une autre :<br>c_typent:libelle:id:code_liste_parent|colonne_parent:filter
|
||||
LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF
|
||||
WarningUsingFPDF=Attention : votre fichier <b>conf.php</b> contient la directive <b>dolibarr_pdf_force_fpdf=1</b>. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalités (Unicode, transparence des images, langues cyrilliques, arabes ou asiatiques...), aussi vous pouvez rencontrer des problèmes durant la génération des PDF.<br>Pour résoudre cela et avoir une prise en charge complète de PDF, vous pouvez télécharger la <a href="http://www.tcpdf.org/" target="_blank">bibliothèque TCPDF</a> puis commenter ou supprimer la ligne <b>$dolibarr_pdf_force_fpdf=1</b>, et ajouter à la place <b>$dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF'</b>
|
||||
LocalTaxDesc=Certains pays appliquent 2 voire 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)<br>3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)<br>4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)<br>5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale)
|
||||
|
||||
@ -103,6 +103,7 @@ CloneContacts=Cloner les contacts
|
||||
CloneNotes=Cloner les notes
|
||||
CloneProjectFiles=Cloner les pièces jointes du projet
|
||||
CloneTaskFiles=Cloner les pièces jointes des tâche(s) (si tâche(s) cloner)
|
||||
CloneMoveDate=Deplacer les date projets/taches sur maintenant
|
||||
ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ?
|
||||
ProjectReportDate=Reporter les dates des tâches en fonction de la date de départ.
|
||||
ErrorShiftTaskDate=Une erreur s'est produite dans le report des dates des tâches.
|
||||
|
||||
@ -353,7 +353,8 @@ if (empty($reshook))
|
||||
$clone_project_files = GETPOST('clone_project_files') ? 1 : 0;
|
||||
$clone_task_files = GETPOST('clone_task_files') ? 1 : 0;
|
||||
$clone_notes=GETPOST('clone_notes')?1:0;
|
||||
$result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes);
|
||||
$move_date=GETPOST('move_date')?1:0;
|
||||
$result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes,$move_date);
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
@ -538,6 +539,7 @@ else
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'move_date', 'label' => $langs->trans("CloneMoveDate"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_project_files','label' => $langs->trans("CloneProjectFiles"), 'value' => false),
|
||||
array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false)
|
||||
|
||||
@ -1002,16 +1002,17 @@ class Project extends CommonObject
|
||||
* @param bool $clone_project_file clone file of project
|
||||
* @param bool $clone_task_file clone file of task (if task are copied)
|
||||
* @param bool $clone_note clone note of project
|
||||
* @param bool $move_date move task date on clone
|
||||
* @param bool $notrigger no trigger flag
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_project_file=false,$clone_task_file=false,$clone_note=true,$notrigger=0)
|
||||
function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_project_file=false,$clone_task_file=false,$clone_note=true,$move_date=true,$notrigger=0)
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("createFromClone clone_contact=".$clone_contact." clone_task=".$clone_task." clone_project_file=".$clone_project_file." clone_note=".$clone_note);
|
||||
dol_syslog("createFromClone clone_contact=".$clone_contact." clone_task=".$clone_task." clone_project_file=".$clone_project_file." clone_note=".$clone_note." move_date=".$move_date,LOG_DEBUG);
|
||||
|
||||
$now = dol_mktime(0,0,0,idate('m',dol_now()),idate('d',dol_now()),idate('Y',dol_now()));
|
||||
|
||||
@ -1027,11 +1028,13 @@ class Project extends CommonObject
|
||||
$orign_project_ref=$clone_project->ref;
|
||||
|
||||
$clone_project->id=0;
|
||||
$clone_project->date_start = $now;
|
||||
if (!(empty($clone_project->date_end)))
|
||||
{
|
||||
$clone_project->date_end = $clone_project->date_end + ($now - $orign_dt_start);
|
||||
}
|
||||
if ($move_date) {
|
||||
$clone_project->date_start = $now;
|
||||
if (!(empty($clone_project->date_end)))
|
||||
{
|
||||
$clone_project->date_end = $clone_project->date_end + ($now - $orign_dt_start);
|
||||
}
|
||||
}
|
||||
|
||||
$clone_project->datec = $now;
|
||||
|
||||
@ -1185,7 +1188,7 @@ class Project extends CommonObject
|
||||
|
||||
foreach ($tasksarray as $tasktoclone)
|
||||
{
|
||||
$result_clone = $taskstatic->createFromClone($tasktoclone->id,$clone_project_id,$tasktoclone->fk_parent,true,true,false,$clone_task_file,true,false);
|
||||
$result_clone = $taskstatic->createFromClone($tasktoclone->id,$clone_project_id,$tasktoclone->fk_parent,$move_date,true,false,$clone_task_file,true,false);
|
||||
if ($result_clone <= 0)
|
||||
{
|
||||
$this->error.=$result_clone->error;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user