Dolibarize code
This commit is contained in:
parent
0b57faa7b4
commit
35419fa206
@ -147,8 +147,6 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*
|
|
||||||
* Put here all code to do according to value of "$action" parameter
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||||
@ -192,8 +190,6 @@ if (empty($reshook))
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*
|
|
||||||
* Put here all code to render page
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
@ -402,11 +398,11 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
@ -428,11 +424,14 @@ print '</tr>'."\n";
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
|
{
|
||||||
|
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
@ -475,14 +474,18 @@ while ($i < min($num, $limit))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
if ($align) print ' class="'.$align.'"';
|
if ($cssforfield || $val['css']) print ' class="';
|
||||||
|
print $cssforfield;
|
||||||
|
if ($cssforfield && $val['css']) print ' ';
|
||||||
|
print $val['css'];
|
||||||
|
if ($cssforfield || $val['css']) print '"';
|
||||||
print '>';
|
print '>';
|
||||||
print $object->showOutputField($val, $key, $obj->$key, '');
|
print $object->showOutputField($val, $key, $obj->$key, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -180,9 +180,9 @@ class Ticket extends CommonObject
|
|||||||
public $fields=array(
|
public $fields=array(
|
||||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'position'=>1, 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id"),
|
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'position'=>1, 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id"),
|
||||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1),
|
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1),
|
||||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'aaa'),
|
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''),
|
||||||
'track_id' => array('type'=>'varchar(255)', 'label'=>'TrackID', 'visible'=>0, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"),
|
'track_id' => array('type'=>'varchar(255)', 'label'=>'TrackID', 'visible'=>0, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"),
|
||||||
'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1),
|
'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'nowraponall'),
|
||||||
'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"),
|
'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"),
|
||||||
'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>""),
|
'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>""),
|
||||||
'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'),
|
'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'),
|
||||||
|
|||||||
@ -38,7 +38,7 @@ $langs->loadLangs(array("ticket","companies","other","projects"));
|
|||||||
|
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
$action = GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||||
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
|
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
|
||||||
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
|
$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
|
||||||
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
|
$confirm = GETPOST('confirm','alpha'); // Result of a confirmation
|
||||||
@ -62,7 +62,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
|||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
$sortorder = GETPOST('sortorder','alpha');
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
$page = GETPOST('page','int');
|
$page = GETPOST('page','int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -74,7 +74,6 @@ $diroutputmassaction=$conf->ticket->dir_output . '/temp/massgeneration/'.$user->
|
|||||||
if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket'));
|
if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket'));
|
||||||
elseif ($project > 0) $hookmanager->initHooks(array('projectticket'));
|
elseif ($project > 0) $hookmanager->initHooks(array('projectticket'));
|
||||||
else $hookmanager->initHooks(array('ticketlist'));
|
else $hookmanager->initHooks(array('ticketlist'));
|
||||||
|
|
||||||
// Fetch optionals attributes and labels
|
// Fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('ticket');
|
$extralabels = $extrafields->fetch_name_optionals_label('ticket');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
|
||||||
@ -186,7 +185,7 @@ $user_assign = new User($db);
|
|||||||
$user_create = new User($db);
|
$user_create = new User($db);
|
||||||
$socstatic = new Societe($db);
|
$socstatic = new Societe($db);
|
||||||
|
|
||||||
$help_url = 'FR:DocumentationModuleTicket';
|
$help_url = '';
|
||||||
$title = $langs->trans('TicketList');
|
$title = $langs->trans('TicketList');
|
||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
@ -435,7 +434,7 @@ $arrayofmassactions = array(
|
|||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->ticket->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
if ($user->rights->ticket->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -518,30 +517,30 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked'])) {
|
if (! empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
if ($key == 'type_code') {
|
if ($key == 'type_code') {
|
||||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
||||||
$formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
$formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($key == 'category_code') {
|
} elseif ($key == 'category_code') {
|
||||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
||||||
$formTicket->selectCategoriesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
$formTicket->selectCategoriesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($key == 'severity_code') {
|
} elseif ($key == 'severity_code') {
|
||||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
||||||
$formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
$formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, ($val['css']?$val['css']:'maxwidth200'));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($key == 'fk_statut') {
|
} elseif ($key == 'fk_statut') {
|
||||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
||||||
$object->printSelectStatus(dol_escape_htmltag($search[$key]));
|
$object->printSelectStatus(dol_escape_htmltag($search[$key]));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -565,11 +564,14 @@ print '</tr>'."\n";
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
|
{
|
||||||
|
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
@ -612,14 +614,18 @@ while ($i < min($num, $limit))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
$align='';
|
$cssforfield='';
|
||||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td';
|
print '<td';
|
||||||
if ($align) print ' class="'.$align.'"';
|
if ($cssforfield || $val['css']) print ' class="';
|
||||||
|
print $cssforfield;
|
||||||
|
if ($cssforfield && $val['css']) print ' ';
|
||||||
|
print $val['css'];
|
||||||
|
if ($cssforfield || $val['css']) print '"';
|
||||||
print '>';
|
print '>';
|
||||||
print $object->showOutputField($val, $key, $obj->$key, '');
|
print $object->showOutputField($val, $key, $obj->$key, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user