forked from Wavyzz/dolibarr
Can set status of a websitepage
This commit is contained in:
@@ -43,9 +43,9 @@ if (!empty($user->socid)) {
|
|||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
/*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
|
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) {
|
|||||||
$triggerkey = 'COMPANY_UPDATE';
|
$triggerkey = 'COMPANY_UPDATE';
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->setValueFrom($field, $value, $element, $id, $user, $triggerkey);
|
$tablename = $element;
|
||||||
|
if ($tablename == 'websitepage') $tablename = 'website_page';
|
||||||
|
|
||||||
|
$format = 'int';
|
||||||
|
|
||||||
|
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8070,7 +8070,10 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if (empty($id) && empty($ref) && empty($morewhere)) return -1;
|
if (empty($id) && empty($ref) && empty($morewhere)) return -1;
|
||||||
|
|
||||||
$sql = 'SELECT '.$this->getFieldList();
|
$fieldlist = $this->getFieldList();
|
||||||
|
if (empty($fieldlist)) return 0;
|
||||||
|
|
||||||
|
$sql = 'SELECT '.$fieldlist;
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
|
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
|
||||||
if (!empty($id)) $sql .= ' WHERE rowid = '.$id;
|
if (!empty($id)) $sql .= ' WHERE rowid = '.$id;
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
|||||||
if ($features == 'mo') $features = 'mrp';
|
if ($features == 'mo') $features = 'mrp';
|
||||||
if ($features == 'member') $features = 'adherent';
|
if ($features == 'member') $features = 'adherent';
|
||||||
if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; };
|
if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; };
|
||||||
|
if ($features == 'websitepage') $features = 'website';
|
||||||
|
|
||||||
// Get more permissions checks from hooks
|
// Get more permissions checks from hooks
|
||||||
$parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select);
|
$parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select);
|
||||||
|
|||||||
@@ -3170,6 +3170,7 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
$pageauthorid = $objectpage->fk_user_creat;
|
$pageauthorid = $objectpage->fk_user_creat;
|
||||||
$pageusermodifid = $objectpage->fk_user_modif;
|
$pageusermodifid = $objectpage->fk_user_modif;
|
||||||
$pageauthoralias = $objectpage->author_alias;
|
$pageauthoralias = $objectpage->author_alias;
|
||||||
|
$pagestatus = $objectpage->status;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3178,6 +3179,7 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
$pageauthorid = $user->id;
|
$pageauthorid = $user->id;
|
||||||
$pageusermodifid = 0;
|
$pageusermodifid = 0;
|
||||||
$pageauthoralias = '';
|
$pageauthoralias = '';
|
||||||
|
$pagestatus = 1;
|
||||||
}
|
}
|
||||||
if (GETPOST('WEBSITE_TITLE', 'alpha')) $pagetitle = GETPOST('WEBSITE_TITLE', 'alpha');
|
if (GETPOST('WEBSITE_TITLE', 'alpha')) $pagetitle = GETPOST('WEBSITE_TITLE', 'alpha');
|
||||||
if (GETPOST('WEBSITE_PAGENAME', 'alpha')) $pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha');
|
if (GETPOST('WEBSITE_PAGENAME', 'alpha')) $pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha');
|
||||||
@@ -3381,6 +3383,16 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
print $doleditor->Create(1, '', true, 'HTML Header', 'html');
|
print $doleditor->Create(1, '', true, 'HTML Header', 'html');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
if ($action != 'createcontainer')
|
||||||
|
{
|
||||||
|
print '<tr><td>';
|
||||||
|
print $langs->trans('Status');
|
||||||
|
print '</td><td>';
|
||||||
|
print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled');
|
||||||
|
//print dol_print_date($pagedatecreation, 'dayhour');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
if ($action == 'createcontainer')
|
if ($action == 'createcontainer')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user