Fix on skeleton

This commit is contained in:
Laurent Destailleur 2016-09-30 23:44:55 +02:00
parent dcb18cd637
commit 057e107d29
2 changed files with 9 additions and 8 deletions

View File

@ -59,7 +59,7 @@ $myparam = GETPOST('myparam','alpha');
$search_field1=GETPOST("search_field1"); $search_field1=GETPOST("search_field1");
$search_field2=GETPOST("search_field2"); $search_field2=GETPOST("search_field2");
if (empty($action) && empty($id) && empty($ref)) $action='list'; if (empty($action) && empty($id) && empty($ref)) $action='view';
// Protection if external user // Protection if external user
if ($user->societe_id > 0) if ($user->societe_id > 0)
@ -300,7 +300,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>'; // print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
// LIST_OF_TD_LABEL_FIELDS_VIEW // LIST_OF_TD_LABEL_FIELDS_VIEW
print '</table>'; print '</table>';

View File

@ -365,6 +365,8 @@ class Skeleton_Class extends CommonObject
} }
} }
// If you need to delete child tables to, you can insert them here
if (!$error) { if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
$sql .= ' WHERE rowid=' . $this->id; $sql .= ' WHERE rowid=' . $this->id;
@ -437,8 +439,7 @@ class Skeleton_Class extends CommonObject
} }
/** /**
* Return a link to the user card (with optionaly the picto) * Return a link to the object card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
* *
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to * @param string $option On what the link point to
@ -461,7 +462,7 @@ class Skeleton_Class extends CommonObject
$label.= '<div width="100%">'; $label.= '<div width="100%">';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; $label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/mymodule/card.php?id='.$this->id.'"'; $link = '<a href="'.DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id.'"';
$link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"'); $link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
$link.= '>'; $link.= '>';
$linkend='</a>'; $linkend='</a>';
@ -487,13 +488,13 @@ class Skeleton_Class extends CommonObject
} }
/** /**
* Renvoi le libelle d'un status donne * Return the status
* *
* @param int $status Id status * @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status * @return string Label of status
*/ */
function LibStatut($status,$mode=0) static function LibStatut($status,$mode=0)
{ {
global $langs; global $langs;