Fix hrm module
This commit is contained in:
parent
f04a3bf0c8
commit
1360372a3c
@ -110,7 +110,8 @@ if ($result)
|
||||
|
||||
$establishmentstatic->id=$obj->rowid;
|
||||
$establishmentstatic->name=$obj->name;
|
||||
|
||||
$establishmentstatic->status=$obj->status;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$establishmentstatic->getNomUrl(1).'</td>';
|
||||
@ -119,7 +120,7 @@ if ($result)
|
||||
print '<td align="left">'.$obj->town.'</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print $establishmenttmp->getLibStatus(5);
|
||||
print $establishmentstatic->getLibStatus(5);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -58,8 +58,8 @@ class Establishment extends CommonObject
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(0 => 'Opened', 1 => 'Closed');
|
||||
$this->statuts = array(0 => 'Opened', 1 => 'Closed');
|
||||
$this->statuts_short = array(0 => 'Closed', 1 => 'Opened');
|
||||
$this->statuts = array(0 => 'Closed', 1 => 'Opened');
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -157,7 +157,7 @@ class Establishment extends CommonObject
|
||||
$sql .= ", address = '".$this->address."'";
|
||||
$sql .= ", zip = '".$this->zip."'";
|
||||
$sql .= ", town = '".$this->town."'";
|
||||
|
||||
$sql .= ", fk_country = ".($this->country_id > 0 ? $this->country_id : 'null');
|
||||
$sql .= ", status = '".$this->status."'";
|
||||
$sql .= ", fk_user_mod = " . $user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
@ -273,23 +273,23 @@ class Establishment extends CommonObject
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]);
|
||||
if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut8').' '.$langs->trans($this->statuts_short[$status]);
|
||||
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts_short[$status]);
|
||||
if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4');
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut8');
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5');
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]);
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut8').' '.$langs->trans($this->statuts[$status]);
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts[$status]);
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4');
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut8');
|
||||
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5');
|
||||
if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,8 +40,8 @@ $id = GETPOST('id','int');
|
||||
|
||||
// List of status
|
||||
static $tmpstatus2label=array(
|
||||
'0'=>'OpenEtablishment',
|
||||
'1'=>'CloseEtablishment'
|
||||
'0'=>'CloseEtablishment',
|
||||
'1'=>'OpenEtablishment'
|
||||
);
|
||||
$status2label=array('');
|
||||
foreach ($tmpstatus2label as $key => $val) $status2label[$key]=$langs->trans($val);
|
||||
@ -138,7 +138,7 @@ else if ($action == 'update')
|
||||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
$object->town = GETPOST('town', 'alpha');
|
||||
$object->country_id = $_POST["country_id"];
|
||||
$object->country_id = GETPOST('country_id', 'int');
|
||||
$object->fk_user_mod = $user->id;
|
||||
|
||||
$result = $object->update($user);
|
||||
@ -378,7 +378,8 @@ else if ($id)
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'.$object->getLibStatus(4).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
|
||||
print $object->getLibStatus(4).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user