Revert commit

This commit is contained in:
Laurent Destailleur 2016-03-25 15:31:17 +01:00
parent 8ecfca5a9e
commit e7a02d77a6

View File

@ -64,7 +64,7 @@ class Form
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
public function __construct($db)
{
$this->db = $db;
}
@ -82,7 +82,7 @@ class Form
* @param int $fieldrequired 1 if we want to show field as mandatory using the fieldrequired CSS.
* @return string HTML edit field
*/
public static function editfieldkey($text, $htmlname, $value, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0)
function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0)
{
global $conf,$langs;
@ -136,7 +136,7 @@ class Form
* @param string $moreparam More param to add on a href URL
* @return string HTML edit field
*/
public static function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='')
function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='')
{
global $conf,$langs,$db;
@ -148,7 +148,7 @@ class Form
// When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker
{
$ret.= self::editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
}
else
{
@ -178,11 +178,11 @@ class Form
}
else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
{
$ret.=self::selectDate($value,$htmlname,0,0,1,'form'.$htmlname,1,0,1);
$ret.=$this->select_date($value,$htmlname,0,0,1,'form'.$htmlname,1,0,1);
}
else if ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker')
{
$ret.=self::selectDate($value,$htmlname,1,1,1,'form'.$htmlname,1,0,1);
$ret.=$this->select_date($value,$htmlname,1,1,1,'form'.$htmlname,1,0,1);
}
else if (preg_match('/^select;/',$typeofdata))
{
@ -259,7 +259,7 @@ class Form
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @return string HTML edit in place
*/
private static function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null)
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null)
{
global $conf;
@ -492,10 +492,10 @@ class Form
* Generate select HTML to choose massaction
*
* @param string $selected Selected value
* @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @return string Select list
*/
public static function selectMassAction($selected, array $arrayofaction)
function selectMassAction($selected, $arrayofaction)
{
global $conf,$langs,$hookmanager;
@ -3270,7 +3270,7 @@ class Form
{
$more.='<tr><td>'.$input['label'].'</td>';
$more.='<td colspan="2" align="left">';
$more.=self::selectDate($input['value'],$input['name'],0,0,0,'',1,0,1);
$more.=$this->select_date($input['value'],$input['name'],0,0,0,'',1,0,1);
$more.='</td></tr>'."\n";
$formquestion[] = array('name'=>$input['name'].'day');
$formquestion[] = array('name'=>$input['name'].'month');
@ -3622,7 +3622,7 @@ class Form
* @return void
* @see selectDate
*/
public static function formDate($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
{
global $langs;
@ -3635,7 +3635,7 @@ class Form
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
$ret.='<tr><td>';
$ret.=self::selectDate($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname,1,0,1);
$ret.=$this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname,1,0,1);
$ret.='</td>';
$ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret.='</tr></table></form>';
@ -4263,7 +4263,7 @@ class Form
* @return mixed Nothing or string if nooutput is 1
* @see formDate
*/
public static function selectDate($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
{
global $conf,$langs;
@ -5465,7 +5465,7 @@ class Form
* @param string $morehtmlright More html code to show before navigation arrows
* @return string Portion HTML avec ref + boutons nav
*/
public static function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='')
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='')
{
global $langs,$conf;
@ -5531,11 +5531,11 @@ class Form
/**
* Return HTML code to output a barcode
*
* @param object $object Object containing data to retrieve file name
* @param Object $object Object containing data to retrieve file name
* @param int $width Width of photo
* @return string HTML code to output barcode
*/
public static function showbarcode($object, $width = 100)
function showbarcode(&$object,$width=100)
{
global $conf;
@ -5810,7 +5810,7 @@ class Form
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
* @return string
*/
public static function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
{
global $conf, $langs;