mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
995e07041a
|
|
@ -47,6 +47,7 @@ $mesg = '';
|
|||
|
||||
$object = new Deplacement($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
|
@ -244,7 +245,9 @@ if ($action == 'create')
|
|||
print '<tr>';
|
||||
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'"></textarea>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note_public',GETPOST('note_public'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Private note
|
||||
|
|
@ -253,7 +256,9 @@ if ($action == 'create')
|
|||
print '<tr>';
|
||||
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'"></textarea>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note_private',GETPOST('note_private'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
@ -376,9 +381,9 @@ else if ($id)
|
|||
|
||||
// Type
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("Type",'type',$langs->trans($object->type),'id',$object->id,$user->rights->deplacement->creer,'select:types_fees');
|
||||
print $form->editfieldkey("Type",'type',$langs->trans($object->type),'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("Type",'type',$langs->trans($object->type),'id',$object->id,$user->rights->deplacement->creer,'select:types_fees');
|
||||
print $form->editfieldval("Type",'type',$langs->trans($object->type),'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
|
||||
print '</td></tr>';
|
||||
|
||||
// Who
|
||||
|
|
@ -390,16 +395,16 @@ else if ($id)
|
|||
|
||||
// Date
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("Date",'dated',$object->date,'id',$object->id,$user->rights->deplacement->creer,'datepicker');
|
||||
print $form->editfieldkey("Date",'dated',$object->date,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("Date",'dated',$object->date,'id',$object->id,$user->rights->deplacement->creer,'datepicker');
|
||||
print $form->editfieldval("Date",'dated',$object->date,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
|
||||
print '</td></tr>';
|
||||
|
||||
// Km/Price
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,'id',$object->id,$user->rights->deplacement->creer,'numeric:6');
|
||||
print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,'id',$object->id,$user->rights->deplacement->creer,'numeric:6');
|
||||
print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
|
||||
print "</td></tr>";
|
||||
|
||||
// Where
|
||||
|
|
@ -443,18 +448,18 @@ else if ($id)
|
|||
|
||||
// Public note
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180:100:6');
|
||||
print $form->editfieldkey("NotePublic",'note_public',$object->note_public,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180:100:6');
|
||||
print $form->editfieldval("NotePublic",'note_public',$object->note_public,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print "</td></tr>";
|
||||
|
||||
// Private note
|
||||
if (! $user->societe_id)
|
||||
{
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("NotePrivate",'note',$object->note_private,'id',$object->id,$user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180:100:6');
|
||||
print $form->editfieldkey("NotePrivate",'note',$object->note_private,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("NotePrivate",'note',$object->note_private,'id',$object->id,$user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180:100:6');
|
||||
print $form->editfieldval("NotePrivate",'note',$object->note_private,'id',$object->id,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ class DolEditor
|
|||
|
||||
dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." tool=".$tool);
|
||||
|
||||
if (! $rows) $rows=round($height/25);
|
||||
if (! $cols) $rows=round($height/6);
|
||||
|
||||
// Name of extended editor to use (FCKEDITOR_EDITORNAME can be 'ckeditor' or 'fckeditor')
|
||||
$defaulteditor='ckeditor';
|
||||
$this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?$defaulteditor:$conf->global->FCKEDITOR_EDITORNAME;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Form
|
|||
* @param string $paramkey Key of parameter for Url (unique if there is several parameter to show). In most cases "id".
|
||||
* @param string $paramvalue Value of parameter for Url
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz', 'select:xxx'...)
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string')
|
||||
|
|
@ -110,7 +110,7 @@ class Form
|
|||
* @param string $value Value to show/edit
|
||||
* @param string $paramkey Key of parameter (unique if there is several parameter to show). In most cases "id".
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:rows:cols', 'select:xxx'...)
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
|
|
@ -140,7 +140,7 @@ class Form
|
|||
$tmp=explode(':',$typeofdata);
|
||||
$ret.='<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue?$editvalue:$value).'"'.($tmp[1]?' size="'.$tmp[1].'"':'').'>';
|
||||
}
|
||||
else if ($typeofdata == 'text' || $typeofdata == 'textarea')
|
||||
else if ($typeofdata == 'text' || $typeofdata == 'textarea' || $typeofdata == 'note')
|
||||
{
|
||||
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" cols="70">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ class Form
|
|||
{
|
||||
$tmp=explode(':',$typeofdata);
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor($htmlname,($editvalue?$editvalue:$value),($tmp[2]?$tmp[2]:''),($tmp[3]?$tmp[3]:'100'),($tmp[1]?$tmp[1]:'dolibarr_notes'),'In',false,true,true,($tmp[4]?$tmp[4]:ROWS_4),($tmp[5]?$tmp[5]:'100'));
|
||||
$doleditor=new DolEditor($htmlname,($editvalue?$editvalue:$value),($tmp[2]?$tmp[2]:''),($tmp[3]?$tmp[3]:'100'),($tmp[1]?$tmp[1]:'dolibarr_notes'),'In',false,true,true);
|
||||
$ret.=$doleditor->Create(1);
|
||||
//$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" cols="70">'.($editvalue?$editvalue:$value).'</textarea>';
|
||||
}
|
||||
|
|
@ -165,7 +165,14 @@ class Form
|
|||
{
|
||||
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
|
||||
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
|
||||
elseif ($typeofdata == 'text' || $typeofdata == 'textarea') $ret.=dol_htmlentitiesbr($value);
|
||||
elseif ($typeofdata == 'text' || $typeofdata == 'textarea') $ret.=dol_htmlentitiesbr($value);
|
||||
else if (preg_match('/^ckeditor/',$typeofdata))
|
||||
{
|
||||
$tmpcontent=dol_htmlentitiesbr($value);
|
||||
$firstline=preg_replace('/<br>.*/','',$tmpcontent);
|
||||
$firstline=preg_replace('/[\n\r].*/','',$firstline);
|
||||
$ret.=$firstline.((strlen($firstline) != strlen($tmpcontent))?'...':'');
|
||||
}
|
||||
else $ret.=$value;
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +188,7 @@ class Form
|
|||
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea', 'ckeditor:dolibarr_zzz', 'select:xxx')
|
||||
* @return string HTML edit in place
|
||||
*/
|
||||
function editInPlace($value, $htmlname, $condition, $inputType='textarea')
|
||||
private function editInPlace($value, $htmlname, $condition, $inputType='textarea')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
|
|||
|
|
@ -816,9 +816,9 @@ else if ($id > 0 || ! empty($ref))
|
|||
|
||||
// Description (must be a textarea and not html must be allowed (used in list view)
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("Description",'description',$object->description,'id',$object->id,$object->statut == 0 && $user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldkey("Description",'description',$object->description,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print '</td><td colspan="3">';
|
||||
print $form->editfieldval("Description",'description',$object->description,'id',$object->id,$object->statut == 0 && $user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldval("Description",'description',$object->description,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -857,18 +857,18 @@ else if ($id > 0 || ! empty($ref))
|
|||
|
||||
// Public note
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldkey("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->ficheinter->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print '</td><td colspan="3">';
|
||||
print $form->editfieldval("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldval("NotePublic",'note_public',$object->note_public,'id',$object->id,$user->rights->ficheinter->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print "</td></tr>";
|
||||
|
||||
// Private note
|
||||
if (! $user->societe_id)
|
||||
{
|
||||
print '<tr><td valign="top">';
|
||||
print $form->editfieldkey("NotePrivate",'note_private',$object->note_private,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldkey("NotePrivate",'note_private',$object->note_private,'id',$object->id,$user->rights->ficheinter->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print '</td><td colspan="3">';
|
||||
print $form->editfieldval("NotePrivate",'note_private',$object->note_private,'id',$object->id,$user->rights->ficheinter->creer,'textarea');
|
||||
print $form->editfieldval("NotePrivate",'note_private',$object->note_private,'id',$object->id,$user->rights->ficheinter->creer,'ckeditor:dolibarr_notes:600:180');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user