diff --git a/ChangeLog b/ChangeLog index 28e548067fb..9aae192541f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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.* ***** diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a775408e9a8..8fdab8115a6 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -519,7 +519,7 @@ if ($id > 0) print ''; print ''; - print '
'; + print ''; print ''; @@ -531,11 +531,13 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; print ''; @@ -592,7 +594,7 @@ if ($id > 0) print '
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' ('.$num.')'; print ''; print '
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; - if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) - { - print " ".img_warning(); - } + print ''; + $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 ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'; print ''; - print ''; print ''; @@ -367,7 +367,11 @@ if ($object->id > 0) $var=!$var; print ""; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 9da28281779..29f12fed38f 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -126,7 +126,7 @@ if (! empty($conf->fournisseur->enabled)) { print '
'; + print ''; print ''; } $i = 0; @@ -706,7 +711,7 @@ if ($id > 0) print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'; print ''; //if($num2 > 0) print ''; //else print ''; @@ -606,7 +608,10 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; print ''; @@ -647,7 +652,7 @@ if ($id > 0) print ''; print ''; + print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').''.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; + print ''; + $commande_static->id=$objp->cid; + $commande_static->ref=$objp->ref; + print $commande_static->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dc),'day')."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'; - print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllContracts").' ('.$num.')
'.$langs->trans("AllContracts").' '.$num.'
'; print ''; - print ''; + print ''; print ''; $var=!$var; } @@ -769,7 +774,7 @@ if ($id > 0) $tableaushown=1; print ''; - print ' diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 493634c84a5..9cf186de39f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -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') diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 205d1a89ea6..0fefa8d4555 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -299,7 +299,7 @@ if ($object->id > 0) print '
'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' ('.$num.')
'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' '.$num.'
'; + print ''; print ''; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index de51cf63104..a0e8a3409ab 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -313,7 +313,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $var=true; print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' ('.$num.')'; print ''; print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; - print ''; + print ''; $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 '
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("ProposalsOpened").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { @@ -471,7 +471,7 @@ if (! empty($conf->propal->enabled)) print '
'.$langs->trans("ProposalsToProcess").' ('.$num.')
'.$langs->trans("ProposalsToProcess").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0d2815a6d67..40b39ccb666 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -303,7 +303,7 @@ if (! empty($conf->commande->enabled)) print '
'.$langs->trans("OnProcessOrders").' ('.$num.')
'.$langs->trans("OnProcessOrders").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { @@ -374,7 +374,7 @@ if (! empty($conf->commande->enabled)) print '
'.$langs->trans("OrdersToProcess").' ('.$num.')
'.$langs->trans("OrdersToProcess").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 991601a4fbd..6087a5a0adb 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -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"); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 30c97e9f1ef..364307468a7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -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.'
'; } } + 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 .= 'rowid . '"'; + + $out .= 'checked="checked"'; + + $out .= '/>' . $labeltoshow . '
'; + } 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 .= 'rowid . '"'; + + $out .= 'checked="checked"'; + $out .= ''; + + $out .= '/>' . $labeltoshow . '
'; + } + + if (! empty($InfoFieldList[3])) { + $parent = $parentName . ':' . $obj->{$parentField}; + } + + $out .= 'rowid . '"'; + + $out .= ((is_array($value_arr) && in_array($obj->rowid, $value_arr)) ? ' checked="checked" ' : ''); + ; + $out .= ''; + + $out .= '/>' . $labeltoshow . '
'; + } + + $i ++; + } + $this->db->free($resql); + } else { + print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
'; + } + } + $out .= ''; + } /* 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) . '
'; + } else { + $value .= $obj->$field_toshow . '
'; + } + } + } else { + $translabel = ''; + if (! empty($obj->$InfoFieldList[1])) { + $translabel = $langs->trans($obj->$InfoFieldList[1]); + } + if ($translabel != $obj->$InfoFieldList[1]) { + $value .= dol_trunc($translabel, 18) . '
'; + } else { + $value .= $obj->$InfoFieldList[1] . '
'; + } + } + } + } + } 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)) { diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 56cca5af04f..8f14bff797f 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -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(''); @@ -90,7 +91,8 @@ - +
'.$langs->trans("OnProcessOrders").' ('.$num.')
'.$langs->trans("OnProcessOrders").' '.$num.'
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?>textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> +textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0)?>
trans("Position"); ?>
'; print ''; print '
'.$langs->trans("ProductsAndServices").''; - print ''.$langs->trans("All").' ('.$object->nbOfProductRefs().')'; + print ''.$langs->trans("All").' '.$object->nbOfProductRefs().''; print '
'; } @@ -355,7 +355,7 @@ if ($object->id > 0) print '
'; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("LastOrders",($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print '
'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.''; + $orderstatic->id=$obj->rowid; + $orderstatic->ref=$obj->ref; + print $orderstatic->getNomUrl(1); + print ''; if ($obj->dc) { @@ -422,7 +426,7 @@ if ($object->id > 0) print '
'; - print ''; + print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' ('.$num.')
'; print ''; print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print '
'; print ''; - print ''; + print ''; $i = 0; $var = true; @@ -183,7 +183,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { print '
'.$langs->trans("DraftOrders").' ('.$num.')
'.$langs->trans("DraftOrders").' '.$num.'
'; print ''; - print ''; + print ''; $i = 0; $tot_ttc = 0; $var = True; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b1f25a02955..bca163db8bd 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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

for example :
1,value1
2,value2
3,value3
...

In order to have the list depending on another :
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value

for example :
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=Parameters list have to be like key,value

for example :
1,value1
2,value2
3,value3
... -ExtrafieldParamHelpsellist=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpsellist=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpchkbxlst=Parameters list comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column:filter LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. 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.
To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' 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:
1 : local tax apply on products and services without vat (vat is not applied on local tax)
2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)
3 : local tax apply on products without vat (vat is not applied on local tax)
4 : local tax apply on products before vat (vat is calculated on amount + localtax)
5 : local tax apply on services without vat (vat is not applied on local tax)
6 : local tax apply on services before vat (vat is calculated on amount + localtax) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 84624b219f9..b3c150d1687 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -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 diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 4397bb313fa..4e783fafce1 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -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

par exemple :
1,valeur1
2,valeur2
3,valeur3
...

Pour que la liste soit dépendante d'une autre :
1,valeur1|code_liste_parent:clef_parent
2,valeur2|code_liste_parent:clef_parent ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
... ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
... ExtrafieldParamHelpsellist=La liste vient d'une table
Syntaxe:
nom_de_table:nom_de_champ:id_champ::filtre
Exemple :
c_typent:libelle:id::filter

filter peux être un test simple (exemple active=1 pour ne proposer que les valeur active)
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)

Pour que la liste soit dépendante d'une autre :
c_typent:libelle:id:code_liste_parent|colonne_parent:filter +ExtrafieldParamHelpchkbxlst=Les cases à cocher viennent d'une table
Syntaxe:
nom_de_table:nom_de_champ:id_champ::filtre
Exemple :
c_typent:libelle:id::filter

filter peux être un test simple (exemple active=1 pour ne proposer que les valeur active)
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)

Pour que la liste soit dépendante d'une autre :
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 conf.php contient la directive dolibarr_pdf_force_fpdf=1. 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.
Pour résoudre cela et avoir une prise en charge complète de PDF, vous pouvez télécharger la bibliothèque TCPDF puis commenter ou supprimer la ligne $dolibarr_pdf_force_fpdf=1, et ajouter à la place $dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF' 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:
1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)
2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)
3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)
4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)
5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)
6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale) diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 29a11afec29..0bdc1526675 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -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. diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1f6f430fccb..9b5f70e4dce 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -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) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5bf17d596a4..4eef74b0dc1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -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;
'.$langs->trans("DraftBills").' ('.$num.')
'.$langs->trans("DraftBills").' '.$num.'