diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index def454f2ca5..6cc91072a34 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -204,7 +204,7 @@ if ($action == 'create') print ''.$langs->trans("Ref").''.$chid.''; print ''.$langs->trans("Type")."".$charge->type_libelle."\n"; print ''.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."\n"; - print ''.$langs->trans("Label").''.$charge->lib."\n"; + print ''.$langs->trans("Label").''.$charge->label."\n"; /*print ''.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."\n"; print ''.$langs->trans("Amount")."".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 7399a7098c6..389c91e316e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -242,12 +242,23 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char { $object->paye = 0; $object->id = $object->ref = null; - $object->lib = $langs->trans("CopyOf").' '.$object->lib; - if (GETPOST('clone_for_next_month') != '') - { - $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); + if (GETPOST('clone_label', 'alphanohtml')) { + $object->label = GETPOST('clone_label', 'alphanohtml'); + } + else { + $object->label = $langs->trans("CopyOf").' '.$object->label; + } + + if (GETPOST('clone_for_next_month', 'int')) { $object->periode = dol_time_plus_duree($object->periode, 1, 'm'); + $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); + } + else { + $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); + $newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int')); + if ($newdateperiod) $object->periode = $newdateperiod; + if ($newdateech) $object->date_ech = $newdateech; } if ($object->check()) @@ -414,12 +425,20 @@ if ($id > 0) // Clone confirmation if ($action === 'clone') { - $formclone=array( - array('type' => 'checkbox', 'name' => 'clone_for_next_month','label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1), - + $formquestion=array( + array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label), ); + if (! empty($conf->global->TAX_ADD_CLON_FOR_NEXT_MONTH_CHECKBOX)) + { + $formquestion[]=array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); + } + else + { + $formquestion[]=array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); + $formquestion[]=array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("DateDue"), 'value' => -1); + } - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formclone, 'yes'); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formquestion, 'yes', 2); } // Confirmation de la suppression de la charge diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index c5a882283c7..bbffbebe0c9 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -55,7 +55,7 @@ class ChargeSociales extends CommonObject protected $table_ref_field = 'ref'; public $date_ech; - public $lib; + public $label; public $type; public $type_libelle; public $amount; @@ -65,6 +65,11 @@ class ChargeSociales extends CommonObject public $date_modification; public $date_validation; + /** + * @deprecated Use label instead + */ + public $lib; + /** * @var int account ID */ @@ -106,7 +111,7 @@ class ChargeSociales extends CommonObject public function fetch($id, $ref = '') { $sql = "SELECT cs.rowid, cs.date_ech"; - $sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; + $sql.= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; $sql.= ", cs.fk_account, cs.fk_mode_reglement"; $sql.= ", c.libelle"; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; @@ -128,7 +133,8 @@ class ChargeSociales extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->date_ech = $this->db->jdate($obj->date_ech); - $this->lib = $obj->lib; + $this->lib = $obj->label; + $this->label = $obj->label; $this->type = $obj->fk_type; $this->type_libelle = $obj->libelle; $this->fk_account = $obj->fk_account; @@ -203,7 +209,7 @@ class ChargeSociales extends CommonObject $sql.= " VALUES (".$this->type; $sql.= ", ".($this->fk_account>0 ? $this->fk_account:'NULL'); $sql.= ", ".($this->mode_reglement_id>0 ? $this->mode_reglement_id:"NULL"); - $sql.= ", '".$this->db->escape($this->lib)."'"; + $sql.= ", '".$this->db->escape($this->label?$this->label:$this->lib)."'"; $sql.= ", '".$this->db->idate($this->date_ech)."'"; $sql.= ", '".$this->db->idate($this->periode)."'"; $sql.= ", '".price2num($newamount)."'"; @@ -323,7 +329,7 @@ class ChargeSociales extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; - $sql.= " SET libelle='".$this->db->escape($this->lib)."'"; + $sql.= " SET libelle='".$this->db->escape($this->label?$this->label:$this->lib)."'"; $sql.= ", date_ech='".$this->db->idate($this->date_ech)."'"; $sql.= ", periode='".$this->db->idate($this->periode)."'"; $sql.= ", amount='".price2num($this->amount, 'MT')."'"; @@ -543,13 +549,13 @@ class ChargeSociales extends CommonObject } - if (empty($this->ref)) $this->ref=$this->lib; + if (empty($this->ref)) $this->ref=$this->label; $label = ''.$langs->trans("ShowSocialContribution").''; if (! empty($this->ref)) $label .= '
'.$langs->trans('Ref') . ': ' . $this->ref; - if (! empty($this->lib)) - $label .= '
'.$langs->trans('Label') . ': ' . $this->lib; + if (! empty($this->label)) + $label .= '
'.$langs->trans('Label') . ': ' . $this->label; if (! empty($this->type_libelle)) $label .= '
'.$langs->trans('Type') . ': ' . $this->type_libelle; @@ -677,12 +683,12 @@ class ChargeSociales extends CommonObject $this->ref = 'SPECIMEN'; $this->specimen=1; $this->paye = 0; - $this->date = time(); + $this->date = dol_now(); $this->date_ech=$this->date+3600*24*30; $this->periode=$this->date+3600*24*30; $this->amount=100; - $this->lib = 0; + $this->label = 'Social contribution label'; $this->type = 1; - $this->type_libelle = 'Social contribution label'; + $this->type_libelle = 'Type of social contribution'; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7f1c2cbee50..72c1e589233 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4070,13 +4070,13 @@ class Form * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ... * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' - * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx - * @param int $height Force height of box + * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx + * @param int $height Force height of box (0 = auto) * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a
section. * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ - public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 210, $width = 500, $disableformtag = 0) + public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0) { global $langs,$conf; global $useglobalvars; @@ -4090,6 +4090,14 @@ class Form $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; if ($conf->browser->layout == 'phone') $width='95%'; + // Set height automatically if not defined + if (empty($height)) { + $height = 210; + if (is_array($formquestion) && count($formquestion) > 2) { + $height += ((count($formquestion) - 2) * 24); + } + } + if (is_array($formquestion) && ! empty($formquestion)) { // First add hidden fields and value @@ -4105,7 +4113,7 @@ class Form } // Now add questions - $more.=''."\n"; + $more.='
'."\n"; if (! empty($formquestion['text'])) $more.='
'."\n"; foreach ($formquestion as $key => $input) { @@ -4117,52 +4125,52 @@ class Form if ($input['type'] == 'text') { - $more.=''.$input['label'].''."\n"; + $more.='
'.$input['label'].'
'."\n"; } elseif ($input['type'] == 'password') { - $more.=''.$input['label'].''."\n"; + $more.='
'.$input['label'].'
'."\n"; } elseif ($input['type'] == 'select') { - $more.=''; - if (! empty($input['label'])) $more.=$input['label'].''."\n"; + $more.=''."\n"; } elseif ($input['type'] == 'checkbox') { - $more.=''; - $more.=''.$input['label'].' '; - if ($i==0) $more.=''.$input['label'].''; - else $more.=' '; - $more.=''; - $more.=''."\n"; + $more.=''."\n"; $formquestion[] = array('name'=>$input['name'].'day'); $formquestion[] = array('name'=>$input['name'].'month'); $formquestion[] = array('name'=>$input['name'].'year'); @@ -4171,21 +4179,21 @@ class Form } elseif ($input['type'] == 'other') { - $more.=''; - if (! empty($input['label'])) $more.=$input['label'].''."\n"; + $more.=''."\n"; } elseif ($input['type'] == 'onecolumn') { - $more.=''."\n"; + $more.=''."\n"; } } } - $more.='
'.$formquestion['text'].'
'; + $more.='
'; + if (! empty($input['label'])) $more.=$input['label'].'
'; $more.=$this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss); - $more.='
'; + $more.='
'; + $more.='
'.$input['label'].'
'; $more.=' $selval) { - $more.='
'.$input['label'].''; + else $more.='
 
'; + $more.='
'.$input['label'].'
'; + $more.='
'.$input['label'].'
'; + $more.='
'; $more.=$this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0); - $more.='
'; + $more.='
'; + if (! empty($input['label'])) $more.=$input['label'].'
'; $more.=$input['value']; - $more.='
'; + $more.='
'; $more.=$input['value']; - $more.='
'."\n"; + $more.=''."\n"; } // JQUI method dialog is broken with jmobile, we use standard HTML. diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 28029def9ff..ad0f68bee43 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2529,6 +2529,9 @@ span.tabspan { margin: 0px !important; padding: 0px !important; } +.noborderspacing { + border-spacing: 0; +} tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd { border: 0px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 04ae5d298c4..df88a655280 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2620,7 +2620,6 @@ span.tabspan { margin-top: px; } - .paddingrightonly { border-collapse: collapse; border: 0px; @@ -2633,6 +2632,9 @@ span.tabspan { margin: 0px !important; padding: 0px !important; } +.noborderspacing { + border-spacing: 0; +} tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd { border: 0px;